mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-06-16 22:01:14 +00:00
Add a friendly error message when no video traffic is received
This commit is contained in:
@@ -1538,9 +1538,21 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
|
|
||||||
// Display the error dialog if it was an unexpected termination.
|
// Display the error dialog if it was an unexpected termination.
|
||||||
// Otherwise, just finish the activity immediately.
|
// Otherwise, just finish the activity immediately.
|
||||||
if (errorCode != 0) {
|
if (errorCode != MoonBridge.ML_ERROR_GRACEFUL_TERMINATION) {
|
||||||
|
String message;
|
||||||
|
|
||||||
|
switch (errorCode) {
|
||||||
|
case MoonBridge.ML_ERROR_NO_VIDEO_TRAFFIC:
|
||||||
|
message = getResources().getString(R.string.no_video_received_error);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
message = getResources().getString(R.string.conn_terminated_msg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
Dialog.displayDialog(Game.this, getResources().getString(R.string.conn_terminated_title),
|
Dialog.displayDialog(Game.this, getResources().getString(R.string.conn_terminated_title),
|
||||||
getResources().getString(R.string.conn_terminated_msg), true);
|
message, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
finish();
|
finish();
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ public class MoonBridge {
|
|||||||
public static final int CONN_STATUS_OKAY = 0;
|
public static final int CONN_STATUS_OKAY = 0;
|
||||||
public static final int CONN_STATUS_POOR = 1;
|
public static final int CONN_STATUS_POOR = 1;
|
||||||
|
|
||||||
|
public static final int ML_ERROR_GRACEFUL_TERMINATION = 0;
|
||||||
|
public static final int ML_ERROR_NO_VIDEO_TRAFFIC = -100;
|
||||||
|
|
||||||
private static AudioRenderer audioRenderer;
|
private static AudioRenderer audioRenderer;
|
||||||
private static VideoDecoderRenderer videoRenderer;
|
private static VideoDecoderRenderer videoRenderer;
|
||||||
private static NvConnectionListener connectionListener;
|
private static NvConnectionListener connectionListener;
|
||||||
|
|||||||
Submodule app/src/main/jni/moonlight-core/moonlight-common-c updated: 247b1fe0e3...f596e80575
@@ -61,6 +61,7 @@
|
|||||||
<string name="error_usb_prohibited">USB access is prohibited by your device administrator. Check your Knox or MDM settings.</string>
|
<string name="error_usb_prohibited">USB access is prohibited by your device administrator. Check your Knox or MDM settings.</string>
|
||||||
<string name="unable_to_pin_shortcut">Your current launcher does not allow for creating pinned shortcuts.</string>
|
<string name="unable_to_pin_shortcut">Your current launcher does not allow for creating pinned shortcuts.</string>
|
||||||
<string name="video_decoder_init_failed">Video decoder failed to initialize. Your device may not support the selected resolution or frame rate.</string>
|
<string name="video_decoder_init_failed">Video decoder failed to initialize. Your device may not support the selected resolution or frame rate.</string>
|
||||||
|
<string name="no_video_received_error">No video received from host. Check the host PC\'s firewall and port forwarding rules.</string>
|
||||||
|
|
||||||
<!-- Start application messages -->
|
<!-- Start application messages -->
|
||||||
<string name="conn_establishing_title">Establishing Connection</string>
|
<string name="conn_establishing_title">Establishing Connection</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user