# GCKMediaControlChannel Class

[Instance Methods](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#pub-methods) \| [Properties](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#properties) GCKMediaControlChannel Class Reference

## Overview

A [GCKCastChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel "A virtual communication channel for exchanging messages between a Cast sender and a Cast receiver...") subclass for media control operations.

Any operations which apply to a currently active stream (play, pause, seek, stop, etc.) require a valid (that is, non-nil) media status, or they will return [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) and will not send the request. A media status is requested automatically when the channel connects, is included with a successful load completed respose, and can also be updated at any time. The media status can also become nil at any time; this will happen if the channel is temporarily disconnected, for example. When using this channel, media status changes should be monitored via the [mediaControlChannelDidUpdateStatus: (GCKMediaControlChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_media_control_channel_delegate-p#a0fd482bf2cfa5a79bf1d443a07c10298 "Called when updated player status information is received. ") callback, and methods which act on streams should be called only while the media status is non-nil.

If a request is successfully started, the corresponding method returns the request ID that was assigned to that request. If the request fails to start, the method returns [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) and sets the [lastError](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a553657c47e72196bbfe92121471a7139 "The error detail from the last request, if any, or nil if the last request was successful. ") property to indicate the reason for the failure. If a request is successfully started but ultimately fails, the [mediaControlChannel:requestDidFailWithID:error: (GCKMediaControlChannelDelegate-p)](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_media_control_channel_delegate-p#a420be0323e2b9663027774beada042bb "Called when a request fails. ") callback will be invoked to indicate the failure.

See [GCKMediaControlChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_media_control_channel_delegate-p "The GCKMediaControlChannel delegate protocol. ") for the delegate protocol.

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000029)**
:   Use the [GCKRemoteMediaClient](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_remote_media_client "A class for controlling media playback on a Cast receiver. ") property of the [GCKCastSession](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_session "A class that manages a Cast session with a receiver device. ") to control media playback.

Inherits [GCKCastChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel).

|---|---|
| ## Instance Method Summary ||
| (instancetype) | - [init](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5032b83abf997c43da88cab84899973e) |
|   | Designated initializer. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5032b83abf997c43da88cab84899973e) |
|   ||
| (NSInteger) | - [loadMedia:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a9d1814bebc6de4b39fe4c82790e13713) |
|   | Loads and starts playback of a new media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a9d1814bebc6de4b39fe4c82790e13713) |
|   ||
| (NSInteger) | - [loadMedia:autoplay:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a8043d79de6b3af8bdb0a191dc87b2986) |
|   | Loads and optionally starts playback of a new media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a8043d79de6b3af8bdb0a191dc87b2986) |
|   ||
| (NSInteger) | - [loadMedia:autoplay:playPosition:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a4c18b6d0bbda6551775356c13ae31d95) |
|   | Loads and optionally starts playback of a new media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a4c18b6d0bbda6551775356c13ae31d95) |
|   ||
| (NSInteger) | - [loadMedia:autoplay:playPosition:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a0abd7239775f6dfea4b52585deb29c25) |
|   | Loads and optionally starts playback of a new media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a0abd7239775f6dfea4b52585deb29c25) |
|   ||
| (NSInteger) | - [loadMedia:autoplay:playPosition:activeTrackIDs:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a8b1c5921273c5e5a1bfe07e96d8e75c7) |
|   | Loads and optionally starts playback of a new media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a8b1c5921273c5e5a1bfe07e96d8e75c7) |
|   ||
| (NSInteger) | - [loadMedia:autoplay:playPosition:activeTrackIDs:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#acbd0942bd84dbf794f4196e899ecf916) |
|   | Loads and optionally starts playback of a new media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#acbd0942bd84dbf794f4196e899ecf916) |
|   ||
| (NSInteger) | - [setActiveTrackIDs:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#aea496a58cf0dbd6446fc6b1872276b3f) |
|   | Sets the active tracks. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#aea496a58cf0dbd6446fc6b1872276b3f) |
|   ||
| (NSInteger) | - [setTextTrackStyle:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a4164f515dcda2e503ed97d74072d703f) |
|   | Sets the text track style. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a4164f515dcda2e503ed97d74072d703f) |
|   ||
| (NSInteger) | - [pause](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ac9f82f6da29fd35d313277b24ccd55d6) |
|   | Pauses playback of the current media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ac9f82f6da29fd35d313277b24ccd55d6) |
|   ||
| (NSInteger) | - [pauseWithCustomData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a50c0cd0c7a69d2c00aeb0fa7c6649cd5) |
|   | Pauses playback of the current media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a50c0cd0c7a69d2c00aeb0fa7c6649cd5) |
|   ||
| (NSInteger) | - [stop](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a0af750047871d0a8bf8cf0fcc7485fed) |
|   | Stops playback of the current media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a0af750047871d0a8bf8cf0fcc7485fed) |
|   ||
| (NSInteger) | - [stopWithCustomData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ae9b3da45354de85bed76cc773071510d) |
|   | Stops playback of the current media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ae9b3da45354de85bed76cc773071510d) |
|   ||
| (NSInteger) | - [play](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ab82a738d692295a9ff5c4a3c7315dd4d) |
|   | Begins (or resumes) playback of the current media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ab82a738d692295a9ff5c4a3c7315dd4d) |
|   ||
| (NSInteger) | - [playWithCustomData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ac0afe8fc39926bcb078c661fb3525a3f) |
|   | Begins (or resumes) playback of the current media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ac0afe8fc39926bcb078c661fb3525a3f) |
|   ||
| (NSInteger) | - [seekToTimeInterval:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a12ee7e6188f81eb350778acff75b0896) |
|   | Seeks to a new position within the current media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a12ee7e6188f81eb350778acff75b0896) |
|   ||
| (NSInteger) | - [seekToTimeInterval:resumeState:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5d9fadf3b01bda1c2854dc417a92a3bf) |
|   | Seeks to a new position within the current media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5d9fadf3b01bda1c2854dc417a92a3bf) |
|   ||
| (NSInteger) | - [seekToTimeInterval:resumeState:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5e9c2ea5eff57d1eeaf1249419b343ab) |
|   | Seeks to a new position within the current media item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5e9c2ea5eff57d1eeaf1249419b343ab) |
|   ||
| (NSInteger) | - [queueLoadItems:startIndex:repeatMode:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a728af343457c1a3b8c9d4f80364b0d29) |
|   | Loads and optionally starts playback of a new queue of media items. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a728af343457c1a3b8c9d4f80364b0d29) |
|   ||
| (NSInteger) | - [queueLoadItems:startIndex:repeatMode:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#aa280bc0d8876fc99f4573fdcb5534f75) |
|   | Loads and optionally starts playback of a new queue of media items. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#aa280bc0d8876fc99f4573fdcb5534f75) |
|   ||
| (NSInteger) | - [queueLoadItems:startIndex:playPosition:repeatMode:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#abd62efa677328aaf9a64ce16fb43eddb) |
|   | Loads and optionally starts playback of a new queue of media items. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#abd62efa677328aaf9a64ce16fb43eddb) |
|   ||
| (NSInteger) | - [queueInsertItems:beforeItemWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a72a2968296122c8efe604b465e4cb73c) |
|   | Inserts a list of new media items into the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a72a2968296122c8efe604b465e4cb73c) |
|   ||
| (NSInteger) | - [queueInsertItems:beforeItemWithID:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5a045ebbec7164187f08d7b1fdc60d7a) |
|   | Inserts a list of new media items into the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5a045ebbec7164187f08d7b1fdc60d7a) |
|   ||
| (NSInteger) | - [queueInsertItem:beforeItemWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a08576a7036f33381fb786da81d96d447) |
|   | A convenience method that inserts a single item into the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a08576a7036f33381fb786da81d96d447) |
|   ||
| (NSInteger) | - [queueInsertAndPlayItem:beforeItemWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#af927178f4582b20ba173583c45484e7e) |
|   | A convenience method that inserts a single item into the queue and makes it the current item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#af927178f4582b20ba173583c45484e7e) |
|   ||
| (NSInteger) | - [queueInsertAndPlayItem:beforeItemWithID:playPosition:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5fcb5413ca77397a5997bb48ad21d663) |
|   | A convenience method that inserts a single item into the queue and makes it the current item. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5fcb5413ca77397a5997bb48ad21d663) |
|   ||
| (NSInteger) | - [queueUpdateItems:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a405ce1319715a57d02ca29d0c19188f2) |
|   | Updates the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a405ce1319715a57d02ca29d0c19188f2) |
|   ||
| (NSInteger) | - [queueUpdateItems:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a83181186c2f0fbb07c3a94913a33252f) |
|   | Updates the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a83181186c2f0fbb07c3a94913a33252f) |
|   ||
| (NSInteger) | - [queueRemoveItemsWithIDs:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ace8a617ee160af84ebb657d7bc4ac350) |
|   | Removes a list of media items from the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ace8a617ee160af84ebb657d7bc4ac350) |
|   ||
| (NSInteger) | - [queueRemoveItemsWithIDs:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ab08297511d8a145b4975adbb3214c141) |
|   | Removes a list of media items from the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ab08297511d8a145b4975adbb3214c141) |
|   ||
| (NSInteger) | - [queueRemoveItemWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#aab47b1dbfa88c20c0279a5c6ba772213) |
|   | A convenience method that removes a single item from the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#aab47b1dbfa88c20c0279a5c6ba772213) |
|   ||
| (NSInteger) | - [queueReorderItemsWithIDs:insertBeforeItemWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a43b279314332ea7dd367ed737c01f3a4) |
|   | Reorders a list of media items in the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a43b279314332ea7dd367ed737c01f3a4) |
|   ||
| (NSInteger) | - [queueReorderItemsWithIDs:insertBeforeItemWithID:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a2b0db893df897049e7dfdf269fa495c0) |
|   | Reorder a list of media items in the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a2b0db893df897049e7dfdf269fa495c0) |
|   ||
| (NSInteger) | - [queueMoveItemWithID:beforeItemWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5b6e5473c2b88677247e4ddc7fb173df) |
|   | A convenience method that moves a single item in the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5b6e5473c2b88677247e4ddc7fb173df) |
|   ||
| (NSInteger) | - [queueJumpToItemWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5cb623b8a5dc3464342ce7330042c887) |
|   | Jumps to the item with the specified ID in the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5cb623b8a5dc3464342ce7330042c887) |
|   ||
| (NSInteger) | - [queueJumpToItemWithID:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5c2d43f7e130096dd667cd1cca31b118) |
|   | Jumps to the item with the specified ID in the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5c2d43f7e130096dd667cd1cca31b118) |
|   ||
| (NSInteger) | - [queueJumpToItemWithID:playPosition:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#afa5dbd2e694dd2ec9c7237510e6bdc83) |
|   | Jumps to the item with the specified ID in the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#afa5dbd2e694dd2ec9c7237510e6bdc83) |
|   ||
| (NSInteger) | - [queueNextItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#afddde53b28b313bc8a08bbd94154755f) |
|   | Moves to the next item in the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#afddde53b28b313bc8a08bbd94154755f) |
|   ||
| (NSInteger) | - [queuePreviousItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ac5716e64a3ab673050676e87d2a74266) |
|   | Moves to the previous item in the queue. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ac5716e64a3ab673050676e87d2a74266) |
|   ||
| (NSInteger) | - [queueSetRepeatMode:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a45be1a67cb97adf1df2c4dcb892239b7) |
|   | Sets the queue repeat mode. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a45be1a67cb97adf1df2c4dcb892239b7) |
|   ||
| (NSInteger) | - [setStreamVolume:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a247e1855e851e9cce9f9df0dc4f3a0d1) |
|   | Sets the stream volume. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a247e1855e851e9cce9f9df0dc4f3a0d1) |
|   ||
| (NSInteger) | - [setStreamVolume:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#adfa2b1e6b789c7a31dc8ded7dee834f6) |
|   | Sets the stream volume. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#adfa2b1e6b789c7a31dc8ded7dee834f6) |
|   ||
| (NSInteger) | - [setStreamMuted:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a53e5be1a517429368dffe4d63c88bdef) |
|   | Sets whether the stream is muted. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a53e5be1a517429368dffe4d63c88bdef) |
|   ||
| (NSInteger) | - [setStreamMuted:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a89241b2c4659d0b7a28d1c9cb61a04c6) |
|   | Sets whether the stream is muted. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a89241b2c4659d0b7a28d1c9cb61a04c6) |
|   ||
| (NSInteger) | - [requestStatus](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#abf91de229e5f7b778705e3e9ed4cffcc) |
|   | Requests updated media status information from the receiver. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#abf91de229e5f7b778705e3e9ed4cffcc) |
|   ||
| (NSTimeInterval) | - [approximateStreamPosition](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a0108b52f99f28cfe6052e0486260add2) |
|   | Returns the approximate stream position as calculated from the last received stream information and the elapsed wall-time since that update. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a0108b52f99f28cfe6052e0486260add2) |
|   ||
| (BOOL) | - [cancelRequestWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a4dd1689c2da6217fbc44bb255c0ef735) |
|   | Cancels an in-progress request. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a4dd1689c2da6217fbc44bb255c0ef735) |
|   ||
| (instancetype) | - [initWithNamespace:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a95b4ed119093a3de422528e8bee9b14e) |
|   | Designated initializer. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a95b4ed119093a3de422528e8bee9b14e) |
|   ||
| (void) | - [didReceiveTextMessage:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#ad8d937fc0cfd104f02d7d2951d925cdd) |
|   | Called when a text message has been received on this channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ad8d937fc0cfd104f02d7d2951d925cdd) |
|   ||
| (BOOL) | - [sendTextMessage:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a536d42cdfb9d56d9ed10c3f75c493985) |
|   | Sends a text message on this channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a536d42cdfb9d56d9ed10c3f75c493985) |
|   ||
| (BOOL) | - [sendTextMessage:error:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a4033e8c0bcfbaf3916d6e38260930c43) |
|   | Sends a text message on this channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a4033e8c0bcfbaf3916d6e38260930c43) |
|   ||
| (NSInteger) | - [generateRequestID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a8c83fab95cb5d463d28a0426dd4d3e17) |
|   | Generates a request ID for a new message. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a8c83fab95cb5d463d28a0426dd4d3e17) |
|   ||
| (NSNumber \*__nullable) | - [generateRequestNumber](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a87356e48d904a3c88f4a05bd077226cb) |
|   | A convenience method which wraps the result of [generateRequestID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a8c83fab95cb5d463d28a0426dd4d3e17) in an [**NSNumber**](https://goo.gl/gY6NGU). [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a87356e48d904a3c88f4a05bd077226cb) |
|   ||
| (void) | - [didConnect](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a82a79e3e3f45509df5d0b6b4296a8529) |
|   | Called when this channel has been connected, indicating that messages can now be exchanged with the Cast device over this channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a82a79e3e3f45509df5d0b6b4296a8529) |
|   ||
| (void) | - [didDisconnect](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a83f1f5750468a8442116610ff3a6a6a9) |
|   | Called when this channel has been disconnected, indicating that messages can no longer be exchanged with the Cast device over this channel. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a83f1f5750468a8442116610ff3a6a6a9) |
|   ||

|---|---|
| ## Property Summary ||
| [GCKMediaStatus](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_status) \* | [mediaStatus](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a83be065cfaa21f720db9d856e14c6119) |
|   | The media status for the currently loaded media, if any; otherwise `nil`. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a83be065cfaa21f720db9d856e14c6119) |
|   ||
| NSTimeInterval | [timeSinceLastMediaStatusUpdate](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a583d803f09056f025445630e535e77a7) |
|   | The amount of time that has passed since the last media status update was received. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a583d803f09056f025445630e535e77a7) |
|   ||
| [GCKError](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_error) \* | [lastError](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a553657c47e72196bbfe92121471a7139) |
|   | The error detail from the last request, if any, or `nil` if the last request was successful. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a553657c47e72196bbfe92121471a7139) |
|   ||
| id\< [GCKMediaControlChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_media_control_channel_delegate-p) \> | [delegate](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a0b1bca227be9b92627676d9d62e46e2e) |
|   | The delegate for receiving notifications about changes in the channel's state. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a0b1bca227be9b92627676d9d62e46e2e) |
|   ||
| NSString \* | [protocolNamespace](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#abf91f5de1dfcc467c94d9f711f219625) |
|   | The channel's namespace. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#abf91f5de1dfcc467c94d9f711f219625) |
|   ||
| BOOL | [isConnected](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#aef5eb750a266e9549fd81f45d63b36eb) |
|   | A flag indicating whether this channel is currently connected. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#aef5eb750a266e9549fd81f45d63b36eb) |
|   ||
| [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager) \* | [deviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a31b5b45235120ca70905ee5ac26cd3cf) |
|   | The device manager with which this channel is registered, if any. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a31b5b45235120ca70905ee5ac26cd3cf) |
|   ||

## Method Detail

|---|---|---|---|
| - (instancetype) init |   |   |   |

Designated initializer.

Implements [GCKCastChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a5c30573fc91241959e4ffe894b539d42).

|---|---|---|---|---|
| - (NSInteger) loadMedia: |   | ([GCKMediaInformation](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information) \*) | *mediaInfo* |   |

Loads and starts playback of a new media item.

Parameters
:

    |---|---|
    | mediaInfo | An object describing the media item to load. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [loadMedia:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a9d1814bebc6de4b39fe4c82790e13713) |   | ([GCKMediaInformation](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information) \*) | *mediaInfo* |
| autoplay: |   | (BOOL) | *autoplay* |
|   |   |   |   |

Loads and optionally starts playback of a new media item.

Parameters
:

    |---|---|
    | mediaInfo | An object describing the media item to load. |
    | autoplay | Whether playback should start immediately. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [loadMedia:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a9d1814bebc6de4b39fe4c82790e13713) |   | ([GCKMediaInformation](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information) \*) | *mediaInfo* |
| autoplay: |   | (BOOL) | *autoplay* |
| playPosition: |   | (NSTimeInterval) | *playPosition* |
|   |   |   |   |

Loads and optionally starts playback of a new media item.

Parameters
:

    |---|---|
    | mediaInfo | An object describing the media item to load. |
    | autoplay | Whether playback should start immediately. |
    | playPosition | The initial playback position. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [loadMedia:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a9d1814bebc6de4b39fe4c82790e13713) |   | ([GCKMediaInformation](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information) \*) | *mediaInfo* |
| autoplay: |   | (BOOL) | *autoplay* |
| playPosition: |   | (NSTimeInterval) | *playPosition* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

Loads and optionally starts playback of a new media item.

Parameters
:

    |---|---|
    | mediaInfo | An object describing the media item to load. |
    | autoplay | Whether playback should start immediately. |
    | playPosition | The initial playback position. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [loadMedia:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a9d1814bebc6de4b39fe4c82790e13713) |   | ([GCKMediaInformation](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information) \*) | *mediaInfo* |
| autoplay: |   | (BOOL) | *autoplay* |
| playPosition: |   | (NSTimeInterval) | *playPosition* |
| activeTrackIDs: |   | (NSArray\< NSNumber \* \> \*__nullable) | *activeTrackIDs* |
|   |   |   |   |

Loads and optionally starts playback of a new media item.

Parameters
:

    |---|---|
    | mediaInfo | An object describing the media item to load. |
    | autoplay | Whether playback should start immediately. |
    | playPosition | The initial playback position. |
    | activeTrackIDs | An array of integers specifying the active tracks. May be `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [loadMedia:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a9d1814bebc6de4b39fe4c82790e13713) |   | ([GCKMediaInformation](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information) \*) | *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
:

    |---|---|
    | mediaInfo | An object describing the media item to load. |
    | autoplay | Whether playback should start immediately. |
    | playPosition | The initial playback position. |
    | activeTrackIDs | An array of integers specifying the active tracks. May be `nil`. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|---|
| - (NSInteger) setActiveTrackIDs: |   | (NSArray\< NSNumber \* \> \*__nullable) | *activeTrackIDs* |   |

Sets the active tracks.

Request will fail if there is no current media status.

Parameters
:

    |---|---|
    | activeTrackIDs | An array of integers specifying the active tracks. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_text_track_style) \*__nullable) | *textTrackStyle* |   |

Sets the text track style.

Request will fail if there is no current media status.

Parameters
:

    |---|---|
    | textTrackStyle | The text track style. The style will not be changed if this is `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|---|
| - (NSInteger) pauseWithCustomData: |   | (id __nullable) | *customData* |   |

Pauses playback of the current media item.

Request will fail if there is no current media status.

Parameters
:

    |---|---|
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|---|
| - (NSInteger) stopWithCustomData: |   | (id __nullable) | *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
:

    |---|---|
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|---|
| - (NSInteger) playWithCustomData: |   | (id __nullable) | *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
:

    |---|---|
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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
:

    |---|---|
    | position | The new position from the beginning of the stream. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [seekToTimeInterval:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a12ee7e6188f81eb350778acff75b0896) |   | (NSTimeInterval) | *position* |
| resumeState: |   | ([GCKMediaControlChannelResumeState](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_common_8h#af220aba6f13c2466e41e7d5a3e683e52)) | *resumeState* |
|   |   |   |   |

Seeks to a new position within the current media item.

Request will fail if there is no current media status.

Parameters
:

    |---|---|
    | position | The new position interval from the beginning of the stream. |
    | resumeState | The action to take after the seek operation has finished. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [seekToTimeInterval:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a12ee7e6188f81eb350778acff75b0896) |   | (NSTimeInterval) | *position* |
| resumeState: |   | ([GCKMediaControlChannelResumeState](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_common_8h#af220aba6f13c2466e41e7d5a3e683e52)) | *resumeState* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

Seeks to a new position within the current media item.

Request will fail if there is no current media status.

Parameters
:

    |---|---|
    | position | The new position from the beginning of the stream. |
    | resumeState | The action to take after the seek operation has finished. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) queueLoadItems: |   | (NSArray\< [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item) \* \> \*) | *queueItems* |
| startIndex: |   | (NSUInteger) | *startIndex* |
| repeatMode: |   | ([GCKMediaRepeatMode](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_common_8h#aad72b610da8ac7e1785975bd5f251406)) | *repeatMode* |
|   |   |   |   |

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

Parameters
:

    |---|---|
    | queueItems | An array of [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item "A class representing a media queue item. ") instances to load. Must not be `nil` or empty. |
    | startIndex | The index of the item in the items array that should be played first. |
    | repeatMode | The repeat mode for playing the queue. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) queueLoadItems: |   | (NSArray\< [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item) \* \> \*) | *queueItems* |
| startIndex: |   | (NSUInteger) | *startIndex* |
| repeatMode: |   | ([GCKMediaRepeatMode](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_common_8h#aad72b610da8ac7e1785975bd5f251406)) | *repeatMode* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

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

Parameters
:

    |---|---|
    | queueItems | An array of [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item "A class representing a media queue item. ") instances to load. Must not be `nil` or empty. |
    | startIndex | The index of the item in the items array that should be played first. |
    | repeatMode | The repeat mode for playing the queue. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) queueLoadItems: |   | (NSArray\< [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item) \* \> \*) | *queueItems* |
| startIndex: |   | (NSUInteger) | *startIndex* |
| playPosition: |   | (NSTimeInterval) | *playPosition* |
| repeatMode: |   | ([GCKMediaRepeatMode](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_common_8h#aad72b610da8ac7e1785975bd5f251406)) | *repeatMode* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

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

Parameters
:

    |---|---|
    | queueItems | An array of [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item "A class representing a media queue item. ") instances to load. Must not be `nil` or empty. |
    | startIndex | The index of the item in the items array that should be played first. |
    | playPosition | The 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. |
    | repeatMode | The repeat mode for playing the queue. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) queueInsertItems: |   | (NSArray\< [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item) \* \> \*) | *queueItems* |
| beforeItemWithID: |   | (NSUInteger) | *beforeItemID* |
|   |   |   |   |

Inserts a list of new media items into the queue.

Parameters
:

    |---|---|
    | queueItems | An array of [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item "A class representing a media queue item. ") instances to insert. Must not be `nil` or empty. |
    | beforeItemID | The ID of the item that will be located immediately after the inserted list. If the value is [kGCKMediaQueueInvalidItemID](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_queue_item_8h#a200e0d20acf51d47ce1c90ae982bd4e5), the inserted list will be appended to the end of the queue. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) queueInsertItems: |   | (NSArray\< [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item) \* \> \*) | *queueItems* |
| beforeItemWithID: |   | (NSUInteger) | *beforeItemID* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

Inserts a list of new media items into the queue.

Parameters
:

    |---|---|
    | queueItems | An array of [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item "A class representing a media queue item. ") instances to insert. Must not be `nil` or empty. |
    | beforeItemID | ID of the item that will be located immediately after the inserted list. If the value is [kGCKMediaQueueInvalidItemID](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_queue_item_8h#a200e0d20acf51d47ce1c90ae982bd4e5), the inserted list will be appended to the end of the queue. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) queueInsertItem: |   | ([GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item) \*) | *item* |
| beforeItemWithID: |   | (NSUInteger) | *beforeItemID* |
|   |   |   |   |

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

Parameters
:

    |---|---|
    | item | The item to insert. |
    | beforeItemID | The ID of the item that will be located immediately after the inserted item. If the value is [kGCKMediaQueueInvalidItemID](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_queue_item_8h#a200e0d20acf51d47ce1c90ae982bd4e5), 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) queueInsertAndPlayItem: |   | ([GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item) \*) | *item* |
| beforeItemWithID: |   | (NSUInteger) | *beforeItemID* |
|   |   |   |   |

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

Parameters
:

    |---|---|
    | item | The item to insert. |
    | beforeItemID | The ID of the item that will be located immediately after the inserted item. If the value is [kGCKMediaQueueInvalidItemID](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_queue_item_8h#a200e0d20acf51d47ce1c90ae982bd4e5), 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) queueInsertAndPlayItem: |   | ([GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item) \*) | *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
:

    |---|---|
    | item | The item to insert. |
    | beforeItemID | The ID of the item that will be located immediately after the inserted item. If the value is [kGCKMediaQueueInvalidItemID](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_queue_item_8h#a200e0d20acf51d47ce1c90ae982bd4e5), or does not refer to any item currently in the queue, the inserted item will be appended to the end of the queue. |
    | playPosition | The 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. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|---|
| - (NSInteger) queueUpdateItems: |   | (NSArray\< [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item) \* \> \*) | *queueItems* |   |

Updates the queue.

Parameters
:

    |---|---|
    | queueItems | The list of updated items. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) [queueUpdateItems:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a405ce1319715a57d02ca29d0c19188f2) |   | (NSArray\< [GCKMediaQueueItem](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_queue_item) \* \> \*) | *queueItems* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

Updates the queue.

Parameters
:

    |---|---|
    | queueItems | The list of updated items. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|---|
| - (NSInteger) 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
:

    |---|---|
    | itemIDs | An 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) [queueRemoveItemsWithIDs:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#ace8a617ee160af84ebb657d7bc4ac350) |   | (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
:

    |---|---|
    | itemIDs | An array of media item IDs identifying the items to remove. Must not be `nil` or empty. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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
:

    |---|---|
    | itemID | The ID of the item to remove. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) queueReorderItemsWithIDs: |   | (NSArray\< NSNumber \* \> \*) | *queueItemIDs* |
| insertBeforeItemWithID: |   | (NSUInteger) | *beforeItemID* |
|   |   |   |   |

Reorders a list of media items in the queue.

Parameters
:

    |---|---|
    | queueItemIDs | An array of media item IDs identifying the items to reorder. Must not be `nil` or empty. |
    | beforeItemID | ID of the item that will be located immediately after the reordered list. If the value is [kGCKMediaQueueInvalidItemID](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_queue_item_8h#a200e0d20acf51d47ce1c90ae982bd4e5), 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|
| - (NSInteger) queueReorderItemsWithIDs: |   | (NSArray\< NSNumber \* \> \*) | *queueItemIDs* |
| insertBeforeItemWithID: |   | (NSUInteger) | *beforeItemID* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

Reorder a list of media items in the queue.

Parameters
:

    |---|---|
    | queueItemIDs | An array of media item IDs identifying the items to reorder. Must not be `nil` or empty. |
    | beforeItemID | The ID of the item that will be located immediately after the reordered list. If the value is [kGCKMediaQueueInvalidItemID](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_queue_item_8h#a200e0d20acf51d47ce1c90ae982bd4e5), or does not refer to any item currently in the queue, the reordered list will be moved to the end of the queue. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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
:

    |---|---|
    | itemID | The ID of the item to move. |
    | beforeItemID | The ID of the item that will be located immediately after the reordered list. If the value is [kGCKMediaQueueInvalidItemID](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_queue_item_8h#a200e0d20acf51d47ce1c90ae982bd4e5), 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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
:

    |---|---|
    | itemID | The ID of the item to jump to. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [queueJumpToItemWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5cb623b8a5dc3464342ce7330042c887) |   | (NSUInteger) | *itemID* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

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

Parameters
:

    |---|---|
    | itemID | The ID of the item to jump to. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [queueJumpToItemWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a5cb623b8a5dc3464342ce7330042c887) |   | (NSUInteger) | *itemID* |
| playPosition: |   | (NSTimeInterval) | *playPosition* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

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

Parameters
:

    |---|---|
    | itemID | The ID of the item to jump to. |
    | playPosition | The 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. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|---|
| - (NSInteger) queueSetRepeatMode: |   | ([GCKMediaRepeatMode](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_common_8h#aad72b610da8ac7e1785975bd5f251406)) | *repeatMode* |   |

Sets the queue repeat mode.

Parameters
:

    |---|---|
    | repeatMode | The new repeat mode. |


Returns
:   The request ID for this request, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent or if any of the parameters are invalid.

|---|---|---|---|---|
| - (NSInteger) setStreamVolume: |   | (float) | *volume* |   |

Sets the stream volume.

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

Parameters
:

    |---|---|
    | volume | The new volume, in the range \[0.0 - 1.0\]. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [setStreamVolume:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a247e1855e851e9cce9f9df0dc4f3a0d1) |   | (float) | *volume* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

Sets the stream volume.

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

Parameters
:

    |---|---|
    | volume | The new volume, in the range \[0.0 - 1.0\]. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|---|
| - (NSInteger) setStreamMuted: |   | (BOOL) | *muted* |   |

Sets whether the stream is muted.

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

Parameters
:

    |---|---|
    | muted | Whether the stream should be muted or unmuted. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) [setStreamMuted:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_control_channel#a53e5be1a517429368dffe4d63c88bdef) |   | (BOOL) | *muted* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

Sets whether the stream is muted.

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

Parameters
:

    |---|---|
    | muted | Whether the stream should be muted or unmuted. |
    | customData | Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the message could not be sent.

|---|---|---|---|
| - (NSInteger) requestStatus |   |   |   |

Requests updated media status information from the receiver.

Returns
:   The request ID, or [kGCKInvalidRequestID](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) 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.

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

|---|---|---|---|---|
| - (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
:

    |---|---|
    | requestID | The 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](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel "A virtual communication channel for exchanging messages between a Cast sender and a Cast receiver...") with the given namespace.

Parameters
:

    |---|---|
    | protocolNamespace | The namespace. |


Implemented in [GCKGenericChannel](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_generic_channel#ac355b4afa1aa5011122abb8340dea7a0).

|---|---|---|---|---|
| - (void) didReceiveTextMessage: |   | (NSString \*) | *message* |   |

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

The default implementation is a no-op.

Parameters
:

    |---|---|
    | message | The message. |


|---|---|---|---|---|
| - (BOOL) sendTextMessage: |   | (NSString \*) | *message* |   |

Sends a text message on this channel.

Parameters
:

    |---|---|
    | message | The 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).

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000002)**
:   Use [sendTextMessage:error:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a4033e8c0bcfbaf3916d6e38260930c43) which provides detailed error information.

|---|---|---|---|
| - (BOOL) [sendTextMessage:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a536d42cdfb9d56d9ed10c3f75c493985) |   | (NSString \*) | *message* |
| error: |   | ([GCKError](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_error) \*__nullable \*__nullable) | *error* |
|   |   |   |   |

Sends a text message on this channel.

Parameters
:

    |---|---|
    | message | The message. |
    | error | A 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](https://developers.google.com/cast/v3/reference/ios/g_c_k_common_8h#aad76567f243bc1b4fb113abd97bf3327) if the channel is not currently connected.

|---|---|---|---|
| - (NSNumber \* __nullable) generateRequestNumber |   |   |   |

A convenience method which wraps the result of [generateRequestID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_cast_channel#a8c83fab95cb5d463d28a0426dd4d3e17) in an [**NSNumber**](https://goo.gl/gY6NGU).

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 Detail

|---|---|
| |---| | - ([GCKMediaStatus](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_status)\*) mediaStatus | | readnonatomicstrong |

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

|---|---|
| |---| | - (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.

|---|---|
| |---| | - ([GCKError](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_error)\*) lastError | | readnonatomiccopy |

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

|---|---|
| |---| | - (id\<[GCKMediaControlChannelDelegate](https://developers.google.com/cast/v3/reference/ios/protocol_g_c_k_media_control_channel_delegate-p)\>) 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](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager)\*) deviceManager | | readnonatomicweakinherited |

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

**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000001)**
:   If this channel was not registered with the deprecated [GCKDeviceManager](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_device_manager "A controller for Cast devices. ") class, this will be `nil`.