为什么HTML 5 Audio会忽略移动设备音频设置,例如静音或音量? [英] Why does HTML 5 Audio disregards mobile device audio settings such as silent or volume?

查看:108
本文介绍了为什么HTML 5 Audio会忽略移动设备音频设置,例如静音或音量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个针对移动Android用户的网站。我正在使用HTML5音频播放背景音乐。

I have a site that targets mobile android users. I’m using the HTML5 audio to play background music.

即使设备处于静音状态,也会播放音频;无论设备音量设置如何,音频都以最高音量播放。

The audio is played even if the device is on silent; also the audio is played in the highest volume regardless of the device volume settings.

有谁知道为什么会发生这些事情或者如何获得设备当前的音频设置?
我更喜欢客户端(javascript)解决方案,但我对所有解决方案都持开放态度。

Does anyone know why these things happen or how to get the device current audio settings? I’d prefer a client side (javascript) solution but I’m open to all solution.

感谢您的帮助
Moshe S 。

Thank you for your help Moshe S.

推荐答案

在Android中,即使手机处于静音状态,媒体音量也不会改变。

In Android, even if the phone is on silent, the media volume will not change.

我不确定android是否允许通过浏览器修改系统声音设置,因为默认设置没有更改/读取音量状态的权限。

I'm not sure if android allows for the modification of the system sound settings through the browser, since the default one does not have permission to change/read the volume state.

这篇关于为什么HTML 5 Audio会忽略移动设备音频设置,例如静音或音量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆