我目前正在开发一个 HTML5 视频播放器,它可以在除 iPad 之外的任何地方正常运行。
基本上,我可以控制一切,除了声音,我有一个 mute
按钮,它在 Google Chrome、Firefox 3.6 和 Mac OS 上的 Safari 上工作正常,但在 iPad 上无论我输入什么值video.volume
,没有发生任何变化。
有人让它正常工作吗?
这是我的 HTML 代码:
<video src="video_url" width="608" height="476" autobuffer="autobuffer" id="html5-player" preload>
Your browser doesn't support HTML5.
</video
这是 Javascript:
var muted = false;
$j('.player-mute').click(function(){
if(muted) {
videoPlayer.volume = 1;
muted = false;
} else {
videoPlayer.volume = 0;
muted = true;
}
});
最佳答案
根据Apple's documentation,iOS 设备上的volume
属性是只读 :
On iOS devices, the audio level is always under the user’s physical control. The volume property is not settable in JavaScript. Reading the volume property always returns 1.
关于ios - HTML5 视频量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2602541/