google / ExoPlayer

An extensible media player for Android
Apache License 2.0
21.63k stars 6k forks source link

How can I play .php video file? #5220

Closed jmimohsin closed 5 years ago

jmimohsin commented 5 years ago

Hi,

I would like to play url like http://13.233.200.191/jio/m3u8.php?c=Six_HD&q=400&e=.m3u8

But this is not working in latest version or 2.8 version. Is it possible to play in Exoplayer?

Thanks in advance.

ojw28 commented 5 years ago

I don't think there's such a thing as a ".php video file". The link you've provided does not work for me either. Please provide a working link to some test content if you want us to investigate further.

jmimohsin commented 5 years ago

Hi,

Another one url is http://smumcdnems03.cdnsrv.jio.com/jiotv.live.cdn.jio.com/Ten_1/Ten_1.m3u8?jct=6xn8fjTQUCFOBO3GxeCrKQ&pxe=1548900873&st=EoMVarxgha7pTVhpmCYXcg

which have

EXTM3U

EXT-X-VERSION:3

EXT-X-STREAM-INF:PROGRAM-ID=1,CLOSED-CAPTIONS=NONE,BANDWIDTH=250000

Ten_1_250.m3u8

EXT-X-STREAM-INF:PROGRAM-ID=1,CLOSED-CAPTIONS=NONE,BANDWIDTH=400000

Ten_1_400.m3u8

EXT-X-STREAM-INF:PROGRAM-ID=1,CLOSED-CAPTIONS=NONE,BANDWIDTH=600000

Ten_1_600.m3u8

and then internal link http://smumcdnems03.cdnsrv.jio.com/jiotv.live.cdn.jio.com/Ten_1/Ten_1_600.m3u8?jct=6xn8fjTQUCFOBO3GxeCrKQ&pxe=1548900873&st=EoMVarxgha7pTVhpmCYXcg

have AES Key, like below:-

EXTM3U

EXT-X-VERSION:3

EXT-X-MEDIA-SEQUENCE:26466

EXT-X-TARGETDURATION:6

EXT-X-KEY:METHOD=AES-128,URI="https://tv.media.jio.com/streams_live/Ten_1/Ten_1_600-1544462974000.key",IV=0x000000000000000000000167992ABC30

EXTINF:6.000,

Ten_1_600-1544463368000.ts

EXTINF:6.000,

Ten_1_600-1544463376000.ts

EXTINF:6.000,

Ten_1_600-1544463382000.ts

EXTINF:6.000,

Ten_1_600-1544463388000.ts

EXTINF:6.000,

Ten_1_600-1544463392000.ts

EXTINF:6.000,

Ten_1_600-1544463400000.ts

EXTINF:6.000,

Ten_1_600-1544463404000.ts

EXTINF:6.000,

Ten_1_600-1544463412000.ts

EXTINF:6.000,

Ten_1_600-1544463418000.ts

EXTINF:6.000,

Ten_1_600-1544463424000.ts

EXTINF:6.000,

Ten_1_600-1544463430000.ts

EXTINF:6.000,

Ten_1_600-1544463436000.ts

EXTINF:6.000,

Ten_1_600-1544463442000.ts

EXTINF:6.000,

Ten_1_600-1544463448000.ts

EXTINF:6.000,

Ten_1_600-1544463454000.ts

EXTINF:6.000,

Ten_1_600-1544463460000.ts

EXTINF:6.000,

Ten_1_600-1544463466000.ts

EXTINF:6.000,

Ten_1_600-1544463472000.ts

EXTINF:6.000,

Ten_1_600-1544463478000.ts

EXTINF:6.000,

Ten_1_600-1544463484000.ts

EXTINF:6.000,

Ten_1_600-1544463490000.ts

EXTINF:6.000,

Ten_1_600-1544463496000.ts

EXTINF:6.000,

Ten_1_600-1544463502000.ts

EXTINF:6.000,

Ten_1_600-1544463508000.ts

EXTINF:6.000,

Ten_1_600-1544463514000.ts

EXTINF:6.000,

Ten_1_600-1544463520000.ts

EXTINF:6.000,

Ten_1_600-1544463526000.ts

EXTINF:6.000,

Ten_1_600-1544463532000.ts

EXTINF:6.000,

Ten_1_600-1544463538000.ts

EXTINF:6.000,

Ten_1_600-1544463544000.ts

EXTINF:6.000,

Ten_1_600-1544463550000.ts

EXTINF:6.000,

Ten_1_600-1544463556000.ts

EXTINF:6.000,

Ten_1_600-1544463562000.ts

EXTINF:6.000,

Ten_1_600-1544463568000.ts

EXT-X-KEY:METHOD=AES-128,URI="https://tv.media.jio.com/streams_live/Ten_1/Ten_1_600-1544463574000.key",IV=0x0000000000000000000001679933E3F0

EXTINF:6.000,

Ten_1_600-1544463574000.ts

EXTINF:6.000,

Ten_1_600-1544463580000.ts

EXTINF:6.000,

Ten_1_600-1544463586000.ts

EXTINF:6.000,

Ten_1_600-1544463592000.ts

EXTINF:6.000,

Ten_1_600-1544463598000.ts

EXTINF:6.000,

Ten_1_600-1544463604000.ts

EXTINF:6.000,

Ten_1_600-1544463610000.ts

EXTINF:6.000,

Ten_1_600-1544463614000.ts

EXTINF:6.000,

Ten_1_600-1544463622000.ts

EXTINF:6.000,

Ten_1_600-1544463628000.ts

EXTINF:6.000,

Ten_1_600-1544463634000.ts

EXTINF:6.000,

Ten_1_600-1544463640000.ts

EXTINF:6.000,

Ten_1_600-1544463646000.ts

EXTINF:6.000,

Ten_1_600-1544463652000.ts

EXTINF:6.000,

Ten_1_600-1544463658000.ts

EXTINF:6.000,

Ten_1_600-1544463664000.ts

ojw28 commented 5 years ago

Those streams give an HTTP 451 response for me, probably because they're geo-restricted or require some form of authentication. That aside, these are HLS streams. They should just work if you build an HlsMediaSource and give it to the player.

ojw28 commented 5 years ago

You need to make sure that block of code is building the correct type of source is being built, which is HlsMediaSource, at least for the second case.

The code you've provided infers the type from the uri and overrideExtension. Most likely you're not providing an overrideExtension, and the uri has an unconventional file extension which is causing the wrong source to be built. For HLS streams we expect the extension to be m3u8, which it's not for the first url you've provided (php) but is for the second. In cases where an unconventional file extension is used, you'll need to provide `overrideExtension="m3u8" as a hint for that code to build the correct source.

jmimohsin commented 5 years ago

yes I just passing blank like this:-

buildMediaSource(Uri.parse(url), "", agent)
ojw28 commented 5 years ago

So is the correct source being built or not? If it's not, you need to fix it somehow in your application code so that the correct source is built.

Note: In the completely general case we're aware that getting this right in application code may be tricky. Having ExoPlayer always detect the content type automatically is tracked by https://github.com/google/ExoPlayer/issues/3165, but is not seen as high priority, so we're unlikely to get around to implementing this any time soon.

GotvApps commented 5 years ago
DefaultHttpDataSourceFactory httpDataSourceFactory = new DefaultHttpDataSourceFactory(
            userAgent,
            null,
            DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
            DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS,
            true /* allowCrossProtocolRedirects */
    );

    dataSourceFactory = new DefaultDataSourceFactory(
            this,
            null,
            httpDataSourceFactory

    );
jmimohsin commented 5 years ago

For php type url LoopingMediaSource is working but for this one http://smumcdnems03.cdnsrv.jio.com/jiotv.live.cdn.jio.com/Ten_1/Ten_1.m3u8?jct=6xn8fjTQUCFOBO3GxeCrKQ&pxe=1548900873&st=EoMVarxgha7pTVhpmCYXcg

Nothing work till now.

ojw28 commented 5 years ago

That link gives me a http 451 status code. There is nothing we can do to help here, since we're not being provided with streams that are accessible to us (they need to be accessible from the UK without authentication).

ojw28 commented 5 years ago

Given lack of better information, there's nothing we can do to help here. I suspect this is most likely a duplicate of #3165. Closing based on that assumption.

jmimohsin commented 5 years ago

Hi,

Checked mostly all issues and stack overflow answers but still not getting any solution which provide a simple code example and can help to run HLS url with AES-128 method like above example has

EXT-X-KEY:METHOD=AES-128,URI="https://tv.media.jio.com/streams_live/Ten_1/Ten_1_600-1544462974000.key",IV=0x000000000000000000000167992ABC30

Just let me know a simple code which can help it. I am searching it from a month approx. Please help.

Thanks.

jmimohsin commented 5 years ago

params for key are ?jct=6xn8fjTQUCFOBO3GxeCrKQ&pxe=1548900873&st=EoMVarxgha7pTVhpmCYXcg

jmimohsin commented 5 years ago

main url http://smumcdnems03.cdnsrv.jio.com/jiotv.live.cdn.jio.com/Ten_1/Ten_1.m3u8?jct=6xn8fjTQUCFOBO3GxeCrKQ&pxe=1548900873&st=EoMVarxgha7pTVhpmCYXcg

agent JioTV

ojw28 commented 5 years ago

The link still gives me a 451 response code. If you're not going to provide working media for us to test with, we're not going to be able to help you.

jmimohsin commented 5 years ago

Can you please just let me know what I have to use additional for AES-128 method. I don't have other url right now. I have shared url and data already which I am getting.

ojw28 commented 5 years ago

As per my previous response, you don't have to do anything additional:

They should just work if you build an HlsMediaSource and give it to the player.