解决新版本 Chrome 提示 DOMException: The play() request was interrupted 解决新版本 Chrome 提示 DOMException: The play() request was interrupted 大概在一些新版本的浏览器中,我们是用 audio 或者 video 进行媒体资源播放的时候,可能会在控制台看到这个输出: Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause(). Or Uncaught (in promise) DOMException: The play() request was interrupted by a new load request. 如何触发? < 详情 »
前些天 Apple 正式向用户推送了他们的新一代 Mac OS MacOS High Sierra 。这次带来了新的 Safari 浏览器,然而一个不好的消息,是 safari 重新制定了新的限播策略。点击这里 了解上个版本的播放限制策略调整。 现在网页用包含 video 或者 audio 的标签,如果涉及了 autoplay 属性,浏览器现在不再进行自动播放,而用户需要在 url 的状态栏进行设置(右击就好): 里面会有三个选项: 允许自动播放 永不自动播放 停止播放含有声音的媒体 官方也给了建议,你可以通过代码来监听是否自动播放: var promise = document.querySelector('video').play(); if (promise !== undefined) { promise.catch(error => { // Auto-play was prevented // Show a UI element 详情 »
Last year, I have tried to finish an interesting react-native project on my GitHub. React-native-percentage-circle is a component which supports you to define your percent data and draw a circle. And also you can use it as a progress bar and show some data in the circle. It does make a difference to my life. Opearation 详情 »