很简单,使用如下代码就行
Uri uri = Uri.parse("http://47.96.22.18:8002/test.pg1");
Map<String, String> headers = new HashMap<>();
headers.put("sencoder", "hevc");
Map<String, String> headers = new HashMap<String, String>();
headers.put("User-Agent", "My custom User Agent name");
mMediaPlayer.setDataSource(getApplicationContext(), uri, headers);