I'm trying to play a streaming HLS (m3u8) that requires some parameters like User-Agent and Referer but doesn't works.
My code:
...
Map<String,String> options = new HashMap<>();
options.put("Referer","Xxxxxxxx");
options.put("User-Agent","Yyyyyyyy");
videoView.setVideoURI(streamURI,options);
...
And the response:
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
Also I tried to use it like this:
options.put("headers","Referer:Xxxxxxxx\r\n");
options.put("headers","User-Agent:Yyyyyyyy\r\n");
The result was the same...
Is there an error in the code? the format? the order maybe?
Thanks.
options.put("headers", "User-Agent: myUserAgent\r\n");
It is the correct method. But parsing User agent is different from standard method. Which server your are using?