summaryrefslogtreecommitdiff
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
parentf3632426a6f4e9fe6c1b51287c5fb10dd7fb4efe (diff)
web: request keyframes
-rw-r--r--PKGBUILD2
-rw-r--r--web/share/js/kvm/stream.js12
2 files changed, 13 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index da449a27..3d95bf57 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -78,7 +78,7 @@ depends=(
"janus-gateway-pikvm>=0.11.2-7"
certbot
platform-io-access
- "ustreamer>=5.26"
+ "ustreamer>=5.29"
# Systemd UDEV bug
"systemd>=248.3-2"
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) {