-
Notifications
You must be signed in to change notification settings - Fork 12
/
example.html
86 lines (77 loc) · 2.46 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!doctype html>
<html>
<head>
<title>Video.js Endcard Example</title>
<link href="http://vjs.zencdn.net/4.0/video-js.css" rel="stylesheet">
<link href="videojs.endcard.css" rel="stylesheet">
<style>
p.example {
background-color: #eee;
border: thin solid #777;
padding: 10px;
}
</style>
</head>
<body>
<p class="example">Skip to the end of the video to see how the Endcard functions:</p>
<video id='video'
src='http://video-js.zencoder.com/oceans-clip.mp4'
class='video-js vjs-default-skin'
width='640'
height='264'
poster='http://video-js.zencoder.com/oceans-clip.jpg'
controls>
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4'>
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm'>
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg'>
<p>Video Playback Not Supported</p>
</video>
<script src="http://vjs.zencdn.net/4.0/video.js"></script>
<script src='videojs.endcard.js'></script>
<script>
// initialize video.js
var video = videojs('video');
// creating sample thumbnails
var rel_content_1 = document.createElement('div');
var a1 = document.createElement('a');
var p1 = document.createElement('p');
p1.innerHTML = "Video JS Website, For All Your HTML5 Needs.... AND MORE!";
a1.href = "http://www.videojs.com/";
a1.appendChild(p1);
rel_content_1.appendChild(a1);
var rel_content_2 = document.createElement('div');
var a2 = document.createElement('a');
var p2 = document.createElement('p');
p2.innerHTML = "This Man Found a LinkBait LinkBait. You Won't Believe What the LinkBait Did Next!";
a2.href = "http://www.youtube.com/watch?v=6k3--GPk-l4";
a2.appendChild(p2);
rel_content_2.appendChild(a2);
var next_video = document.createElement('div');
var a3 = document.createElement('a');
var p3 = document.createElement('p');
p3.innerHTML = "ABOUT TO GO HERE!!";
a3.href = "http://www.youtube.com/watch?v=KAv500Q6bfA";
a3.appendChild(p3);
next_video.appendChild(a3);
// Asynchronous functions
function getRelatedContent(callback) {
var list = [];
list.push(rel_content_1);
list.push(rel_content_2);
setTimeout(function(){
callback(list);
}, 0);
}
function getNextVid(callback) {
setTimeout(function(){
callback(next_video);
}, 0);
}
video.endcard({
getRelatedContent: getRelatedContent,
// getNextVid: getNextVid, //------------------------------ uncomment this to get autoplaying video
count: 20
});
</script>
</body>
</html>