From ca4f00d8450b2e69c0f07260b76acbfdc795fdcc Mon Sep 17 00:00:00 2001 From: Hiram <> Date: Tue, 9 Apr 2024 18:59:14 +0800 Subject: [PATCH] fix sniffer url is empty always open system player --- src/renderer/src/pages/Play.vue | 3 +-- src/renderer/src/pages/film/Detail.vue | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/pages/Play.vue b/src/renderer/src/pages/Play.vue index a1e584fcd..e25cad1f8 100644 --- a/src/renderer/src/pages/Play.vue +++ b/src/renderer/src/pages/Play.vue @@ -585,7 +585,6 @@ const onlineUrl = ref(); // 解析接口+需解析的地址 const isSniff = ref(true); // 嗅探标识 const iframeRef = ref(); // iframe dom节点 const currentUrl = ref(); // 当前未解析前的url -const snifferTimer = ref(); const reverseOrder = ref(true); // true 正序 false 倒序 const onlinekey = new Date().getTime(); // 解决iframe不刷新问题 @@ -1116,7 +1115,7 @@ const initFilmPlayer = async (isFirst) => { try { MessagePlugin.info('嗅探资源中, 如10s没有结果请换源,咻咻咻!'); playerUrl = await sniffer(snifferType.type, snifferType.type === 'custom' ? `${snifferType.url}${config.value.url}` : config.value.url); - createPlayer(playerUrl); + if (playerUrl) createPlayer(playerUrl); } catch (err) { console.error(err); }; diff --git a/src/renderer/src/pages/film/Detail.vue b/src/renderer/src/pages/film/Detail.vue index e89133f56..89bd8df63 100644 --- a/src/renderer/src/pages/film/Detail.vue +++ b/src/renderer/src/pages/film/Detail.vue @@ -406,7 +406,7 @@ const gotoPlay = async (e) => { try { MessagePlugin.info('嗅探资源中, 如10s没有结果请换源,咻咻咻!'); playerUrl = await sniffer(snifferType.type, snifferType.type === 'custom' ? `${snifferType.url}${url}` : url); - callSysPlayer(playerUrl); + if (playerUrl) callSysPlayer(playerUrl); } catch (err) { console.error(err); };