How to change default User-agent in mediaplayer of the android [duplicate]
In which file of the android repo do i have to change the default user-agent? I need to set this string as default user-agent for the media-player: HTC Streaming Player vodafone_uk / 1.0 / htc_bravo / 2.2
public void setDataSource (Context context, Uri uri, Map<String, String> headers);
In you app which controls MediaPlayer instance, pass the user agent in the header map as follows:
Map<String, String> headerMap = new HashMap<String, String>();;
headerMap.put("User-Agent", "my user agent value");
mediaPlayer.setDataSource(context, uri, headerMap);
精彩评论