mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
show streamer name in window title
This commit is contained in:
parent
3e92523ba3
commit
f9d2e747e3
@ -532,7 +532,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<div class="window window-resizable" id="stream-window" data-show-by-button="show-stream-button">
|
<div class="window window-resizable" id="stream-window" data-show-by-button="show-stream-button">
|
||||||
<div class="window-header" id="stream-window-header">
|
<div class="window-header" id="stream-window-header">
|
||||||
<div class="window-grab">Stream</div>
|
<div class="window-grab">MJPEG</div>
|
||||||
<button class="window-button-close">×</button>
|
<button class="window-button-close">×</button>
|
||||||
<button class="window-button-maximize">☐</button>
|
<button class="window-button-maximize">☐</button>
|
||||||
<button class="window-button-original">•</button>
|
<button class="window-button-original">•</button>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
div(id="stream-window" class="window window-resizable" data-show-by-button="show-stream-button")
|
div(id="stream-window" class="window window-resizable" data-show-by-button="show-stream-button")
|
||||||
div(id="stream-window-header" class="window-header")
|
div(id="stream-window-header" class="window-header")
|
||||||
div(class="window-grab") Stream
|
div(class="window-grab") MJPEG
|
||||||
button(class="window-button-close") ×
|
button(class="window-button-close") ×
|
||||||
button(class="window-button-maximize") ☐
|
button(class="window-button-maximize") ☐
|
||||||
button(class="window-button-original") •
|
button(class="window-button-original") •
|
||||||
|
|||||||
@ -45,6 +45,9 @@ function _JanusStreamer(__setActive, __setInactive, __setInfo) {
|
|||||||
|
|
||||||
var __state = null;
|
var __state = null;
|
||||||
|
|
||||||
|
self.getName = () => "WebRTC";
|
||||||
|
self.getMode = () => "janus";
|
||||||
|
|
||||||
self.getResolution = function() {
|
self.getResolution = function() {
|
||||||
let el_video = $("stream-video");
|
let el_video = $("stream-video");
|
||||||
return {
|
return {
|
||||||
@ -292,6 +295,9 @@ function _MjpegStreamer(__setActive, __setInactive, __setInfo) {
|
|||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
|
self.getName = () => "MJPEG";
|
||||||
|
self.getMode = () => "mjpeg";
|
||||||
|
|
||||||
self.getResolution = function() {
|
self.getResolution = function() {
|
||||||
let el_image = $("stream-image");
|
let el_image = $("stream-image");
|
||||||
return {
|
return {
|
||||||
@ -557,10 +563,10 @@ export function Streamer() {
|
|||||||
$("stream-box").classList.toggle("stream-box-offline", !online);
|
$("stream-box").classList.toggle("stream-box-offline", !online);
|
||||||
let el_grab = document.querySelector("#stream-window-header .window-grab");
|
let el_grab = document.querySelector("#stream-window-header .window-grab");
|
||||||
let el_info = $("stream-info");
|
let el_info = $("stream-info");
|
||||||
let title = "Stream – ";
|
let title = `${__streamer.getName()} – `;
|
||||||
if (is_active) {
|
if (is_active) {
|
||||||
if (!online) {
|
if (!online) {
|
||||||
title += "no signal / ";
|
title += "No signal / ";
|
||||||
}
|
}
|
||||||
title += __makeStringResolution(__resolution);
|
title += __makeStringResolution(__resolution);
|
||||||
if (text.length > 0) {
|
if (text.length > 0) {
|
||||||
@ -570,7 +576,7 @@ export function Streamer() {
|
|||||||
if (text.length > 0) {
|
if (text.length > 0) {
|
||||||
title += text;
|
title += text;
|
||||||
} else {
|
} else {
|
||||||
title += "inactive";
|
title += "Inactive";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
el_grab.innerHTML = el_info.innerHTML = title;
|
el_grab.innerHTML = el_info.innerHTML = title;
|
||||||
@ -603,6 +609,7 @@ export function Streamer() {
|
|||||||
var __clickModeRadio = function() {
|
var __clickModeRadio = function() {
|
||||||
if (_Janus !== null) {
|
if (_Janus !== null) {
|
||||||
let mode = tools.radioGetValue("stream-mode-radio");
|
let mode = tools.radioGetValue("stream-mode-radio");
|
||||||
|
if (mode !== __streamer.getMode()) {
|
||||||
setTimeout(() => tools.radioSetValue("stream-mode-radio", mode), 100);
|
setTimeout(() => tools.radioSetValue("stream-mode-radio", mode), 100);
|
||||||
tools.hiddenSetVisible($("stream-image"), (mode === "mjpeg"));
|
tools.hiddenSetVisible($("stream-image"), (mode === "mjpeg"));
|
||||||
tools.hiddenSetVisible($("stream-video"), (mode !== "mjpeg"));
|
tools.hiddenSetVisible($("stream-video"), (mode !== "mjpeg"));
|
||||||
@ -617,6 +624,7 @@ export function Streamer() {
|
|||||||
__streamer.ensureStream(__state);
|
__streamer.ensureStream(__state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var __clickScreenshotButton = function() {
|
var __clickScreenshotButton = function() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user