diff --git a/web/includes/functions.php b/web/includes/functions.php index 9a8264548..459a3772d 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -229,154 +229,137 @@ function getMimeType( $file ) return( trim( exec( 'file -bi '.escapeshellarg( $file ).' 2>/dev/null' ) ) ); } -function outputVideoStream( $id, $src, $width, $height, $format, $title="" ) -{ - if ( file_exists( $src ) ) - $mimeType = getMimeType( $src ); - else - { - switch( $format ) - { - case 'asf' : - $mimeType = "video/x-ms-asf"; - break; - case 'avi' : - case 'wmv' : - $mimeType = "video/x-msvideo"; - break; - case 'mov' : - $mimeType = "video/quicktime"; - break; - case 'mpg' : - case 'mpeg' : - $mimeType = "video/mpeg"; - break; - case 'swf' : - $mimeType = "application/x-shockwave-flash"; - break; - case '3gp' : - $mimeType = "video/3gpp"; - break; - default : - $mimeType = "video/$format"; - break; - } - } - if ( !$mimeType || ($mimeType == 'application/octet-stream') ) - $mimeType = 'video/'.$format; - $objectTag = false; - if ( ZM_WEB_USE_OBJECT_TAGS ) - { - switch( $mimeType ) - { - case "video/x-ms-asf" : - case "video/x-msvideo" : - case "video/mp4" : - { - if ( isWindows() ) - { -?> - - - - - - - - - - - - + + + + + '; + } + } + case "video/quicktime" : + { + return ''; + } + case "application/x-shockwave-flash" : + { + return ''; + } + } # end switch + } # end if use object tags + return ''; +} + +function outputImageStream( $id, $src, $width, $height, $title="" ) { + echo getImageStream( $id, $src, $width, $height, $title ); +} + + +function getImageStream( $id, $src, $width, $height, $title="" ) { + if ( canStreamIframe() ) { + return ''; + } else { + return ''; + } } function outputControlStream( $src, $width, $height, $monitor, $scale, $target ) @@ -2502,11 +2485,11 @@ function getStreamHTML( $monitor, $scale=100 ) { //FIXME, the width and height of the image need to be scaled. if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT ) { $streamSrc = $monitor->getStreamSrc( array( "mode=mpeg", "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_LIVE_FORMAT ) ); - outputVideoStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), ZM_MPEG_LIVE_FORMAT, $monitor->Name() ); + return getVideoStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), ZM_MPEG_LIVE_FORMAT, $monitor->Name() ); } else if ( canStream() ) { $streamSrc = $monitor->getStreamSrc( array( 'mode=jpeg', 'scale='.$scale, 'maxfps='.ZM_WEB_VIDEO_MAXFPS, 'buffer='.$monitor->StreamReplayBuffer() ) ); if ( canStreamNative() ) - outputImageStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() ); + return getImageStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() ); elseif ( canStreamApplet() ) outputHelperStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() ); } else { diff --git a/web/skins/classic/views/zone.php b/web/skins/classic/views/zone.php index 498ea5502..1e17d32a6 100644 --- a/web/skins/classic/views/zone.php +++ b/web/skins/classic/views/zone.php @@ -118,6 +118,10 @@ $selfIntersecting = isSelfIntersecting( $newZone['Points'] ); $focusWindow = true; $connkey = generateConnKey(); +$streamSrc = ''; +$streamMode = ''; +# Have to do this here, because the .js.php references somethings figured out when generating the streamHTML +$StreamHTML = getStreamHTML( $monitor, $scale ); xhtmlHeaders(__FILE__, translate('Zone') ); ?> @@ -211,7 +215,7 @@ xhtmlHeaders(__FILE__, translate('Zone') );