mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
implement webui live video (#340)
* implement webui live video * add missing german translation
This commit is contained in:
@@ -322,10 +322,12 @@ $(document).ready(function() {
|
||||
createClassicLeds();
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$('.ledMAconstr').bind("change", function() {
|
||||
createMatrixLeds();
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$('#btn_cl_generate').off().on("click", function() {
|
||||
if (finalLedArray != ""){
|
||||
$("#ledconfig").text(JSON.stringify(finalLedArray, null, "\t"));
|
||||
@@ -334,6 +336,7 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$('#btn_ma_generate').off().on("click", function() {
|
||||
if (finalLedArray != ""){
|
||||
$("#ledconfig").text(JSON.stringify(finalLedArray, null, "\t"));
|
||||
@@ -342,6 +345,19 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$(hyperion).on("cmd-ledcolors-imagestream-update",function(event){
|
||||
if ($("#leddevices").length == 0)
|
||||
{
|
||||
requestLedImageStop();
|
||||
}
|
||||
else
|
||||
{
|
||||
imageData = (event.response.result.image);
|
||||
$("#image_preview").attr("src", imageData);
|
||||
}
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$(hyperion).on("cmd-ledcolors-ledstream-update",function(event){
|
||||
if ($("#leddevices").length == 0)
|
||||
@@ -420,7 +436,7 @@ $(document).ready(function() {
|
||||
canvas_height = $('#leds_canvas').innerHeight();
|
||||
canvas_width = $('#leds_canvas').innerWidth();
|
||||
|
||||
leds_html = "";
|
||||
leds_html = '<img src="" id="image_preview" style="position:relative" />"';
|
||||
for(var idx=0; idx<leds.length; idx++)
|
||||
{
|
||||
led = leds[idx];
|
||||
@@ -436,6 +452,9 @@ $(document).ready(function() {
|
||||
$('#led_0').css({"z-index":"10"});
|
||||
|
||||
$('#leds_custom_updsim').trigger('click');
|
||||
$('#image_preview').hide();
|
||||
$('#image_preview').attr("width" , $('#leds_canvas').innerWidth()-2);
|
||||
$('#image_preview').attr("height", $('#leds_canvas').innerHeight()-2);
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@@ -463,6 +482,21 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$('#leds_toggle_live_video').off().on("click", function() {
|
||||
setClassByBool('#leds_toggle_live_video',imageStreamActive,"btn-success","btn-danger");
|
||||
if ( imageStreamActive )
|
||||
{
|
||||
requestLedImageStop();
|
||||
$('#image_preview').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#image_preview').show();
|
||||
requestLedImageStart();
|
||||
}
|
||||
});
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
$("#leds_custom_updsim").off().on("click", function() {
|
||||
if (validateText()){
|
||||
|
Reference in New Issue
Block a user