aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-05-18 15:46:10 +0700
committerFactiven <[email protected]>2023-05-18 15:46:10 +0700
commit759120279dbd83f787cc1005c0015955f8d64bc9 (patch)
treebe8d7dc74fe4a31d98dddbe59961e227649c49ec /lib
parentUpdate [param].js (diff)
downloadmoopa-759120279dbd83f787cc1005c0015955f8d64bc9.tar.xz
moopa-759120279dbd83f787cc1005c0015955f8d64bc9.zip
Emergency Update
> Temporary switching to zoro as a source until the API works again
Diffstat (limited to 'lib')
-rw-r--r--lib/Artplayer.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/Artplayer.js b/lib/Artplayer.js
index 74f9acd..5800527 100644
--- a/lib/Artplayer.js
+++ b/lib/Artplayer.js
@@ -2,7 +2,13 @@ import { useEffect, useRef } from "react";
import Artplayer from "artplayer";
import Hls from "hls.js";
-export default function Player({ option, getInstance, ...rest }) {
+export default function Player({
+ option,
+ quality,
+ subtitles,
+ getInstance,
+ ...rest
+}) {
const artRef = useRef();
function playM3u8(video, url, art) {
if (Hls.isSupported()) {
@@ -37,6 +43,30 @@ export default function Player({ option, getInstance, ...rest }) {
autoOrientation: true,
pip: true,
theme: "#f97316",
+ settings: [
+ {
+ html: "Subtitle",
+ width: 300,
+ tooltip: "English",
+ selector: subtitles,
+ onSelect: function (item) {
+ art.subtitle.switch(item.url, {
+ name: item.html,
+ });
+ return item.html;
+ },
+ },
+ {
+ html: "Quality",
+ width: 150,
+ tooltip: "auto",
+ selector: quality,
+ onSelect: function (item) {
+ art.switchQuality(item.url, item.html);
+ return item.html;
+ },
+ },
+ ],
});
if (getInstance && typeof getInstance === "function") {