Pārlūkot izejas kodu

等视频帧全部加载完成后再开始播放

任一存 3 gadi atpakaļ
vecāks
revīzija
303d92706e

+ 5 - 4
src/views/AppCover.vue

@@ -96,11 +96,15 @@ export default {
   },
   mounted() {
     this.intervalId = setInterval(() => {
-      if ((this.loadCountDown === 0) && (this.imgStateList[this.currentFrameIdx + 1] !== undefined)) {
+      if (this.frameLoadProgress === '100%') {
+      // if ((this.loadCountDown === 0) && (this.imgStateList[this.currentFrameIdx + 1] !== undefined)) {
         this.isLoading = false
         do {
           this.currentFrameIdx++
         } while (this.imgStateList[this.currentFrameIdx] === false)
+        if (this.currentFrameIdx >= frameNumber - 50) {
+          this.showLogo = true
+        }
         if (this.currentFrameIdx >= frameNumber - 1) {
           clearInterval(this.intervalId)
           this.$router.replace({
@@ -111,9 +115,6 @@ export default {
         this.isLoading = true
       }
     }, 41)
-    setTimeout(() => {
-      this.showLogo = true
-    }, 41 * 170)
   },
   methods: {
     onImgLoad(idx) {

+ 2 - 1
src/views/ExhibitionDetailAnimation.vue

@@ -65,7 +65,8 @@ export default {
   },
   mounted() {
     this.intervalId = setInterval(() => {
-      if ((this.loadCountDown === 0) && (this.imgStateList[this.currentFrameIdx + 1] !== undefined)) {
+      if (this.frameLoadProgress === '100%') {
+      // if ((this.loadCountDown === 0) && (this.imgStateList[this.currentFrameIdx + 1] !== undefined)) {
         this.isLoading = false
         do {
           this.currentFrameIdx++

+ 2 - 1
src/views/TreeAnimation.vue

@@ -54,7 +54,8 @@ export default {
   },
   mounted() {
     this.intervalId = setInterval(() => {
-      if ((this.loadCountDown === 0) && (this.imgStateList[this.currentFrameIdx + 1] !== undefined)) {
+      if (this.frameLoadProgress === '100%') {
+      // if ((this.loadCountDown === 0) && (this.imgStateList[this.currentFrameIdx + 1] !== undefined)) {
         this.isLoading = false
         do {
           this.currentFrameIdx++