Overview
A class representing a media queue item.
Instances of this object are immutable.
This class is used in two-way communication between a sender application and a receiver application. The sender constructs them to load or insert a list of media items on the receiver application. The GCKMediaStatus from the receiver also contains the list of items represented as instances of this class.
Once loaded, the receiver will assign a unique item ID to each GCKMediaQueueItem, even if the same media gets loaded multiple times.
Inherits NSObject. Implements <NSCopying>.
Instance Method Summary | |
(instancetype) | - initWithMediaInformation:autoplay:startTime:preloadTime:activeTrackIDs:customData: |
Constructs a new GCKMediaQueueItem with the given attributes. More... | |
(instancetype) | - initWithMediaInformation:autoplay:startTime:playbackDuration:preloadTime:activeTrackIDs:customData: |
Designated initializer. More... | |
(void) | - clearItemID |
Clears (unassigns) the item ID. More... | |
(instancetype) | - mediaQueueItemModifiedWithBlock: |
Returns a copy of this GCKMediaQueueItem that has been modified by the given block. More... | |
Property Summary | |
GCKMediaInformation * | mediaInformation |
The media information associated with this item. More... | |
GCKMediaQueueItemID | itemID |
The item ID, or kGCKMediaQueueInvalidItemID if one has not yet been assigned. More... | |
BOOL | autoplay |
Whether the item should automatically start playback when it becomes the current item in the queue. More... | |
NSTimeInterval | startTime |
The start time of the item, in seconds. More... | |
NSTimeInterval | playbackDuration |
The playback duration for the item, in seconds, or INFINITY if the stream's actual duration should be used. More... | |
NSTimeInterval | preloadTime |
How long before the previous item ends, in seconds, before the receiver should start preloading this item. More... | |
NSArray< NSNumber * > * | activeTrackIDs |
The active track IDs for this item. More... | |
id | customData |
The custom data associated with this item, if any. More... | |
Method Detail
- (instancetype) initWithMediaInformation: | (GCKMediaInformation *) | mediaInformation | |
autoplay: | (BOOL) | autoplay | |
startTime: | (NSTimeInterval) | startTime | |
preloadTime: | (NSTimeInterval) | preloadTime | |
activeTrackIDs: | (nullable NSArray< NSNumber * > *) | activeTrackIDs | |
customData: | (nullable id) | customData | |
Constructs a new GCKMediaQueueItem with the given attributes.
See the documentation of the corresponding properties for more information.
- 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: | (nullable NSArray< NSNumber * > *) | activeTrackIDs | |
customData: | (nullable id) | customData | |
Designated initializer.
Constructs a new GCKMediaQueueItem with the given attributes. See the documentation of the corresponding properties for more information.
- 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 |
Clears (unassigns) the item ID.
Should be called in order to reuse an existing instance, for example, to add it back to a queue.
- (instancetype) mediaQueueItemModifiedWithBlock: | (void(^)(GCKMediaQueueItemBuilder *builder)) | block |
Returns a copy of this GCKMediaQueueItem that has been modified by the given block.
- 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.
- Returns
- A modified copy of this item.
Property Detail
|
readnonatomicstrong |
The media information associated with this item.
|
readnonatomicassign |
The item ID, or kGCKMediaQueueInvalidItemID if one has not yet been assigned.
|
readnonatomicassign |
Whether the item should automatically start playback when it becomes the current item in the queue.
If NO
, the queue will pause when it reaches this item. The default value is YES
. When using this item to load a media queue in GCKMediaLoadRequestData, this property in the first item only takes effect if autoplay
in GCKMediaLoadRequestData is nil.
|
readnonatomicassign |
The start time of the item, in seconds.
The default value is kGCKInvalidTimeInterval, indicating that no start time has been set.
|
readnonatomicassign |
The playback duration for the item, in seconds, or INFINITY
if the stream's actual duration should be used.
|
readnonatomicassign |
How long before the previous item ends, in seconds, before the receiver should start preloading this item.
The default value is kGCKInvalidTimeInterval, indicating that no preload time has been set.
|
readnonatomicstrong |
The active track IDs for this item.
|
readnonatomicstrong |
The custom data associated with this item, if any.