-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
70 lines (60 loc) · 2.02 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
<head>
<script src="/js/vendor/video.min.js"></script>
<script src="/js/vendor/videojs.endcapCTA.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="../js/vendor/jquery-2.1.4.min.js"><\/script>')</script>
<script src="/js/vendor/jquery.validate.js"></script>
<script src="/js/vendor/jquery.form.js"></script>
<link rel="stylesheet" href="/css/video-js.min.css">
<link rel="stylesheet" href="/css/videojs.endcapCTA.css">
</head>
<body>
<video id="video-id" class="video-js vjs-default-skin">
<source src="video.mp4" type='video/mp4'>
<source src="video.webm" type='video/webm'>
<source src="video.ogv" type='video/webm'>
<p class="vjs-no-js">
<a href="https://www.youtube.com/watch?v=...." target="_blank">View this video on YouTube</a>
</p>
</video>
<script type="text/javascript">
var video = videojs('video-id', {
"width":680,
"height":495,
"autoplay": true,
"controls": true,
"preload": "auto"
});
video.endcapCTA({
html: '<section class="endcapCallToActionContent">....</section>',
run: function() {
// This runs upon creation of endcapCTA, just after video starts playing
}
});
function watchAgain() {
video.play();
}
function submitAndSpin() {
$('.sending').show();
//
// Do form submission stuff here
// Hide/show the success/failure/sending <li>s
//
return false;
}
// prep the form to do JS magic if available
window.setTimeout(function() {
$('#loveToHearForm').validate({
submitHandler: function(form) {
submitAndSpin();
},
messages: {
name: 'Please enter your name',
company: 'Please enter your company',
email: 'Please enter your email address so we can contact you',
message: 'Please enter a short message of what we can do to help'
}
});
}, 100);
</script>
</body>