Map headers = new HashMap<>();
Uri uri = Uri.parse(url);
headers.put("Host",uri.getHost());
headers.put("Cookie"," " + cookie + ";\r\n");
headers.put("http_proxy", "http://123.123.123.123:80");
ijkMediaPlayer.setDataSource(uri, headers);
headers也是在内部被转化为何issuses一样的setOption方法
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT,"http_proxy", "http://123.123.123.123:80");
ijkMediaPlayer.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT,"headers", "test");
源码如下 IjkMediaPlayer.java
/**
* Sets the data source (file-path or http/rtsp URL) to use.
*
* @param path the path of the file, or the http/rtsp URL of the stream you want to play
* @param headers the headers associated with the http request for the stream you want to