Commit dc243dbf authored by ziyu's avatar ziyu

feat: 解决加载

parent 78d18fac
...@@ -16,13 +16,9 @@ function getClass (status) { ...@@ -16,13 +16,9 @@ function getClass (status) {
console.log(status) console.log(status)
return cls[index] return cls[index]
}; };
function showVideo(item,current,index,loadMedia) { function showVideo(item,current,index) {
if(item.showType && item.showType.value ==2) { if(item.showType && item.showType.value ==2) {
if(loadMedia.indexOf(index) !== -1) {
return true
}
if(current === index) { if(current === index) {
loadMedia.push(index);
return true return true
} else { } else {
return false; return false;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
height:100%; height:100%;
width:100%; width:100%;
position: absolute; position: absolute;
background-color: #000;
z-index: 1; z-index: 1;
} }
...@@ -86,7 +87,7 @@ ...@@ -86,7 +87,7 @@
show-center-play-btn="{{false}}" show-center-play-btn="{{false}}"
enable-progress-gesture="{{false}}" enable-progress-gesture="{{false}}"
controls="{{false}}" controls="{{false}}"
src="{{video.showVideo(item,currentIndex,idx,loadMedia)?item.videoUrl:null}}" src="{{video.showVideo(item,currentIndex,idx)?item.videoUrl:null}}"
data-id="{{item.id}}" data-id="{{item.id}}"
data-index="{{idx}}" data-index="{{idx}}"
binderror="onError" binderror="onError"
...@@ -135,7 +136,6 @@ ...@@ -135,7 +136,6 @@
pause: false, pause: false,
curQueue: [], curQueue: [],
currentIndex:0, currentIndex:0,
loadMedia:[],
}, },
watch: { watch: {
videoList () { videoList () {
...@@ -233,9 +233,8 @@ ...@@ -233,9 +233,8 @@
if (index !== current) { if (index !== current) {
ctx && ctx.pause(); ctx && ctx.pause();
} else { } else {
this.loadMedia.push(index);
//将视频重置到最开始的位置并播放 //将视频重置到最开始的位置并播放
ctx && ctx.seek(0); // ctx && ctx.seek(0);
ctx && ctx.play(); ctx && ctx.play();
} }
}); });
......
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