Use Server->Url() more,, moving the logic into Server->Url()
This commit is contained in:
parent
34299aff2c
commit
661876b998
|
@ -195,20 +195,13 @@ private $control_fields = array(
|
|||
}
|
||||
}
|
||||
|
||||
public function getStreamSrc( $args, $querySep='&' ) {
|
||||
public function getStreamSrc($args, $querySep='&') {
|
||||
|
||||
$streamSrc = $this->Server()->Url(
|
||||
ZM_MIN_STREAMING_PORT ?
|
||||
ZM_MIN_STREAMING_PORT+$this->{'Id'} :
|
||||
null);
|
||||
|
||||
$streamSrc = ZM_BASE_PROTOCOL.'://';
|
||||
if ( isset($this->{'ServerId'}) and $this->{'ServerId'} ) {
|
||||
$Server = new Server( $this->{'ServerId'} );
|
||||
$streamSrc .= $Server->Hostname();
|
||||
if ( ZM_MIN_STREAMING_PORT ) {
|
||||
$streamSrc .= ':'.(ZM_MIN_STREAMING_PORT+$this->{'Id'});
|
||||
}
|
||||
} else if ( ZM_MIN_STREAMING_PORT ) {
|
||||
$streamSrc .= $_SERVER['SERVER_NAME'].':'.(ZM_MIN_STREAMING_PORT+$this->{'Id'});
|
||||
} else {
|
||||
$streamSrc .= $_SERVER['HTTP_HOST'];
|
||||
}
|
||||
$streamSrc .= ZM_PATH_ZMS;
|
||||
|
||||
$args['monitor'] = $this->{'Id'};
|
||||
|
@ -230,9 +223,9 @@ private $control_fields = array(
|
|||
$args['rand'] = time();
|
||||
}
|
||||
|
||||
$streamSrc .= '?'.http_build_query( $args,'', $querySep );
|
||||
$streamSrc .= '?'.http_build_query($args,'', $querySep);
|
||||
|
||||
return( $streamSrc );
|
||||
return $streamSrc;
|
||||
} // end function getStreamSrc
|
||||
|
||||
public function Width($new = null) {
|
||||
|
@ -487,9 +480,10 @@ private $control_fields = array(
|
|||
$source = preg_replace( '/^.*\//', '', $this->{'Path'} );
|
||||
} elseif ( $this->{'Type'} == 'Ffmpeg' || $this->{'Type'} == 'Libvlc' || $this->{'Type'} == 'WebSite' ) {
|
||||
$url_parts = parse_url( $this->{'Path'} );
|
||||
if ( ZM_WEB_FILTER_SOURCE == "Hostname" ) { # Filter out everything but the hostname
|
||||
if ( ZM_WEB_FILTER_SOURCE == 'Hostname' ) { # Filter out everything but the hostname
|
||||
$source = $url_parts['host'];
|
||||
} elseif ( ZM_WEB_FILTER_SOURCE == "NoCredentials" ) { # Filter out sensitive and common items
|
||||
} elseif ( ZM_WEB_FILTER_SOURCE == 'NoCredentials' ) {
|
||||
# Filter out sensitive and common items
|
||||
unset($url_parts['user']);
|
||||
unset($url_parts['pass']);
|
||||
#unset($url_parts['scheme']);
|
||||
|
|
Loading…
Reference in New Issue