Avoid bug at init

This commit is contained in:
Thomas Forgione 2021-06-21 11:21:13 +02:00
parent e26971d995
commit d1bd418e89
1 changed files with 28 additions and 26 deletions

View File

@ -36,6 +36,7 @@ function setupApp(app) {
let hls; let hls;
app.ports.polymnyVideoInit.subscribe(function(arg) { app.ports.polymnyVideoInit.subscribe(function(arg) {
requestAnimationFrame(function() {
const video = document.getElementById(arg[0]); const video = document.getElementById(arg[0]);
if (Hls.isSupported()) { if (Hls.isSupported()) {
hls = new Hls(); hls = new Hls();
@ -68,6 +69,7 @@ function setupApp(app) {
video.src = arg[1]; video.src = arg[1];
} }
}); });
});
app.ports.polymnyVideoPlayPause.subscribe(function(arg) { app.ports.polymnyVideoPlayPause.subscribe(function(arg) {
const video = document.getElementById(arg); const video = document.getElementById(arg);