Php 进展Url dailymotion api
如何使用dailymotion api获取上传进度文件? 是否可以获取上传进度文件的百分比 我正在使用ajax jqueryPhp 进展Url dailymotion api,php,jquery,dailymotion-api,Php,Jquery,Dailymotion Api,如何使用dailymotion api获取上传进度文件? 是否可以获取上传进度文件的百分比 我正在使用ajax jquery $.ajax({ type: "POST", url: 'http://localhost:81/video_api/api_bridge/requestUrl', /*this section to accessed uploadFile()*/ data:{
$.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)
}
});
$.ajax({
类型:“POST”,
网址:'http://localhost:81/video_api/api_bridge/requestUrl',
/*本节将访问uploadFile()*/
数据:{
“路径”:“/home/rizky/Downloads/114.mkv”,
},
成功:功能(结果){
setInterval(函数(){
$.get(result.progress,
功能(数据){
控制台日志(数据);
/*本节介绍如何更新元素*/
}
);
},1200)
控制台日志(结果);
/*此部分可访问帖子(“/me/videos”)*/
$.ajax({
类型:“POST”,
网址:'http://localhost:81/video_api/api_bridge/post_to_dailymotion',
数据:{
“路径”:“/home/rizky/Downloads/114.mkv”,
“标题”:“privasi”,
“发布状态”:true,
“播放列表”:“,
“私有模式”:true,
“描述”:“,
“上载url”:result.url,
“标签”:“,
},
成功:功能(结果){
console.log(结果)
$('.loadeng').css('display','none'))
},
错误:函数(aaa){
控制台日志(aaa)
console.log(aaa.responseText)
}
});
},
错误:函数(aaa){
控制台日志(aaa)
console.log(aaa.responseText)
}
});
然后,我想显示
元素。
但是progress\u url
的API只给了我返回消息state
done或start,而不是百分比值progress
谢谢,大家好。我想您可以在文档中找到一些有趣的内容,尤其是字段和字段 干杯,
Giovanni所以,你给我的文档,我认为在视频成功上传后会起作用,因为我们需要视频id作为参数。但是,我需要知道上传进度的百分比。若我上传了大尺寸的视频,这会让用户等待,并没有迹象表明他们需要等待多少视频上传,直到完成和成功。以前,我试过这个,但我不明白。再次感谢@Giovanni