[mirotalksfu] - fix, update dep

هذا الالتزام موجود في:
Miroslav Pejic
2024-06-07 15:10:12 +02:00
الأصل f38d848d1d
التزام e728853938
5 ملفات معدلة مع 47 إضافات و7 حذوفات

عرض الملف

@@ -238,7 +238,7 @@ module.exports = class Peer {
producerId: producer_id, producerId: producer_id,
rtpCapabilities, rtpCapabilities,
enableRtx: true, // Enable NACK for OPUS. enableRtx: true, // Enable NACK for OPUS.
paused: false, paused: true,
}); });
const { id, type, kind, rtpParameters, producerPaused } = consumer; const { id, type, kind, rtpParameters, producerPaused } = consumer;

عرض الملف

@@ -42,7 +42,7 @@ dependencies: {
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com * @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.4.46 * @version 1.4.47
* *
*/ */
@@ -1418,6 +1418,38 @@ function startServer() {
callback('successfully'); callback('successfully');
}); });
socket.on('resumeConsumer', async ({ consumer_id }, callback) => {
if (!roomList.has(socket.room_id)) return;
const room = roomList.get(socket.room_id);
const peer_name = getPeerName(room, false);
const peer = room.getPeer(socket.id);
if (!peer) {
return callback({
error: `peer with ID: "${socket.id}" for consumer with id "${consumer_id}" not found`,
});
}
const consumer = peer.getConsumer(consumer_id);
if (!consumer) {
return callback({ error: `consumer with id "${consumer_id}" not found` });
}
try {
await consumer.resume();
} catch (error) {
return callback({ error: error.message });
}
log.debug('Consumer resumed', { peer_name: peer_name, consumer_id: consumer_id });
callback('successfully');
});
socket.on('getProducers', () => { socket.on('getProducers', () => {
if (!roomList.has(socket.room_id)) return; if (!roomList.has(socket.room_id)) return;

عرض الملف

@@ -1,6 +1,6 @@
{ {
"name": "mirotalksfu", "name": "mirotalksfu",
"version": "1.4.46", "version": "1.4.47",
"description": "WebRTC SFU browser-based video calls", "description": "WebRTC SFU browser-based video calls",
"main": "Server.js", "main": "Server.js",
"scripts": { "scripts": {
@@ -58,7 +58,7 @@
"mediasoup-client": "3.7.8", "mediasoup-client": "3.7.8",
"ngrok": "^5.0.0-beta.2", "ngrok": "^5.0.0-beta.2",
"nodemailer": "^6.9.13", "nodemailer": "^6.9.13",
"openai": "^4.48.2", "openai": "^4.49.0",
"qs": "6.12.1", "qs": "6.12.1",
"socket.io": "4.7.5", "socket.io": "4.7.5",
"swagger-ui-express": "5.0.1", "swagger-ui-express": "5.0.1",
@@ -68,6 +68,6 @@
"devDependencies": { "devDependencies": {
"node-fetch": "^3.3.2", "node-fetch": "^3.3.2",
"nodemon": "^3.1.3", "nodemon": "^3.1.3",
"prettier": "3.3.0" "prettier": "3.3.1"
} }
} }

عرض الملف

@@ -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 license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com * @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.4.46 * @version 1.4.47
* *
*/ */

عرض الملف

@@ -9,7 +9,7 @@
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com * @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.4.46 * @version 1.4.47
* *
*/ */
@@ -2064,6 +2064,14 @@ class RoomClient {
this.consumers.set(consumer.id, consumer); this.consumers.set(consumer.id, consumer);
// https://mediasoup.discourse.group/t/create-server-side-consumers-with-paused-true/244
try {
const response = await this.socket.request('resumeConsumer', { consumer_id: consumer.id });
console.log('Consumer resumed', response);
} catch (error) {
console.error('Error resuming consumer', error);
}
consumer.on('trackended', () => { consumer.on('trackended', () => {
console.log('Consumer track end', { id: consumer.id }); console.log('Consumer track end', { id: consumer.id });
this.removeConsumer(consumer.id, consumer.kind); this.removeConsumer(consumer.id, consumer.kind);