视频会议

This commit is contained in:
duoaohui
2026-05-23 21:49:08 +08:00
parent fb7b0a8dde
commit 50234db7a9

View File

@@ -134,7 +134,12 @@ const applyVideo = (retry = 0) => {
}
const el = ensureMediaEl('video')
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) {
el.srcObject = new MediaStream([props.videoTrack])
boundVideoTrack = props.videoTrack