Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play m3u8 format in iPhone

Tags:

ios4

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.


1 Answers

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://

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];
    }
}
like image 57
Iqbal Khan Avatar answered Dec 01 '25 01:12

Iqbal Khan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!