= 352 && $deviceHeight >= 288 ) $videoSize = "352x288"; elseif ( $deviceWidth >= 176 && $deviceHeight >= 144 ) $videoSize = "176x144"; else $videoSize = "128x96"; $eventWidth = $event['Width']; $eventHeight = $event['Height']; if ( !isset( $rate ) ) $_REQUEST['rate'] = reScale( RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE ); $eventPath = ZM_DIR_EVENTS.'/'.getEventPath( $event ); $videoFormats = array(); $ffmpegFormats = preg_split( '/\s+/', ZM_FFMPEG_FORMATS ); foreach ( $ffmpegFormats as $ffmpegFormat ) { preg_match( '/^([^*]+)(\**)$/', $ffmpegFormat, $matches ); $videoFormats[$matches[1]] = $matches[1]; if ( $matches[2] == '*' ) $defaultVideoFormat = $matches[1]; elseif ( $matches[2] == '**' ) $defaultPhoneFormat = $matches[1]; } if ( !isset($_REQUEST['videoFormat']) ) { if ( isset($defaultPhoneFormat) ) $_REQUEST['videoFormat'] = $defaultPhoneFormat; elseif ( isset($defaultVideoFormat) ) $_REQUEST['videoFormat'] = $defaultVideoFormat; else $videoFormat = $ffmpegFormats[0]; } if ( !empty($_REQUEST['generate']) ) { $videoFile = createVideo( $event, $_REQUEST['videoFormat'], $_REQUEST['rate'], $videoSize, !empty($_REQUEST['overwrite']) ); } $videoFiles = array(); if ( $dir = opendir( $eventPath ) ) { while ( ($file = readdir( $dir )) !== false ) { $file = $eventPath.'/'.$file; if ( is_file( $file ) ) { if ( preg_match( '/-S([\da-z]+)\.(?:'.join( '|', $videoFormats ).')$/', $file, $matches ) ) { if ( $matches[1] == $videoSize ) { $videoFiles[] = $file; } } } } closedir( $dir ); } if ( isset($_REQUEST['download']) ) { header( "Content-type: ".getMimeType($videoFiles[$_REQUEST['download']])); header( "Content-length: ".filesize($videoFiles[$_REQUEST['download']])); header( "Content-disposition: attachment; filename=".preg_replace( "/^.*\//", "", $videoFiles[$_REQUEST['download']] )."; size=".filesize($videoFiles[$_REQUEST['download']]) ); readfile( $videoFiles[$_REQUEST['download']] ); exit; } xhtmlHeaders( __FILE__, translate('Video').' - '.$event['Name'] ); ?>
checked="checked"/>

0 ) { $index = 0; foreach ( $videoFiles as $file ) { preg_match( '/^(.+)-((?:r[_\d]+)|(?:F[_\d]+))-((?:s[_\d]+)|(?:S[0-9a-z]+))\.([^.]+)$/', $file, $matches ); if ( preg_match( '/^r(.+)$/', $matches[2], $temp_matches ) ) { $rate = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) ); $rateText = isset($rates[$rate])?$rates[$rate]:($rate."x"); } elseif ( preg_match( '/^F(.+)$/', $matches[2], $temp_matches ) ) { $rateText = $temp_matches[1]."fps"; } if ( preg_match( '/^s(.+)$/', $matches[3], $temp_matches ) ) { $scale = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) ); $scaleText = isset($scales[$scale])?$scales[$scale]:($scale."x"); } elseif ( preg_match( '/^S(.+)$/', $matches[3], $temp_matches ) ) { $scaleText = $temp_matches[1]; } ?>
 /