My task was to merge two videos together and play them one after another automatically. This is the source code of my project html code -
var video = document.getElementById('videoPlayer');
video.addEventListener('ended', function(event) {
var currentVid = document.querySelector("#videoPlayer source.current");
var nextVid = document.querySelector("#videoPlayer source.current + source") || document.querySelector("#videoPlayer source:first-child");
currentVid.className = "";
nextVid.className = "current";
video.src = nextVid.src;
video.play();
});
<video id="videoPlayer" width="500" height="350" controls style="background:black">
<source class="current" src="MY_VIDEO.mp4" type="video/mp4" />
<source src="video2.mp4" type="video/mp4" />
</video>
My next task says https://videojs.com/ is the URL to access the source files for the library. I am not getting what does this means? Any idea? Thanks in advance :)
I think there is a cdn where all css/js files are hosted on that link. Can you provide more details, so I can help! Thank you!
See https://videojs.com/getting-started/
You can get CDN hosted dist files at https://vjs.zencdn.net/7.19.2/video-js.css and https://vjs.zencdn.net/7.19.2/video.min.js, or install with NPM.
You don't need to upload your code. You can just include the video js cdn hosted files inside a simple HTML document, then load your video files as its written inside the documentation. You can display videos hosted on your web server or from external source. Include these: https://vjs.zencdn.net/7.19.2/video.min.js https://vjs.zencdn.net/7.19.2/video-js.css