Przeglądaj źródła

跳过片头的修复

onecold 11 miesięcy temu
rodzic
commit
9333edf304

+ 1 - 1
entry/src/main/ets/pages/UserCenter.ets

@@ -174,7 +174,7 @@ export struct UserCenter {
       title: 'HiCAR播放',
       description: '专为驾车体验优化的音乐播放模式',
       isVipOnly: true,
-      hasCome: false
+      hasCome: true
     },
     {
       icon: $r('app.media.music_wave'),

+ 10 - 2
entry/src/main/ets/view/LocalMusic.ets

@@ -11053,9 +11053,17 @@ export struct LocalMusic {
           this.duration = this.mIjkMediaPlayer.getDuration()
           if (this.isOpenJump) { //用户是否设置跳过片头片尾
             if (this.mIjkMediaPlayer != null) {
-              if (this.jumpTopTime * 1000 <= this.duration) {
+              let jumpTopTimeMs = this.jumpTopTime*1000;
+              if (jumpTopTimeMs <= this.duration) {
                 // 调用 seekTo 方法,跳到指定时间
-
+                if(PreferencesUtil.getBooleanSync(SettingPage.iS_MUSIC_MEMORY_PLAY,true)){
+                  console.log('onecold jumpTopTime = '+jumpTopTimeMs);
+                  const position:number = PreferencesUtil.getNumberSync(this.videoUrl, 0);
+                  console.log('onecold position = '+position);
+                  if (position > jumpTopTimeMs) {
+                    jumpTopTimeMs = position
+                  }
+                }
                 setTimeout(() => { //rmvb和flac格式马上记忆播放会报错,会延迟1s在读取记忆播放。
                   if (StrUtil.isNotEmpty(this.videoUrl) && !this.videoUrl.toLowerCase().endsWith('.ts')) {
                     this.seekTo(this.jumpTopTime * 1000 + ""); // 跳到开头