MPMoviePlayerPlaybackDidFinishNotification is called immediately

后端 未结 3 1339
孤独总比滥情好
孤独总比滥情好 2020-12-22 08:45

I\'m trying to play video with the following code:

UIGraphicsBeginImageContext(CGSizeMake(1,1));

self.player = [[MPMoviePlayerViewController alloc] initWith         


        
3条回答
  •  别那么骄傲
    2020-12-22 09:31

    I'am not sure why, but with remote url's I realized in a past project that you need to add the observer without object as reference.... If you ask me why, I am not sure. Try adding the observer with nil as object...

     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
    

提交回复
热议问题