(video、audio)关于 Uncaught (in promise) DOMException: The play() request was interrupted by a call to
2018-05-30 14:46
549 查看
连续点击播放按钮的报错问题:
解决思路:获取两次点击的时间差,如果大于100ms就return,直接退出
//-------------播放视频
var videoPlayer = document.getElementById("videoCon");var lastRunTime = Date.now();
var currentTime = Date.now();
var protectTime = 100;//设置保护性延时 单位毫秒,不要小于50 建议100以上
if((currentTime - lastRunTime) < protectTime){
return;//两次执行太过频繁,直接退出
}
if(videoPlayer.paused){
videoPlayer.play();
}else{
videoPlayer.pause();
}
lastRunTime=Date.now(); 阅读更多
相关文章推荐
- 关于 Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause() 错误
- DOMException: The play() request was interrupted by a call to pause().
- The play() request was interrupted by a call to pause()
- The play() request was interrupted by a call to pause()
- How to see the Physical SQL generated by a request in Presentation Service ?
- The request was denied by service delegate (SBMainWorkspace) for reason: Security ("Entitlement "com.apple.frontboard.debugapplications" required to launch applications for debugging").
- 关于dubbo调度时出现Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method insertTestTb in the service cn.cuibusi.core.service.TestTbService.的解决办法
- spring mvc 数据绑定问题 提交表单提示HTTP status 400, The request sent by the client was syntactically incorrect
- jenkins===当postman出现错误403 No valid crumb was included in the request的解决办法
- 异常处理Spring MVC "The request sent by the client was syntactically incorrect ()"
- 关于error:Cannot assign to 'self' outside of a method in the init family
- 关于Tomcat的 The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found o
- 服务器,tomcat,网页请求错误400,The request sent by the client was syntactically incorrect的问题
- Spring MVC "The request sent by the client was syntactically incorrect ()"解决办法
- WCF分布式开发常见错误解决(12):The server was unable to process the request,服务无法处理请求
- How to generate DLL files by GCC in the MinGW?
- 错误The request sent by the client was syntactically incorrect ()的解决
- 关于error:Cannot assign to 'self' outside of a method in the init family
- Spring MVC报错:The request sent by the client was syntactically incorrect ()
- MyEclipse Tern was unable to complete your request in time