但它没有显示视频。
<?php
$file = $_GET['id'];
header ("Content-type: application/octet-stream");
$mimetype = "video/mp4";
header('Content-Type: '.$mimetype);
header('Content-Transfer-Encoding: binary');
header ('Content-disposition: attachment; filename='.$file.';');
header('Content-Length: '.filesize($file));
readfile(realpath($file));
exit;
?>
有人可以帮忙吗?
答案 0 :(得分:-1)
要显示服务器中的视频,您需要添加html5 video代码或embed
PHP文件(video.php
)
$file = $_GET["id"]; //'http://techslides.com/demos/sample-videos/small.mp4';
readfile($file);
HTML5(showVideo.php
)
<video width="320" height="240" controls>
<source src="video.php">
Your browser does not support the video tag.
</video>