implement alternate ports for streaming

This commit is contained in:
Isaac Connor 2017-10-05 16:05:41 -04:00
parent 40972383c1
commit 09242d72b3
2 changed files with 20 additions and 2 deletions

View File

@ -899,6 +899,21 @@ our @options = (
type => $types{integer}, type => $types{integer},
category => 'network', category => 'network',
}, },
{
name => 'ZM_MIN_STREAMING_PORT',
default => '',
description => 'Alternate port range to contact for streaming video.',
help => q`
Due to browsers only wanting to open 6 connections, if you have more
than 6 monitors, you can have trouble viewing more than 6. This setting
specified the beginning of a port range that will be used to contact ZM
on. Each monitor will use this value plus the Monitor Id to stream
content. So a value of 2000 here will cause a stream for Monitor 1 to
hit port 2001. Please ensure that you configure apache appropriately
to respond on these ports.`,
type => $types{integer},
category => 'network',
},
{ {
name => 'ZM_MIN_RTP_PORT', name => 'ZM_MIN_RTP_PORT',
default => '40200', default => '40200',

View File

@ -174,10 +174,13 @@ private $control_fields = array(
public function getStreamSrc( $args, $querySep='&' ) { public function getStreamSrc( $args, $querySep='&' ) {
if ( isset($this->{'ServerId'}) and $this->{'ServerId'} ) { if ( isset($this->{'ServerId'}) and $this->{'ServerId'} ) {
$Server = new Server( $this->{'ServerId'} ); $Server = new Server( $this->{'ServerId'} );
$streamSrc = ZM_BASE_PROTOCOL.'://'.$Server->Hostname().ZM_PATH_ZMS; $streamSrc = ZM_BASE_PROTOCOL.'://'.$Server->Hostname();
} else { } else {
$streamSrc = ZM_BASE_URL.ZM_PATH_ZMS; $streamSrc = ZM_BASE_URL;
} }
if ( ZM_MIN_STREAMING_PORT )
$streamSrc .= ':'. (ZM_MIN_STREAMING_PORT+$this->{'Id'});
$streamSrc .= ZM_PATH_ZMS;
$args['monitor'] = $this->{'Id'}; $args['monitor'] = $this->{'Id'};