總覽
媒體控制作業的 GCKCastChannel 子類別。
如要對目前有效的串流執行任何操作 (播放、暫停、搜尋、停止等),必須提供有效的 (非空值) 媒體狀態,否則系統會傳回 kGCKInvalidRequestID,且不會傳送要求。頻道連線時會自動要求媒體狀態,並包含在成功完成載入的回應中,且隨時可以更新。媒體狀態也可能隨時變成空值,例如頻道暫時中斷連線時就會發生這種情況。使用這個管道時,應透過 mediaControlChannelDidUpdateStatus: (GCKMediaControlChannelDelegate-p) 回呼監控媒體狀態變化,且只有在媒體狀態為非空值時,才能呼叫對串流執行的動作方法。
如果要求成功啟動,對應的方法會傳回指派給該要求的要求 ID。如果要求無法啟動,這個方法會傳回 kGCKInvalidRequestID,並設定 lastError 屬性,指出失敗原因。如果要求已成功啟動,但最終失敗,系統會叫用 mediaControlChannel:requestDidFailWithID:error: (GCKMediaControlChannelDelegate-p) 回呼來指出失敗。
如需委派通訊協定,請參閱 GCKMediaControlChannelDelegate。
- Deprecated:
- 使用 GCKCastSession 的 GCKRemoteMediaClient 屬性控制媒體播放。
沿用 GCKCastChannel。
執行個體方法摘要 | |
(instancetype) | - init |
指定初始化器。更多... | |
(NSInteger) | - loadMedia: |
載入並開始播放新的媒體項目。更多... | |
(NSInteger) | - loadMedia:autoplay: |
載入新的媒體項目,並視需要開始播放。更多... | |
(NSInteger) | - loadMedia:autoplay:playPosition: |
載入新的媒體項目,並視需要開始播放。更多... | |
(NSInteger) | - loadMedia:autoplay:playPosition:customData: |
載入新的媒體項目,並視需要開始播放。更多... | |
(NSInteger) | - loadMedia:autoplay:playPosition:activeTrackIDs: |
載入新的媒體項目,並視需要開始播放。更多... | |
(NSInteger) | - loadMedia:autoplay:playPosition:activeTrackIDs:customData: |
載入新的媒體項目,並視需要開始播放。更多... | |
(NSInteger) | - setActiveTrackIDs: |
設定有效測試群組。更多... | |
(NSInteger) | - setTextTrackStyle: |
設定文字軌樣式。更多... | |
(NSInteger) | - pause |
暫停播放目前的媒體項目。更多... | |
(NSInteger) | - pauseWithCustomData: |
暫停播放目前的媒體項目。更多... | |
(NSInteger) | - stop |
停止播放目前的媒體項目。更多... | |
(NSInteger) | - stopWithCustomData: |
停止播放目前的媒體項目。更多... | |
(NSInteger) | - play |
開始 (或繼續) 播放目前的媒體項目。更多... | |
(NSInteger) | - playWithCustomData: |
開始 (或繼續) 播放目前的媒體項目。更多... | |
(NSInteger) | - seekToTimeInterval: |
在目前的媒體項目中搜尋新位置。更多... | |
(NSInteger) | - seekToTimeInterval:resumeState: |
在目前的媒體項目中搜尋新位置。更多... | |
(NSInteger) | - seekToTimeInterval:resumeState:customData: |
在目前的媒體項目中搜尋新位置。更多... | |
(NSInteger) | - queueLoadItems:startIndex:repeatMode: |
載入新的媒體項目佇列,並視需要開始播放。更多... | |
(NSInteger) | - queueLoadItems:startIndex:repeatMode:customData: |
載入新的媒體項目佇列,並視需要開始播放。更多... | |
(NSInteger) | - queueLoadItems:startIndex:playPosition:repeatMode:customData: |
載入新的媒體項目佇列,並視需要開始播放。更多... | |
(NSInteger) | - queueInsertItems:beforeItemWithID: |
將新媒體項目清單插入佇列。更多... | |
(NSInteger) | - queueInsertItems:beforeItemWithID:customData: |
將新媒體項目清單插入佇列。更多... | |
(NSInteger) | - queueInsertItem:beforeItemWithID: |
便利方法,可將單一項目插入佇列。更多... | |
(NSInteger) | - queueInsertAndPlayItem:beforeItemWithID: |
便利方法,可將單一項目插入佇列,並設為目前項目。更多... | |
(NSInteger) | - queueInsertAndPlayItem:beforeItemWithID:playPosition:customData: |
便利方法,可將單一項目插入佇列,並設為目前項目。更多... | |
(NSInteger) | - queueUpdateItems: |
更新佇列。更多... | |
(NSInteger) | - queueUpdateItems:customData: |
更新佇列。更多... | |
(NSInteger) | - queueRemoveItemsWithIDs: |
從佇列中移除媒體項目清單。更多... | |
(NSInteger) | - queueRemoveItemsWithIDs:customData: |
從佇列中移除媒體項目清單。更多... | |
(NSInteger) | - queueRemoveItemWithID: |
便利方法,可從佇列中移除單一項目。更多... | |
(NSInteger) | - queueReorderItemsWithIDs:insertBeforeItemWithID: |
重新排序佇列中的媒體項目清單。更多... | |
(NSInteger) | - queueReorderItemsWithIDs:insertBeforeItemWithID:customData: |
重新排序待播清單中的媒體項目。更多... | |
(NSInteger) | - queueMoveItemWithID:beforeItemWithID: |
這個便利方法可移動佇列中的單一項目。更多... | |
(NSInteger) | - queueJumpToItemWithID: |
跳到佇列中具有指定 ID 的項目。更多... | |
(NSInteger) | - queueJumpToItemWithID:customData: |
跳到佇列中具有指定 ID 的項目。更多... | |
(NSInteger) | - queueJumpToItemWithID:playPosition:customData: |
跳到佇列中具有指定 ID 的項目。更多... | |
(NSInteger) | - queueNextItem |
移至佇列中的下一個項目。更多... | |
(NSInteger) | - queuePreviousItem |
移至佇列中的上一個項目。更多... | |
(NSInteger) | - queueSetRepeatMode: |
設定佇列重複模式。更多... | |
(NSInteger) | - setStreamVolume: |
設定串流音量。更多... | |
(NSInteger) | - setStreamVolume:customData: |
設定串流音量。更多... | |
(NSInteger) | - setStreamMuted: |
設定是否將串流設為靜音。更多... | |
(NSInteger) | - setStreamMuted:customData: |
設定是否將串流設為靜音。更多... | |
(NSInteger) | - requestStatus |
向接收端要求更新媒體狀態資訊。更多... | |
(NSTimeInterval) | - approximateStreamPosition |
傳回根據上次收到的串流資訊和自該更新以來經過的實際時間計算出的概略串流位置。更多... | |
(BOOL) | - cancelRequestWithID: |
取消進行中的要求。更多... | |
(instancetype) | - initWithNamespace: |
指定初始化器。更多... | |
(void) | - didReceiveTextMessage: |
當這個管道收到簡訊時,系統會呼叫此方法。更多... | |
(BOOL) | - sendTextMessage: |
在這個管道中傳送簡訊。更多... | |
(BOOL) | - sendTextMessage:error: |
在這個管道中傳送簡訊。更多... | |
(NSInteger) | - generateRequestID |
為新訊息產生要求 ID。更多... | |
(NSNumber *__nullable) | - generateRequestNumber |
這項便利方法會將 generateRequestID 的結果包裝在 NSNumber 中。更多... | |
(void) | - didConnect |
連線至這個管道時呼叫,表示現在可以透過這個管道與 Cast 裝置交換訊息。更多... | |
(void) | - didDisconnect |
Called when this channel has been disconnected, indicating that messages can no longer be exchanged with the Cast device over this channel. 更多... | |
房源摘要 | |
GCKMediaStatus * | mediaStatus |
目前載入媒體的媒體狀態 (如有),否則為 nil 。 更多... | |
NSTimeInterval | timeSinceLastMediaStatusUpdate |
自上次收到媒體狀態更新以來經過的時間量。更多... | |
GCKError * | lastError |
上次要求的錯誤詳細資料 (如有),或上次要求成功時的 nil 。更多... | |
id< GCKMediaControlChannelDelegate > | delegate |
接收頻道狀態變更通知的委派。更多... | |
NSString * | protocolNamespace |
頻道的命名空間。更多... | |
BOOL | isConnected |
這個標記用於指出頻道目前是否已連結。更多... | |
GCKDeviceManager * | deviceManager |
這個頻道註冊的裝置管理員 (如有)。更多... | |
方法詳細資料
- (instancetype) init |
指定初始化器。
實作 GCKCastChannel。
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo |
載入並開始播放新的媒體項目。
- Parameters
-
mediaInfo An object describing the media item to load.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
載入新的媒體項目,並視需要開始播放。
- Parameters
-
mediaInfo An object describing the media item to load. autoplay Whether playback should start immediately.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
playPosition: | (NSTimeInterval) | playPosition | |
載入新的媒體項目,並視需要開始播放。
- Parameters
-
mediaInfo An object describing the media item to load. autoplay Whether playback should start immediately. playPosition The initial playback position.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
playPosition: | (NSTimeInterval) | playPosition | |
customData: | (id __nullable) | customData | |
載入新的媒體項目,並視需要開始播放。
- Parameters
-
mediaInfo An object describing the media item to load. autoplay Whether playback should start immediately. playPosition The initial playback position. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
playPosition: | (NSTimeInterval) | playPosition | |
activeTrackIDs: | (NSArray< NSNumber * > *__nullable) | activeTrackIDs | |
載入新的媒體項目,並視需要開始播放。
- Parameters
-
mediaInfo An object describing the media item to load. autoplay Whether playback should start immediately. playPosition The initial playback position. activeTrackIDs An array of integers specifying the active tracks. May be nil
.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
playPosition: | (NSTimeInterval) | playPosition | |
activeTrackIDs: | (NSArray< NSNumber * > *__nullable) | activeTrackIDs | |
customData: | (id __nullable) | customData | |
載入新的媒體項目,並視需要開始播放。
- Parameters
-
mediaInfo An object describing the media item to load. autoplay Whether playback should start immediately. playPosition The initial playback position. activeTrackIDs An array of integers specifying the active tracks. May be nil
.customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) setActiveTrackIDs: | (NSArray< NSNumber * > *__nullable) | activeTrackIDs |
設定有效測試群組。
如果沒有目前的媒體狀態,要求就會失敗。
- Parameters
-
activeTrackIDs An array of integers specifying the active tracks.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。可以是
nil
,也可以是空陣列,將有效軌道設為空清單。
- (NSInteger) setTextTrackStyle: | (GCKMediaTextTrackStyle *__nullable) | textTrackStyle |
設定文字軌樣式。
如果沒有目前的媒體狀態,要求就會失敗。
- Parameters
-
textTrackStyle The text track style. The style will not be changed if this is nil
.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) pause |
- (NSInteger) pauseWithCustomData: | (id __nullable) | customData |
暫停播放目前的媒體項目。
如果沒有目前的媒體狀態,要求就會失敗。
- Parameters
-
customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) stop |
- (NSInteger) stopWithCustomData: | (id __nullable) | customData |
停止播放目前的媒體項目。
如果沒有目前的媒體狀態,要求就會失敗。如果目前已載入佇列,系統會移除該佇列。
- Parameters
-
customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) play |
- (NSInteger) playWithCustomData: | (id __nullable) | customData |
開始 (或繼續) 播放目前的媒體項目。
播放一律從串流的開頭開始。如果沒有目前的媒體狀態,要求就會失敗。
- Parameters
-
customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) seekToTimeInterval: | (NSTimeInterval) | position |
在目前的媒體項目中搜尋新位置。
如果沒有目前的媒體狀態,要求就會失敗。
- Parameters
-
position The new position from the beginning of the stream.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) seekToTimeInterval: | (NSTimeInterval) | position | |
resumeState: | (GCKMediaControlChannelResumeState) | resumeState | |
在目前的媒體項目中搜尋新位置。
如果沒有目前的媒體狀態,要求就會失敗。
- Parameters
-
position The new position interval from the beginning of the stream. resumeState The action to take after the seek operation has finished.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) seekToTimeInterval: | (NSTimeInterval) | position | |
resumeState: | (GCKMediaControlChannelResumeState) | resumeState | |
customData: | (id __nullable) | customData | |
在目前的媒體項目中搜尋新位置。
如果沒有目前的媒體狀態,要求就會失敗。
- Parameters
-
position The new position from the beginning of the stream. resumeState The action to take after the seek operation has finished. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) queueLoadItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
startIndex: | (NSUInteger) | startIndex | |
repeatMode: | (GCKMediaRepeatMode) | repeatMode | |
載入新的媒體項目佇列,並視需要開始播放。
- Parameters
-
queueItems An array of GCKMediaQueueItem instances to load. Must not be nil
or empty.startIndex The index of the item in the items array that should be played first. repeatMode The repeat mode for playing the queue.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueLoadItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
startIndex: | (NSUInteger) | startIndex | |
repeatMode: | (GCKMediaRepeatMode) | repeatMode | |
customData: | (id __nullable) | customData | |
載入新的媒體項目佇列,並視需要開始播放。
- Parameters
-
queueItems An array of GCKMediaQueueItem instances to load. Must not be nil
or empty.startIndex The index of the item in the items array that should be played first. repeatMode The repeat mode for playing the queue. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueLoadItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
startIndex: | (NSUInteger) | startIndex | |
playPosition: | (NSTimeInterval) | playPosition | |
repeatMode: | (GCKMediaRepeatMode) | repeatMode | |
customData: | (id __nullable) | customData | |
載入新的媒體項目佇列,並視需要開始播放。
- Parameters
-
queueItems An array of GCKMediaQueueItem instances to load. Must not be nil
or empty.startIndex The index of the item in the items array that should be played first. playPosition The initial playback position for the item when it is first played, relative to the beginning of the stream. This value is ignored when the same item is played again, for example when the queue repeats, or the item is later jumped to. In those cases the item's startTime is used. repeatMode The repeat mode for playing the queue. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueInsertItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
將新媒體項目清單插入佇列。
- Parameters
-
queueItems An array of GCKMediaQueueItem instances to insert. Must not be nil
or empty.beforeItemID The ID of the item that will be located immediately after the inserted list. If the value is kGCKMediaQueueInvalidItemID, the inserted list will be appended to the end of the queue.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueInsertItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
customData: | (id __nullable) | customData | |
將新媒體項目清單插入佇列。
- Parameters
-
queueItems An array of GCKMediaQueueItem instances to insert. Must not be nil
or empty.beforeItemID ID of the item that will be located immediately after the inserted list. If the value is kGCKMediaQueueInvalidItemID, the inserted list will be appended to the end of the queue. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueInsertItem: | (GCKMediaQueueItem *) | item | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
便利方法,可將單一項目插入佇列。
- Parameters
-
item The item to insert. beforeItemID The ID of the item that will be located immediately after the inserted item. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the inserted item will be appended to the end of the queue.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueInsertAndPlayItem: | (GCKMediaQueueItem *) | item | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
便利方法,可將單一項目插入佇列,並設為目前項目。
- Parameters
-
item The item to insert. beforeItemID The ID of the item that will be located immediately after the inserted item. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the inserted item will be appended to the end of the queue.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueInsertAndPlayItem: | (GCKMediaQueueItem *) | item | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
playPosition: | (NSTimeInterval) | playPosition | |
customData: | (id __nullable) | customData | |
便利方法,可將單一項目插入佇列,並設為目前項目。
- Parameters
-
item The item to insert. beforeItemID The ID of the item that will be located immediately after the inserted item. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the inserted item will be appended to the end of the queue. playPosition The initial playback position for the item when it is first played, relative to the beginning of the stream. This value is ignored when the same item is played again, for example when the queue repeats, or the item is later jumped to. In those cases the item's startTime is used. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueUpdateItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems |
更新佇列。
- Parameters
-
queueItems The list of updated items.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueUpdateItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
customData: | (id __nullable) | customData | |
更新佇列。
- Parameters
-
queueItems The list of updated items. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueRemoveItemsWithIDs: | (NSArray< NSNumber * > *) | itemIDs |
從待播清單中移除媒體項目清單。
如果佇列因此清空,目前媒體工作階段就會終止。
- Parameters
-
itemIDs An array of media item IDs identifying the items to remove. Must not be nil
or empty.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueRemoveItemsWithIDs: | (NSArray< NSNumber * > *) | itemIDs | |
customData: | (id __nullable) | customData | |
從待播清單中移除媒體項目清單。
如果佇列因此清空,目前媒體工作階段就會終止。
- Parameters
-
itemIDs An array of media item IDs identifying the items to remove. Must not be nil
or empty.customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueRemoveItemWithID: | (NSUInteger) | itemID |
這項便利方法可從佇列中移除單一項目。
- Parameters
-
itemID The ID of the item to remove.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueReorderItemsWithIDs: | (NSArray< NSNumber * > *) | queueItemIDs | |
insertBeforeItemWithID: | (NSUInteger) | beforeItemID | |
重新排序佇列中的媒體項目清單。
- Parameters
-
queueItemIDs An array of media item IDs identifying the items to reorder. Must not be nil
or empty.beforeItemID ID of the item that will be located immediately after the reordered list. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the reordered list will be appended at the end of the queue.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueReorderItemsWithIDs: | (NSArray< NSNumber * > *) | queueItemIDs | |
insertBeforeItemWithID: | (NSUInteger) | beforeItemID | |
customData: | (id __nullable) | customData | |
重新排序待播清單中的媒體項目。
- Parameters
-
queueItemIDs An array of media item IDs identifying the items to reorder. Must not be nil
or empty.beforeItemID The ID of the item that will be located immediately after the reordered list. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the reordered list will be moved to the end of the queue. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueMoveItemWithID: | (NSUInteger) | itemID | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
這個便利方法可移動佇列中的單一項目。
- Parameters
-
itemID The ID of the item to move. beforeItemID The ID of the item that will be located immediately after the reordered list. If the value is kGCKMediaQueueInvalidItemID, or does not refer to any item currently in the queue, the item will be moved to the end of the queue.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) queueJumpToItemWithID: | (NSUInteger) | itemID |
跳到佇列中具有指定 ID 的項目。
- Parameters
-
itemID The ID of the item to jump to.
- 傳回
- 這項要求的 ID,或 kGCKInvalidRequestID (如果無法傳送訊息)。
- (NSInteger) queueJumpToItemWithID: | (NSUInteger) | itemID | |
customData: | (id __nullable) | customData | |
跳到佇列中具有指定 ID 的項目。
- Parameters
-
itemID The ID of the item to jump to. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 這項要求的 ID,或 kGCKInvalidRequestID (如果無法傳送訊息)。
- (NSInteger) queueJumpToItemWithID: | (NSUInteger) | itemID | |
playPosition: | (NSTimeInterval) | playPosition | |
customData: | (id __nullable) | customData | |
跳到佇列中具有指定 ID 的項目。
- Parameters
-
itemID The ID of the item to jump to. playPosition The initial playback position for the item when it is first played, relative to the beginning of the stream. This value is ignored when the same item is played again, for example when the queue repeats, or the item is later jumped to. In those cases the item's startTime is used. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 這項要求的 ID,或 kGCKInvalidRequestID (如果無法傳送訊息)。
- (NSInteger) queueNextItem |
移至佇列中的下一個項目。
- 傳回
- 這項要求的 ID,或 kGCKInvalidRequestID (如果無法傳送訊息)。
- (NSInteger) queuePreviousItem |
移至佇列中的上一個項目。
- 傳回
- 這項要求的 ID,或 kGCKInvalidRequestID (如果無法傳送訊息)。
- (NSInteger) queueSetRepeatMode: | (GCKMediaRepeatMode) | repeatMode |
設定佇列重複模式。
- Parameters
-
repeatMode The new repeat mode.
- 傳回
- 這項要求的 ID,如果無法傳送訊息或任何參數無效,則為 kGCKInvalidRequestID。
- (NSInteger) setStreamVolume: | (float) | volume |
設定串流音量。
如果沒有目前的媒體工作階段,要求就會失敗。
- Parameters
-
volume The new volume, in the range [0.0 - 1.0].
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) setStreamVolume: | (float) | volume | |
customData: | (id __nullable) | customData | |
設定串流音量。
如果沒有目前的媒體工作階段,要求就會失敗。
- Parameters
-
volume The new volume, in the range [0.0 - 1.0]. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) setStreamMuted: | (BOOL) | muted |
設定是否將串流設為靜音。
如果沒有目前的媒體工作階段,要求就會失敗。
- Parameters
-
muted Whether the stream should be muted or unmuted.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) setStreamMuted: | (BOOL) | muted | |
customData: | (id __nullable) | customData | |
設定是否將串流設為靜音。
如果沒有目前的媒體工作階段,要求就會失敗。
- Parameters
-
muted Whether the stream should be muted or unmuted. customData Custom application-specific data to pass along with the request. Must either be an object that can be serialized to JSON using NSJSONSerialization, or nil
.
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSInteger) requestStatus |
向接收端要求更新媒體狀態資訊。
- 傳回
- 要求 ID,或kGCKInvalidRequestID訊息無法傳送。
- (NSTimeInterval) approximateStreamPosition |
傳回根據上次收到的串流資訊和自該更新以來經過的實際時間計算出的概略串流位置。
如果管道未連線或目前未載入任何媒體,則傳回 0。
- (BOOL) cancelRequestWithID: | (NSInteger) | requestID |
取消進行中的要求。
取消要求不會阻止要求執行,只是表示呼叫應用程式不再需要要求結果,因此與追蹤要求相關聯的任何狀態都會清除。
- Parameters
-
requestID The ID of the request to cancel.
- 傳回 如果要求已取消,則為
YES
;如果沒有以指定 ID 追蹤的要求,則為NO
。
- (instancetype) initWithNamespace: | (NSString *) | protocolNamespace |
指定初始化器。
使用指定命名空間建構新的 GCKCastChannel。
- Parameters
-
protocolNamespace The namespace.
實作於 GCKGenericChannel。
- (void) didReceiveTextMessage: | (NSString *) | message |
當這個管道收到簡訊時,系統會呼叫此方法。
預設實作是免人工管理。
- Parameters
-
message The message.
- (BOOL) sendTextMessage: | (NSString *) | message |
透過這個管道傳送簡訊。
- Parameters
-
message The message.
- 傳回 如果訊息無法傳送 (因為管道未連線,或傳送緩衝區目前過於飽和),則為
NO
。YES
- Deprecated:
- 使用 sendTextMessage:error:,其中提供詳細的錯誤資訊。
- (BOOL) sendTextMessage: | (NSString *) | message | |
error: | (GCKError *__nullable *__nullable) | error | |
透過這個管道傳送簡訊。
- Parameters
-
message The message. error A pointer at which to store the error result. May be nil
.
- 傳回 如果訊息傳送成功,系統會顯示
YES
;如果無法傳送,則會顯示NO
。
- (NSInteger) generateRequestID |
為新訊息產生要求 ID。
- 傳回
- 產生的 ID,或 kGCKInvalidRequestID (如果頻道目前未連結)。
- (NSNumber * __nullable) generateRequestNumber |
這項便利方法會將 generateRequestID 的結果包裝在 NSNumber 中。
- 傳回
- 產生的 ID,或
nil
(如果頻道目前未連結)。
- (void) didConnect |
連線至這個管道時呼叫,表示現在可以透過這個管道與 Cast 裝置交換訊息。
預設實作是免人工管理。
- (void) didDisconnect |
這個管道已中斷連線時呼叫,表示無法再透過這個管道與 Cast 裝置交換訊息。
預設實作是免人工管理。
資源詳細資料
|
readnonatomicstrong |
目前載入媒體的媒體狀態 (如有),否則為 nil
。
|
readnonatomicassign |
自上次收到媒體狀態更新以來經過的時間。
如果目前正在處理狀態要求,這個值會是 0。
|
readnonatomiccopy |
上次要求的錯誤詳細資料 (如有),或上次要求成功時的 nil
。
|
readwritenonatomicweak |
接收頻道狀態變更通知的委派。
|
readnonatomiccopyinherited |
頻道的命名空間。
|
readnonatomicassigninherited |
這個標記用於指出頻道目前是否已連結。
|
readnonatomicweakinherited |
這個頻道註冊的裝置管理員 (如有)。
- Deprecated:
- 如果這個管道未向已淘汰的 GCKDeviceManager 類別註冊,則為
nil
。