小程序實時獲取最新進度時長


源: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