Sunday, 24 January 2021

Duplicate YouTube iframe embed video playback

I'm using react-youtube (essentially YouTube iframe embed API) in order to render a video in my web app.
I want to clone the video itself to a separate <video> element, so that it will correspond to all the user actions in the original video player (play, pause, seek, change quality, etc).

I know it can be done by duplicating the whole player and using the onPlay, onPause and other callbacks to trigger the same actions in the second player - but the ideal solution for me would be to just clone the video output itself.
Obviously cloning by drawing with a Canvas is not a good solution.

Is there any way to do it?



from Duplicate YouTube iframe embed video playback

No comments:

Post a Comment