이 글에서는 HTML5 영상의 현재 재생 시간(코드)을 실시간으로 모니터링하는 방법을 소개합니다. 도움이 필요한 친구들에게 도움이 되길 바랍니다. .
html:
1 2 3 4 | <video id= "video" controls autoplay= "autoplay" muted>
<source src= "" type= "video/mp4" />
Your browser does not support the video tag.
</video>
|
로그인 후 복사
js:
1 2 3 4 5 6 7 8 9 10 11 12 13 | var video = document.getElementById('video');
video.addEventListener( "timeupdate" , function (){
var timeDisplay;
timeDisplay = Math. floor (video.currentTime);
console.log(Math. floor (video.currentTime))
if (timeDisplay == 4){
}
},false);
|
로그인 후 복사
추천 관련 기사:
html5 오디오( 오디오 분석)
html5의 비디오(비디오) 요소 분석
위 내용은 HTML5 비디오에서 현재 재생 시간의 실시간 모니터링을 구현하는 방법(코드)의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!