Obtém URLs de reprodução para um recurso de mídia fornecendo seu ID. Você pode então usar essas URLs para reproduzir o conteúdo de áudio/vídeo com o ApsaraVideo Player ou qualquer player de terceiros, como um player nativo do sistema, player de código aberto ou um player desenvolvido internamente.
Descrição da operação
-
Antes de usar esta API, certifique-se de compreender totalmente os preços e os métodos de cobrança do serviço ApsaraVideo VOD. A reprodução ou o download de conteúdo a partir de uma URL de reprodução do VOD incorrerá em taxas de tráfego de saída. Se um domínio acelerado não estiver configurado, consulte Tráfego de saída. Se um domínio acelerado estiver configurado, consulte Aceleração. Se você ativou a aceleração de transferência entre regiões, taxas adicionais serão aplicadas. Para obter detalhes, consulte Aceleração de transferência.
-
Somente vídeos com um
StatusNormal podem ser reproduzidos. Para obter mais informações sobre o uso e as limitações da URL de reprodução, consulte . -
Se um recurso de mídia não estiver na classe de armazenamento Standard, defina o campo StorageClass do parâmetro PlayConfig de acordo. Para obter mais informações, consulte PlayConfig.
-
Se você encontrar problemas de reprodução, chame a API para verificar as informações do arquivo de origem.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
vod:GetPlayInfo |
get |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| VideoId |
string |
Não |
O ID do recurso de mídia. Apenas um ID é suportado por solicitação. Você pode obter o ID de uma das seguintes maneiras:
|
93ab850b4f654b6e91d24d81d44**** |
| Formats |
string |
Não |
Uma lista separada por vírgulas de formatos de fluxo de mídia a serem recuperados. Valores válidos:
Nota
|
mp4,m3u8 |
| AuthTimeout |
integer |
Não |
O período de validade da URL de reprodução, em segundos.
|
1800 |
| OutputType |
string |
Não |
O tipo de URL de reprodução a ser retornado. Valores válidos:
|
cdn |
| StreamType |
string |
Não |
Uma lista separada por vírgulas de tipos de fluxo de mídia a serem recuperados. Valores válidos:
Se não for especificado, todos os tipos de fluxo disponíveis serão retornados. |
video |
| ReAuthInfo |
string |
Não |
Uma string JSON contendo parâmetros para autenticação secundária de CDN. Use este parâmetro para definir os campos |
{"uid":"12345","rand":"abckljd"} |
| Definition |
string |
Não |
A definição do fluxo de vídeo. Separe várias definições com vírgulas (,). Valores válidos:
Nota
|
LD |
| ResultType |
string |
Não |
O tipo de dados a ser retornado para cada formato e definição. Valores válidos:
|
Single |
| PlayConfig |
string |
Não |
Uma string JSON para configurações personalizadas de reprodução, como a especificação de um domínio de reprodução. Para obter mais informações sobre a estrutura do parâmetro, consulte PlayConfig. Nota
|
{"PlayDomain":"vod.test_domain","XForwardedFor":"yqCD7Fp1uqChoVj/sl/p5Q==","PreviewTime":"20","MtsHlsUriToken":"yqCD7Fp1uqChoVjslp5Q"} |
| AdditionType |
string |
Não |
Defina como danmu para recuperar a URL dos dados de sobreposição de bullet chat (danmaku). Nota
Este parâmetro é eficaz apenas quando |
danmu |
| Trace |
string |
Não |
Informações definidas pelo usuário para uma marca d'água digital.
|
test mark |
| DigitalWatermarkType |
string |
Não |
O tipo da marca d'água digital. Valores válidos:
|
TraceMark |
| CodecName |
string |
Não |
H264 |
|
| ReferenceId |
string |
Não |
Custom ID. Supports letters, digits, hyphens (-), and underscores (_). Length: 6 to 64 characters. Must be unique per user. |
123-123 |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
A resposta. |
||
| RequestId |
string |
O ID da solicitação. |
F552E596-967D-5500-842F-17E6364**** |
| VideoBase |
object |
As informações básicas sobre o arquivo de áudio ou vídeo. |
|
| CreationTime |
string |
A hora em que o arquivo de áudio ou vídeo foi criado. A hora está no formato aaaa-MM-ddTHH:mm:ssZ em UTC. |
2017-06-26T06:38:48Z |
| Status |
string |
O status do arquivo de áudio ou vídeo. Para obter mais informações sobre os valores válidos e descrições, consulte Status: Status de áudio e vídeo. |
Normal |
| VideoId |
string |
O ID do arquivo de áudio ou vídeo. |
93ab850b4f654b6e91d24d81d44**** |
| CoverURL |
string |
A URL da miniatura. Nota
Para obter a URL da miniatura em tempo real após o upload de um vídeo, configure os callbacks do ApsaraVideo VOD. Para obter mais informações, consulte Callback HTTP e Captura de miniatura concluída. |
http://example.aliyundoc.com/sample.jpg?auth_key=2333232-atb**** |
| Duration |
string |
A duração do arquivo de áudio ou vídeo. Unidade: segundos. |
3.1667 |
| Title |
string |
O título do arquivo de áudio ou vídeo. |
Alibaba Cloud VOD |
| MediaType |
string |
O tipo do arquivo de mídia. Valores válidos:
|
video |
| DanMuURL |
string |
A URL dos dados de sobreposição de comentários ao vivo. |
http://example.aliyundoc.com/****?auth_key=abdf2123-6783232**** |
| StorageClass |
string |
A classe de armazenamento do recurso de mídia. Valores válidos:
|
Standard |
| PlayInfoList |
object |
||
| PlayInfo |
array<object> |
As informações de reprodução do fluxo de áudio ou vídeo. |
|
|
object |
Os detalhes do arquivo de áudio ou vídeo. |
||
| CreationTime |
string |
The time when the stream was created. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2022-04-18T07:37:15Z |
| Status |
string |
The status of the media stream. Valid values:
|
Normal |
| Specification |
string |
The specifications of the transcoded output. For more information about the valid values and descriptions, see Specification: Output specifications. |
H264.LD |
| NarrowBandType |
string |
The transcoding type. Valid values:
|
0 |
| Height |
integer |
The height of the media stream. Unit: px. |
640 |
| Bitrate |
string |
The bitrate of the media stream. Unit: Kbps. Nota
Due to the dynamic sharding feature of M3U8, the calculated bitrate may have a drift. |
450.878 |
| ModificationTime |
string |
The time when the stream was last updated. The time is in the yyyy-MM-ddTHH:mm:ssZ format in UTC. |
2022-04-20T06:32:19Z |
| WatermarkId |
string |
The ID of the watermark template associated with the current media stream. |
dgfn26457856**** |
| Encrypt |
integer |
Indicates whether the media stream is encrypted. Valid values:
|
1 |
| Definition |
string |
The definition of the video stream. Valid values are:
|
LD |
| EncryptType |
string |
The encryption type of the media stream. Valid values:
Nota
If the encryption type is |
AliyunVoDEncryption |
| EncryptMode |
string |
The encryption mode of the media stream. Valid values:
Nota
If the encryption mode is License, you can play the stream only using ApsaraVideo Player SDK. |
License |
| StreamType |
string |
The type of the media stream. The value is video for a video stream or audio for an audio-only stream. |
video |
| JobId |
string |
The ID of the transcoding job for the media stream. This ID serves as the unique identifier for the media stream. |
80e9c6580e754a798c3c19c59b16**** |
| Size |
integer |
The size of the media stream. Unit: byte. Nota
Due to the dynamic sharding feature of M3U8, the calculated stream size may have a drift. |
418112 |
| Width |
integer |
The width of the media stream. Unit: px. |
360 |
| Fps |
string |
The frame rate of the media stream. Unit: frames per second. |
25 |
| Duration |
string |
The duration of the media stream. Unit: seconds. |
9.0464 |
| PlayURL |
string |
The playback URL of the video stream. |
https://example.aliyundoc.com/d52ee123f331466aabf6ab32a93d****/a777f9e24e6e47a2a942467d5c38ea37-8ee8e04293c6657fdda282bc422704****.m3u8 |
| Format |
string |
The format of the media stream.
|
m3u8 |
| HDRType |
string |
The High Dynamic Range (HDR) type of the media stream. Valid values:
|
HLG |
| BitDepth |
integer |
The color depth. The value is an integer. |
8 |
| JobType |
integer |
The type of the digital watermark. Valid values:
|
2 |
| JobExt |
string |
The custom watermark information for the copyright watermark. This field is returned only when |
CopyrightMarkTest |
| CodecName |
string |
The encoding type. Valid values:
|
H264 |
Exemplos
Resposta de sucesso
JSON formato
{
"RequestId": "F552E596-967D-5500-842F-17E6364****",
"VideoBase": {
"CreationTime": "2017-06-26T06:38:48Z",
"Status": "Normal",
"VideoId": "93ab850b4f654b6e91d24d81d44****",
"CoverURL": "http://example.aliyundoc.com/sample.jpg?auth_key=2333232-atb****",
"Duration": "3.1667",
"Title": "Alibaba Cloud VOD",
"MediaType": "video",
"DanMuURL": "http://example.aliyundoc.com/****?auth_key=abdf2123-6783232****",
"StorageClass": "Standard"
},
"PlayInfoList": {
"PlayInfo": [
{
"CreationTime": "2022-04-18T07:37:15Z",
"Status": "Normal",
"Specification": "H264.LD",
"NarrowBandType": "0",
"Height": 640,
"Bitrate": "450.878",
"ModificationTime": "2022-04-20T06:32:19Z",
"WatermarkId": "dgfn26457856****",
"Encrypt": 1,
"Definition": "LD",
"EncryptType": "AliyunVoDEncryption",
"EncryptMode": "License",
"StreamType": "video",
"JobId": "80e9c6580e754a798c3c19c59b16****",
"Size": 418112,
"Width": 360,
"Fps": "25",
"Duration": "9.0464",
"PlayURL": "https://example.aliyundoc.com/d52ee123f331466aabf6ab32a93d****/a777f9e24e6e47a2a942467d5c38ea37-8ee8e04293c6657fdda282bc422704****.m3u8",
"Format": "m3u8",
"HDRType": "HLG",
"BitDepth": 8,
"JobType": 2,
"JobExt": "CopyrightMarkTest",
"CodecName": "H264"
}
]
}
}
Códigos de erro
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.