GCKRemoteMediaClient Class

GCKRemoteMediaClient Class Reference

Overview

A class for controlling media playback on a Cast receiver.

An instance of this object is available as the property GCKSession::remoteMediaClient.

Since
3.0

Inherits NSObject.

Instance Method Summary

(void) - addListener:
 Adds a listener to this object's list of listeners. More...
 
(void) - removeListener:
 Removes a listener from this object's list of listeners. More...
 
(GCKRequest *) - loadMedia:
 Loads and starts playback of a new media item with default options. More...
 
(GCKRequest *) - loadMedia:withOptions:
 Loads and starts playback of a new media item with the specified options. More...
 
(GCKRequest *) - loadMedia:autoplay:
 Loads and optionally starts playback of a new media item. More...
 
(GCKRequest *) - loadMedia:autoplay:playPosition:
 Loads and optionally starts playback of a new media item. More...
 
(GCKRequest *) - loadMedia:autoplay:playPosition:customData:
 Loads and optionally starts playback of a new media item. More...
 
(GCKRequest *) - loadMedia:autoplay:playPosition:activeTrackIDs:
 Loads and optionally starts playback of a new media item. More...
 
(GCKRequest *) - loadMedia:autoplay:playPosition:activeTrackIDs:customData:
 Loads and optionally starts playback of a new media item. More...
 
(GCKRequest *) - setPlaybackRate:
 Sets the playback rate for the current media session. More...
 
(GCKRequest *) - setPlaybackRate:customData:
 Sets the playback rate for the current media session. More...
 
(GCKRequest *) - setActiveTrackIDs:
 Sets the active tracks. More...
 
(GCKRequest *) - setTextTrackStyle:
 Sets the text track style. More...
 
(GCKRequest *) - pause
 Pauses playback of the current media item. More...
 
(GCKRequest *) - pauseWithCustomData:
 Pauses playback of the current media item. More...
 
(GCKRequest *) - stop
 Stops playback of the current media item. More...
 
(GCKRequest *) - stopWithCustomData:
 Stops playback of the current media item. More...
 
(GCKRequest *) - play
 Begins (or resumes) playback of the current media item. More...
 
(GCKRequest *) - playWithCustomData:
 Begins (or resumes) playback of the current media item. More...
 
(GCKRequest *) - skipAd
 Sends a request to skip the playing ad. More...
 
(GCKRequest *) - seekWithOptions:
 Seeks to a new position within the current media item. More...
 
(GCKRequest *) - seekToTimeInterval:
 Seeks to a new position within the current media item. More...
 
(GCKRequest *) - seekToTimeInterval:resumeState:
 Seeks to a new position within the current media item. More...
 
(GCKRequest *) - seekToTimeInterval:resumeState:customData:
 Seeks to a new position within the current media item. More...
 
(GCKRequest *) - queueFetchItemIDs
 Requests the list of item IDs for the queue. More...
 
(GCKRequest *) - queueFetchItemsForIDs:
 Requests complete information for the queue items with the given item IDs. More...
 
(GCKRequest *) - queueLoadItems:startIndex:repeatMode:
 Loads and optionally starts playback of a new queue of media items. More...
 
(GCKRequest *) - queueLoadItems:startIndex:repeatMode:customData:
 Loads and optionally starts playback of a new queue of media items. More...
 
(GCKRequest *) - queueLoadItems:startIndex:playPosition:repeatMode:customData:
 Loads and optionally starts playback of a new queue of media items. More...
 
(GCKRequest *) - queueLoadItems:withOptions:
 Loads and optionally starts playback of a new queue of media items. More...
 
(GCKRequest *) - queueInsertItems:beforeItemWithID:
 Inserts a list of new media items into the queue. More...
 
(GCKRequest *) - queueInsertItems:beforeItemWithID:customData:
 Inserts a list of new media items into the queue. More...
 
(GCKRequest *) - queueInsertItem:beforeItemWithID:
 A convenience method that inserts a single item into the queue. More...
 
(GCKRequest *) - queueInsertAndPlayItem:beforeItemWithID:
 A convenience method that inserts a single item into the queue and makes it the current item. More...
 
(GCKRequest *) - queueInsertAndPlayItem:beforeItemWithID:playPosition:customData:
 A convenience method that inserts a single item into the queue and makes it the current item. More...
 
(GCKRequest *) - queueUpdateItems:
 Updates the queue. More...
 
(GCKRequest *) - queueUpdateItems:customData:
 Updates the queue. More...
 
(GCKRequest *) - queueRemoveItemsWithIDs:
 Removes a list of media items from the queue. More...
 
(GCKRequest *) - queueRemoveItemsWithIDs:customData:
 Removes a list of media items from the queue. More...
 
(GCKRequest *) - queueRemoveItemWithID:
 A convenience method that removes a single item from the queue. More...
 
(GCKRequest *) - queueReorderItemsWithIDs:insertBeforeItemWithID:
 Reorders a list of media items in the queue. More...
 
(GCKRequest *) - queueReorderItemsWithIDs:insertBeforeItemWithID:customData:
 Reorder a list of media items in the queue. More...
 
(GCKRequest *) - queueMoveItemWithID:beforeItemWithID:
 A convenience method that moves a single item in the queue. More...
 
(GCKRequest *) - queueJumpToItemWithID:
 Jumps to the item with the specified ID in the queue. More...
 
(GCKRequest *) - queueJumpToItemWithID:customData:
 Jumps to the item with the specified ID in the queue. More...
 
(GCKRequest *) - queueJumpToItemWithID:playPosition:customData:
 Jumps to the item with the specified ID in the queue. More...
 
(GCKRequest *) - queueNextItem
 Moves to the next item in the queue. More...
 
(GCKRequest *) - queuePreviousItem
 Moves to the previous item in the queue. More...
 
(GCKRequest *) - queueSetRepeatMode:
 Sets the queue repeat mode. More...
 
(GCKRequest *) - setStreamVolume:
 Sets the stream volume. More...
 
(GCKRequest *) - setStreamVolume:customData:
 Sets the stream volume. More...
 
(GCKRequest *) - setStreamMuted:
 Sets whether the stream is muted. More...
 
(GCKRequest *) - setStreamMuted:customData:
 Sets whether the stream is muted. More...
 
(GCKRequest *) - requestStatus
 Requests updated media status information from the receiver. More...
 
(NSTimeInterval) - approximateStreamPosition
 Returns the approximate stream position as calculated from the last received stream information and the elapsed wall-time since that update. More...
 
(void) - notifyDidStartMediaSession
 To be called by subclasses whenever a media session begins, namely, right after new media has been successfully loaded on the remote player. More...
 
(void) - notifyDidUpdateMediaStatus
 To be called by subclasses whenever the mediaStatus object of the client changes. More...
 
(void) - notifyDidUpdateQueue
 To be called by subclasses whenever the media queue managed by the client changes. More...
 
(void) - notifyDidUpdatePreloadStatus
 To be called by subclasses whenever the GCKMediaStatus::preloadedItemID of the client's GCKMediaStatus changes. More...
 
(void) - notifyDidUpdateMetadata
 To be called by subclasses whenever the metadata changes. More...
 
(void) - notifyDidReceiveQueueItemIDs:
 To be called by subclasses whenever the list of media queue item IDs is received. More...
 
(void) - notifyDidInsertQueueItemsWithIDs:beforeItemWithID:
 To be called by subclasses whenever a contiguous sequence of queue items has been inserted into the queue. More...
 
(void) - notifyDidUpdateQueueItemsWithIDs:
 To be called by subclasses whenever existing queue items have been updated in the queue. More...
 
(void) - notifyDidRemoveQueueItemsWithIDs:
 To be called by subclasses whenever a contiguous sequence of queue items has been removed from the queue. More...
 
(void) - notifyDidReceiveQueueItems:
 To be called by a subclass whenever queue items have been received. More...
 

Property Summary

BOOL connected
 A flag that indicates whether this object is connected to a session. More...
 
GCKMediaStatusmediaStatus
 The current media status, as reported by the media control channel. More...
 
NSTimeInterval timeSinceLastMediaStatusUpdate
 The amount of time that has passed since the last media status update was received. More...
 
id< GCKRemoteMediaClientAdInfoParserDelegateadInfoParserDelegate
 A delegate capable of extracting ad break information from the custom data in a GCKMediaStatus object. More...
 

Method Detail

- (void) addListener: (id< GCKRemoteMediaClientListener >)  listener

Adds a listener to this object's list of listeners.

Parameters
listenerThe listener to add.
- (void) removeListener: (id< GCKRemoteMediaClientListener >)  listener

Removes a listener from this object's list of listeners.

Parameters
listenerThe listener to remove.
- (GCKRequest *) loadMedia: (GCKMediaInformation *)  mediaInfo

Loads and starts playback of a new media item with default options.

Parameters
mediaInfoAn object describing the media item to load.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) loadMedia: (GCKMediaInformation *)  mediaInfo
withOptions: (GCKMediaLoadOptions *)  options 

Loads and starts playback of a new media item with the specified options.

Parameters
mediaInfoAn object describing the media item to load.
optionsThe load options for this request.
Returns
The GCKRequest object for tracking this request.
Since
4.0
- (GCKRequest *) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay 

Loads and optionally starts playback of a new media item.

Parameters
mediaInfoAn object describing the media item to load.
autoplayWhether playback should start immediately.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use loadMedia:withOptions:.
- (GCKRequest *) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay
playPosition: (NSTimeInterval)  playPosition 

Loads and optionally starts playback of a new media item.

Parameters
mediaInfoAn object describing the media item to load.
autoplayWhether playback should start immediately.
playPositionThe initial playback position.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use loadMedia:withOptions:.
- (GCKRequest *) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay
playPosition: (NSTimeInterval)  playPosition
customData: (id __nullable)  customData 

Loads and optionally starts playback of a new media item.

Parameters
mediaInfoAn object describing the media item to load.
autoplayWhether playback should start immediately.
playPositionThe initial playback position.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use loadMedia:withOptions:.
- (GCKRequest *) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay
playPosition: (NSTimeInterval)  playPosition
activeTrackIDs: (NSArray< NSNumber * > *__nullable)  activeTrackIDs 

Loads and optionally starts playback of a new media item.

Parameters
mediaInfoAn object describing the media item to load.
autoplayWhether playback should start immediately.
playPositionThe initial playback position.
activeTrackIDsAn array of integers specifying the active tracks. May be nil.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use loadMedia:withOptions:.
- (GCKRequest *) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay
playPosition: (NSTimeInterval)  playPosition
activeTrackIDs: (NSArray< NSNumber * > *__nullable)  activeTrackIDs
customData: (id __nullable)  customData 

Loads and optionally starts playback of a new media item.

Parameters
mediaInfoAn object describing the media item to load.
autoplayWhether playback should start immediately.
playPositionThe initial playback position.
activeTrackIDsAn array of integers specifying the active tracks. May be nil.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use loadMedia:withOptions:.
- (GCKRequest *) setPlaybackRate: (float)  playbackRate

Sets the playback rate for the current media session.

Parameters
playbackRateThe new playback rate.
Returns
The GCKRequest object for tracking this request.
Since
4.0
- (GCKRequest *) setPlaybackRate: (float)  playbackRate
customData: (id __nullable)  customData 

Sets the playback rate for the current media session.

Parameters
playbackRateThe new playback rate, which must be between GCKMediaLoadOptions::kGCKMediaMinPlaybackRate and GCKMediaLoadOptions::kGCKMediaMaxPlaybackRate.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
Since
4.0
- (GCKRequest *) setActiveTrackIDs: (NSArray< NSNumber * > *__nullable)  activeTrackIDs

Sets the active tracks.

The request will fail if there is no current media status.

Parameters
activeTrackIDsAn array of integers specifying the active tracks. May be empty or nil to disable any currently active tracks.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) setTextTrackStyle: (GCKMediaTextTrackStyle *__nullable)  textTrackStyle

Sets the text track style.

The request will fail if there is no current media status.

Parameters
textTrackStyleThe text track style. The style will not be changed if this is nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) pause

Pauses playback of the current media item.

The request will fail if there is no current media status.

Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) pauseWithCustomData: (id __nullable)  customData

Pauses playback of the current media item.

The request will fail if there is no current media status.

Parameters
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) stop

Stops playback of the current media item.

If a queue is currently loaded, it will be removed. The request will fail if there is no current media status.

Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) stopWithCustomData: (id __nullable)  customData

Stops playback of the current media item.

If a queue is currently loaded, it will be removed. The request will fail if there is no current media status.

Parameters
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) play

Begins (or resumes) playback of the current media item.

Playback always begins at the beginning of the stream. The request will fail if there is no current media status.

Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) playWithCustomData: (id __nullable)  customData

Begins (or resumes) playback of the current media item.

Playback always begins at the beginning of the stream. The request will fail if there is no current media status.

Parameters
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) skipAd

Sends a request to skip the playing ad.

Returns
The GCKRequest object for tracking this request.
Since
4.3
- (GCKRequest *) seekWithOptions: (GCKMediaSeekOptions *)  options

Seeks to a new position within the current media item.

The request will fail if there is no current media status.

Parameters
optionsThe seek options for the request.
Returns
The GCKRequest object for tracking this request.
Since
4.0
- (GCKRequest *) seekToTimeInterval: (NSTimeInterval)  position

Seeks to a new position within the current media item.

The request will fail if there is no current media status.

Parameters
positionThe new position from the beginning of the stream.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use seekWithOptions:.
- (GCKRequest *) seekToTimeInterval: (NSTimeInterval)  position
resumeState: (GCKMediaResumeState resumeState 

Seeks to a new position within the current media item.

The request will fail if there is no current media status.

Parameters
positionThe new position interval from the beginning of the stream.
resumeStateThe action to take after the seek operation has finished.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use seekWithOptions:.
- (GCKRequest *) seekToTimeInterval: (NSTimeInterval)  position
resumeState: (GCKMediaResumeState resumeState
customData: (id __nullable)  customData 

Seeks to a new position within the current media item.

The request will fail if there is no current media status.

Parameters
positionThe new position from the beginning of the stream.
resumeStateThe action to take after the seek operation has finished.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use seekWithOptions:.
- (GCKRequest *) queueFetchItemIDs

Requests the list of item IDs for the queue.

The results are passed to the delegate callback GCKRemoteMediaClientDelegate::remoteMediaClient:didReceiveQueueItemIDs:.

Returns
The GCKRequest object for tracking this request.
Since
4.1
- (GCKRequest *) queueFetchItemsForIDs: (NSArray< NSNumber * > *)  queueItemIDs

Requests complete information for the queue items with the given item IDs.

The results are passed to the delegate callback GCKRemoteMediaClientDelegate::remoteMediaClient:didReceiveQueueItems:.

Returns
The GCKRequest object for tracking this request.
Since
4.1
- (GCKRequest *) queueLoadItems: (NSArray< GCKMediaQueueItem * > *)  queueItems
startIndex: (NSUInteger)  startIndex
repeatMode: (GCKMediaRepeatMode repeatMode 

Loads and optionally starts playback of a new queue of media items.

Parameters
queueItemsAn array of GCKMediaQueueItem instances to load. Must not be nil or empty.
startIndexThe index of the item in the items array that should be played first.
repeatModeThe repeat mode for playing the queue.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use queueLoadItems:withOptions:.
- (GCKRequest *) queueLoadItems: (NSArray< GCKMediaQueueItem * > *)  queueItems
startIndex: (NSUInteger)  startIndex
repeatMode: (GCKMediaRepeatMode repeatMode
customData: (id __nullable)  customData 

Loads and optionally starts playback of a new queue of media items.

Parameters
queueItemsAn array of GCKMediaQueueItem instances to load. Must not be nil or empty.
startIndexThe index of the item in the items array that should be played first.
repeatModeThe repeat mode for playing the queue.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use queueLoadItems:withOptions:.
- (GCKRequest *) queueLoadItems: (NSArray< GCKMediaQueueItem * > *)  queueItems
startIndex: (NSUInteger)  startIndex
playPosition: (NSTimeInterval)  playPosition
repeatMode: (GCKMediaRepeatMode repeatMode
customData: (id __nullable)  customData 

Loads and optionally starts playback of a new queue of media items.

Parameters
queueItemsAn array of GCKMediaQueueItem instances to load. Must not be nil or empty.
startIndexThe index of the item in the items array that should be played first.
playPositionThe initial playback position for the item when it is first played, relative to the beginning of the stream. This value is ignored when the same item is played again, for example when the queue repeats, or the item is later jumped to. In those cases the item's startTime is used.
repeatModeThe repeat mode for playing the queue.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
Deprecated:
Use queueLoadItems:withOptions:.
- (GCKRequest *) queueLoadItems: (NSArray< GCKMediaQueueItem * > *)  queueItems
withOptions: (GCKMediaQueueLoadOptions *)  options 

Loads and optionally starts playback of a new queue of media items.

Parameters
queueItemsAn array of GCKMediaQueueItem instances to load. Must not be nil or empty.
optionsThe options which to load the queue items by as defined by GCKMediaQueueLoadOptions
- (GCKRequest *) queueInsertItems: (NSArray< GCKMediaQueueItem * > *)  queueItems
beforeItemWithID: (NSUInteger)  beforeItemID 

Inserts a list of new media items into the queue.

Parameters
queueItemsAn array of GCKMediaQueueItem instances to insert. Must not be nil or empty.
beforeItemIDThe ID of the item that will be located immediately after the inserted list. If the value is kGCKMediaQueueInvalidItemID, the inserted list will be appended to the end of the queue.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueInsertItems: (NSArray< GCKMediaQueueItem * > *)  queueItems
beforeItemWithID: (NSUInteger)  beforeItemID
customData: (id __nullable)  customData 

Inserts a list of new media items into the queue.

Parameters
queueItemsAn array of GCKMediaQueueItem instances to insert. Must not be nil or empty.
beforeItemIDID of the item that will be located immediately after the inserted list. If the value is kGCKMediaQueueInvalidItemID, the inserted list will be appended to the end of the queue.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueInsertItem: (GCKMediaQueueItem *)  item
beforeItemWithID: (NSUInteger)  beforeItemID 

A convenience method that inserts a single item into the queue.

Parameters
itemThe item to insert.
beforeItemIDThe ID of the item that will be located immediately after the inserted item. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the inserted item will be appended to the end of the queue.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueInsertAndPlayItem: (GCKMediaQueueItem *)  item
beforeItemWithID: (NSUInteger)  beforeItemID 

A convenience method that inserts a single item into the queue and makes it the current item.

Parameters
itemThe item to insert.
beforeItemIDThe ID of the item that will be located immediately after the inserted item. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the inserted item will be appended to the end of the queue.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueInsertAndPlayItem: (GCKMediaQueueItem *)  item
beforeItemWithID: (NSUInteger)  beforeItemID
playPosition: (NSTimeInterval)  playPosition
customData: (id __nullable)  customData 

A convenience method that inserts a single item into the queue and makes it the current item.

Parameters
itemThe item to insert.
beforeItemIDThe ID of the item that will be located immediately after the inserted item. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the inserted item will be appended to the end of the queue.
playPositionThe initial playback position for the item when it is first played, relative to the beginning of the stream. This value is ignored when the same item is played again, for example when the queue repeats, or the item is later jumped to. In those cases the item's startTime is used.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueUpdateItems: (NSArray< GCKMediaQueueItem * > *)  queueItems

Updates the queue.

Parameters
queueItemsThe list of updated items.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueUpdateItems: (NSArray< GCKMediaQueueItem * > *)  queueItems
customData: (id __nullable)  customData 

Updates the queue.

Parameters
queueItemsThe list of updated items.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueRemoveItemsWithIDs: (NSArray< NSNumber * > *)  itemIDs

Removes a list of media items from the queue.

If the queue becomes empty as a result, the current media session will be terminated.

Parameters
itemIDsAn array of media item IDs identifying the items to remove. Must not be nil or empty.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueRemoveItemsWithIDs: (NSArray< NSNumber * > *)  itemIDs
customData: (id __nullable)  customData 

Removes a list of media items from the queue.

If the queue becomes empty as a result, the current media session will be terminated.

Parameters
itemIDsAn array of media item IDs identifying the items to remove. Must not be nil or empty.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueRemoveItemWithID: (NSUInteger)  itemID

A convenience method that removes a single item from the queue.

Parameters
itemIDThe ID of the item to remove.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueReorderItemsWithIDs: (NSArray< NSNumber * > *)  queueItemIDs
insertBeforeItemWithID: (NSUInteger)  beforeItemID 

Reorders a list of media items in the queue.

Parameters
queueItemIDsAn array of media item IDs identifying the items to reorder. Must not be nil or empty.
beforeItemIDID of the item that will be located immediately after the reordered list. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the reordered list will be appended at the end of the queue.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueReorderItemsWithIDs: (NSArray< NSNumber * > *)  queueItemIDs
insertBeforeItemWithID: (NSUInteger)  beforeItemID
customData: (id __nullable)  customData 

Reorder a list of media items in the queue.

Parameters
queueItemIDsAn array of media item IDs identifying the items to reorder. Must not be nil or empty.
beforeItemIDThe ID of the item that will be located immediately after the reordered list. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the reordered list will be moved to the end of the queue.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueMoveItemWithID: (NSUInteger)  itemID
beforeItemWithID: (NSUInteger)  beforeItemID 

A convenience method that moves a single item in the queue.

Parameters
itemIDThe ID of the item to move.
beforeItemIDThe ID of the item that will be located immediately after the reordered list. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the item will be moved to the end of the queue.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueJumpToItemWithID: (NSUInteger)  itemID

Jumps to the item with the specified ID in the queue.

Parameters
itemIDThe ID of the item to jump to.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueJumpToItemWithID: (NSUInteger)  itemID
customData: (id __nullable)  customData 

Jumps to the item with the specified ID in the queue.

Parameters
itemIDThe ID of the item to jump to.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueJumpToItemWithID: (NSUInteger)  itemID
playPosition: (NSTimeInterval)  playPosition
customData: (id __nullable)  customData 

Jumps to the item with the specified ID in the queue.

Parameters
itemIDThe ID of the item to jump to.
playPositionThe initial playback position for the item when it is first played, relative to the beginning of the stream. This value is ignored when the same item is played again, for example when the queue repeats, or the item is later jumped to. In those cases the item's startTime is used.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueNextItem

Moves to the next item in the queue.

Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queuePreviousItem

Moves to the previous item in the queue.

Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) queueSetRepeatMode: (GCKMediaRepeatMode repeatMode

Sets the queue repeat mode.

Parameters
repeatModeThe new repeat mode.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) setStreamVolume: (float)  volume

Sets the stream volume.

The request will fail if there is no current media session.

Parameters
volumeThe new volume, in the range [0.0 - 1.0].
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) setStreamVolume: (float)  volume
customData: (id __nullable)  customData 

Sets the stream volume.

The request will fail if there is no current media session.

Parameters
volumeThe new volume, in the range [0.0 - 1.0].
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) setStreamMuted: (BOOL)  muted

Sets whether the stream is muted.

The request will fail if there is no current media session.

Parameters
mutedWhether the stream should be muted or unmuted.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) setStreamMuted: (BOOL)  muted
customData: (id __nullable)  customData 

Sets whether the stream is muted.

The request will fail if there is no current media session.

Parameters
mutedWhether the stream should be muted or unmuted.
customDataCustom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil.
Returns
The GCKRequest object for tracking this request.
- (GCKRequest *) requestStatus

Requests updated media status information from the receiver.

Returns
The GCKRequest object for tracking this request.
- (NSTimeInterval) approximateStreamPosition

Returns the approximate stream position as calculated from the last received stream information and the elapsed wall-time since that update.

Returns 0 if the channel is not connected or if no media is currently loaded.

- (void) notifyDidStartMediaSession

To be called by subclasses whenever a media session begins, namely, right after new media has been successfully loaded on the remote player.

Provided by category GCKRemoteMediaClient(Protected).

- (void) notifyDidUpdateMediaStatus

To be called by subclasses whenever the mediaStatus object of the client changes.

Provided by category GCKRemoteMediaClient(Protected).

- (void) notifyDidUpdateQueue

To be called by subclasses whenever the media queue managed by the client changes.

Provided by category GCKRemoteMediaClient(Protected).

- (void) notifyDidUpdatePreloadStatus

To be called by subclasses whenever the GCKMediaStatus::preloadedItemID of the client's GCKMediaStatus changes.

Provided by category GCKRemoteMediaClient(Protected).

- (void) notifyDidUpdateMetadata

To be called by subclasses whenever the metadata changes.

Provided by category GCKRemoteMediaClient(Protected).

- (void) notifyDidReceiveQueueItemIDs: (NSArray< NSNumber * > *)  itemIDs

To be called by subclasses whenever the list of media queue item IDs is received.

Parameters
itemIDsThe list of queue item IDs.
Since
4.1

Provided by category GCKRemoteMediaClient(Protected).

- (void) notifyDidInsertQueueItemsWithIDs: (NSArray< NSNumber * > *)  itemIDs
beforeItemWithID: (GCKMediaQueueItemID beforeItemID 

To be called by subclasses whenever a contiguous sequence of queue items has been inserted into the queue.

Parameters
itemIDsThe list of queue item IDs identifying the items that were inserted.
beforeItemIDThe ID of the queue item in front of which the new items were inserted, or kGCKInvalidQueueItemID if the items were appended to the end of the queue.
Since
4.1

Provided by category GCKRemoteMediaClient(Protected).

- (void) notifyDidUpdateQueueItemsWithIDs: (NSArray< NSNumber * > *)  itemIDs

To be called by subclasses whenever existing queue items have been updated in the queue.

Parameters
itemIDsThe list of queue item IDs identifying the items that were updated.
Since
4.1

Provided by category GCKRemoteMediaClient(Protected).

- (void) notifyDidRemoveQueueItemsWithIDs: (NSArray< NSNumber * > *)  itemIDs

To be called by subclasses whenever a contiguous sequence of queue items has been removed from the queue.

Parameters
itemIDsThe list of queue item IDs identifying the items that were removed.
Since
4.1

Provided by category GCKRemoteMediaClient(Protected).

- (void) notifyDidReceiveQueueItems: (NSArray< GCKMediaQueueItem * > *)  items

To be called by a subclass whenever queue items have been received.

Parameters
itemsThe list of queue items.
Since
4.1

Provided by category GCKRemoteMediaClient(Protected).

Property Detail

- (BOOL) connected
readnonatomicassign

A flag that indicates whether this object is connected to a session.

- (GCKMediaStatus*) mediaStatus
readnonatomicstrong

The current media status, as reported by the media control channel.

- (NSTimeInterval) timeSinceLastMediaStatusUpdate
readnonatomicassign

The amount of time that has passed since the last media status update was received.

If a status request is currently in progress, this will be 0.

- (id<GCKRemoteMediaClientAdInfoParserDelegate>) adInfoParserDelegate
readwritenonatomicweak

A delegate capable of extracting ad break information from the custom data in a GCKMediaStatus object.

Deprecated:
Use GCKAdBreakStatus instead.