implement webui live video (#340)

* implement webui live video

* add missing german translation
This commit is contained in:
redPanther
2016-12-18 19:00:14 +01:00
committed by GitHub
parent 23194730c2
commit 721668fc85
15 changed files with 156 additions and 20 deletions

View File

@@ -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()){