mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
fix(video player): ignore case in file extension
This commit is contained in:
parent
6c2a40a86b
commit
0124c9feba
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in New Issue