I can able to play local video, I'm unable to play live video streaming. What I need to do for this. My url is like this...
rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_175k.mov
My code is:
NSURL *url = [[NSURL alloc] initFileURLWithPath: @"rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_175k.mov"];
NSLog(@"%@", path);
AVAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil];
AVPlayerItem *anItem = [AVPlayerItem playerItemWithAsset:asset];
dispatch_async(dispatch_get_main_queue(), ^{
self.avPlayer = [AVPlayer playerWithPlayerItem:anItem];
[self.avPlayer addObserver:self forKeyPath:@"status" options:0 context:nil];
self.avPlayerView = [[AVPlayerViewController alloc] init];
self.avPlayerView.view.frame = self.view.bounds;
[self.avPlayerView setPlayer:_avPlayer];
[self.view addSubview:_avPlayerView.view];
});
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.avPlayer play];
});
Can any one suggest any code or GitHub link.
Thank you.