开发者

iPhone:Streaming feed URL sample?

I have a media streaming code like below for playing streaming video. I want to test it with some working streaming url feed on iOS 4 devices. Could someone provide me the exact sample streaming video feed if anything is available for iPhone supported? So that, i can test this code and make sure it works well, though it could be cor开发者_StackOverflowrect. I want a real streaming video url link.

NSString *strUrl = @"http://????????????"

NSURL *url = [NSURL URLWithString:strUrl];

MPMoviePlayerController *mPlayer = [[MPMoviePlayerController alloc]initWithContentURL:url]; mPlayer.view.frame = self.view.frame;

[self.view addSubview:mPlayer.view];

[mPlayer setFullscreen:YES animated:YES];

[mPlayer play];

Thanks.


I don't have a URL for you, but your code looks correct, except that you should turn auto-play off before setting full screen with animation. In my experience, the app could crash on setFullscreen:animated: if you use the player more than once. You might also want to observe the MPMoviePlayerPlaybackDidFinishNotification notification in case of playback error so that you can inform the user that there was a playback error.

NSURL *url = [NSURL URLWithString:strUrl];
MPMoviePlayerController *mPlayer = [[MPMoviePlayerController alloc]initWithContentURL:url]; mPlayer.view.frame = self.view.frame;

mPlayer.shouldAutoplay = NO;

[self.view addSubview:mPlayer.view];
[mPlayer setFullscreen:YES animated:YES];
[mPlayer play];


You can use below urls for testing purpose,

http://a1408.g.akamai.net/5/1408/1388/2005110405/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_mpeg4.mp4

I have not tested it, but it should work well...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜