【发布时间】:2022-01-21 05:04:40
【问题描述】:
在 React APP 上使用 peer.js 流视频
addVideoStream(video: HTMLVideoElement, stream: MediaStream) {
video.srcObject = stream
video?.addEventListener('loadedmetadata', () => {
video.play()
})
if (this.videoGrid) this.videoGrid.append(video)
}
在 'video.play()' 得到这个错误
the request is not allowed by the user agent or the platform in the current context
我已经允许 IOS 上的音频和视频。
此代码适用于除 IOS 以外的其他平台。
我不知道。
如果我部署,那么我只会在 IOS 上出现黑屏。
我该如何解决这个问题?
提前致谢
【问题讨论】:
标签: javascript html reactjs stream webrtc