Skip to content

Instantly share code, notes, and snippets.

@dimified
Created October 23, 2016 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimified/fecfcc6a9c653cef7960777b000eabcc to your computer and use it in GitHub Desktop.
Save dimified/fecfcc6a9c653cef7960777b000eabcc to your computer and use it in GitHub Desktop.
Discover CS launchers and launch application
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