GCKMediaControlChannel Class

GCKMediaControlChannel Class Reference

Overview

A CastChannel for media control operations.

Inherits GCKCastChannel.

Instance Method Summary

(instancetype) - init
 Designated initializer. More...
 
(NSInteger) - loadMedia:
 Loads and starts playback of a new media item. More...
 
(NSInteger) - loadMedia:autoplay:
 Loads and optionally starts playback of a new media item. More...
 
(NSInteger) - loadMedia:autoplay:playPosition:
 Loads and optionally starts playback of a new media item. More...
 
(NSInteger) - loadMedia:autoplay:playPosition:customData:
 Loads and optionally starts playback of a new media item. More...
 
(NSInteger) - loadMedia:autoplay:playPosition:activeTrackIDs:
 Loads and optionally starts playback of a new media item. More...
 
(NSInteger) - loadMedia:autoplay:playPosition:activeTrackIDs:customData:
 Loads and optionally starts playback of a new media item. More...
 
(NSInteger) - setActiveTrackIDs:
 Sets the active tracks. More...
 
(NSInteger) - setTextTrackStyle:
 Sets the text track style. More...
 
(NSInteger) - pause
 Pauses playback of the current media item. More...
 
(NSInteger) - pauseWithCustomData:
 Pauses playback of the current media item. More...
 
(NSInteger) - stop
 Stops playback of the current media item. More...
 
(NSInteger) - stopWithCustomData:
 Stops playback of the current media item. More...
 
(NSInteger) - play
 Begins (or resumes) playback of the current media item. More...
 
(NSInteger) - playWithCustomData:
 Begins (or resumes) playback of the current media item. More...
 
(NSInteger) - seekToTimeInterval:
 Seeks to a new position within the current media item. More...
 
(NSInteger) - seekToTimeInterval:resumeState:
 Seeks to a new position within the current media item. More...
 
(NSInteger) - seekToTimeInterval:resumeState:customData:
 Seeks to a new position within the current media item. More...
 
(NSInteger) - queueLoadItems:startIndex:repeatMode:
 Loads and optionally starts playback of a new queue of media items. More...
 
(NSInteger) - queueLoadItems:startIndex:repeatMode:customData:
 Loads and optionally starts playback of a new queue of media items. More...
 
(NSInteger) - queueLoadItems:startIndex:playPosition:repeatMode:customData:
 Loads and optionally starts playback of a new queue of media items. More...
 
(NSInteger) - queueInsertItems:beforeItemWithID:
 Inserts a list of new media items into the queue. More...
 
(NSInteger) - queueInsertItems:beforeItemWithID:customData:
 Inserts a list of new media items into the queue. More...
 
(NSInteger) - queueInsertItem:beforeItemWithID:
 A convenience method that inserts a single item into the queue. More...
 
(NSInteger) - queueInsertAndPlayItem:beforeItemWithID:
 A convenience method that inserts a single item into the queue and makes it the current item. More...
 
(NSInteger) - queueInsertAndPlayItem:beforeItemWithID:playPosition:customData:
 A convenience method that inserts a single item into the queue and makes it the current item. More...
 
(NSInteger) - queueUpdateItems:
 Updates the queue. More...
 
(NSInteger) - queueUpdateItems:customData:
 Updates the queue. More...
 
(NSInteger) - queueRemoveItemsWithIDs:
 Removes a list of media items from the queue. More...
 
(NSInteger) - queueRemoveItemsWithIDs:customData:
 Removes a list of media items from the queue. More...
 
(NSInteger) - queueRemoveItemWithID:
 A convenience method that removes a single item from the queue. More...
 
(NSInteger) - queueReorderItemsWithIDs:insertBeforeItemWithID:
 Reorders a list of media items in the queue. More...
 
(NSInteger) - queueReorderItemsWithIDs:insertBeforeItemWithID:customData:
 Reorder a list of media items in the queue. More...
 
(NSInteger) - queueMoveItemWithID:beforeItemWithID:
 A convenience method that moves a single item in the queue. More...
 
(NSInteger) - queueJumpToItemWithID:
 Jumps to the item with the specified ID in the queue. More...
 
(NSInteger) - queueJumpToItemWithID:customData:
 Jumps to the item with the specified ID in the queue. More...
 
(NSInteger) - queueJumpToItemWithID:playPosition:customData:
 Jumps to the item with the specified ID in the queue. More...
 
(NSInteger) - queueNextItem
 Moves to the next item in the queue. More...
 
(NSInteger) - queuePreviousItem
 Moves to the previous item in the queue. More...
 
(NSInteger) - queueSetRepeatMode:
 Sets the queue repeat mode. More...
 
(NSInteger) - setStreamVolume:
 Sets the stream volume. More...
 
(NSInteger) - setStreamVolume:customData:
 Sets the stream volume. More...
 
(NSInteger) - setStreamMuted:
 Sets whether the stream is muted. More...
 
(NSInteger) - setStreamMuted:customData:
 Sets whether the stream is muted. More...
 
(NSInteger) - 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...
 
(BOOL) - cancelRequestWithID:
 Cancels an in-progress request. More...
 
(instancetype) - initWithNamespace:
 Designated initializer. More...
 
(void) - didReceiveTextMessage:
 Called when a text message has been received on this channel. More...
 
(BOOL) - sendTextMessage:
 Sends a text message on this channel. More...
 
(BOOL) - sendTextMessage:error:
 Sends a text message on this channel. More...
 
(NSInteger) - generateRequestID
 Generates a request ID for a new message. More...
 
(NSNumber *) - generateRequestNumber
 A convenience method which wraps generateRequestID in an NSNumber. More...
 
(void) - didConnect
 Called when this channel has been connected, indicating that messages can now be exchanged with the Cast device over this channel. More...
 
(void) - didDisconnect
 Called when this channel has been disconnected, indicating that messages can no longer be exchanged with the Cast device over this channel. More...
 

Properties

GCKMediaStatusmediaStatus
 The media status for the currently loaded media, if any; otherwise nil. More...
 
GCKErrorlastError
 The error detail from the last request, if any, or nil if the last request was successful. More...
 
id
< GCKMediaControlChannelDelegate
delegate
 The delegate for receiving notifications about changes in the channel's state. More...
 
NSString * protocolNamespace
 The channel's namespace. More...
 
BOOL isConnected
 A flag indicating whether this channel is currently connected. More...
 
GCKDeviceManagerdeviceManager
 The device manager with which this channel is registered, if any. More...
 

Method Detail

- (instancetype) init

Designated initializer.

- (NSInteger) loadMedia: (GCKMediaInformation *)  mediaInfo

Loads and starts playback of a new media item.

Parameters
mediaInfoAn object describing the media item to load.
Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) 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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) 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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay
playPosition: (NSTimeInterval)  playPosition
customData: (id)  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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay
playPosition: (NSTimeInterval)  playPosition
activeTrackIDs: (NSArray *)  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 (as NSNumbers) specifying the active tracks. May be nil.
Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay
playPosition: (NSTimeInterval)  playPosition
activeTrackIDs: (NSArray *)  activeTrackIDs
customData: (id)  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 (as NSNumbers) 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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) setActiveTrackIDs: (NSArray *)  activeTrackIDs

Sets the active tracks.

Request will fail if there is no current media status.

Parameters
activeTrackIDsAn array of integers (as NSNumbers) specifying the active tracks.
Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent. May be nil or an empty array to set the active tracks to the empty list.
- (NSInteger) setTextTrackStyle: (GCKMediaTextTrackStyle *)  textTrackStyle

Sets the text track style.

Request will fail if there is no current media status.

Parameters
textTrackStyleThe text track style. Style will not be changed if nil.
Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) pause

Pauses playback of the current media item.

Request will fail if there is no current media status.

Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) pauseWithCustomData: (id)  customData

Pauses playback of the current media item.

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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) stop

Stops playback of the current media item.

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

Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) stopWithCustomData: (id)  customData

Stops playback of the current media item.

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

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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) play

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

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

Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) playWithCustomData: (id)  customData

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

Playback always begins at the beginning of the stream. 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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) seekToTimeInterval: (NSTimeInterval)  position

Seeks to a new position within the current media item.

Request will fail if there is no current media status.

Parameters
positionThe new position from the beginning of the stream.
Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) seekToTimeInterval: (NSTimeInterval)  position
resumeState: (GCKMediaControlChannelResumeState)  resumeState 

Seeks to a new position within the current media item.

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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) seekToTimeInterval: (NSTimeInterval)  position
resumeState: (GCKMediaControlChannelResumeState)  resumeState
customData: (id)  customData 

Seeks to a new position within the current media item.

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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) queueLoadItems: (NSArray *)  queueItems
startIndex: (NSUInteger)  startIndex
repeatMode: (GCKMediaRepeatMode)  repeatMode 

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

Parameters
queueItemsAn array of GCKMediaQueueItems 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueLoadItems: (NSArray *)  queueItems
startIndex: (NSUInteger)  startIndex
repeatMode: (GCKMediaRepeatMode)  repeatMode
customData: (id)  customData 

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

Parameters
queueItemsAn array of GCKMediaQueueItems 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueLoadItems: (NSArray *)  queueItems
startIndex: (NSUInteger)  startIndex
playPosition: (NSTimeInterval)  playPosition
repeatMode: (GCKMediaRepeatMode)  repeatMode
customData: (id)  customData 

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

Parameters
queueItemsAn array of GCKMediaQueueItems 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, e.g. 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueInsertItems: (NSArray *)  queueItems
beforeItemWithID: (NSUInteger)  beforeItemID 

Inserts a list of new media items into the queue.

Parameters
queueItemsAn array of GCKMediaQueueItems 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueInsertItems: (NSArray *)  queueItems
beforeItemWithID: (NSUInteger)  beforeItemID
customData: (id)  customData 

Inserts a list of new media items into the queue.

Parameters
queueItemsAn array of GCKMediaQueueItems 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueInsertAndPlayItem: (GCKMediaQueueItem *)  item
beforeItemWithID: (NSUInteger)  beforeItemID
playPosition: (NSTimeInterval)  playPosition
customData: (id)  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, e.g. 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueUpdateItems: (NSArray *)  queueItems

Updates the queue.

Parameters
queueItemsThe list of updated items.
Returns
The request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueUpdateItems: (NSArray *)  queueItems
customData: (id)  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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueRemoveItemsWithIDs: (NSArray *)  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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueRemoveItemsWithIDs: (NSArray *)  itemIDs
customData: (id)  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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueRemoveItemWithID: (NSUInteger)  itemID

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

Parameters
itemIDThe ID of the item to remove.
Returns
The request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueReorderItemsWithIDs: (NSArray *)  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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) queueReorderItemsWithIDs: (NSArray *)  queueItemIDs
insertBeforeItemWithID: (NSUInteger)  beforeItemID
customData: (id)  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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) queueJumpToItemWithID: (NSUInteger)  itemID
customData: (id)  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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) queueJumpToItemWithID: (NSUInteger)  itemID
playPosition: (NSTimeInterval)  playPosition
customData: (id)  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, e.g. 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 request ID for this request, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) queueNextItem

Moves to the next item in the queue.

Returns
The request ID for this request, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) queuePreviousItem

Moves to the previous item in the queue.

Returns
The request ID for this request, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) queueSetRepeatMode: (GCKMediaRepeatMode)  repeatMode

Sets the queue repeat mode.

Parameters
repeatModeThe new repeat mode.
Returns
The request ID for this request, or kGCKInvalidRequestID if the message could not be sent or if any of the parameters are invalid.
- (NSInteger) setStreamVolume: (float)  volume

Sets the stream volume.

Request will fail if there is no current media status.

Parameters
volumeThe new volume, in the range [0.0 - 1.0].
Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) setStreamVolume: (float)  volume
customData: (id)  customData 

Sets the stream volume.

Request will fail if there is no current media status.

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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) setStreamMuted: (BOOL)  muted

Sets whether the stream is muted.

Request will fail if there is no current media status.

Parameters
mutedWhether the stream should be muted or unmuted.
Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) setStreamMuted: (BOOL)  muted
customData: (id)  customData 

Sets whether the stream is muted.

Request will fail if there is no current media status.

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 request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSInteger) requestStatus

Requests updated media status information from the receiver.

Returns
The request ID, or kGCKInvalidRequestID if the message could not be sent.
- (NSTimeInterval) approximateStreamPosition

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

If the channel is not connected, or if no media is currently loaded, 0 is returned.

- (BOOL) cancelRequestWithID: (NSInteger)  requestID

Cancels an in-progress request.

Cancelling a request does not prevent it from being executed; it simply indicates that the calling application is no longer interested in the results of the request, so any state associated with the tracking of the request will be cleared.

Parameters
requestIDThe ID of the request to cancel.
Returns
YES if the request was cancelled, or NO if there is no request being tracked with the given ID.
- (instancetype) initWithNamespace: (NSString *)  protocolNamespace

Designated initializer.

Constructs a new GCKCastChannel with the given namespace.

Parameters
protocolNamespaceThe namespace.

Implemented in GCKGenericChannel.

- (void) didReceiveTextMessage: (NSString *)  message

Called when a text message has been received on this channel.

The default implementation is a no-op.

Parameters
messageThe message.
- (BOOL) sendTextMessage: (NSString *)  message

Sends a text message on this channel.

Parameters
messageThe message.
Returns
YES on success or NO if the message could not be sent (because the channel is not connected, or because the send buffer is too full at the moment).
- (BOOL) sendTextMessage: (NSString *)  message
error: (GCKError **)  error 

Sends a text message on this channel.

Parameters
messageThe message.
errorA pointer at which to store the error result. May be nil.
Returns
YES on success or NO if the message could not be sent.
- (NSInteger) generateRequestID

Generates a request ID for a new message.

Returns
The generated ID, or kGCKInvalidRequestID if the channel is not currently connected.
- (NSNumber *) generateRequestNumber

A convenience method which wraps generateRequestID in an NSNumber.

Returns
The generated ID, or nil if the channel is not currently connected.
- (void) didConnect

Called when this channel has been connected, indicating that messages can now be exchanged with the Cast device over this channel.

The default implementation is a no-op.

- (void) didDisconnect

Called when this channel has been disconnected, indicating that messages can no longer be exchanged with the Cast device over this channel.

The default implementation is a no-op.

Property Documentation

- (GCKMediaStatus*) mediaStatus
readnonatomicstrong

The media status for the currently loaded media, if any; otherwise nil.

- (GCKError*) lastError
readnonatomiccopy

The error detail from the last request, if any, or nil if the last request was successful.

- (id<GCKMediaControlChannelDelegate>) delegate
readwritenonatomicweak

The delegate for receiving notifications about changes in the channel's state.

- (NSString*) protocolNamespace
readnonatomiccopyinherited

The channel's namespace.

- (BOOL) isConnected
readnonatomicassigninherited

A flag indicating whether this channel is currently connected.

- (GCKDeviceManager*) deviceManager
readnonatomicweakinherited

The device manager with which this channel is registered, if any.

Google Cast iOS Sender API Reference v 2.10.1 4691