Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update from addStream to addTrack correctly?

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

like image 984
Hongbo Miao Avatar asked Nov 23 '16 05:11

Hongbo Miao


1 Answers

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


Chrome has not supported addTrack yet:

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

Also check Browser compatibility section here.

like image 176
Hongbo Miao Avatar answered Oct 20 '22 00:10

Hongbo Miao