PHP服务MP4 - Chrome“临时标题显示/请求尚未完成”窃听器 [英] PHP serve MP4 - Chrome "Provisional headers are shown/request is not finished yet" bug

查看:872
本文介绍了PHP服务MP4 - Chrome“临时标题显示/请求尚未完成”窃听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在允许用户查看视频前检查用户的订阅,因此我使用PHP与 Stripe 检查用户的订阅,而不是使用 PHP脚本为MP4服务浏览器 b
$ b

当谷歌浏览器第一次播放视频时(使用HTML5播放器),它工作正常...
但是当我关闭视频并播放它时再次,视频不再播放...我不能重新加载当前页面。这就像服务器停止工作。



当我检查第一个视频请求(播放的请求)时,在时间选项卡中,我看到:小心:请求尚未完成! (截图如下)





当我检查第二个视频请求(没有播放的请求)时,在Headers选项卡中显示[警告标志]显示临时标题(截图下面)





Safari或Firefox中的所有功能都符合预期



任何人都知道发生了什么?视频再次播放的唯一方法是关闭当前标签,再次输入该网站。重新加载不起作用!

解决方案

嗯,我当然是一个有趣的问题。这里很难确定根本原因。但如果我在你的情况下,我会检查两件事。


  1. 首先,我会确保设置保持活动状态在你的httpd.conf中关闭 KeepAlive Off


  2. 然后用此配置对其进行测试。

    >

  3. 然后,我将禁用所有浏览器缓存:

    标题('Cache-Control:no-cache,no -store,must-revalidate');
    header('Pragma:no-cache');
    header('Expires:0');

  4. 最后的测试。


  5. ol>

    这个问题似乎与保持活动或浏览器缓存或甚至两个,但我不明白为什么它只出现在铬。作为最后的手段,请确保您没有使用任何可能会产生问题的扩展程序,例如Adblock。



    希望我能得到这些信息:)


    I want to check for users' subscription before allow them to see the video, for this reason I use PHP to interact with Stripe to check for user's subscription, and than used PHP script to serve MP4 to browser

    It works fine the first time a video is played in Google Chrome (Using HTML5 player)... But when I close the video and play it again, the video doesn't play anymore... I can NOT also reload the current page. It's like server stops working.

    When I inspect the 1st video request (the one which played), in the Timing tab i see: "CAUTION: request is not finished yet!" (screenshot below)

    When I inspect the 2nd video request (the one did not play), in Headers tab it says "[caution sign] Provisional headers are shown" (screenshot below)

    everything worked as expected in Safari or Firefox

    Anyone has any idea what is going on? The only way for the video to play again is to close the current tab, enter the site again. Reloading doesn't work!

    解决方案

    Well i certainly is an intriguing problem. And is really hard to determine the root cause here. But if i was in your case i would check for two things.

    1. First i would make sure that keep-alive is set to off KeepAlive Off on your httpd.conf

    2. Afterwards test it with this configuration.

    3. Then i would disable all browser caching:

      header('Cache-Control: no-cache, no-store, must-revalidate'); header('Pragma: no-cache'); header('Expires: 0');

    4. Final test after that.

    The issue seems to be either with keep-alive or browser caching or even both, but i can not understand why it appears only in chrome. As a last resort make sure that you are not using any extensions that may create problems like Adblock.

    Hope i get you going with these information :)

    这篇关于PHP服务MP4 - Chrome“临时标题显示/请求尚未完成”窃听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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