移动视频加载缓慢

时间:2017-10-11 01:33:51

标签: html video mp4

我有一个包含mp4视频和jpg海报的网站但是移动设备的视频加载速度相当慢,无论如何加快速度? iv重命名文件名,但这是我的代码:

<div class="w3-row-padding" style="margin-bottom:128px">
  <div class="w3-half w3-center">
    <video controls height="380" width="512" class="video" poster="Images/image.jpg" controlsList="nodownload noaudio">
            <source src="videos/video.mp4" type="video/mp4"> Your browser does not support the video tag.
          </video>
    <video controls height="380" width="512" class="video" poster="Images/image.jpg" controlsList="nodownload noaudio">
            <source src="videos/video.mp4" type="video/mp4"> Your browser does not support the video tag.
          </video>
    <video controls height="380" width="512" class="video" poster="Images/image.jpg" controlsList="nodownload noaudio">
            <source src="videos/video.mp4" type="video/mp4"> Your browser does not support the video tag.
          </video>
    <video controls height="380" width="512" class="video" poster="Images/image.jpg" controlsList="nodownload noaudio">
            <source src="videos/video.mp4" type="video/mp4"> Your browser does not support the video tag.
          </video>
  </div>
  <div class="w3-half w3-center">
    <video controls height="380" width="512" class="video" poster="Images/image.jpg" controlsList="nodownload noaudio">
            <source src="videos/video.mp4" type="video/mp4"> Your browser does not support the video tag.
          </video>
    <video controls height="380" width="512" class="video" poster="Images/image.jpg" controlsList="nodownload noaudio">
            <source src="videos/video.mp4" type="video/mp4"> Your browser does not support the video tag.
          </video>
    <video controls height="380" width="512" class="video" poster="Images/image.jpg" controlsList="nodownload noaudio">
        <source src="videos/video.mp4" type="video/mp4"> Your browser does not support the video tag.
          </video>
    <video controls height="380" width="512" class="video" poster="Images/image.jpg" controlsList="nodownload noaudio">
            <source src="videos/video.mp4" type="video/mp4"> Your browser does not support the video tag.
          </video>

    <br>
    <br>
    <br>
    <div class="w3-right">
      <a title="Next" href="page-2.html" class="w3-button border">Next</a>
      <a style="margin-right: 100px;" href="page-2.html" class="w3-button border">2</a>
    </div>
  </div>
</div>

1 个答案:

答案 0 :(得分:0)

(1)尝试在preload="none"代码设置中添加<video>作为最后参数。

<video controls height="380" width="512" class="video" poster="Images/thg.jpg" controlsList="nodownload noaudio" preload="none">
<source src="videos/Comp 1.mp4" type="video/mp4"> Your browser does not support the video tag.
</video>

问题是页面上的所有视频都试图一次性缓冲/加载,从而减慢一切。使用 preload =“none”将停止任何预加载,直到用户选择播放(它们加载速度更快)。

另一件事可能是你只有一台慢速的服务器。一个视频文件只有500多KB,但仍然以小块缓冲。在我的互联网上,我希望即时可以完全加载500 KB的数据。

检查您的服务器提供商是否在某种程度上限制或限制发送数据包的任何速度/大小。

(2)不要在网址中使用空格 / quotes / colons / bracket等...
虽然有些浏览器可能会为您修复此问题(链接/ URL中的空格被编辑为%20),但仍然无法保证其他应用会接受vid 1.mp4,除非您记得将文件请求为vid%201.mp4。使用下划线vid_1.mp4或短划线vid-1.mp4或仅使用vid1.mp4空格。