<GCKSessionManagerListener> Giao thức
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.
Giao thức trình nghe GCKSessionManager.
Tất cả phương thức của giao thức là không bắt buộc. Tất cả các phương thức thông báo có hai loại: một phương thức được gọi cho bất kỳ loại phiên nào và một phương thức được gọi riêng cho các phiên Truyền.
Trình nghe được gọi theo thứ tự đăng ký. Các thực thể GCKSessionManagerListener được đăng ký bởi các thành phần của chính khung (chẳng hạn như GCKUIMediaController) sẽ luôn được gọi sau các lệnh gọi lại đã được ứng dụng đăng ký cho các lệnh gọi lại sessionManager:willStartSession: (GCKSessionManagerListener-p), sessionManager:willStartCastSession: (GCKSessionManagerListener-p), sessionManager:willResumeSession: (GCKSessionManagerListener-p) và sessionManager:willResumeCastSession: (GCKSessionManagerListener-p); và trước những lệnh được ứng dụng đăng ký cho tất cả các lệnh gọi lại còn lại.
- Năm thành lập
- 3
Kế thừa <NSObjectNSObject>.
Được gọi khi một phiên sắp bắt đầu.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Được gọi khi một phiên đã bắt đầu thành công.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Được gọi khi một phiên Truyền sắp bắt đầu.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Được gọi khi một phiên Truyền đã được bắt đầu thành công.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
Được gọi khi một phiên sắp kết thúc, theo yêu cầu hoặc do lỗi.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
didEndSession: |
|
(GCKSession *) |
session |
withError: |
|
(nullable NSError *) |
error |
|
|
| |
|
optional |
Được gọi khi một phiên kết thúc, theo yêu cầu hoặc do lỗi.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
error | The error, if any; otherwise nil. |
Được gọi khi một phiên truyền sắp kết thúc, theo yêu cầu hoặc do lỗi.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Được gọi khi phiên truyền đã kết thúc, theo yêu cầu hoặc do lỗi.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
error | The error, if any; otherwise nil. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
didFailToStartSession: |
|
(GCKSession *) |
session |
withError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
Được gọi khi phiên không bắt đầu được.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
error | The error. |
Được gọi khi phiên Truyền không bắt đầu được.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
error | The error. |
Được gọi khi một phiên bị tạm ngưng.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
reason | The reason for the suspension. |
Được gọi khi một phiên Truyền đã bị tạm ngưng.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
reason | The reason for the suspension. |
Được gọi khi một phiên sắp được tiếp tục.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Được gọi khi phiên đã được tiếp tục thành công.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Được gọi khi một phiên Truyền sắp được tiếp tục.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
Được gọi khi một phiên Truyền đã được tiếp tục thành công.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
Được gọi khi thiết bị liên kết với phiên này có sự thay đổi theo cách nào đó (ví dụ: tên thân thiện đã thay đổi).
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
device | The updated device object. |
- Năm thành lập
- 3,2
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
session: |
|
(GCKSession *) |
session |
didReceiveDeviceVolume: |
|
(float) |
volume |
muted: |
|
(BOOL) |
muted |
|
|
| |
|
optional |
Được gọi khi nhận được âm lượng thiết bị cập nhật và trạng thái tắt tiếng cho một phiên.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
volume | The current volume, in the range [0.0, 1.0]. |
muted | The current mute state. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
castSession: |
|
(GCKCastSession *) |
session |
didReceiveDeviceVolume: |
|
(float) |
volume |
muted: |
|
(BOOL) |
muted |
|
|
| |
|
optional |
Được gọi khi nhận được âm lượng thiết bị cập nhật và trạng thái tắt tiếng cho một phiên Truyền.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
volume | The current volume, in the range [0.0, 1.0]. |
muted | The current mute state. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
session: |
|
(GCKSession *) |
session |
didReceiveDeviceStatus: |
|
(nullable NSString *) |
statusText |
|
|
| |
|
optional |
Được gọi khi nhận được trạng thái thiết bị cập nhật của một phiên.
- Parameters
-
sessionManager | The session manager. |
session | The session. |
statusText | The new device status text. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
castSession: |
|
(GCKCastSession *) |
session |
didReceiveDeviceStatus: |
|
(nullable NSString *) |
statusText |
|
|
| |
|
optional |
Được gọi khi nhận được trạng thái thiết bị cập nhật cho một phiên Truyền.
- Parameters
-
sessionManager | The session manager. |
session | The Cast session. |
statusText | The new device status text. |
- (void) sessionManager: |
|
(GCKSessionManager *) |
sessionManager |
didUpdateDefaultSessionOptionsForDeviceCategory: |
|
(NSString *) |
category |
|
|
| |
|
optional |
Được gọi khi các tuỳ chọn phiên mặc định đã được thay đổi cho một danh mục thiết bị nhất định.
- Parameters
-
sessionManager | The session manager. |
category | The device category. |
- Năm thành lập
- 4
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: 2023-12-02 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2023-12-02 UTC."],[[["`GCKSessionManagerListener` protocol provides methods to monitor the lifecycle and status of Cast sessions, including start, end, suspension, and resumption."],["Listeners are notified about changes in session state through methods like `sessionManager:didStartSession:` and `sessionManager:didEndSession:withError:`."],["The protocol also includes methods to track device updates, such as volume changes (`sessionManager:session:didReceiveDeviceVolume:muted:`) and status updates (`sessionManager:session:didReceiveDeviceStatus:`)."],["Framework-registered listeners have priority for certain callbacks, specifically those related to session start and resumption."],["These optional methods are invoked in the order the listeners were registered, enabling developers to react to various session and device events."]]],[]]