FORUMS
Remove All Ads from XDA

MX player useragent issue

2 posts
Thanks Meter: 0
 
By engkazim2000, Junior Member on 31st October 2018, 02:07 AM
Post Reply Email Thread
Hi,

Can anyone guide me how to change the user agent with using API i tried that with using below

Intent intent = new Intent(Intent.ACTION_VIEW);

Uri videoUri = Uri.parse("url");

intent.setDataAndType( videoUri, "application/x-mpegURL" );
String[] headers = { "User-Agent", "exoplayer/1.0"};
intent.setPackage( "com.mxtech.videoplayer.pro" );

startActivity( intent );


but its not working
31st October 2018, 06:43 PM |#2  
OP Junior Member
Thanks Meter: 0
 
More
Anyone here to help me out
28th October 2019, 04:31 PM |#3  
Inside 4ndroid's Avatar
Senior Member
Flag Dewsbury
Thanks Meter: 299
 
Donate to Me
More
This is how you use the header extras with intent....

String[] headers = {
"User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Safari/537.36",
"Referer", "https://vidcloud.icu"};
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(finalUrl), "video/*");
intent.putExtra("headers", headers);
intent.setPackage("com.mxtech.videoplayer.pro");
startActivity(intent);
29th October 2019, 12:52 PM |#4  
MXPlayer's Avatar
Senior Member
Thanks Meter: 88
 
More
Quote:
Originally Posted by engkazim2000

Hi,

Can anyone guide me how to change the user agent with using API i tried that with using below

Intent intent = new Intent(Intent.ACTION_VIEW);

Uri videoUri = Uri.parse("url");

intent.setDataAndType( videoUri, "application/x-mpegURL" );
String[] headers = { "User-Agent", "exoplayer/1.0"};
intent.setPackage( "com.mxtech.videoplayer.pro" );

startActivity( intent );


but its not working

We apologise for the delayed response. It seems that you haven't used the headers you have created. please check the snippets shared by @Inside 4ndroid. It should work for you.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes