Open ralyodio opened 2 years ago
I'm using vime.js and trying to dynamically change the video player source video with javascript (not using any frameworks):
1 (async () => {
2 const movie = document.querySelector("a[href$='.mp4']").href;
3 window.player = document.querySelector('vm-player');
4
5 console.log('movie: ',movie);
6
7 if (movie) {
8 console.log(window.player);
9 window.player.src = movie;
10 }
11 })();
i'm using vanilla html/js and want to dynamically add the mp4 file to play with javascript.
I have a player object with
window.player = document.querySelector('vm-player');