mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
UI and Web updates (#1421)
* Stop Web-Capture when priority changes * Remote control UI: Treat duration=0 as endless * Stop Web-Capture on non-Image events changes * LED Matrix Layout - Support vertical cabling direction * Additional Yeelight models * Treat http headers case insensitive * Update change log * Treat http headers case insensitive (consider Qt version) * API - Consider provided format when setImage * UI - Support Boblight configuration per LED instance * Support multiple Boblight clients with different priorities * Update changelog * Simplify isGUI rules allowing for QT only builds * Sysinfo: Fix indents * LED-Devices: Show warning, if get properties failed * Qt-Grabber: Fixed position handling of multiple monitors * LED layout: Remove indention limitations * Yeelight: Test YLTD003 * hyperion-remote: Provide image filename to muxer/UI * Refactor PriorityMuxer and related * Temp: Build under Windows 2019 * Yeelight: Remove YLTD003 as it is not working without additional changes * Test Windows-latest with out removing redistributables/new MSVC * correct workflows * correct CI script * Build Windows with Qt 5.15.2 * Priority Muxer: Updates after testing * Fix Typo * Update BGHandler * QTGrabber - Reactivate windows code to avoid cursor issues * Emit prioritiesChanged when autoselect was changed by user Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></h3>
|
||||
<h3 class="page-header"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_instcapture_conf_token">Capturing Hardware</span></h3>
|
||||
|
||||
<div class="panel panel-default" style="border:0px;">
|
||||
<div class="panel-heading panel-instance" style="border-radius:3px; border-bottom:0px;">
|
||||
|
@@ -199,14 +199,14 @@
|
||||
<label class="ltdlabel" for="ip_cl_ptl" data-i18n="conf_leds_layout_ptl">Point Top Left</label>
|
||||
</td>
|
||||
<td class="itd input-group">
|
||||
<input class="form-control ledCLconstr" id="ip_cl_ptlh" type="number" value="0" min="0" max="40" step="1"></input>
|
||||
<input class="form-control ledCLconstr" id="ip_cl_ptlh" type="number" value="0" min="0" max="100" step="1"></input>
|
||||
<div class="input-group-addon" data-i18n="edt_append_percent_h">%h</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="ltd"></td>
|
||||
<td class="itd input-group">
|
||||
<input class="form-control ledCLconstr" id="ip_cl_ptlv" type="number" value="0" min="0" max="40" step="1"></input>
|
||||
<input class="form-control ledCLconstr" id="ip_cl_ptlv" type="number" value="0" min="0" max="100" step="1"></input>
|
||||
<div class="input-group-addon" data-i18n="edt_append_percent_v">%v</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -215,14 +215,14 @@
|
||||
<label class="ltdlabel" for="ip_cl_ptr" data-i18n="conf_leds_layout_ptr">Point Top Right</label>
|
||||
</td>
|
||||
<td class="itd input-group">
|
||||
<input class="form-control ledCLconstr" id="ip_cl_ptrh" type="number" value="100" min="60" max="100" step="1"></input>
|
||||
<input class="form-control ledCLconstr" id="ip_cl_ptrh" type="number" value="100" min="0" max="100" step="1"></input>
|
||||
<div class="input-group-addon" data-i18n="edt_append_percent_h">%</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="ltd"></td>
|
||||
<td class="itd input-group">
|
||||
<input class="form-control ledCLconstr" id="ip_cl_ptrv" type="number" value="0" min="0" max="40" step="1"></input>
|
||||
<input class="form-control ledCLconstr" id="ip_cl_ptrv" type="number" value="0" min="0" max="100" step="1"></input>
|
||||
<div class="input-group-addon" data-i18n="edt_append_percent_v">%</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -231,14 +231,14 @@
|
||||
<label class="ltdlabel" for="ip_cl_pbr" data-i18n="conf_leds_layout_pbr">Point Bottom Right</label>
|
||||
</td>
|
||||
<td class="itd input-group">
|
||||
<input class="form-control ledCLconstr" id="ip_cl_pbrh" type="number" value="100" min="60" max="100" step="1"></input>
|
||||
<input class="form-control ledCLconstr" id="ip_cl_pbrh" type="number" value="100" min="0" max="100" step="1"></input>
|
||||
<div class="input-group-addon" data-i18n="edt_append_percent_h">%</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="ltd"></td>
|
||||
<td class="itd input-group">
|
||||
<input class="form-control ledCLconstr" id="ip_cl_pbrv" type="number" value="100" min="60" max="100" step="1"></input>
|
||||
<input class="form-control ledCLconstr" id="ip_cl_pbrv" type="number" value="100" min="0" max="100" step="1"></input>
|
||||
<div class="input-group-addon" data-i18n="edt_append_percent_v">%</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -247,14 +247,14 @@
|
||||
<label class="ltdlabel" for="ip_cl_pbl" data-i18n="conf_leds_layout_pbl">Point Bottom Left</label>
|
||||
</td>
|
||||
<td class="itd input-group">
|
||||
<input class="form-control ledCLconstr" id="ip_cl_pblh" type="number" value="0" min="0" max="40" step="1"></input>
|
||||
<input class="form-control ledCLconstr" id="ip_cl_pblh" type="number" value="0" min="0" max="100" step="1"></input>
|
||||
<div class="input-group-addon" data-i18n="edt_append_percent_h">%</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="ltd"></td>
|
||||
<td class="itd input-group">
|
||||
<input class="form-control ledCLconstr" id="ip_cl_pblv" type="number" value="100" min="60" max="100" step="1"></input>
|
||||
<input class="form-control ledCLconstr" id="ip_cl_pblv" type="number" value="100" min="0" max="100" step="1"></input>
|
||||
<div class="input-group-addon" data-i18n="edt_append_percent_v">%</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -402,3 +402,4 @@
|
||||
|
||||
<script src="/js/content_leds.js"></script>
|
||||
|
||||
|
||||
|
@@ -70,6 +70,14 @@
|
||||
<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem('MenuItemNetwork', 'editor_container_protoserver')" style="text-decoration: none; cursor: pointer"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="dash_ports_boblight_row">
|
||||
<td></td>
|
||||
<td data-i18n="dashboard_infobox_label_port_boblight">proto</td>
|
||||
<td style="text-align: right; padding-right: 0">
|
||||
<span id="dash_boblightPort">unknown</span>
|
||||
<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem('MenuItemInstCapture', 'editor_container_boblightserver')" style="text-decoration: none; cursor: pointer"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td data-i18n="dashboard_infobox_label_port_json">json</td>
|
||||
|
@@ -55,6 +55,8 @@
|
||||
"conf_leds_contr_label_contrtype": "Controller type:",
|
||||
"conf_leds_device_info_log": "In case your LEDs do not work, check here for errors:",
|
||||
"conf_leds_device_intro": "Hyperion supports a lot of controllers to transmit data to your target device. Select a LED controller out of the sorted list and configure it. We have chosen the best default settings for each device.",
|
||||
"conf_leds_error_get_properties_text" : "Failed to get the device's properties. Please check the configuration items.",
|
||||
"conf_leds_error_get_properties_title" : "Device properties",
|
||||
"conf_leds_error_hwled_gt_layout": "The hardware LED count ($1) is greater than LEDs configured via layout ($2),<br>$3 {{plural:$3|LED|LEDs}} will stay black if you continue.",
|
||||
"conf_leds_error_hwled_lt_layout": "The hardware LED count ($1) is less than LEDs configured via layout ($2). <br> The number of LEDs configured in the layout must not exceed the available LEDs",
|
||||
"conf_leds_error_hwled_gt_maxled": "The hardware LED count ($1) is greater than the maximum number of LEDs supported by the device ($2). <br> The hardware LED count is set to ($3).",
|
||||
@@ -99,6 +101,7 @@
|
||||
"conf_leds_layout_generatedconf": "Generated/Current LED Configuration",
|
||||
"conf_leds_layout_intro": "You also need an LED layout, which reflects your LED positions. The classic layout is the usually used TV frame, but we also support LED matrix (LED walls) creation. The view on this layout is ALWAYS from the FRONT of your TV.",
|
||||
"conf_leds_layout_ma_cabling": "Cabling",
|
||||
"conf_leds_layout_ma_direction": "Direction",
|
||||
"conf_leds_layout_ma_horiz": "Horizontal",
|
||||
"conf_leds_layout_ma_optbottomleft": "Bottom left",
|
||||
"conf_leds_layout_ma_optbottomright": "Bottom right",
|
||||
@@ -185,6 +188,7 @@
|
||||
"dashboard_infobox_label_instance": "Instance:",
|
||||
"dashboard_infobox_label_latesthyp": "Latest Hyperion version:",
|
||||
"dashboard_infobox_label_platform": "Platform:",
|
||||
"dashboard_infobox_label_port_boblight": "Boblight Server:",
|
||||
"dashboard_infobox_label_port_flat": "Flatbuffer:",
|
||||
"dashboard_infobox_label_port_json": "JSON-Server:",
|
||||
"dashboard_infobox_label_port_proto": "Protobuffer:",
|
||||
|
@@ -137,7 +137,14 @@ $(document).ready(function () {
|
||||
} else {
|
||||
$("#dash_ports_proto_row").hide();
|
||||
}
|
||||
|
||||
|
||||
if (jQuery.inArray("boblight", window.serverInfo.services) !== -1) {
|
||||
var boblightPort = window.serverConfig.boblightServer.enable ? window.serverConfig.boblightServer.port : $.i18n('general_disabled');
|
||||
$('#dash_boblightPort').html(boblightPort);
|
||||
} else {
|
||||
$("#dash_ports_boblight_row").hide();
|
||||
}
|
||||
|
||||
var jsonPort = window.serverConfig.jsonServer.port;
|
||||
$('#dash_jsonPort').html(jsonPort);
|
||||
var wsPorts = window.serverConfig.webConfig.port + ' | ' + window.serverConfig.webConfig.sslPort;
|
||||
|
@@ -226,7 +226,9 @@ $(document).ready(function () {
|
||||
//Hide capture menu entries, if no grabbers are available
|
||||
if ((window.serverInfo.grabbers.screen.available.length === 0) && (window.serverInfo.grabbers.video.available.length === 0)) {
|
||||
$("#MenuItemGrabber").attr('style', 'display:none')
|
||||
$("#MenuItemInstCapture").attr('style', 'display:none')
|
||||
if ((jQuery.inArray("boblight", window.serverInfo.services) === -1)) {
|
||||
$("#MenuItemInstCapture").attr('style', 'display:none')
|
||||
}
|
||||
}
|
||||
|
||||
//Hide effectsconfigurator menu entry, if effectengine is not available
|
||||
|
@@ -4,113 +4,184 @@ $(document).ready(function () {
|
||||
var screenGrabberAvailable = (window.serverInfo.grabbers.screen.available.length !== 0);
|
||||
var videoGrabberAvailable = (window.serverInfo.grabbers.video.available.length !== 0);
|
||||
|
||||
var BOBLIGHT_ENABLED = (jQuery.inArray("boblight", window.serverInfo.services) !== -1);
|
||||
|
||||
// update instance listing
|
||||
updateHyperionInstanceListing();
|
||||
|
||||
var conf_editor_instCapt = null;
|
||||
var conf_editor_bobl = null;
|
||||
|
||||
// Instance Capture
|
||||
$('#conf_cont').append(createRow('conf_cont_instCapt'));
|
||||
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt', ''));
|
||||
|
||||
if (window.showOptHelp) {
|
||||
$('#conf_cont_instCapt').append(createHelpTable(window.schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
|
||||
if (screenGrabberAvailable || videoGrabberAvailable) {
|
||||
$('#conf_cont').append(createRow('conf_cont_instCapt'));
|
||||
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt', ''));
|
||||
$('#conf_cont_instCapt').append(createHelpTable(window.schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
|
||||
}
|
||||
//boblight
|
||||
if (BOBLIGHT_ENABLED) {
|
||||
$('#conf_cont').append(createRow('conf_cont_bobl'));
|
||||
$('#conf_cont_bobl').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_bobls_heading_title"), 'editor_container_boblightserver', 'btn_submit_boblightserver', ''));
|
||||
$('#conf_cont_bobl').append(createHelpTable(window.schema.boblightServer.properties, $.i18n("edt_conf_bobls_heading_title"), "boblightServerHelpPanelId"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('#conf_cont').addClass('row');
|
||||
if (screenGrabberAvailable || videoGrabberAvailable) {
|
||||
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt', ''));
|
||||
}
|
||||
if (BOBLIGHT_ENABLED) {
|
||||
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_bobls_heading_title"), 'editor_container_boblightserver', 'btn_submit_boblightserver', ''));
|
||||
}
|
||||
}
|
||||
|
||||
// Instance Capture
|
||||
conf_editor_instCapt = createJsonEditor('editor_container_instCapt', {
|
||||
instCapture: window.schema.instCapture
|
||||
}, true, true);
|
||||
if (screenGrabberAvailable || videoGrabberAvailable) {
|
||||
|
||||
var grabber_config_info_html = '<div class="bs-callout bs-callout-info" style="margin-top:0px"><h4>' + $.i18n('dashboard_infobox_label_title') + '</h4 >';
|
||||
grabber_config_info_html += '<span>' + $.i18n('conf_grabber_inst_grabber_config_info') + '</span>';
|
||||
grabber_config_info_html += '<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem(\'MenuItemGrabber\')" style="text-decoration:none;cursor:pointer"></a>';
|
||||
grabber_config_info_html += '</div>';
|
||||
$('#editor_container_instCapt').append(grabber_config_info_html);
|
||||
// Instance Capture
|
||||
conf_editor_instCapt = createJsonEditor('editor_container_instCapt', {
|
||||
instCapture: window.schema.instCapture
|
||||
}, true, true);
|
||||
|
||||
conf_editor_instCapt.on('ready', function () {
|
||||
var grabber_config_info_html = '<div class="bs-callout bs-callout-info" style="margin-top:0px"><h4>' + $.i18n('dashboard_infobox_label_title') + '</h4 >';
|
||||
grabber_config_info_html += '<span>' + $.i18n('conf_grabber_inst_grabber_config_info') + '</span>';
|
||||
grabber_config_info_html += '<a class="fa fa-cog fa-fw" onclick="SwitchToMenuItem(\'MenuItemGrabber\')" style="text-decoration:none;cursor:pointer"></a>';
|
||||
grabber_config_info_html += '</div>';
|
||||
$('#editor_container_instCapt').append(grabber_config_info_html);
|
||||
|
||||
if (screenGrabberAvailable) {
|
||||
if (!window.serverConfig.framegrabber.enable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemEnable").setValue(false);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemEnable").disable();
|
||||
}
|
||||
else {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemEnable").setValue(window.serverConfig.instCapture.systemEnable);
|
||||
}
|
||||
} else {
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemEnable", false);
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemGrabberDevice", false);
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemPriority", false);
|
||||
}
|
||||
conf_editor_instCapt.on('ready', function () {
|
||||
|
||||
if (videoGrabberAvailable) {
|
||||
if (!window.serverConfig.grabberV4L2.enable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").setValue(false);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").disable();
|
||||
}
|
||||
else {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").setValue(window.serverConfig.instCapture.v4lEnable);
|
||||
|
||||
}
|
||||
} else {
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lGrabberDevice", false);
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lEnable", false);
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lPriority", false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
conf_editor_instCapt.on('change', function () {
|
||||
|
||||
if (!conf_editor_instCapt.validate().length) {
|
||||
if (!window.serverConfig.framegrabber.enable && !window.serverConfig.grabberV4L2.enable) {
|
||||
$('#btn_submit_instCapt').attr('disabled', true);
|
||||
if (screenGrabberAvailable) {
|
||||
if (!window.serverConfig.framegrabber.enable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemEnable").setValue(false);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemEnable").disable();
|
||||
}
|
||||
else {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemEnable").setValue(window.serverConfig.instCapture.systemEnable);
|
||||
}
|
||||
} else {
|
||||
window.readOnlyMode ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemEnable", false);
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemGrabberDevice", false);
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemPriority", false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('#btn_submit_instCapt').attr('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
conf_editor_instCapt.watch('root.instCapture.systemEnable', () => {
|
||||
if (videoGrabberAvailable) {
|
||||
if (!window.serverConfig.grabberV4L2.enable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").setValue(false);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").disable();
|
||||
}
|
||||
else {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").setValue(window.serverConfig.instCapture.v4lEnable);
|
||||
|
||||
var screenEnable = conf_editor_instCapt.getEditor("root.instCapture.systemEnable").getValue();
|
||||
if (screenEnable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemGrabberDevice").setValue(window.serverConfig.framegrabber.available_devices);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemGrabberDevice").disable();
|
||||
showInputOptions("instCapture", ["systemGrabberDevice"], true);
|
||||
showInputOptions("instCapture", ["systemPriority"], true);
|
||||
|
||||
} else {
|
||||
showInputOptions("instCapture", ["systemGrabberDevice"], false);
|
||||
showInputOptions("instCapture", ["systemPriority"], false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
conf_editor_instCapt.watch('root.instCapture.v4lEnable', () => {
|
||||
console.log("instCapt.watch(root.instCapture.v4lEnable");
|
||||
var videoEnable = conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").getValue();
|
||||
if (videoEnable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lGrabberDevice").setValue(window.serverConfig.grabberV4L2.available_devices);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lGrabberDevice").disable();
|
||||
showInputOptions("instCapture", ["v4lGrabberDevice"], true);
|
||||
showInputOptions("instCapture", ["v4lPriority"], true);
|
||||
}
|
||||
else {
|
||||
if (!window.serverConfig.grabberV4L2.enable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").disable();
|
||||
}
|
||||
} else {
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lGrabberDevice", false);
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lEnable", false);
|
||||
showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lPriority", false);
|
||||
}
|
||||
showInputOptions("instCapture", ["v4lGrabberDevice"], false);
|
||||
showInputOptions("instCapture", ["v4lPriority"], false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#btn_submit_instCapt').off().on('click', function () {
|
||||
requestWriteConfig(conf_editor_instCapt.getValue());
|
||||
});
|
||||
});
|
||||
|
||||
conf_editor_instCapt.on('change', function () {
|
||||
|
||||
if (!conf_editor_instCapt.validate().length) {
|
||||
if (!window.serverConfig.framegrabber.enable && !window.serverConfig.grabberV4L2.enable) {
|
||||
$('#btn_submit_instCapt').attr('disabled', true);
|
||||
} else {
|
||||
window.readOnlyMode ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('#btn_submit_instCapt').attr('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
conf_editor_instCapt.watch('root.instCapture.systemEnable', () => {
|
||||
|
||||
var screenEnable = conf_editor_instCapt.getEditor("root.instCapture.systemEnable").getValue();
|
||||
if (screenEnable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemGrabberDevice").setValue(window.serverConfig.framegrabber.available_devices);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.systemGrabberDevice").disable();
|
||||
showInputOptions("instCapture", ["systemGrabberDevice"], true);
|
||||
showInputOptions("instCapture", ["systemPriority"], true);
|
||||
|
||||
} else {
|
||||
showInputOptions("instCapture", ["systemGrabberDevice"], false);
|
||||
showInputOptions("instCapture", ["systemPriority"], false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
conf_editor_instCapt.watch('root.instCapture.v4lEnable', () => {
|
||||
var videoEnable = conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").getValue();
|
||||
if (videoEnable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lGrabberDevice").setValue(window.serverConfig.grabberV4L2.available_devices);
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lGrabberDevice").disable();
|
||||
showInputOptions("instCapture", ["v4lGrabberDevice"], true);
|
||||
showInputOptions("instCapture", ["v4lPriority"], true);
|
||||
}
|
||||
else {
|
||||
if (!window.serverConfig.grabberV4L2.enable) {
|
||||
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").disable();
|
||||
}
|
||||
showInputOptions("instCapture", ["v4lGrabberDevice"], false);
|
||||
showInputOptions("instCapture", ["v4lPriority"], false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#btn_submit_instCapt').off().on('click', function () {
|
||||
requestWriteConfig(conf_editor_instCapt.getValue());
|
||||
});
|
||||
}
|
||||
|
||||
//boblight
|
||||
if (BOBLIGHT_ENABLED) {
|
||||
conf_editor_bobl = createJsonEditor('editor_container_boblightserver', {
|
||||
boblightServer: window.schema.boblightServer
|
||||
}, true, true);
|
||||
|
||||
conf_editor_bobl.on('ready', function () {
|
||||
var boblightServerEnable = conf_editor_bobl.getEditor("root.boblightServer.enable").getValue();
|
||||
if (!boblightServerEnable) {
|
||||
showInputOptionsForKey(conf_editor_bobl, "boblightServer", "enable", false);
|
||||
$('#boblightServerHelpPanelId').hide();
|
||||
}
|
||||
});
|
||||
|
||||
conf_editor_bobl.on('change', function () {
|
||||
conf_editor_bobl.validate().length || window.readOnlyMode ? $('#btn_submit_boblightserver').attr('disabled', true) : $('#btn_submit_boblightserver').attr('disabled', false);
|
||||
});
|
||||
|
||||
conf_editor_bobl.watch('root.boblightServer.enable', () => {
|
||||
var boblightServerEnable = conf_editor_bobl.getEditor("root.boblightServer.enable").getValue();
|
||||
if (boblightServerEnable) {
|
||||
//Make port instance specific, if port is still the default one (avoids overlap of used ports)
|
||||
var port = conf_editor_bobl.getEditor("root.boblightServer.port").getValue();
|
||||
if (port === conf_editor_bobl.schema.properties.boblightServer.properties.port.default) {
|
||||
port += parseInt(window.currentHyperionInstance);
|
||||
}
|
||||
conf_editor_bobl.getEditor("root.boblightServer.port").setValue(port);
|
||||
|
||||
showInputOptionsForKey(conf_editor_bobl, "boblightServer", "enable", true);
|
||||
$('#boblightServerHelpPanelId').show();
|
||||
} else {
|
||||
showInputOptionsForKey(conf_editor_bobl, "boblightServer", "enable", false);
|
||||
$('#boblightServerHelpPanelId').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#btn_submit_boblightserver').off().on('click', function () {
|
||||
requestWriteConfig(conf_editor_bobl.getValue());
|
||||
});
|
||||
}
|
||||
|
||||
//create introduction
|
||||
if (window.showOptHelp) {
|
||||
if (BOBLIGHT_ENABLED) {
|
||||
createHint("intro", $.i18n('conf_network_bobl_intro'), "editor_container_boblightserver");
|
||||
}
|
||||
}
|
||||
|
||||
removeOverlay();
|
||||
});
|
||||
|
@@ -277,7 +277,7 @@ function createClassicLeds() {
|
||||
aceEdt.set(finalLedArray);
|
||||
}
|
||||
|
||||
function createMatrixLayout(ledshoriz, ledsvert, cabling, start) {
|
||||
function createMatrixLayout(ledshoriz, ledsvert, cabling, start, direction) {
|
||||
// Big thank you to RanzQ (Juha Rantanen) from Github for this script
|
||||
// https://raw.githubusercontent.com/RanzQ/hyperion-audio-effects/master/matrix-config.js
|
||||
|
||||
@@ -325,15 +325,30 @@ function createMatrixLayout(ledshoriz, ledsvert, cabling, start) {
|
||||
|
||||
var x, y
|
||||
|
||||
for (y = startY; downward && y <= endY || !downward && y >= endY; y += downward ? 1 : -1) {
|
||||
if (direction === 'vertical') {
|
||||
for (x = startX; forward && x <= endX || !forward && x >= endX; x += forward ? 1 : -1) {
|
||||
addLed(x, y)
|
||||
for (y = startY; downward && y <= endY || !downward && y >= endY; y += downward ? 1 : -1) {
|
||||
|
||||
addLed(x, y)
|
||||
}
|
||||
if (!parallel) {
|
||||
downward = !downward
|
||||
var tmp = startY
|
||||
startY = endY
|
||||
endY = tmp
|
||||
}
|
||||
}
|
||||
if (!parallel) {
|
||||
forward = !forward
|
||||
var tmp = startX
|
||||
startX = endX
|
||||
endX = tmp
|
||||
} else {
|
||||
for (y = startY; downward && y <= endY || !downward && y >= endY; y += downward ? 1 : -1) {
|
||||
for (x = startX; forward && x <= endX || !forward && x >= endX; x += forward ? 1 : -1) {
|
||||
addLed(x, y)
|
||||
}
|
||||
if (!parallel) {
|
||||
forward = !forward
|
||||
var tmp = startX
|
||||
startX = endX
|
||||
endX = tmp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,9 +363,10 @@ function createMatrixLeds() {
|
||||
var ledshoriz = parseInt($("#ip_ma_ledshoriz").val());
|
||||
var ledsvert = parseInt($("#ip_ma_ledsvert").val());
|
||||
var cabling = $("#ip_ma_cabling").val();
|
||||
var direction = $("#ip_ma_direction").val();
|
||||
var start = $("#ip_ma_start").val();
|
||||
|
||||
nonBlacklistLedArray = createMatrixLayout(ledshoriz, ledsvert, cabling, start);
|
||||
nonBlacklistLedArray = createMatrixLayout(ledshoriz, ledsvert, cabling, start, direction);
|
||||
finalLedArray = blackListLeds(nonBlacklistLedArray, ledBlacklist);
|
||||
|
||||
createLedPreview(finalLedArray, 'matrix');
|
||||
@@ -467,7 +483,63 @@ $(document).ready(function () {
|
||||
|
||||
// bind change event to all inputs
|
||||
$('.ledCLconstr').bind("change", function () {
|
||||
valValue(this.id, this.value, this.min, this.max);
|
||||
|
||||
//Ensure Values are in min/max ranges
|
||||
if ($(this).val() < $(this).attr('min') * 1) { $(this).val($(this).attr('min')); }
|
||||
if ($(this).val() > $(this).attr('max') * 1) { $(this).val($(this).attr('max')); }
|
||||
|
||||
//top/bottom and left/right must not overlap
|
||||
switch (this.id) {
|
||||
case "ip_cl_ptlh":
|
||||
var ptrh = parseInt($("#ip_cl_ptrh").val());
|
||||
if (this.value > ptrh) {
|
||||
$(this).val(ptrh);
|
||||
}
|
||||
break;
|
||||
case "ip_cl_ptrh":
|
||||
var ptlh = parseInt($("#ip_cl_ptlh").val());
|
||||
if (this.value < ptlh) {
|
||||
$(this).val(ptlh);
|
||||
}
|
||||
break;
|
||||
case "ip_cl_pblh":
|
||||
var pbrh = parseInt($("#ip_cl_pbrh").val());
|
||||
if (this.value > pbrh) {
|
||||
$(this).val(pbrh);
|
||||
}
|
||||
break;
|
||||
case "ip_cl_pbrh":
|
||||
var pblh = parseInt($("#ip_cl_pblh").val());
|
||||
if (this.value < pblh) {
|
||||
$(this).val(pblh);
|
||||
}
|
||||
break;
|
||||
case "ip_cl_ptlv":
|
||||
var pblv = parseInt($("#ip_cl_pblv").val());
|
||||
if (this.value > pblv) {
|
||||
$(this).val(pblv);
|
||||
}
|
||||
break;
|
||||
case "ip_cl_pblv":
|
||||
var ptlv = parseInt($("#ip_cl_ptlv").val());
|
||||
if (this.value < ptlv) {
|
||||
$(this).val(ptlv);
|
||||
}
|
||||
break;
|
||||
case "ip_cl_ptrv":
|
||||
var pbrv = parseInt($("#ip_cl_pbrv").val());
|
||||
if (this.value > pbrv) {
|
||||
$(this).val(pbrv);
|
||||
}
|
||||
break;
|
||||
case "ip_cl_pbrv":
|
||||
var ptrv = parseInt($("#ip_cl_ptrv").val());
|
||||
if (this.value < ptrv) {
|
||||
$(this).val(ptrv);
|
||||
}
|
||||
|
||||
default:
|
||||
}
|
||||
createClassicLeds();
|
||||
});
|
||||
|
||||
@@ -1591,6 +1663,7 @@ async function getProperties_device(ledType, key, params) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
showNotification('warning', $.i18n('conf_leds_error_get_properties_text'), $.i18n('conf_leds_error_get_properties_title'))
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
}
|
||||
@@ -1691,6 +1764,7 @@ function updateElements(ledType, key) {
|
||||
$("#ip_ma_ledshoriz").val(ledProperties.maxColumn);
|
||||
$("#ip_ma_ledsvert").val(ledProperties.maxRow);
|
||||
$("#ip_ma_cabling").val("parallel");
|
||||
$("#ip_ma_direction").val("horizontal");
|
||||
$("#ip_ma_start").val("top-left");
|
||||
createMatrixLeds();
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
$(document).ready(function () {
|
||||
performTranslation();
|
||||
|
||||
var BOBLIGHT_ENABLED = (jQuery.inArray("boblight", window.serverInfo.services) !== -1);
|
||||
var FORWARDER_ENABLED = (jQuery.inArray("forwarder", window.serverInfo.services) !== -1);
|
||||
var FLATBUF_SERVER_ENABLED = (jQuery.inArray("flatbuffer", window.serverInfo.services) !== -1);
|
||||
var PROTOTBUF_SERVER_ENABLED = (jQuery.inArray("protobuffer", window.serverInfo.services) !== -1);
|
||||
@@ -10,7 +9,6 @@ $(document).ready(function () {
|
||||
var conf_editor_json = null;
|
||||
var conf_editor_proto = null;
|
||||
var conf_editor_fbs = null;
|
||||
var conf_editor_bobl = null;
|
||||
var conf_editor_forw = null;
|
||||
|
||||
addJsonEditorHostValidation();
|
||||
@@ -40,13 +38,6 @@ $(document).ready(function () {
|
||||
$('#conf_cont_proto').append(createHelpTable(window.schema.protoServer.properties, $.i18n("edt_conf_pbs_heading_title"), "protoServerHelpPanelId"));
|
||||
}
|
||||
|
||||
//boblight
|
||||
if (BOBLIGHT_ENABLED) {
|
||||
$('#conf_cont').append(createRow('conf_cont_bobl'));
|
||||
$('#conf_cont_bobl').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_bobls_heading_title"), 'editor_container_boblightserver', 'btn_submit_boblightserver', 'panel-system'));
|
||||
$('#conf_cont_bobl').append(createHelpTable(window.schema.boblightServer.properties, $.i18n("edt_conf_bobls_heading_title"), "boblightServerHelpPanelId"));
|
||||
}
|
||||
|
||||
//forwarder
|
||||
if (FORWARDER_ENABLED) {
|
||||
if (storedAccess != 'default') {
|
||||
@@ -66,9 +57,6 @@ $(document).ready(function () {
|
||||
if (PROTOTBUF_SERVER_ENABLED) {
|
||||
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_pbs_heading_title"), 'editor_container_protoserver', 'btn_submit_protoserver'));
|
||||
}
|
||||
if (BOBLIGHT_ENABLED) {
|
||||
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_bobls_heading_title"), 'editor_container_boblightserver', 'btn_submit_boblightserver'));
|
||||
}
|
||||
if (FORWARDER_ENABLED) {
|
||||
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_fw_heading_title"), 'editor_container_forwarder', 'btn_submit_forwarder'));
|
||||
}
|
||||
@@ -147,29 +135,6 @@ $(document).ready(function () {
|
||||
});
|
||||
}
|
||||
|
||||
//boblight
|
||||
if (BOBLIGHT_ENABLED) {
|
||||
conf_editor_bobl = createJsonEditor('editor_container_boblightserver', {
|
||||
boblightServer: window.schema.boblightServer
|
||||
}, true, true);
|
||||
|
||||
conf_editor_bobl.on('change', function () {
|
||||
var boblightServerEnable = conf_editor_bobl.getEditor("root.boblightServer.enable").getValue();
|
||||
if (boblightServerEnable) {
|
||||
showInputOptionsForKey(conf_editor_bobl, "boblightServer", "enable", true);
|
||||
$('#boblightServerHelpPanelId').show();
|
||||
} else {
|
||||
showInputOptionsForKey(conf_editor_bobl, "boblightServer", "enable", false);
|
||||
$('#boblightServerHelpPanelId').hide();
|
||||
}
|
||||
conf_editor_bobl.validate().length || window.readOnlyMode ? $('#btn_submit_boblightserver').attr('disabled', true) : $('#btn_submit_boblightserver').attr('disabled', false);
|
||||
});
|
||||
|
||||
$('#btn_submit_boblightserver').off().on('click', function () {
|
||||
requestWriteConfig(conf_editor_bobl.getValue());
|
||||
});
|
||||
}
|
||||
|
||||
//forwarder
|
||||
if (FORWARDER_ENABLED) {
|
||||
if (storedAccess != 'default') {
|
||||
@@ -205,9 +170,6 @@ $(document).ready(function () {
|
||||
if (PROTOTBUF_SERVER_ENABLED) {
|
||||
createHint("intro", $.i18n('conf_network_proto_intro'), "editor_container_protoserver");
|
||||
}
|
||||
if (BOBLIGHT_ENABLED) {
|
||||
createHint("intro", $.i18n('conf_network_bobl_intro'), "editor_container_boblightserver");
|
||||
}
|
||||
if (FORWARDER_ENABLED) {
|
||||
createHint("intro", $.i18n('conf_network_forw_intro'), "editor_container_forwarder");
|
||||
}
|
||||
|
@@ -128,13 +128,13 @@ $(document).ready(function () {
|
||||
|
||||
switch (compId) {
|
||||
case "EFFECT":
|
||||
owner = $.i18n('remote_effects_label_effects') + ' ' + owner;
|
||||
owner = $.i18n('remote_effects_label_effects') + ' ' + owner;
|
||||
break;
|
||||
case "COLOR":
|
||||
owner = $.i18n('remote_color_label_color') + ' ' + '<div style="width:18px; height:18px; border-radius:20px; margin-bottom:-4px; border:1px grey solid; background-color: rgb(' + value + '); display:inline-block" title="RGB: (' + value + ')"></div>';
|
||||
break;
|
||||
case "IMAGE":
|
||||
owner = $.i18n('remote_effects_label_picture') + ' ' + owner;
|
||||
owner = $.i18n('remote_effects_label_picture') + (owner !== undefined ? (' ' + owner): "");
|
||||
break;
|
||||
case "GRABBER":
|
||||
owner = $.i18n('general_comp_GRABBER') + ': (' + owner + ')';
|
||||
@@ -153,16 +153,19 @@ $(document).ready(function () {
|
||||
break;
|
||||
}
|
||||
|
||||
if (duration && compId != "GRABBER" && compId != "FLATBUFSERVER" && compId != "PROTOSERVER")
|
||||
owner += '<br/><span style="font-size:80%; color:grey;">' + $.i18n('remote_input_duration') + ' ' + duration.toFixed(0) + $.i18n('edt_append_s') + '</span>';
|
||||
if (!(duration && duration < 0))
|
||||
{
|
||||
if (duration && compId != "GRABBER" && compId != "FLATBUFSERVER" && compId != "PROTOSERVER")
|
||||
owner += '<br/><span style="font-size:80%; color:grey;">' + $.i18n('remote_input_duration') + ' ' + duration.toFixed(0) + $.i18n('edt_append_s') + '</span>';
|
||||
|
||||
var btn = '<button id="srcBtn' + i + '" type="button" ' + btn_state + ' class="btn btn-' + btn_type + ' btn_input_selection" onclick="requestSetSource(' + priority + ');">' + btn_text + '</button>';
|
||||
var btn = '<button id="srcBtn' + i + '" type="button" ' + btn_state + ' class="btn btn-' + btn_type + ' btn_input_selection" onclick="requestSetSource(' + priority + ');">' + btn_text + '</button>';
|
||||
|
||||
if ((compId == "EFFECT" || compId == "COLOR" || compId == "IMAGE") && priority < 254)
|
||||
btn += '<button type="button" class="btn btn-sm btn-danger" style="margin-left:10px;" onclick="requestPriorityClear(' + priority + ');"><i class="fa fa-close"></button>';
|
||||
if ((compId == "EFFECT" || compId == "COLOR" || compId == "IMAGE") && priority < 254)
|
||||
btn += '<button type="button" class="btn btn-sm btn-danger" style="margin-left:10px;" onclick="requestPriorityClear(' + priority + ');"><i class="fa fa-close"></button>';
|
||||
|
||||
if (btn_type != 'default')
|
||||
$('.sstbody').append(createTableRow([origin, owner, priority, btn], false, true));
|
||||
if (btn_type != 'default')
|
||||
$('.sstbody').append(createTableRow([origin, owner, priority, btn], false, true));
|
||||
}
|
||||
}
|
||||
var btn_auto_color = (window.serverInfo.priorities_autoselect ? "btn-success" : "btn-danger");
|
||||
var btn_auto_state = (window.serverInfo.priorities_autoselect ? "disabled" : "enabled");
|
||||
@@ -313,6 +316,9 @@ $(document).ready(function () {
|
||||
if (getStorage('rmduration') != null) {
|
||||
$("#remote_duration").val(getStorage('rmduration'));
|
||||
duration = getStorage('rmduration');
|
||||
if (duration == 0) {
|
||||
duration = ENDLESS;
|
||||
}
|
||||
}
|
||||
|
||||
createCP('cp2', cpcolor, function (rgbT, hex) {
|
||||
@@ -332,6 +338,9 @@ $(document).ready(function () {
|
||||
$("#remote_duration").off().on("change", function () {
|
||||
duration = valValue(this.id, this.value, this.min, this.max);
|
||||
setStorage('rmduration', duration);
|
||||
if (duration == 0) {
|
||||
duration = ENDLESS;
|
||||
}
|
||||
});
|
||||
|
||||
$("#effect_select").off().on("change", function (event) {
|
||||
@@ -349,8 +358,9 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$("#remote_input_repimg").off().on("click", function () {
|
||||
if (lastImgData != "")
|
||||
if (lastImgData != "") {
|
||||
requestSetImage(lastImgData, duration, lastFileName);
|
||||
}
|
||||
});
|
||||
|
||||
$("#remote_input_img").change(function () {
|
||||
@@ -380,7 +390,6 @@ $(document).ready(function () {
|
||||
// interval updates
|
||||
|
||||
$(window.hyperion).on('components-updated', function (e, comp) {
|
||||
//console.log ("components-updated", e, comp);
|
||||
updateComponent(comp);
|
||||
});
|
||||
|
||||
|
@@ -359,21 +359,25 @@ function requestPriorityClear(prio)
|
||||
if(typeof prio !== 'number')
|
||||
prio = window.webPrio;
|
||||
|
||||
$(window.hyperion).trigger({type:"stopBrowerScreenCapture"});
|
||||
sendToHyperion("clear", "", '"priority":'+prio+'');
|
||||
}
|
||||
|
||||
function requestClearAll()
|
||||
{
|
||||
$(window.hyperion).trigger({type:"stopBrowerScreenCapture"});
|
||||
requestPriorityClear(-1)
|
||||
}
|
||||
|
||||
function requestPlayEffect(effectName, duration)
|
||||
{
|
||||
$(window.hyperion).trigger({type:"stopBrowerScreenCapture"});
|
||||
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+window.webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+window.webOrigin+'"');
|
||||
}
|
||||
|
||||
function requestSetColor(r,g,b,duration)
|
||||
{
|
||||
$(window.hyperion).trigger({type:"stopBrowerScreenCapture"});
|
||||
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+window.webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+window.webOrigin+'"');
|
||||
}
|
||||
|
||||
|
@@ -1,111 +1,117 @@
|
||||
$(document).ready( function() {
|
||||
$(document).ready(function () {
|
||||
|
||||
// check if browser supports streaming
|
||||
if(window.navigator.mediaDevices && window.navigator.mediaDevices.getDisplayMedia){
|
||||
$("#btn_streamer").toggle();
|
||||
}
|
||||
// check if browser supports streaming
|
||||
if (window.navigator.mediaDevices && window.navigator.mediaDevices.getDisplayMedia) {
|
||||
$("#btn_streamer").toggle();
|
||||
}
|
||||
|
||||
// variables
|
||||
var streamActive = false;
|
||||
var screenshotTimer = "";
|
||||
var screenshotIntervalTimeMs = 100;
|
||||
var streamImageHeight = 0;
|
||||
var streamImageWidth = 0;
|
||||
const videoElem = document.getElementById("streamvideo");
|
||||
const canvasElem = document.getElementById("streamcanvas");
|
||||
// variables
|
||||
var streamActive = false;
|
||||
var screenshotTimer = "";
|
||||
var screenshotIntervalTimeMs = 100;
|
||||
var streamImageHeight = 0;
|
||||
var streamImageWidth = 0;
|
||||
const videoElem = document.getElementById("streamvideo");
|
||||
const canvasElem = document.getElementById("streamcanvas");
|
||||
|
||||
// Options for getDisplayMedia()
|
||||
var displayMediaOptions = {
|
||||
video: {
|
||||
cursor: "never",
|
||||
width: 170,
|
||||
height: 100,
|
||||
frameRate: 15
|
||||
},
|
||||
audio: false
|
||||
};
|
||||
// Options for getDisplayMedia()
|
||||
var displayMediaOptions = {
|
||||
video: {
|
||||
cursor: "never",
|
||||
width: 170,
|
||||
height: 100,
|
||||
frameRate: 15
|
||||
},
|
||||
audio: false
|
||||
};
|
||||
|
||||
async function startCapture() {
|
||||
streamActive = true;
|
||||
|
||||
async function startCapture() {
|
||||
streamActive = true;
|
||||
try {
|
||||
var stream = await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
|
||||
videoElem.srcObject = stream;
|
||||
|
||||
try {
|
||||
var stream = await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
|
||||
videoElem.srcObject = stream;
|
||||
// get the active track of the stream
|
||||
const track = stream.getVideoTracks()[0];
|
||||
|
||||
// get the active track of the stream
|
||||
const track = stream.getVideoTracks()[0];
|
||||
// listen for track ending, fires when user aborts through browser
|
||||
track.onended = function (event) {
|
||||
stopCapture();
|
||||
};
|
||||
|
||||
// listen for track ending, fires when user aborts through browser
|
||||
track.onended = function(event) {
|
||||
stopCapture();
|
||||
};
|
||||
// wait for video ready
|
||||
videoElem.addEventListener('loadedmetadata', (e) => {
|
||||
window.setTimeout(() => (
|
||||
onCapabilitiesReady(track.getSettings())
|
||||
), 500);
|
||||
});
|
||||
} catch (err) {
|
||||
stopCapture();
|
||||
console.error("Error: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
// wait for video ready
|
||||
videoElem.addEventListener('loadedmetadata', (e) => {
|
||||
window.setTimeout(() => (
|
||||
onCapabilitiesReady(track.getSettings())
|
||||
), 500);
|
||||
});
|
||||
} catch(err) {
|
||||
stopCapture();
|
||||
console.error("Error: " + err);
|
||||
}
|
||||
}
|
||||
function onCapabilitiesReady(settings) {
|
||||
// extract real width/height
|
||||
streamImageWidth = settings.width;
|
||||
streamImageHeight = settings.height;
|
||||
|
||||
function onCapabilitiesReady(settings) {
|
||||
// extract real width/height
|
||||
streamImageWidth = settings.width;
|
||||
streamImageHeight = settings.height;
|
||||
// start screenshotTimer
|
||||
updateScrTimer(false);
|
||||
|
||||
// start screenshotTimer
|
||||
updateScrTimer(false);
|
||||
// we are sending
|
||||
$("#btn_streamer_icon").addClass("text-danger");
|
||||
}
|
||||
|
||||
// we are sending
|
||||
$("#btn_streamer_icon").addClass("text-danger");
|
||||
}
|
||||
function stopCapture(evt) {
|
||||
streamActive = false;
|
||||
$("#btn_streamer_icon").removeClass("text-danger");
|
||||
|
||||
function stopCapture(evt) {
|
||||
streamActive = false;
|
||||
$("#btn_streamer_icon").removeClass("text-danger");
|
||||
updateScrTimer(true);
|
||||
// sometimes it's null on abort
|
||||
if (videoElem.srcObject) {
|
||||
let tracks = videoElem.srcObject.getTracks();
|
||||
|
||||
updateScrTimer(true);
|
||||
// sometimes it's null on abort
|
||||
if(videoElem.srcObject){
|
||||
let tracks = videoElem.srcObject.getTracks();
|
||||
tracks.forEach(track => track.stop());
|
||||
videoElem.srcObject = null;
|
||||
}
|
||||
requestPriorityClear(1);
|
||||
}
|
||||
|
||||
tracks.forEach(track => track.stop());
|
||||
videoElem.srcObject = null;
|
||||
}
|
||||
}
|
||||
function takePicture() {
|
||||
var context = canvasElem.getContext('2d');
|
||||
canvasElem.width = streamImageWidth;
|
||||
canvasElem.height = streamImageHeight;
|
||||
context.drawImage(videoElem, 0, 0, streamImageWidth, streamImageHeight);
|
||||
|
||||
function takePicture(){
|
||||
var context = canvasElem.getContext('2d');
|
||||
canvasElem.width = streamImageWidth;
|
||||
canvasElem.height = streamImageHeight;
|
||||
context.drawImage(videoElem, 0, 0, streamImageWidth, streamImageHeight);
|
||||
var data = canvasElem.toDataURL('image/png').split(",")[1];
|
||||
requestSetImage(data, -1, "Streaming");
|
||||
}
|
||||
|
||||
var data = canvasElem.toDataURL('image/png').split(",")[1];
|
||||
requestSetImage(data, 2, "Streaming");
|
||||
}
|
||||
// start or update screenshot timer
|
||||
function updateScrTimer(stop) {
|
||||
clearInterval(screenshotTimer)
|
||||
|
||||
// start or update screenshot timer
|
||||
function updateScrTimer(stop){
|
||||
clearInterval(screenshotTimer)
|
||||
if (stop === false) {
|
||||
screenshotTimer = setInterval(() => (
|
||||
takePicture()
|
||||
), screenshotIntervalTimeMs);
|
||||
}
|
||||
}
|
||||
|
||||
if(stop === false){
|
||||
screenshotTimer = setInterval(() => (
|
||||
takePicture()
|
||||
), screenshotIntervalTimeMs);
|
||||
}
|
||||
}
|
||||
$("#btn_streamer").off().on("click", function (e) {
|
||||
if (!$("#btn_streamer_icon").hasClass("text-danger") && !streamActive) {
|
||||
startCapture();
|
||||
} else {
|
||||
stopCapture();
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_streamer").off().on("click",function(e){
|
||||
if(!$("#btn_streamer_icon").hasClass("text-danger") && !streamActive){
|
||||
startCapture();
|
||||
} else {
|
||||
stopCapture();
|
||||
}
|
||||
});
|
||||
$(window.hyperion).on("stopBrowerScreenCapture", function (event) {
|
||||
if (streamActive) {
|
||||
stopCapture();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
@@ -1221,13 +1221,13 @@ function getSystemInfo() {
|
||||
info += '- Architecture: ' + sys.architecture + '\n';
|
||||
|
||||
if (sys.cpuModelName)
|
||||
info += '- CPU Model: ' + sys.cpuModelName + '\n';
|
||||
info += '- CPU Model: ' + sys.cpuModelName + '\n';
|
||||
if (sys.cpuModelType)
|
||||
info += '- CPU Type: ' + sys.cpuModelType + '\n';
|
||||
info += '- CPU Type: ' + sys.cpuModelType + '\n';
|
||||
if (sys.cpuRevision)
|
||||
info += '- CPU Revision: ' + sys.cpuRevision + '\n';
|
||||
info += '- CPU Revision: ' + sys.cpuRevision + '\n';
|
||||
if (sys.cpuHardware)
|
||||
info += '- CPU Hardware: ' + sys.cpuHardware + '\n';
|
||||
info += '- CPU Hardware: ' + sys.cpuHardware + '\n';
|
||||
|
||||
info += '- Kernel: ' + sys.kernelType + ' (' + sys.kernelVersion + ' (WS: ' + sys.wordSize + '))\n';
|
||||
info += '- Root/Admin: ' + sys.isUserAdmin + '\n';
|
||||
|
@@ -304,7 +304,7 @@ function performAction() {
|
||||
h += '<button id="wiz_cc_btn_sp" class="btn btn-primary">' + $.i18n('wiz_cc_btn_switchpic') + '</button>';
|
||||
}
|
||||
else
|
||||
h += '<p>' + $.i18n('wiz_cc_lettvshowm', "gey_1, grey_2, grey_3, HGradient, VGradient") + '</p>';
|
||||
h += '<p>' + $.i18n('wiz_cc_lettvshowm', "grey_1, grey_2, grey_3, HGradient, VGradient") + '</p>';
|
||||
$('#wiz_cc_desc').html(h);
|
||||
$('#wiz_cc_btn_sp').off().on('click', function () {
|
||||
switchPicture(["VGradient", "grey_1", "grey_2", "grey_3", "HGradient"]);
|
||||
@@ -1534,8 +1534,8 @@ async function discover_yeelight_lights() {
|
||||
|
||||
function assign_yeelight_lights() {
|
||||
// Model mappings, see https://www.home-assistant.io/integrations/yeelight/
|
||||
var models = ['color', 'color1', 'YLDP02YL', 'YLDP02YL', 'color2', 'YLDP06YL', 'color4', 'YLDP13YL', 'stripe', 'YLDD04YL', 'strip1', 'YLDD01YL', 'YLDD02YL'];
|
||||
|
||||
var models = ['color', 'color1', 'YLDP02YL', 'YLDP02YL', 'color2', 'YLDP06YL', 'color4', 'YLDP13YL', 'color6', 'YLDP13AYL', 'colorc', "YLDP004-A", 'stripe', 'YLDD04YL', 'strip1', 'YLDD01YL', 'YLDD02YL', 'strip4', 'YLDD05YL', 'strip6', 'YLDD05YL'];
|
||||
|
||||
// If records are left for configuration
|
||||
if (Object.keys(lights).length > 0) {
|
||||
$('#wh_topcontainer').toggle(false);
|
||||
|
Reference in New Issue
Block a user