diff --git a/Classes/VideoPlayer/iOS/VideoPlayerImpliOS.m b/Classes/VideoPlayer/iOS/VideoPlayerImpliOS.m index 71550d4..0e07723 100644 --- a/Classes/VideoPlayer/iOS/VideoPlayerImpliOS.m +++ b/Classes/VideoPlayer/iOS/VideoPlayerImpliOS.m @@ -24,10 +24,26 @@ - (id) init if ( (self = [super init]) ) { _theMovie = nil; + + // add notification to know when app will become active when app goes in background player will change state to paused... + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(appDidBecomeActive:) + name:UIApplicationDidBecomeActiveNotification + object:nil]; + } return self; } +//this method will resume it if will need.... +-(void)appDidBecomeActive:(NSNotification *)notification { + if (_theMovie != nil && self.isPlaying) { + if (_theMovie.playbackState == MPMoviePlaybackStatePaused) { + [_theMovie play]; + } + } +} + //----- playMovieAtURL: ------ -(void)playMovieAtURL:(NSURL*)theURL {