คลาส: Senderยกเลิกการเชื่อมต่อEvent
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-28 UTC
[null,null,["อัปเดตล่าสุด 2025-07-28 UTC"],[[["\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."]]