Commit 3eef7a58 authored by jyx's avatar jyx

new

parent 03df497e
...@@ -129,12 +129,16 @@ ...@@ -129,12 +129,16 @@
this.isFirstLoad = false this.isFirstLoad = false
this.queryList() this.queryList()
} else { } else {
this.videoContext?.play() tt.createVideoContext('' + this.originList[originIndex].vedioIndex, this).play();
// this.videoContext?.play()
} }
}, },
stop() { stop() {
// audo.pause() // audo.pause()
this.videoContext?.pause() // this.videoContext?.pause()
tt.createVideoContext('' + this.originList[originIndex].vedioIndex, this).pause();
}, },
queryList() { queryList() {
// 推荐 // 推荐
...@@ -156,32 +160,32 @@ ...@@ -156,32 +160,32 @@
if (this.controls) return if (this.controls) return
this.isqp = true this.isqp = true
this.controls = true this.controls = true
}, },
startPlay() { startPlay() {
if (tt.canIUse('preloadResourceVideo')) { if (tt.canIUse('preloadResourceVideo')) {
this.preloadplaylet() this.preloadplaylet()
} }
}, },
preloadplaylet() { preloadplaylet() {
var preIndex = 0 var preIndex = 0
if (this.displayIndex < 2) { if (this.displayIndex < 2) {
preIndex = this.displayIndex + 1 preIndex = this.displayIndex + 1
} else { } else {
preIndex = 0 preIndex = 0
} }
// 抖音预加载 // 抖音预加载
tt.preloadResourceVideo({ tt.preloadResourceVideo({
albumId: this.displaySwiperList[preIndex].douyinAlbumId, albumId: this.displaySwiperList[preIndex].douyinAlbumId,
episodeId: this.displaySwiperList[preIndex].douyinEpisodeId, episodeId: this.displaySwiperList[preIndex].douyinEpisodeId,
cloudType: 1, cloudType: 1,
version: 1, version: 1,
success: () => { success: () => {
console.log("短剧预加载成功" + this.displaySwiperList[preIndex].douyinEpisodeId); console.log("短剧预加载成功" + this.displaySwiperList[preIndex].douyinEpisodeId);
}, },
fail: (error) => { fail: (error) => {
console.log("短剧预加载失败", error); console.log("短剧预加载失败", error);
}, },
}); });
}, },
ended() { ended() {
// 1.播放当前视频结束时触发,自动切换下一个视频 // 1.播放当前视频结束时触发,自动切换下一个视频
...@@ -221,13 +225,19 @@ ...@@ -221,13 +225,19 @@
} }
console.log('++++++++++++上一条播放数据 Index:', this.oid) console.log('++++++++++++上一条播放数据 Index:', this.oid)
// audo.pause() // audo.pause()
this.videoContext = uni.createVideoContext("" + this.originList[this.oid].vedioId, this) // this.videoContext = uni.createVideoContext("" + this.originList[this.oid].vedioId, this)
this.videoContext.pause() // this.videoContext.pause()
this.videoContext.stop() // this.videoContext.stop()
tt.createVideoContext('' + this.originList[this.oid].vedioIndex, this).pause();
setTimeout(() => { setTimeout(() => {
console.log('qqqqqq:', this.originList[originIndex].vedioId) console.log('qqqqqq:', this.originList[originIndex].vedioId)
this.videoContext = uni.createVideoContext("" + this.originList[originIndex].vedioId, this) // this.videoContext = uni.createVideoContext("" + this.originList[originIndex].vedioId, this)
this.videoContext.play() // this.videoContext.play()
tt.createVideoContext('' + this.originList[originIndex].vedioIndex, this).play();
}, 500) }, 500)
var pCount = this.originList.length - this.playCount var pCount = this.originList.length - this.playCount
if (originIndex == pCount) { if (originIndex == pCount) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment