Currently developing with localhost.
It seems like because that script was run once on the page already it won't run again? Any idea how to fix this?
The following is my code and workflow.
This the JS being run, which renders a template with data pulled from the external endpoint.
This is the template being rendered form the above code. You can see I am writing a table for each video returned, and a button that says watch with a class of modal-trigger. The JS below binds a click event to that class. There's some logic to remove all the modals before creating a new one, to prevent multiple modals which was causing me problems.
The modal is rendered with a placeholder div, and once the modal is created we render the template with the video information.
This is the template that renders the video and then the JS to load VideoJS, but it doesn't work once it has been run once.
I think this is a problem more about me not knowing enough about Moodle and the VideoJS plugin to know what is happening here. No console errors either by the way. Any help or suggestions are welcome