-1
在我的應用我要玩2個網址視頻陸續播放從URL一個2個視頻。陸續
這是我的代碼:
` - (無效)viewDidLoad中{
NSLog(@"viewDidLoad");
player = [[MPMoviePlayerController alloc] initWithContentURL:[self movieURL]];
[NSNotificationCenter defaultCenter]addObserver:self
selector:@selector(movieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player play];
[超級vieDidLoad]; }
- (NSURL *)movieURL {
return [NSURL URLWithString: @"https://s3.amazonaws.com/adplayer/colgate.mp4"];//First video url after this video complete.I want to play the next url video.
}
- (void) movieFinishedCallback:(NSNotification*) aNotification {
NSLog(@"movieFinishedCallback");
player = [aNotification object];
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player autorelease];
}
`
後一個網址視頻完成我想玩下一個URL的視頻。
請任何人幫助我。
我有存儲URL在數組這樣,
array=[[NSArray alloc] initWithObjects:@"https://s3.amazonaws.com/adplayer/colgate.mp4",@"https://s3.amazonaws.com/ventuno-platform-flv-sep2010/happy_family.mp4",nil];
那我該怎麼retrive的URL - (空)movieFinishedCallback:(NSNotification *)aNotification {
} method.please給予我指導這個。
@Harinder:如何網址存儲在一個array.and我怎麼能retrive URL的一個由one.please給我一個樣品code.please保存我的生活。謝謝你 – kanmani 2011-02-18 10:06:37