Fix retry on timeout for AJAX requests

This commit is contained in:
Omar Roth 2019-06-15 10:08:06 -05:00
parent a3164177f8
commit 552f616305
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2
9 changed files with 110 additions and 53 deletions

View file

@ -218,7 +218,6 @@ if (!video_data.params.listen && video_data.params.annotations) {
xhr.responseType = 'text';
xhr.timeout = 60000;
xhr.open('GET', '/api/v1/annotations/' + video_data.id, true);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
@ -251,6 +250,8 @@ if (!video_data.params.listen && video_data.params.annotations) {
window.open(path, '_blank');
}
});
xhr.send();
}
// Since videojs-share can sometimes be blocked, we defer it until last