Video.js中的MP4在完全加载之前无法播放 [英] MP4 in Video.js not playing until fully loaded

查看:1330
本文介绍了Video.js中的MP4在完全加载之前无法播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Video.js在客户的网站上播放MP4格式的视频。
播放器使用html5视频和Adobe Flash Player作为后备。
(在我的情况下,似乎总是使用Flash,所以我不知道本机html5播放器中是否存在问题。)

I'm using Video.js to play back videos in MP4 format on a client's website. The player uses html5 video and Adobe Flash Player as a fallback. (In my case it seems to use Flash always so I don't know if the problem exists in the native html5 player as well.)

视频仅在* .mp4文件完全加载后才开始播放。因此几秒钟内没有缓冲区。浏览器在开始播放之前必须完全下载该文件。

The video only starts playing after the *.mp4 file is completely loaded. So no buffer for a few seconds. The file must be completely downloaded by the browser before it starts playing.

当视频很长时,访问者必须等待很长时间才能看到视频正在运作。

When the video is long, the visitor has to wait very long before he can even see that the video is working.

现在的问题是,是浏览器,脚本(video.js)还是创建该问题的视频文件。

在videojs.com网站上,视频在加载时播放,因此工作正常。因此我认为它不能是浏览器。

On the videojs.com website however the video is playing back while loading, so works properly. Therefore I think it can't be the browser.

还有其他人有这个问题吗?我该如何解决这个问题?

非常感谢任何建议!

Has anyone else had that problem? How can I fix this issue?
Any advice is very much appreciated!

谢谢

Max

推荐答案

这是因为mp4文件的moov原子位于文件的末尾,玩家需要在开始播放之前知道moov原子,你可以用MP4Box轻松地将moov原子移动到文件的开头,有一个适用于Windows的gui版本。

That occurs because the moov atom of the mp4 file is on the end of the file, the player needs to know the moov atom before start playing, you can move easily the moov atom to the beginning of the file with MP4Box, there is a gui version for Windows.

在Linux命令中你移动MA的行: MP4Box -add my_video.mp4 my_newVideo.mp4

In Linux command line you move the MA with: MP4Box -add my_video.mp4 my_newVideo.mp4.

这需要几秒钟。

更多信息:Adobe对moov原子的解释这里

More info:Adobe's explanation of moov atomhere

这篇关于Video.js中的MP4在完全加载之前无法播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆