-
Notifications
You must be signed in to change notification settings - Fork 2
/
myplugin1.html
109 lines (88 loc) · 3.39 KB
/
myplugin1.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html>
<head>
<title>Video.js | HTML5 Video Player</title>
<!-- Chang URLs to wherever Video.js files will be hosted -->
<link href="video-js.css" rel="stylesheet" type="text/css">
<!-- video.js must be in the <head> for older IEs to work. -->
<script src="video.js"></script>
<script src="api.js"></script>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
$(function() {
log( 'ready---------------');
var LiveRailVPAID,
vpaidFrame, vpaidLoader, videoWrapper = document.getElementById('videoWrapper'),
videoElement = document.getElementById('vid1'),
initAdButton = document.getElementById('initAdButton'),
startAdButton = document.getElementById('startAdButton'),
initAdButton = document.getElementById('initAdButton');
vpaidFrame = document.createElement('iframe');
//vpaidFrame.style.display = 'none';
vpaidFrame.onload = function() {
vpaidLoader = vpaidFrame.contentWindow.document.createElement('script');
vpaidLoader.src = 'LiveRail.AdManager-1.0.js';
vpaidLoader.onload = function() {
LiveRailVPAID = vpaidFrame.contentWindow.getVPAIDAd();
LiveRailVPAID.handshakeVersion('2.0');
onVPAIDLoad();
};
vpaidFrame.contentWindow.document.body.appendChild(vpaidLoader);
};
document.body.appendChild(vpaidFrame);
});
</script>
<script src="vpaid.js"></script>
<!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
<script>
videojs.options.flash.swf = "video-js.swf";
log = function(obj) {
console.log(obj);
}
</script>
</head>
<body>
<div id="videoWrapper">
<video id="vid1" class="video-js vjs-default-skin" controls muted preload="none" width="640" height="264" poster="http://video-js.zencoder.com/oceans-clip.png">
<source src="282076105.mp4" type='video/mp4' />
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p>
</video>
</div>
<script type="text/javascript">
var vid1 = videojs('vid1');
function playerReset() {
// videoElement.src = 'http://video-js.zencoder.com/oceans-clip.mp4';
// videoElement.load();
console.log('playerReset ');
//initAdButton.removeAttribute('disabled');
}
//DefineinitialVPAID setup
function onVPAIDLoad() {
LiveRailVPAID.subscribe(function() {
log('ad Loaded')
LiveRailVPAID.startAd();
}, 'AdLoaded');
LiveRailVPAID.subscribe(function() {
playerReset();
videojs("videoElement").play();
}, 'AdStopped');
LiveRailVPAID.subscribe(function() {
playerReset();
}, 'AdError');
LiveRailVPAID.subscribe(function(message) {
console.log(message);
}, 'AdLog');
LiveRailVPAID.subscribe(function(message) {
}, 'AdComplete');
playerReset();
}
/*
var vid = videojs("vid1", {
plugins : { vpaidPlugin : {} }
}, function() {
videoPlayer = this;
});*/
</script>
</body>
</html>