【发布时间】:2018-03-17 06:12:48
【问题描述】:
<video id='myVideo' controls autoplay>
<source src='a.mp4#t=00:00:00' type=video/mp4>
</video>
如何在不使用任何外部软件的情况下,在php中获取html5视频的观看时间并存储到php变量中?
【问题讨论】:
标签: javascript php html html5-video
<video id='myVideo' controls autoplay>
<source src='a.mp4#t=00:00:00' type=video/mp4>
</video>
如何在不使用任何外部软件的情况下,在php中获取html5视频的观看时间并存储到php变量中?
【问题讨论】:
标签: javascript php html html5-video
如果我收到您的问题,您想知道视频开始后经过的时间。这是解决方案
$(document).ready(function(){
$("#myvideo").on(
"timeupdate",
function(event){
onTrackedVideoFrame(this.currentTime, this.duration);
});
});
function onTrackedVideoFrame(currentTime, duration){
/* Here you can get both currentTIme and duration */
}
【讨论】: