Improved stream handling for single image mode, for Chrome etc.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3281 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2011-02-06 16:04:11 +00:00
parent ee3c2f84a4
commit 98203e6c2f
4 changed files with 7 additions and 4 deletions

View File

@ -171,7 +171,7 @@ function getStreamSrc( $args, $querySep='&' )
$args[] = "user=".$_SESSION['username']; $args[] = "user=".$_SESSION['username'];
} }
} }
if ( !empty($GLOBALS['connkey']) ) if ( !in_array( "mode=single", $args ) && !empty($GLOBALS['connkey']) )
{ {
$args[] = "connkey=".$GLOBALS['connkey']; $args[] = "connkey=".$GLOBALS['connkey'];
} }

View File

@ -710,10 +710,14 @@ function initPage()
var streamImg = $('imageFeed').getElement('img'); var streamImg = $('imageFeed').getElement('img');
if ( !streamImg ) if ( !streamImg )
streamImg = $('imageFeed').getElement('object'); streamImg = $('imageFeed').getElement('object');
$(streamImg).addEvent( 'click', handleClick.bindWithEvent( $(streamImg) ) );
if ( streamMode == "single" ) if ( streamMode == "single" )
{
streamImg.addEvent( 'click', fetchImage.pass( streamImg ) );
fetchImage.pass( streamImg ).periodical( imageRefreshTimeout ); fetchImage.pass( streamImg ).periodical( imageRefreshTimeout );
} }
else
streamImg.addEvent( 'click', handleClick.bindWithEvent( streamImg ) );
}
if ( refreshApplet && appletRefreshTime ) if ( refreshApplet && appletRefreshTime )
appletRefresh.delay( appletRefreshTime*1000 ); appletRefresh.delay( appletRefreshTime*1000 );

View File

@ -50,7 +50,7 @@ var monitorHeight = <?= $monitor['Height'] ?>;
var scale = <?= $scale ?>; var scale = <?= $scale ?>;
var streamSrc = "<?= $streamSrc ?>"; var streamSrc = "<?= preg_replace( '/&amp;/', '&', $streamSrc ) ?>";
var statusRefreshTimeout = <?= 1000*ZM_WEB_REFRESH_STATUS ?>; var statusRefreshTimeout = <?= 1000*ZM_WEB_REFRESH_STATUS ?>;
var eventsRefreshTimeout = <?= 1000*ZM_WEB_REFRESH_EVENTS ?>; var eventsRefreshTimeout = <?= 1000*ZM_WEB_REFRESH_EVENTS ?>;

View File

@ -44,7 +44,6 @@ $connkey = generateConnKey();
if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT ) if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT )
{ {
$streamMode = "mpeg"; $streamMode = "mpeg";
//$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_LIVE_FORMAT, "buffer=".$monitor['StreamReplayBuffer'] ) );
$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_LIVE_FORMAT ) ); $streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_LIVE_FORMAT ) );
} }
elseif ( canStream() ) elseif ( canStream() )