This commit is contained in:
Page Asgardius 2024-09-18 13:36:07 -07:00
parent 45189a5247
commit 77f6412a24

View file

@ -9,7 +9,16 @@ import VideoJS from './VideoJS';
const App = () => {
const playerRef = React.useRef(null);
const searchParams = new URLSearchParams(document.location.search)
var mimetype
if (!searchParams.get('mime' ) === "") {
mimetype = searchParams.get('mime')
}
else if (searchParams.get('video').endsWith('oga') || searchParams.get('video').endsWith('ogg') || searchParams.get('video').endsWith("opus")) {
mimetype = 'audio/ogg'
}
else if (searchParams.get('video').endsWith("m3u8")) {
mimetype = 'application/x-mpegURL'
}
const videoJsOptions = {
autoplay: false,
controls: true,
@ -17,7 +26,7 @@ const App = () => {
fluid: true,
sources: [{
src: searchParams.get('video'),
type: searchParams.get('mime')
type: mimetype
}]
};