You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! In example https://demo.ovenplayer.com/demo_input.html I can change audio settings and select "Without audio", but then streaming stopped. I can disable the microphone without stopping the stream?
The text was updated successfully, but these errors were encountered:
kolik29
changed the title
How I can enable/disable the microphone/camera without restarting the stream
How I can enable/disable the microphone/camera without restarting the stream?
Apr 13, 2022
I don't think the demo page does it, but here is what I do in my app. After calling OvenLiveKit.getUserMedia(constraints), you can enable / disable the video or audio track like so:
let videoTrack = userMedia.getVideoTracks()[0];
let audioTrack = userMedia.getAudioTracks()[0];
$("#muteOwnVideo, #muteOwnAudio").off("click");
$("#muteOwnVideo").on("click", () => {
let enabled = videoTrack.enabled;
videoTrack.enabled = !enabled;
let src = enabled ? "./img/icons/camera_off.svg" : "./img/icons/camera_on.svg";
$("#muteOwnVideo").attr("src", src);
});
$("#muteOwnAudio").on("click", () => {
let enabled = audioTrack.enabled;
audioTrack.enabled = !enabled;
let src = enabled ? "./img/icons/mic_muted.svg" : "./img/icons/mic_unmuted.svg";
$("#muteOwnAudio").attr("src", src);
});
Obviously some of this is specific to my app but if you are using JS on the front end feel free to use this as a guiding point.
Hello! In example https://demo.ovenplayer.com/demo_input.html I can change audio settings and select "Without audio", but then streaming stopped. I can disable the microphone without stopping the stream?
The text was updated successfully, but these errors were encountered: