Stay organized with collections Save and categorize content based on your preferences.
A controller for UI views that are used to control or display the status of media playback on a Cast receiver.
The calling application registers its media-related UI controls with the controller by setting the appropriate properties. The controller then responds to touch events on the controls by issuing the appropriate media commands to the receiver, and updates the controls based on status information and media metadata received from the receiver. The controller automatically enables and disables the UI controls as appropriate for the current session and media player state. It additionally disables all of the controls while a request is in progress.
See GCKUIMediaControllerDelegate for the delegate protocol.
Inherits NSObject.
- (void) bindLabel: (UILabel *) label toMetadataKey: (NSString *) keyBinds a UILabel to a metadata key.
The view will display the current value of the corresponding metadata field.
See GCKMediaMetadata for a list of predefined metadata keys.
Binds a UILabel to a metadata key.
The view will display the current value of the corresponding metadata field.
See GCKMediaMetadata for a list of predefined metadata keys.
Binds a UITextView to a metadata key.
The view will display the current value of the corresponding metadata field.
See GCKMediaMetadata for a list of predefined metadata keys.
Binds a UITextView to a metadata key.
The view will display the current value of the corresponding metadata field.
See GCKMediaMetadata for a list of predefined metadata keys.
Binds a UIControl
to rewind playback of the current item by the passed value as seconds.
The view will be updated based on GCKCastSession
state, the remote playback state and whether it is a livestream. A target is also added to the UIControl
to capture UIControlEventTouchUpInside
event. Do not add target of this type on the UIControl
. To capture the event use the GCKUIMediaControllerDelegate
methods instead.
UIButton
. rewindSeconds The number of seconds to rewind the media.
Binds a UIControl
to forward playback of the current item by the passed value as seconds.
The view will be updated based on GCKCastSession
state, the remote playback state and whether it is a livestream. A target is also added to the UIControl
to capture UIControlEventTouchUpInside
event. Do not add target of this type on the UIControl
. To capture the event use the GCKUIMediaControllerDelegate
methods instead.
UIButton
. forwardSeconds The number of seconds to skip the media.
Unbinds the specified view.
A convenience method for displaying the media track selection UI.
Sends and monitors the skip ad request.
The session that is associated with this controller.
Whether there is media currently loaded (or loading) on the receiver.
If no Cast session is active, this will be NO
.
Whether there is a current item in the queue.
- (BOOL) hasLoadingQueueItem readnonatomicassignWhether there is an item being preloaded in the queue.
- (GCKMediaPlayerState) lastKnownPlayerState readnonatomicassignThe latest known media player state.
If no Cast session is active, this will be player state just before the last session ended. If there was no prior session, this will be GCKMediaPlayerStateUnknown.
- (NSTimeInterval) lastKnownStreamPosition readnonatomicassignThe latest known media stream position.
If no Cast session is active, this will be the stream position of the media just before the last session ended. If there was no prior session, this will be kGCKInvalidTimeInterval.
A "play" button.
When the button is tapped, playback of the currently loaded media is started or resumed on the receiver. The button will be disabled if playback is already in progress, or if there is no media currently loaded, or if there is no Cast session currently active.
- (UIButton*) pauseButton readwritenonatomicweakA "pause" button.
When the button is tapped, playback of the currently loaded media is paused on the receiver. The button will be disabled if the currently loaded media does not support pausing, or if playback is not currently in progress, or if there is no media currently loaded, or if there is no Cast session currently active.
A "play/pause" toggle button.
The caller should set appropriate icons for the button's GCKUIButtonStatePlay, GCKUIButtonStatePlayLive, and GCKUIButtonStatePause button states, namely, a "pause" icon for the play state, a "stop" icon for the play-live state, and a "play" icon for the pause state. The button state is automatically updated to reflect the current playback state on the receiver. When the button is tapped, playback of the currently loaded media is paused or resumed on the receiver. The button will be disabled if the currently loaded media does not support pausing, or if playback is not currently in progress or paused, or if there is no media currently loaded, or if there is no Cast session currently active.
A "play/pause" toggle controller.
Used as a stand-in for a custom, application-supplied play/pause toggle UI. See GCKUIPlayPauseToggleController for details.
A "stop" button.
When the button is tapped, playback of the currently loaded media is stopped on the receiver. The button will be disabled if there is no media currently loaded, or if there is no Cast session currently active.
- (UIButton*) forward30SecondsButton readwritenonatomicweakA button for seeking 30 seconds forward in the currently playing media item.
The button will be disabled if there is no media currently loaded, or if there is no Cast session currently active.
- (UIButton*) rewind30SecondsButton readwritenonatomicweakA button for seeking 30 seconds back in the currently playing media item.
The button will be disabled if there is no media currently loaded, or if there is no Cast session currently active.
- (UIButton*) pauseQueueButton readwritenonatomicweakA button for pausing queue playback once the current item finishes playing.
A "next" button.
When the button is tapped, playback moves to the next media item in the queue. The button will be disabled if the operation is not supported, or if there is no media currently loaded, or if there is no Cast session currently active.
- (UIButton*) previousButton readwritenonatomicweakA "previous" button.
When the button is tapped, playback moves to the previous media item in the queue. The button will be disabled if the operation is not supported, or if there is no media currently loaded, or if there is no Cast session currently active.
- (UISlider*) streamPositionSlider readwritenonatomicweakA slider for displaying and changing the current stream position.
When the slider's value is changed by the user, the stream position of the currently loaded media is updated on the receiver. While playback of media is in progress on the receiver, the slider's value is updated in realtime to reflect the current stream position. The slider will be disabled if the currently loaded media does not support seeking, or if there is no media currently loaded, or if there is no Cast session currently active.
- (UIProgressView*) streamProgressView readwritenonatomicweakA view for displaying the current stream progress.
While playback of media is in progress on the receiver, the views's value is updated in realtime to reflect the current stream position. The view will be disabled if the currently loaded media is a live stream, or if there is no media currently loaded, or if there is no Cast session currently active.
- (UILabel*) streamPositionLabel readwritenonatomicweakA label for displaying the current stream position, in minutes and seconds.
If there is no media currently loaded, or if there is no Cast session currently active, the label displays a localized form of "--:--".
- (UILabel*) streamDurationLabel readwritenonatomicweakA label for displaying the current stream duration, in minutes and seconds.
If the currently loaded media does not have a duration (for example, if it is a live stream), or if there is no media currently loaded, or if there is no Cast session currently active, the label displays a localized form of "--:--".
- (UILabel*) streamTimeRemainingLabel readwritenonatomicweakA label for displaying the remaining stream time (the duration minus the position), in minutes and seconds.
If the currently loaded media does not have a duration (for example, if it is a live stream), or if there is no media currently loaded, or if there is no Cast session currently active, the label displays a localized form of "--:--".
A stream posdition controller.
Used as a stand-in for a custom, application-supplied stream position and/or seek UI. See GCKUIStreamPositionController for details.
Whether remaining stream time will be displayed as a negative value, for example, "-1:23:45".
By default this property is set to YES
.
Whether stream position controls (including the stream position slider, the stream position label, the stream duration label, and the stream progress view) should be hidden for live content.
The default value is NO
.
A button for selecting audio tracks and/or closed captions or subtitles.
When the button is tapped, the media tracks selection UI is displayed to the user. The button will be disabled if the currently loaded media does not have any selectable media tracks, or if there is no media currently loaded, or if there is no Cast session currently active.
- (UILabel*) smartSubtitleLabel readwritenonatomicweakA label for displaying a subtitle for the currently loaded media.
If there is no subtitle field explicitly set in the metadata, the label will display the most appropriate metadata field based on the media type, for example the studio name for a movie or the artist name for a music track.
- (UIActivityIndicatorView*) mediaLoadingIndicator readwritenonatomicweakAn activity indicator view for indicating that the media is in a loading state.
A label for displaying the amount of time left until the ad can be skipped.
A button for skipping the current ad.
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."],[[["The `GCKUIMediaController` class manages the UI elements for controlling media playback on a Cast receiver, connecting UI components to media commands."],["It offers methods for binding UI elements to metadata, controlling playback (play, pause, seek, skip), and managing the queue, as well as properties reflecting the playback state and providing direct access to common UI controls."],["Developers can customize UI elements and behavior using provided properties like buttons, sliders, and labels, and methods to connect them to specific playback actions."],["The `GCKUIMediaControllerDelegate` protocol allows you to respond to media control events and handle user interactions with bound UI controls."],["Properties like `mediaLoaded`, `lastKnownPlayerState`, and `lastKnownStreamPosition` provide insights into the current media playback status on the Cast receiver."]]],["The `GCKUIMediaController` manages media playback UI on a Cast receiver. It binds UI elements like labels, image views, and controls to display media metadata, status, and enable user interactions. Key actions include binding views to data, controlling playback (play, pause, stop, forward, rewind), managing queue operations (repeat, next, previous), and selecting media tracks. It automatically updates UI states and disables controls when necessary, such as during requests or when media is not loaded, and it uses delegate to provide notification.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4