2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

49_SSCamSTRM: click on content in stream device or snap gallery opens a popup window

git-svn-id: https://svn.fhem.de/fhem/trunk@17881 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2018-12-02 17:52:30 +00:00
parent 5834221233
commit e079296db7
3 changed files with 51 additions and 24 deletions

View File

@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- feature: 49_SSCamSTRM: click on content in stream device or snap gallery
opens a popup window
- new: 70_LaMetric2: add official module for LaMetric Smart Clock - new: 70_LaMetric2: add official module for LaMetric Smart Clock
- feature: 73_AutoShuttersControl: change ReadingsVal to ReadingsNum for - feature: 73_AutoShuttersControl: change ReadingsVal to ReadingsNum for
read position Reading, add setDriveReading for wiggle read position Reading, add setDriveReading for wiggle

View File

@ -45,6 +45,7 @@ use HttpUtils;
# Versions History intern # Versions History intern
our %SSCam_vNotesIntern = ( our %SSCam_vNotesIntern = (
"7.5.0" => "02.12.2018 sub SSCam_StreamDev and SSCam_composegallery changed to use popup window ",
"7.4.1" => "26.11.2018 sub composegallery deleted, SSCam_composegallery changed to get information for SSCam_refresh ", "7.4.1" => "26.11.2018 sub composegallery deleted, SSCam_composegallery changed to get information for SSCam_refresh ",
"7.4.0" => "24.11.2018 new set command \"createReadingsGroup\", versionNotes can process lists like \"2,6\", changed compatibility check, use SnapId when get information after took snapshot and sscam state-event ", "7.4.0" => "24.11.2018 new set command \"createReadingsGroup\", versionNotes can process lists like \"2,6\", changed compatibility check, use SnapId when get information after took snapshot and sscam state-event ",
"7.3.3" => "18.11.2018 change rights decsption in commandRef ", "7.3.3" => "18.11.2018 change rights decsption in commandRef ",
@ -5067,13 +5068,8 @@ sub SSCam_camop_parse ($) {
my $stmkey = $sk[1]; my $stmkey = $sk[1];
$stmkey =~ tr/"//d; $stmkey =~ tr/"//d;
# Quotes in StmKey entfernen falls noQuotesForSID gesezt # Quotes in StmKey entfernen falls noQuotesForSID gesezt
$mjpegHttp =~ tr/"//d if(AttrVal($name, "noQuotesForSID",0)); # $mjpegHttp =~ tr/"//d if(AttrVal($name, "noQuotesForSID",0));
$mjpegHttp =~ tr/"//d;
# Readings löschen falls sie nicht angezeigt werden sollen (showStmInfoFull)
#if (!AttrVal($name,"showStmInfoFull",0)) {
# delete($defs{$name}{READINGS}{StmKeymjpegHttp});
#delete($defs{$name}{READINGS}{StmKeyUnicstOverHttp});
#}
# Streaminginfos in Helper speichern # Streaminginfos in Helper speichern
$hash->{HELPER}{STMKEYMJPEGHTTP} = $mjpegHttp if($mjpegHttp); $hash->{HELPER}{STMKEYMJPEGHTTP} = $mjpegHttp if($mjpegHttp);
@ -6177,9 +6173,9 @@ return;
} }
###################################################################################### ######################################################################################
# Stream einer Kamera - Kamera Liveview weblink device # Funktion für SSCamSTRM-Devices - Kamera Liveview weblink device
# API: SYNO.SurveillanceStation.VideoStreaming # API: SYNO.SurveillanceStation.VideoStreaming
# Methode: GetLiveViewPath # Methode: GetLiveViewPath
###################################################################################### ######################################################################################
sub SSCam_StreamDev($$$) { sub SSCam_StreamDev($$$) {
my ($camname,$strmdev,$fmt) = @_; my ($camname,$strmdev,$fmt) = @_;
@ -6235,6 +6231,7 @@ sub SSCam_StreamDev($$$) {
my $ha = AttrVal($camname, "htmlattr", 'width="500" height="325"'); # HTML Attribute der Cam my $ha = AttrVal($camname, "htmlattr", 'width="500" height="325"'); # HTML Attribute der Cam
$ha = AttrVal($strmdev, "htmlattr", $ha); # htmlattr mit htmattr Streaming-Device übersteuern $ha = AttrVal($strmdev, "htmlattr", $ha); # htmlattr mit htmattr Streaming-Device übersteuern
my $pws = AttrVal($strmdev, "popupWindowSize", ''); # Größe eines Popups
my $StmKey = ReadingsVal($camname,"StmKey",undef); my $StmKey = ReadingsVal($camname,"StmKey",undef);
$ret = ""; $ret = "";
@ -6264,7 +6261,7 @@ sub SSCam_StreamDev($$$) {
if($apiaudiostmmaxver) { # keine API "SYNO.SurveillanceStation.AudioStream" mehr ab API v2.8 if($apiaudiostmmaxver) { # keine API "SYNO.SurveillanceStation.AudioStream" mehr ab API v2.8
$audiolink = "$proto://$serveraddr:$serverport/webapi/$apiaudiostmpath?api=$apiaudiostm&version=$apiaudiostmmaxver&method=Stream&cameraId=$camid&_sid=$sid"; $audiolink = "$proto://$serveraddr:$serverport/webapi/$apiaudiostmpath?api=$apiaudiostm&version=$apiaudiostmmaxver&method=Stream&cameraId=$camid&_sid=$sid";
} }
$ret .= "<td><img src=$link $ha><br>"; $ret .= "<td><img src=$link $ha onClick=\"FW_okDialog('<img src=$link $pws>')\"><br>";
if(ReadingsVal($camname, "Record", "Stop") eq "Stop") { if(ReadingsVal($camname, "Record", "Stop") eq "Stop") {
# Aufnahmebutton endlos Start # Aufnahmebutton endlos Start
$ret .= "<a onClick=\"FW_cmd('$FW_ME$FW_subdir?XHR=1&$cmdrecendless')\">$imgrecendless </a>"; $ret .= "<a onClick=\"FW_cmd('$FW_ME$FW_subdir?XHR=1&$cmdrecendless')\">$imgrecendless </a>";
@ -6334,7 +6331,7 @@ sub SSCam_StreamDev($$$) {
if($link && $wltype =~ /image|iframe|video|base64img|embed|hls/) { if($link && $wltype =~ /image|iframe|video|base64img|embed|hls/) {
if($wltype =~ /image/) { if($wltype =~ /image/) {
$ret .= "<td><img src=$link $ha><br>"; $ret .= "<td><img src=$link $ha onClick=\"FW_okDialog('<img src=$link $pws>')\"><br>";
$ret .= "<a onClick=\"FW_cmd('$FW_ME$FW_subdir?XHR=1&$cmdstop')\">$imgstop </a>"; $ret .= "<a onClick=\"FW_cmd('$FW_ME$FW_subdir?XHR=1&$cmdstop')\">$imgstop </a>";
$ret .= $imgblank; $ret .= $imgblank;
if($hash->{HELPER}{RUNVIEW} =~ /live_fw/) { if($hash->{HELPER}{RUNVIEW} =~ /live_fw/) {
@ -6363,7 +6360,7 @@ sub SSCam_StreamDev($$$) {
} }
} elsif ($wltype =~ /iframe/) { } elsif ($wltype =~ /iframe/) {
$ret .= "<td><iframe src=$link $ha controls autoplay> $ret .= "<td><iframe src=$link $ha controls autoplay onClick=\"FW_okDialog('<img src=$link $pws>')\">
Iframes disabled Iframes disabled
</iframe><br>"; </iframe><br>";
$ret .= "<a onClick=\"FW_cmd('$FW_ME$FW_subdir?XHR=1&$cmdstop')\">$imgstop </a>"; $ret .= "<a onClick=\"FW_cmd('$FW_ME$FW_subdir?XHR=1&$cmdstop')\">$imgstop </a>";
@ -6396,12 +6393,12 @@ sub SSCam_StreamDev($$$) {
$ret .= "</td>"; $ret .= "</td>";
} }
} elsif($wltype =~ /base64img/) { } elsif($wltype =~ /base64img/) {
$ret .= "<td><img src='data:image/jpeg;base64,$link' $ha><br>"; $ret .= "<td><img src='data:image/jpeg;base64,$link' $ha onClick=\"FW_okDialog('<img src=data:image/jpeg;base64,$link $pws>')\"><br>";
$ret .= "<a onClick=\"FW_cmd('$FW_ME$FW_subdir?XHR=1&$cmdstop')\">$imgstop </a>"; $ret .= "<a onClick=\"FW_cmd('$FW_ME$FW_subdir?XHR=1&$cmdstop')\">$imgstop </a>";
$ret .= "</td>"; $ret .= "</td>";
} elsif($wltype =~ /embed/) { } elsif($wltype =~ /embed/) {
$ret .= "<td><embed src=$link $ha></td>"; $ret .= "<td><embed src=$link $ha onClick=\"FW_okDialog('<img src=$link $pws>')\"></td>";
} elsif($wltype =~ /hls/) { } elsif($wltype =~ /hls/) {
$ret .= "<td><video $ha controls autoplay> $ret .= "<td><video $ha controls autoplay>
@ -6456,6 +6453,7 @@ return $ret;
############################################################################### ###############################################################################
# Schnappschußgalerie zusammenstellen # Schnappschußgalerie zusammenstellen
# Verwendung durch SSCamSTRM-Devices
############################################################################### ###############################################################################
sub SSCam_composegallery ($;$$) { sub SSCam_composegallery ($;$$) {
my ($name,$strmdev,$model) = @_; my ($name,$strmdev,$model) = @_;
@ -6481,13 +6479,14 @@ sub SSCam_composegallery ($;$$) {
my $cmddosnap = "cmd=set $name snap STRM"; # Snapshot auslösen mit Kennzeichnung "by STRM-Device" my $cmddosnap = "cmd=set $name snap STRM"; # Snapshot auslösen mit Kennzeichnung "by STRM-Device"
my $imgdosnap = "<img src=\"$FW_ME/www/images/sscam/black_btn_DOSNAP.png\">"; my $imgdosnap = "<img src=\"$FW_ME/www/images/sscam/black_btn_DOSNAP.png\">";
my $ha = AttrVal($name, "snapGalleryHtmlAttr", AttrVal($name, "htmlattr", 'width="500" height="325"')); my $ha = AttrVal($name, "snapGalleryHtmlAttr", AttrVal($name, "htmlattr", 'width="500" height="325"'));
my $pws = AttrVal($strmdev, "popupWindowSize", ""); # Größe eines Popups
# falls "SSCam_composegallery" durch ein SSCamSTRM-Device aufgerufen wird # falls "SSCam_composegallery" durch ein SSCamSTRM-Device aufgerufen wird
my $devWlink = ""; my $devWlink = "";
if ($strmdev) { if ($strmdev) {
my $wlha = AttrVal($strmdev, "htmlattr", undef); my $wlha = AttrVal($strmdev, "htmlattr", undef);
$ha = (defined($wlha))?$wlha:$ha; # htmlattr vom SSCamSTRM-Device übernehmen falls von SSCamSTRM-Device aufgerufen und gesetzt $ha = (defined($wlha))?$wlha:$ha; # htmlattr vom SSCamSTRM-Device übernehmen falls von SSCamSTRM-Device aufgerufen und gesetzt
} }
# wenn SSCamSTRM-device genutzt wird und attr "snapGalleryBoost" nicht gesetzt ist -> Warnung in Gallerie ausgeben # wenn SSCamSTRM-device genutzt wird und attr "snapGalleryBoost" nicht gesetzt ist -> Warnung in Gallerie ausgeben
@ -6521,7 +6520,7 @@ sub SSCam_composegallery ($;$$) {
foreach my $key (@as) { foreach my $key (@as) {
$ct = $allsnaps->{$key}{createdTm}; $ct = $allsnaps->{$key}{createdTm};
my $html = sprintf("<td>$ct<br /> <img $gattr src=\"data:image/jpeg;base64,$allsnaps->{$key}{imageData}\" /> </td>" ); my $html = sprintf("<td>$ct<br> <img src=\"data:image/jpeg;base64,$allsnaps->{$key}{imageData}\" $gattr onClick=\"FW_okDialog('<img src=data:image/jpeg;base64,$allsnaps->{$key}{imageData} $pws>')\"> </td>" );
$cell++; $cell++;

View File

@ -34,6 +34,7 @@ use warnings;
# Versions History intern # Versions History intern
our %SSCamSTRM_vNotesIntern = ( our %SSCamSTRM_vNotesIntern = (
"1.5.0" => "02.12.2018 new attribute \"popupWindowSize\" ",
"1.4.1" => "31.10.2018 attribute \"autoLoop\" changed to \"autoRefresh\", new attribute \"autoRefreshFW\" ", "1.4.1" => "31.10.2018 attribute \"autoLoop\" changed to \"autoRefresh\", new attribute \"autoRefreshFW\" ",
"1.4.0" => "29.10.2018 readingFnAttributes added ", "1.4.0" => "29.10.2018 readingFnAttributes added ",
"1.3.0" => "28.10.2018 direct help for attributes, new attribute \"autoLoop\" ", "1.3.0" => "28.10.2018 direct help for attributes, new attribute \"autoLoop\" ",
@ -68,6 +69,7 @@ sub SSCamSTRM_Initialize($) {
"forcePageRefresh:1,0 ". "forcePageRefresh:1,0 ".
"htmlattr ". "htmlattr ".
"hideDisplayName:1,0 ". "hideDisplayName:1,0 ".
"popupWindowSize ".
$readingFnAttributes; $readingFnAttributes;
$hash->{FW_summaryFn} = "SSCamSTRM_FwFn"; $hash->{FW_summaryFn} = "SSCamSTRM_FwFn";
$hash->{FW_detailFn} = "SSCamSTRM_FwFn"; $hash->{FW_detailFn} = "SSCamSTRM_FwFn";
@ -274,12 +276,23 @@ Dependend of the Streaming-Device state, different buttons are provided to start
<a name="htmlattr"></a> <a name="htmlattr"></a>
<li><b>htmlattr</b><br> <li><b>htmlattr</b><br>
Additional HTML tags to manipulate the streaming device. <br> Additional HTML tags to manipulate the streaming device.
<ul> <br><br>
<ul> <ul>
<b>Example: </b><br> <b>Example: </b><br>
attr &lt;name&gt; htmlattr width="480" height="560" <br> attr &lt;name&gt; htmlattr width=480 height=560 <br>
</ul> </ul>
</li>
<br>
<a name="popupWindowSize"></a>
<li><b>popupWindowSize</b><br>
If the content of playback (Videostream or Snapshot gallery) is suitable, by clicking the content a popup window will appear.
The size of display can be setup by this attribute.
<br><br>
<ul>
<b>Example: </b><br>
attr &lt;name&gt; popupWindowSize width=1000 height=625 <br>
</ul> </ul>
</li> </li>
@ -378,10 +391,23 @@ Abhängig vom Zustand des Streaming-Devices werden zum Start von Aktionen unters
<a name="htmlattr"></a> <a name="htmlattr"></a>
<li><b>htmlattr</b><br> <li><b>htmlattr</b><br>
Zusätzliche HTML Tags zur Darstellungsänderung im Streaming Device. <br> Zusätzliche HTML Tags zur Darstellungsänderung im Streaming Device.
<br><br>
<ul> <ul>
<b>Beispiel: </b><br> <b>Beispiel: </b><br>
attr &lt;name&gt; htmlattr width="480" height="560" <br> attr &lt;name&gt; htmlattr width=480 height=560 <br>
</ul>
</li>
<br>
<a name="popupWindowSize"></a>
<li><b>popupWindowSize</b><br>
Bei geeigneten Wiedergabeinhalten (Videostream oder Schnappschußgalerie) öffnet ein Klick auf den Bildinhalt ein
Popup-Fenster mit diesem Inhalt. Die Darstellungsgröße kann mit diesem Attribut eingestellt werden.
<br><br>
<ul>
<b>Beispiel: </b><br>
attr &lt;name&gt; popupWindowSize width=1000 height=625 <br>
</ul> </ul>
</li> </li>