From c9faafe80a9fa42a95780a4ecaa9be7f04c6eb09 Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sun, 9 Dec 2018 12:42:06 +0000 Subject: [PATCH] 49_SSCam: contrib 7.7.0 git-svn-id: https://svn.fhem.de/fhem/trunk@17930 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/49_SSCam.pm | 36 +++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/fhem/contrib/DS_Starter/49_SSCam.pm b/fhem/contrib/DS_Starter/49_SSCam.pm index 51ce9af2d..eba092101 100644 --- a/fhem/contrib/DS_Starter/49_SSCam.pm +++ b/fhem/contrib/DS_Starter/49_SSCam.pm @@ -45,7 +45,8 @@ use HttpUtils; # Versions History intern our %SSCam_vNotesIntern = ( - "7.7.0" => "07.12.2018 SVS-Device: autocreateCams command added, some other fixes and improvements, minor code rewrite ", + "7.7.0" => "07.12.2018 SVS-Device: autocreateCams command added, some other fixes and improvements, minor code rewrite, ". + "save Stream \$streamHash->{HELPER}{STREAM} for popupStream in SSCamSTRM-Device ", "7.6.0" => "02.12.2018 sub SSCam_ptzpanel completed by Preset and Patrol, minor fixes ", "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 ", @@ -6228,6 +6229,7 @@ sub SSCam_StreamDev($$$) { $hash->{HELPER}{STRMDEV} = $strmdev; # Name des aufrufenden SSCamSTRM-Devices $hash->{HELPER}{STRMROOM} = $FW_room?$FW_room:""; # Raum aus dem das SSCamSTRM-Device die Funktion aufrief $hash->{HELPER}{STRMDETAIL} = $FW_detail?$FW_detail:""; # Name des SSCamSTRM-Devices (wenn Detailansicht) + my $streamHash = $defs{$strmdev}; # SSCamSTRM-Devices # Definition Tasten my $imgblank = ""; # nicht sichtbare Leertaste @@ -6281,15 +6283,17 @@ sub SSCam_StreamDev($$$) { } if($fmt =~ /mjpeg/) { - if($apivideostmsmaxver) { # keine API "SYNO.SurveillanceStation.VideoStream" mehr ab API v2.8 + if($apivideostmsmaxver) { # keine API "SYNO.SurveillanceStation.VideoStream" mehr ab API v2.8 $link = "$proto://$serveraddr:$serverport/webapi/$apivideostmspath?api=$apivideostms&version=$apivideostmsmaxver&method=Stream&cameraId=$camid&format=mjpeg&_sid=$sid"; } elsif ($hash->{HELPER}{STMKEYMJPEGHTTP}) { $link = $hash->{HELPER}{STMKEYMJPEGHTTP}; } - 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"; } $ret .= "')\">
"; + $streamHash->{HELPER}{STREAM} = ""; # Stream für "get popupStream" speichern + if(ReadingsVal($camname, "Record", "Stop") eq "Stop") { # Aufnahmebutton endlos Start $ret .= "$imgrecendless "; @@ -6312,7 +6316,7 @@ sub SSCam_StreamDev($$$) { Your browser does not support the audio element. "; $ret .= ""; - $ret .= "" if(AttrVal($camname,"ptzPanel_use",1)); + $ret .= "" if(AttrVal($camname,"ptzPanel_use",0)); } } elsif($fmt =~ /generic/) { @@ -6334,6 +6338,7 @@ sub SSCam_StreamDev($$$) { $ret .= ""; $ret .= "$htag"; + $streamHash->{HELPER}{STREAM} = "$htag"; # Stream für "get popupStream" speichern $ret .= "
"; Log3($strmdev, 4, "$strmdev - generic Stream params:\n$htag"); $ret .= "$imgrefresh "; @@ -6361,6 +6366,7 @@ sub SSCam_StreamDev($$$) { if($link && $wltype =~ /image|iframe|video|base64img|embed|hls/) { if($wltype =~ /image/) { $ret .= "')\">
"; + $streamHash->{HELPER}{STREAM} = ""; # Stream für "get popupStream" speichern $ret .= "$imgstop "; $ret .= $imgblank; if($hash->{HELPER}{RUNVIEW} =~ /live_fw/) { @@ -6387,13 +6393,16 @@ sub SSCam_StreamDev($$$) { Your browser does not support the audio element. "; $ret .= ""; - $ret .= "" if(AttrVal($camname,"ptzPanel_use",1)); + $ret .= "" if(AttrVal($camname,"ptzPanel_use",0)); } } elsif ($wltype =~ /iframe/) { $ret .= "
"; + $streamHash->{HELPER}{STREAM} = ""; # Stream für "get popupStream" speichern $ret .= "$imgstop "; $ret .= "$imgrefresh "; $ret .= ""; @@ -6404,7 +6413,7 @@ sub SSCam_StreamDev($$$) { Your browser does not support the audio element. "; $ret .= ""; - $ret .= "" if(AttrVal($camname,"ptzPanel_use",1)); + $ret .= "" if(AttrVal($camname,"ptzPanel_use",0)); } } elsif ($wltype =~ /video/) { @@ -6414,6 +6423,12 @@ sub SSCam_StreamDev($$$) { Your browser does not support the video tag
"; + $streamHash->{HELPER}{STREAM} = ""; # Stream für "get popupStream" speichern $ret .= "$imgstop "; $ret .= ""; if($hash->{HELPER}{AUDIOLINK} && ReadingsVal($camname, "CamAudioType", "Unknown") !~ /Unknown/) { @@ -6423,15 +6438,17 @@ sub SSCam_StreamDev($$$) { Your browser does not support the audio element. "; $ret .= ""; - $ret .= "" if(AttrVal($camname,"ptzPanel_use",1)); + $ret .= "" if(AttrVal($camname,"ptzPanel_use",0)); } } elsif($wltype =~ /base64img/) { $ret .= "')\">
"; + $streamHash->{HELPER}{STREAM} = ""; # Stream für "get popupStream" speichern $ret .= "$imgstop "; $ret .= ""; } elsif($wltype =~ /embed/) { $ret .= "')\">"; + $streamHash->{HELPER}{STREAM} = ""; # Stream für "get popupStream" speichern } elsif($wltype =~ /hls/) { $ret .= "
"; + $streamHash->{HELPER}{STREAM} = ""; # Stream für "get popupStream" speichern $ret .= "$imgstop "; $ret .= "$imgrefresh "; $ret .= "$imghlsreact ";