From f4d9265712a903c1a77deb5165dcb5f42f88d2bc Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 29 Aug 2020 21:15:05 -0700 Subject: [PATCH] Add warning if no key frames can be received in 10 seconds --- moonlight-common-c | 2 +- static/js/messages.js | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/moonlight-common-c b/moonlight-common-c index f2c1d03..9e4651e 160000 --- a/moonlight-common-c +++ b/moonlight-common-c @@ -1 +1 @@ -Subproject commit f2c1d03d8e268375de00352a1228a5669b016b61 +Subproject commit 9e4651e460a92168ffa86f54be9a5033c6e9064c diff --git a/static/js/messages.js b/static/js/messages.js index 1cbcc60..d8ab820 100644 --- a/static/js/messages.js +++ b/static/js/messages.js @@ -42,13 +42,21 @@ function handleMessage(msg) { // Show a termination snackbar message if the termination was unexpected var errorCode = parseInt(msg.data.replace('streamTerminated: ', '')); - if (errorCode !== 0) { - if (errorCode === -100) { // ML_ERROR_NO_VIDEO_TRAFFIC + switch (errorCode) { + case 0: // ML_ERROR_GRACEFUL_TERMINATION + break; + + case -100: // ML_ERROR_NO_VIDEO_TRAFFIC snackbarLogLong("No video received from host. Check the host PC's firewall and port forwarding rules."); - } - else { + break; + + case -101: // ML_ERROR_NO_VIDEO_FRAME + snackbarLogLong("Your network connection isn't performing well. Reduce your video bitrate setting or try a faster connection."); + break; + + default: snackbarLogLong("Connection terminated"); - } + break; } api.refreshServerInfo().then(function(ret) {