炒股就看金麒麟分析师研报,权威,专业,及时,全面,助您挖掘潜力主题机会!
快科技6月4日消息,现如今大部分浏览器在访问网站时,页面视频即便自动播放也会以静音状态播放,避免在不合适的场合发出声音造成尴尬。
但如果网站使用iframe框架嵌套音视频,浏览器可能就无法正常将其静音播放,近日微软工程师向Chromium项目提交了一项代码改进,可以减少意外的音视频播放问题。
根据微软的提案,新的权限策略名为"media-playback-while-not-visible",即"在不可见时暂停媒体播放"。
该策略允许网页开发者通过API控制嵌入的音视频内容,当相关的iframe不可见时,自动暂停媒体播放,只有当iframe重新显示时才恢复播放。
微软在提案中指出,当前开发者虽然有一些解决意外播放问题的方法,但这些方法往往会导致性能和用户体验问题。
例如,开发者可能会通过完全卸载和重新加载iframe来停止播放,但这会增加页面的加载时间和资源消耗。
微软的新策略提供了一种更高效、更优雅的解决方案,通过浏览器自身的机制来控制不可见媒体的播放,从而减少意外播放的发生。
这一改进将提升用户在使用Chromium内核浏览器(如Chrome和Edge等)时的浏览体验,减少意外播放带来的干扰。
值得注意的是,这一新的权限策略目前尚未默认启用,仍处于实验阶段,微软希望开发者能够积极参与测试,并提供反馈,以便进一步完善该策略。
Disclaimer: Investing carries risk. This is not financial advice. The above content should not be regarded as an offer, recommendation, or solicitation on acquiring or disposing of any financial products, any associated discussions, comments, or posts by author or other users should not be considered as such either. It is solely for general information purpose only, which does not consider your own investment objectives, financial situations or needs. TTM assumes no responsibility or warranty for the accuracy and completeness of the information, investors should do their own research and may seek professional advice before investing.