mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-04 00:36:23 +00:00
Re-enable the idle timer when streaming has ended
This commit is contained in:
parent
275f6df8c1
commit
e697938afc
@ -56,6 +56,7 @@
|
|||||||
|
|
||||||
- (void) returnToMainFrame {
|
- (void) returnToMainFrame {
|
||||||
[_controllerSupport cleanup];
|
[_controllerSupport cleanup];
|
||||||
|
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,6 +85,9 @@
|
|||||||
Log(LOG_I, @"Connection terminated: %ld", errorCode);
|
Log(LOG_I, @"Connection terminated: %ld", errorCode);
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
// Allow the display to go to sleep now
|
||||||
|
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||||
|
|
||||||
UIAlertController* conTermAlert = [UIAlertController alertControllerWithTitle:@"Connection Terminated" message:@"The connection was terminated" preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController* conTermAlert = [UIAlertController alertControllerWithTitle:@"Connection Terminated" message:@"The connection was terminated" preferredStyle:UIAlertControllerStyleAlert];
|
||||||
[conTermAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
[conTermAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||||
[self returnToMainFrame];
|
[self returnToMainFrame];
|
||||||
@ -112,6 +116,9 @@
|
|||||||
Log(LOG_I, @"Stage %s failed: %ld", stageName, errorCode);
|
Log(LOG_I, @"Stage %s failed: %ld", stageName, errorCode);
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
// Allow the display to go to sleep now
|
||||||
|
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||||
|
|
||||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed"
|
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed"
|
||||||
message:[NSString stringWithFormat:@"%s failed with error %ld",
|
message:[NSString stringWithFormat:@"%s failed with error %ld",
|
||||||
stageName, errorCode]
|
stageName, errorCode]
|
||||||
@ -132,6 +139,9 @@
|
|||||||
Log(LOG_I, @"Launch failed: %@", message);
|
Log(LOG_I, @"Launch failed: %@", message);
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
// Allow the display to go to sleep now
|
||||||
|
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||||
|
|
||||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed"
|
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"Connection Failed"
|
||||||
message:message
|
message:message
|
||||||
preferredStyle:UIAlertControllerStyleAlert];
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user