Video.js中的MP4在完全加载之前无法播放

编程入门 行业动态 更新时间:2024-10-22 11:25:57
本文介绍了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网站上,视频在加载时播放,因此工作正常。因此我认为它不能是浏览器。

On the videojs 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在完全加载之前无法播放

本文发布于:2023-11-24 21:09:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1626838.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法播放   加载   Video   js

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!