通过 m3u8 流式传输到 iPhone
我一直在阅读有关通过 m3u8 在 iPhone 上进行流媒体的内容,但我不确定我是否遗漏了一些东西。
有据可查的是,MPMoviePlayerController 只能在 OS 3.1 中全屏播放,因此 iPhone 用户只能观看视频(在我的例子中是听音频)并且无法在应用程序中导航。我还没有找到像您一样通过 m3u8 进行流式传输的方法,例如,使用 Matt Gallagher 的代码和 mp3...
有关如何包含可嵌入播放的 m3u8 播放器的任何想法吗?
谢谢!
I've been reading around about streaming on the iphone via m3u8 but I'm not sure if I'm missing something.
It is well documented that MPMoviePlayerController will only play full-screen in OS 3.1, so iPhone users are stuck watching the video (listening to audio, in my case) and can't navigate in the application. I haven't found a way to stream via m3u8 like you can, for example, using Matt Gallagher's code and an mp3...
any ideas on how to include a m3u8 player that will play embedded?
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我没猜错的话,您想使用标准媒体播放器在 OS 3.1 上播放 mp3 播放列表,而无需将其显示在屏幕上。
如果这是正确的,我建议您将应用程序窗口移动到视频屏幕的顶部:
如果您的主窗口不透明,您将永远看不到播放器。
我不知道原生播放器是否支持M3U文件,在最坏的情况下你必须拦截MPMoviePlayerPlaybackDidFinishNotification事件然后播放下一个文件。
希望这有帮助。
If I got it right you want to play an mp3 playlist on OS 3.1 using the standard media player without having it on screen.
If this is right I suggest you to move your application window on top of the video screen with this:
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 have to intercept the MPMoviePlayerPlaybackDidFinishNotification event and then play the next file.
Hope this helps.
好吧,如果你要播放音频,你可以使用 AVPlayer (https://developer.apple.com/ Documentation/avfoundation/avplayer) 或者,如果您还想要预缓冲,您可以使用 AVQueuePlayer (https://developer.apple.com/documentation/avfoundation/avqueueplayer) - 它们都使用 HTTP 直播流协议,但您应该使用 Apple 提供的工具对曲目进行分段:
https://developer.apple.com/streaming/
他们还有一个验证器,可以告诉您是否溪流没问题。问题是 AVPlayer 从 iOS 4.0 开始可用,AVQueuePlayer 从 4.1 开始可用。
Well if you'll play audio you could use AVPlayer (https://developer.apple.com/documentation/avfoundation/avplayer) or, if you want pre-buffering as well, you could use AVQueuePlayer (https://developer.apple.com/documentation/avfoundation/avqueueplayer) - they both work with the HTTP live streaming protocol but you should fragment your tracks by using the tools provided by apple:
https://developer.apple.com/streaming/
They also have a validator which tells you if the streams are ok. The problem is that AVPlayer is available from iOS 4.0 and AVQueuePlayer from 4.1.