网上的在线视频,播放窗口失去焦点即暂停播放,有什么解决方法吗?

文章正文
发布时间:2025-08-03 17:22

哪位高人能帮助解决一下这个问题,这样的网页有。
今年的继续教育——低碳经济,就是这样的网页,如果当前正在观看,突然有别的窗口弹出,视频会立即暂停播放,只有重获焦点后参会继续播放。不过有的弹出窗口例外,比如 金山毒霸的优盘扫描提示等,就不会让当前网页失去焦点......
源文件代码如下:

<html>
<head>

<style>

body{ margin:0px; padding:0px;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type='text/javascript' src='../resource/mtmcode.js'></script>
<link href="/chinahrt/resource/style/common/ymPrompt.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/chinahrt/resource/js/ymPrompt.js"></script>



<title>低碳经济</title>





<script type="text/javascript">
function init()
{
API = this.document.APIAdapter;
}

</script>
<script language="JavaScript" type="text/javascript">
function pauseDialog(){

if(this.document.hasFocus()){
window.showModelessDialog("/chinahrt/hrt/course/scorm/course_player/showMessage.html","提示信息","dialogWidth:469px;dialogHeight:194px;scroll:no;status:no");
//ymPrompt.alert({title:'温馨提示',message:'您的学习已持续2分钟,要继续学习吗?'});
//ymPrompt.win({message:'/chinahrt/hrt/course/scorm/course_player/showMessage.html',width:500,height:300,title:'温馨提示',iframe:true});
}

}
function ff(){
alert();
}




</script>

</head>

<body>
<span id="tt"></span>

<iframe id="playFram" name="playFram" src=":80/chinahrt/hrt/course/scorm/course_player/api.jsp?url=/chinahrt/data/course/12c3da7a120658bf7fc1c8e492692800/2011-10-25/C1319519464572/sco0100.htm&userId=133fe8915a61689ffcdadaf429896df9&courseNumber=C1319519464572&scoId=0100&sessionId=1329529413327" height="100%" width="100%" scrolling="no" marginheight="0" frameborder="0" >
</iframe>
<!--
<script>window.setInterval(pauseDialog,1000*60);</script>
-->
<!--
<script>window.setInterval(pauseDialog,1000*60*30);</script>
-->


</body>
</html>

首页
评论
分享
Top