diff --git a/web/zm_funcs.php b/web/zm_funcs.php index 66cb915e5..ce6e1fbd7 100644 --- a/web/zm_funcs.php +++ b/web/zm_funcs.php @@ -145,6 +145,220 @@ function getStreamSrc( $args ) return( $stream_src ); } +function outputVideoStream( $src, $width, $height, $name, $format ) +{ + switch ( $format ) + { + case "asf" : + $mime_type = "video/x-ms-asf"; + break; + case "swf" : + $mime_type = "application/x-shockwave-flash"; + break; + case "mp4" : + $mime_type = "video/mp4"; + break; + case "mov" : + $mime_type = "video/quicktime"; + break; + default : + $mime_type = "video/$format"; + break; + } + $object_tag = false; + if ( ZM_WEB_USE_OBJECT_TAGS ) + { + switch( $format ) + { + case "asf" : + case "wmv" : + { + if ( isWindows() ) + { +?> + + + + + + + + + + + + + + + + + + + + + +src="" +width="" +height="" +name="" +autostart="1" +autoplay="1" +showcontrols="0" +controller="0"> + + +<?= $name ?> + +
+ + + + + + + + + + + + +
+ + + + + +<?= $name ?> + +
+ + + + + + + + + + + + +
+ 0 ) || ( $det1 > 0 && $det2 < 0 ) ) - { - return( true ); - } - - if ( !$det1 ) - { - if ( !$det2 ) - return( true ); - elseif ( ($line2[1]['x'] == $line2[0]['x']) && ($line2[1]['y'] == $line2[0]['y']) ) - return( true ); - } - elseif ( !$det2 ) - { - if ( !$dx && !$dy ) - return( true ); - } - - return( false ); -} - function linesIntersect( $line1, $line2 ) { global $debug; @@ -1199,55 +1369,33 @@ function linesIntersect( $line1, $line2 ) if ( $dx1 && $dx2 ) // Both not vertical { - //if ( isset($m1) && isset($m2) ) // Both not horizontal + if ( $m1 != $m2 ) // Not parallel or colinear { - if ( $m1 != $m2 ) // Not parallel or colinear - { - $x = ( $b2 - $b1 ) / ( $m1 - $m2 ); + $x = ( $b2 - $b1 ) / ( $m1 - $m2 ); - if ( $x >= $min_x1 && $x <= $max_x1 && $x >= $min_x2 && $x <= $max_x2 ) - { - if ( $debug ) echo "Intersecting, at x $x
"; - return( true ); - } - else - { - if ( $debug ) echo "Not intersecting, out of range at x $x
"; - return( false ); - } - } - elseif ( $b1 == $b2 ) + if ( $x >= $min_x1 && $x <= $max_x1 && $x >= $min_x2 && $x <= $max_x2 ) { - // Colinear, must overlap due to box check, intersect? - if ( $debug ) echo "Intersecting, colinear
"; + if ( $debug ) echo "Intersecting, at x $x
"; return( true ); } else { - // Parallel - if ( $debug ) echo "Not intersecting, parallel
"; + if ( $debug ) echo "Not intersecting, out of range at x $x
"; return( false ); } } - //elseif ( isset($m1) ) // Line 2 is horizontal - //{ - // - //} - //else // Both lines are horizontal - //{ - //if ( $line1[0]['y'] == $line2[0]['y'] ) - //{ - //// Colinear, must overlap due to box check, intersect? - //if ( $debug ) echo "Intersecting, horizontal, colinear
"; - //return( true ); - //} - //else - //{ - //// Parallel - //if ( $debug ) echo "Not intersecting, horizontal, parallel
"; - //return( false ); - //} - //} + elseif ( $b1 == $b2 ) + { + // Colinear, must overlap due to box check, intersect? + if ( $debug ) echo "Intersecting, colinear
"; + return( true ); + } + else + { + // Parallel + if ( $debug ) echo "Not intersecting, parallel
"; + return( false ); + } } elseif ( !$dx1 ) // Line 1 is vertical { diff --git a/web/zm_html_view_cycle.php b/web/zm_html_view_cycle.php index fe34b3a27..dc7b3a63d 100644 --- a/web/zm_html_view_cycle.php +++ b/web/zm_html_view_cycle.php @@ -124,13 +124,13 @@ if ( $mode == "stream" ) if ( canStreamNative() ) { ?> - + - + - + diff --git a/web/zm_html_view_event.php b/web/zm_html_view_event.php index 29450288b..16519cf91 100644 --- a/web/zm_html_view_event.php +++ b/web/zm_html_view_event.php @@ -312,56 +312,18 @@ if ( $mode == "stream" ) if ( ZM_VIDEO_STREAM_METHOD == 'mpeg' && ZM_VIDEO_REPLAY_FORMAT ) { $stream_src = getStreamSrc( array( "mode=mpeg", "event=".$eid, "scale=".$scale, "rate=".$rate, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_VIDEO_REPLAY_FORMAT ) ); - if ( isWindows() ) - { -?> - - - - - - - - - - - - - - - diff --git a/web/zm_html_view_montagefeed.php b/web/zm_html_view_montagefeed.php index 0260c181a..68ef71e9a 100644 --- a/web/zm_html_view_montagefeed.php +++ b/web/zm_html_view_montagefeed.php @@ -109,120 +109,37 @@ if ( $mode == "stream" ) if ( ZM_VIDEO_STREAM_METHOD == 'mpeg' && ZM_VIDEO_LIVE_FORMAT ) { $stream_src = getStreamSrc( array( "mode=mpeg", "monitor=".$monitor['Id'], "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_VIDEO_LIVE_FORMAT ) ); - if ( isWindows() ) - { -?> - - - - - - - - - - - -
- - - - - - - - - - -
- -<?= $monitor['Name'] ?> - - - -
- - - - - - - - - -
- -<?= $monitor['Name'] ?> - diff --git a/web/zm_html_view_watchfeed.php b/web/zm_html_view_watchfeed.php index 43a97307c..0d32d59ec 100644 --- a/web/zm_html_view_watchfeed.php +++ b/web/zm_html_view_watchfeed.php @@ -99,41 +99,7 @@ if ( $mode == "stream" ) if ( ZM_VIDEO_STREAM_METHOD == 'mpeg' && ZM_VIDEO_LIVE_FORMAT ) { $stream_src = getStreamSrc( array( "mode=mpeg", "monitor=".$mid, "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_VIDEO_LIVE_FORMAT ) ); - if ( isWindows() ) - { -?> - - - - - - - - - - - { if ( $control && ($monitor['CanMoveMap'] || $monitor['CanMoveRel'] || $monitor['CanMoveCon']) ) { -?> -
- - - - - - - - - - - - -
- -<?= $monitor['Name'] ?> - - - -
- - - - - - - - - - - -
- -<?= $monitor['Name'] ?> -