File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,12 @@ export class GroupCallError extends Error {
5959 }
6060}
6161
62+ export class OtherUserSpeakingError extends Error {
63+ constructor ( ) {
64+ super ( "Cannot unmute: another user is speaking" ) ;
65+ }
66+ }
67+
6268export interface IGroupCallDataChannelOptions {
6369 ordered : boolean ;
6470 maxPacketLifeTime : number ;
@@ -408,6 +414,12 @@ export class GroupCall extends EventEmitter {
408414
409415 // set a timer for the maximum transmit time on PTT calls
410416 if ( this . isPtt ) {
417+ // if anoher user is currently unmuted, we can't unmute
418+ if ( ! muted && this . userMediaFeeds . some ( f => ! f . isAudioMuted ( ) ) ) {
419+ throw new OtherUserSpeakingError ( ) ;
420+ }
421+
422+ // Set or clear the max transmit timer
411423 if ( ! muted && this . isMicrophoneMuted ( ) ) {
412424 this . transmitTimer = setTimeout ( ( ) => {
413425 this . setMicrophoneMuted ( true ) ;
You can’t perform that action at this time.
0 commit comments