Commit dc243dbf authored by ziyu's avatar ziyu

feat: 解决加载

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