Procházet zdrojové kódy

修复SMB无法播放的bug

onecold před 6 měsíci
rodič
revize
5661374ec9

+ 5 - 0
entry/src/main/ets/common/util/RemoteDriveManager.ets

@@ -631,6 +631,11 @@ export class RemoteDriveManager {
       Logger.info(TAG, `构建百度请求头: ${JSON.stringify(headerSnapshot)}`);
     }
 
+    // SMB类型的歌曲通过本地HTTP代理服务器播放,不需要特殊认证头
+    if (currentSong.type === CommonConstants.TYPE_SMB) {
+      Logger.info(TAG, `SMB歌曲使用HTTP代理流,无需特殊认证头`);
+    }
+
     return headers;
   }
 

+ 2 - 2
entry/src/main/ets/common/util/RemotePlayerUtil.ets

@@ -677,8 +677,8 @@ export async function setVideoUrlForSong(
       const streamingUrl = await ensureSmbFileStreaming(account, pathInfo.normalizedRelative, streamMeta);
       Logger.info(TAG, `SMB 流地址: ${streamingUrl}`);
       void scheduleMetadataExtractionFromCache(song, pathInfo.cachePath, metadataOptions, song.videoSize);
-      const shouldBypassSanitize = streamingUrl.startsWith('http://127.0.0.1:');
-      return shouldBypassSanitize ? streamingUrl : sanitizePlaybackUrl(streamingUrl);
+      // SMB流地址已经是合法的HTTP URL,不需要再编码
+      return streamingUrl;
     } catch (error) {
       const err = error as Error;
       Logger.error(TAG, `SMB 流式播放失败: ${err.message}`);

+ 13 - 13
lib/src/main/ets/view/LyricView2.ets

@@ -222,11 +222,11 @@ export struct LyricView2 {
         .contentEndOffset(this.h / 3)
         .contentStartOffset(this.isUserTouching?this.h / 3:0)
         .cachedCount(this.cacheSize)
-        .chainAnimation(true)
-        .animation({
-            curve: curves.springCurve(100, 10, 80, 10),
-            duration: 500
-        })
+        // .chainAnimation(true)
+        // .animation({
+        //     curve: curves.springCurve(100, 10, 80, 10),
+        //     duration: 500
+        // })
         .visibility(this.isLoadingData ? Visibility.Hidden : Visibility.Visible)
         .onScrollIndex((_, __, center) => {
             const now = Date.now()
@@ -280,10 +280,10 @@ export struct LyricView2 {
                     (index >= this.currentIndex && index <= this.currentIndex + 1 ? Visibility.Visible : Visibility.None)
                     : Visibility.Visible)
                 .width(this.alignMode == 'center' ? '100%' :index == this.currentIndex ?'95%': '80%')
-                .animation({
-                    duration: 150,
-                    curve: Curve.Linear
-                })
+                // .animation({
+                //     duration: 150,
+                //     curve: Curve.Linear
+                // })
                 .blendMode(
                     index == this.currentIndex ? BlendMode.DST_IN : undefined,
                     index == this.currentIndex ? BlendApplyType.OFFSCREEN : undefined
@@ -307,10 +307,10 @@ export struct LyricView2 {
                     index == this.currentIndex ? BlendApplyType.OFFSCREEN : undefined
                 )
                 .width(this.alignMode == 'center' ? '100%' :index == this.currentIndex ?'95%': '80%')
-                .animation({
-                    duration: 150,
-                    curve: Curve.Linear
-                })
+                // .animation({
+                //     duration: 150,
+                //     curve: Curve.Linear
+                // })
 
             }
         }