Created
October 23, 2016 16:51
-
-
Save dimified/fecfcc6a9c653cef7960777b000eabcc to your computer and use it in GitHub Desktop.
Discover CS launchers and launch application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CompanionScreenManager.prototype.discoverCSLaunchers = function (callback) { | |
if (!csManager) return false; | |
csManager.discoverCSLaunchers(function (launchers) { | |
csLaunchers = launchers; | |
$log(PREFIX + csLaunchers.length + ' CS launchers discovered'); | |
if (callback) { callback(); } | |
}); | |
}; | |
CompanionScreenManager.prototype.launchCsApp = function (launcher, launchUrl) { | |
if (!csManager || !csLaunchers) return false; | |
var payload = JSON.stringify({ | |
launch: [ | |
{ | |
launchUrl: launchUrl, | |
appType: 'html' | |
} | |
] | |
}); | |
if (launchUrl) { | |
csManager.launchCSApp(launcher.enum_id, payload, _onCSLaunch); | |
$log(PREFIX + 'CS App launched, with URL: ' + launchUrl ); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment