chromecast-media-controls
API to control any media running on the Chromecast
Install
yarn add chromecast-media-controls
Usage
import { ChromecastMediaControls } from "chromecast-media-controls";
const onClientError = (error: Error) => {
};
const chromecast = new ChromecastMediaControls();
await chromecast.initialize(onClientError);
chromcast.client;
await chromecast.pause();
await chromecast.resume();
await chromecast.seek(120);
await chromecast.setVolume({ level: 0.2, muted: false });
const currentVolume = await chromecast.getVolume();
const currentMediaSession = await chromecast.getStatus();
const player = await chromecast.player();
player._player;