Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Classes/VideoPlayer/iOS/VideoPlayerImpliOS.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down