duanjuelu8874 2015-02-16 22:47
浏览 85

无法从PHP curl请求将视频流式传输到iOS

I'm having some trouble streaming video for iOS using PHP. The problem lies in the architecture of the system. I'll explain. We have a public facing website that gets its data from a non-public-facing server. Let's say we have these urls:

public.website.com - public website 1.2.3.4 - private server

I've seen examples of using byte range requests (http://www.matheretter.de/test/ipad/test-byterange-2.txt and others) that work when I hit the server directly in a testing environment (1.2.3.4/stream-video.php), but that's not something I can do in production. So what happens then is a user comes to the site and the video src in the video tag is something like this:

public.website.com/getvideo/video-wrapper.php

video-wrapper.php then makes a curl request (or fopen or fsockopen...tried many things) to the private server, something like

1.2.3.4/stream-video.php

As I said, 1.2.3.4/stream-video.php works if I use that in the video src but when called from video-wrapper.php, I get "video not found" errors. There's something in that handoff from private server to public website that gets lost. I can output the same headers as stream-video.php but it still just never works.

Every example I've seen of this assumes that the local call to public.website.com/getvideo/video-wrapper.php can read the file, but that isn't the case here. I have to make a call to the private server to get the file and then output that to the website. Does anyone else have a set up like this? Or has anyone seen something similar. Pretty much at my wits end on this one.

I can't provide a url but I can provide code samples of non-working code if need be.

Thanks.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog