videojs-mobile-ui 1.1.4 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -53
- package/dist/videojs-mobile-ui.cjs.js +194 -42
- package/dist/videojs-mobile-ui.css +6 -0
- package/dist/videojs-mobile-ui.es.js +194 -42
- package/dist/videojs-mobile-ui.js +194 -42
- package/dist/videojs-mobile-ui.min.js +2 -2
- package/docs/api/TouchOverlay.html +772 -0
- package/docs/api/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/docs/api/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/api/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/docs/api/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/api/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/docs/api/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/api/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/docs/api/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/api/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/docs/api/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/api/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/docs/api/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/api/global.html +1485 -0
- package/docs/api/index.html +159 -0
- package/docs/api/plugin.js.html +266 -0
- package/docs/api/scripts/linenumber.js +25 -0
- package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/api/scripts/prettify/lang-css.js +2 -0
- package/docs/api/scripts/prettify/prettify.js +28 -0
- package/docs/api/styles/jsdoc-default.css +358 -0
- package/docs/api/styles/prettify-jsdoc.css +111 -0
- package/docs/api/styles/prettify-tomorrow.css +132 -0
- package/docs/api/swipeFullscreen.js.html +173 -0
- package/docs/api/touchOverlay.js.html +203 -0
- package/index.html +238 -170
- package/package.json +6 -4
- package/scripts/netlify.js +16 -0
- package/scripts/readme-options.js +370 -0
- package/src/plugin.css +6 -0
- package/src/plugin.js +64 -38
- package/src/swipeFullscreen.js +122 -0
- package/src/touchOverlay.js +6 -2
- package/test/plugin.test.js +57 -41
- package/test/swipeFullscreen.test.js +365 -0
package/index.html
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
|
+
|
|
3
4
|
<head>
|
|
4
5
|
<meta charset="utf-8" />
|
|
5
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
7
|
<title>videojs-mobile-ui Demo</title>
|
|
8
|
+
<link href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20height%3D%2224px%22%20viewBox%3D%220%20-960%20960%20960%22%20width%3D%2224px%22%20fill%3D%22%231f1f1f%22%3E%3Cpath%20d%3D%22M419-80q-28%200-52.5-12T325-126L124-381q-8-9-7-21.5t9-20.5q20-21%2048-25t52%2011l74%2045v-328q0-17%2011.5-28.5T340-760q17%200%2029%2011.5t12%2028.5v200h299q50%200%2085%2035t35%2085v160q0%2066-47%20113T640-80H419Zm60-520q-17%200-28.5-11.5T439-640q0-2%205-20%208-14%2012-28.5t4-31.5q0-50-35-85t-85-35q-50%200-85%2035t-35%2085q0%2017%204%2031.5t12%2028.5q3%205%204%2010t1%2010q0%2017-11%2028.5T202-600q-11%200-20.5-6T167-621q-13-22-20-47t-7-52q0-83%2058.5-141.5T340-920q83%200%20141.5%2058.5T540-720q0%2027-7%2052t-20%2047q-5%209-14%2015t-20%206Z%22%2F%3E%3C%2Fsvg%3E" rel="icon" type="image/x-icon" />
|
|
7
9
|
<link href="node_modules/video.js/dist/video-js.css" rel="stylesheet" />
|
|
8
10
|
<link href="dist/videojs-mobile-ui.css" rel="stylesheet" />
|
|
9
11
|
<style>
|
|
@@ -15,186 +17,252 @@
|
|
|
15
17
|
pointer-events: none;
|
|
16
18
|
display: none;
|
|
17
19
|
}
|
|
20
|
+
|
|
21
|
+
body {
|
|
22
|
+
font-size: 16px;
|
|
23
|
+
line-height: 1.4;
|
|
24
|
+
margin-bottom: 60px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.video-container {
|
|
28
|
+
width: 100vw;
|
|
29
|
+
margin-left: calc(50% - 50vw);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
video-js:fullscreen .vjs-control-bar {
|
|
33
|
+
font-size: 1.1em;
|
|
34
|
+
padding-bottom: 20px;
|
|
35
|
+
height: calc(3em + 20px);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#demoOptions {
|
|
39
|
+
|
|
40
|
+
ul {
|
|
41
|
+
list-style: none;
|
|
42
|
+
padding: 0;
|
|
43
|
+
margin: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
li {
|
|
47
|
+
margin-bottom: 10px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
label {
|
|
51
|
+
min-height: 44px;
|
|
52
|
+
/* Apple/Google tap target guidance */
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
font-family: ui-monospace, 'Courier New', Courier, monospace;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Text inputs */
|
|
58
|
+
input[type="text"],
|
|
59
|
+
input[type="email"],
|
|
60
|
+
input[type="number"],
|
|
61
|
+
input[type="password"],
|
|
62
|
+
textarea {
|
|
63
|
+
width: 90%;
|
|
64
|
+
padding: 10px 12px;
|
|
65
|
+
font-size: 16px;
|
|
66
|
+
/* Prevents iOS zoom */
|
|
67
|
+
border: 1px solid #ccc;
|
|
68
|
+
border-radius: 6px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Checkboxes (simple but usable) */
|
|
72
|
+
input[type="checkbox"] {
|
|
73
|
+
width: 20px;
|
|
74
|
+
height: 20px;
|
|
75
|
+
flex-shrink: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Optional: subtle focus style */
|
|
79
|
+
input:focus,
|
|
80
|
+
textarea:focus {
|
|
81
|
+
outline: none;
|
|
82
|
+
border-color: #007aff;
|
|
83
|
+
/* iOS blue */
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Optional: slightly separate groups */
|
|
87
|
+
li+li {
|
|
88
|
+
border-top: 1px solid #eee;
|
|
89
|
+
padding-top: 8px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
button {
|
|
93
|
+
font-size: 16px;
|
|
94
|
+
margin-bottom: 10px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
18
97
|
</style>
|
|
19
98
|
</head>
|
|
99
|
+
|
|
20
100
|
<body>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</video-js>
|
|
29
|
-
<ul>
|
|
30
|
-
<li><a href="test/">Run unit tests in browser.</a></li>
|
|
31
|
-
<li><a href="docs/api/">Read generated docs.</a></li>
|
|
32
|
-
</ul>
|
|
33
|
-
<h2>Options</h2>
|
|
34
|
-
<ul id="options">
|
|
35
|
-
<li>fullscreen:</li>
|
|
101
|
+
<h1>videojs-mobile-ui test page.</h1>
|
|
102
|
+
<div class="video-container">
|
|
103
|
+
<video-js id="videojs-mobile-ui-player" class="video-js vjs-default-skin vjs-fluid" controls playsinline>
|
|
104
|
+
<source src="https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8"
|
|
105
|
+
type="application/x-mpegurl" />
|
|
106
|
+
</video-js>
|
|
107
|
+
</div>
|
|
36
108
|
<ul>
|
|
37
|
-
<li>
|
|
38
|
-
<input
|
|
39
|
-
type="checkbox"
|
|
40
|
-
data-section="fullscreen"
|
|
41
|
-
id="enterOnRotate"
|
|
42
|
-
/>enterOnRotate
|
|
43
|
-
</li>
|
|
44
|
-
<li>
|
|
45
|
-
<input
|
|
46
|
-
type="checkbox"
|
|
47
|
-
data-section="fullscreen"
|
|
48
|
-
id="exitOnRotate"
|
|
49
|
-
/>exitOnRotate
|
|
50
|
-
</li>
|
|
51
|
-
<li>
|
|
52
|
-
<input
|
|
53
|
-
type="checkbox"
|
|
54
|
-
data-section="fullscreen"
|
|
55
|
-
id="lockOnRotate"
|
|
56
|
-
/>lockOnRotate
|
|
57
|
-
</li>
|
|
58
|
-
<li>
|
|
59
|
-
<input
|
|
60
|
-
type="checkbox"
|
|
61
|
-
data-section="fullscreen"
|
|
62
|
-
id="alwaysLockToLandscape"
|
|
63
|
-
/>alwaysLockToLandscape
|
|
64
|
-
</li>
|
|
65
|
-
<li>
|
|
66
|
-
<input
|
|
67
|
-
type="checkbox"
|
|
68
|
-
data-section="fullscreen"
|
|
69
|
-
id="fullscreenDisabled"
|
|
70
|
-
/>disabled
|
|
71
|
-
</li>
|
|
109
|
+
<li><a href="test/">Run unit tests in browser.</a></li>
|
|
72
110
|
</ul>
|
|
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
|
-
|
|
111
|
+
<h2>Options</h2>
|
|
112
|
+
<div id="demoOptions">
|
|
113
|
+
<p>Reload to apply changed options.</p>
|
|
114
|
+
<button id="reload">Reload with options</button>
|
|
115
|
+
<ul id="options">
|
|
116
|
+
<li>
|
|
117
|
+
<h3>fullscreen:</h3>
|
|
118
|
+
</li>
|
|
119
|
+
<ul>
|
|
120
|
+
<li>
|
|
121
|
+
<input type="checkbox" data-section="fullscreen" id="enterOnRotate" /> <label for="enterOnRotate">enterOnRotate</label>
|
|
122
|
+
</li>
|
|
123
|
+
<li>
|
|
124
|
+
<input type="checkbox" data-section="fullscreen" id="exitOnRotate" />
|
|
125
|
+
<label for="exitOnRotate">exitOnRotate</label>
|
|
126
|
+
</li>
|
|
127
|
+
<li>
|
|
128
|
+
<input type="checkbox" data-section="fullscreen" id="lockOnRotate" />
|
|
129
|
+
<label for="lockOnRotate">lockOnRotate</label>
|
|
130
|
+
</li>
|
|
131
|
+
<li>
|
|
132
|
+
<input type="checkbox" data-section="fullscreen" id="alwaysLockToLandscape" />
|
|
133
|
+
<label for="alwaysLockToLandscape">alwaysLockToLandscape</label>
|
|
134
|
+
</li>
|
|
135
|
+
<li>
|
|
136
|
+
<input type="checkbox" data-section="fullscreen" id="swipeToFullscreen" />
|
|
137
|
+
<label for="swipeToFullscreen">swipeToFullscreen</label>
|
|
138
|
+
</li>
|
|
139
|
+
<li>
|
|
140
|
+
<input type="checkbox" data-section="fullscreen" id="swipeFromFullscreen" />
|
|
141
|
+
<label for="swipeFromFullscreen">swipeFromFullscreen</label>
|
|
142
|
+
</li>
|
|
143
|
+
<li>
|
|
144
|
+
<input type="checkbox" data-section="fullscreen" id="fullscreenDisabled" />
|
|
145
|
+
<label for="disabled">disabled</label>
|
|
146
|
+
</li>
|
|
147
|
+
</ul>
|
|
148
|
+
<li>
|
|
149
|
+
<h3>touchControls:</h3>
|
|
150
|
+
</li>
|
|
151
|
+
<ul>
|
|
152
|
+
<li>
|
|
153
|
+
<input type="number" data-section="touchControls" id="seekSeconds" />
|
|
154
|
+
<label for="seekSeconds">seekSeconds</label>
|
|
155
|
+
</li>
|
|
156
|
+
<li>
|
|
157
|
+
<input type="number" data-section="touchControls" id="tapTimeout" />
|
|
158
|
+
<label for="tapTimeout">tapTimeout</label>
|
|
159
|
+
</li>
|
|
160
|
+
<li>
|
|
161
|
+
<input type="checkbox" data-section="touchControls" id="disableOnEnd" />
|
|
162
|
+
<label for="disableOnEnd">disableOnEnd</label>
|
|
163
|
+
</li>
|
|
164
|
+
<li>
|
|
165
|
+
<input type="checkbox" data-section="touchControls" id="touchControlsDisabled" />
|
|
166
|
+
<label for="disabled">disabled</label>
|
|
167
|
+
</li>
|
|
168
|
+
</ul>
|
|
169
|
+
</ul>
|
|
170
|
+
</div>
|
|
171
|
+
<ul id="log"></ul>
|
|
172
|
+
<script src="node_modules/video.js/dist/video.js"></script>
|
|
173
|
+
<script src="dist/videojs-mobile-ui.js"></script>
|
|
174
|
+
<script>
|
|
175
|
+
(function (window, videojs) {
|
|
176
|
+
var options = {
|
|
177
|
+
fullscreen: {
|
|
178
|
+
enterOnRotate: true,
|
|
179
|
+
exitOnRotate: true,
|
|
180
|
+
lockOnRotate: true,
|
|
181
|
+
alwaysLockToLandscape: false,
|
|
182
|
+
swipeToFullscreen: false,
|
|
183
|
+
swipeFromFullscreen: false,
|
|
184
|
+
disabled: false,
|
|
185
|
+
},
|
|
186
|
+
touchControls: {
|
|
187
|
+
seekSeconds: 10,
|
|
188
|
+
tapTimeout: 300,
|
|
189
|
+
disableOnEnd: false,
|
|
190
|
+
disabled: false,
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
var url = new URL(window.location);
|
|
195
|
+
if (url.searchParams.has('options')) {
|
|
196
|
+
options = JSON.parse(url.searchParams.get('options'));
|
|
197
|
+
}
|
|
131
198
|
|
|
132
|
-
|
|
199
|
+
console.log(JSON.stringify(options, null, 2));
|
|
133
200
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
201
|
+
Object.keys(options).forEach(function (section) {
|
|
202
|
+
Object.keys(options[section]).forEach(function (prop) {
|
|
203
|
+
const val = options[section][prop];
|
|
137
204
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
205
|
+
if (prop === 'disabled') {
|
|
206
|
+
prop = `${section}Disabled`;
|
|
207
|
+
}
|
|
141
208
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
209
|
+
if (typeof val === 'boolean') {
|
|
210
|
+
document.getElementById(prop).checked = val;
|
|
211
|
+
}
|
|
212
|
+
if (typeof val === 'number') {
|
|
213
|
+
document.getElementById(prop).value = val;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
148
216
|
});
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
217
|
+
|
|
218
|
+
document
|
|
219
|
+
.getElementById('options')
|
|
220
|
+
.querySelectorAll('input')
|
|
221
|
+
.forEach(function (opt) {
|
|
222
|
+
opt.addEventListener('change', function () {
|
|
223
|
+
if (this.type === 'checkbox') {
|
|
224
|
+
const param = this.id.endsWith('Disabled')
|
|
225
|
+
? 'disabled'
|
|
226
|
+
: this.id;
|
|
227
|
+
|
|
228
|
+
options[this.getAttribute('data-section')][param] =
|
|
229
|
+
this.checked;
|
|
230
|
+
} else {
|
|
231
|
+
options[this.getAttribute('data-section')][this.id] =
|
|
232
|
+
parseFloat(this.value);
|
|
233
|
+
}
|
|
234
|
+
console.log(options);
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
document
|
|
239
|
+
.getElementById('reload')
|
|
240
|
+
.addEventListener('click', function () {
|
|
241
|
+
url.searchParams.set('options', JSON.stringify(options));
|
|
242
|
+
|
|
243
|
+
window.location = url.href;
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
window.addEventListener('orientationchange', function () {
|
|
247
|
+
var el = document.createElement('li');
|
|
248
|
+
var message =
|
|
249
|
+
new Date().toTimeString().split(' ')[0] + ' ' + window.orientation;
|
|
250
|
+
message +=
|
|
251
|
+
screen && screen.orientation
|
|
252
|
+
? ' ' + screen.orientation.type + ' ' + screen.orientation.angle
|
|
253
|
+
: '';
|
|
254
|
+
el.textContent = message;
|
|
255
|
+
console.log(message);
|
|
256
|
+
document.getElementById('log').appendChild(el);
|
|
168
257
|
});
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
.getElementById('reload')
|
|
173
|
-
.addEventListener('click', function () {
|
|
174
|
-
url.searchParams.set('options', JSON.stringify(options));
|
|
175
|
-
|
|
176
|
-
window.location = url.href;
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
window.addEventListener('orientationchange', function () {
|
|
180
|
-
var el = document.createElement('li');
|
|
181
|
-
var message =
|
|
182
|
-
new Date().toTimeString().split(' ')[0] + ' ' + window.orientation;
|
|
183
|
-
message +=
|
|
184
|
-
screen && screen.orientation
|
|
185
|
-
? ' ' + screen.orientation.type + ' ' + screen.orientation.angle
|
|
186
|
-
: '';
|
|
187
|
-
el.textContent = message;
|
|
188
|
-
console.log(message);
|
|
189
|
-
document.getElementById('log').appendChild(el);
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
var testPlayer = (window.testPlayer = videojs(
|
|
193
|
-
'videojs-mobile-ui-player'
|
|
258
|
+
|
|
259
|
+
var testPlayer = (window.testPlayer = videojs(
|
|
260
|
+
'videojs-mobile-ui-player'
|
|
194
261
|
));
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
</script>
|
|
262
|
+
testPlayer.endscreen = function () { };
|
|
263
|
+
testPlayer.mobileUi(options);
|
|
264
|
+
})(window, window.videojs);
|
|
265
|
+
</script>
|
|
199
266
|
</body>
|
|
200
|
-
|
|
267
|
+
|
|
268
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "videojs-mobile-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Mobile tap controls and fullscreen on rotate for Video.js",
|
|
5
5
|
"main": "dist/videojs-mobile-ui.cjs.js",
|
|
6
6
|
"module": "dist/videojs-mobile-ui.es.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"version": "8.0.0"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "npm-run-all -s clean -p build:*",
|
|
13
|
+
"build": "npm-run-all -s clean -p docs:options -p build:*",
|
|
14
14
|
"build-prod": "cross-env-shell NO_TEST_BUNDLE=1 'npm run build'",
|
|
15
15
|
"build-test": "cross-env-shell TEST_BUNDLE_ONLY=1 'npm run build'",
|
|
16
16
|
"build:css": "postcss -o dist/videojs-mobile-ui.css --config scripts/postcss.config.js src/plugin.css",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"clean": "shx rm -rf ./dist ./test/dist ./cjs ./es && shx mkdir -p ./dist ./test/dist ./cjs ./es",
|
|
20
20
|
"docs": "npm-run-all docs:*",
|
|
21
21
|
"docs:api": "jsdoc src -r -d docs/api",
|
|
22
|
-
"docs:
|
|
22
|
+
"docs:options": "node scripts/readme-options.js",
|
|
23
23
|
"lint": "vjsstandard",
|
|
24
24
|
"server": "karma start scripts/karma.conf.js --singleRun=false --auto-watch",
|
|
25
25
|
"start": "npm-run-all -p server watch",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"watch": "npm-run-all -p watch:*",
|
|
32
32
|
"watch:css": "npm run build:css -- -w",
|
|
33
33
|
"watch:js": "npm run build:js -- -w",
|
|
34
|
-
"prepublishOnly": "npm-run-all build-prod && vjsverify --verbose --skip-es-check"
|
|
34
|
+
"prepublishOnly": "npm-run-all build-prod && vjsverify --verbose --skip-es-check",
|
|
35
|
+
"netlify": "node ./scripts/netlify.js"
|
|
35
36
|
},
|
|
36
37
|
"engines": {
|
|
37
38
|
"node": ">=14",
|
|
@@ -87,6 +88,7 @@
|
|
|
87
88
|
"postcss-nested": "^7.0.2",
|
|
88
89
|
"postcss-progress": "^2.0.0",
|
|
89
90
|
"rollup": "^2.46.0",
|
|
91
|
+
"shelljs": "^0.10.0",
|
|
90
92
|
"sinon": "^21.0.0",
|
|
91
93
|
"video.js": "^8.0.0",
|
|
92
94
|
"videojs-generate-karma-config": "^8.1.0",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const sh = require('shelljs');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
|
|
5
|
+
const deployDir = 'deploy';
|
|
6
|
+
|
|
7
|
+
sh.rm('-rf', deployDir);
|
|
8
|
+
sh.mkdir('-p', deployDir);
|
|
9
|
+
|
|
10
|
+
sh.exec('npm run build');
|
|
11
|
+
sh.cp('-r', 'dist', path.join(deployDir, 'dist'));
|
|
12
|
+
|
|
13
|
+
let pluginContent = fs.readFileSync('index.html', 'utf8');
|
|
14
|
+
|
|
15
|
+
pluginContent = pluginContent.replace(/="node_modules\//g, '="https://unpkg.com/');
|
|
16
|
+
fs.writeFileSync(path.join(deployDir, 'index.html'), pluginContent);
|