2012-07-18 64 views
4

enter image description here爲什麼localStreams包含LocalMediaStream而remoteStreams包含MediaStream?

localStreamsremoteStreams均爲類型「MediaStreamList」的。 localStreams包含「LocalMediaStream」對象

然而,remoteStreams包含「MediaStream」對象

爲什麼這麼差?

當我使用「localStreams」 - 它爲我工作:

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

但是,如果我嘗試使用「remoteStreams」 - 這是行不通的:

remoteVideo.src = URL.createObjectURL(remoteStreams[0]) 

Blob爲「remoteStreams」和「localStreams「風格相同。

爲什麼「remoteStreams」不爲我工作(在「onaddstream」事件或直接)???

remoteVideo.src = URL.createObjectURL(secondPeer.remoteStreams[0]) 
"blob:http%3A//localhost%3A8082/78e8821f-90b8-4703-b56d-918ec505e5bf" 

現場演示:--- https://muazkh.appspot.com/?page=WebRTC

回答

0

LocalMediaStream正在被MediaStream接口所取代。

simpl.info/pc,在Chrome穩定和金絲雀從控制檯試試這個:

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

這意味着,「遠程流附件」是可能的,山姆,進一步轉發?它一直失敗。實驗顯示它仍然失敗:https://googledrive.com/host/0B6GWd_dUUTT8V1Fodm9WQldkb28/Attaching-Remote-MediaStreams.html -----抱歉沒有主題問題。 – 2013-05-25 01:33:07