【发布时间】:2017-01-05 07:26:31
【问题描述】:
我正在尝试播放流式 HLS (m3u8),它需要一些参数,例如 User-Agent 和 Referer,但不起作用。
我的代码:
...
Map<String,String> options = new HashMap<>();
options.put("Referer","Xxxxxxxx");
options.put("User-Agent","Yyyyyyyy");
videoView.setVideoURI(streamURI,options);
...
然后回应:
D/Vitamio[5.0.1][Player]: [http @ 0x9627e500] HTTP error 403 Forbidden
E/Vitamio[5.0.1][Player]: avformat_open_input: Server returned 403 Forbidden (access denied) : -858797304
我也试过这样使用它:
options.put("headers","Referer:Xxxxxxxx\r\n");
options.put("headers","User-Agent:Yyyyyyyy\r\n");
结果是一样的……
代码有错误吗?格式?顺序可能吗?
谢谢。
【问题讨论】:
标签: android header m3u8 vitamio referer