پروتکل <GCKDeviceManagerDelegate>
پروتکل نمایندگی GCKDeviceManager .
تماس گیرنده نباید شی GCKDeviceManager را از داخل یک متد delegate رها کند مگر اینکه خلاف آن مشخص شود.
<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. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2022-12-05 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2022-12-05 بهوقت ساعت هماهنگ جهانی."],[[["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"]]