MCPcopy
hub / github.com/feross/simple-peer / addStream

Method addStream

index.js:281–289  ·  view source on GitHub ↗

* Add a MediaStream to the connection. * @param {MediaStream} stream

(stream)

Source from the content-addressed store, hash-verified

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.

Callers 3

constructorMethod · 0.95
negotiation.jsFile · 0.45
multistream.jsFile · 0.45

Calls 2

_debugMethod · 0.95
addTrackMethod · 0.95

Tested by

no test coverage detected