Problem with chrome bug making it impossible to play synched video in two browser windows


#1

I’m having an issue trying to play synched video in two browser windows. I am loading a src into a video element of my mainBrowser window and then sending a message via ipcRenderer to main.js to tell the second browser window to load the same video (but from a separate duplicate folder and file) into the src of another video element.

If I do this I get an “uncaught in Promise - DOM Exception, the play() request was interrupted by a load request” error and some odd skipping behaviour where the wrong video loads.

This doesn’t happen if I just load the video in one browser window - so it seems to be related to loading video in two windows.

It seems to be related to a Chrome bug https://bugs.chromium.org/p/chromium/issues/detail?id=593273

Does anyone have any thoughts on how to workaround this bug?


#2

I’m guessing you’re setting the srcof the video and then immediately calling play on it?

You might try waiting for the canplay event to fire first. Maybe something like this?

video.src = 'movie.mp4';
video.addEventListener('canplay', () => { video.play(); });