Lớp: SenderUnsubscribeedEvent
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-28 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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."]]