Visão geral
Uma subclasse GCKCastChannel para operações de controle de mídia.
Qualquer operação que se aplique a um stream ativo no momento (reproduzir, pausar, buscar, parar etc.) exige um status de mídia válido (ou seja, não nulo). Caso contrário, ela vai retornar kGCKInvalidRequestID e não enviará a solicitação. Um status de mídia é solicitado automaticamente quando o canal se conecta, é incluído em uma resposta de carregamento concluído bem-sucedida e também pode ser atualizado a qualquer momento. O status da mídia também pode ficar nulo a qualquer momento. Isso acontece se o canal for desconectado temporariamente, por exemplo. Ao usar esse canal, as mudanças de status da mídia precisam ser monitoradas pelo callback mediaControlChannelDidUpdateStatus: (GCKMediaControlChannelDelegate-p), e os métodos que atuam em streams só podem ser chamados enquanto o status da mídia não for nulo.
Se uma solicitação for iniciada com sucesso, o método correspondente vai retornar o ID atribuído a ela. Se a solicitação não for iniciada, o método vai retornar kGCKInvalidRequestID e definir a propriedade lastError para indicar o motivo da falha. Se uma solicitação for iniciada com sucesso, mas falhar, o callback mediaControlChannel:requestDidFailWithID:error: (GCKMediaControlChannelDelegate-p) será invocado para indicar a falha.
Consulte GCKMediaControlChannelDelegate para conferir o protocolo de delegação.
- Deprecated:
- Use a propriedade GCKRemoteMediaClient do GCKCastSession para controlar a reprodução de mídia.
Herda GCKCastChannel.
Resumo do método de instância | |
(instancetype) | - init |
Inicializador designado. Mais... | |
(NSInteger) | - loadMedia: |
Carrega e inicia a reprodução de um novo item de mídia. Mais... | |
(NSInteger) | - loadMedia:autoplay: |
Carrega e, opcionalmente, inicia a reprodução de um novo item de mídia. Mais... | |
(NSInteger) | - loadMedia:autoplay:playPosition: |
Carrega e, opcionalmente, inicia a reprodução de um novo item de mídia. Mais... | |
(NSInteger) | - loadMedia:autoplay:playPosition:customData: |
Carrega e, opcionalmente, inicia a reprodução de um novo item de mídia. Mais... | |
(NSInteger) | - loadMedia:autoplay:playPosition:activeTrackIDs: |
Carrega e, opcionalmente, inicia a reprodução de um novo item de mídia. Mais... | |
(NSInteger) | - loadMedia:autoplay:playPosition:activeTrackIDs:customData: |
Carrega e, opcionalmente, inicia a reprodução de um novo item de mídia. Mais... | |
(NSInteger) | - setActiveTrackIDs: |
Define as faixas ativas. Mais... | |
(NSInteger) | - setTextTrackStyle: |
Define o estilo da faixa de texto. Mais... | |
(NSInteger) | - pause |
Pausa a reprodução do item de mídia atual. Mais... | |
(NSInteger) | - pauseWithCustomData: |
Pausa a reprodução do item de mídia atual. Mais... | |
(NSInteger) | - stop |
Interrompe a reprodução do item de mídia atual. Mais... | |
(NSInteger) | - stopWithCustomData: |
Interrompe a reprodução do item de mídia atual. Mais... | |
(NSInteger) | - play |
Inicia (ou retoma) a reprodução do item de mídia atual. Mais... | |
(NSInteger) | - playWithCustomData: |
Inicia (ou retoma) a reprodução do item de mídia atual. Mais... | |
(NSInteger) | - seekToTimeInterval: |
Procura uma nova posição no item de mídia atual. Mais... | |
(NSInteger) | - seekToTimeInterval:resumeState: |
Procura uma nova posição no item de mídia atual. Mais... | |
(NSInteger) | - seekToTimeInterval:resumeState:customData: |
Procura uma nova posição no item de mídia atual. Mais... | |
(NSInteger) | - queueLoadItems:startIndex:repeatMode: |
Carrega e, opcionalmente, inicia a reprodução de uma nova fila de itens de mídia. Mais... | |
(NSInteger) | - queueLoadItems:startIndex:repeatMode:customData: |
Carrega e, opcionalmente, inicia a reprodução de uma nova fila de itens de mídia. Mais... | |
(NSInteger) | - queueLoadItems:startIndex:playPosition:repeatMode:customData: |
Carrega e, opcionalmente, inicia a reprodução de uma nova fila de itens de mídia. Mais... | |
(NSInteger) | - queueInsertItems:beforeItemWithID: |
Insere uma lista de novos itens de mídia na fila. Mais... | |
(NSInteger) | - queueInsertItems:beforeItemWithID:customData: |
Insere uma lista de novos itens de mídia na fila. Mais... | |
(NSInteger) | - queueInsertItem:beforeItemWithID: |
Um método prático que insere um único item na fila. Mais... | |
(NSInteger) | - queueInsertAndPlayItem:beforeItemWithID: |
Um método de conveniência que insere um único item na fila e o torna o item atual. Mais... | |
(NSInteger) | - queueInsertAndPlayItem:beforeItemWithID:playPosition:customData: |
Um método de conveniência que insere um único item na fila e o torna o item atual. Mais... | |
(NSInteger) | - queueUpdateItems: |
Atualiza a fila. Mais... | |
(NSInteger) | - queueUpdateItems:customData: |
Atualiza a fila. Mais... | |
(NSInteger) | - queueRemoveItemsWithIDs: |
Remove uma lista de itens de mídia da fila. Mais... | |
(NSInteger) | - queueRemoveItemsWithIDs:customData: |
Remove uma lista de itens de mídia da fila. Mais... | |
(NSInteger) | - queueRemoveItemWithID: |
Um método prático que remove um único item da fila. Mais... | |
(NSInteger) | - queueReorderItemsWithIDs:insertBeforeItemWithID: |
Reordena uma lista de itens de mídia na fila. Mais... | |
(NSInteger) | - queueReorderItemsWithIDs:insertBeforeItemWithID:customData: |
Reordena uma lista de itens de mídia na fila. Mais... | |
(NSInteger) | - queueMoveItemWithID:beforeItemWithID: |
Um método prático que move um único item na fila. Mais... | |
(NSInteger) | - queueJumpToItemWithID: |
Pula para o item com o ID especificado na fila. Mais... | |
(NSInteger) | - queueJumpToItemWithID:customData: |
Pula para o item com o ID especificado na fila. Mais... | |
(NSInteger) | - queueJumpToItemWithID:playPosition:customData: |
Pula para o item com o ID especificado na fila. Mais... | |
(NSInteger) | - queueNextItem |
Passa para o próximo item na fila. Mais... | |
(NSInteger) | - queuePreviousItem |
Vai para o item anterior na fila. Mais... | |
(NSInteger) | - queueSetRepeatMode: |
Define o modo de repetição da fila. Mais... | |
(NSInteger) | - setStreamVolume: |
Define o volume da transmissão. Mais... | |
(NSInteger) | - setStreamVolume:customData: |
Define o volume da transmissão. Mais... | |
(NSInteger) | - setStreamMuted: |
Define se o stream está sem som. Mais... | |
(NSInteger) | - setStreamMuted:customData: |
Define se o stream está sem som. Mais... | |
(NSInteger) | - requestStatus |
Solicita informações atualizadas sobre o status da mídia do receptor. Mais... | |
(NSTimeInterval) | - approximateStreamPosition |
Retorna a posição aproximada da transmissão, calculada com base nas últimas informações recebidas e no tempo decorrido desde a atualização. Mais... | |
(BOOL) | - cancelRequestWithID: |
Cancela uma solicitação em andamento. Mais... | |
(instancetype) | - initWithNamespace: |
Inicializador designado. Mais... | |
(void) | - didReceiveTextMessage: |
Chamado quando uma mensagem de texto é recebida neste canal. Mais... | |
(BOOL) | - sendTextMessage: |
Envia uma mensagem de texto neste canal. Mais... | |
(BOOL) | - sendTextMessage:error: |
Envia uma mensagem de texto neste canal. Mais... | |
(NSInteger) | - generateRequestID |
Gera um ID de solicitação para uma nova mensagem. Mais... | |
(NSNumber *__nullable) | - generateRequestNumber |
Um método prático que encapsula o resultado de generateRequestID em um NSNumber. Mais... | |
(void) | - didConnect |
Chamado quando o canal é conectado, indicando que as mensagens podem ser trocadas com o dispositivo Google Cast por ele. Mais... | |
(void) | - didDisconnect |
Chamado quando este canal é desconectado, indicando que as mensagens não podem mais ser trocadas com o dispositivo Cast por ele. Mais... | |
Resumo da propriedade | |
GCKMediaStatus * | mediaStatus |
O status da mídia carregada no momento, se houver. Caso contrário, nil . Mais... | |
NSTimeInterval | timeSinceLastMediaStatusUpdate |
A quantidade de tempo que passou desde que a última atualização do status da mídia foi recebida. Mais... | |
GCKError * | lastError |
O detalhe do erro da última solicitação, se houver, ou nil se a última solicitação foi bem-sucedida. Mais... | |
id< GCKMediaControlChannelDelegate > | delegate |
O delegado para receber notificações sobre mudanças no estado do canal. Mais... | |
NSString * | protocolNamespace |
O namespace do canal. Mais... | |
BOOL | isConnected |
Uma flag que indica se o canal está conectado no momento. Mais... | |
GCKDeviceManager * | deviceManager |
O gerenciador de dispositivos em que este canal está registrado, se houver. Mais... | |
Detalhes do método
- (instancetype) init |
Inicializador designado.
Implementa GCKCastChannel.
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo |
Carrega e inicia a reprodução de um novo item de mídia.
- Parameters
-
mediaInfo An object describing the media item to load.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
Carrega e, opcionalmente, inicia a reprodução de um novo item de mídia.
- Parameters
-
mediaInfo An object describing the media item to load. autoplay Whether playback should start immediately.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
playPosition: | (NSTimeInterval) | playPosition | |
Carrega e, opcionalmente, inicia a reprodução de um novo item de mídia.
- Parameters
-
mediaInfo An object describing the media item to load. autoplay Whether playback should start immediately. playPosition The initial playback position.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
playPosition: | (NSTimeInterval) | playPosition | |
customData: | (id __nullable) | customData | |
Carrega e, opcionalmente, inicia a reprodução de um novo item de mídia.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
playPosition: | (NSTimeInterval) | playPosition | |
activeTrackIDs: | (NSArray< NSNumber * > *__nullable) | activeTrackIDs | |
Carrega e, opcionalmente, inicia a reprodução de um novo item de mídia.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) loadMedia: | (GCKMediaInformation *) | mediaInfo | |
autoplay: | (BOOL) | autoplay | |
playPosition: | (NSTimeInterval) | playPosition | |
activeTrackIDs: | (NSArray< NSNumber * > *__nullable) | activeTrackIDs | |
customData: | (id __nullable) | customData | |
Carrega e, opcionalmente, inicia a reprodução de um novo item de mídia.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) setActiveTrackIDs: | (NSArray< NSNumber * > *__nullable) | activeTrackIDs |
Define as faixas ativas.
A solicitação vai falhar se não houver um status de mídia atual.
- Parameters
-
activeTrackIDs An array of integers specifying the active tracks.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada. Pode ser
nil
ou uma matriz vazia para definir as faixas ativas como a lista vazia.
- (NSInteger) setTextTrackStyle: | (GCKMediaTextTrackStyle *__nullable) | textTrackStyle |
Define o estilo da faixa de texto.
A solicitação vai falhar se não houver um status de mídia atual.
- Parameters
-
textTrackStyle The text track style. The style will not be changed if this is nil
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) pause |
Pausa a reprodução do item de mídia atual.
A solicitação vai falhar se não houver um status de mídia atual.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) pauseWithCustomData: | (id __nullable) | customData |
Pausa a reprodução do item de mídia atual.
A solicitação vai falhar se não houver um status de mídia atual.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) stop |
Interrompe a reprodução do item de mídia atual.
A solicitação vai falhar se não houver um status de mídia atual. Se uma fila estiver carregada, ela será removida.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) stopWithCustomData: | (id __nullable) | customData |
Interrompe a reprodução do item de mídia atual.
A solicitação vai falhar se não houver um status de mídia atual. Se uma fila estiver carregada, ela será removida.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) play |
Inicia (ou retoma) a reprodução do item de mídia atual.
A reprodução sempre começa no início da transmissão. A solicitação vai falhar se não houver um status de mídia atual.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) playWithCustomData: | (id __nullable) | customData |
Inicia (ou retoma) a reprodução do item de mídia atual.
A reprodução sempre começa no início da transmissão. A solicitação vai falhar se não houver um status de mídia atual.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) seekToTimeInterval: | (NSTimeInterval) | position |
Procura uma nova posição no item de mídia atual.
A solicitação vai falhar se não houver um status de mídia atual.
- Parameters
-
position The new position from the beginning of the stream.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) seekToTimeInterval: | (NSTimeInterval) | position | |
resumeState: | (GCKMediaControlChannelResumeState) | resumeState | |
Procura uma nova posição no item de mídia atual.
A solicitação vai falhar se não houver um status de mídia atual.
- Parameters
-
position The new position interval from the beginning of the stream. resumeState The action to take after the seek operation has finished.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) seekToTimeInterval: | (NSTimeInterval) | position | |
resumeState: | (GCKMediaControlChannelResumeState) | resumeState | |
customData: | (id __nullable) | customData | |
Procura uma nova posição no item de mídia atual.
A solicitação vai falhar se não houver um status de mídia atual.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) queueLoadItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
startIndex: | (NSUInteger) | startIndex | |
repeatMode: | (GCKMediaRepeatMode) | repeatMode | |
Carrega e, opcionalmente, inicia a reprodução de uma nova fila de itens de mídia.
- 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.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueLoadItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
startIndex: | (NSUInteger) | startIndex | |
repeatMode: | (GCKMediaRepeatMode) | repeatMode | |
customData: | (id __nullable) | customData | |
Carrega e, opcionalmente, inicia a reprodução de uma nova fila de itens de mídia.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueLoadItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
startIndex: | (NSUInteger) | startIndex | |
playPosition: | (NSTimeInterval) | playPosition | |
repeatMode: | (GCKMediaRepeatMode) | repeatMode | |
customData: | (id __nullable) | customData | |
Carrega e, opcionalmente, inicia a reprodução de uma nova fila de itens de mídia.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueInsertItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
Insere uma lista de novos itens de mídia na fila.
- 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.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueInsertItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
customData: | (id __nullable) | customData | |
Insere uma lista de novos itens de mídia na fila.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueInsertItem: | (GCKMediaQueueItem *) | item | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
Um método prático que insere um único item na fila.
- 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.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueInsertAndPlayItem: | (GCKMediaQueueItem *) | item | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
Um método de conveniência que insere um único item na fila e o torna o item atual.
- 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.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueInsertAndPlayItem: | (GCKMediaQueueItem *) | item | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
playPosition: | (NSTimeInterval) | playPosition | |
customData: | (id __nullable) | customData | |
Um método de conveniência que insere um único item na fila e o torna o item atual.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueUpdateItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems |
Atualiza a fila.
- Parameters
-
queueItems The list of updated items.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueUpdateItems: | (NSArray< GCKMediaQueueItem * > *) | queueItems | |
customData: | (id __nullable) | customData | |
Atualiza a fila.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueRemoveItemsWithIDs: | (NSArray< NSNumber * > *) | itemIDs |
Remove uma lista de itens de mídia da fila.
Se a fila ficar vazia como resultado, a sessão de mídia atual será encerrada.
- Parameters
-
itemIDs An array of media item IDs identifying the items to remove. Must not be nil
or empty.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueRemoveItemsWithIDs: | (NSArray< NSNumber * > *) | itemIDs | |
customData: | (id __nullable) | customData | |
Remove uma lista de itens de mídia da fila.
Se a fila ficar vazia como resultado, a sessão de mídia atual será encerrada.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueRemoveItemWithID: | (NSUInteger) | itemID |
Um método prático que remove um único item da fila.
- Parameters
-
itemID The ID of the item to remove.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueReorderItemsWithIDs: | (NSArray< NSNumber * > *) | queueItemIDs | |
insertBeforeItemWithID: | (NSUInteger) | beforeItemID | |
Reordena uma lista de itens de mídia na fila.
- 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.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueReorderItemsWithIDs: | (NSArray< NSNumber * > *) | queueItemIDs | |
insertBeforeItemWithID: | (NSUInteger) | beforeItemID | |
customData: | (id __nullable) | customData | |
Reordena uma lista de itens de mídia na fila.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueMoveItemWithID: | (NSUInteger) | itemID | |
beforeItemWithID: | (NSUInteger) | beforeItemID | |
Um método prático que move um único item na fila.
- 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.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) queueJumpToItemWithID: | (NSUInteger) | itemID |
Pula para o item com o ID especificado na fila.
- Parameters
-
itemID The ID of the item to jump to.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) queueJumpToItemWithID: | (NSUInteger) | itemID | |
customData: | (id __nullable) | customData | |
Pula para o item com o ID especificado na fila.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) queueJumpToItemWithID: | (NSUInteger) | itemID | |
playPosition: | (NSTimeInterval) | playPosition | |
customData: | (id __nullable) | customData | |
Pula para o item com o ID especificado na fila.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) queueNextItem |
Passa para o próximo item na fila.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) queuePreviousItem |
Vai para o item anterior na fila.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) queueSetRepeatMode: | (GCKMediaRepeatMode) | repeatMode |
Define o modo de repetição da fila.
- Parameters
-
repeatMode The new repeat mode.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada ou se algum dos parâmetros for inválido.
- (NSInteger) setStreamVolume: | (float) | volume |
Define o volume da transmissão.
A solicitação vai falhar se não houver uma sessão de mídia atual.
- Parameters
-
volume The new volume, in the range [0.0 - 1.0].
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) setStreamVolume: | (float) | volume | |
customData: | (id __nullable) | customData | |
Define o volume da transmissão.
A solicitação vai falhar se não houver uma sessão de mídia atual.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) setStreamMuted: | (BOOL) | muted |
Define se o stream está sem som.
A solicitação vai falhar se não houver uma sessão de mídia atual.
- Parameters
-
muted Whether the stream should be muted or unmuted.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) setStreamMuted: | (BOOL) | muted | |
customData: | (id __nullable) | customData | |
Define se o stream está sem som.
A solicitação vai falhar se não houver uma sessão de mídia atual.
- 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
.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSInteger) requestStatus |
Solicita informações atualizadas sobre o status da mídia do receptor.
- Retorna
- O ID da solicitação ou kGCKInvalidRequestID se a mensagem não puder ser enviada.
- (NSTimeInterval) approximateStreamPosition |
Retorna a posição aproximada da transmissão, calculada com base nas últimas informações recebidas e no tempo decorrido desde a atualização.
Retorna 0 se o canal não estiver conectado ou se nenhuma mídia estiver carregada no momento.
- (BOOL) cancelRequestWithID: | (NSInteger) | requestID |
Cancela uma solicitação em andamento.
O cancelamento de uma solicitação não impede que ela seja executada. Ele apenas indica que o aplicativo de chamada não está mais interessado nos resultados da solicitação. Portanto, qualquer estado associado ao rastreamento da solicitação será limpo.
- Parameters
-
requestID The ID of the request to cancel.
- Retorna
YES
se a solicitação foi cancelada ouNO
se não houver uma solicitação sendo rastreada com o ID fornecido.
- (instancetype) initWithNamespace: | (NSString *) | protocolNamespace |
Inicializador designado.
Cria um novo GCKCastChannel com o namespace especificado.
- Parameters
-
protocolNamespace The namespace.
Implementado em GCKGenericChannel.
- (void) didReceiveTextMessage: | (NSString *) | message |
Chamado quando uma mensagem de texto é recebida neste canal.
A implementação padrão é uma operação nula.
- Parameters
-
message The message.
- (BOOL) sendTextMessage: | (NSString *) | message |
Envia uma mensagem de texto neste canal.
- Parameters
-
message The message.
- Retorna
YES
em caso de sucesso ouNO
se a mensagem não puder ser enviada (porque o canal não está conectado ou porque o buffer de envio está muito cheio no momento).
- Deprecated:
- Use sendTextMessage:error:, que fornece informações detalhadas sobre o erro.
- (BOOL) sendTextMessage: | (NSString *) | message | |
error: | (GCKError *__nullable *__nullable) | error | |
Envia uma mensagem de texto neste canal.
- Parameters
-
message The message. error A pointer at which to store the error result. May be nil
.
- Retorna
YES
em caso de sucesso ouNO
se a mensagem não puder ser enviada.
- (NSInteger) generateRequestID |
Gera um ID de solicitação para uma nova mensagem.
- Retorna
- O ID gerado ou kGCKInvalidRequestID se o canal não estiver conectado no momento.
- (NSNumber * __nullable) generateRequestNumber |
Um método prático que encapsula o resultado de generateRequestID em um NSNumber.
- Retorna
- O ID gerado ou
nil
se o canal não estiver conectado no momento.
- (void) didConnect |
Chamado quando o canal é conectado, indicando que as mensagens podem ser trocadas com o dispositivo Google Cast por ele.
A implementação padrão é uma operação nula.
- (void) didDisconnect |
Chamado quando este canal é desconectado, indicando que as mensagens não podem mais ser trocadas com o dispositivo Cast por ele.
A implementação padrão é uma operação nula.
Detalhes da propriedade
|
readnonatomicstrong |
O status da mídia carregada no momento, se houver. Caso contrário, nil
.
|
readnonatomicassign |
A quantidade de tempo que passou desde que a última atualização do status da mídia foi recebida.
Se uma solicitação de status estiver em andamento, esse valor será 0.
|
readnonatomiccopy |
O detalhe do erro da última solicitação, se houver, ou nil
se a última solicitação foi bem-sucedida.
|
readwritenonatomicweak |
O delegado para receber notificações sobre mudanças no estado do canal.
|
readnonatomiccopyinherited |
O namespace do canal.
|
readnonatomicassigninherited |
Uma flag que indica se o canal está conectado no momento.
|
readnonatomicweakinherited |
O gerenciador de dispositivos em que este canal está registrado, se houver.
- Deprecated:
- Se o canal não tiver sido registrado com a classe GCKDeviceManager descontinuada, o valor será
nil
.