gemer cheung 4 سال پیش
والد
کامیت
41930651eb
2فایلهای تغییر یافته به همراه17 افزوده شده و 34 حذف شده
  1. 6 11
      components/video-swiper/index.js
  2. 11 23
      pages/index/index.js

+ 6 - 11
components/video-swiper/index.js

@@ -89,7 +89,8 @@ Component({
         _change,
         curQueue,
         prevQueue,
-        nextQueue
+        nextQueue,
+        _dataIdx
       } = this.data
 
       const current = e.detail.current
@@ -132,7 +133,7 @@ Component({
 
       let circular = true
 
-      // if (nextQueue.length === 0 && current !== 0) {
+      // if (_dataIdx === 0) {
       //   circular = false
       // }
 
@@ -189,12 +190,6 @@ Component({
       curQueue[pre] = preV
       curQueue[next] = nextV
       curQueue[current] = curVideo
-
-
-      console.log('preV', preV)
-      console.log('curVideo', curVideo)
-      console.log('nextV', nextV)
-      console.log('curQueue', curQueue)
     },
     /**
      * 指定视频播放 
@@ -238,9 +233,9 @@ Component({
         playing: true,
         playerIdx: current
       }, () => {
-        // this.data._videoContexts.forEach((ctx, index) => {
-        //   index !== current ? ctx.seek(0) : null
-        // })
+        this.data._videoContexts.forEach((ctx, index) => {
+          index !== current ? ctx.seek(0) : null
+        })
       })
       //  // 重置所有视频pause时重置时间
       //  setTimeout(() => {

+ 11 - 23
pages/index/index.js

@@ -12,28 +12,16 @@ const urls = [
   'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
   'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
   'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/3.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/4.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/5.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/1.MP4',
-  // 'https://4dkk2.4dage.com/swipe-video-test/2.MP4',
+  'https://4dkk2.4dage.com/swipe-video-test/6.MP4',
+  'https://4dkk2.4dage.com/swipe-video-test/7.MP4',
+  'https://4dkk2.4dage.com/swipe-video-test/8.MP4',
+  'https://4dkk2.4dage.com/swipe-video-test/9.MP4',
+  'https://4dkk2.4dage.com/swipe-video-test/10.MP4',
+  'https://4dkk2.4dage.com/swipe-video-test/11.MP4',
+  'https://4dkk2.4dage.com/swipe-video-test/12.MP4',
+  'https://4dkk2.4dage.com/swipe-video-test/13.MP4',
+  'https://4dkk2.4dage.com/swipe-video-test/14.MP4',
+
 ]
 
 const videoList = urls.map((url, index) => ({
@@ -49,7 +37,7 @@ Page({
     videoList,
     targetPlayIndex: -1
   },
-  
+
   onLoad() {
     // setTimeout(() => {
     //   this.setData({