Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Chrome快速视频html_Html - Fatal编程技术网

Chrome快速视频html

Chrome快速视频html,html,Html,我有一个视频在我的网站上播放 除了Google Chrome,我测试过的所有浏览器都可以使用它 视频在播放,但真的很不稳定 我如何解决这个问题,它有时会卡住,然后玩,然后卡住,等等 这是我的密码 <video autoplay="autoplay" loop="loop" preload="auto" muted="muted" poster="images/backscreen.jpg" width="640" height="360"> <source src="v

我有一个视频在我的网站上播放 除了Google Chrome,我测试过的所有浏览器都可以使用它

视频在播放,但真的很不稳定

我如何解决这个问题,它有时会卡住,然后玩,然后卡住,等等

这是我的密码

<video autoplay="autoplay" loop="loop" preload="auto" muted="muted" poster="images/backscreen.jpg" width="640" height="360">
    <source src="videos/footage_test.mp4" type="video/mp4" />
    <object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" width="640" height="360">
        <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
        <param name="allowFullScreen" value="true" />
        <param name="wmode" value="transparent" />
        <img alt="Backscreen" src="images/backscreen.jpg" width="640" height="360" title="No video playback capabilities, please download the video below" />
    </object>
</video>

对此你真的无能为力。您的描述没有足够的具体信息来确定确切原因,但可能是以下原因之一:

  • 您没有足够的带宽支持流式视频(客户端或服务器端)
  • 用于播放的编解码器在Chrome和其他浏览器中是不同的。您使用的是Flowplayer,所以可能在Chrome中使用HTML5,而在其他浏览器中使用Flash,这就留下了各种实现差异,包括编解码器的选择。(例如,可以使用硬件编解码器。)

  • 我遇到了同样的问题,发现可以通过为视频源URL设置缓存控制、ETag和Expires响应头来解决

    如果您还没有设置内容范围、接受范围、内容长度和内容类型,则可能还需要设置内容范围、接受范围、内容长度和内容类型

    这就是使用nodejs可以实现的方法

    fs.stat(path, function(err, stat) {
      if (err) Error(err);
      var positions = req.headers.range.replace(/bytes=/, "").split("-");
      var start = parseInt(positions[0], 10);
      var total = stat.size;
      var end = positions[1] ? parseInt(positions[1], 10) : total - 1;
      var chunksize = (end - start) + 1;
      res.writeHead(206, {
        'Content-Range': 'bytes ' + start + '-' + end + '/' + total,
        'Accept-Ranges': 'bytes',
        'Content-Length': chunksize,
        'Content-Type': 'video/mp4',
        'Cache-Control': 'public, max-age=2592000',
        'ETag': stat.md5Hash,
        'Expires': new Date(Date.now() + 2592000000).toUTCString(),
      });
      // Send file stream
      sendStream(path, start, end);
    });
    

    你能告诉我更多关于这个编解码器的信息吗?有没有其他播放器(比如flowplayer)可以兼容所有浏览器?有,但没关系。最后,flowplayer和所有其他人总结了内置于浏览器和Flash中的功能。那么解决方案是什么呢?我认为问题来自于您的“2”部分answer@user2372006,除了尝试不同的编解码器之外,真的没有一个。每个人都可以毫无问题地播放MPEG-2,但这样做并不能获得很好的视频压缩效果。H.264相当可靠,但有些机器解码速度不够快。