* Add a MediaStream to the connection. * @param {MediaStream} stream
(stream)
| 279 | * @param {MediaStream} stream |
| 280 | */ |
| 281 | addStream (stream) { |
| 282 | if (this.destroying) return |
| 283 | if (this.destroyed) throw errCode(new Error('cannot addStream after peer is destroyed'), 'ERR_DESTROYED') |
| 284 | this._debug('addStream()') |
| 285 | |
| 286 | stream.getTracks().forEach(track => { |
| 287 | this.addTrack(track, stream) |
| 288 | }) |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * Add a MediaStreamTrack to the connection. |
no test coverage detected