From d17ebada8959f6761fe01b4f817297f44a2475d0 Mon Sep 17 00:00:00 2001 From: Alexandru Branza Date: Thu, 30 May 2024 12:58:35 +0300 Subject: [PATCH] [Test] Load Before Subscribe --- src/WebOsVideo/WebOsVideo.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/WebOsVideo/WebOsVideo.js b/src/WebOsVideo/WebOsVideo.js index c60f83e..9d94b60 100644 --- a/src/WebOsVideo/WebOsVideo.js +++ b/src/WebOsVideo/WebOsVideo.js @@ -1008,6 +1008,14 @@ function WebOsVideo(options) { if (videoElement.mediaId) { knownMediaId = videoElement.mediaId; clearInterval(timer); + + try { + videoElement.load(); + } catch(e) { + // console.log('can\'t load video'); + // console.error(e); + } + setTimeout(function() { subscribe(cb); }, 500); @@ -1030,12 +1038,12 @@ function WebOsVideo(options) { // not needed? // videoElement.src = stream.url; - try { - videoElement.load(); - } catch(e) { - // console.log('can\'t load video'); - // console.error(e); - } + // try { + // videoElement.load(); + // } catch(e) { + // // console.log('can\'t load video'); + // // console.error(e); + // } try { // console.log('try play');