mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-15 18:50:29 +08:00
moving to janus 1.x
This commit is contained in:
parent
9ef1a3665a
commit
f5de6a0f2e
4
PKGBUILD
4
PKGBUILD
@ -89,11 +89,11 @@ depends=(
|
|||||||
iproute2
|
iproute2
|
||||||
dnsmasq
|
dnsmasq
|
||||||
ipmitool
|
ipmitool
|
||||||
"janus-gateway-pikvm>=0.14.2-3"
|
"janus-gateway-pikvm>=1.3.0"
|
||||||
certbot
|
certbot
|
||||||
platform-io-access
|
platform-io-access
|
||||||
raspberrypi-utils
|
raspberrypi-utils
|
||||||
"ustreamer>=6.16"
|
"ustreamer>=6.21-2"
|
||||||
|
|
||||||
# Systemd UDEV bug
|
# Systemd UDEV bug
|
||||||
"systemd>=248.3-2"
|
"systemd>=248.3-2"
|
||||||
|
|||||||
@ -152,6 +152,16 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __orient, _
|
|||||||
el.srcObject = new MediaStream();
|
el.srcObject = new MediaStream();
|
||||||
}
|
}
|
||||||
el.srcObject.addTrack(track);
|
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) {
|
var __removeTrack = function(track) {
|
||||||
@ -246,12 +256,8 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __orient, _
|
|||||||
__handle.createAnswer({
|
__handle.createAnswer({
|
||||||
"jsep": jsep,
|
"jsep": jsep,
|
||||||
|
|
||||||
// Janus 1.x
|
|
||||||
"tracks": tracks,
|
"tracks": tracks,
|
||||||
|
|
||||||
// Janus 0.x
|
|
||||||
"media": {"audioSend": false, "videoSend": false, "data": false},
|
|
||||||
|
|
||||||
// Chrome is playing OPUS as mono without this hack
|
// Chrome is playing OPUS as mono without this hack
|
||||||
// - https://issues.webrtc.org/issues/41481053 - IT'S NOT FIXED!
|
// - https://issues.webrtc.org/issues/41481053 - IT'S NOT FIXED!
|
||||||
// - https://github.com/ossrs/srs/pull/2683/files
|
// - 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() {
|
"oncleanup": function() {
|
||||||
__logInfo("Got a cleanup notification");
|
__logInfo("Got a cleanup notification");
|
||||||
__stopInfoInterval();
|
__stopInfoInterval();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user