我拼命寻找有关如何获取 zencoder 进度 JSON 响应、将响应中的“进度”变量转换为 javascript 变量并使用它来填充 css 宽度值中的数字的信息。
有关 Zencoder JSON 响应的更多信息,请参见此处:https ://app.zencoder.com/docs/api/jobs/progress
典型输出如下:
{
"state": "processing",
"progress": 32.34567345,
"input": {
"id": 1234,
"state": "finished"
},
"outputs": [
{
"id": 4567,
"state": "processing",
"current_event": "Transcoding",
"current_event_progress": 25.0323,
"progress": 35.23532
},
{
"id": 4568,
"state": "processing",
"current_event": "Uploading",
"current_event_progress": 82.32,
"progress": 95.3223
}
]
}
我想每半秒左右获取一次更新的“进度”值,并用它来填充 Twitter Boostraps 进度条中的宽度值:
<div class="progress progress-striped active">
<div class="bar" style="width: 40%;"></div>
</div>
任何帮助将不胜感激!