From 79ddb9474821a778f1120400c693482bab5f67ba Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 27 Jan 2004 09:57:12 +0000 Subject: [PATCH] Merged in tristate config. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@777 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_funcs.php | 12 +++++++++++- web/zm_html_view_cycle.php | 2 +- web/zm_html_view_event.php | 2 +- web/zm_html_view_montagefeed.php | 2 +- web/zm_html_view_watchfeed.php | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/web/zm_funcs.php b/web/zm_funcs.php index 4e390fb9e..f6ec4228e 100644 --- a/web/zm_funcs.php +++ b/web/zm_funcs.php @@ -216,9 +216,19 @@ function isNetscape() return( $browser == "mozilla" ); } +function canStreamNative() +{ + return( ZM_CAN_STREAM == "yes" || ( ZM_CAN_STREAM == "auto" && isNetscape() ) ); +} + +function canStreamApplet() +{ + return( (ZM_OPT_CAMBOZOLA && file_exists( ZM_PATH_WEB.'/'.ZM_PATH_CAMBOZOLA )) ); +} + function canStream() { - return( ZM_CAN_STREAM || isNetscape() || (ZM_OPT_CAMBOZOLA && file_exists( ZM_PATH_WEB.'/'.ZM_PATH_CAMBOZOLA )) ); + return( canStreamNative() | canStreamApplet() ); } function fixDevices() diff --git a/web/zm_html_view_cycle.php b/web/zm_html_view_cycle.php index c026a8afb..3a4321a67 100644 --- a/web/zm_html_view_cycle.php +++ b/web/zm_html_view_cycle.php @@ -101,7 +101,7 @@ window.setTimeout( "window.location.replace( ' diff --git a/web/zm_html_view_event.php b/web/zm_html_view_event.php index 657276a2f..8b474a455 100644 --- a/web/zm_html_view_event.php +++ b/web/zm_html_view_event.php @@ -234,7 +234,7 @@ if ( $mode == "still" && $paged && !empty($page) ) if ( $mode == "stream" ) { $stream_src = ZM_PATH_ZMS."?path=".ZM_PATH_WEB."&event=$eid&rate=$rate&scale=$scale"; - if ( isNetscape() ) + if ( canStreamNative() ) { ?> diff --git a/web/zm_html_view_montagefeed.php b/web/zm_html_view_montagefeed.php index 591e8c609..f09ffd495 100644 --- a/web/zm_html_view_montagefeed.php +++ b/web/zm_html_view_montagefeed.php @@ -83,7 +83,7 @@ window.setTimeout( "window.location.reload(true)", ); if ( $mode == "stream" ) { $stream_src = ZM_PATH_ZMS."?monitor=".$monitor['Id']."&idle=".STREAM_IDLE_DELAY."&refresh=".STREAM_FRAME_DELAY; - if ( isNetscape() ) + if ( canStreamNative() ) { ?> diff --git a/web/zm_html_view_watchfeed.php b/web/zm_html_view_watchfeed.php index d422fa5f8..aade902e1 100644 --- a/web/zm_html_view_watchfeed.php +++ b/web/zm_html_view_watchfeed.php @@ -111,7 +111,7 @@ window.setTimeout( "window.location.reload(true)", ); if ( $mode == "stream" ) { $stream_src = ZM_PATH_ZMS."?monitor=".$monitor['Id']."&idle=".STREAM_IDLE_DELAY."&refresh=".STREAM_FRAME_DELAY."&scale=$scale"; - if ( isNetscape() ) + if ( canStreamNative() ) { ?>