# GCKMediaInformation Class

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

## Overview

A class that aggregates information about a media item.

Inherits NSObject, \<NSCopying\>, and \<NSSecureCoding\>.

|---|---|
| ## Instance Method Summary ||
| (instancetype) | - [initWithContentID:streamType:contentType:metadata:adBreaks:adBreakClips:streamDuration:mediaTracks:textTrackStyle:customData:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#ae3dfcbcb9317cbfe0cee8c896f7386db) |
|   | Deprecated. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#ae3dfcbcb9317cbfe0cee8c896f7386db) |
|   ||
| (instancetype) | - [initWithContentID:streamType:contentType:metadata:streamDuration:mediaTracks:textTrackStyle:customData:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a37459a6f80f990ceaec1ab1a64ba3f31) |
|   | Deprecated. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a37459a6f80f990ceaec1ab1a64ba3f31) |
|   ||
| (nullable [GCKMediaTrack](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_track) \*) | - [mediaTrackWithID:](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a1c633c66664698878242e1c45c9b9606) |
|   | Searches for a media track with the given track ID. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a1c633c66664698878242e1c45c9b9606) |
|   ||

|---|---|
| ## Property Summary ||
| NSString \* | [contentID](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a791941bd8c31303e3674da124eb5be93) |
|   | The content ID for this stream. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a791941bd8c31303e3674da124eb5be93) |
|   ||
| NSURL \* | [contentURL](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a585abf91f237c2896929ebdae7509bbe) |
|   | The URL of the content to be played. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a585abf91f237c2896929ebdae7509bbe) |
|   ||
| [GCKMediaStreamType](https://developers.google.com/cast/docs/reference/ios/g_c_k_media_information_8h#ada512d5ee6ced19b871067e948aaffd3) | [streamType](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a337e50ed2044af8de6a49d095765adfb) |
|   | The stream type. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a337e50ed2044af8de6a49d095765adfb) |
|   ||
| NSString \* | [contentType](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#aac1b148483d9db2bb3942109010fe41a) |
|   | The content (MIME) type. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#aac1b148483d9db2bb3942109010fe41a) |
|   ||
| [GCKMediaMetadata](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_metadata) \* | [metadata](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a6f5127528ce1ba6e04d1de4dfb34c51d) |
|   | The media item metadata. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a6f5127528ce1ba6e04d1de4dfb34c51d) |
|   ||
| NSArray\< [GCKAdBreakInfo](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_ad_break_info) \* \> \* | [adBreaks](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a87faa23027c069042ec5ea515b65c6fa) |
|   | The list of ad breaks in this content. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a87faa23027c069042ec5ea515b65c6fa) |
|   ||
| NSArray\< [GCKAdBreakClipInfo](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_ad_break_clip_info) \* \> \* | [adBreakClips](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#ada1664b3c19ea528df7bb19cd9bf2507) |
|   | The list of ad break clips in this content. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#ada1664b3c19ea528df7bb19cd9bf2507) |
|   ||
| NSTimeInterval | [streamDuration](https://developers.google.com/cast/docs/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/docs/reference/ios/interface_g_c_k_media_information#aaa26b93beb30eccccf3430a52eebe6c9) |
|   ||
| NSArray\< [GCKMediaTrack](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_track) \* \> \* | [mediaTracks](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a751ed326ca3868e0d22114935588db9b) |
|   | The media tracks for this stream. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a751ed326ca3868e0d22114935588db9b) |
|   ||
| [GCKMediaTextTrackStyle](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_text_track_style) \* | [textTrackStyle](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a8dd90a57da977d729ebdf813e49102cc) |
|   | The text track style for this stream. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a8dd90a57da977d729ebdf813e49102cc) |
|   ||
| NSString \* | [entity](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#ae3e7767c9e335d31ba0632da0fb9eeb3) |
|   | The deep link for the media as used by Google Assistant, if any. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#ae3e7767c9e335d31ba0632da0fb9eeb3) |
|   ||
| [GCKVASTAdsRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_v_a_s_t_ads_request) \* | [VMAP](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#ae2bf99ae063fc326ffd439f9c1be599f) |
|   | The VMAP request configuration if any. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#ae2bf99ae063fc326ffd439f9c1be599f) |
|   ||
| NSTimeInterval | [startAbsoluteTime](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#ae31c06e97994fc292505b2cb2675831f) |
|   | The epoch time, in seconds, of a live stream's start time. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#ae31c06e97994fc292505b2cb2675831f) |
|   ||
| [GCKHLSSegmentFormat](https://developers.google.com/cast/docs/reference/ios/g_c_k_h_l_s_segment_format_8h#a2e7a0fabbe01b583c51dab04d512642b) | [hlsSegmentFormat](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a84b7d405ee3ad0bb763102111c83166e) |
|   | The format of the HLS audio segment. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a84b7d405ee3ad0bb763102111c83166e) |
|   ||
| [GCKHLSVideoSegmentFormat](https://developers.google.com/cast/docs/reference/ios/g_c_k_h_l_s_video_segment_format_8h#a43724114dd6857be31367414f0dcd8c4) | [hlsVideoSegmentFormat](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a918dc29ea45867799b5960635199050b) |
|   | The format of the HLS video segment. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#a918dc29ea45867799b5960635199050b) |
|   ||
| id | [customData](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#af083a52abe5d4da48cddec65f738246d) |
|   | The custom data, if any. [More...](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information#af083a52abe5d4da48cddec65f738246d) |
|   ||

## Method Detail

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

Deprecated.

Use [GCKMediaInformationBuilder](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information_builder "A builder object for constructing new or derived GCKMediaInformation instances. ") to initialize [GCKMediaInformation](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information "A class that aggregates information about a media item. ") objects.

Parameters
:

    |---|---|
    | contentID | The content ID. |
    | streamType | The stream type. |
    | contentType | The content (MIME) type. |
    | metadata | The media item metadata. |
    | adBreaks | The list of ad breaks in this content. |
    | adBreakClips | The list of ad break clips in this content. |
    | 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`. |


Since
:   4.3

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

Deprecated.

Use [GCKMediaInformationBuilder](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information_builder "A builder object for constructing new or derived GCKMediaInformation instances. ") to initialize [GCKMediaInformation](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_information "A class that aggregates information about a media item. ") objects.

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


|---|---|---|---|---|
| - (nullable [GCKMediaTrack](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_media_track) \*) 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/docs/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.

|---|---|
| |---| | - (NSURL\*) contentURL | | readnonatomiccopy |

The URL of the content to be played.

Since
:   4.3.4

|---|---|
| |---| | - ([GCKMediaStreamType](https://developers.google.com/cast/docs/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/docs/reference/ios/interface_g_c_k_media_metadata)\*) metadata | | readnonatomicassign |

The media item metadata.

|---|---|
| |---| | - (NSArray\<[GCKAdBreakInfo](https://developers.google.com/cast/docs/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/docs/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/docs/reference/ios/interface_g_c_k_media_track) \*\>\*) mediaTracks | | readnonatomiccopy |

The media tracks for this stream.

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

The text track style for this stream.

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

The deep link for the media as used by Google Assistant, if any.

Since
:   4.0

|---|---|
| |---| | - ([GCKVASTAdsRequest](https://developers.google.com/cast/docs/reference/ios/interface_g_c_k_v_a_s_t_ads_request)\*) VMAP | | readnonatomicassign |

The VMAP request configuration if any.

See more here: [Digital Video Ad Serving Template 4.0](https://www.iab.com/guidelines/digital-video-ad-serving-template-vast-4-0/). If this is non-nil, all other ads related fields will be ignored.

Since
:   4.3.4

|---|---|
| |---| | - (NSTimeInterval) startAbsoluteTime | | readnonatomicassign |

The epoch time, in seconds, of a live stream's start time.

For live streams that have a known start time, e.g. a live TV show or sport game, it would be the epoch time that the event started. Otherwise, it will be start time of the live seekable range when the streaming started.

Since
:   4.4.1

|---|---|
| |---| | - ([GCKHLSSegmentFormat](https://developers.google.com/cast/docs/reference/ios/g_c_k_h_l_s_segment_format_8h#a2e7a0fabbe01b583c51dab04d512642b)) hlsSegmentFormat | | readnonatomicassign |

The format of the HLS audio segment.

Since
:   4.6.0

|---|---|
| |---| | - ([GCKHLSVideoSegmentFormat](https://developers.google.com/cast/docs/reference/ios/g_c_k_h_l_s_video_segment_format_8h#a43724114dd6857be31367414f0dcd8c4)) hlsVideoSegmentFormat | | readnonatomicassign |

The format of the HLS video segment.

Since
:   4.6.0

|---|---|
| |---| | - (id) customData | | readnonatomicassign |

The custom data, if any.