Mengambil URL pemutaran file audio atau video dengan menyediakan ID audio atau video, yang kemudian dapat diputar menggunakan Pemutar Video Apsara atau pemutar pihak ketiga seperti pemutar bawaan sistem, open-source, atau buatan sendiri.
Deskripsi operasi
Sebelum menggunakan operasi ini, pastikan Anda sepenuhnya memahami metode penagihan dan harga ApsaraVideo VOD. Mengunduh langsung atau memutar video dari URL pemutaran ApsaraVideo VOD menimbulkan biaya lalu lintas keluar. Jika tidak ada nama domain yang dipercepat dikonfigurasi, lihat Penagihan lalu lintas keluar penyimpanan. Jika nama domain yang dipercepat dikonfigurasi, lihat Penagihan layanan akselerasi. Jika Anda telah mengaktifkan akselerasi transfer penyimpanan, mengunduh langsung atau memutar video dari URL pemutaran ApsaraVideo VOD juga menimbulkan biaya akselerasi unduhan. Untuk detail penagihan, lihat Penagihan akselerasi transfer penyimpanan.
Hanya video dalam status Normal (nilai bidang Status adalah Normal) yang dapat diputar. Untuk informasi lebih lanjut tentang deskripsi URL pemutaran dan batas penggunaan, lihat Pemutaran audio dan video.
Ketika jenis penyimpanan media adalah penyimpanan non-standar, atur bidang StorageClass dari parameter PlayConfig sesuai kebutuhan. Untuk detailnya, lihat PlayConfig.
Jika pemutaran video tidak normal, panggil operasi GetMezzanineInfo untuk memeriksa apakah informasi file sumber video benar.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
vod:GetPlayInfo |
get |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| VideoId |
string |
No |
ID audio atau video. Hanya satu ID audio atau video yang didukung. Anda dapat memperoleh ID dengan menggunakan metode berikut:
|
93ab850b4f654b6e91d24d81d44**** |
| Formats |
string |
No |
Format aliran media. Pisahkan beberapa format dengan koma (,). Nilai valid:
Catatan
|
mp4,m3u8 |
| AuthTimeout |
integer |
No |
Periode validitas URL pemutaran. Unit: detik.
|
1800 |
| OutputType |
string |
No |
Jenis URL output. Nilai valid:
|
cdn. |
| StreamType |
string |
No |
Jenis aliran media. Pisahkan beberapa jenis dengan koma (,). Nilai valid:
Secara default, aliran dari semua jenis dikembalikan. |
video. |
| ReAuthInfo |
string |
No |
Parameter reotentikasi CDN. Nilainya adalah string JSON. Ketika penandatanganan tipe A diaktifkan untuk otentikasi URL, Anda dapat menggunakan parameter ini untuk mengatur |
{"uid":"12345","rand":"abckljd"} |
| Definition |
string |
No |
Definisi aliran video. Pisahkan beberapa definisi dengan koma (,). Nilai valid:
Catatan
|
LD |
| ResultType |
string |
No |
Jenis data yang dikembalikan. Nilai valid:
|
Single. |
| PlayConfig |
string |
No |
Pengaturan pemutaran kustom. Nilainya adalah string JSON yang mendukung penetapan pengaturan pemutaran nama domain. Untuk detail konstruksi parameter, lihat PlayConfig. Catatan
|
{"PlayDomain":"vod.test_domain","XForwardedFor":"yqCD7Fp1uqChoVj/sl/p5Q==","PreviewTime":"20","MtsHlsUriToken":"yqCD7Fp1uqChoVjslp5Q"} |
| AdditionType |
string |
No |
Mengambil URL data masker layar bullet yang dapat diakses di Tiongkok. Nilai valid: danmu. Catatan
Parameter ini hanya berlaku ketika |
danmu. |
| Trace |
string |
No |
Pengaturan watermark digital kustom.
|
test mark. |
| DigitalWatermarkType |
string |
No |
Jenis watermark digital. Nilai valid:
|
TraceMark. |
| ReferenceId |
string |
No |
A custom ID. It can be 6 to 64 characters in length and can contain lowercase letters, uppercase letters, digits, hyphens (-), and underscores (_). The ID must be unique for each user. |
H264 |
|
No |
ID kustom. Hanya huruf kecil, huruf besar, angka, tanda hubung, dan garis bawah yang didukung. Panjangnya 6 hingga 64 karakter. ID ini unik per pengguna. |
123-123 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Parameter respons. |
||
| RequestId |
string |
ID permintaan. |
F552E596-967D-5500-842F-17E6364**** |
| VideoBase |
object |
Informasi dasar tentang file audio atau video. |
|
| CreationTime |
string |
Waktu saat file audio atau video dibuat. Waktu mengikuti standar ISO 8601 dalam format yyyy-MM-ddTHH:mm:ssZ. Waktu ditampilkan dalam UTC. |
2017-06-26T06:38:48Z |
| Status |
string |
Status file audio atau video. Untuk nilai valid dan deskripsi, lihat Status: status audio dan video. |
Normal. |
| VideoId |
string |
ID audio atau video. |
93ab850b4f654b6e91d24d81d44**** |
| CoverURL |
string |
URL gambar mini file audio atau video. Catatan
Untuk memperoleh URL gambar mini secara real-time setelah mengunggah video, konfigurasikan callback ApsaraVideo VOD. Untuk informasi lebih lanjut, lihat Callback HTTP dan Event SnapshotComplete. |
http://example.aliyundoc.com/sample.jpg?auth_key=2333232-atb**** |
| Duration |
string |
Durasi file audio atau video. Unit: detik. |
3.1667 |
| Title |
string |
Judul file audio atau video. |
Alibaba Cloud VOD. |
| MediaType |
string |
Jenis file media. Nilai valid:
|
video. |
| DanMuURL |
string |
URL data masker layar bullet yang dapat diakses di Tiongkok. |
http://example.aliyundoc.com/****?auth_key=abdf2123-6783232**** |
| StorageClass |
string |
Kelas penyimpanan aset media. Nilai valid:
|
Standard |
| PlayInfoList |
object |
||
| PlayInfo |
array<object> |
Informasi pemutaran (informasi aliran) file audio atau video. |
|
|
object |
Informasi detail tentang file audio atau video. |
||
| 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. Catatan
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:
|
LD |
| EncryptType |
string |
The encryption type of the media stream. Valid values:
Catatan
If the encryption type is |
AliyunVoDEncryption |
| EncryptMode |
string |
The encryption mode of the media stream. Valid values:
Catatan
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. Catatan
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 |
Contoh
Respons sukses
JSONformat
{
"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": "阿里云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"
}
]
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.