小程序获取视频播放的长度

<view class="section tc">
<video id="myVideo" bindtimeupdate="bc" danmu-list src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400" poster="/pages/images/test-1.png" danmu-list="{{danmuList}}" enable-danmu danmu-btn controls></video>
</view>
 
bc(e){
let time = e.detail.currentTime;
let n = Math.floor(time);
if(n == 5){
console.log('可以 你这用户不错');
}
},
 
原文地址:https://www.cnblogs.com/xm666/p/11355538.html