gpt4 book ai didi

webrtc - 为什么 localStreams 包含 LocalMediaStream 而 remoteStreams 包含 MediaStream?

转载 作者:行者123 更新时间:2023-12-03 20:30:40 27 4
gpt4 key购买 nike

enter image description here

本地流 远程流 两者都是“媒体流列表 ”。
本地流 包含“本地媒体流 ” 对象

但是,远程流 包含“媒体流 ” 对象

为什么差别这么大?

当我使用“本地流 “- 这个对我有用:

localVideo.src = URL.createObjectURL(localStreams[0]);

但是如果我尝试使用“ 远程流 ” - 它不起作用:
remoteVideo.src = URL.createObjectURL(remoteStreams[0])

Blob 为“ 远程流 ” 和 “ 本地流 ”看起来风格相同。

为什么“ 远程流 ” 对我不起作用(在“ onaddstream ”事件中或直接)?
remoteVideo.src = URL.createObjectURL(secondPeer.remoteStreams[0])
"blob:http%3A//localhost%3A8082/78e8821f-90b8-4703-b56d-918ec505e5bf"

现场演示 :--- https://muazkh.appspot.com/?page=WebRTC

最佳答案

LocalMediaStream 正在被 MediaStream 接口(interface)取代。

simpl.info/pc ,在 Chrome Stable 和 Canary 的控制台中试试这个:

localPeerConnection.getLocalStreams()[0];
remotePeerConnection.getRemoteStreams()[0];

关于webrtc - 为什么 localStreams 包含 LocalMediaStream 而 remoteStreams 包含 MediaStream?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11539689/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com