fix(video player): ignore case in file extension

This commit is contained in:
小白-白 2025-04-26 11:45:36 +08:00
parent 6c2a40a86b
commit 0124c9feba
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import { Box, BoxProps } from "@mui/material";
import { fileExtension } from "../../../util";
import Artplayer from "artplayer";
import artplayerPluginChapter from "artplayer-plugin-chapter";
import artplayerPluginHlsControl from "artplayer-plugin-hls-control";
@ -143,7 +144,7 @@ export default function Player({
opts.plugins.push(artplayerPluginChapter({ chapters }));
}
if (option.title.endsWith(".m3u8")) {
if (fileExtension(option.title) === "m3u8") {
opts.plugins.push(
artplayerPluginHlsControl({
quality: {

View File

@ -100,7 +100,7 @@ const VideoViewer = () => {
}
const firstLoad = !currentExpire.current;
const isM3u8 = viewerState.file.name.endsWith(".m3u8");
const isM3u8 = fileExtension(viewerState.file.name) === "m3u8";
if (isM3u8) {
// For m3u8, use masked url
const crFileUrl = new CrUri(getFileLinkedUri(viewerState.file));