Class: CastSender
CastSender handles initiation of and communication with the Google Cast Receiver
Extends
Emitter
<CastSenderEvents
>
Accessors
casting
Get Signature
get casting():
boolean
True if the instance is casting right now
Returns
boolean
channelId
Get Signature
get channelId():
string
The current channelId
Returns
string
Set Signature
set channelId(
channelId
):void
Set the current channelId
Parameters
channelId
string
Returns
void
language
Get Signature
get language():
undefined
|string
The current language
Returns
undefined
| string
Set Signature
set language(
language
):void
Set the current language
Parameters
language
undefined
| string
Returns
void
volume
Get Signature
get volume():
number
The current volume
Returns
number
Set Signature
set volume(
volume
):void
Set the current volume. Setting this to zero is equivalent to muting the video
Parameters
volume
number
Returns
void
Methods
getReceiverName()
getReceiverName():
undefined
|string
Returns a string representing the name of the Cast receiver device or undefined if no receiver exists
Returns
undefined
| string
init()
init():
Promise
<void
>
Initiates the CastSender. Will reject if Cast is not available on the device or the network.
Returns
Promise
<void
>
off()
Call Signature
off<
T
>(eventName
,fn
):void
Remove an event listener from eventName
Type Parameters
• T extends "connected"
| "resumed"
| "disconnected"
| "failed"
Parameters
eventName
T
fn
() => EventListenerReturnType
Returns
void
Inherited from
Emitter.off
Call Signature
off<
T
>(eventName
,fn
):void
Remove an event listener from eventName
Type Parameters
• T extends "metadata"
| "server wallclock time"
Parameters
eventName
T
fn
(args
) => EventListenerReturnType
Returns
void
Inherited from
Emitter.off
on()
Call Signature
on<
T
>(eventName
,fn
):void
Add an event listener to eventName
Event listeners may optionally return a "defer function" that will be called once all other listeners have been called. This is useful when one listener may want everone to have reacted to an event before calling something.
Type Parameters
• T extends "connected"
| "resumed"
| "disconnected"
| "failed"
Parameters
eventName
T
fn
() => void
Returns
void
Inherited from
Emitter.on
Call Signature
on<
T
>(eventName
,fn
):void
Add an event listener to eventName
Event listeners may optionally return a "defer function" that will be called once all other listeners have been called. This is useful when one listener may want everone to have reacted to an event before calling something.
Type Parameters
• T extends "metadata"
| "server wallclock time"
Parameters
eventName
T
fn
(args
) => void
Returns
void
Inherited from
Emitter.on
once()
Call Signature
once<
T
>(eventName
,fn
):void
Add an event listener to eventName
that will be called once only
Event listeners may optionally return a "defer function" that will be called once all other listeners have been called. This is useful when one listener may want everone to have reacted to an event before calling something.
Type Parameters
• T extends "connected"
| "resumed"
| "disconnected"
| "failed"
Parameters
eventName
T
fn
() => void
Returns
void
Inherited from
Emitter.once
Call Signature
once<
T
>(eventName
,fn
):void
Add an event listener to eventName
that will be called once only
Event listeners may optionally return a "defer function" that will be called once all other listeners have been called. This is useful when one listener may want everone to have reacted to an event before calling something.
Type Parameters
• T extends "metadata"
| "server wallclock time"
Parameters
eventName
T
fn
(args
) => void
Returns
void
Inherited from
Emitter.once