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 R语言Rstudio突然无法启动
    • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
    • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
    • ¥15 用windows做服务的同志有吗
    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值