fix(player): don't show video box if there is no stream
This commit is contained in:
parent
648b639cea
commit
48ca432a9c
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue