fix(player): don't show video box if there is no stream

This commit is contained in:
sylenien 2022-08-31 15:26:02 +02:00
parent 648b639cea
commit 48ca432a9c

View file

@ -20,7 +20,7 @@ function VideoContainer({ stream, muted = false, height = 280 }: Props) {
if (!stream) { return }
const iid = setInterval(() => {
const settings = stream.getVideoTracks()[0]?.getSettings()
const isDummyVideoTrack = settings ? (settings.width === 2 || settings.frameRate === 0) : true
const isDummyVideoTrack = settings ? (settings.width === 2 || settings.frameRate === 0 || !settings.frameRate && !settings.width) : true
const shouldBeEnabled = !isDummyVideoTrack
isEnabled !== shouldBeEnabled ? setEnabled(shouldBeEnabled) : null;
}, 500)