mirror of
https://github.com/jech/galene.git
synced 2024-11-09 18:25:58 +01:00
Delay playing of video until connection is in good state.
This commit is contained in:
parent
27a2e45500
commit
1a11548192
1 changed files with 12 additions and 3 deletions
|
@ -932,7 +932,7 @@ async function addFileMedia(file) {
|
|||
}
|
||||
};
|
||||
setMedia(c, true, video);
|
||||
video.play();
|
||||
c.userdata.play = true;
|
||||
setButtonsVisibility()
|
||||
}
|
||||
|
||||
|
@ -1230,10 +1230,19 @@ function setMediaStatus(c) {
|
|||
console.warn('Setting status of unknown media.');
|
||||
return;
|
||||
}
|
||||
if(good)
|
||||
if(good) {
|
||||
media.classList.remove('media-failed');
|
||||
else
|
||||
if(c.userdata.play) {
|
||||
if(media instanceof HTMLMediaElement)
|
||||
media.play().catch(e => {
|
||||
console.error(e);
|
||||
displayError(e);
|
||||
});
|
||||
delete(c.userdata.play);
|
||||
}
|
||||
} else {
|
||||
media.classList.add('media-failed');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue