简体   繁体   English

HTML5 音频标签音量控制不起作用

[英]HTML5 Audio Tag Volume control is Not working

I'm using a HTML5 audio tag to play the audio from the internet.我正在使用 HTML5 音频标签来播放来自互联网的音频。

It's perfectly working on PC browsers and Android browsers.它在 PC 浏览器和 Android 浏览器上完美运行。

IN IOS mobile browsers Volume control is not working,在 IOS 移动浏览器中音量控制不起作用,

Is there a workaround to correct this?是否有解决方法来纠正这个问题?

<audio #audioplayer [src]="audioUrl"></audio>

Different browsers supports a little different sets of media formats.不同的浏览器支持不同的媒体格式集。 It's possible, that iOS's browser don't support your audio format.有可能是 iOS 的浏览器不支持您的音频格式。

To add volume change support to iOS and not rewrite your entire app from html5 audio to web audio for that, you can combine these audio solutions via createMediaElementSource.要为 iOS 添加音量更改支持而不是将整个应用程序从 html5 音频重写为网络音频,您可以通过 createMediaElementSource 组合这些音频解决方案。

Please see more details at Mozilla website https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaElementSource请在 Mozilla 网站上查看更多详细信息https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaElementSource

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM