-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaylist.js
More file actions
22 lines (22 loc) · 785 Bytes
/
playlist.js
File metadata and controls
22 lines (22 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<video width="320" height="240" autoplay id="player">
<source id="video_stream" src="" type="video/mp4">
</video>
<script>
$(document).ready(function() {
var video = document.getElementById('player');
var vids = ["https://www.quirksmode.org/html5/videos/big_buck_bunny.mp4",
"http://jell.yfish.us/media/jellyfish-3-mbps-hd-h264.mkv"
];
var current_vid = 0;
video.volume = 0.2;
video.setAttribute("src", vids['0']);
$('video').on('ended', function() {
current_vid = +current_vid + 1;
if (typeof vids[current_vid] == 'undefined') {
current_vid = 0;
}
video.setAttribute("src", vids[current_vid]);
});
});
</script>