如何在iphone中使用“HTTP Live Streaming”播放视频? [英] How play the video using “HTTP Live Streaming” in iphone?

查看:136
本文介绍了如何在iphone中使用“HTTP Live Streaming”播放视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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];

}

}

这是有效的很好,但我想用HTTP Live Streaming播放视频。我怎么能这样做?任何教程和示例代码都会对我更有帮助。谢谢。

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.

推荐答案

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

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];
       }
}

这篇关于如何在iphone中使用“HTTP Live Streaming”播放视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆