mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 08:36:42 +00:00
Keep the display awake when streaming. Fixes #325
This commit is contained in:
parent
3f244ff8e1
commit
e0c4c01e44
@ -26,6 +26,7 @@
|
|||||||
"pointerLock",
|
"pointerLock",
|
||||||
"system.network",
|
"system.network",
|
||||||
"fullscreen",
|
"fullscreen",
|
||||||
|
"power",
|
||||||
"overrideEscFullscreen", {
|
"overrideEscFullscreen", {
|
||||||
"socket": [
|
"socket": [
|
||||||
"tcp-connect",
|
"tcp-connect",
|
||||||
|
@ -37,6 +37,9 @@ function handleMessage(msg) {
|
|||||||
$('#loadingSpinner').css('display', 'none'); // This is a fallback for RTSP handshake failing, which immediately terminates the stream.
|
$('#loadingSpinner').css('display', 'none'); // This is a fallback for RTSP handshake failing, which immediately terminates the stream.
|
||||||
$('body').css('backgroundColor', '#282C38');
|
$('body').css('backgroundColor', '#282C38');
|
||||||
|
|
||||||
|
// Release our keep awake request
|
||||||
|
chrome.power.releaseKeepAwake();
|
||||||
|
|
||||||
api.refreshServerInfo().then(function (ret) { // refresh the serverinfo to acknowledge the currently running app
|
api.refreshServerInfo().then(function (ret) { // refresh the serverinfo to acknowledge the currently running app
|
||||||
api.getAppList().then(function (appList) {
|
api.getAppList().then(function (appList) {
|
||||||
appList.forEach(function (app) {
|
appList.forEach(function (app) {
|
||||||
@ -54,6 +57,9 @@ function handleMessage(msg) {
|
|||||||
} else if(msg.data === 'Connection Established') {
|
} else if(msg.data === 'Connection Established') {
|
||||||
$('#loadingSpinner').css('display', 'none');
|
$('#loadingSpinner').css('display', 'none');
|
||||||
$('body').css('backgroundColor', 'black');
|
$('body').css('backgroundColor', 'black');
|
||||||
|
|
||||||
|
// Keep the display awake while streaming
|
||||||
|
chrome.power.requestKeepAwake("display");
|
||||||
} else if(msg.data.indexOf('ProgressMsg: ') === 0) {
|
} else if(msg.data.indexOf('ProgressMsg: ') === 0) {
|
||||||
$('#loadingMessage').text(msg.data.replace('ProgressMsg: ', ''));
|
$('#loadingMessage').text(msg.data.replace('ProgressMsg: ', ''));
|
||||||
} else if(msg.data.indexOf('TransientMsg: ') === 0) {
|
} else if(msg.data.indexOf('TransientMsg: ') === 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user