mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 08:36:42 +00:00
Add basic logic for resuming an existing stream
This commit is contained in:
parent
8ce558f701
commit
02341e85e2
@ -107,8 +107,15 @@ function startPushed() {
|
|||||||
|
|
||||||
console.log('startRequest:' + target + ":" + streamWidth + ":" + streamHeight + ":" + frameRate + ":" + bitrate);
|
console.log('startRequest:' + target + ":" + streamWidth + ":" + streamHeight + ":" + frameRate + ":" + bitrate);
|
||||||
|
|
||||||
sendMessage('startRequest', [target, streamWidth, streamHeight, frameRate, bitrate.toString()]);
|
|
||||||
sendMessage('httpInit', [pairingCert.cert, pairingCert.privateKey, myUniqueid]).then(function (ret) {
|
sendMessage('httpInit', [pairingCert.cert, pairingCert.privateKey, myUniqueid]).then(function (ret) {
|
||||||
|
api = new NvHTTP(target, myUniqueid);
|
||||||
|
api.init().then(function (ret) {
|
||||||
|
if (api.currentGame != 0) {
|
||||||
|
api.resumeApp('00000000000000000000000000000000', 0).then(function (ret) {
|
||||||
|
sendMessage('startRequest', [target, streamWidth, streamHeight, frameRate, bitrate.toString()]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// we just finished the gameSelection section. only expose the NaCl section
|
// we just finished the gameSelection section. only expose the NaCl section
|
||||||
|
@ -39,8 +39,8 @@ NvHTTP.prototype = {
|
|||||||
$root = $xml.find('root')
|
$root = $xml.find('root')
|
||||||
|
|
||||||
if($root.attr("status_code") == 200) {
|
if($root.attr("status_code") == 200) {
|
||||||
_self.pair = getXMLString(xml, "PairStatus").trim() == 1;
|
_self.paired = $root.find("PairStatus").text().trim() == 1;
|
||||||
_self.currentGame = getXMLString(xml, "currentgame").trim();
|
_self.currentGame = parseInt($root.find("currentgame").text().trim(), 10);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -93,7 +93,7 @@ NvHTTP.prototype = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
launchApp: function (context, appId, mode, sops, rikey, rikeyid, localAudio, surroundAudioInfo) {
|
launchApp: function (appId, mode, sops, rikey, rikeyid, localAudio, surroundAudioInfo) {
|
||||||
return sendMessage('openUrl', [
|
return sendMessage('openUrl', [
|
||||||
_self.baseUrlHttps +
|
_self.baseUrlHttps +
|
||||||
'/launch?' + _self._buildUidStr() +
|
'/launch?' + _self._buildUidStr() +
|
||||||
@ -109,7 +109,7 @@ NvHTTP.prototype = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
resumeApp: function (context, rikey, rikeyid) {
|
resumeApp: function (rikey, rikeyid) {
|
||||||
return sendMessage('openUrl', [
|
return sendMessage('openUrl', [
|
||||||
_self._baseUrlHttps +
|
_self._baseUrlHttps +
|
||||||
'/resume?' + _self._buildUidStr() +
|
'/resume?' + _self._buildUidStr() +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user