GCKMediaInformation 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
继承自 NSObject。实现 <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 |
|
|
| |
指定初始化程序。
- 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 |
|
|
| |
旧版初始化程序;不包含媒体轨道或文本轨道样式。
- 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:
- 使用指定初始化程序。
- (GCKMediaTrack *__nullable) mediaTrackWithID: |
|
(NSInteger) |
trackID |
|
搜索具有指定轨道 ID 的媒体轨道。
- Parameters
-
trackID | The media track ID. |
- 返回
- 匹配的 GCKMediaTrack 对象;如果没有具有指定 ID 的媒体轨道,则返回
nil
。
- (NSString*) contentType |
|
readnonatomiccopy |
- (NSTimeInterval) streamDuration |
|
readnonatomicassign |
视频流的时长(以秒为单位),如果是直播,则为 INFINITY
。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\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,[]]