概要
キャスト レシーバーでのメディア再生を制御するためのクラス。
このクラスは、非推奨の GCKMediaControlChannel をラップし、同じ機能を提供しますが、より便利な API を備えています。主な違いは次のとおりです。
- 各リクエストは GCKRequest オブジェクトで表され、専用のデリゲートで追跡できます。
- GCKRemoteMediaClient は、単一のデリゲートではなく、複数のリスナーをサポートします。
- 発足
- 3.0
NSObject を継承します。
プロパティの概要 | |
BOOL | connected |
このオブジェクトがセッションに接続されているかどうかを示すフラグ。詳細... | |
GCKMediaStatus * | mediaStatus |
メディア コントロール チャネルから報告された現在のメディア ステータス。詳細... | |
NSTimeInterval | timeSinceLastMediaStatusUpdate |
最後のメディア ステータス更新を受信してから経過した時間。詳細... | |
id< GCKRemoteMediaClientAdInfoParserDelegate > | adInfoParserDelegate |
GCKMediaStatus オブジェクトのカスタムデータから広告ブレーク情報を抽出できるデリゲート。詳細... | |
メソッドの詳細
- (void) addListener: | (id< GCKRemoteMediaClientListener >) | listener |
このオブジェクトのリスナーのリストにリスナーを追加します。
- Parameters
-
listener The listener to add.
- (void) removeListener: | (id< GCKRemoteMediaClientListener >) | listener |
このオブジェクトのリスナーのリストからリスナーを削除します。
- Parameters
-
listener The listener to remove.
- (GCKRequest *) loadMedia: | (GCKMediaInformation *) | mediaInfo |
新しいメディア アイテムを読み込んで再生を開始します。
- Parameters
-
mediaInfo An object describing the media item to load.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
新しいメディア アイテムを読み込み、必要に応じて再生を開始します。
- Parameters
-
mediaInfo An object describing the media item to load. autoplay Whether playback should start immediately.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) setActiveTrackIDs: | (NSArray< NSNumber * > *__nullable) | activeTrackIDs |
アクティブなトラックを設定します。
現在のメディア ステータスがない場合、リクエストは失敗します。
- Parameters
-
activeTrackIDs An array of integers specifying the active tracks. May be empty or nil
to disable any currently active tracks.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) setTextTrackStyle: | (GCKMediaTextTrackStyle *__nullable) | textTrackStyle |
テキスト トラックのスタイルを設定します。
現在のメディア ステータスがない場合、リクエストは失敗します。
- Parameters
-
textTrackStyle The text track style. The style will not be changed if this is nil
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) pause |
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) stop |
現在のメディア アイテムの再生を停止します。
現在読み込まれているキューがある場合は削除されます。現在のメディア ステータスがない場合、リクエストは失敗します。
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) play |
現在のメディア アイテムの再生を開始(または再開)します。
再生は常にストリームの先頭から開始されます。現在のメディア ステータスがない場合、リクエストは失敗します。
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) seekToTimeInterval: | (NSTimeInterval) | position |
現在のメディア アイテム内の新しい位置にシークします。
現在のメディア ステータスがない場合、リクエストは失敗します。
- Parameters
-
position The new position from the beginning of the stream.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) seekToTimeInterval: | (NSTimeInterval) | position | |
resumeState: | (GCKMediaResumeState) | resumeState | |
現在のメディア アイテム内の新しい位置にシークします。
現在のメディア ステータスがない場合、リクエストは失敗します。
- Parameters
-
position The new position interval from the beginning of the stream. resumeState The action to take after the seek operation has finished.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) seekToTimeInterval: | (NSTimeInterval) | position | |
resumeState: | (GCKMediaResumeState) | 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) queueUpdateItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems |
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) queueRemoveItemsWithIDs: | (NSArray< NSNumber * > *) | itemIDs |
キューからメディア アイテムのリストを削除します。
その結果、キューが空になると、現在のメディア セッションは終了します。
- Parameters
-
itemIDs An array of media item IDs identifying the items to remove. Must not be nil
or empty.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) queueRemoveItemWithID: | (NSUInteger) | itemID |
キューから 1 つのアイテムを削除するコンビニエンス メソッド。
- Parameters
-
itemID The ID of the item to remove.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) queueJumpToItemWithID: | (NSUInteger) | itemID |
キュー内の指定された ID のアイテムにジャンプします。
- Parameters
-
itemID The ID of the item to jump to.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) queueNextItem |
キュー内の次のアイテムに移動します。
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) queuePreviousItem |
キュー内の前のアイテムに移動します。
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) queueSetRepeatMode: | (GCKMediaRepeatMode) | repeatMode |
- (GCKRequest *) setStreamVolume: | (float) | volume |
ストリームの音量を設定します。
現在のメディア セッションがない場合、リクエストは失敗します。
- Parameters
-
volume The new volume, in the range [0.0 - 1.0].
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) setStreamMuted: | (BOOL) | muted |
ストリームがミュートされているかどうかを設定します。
現在のメディア セッションがない場合、リクエストは失敗します。
- Parameters
-
muted Whether the stream should be muted or unmuted.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) 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
.
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (GCKRequest *) requestStatus |
レシーバーから更新されたメディア ステータス情報をリクエストします。
- 戻り値
- このリクエストを追跡するための GCKRequest オブジェクト。
- (NSTimeInterval) approximateStreamPosition |
最後に受信したストリーム情報と、その更新以降の経過実時間から計算された、おおよそのストリーム位置を返します。
チャンネルが接続されていない場合、または現在読み込まれているメディアがない場合は 0 を返します。
- (void) notifyDidStartMediaSession |
メディア セッションが開始されるたびに(つまり、新しいメディアがリモート プレーヤーに正常に読み込まれた直後)サブクラスによって呼び出されます。
カテゴリ GCKRemoteMediaClient(Protected) で提供されます。
- (void) notifyDidUpdateMediaStatus |
クライアントの mediaStatus オブジェクトが変更されるたびに、サブクラスによって呼び出されます。
カテゴリ GCKRemoteMediaClient(Protected) で提供されます。
- (void) notifyDidUpdateQueue |
クライアントが管理するメディアキューが変更されるたびに、サブクラスによって呼び出されます。
カテゴリ GCKRemoteMediaClient(Protected) で提供されます。
- (void) notifyDidUpdatePreloadStatus |
クライアントの mediaStatus の GCKMediaStatus::preloadedItemID が変更されるたびに、サブクラスによって呼び出されます。
カテゴリ GCKRemoteMediaClient(Protected) で提供されます。
- (void) notifyDidUpdateMetadata |
メタデータが変更されるたびにサブクラスによって呼び出されます。
カテゴリ GCKRemoteMediaClient(Protected) で提供されます。
プロパティの詳細
|
readnonatomicassign |
このオブジェクトがセッションに接続されているかどうかを示すフラグ。
|
readnonatomicstrong |
メディア コントロール チャネルから報告された現在のメディア ステータス。
|
readnonatomicassign |
メディア ステータスの更新が最後に受信されてからの経過時間。
ステータス リクエストが現在進行中の場合は 0 になります。
|
readwritenonatomicweak |
GCKMediaStatus オブジェクトのカスタムデータから広告ブレーク情報を抽出できるデリゲート。
- Deprecated:
- 代わりに GCKAdBreakStatus を使用してください。