MediaElement.js - Flash视频不会播放,直到完全加载 [英] MediaElement.js - Flash Video Wont Play Until Fully Loaded
问题描述
我已经用各种第三方视频文件测试过了,这些视频文件在完全加载前似乎立即播放。只有我的文件没有:(b / b)
使用html5视频解决方案播放时,他们直接播放,而不是在闪回。
这是否可以处理视频编码的设置?我没有看到任何其他原因。
CODE:
< video id =player1src ='BriefTour.m4v'type =video / mp4preload =none> < / video>
< script>
var videoPlayer = MediaElement('player1',{
success:function(me){me.play();}
$您可以看到我
希望有人以前有过这样的经历,可以帮助我!
解决方案当你编码自己的视频并使用FFmpeg时,我建议使用'qt-faststart'。
FFmpeg附带的一个有用的工具,可以用H.264 v重新排列文件ideo,使得moov原子位于数据的前面,从而便于网络流式传输。基本上,它允许网络电影在完全下载之前开始播放。
使用以下ffmpeg目录启用它:
cd〜 / ffmpeg
make tools / qt-faststart
用法(在ffmpeg编码之后):
qt-faststart input.foo output.foo
这可让您的播放器在下载的同时播放视频。
I'm having an issue will MediaElement.js (my flash video player) not playing my .m4V video files (encoded using ffmpeg) until the video is fully loaded.
I have tested this with various third party video files that appear to play straight away before they have completely loaded. Only my files do not :(
When played using the html5 video solution they play straight away, just not on the flash fallback.
Could this be to do with the settings the video is being encoded at? I don't see any other reason.
CODE:
<video id="player1" src='BriefTour.m4v' type="video/mp4" preload="none"></video>
<script>
var videoPlayer = MediaElement('player1',{
success:function(me){me.play();}
});
</script>
As you can see I am specifying no option, the player is on default settings.
Hope someone has encoutered this before and can help me out!
解决方案 As you are encoding your own videos and using FFmpeg, I suggest using 'qt-faststart'.
This is a useful tool included with FFmpeg that rearranges a file with H.264 video, "such that the moov atom is in front of the data, thus facilitating network streaming". Basically, it allows web movies to start playing before they are completely downloaded.
Enable it with the following the ffmpeg directory:
cd ~/ffmpeg
make tools/qt-faststart
Usage (after your ffmpeg encoding):
qt-faststart input.foo output.foo
This should allow your player to play the video while it is still downloading.
这篇关于MediaElement.js - Flash视频不会播放,直到完全加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!