Compare commits

...

1 commit
R3.0.0 ... main

Author SHA1 Message Date
77f6412a24 mimetype 2024-09-18 13:36:07 -07:00

View file

@ -9,7 +9,16 @@ import VideoJS from './VideoJS';
const App = () => { const App = () => {
const playerRef = React.useRef(null); const playerRef = React.useRef(null);
const searchParams = new URLSearchParams(document.location.search) 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 = { const videoJsOptions = {
autoplay: false, autoplay: false,
controls: true, controls: true,
@ -17,7 +26,7 @@ const App = () => {
fluid: true, fluid: true,
sources: [{ sources: [{
src: searchParams.get('video'), src: searchParams.get('video'),
type: searchParams.get('mime') type: mimetype
}] }]
}; };