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 GCKUIButton 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 enables the creation of custom play/pause toggle UI elements for Cast receivers.\u003c/p\u003e\n"],["\u003cp\u003eIt provides properties like \u003ccode\u003eplayPauseState\u003c/code\u003e and \u003ccode\u003einputEnabled\u003c/code\u003e to reflect the current playback status and UI control state.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can subclass it and override setters or use KVO to keep the UI synchronized with the receiver's state.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGCKUIMediaController\u003c/code\u003e manages the \u003ccode\u003eplayPauseState\u003c/code\u003e and \u003ccode\u003einputEnabled\u003c/code\u003e properties, automatically issuing media commands to the receiver when needed.\u003c/p\u003e\n"],["\u003cp\u003eThis class is useful when the standard \u003ccode\u003eGCKUIButton\u003c/code\u003e isn't sufficient for custom UI implementations.\u003c/p\u003e\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 [GCKUIButton](/cast/v3/reference/ios/interface_g_c_k_u_i_button \"A subclass of UIButton that supports custom application states. \") will not suffice.\n\nThe application may either subclass this class and override the [GCKUIPlayPauseToggleController::playPauseState](/cast/v3/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/v3/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/v3/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/v3/reference/ios/g_c_k_u_i_play_pause_toggle_controller_8h#a5fb82340e0cb27757322006b7fbe0380) | [playPauseState](/cast/v3/reference/ios/interface_g_c_k_u_i_play_pause_toggle_controller#a64f0f8b474ee9cb85a8458694c6dcf65) |\n| | The current play/pause state of the [GCKRemoteMediaClient](/cast/v3/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/v3/reference/ios/interface_g_c_k_u_i_play_pause_toggle_controller#ac56ec8a8b78b48e7c2cb02b20115ebdb) |\n| | The [GCKUIMediaController](/cast/v3/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/v3/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/v3/reference/ios/interface_g_c_k_remote_media_client \"A class for controlling media playback on a Cast receiver. \").\n\nThe [GCKUIMediaController](/cast/v3/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/v3/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/v3/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."]]