GCKMediaQueueItem Class Reference

A class representing a media queue item. More...

#import <GCKMediaQueueItem.h>

+ Inheritance diagram for GCKMediaQueueItem:

Instance Methods

(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...
 

Properties

GCKMediaInformationmediaInformation
 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...
 

Detailed Description

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.

Method Documentation

- (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) initWithMediaInformation: (GCKMediaInformation *)  mediaInformation
autoplay: (BOOL)  autoplay
startTime: (NSTimeInterval)  startTime
playbackDuration: (NSTimeInterval)  playbackDuration
preloadTime: (NSTimeInterval)  preloadTime
activeTrackIDs: (NSArray< NSNumber * > *GCK_NULLABLE_TYPE)  activeTrackIDs
customData: (id GCK_NULLABLE_TYPE)  customData 

Designated initializer.

Constructs a new GCKMediaQueueItem with the given attributes. See the documentation of the corresponding properties for more information.

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.
- (instancetype) initWithMediaInformation: (GCKMediaInformation *)  mediaInformation
autoplay: (BOOL)  autoplay
startTime: (NSTimeInterval)  startTime
preloadTime: (NSTimeInterval)  preloadTime
activeTrackIDs: (NSArray< NSNumber * > *GCK_NULLABLE_TYPE)  activeTrackIDs
customData: (id GCK_NULLABLE_TYPE)  customData 

Constructs a new GCKMediaQueueItem with the given attributes.

See the documentation of the corresponding properties for more information.

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) mediaQueueItemModifiedWithBlock: (void(^)(GCKMediaQueueItemBuilder *builder))  block

Returns a copy of this GCKMediaQueueItem that has been modified by the given block.

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.
Returns
A modified copy of this item.

Property Documentation

- (NSArray<NSNumber *>*) activeTrackIDs
readnonatomicstrong

The active track IDs for this item.

- (BOOL) autoplay
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.

- (id) customData
readnonatomicstrong

The custom data associated with this item, if any.

- (GCKMediaQueueItemID) itemID
readnonatomicassign

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

- (GCKMediaInformation*) mediaInformation
readnonatomicstrong

The media information associated with this item.

- (NSTimeInterval) playbackDuration
readnonatomicassign

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

- (NSTimeInterval) preloadTime
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.

- (NSTimeInterval) startTime
readnonatomicassign

The start time of the item, in seconds.

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


The documentation for this class was generated from the following file: