Skip to content

Commit

Permalink
fix: test trial for local track
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed May 20, 2024
1 parent c8c28d6 commit d82523c
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class VideoElementManager {
for (const videoElement of this.videoElements) {
if (this.track.enabled) {
this.track.addSink(videoElement, requestLayer);
this.resumeVideoPlayback({ target: videoElement } as unknown as Event);
} else {
this.track.removeSink(videoElement, requestLayer);
}
Expand Down Expand Up @@ -87,12 +86,8 @@ export class VideoElementManager {
private resumeVideoPlayback = (e: Event) => {
const element = e.target as HTMLVideoElement;
if (!document.hidden && isMobile() && element.paused) {
setTimeout(() => {
this.track.addSink(element);
element.play().catch(err => {
HMSLogger.w(this.TAG, `Error resuming video playback for ${this.track.peerId} ${(err as Error).message}`);
});
}, 0);
// add sink again to play the video specially in safari iOS
this.track.addSink(element);
}
};

Expand Down

0 comments on commit d82523c

Please sign in to comment.