Class: SenderDisconnectedEvent

  • SenderDisconnectedEvent is dispatched when a sender (like a phone or laptop) disconnects from the Cast receiver.

  • It provides information about the disconnection, including the sender's ID, user agent, and the reason for disconnection.

  • This event extends the base Event class and includes properties like reason, senderId, type, and userAgent.

  • Developers can use this event to handle scenarios like pausing content or cleaning up resources when a sender disconnects.

Constructor

SenderDisconnectedEvent

new SenderDisconnectedEvent(senderId, userAgent, reason)

Parameter

senderId

string

The sender ID.

userAgent

string

The user agent.

reason

cast.framework.system.DisconnectReason

The reason the sender was disconnected.

Value must not be null.

Extends
cast.framework.system.Event

Properties

reason

non-null cast.framework.system.DisconnectReason

The reason the sender was disconnected.

senderId

string

The ID of the disconnected sender.

type

non-null cast.framework.system.EventType

The event type.

Inherited from
cast.framework.system.Event#type

userAgent

string

The user agent of the sender.