如何在iPhone中播放m3u8格式 [英] How to play m3u8 format in iPhone

查看:2844
本文介绍了如何在iPhone中播放m3u8格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网址 http://stream.alayam.com/alayam/ alayam / playlist.m3u8 并希望在iPhone中播放,使用m3u8格式,我已经成功获得了声音,但是电影还没有到来。我已经使用了MPMEDIAPLAYER框架和其他东西。

I have got a url http://stream.alayam.com/alayam/alayam/playlist.m3u8 and wanted to play in iPhone, with m3u8 format, I have successfully got the voice, however movie is not coming. I have used MPMEDIAPLAYER framework and other things.

推荐答案

我在新的答案中给你答案,因为代码更具可读性。
我只是从Apple网站下载MPMovieController示例,然后使用 http://

I am giving u answer in new answer because code will be more readable. I just download MPMovieController example from Apple website and then add your link with http://

添加您的链接在 NSURL 我传递链接 http://stream.alayam.com/alayam/alayam/playlist.m3u8 不是这个一个 stream.alayam.com/alayam/alayam/playlist.m3u8 并且工作正常。

In NSURL i pass link http://stream.alayam.com/alayam/alayam/playlist.m3u8 not this one stream.alayam.com/alayam/alayam/playlist.m3u8 and it works fine.

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

        // Apply the user specified settings to the movie player object
        [self setMoviePlayerUserSettings];

        // Play the movie!
        [self.moviePlayer play];
    }
}

这篇关于如何在iPhone中播放m3u8格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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