Http实时流传输:强制MPMoviePlayerController在http请求中打包标头 [英] Http live streaming: Forcing MPMoviePlayerController to pack headers in the http requests

查看:97
本文介绍了Http实时流传输:强制MPMoviePlayerController在http请求中打包标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Http Live Streaming将视频从服务器流式传输到iPhone.我需要在手机发送到服务器的http数据包中设置某些标头.

I am streaming video from a server to iPhone using Http Live Streaming. I need to set certain headers in the http packets that the phone sends to the server.

对于常规数据包,下面的代码就足够了:

For regular packets, the following code would suffice:

NSMutableURLRequest* request = [[[NSMutableURLRequest alloc] initWithURL:url]
                                autorelease];
[request setValue:VALUE forHTTPHeaderField:@"Field You Want To Set"];

很遗憾,我没有为MPMoviePlayerController找到类似的API.换句话说,如何强制MPMoviePlayerController在用于与服务器通信的http数据包中设置某些标头?

Unfortunately, I did not find a similar API for MPMoviePlayerController. In other words, how do I force MPMoviePlayerController to set certain headers in the http packets that it uses to communicate to the server?

推荐答案

我认为设置cookie可能会解决您的问题.请查看NSHTTPCookie和NSHTTPCookieStorage的文档.

I think setting a cookie might solve your problem. Please look into the documentation for NSHTTPCookie and NSHTTPCookieStorage.

这篇关于Http实时流传输:强制MPMoviePlayerController在http请求中打包标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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