From 2b294020555b415cf5e731d72807f4b2c02485cc Mon Sep 17 00:00:00 2001 From: Factiven Date: Tue, 13 Jun 2023 08:43:22 +0700 Subject: Fixed enime video quality --- lib/Artplayer.js | 92 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 39 deletions(-) (limited to 'lib') diff --git a/lib/Artplayer.js b/lib/Artplayer.js index 705bbfe..5a50303 100644 --- a/lib/Artplayer.js +++ b/lib/Artplayer.js @@ -66,13 +66,13 @@ export default function Player({ ], settings: [ provider === "zoro" && { - html: 'Subtitle', + html: "Subtitles", icon: '', width: 300, tooltip: "Settings", selector: [ { - html: 'Display', + html: "Display", icon: '', tooltip: "Show", switch: true, @@ -83,7 +83,7 @@ export default function Player({ }, }, { - html: 'Font Size', + html: "Font Size", icon: '', selector: subSize, onSelect: function (item) { @@ -118,12 +118,10 @@ export default function Player({ }, }, { - html: 'Language', - icon:'', + html: "Language", + icon: '', tooltip: "English", - selector: [ - ...subtitles, - ], + selector: [...subtitles], onSelect: function (item) { art.subtitle.switch(item.url, { name: item.html, @@ -133,46 +131,62 @@ export default function Player({ }, { html: "Font Family", - tooltip: localStorage.getItem("font") ? localStorage.getItem("font") : "Arial", - selector: [{ html: "Arial"}, - { html: "Comic Sans MS"}, - { html: "Verdana"}, - { html: "Tahoma"}, - { html: "Trebuchet MS"}, - { html: "Times New Roman",}, - { html: "Georgia"}, - { html: "Impact "}, - { html: "Andalé Mono"}, - { html: "Palatino"}, - { html: "Baskerville"}, - { html: "Garamond"}, - { html: "Courier New"}, - { html: "Brush Script MT"}], + tooltip: localStorage.getItem("font") + ? localStorage.getItem("font") + : "Arial", + selector: [ + { html: "Arial" }, + { html: "Comic Sans MS" }, + { html: "Verdana" }, + { html: "Tahoma" }, + { html: "Trebuchet MS" }, + { html: "Times New Roman" }, + { html: "Georgia" }, + { html: "Impact " }, + { html: "Andalé Mono" }, + { html: "Palatino" }, + { html: "Baskerville" }, + { html: "Garamond" }, + { html: "Courier New" }, + { html: "Brush Script MT" }, + ], onSelect: function (item) { art.subtitle.style({ fontFamily: item.html }); localStorage.setItem("font", item.html); return item.html; - } + }, }, { html: "Font Shadow", - tooltip: localStorage.getItem("subShadow") ? JSON.parse(localStorage.getItem("subShadow")).shadow : "Default", + tooltip: localStorage.getItem("subShadow") + ? JSON.parse(localStorage.getItem("subShadow")).shadow + : "Default", selector: [ - { html: 'None', value: 'none' }, - { html: 'Uniform', value: '2px 2px 0px #000, -2px -2px 0px #000, 2px -2px 0px #000, -2px 2px 0px #000' }, - { html: 'Raised', value: '-1px 2px 3px rgba(0, 0, 0, 1)' }, - { html: 'Depressed', value: '-2px -3px 3px rgba(0, 0, 0, 1)' }, - { html: 'Glow', value: '0 0 10px rgba(0, 0, 0, 0.8)' }, - { html: 'Block', value: '-3px 3px 4px rgba(0, 0, 0, 1),2px 2px 4px rgba(0, 0, 0, 1),1px -1px 3px rgba(0, 0, 0, 1),-3px -2px 4px rgba(0, 0, 0, 1)' } + { html: "None", value: "none" }, + { + html: "Uniform", + value: + "2px 2px 0px #000, -2px -2px 0px #000, 2px -2px 0px #000, -2px 2px 0px #000", + }, + { html: "Raised", value: "-1px 2px 3px rgba(0, 0, 0, 1)" }, + { html: "Depressed", value: "-2px -3px 3px rgba(0, 0, 0, 1)" }, + { html: "Glow", value: "0 0 10px rgba(0, 0, 0, 0.8)" }, + { + html: "Block", + value: + "-3px 3px 4px rgba(0, 0, 0, 1),2px 2px 4px rgba(0, 0, 0, 1),1px -1px 3px rgba(0, 0, 0, 1),-3px -2px 4px rgba(0, 0, 0, 1)", + }, ], onSelect: function (item) { art.subtitle.style({ textShadow: item.value }); - localStorage.setItem("subShadow", JSON.stringify({shadow:item.html, value:item.value})); + localStorage.setItem( + "subShadow", + JSON.stringify({ shadow: item.html, value: item.value }) + ); return item.html; - } - } + }, + }, ], - }, provider === "gogoanime" && { html: "Quality", @@ -187,10 +201,10 @@ export default function Player({ }, ].filter(Boolean), }); - - art.events.proxy(document,"keydown", event => { - if (event.key === 'f' || event.key === 'F') { - art.fullscreen = !art.fullscreen; + + art.events.proxy(document, "keydown", (event) => { + if (event.key === "f" || event.key === "F") { + art.fullscreen = !art.fullscreen; } }); -- cgit v1.2.3