# GCKMediaInformation Class

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

## Overview

A class that aggregates information about a media item.

Inherits NSObject. Implements \<NSCopying\>.

|---|---|
| ## Instance Method Summary ||
| (instancetype) | - [initWithContentID:streamType:contentType:metadata:streamDuration:mediaTracks:textTrackStyle:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#ab86ab04bc02de3d21e0d719438e7ea08) |
|   | Designated initializer. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#ab86ab04bc02de3d21e0d719438e7ea08) |
|   ||
| (instancetype) | - [initWithContentID:streamType:contentType:metadata:streamDuration:customData:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a195aa47eff7d0f3258483a99b73c55e3) |
|   | Legacy initializer; does not include media tracks or text track style. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a195aa47eff7d0f3258483a99b73c55e3) |
|   ||
| ([GCKMediaTrack](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_track) \*__nullable) | - [mediaTrackWithID:](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#aedf7b7c1a2f59f4eb04b8cb1a24af4ef) |
|   | Searches for a media track with the given track ID. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#aedf7b7c1a2f59f4eb04b8cb1a24af4ef) |
|   ||

|---|---|
| ## Property Summary ||
| NSString \* | [contentID](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a791941bd8c31303e3674da124eb5be93) |
|   | The content ID for this stream. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a791941bd8c31303e3674da124eb5be93) |
|   ||
| [GCKMediaStreamType](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_information_8h#ada512d5ee6ced19b871067e948aaffd3) | [streamType](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a337e50ed2044af8de6a49d095765adfb) |
|   | The stream type. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a337e50ed2044af8de6a49d095765adfb) |
|   ||
| NSString \* | [contentType](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#aac1b148483d9db2bb3942109010fe41a) |
|   | The content (MIME) type. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#aac1b148483d9db2bb3942109010fe41a) |
|   ||
| [GCKMediaMetadata](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_metadata) \* | [metadata](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a6f5127528ce1ba6e04d1de4dfb34c51d) |
|   | The media item metadata. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a6f5127528ce1ba6e04d1de4dfb34c51d) |
|   ||
| NSArray\< [GCKAdBreakInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_ad_break_info) \* \> \* | [adBreaks](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a87faa23027c069042ec5ea515b65c6fa) |
|   | The list of ad breaks in this content. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a87faa23027c069042ec5ea515b65c6fa) |
|   ||
| NSArray\< [GCKAdBreakClipInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_ad_break_clip_info) \* \> \* | [adBreakClips](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#ada1664b3c19ea528df7bb19cd9bf2507) |
|   | The list of ad break clips in this content. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#ada1664b3c19ea528df7bb19cd9bf2507) |
|   ||
| NSTimeInterval | [streamDuration](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#aaa26b93beb30eccccf3430a52eebe6c9) |
|   | The length of the stream, in seconds, or `INFINITY` if it is a live stream. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#aaa26b93beb30eccccf3430a52eebe6c9) |
|   ||
| NSArray\< [GCKMediaTrack](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_track) \* \> \* | [mediaTracks](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a751ed326ca3868e0d22114935588db9b) |
|   | The media tracks for this stream. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a751ed326ca3868e0d22114935588db9b) |
|   ||
| [GCKMediaTextTrackStyle](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_text_track_style) \* | [textTrackStyle](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a8dd90a57da977d729ebdf813e49102cc) |
|   | The text track style for this stream. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#a8dd90a57da977d729ebdf813e49102cc) |
|   ||
| id | [customData](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#af083a52abe5d4da48cddec65f738246d) |
|   | The custom data, if any. [More...](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_information#af083a52abe5d4da48cddec65f738246d) |
|   ||

## Method Detail

|---|---|---|---|
| - (instancetype) initWithContentID: |   | (NSString \*) | *contentID* |
| streamType: |   | ([GCKMediaStreamType](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_information_8h#ada512d5ee6ced19b871067e948aaffd3)) | *streamType* |
| contentType: |   | (NSString \*) | *contentType* |
| metadata: |   | ([GCKMediaMetadata](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_metadata) \*__nullable) | *metadata* |
| streamDuration: |   | (NSTimeInterval) | *streamDuration* |
| mediaTracks: |   | (NSArray\< [GCKMediaTrack](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_track) \* \> \*__nullable) | *mediaTracks* |
| textTrackStyle: |   | ([GCKMediaTextTrackStyle](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_text_track_style) \*__nullable) | *textTrackStyle* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

Designated initializer.

Parameters
:

    |---|---|
    | contentID | The content ID. |
    | streamType | The stream type. |
    | contentType | The content (MIME) type. |
    | metadata | The media item metadata. |
    | streamDuration | The stream duration. |
    | mediaTracks | The media tracks, if any, otherwise `nil`. |
    | textTrackStyle | The text track style, if any, otherwise `nil`. |
    | customData | The custom application-specific data. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


|---|---|---|---|
| - (instancetype) initWithContentID: |   | (NSString \*) | *contentID* |
| streamType: |   | ([GCKMediaStreamType](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_information_8h#ada512d5ee6ced19b871067e948aaffd3)) | *streamType* |
| contentType: |   | (NSString \*) | *contentType* |
| metadata: |   | ([GCKMediaMetadata](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_metadata) \*__nullable) | *metadata* |
| streamDuration: |   | (NSTimeInterval) | *streamDuration* |
| customData: |   | (id __nullable) | *customData* |
|   |   |   |   |

Legacy initializer; does not include media tracks or text track style.

Parameters
:

    |---|---|
    | contentID | The content ID. |
    | streamType | The stream type. |
    | contentType | The content (MIME) type. |
    | metadata | The media item metadata. |
    | streamDuration | The stream duration. |
    | customData | Custom application-specific data. Must either be an object that can be serialized to JSON using [**NSJSONSerialization**](https://goo.gl/0vd4Q2), or `nil`. |


**[Deprecated:](https://developers.google.com/cast/v3/reference/ios/deprecated#_deprecated000030)**
:   Use the designated initializer.

|---|---|---|---|---|
| - ([GCKMediaTrack](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_track) \*__nullable) mediaTrackWithID: |   | (NSInteger) | *trackID* |   |

Searches for a media track with the given track ID.

Parameters
:

    |---|---|
    | trackID | The media track ID. |


Returns
:   The matching [GCKMediaTrack](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_track "A class representing a media track. ") object, or `nil` if there is no media track with the given ID.

## Property Detail

|---|---|
| |---| | - (NSString\*) contentID | | readnonatomiccopy |

The content ID for this stream.

|---|---|
| |---| | - ([GCKMediaStreamType](https://developers.google.com/cast/v3/reference/ios/g_c_k_media_information_8h#ada512d5ee6ced19b871067e948aaffd3)) streamType | | readnonatomicassign |

The stream type.

|---|---|
| |---| | - (NSString\*) contentType | | readnonatomiccopy |

The content (MIME) type.

|---|---|
| |---| | - ([GCKMediaMetadata](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_metadata)\*) metadata | | readnonatomicstrong |

The media item metadata.

|---|---|
| |---| | - (NSArray\<[GCKAdBreakInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_ad_break_info) \*\>\*) adBreaks | | readnonatomiccopy |

The list of ad breaks in this content.

|---|---|
| |---| | - (NSArray\<[GCKAdBreakClipInfo](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_ad_break_clip_info) \*\>\*) adBreakClips | | readnonatomiccopy |

The list of ad break clips in this content.

Since
:   3.3

|---|---|
| |---| | - (NSTimeInterval) streamDuration | | readnonatomicassign |

The length of the stream, in seconds, or `INFINITY` if it is a live stream.

|---|---|
| |---| | - (NSArray\<[GCKMediaTrack](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_track) \*\>\*) mediaTracks | | readnonatomiccopy |

The media tracks for this stream.

|---|---|
| |---| | - ([GCKMediaTextTrackStyle](https://developers.google.com/cast/v3/reference/ios/interface_g_c_k_media_text_track_style)\*) textTrackStyle | | readnonatomiccopy |

The text track style for this stream.

|---|---|
| |---| | - (id) customData | | readnonatomicstrong |

The custom data, if any.