如何使用“HTTP Live Streaming”播放视频在 iPhone 中?

发布于 2024-08-30 13:57:18 字数 420 浏览 4 评论 0原文

我是 iPhone 开发新手,我正在解析 XML URL 并将其内容显示在表格中,当我单击一行时,使用电影播放器​​播放其相应的解析管 URL。我正在使用媒体播放器框架。这是我的代码

NSURL *movieURL = [NSURL URLWithString:requiredTubeUrl];

if (movieURL)
{
if ([movieURL scheme])  
{
    MoviePlayerController *myMovie = [[MoviePlayerController alloc]init];

    [myMovie initAndPlayMovie:movieURL];

}

}

这工作正常,但我想使用“HTTP Live Streaming”播放视频。我该怎么做?任何教程和示例代码都会对我更有帮助。谢谢。

I am new to iphone development,I am parsing a XML URL and display its content in the table, when i click a row , its corresponding parsed tube URL is played using the movie player.I am using media player framework.Here is my code

NSURL *movieURL = [NSURL URLWithString:requiredTubeUrl];

if (movieURL)
{
if ([movieURL scheme])  
{
    MoviePlayerController *myMovie = [[MoviePlayerController alloc]init];

    [myMovie initAndPlayMovie:movieURL];

}

}

This is working fine, but i want to play the video using "HTTP Live Streaming".How can i do that? Any tutorials and sample code would me more helpful.Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

苦行僧 2024-09-06 13:57:18

Apple 提供了概述以及一些带有流的示例页面。您向 MPMoviePlayer 实例提供播放列表文件 (.M3U8) URL。如果您的服务器设置正确,.M3U8 文件 URL 就足够了。

http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008332-CH1-DontLinkElementID_29

Apple provides and overview and some sample pages with streams. You provide the playlist file (.M3U8) URL to your MPMoviePlayer instance. If your server is set up properly, the .M3U8 file URL should suffice.

http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008332-CH1-DontLinkElementID_29

风向决定发型 2024-09-06 13:57:18

在浏览器中实现,这在很大程度上适用于本机应用程序开发,因为它将 iPhone 用户引导至电影应用程序。很大程度上取决于您想要查看的正确流http://www.ioncannon.net/programming/452/iphone-http-streaming-with-ffmpeg-and-an-open-source-segmenter/

To implement in for the browser, which applies for a lot to native app development since it directs iphone users to movie app. A lot depends on the proper stream you're wanting to view http://www.ioncannon.net/programming/452/iphone-http-streaming-with-ffmpeg-and-an-open-source-segmenter/

等你爱我 2024-09-06 13:57:18

使用 MPMoviePlayerController 从服务器进行流式传输。

-(void)initAndPlayMovie:(NSURL *)movieURL
{
    // Initialize a movie player object with the specified URL
       MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
       if (mp)
       {
           [self.moviePlayer play];
       }
}

Use MPMoviePlayerController for streaming from server.

-(void)initAndPlayMovie:(NSURL *)movieURL
{
    // Initialize a movie player object with the specified URL
       MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
       if (mp)
       {
           [self.moviePlayer play];
       }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文