mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 14:11:35 +00:00
Add a friendly error message when no video traffic is received
This commit is contained in:
@@ -236,15 +236,34 @@
|
|||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
// Allow the display to go to sleep now
|
// Allow the display to go to sleep now
|
||||||
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||||
if (errorCode == 0) {
|
|
||||||
[self returnToMainFrame];
|
NSString* title;
|
||||||
} else {
|
NSString* message;
|
||||||
UIAlertController* conTermAlert = [UIAlertController alertControllerWithTitle:@"Connection Terminated" message:@"The connection was terminated" preferredStyle:UIAlertControllerStyleAlert];
|
|
||||||
[conTermAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
switch (errorCode) {
|
||||||
|
case ML_ERROR_GRACEFUL_TERMINATION:
|
||||||
[self returnToMainFrame];
|
[self returnToMainFrame];
|
||||||
}]];
|
return;
|
||||||
[self presentViewController:conTermAlert animated:YES completion:nil];
|
|
||||||
|
case ML_ERROR_NO_VIDEO_TRAFFIC:
|
||||||
|
title = @"Connection Error";
|
||||||
|
message = @"No video received from host. Check the host PC's firewall and port forwarding rules.";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
title = @"Connection Terminated";
|
||||||
|
message = @"The connection was terminated";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UIAlertController* conTermAlert = [UIAlertController alertControllerWithTitle:title
|
||||||
|
message:message
|
||||||
|
preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
[Utils addHelpOptionToDialog:conTermAlert];
|
||||||
|
[conTermAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){
|
||||||
|
[self returnToMainFrame];
|
||||||
|
}]];
|
||||||
|
[self presentViewController:conTermAlert animated:YES completion:nil];
|
||||||
});
|
});
|
||||||
|
|
||||||
[_streamMan stopStream];
|
[_streamMan stopStream];
|
||||||
|
|||||||
Submodule moonlight-common/moonlight-common-c updated: 247b1fe0e3...b46e06fcf1
Reference in New Issue
Block a user