類別:SenderBreakedEvent
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-28 (世界標準時間)。
[null,null,["上次更新時間:2025-07-28 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eSenderDisconnectedEvent\u003c/code\u003e is dispatched when a sender (like a phone or laptop) disconnects from the Cast receiver.\u003c/p\u003e\n"],["\u003cp\u003eIt provides information about the disconnection, including the sender's ID, user agent, and the reason for disconnection.\u003c/p\u003e\n"],["\u003cp\u003eThis event extends the base \u003ccode\u003eEvent\u003c/code\u003e class and includes properties like \u003ccode\u003ereason\u003c/code\u003e, \u003ccode\u003esenderId\u003c/code\u003e, \u003ccode\u003etype\u003c/code\u003e, and \u003ccode\u003euserAgent\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use this event to handle scenarios like pausing content or cleaning up resources when a sender disconnects.\u003c/p\u003e\n"]]],["The `SenderDisconnectedEvent` class, dispatched by `CastReceiverContext`, signals when a sender disconnects. This event provides details about the disconnection, including the `senderId` (ID of the disconnected sender), `userAgent` (sender's user agent), and `reason` (the cause of disconnection, which cannot be null). The `type` property indicates the event type and is inherited. It extends the `Event` class. The event is created by invoking a new instance of `SenderDisconnectedEvent` and passing the parameters.\n"],null,["# Class: SenderDisconnectedEvent\n\ncast.[framework](/cast/docs/reference/web_receiver/cast.framework).[system](/cast/docs/reference/web_receiver/cast.framework.system).SenderDisconnectedEvent\n============================================================================================================================================================\n\nclass static\n\nAn event dispatched by [cast.framework.CastReceiverContext](/cast/docs/reference/web_receiver/cast.framework.CastReceiverContext) when a\nsender is disconnected.\n\nConstructor\n-----------\n\n### SenderDisconnectedEvent\n\nnew\nSenderDisconnectedEvent(senderId, userAgent, reason)\n\n| #### Parameter ||\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| senderId | string The sender ID. |\n| userAgent | string The user agent. |\n| reason | [cast.framework.system.DisconnectReason](/cast/docs/reference/web_receiver/cast.framework.system#.DisconnectReason) The reason the sender was disconnected. Value must not be null. |\n\nExtends\n: [cast.framework.system.Event](/cast/docs/reference/web_receiver/cast.framework.system.Event)\n\nProperties\n----------\n\n### reason\n\nnon-null [cast.framework.system.DisconnectReason](/cast/docs/reference/web_receiver/cast.framework.system#.DisconnectReason)\n\nThe reason the sender was disconnected.\n\n### senderId\n\nstring\n\nThe ID of the disconnected sender.\n\n### type\n\nnon-null [cast.framework.system.EventType](/cast/docs/reference/web_receiver/cast.framework.system#.EventType)\n\nThe event type.\n\nInherited from\n: [cast.framework.system.Event#type](/cast/docs/reference/web_receiver/cast.framework.system.Event#type)\n\n### userAgent\n\nstring\n\nThe user agent of the sender."]]