Skip to content

Commit

Permalink
fix: add to paused tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed May 21, 2024
1 parent f62e4de commit 6903b7d
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { HMSRemoteAudioTrack } from '../media/tracks';
import { HMSRemotePeer } from '../sdk/models/peer';
import { Store } from '../sdk/store';
import HMSLogger from '../utils/logger';
import { isMobile } from '../utils/support';
import { sleep } from '../utils/timer-utils';

/**
Expand Down Expand Up @@ -120,13 +119,7 @@ export class AudioSinkManager {
HMSLogger.d(this.TAG, 'Audio Paused', event.target.id);
const audioTrack = this.store.getTrackById(event.target.id);
if (audioTrack) {
if (isMobile()) {
// Play after a delay since mobile devices don't call onDevice change event
await sleep(500);
this.playAudioFor(audioTrack as HMSRemoteAudioTrack);
} else {
this.autoPausedTracks.add(audioTrack as HMSRemoteAudioTrack);
}
this.autoPausedTracks.add(audioTrack as HMSRemoteAudioTrack);
}
};

Expand Down

0 comments on commit 6903b7d

Please sign in to comment.