【发布时间】:2013-05-22 02:35:33
【问题描述】:
我想知道在接收到的流 onaddstream 回调中是否存在轨道。视频通话效果很好,但我想做。仅音频调用,所以我只是在 getUserMedia 约束中传递了audio:true,video:false,现在当我收到流时,我无法确定流中的轨道存在。
如何知道曲目在流中的存在?
【问题讨论】:
-
你试过getAudioTracks().length吗?
-
我怎么知道没有 VideoTracks?
-
getVideoTracks().length 或 "a=mid:video" 在 peer.remoteDescription.sdp 中的存在
-
希望你设置 OfferToReceiveAudio:true 和 OfferToReceiveVideo:false --- 像这样:github.com/muaz-khan/WebRTC-Experiment/blob/master/RTCall/…
-
所以如果长度为 0 那应该只是音频
标签: javascript html html5-video html5-audio webrtc