Class: Sender

Newscast. Sender

new Sender(config)

The Chromecast app Sender that runs in the user's browser.
Parameters:
Name Type Description
config Object Configuration object
Properties
Name Type Description
namespace String Chromecast namespace for this application.
appId String Chromecast application identifier.
onSenderReady Sender~onSenderReadyCallback Callback to be fired when a device is available to be cast to.
onSenderStarted Sender~onSenderStartedCallback Callback to be fired when casting has begun.
onSenderStopped Sender~onSenderStoppedCallback Callback to be fired when casting has ceased.
debug Boolean If true, debug information will be logged to the console.
Source:

Methods

onMessage(messageType, callback)

Register a new message handler callback.
Parameters:
Name Type Description
messageType String Name of message type to listen for.
callback Sender~onMessageCallback The callback to invoke when the given message type is received.
Source:

sendMessage(messageType, message)

Send a message to the Receiver.
Parameters:
Name Type Description
messageType String Name of the message type to send.
message String Message data to send.
Source:

startCasting()

Request to start a Chromecasting session. Will cause the browser plugin device selection dialog to open.
Source:

stopCasting()

Stop casting an ongoing Chromecast session.
Source: