[mirotalksfu] - signaling producer pause/resume

هذا الالتزام موجود في:
Miroslav Pejic
2024-03-10 13:53:22 +01:00
الأصل fc3d364156
التزام 4c87a559df
2 ملفات معدلة مع 62 إضافات و5 حذوفات

عرض الملف

@@ -1676,7 +1676,7 @@ class RoomClient {
return elem;
}
pauseProducer(type) {
async pauseProducer(type) {
if (!this.producerLabel.has(type)) {
return console.log('There is no producer for this type ' + type);
}
@@ -1684,6 +1684,13 @@ class RoomClient {
const producer_id = this.producerLabel.get(type);
this.producers.get(producer_id).pause();
try {
const response = await this.socket.request('pauseProducer', { producer_id: producer_id });
console.log('Producer paused', response);
} catch (error) {
console.error('Error pausing producer', error);
}
switch (type) {
case mediaType.audio:
this.event(_EVENTS.pauseAudio);
@@ -1699,7 +1706,7 @@ class RoomClient {
}
}
resumeProducer(type) {
async resumeProducer(type) {
if (!this.producerLabel.has(type)) {
return console.log('There is no producer for this type ' + type);
}
@@ -1707,6 +1714,13 @@ class RoomClient {
const producer_id = this.producerLabel.get(type);
this.producers.get(producer_id).resume();
try {
const response = await this.socket.request('resumeProducer', { producer_id: producer_id });
console.log('Producer resumed', response);
} catch (error) {
console.error('Error resuming producer', error);
}
switch (type) {
case mediaType.audio:
this.event(_EVENTS.resumeAudio);