diff options
| author | Factiven <[email protected]> | 2023-05-19 00:44:37 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-05-19 00:44:37 +0700 |
| commit | 953d0754e1a56afd1fe50a1840e60f16b417ae59 (patch) | |
| tree | 67a58479966b4e221a4765c7466e1281a903e9b3 /lib | |
| parent | Emergency Update (diff) | |
| download | moopa-953d0754e1a56afd1fe50a1840e60f16b417ae59.tar.xz moopa-953d0754e1a56afd1fe50a1840e60f16b417ae59.zip | |
Update v3.5.9
> Added font size settings for subtitles
> Now the player will save your last played video resolution
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Artplayer.js | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/lib/Artplayer.js b/lib/Artplayer.js index 5800527..0a00135 100644 --- a/lib/Artplayer.js +++ b/lib/Artplayer.js @@ -4,7 +4,9 @@ import Hls from "hls.js"; export default function Player({ option, + res, quality, + subSize, subtitles, getInstance, ...rest @@ -48,7 +50,43 @@ export default function Player({ html: "Subtitle", width: 300, tooltip: "English", - selector: subtitles, + selector: [ + { + 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, @@ -59,10 +97,11 @@ export default function Player({ { html: "Quality", width: 150, - tooltip: "auto", + tooltip: `${res}`, selector: quality, onSelect: function (item) { art.switchQuality(item.url, item.html); + localStorage.setItem("quality", item.html); return item.html; }, }, |