I have .m3u8
link which I need to play on iOS
which supports the HLS Protocol
.
When I assign URL directly to the MPMoviePlayerController
and play, video is not visible but I can hear the audio.
NSURL *movieURL = [NSURL URLWithString:@"http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"];
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[self.view addSubview:self.moviePlayer.view];
if (mp)
{
// save the movie player object
self.moviePlayer = mp;
[self.moviePlayer setFullscreen:YES];
// Play the movie!
[self.moviePlayer play];
}
What additional stuff do I need to do on iOS
side?
Open the Mac App Store to buy and download apps. This is a stream player that can read every stream in the m3u8 format. Just add the url you want and enjoy. Worked where nothing else would.
Unfortunately, only Android users can download the m3u8 loader. This is another simple application to play videos and music. It is truly universal – it can work with hls, m3u, mp4, as well as other formats. The app works just like a player.
On Android there are many apps like Total Commander that can play m3u files with radio streams. Here is an example content of such a m3u file: Is there any way to play this file without jailbreaking the device? Show activity on this post. GSE SMART IPTV app is recommended to playback M3U streams on iOS devices.
Import:
#import <MediaPlayer/MediaPlayer.h>
Then do:
NSURL *movieURL = [NSURL URLWithString:@"http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8"];
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
if (mp) {
mp.view.frame = self.view.bounds;
[self.view addSubview:mp.view];
// save the movie player object
[mp setFullscreen:YES];
// Play the movie!
[mp play];
self.moviePlayer = mp;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With