-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
968ca95
commit 98e5bf2
Showing
6 changed files
with
36 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ dev dependencies: { | |
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon | ||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 | ||
* @author Miroslav Pejic - [email protected] | ||
* @version 1.6.63 | ||
* @version 1.6.64 | ||
* | ||
*/ | ||
|
||
|
@@ -1674,7 +1674,7 @@ function startServer() { | |
} | ||
}); | ||
|
||
socket.on('consume', async ({ consumerTransportId, producerId, rtpCapabilities }, callback) => { | ||
socket.on('consume', async ({ consumerTransportId, producerId, rtpCapabilities, type }, callback) => { | ||
if (!roomExists(socket)) { | ||
return callback({ error: 'Room not found' }); | ||
} | ||
|
@@ -1684,10 +1684,11 @@ function startServer() { | |
const { peer_name } = peer || 'undefined'; | ||
|
||
try { | ||
const params = await room.consume(socket.id, consumerTransportId, producerId, rtpCapabilities); | ||
const params = await room.consume(socket.id, consumerTransportId, producerId, rtpCapabilities, type); | ||
|
||
log.debug('Consuming', { | ||
peer_name: peer_name, | ||
producer_type: type, | ||
producer_id: producerId, | ||
consumer_id: params ? params.id : undefined, | ||
}); | ||
|
@@ -1711,89 +1712,89 @@ function startServer() { | |
room.closeProducer(socket.id, data.producer_id); | ||
}); | ||
|
||
socket.on('pauseProducer', async ({ producer_id }, callback) => { | ||
socket.on('pauseProducer', async ({ producer_id, type }, callback) => { | ||
if (!roomExists(socket)) return; | ||
|
||
const peer = getPeer(socket); | ||
|
||
if (!peer) { | ||
return callback({ | ||
error: `Peer with ID: ${socket.id} for producer with id "${producer_id}" not found`, | ||
error: `Peer with ID: ${socket.id} for producer with id "${producer_id}" type "${type}" not found`, | ||
}); | ||
} | ||
|
||
const producer = peer.getProducer(producer_id); | ||
|
||
if (!producer) { | ||
return callback({ error: `Producer with id "${producer_id}" not found` }); | ||
return callback({ error: `Producer with id "${producer_id}" type "${type}" not found` }); | ||
} | ||
|
||
try { | ||
await producer.pause(); | ||
|
||
const { peer_name } = peer || 'undefined'; | ||
|
||
log.debug('Producer paused', { peer_name: peer_name, producer_id: producer_id }); | ||
log.debug('Producer paused', { peer_name, producer_id, type }); | ||
|
||
callback('successfully'); | ||
} catch (error) { | ||
callback({ error: error.message }); | ||
} | ||
}); | ||
|
||
socket.on('resumeProducer', async ({ producer_id }, callback) => { | ||
socket.on('resumeProducer', async ({ producer_id, type }, callback) => { | ||
if (!roomExists(socket)) return; | ||
|
||
const peer = getPeer(socket); | ||
|
||
if (!peer) { | ||
return callback({ | ||
error: `peer with ID: "${socket.id}" for producer with id "${producer_id}" not found`, | ||
error: `peer with ID: "${socket.id}" for producer with id "${producer_id}" type "${type}" not found`, | ||
}); | ||
} | ||
|
||
const producer = peer.getProducer(producer_id); | ||
|
||
if (!producer) { | ||
return callback({ error: `producer with id "${producer_id}" not found` }); | ||
return callback({ error: `producer with id "${producer_id}" type "${type}" not found` }); | ||
} | ||
|
||
try { | ||
await producer.resume(); | ||
|
||
const { peer_name } = peer || 'undefined'; | ||
|
||
log.debug('Producer resumed', { peer_name: peer_name, producer_id: producer_id }); | ||
log.debug('Producer resumed', { peer_name, producer_id, type }); | ||
|
||
callback('successfully'); | ||
} catch (error) { | ||
callback({ error: error.message }); | ||
} | ||
}); | ||
|
||
socket.on('resumeConsumer', async ({ consumer_id }, callback) => { | ||
socket.on('resumeConsumer', async ({ consumer_id, type }, callback) => { | ||
if (!roomExists(socket)) return; | ||
|
||
const peer = getPeer(socket); | ||
|
||
if (!peer) { | ||
return callback({ | ||
error: `peer with ID: "${socket.id}" for consumer with id "${consumer_id}" not found`, | ||
error: `peer with ID: "${socket.id}" for consumer with id "${consumer_id}" type "${type}" not found`, | ||
}); | ||
} | ||
|
||
const consumer = peer.getConsumer(consumer_id); | ||
|
||
if (!consumer) { | ||
return callback({ error: `consumer with id "${consumer_id}" not found` }); | ||
return callback({ error: `consumer with id "${consumer_id}" type "${type}" not found` }); | ||
} | ||
|
||
try { | ||
await consumer.resume(); | ||
|
||
const { peer_name } = peer || 'undefined'; | ||
|
||
log.debug('Consumer resumed', { peer_name: peer_name, consumer_id: consumer_id }); | ||
log.debug('Consumer resumed', { peer_name, consumer_id, type }); | ||
|
||
callback('successfully'); | ||
} catch (error) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h | |
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon | ||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 | ||
* @author Miroslav Pejic - [email protected] | ||
* @version 1.6.63 | ||
* @version 1.6.64 | ||
* | ||
*/ | ||
|
||
|
@@ -4618,7 +4618,7 @@ function showAbout() { | |
imageUrl: image.about, | ||
customClass: { image: 'img-about' }, | ||
position: 'center', | ||
title: 'WebRTC SFU v1.6.63', | ||
title: 'WebRTC SFU v1.6.64', | ||
html: ` | ||
<br /> | ||
<div id="about"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon | ||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 | ||
* @author Miroslav Pejic - [email protected] | ||
* @version 1.6.63 | ||
* @version 1.6.64 | ||
* | ||
*/ | ||
|
||
|
@@ -2051,7 +2051,7 @@ class RoomClient { | |
this.producers.get(producer_id).pause(); | ||
|
||
try { | ||
const response = await this.socket.request('pauseProducer', { producer_id: producer_id }); | ||
const response = await this.socket.request('pauseProducer', { producer_id, type }); | ||
console.log('Producer paused', response); | ||
} catch (error) { | ||
console.error('Error pausing producer', error); | ||
|
@@ -2082,7 +2082,7 @@ class RoomClient { | |
this.producers.get(producer_id).resume(); | ||
|
||
try { | ||
const response = await this.socket.request('resumeProducer', { producer_id: producer_id }); | ||
const response = await this.socket.request('resumeProducer', { producer_id, type }); | ||
console.log('Producer resumed', response); | ||
} catch (error) { | ||
console.error('Error resuming producer', error); | ||
|
@@ -2286,9 +2286,10 @@ class RoomClient { | |
|
||
try { | ||
data = await this.socket.request('consume', { | ||
rtpCapabilities, | ||
consumerTransportId: this.consumerTransport.id, | ||
rtpCapabilities, | ||
producerId, | ||
type, | ||
}); | ||
|
||
if (data.error) { | ||
|