Run iptv & ts urls in android

独自空忆成欢 提交于 2019-12-24 06:59:06

问题


I am working on a project which requires a player to play iptv which comes in .ts links I used vitamio player but it loads the link as entities and close after only 23 second So my approach is to playvthe link again in onCompleteListener, it works fine but after complete it takes a long time to load the next entity of the link and play it and so on. The question is what is best free player sdk to run ts and iptv links for android?


回答1:


Usually, the TS segments for a stream will be indexed in a manifest file as part of HLS or MPEG-DASH steaming protocols, although DASH typically uses fragmented mp4 rather than TS.

You can see examples of this with the example HLS manifests that apple provides in the HLS documentation online (https://developer.apple.com/library/content/technotes/tn2288/_index.html):

#EXTM3U
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.0,
http://example.com/movie1/fileSequenceA.ts 
#EXTINF:10.0,
http://example.com/movie1/fileSequenceB.ts
#EXTINF:10.0,
http://example.com/movie1/fileSequenceC.ts
#EXTINF:9.0,
http://example.com/movie1/fileSequenceD.ts
#EXT-X-ENDLIST

ExoPlayer (https://github.com/google/ExoPlayer) will play this type of stream - you provide it the manifest file (e.g. myStream.m3u8) file as the source, rather than the individual TS segments.

If you look in the demo app 'media.exolist.json' in the assets folder you will see it includes a HLS example.

You can see how it parses the HLS manifest in the 'HlsPlaylistParser' class.



来源:https://stackoverflow.com/questions/44444253/run-iptv-ts-urls-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!