How can I keep a MPMoviePlayerController from dismissing on lock button press?
After toying with a thousand other things I found what I needed to do.
All I needed to do was make two adjustments:
Add this to the AppDelegate.m in the
application: didFinishLaunchingWithOptions:
method:NSError *error = nil;
BOOL success = [[AVAudioSession sharedInstance]
setCategory: AVAudioSessionCategoryPlayback
error: &error];
if (success == false) { /* handle error */ }Add the following to your info.plist after you drag it into a text editor like Sublime:
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
If you setup your video correctly you will be able to listen to the audio from the video while using other apps and while the screen is in sleep mode.
Autolock iOS device while in camera mode
You're unfortunately not going to be able to do this unless you do a round-about hack assuming the user's device is already set to lock after 1 minute.
If the latter case is true you can disable the idleTimerDisabled
and after your period of inactivity re-enable the idleTimer which will then trigger the phone to be able to lock again after 1 minute.
How to disable iPhone/iPad auto-lock while app is in foreground mode?
Enable the idle timer in
- (void)applicationWillResignActive:(UIApplication *)application
and disable it in
- (void)applicationDidBecomeActive:(UIApplication *)application
Prevent automatic screen lock on Windows Phone 8
The screen can be forced to stay on using the UserIdleDetectionMode
property of the current PhoneApplicationService
.
To disable automatic screen lock:
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
To enable it again:
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled;
More information can be found on MSDN
Related Topics
Geofire Query on User Location
Select Items Programmatically in Uicollectionview
Game Engine Collison Bitmask... Why 0X01 etc
Uilabel, Uifont and Utf-8 Triangle
Undefined Symbols for Architecture Arm64 "_Objc_Class_$_Sfsafariviewcontroller"
Hide Status Bar and Increase the Height of Uinavigationbar
How to Get Nsdate with Millisecond Accuracy
iOS - Custom Table Cell Not Full Width of Uitableview
iOS Xcode Swift Autocomplete Broken
How to Encrypt and Decrypt a String(Plain Text) with Rsa Public Key in iOS, Swift
Reordering Uitableview Without Reorder Control
How to Properly Send an Image to Cloudkit as Ckasset
Capture Location in All States App
Get the Expiration Date of a Provisioning Profile at Run-Time
How to Localize Label Strings in iOS for a Beginner
How to Set the Accessibility Label for a Particular Segment of a Uisegmentedcontrol