diff --git a/web/includes/functions.php b/web/includes/functions.php
index d7ae4c95b..abf6246b3 100644
--- a/web/includes/functions.php
+++ b/web/includes/functions.php
@@ -217,14 +217,20 @@ 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 ) )
+function outputVideoStream( $id, $src, $width, $height, $format, $title="" ) {
+ echo getVideoStreamHTML( $id, $src, $width, $height, $format, $title );
+}
+
+function getVideoStreamHTML( $id, $src, $width, $height, $format, $title="" ) {
+ $html = '';
+ $width = validInt($width);
+ $height = validInt($height);
+ $title = validHtmlStr($title);
+
+ if ( file_exists( $src ) ) {
$mimeType = getMimeType( $src );
- else
- {
- switch( $format )
- {
+ } else {
+ switch( $format ) {
case 'asf' :
$mimeType = "video/x-ms-asf";
break;
@@ -252,118 +258,95 @@ function outputVideoStream( $id, $src, $width, $height, $format, $title="" )
}
if ( !$mimeType || ($mimeType == 'application/octet-stream') )
$mimeType = 'video/'.$format;
- $objectTag = false;
- if ( ZM_WEB_USE_OBJECT_TAGS )
- {
- switch( $mimeType )
- {
+ if ( ZM_WEB_USE_OBJECT_TAGS ) {
+ switch( $mimeType ) {
case "video/x-ms-asf" :
case "video/x-msvideo" :
case "video/mp4" :
{
- if ( isWindows() )
- {
- ?>
-
- ';
}
- break;
}
case "video/quicktime" :
{
- ?>
-
- ';
}
case "application/x-shockwave-flash" :
{
- ?>
-
- ';
}
- }
- }
- if ( !$objectTag )
- {
- ?>
-