Show video player for .m3u8 links

This commit is contained in:
2023-06-17 22:36:15 +01:00
parent 206aaca7b4
commit 19a2589e77
4 changed files with 30 additions and 21 deletions

View File

@ -12,6 +12,7 @@ import { useWallet } from "Wallet";
import { PaymentsCache } from "Cache/PaymentsCache";
import { Payment } from "Db";
import PageSpinner from "Element/PageSpinner";
import { LiveVideoPlayer } from "Element/LiveVideoPlayer";
/*
[
"imeta",
@ -172,11 +173,10 @@ export function MediaElement(props: MediaElementProps) {
} else if (props.mime.startsWith("audio/")) {
return <audio key={props.url} src={url} controls onError={() => probeFor402()} />;
} else if (props.mime.startsWith("video/")) {
return (
<SpotlightMedia>
<video key={props.url} src={url} controls onError={() => probeFor402()} />
</SpotlightMedia>
);
if (props.url.endsWith(".m3u8")) {
return <LiveVideoPlayer src={props.url} />;
}
return <video key={props.url} src={url} controls onError={() => probeFor402()} />;
} else {
return (
<a