小程序实时获取最新进度时长

源:https://blog.csdn.net/w6718189/article/details/87623129

微信小程序文档:https://developers.weixin.qq.com/miniprogram/dev/component/video.html

微信小程序获取音频时长和实时获取播放进度

通过 bindtimeupdate 可以获取播放进度变化时触发

		<video
		 bindtimeupdate="timeupdate"
		 id="myVideo"
		 class="video"
		 src="{{ video.filePath }}"
		 controls
		 duration="{{ video.duration }}"
		 title="{{ video.title }}"
		 poster="{{ video.imageUrl }}"
		 autoplay="false"
		/>

  

    timeupdate(res){
        console.log('bindtimeupdate', parseInt(res.detail.currentTime), '时间总时长-->', parseInt(res.detail.duration))
    },

  

posted @ 2020-08-06 14:51  kpengfang  阅读(816)  评论(0编辑  收藏  举报