Streaming mp3 audio with AVPlayer

后端 未结 5 1282
眼角桃花
眼角桃花 2020-11-28 22:09

I\'m hearing some conflicting reports about this. What I\'m trying to do is stream an mp3 file from a URL. I\'ve done hours of research, but I cannot find any good guides on

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 22:39

    In addition to Sumit Mundra's answer, which helped me a lot, I found that this technique doesn't actually stream MP3 files from a remote server. When I implemented this, the file downloaded synchronously, blocking my UI, before playing. The way to properly stream the MP3 that I found worked very well was to point to an M3U file. This is just a text file with an .m3u extension which contains a link to the original MP3. Point Sumit's code at that file instead, and you have a stream that starts playing immediately.

    This is the place I found that information: http://www.soundabout.net/streammp3.htm

提交回复
热议问题