简体   繁体   English

HTML5音频标签在iOS7设备上不起作用

[英]Html5 audio tag doesn't work on iOS7 devices

I am working on an application in which we used html5 audio control. 我正在使用html5音频控件的应用程序上工作。 It was pretty good and working fine in iPad and iPhone with iOS6. 这非常好,并且可以在带有iOS6的iPad和iPhone中正常工作。 After upgrading to the iOS7, the seekbar doesn't show up. 升级到iOS7后,搜索栏不会显示。 There is only one play button without any volume bar. 只有一个播放按钮,没有任何音量条。 Is there any one who is also facing the similar issue. 是否有人也面临类似的问题。

<audio src='mymp3file.mp3' controls></audio>

This code works for iOS7 also: 此代码也适用于iOS7:

<style>
audio { width: 500px; display: block; margin:20px; }
</style>

<audio src='mymp3file.mp3' controls></audio>

It's possible, that there are some default-css-properties, which have been changed in iOS7. 可能有一些default-css-properties,在iOS7中已更改。 This can lead to "invisible controls". 这可能导致“隐形控件”。

I found a similar question (+answer) here: github.com/senchalabs/jQTouch/issues/499 我在这里找到了类似的问题(+ answer):github.com/senchalabs/jQTouch/issues/499

Just set the width and display -attributes to appropiate values, and check if the controls are visible afterwards 只需设置widthdisplay属性即可得出适当的值,然后检查控件是否可见

I'm using ios 8 on my iphone and had to set height:100px; 我在iPhone上使用的是ios 8,必须设置height:100px; for the play arrow to show fully. 使播放箭头充分显示。 Must be some bug in iOS 8 on the iphone. 必须是iPhone 8上的iOS 8中的一些错误。 The control was displaying fine on iPad but on iPhone only showed 1/2 the height of the play arrow. 控件在iPad上显示正常,但在iPhone上仅显示播放箭头高度的1/2。 I also note that just hitting 'refresh' on the page after making the change was not reliable. 我还注意到,进行更改后仅点击页面上的“刷新”是不可靠的。 I had to close out the page and go back to it for the change to take affect. 为了使更改生效,我不得不关闭页面并返回到页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM