1

After calling -

[self.navigationController presentMoviePlayerViewControllerAnimated:movieViewController];

The view dismisses itself after screen lock or backgrounding. Is there anyway to prevent this?

rishi
  • 11,779
  • 4
  • 40
  • 59
wL_
  • 997
  • 8
  • 13

3 Answers3

2

It appears that locking the screen causes MPMoviePlayerController to stop, which causes MPMoviePlayerViewController to dismiss.

I ended up rolling my own custom UIViewController with MPMoviePlayerController taking up the entire view with full screen controls.

Dharmesh Dhorajiya
  • 3,976
  • 9
  • 30
  • 39
wL_
  • 997
  • 8
  • 13
0

Try below this post screen lock event in iphone sdk

Lock Unlock events iphone

after trying lock event to dismiss mpmovieplayerviewcontroller!

thanks!

Community
  • 1
  • 1
Dinesh
  • 6,500
  • 10
  • 42
  • 77
0

It will be the natural behavior of the device .. Unless >> you add the permission for it.

Info.plist > Required background modes

add mode App plays audio or streams audio/video using AirPlay

Now difference will be that the MPMoviePlayerViewController will not dismiss, even after the app goes to background. But the video will pause.

Dharmesh Dhorajiya
  • 3,976
  • 9
  • 30
  • 39
Shanu ji
  • 359
  • 4
  • 5