showing results for - "create video playlist using jquery"
Nora
01 Jan 2019
1function handler(e) {
2	e.preventDefault();
3	videotarget = this.getAttribute("href");
4	filename = videotarget.substr(0, videotarget.lastIndexOf('.')) || videotarget;
5	video = document.querySelector("#video_player video");
6	video.removeAttribute("controls");
7	video.removeAttribute("poster");
8	source = document.querySelectorAll("#video_player video source");
9	source[0].src = filename + ".mp4";
10	source[1].src = filename + ".webm";
11	video.load();
12	video.play();    
13}