当我的HTML5视频播放器到达某个特定时间时,我希望能够显示一个div。我已经成功让一个div在视频结束时显示,但我不知道如何在视频播放到特定时间(例如0:06)时显示div。
<div id = "showdiv" style="display:none" align="center">
this is the message that will pop up.
</div>
<video id='myVideo' align="center" margin-top="100px" class='video-js
vjs-default-skin' preload='auto' data-setup='{}' width='800' height='446'>
<source src='myVideo.mp4' type='video/mp4'l></source>
<script>
document.getElementById('myVideo').addEventListener('ended',myHandler,false);
function myHandler(e) {
if(!e) { e = window.event; }
$("#showdiv").toggle("slow");
}
</script>
h*60*60 + m*60 + s
。 - Yury Tarabanko