Compare commits
No commits in common. "main" and "R3.0.0" have entirely different histories.
1 changed files with 2 additions and 11 deletions
13
src/App.js
13
src/App.js
|
@ -9,16 +9,7 @@ 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,
|
||||
|
@ -26,7 +17,7 @@ const App = () => {
|
|||
fluid: true,
|
||||
sources: [{
|
||||
src: searchParams.get('video'),
|
||||
type: mimetype
|
||||
type: searchParams.get('mime')
|
||||
}]
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue