Files
fdn2/public/getLocalVideo.php
T
Lorenzo Giacomelli ac76651553 fix size youtube video piccoli
prove con local video ristabilito preload auto
2017-03-29 12:40:56 +02:00

24 lines
614 B
PHP

<?php
require_once(dirname(__FILE__)."/load.php");
// $sizes = array(
// "large"=>array("width"=>800,"height"=>600),
// "small"=>array("width"=>160,"height"=>120)
// );
if (array_key_exists("id",$_GET)) {
$video = GlobalVariables::get("dao")->getFirst("MediaModel",array("id"=>$_GET['id']));
if (!is_null($video)){
$basepath = GlobalVariables::get("config")->paths->media;
$videoPath= $basepath."/".$video->id.".".$video->extension;
$lenght = filesize($videoPath);
header('Content-Type: '.mime_content_type($videoPath));
header('Content-Lenght: '.$lenght);
readfile($videoPath);
}
}
?>