So I am trying to livestream a video using the http live stream example apple provides. The program compiles but, it wont display anything on my iphone. Below is the code:
Thank you.
NSURL *url = [NSURL URLWithString:@"<#http://developer.apple.com/resources/http-streaming/examples/advanced-stream.html#>"];
/*
// You may find a test stream at <http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8>.
self.playerItem = [AVPlayerItem playerItemWithURL:url];
[playerItem addObserver:self forKeyPath:@"status" options:0 context:&ItemStatusContext];
self.player = [AVPlayer playerWithPlayerItem:playerItem];
*/
/*
self.player = [AVPlayer playerWithURL:url];
[player addObserver:self forKeyPath:@"status" options:0 context:&PlayerStatusContext];
*/
self.playerItem = [AVPlayerItem playerItemWithURL:url];
//(optional) [playerItem addObserver:self forKeyPath:@"status" options:0 context:&ItemStatusContext];
self.player = [AVPlayer playerWithPlayerItem:playerItem];
self.player = [AVPlayer playerWithURL:url];
[player play];
[super viewDidLoad];
check out this apple sample code. this is using a AVFoundation.
I look at the following Apple’s sample code is recommended.
You just want to implement the steps in it seems to be under the code You will be very helpful.
StitchedStreamPlayer
I upload to myServer Tested. Perfectly. also Youtube, Vimeo and so on… is work fine.
Trust me. 3G, wifi tested in both environments. although sample code, It was surprisingly works perfectly.