0
我使用video
标记在我的浏览器(Chrome)上播放视频。只有当文件低于(大约)135MB时,我才能使用此标记播放我的mp4视频。如果文件大于135MB,则无法播放视频(相同格式的&相同的扩展名)。任何人都知道发生了什么事以及如何解决?HTML5视频无法播放
我的代码来打开文件:
<?php
$filename=$_GET['filename']; //parameter identifying the file to be downloaded. Should not be direct path as in this simple example, rather than the id of the file's data stored in a database. You need to add that piece of code.
header('Content-Type: text/plain'); //set MIME type - you need to store this along your path to the file, you can get it from $_FILES['uploadedfilename']['type'] when a file is uploaded via php
header("Content-disposition: attachment;filename=$filename"); //advises the browser to open the file outside of the browser, not within a plugin
readfile($filename); //outputs the file
?>
我的代码来读取文件:
<video controls width="320">
<source src="video_view.php?filename='.$query['v_drive'].'://upload/'.$query['c_group'].'/'.$query['c_name'].'/'.$query['v_link'].'" type="video/mp4">
<source src="video_view.php?filename='.$query['v_drive'].'://upload/'.$query['c_group'].'/'.$query['c_name'].'/'.$query['v_link'].'" type="video/webm">
<object type="application/x-shockwave-flash" data="eh5v.files/html5video/flashfox.swf" width="720" height="576" style="position:relative;">
<param name="movie" value="assets/flashfox.swf" />
<param name="allowFullScreen" value="true" />
<param name="flashVars" value="autoplay=true&controls=true&fullScreenEnabled=true&posterOnEnd=true&loop=false&src=video_view.php?filename='.$query['v_drive'].'://upload/'.$query['c_group'].'/'.$query['c_name'].'/'.$query['v_link'].'"" />
<embed src="assets/flashfox.swf" width="320" style="position:relative;" flashVars="controls=true&fullScreenEnabled=true&posterOnEnd=true&loop=false&src=video_view.php?filename='.$query['v_drive'].'://upload/'.$query['c_group'].'/'.$query['c_name'].'/'.$query['v_link'].'" allowFullScreen="true" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer_en" />
</object>
Your browser does not support the video element.
</video>
是在文件上运行qt-faststart(或等效)吗?或者是后面的moov? – szatmary
没有。没有qt-faststart。我正在使用文件来打开电影。已经更新我的代码。 –
不“快速启动”该文件可能是您的问题。如果你可以发布文件,我可以肯定地告诉你。 – szatmary