summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-11-28 13:46:00 +0300
committerMaxim Devaev <[email protected]>2022-11-28 13:46:00 +0300
commit31bb5e4308fe7de9ede86ddc26b5cba18491bb43 (patch)
treeb60d192f3dfd672d906df52557f908c3b1aa7ba2
parent154560b4e0c71e407b8335fd2c51ff8a654bb31d (diff)
web: janus features request
-rw-r--r--web/share/js/kvm/stream.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index c84e8719..34715ae3 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -179,6 +179,8 @@ function _JanusStreamer(__setActive, __setInactive, __setInfo) {
} else if (msg.result.status === "stopped") {
__setInactive();
__setInfo(false, false, "");
+ } else if (msg.result.status === "features") {
+ __setAudioEnabled(msg.result.features.audio);
}
} else if (msg.error_code || msg.error) {
__logError("Got uStreamer error message:", msg.error_code, "-", msg.error);
@@ -219,7 +221,6 @@ function _JanusStreamer(__setActive, __setInactive, __setInfo) {
"onremotestream": function(stream) {
__logInfo("Got a remote stream:", stream);
- __setAudioEnabled(!!stream.getAudioTracks().length);
_Janus.attachMediaStream($("stream-video"), stream);
__sendKeyRequired();
__startInfoInterval();
@@ -292,7 +293,8 @@ function _JanusStreamer(__setActive, __setInactive, __setInfo) {
var __sendWatch = function() {
if (__handle) {
- __logInfo("Sending WATCH ...");
+ __logInfo("Sending WATCH + FEATURES ...");
+ __handle.send({"message": {"request": "features"}});
__handle.send({"message": {"request": "watch", "params": {"audio": true}}});
}
};