GCKMediaControlChannel クラス

GCKMediaControlChannel クラス リファレンス

概要

メディア コントロール オペレーション用の GCKCastChannel サブクラス。

現在アクティブなストリームに適用されるオペレーション(再生、一時停止、シーク、停止など)では、有効な(つまり、null ではない)メディア ステータスが必要です。そうでない場合、kGCKInvalidRequestID が返され、リクエストは送信されません。メディア ステータスは、チャンネルが接続されると自動的にリクエストされ、読み込み完了の成功応答に含まれます。また、いつでも更新できます。メディア ステータスはいつでも nil になる可能性があります。たとえば、チャンネルが一時的に切断された場合などです。このチャンネルを使用する場合、メディア ステータスの変更は mediaControlChannelDidUpdateStatus: (GCKMediaControlChannelDelegate-p) コールバックでモニタリングし、ストリームを操作するメソッドはメディア ステータスが nil 以外の場合にのみ呼び出す必要があります。

リクエストが正常に開始されると、対応するメソッドは、そのリクエストに割り当てられたリクエスト ID を返します。リクエストの開始に失敗した場合、メソッドは kGCKInvalidRequestID を返し、失敗の理由を示すように lastError プロパティを設定します。リクエストが正常に開始されたものの最終的に失敗した場合、失敗を示すために mediaControlChannel:requestDidFailWithID:error: (GCKMediaControlChannelDelegate-p) コールバックが呼び出されます。

デリゲート プロトコルについては、GCKMediaControlChannelDelegate をご覧ください。

Deprecated:
GCKCastSessionGCKRemoteMediaClient プロパティを使用して、メディアの再生を制御します。

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:
 キューから 1 つのアイテムを削除するコンビニエンス メソッド。詳細...
 
(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
 このチャンネルが切断されたときに呼び出されます。このチャンネルを介して Cast デバイスとメッセージを交換できなくなったことを示します。詳細...
 

プロパティの概要

GCKMediaStatusmediaStatus
 現在読み込まれているメディアのメディア ステータス(存在する場合)。存在しない場合は nil詳細...
 
NSTimeInterval timeSinceLastMediaStatusUpdate
 最後のメディア ステータス更新を受信してから経過した時間。詳細...
 
GCKErrorlastError
 最後のリクエストのエラーの詳細(ある場合)。最後のリクエストが成功した場合は nil詳細...
 
id< GCKMediaControlChannelDelegatedelegate
 チャンネルの状態の変化に関する通知を受け取るためのデリゲート。詳細...
 
NSString * protocolNamespace
 チャンネルの Namespace。詳細...
 
BOOL isConnected
 このチャンネルが現在接続されているかどうかを示すフラグ。詳細...
 
GCKDeviceManagerdeviceManager
 このチャンネルが登録されているデバイス マネージャー(存在する場合)。詳細...
 

メソッドの詳細

- (instancetype) init

指定イニシャライザ。

GCKCastChannel を実装します。

- (NSInteger) loadMedia: (GCKMediaInformation *)  mediaInfo

新しいメディア アイテムを読み込んで再生を開始します。

Parameters
mediaInfoAn object describing the media item to load.
戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay 

新しいメディア アイテムを読み込み、必要に応じて再生を開始します。

Parameters
mediaInfoAn object describing the media item to load.
autoplayWhether playback should start immediately.
戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay
playPosition: (NSTimeInterval)  playPosition 

新しいメディア アイテムを読み込み、必要に応じて再生を開始します。

Parameters
mediaInfoAn object describing the media item to load.
autoplayWhether playback should start immediately.
playPositionThe initial playback position.
戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) loadMedia: (GCKMediaInformation *)  mediaInfo
autoplay: (BOOL)  autoplay
playPosition: (NSTimeInterval)  playPosition
customData: (id __nullable)  customData 

新しいメディア アイテムを読み込み、必要に応じて再生を開始します。

Parameters
mediaInfoAn object describing the media item to load.
autoplayWhether playback should start immediately.
playPositionThe initial playback position.
customDataCustom 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
mediaInfoAn object describing the media item to load.
autoplayWhether playback should start immediately.
playPositionThe initial playback position.
activeTrackIDsAn 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
mediaInfoAn object describing the media item to load.
autoplayWhether playback should start immediately.
playPositionThe initial playback position.
activeTrackIDsAn array of integers specifying the active tracks. May be nil.
customDataCustom 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
activeTrackIDsAn array of integers specifying the active tracks.
戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestIDnil または空の配列にできます。空のリストにアクティブ トラックを設定します。
- (NSInteger) setTextTrackStyle: (GCKMediaTextTrackStyle *__nullable)  textTrackStyle

テキスト トラックのスタイルを設定します。

現在のメディア ステータスがない場合、リクエストは失敗します。

Parameters
textTrackStyleThe text track style. The style will not be changed if this is nil.
戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) pause

現在のメディア アイテムの再生を一時停止します。

現在のメディア ステータスがない場合、リクエストは失敗します。

戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) pauseWithCustomData: (id __nullable)  customData

現在のメディア アイテムの再生を一時停止します。

現在のメディア ステータスがない場合、リクエストは失敗します。

Parameters
customDataCustom 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

現在のメディア アイテムの再生を停止します。

現在のメディア ステータスがない場合、リクエストは失敗します。現在読み込まれているキューがある場合は、削除されます。

戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) stopWithCustomData: (id __nullable)  customData

現在のメディア アイテムの再生を停止します。

現在のメディア ステータスがない場合、リクエストは失敗します。現在読み込まれているキューがある場合は、削除されます。

Parameters
customDataCustom 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

現在のメディア アイテムの再生を開始(または再開)します。

再生は常にストリームの先頭から開始されます。現在のメディア ステータスがない場合、リクエストは失敗します。

戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) playWithCustomData: (id __nullable)  customData

現在のメディア アイテムの再生を開始(または再開)します。

再生は常にストリームの先頭から開始されます。現在のメディア ステータスがない場合、リクエストは失敗します。

Parameters
customDataCustom 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
positionThe new position from the beginning of the stream.
戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) seekToTimeInterval: (NSTimeInterval)  position
resumeState: (GCKMediaControlChannelResumeState resumeState 

現在のメディア アイテム内の新しい位置にシークします。

現在のメディア ステータスがない場合、リクエストは失敗します。

Parameters
positionThe new position interval from the beginning of the stream.
resumeStateThe action to take after the seek operation has finished.
戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) seekToTimeInterval: (NSTimeInterval)  position
resumeState: (GCKMediaControlChannelResumeState resumeState
customData: (id __nullable)  customData 

現在のメディア アイテム内の新しい位置にシークします。

現在のメディア ステータスがない場合、リクエストは失敗します。

Parameters
positionThe new position from the beginning of the stream.
resumeStateThe action to take after the seek operation has finished.
customDataCustom 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
queueItemsAn array of GCKMediaQueueItem instances to load. Must not be nil or empty.
startIndexThe index of the item in the items array that should be played first.
repeatModeThe repeat mode for playing the queue.
戻り値
このリクエストのリクエスト ID。メッセージを送信できなかった場合、またはパラメータが無効な場合は kGCKInvalidRequestID
- (NSInteger) queueLoadItems: (NSArray< GCKMediaQueueItem * > *)  queueItems
startIndex: (NSUInteger)  startIndex
repeatMode: (GCKMediaRepeatMode repeatMode
customData: (id __nullable)  customData 

メディア アイテムの新しいキューを読み込み、必要に応じて再生を開始します。

Parameters
queueItemsAn array of GCKMediaQueueItem instances to load. Must not be nil or empty.
startIndexThe index of the item in the items array that should be played first.
repeatModeThe repeat mode for playing the queue.
customDataCustom 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
queueItemsAn array of GCKMediaQueueItem instances to load. Must not be nil or empty.
startIndexThe index of the item in the items array that should be played first.
playPositionThe 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.
repeatModeThe repeat mode for playing the queue.
customDataCustom 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
queueItemsAn array of GCKMediaQueueItem instances to insert. Must not be nil or empty.
beforeItemIDThe 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
queueItemsAn array of GCKMediaQueueItem instances to insert. Must not be nil or empty.
beforeItemIDID 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.
customDataCustom 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
itemThe item to insert.
beforeItemIDThe 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
itemThe item to insert.
beforeItemIDThe 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
itemThe item to insert.
beforeItemIDThe 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.
playPositionThe 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.
customDataCustom 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
queueItemsThe list of updated items.
戻り値
このリクエストのリクエスト ID。メッセージを送信できなかった場合、またはパラメータが無効な場合は kGCKInvalidRequestID
- (NSInteger) queueUpdateItems: (NSArray< GCKMediaQueueItem * > *)  queueItems
customData: (id __nullable)  customData 

キューを更新します。

Parameters
queueItemsThe list of updated items.
customDataCustom 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
itemIDsAn 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
itemIDsAn array of media item IDs identifying the items to remove. Must not be nil or empty.
customDataCustom 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

キューから 1 つのアイテムを削除するコンビニエンス メソッド。

Parameters
itemIDThe ID of the item to remove.
戻り値
このリクエストのリクエスト ID。メッセージを送信できなかった場合、またはパラメータが無効な場合は kGCKInvalidRequestID
- (NSInteger) queueReorderItemsWithIDs: (NSArray< NSNumber * > *)  queueItemIDs
insertBeforeItemWithID: (NSUInteger)  beforeItemID 

キュー内のメディア アイテムのリストの順序を変更します。

Parameters
queueItemIDsAn array of media item IDs identifying the items to reorder. Must not be nil or empty.
beforeItemIDID 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
queueItemIDsAn array of media item IDs identifying the items to reorder. Must not be nil or empty.
beforeItemIDThe 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.
customDataCustom 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
itemIDThe ID of the item to move.
beforeItemIDThe 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
itemIDThe ID of the item to jump to.
戻り値
このリクエストのリクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) queueJumpToItemWithID: (NSUInteger)  itemID
customData: (id __nullable)  customData 

キュー内の指定された ID のアイテムにジャンプします。

Parameters
itemIDThe ID of the item to jump to.
customDataCustom 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
itemIDThe ID of the item to jump to.
playPositionThe 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.
customDataCustom 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
repeatModeThe new repeat mode.
戻り値
このリクエストのリクエスト ID。メッセージを送信できなかった場合、またはパラメータが無効な場合は kGCKInvalidRequestID
- (NSInteger) setStreamVolume: (float)  volume

ストリームの音量を設定します。

現在のメディア セッションがない場合、リクエストは失敗します。

Parameters
volumeThe new volume, in the range [0.0 - 1.0].
戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) setStreamVolume: (float)  volume
customData: (id __nullable)  customData 

ストリームの音量を設定します。

現在のメディア セッションがない場合、リクエストは失敗します。

Parameters
volumeThe new volume, in the range [0.0 - 1.0].
customDataCustom 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
mutedWhether the stream should be muted or unmuted.
戻り値
リクエスト ID。メッセージを送信できなかった場合は kGCKInvalidRequestID
- (NSInteger) setStreamMuted: (BOOL)  muted
customData: (id __nullable)  customData 

ストリームがミュートされているかどうかを設定します。

現在のメディア セッションがない場合、リクエストは失敗します。

Parameters
mutedWhether the stream should be muted or unmuted.
customDataCustom 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
requestIDThe ID of the request to cancel.
戻り値
リクエストがキャンセルされた場合は
YES、指定された ID で追跡されているリクエストがない場合は NO
- (instancetype) initWithNamespace: (NSString *)  protocolNamespace

指定イニシャライザ。

指定された名前空間を使用して新しい GCKCastChannel を構築します。

Parameters
protocolNamespaceThe namespace.

GCKGenericChannel で実装されています。

- (void) didReceiveTextMessage: (NSString *)  message

このチャンネルでテキスト メッセージを受信したときに呼び出されます。

デフォルトの実装は no-op です。

Parameters
messageThe message.
- (BOOL) sendTextMessage: (NSString *)  message

このチャンネルでテキスト メッセージを送信します。

Parameters
messageThe message.
戻り値
成功した場合は
YES、メッセージを送信できなかった場合は NO(チャンネルが接続されていない、または送信バッファが現在いっぱいであるため)。
Deprecated:
詳細なエラー情報を提供する sendTextMessage:error: を使用します。
- (BOOL) sendTextMessage: (NSString *)  message
error: (GCKError *__nullable *__nullable)  error 

このチャンネルでテキスト メッセージを送信します。

Parameters
messageThe message.
errorA 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 デバイスとメッセージを交換できることを示します。

デフォルトの実装は no-op です。

- (void) didDisconnect

このチャンネルが切断されたときに呼び出されます。このチャンネルを介して Cast デバイスとメッセージを交換できなくなったことを示します。

デフォルトの実装は no-op です。

プロパティの詳細

- (GCKMediaStatus*) mediaStatus
readnonatomicstrong

現在読み込まれているメディアのメディア ステータス(存在する場合)。存在しない場合は nil

- (NSTimeInterval) timeSinceLastMediaStatusUpdate
readnonatomicassign

メディア ステータスの更新が最後に受信されてからの経過時間。

ステータス リクエストが現在進行中の場合は 0 になります。

- (GCKError*) lastError
readnonatomiccopy

最後のリクエストのエラーの詳細(ある場合)。最後のリクエストが成功した場合は nil

- (id<GCKMediaControlChannelDelegate>) delegate
readwritenonatomicweak

チャンネルの状態の変化に関する通知を受け取るためのデリゲート。

- (NSString*) protocolNamespace
readnonatomiccopyinherited

チャンネルの Namespace。

- (BOOL) isConnected
readnonatomicassigninherited

このチャンネルが現在接続されているかどうかを示すフラグ。

- (GCKDeviceManager*) deviceManager
readnonatomicweakinherited

このチャンネルが登録されているデバイス マネージャー(存在する場合)。

Deprecated:
このチャンネルが非推奨の GCKDeviceManager クラスに登録されていない場合、これは nil になります。