方法:{ // ビデオの長さの更新 timeupdate(E){ はconsole.log(E) のlet DURATION = e.detail.duration せCURRENTTIME = e.detail.currentTime にconsole.log(DURATION) はconsole.log(CURRENTTIME) IF(CURRENTTIME > DURATION - 2.925 ){ // ビデオ停止 wx.createVideoContext(この .data.indexCurrent、この).stop() // ビデオ一時停止 // wx.createVideoContext(this.data.indexCurrentを、この).pause() コンソール。ログ( "中断さ" ) } } }
wxml
< ビデオbindtimeupdate = "timeupdate" bindtap = "video_play" ID = "{{item.sid}}" ポスター= "{{item.thumbnail}}" 自動ポーズIF-オープンネイティブWX:ELIF = "{{ item.type == 'ビデオ'}}」SRC = "{{item.images}}" SRC = "{{item.video}}" > </ ビデオ>