Zakaria
Zakaria

Reputation: 599

How to pass http headers to VLC player Intent?

I want to play a video stream with HTTP request headers via Intent in VLC player (VLC for Android).

I'm using the following code to play normal streams:

Intent intent = new Intent(Intent.ACTION_VIEW);
Uri videoUri = Uri.parse(url);
intent.setDataAndType( videoUri, "application/x-mpegURL" );
intent.setPackage( "org.videolan.vlc" );
startActivity( intent );

The problem is that the link I'm playing requires a special HTTP header token, which means that the code doesn't work in my case.

How can I pass http request headers to VLC player via intent?

Upvotes: 0

Views: 5475

Answers (1)

Hugo Rosário
Hugo Rosário

Reputation: 41

Been searching for solutions for the same problem and I don't think you can do it with the intent.

I ended up using an http proxy on my app which is based on NanoHTTP.

My proxy adds all the required headers and connects to the stream url and redirects the inputstream to the response of the NanoHTTP request.

After this, the url I send to the VLC is a local url like http://127.0.0.1/proxy?url=https://myurl.m3u8

Upvotes: 4

Related Questions