Jelajahi Sumber

优化一些ui问题

onecold 7 bulan lalu
induk
melakukan
86ffb3057f
1 mengubah file dengan 9 tambahan dan 19 penghapusan
  1. 9 19
      entry/src/main/ets/view/LocalMusic.ets

+ 9 - 19
entry/src/main/ets/view/LocalMusic.ets

@@ -10465,20 +10465,17 @@ export struct LocalMusic {
           .layoutWeight(1)
           .enabled(this.slideEnable)
           .onChange((value: number, mode: SliderChangeMode) => {
-
-
+           if(this.isSeekTo)
+             return
             this.isSeekTo = true;
             this.mDestroyPage = false;
             // 只有播放网盘歌曲时才显示转圈圈
             if (this.currentSong && isRemoteCloudType(this.currentSong.type)) {
-              this.showLoadIng();
+              this.showLoadIng();3
             }
-            LogUtils.getInstance().LOGI("slider-->seekValue start:" + value);
             let seekValue = value * (this.mIjkMediaPlayer.getDuration() / 100);
+            console.info("onecold this.currentSong.type:"+this.currentSong?.type)
             this.seekTo(seekValue + "");
-            // this.setProgress()
-            LogUtils.getInstance().LOGI("slider-->seekValue end:" + seekValue);
-            // }
           })
 
 
@@ -10751,20 +10748,13 @@ export struct LocalMusic {
           this.isSeekTo = true;
           this.mDestroyPage = false;
           // 只有播放网盘歌曲时才显示转圈圈
+          console.info("onecold this.currentSong.type:"+this.currentSong?.type)
           if (this.currentSong && isRemoteCloudType(this.currentSong.type)) {
+            console.info("onecold 开始转圈圈")
             this.showLoadIng();
-            setTimeout(() => {
-              let seekValue = value * (this.mIjkMediaPlayer.getDuration() / 100);
-              this.seekTo(seekValue + "");
-            },200)
-          }else{
-            LogUtils.getInstance().LOGI("slider-->seekValue start:" + value);
-            let seekValue = value * (this.mIjkMediaPlayer.getDuration() / 100);
-            this.seekTo(seekValue + "");
-            LogUtils.getInstance().LOGI("slider-->seekValue end:" + seekValue);
           }
-
-          // }
+          let seekValue = value * (this.mIjkMediaPlayer.getDuration() / 100);
+          this.seekTo(seekValue + "");
         })
       Text(this.totalTime)
         .fontSize($r('app.float.slider_font_size'))
@@ -14458,7 +14448,7 @@ export struct LocalMusic {
     }
   }
 
-  private seekTo(value: string) {
+  private  seekTo(value: string) {
     if (StrUtil.isNotEmpty(this.videoUrl) && this.videoUrl.toLowerCase().endsWith('.wma')) {
       ToastUtil.showToast('wma格式不支持拖动快进。')
       return