视频会议
This commit is contained in:
@@ -134,7 +134,12 @@ const applyVideo = (retry = 0) => {
|
|||||||
}
|
}
|
||||||
const el = ensureMediaEl('video')
|
const el = ensureMediaEl('video')
|
||||||
if (!el) return
|
if (!el) return
|
||||||
el.muted = props.isLocal
|
// 关键:<video> 必须 muted 才能在 Chrome / 微信内核里自动播放。
|
||||||
|
// 音频在独立的 <audio> 元素上播放,所以此处 muted 不会让对方静音,
|
||||||
|
// 同时彻底解决"进会黑屏,必须点切换按钮才出图"的问题。
|
||||||
|
el.muted = true
|
||||||
|
el.setAttribute('muted', '')
|
||||||
|
el.playsInline = true
|
||||||
if (boundVideoTrack !== props.videoTrack) {
|
if (boundVideoTrack !== props.videoTrack) {
|
||||||
el.srcObject = new MediaStream([props.videoTrack])
|
el.srcObject = new MediaStream([props.videoTrack])
|
||||||
boundVideoTrack = props.videoTrack
|
boundVideoTrack = props.videoTrack
|
||||||
|
|||||||
Reference in New Issue
Block a user