From 84618a66caf9746faa503de0af532d6a86c8fb73 Mon Sep 17 00:00:00 2001 From: Factiven Date: Wed, 7 Jun 2023 13:17:05 +0700 Subject: fixed freezed subtitle after changing quality --- components/videoPlayer.js | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'components') diff --git a/components/videoPlayer.js b/components/videoPlayer.js index 8c137d1..ecd62e0 100644 --- a/components/videoPlayer.js +++ b/components/videoPlayer.js @@ -1,6 +1,7 @@ import Player from "../lib/Artplayer"; import { useEffect, useState } from "react"; import { useAniList } from "../lib/useAnilist"; +import artplayerPluginHlsQuality from "artplayer-plugin-hls-quality"; const fontSize = [ { @@ -68,7 +69,9 @@ export default function VideoPlayer({ const referer = data?.headers?.Referer; const source = data.sources.map((items) => { const isDefault = - resolution === "auto" + provider !== "gogoanime" + ? items.quality === "default" || items.quality === "auto" + : resolution === "auto" ? items.quality === "default" || items.quality === "auto" : items.quality === resolution; return { @@ -129,7 +132,7 @@ export default function VideoPlayer({ return ( <> - {url ? ( + {url && ( level.height + "P", + + // I18n + title: "Quality", + auto: "Auto", + }), + ], + }), ...(provider === "zoro" && { subtitle: { url: `${defSub}`, @@ -275,8 +299,6 @@ export default function VideoPlayer({ // }); }} /> - ) : ( - "" )} ); -- cgit v1.2.3