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

(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...
 
NSUInteger 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 * 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: (NSArray *)  activeTrackIDs
customData: (id)  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 kInvalidTimeInterval 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 kInvalidTimeInterval 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 *)  activeTrackIDs
customData: (id)  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 kInvalidTimeInterval 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 kInvalidTimeInterval 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

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
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] method within the block, as this method will do that automatically when the block completes.
Returns
A modified copy of this item.

Property Documentation

- (GCKMediaInformation*) mediaInformation
readnonatomicstrong

The media information associated with this item.

- (NSUInteger) itemID
readnonatomicassign

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

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

- (NSTimeInterval) startTime
readnonatomicassign

The start time of the item, in seconds.

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

- (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 kInvalidTimeInterval, indicating that no preload time has been set.

- (NSArray*) activeTrackIDs
readnonatomicstrong

The active track IDs for this item.

- (id) customData
readnonatomicstrong

The custom data associated with this item, if any.

Google Cast iOS Sender API Reference v 2.10.1 4691