GCKUIPlayPauseToggleController 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\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,["# GCKUIPlayPauseToggleController Class\n\n[Instance Methods](#pub-methods) \\| [Properties](#properties) \nGCKUIPlayPauseToggleController Class Reference \n\nOverview\n--------\n\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|-----------------------|---|---|---|\n| - (instancetype) init | | | |\n\nDesignated initializer.\n\nProperty Detail\n---------------\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."]]