admin管理员组文章数量:1287591
Is there a way to programmatic-ally control audio level on tabs i want to regardless of how web app was designed (be it HTML5 Audio element or Flash, etc.)?
Just to make it clear i don't intend to research web page for some "id" "elements" or whatsoever, but something like Chrome.ThisAudioOutputLevels...?
Is there a way to programmatic-ally control audio level on tabs i want to regardless of how web app was designed (be it HTML5 Audio element or Flash, etc.)?
Just to make it clear i don't intend to research web page for some "id" "elements" or whatsoever, but something like Chrome.ThisAudioOutputLevels...?
Share Improve this question asked Jul 26, 2015 at 17:16 user963720user9637202 Answers
Reset to default 8Admitting that the audio es from a <audio>
HTML element, you can try to get all audio elements from the DOM and lower their volumes. I was suffering from this with google hangouts meetings where I couldn't lower the audio because it had no control whatsoever.
"The solution"
I selected all <audio>
elements and lowered their volumes. Follow these steps:
- Open your console on the given tab. (Press F12).
- Select all audio elements.
- Lower each audio volume.
let audios = [...document.getElementsByTagName('audio')];
audios.forEach(audio => audio.volume = 0.5) // lower volume 50%.
Volume range = {0..1} where 0 = no volume.
This is more of a ment than an answer, but I can't ment, so:
Browsers generally try not to change how the content is meant to be displayed, including sound. For this reason, I would be surprised if there were such a feature.
If you're trying to simply mute tabs, you could take a look at chrome://flags/#enable-tab-audio-muting
Alternatively you could use tampermonkey or a similar extension and run a search for all audio/video tags and change the volume, but you said you didn't want to search for specific elements. To my knowledge (and Google's) as of right now there is no volume control for an entire page.
本文标签: Javascript control Google Chrome39s open tab audio volume controlStack Overflow
版权声明:本文标题:Javascript: control Google Chrome's open tab audio volume control - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741276726a2369772.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论