【问题标题】:Chrome or Chromium Autoplay Muted Loop only loops a few times for larger videos. How do I make large videos loop indefinitely?对于较大的视频,Chrome 或 Chromium 自动播放静音循环仅循环几次。如何让大型视频无限循环?
【发布时间】:2020-06-04 17:55:22
【问题描述】:

示例 1: 视频 MP4 大小为 118mb 循环 3 次 Large Video on Autoplay loop muted

示例 2: 视频 MP4 大小为 6.4mb 无限循环 Small Video on Autoplay Loop Muted

将视频从 MP4 更改为其他更压缩的选项似乎对用户不友好,所以我宁愿这不是一个解决方案。

我已经调整了Cache-Control: max-age=86400, public,但这似乎没有任何作用。我已经阅读了有关禁用 HTTP 200 响应的信息,但还没有找到使用 NGINX 或 RoR 的好方法。

【问题讨论】:

    标签: ruby-on-rails google-chrome nginx chromium


    【解决方案1】:

    不得不采用几种不同的基于缓存的解决方案。推荐阅读以下文章A Caching Journey

    添加到控制器上的显示操作到:

        expires_in 24.hours
        fresh_when(:etag => @board, :last_modified => @board.created_at.utc)
    

    在 Config/environment/production.rb 中添加

    ActiveStorage::Service.url_expires_in = 3.hours
    

    在 Config/Storage.yml 添加

     upload:
        cache_control: 'max-age=86400, private'
    

    【讨论】:

      猜你喜欢
      • 2017-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多