The goal of ghast
is be to a drop in replacement for the chrome sender API.
You should be able to do a s/chrome.cast/ghast/g with existing chrome sender applications, port them to an electron environment, or (potentially 🤞) a firefox extension.
Status: WIP
- chrome.cast.* - i.e., Session/MediaSession etc. all work
- chrome.cast.games - implemented, untested
- cast.framework - mostly implemented, completely untested
Still relatively usable provided you aren't using the more recent cast.framework
.
You can look an example w/ sample.js: node sample.js [url]
const ghast = require('ghast');
const apiConfig = new ghast.ApiConfig(
new ghast.SessionRequest(appID),
sessionListener, // gets called when you auto-connect to an active session
receiverListener, // gets called when devices go up / down
ghast.AutoJoinPolicy.ORIGIN_SCOPED, // rules for auto-connecting
);
ghast.initialize(apiConfig, () => {
console.log('Initialized. Now searching for devices...');
});
// ...