Open rvrajj opened 1 year ago
I have the same question, basically I implemented an post scrolling in my site and videos get added whenever the user hits the bottom of the page, however Plyr doesn't seem to get applied to the newly loaded videos even if it has the player
class which I passed through let player = new Plyr('.player')
, is there any solutions for this?
So finally 2 seconds of reading README I was able to make it work, I decided to put a randomized Id
to each of the players being appended to the HTML and at the very end of the loop I put let player = new Plyr(document.getElementById(randomizedId));
.
After initializing the player as
const players = Plyr.setup('.js-player');
I want to add another video dynamically, but just adding a video tag with classjs-player
does not initializes it as Plyr.The actual question is : How to add a video/audio dynamically in plyr ui?