logo

THEOplayer > ChromecastConnectionCallback

ChromecastConnectionCallback interface

The ChromecastConnectionCallback.

Signature:

export interface ChromecastConnectionCallback 

Methods

Method

Description

onJoin​(sourceDescription: SourceDescription | undefined): SourceDescription | undefined

Called after the player has joined an already existing connection to the receiver.

onLeave​(sourceDescription: SourceDescription | undefined): SourceDescription | undefined

Called after the player has left the connection to the receiver.

onStart​(sourceDescription: SourceDescription | undefined): SourceDescription | undefined

Called after the player has started the connection to the receiver.

onStop​(sourceDescription: SourceDescription | undefined): SourceDescription | undefined

Called after the player has stopped the connection to the receiver.

Method Details

onJoin

Called after the player has joined an already existing connection to the receiver.

Signature:

onJoin(sourceDescription: SourceDescription | undefined): SourceDescription | undefined;

Parameters

Parameter

Type

Description

sourceDescription

SourceDescription | undefined

The current SourceDescription on the current sender device.

Returns

The SourceDescription to be loaded on the receiver device.

Remarks


- At this point it's possible to load a new media from the sender to the receiver.
- Returning null will not change the source on the receiver.

onLeave

Called after the player has left the connection to the receiver.

Signature:

onLeave(sourceDescription: SourceDescription | undefined): SourceDescription | undefined;

Parameters

Parameter

Type

Description

sourceDescription

SourceDescription | undefined

The current SourceDescription on the receiver device.

Returns

The SourceDescription to be loaded on the sender device.

Remarks


- At this point we are trying to load the media from the receiver to the sender.
- Returning null will behave same as returning the provided SourceDescription.

onStart

Called after the player has started the connection to the receiver.

Signature:

onStart(sourceDescription: SourceDescription | undefined): SourceDescription | undefined;

Parameters

Parameter

Type

Description

sourceDescription

SourceDescription | undefined

The current SourceDescription on the sender device.

Returns

The SourceDescription to be loaded on the receiver device.

Remarks


- At this point we are trying to load the media from the sender to the receiver.
- Returning null will behave same as returning the provided SourceDescription.

onStop

Called after the player has stopped the connection to the receiver.

Signature:

onStop(sourceDescription: SourceDescription | undefined): SourceDescription | undefined;

Parameters

Parameter

Type

Description

sourceDescription

SourceDescription | undefined

The current SourceDescription on the receiver device.

Returns

The SourceDescription to be loaded on the sender device.

Remarks


- At this point we are trying to load the media from the receiver to the sender.
- Returning null will behave same as returning the provided SourceDescription.

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