Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 981
streetparade Avatar asked Feb 18 '11 19:02

streetparade


1 Answers

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);
like image 60
Dekra Avatar answered Oct 11 '22 21:10

Dekra