總覽
代表媒體佇列項目的類別。
這個物件的例項不會變更。
這個類別用於傳送端應用程式和接收端應用程式之間的雙向通訊。傳送者會建構這些項目,以便在接收端應用程式中載入或插入媒體項目清單。接收端的 GCKMediaStatus 也包含以這個類別例項表示的項目清單。
載入後,接收器會為每個 GCKMediaQueueItem 指派專屬項目 ID,即使載入的媒體相同也一樣。
繼承 NSObject。實作 <NSCopying>。
執行個體方法摘要 | |
(instancetype) | - initWithMediaInformation:autoplay:startTime:preloadTime:activeTrackIDs:customData: |
使用指定屬性建構新的 GCKMediaQueueItem。更多... | |
(instancetype) | - initWithMediaInformation:autoplay:startTime:playbackDuration:preloadTime:activeTrackIDs:customData: |
指定初始化器。更多... | |
(void) | - clearItemID |
清除 (取消指派) 項目 ID。更多... | |
(instancetype) | - mediaQueueItemModifiedWithBlock: |
傳回這個 GCKMediaQueueItem 的副本,該副本已由指定區塊修改。更多... | |
房源摘要 | |
GCKMediaInformation * | mediaInformation |
與這個項目相關聯的媒體資訊。更多... | |
NSUInteger | itemID |
項目 ID,或尚未指派時則為 kGCKMediaQueueInvalidItemID。更多... | |
BOOL | autoplay |
項目是否應在成為佇列中的目前項目時自動開始播放。更多... | |
NSTimeInterval | startTime |
項目的開始時間 (以秒為單位)。更多... | |
NSTimeInterval | playbackDuration |
項目播放時間長度 (以秒為單位),或 INFINITY (如要使用串流的實際時間長度)。更多... | |
NSTimeInterval | preloadTime |
接收器應開始預先載入這個項目的時間,以秒為單位,表示前一個項目結束前多久。更多... | |
NSArray< NSNumber * > * | activeTrackIDs |
這個項目的有效曲目 ID。更多... | |
id | customData |
與這個項目相關聯的自訂資料 (如有)。更多... | |
方法詳細資料
- (instancetype) initWithMediaInformation: | (GCKMediaInformation *) | mediaInformation | |
autoplay: | (BOOL) | autoplay | |
startTime: | (NSTimeInterval) | startTime | |
preloadTime: | (NSTimeInterval) | preloadTime | |
activeTrackIDs: | (NSArray< NSNumber * > *__nullable) | activeTrackIDs | |
customData: | (id __nullable) | customData | |
使用指定屬性建構新的 GCKMediaQueueItem。
詳情請參閱對應屬性的說明文件。
- Parameters
-
mediaInformation The media information for the item. autoplay The autoplay state for this item. startTime The start time of the item, in seconds. May be kGCKInvalidTimeInterval if this item refers to a live stream or if the default start time should be used. preloadTime The preload time for the item, in seconds. May be kGCKInvalidTimeInterval to indicate no preload time. activeTrackIDs The active track IDs for the item. May be nil
.customData Any custom data to associate with the item. May be nil
.
- (instancetype) initWithMediaInformation: | (GCKMediaInformation *) | mediaInformation | |
autoplay: | (BOOL) | autoplay | |
startTime: | (NSTimeInterval) | startTime | |
playbackDuration: | (NSTimeInterval) | playbackDuration | |
preloadTime: | (NSTimeInterval) | preloadTime | |
activeTrackIDs: | (NSArray< NSNumber * > *__nullable) | activeTrackIDs | |
customData: | (id __nullable) | customData | |
指定初始化器。
使用指定屬性建構新的 GCKMediaQueueItem。詳情請參閱對應屬性的說明文件。
- Parameters
-
mediaInformation The media information for the item. autoplay The autoplay state for this item. startTime The start time of the item, in seconds. May be kGCKInvalidTimeInterval if this item refers to a live stream or if the default start time should be used. playbackDuration The playback duration of the item, in seconds. May be kGCKInvalidTimeInterval to indicate no preload time. preloadTime The preload time for the item, in seconds. activeTrackIDs The active track IDs for the item. May be nil
.customData Any custom data to associate with the item. May be nil
.
- (void) clearItemID |
清除 (取消指派) 項目 ID。
應呼叫此方法,以便重複使用現有執行個體,例如將執行個體加回佇列。
- (instancetype) mediaQueueItemModifiedWithBlock: | (void(^)(GCKMediaQueueItemBuilder *builder)) | block |
傳回這個 GCKMediaQueueItem 的副本,該副本已由指定區塊修改。
- Parameters
-
block A block that receives a GCKMediaQueueItemBuilder which can be used to modify attributes of the copy. It is not necessary to call the builder's build (GCKMediaQueueItemBuilder) method within the block, as this method will do that automatically when the block completes.
- 傳回
- 這個項目的修改副本。
資源詳細資料
|
readnonatomicstrong |
與這個項目相關聯的媒體資訊。
|
readnonatomicassign |
項目 ID,或尚未指派 ID 時為 kGCKMediaQueueInvalidItemID。
|
readnonatomicassign |
項目是否應在成為佇列中的目前項目時自動開始播放。
如為 NO
,佇列會在到達這個項目時暫停。預設值為 YES
。
|
readnonatomicassign |
項目的開始時間 (以秒為單位)。
預設值為 kGCKInvalidTimeInterval,表示尚未設定開始時間。
|
readnonatomicassign |
項目播放時間長度 (以秒為單位),或 INFINITY
(如果應使用串流的實際時間長度)。
|
readnonatomicassign |
接收器應開始預先載入這個項目的時間,以秒為單位,表示距離前一個項目結束的時間長度。
預設值為 kGCKInvalidTimeInterval,表示未設定預先載入時間。
|
readnonatomicstrong |
這個項目的有效曲目 ID。
|
readnonatomicstrong |
與這個項目相關聯的自訂資料 (如有)。