How to free up the memory that takes video when the source changes:
var video = document.querySelector('.video');
var nextButton = document.getElementById('next-button');
nextButton.addEventListener('click', function() {
video.src = videoQueue.shift();
});