在Vitamio Android上设置标题
我正在尝试播放一个流式HLS(m3u8),它需要一些参数,如用户代理和Referer,但不起作用 我的代码:在Vitamio Android上设置标题,android,header,m3u8,vitamio,referer,Android,Header,M3u8,Vitamio,Referer,我正在尝试播放一个流式HLS(m3u8),它需要一些参数,如用户代理和Referer,但不起作用 我的代码: ... Map<String,String> options = new HashMap<>(); options.put("Referer","Xxxxxxxx"); options.put("User-Agent","Yyyyyyyy"); videoView.setVideoURI(streamURI,options); ... 我也试着这样使用它
...
Map<String,String> options = new HashMap<>();
options.put("Referer","Xxxxxxxx");
options.put("User-Agent","Yyyyyyyy");
videoView.setVideoURI(streamURI,options);
...
我也试着这样使用它:
options.put("headers","Referer:Xxxxxxxx\r\n");
options.put("headers","User-Agent:Yyyyyyyy\r\n");
结果是一样的
代码中有错误吗?格式?也许是点菜
谢谢
final HashMap<String, String> options;
options = new HashMap<>();
这是正确的方法。但解析用户代理和标准方法不同。您使用的是哪台服务器
这是正确的方法。但解析用户代理和标准方法不同。您使用的是哪台服务器 我不记得了,因为我更改了库=/
final HashMap<String, String> options;
options = new HashMap<>();
videoView.setVideoURI(Uri.parse("http://www.example.com/playlist.m3u8), options);