Пример #1
0
 function secure_html5_video_player_filename_no_ext($str)
 {
     $retval = $str;
     $pos = strrpos($str, '.');
     if ($pos > 0) {
         $retval = substr($str, 0, $pos);
     }
     if (secure_html5_video_player_endsWith($retval, '.theora')) {
         $retval = secure_html5_video_player_filename_no_ext($retval);
     }
     return $retval;
 }
Пример #2
0
if (secure_html5_video_player_endsWith($filename, '.ogv') || secure_html5_video_player_endsWith($filename, '.ogg')) {
    $content_type = 'video/ogg';
} else {
    if (secure_html5_video_player_endsWith($filename, '.webm')) {
        $content_type = 'video/webm';
    } else {
        if (secure_html5_video_player_endsWith($filename, '.mp4') || secure_html5_video_player_endsWith($filename, '.m4v')) {
            $content_type = 'video/mp4';
        } else {
            if (secure_html5_video_player_endsWith($filename, '.jpg') || secure_html5_video_player_endsWith($filename, '.jpeg')) {
                $content_type = 'image/jpeg';
            } else {
                if (secure_html5_video_player_endsWith($filename, '.png')) {
                    $content_type = 'image/png';
                } else {
                    if (secure_html5_video_player_endsWith($filename, '.gif')) {
                        $content_type = 'image/gif';
                    }
                }
            }
        }
    }
}
$filesize = filesize($filepath);
$fp = fopen($filepath, 'r');
if (!$fp) {
    exit;
}
$content_length = $filesize;
$range_start = 0;
$range_end = $filesize - 1;