Class: Sender

Sender

new Sender(config)

Sender
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

<static> 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:

<static> 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:

<static> startCasting()

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

<static> stopCasting()

Stop casting an ongoing Chromecast session.
Source:

Type Definitions

onMessageCallback(message)

Parameters:
Name Type Description
message String The message data.
Source:

onSenderReadyCallback()

Source:

onSenderStartedCallback()

Source:

onSenderStoppedCallback()

Source: