mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 17:20:30 +08:00
web: request keyframes
This commit is contained in:
parent
f3632426a6
commit
48118f15ff
2
PKGBUILD
2
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"
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user