//On click of button, either pause or play video function controlVideo() { //Capture and store button and video elements let btn = document.querySelector(".play-pause-btn"); let video = document.querySelector(".video-loop"); if (video.paused) { video.play(); btn.innerHTML = ''; //pause icon btn.setAttribute("aria-label", "pause video"); } else { video.pause(); btn.innerHTML = ''; //play icon btn.setAttribute("aria-label", "play video"); } }