I have a URL (http://ms1.clickhere2.com:1935/live/power98/playlist.m3u8) and wanted to play in iPhone, with m3u8 format, would somebody help on this, I have used MPMEDIAPLAYER framework and other things.
Asked
Active
Viewed 4,173 times
1
-
1http://stackoverflow.com/questions/2715015/streaming-to-iphone-via-m3u8 – Ravi Kumar Karunanithi Mar 29 '12 at 09:40
1 Answers
4
Try like this:
NSString *path =[[NSString alloc] initWithString:@"http://stream.alayam.com/alayam/alayam/playlist.m3u8"];
NSURL *audioUrl=[NSURL URLWithString:path];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:audioUrl];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(loadStateDidChange:) name:MPMoviePlayerLoadStateDidChangeNotification
object:player];
if ([player respondsToSelector:@selector(loadState)])
{
[player setControlStyle:MPMovieControlModeVolumeOnly];
[player setFullscreen:YES];
[player prepareToPlay];
}

Loquatious
- 1,791
- 12
- 21
-
MPMoviePlayerController depreciated in iOS10 use AVFoundation instead. – Onder OZCAN Oct 16 '16 at 22:25