Skip to content
An open implementation of the JavaScript Chromecast API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
.gitignore
LICENSE
README.md
package-lock.json
package.json
sample.js

README.md

ghast

An open implementation of the JavaScript Chromecast API

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]

Usage

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...');
});

// ...
You can’t perform that action at this time.