summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/stream.js
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-06-01 09:32:45 +0300
committerMaxim Devaev <[email protected]>2022-06-01 09:32:45 +0300
commit08b7c577d7f00e037b84f9aca6c714edc4774a07 (patch)
tree7ae6b78c1f9482a0eceb26b9fd8a9559557ec8b7 /web/share/js/kvm/stream.js
parentfd256852bf78f6afe04c53c583a560622124baff (diff)
webrtc audio draft
Diffstat (limited to 'web/share/js/kvm/stream.js')
-rw-r--r--web/share/js/kvm/stream.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index 4d432fb4..e2e03715 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -124,6 +124,7 @@ function _JanusStreamer(__setActive, __setInactive, __setInfo) {
__handle.webrtcStuff.remoteStream = null;
}
$("stream-video").srcObject = null;
+ __setAudioEnabled(false);
if (__janus !== null) {
__janus.destroy();
}
@@ -214,6 +215,7 @@ function _JanusStreamer(__setActive, __setInactive, __setInfo) {
onremotestream: function(stream) {
__logInfo("Got a remote stream:", stream);
+ __setAudioEnabled(!!stream.getAudioTracks());
_Janus.attachMediaStream($("stream-video"), stream);
__startInfoInterval();
},
@@ -225,6 +227,10 @@ function _JanusStreamer(__setActive, __setInactive, __setInfo) {
});
};
+ var __setAudioEnabled = function(enabled) {
+ tools.feature.setEnabled($("stream-audio"), enabled);
+ };
+
var __startInfoInterval = function() {
__stopInfoInterval();
__setActive();
@@ -447,6 +453,12 @@ export function Streamer() {
tools.radio.setOnClick("stream-mode-radio", __clickModeRadio, false);
+ tools.slider.setParams($("stream-audio-volume-slider"), 0, 100, 1, 0, function(value) {
+ $("stream-video").muted = !value;
+ $("stream-video").volume = value / 100;
+ $("stream-audio-volume-value").innerHTML = value + "%";
+ });
+
tools.el.setOnClick($("stream-screenshot-button"), __clickScreenshotButton);
tools.el.setOnClick($("stream-reset-button"), __clickResetButton);