logo

THEOplayer > Chromecast

Chromecast interface

Inherits from VendorCast, EventDispatcher<ChromecastEventMap> . See parent page for inherited properties and methods.

The Chromecast API.

Signature:

export interface Chromecast extends VendorCast, EventDispatcher<ChromecastEventMap> 

Properties

Property

Type

Description

connectionCallback

ChromecastConnectionCallback | undefined

The callback for the Chromecast connection changes.

error

ChromecastError | undefined

The last error that occurred during casting, if any.

receiverName

string | undefined

The name of the Chromecast device that the player is casting to, if any.

source

SourceDescription | undefined

The source of the active casting session, if any.

Methods

Method

Description

addEventListener​(type: TType | readonly TType[], listener: EventListener<ChromecastEventMap[TType]>): void

Add the given listener for the given event type(s).

join​(): void

Join an active casting session.

leave​(): void

Leave the active casting session.

removeEventListener​(type: TType | readonly TType[], listener: EventListener<ChromecastEventMap[TType]>): void

Remove the given listener for the given event type(s).

Property Details

connectionCallback

The callback for the Chromecast connection changes.

Signature:

connectionCallback: ChromecastConnectionCallback | undefined;

error

The last error that occurred during casting, if any.

Signature:

error: ChromecastError | undefined;

receiverName

The name of the Chromecast device that the player is casting to, if any.

Signature:

receiverName: string | undefined;

source

Warning: This API is deprecated.

Superseded by Chromecast.connectionCallback.

The source of the active casting session, if any.

Signature:

source: SourceDescription | undefined;

Method Details

addEventListener

Add the given listener for the given event type(s).

Signature:

addEventListener<TType extends StringKeyOf<ChromecastEventMap>>(type: TType | readonly TType[], listener: EventListener<ChromecastEventMap[TType]>): void;

Parameters

Parameter

Type

Description

type

TType | readonly TType[]

The type of the event.

listener

EventListener<ChromecastEventMap[TType]>

The callback which is executed when the event occurs.

join

Join an active casting session.

Signature:

join(): void;

leave

Leave the active casting session.

Signature:

leave(): void;

Remarks


- Does not stop the session when other devices are connected.
- Use VendorCast.stop() to fully stop the session.

removeEventListener

Remove the given listener for the given event type(s).

Signature:

removeEventListener<TType extends StringKeyOf<ChromecastEventMap>>(type: TType | readonly TType[], listener: EventListener<ChromecastEventMap[TType]>): void;

Parameters

Parameter

Type

Description

type

TType | readonly TType[]

The type of the event.

listener

EventListener<ChromecastEventMap[TType]>

The callback which will be removed.

github
Make sure to follow us on GitHub!
THEO-logo-white
twitter
facebook
linkedin
Copyright © 2022. All Rights Reserved.
Leuven
New York
Singapore
Barcelona