summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2025-01-05 20:48:35 +0200
committerMaxim Devaev <[email protected]>2025-01-05 20:48:35 +0200
commitf5de6a0f2e4ddb0dbb641b1e1e283a2c4cebb4a1 (patch)
tree519a0cffac1e8f4b6c698bf9ea62d3918e8bfe2a
parent9ef1a3665a5f15bb3b58ed4818c77dc2d978d5be (diff)
moving to janus 1.x
-rw-r--r--PKGBUILD4
-rw-r--r--web/share/js/kvm/stream_janus.js58
2 files changed, 12 insertions, 50 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 55281e41..7a019680 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -89,11 +89,11 @@ depends=(
iproute2
dnsmasq
ipmitool
- "janus-gateway-pikvm>=0.14.2-3"
+ "janus-gateway-pikvm>=1.3.0"
certbot
platform-io-access
raspberrypi-utils
- "ustreamer>=6.16"
+ "ustreamer>=6.21-2"
# Systemd UDEV bug
"systemd>=248.3-2"
diff --git a/web/share/js/kvm/stream_janus.js b/web/share/js/kvm/stream_janus.js
index df7c48f1..09ee75da 100644
--- a/web/share/js/kvm/stream_janus.js
+++ b/web/share/js/kvm/stream_janus.js
@@ -152,6 +152,16 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __orient, _
el.srcObject = new MediaStream();
}
el.srcObject.addTrack(track);
+ // FIXME: Задержка уменьшается, но начинаются заикания на кейфреймах.
+ // XXX: Этот пример переехал из януса 0.x, перед использованием адаптировать к 1.x.
+ // - https://github.com/Glimesh/janus-ftl-plugin/issues/101
+ /*if (__handle && __handle.webrtcStuff && __handle.webrtcStuff.pc) {
+ for (let receiver of __handle.webrtcStuff.pc.getReceivers()) {
+ if (receiver.track && receiver.track.kind === "video" && receiver.playoutDelayHint !== undefined) {
+ receiver.playoutDelayHint = 0;
+ }
+ }
+ }*/
};
var __removeTrack = function(track) {
@@ -246,12 +256,8 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __orient, _
__handle.createAnswer({
"jsep": jsep,
- // Janus 1.x
"tracks": tracks,
- // Janus 0.x
- "media": {"audioSend": false, "videoSend": false, "data": false},
-
// Chrome is playing OPUS as mono without this hack
// - https://issues.webrtc.org/issues/41481053 - IT'S NOT FIXED!
// - https://github.com/ossrs/srs/pull/2683/files
@@ -292,50 +298,6 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __orient, _
}
},
- // Janus 0.x
- "onremotestream": function(stream) {
- if (stream === null) {
- // https://github.com/pikvm/pikvm/issues/1084
- // Этого вообще не должно происходить, но почему-то янусу в unmute
- // может прилететь null-эвент. Костыляем, наблюдаем.
- __logError("Got invalid onremotestream(null). Restarting Janus...");
- __destroyJanus();
- return;
- }
-
- let tracks = stream.getTracks();
- __logInfo("Got a remote stream changes:", stream, tracks);
-
- let has_video = false;
- for (let track of tracks) {
- if (track.kind == "video") {
- has_video = true;
- break;
- }
- }
-
- if (!has_video && __isOnline()) {
- // Chrome sends `muted` notifiation for tracks in `disconnected` ICE state
- // and Janus.js just removes muted track from list of available tracks.
- // But track still exists actually so it's safe to just ignore that case.
- return;
- }
-
- _Janus.attachMediaStream($("stream-video"), stream);
- __sendKeyRequired();
- __startInfoInterval();
-
- // FIXME: Задержка уменьшается, но начинаются заикания на кейфреймах.
- // - https://github.com/Glimesh/janus-ftl-plugin/issues/101
- /*if (__handle && __handle.webrtcStuff && __handle.webrtcStuff.pc) {
- for (let receiver of __handle.webrtcStuff.pc.getReceivers()) {
- if (receiver.track && receiver.track.kind === "video" && receiver.playoutDelayHint !== undefined) {
- receiver.playoutDelayHint = 0;
- }
- }
- }*/
- },
-
"oncleanup": function() {
__logInfo("Got a cleanup notification");
__stopInfoInterval();