GCKUIPlayPauseToggleController Class
Stay organized with collections
Save and categorize content based on your preferences.
A class that can be used to implement a custom play/pause toggle UI, in situations where a GCKUIMultistateButton will not suffice.
The application may either subclass this class and override the GCKUIPlayPauseToggleController::playPauseState and GCKUIPlayPauseToggleController::inputEnabled setters, or use KVO to listen for changes to these properties, and update its play/pause UI control(s) accordingly.
- Since
- 3.4
Inherits NSObject.
The current play/pause state of the GCKRemoteMediaClient.
The GCKUIMediaController writes this property whenever the receiver's play/pause state changes. It observes the property (unless it is in the process of writing it) and if it changes, it issues the appropriate media command with the GCKRemoteMediaClient to change the receiver's player state accordingly.
The GCKUIMediaController writes this property to enable or disable the UI control(s) managed by this controller.
Media-related UI controls are temporarily disabled while a media command is in-flight.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGCKUIPlayPauseToggleController\u003c/code\u003e class provides a way to create custom play/pause UI controls for Cast receivers.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can subclass this class and override its properties, or use Key-Value Observing to monitor and update their UI based on changes to the \u003ccode\u003eplayPauseState\u003c/code\u003e and \u003ccode\u003einputEnabled\u003c/code\u003e properties.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGCKUIMediaController\u003c/code\u003e manages the state and enabled/disabled status of the play/pause controls, communicating with the \u003ccode\u003eGCKRemoteMediaClient\u003c/code\u003e to control the receiver's playback.\u003c/p\u003e\n"],["\u003cp\u003eThis class offers an alternative when the standard \u003ccode\u003eGCKUIMultistateButton\u003c/code\u003e is insufficient for implementing play/pause functionality.\u003c/p\u003e\n"]]],["The `GCKUIPlayPauseToggleController` class allows for custom play/pause UI implementations. Developers can subclass and override `playPauseState` and `inputEnabled` setters or use KVO to monitor changes. `playPauseState` reflects the `GCKRemoteMediaClient`'s current play/pause status, managed by the `GCKUIMediaController`. `inputEnabled`, also managed by `GCKUIMediaController`, controls whether the UI control is enabled or disabled, often when media commands are active. The initializer is `init`.\n"],null,["[Instance Methods](#pub-methods) \\| [Properties](#properties) \nGCKUIPlayPauseToggleController Class Reference \n\nOverview \nA class that can be used to implement a custom play/pause toggle UI, in situations where a [GCKUIMultistateButton](/cast/docs/reference/ios/interface_g_c_k_u_i_multistate_button \"A subclass of UIButton that supports multiple states. \") will not suffice.\n\nThe application may either subclass this class and override the [GCKUIPlayPauseToggleController::playPauseState](/cast/docs/reference/ios/interface_g_c_k_u_i_play_pause_toggle_controller#a64f0f8b474ee9cb85a8458694c6dcf65 \"The current play/pause state of the GCKRemoteMediaClient. \") and [GCKUIPlayPauseToggleController::inputEnabled](/cast/docs/reference/ios/interface_g_c_k_u_i_play_pause_toggle_controller#ac56ec8a8b78b48e7c2cb02b20115ebdb \"The GCKUIMediaController writes this property to enable or disable the UI control(s) managed by this ...\") setters, or use KVO to listen for changes to these properties, and update its play/pause UI control(s) accordingly.\n\nSince\n: 3.4\n\nInherits NSObject.\n\n|----------------|-----------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ||\n| (instancetype) | - [init](/cast/docs/reference/ios/interface_g_c_k_u_i_play_pause_toggle_controller#a64f309fa39dada01b3956e172d65b30f) |\n| | Designated initializer. [More...](#a64f309fa39dada01b3956e172d65b30f) |\n| ||\n\n|-----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Property Summary ||\n| [GCKUIPlayPauseState](/cast/docs/reference/ios/g_c_k_u_i_play_pause_toggle_controller_8h#a5fb82340e0cb27757322006b7fbe0380) | [playPauseState](/cast/docs/reference/ios/interface_g_c_k_u_i_play_pause_toggle_controller#a64f0f8b474ee9cb85a8458694c6dcf65) |\n| | The current play/pause state of the [GCKRemoteMediaClient](/cast/docs/reference/ios/interface_g_c_k_remote_media_client \"A class for controlling media playback on a Cast receiver. \"). [More...](#a64f0f8b474ee9cb85a8458694c6dcf65) |\n| ||\n| BOOL | [inputEnabled](/cast/docs/reference/ios/interface_g_c_k_u_i_play_pause_toggle_controller#ac56ec8a8b78b48e7c2cb02b20115ebdb) |\n| | The [GCKUIMediaController](/cast/docs/reference/ios/interface_g_c_k_u_i_media_controller \"A controller for UI views that are used to control or display the status of media playback on a Cast ...\") writes this property to enable or disable the UI control(s) managed by this controller. [More...](#ac56ec8a8b78b48e7c2cb02b20115ebdb) |\n| ||\n\nMethod Detail \n\n|-----------------------|---|---|---|\n| - (instancetype) init | | | |\n\nDesignated initializer.\n\nProperty Detail \n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|\n| |------------------------------------------------------------------------------------------------------------------------------------------------| | - ([GCKUIPlayPauseState](/cast/docs/reference/ios/g_c_k_u_i_play_pause_toggle_controller_8h#a5fb82340e0cb27757322006b7fbe0380)) playPauseState | | readwritenonatomicassign |\n\nThe current play/pause state of the [GCKRemoteMediaClient](/cast/docs/reference/ios/interface_g_c_k_remote_media_client \"A class for controlling media playback on a Cast receiver. \").\n\nThe [GCKUIMediaController](/cast/docs/reference/ios/interface_g_c_k_u_i_media_controller \"A controller for UI views that are used to control or display the status of media playback on a Cast ...\") writes this property whenever the receiver's play/pause state changes. It observes the property (unless it is in the process of writing it) and if it changes, it issues the appropriate media command with the [GCKRemoteMediaClient](/cast/docs/reference/ios/interface_g_c_k_remote_media_client \"A class for controlling media playback on a Cast receiver. \") to change the receiver's player state accordingly. \n\n|-----------------------------------------------------|--------------------------|\n| |-----------------------| | - (BOOL) inputEnabled | | readwritenonatomicassign |\n\nThe [GCKUIMediaController](/cast/docs/reference/ios/interface_g_c_k_u_i_media_controller \"A controller for UI views that are used to control or display the status of media playback on a Cast ...\") writes this property to enable or disable the UI control(s) managed by this controller.\n\nMedia-related UI controls are temporarily disabled while a media command is in-flight."]]