GCKMediaQueueItem 類別

GCKMediaQueueItem 類別參考資料

總覽

代表媒體佇列項目的類別。

這個物件的例項不會變更。

這個類別用於傳送端應用程式和接收端應用程式之間的雙向通訊。傳送者會建構這些項目,以便在接收端應用程式中載入或插入媒體項目清單。接收端的 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 的副本,該副本已由指定區塊修改。更多...
 

房源摘要

GCKMediaInformationmediaInformation
 與這個項目相關聯的媒體資訊。更多...
 
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
mediaInformationThe media information for the item.
autoplayThe autoplay state for this item.
startTimeThe 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.
preloadTimeThe preload time for the item, in seconds. May be kGCKInvalidTimeInterval to indicate no preload time.
activeTrackIDsThe active track IDs for the item. May be nil.
customDataAny 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
mediaInformationThe media information for the item.
autoplayThe autoplay state for this item.
startTimeThe 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.
playbackDurationThe playback duration of the item, in seconds. May be kGCKInvalidTimeInterval to indicate no preload time.
preloadTimeThe preload time for the item, in seconds.
activeTrackIDsThe active track IDs for the item. May be nil.
customDataAny custom data to associate with the item. May be nil.
- (void) clearItemID

清除 (取消指派) 項目 ID。

應呼叫此方法,以便重複使用現有執行個體,例如將執行個體加回佇列。

- (instancetype) mediaQueueItemModifiedWithBlock: (void(^)(GCKMediaQueueItemBuilder *builder))  block

傳回這個 GCKMediaQueueItem 的副本,該副本已由指定區塊修改。

Parameters
blockA 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.
傳回
這個項目的修改副本。

資源詳細資料

- (GCKMediaInformation*) mediaInformation
readnonatomicstrong

與這個項目相關聯的媒體資訊。

- (NSUInteger) itemID
readnonatomicassign

項目 ID,或尚未指派 ID 時為 kGCKMediaQueueInvalidItemID

- (BOOL) autoplay
readnonatomicassign

項目是否應在成為佇列中的目前項目時自動開始播放。

如為 NO,佇列會在到達這個項目時暫停。預設值為 YES

- (NSTimeInterval) startTime
readnonatomicassign

項目的開始時間 (以秒為單位)。

預設值為 kGCKInvalidTimeInterval,表示尚未設定開始時間。

- (NSTimeInterval) playbackDuration
readnonatomicassign

項目播放時間長度 (以秒為單位),或 INFINITY (如果應使用串流的實際時間長度)。

- (NSTimeInterval) preloadTime
readnonatomicassign

接收器應開始預先載入這個項目的時間,以秒為單位,表示距離前一個項目結束的時間長度。

預設值為 kGCKInvalidTimeInterval,表示未設定預先載入時間。

- (NSArray<NSNumber *>*) activeTrackIDs
readnonatomicstrong

這個項目的有效曲目 ID。

- (id) customData
readnonatomicstrong

與這個項目相關聯的自訂資料 (如有)。