Allows local code to be easily casted to a chromecast receiver with hot reloading support
npm install codecast
import { CodeCast } from 'codecast/sender'
window['__onGCastApiAvailable'] = function(isAvailable) {
if (isAvailable) {
const codeCast = new CodeCast()
const code = 'resolve(navigator.userAgent)'
codeCast.sendString(code).then(userAgent => {
console.log(userAgent)
})
}
}
import { CodeCast } from 'codecast/receiver'
const codeCast = new CodeCast()
codeCast.start()
//Request URL contents and send it to the receiver as JS code to be run
send(url: string): Promise
//Send text to the receiver as JS code to be run
sendString(text: string): Promise
//Send a message to the receiver telling it to reload
reload(): void
//Proxy for the CastReceiverContext start function
start(options: CastReceiverOptions): CastReceiverContext