-
Notifications
You must be signed in to change notification settings - Fork 7.4k
/
embeds.html.example
155 lines (151 loc) · 6.61 KB
/
embeds.html.example
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Video.js Sandbox</title>
<script src='../node_modules/es5-shim/es5-shim.js'></script>
<script src='../node_modules/es6-shim/es6-shim.js'></script>
<link href="../dist/video-js.css" rel="stylesheet" type="text/css">
<script src="../dist/video.js"></script>
<style>
.source-el { background: #FF6961; }
.source-js { background: #77DD77; }
.options-src { background: #AEC6CF; }
.source-el.data-setup { background: red; }
.source-js.data-setup { background: green; }
.options-src.data-setup { background: blue; }
.video-js {
height: 150px;
width: 300px;
}
.wrapper {
display: grid;
margin: 0 auto;
grid-gap: 10px;
grid-template-columns: 300px 300px 300px;
}
.panel > p:first-child {
border-bottom: black 1px solid;
}
</style>
</head>
<body>
<p>All the various ways to embed and source video elements.</p>
<p>Pastel color background represent programmatic setup.</p>
<p>Vibrant color background represent data-setup.</p>
<div class="wrapper">
<div class="panel source-el">
<p>js setup with source element</p>
<p>video-js embed", source element</p>
<video-js id="vid01" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
<source src="https://vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
</video-js>
<p>Video embed, source element</p>
<video id="vid11" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
<source src="https://vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
</video>
<p>injested div el, source element</p>
<div data-vjs-player>
<video id="vid21" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
<source src="https://vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
</video>
</div>
</div>
<div class="panel options-src">
<p>js setup with sources options</p>
<p>video-js embed", js source</p>
<video-js id="vid05" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
</video-js>
<p>Video embed, js source</p>
<video id="vid15" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
</video>
<p>injested div el, js source</p>
<div data-vjs-player>
<video id="vid25" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png">
</video>
</div>
</div>
<div class="panel source-js">
<p>js setup with js method sources</p>
<p>video-js embed", js source</p>
<video-js id="vid02" class="video-js" controls>
</video-js>
<p>Video embed, js source</p>
<video id="vid12" class="video-js" controls>
</video>
<p>injested div el, js source</p>
<div data-vjs-player>
<video id="vid22" class="video-js" controls>
</video>
</div>
</div>
<div class="panel source-el data-setup">
<p>data-setup with sourrce elements</p>
<p>video-js embed", source element</p>
<video-js id="vid03" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
<source src="https://vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
</video-js>
<p>Video embed, source element</p>
<video id="vid13" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
<source src="https://vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
</video>
<p>injested div el, source element</p>
<div data-vjs-player>
<video id="vid23" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
<source src="https://vjs.zencdn.net/v/oceans.mp4" type='video/mp4'>
</video>
</div>
</div>
<div class="panel options-src data-setup">
<p>data-setup embeds with sources options</p>
<p>video-js embed", source element</p>
<video-js id="vid04" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup='{"sources": [{"src":"https://vjs.zencdn.net/v/oceans.mp4", "type":"video/mp4"}]}'>
</video-js>
<p>Video embed, source element</p>
<video id="vid14" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup='{"sources": [{"src":"https://vjs.zencdn.net/v/oceans.mp4", "type":"video/mp4"}]}'>
</video>
<p>injested div el, source element</p>
<div data-vjs-player>
<video id="vid24" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup='{"sources": [{"src":"https://vjs.zencdn.net/v/oceans.mp4", "type":"video/mp4"}]}'>
</video>
</div>
</div>
<div class="panel source-js data-setup">
<p>js setup with js method sources</p>
<p>video-js embed", js source</p>
<video-js id="vid06" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
</video-js>
<p>Video embed, js source</p>
<video id="vid16" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
</video>
<p>injested div el, js source</p>
<div data-vjs-player>
<video id="vid26" class="video-js" controls poster="//vjs.zencdn.net/v/oceans.png" data-setup="{}">
</video>
</div>
</div>
</div>
<script>
var player01 = videojs('vid01');
var player11 = videojs('vid11');
var player21 = videojs('vid21');
var player01 = videojs('vid02');
var player11 = videojs('vid12');
var player21 = videojs('vid22');
var player05 = videojs('vid05', {sources: [{src:'https://vjs.zencdn.net/v/oceans.mp4',type:'video/mp4'}]});
var player15 = videojs('vid15', {sources: [{src:'https://vjs.zencdn.net/v/oceans.mp4',type:'video/mp4'}]});
var player25 = videojs('vid25', {sources: [{src:'https://vjs.zencdn.net/v/oceans.mp4',type:'video/mp4'}]});
player01.src({src:'https://vjs.zencdn.net/v/oceans.mp4', type:'video/mp4'});
player11.src({src:'https://vjs.zencdn.net/v/oceans.mp4', type:'video/mp4'});
player21.src({src:'https://vjs.zencdn.net/v/oceans.mp4', type:'video/mp4'});
player01.poster('//vjs.zencdn.net/v/oceans.png');
player11.poster('//vjs.zencdn.net/v/oceans.png');
player21.poster('//vjs.zencdn.net/v/oceans.png');
setTimeout(function() {
videojs.players.vid06 && videojs.players.vid06.src({src:'https://vjs.zencdn.net/v/oceans.mp4', type:'video/mp4'});
videojs.players.vid16 && videojs.players.vid16.src({src:'https://vjs.zencdn.net/v/oceans.mp4', type:'video/mp4'});
videojs.players.vid26 && videojs.players.vid26.src({src:'https://vjs.zencdn.net/v/oceans.mp4', type:'video/mp4'});
});
</script>
</body>
</html>