mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
unmute me
This commit is contained in:
@@ -29,12 +29,19 @@ function buildAuthHeader(token) {
|
||||
}
|
||||
|
||||
export class WhepPlayer {
|
||||
constructor({ url, token, video, onStatus, audioOnly = false, receiveAudio = true }) {
|
||||
constructor({ url, token, video, onStatus, audioOnly = false, receiveAudio = true, startMuted = null }) {
|
||||
this.url = url;
|
||||
this.token = token;
|
||||
this.video = video;
|
||||
this.audioOnly = audioOnly;
|
||||
this.receiveAudio = receiveAudio;
|
||||
/*
|
||||
Browser autoplay usually requires normal video streams to start muted,
|
||||
while audio-only streams need to start audible. Keep that historical
|
||||
default, but allow a caller that is already behind a user gesture, such as
|
||||
the PTZ fullscreen controller, to request audible inline audio.
|
||||
*/
|
||||
this.startMuted = startMuted === null ? !audioOnly : Boolean(startMuted);
|
||||
this.pc = null;
|
||||
this.abortController = null;
|
||||
this.onStatus = onStatus;
|
||||
@@ -50,7 +57,7 @@ export class WhepPlayer {
|
||||
if (!this.video) return;
|
||||
this.video.playsInline = true;
|
||||
this.video.autoplay = true;
|
||||
this.video.muted = this.audioOnly ? false : true;
|
||||
this.video.muted = this.startMuted;
|
||||
if (typeof this.video.disableRemotePlayback !== 'undefined') {
|
||||
this.video.disableRemotePlayback = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user