THEOplayer > Chromecast
Inherits from VendorCast, EventDispatcher<ChromecastEventMap> . See parent page for inherited properties and methods.
The Chromecast API.
Signature:
export interface Chromecast extends VendorCast, EventDispatcher<ChromecastEventMap>
Property |
Type |
Description |
---|---|---|
ChromecastConnectionCallback |
The callback for the Chromecast connection changes. |
|
ChromecastError |
The last error that occurred during casting, if any. |
|
|
The name of the Chromecast device that the player is casting to, if any. |
|
SourceDescription |
The source of the active casting session, if any. |
Method |
Description |
---|---|
addEventListener(type: |
Add the given listener for the given event type(s). |
join(): |
Join an active casting session. |
leave(): |
Leave the active casting session. |
removeEventListener(type: |
Remove the given listener for the given event type(s). |
The callback for the Chromecast connection changes.
Signature:
connectionCallback: ChromecastConnectionCallback | undefined;
The last error that occurred during casting, if any.
Signature:
error: ChromecastError | undefined;
The name of the Chromecast device that the player is casting to, if any.
Signature:
receiverName: string | undefined;
Warning: This API is deprecated.
Superseded by Chromecast.connectionCallback.
The source of the active casting session, if any.
Signature:
source: SourceDescription | undefined;
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;
Parameter |
Type |
Description |
---|---|---|
type |
|
The type of the event. |
listener |
EventListener |
The callback which is executed when the event occurs. |
Join an active casting session.
Signature:
join(): void;
Leave the active casting session.
Signature:
leave(): void;
- Does not stop the session when other devices are connected.
- Use VendorCast.stop() to fully stop the session.
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;
Parameter |
Type |
Description |
---|---|---|
type |
|
The type of the event. |
listener |
EventListener |
The callback which will be removed. |