【问题标题】:HTTP UserAgent in MobileVLCKit for iOSiOS 版 MobileVLCKit 中的 HTTP UserAgent
【发布时间】:2015-12-29 11:51:51
【问题描述】:

有没有办法通过 MobileVLCKit for iOS 中的一些选项来更改默认的 http 标头(主要是 User-Agent)?

我知道我可以传递这样的选项:

[[VLCMediaPlayer alloc] initWithOptions:@[option1, option2]];

但是我在哪里可以找到可用选项的列表,我可以在初始化后更改选项吗?

谢谢。

【问题讨论】:

    标签: ios vlc libvlc


    【解决方案1】:

    请参阅 VLCLibrary 的 - (void)setHumanReadableName:(NSString *)readableName withHTTPUserAgent:(NSString *)userAgent,它应该完全符合您的要求。

    对于所有可用选项(未记录,因为明确不保证它们在不同版本中工作或保持工作 - 尽可能使用适当的 libvlc/VLCKit API!),请参阅任何 VLC 上的 --longhelp --advanced释放。

    【讨论】:

    • 您能否告诉我是否可以更改/添加任何其他 HTTP 请求标头?谢谢。
    • 我试过这个:[[VLCLibrary sharedLibrary] setHumanReadableName:@"My Player" withHTTPUserAgent:@"My Payer 1.2.3"]; 而 User-Agent 仍然是 VLC/3.0.0-git LibVLC/3.0.0-git 我做错了什么?
    • 哦,这可能是不稳定代码中的回归。请注意,VLC 3.0 远未完成或稳定。会调查的。同时,考虑使用 stable 2.2 分支。
    【解决方案2】:

    它应该是例如"[[VLCLibrary sharedLibrary] setHumanReadableName:@"Mozilla" withHTTPUserAgent:@"Mozilla"]"。但是随着 2.2.2 User-Agent 没有改变,User-Agent 仍然是“VLC/2.2.2 LibVLC/2.2.2”。这是一个错误还是我错过了什么?

    【讨论】:

      猜你喜欢
      • 2019-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多