diff options
| author | Factiven <[email protected]> | 2023-06-13 08:43:22 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-06-13 08:43:22 +0700 |
| commit | 2b294020555b415cf5e731d72807f4b2c02485cc (patch) | |
| tree | 2c37fbe0af0dfd42eee51c73c4f0a3432a2d7f76 | |
| parent | Added Subtitle Customizations (#20) (diff) | |
| download | moopa-2b294020555b415cf5e731d72807f4b2c02485cc.tar.xz moopa-2b294020555b415cf5e731d72807f4b2c02485cc.zip | |
Fixed enime video quality
| -rw-r--r-- | components/videoPlayer.js | 10 | ||||
| -rw-r--r-- | lib/Artplayer.js | 92 |
2 files changed, 60 insertions, 42 deletions
diff --git a/components/videoPlayer.js b/components/videoPlayer.js index 122f5b8..6d98af0 100644 --- a/components/videoPlayer.js +++ b/components/videoPlayer.js @@ -144,7 +144,7 @@ export default function VideoPlayer({ crossOrigin: "anonymous", }, poster: poster ? poster : "", - ...(provider === "zoro" && { + ...(provider !== "gogoanime" && { plugins: [ artplayerPluginHlsQuality({ // Show quality in control @@ -173,8 +173,12 @@ export default function VideoPlayer({ style: { color: "#FFFF", fontSize: `${defSize?.size}`, - fontFamily: localStorage.getItem("font")? localStorage.getItem("font") : "Arial", - textShadow: localStorage.getItem("subShadow")? JSON.parse(localStorage.getItem("subShadow")).value : "0px 0px 10px #000000", + fontFamily: localStorage.getItem("font") + ? localStorage.getItem("font") + : "Arial", + textShadow: localStorage.getItem("subShadow") + ? JSON.parse(localStorage.getItem("subShadow")).value + : "0px 0px 10px #000000", }, }, }), 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: '<svg xmlns="http://www.w3.org/2000/svg" width="35" height="28" viewBox="0 -960 960 960"><path d="M240-350h360v-60H240v60zm420 0h60v-60h-60v60zM240-470h60v-60h-60v60zm120 0h360v-60H360v60zM140-160q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140zm0-60h680v-520H140v520zm0 0v-520 520z"></path></svg>', width: 300, tooltip: "Settings", selector: [ { - html: 'Display', + html: "Display", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="35" height="26" viewBox="0 -960 960 960"><path d="M480.169-341.796q65.754 0 111.894-46.31 46.141-46.309 46.141-112.063t-46.31-111.894q-46.309-46.141-112.063-46.141t-111.894 46.31q-46.141 46.309-46.141 112.063t46.31 111.894q46.309 46.141 112.063 46.141zm-.371-48.307q-45.875 0-77.785-32.112-31.91-32.112-31.91-77.987 0-45.875 32.112-77.785 32.112-31.91 77.987-31.91 45.875 0 77.785 32.112 31.91 32.112 31.91 77.987 0 45.875-32.112 77.785-32.112 31.91-77.987 31.91zm.226 170.102q-130.921 0-239.6-69.821-108.679-69.82-167.556-186.476-2.687-4.574-3.892-10.811Q67.77-493.347 67.77-500t1.205-12.891q1.205-6.237 3.892-10.811Q131.745-640.358 240.4-710.178q108.655-69.821 239.576-69.821t239.6 69.821q108.679 69.82 167.556 186.476 2.687 4.574 3.892 10.811 1.205 6.238 1.205 12.891t-1.205 12.891q-1.205 6.237-3.892 10.811Q828.255-359.642 719.6-289.822q-108.655 69.821-239.576 69.821zM480-500zm-.112 229.744q117.163 0 215.048-62.347Q792.821-394.949 844.308-500q-51.487-105.051-149.26-167.397-97.772-62.347-214.936-62.347-117.163 0-215.048 62.347Q167.179-605.051 115.282-500q51.897 105.051 149.67 167.397 97.772 62.347 214.936 62.347z"></path></svg>', tooltip: "Show", switch: true, @@ -83,7 +83,7 @@ export default function Player({ }, }, { - html: 'Font Size', + html: "Font Size", icon: '<svg xmlns="http://www.w3.org/2000/svg" width="35" height="26" viewBox="0 -960 960 960"><path d="M619.861-177.694q-15.655 0-26.475-10.918-10.821-10.918-10.821-26.516v-492.309H415.128q-15.598 0-26.516-10.959-10.918-10.959-10.918-26.615 0-15.655 10.918-26.475 10.918-10.82 26.516-10.82h409.744q15.598 0 26.516 10.958 10.918 10.959 10.918 26.615 0 15.656-10.918 26.476-10.918 10.82-26.516 10.82H657.435v492.309q0 15.598-10.959 26.516-10.959 10.918-26.615 10.918zm-360 0q-15.655 0-26.475-10.918-10.821-10.918-10.821-26.516v-292.309h-87.437q-15.598 0-26.516-10.959-10.918-10.959-10.918-26.615 0-15.655 10.918-26.475 10.918-10.82 26.516-10.82h249.744q15.598 0 26.516 10.958 10.918 10.959 10.918 26.615 0 15.656-10.918 26.476-10.918 10.82-26.516 10.82h-87.437v292.309q0 15.598-10.959 26.516-10.959 10.918-26.615 10.918z"></path></svg>', selector: subSize, onSelect: function (item) { @@ -118,12 +118,10 @@ export default function Player({ }, }, { - html: 'Language', - icon:'<svg xmlns="http://www.w3.org/2000/svg" width="35" height="26" viewBox="0 -960 960 960"><path d="M528.282-110.771q-21.744 0-31.308-14.013t-2.205-34.295l135.952-359.307q5.304-14.793 20.292-25.126 14.988-10.334 31.152-10.334 15.398 0 30.85 10.388 15.451 10.387 20.932 25.125l137.128 357.485q8.025 20.949-1.83 35.513-9.855 14.564-33.24 14.564-10.366 0-19.392-6.616-9.025-6.615-12.72-16.242l-30.997-91.808H594.769l-33.381 91.869q-3.645 9.181-13.148 15.989-9.504 6.808-19.958 6.808zm87.871-179.281h131.64l-64.615-180.717h-2.41l-64.615 180.717zM302.104-608.384q14.406 25.624 31.074 48.184 16.669 22.559 37.643 47.021 41.333-44.128 68.628-90.461t46.038-97.897H111.499q-15.674 0-26.278-10.615-10.603-10.616-10.603-26.308t10.615-26.307q10.616-10.616 26.308-10.616h221.537v-36.923q0-15.692 10.615-26.307 10.616-10.616 26.308-10.616t26.307 10.616q10.616 10.615 10.616 26.307v36.923h221.537q15.692 0 26.307 10.616 10.616 10.615 10.616 26.307 0 15.692-10.616 26.308-10.615 10.615-26.307 10.615h-69.088q-19.912 64.153-53.237 125.74-33.325 61.588-82.341 116.412l89.384 90.974-27.692 75.179-115.486-112.922-158.948 158.947q-10.615 10.616-25.667 10.616-15.051 0-25.666-11.026-11.026-10.615-11.026-25.666 0-15.052 11.026-26.077l161.614-161.358q-24.666-28.308-45.551-57.307-20.884-29-37.756-60.103-10.641-19.871-1.346-34.717t33.038-14.846q9.088 0 18.429 5.73 9.34 5.731 13.956 13.577z"></path></svg>', + html: "Language", + icon: '<svg xmlns="http://www.w3.org/2000/svg" width="35" height="26" viewBox="0 -960 960 960"><path d="M528.282-110.771q-21.744 0-31.308-14.013t-2.205-34.295l135.952-359.307q5.304-14.793 20.292-25.126 14.988-10.334 31.152-10.334 15.398 0 30.85 10.388 15.451 10.387 20.932 25.125l137.128 357.485q8.025 20.949-1.83 35.513-9.855 14.564-33.24 14.564-10.366 0-19.392-6.616-9.025-6.615-12.72-16.242l-30.997-91.808H594.769l-33.381 91.869q-3.645 9.181-13.148 15.989-9.504 6.808-19.958 6.808zm87.871-179.281h131.64l-64.615-180.717h-2.41l-64.615 180.717zM302.104-608.384q14.406 25.624 31.074 48.184 16.669 22.559 37.643 47.021 41.333-44.128 68.628-90.461t46.038-97.897H111.499q-15.674 0-26.278-10.615-10.603-10.616-10.603-26.308t10.615-26.307q10.616-10.616 26.308-10.616h221.537v-36.923q0-15.692 10.615-26.307 10.616-10.616 26.308-10.616t26.307 10.616q10.616 10.615 10.616 26.307v36.923h221.537q15.692 0 26.307 10.616 10.616 10.615 10.616 26.307 0 15.692-10.616 26.308-10.615 10.615-26.307 10.615h-69.088q-19.912 64.153-53.237 125.74-33.325 61.588-82.341 116.412l89.384 90.974-27.692 75.179-115.486-112.922-158.948 158.947q-10.615 10.616-25.667 10.616-15.051 0-25.666-11.026-11.026-10.615-11.026-25.666 0-15.052 11.026-26.077l161.614-161.358q-24.666-28.308-45.551-57.307-20.884-29-37.756-60.103-10.641-19.871-1.346-34.717t33.038-14.846q9.088 0 18.429 5.73 9.34 5.731 13.956 13.577z"></path></svg>', 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; } }); |