โปรโตคอล <GCKDeviceManagerDelegate>
โปรโตคอลการมอบสิทธิ์ GCKDeviceManager
ผู้โทรควรไม่ปล่อยออบเจ็กต์ GCKDeviceManager ที่ได้รับมอบสิทธิ์จากภายในเมธอดที่ได้รับมอบสิทธิ์ เว้นแต่จะระบุไว้เป็นอย่างอื่น
รับค่า <NSObjectNSObject>
โทรเมื่อสร้างการเชื่อมต่อไปยังอุปกรณ์แล้ว
- Parameters
-
deviceManager | The device manager. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didFailToConnectWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
โทรเมื่อเชื่อมต่อกับอุปกรณ์ไม่สําเร็จ
คุณสามารถปล่อยออบเจ็กต์ GCKDeviceManager จากภายในโค้ดเรียกกลับนี้ได้อย่างปลอดภัย
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the connection to fail. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didDisconnectWithError: |
|
(NSError *__nullable) |
error |
|
|
| |
|
optional |
โทรเมื่อมีการสิ้นสุดการเชื่อมต่อกับอุปกรณ์
คุณสามารถปล่อยออบเจ็กต์ GCKDeviceManager จากภายในโค้ดเรียกกลับนี้ได้อย่างปลอดภัย
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the disconnection; nil if there was no error (for example, an intentional disconnect). |
โทรเมื่อการเชื่อมต่อกับอุปกรณ์ถูกระงับ ซึ่งอาจชั่วคราว
เมื่อการเชื่อมต่อถูกระงับ ผู้จัดการอุปกรณ์จะพยายามสร้างการเชื่อมต่อใหม่โดยอัตโนมัติในเวลาที่เหมาะสม แอปพลิเคชันการโทรไม่ควรพยายามบังคับให้เชื่อมต่อใหม่เอง
- Parameters
-
deviceManager | The device manager. |
reason | The reason for the suspension. |
- (void) deviceManagerDidResumeConnection: |
|
(GCKDeviceManager *) |
deviceManager |
rejoinedApplication: |
|
(BOOL) |
rejoinedApplication |
|
|
| |
|
optional |
เรียกเมื่อเริ่มต้นการเชื่อมต่ออุปกรณ์ที่ถูกระงับก่อนหน้านี้
- Parameters
-
deviceManager | The device manager. |
rejoinedApplication | If a connection had been established to a receiver application at the time of the suspension, this flag indicates whether that application has been successfully re-joined. This value would be NO if, for example, the application was terminated during the time that the device manager was attempting to re-establish its connection to the device. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didConnectToCastApplication: |
|
(GCKApplicationMetadata *) |
applicationMetadata |
sessionID: |
|
(NSString *) |
sessionID |
launchedApplication: |
|
(BOOL) |
launchedApplication |
|
|
| |
|
optional |
โทรเมื่อแอปพลิเคชันเปิดขึ้นหรือเข้าร่วม
- Parameters
-
deviceManager | The device manager. |
applicationMetadata | Metadata about the application. |
sessionID | The current application session ID that is active on the receiver. |
launchedApplication | YES if the application was launched as part of the connection, or NO if the application was already running and was joined. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didFailToConnectToApplicationWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
โทรเมื่อเชื่อมต่อกับแอปพลิเคชันไม่สําเร็จ
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the failure. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didDisconnectFromApplicationWithError: |
|
(NSError *__nullable) |
error |
|
|
| |
|
optional |
โทรเมื่อไม่ได้เชื่อมต่อจากแอปพลิเคชันปัจจุบัน
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the disconnect, or nil if this was a normal disconnect. |
โทรเมื่อคําขอหยุดดําเนินการเสร็จสมบูรณ์
- Parameters
-
deviceManager | The device manager. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didFailToStopApplicationWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
โทรเมื่อคําขอหยุดไม่สําเร็จ
- Parameters
-
deviceManager | The device manager. |
error | The error that caused the failure. |
เรียกใช้ทุกครั้งที่ข้อมูลเมตาของแอปพลิเคชันสําหรับแอปพลิเคชันที่ทํางานอยู่ปัจจุบันมีการเปลี่ยนแปลง
- Parameters
-
deviceManager | The device manager. |
metadata | The application metadata. May be nil if no application is currently running. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
didReceiveApplicationStatusText: |
|
(NSString *__nullable) |
applicationStatusText |
|
|
| |
|
optional |
เรียกใช้ทุกครั้งที่ข้อความสถานะแอปพลิเคชันที่ใช้งานอยู่มีการเปลี่ยนแปลง
- Parameters
-
deviceManager | The device manager. |
applicationStatusText | The application status text. May be nil if no application is currently running or if the application did not report any status text. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
volumeDidChangeToLevel: |
|
(float) |
volumeLevel |
isMuted: |
|
(BOOL) |
isMuted |
|
|
| |
|
optional |
เรียกใช้ทุกครั้งที่ปรับระดับเสียง
- Parameters
-
deviceManager | The device manager. |
volumeLevel | The current device volume level. |
isMuted | The current device mute state. |
เรียกใช้เมื่อใดก็ตามที่สถานะการป้อนข้อมูลที่ใช้งานอยู่มีการเปลี่ยนแปลง
- Parameters
-
deviceManager | The device manager. |
activeInputStatus | The active input status. |
เรียกใช้เมื่อสถานะสแตนด์บายมีการเปลี่ยนแปลง
- Parameters
-
deviceManager | The device manager. |
standbyStatus | The standby status. |
- (void) deviceManager: |
|
(GCKDeviceManager *) |
deviceManager |
request: |
|
(NSInteger) |
requestID |
didFailWithError: |
|
(NSError *) |
error |
|
|
| |
|
optional |
เรียกเมื่อการดําเนินการแบบไม่พร้อมกันล้มเหลว
- Parameters
-
deviceManager | The device manager. |
requestID | The ID of the request that failed. |
error | The error. |
โทรเมื่อสร้างการเชื่อมต่อโหมดผู้มาเยือนกับอุปกรณ์
- Parameters
-
deviceManager | The device manager. |
guestModeDevice | The device object for the concrete guest mode device. |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2022-12-06 UTC
[null,null,["อัปเดตล่าสุด 2022-12-06 UTC"],[[["The `GCKDeviceManagerDelegate` protocol defines methods that inform your app about the status of Cast devices and Cast sessions."],["These methods provide notifications for connections, disconnections, application launches, volume changes, and errors."],["Your app should implement this protocol to handle Cast-related events."],["The delegate methods are called on the main thread."],["It is important to note that unless specified, the `GCKDeviceManager` object should not be released from within a delegate method."]]],["The `GCKDeviceManagerDelegate` protocol manages interactions with Cast devices. Key actions include handling device connections (successful or failed), disconnections, and suspensions. It manages application connections, launches, failures, and disconnections. It also reports changes in application metadata, status text, volume, active input, and standby status. Additionally, it notifies when application stop requests succeed or fail, when an asynchronous operation fails and when a guest mode connection is established. The delegating object should not be released from within most delegate methods.\n"]]