ios - HTML5 视频量

标签 ios ipad html video

我目前正在开发一个 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/

相关文章:

html - div 扩展到 HTML 和 body 之外

ios - 无法在发布架构中运行 iOS React Native 应用程序

ios - 如果可用,请在 Facebook 应用程序中打开链接

android - 小米滑板车通信代码

ios - 当支持横向时强制 iPad 应用程序以纵向启动

iOS 模拟器不为 iPhone 旋转(适用于 iPad)

iphone - 展开和折叠 UITableview

html - 带有 Bootstrap 的 map 和固定侧边栏

html - 背景幻灯片放映 Safari

iphone - 在后台线程上准备 View 元素