简体   繁体   English

如何用AudioStreamer播放.m3u8文件流媒体网址?

[英]How to play .m3u8 file streaming url with AudioStreamer?

I have an iOS streaming app, that is integrated with AudioStreamer . 我有一个iOS流媒体应用程序,它与AudioStreamer集成。 It works fine for my streaming urls. 它适用于我的流媒体网址。 But suddenly thay have change the streaming url into .m3u8 format. 但突然之间已经将流式网址改为.m3u8格式。 How can I use AudioStreamer for .m3u8 file url? 如何将AudioStreamer用于.m3u8文件网址?

I cant use MPMoviePlayer because I want to show some buffering before load the stream. 我不能使用MPMoviePlayer因为我想在加载流之前显示一些缓冲。 It can easily done with the AudioStreamer . 它可以通过AudioStreamer轻松完成。 How can I use AudioStreamer to play an .m3u8 file? 如何使用AudioStreamer播放.m3u8文件?

Thank you 谢谢

Try and parse the m3u8 file and get the actual URL to the resource and then pass that URL to AudioStreamer. 尝试并解析m3u8文件并获取资源的实际URL,然后将该URL传递给AudioStreamer。

Here you can find M3U8Parser lib that parse the playlist. 在这里,您可以找到解析播放列表的M3U8Parser库。

Below is an example of m3u8 format: 以下是m3u8格式的示例:

#EXTM3U
#EXT-X-TARGETDURATION:10

#EXT-X-MEDIA-SEQUENCE:1

#EXTINF:10,
http://video.example.com/segment0.ts
#EXTINF:10,
http://video.example.com/segment1.ts
#EXTINF:10,
http://video.example.com/segment2.ts
#EXT-X-ENDLIST

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM