fix autoplay for transcoded files
This commit is contained in:
parent
57c8f44744
commit
fdd9b01513
1 changed files with 4 additions and 1 deletions
|
@ -234,10 +234,13 @@ function VideoViewer(props: Props) {
|
||||||
Promise.race([playPromise, timeoutPromise]).catch((error) => {
|
Promise.race([playPromise, timeoutPromise]).catch((error) => {
|
||||||
if (typeof error === 'object' && error.name && error.name === 'NotAllowedError') {
|
if (typeof error === 'object' && error.name && error.name === 'NotAllowedError') {
|
||||||
// Autoplay disallowed by browser
|
// Autoplay disallowed by browser
|
||||||
|
player.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Autoplay failed
|
||||||
if (PLAY_TIMEOUT_ERROR) {
|
if (PLAY_TIMEOUT_ERROR) {
|
||||||
// Autoplay failed
|
setIsLoading(false);
|
||||||
|
setIsPlaying(false);
|
||||||
} else {
|
} else {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
setIsPlaying(false);
|
setIsPlaying(false);
|
||||||
|
|
Loading…
Reference in a new issue