From ecc235e9485804335a54250ce2bf615d95c9808f Mon Sep 17 00:00:00 2001 From: asuka Date: Sun, 17 Mar 2024 08:51:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9applicationName=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=96=B9=E5=BC=8F=EF=BC=8C=E8=A7=A3=E5=86=B3=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=95=AA=E5=89=A7=E4=BF=A1=E6=81=AF=E6=97=B6=E7=9A=84?= =?UTF-8?q?ocr=E9=97=AE=E9=A2=98=EF=BC=8C=E5=85=BC=E5=AE=B94.8+?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ede.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ede.js b/ede.js index 44da4fb..319f8bd 100644 --- a/ede.js +++ b/ede.js @@ -15,7 +15,10 @@ (async function () { 'use strict'; - if (document.querySelector('meta[name="application-name"]').content == 'Emby') { + const appVersion = document.querySelector('html').getAttribute('data-appversion').substring(0, 3); + const isVersionOld = appVersion < 4.8; + const applicationName = document.querySelector('meta[name="application-name"]').content; + if (applicationName == 'Emby' || applicationName.includes('Media Server')) { // ------ configs start------ const check_interval = 200; const chConverTtitle = ['当前状态: 未启用', '当前状态: 转换为简体', '当前状态: 转换为繁体']; @@ -30,7 +33,10 @@ is: 'paper-icon-button-light', }; const uiAnchorStr = '\uE034'; - const mediaContainerQueryStr = "div[data-type='video-osd']"; + let mediaContainerQueryStr = ".htmlVideoPlayerContainer"; + if (isVersionOld) { + mediaContainerQueryStr = "div[data-type='video-osd']"; + } const mediaQueryStr = 'video'; const displayButtonOpts = { title: '弹幕开关', @@ -304,7 +310,7 @@ animeName = prompt('确认动画名:', animeName); } - let searchUrl = 'https://api.dandanplay.net/api/v2/search/episodes?anime=' + animeName + '&withRelated=true'; + let searchUrl = 'https://api.9-ch.com/cors/https://api.dandanplay.net/api/v2/search/episodes?anime=' + animeName + '&withRelated=true'; if (is_auto) { searchUrl += '&episode=' + episode; } @@ -393,6 +399,9 @@ let _container = document.querySelector(mediaContainerQueryStr); let _media = document.querySelector(mediaQueryStr); + if (!isVersionOld) { + _media.style.position = 'absolute'; + } window.ede.danmaku = new Danmaku({ container: _container, media: _media,