User:Docmoates/Social: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 345: | Line 345: | ||
xhr.onload=function(){ | xhr.onload=function(){ | ||
if(xhr.status===200){ | if(xhr.status===200){ | ||
try{ | |||
var resp=JSON.parse(xhr.responseText); | var resp=JSON.parse(xhr.responseText); | ||
if(resp.upload){ | if(resp.upload){ | ||
| Line 352: | Line 353: | ||
}else if(resp.error){onError(resp.error.info);} | }else if(resp.error){onError(resp.error.info);} | ||
else{onError('Unknown error');} | else{onError('Unknown error');} | ||
}else{onError('Upload failed');} | }catch(e){onError('Parse error');} | ||
}else{onError('Upload failed: '+xhr.status);} | |||
}; | }; | ||
xhr.onerror=function(){onError(' | xhr.onerror=function(){onError('Network error');}; | ||
xhr.ontimeout=function(){onError('Timeout');}; | |||
xhr.timeout=60000; | |||
xhr.send(formData); | xhr.send(formData); | ||
}); | }).catch(function(e){onError('Token error: '+e);}); | ||
} | } | ||
Revision as of 03:12, 3 February 2026
Uploading...
Uploading...
Uploading...
Uploading...
Supports YouTube, Vimeo, or direct video URLs
— or —