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


源: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))
    },

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM