【发布时间】:2017-02-16 12:39:59
【问题描述】:
如何使用 dailymotion api 获取进度文件上传? 是否可以获取进度文件上传的百分比?
我正在使用 ajax jquery。
$.ajax({
type: "POST",
url: 'http://localhost:81/video_api/api_bridge/requestUrl',
/*this section to accessed uploadFile()*/
data:{
'path':'/home/rizky/Downloads/114.mkv',
},
success: function(result) {
setInterval(function(){
$.get(result.progress,
function(data) {
console.log(data);
/*this section, to updating <progress/> element.*/
}
);
},1200)
console.log(result);
/*this section to accessed post('/me/videos')*/
$.ajax({
type: "POST",
url: 'http://localhost:81/video_api/api_bridge/post_to_dailymotion',
data:{
'path':'/home/rizky/Downloads/114.mkv',
'title':'privasi',
'publish_status':true,
'playlist':'',
'private_mode':true,
'description':'',
'upload_url':result.url,
'tags':'',
},
success: function(result) {
console.log(result)
$('.loadeng').css('display','none')
},
error: function(aaa){
console.log(aaa)
console.log(aaa.responseText)
}
});
},
error: function(aaa){
console.log(aaa)
console.log(aaa.responseText)
}
});
然后,我想在<progress> 上显示百分比值进度
元素。
但是progress_url 的 API 只是给了我返回消息state done 或 starting 而不是百分比值进度。
谢谢,问候。
【问题讨论】:
标签: php jquery dailymotion-api