Add DefaultPlayer support in getStreamSrc

This commit is contained in:
Isaac Connor
2025-09-24 14:05:58 -04:00
parent 799f4f701e
commit fe323e0aff

View File

@@ -1149,6 +1149,8 @@ class Monitor extends ZM_Object {
</div>
<div class="zoompan">';
$player = isset($options['player']) ? $options['player'] : $this->DefaultPlayer();
if ($this->Type() == 'WebSite') {
$html .= getWebSiteUrl(
'liveStream'.$this->Id(), $this->Path(),
@@ -1166,6 +1168,20 @@ class Monitor extends ZM_Object {
'format' => ZM_MPEG_LIVE_FORMAT
) );
$html .= getVideoStreamHTML( 'liveStream'.$this->Id(), $streamSrc, $options['width'], $options['height'], ZM_MPEG_LIVE_FORMAT, $this->Name() );
} else if ($player == 'zms') {
if ( $options['mode'] == 'stream' and canStream() ) {
$options['mode'] = 'jpeg';
$streamSrc = $this->getStreamSrc($options);
$html .= getImageStreamHTML('liveStream'.$this->Id(), $streamSrc, $options['width'], $options['height'], $this->Name());
} else if ( $options['mode'] == 'single' and canStream() ) {
$streamSrc = $this->getStreamSrc($options);
$html .= getImageStreamHTML('liveStream'.$this->Id(), $streamSrc, $options['width'], $options['height'], $this->Name());
} else if ( $options['mode'] == 'paused' and canStream() ) {
$streamSrc = $this->getStreamSrc($options);
$html .= getImageStreamHTML('liveStream'.$this->Id(), $streamSrc, $options['width'], $options['height'], $this->Name());
} else {
Debug("What mode or canStream? ".$options['mode']." ".canStream());
}
} else if ($this->JanusEnabled() or ($this->RTSP2WebEnabled() and ZM_RTSP2WEB_PATH) or ($this->Go2RTCEnabled() and ZM_GO2RTC_PATH)) {
$html .= '<video id="liveStream'.$this->Id().'" '.
((isset($options['width']) and $options['width'] and $options['width'] != '0')?'width="'.$options['width'].'"':'').