运行iptv& ts android中的网址 [英] Run iptv & ts urls in android

查看:156
本文介绍了运行iptv& ts android中的网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目上,该项目要求播放器播放.ts链接中的iptv 我使用了vitamio播放器,但它将链接作为实体加载,仅在23秒后关闭 因此,我的方法是在onCompleteListener中再次播放链接,它可以正常工作,但完成后需要花费很长时间才能加载链接的下一个实体并播放它,依此类推. 问题是什么是最好的免费播放器SDK来为Android运行ts和iptv链接?

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?

推荐答案

通常,流的TS段将作为HLS或MPEG-DASH传输协议的一部分在清单文件中建立索引,尽管DASH通常使用片段化的mp4而不是比TS.

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.

您可以在苹果在线提供的HLS文档中看到苹果提供的示例HLS清单( https://developer.apple.com/library/content/technotes/tn2288/_index.html ):

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 )将播放这种类型的流-向您提供清单文件(例如myStream.m3u8)作为源文件,而不是单独的TS段.

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.

如果您在资产文件夹中的演示应用程序"media.exolist.json"中查看,则会看到其中包含一个HLS示例.

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

您可以在"HlsPlaylistParser"类中看到它如何解析HLS清单.

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

这篇关于运行iptv& ts android中的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆