web: request keyframes

This commit is contained in:
Maxim Devaev 2022-11-04 19:50:36 +03:00
parent f3632426a6
commit 48118f15ff
2 changed files with 13 additions and 1 deletions

View File

@ -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"

View File

@ -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) {