mediasoup-client
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -280,8 +280,2 @@ import Logger from './Logger'; | ||
} | ||
else if (!this._handled) | ||
{ | ||
logger.error('pause() | Consumer not handled'); | ||
return false; | ||
} | ||
else if (this._locallyPaused) | ||
@@ -293,5 +287,9 @@ { | ||
this._locallyPaused = true; | ||
this._track.enabled = false; | ||
this.emit('@pause', appData); | ||
if (this._track) | ||
this._track.enabled = false; | ||
if (this._handled) | ||
this.emit('@pause', appData); | ||
this.safeEmit('paused', 'local', appData); | ||
@@ -343,8 +341,2 @@ | ||
} | ||
else if (!this._handled) | ||
{ | ||
logger.error('pause() | Consumer not handled'); | ||
return false; | ||
} | ||
else if (!this._locallyPaused) | ||
@@ -357,7 +349,8 @@ { | ||
this.emit('@resume', appData); | ||
if (!this._remotelyPaused) | ||
if (this._track && !this._remotelyPaused) | ||
this._track.enabled = true; | ||
if (this._handled) | ||
this.emit('@resume', appData); | ||
this.safeEmit('resumed', 'local', appData); | ||
@@ -386,4 +379,4 @@ | ||
if (!this._locallyPaused && this._track) | ||
this._track.enabled = false; | ||
if (this._track && !this._locallyPaused) | ||
this._track.enabled = true; | ||
@@ -410,3 +403,3 @@ this.safeEmit('resumed', 'remote', appData); | ||
* | ||
* @param {Boolean|String} flag - If 'tmp' (String) it's considered as termporal. | ||
* @param {Boolean|String} flag - If 'tmp' it's considered temporal. | ||
* @param {track} MediaStreamTrack | ||
@@ -413,0 +406,0 @@ */ |
@@ -263,8 +263,2 @@ import Logger from './Logger'; | ||
} | ||
else if (!this._handled) | ||
{ | ||
logger.error('pause() | Producer not handled'); | ||
return false; | ||
} | ||
else if (this._locallyPaused) | ||
@@ -278,3 +272,5 @@ { | ||
this.emit('@pause', appData); | ||
if (this._handled) | ||
this.emit('@pause', appData); | ||
this.safeEmit('paused', 'local', appData); | ||
@@ -298,3 +294,3 @@ | ||
if (this._closed || !this._handled || this._remotelyPaused) | ||
if (this._closed || this._remotelyPaused) | ||
return; | ||
@@ -325,8 +321,2 @@ | ||
} | ||
else if (!this._handled) | ||
{ | ||
logger.error('pause() | Producer not handled'); | ||
return false; | ||
} | ||
else if (!this._locallyPaused) | ||
@@ -339,7 +329,8 @@ { | ||
this.emit('@resume', appData); | ||
if (!this._remotelyPaused) | ||
this._track.enabled = true; | ||
if (this._handled) | ||
this.emit('@resume', appData); | ||
this.safeEmit('resumed', 'local', appData); | ||
@@ -363,3 +354,3 @@ | ||
if (this._closed || !this._handled || !this._remotelyPaused) | ||
if (this._closed || !this._remotelyPaused) | ||
return; | ||
@@ -380,3 +371,3 @@ | ||
* | ||
* @param {Boolean|String} flag - If 'tmp' (String) it's considered as termporal. | ||
* @param {Boolean|String} flag - If 'tmp' it's considered temporal. | ||
* @param {RTCRtpParameters} rtpParameters | ||
@@ -383,0 +374,0 @@ */ |
@@ -674,2 +674,5 @@ import Logger from './Logger'; | ||
if (!peer) | ||
throw new Error(`no Peer found [name:"${peerName}"]`); | ||
const consumer = peer.getConsumerById(id); | ||
@@ -676,0 +679,0 @@ |
@@ -367,2 +367,3 @@ import Logger from './Logger'; | ||
rtpParameters : rtpParameters, | ||
paused : producer.locallyPaused, | ||
appData : producer.appData | ||
@@ -427,3 +428,4 @@ }; | ||
{ | ||
id : consumer.id | ||
id : consumer.id, | ||
paused : consumer.locallyPaused | ||
}; | ||
@@ -430,0 +432,0 @@ |
@@ -142,2 +142,3 @@ # Messages | ||
rtpParameters: {}, | ||
paused: false, | ||
appData: Any | ||
@@ -214,3 +215,4 @@ } | ||
method: 'enableConsumer', | ||
id: 3333 | ||
id: 3333, | ||
paused: false | ||
} | ||
@@ -217,0 +219,0 @@ ``` |
{ | ||
"name": "mediasoup-client", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "mediasoup client SDK for mediasoup 2.X", | ||
@@ -5,0 +5,0 @@ "author": "Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)", |
@@ -42,3 +42,3 @@ # mediasoup-client | ||
// Handle Peers already in to the Room. | ||
for (let peer of peers) | ||
for (const peer of peers) | ||
{ | ||
@@ -108,3 +108,3 @@ handlePeer(peer); | ||
{ | ||
channel.send({ type: 'mediasoup-notification', body: notification }) | ||
channel.send({ type: 'mediasoup-notification', body: notification }); | ||
}); | ||
@@ -132,3 +132,3 @@ | ||
// Handle all the Consumers in the Peer. | ||
for (let consumer of peer.consumers) | ||
for (const consumer of peer.consumers) | ||
{ | ||
@@ -162,2 +162,4 @@ handleConsumer(consumer); | ||
console.log('receiving a new remote MediaStreamTrack'); | ||
// Attach the track to a MediaStream and play it. | ||
}); | ||
@@ -164,0 +166,0 @@ |
# TODO | ||
* We are allowing calling `room.join()` after closed, but this means that events are also duplicated when re-joined! NOTE: This is a user error, but must document it. | ||
* Properly match H264 parameters. | ||
@@ -4,0 +6,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
161166
181
0
5718