From 457f735934e6edb3b4eee610819be334c56aad27 Mon Sep 17 00:00:00 2001 From: Hiram <> Date: Sun, 15 Dec 2024 15:56:22 +0800 Subject: [PATCH] [change] use new multi-player --- .../src/components/player/src/utils/tool.ts | 4 +- .../src/locales/lang/en_US/pages/player.ts | 1 + .../src/locales/lang/zh_CN/pages/player.ts | 1 + src/renderer/src/pages/analyze/index.vue | 11 +- .../lab/components/snifferPlay/index.vue | 58 +++--- .../src/pages/play/componets/AsideFilm.vue | 172 +++++++++--------- .../pages/play/componets/DialogDownload.vue | 8 +- src/renderer/src/pages/play/index.vue | 30 +-- src/renderer/src/utils/common/film.ts | 62 ++++--- src/renderer/src/utils/tool.ts | 118 +----------- 10 files changed, 192 insertions(+), 273 deletions(-) diff --git a/src/renderer/src/components/player/src/utils/tool.ts b/src/renderer/src/components/player/src/utils/tool.ts index 1c947a786..f3b379d17 100644 --- a/src/renderer/src/components/player/src/utils/tool.ts +++ b/src/renderer/src/components/player/src/utils/tool.ts @@ -138,11 +138,11 @@ const mediaUtils = (() => { }; // 映射 Content-Type 到具体格式 - const mapContentTypeToFormat = (contentType: string): string => { + const mapContentTypeToFormat = (contentType: string): string | undefined => { const entry = Object.entries(supportedFormats).find(([type]) => contentType.includes(type) ); - return entry ? entry[1] : 'unknown'; + return entry ? entry[1] : undefined; }; // 使用 fetch 获取媒体类型 diff --git a/src/renderer/src/locales/lang/en_US/pages/player.ts b/src/renderer/src/locales/lang/en_US/pages/player.ts index ebe39cadf..a59b6089f 100644 --- a/src/renderer/src/locales/lang/en_US/pages/player.ts +++ b/src/renderer/src/locales/lang/en_US/pages/player.ts @@ -44,6 +44,7 @@ export default { official: 'Analyze completed, data is derived from {0}', noDefaultAnalyze: 'Not set default, Choose your own analysis line', noRecommendSearch: 'No recommendation found for this source, Switch is not performed', + noPlayUrl: 'Play address acquisition failed, please change the source or line', next: 'One moment, Switching next', }, placeholder: { diff --git a/src/renderer/src/locales/lang/zh_CN/pages/player.ts b/src/renderer/src/locales/lang/zh_CN/pages/player.ts index ff4a91f43..9fee624da 100644 --- a/src/renderer/src/locales/lang/zh_CN/pages/player.ts +++ b/src/renderer/src/locales/lang/zh_CN/pages/player.ts @@ -44,6 +44,7 @@ export default { sniiferError: '嗅探失败,请换源', noDefaultAnalyze: '未配置默认解析,自行选择解析线路', noRecommendSearch: '该源未找到相关推荐,不执行本次切换', + noPlayUrl: '播放地址获取失败,请换源或线路', next: '请稍候,正在切换下集', }, placeholder: { diff --git a/src/renderer/src/pages/analyze/index.vue b/src/renderer/src/pages/analyze/index.vue index f3c65168a..c624153ac 100644 --- a/src/renderer/src/pages/analyze/index.vue +++ b/src/renderer/src/pages/analyze/index.vue @@ -38,7 +38,7 @@