GCKMediaInformation Class
Stay organized with collections
Save and categorize content based on your preferences.
A class that aggregates information about a media item.
Inherits NSObject. Implements <NSCopying>.
- (instancetype) initWithContentID: |
|
(NSString *) |
contentID |
streamType: |
|
(GCKMediaStreamType) |
streamType |
contentType: |
|
(NSString *) |
contentType |
metadata: |
|
(GCKMediaMetadata *__nullable) |
metadata |
streamDuration: |
|
(NSTimeInterval) |
streamDuration |
mediaTracks: |
|
(NSArray< GCKMediaTrack * > *__nullable) |
mediaTracks |
textTrackStyle: |
|
(GCKMediaTextTrackStyle *__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, or nil . |
- (instancetype) initWithContentID: |
|
(NSString *) |
contentID |
streamType: |
|
(GCKMediaStreamType) |
streamType |
contentType: |
|
(NSString *) |
contentType |
metadata: |
|
(GCKMediaMetadata *__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, or nil . |
- Deprecated:
- Use the designated initializer.
- (GCKMediaTrack *__nullable) mediaTrackWithID: |
|
(NSInteger) |
trackID |
|
Searches for a media track with the given track ID.
- Parameters
-
trackID | The media track ID. |
- Returns
- The matching GCKMediaTrack object, or
nil
if there is no media track with the given ID.
The content ID for this stream.
- (NSString*) contentType |
|
readnonatomiccopy |
The list of ad breaks in this content.
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.
The media tracks for this stream.
The text track style for this stream.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGCKMediaInformation\u003c/code\u003e class stores details about a media item, such as its content ID, stream type, content type, metadata, stream duration, and custom data.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to initialize media information objects with or without media tracks and text track styles.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can access properties like \u003ccode\u003econtentID\u003c/code\u003e, \u003ccode\u003estreamType\u003c/code\u003e, \u003ccode\u003econtentType\u003c/code\u003e, \u003ccode\u003emetadata\u003c/code\u003e, \u003ccode\u003estreamDuration\u003c/code\u003e, and more to retrieve media information.\u003c/p\u003e\n"],["\u003cp\u003eIt includes methods to find specific media tracks using their track IDs.\u003c/p\u003e\n"],["\u003cp\u003eThe class inherits from \u003ccode\u003eNSObject\u003c/code\u003e and implements the \u003ccode\u003eNSCopying\u003c/code\u003e protocol.\u003c/p\u003e\n"]]],["The GCKMediaInformation class aggregates data about a media item, including its content ID, stream type, and content type. Key actions include initializing with content details like `contentID`, `streamType`, `contentType`, `metadata`, `streamDuration`, `mediaTracks`, `textTrackStyle`, and `customData`. It also supports legacy initialization, excluding media/text tracks. The class facilitates searching for media tracks by ID, and provides properties for ad breaks, ad break clips, stream duration, and custom data.\n"],null,[]]