Fix MSE check for birdseye

This commit is contained in:
Nick Mowen 2023-01-13 13:57:13 -07:00
parent 9325199322
commit 91037e236f

View File

@ -6,7 +6,6 @@ import Heading from '../components/Heading';
import WebRtcPlayer from '../components/WebRtcPlayer'; import WebRtcPlayer from '../components/WebRtcPlayer';
import MsePlayer from '../components/MsePlayer'; import MsePlayer from '../components/MsePlayer';
import useSWR from 'swr'; import useSWR from 'swr';
import videojs from 'video.js';
export default function Birdseye() { export default function Birdseye() {
const { data: config } = useSWR('config'); const { data: config } = useSWR('config');
@ -20,19 +19,19 @@ export default function Birdseye() {
let player; let player;
if (viewSource == 'mse' && config.restream.birdseye) { if (viewSource == 'mse' && config.restream.birdseye) {
if (videojs.browser.IS_IOS) { if ('MediaSource' in window) {
player = ( player = (
<Fragment> <Fragment>
<div className="w-5xl text-center text-sm"> <div className="max-w-5xl">
MSE is not supported on iOS devices. You'll need to use jsmpeg or webRTC. See the docs for more info. <MsePlayer camera="birdseye" />
</div> </div>
</Fragment> </Fragment>
); );
} else { } else {
player = ( player = (
<Fragment> <Fragment>
<div className="max-w-5xl"> <div className="w-5xl text-center text-sm">
<MsePlayer camera="birdseye" /> MSE is not supported on iOS devices. You'll need to use jsmpeg or webRTC. See the docs for more info.
</div> </div>
</Fragment> </Fragment>
); );