diff options
author | Maxim Devaev <[email protected]> | 2024-12-25 09:16:59 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2024-12-25 09:16:59 +0200 |
commit | ab08d823c4feeb58e37591adf1ac40a07362733b (patch) | |
tree | ab2bb3c4aa35ae2efd72486e78d1a8a8d6c40be3 /web/share/js/kvm/stream_janus.js | |
parent | eda7ab3a49efeee6a55546e2ec51364c8dc81307 (diff) |
pikvm/pikvm#1440: Websocket-based transport and decoding for H.264
Diffstat (limited to 'web/share/js/kvm/stream_janus.js')
-rw-r--r-- | web/share/js/kvm/stream_janus.js | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/web/share/js/kvm/stream_janus.js b/web/share/js/kvm/stream_janus.js index 27d3f55d..df7c48f1 100644 --- a/web/share/js/kvm/stream_janus.js +++ b/web/share/js/kvm/stream_janus.js @@ -32,6 +32,8 @@ var _Janus = null; export function JanusStreamer(__setActive, __setInactive, __setInfo, __orient, __allow_audio) { var self = this; + /************************************************************************/ + var __stop = false; var __ensuring = false; @@ -45,10 +47,12 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __orient, _ var __state = null; var __frames = 0; + /************************************************************************/ + self.getOrientation = () => __orient; self.isAudioAllowed = () => __allow_audio; - self.getName = () => (__allow_audio ? "H.264 + Audio" : "H.264"); + self.getName = () => (__allow_audio ? "WebRTC H.264 + Audio" : "WebRTC H.264"); self.getMode = () => "janus"; self.getResolution = function() { @@ -75,9 +79,9 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __orient, _ var __ensureJanus = function(internal) { if (__janus === null && !__stop && (!__ensuring || internal)) { + __ensuring = true; __setInactive(); __setInfo(false, false, ""); - __ensuring = true; __logInfo("Starting Janus ..."); __janus = new _Janus({ "server": `${tools.is_https ? "wss" : "ws"}://${location.host}/janus/ws`, @@ -447,11 +451,3 @@ JanusStreamer.ensure_janus = function(callback) { JanusStreamer.is_webrtc_available = function() { return !!window.RTCPeerConnection; }; - -JanusStreamer.is_h264_available = function() { - let ok = true; - if ($("stream-video").canPlayType) { - ok = $("stream-video").canPlayType("video/mp4; codecs=\"avc1.42E01F\""); - } - return ok; -}; |