javascript – 音量关闭在html5视频ipad 2中不起作用

javascript – 音量关闭在html5视频ipad 2中不起作用,第1张

概述音量关闭在 html5视频ipad 2中不起作用. player = document.getElementById(element_id);if (player.muted){ player.muted = false; player.volume = 1; //player.volume(1);}else{ player.muted = true; 音量关闭在 html5视频ipad 2中不起作用.

player = document.getElementByID(element_ID);if (player.muted){    player.muted = false;    player.volume = 1;    //player.volume(1);}else{    player.muted = true;    player.volume = 0;    //player.volume(0);}
解决方法 我担心iOS不允许使用JavaScript更改音量.来自Apple的 documentation(重点是我的):

On the desktop,you can set and read the volume property of an or element. This allows you to set the element’s audio volume relative to the computer’s current volume setting. A value of 1 plays sound at the normal level. A value of 0 silences the audio. Values between 0 and 1 attenuate the audio.

This volume adjustment can be useful,because it allows the user to mute a game,for example,while still Listening to music on the computer.

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.

没有提到静音属性,但实验表明它也无法改变:
http://jsbin.com/anikab/1/

总结

以上是内存溢出为你收集整理的javascript – 音量关闭在html5视频ipad 2中不起作用全部内容,希望文章能够帮你解决javascript – 音量关闭在html5视频ipad 2中不起作用所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1081308.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存