summaryrefslogtreecommitdiff
path: root/web/share/js
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-11-04 19:50:36 +0300
committerMaxim Devaev <[email protected]>2022-11-04 19:50:39 +0300
commit48118f15ff3cd00e93876ede275837d6b11fd45e (patch)
tree3843e90387092d2f4061c97bd37a9fb95eec69f2 /web/share/js
parentf3632426a6f4e9fe6c1b51287c5fb10dd7fb4efe (diff)
web: request keyframes
Diffstat (limited to 'web/share/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 5b2862dc..1a780845 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -162,6 +162,9 @@ function _JanusStreamer(__setActive, __setInactive, __setInfo) {
webrtcState: function(up) {
__logInfo("Janus says our WebRTC PeerConnection is", (up ? "up" : "down"), "now");
+ if (up) {
+ __sendKeyRequired();
+ }
},
onmessage: function(msg, jsep) {
@@ -217,6 +220,7 @@ function _JanusStreamer(__setActive, __setInactive, __setInfo) {
__logInfo("Got a remote stream:", stream);
__setAudioEnabled(!!stream.getAudioTracks().length);
_Janus.attachMediaStream($("stream-video"), stream);
+ __sendKeyRequired();
__startInfoInterval();
// FIXME: Задержка уменьшается, но начинаются заикания на кейфреймах.
// - https://github.com/Glimesh/janus-ftl-plugin/issues/101
@@ -283,6 +287,14 @@ function _JanusStreamer(__setActive, __setInactive, __setInfo) {
}
};
+ var __sendKeyRequired = function() {
+ if (__handle) {
+ // На этом шаге мы говорим что стрим пошел и надо запросить кейфрейм
+ __logInfo("Sending KEY_REQUIRED ...");
+ __handle.send({message: {request: "key_required"}});
+ }
+ };
+
var __sendStop = function() {
__stopInfoInterval();
if (__handle) {