This repository has been archived by the owner on May 28, 2024. It is now read-only.
forked from videojs/videojs-overlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
57 lines (54 loc) · 1.78 KB
/
index.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>videojs-overlay Demo</title>
<link href="node_modules/video.js/dist/video-js.css" rel="stylesheet">
<link href="dist/videojs-overlay.css" rel="stylesheet">
</head>
<body>
<video id="videojs-overlay-player" class="video-js vjs-default-skin" controls>
<source src="//vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
<source src="//vjs.zencdn.net/v/oceans.webm" type='video/webm'>
</video>
<ul>
<li><a href="test/debug.html">Run unit tests in browser.</a></li>
</ul>
<script src="node_modules/video.js/dist/video.js"></script>
<script src="dist/videojs-overlay.js"></script>
<script>
(function(window, videojs) {
var player = window.player = videojs('videojs-overlay-player');
player.overlay({
content: 'Default overlay content',
debug: false,
overlays: [ {
start: 0,
end: 5,
align: 'bottom-left',
cta_id: 'A1',
content: '<div data-cta-id="A1" data-cta-location="bottom-left">1st Overlay</div>'
}, {
start: 5,
end: 10,
align: 'bottom',
cta_id: 'B1',
content: '<div data-cta-id="B1" data-cta-location="bottom">2nd Overlay</div>'
}, {
start: 10,
end: 15,
align: 'bottom-right',
cta_id: 'C1',
content: '<div data-cta-id="C1" data-cta-location="bottom-right">3rd Overlay</div>'
}]
});
player.on('show-overlay', function(event, data) {
console.log('SHOW EVENT:' + data.id + ' - ' + data.align);
});
player.on('hide-overlay', function(event, data) {
console.log('HIDE EVENT:' + data.id + ' - ' + data.align);
});
}(window, window.videojs));
</script>
</body>
</html>