switchDevice() error Failed to GetUserMedia "-" NotReadableError "- 0 -" 开始捕获视频轨道失败
switchDevice() error Failed to GetUserMedia "–" NotReadableError "– 0 –" Failed starting capture of a video track
我在 switchDevice() 中收到以下错误
可能的问题是什么?
Failed to GetUserMedia "–" NotReadableError "– 0 –" Failed starting capture of a video track
此错误可能发生也可能不发生
- 我每次都调用getDevices来获取设备ID
- 目标浏览器是Mozilla / 5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit / 605.1.15 (KHTML, like Gecko) 版本 / 13.0.5 Mobile / 15E148 Safari / 604.1
- SDK 版本 3.0.2
我得到以下建议
Make sure that if you are switching cameras to stop any existing tracks.
Stop all tracks in an active stream before acquiring a new one.
我尝试了以下并解决了
## OK
navigator.mediaDevices.getUserMedia(video: true,audio: true).then((mediaStream) =>
mediaStream.getTracks().forEach((track) => track.stop())
)
## NG
localStream.getVideoTrack().stop()
localStream.getAudioTrack().stop()
我在 switchDevice() 中收到以下错误
可能的问题是什么?
Failed to GetUserMedia "–" NotReadableError "– 0 –" Failed starting capture of a video track
此错误可能发生也可能不发生
- 我每次都调用getDevices来获取设备ID
- 目标浏览器是Mozilla / 5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit / 605.1.15 (KHTML, like Gecko) 版本 / 13.0.5 Mobile / 15E148 Safari / 604.1
- SDK 版本 3.0.2
我得到以下建议
Make sure that if you are switching cameras to stop any existing tracks. Stop all tracks in an active stream before acquiring a new one.
我尝试了以下并解决了
## OK
navigator.mediaDevices.getUserMedia(video: true,audio: true).then((mediaStream) =>
mediaStream.getTracks().forEach((track) => track.stop())
)
## NG
localStream.getVideoTrack().stop()
localStream.getAudioTrack().stop()