Streaming to iphone via m3u8

I read about streaming to iphone via m3u8, but I'm not sure if I missed something.

It is well documented that MPMoviePlayerController will only play full-screen mode in OS 3.1, so iPhone users get stuck in video viewing mode (listening to audio in my case) and cannot navigate in the application. I did not find a way to broadcast via m3u8, as you can, for example, using Matt Gallagher code and mp3 ...

Any ideas on how to turn on the m3u8 player that will play inline?

thanks!

+4
source share
2 answers

If I understand correctly, you want to play the mp3 playlist on OS 3.1 using a standard media player without having it on the screen.

If this is correct, I suggest you move the application window on top of the video screen using this:

appDelegate.window.windowLevel = 2 

If your main window is opaque, you will not see the player, never. I don’t know if the native player supports M3U files, in the worst case you need to intercept the MPMoviePlayerPlaybackDidFinishNotification event and then play the next file.

Hope this helps.

0
source

Well, if you play audio, you can use AVPlayer ( https://developer.apple.com/documentation/avfoundation/avplayer ) or, if you also want to use pre-buffering, you can use AVQueuePlayer ( https: // developer. apple.com/documentation/avfoundation/avqueueplayer ) - they both work with the HTTP live protocol, but you must fragment your tracks using the tools provided by Apple: https://developer.apple.com/streaming/

They also have a validator that tells you if the threads are ok. The problem is that AVPlayer is available with iOS 4.0 and AVQueuePlayer with 4.1.

0
source

Source: https://habr.com/ru/post/1308040/


All Articles