Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Nall-chan committed Jan 30, 2024
1 parent 8f45e39 commit 647f1c7
Show file tree
Hide file tree
Showing 7 changed files with 3,059 additions and 43 deletions.
20 changes: 11 additions & 9 deletions ONVIF IO/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,11 @@ protected function StartConnection()
//Fallback für reine Profile S Geräte
$VideoSources = $this->GetVideoSources($XAddr[\ONVIF\NS::Media], \ONVIF\WSDL::Media); // array of Token
if ($VideoSources) {
$NbrOfVideoSources = count($VideoSources['VideoSources']);
$NbrOfVideoSources = count($VideoSources);
}
$AudioSources = $this->GetAudioSources($XAddr[\ONVIF\NS::Media], \ONVIF\WSDL::Media); // array of Token
if ($AudioSources) {
$NbrOfAudioSources = count($AudioSources['AudioSources']);
$NbrOfAudioSources = count($AudioSources);
}
$DigitalInputs = $this->GetDigitalInputs($XAddr[\ONVIF\NS::Management], \ONVIF\WSDL::Management);
if (!$DigitalInputs) {
Expand Down Expand Up @@ -1669,11 +1669,11 @@ protected function GetVideoSources($Uri, $WSDL)
if (is_a($VideoSources, 'SoapFault')) {
return false;
}
if (!is_array($VideoSources)) {
if (!is_array($VideoSources->VideoSources)) {
$Result = [];
$Result[] = json_decode(json_encode($VideoSources), true);
$Result[] = json_decode(json_encode($VideoSources->VideoSources), true);
} else {
$Result = json_decode(json_encode($VideoSources), true);
$Result = json_decode(json_encode($VideoSources->VideoSources), true);
}
return $Result;
}
Expand All @@ -1683,11 +1683,11 @@ protected function GetAudioSources($Uri, $WSDL)
if (is_a($AudioSources, 'SoapFault')) {
return false;
}
if (!is_array($AudioSources)) {
if (!is_array($AudioSources->AudioSources)) {
$Result = [];
$Result[] = json_decode(json_encode($AudioSources), true);
$Result[] = json_decode(json_encode($AudioSources->AudioSources), true);
} else {
$Result = json_decode(json_encode($AudioSources), true);
$Result = json_decode(json_encode($AudioSources->AudioSources), true);
}
return $Result;
}
Expand Down Expand Up @@ -1775,12 +1775,14 @@ protected function GetServices(): bool

$xml = new DOMDocument();
$xml->loadXML($Response);
$this->SendDebug('TEST', $Response, 0);
$xPath = new DOMXPath($xml);

foreach ($ServicesResult as $Service) {
$XAddr[$Service['Namespace']] = parse_url($Service['XAddr'], PHP_URL_PATH);
$NSKey = array_search($Service['Namespace'], \ONVIF\NS::Namespaces);
if (!$NSKey) {
continue;
}
$xPath->registerNamespace($NSKey, $Service['Namespace']);

switch ($Service['Namespace']) {
Expand Down
6 changes: 3 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"compatibility": {
"version": "6.1"
},
"version": "2.16",
"build": 216,
"date": 1706551768
"version": "2.17",
"build": 217,
"date": 1706078839
}
Loading

0 comments on commit 647f1c7

Please sign in to comment.