【问题标题】:Need to set the volume of the <audio> to zero or just want to mute it for the mobile android chrome and for safari for ios需要将 <audio> 的音量设置为零或只是想为移动 android chrome 和 ios 的 safari 静音
【发布时间】:2013-11-04 10:06:10
【问题描述】:

我想将音频标签音量设置为零或使用jQuery 将其设为静音。 muted 属性适用于桌面 chrome,但是当我在 android chrome 版本中尝试此操作时,它不起作用。我的代码如下:

song = document.getElementById('audio');
song.volume = 0.0; 

我也试过了

song.muted = true; 

但是对于移动 android 和 ios 没有任何效果。 请帮我解决这个问题。

【问题讨论】:

    标签: javascript android jquery ios


    【解决方案1】:

    移动设备,尤其是 Apple 设备,不允许您设置元素的音量。这个想法是设备的音量控件应该控制项目的音量。

    【讨论】:

      猜你喜欢
      • 2020-02-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-28
      • 1970-01-01
      • 1970-01-01
      • 2021-11-15
      相关资源
      最近更新 更多