javascript - How to update from addStream to addTrack correctly? - Stack Overflow

I am using webrtc-adapter v2.0.8, when I update my codes fromthis.peerConnection.addStream(this.myStrea

I am using webrtc-adapter v2.0.8, when I update my codes from

this.peerConnection.addStream(this.myStream);

to

this.myStream.getTracks().forEach(track => this.peerConnection.addTrack(track, this.myStream));

based on the demo. I got the error

getUserMedia: TypeError: _this.peerConnection.addTrack is not a function

in my browser (Chrome 56.0.2906.0 dev) console.

How can I use addTrack correctly? Thanks

I am using webrtc-adapter v2.0.8, when I update my codes from

this.peerConnection.addStream(this.myStream);

to

this.myStream.getTracks().forEach(track => this.peerConnection.addTrack(track, this.myStream));

based on the demo. I got the error

getUserMedia: TypeError: _this.peerConnection.addTrack is not a function

in my browser (Chrome 56.0.2906.0 dev) console.

How can I use addTrack correctly? Thanks

Share Improve this question asked Nov 23, 2016 at 5:27 Hongbo MiaoHongbo Miao 50.3k67 gold badges203 silver badges328 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

UPDATE on July 15, 2019: Checked again today. Chrome 64 has support already.


Chrome has not supported addTrack yet:

https://bugs.chromium/p/chromium/issues/detail?id=705901

Also check Browser patibility section here.

Try: this.peer.addStream(this.myStream)

Note: peer object has a method 'addStream' which accepts stream object as a parameter

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745150974a4613866.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信