如何使用“;HTTP直播流媒体&x201D;在iphone中?
我是iphone开发新手,我正在解析XML URL并在表中显示其内容,当我单击一行时,其相应的解析管URL将使用电影播放器播放。我正在使用媒体播放器框架。以下是我的代码如何使用“;HTTP直播流媒体&x201D;在iphone中?,iphone,media-player,live-streaming,Iphone,Media Player,Live Streaming,我是iphone开发新手,我正在解析XML URL并在表中显示其内容,当我单击一行时,其相应的解析管URL将使用电影播放器播放。我正在使用媒体播放器框架。以下是我的代码 NSURL *movieURL = [NSURL URLWithString:requiredTubeUrl]; if (movieURL) { if ([movieURL scheme]) { MoviePlayerController *myMovie = [[MoviePlayerController all
NSURL *movieURL = [NSURL URLWithString:requiredTubeUrl];
if (movieURL)
{
if ([movieURL scheme])
{
MoviePlayerController *myMovie = [[MoviePlayerController alloc]init];
[myMovie initAndPlayMovie:movieURL];
}
}
这很好,但我想用“HTTP直播”播放视频。我该怎么做?任何教程和示例代码都会对我更有帮助。谢谢。苹果提供了概述和一些带有流的示例页面。将播放列表文件(.M3U8)URL提供给MPMoviePlayer实例。如果服务器设置正确,.M3U8文件URL应该足够了
使用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];
}
}
在浏览器中实现,这对本机应用程序的开发非常适用,因为它将iphone用户引导到电影应用程序。这在很大程度上取决于您想要查看的正确流就像好奇一样,我正在添加另一个问题如何播放实况广播?@hib如果您将问题作为新问题发布,则获得答案的机会更大。您是否已在服务器端为HTTP实况流进行了所有设置?