GCKMediaQueueItem Class

GCKMediaQueueItem Class Reference

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

Constructs a new GCKMediaQueueItem with the given attributes. More...
Designated initializer. More...
(void) 
Clears (unassigns) the item ID. More...
Returns a copy of this GCKMediaQueueItem that has been modified by the given block. More...

Property Summary

The media information associated with this item. More...
The item ID, or kGCKMediaQueueInvalidItemID if one has not yet been assigned. More...
BOOL 
Whether the item should automatically start playback when it becomes the current item in the queue. More...
NSTimeInterval 
The start time of the item, in seconds. More...
NSTimeInterval 
The playback duration for the item, in seconds, or INFINITY if the stream's actual duration should be used. More...
NSTimeInterval 
How long before the previous item ends, in seconds, before the receiver should start preloading this item. More...
NSArray< NSNumber * > * 
The active track IDs for this item. More...
id 
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

- ( GCKMediaInformation *) mediaInformation
read nonatomic strong

The media information associated with this item.

- ( GCKMediaQueueItemID ) itemID
read nonatomic assign

The item ID, or kGCKMediaQueueInvalidItemID if one has not yet been assigned.

- (BOOL) autoplay
read nonatomic assign

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.

- (NSTimeInterval) startTime
read nonatomic assign

The start time of the item, in seconds.

The default value is kGCKInvalidTimeInterval , indicating that no start time has been set.

- (NSTimeInterval) playbackDuration
read nonatomic assign

The playback duration for the item, in seconds, or INFINITY if the stream's actual duration should be used.

- (NSTimeInterval) preloadTime
read nonatomic assign

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.

- (NSArray<NSNumber *>*) activeTrackIDs
read nonatomic strong

The active track IDs for this item.

- (id) customData
read nonatomic strong

The custom data associated with this item, if any.

Create a Mobile Website
View Site in Mobile | Classic
Share by: