diff options
| author | Factiven <[email protected]> | 2023-05-28 20:27:27 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-28 20:27:27 +0700 |
| commit | 1242c3ed6b2572f4be4d7a5cc3409601a18a36dc (patch) | |
| tree | 83d83fe16297bf600f60bae94dd815bfb9f654c1 /lib | |
| parent | Update README.md (diff) | |
| download | moopa-1242c3ed6b2572f4be4d7a5cc3409601a18a36dc.tar.xz moopa-1242c3ed6b2572f4be4d7a5cc3409601a18a36dc.zip | |
Update v3.6.2
> Added Zoro and Enime provider
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Artplayer.js | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/lib/Artplayer.js b/lib/Artplayer.js index de454bb..64b5c4d 100644 --- a/lib/Artplayer.js +++ b/lib/Artplayer.js @@ -6,6 +6,9 @@ export default function Player({ option, res, quality, + subSize, + subtitles, + provider, getInstance, ...rest }) { @@ -44,6 +47,64 @@ export default function Player({ pip: true, theme: "#f97316", settings: [ + provider === "zoro" && { + html: "Subtitle", + width: 300, + tooltip: "English", + selector: [ + { + html: "Display", + tooltip: "Show", + switch: true, + onSwitch: function (item) { + item.tooltip = item.switch ? "Hide" : "Show"; + art.subtitle.show = !item.switch; + return !item.switch; + }, + }, + { + html: "Font Size", + selector: subSize, + onSelect: function (item) { + if (item.html === "Small") { + art.subtitle.style({ fontSize: "16px" }); + localStorage.setItem( + "subSize", + JSON.stringify({ + size: "16px", + html: "Small", + }) + ); + } else if (item.html === "Medium") { + art.subtitle.style({ fontSize: "36px" }); + localStorage.setItem( + "subSize", + JSON.stringify({ + size: "36px", + html: "Medium", + }) + ); + } else if (item.html === "Large") { + art.subtitle.style({ fontSize: "56px" }); + localStorage.setItem( + "subSize", + JSON.stringify({ + size: "56px", + html: "Large", + }) + ); + } + }, + }, + ...subtitles, + ], + onSelect: function (item) { + art.subtitle.switch(item.url, { + name: item.html, + }); + return item.html; + }, + }, { html: "Quality", width: 150, @@ -55,7 +116,7 @@ export default function Player({ return item.html; }, }, - ], + ].filter(Boolean), }); if (getInstance && typeof getInstance === "function") { |