# GCKUIStreamPositionController Class

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

## Overview

A class that can be used to implement a custom stream position and/or seek UI, in situations where ordinary [**UISlider**](https://goo.gl/H71tKD), [**UIProgressView**](https://goo.gl/LoRoAx), and [**UILabel**](https://goo.gl/POkr7n) controls will not suffice.

The application may either subclass this class and override the [GCKUIStreamPositionController::streamPosition](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a4c18938c7d08cab86a6d9d895cd3e006 "The current stream position from the GCKRemoteMediaClient. "), [GCKUIStreamPositionController::streamDuration](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a7e40db4956d06f5667cae0535fc39392 "The current stream duration from the GCKRemoteMediaClient. "), and [GCKUIStreamPositionController::inputEnabled](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a34802bdc97db740306dfc92ca8caf874 "The GCKUIMediaController writes this property to enable or disable the UI control(s) managed by this ...") setters, or use KVO to listen for changes to these properties, and update its stream position and/or seek UI control(s) accordingly.

Since
:   3.4

Inherits NSObject.

|---|---|
| ## Instance Method Summary ||
| (instancetype) | - [init](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a8bde50e65ad684623d7c6f54d70eb33b) |
|   | Designated initializer. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a8bde50e65ad684623d7c6f54d70eb33b) |
|   ||

|---|---|
| ## Property Summary ||
| NSTimeInterval | [streamPosition](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a4c18938c7d08cab86a6d9d895cd3e006) |
|   | The current stream position from the [GCKRemoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_remote_media_client "A class for controlling media playback on a Cast receiver. "). [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a4c18938c7d08cab86a6d9d895cd3e006) |
|   ||
| NSTimeInterval | [streamDuration](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a7e40db4956d06f5667cae0535fc39392) |
|   | The current stream duration from the [GCKRemoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_remote_media_client "A class for controlling media playback on a Cast receiver. "). [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a7e40db4956d06f5667cae0535fc39392) |
|   ||
| BOOL | [inputEnabled](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a34802bdc97db740306dfc92ca8caf874) |
|   | The [GCKUIMediaController](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_media_controller "A controller for UI views that are used to control or display the status of media playback on a Cast ...") writes this property to enable or disable the UI control(s) managed by this controller. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_stream_position_controller#a34802bdc97db740306dfc92ca8caf874) |
|   ||

## Method Detail

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

Designated initializer.

## Property Detail

|---|---|
| |---| | - (NSTimeInterval) streamPosition | | readwritenonatomicassign |

The current stream position from the [GCKRemoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_remote_media_client "A class for controlling media playback on a Cast receiver. ").

The [GCKUIMediaController](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_media_controller "A controller for UI views that are used to control or display the status of media playback on a Cast ...") writes this property whenever the stream position changes; while the stream is advancing, the property will be updated once per second. The [GCKUIMediaController](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_media_controller "A controller for UI views that are used to control or display the status of media playback on a Cast ...") observes the property (unless it is in the process of writing it) and if it changes, it issues the appropriate media command with the GCKRemoteMediaPlayer to seek to the new stream position. Note that updating this value on an unseekable stream will have no effect.

|---|---|
| |---| | - (NSTimeInterval) streamDuration | | readwritenonatomicassign |

The current stream duration from the [GCKRemoteMediaClient](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_remote_media_client "A class for controlling media playback on a Cast receiver. ").

The [GCKUIMediaController](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_media_controller "A controller for UI views that are used to control or display the status of media playback on a Cast ...") writes this property whenever the stream duration changes. If the stream does not have a known duration (because it is a live stream, for example), then the value written will be [kGCKInvalidTimeInterval](https://developers.google.com/cast/docs/reference/ios/g_c_k_media_common_8h#abe8984fca7b61be2470630190b919c3b). It is not meaningful for the application to change this value.

|---|---|
| |---| | - (BOOL) inputEnabled | | readwritenonatomicassign |

The [GCKUIMediaController](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_u_i_media_controller "A controller for UI views that are used to control or display the status of media playback on a Cast ...") writes this property to enable or disable the UI control(s) managed by this controller.

Media-related UI controls are temporarily disabled while a media command is in-flight.