Search code examples
iphoneobjective-cios6mpmovieplayercontroller

MPMovieNaturalSizeAvailableNotification is not working?


I added a notification with the following code,

  [[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(videoLoadingComplete)
                                           name:MPMovieNaturalSizeAvailableNotification
                                          object:self.streamPlayer];

but it did not enter in the videoLoadingComplete function even after the video stars playing.


Solution

  • You can use following code

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviestart:)   name:MPMoviePlayerLoadStateDidChangeNotification object:nil];
     -(void)moviestart
    {
    //your code here
    }