简体   繁体   English

WebRTC 远程视频不流动

[英]WebRTC remote video not flowing

I'm facing really strange problem with my sample WebRTC application.我的示例 WebRTC 应用程序面临着非常奇怪的问题。 This application just obtains local camera stream using getUserMedia, creates connection using RTCPeerConnection and sends it to remote browser.该应用程序仅使用 getUserMedia 获取本地摄像头流,使用 RTCPeerConnection 创建连接并将其发送到远程浏览器。 When trying in Mozilla Nightly, it works fine, but in Google Chrome (25 and 26beta), the onaddstream event is fired, but the remote video remains empty.在 Mozilla Nightly 中尝试时,它工作正常,但在 Google Chrome(25 和 26beta)中, onaddstream事件被触发,但远程视频仍然为空。 For attaching remote video stream to video element, I'm using createObjectURL and when I inspect the video element, it seems that the stream blob in src attribute is set ( mediastream: in Nightly and blob:http:// in Chrome).为了将远程视频流附加到视频元素,我使用了 createObjectURL,当我检查视频元素时,似乎设置了src属性中的流 blob( mediastream:在 Nightly 和blob:http://在 Chrome 中)。 Does anybody have some idea where the problem could be?有人知道问题出在哪里吗? Thanks for any help.谢谢你的帮助。

try:尝试:

window.URL = window.webkitURL || window.mozURL || window.URL;
if (moz) video.mozSrcObject = stream;
else {
    video.src = window.URL.createObjectURL(stream) || stream;
}
video.play();

And check onended attribute of stream.并检查流的结束属性。 It should be false应该是假的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM