videojs-mobile-ui 0.6.0 → 0.8.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +10 -2
  3. package/dist/videojs-mobile-ui.cjs.js +55 -28
  4. package/dist/videojs-mobile-ui.css +1 -1
  5. package/dist/videojs-mobile-ui.es.js +55 -28
  6. package/dist/videojs-mobile-ui.js +55 -28
  7. package/dist/videojs-mobile-ui.min.js +2 -2
  8. package/docs/api/TouchOverlay.html +964 -0
  9. package/docs/api/fonts/OpenSans-Bold-webfont.eot +0 -0
  10. package/docs/api/fonts/OpenSans-Bold-webfont.svg +1830 -0
  11. package/docs/api/fonts/OpenSans-Bold-webfont.woff +0 -0
  12. package/docs/api/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  13. package/docs/api/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  14. package/docs/api/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  15. package/docs/api/fonts/OpenSans-Italic-webfont.eot +0 -0
  16. package/docs/api/fonts/OpenSans-Italic-webfont.svg +1830 -0
  17. package/docs/api/fonts/OpenSans-Italic-webfont.woff +0 -0
  18. package/docs/api/fonts/OpenSans-Light-webfont.eot +0 -0
  19. package/docs/api/fonts/OpenSans-Light-webfont.svg +1831 -0
  20. package/docs/api/fonts/OpenSans-Light-webfont.woff +0 -0
  21. package/docs/api/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  22. package/docs/api/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  23. package/docs/api/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  24. package/docs/api/fonts/OpenSans-Regular-webfont.eot +0 -0
  25. package/docs/api/fonts/OpenSans-Regular-webfont.svg +1831 -0
  26. package/docs/api/fonts/OpenSans-Regular-webfont.woff +0 -0
  27. package/docs/api/global.html +957 -0
  28. package/docs/api/index.html +159 -0
  29. package/docs/api/plugin.js.html +221 -0
  30. package/docs/api/scripts/linenumber.js +25 -0
  31. package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -0
  32. package/docs/api/scripts/prettify/lang-css.js +2 -0
  33. package/docs/api/scripts/prettify/prettify.js +28 -0
  34. package/docs/api/styles/jsdoc-default.css +358 -0
  35. package/docs/api/styles/prettify-jsdoc.css +111 -0
  36. package/docs/api/styles/prettify-tomorrow.css +132 -0
  37. package/docs/api/touchOverlay.js.html +211 -0
  38. package/index.html +185 -92
  39. package/package.json +10 -13
  40. package/src/plugin.js +59 -34
  41. package/test/plugin.test.js +46 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,56 @@
1
+ <a name="0.8.0"></a>
2
+ # [0.8.0](https://github.com/mister-ben/videojs-mobile-ui/compare/v0.5.3...v0.8.0) (2022-04-13)
3
+
4
+ ### Features
5
+
6
+ * Add disable options (#33) ([59e5f89](https://github.com/mister-ben/videojs-mobile-ui/commit/59e5f89)), closes [#33](https://github.com/mister-ben/videojs-mobile-ui/issues/33)
7
+ * Add option to lock to landscape when entering fullscreen (#49) ([26c58d4](https://github.com/mister-ben/videojs-mobile-ui/commit/26c58d4)), closes [#49](https://github.com/mister-ben/videojs-mobile-ui/issues/49)
8
+
9
+ ### Bug Fixes
10
+
11
+ * Detect angle correctly where no window.orientation (#17) ([c85ac35](https://github.com/mister-ben/videojs-mobile-ui/commit/c85ac35)), closes [#17](https://github.com/mister-ben/videojs-mobile-ui/issues/17)
12
+ * Fix typo in iOS orientation (#27) ([7e05afb](https://github.com/mister-ben/videojs-mobile-ui/commit/7e05afb)), closes [#27](https://github.com/mister-ben/videojs-mobile-ui/issues/27)
13
+ * orientation string (#37) ([177f326](https://github.com/mister-ben/videojs-mobile-ui/commit/177f326)), closes [#37](https://github.com/mister-ben/videojs-mobile-ui/issues/37)
14
+ * Remove event listeners on player dispose (#21) ([25c8fb1](https://github.com/mister-ben/videojs-mobile-ui/commit/25c8fb1)), closes [#21](https://github.com/mister-ben/videojs-mobile-ui/issues/21)
15
+ * Split orientation string ([0eebd64](https://github.com/mister-ben/videojs-mobile-ui/commit/0eebd64))
16
+
17
+ ### Chores
18
+
19
+ * **deps-dev:** bump karma from 6.3.14 to 6.3.16 (#46) ([7bd42f1](https://github.com/mister-ben/videojs-mobile-ui/commit/7bd42f1)), closes [#46](https://github.com/mister-ben/videojs-mobile-ui/issues/46)
20
+ * **deps-dev:** bump karma from 6.3.2 to 6.3.14 (#44) ([ddff196](https://github.com/mister-ben/videojs-mobile-ui/commit/ddff196)), closes [#44](https://github.com/mister-ben/videojs-mobile-ui/issues/44)
21
+ * **deps:** bump engine.io from 4.1.1 to 4.1.2 (#39) ([5031c93](https://github.com/mister-ben/videojs-mobile-ui/commit/5031c93)), closes [#39](https://github.com/mister-ben/videojs-mobile-ui/issues/39)
22
+ * **deps:** bump follow-redirects from 1.14.0 to 1.14.7 (#41) ([6fcbb49](https://github.com/mister-ben/videojs-mobile-ui/commit/6fcbb49)), closes [#41](https://github.com/mister-ben/videojs-mobile-ui/issues/41)
23
+ * **deps:** bump follow-redirects from 1.14.7 to 1.14.8 (#45) ([cf20418](https://github.com/mister-ben/videojs-mobile-ui/commit/cf20418)), closes [#45](https://github.com/mister-ben/videojs-mobile-ui/issues/45)
24
+ * **deps:** bump log4js from 6.3.0 to 6.4.0 (#42) ([f9c69ff](https://github.com/mister-ben/videojs-mobile-ui/commit/f9c69ff)), closes [#42](https://github.com/mister-ben/videojs-mobile-ui/issues/42)
25
+ * **deps:** bump minimist from 1.2.5 to 1.2.6 (#50) ([6faea79](https://github.com/mister-ben/videojs-mobile-ui/commit/6faea79)), closes [#50](https://github.com/mister-ben/videojs-mobile-ui/issues/50)
26
+ * **deps:** bump nanoid from 3.1.22 to 3.2.0 (#43) ([70e3440](https://github.com/mister-ben/videojs-mobile-ui/commit/70e3440)), closes [#43](https://github.com/mister-ben/videojs-mobile-ui/issues/43)
27
+ * **deps:** bump shelljs from 0.8.4 to 0.8.5 (#40) ([bf57915](https://github.com/mister-ben/videojs-mobile-ui/commit/bf57915)), closes [#40](https://github.com/mister-ben/videojs-mobile-ui/issues/40)
28
+ * make video.js a peer dependency (#51) ([1e1ae5d](https://github.com/mister-ben/videojs-mobile-ui/commit/1e1ae5d)), closes [#51](https://github.com/mister-ben/videojs-mobile-ui/issues/51)
29
+ * update dependencies ([6fb5a7b](https://github.com/mister-ben/videojs-mobile-ui/commit/6fb5a7b))
30
+ * Update to Node 14 / Generator 8 (#16) ([660dc86](https://github.com/mister-ben/videojs-mobile-ui/commit/660dc86)), closes [#16](https://github.com/mister-ben/videojs-mobile-ui/issues/16)
31
+
32
+ <a name="0.7.0"></a>
33
+ # [0.7.0](https://github.com/mister-ben/videojs-mobile-ui/compare/v0.6.1...v0.7.0) (2021-11-09)
34
+
35
+ ### Features
36
+
37
+ * Add disable options (#33) ([59e5f89](https://github.com/mister-ben/videojs-mobile-ui/commit/59e5f89)), closes [#33](https://github.com/mister-ben/videojs-mobile-ui/issues/33)
38
+
39
+ ### Bug Fixes
40
+
41
+ * orientation string (#37) ([177f326](https://github.com/mister-ben/videojs-mobile-ui/commit/177f326)), closes [#37](https://github.com/mister-ben/videojs-mobile-ui/issues/37)
42
+
43
+ ### Chores
44
+
45
+ * update dependencies ([6fb5a7b](https://github.com/mister-ben/videojs-mobile-ui/commit/6fb5a7b))
46
+
47
+ <a name="0.6.1"></a>
48
+ ## [0.6.1](https://github.com/mister-ben/videojs-mobile-ui/compare/v0.6.0...v0.6.1) (2021-08-27)
49
+
50
+ ### Bug Fixes
51
+
52
+ * Split orientation string ([0eebd64](https://github.com/mister-ben/videojs-mobile-ui/commit/0eebd64))
53
+
1
54
  <a name="0.6.0"></a>
2
55
  # 0.6.0 (2021-08-27)
3
56
 
package/README.md CHANGED
@@ -12,6 +12,7 @@ Fullscreen control:
12
12
 
13
13
  - Rotate to landscape to enter Fullscreen
14
14
  - Lock to fullscreen on rotate
15
+ - Always lock to landscape when entering fullscreen (works even when device rotation is disabled/non-functional)
15
16
 
16
17
  ## Table of Contents
17
18
 
@@ -45,12 +46,16 @@ npm install --save videojs-mobile-ui
45
46
  fullscreen: {
46
47
  enterOnRotate: true,
47
48
  exitOnRotate: true,
48
- lockOnRotate: true
49
+ lockOnRotate: true,
50
+ lockToLandscapeOnEnter: false,
51
+ iOS: false,
52
+ disabled: false
49
53
  },
50
54
  touchControls: {
51
55
  seekSeconds: 10,
52
56
  tapTimeout: 300,
53
- disableOnEnd: false
57
+ disableOnEnd: false,
58
+ disabled: false,
54
59
  }
55
60
  };
56
61
  ```
@@ -60,10 +65,13 @@ npm install --save videojs-mobile-ui
60
65
  - *fullscreen.enterOnRotate* `boolean` Whether to go fullscreen when rotating to landscape
61
66
  - *fullscreen.exitOnRotate* `boolean` Whether to leave fullscreen when rotating to portrait (if not locked)
62
67
  - *fullscreen.lockOnRotate* `boolean` Whether to lock to fullscreen when rotating to landscape
68
+ - *fullscreen.lockToLandscapeOnEnter* `boolean` Whether to lock to landscape when entering fullscreen (works even when device rotation is disabled/non-functional)
63
69
  - *fullscreen.iOS* `boolean` Whether to use fake fullscreen on iOS (needed for controls to work)
70
+ - *fullscreen.disabled* `boolean` If true no fullscreen handling except the *deprecated* iOS fullwindow hack
64
71
  - *touchControls.seekSeconds* `int` Seconds to seek when double-tapping
65
72
  - *touchControls.tapTimeout* `int` Milliseconds to consider a double-tap
66
73
  - *touchControls.disableOnEnd* `boolean` Whether to disable touch controls when the video has ended, e.g. if an endscreen is used. Automatically disables if the endscreen plugin is present when this plugin initialises
74
+ - *touchControls.disableOnEnd* `boolean` If true no touch controls are added.
67
75
 
68
76
  ## Usage
69
77
 
@@ -1,4 +1,4 @@
1
- /*! @name videojs-mobile-ui @version 0.6.0 @license MIT */
1
+ /*! @name videojs-mobile-ui @version 0.8.0 @license MIT */
2
2
  'use strict';
3
3
 
4
4
  var videojs = require('video.js');
@@ -11,7 +11,7 @@ var videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs);
11
11
  var _inheritsLoose__default = /*#__PURE__*/_interopDefaultLegacy(_inheritsLoose);
12
12
  var window__default = /*#__PURE__*/_interopDefaultLegacy(window);
13
13
 
14
- var version = "0.6.0";
14
+ var version = "0.8.0";
15
15
 
16
16
  var Component = videojs__default['default'].getComponent('Component');
17
17
  var dom = videojs__default['default'].dom || videojs__default['default'];
@@ -183,12 +183,15 @@ var defaults = {
183
183
  enterOnRotate: true,
184
184
  exitOnRotate: true,
185
185
  lockOnRotate: true,
186
- iOS: false
186
+ lockToLandscapeOnEnter: false,
187
+ iOS: false,
188
+ disabled: false
187
189
  },
188
190
  touchControls: {
189
191
  seekSeconds: 10,
190
192
  tapTimeout: 300,
191
- disableOnEnd: false
193
+ disableOnEnd: false,
194
+ disabled: false
192
195
  }
193
196
  };
194
197
  var screen = window__default['default'].screen;
@@ -201,7 +204,7 @@ var screen = window__default['default'].screen;
201
204
  var getOrientation = function getOrientation() {
202
205
  if (screen) {
203
206
  // Prefer the string over angle, as 0° can be landscape on some tablets
204
- var orientationString = (screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation || ''.split('-');
207
+ var orientationString = ((screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation || '').split('-')[0];
205
208
 
206
209
  if (orientationString === 'landscape' || orientationString === 'portrait') {
207
210
  return orientationString;
@@ -236,31 +239,42 @@ var registerPlugin = videojs__default['default'].registerPlugin || videojs__defa
236
239
  var onPlayerReady = function onPlayerReady(player, options) {
237
240
  player.addClass('vjs-mobile-ui');
238
241
 
239
- if (options.touchControls.disableOnEnd || typeof player.endscreen === 'function') {
240
- player.addClass('vjs-mobile-ui-disable-end');
242
+ if (options.fullscreen.iOS) {
243
+ videojs__default['default'].log.warn('videojs-mobile-ui: `fullscreen.iOS` is deprecated. Use Video.js option `preferFullWindow` instead.');
244
+
245
+ if (videojs__default['default'].browser.IS_IOS && videojs__default['default'].browser.IOS_VERSION > 9 && !player.el_.ownerDocument.querySelector('.bc-iframe')) {
246
+ player.tech_.el_.setAttribute('playsinline', 'playsinline');
247
+
248
+ player.tech_.supportsFullScreen = function () {
249
+ return false;
250
+ };
251
+ }
241
252
  }
242
253
 
243
- if (options.fullscreen.iOS && videojs__default['default'].browser.IS_IOS && videojs__default['default'].browser.IOS_VERSION > 9 && !player.el_.ownerDocument.querySelector('.bc-iframe')) {
244
- player.tech_.el_.setAttribute('playsinline', 'playsinline');
254
+ if (!options.touchControls.disabled) {
255
+ if (options.touchControls.disableOnEnd || typeof player.endscreen === 'function') {
256
+ player.addClass('vjs-mobile-ui-disable-end');
257
+ } // Insert before the control bar
245
258
 
246
- player.tech_.supportsFullScreen = function () {
247
- return false;
248
- };
249
- } // Insert before the control bar
250
259
 
260
+ var controlBarIdx;
261
+ var versionParts = videojs__default['default'].VERSION.split('.');
262
+ var major = parseInt(versionParts[0], 10);
263
+ var minor = parseInt(versionParts[1], 10); // Video.js < 7.7.0 doesn't account for precedding components that don't have elements
251
264
 
252
- var controlBarIdx;
253
- var versionParts = videojs__default['default'].VERSION.split('.');
254
- var major = parseInt(versionParts[0], 10);
255
- var minor = parseInt(versionParts[1], 10); // Video.js < 7.7.0 doesn't account for precedding components that don't have elements
265
+ if (major < 7 || major === 7 && minor < 7) {
266
+ controlBarIdx = Array.prototype.indexOf.call(player.el_.children, player.getChild('ControlBar').el_);
267
+ } else {
268
+ controlBarIdx = player.children_.indexOf(player.getChild('ControlBar'));
269
+ }
270
+
271
+ player.touchOverlay = player.addChild('TouchOverlay', options.touchControls, controlBarIdx);
272
+ }
256
273
 
257
- if (major < 7 || major === 7 && minor < 7) {
258
- controlBarIdx = Array.prototype.indexOf.call(player.el_.children, player.getChild('ControlBar').el_);
259
- } else {
260
- controlBarIdx = player.children_.indexOf(player.getChild('ControlBar'));
274
+ if (options.fullscreen.disabled) {
275
+ return;
261
276
  }
262
277
 
263
- player.addChild('TouchOverlay', options.touchControls, controlBarIdx);
264
278
  var locked = false;
265
279
 
266
280
  var rotationHandler = function rotationHandler() {
@@ -270,7 +284,7 @@ var onPlayerReady = function onPlayerReady(player, options) {
270
284
  if (player.paused() === false) {
271
285
  player.requestFullscreen();
272
286
 
273
- if (options.fullscreen.lockOnRotate && screen.orientation && screen.orientation.lock) {
287
+ if ((options.fullscreen.lockOnRotate || options.fullscreen.lockToLandscapeOnEnter) && screen.orientation && screen.orientation.lock) {
274
288
  screen.orientation.lock('landscape').then(function () {
275
289
  locked = true;
276
290
  }).catch(function (e) {
@@ -300,14 +314,20 @@ var onPlayerReady = function onPlayerReady(player, options) {
300
314
  }
301
315
  }
302
316
 
303
- player.on('ended', function (_) {
304
- if (locked === true) {
317
+ player.on('fullscreenchange', function (_) {
318
+ if (player.isFullscreen() && options.fullscreen.lockToLandscapeOnEnter && getOrientation() === 'portrait') {
319
+ screen.orientation.lock('landscape').then(function () {
320
+ locked = true;
321
+ }).catch(function (e) {
322
+ videojs__default['default'].log('Browser refused orientation lock:', e);
323
+ });
324
+ } else if (!player.isFullscreen() && locked) {
305
325
  screen.orientation.unlock();
306
326
  locked = false;
307
327
  }
308
328
  });
309
- player.on('fullscreenchange', function (_) {
310
- if (!player.isFullscreen() && locked) {
329
+ player.on('ended', function (_) {
330
+ if (locked === true) {
311
331
  screen.orientation.unlock();
312
332
  locked = false;
313
333
  }
@@ -325,17 +345,24 @@ var onPlayerReady = function onPlayerReady(player, options) {
325
345
  * Enables the display regardless of user agent, for testing purposes
326
346
  * @param {Object} [options.fullscreen={}]
327
347
  * Fullscreen options.
348
+ * @param {boolean} [options.fullscreen.disabled=false]
349
+ * If true no fullscreen handling except the *deprecated* iOS fullwindow hack
328
350
  * @param {boolean} [options.fullscreen.enterOnRotate=true]
329
351
  * Whether to go fullscreen when rotating to landscape
330
352
  * @param {boolean} [options.fullscreen.exitOnRotate=true]
331
353
  * Whether to leave fullscreen when rotating to portrait (if not locked)
332
354
  * @param {boolean} [options.fullscreen.lockOnRotate=true]
333
355
  * Whether to lock orientation when rotating to landscape
356
+ * Unlocked when exiting fullscreen or on 'ended
357
+ * @param {boolean} [options.fullscreen.lockToLandscapeOnEnter=false]
358
+ * Whether to always lock orientation to landscape on fullscreen mode
334
359
  * Unlocked when exiting fullscreen or on 'ended'
335
360
  * @param {boolean} [options.fullscreen.iOS=false]
336
- * Whether to disable iOS's native fullscreen so controls can work
361
+ * Deprecated: Whether to disable iOS's native fullscreen so controls can work
337
362
  * @param {Object} [options.touchControls={}]
338
363
  * Touch UI options.
364
+ * @param {boolean} [options.touchControls.disabled=false]
365
+ * If true no touch controls are added.
339
366
  * @param {int} [options.touchControls.seekSeconds=10]
340
367
  * Number of seconds to seek on double-tap
341
368
  * @param {int} [options.touchControls.tapTimeout=300]
@@ -1,2 +1,2 @@
1
- /*! @name videojs-mobile-ui @version 0.6.0 @license MIT */
1
+ /*! @name videojs-mobile-ui @version 0.8.0 @license MIT */
2
2
  @-webkit-keyframes fadeAndScale{0%,to{opacity:0}25%{opacity:1}}@keyframes fadeAndScale{0%,to{opacity:0}25%{opacity:1}}.video-js.vjs-has-started .vjs-touch-overlay{position:absolute;pointer-events:auto;top:0}.video-js .vjs-touch-overlay{display:block;width:100%;height:100%;pointer-events:none}.video-js .vjs-touch-overlay.skip{opacity:0;-webkit-animation:fadeAndScale .6s linear;animation:fadeAndScale .6s linear;background-repeat:no-repeat;background-position:80% center;background-size:10%;background-image:url('data:image/svg+xml;utf8,<svg fill="%23FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>')}.video-js .vjs-touch-overlay.skip.reverse{background-position:20% center;background-image:url('data:image/svg+xml;utf8,<svg fill="%23FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>')}.video-js .vjs-touch-overlay .vjs-play-control{top:50%;left:50%;transform:translate(-50%,-50%);position:absolute;width:30%;height:80%;pointer-events:none;opacity:0;transition:opacity .3s ease}.video-js .vjs-touch-overlay .vjs-play-control .vjs-icon-placeholder::before{content:'';background-size:60%;background-position:center center;background-repeat:no-repeat;background-image:url('data:image/svg+xml;utf8,<svg fill="%23FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/><path d="M0 0h24v24H0z" fill="none"/></svg>')}.video-js .vjs-touch-overlay .vjs-play-control.vjs-paused .vjs-icon-placeholder::before{content:'';background-image:url('data:image/svg+xml;utf8,<svg fill="%23FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8 5v14l11-7z"/><path d="M0 0h24v24H0z" fill="none"/></svg>')}.video-js .vjs-touch-overlay .vjs-play-control.vjs-ended .vjs-icon-placeholder::before{content:'';background-image:url('data:image/svg+xml;utf8,<svg fill="%23FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/></svg>')}.video-js .vjs-touch-overlay.show-play-toggle .vjs-play-control{opacity:1;pointer-events:auto}.video-js.vjs-mobile-ui-disable-end.vjs-ended .vjs-touch-overlay{display:none}
@@ -1,9 +1,9 @@
1
- /*! @name videojs-mobile-ui @version 0.6.0 @license MIT */
1
+ /*! @name videojs-mobile-ui @version 0.8.0 @license MIT */
2
2
  import videojs from 'video.js';
3
3
  import _inheritsLoose from '@babel/runtime/helpers/inheritsLoose';
4
4
  import window from 'global/window';
5
5
 
6
- var version = "0.6.0";
6
+ var version = "0.8.0";
7
7
 
8
8
  var Component = videojs.getComponent('Component');
9
9
  var dom = videojs.dom || videojs;
@@ -175,12 +175,15 @@ var defaults = {
175
175
  enterOnRotate: true,
176
176
  exitOnRotate: true,
177
177
  lockOnRotate: true,
178
- iOS: false
178
+ lockToLandscapeOnEnter: false,
179
+ iOS: false,
180
+ disabled: false
179
181
  },
180
182
  touchControls: {
181
183
  seekSeconds: 10,
182
184
  tapTimeout: 300,
183
- disableOnEnd: false
185
+ disableOnEnd: false,
186
+ disabled: false
184
187
  }
185
188
  };
186
189
  var screen = window.screen;
@@ -193,7 +196,7 @@ var screen = window.screen;
193
196
  var getOrientation = function getOrientation() {
194
197
  if (screen) {
195
198
  // Prefer the string over angle, as 0° can be landscape on some tablets
196
- var orientationString = (screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation || ''.split('-');
199
+ var orientationString = ((screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation || '').split('-')[0];
197
200
 
198
201
  if (orientationString === 'landscape' || orientationString === 'portrait') {
199
202
  return orientationString;
@@ -228,31 +231,42 @@ var registerPlugin = videojs.registerPlugin || videojs.plugin;
228
231
  var onPlayerReady = function onPlayerReady(player, options) {
229
232
  player.addClass('vjs-mobile-ui');
230
233
 
231
- if (options.touchControls.disableOnEnd || typeof player.endscreen === 'function') {
232
- player.addClass('vjs-mobile-ui-disable-end');
234
+ if (options.fullscreen.iOS) {
235
+ videojs.log.warn('videojs-mobile-ui: `fullscreen.iOS` is deprecated. Use Video.js option `preferFullWindow` instead.');
236
+
237
+ if (videojs.browser.IS_IOS && videojs.browser.IOS_VERSION > 9 && !player.el_.ownerDocument.querySelector('.bc-iframe')) {
238
+ player.tech_.el_.setAttribute('playsinline', 'playsinline');
239
+
240
+ player.tech_.supportsFullScreen = function () {
241
+ return false;
242
+ };
243
+ }
233
244
  }
234
245
 
235
- if (options.fullscreen.iOS && videojs.browser.IS_IOS && videojs.browser.IOS_VERSION > 9 && !player.el_.ownerDocument.querySelector('.bc-iframe')) {
236
- player.tech_.el_.setAttribute('playsinline', 'playsinline');
246
+ if (!options.touchControls.disabled) {
247
+ if (options.touchControls.disableOnEnd || typeof player.endscreen === 'function') {
248
+ player.addClass('vjs-mobile-ui-disable-end');
249
+ } // Insert before the control bar
237
250
 
238
- player.tech_.supportsFullScreen = function () {
239
- return false;
240
- };
241
- } // Insert before the control bar
242
251
 
252
+ var controlBarIdx;
253
+ var versionParts = videojs.VERSION.split('.');
254
+ var major = parseInt(versionParts[0], 10);
255
+ var minor = parseInt(versionParts[1], 10); // Video.js < 7.7.0 doesn't account for precedding components that don't have elements
243
256
 
244
- var controlBarIdx;
245
- var versionParts = videojs.VERSION.split('.');
246
- var major = parseInt(versionParts[0], 10);
247
- var minor = parseInt(versionParts[1], 10); // Video.js < 7.7.0 doesn't account for precedding components that don't have elements
257
+ if (major < 7 || major === 7 && minor < 7) {
258
+ controlBarIdx = Array.prototype.indexOf.call(player.el_.children, player.getChild('ControlBar').el_);
259
+ } else {
260
+ controlBarIdx = player.children_.indexOf(player.getChild('ControlBar'));
261
+ }
262
+
263
+ player.touchOverlay = player.addChild('TouchOverlay', options.touchControls, controlBarIdx);
264
+ }
248
265
 
249
- if (major < 7 || major === 7 && minor < 7) {
250
- controlBarIdx = Array.prototype.indexOf.call(player.el_.children, player.getChild('ControlBar').el_);
251
- } else {
252
- controlBarIdx = player.children_.indexOf(player.getChild('ControlBar'));
266
+ if (options.fullscreen.disabled) {
267
+ return;
253
268
  }
254
269
 
255
- player.addChild('TouchOverlay', options.touchControls, controlBarIdx);
256
270
  var locked = false;
257
271
 
258
272
  var rotationHandler = function rotationHandler() {
@@ -262,7 +276,7 @@ var onPlayerReady = function onPlayerReady(player, options) {
262
276
  if (player.paused() === false) {
263
277
  player.requestFullscreen();
264
278
 
265
- if (options.fullscreen.lockOnRotate && screen.orientation && screen.orientation.lock) {
279
+ if ((options.fullscreen.lockOnRotate || options.fullscreen.lockToLandscapeOnEnter) && screen.orientation && screen.orientation.lock) {
266
280
  screen.orientation.lock('landscape').then(function () {
267
281
  locked = true;
268
282
  }).catch(function (e) {
@@ -292,14 +306,20 @@ var onPlayerReady = function onPlayerReady(player, options) {
292
306
  }
293
307
  }
294
308
 
295
- player.on('ended', function (_) {
296
- if (locked === true) {
309
+ player.on('fullscreenchange', function (_) {
310
+ if (player.isFullscreen() && options.fullscreen.lockToLandscapeOnEnter && getOrientation() === 'portrait') {
311
+ screen.orientation.lock('landscape').then(function () {
312
+ locked = true;
313
+ }).catch(function (e) {
314
+ videojs.log('Browser refused orientation lock:', e);
315
+ });
316
+ } else if (!player.isFullscreen() && locked) {
297
317
  screen.orientation.unlock();
298
318
  locked = false;
299
319
  }
300
320
  });
301
- player.on('fullscreenchange', function (_) {
302
- if (!player.isFullscreen() && locked) {
321
+ player.on('ended', function (_) {
322
+ if (locked === true) {
303
323
  screen.orientation.unlock();
304
324
  locked = false;
305
325
  }
@@ -317,17 +337,24 @@ var onPlayerReady = function onPlayerReady(player, options) {
317
337
  * Enables the display regardless of user agent, for testing purposes
318
338
  * @param {Object} [options.fullscreen={}]
319
339
  * Fullscreen options.
340
+ * @param {boolean} [options.fullscreen.disabled=false]
341
+ * If true no fullscreen handling except the *deprecated* iOS fullwindow hack
320
342
  * @param {boolean} [options.fullscreen.enterOnRotate=true]
321
343
  * Whether to go fullscreen when rotating to landscape
322
344
  * @param {boolean} [options.fullscreen.exitOnRotate=true]
323
345
  * Whether to leave fullscreen when rotating to portrait (if not locked)
324
346
  * @param {boolean} [options.fullscreen.lockOnRotate=true]
325
347
  * Whether to lock orientation when rotating to landscape
348
+ * Unlocked when exiting fullscreen or on 'ended
349
+ * @param {boolean} [options.fullscreen.lockToLandscapeOnEnter=false]
350
+ * Whether to always lock orientation to landscape on fullscreen mode
326
351
  * Unlocked when exiting fullscreen or on 'ended'
327
352
  * @param {boolean} [options.fullscreen.iOS=false]
328
- * Whether to disable iOS's native fullscreen so controls can work
353
+ * Deprecated: Whether to disable iOS's native fullscreen so controls can work
329
354
  * @param {Object} [options.touchControls={}]
330
355
  * Touch UI options.
356
+ * @param {boolean} [options.touchControls.disabled=false]
357
+ * If true no touch controls are added.
331
358
  * @param {int} [options.touchControls.seekSeconds=10]
332
359
  * Number of seconds to seek on double-tap
333
360
  * @param {int} [options.touchControls.tapTimeout=300]
@@ -1,4 +1,4 @@
1
- /*! @name videojs-mobile-ui @version 0.6.0 @license MIT */
1
+ /*! @name videojs-mobile-ui @version 0.8.0 @license MIT */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js'), require('global/window')) :
4
4
  typeof define === 'function' && define.amd ? define(['video.js', 'global/window'], factory) :
@@ -10,7 +10,7 @@
10
10
  var videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs);
11
11
  var window__default = /*#__PURE__*/_interopDefaultLegacy(window);
12
12
 
13
- var version = "0.6.0";
13
+ var version = "0.8.0";
14
14
 
15
15
  function createCommonjsModule(fn, basedir, module) {
16
16
  return module = {
@@ -222,12 +222,15 @@
222
222
  enterOnRotate: true,
223
223
  exitOnRotate: true,
224
224
  lockOnRotate: true,
225
- iOS: false
225
+ lockToLandscapeOnEnter: false,
226
+ iOS: false,
227
+ disabled: false
226
228
  },
227
229
  touchControls: {
228
230
  seekSeconds: 10,
229
231
  tapTimeout: 300,
230
- disableOnEnd: false
232
+ disableOnEnd: false,
233
+ disabled: false
231
234
  }
232
235
  };
233
236
  var screen = window__default['default'].screen;
@@ -240,7 +243,7 @@
240
243
  var getOrientation = function getOrientation() {
241
244
  if (screen) {
242
245
  // Prefer the string over angle, as 0° can be landscape on some tablets
243
- var orientationString = (screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation || ''.split('-');
246
+ var orientationString = ((screen.orientation || {}).type || screen.mozOrientation || screen.msOrientation || '').split('-')[0];
244
247
 
245
248
  if (orientationString === 'landscape' || orientationString === 'portrait') {
246
249
  return orientationString;
@@ -275,31 +278,42 @@
275
278
  var onPlayerReady = function onPlayerReady(player, options) {
276
279
  player.addClass('vjs-mobile-ui');
277
280
 
278
- if (options.touchControls.disableOnEnd || typeof player.endscreen === 'function') {
279
- player.addClass('vjs-mobile-ui-disable-end');
281
+ if (options.fullscreen.iOS) {
282
+ videojs__default['default'].log.warn('videojs-mobile-ui: `fullscreen.iOS` is deprecated. Use Video.js option `preferFullWindow` instead.');
283
+
284
+ if (videojs__default['default'].browser.IS_IOS && videojs__default['default'].browser.IOS_VERSION > 9 && !player.el_.ownerDocument.querySelector('.bc-iframe')) {
285
+ player.tech_.el_.setAttribute('playsinline', 'playsinline');
286
+
287
+ player.tech_.supportsFullScreen = function () {
288
+ return false;
289
+ };
290
+ }
280
291
  }
281
292
 
282
- if (options.fullscreen.iOS && videojs__default['default'].browser.IS_IOS && videojs__default['default'].browser.IOS_VERSION > 9 && !player.el_.ownerDocument.querySelector('.bc-iframe')) {
283
- player.tech_.el_.setAttribute('playsinline', 'playsinline');
293
+ if (!options.touchControls.disabled) {
294
+ if (options.touchControls.disableOnEnd || typeof player.endscreen === 'function') {
295
+ player.addClass('vjs-mobile-ui-disable-end');
296
+ } // Insert before the control bar
284
297
 
285
- player.tech_.supportsFullScreen = function () {
286
- return false;
287
- };
288
- } // Insert before the control bar
289
298
 
299
+ var controlBarIdx;
300
+ var versionParts = videojs__default['default'].VERSION.split('.');
301
+ var major = parseInt(versionParts[0], 10);
302
+ var minor = parseInt(versionParts[1], 10); // Video.js < 7.7.0 doesn't account for precedding components that don't have elements
290
303
 
291
- var controlBarIdx;
292
- var versionParts = videojs__default['default'].VERSION.split('.');
293
- var major = parseInt(versionParts[0], 10);
294
- var minor = parseInt(versionParts[1], 10); // Video.js < 7.7.0 doesn't account for precedding components that don't have elements
304
+ if (major < 7 || major === 7 && minor < 7) {
305
+ controlBarIdx = Array.prototype.indexOf.call(player.el_.children, player.getChild('ControlBar').el_);
306
+ } else {
307
+ controlBarIdx = player.children_.indexOf(player.getChild('ControlBar'));
308
+ }
309
+
310
+ player.touchOverlay = player.addChild('TouchOverlay', options.touchControls, controlBarIdx);
311
+ }
295
312
 
296
- if (major < 7 || major === 7 && minor < 7) {
297
- controlBarIdx = Array.prototype.indexOf.call(player.el_.children, player.getChild('ControlBar').el_);
298
- } else {
299
- controlBarIdx = player.children_.indexOf(player.getChild('ControlBar'));
313
+ if (options.fullscreen.disabled) {
314
+ return;
300
315
  }
301
316
 
302
- player.addChild('TouchOverlay', options.touchControls, controlBarIdx);
303
317
  var locked = false;
304
318
 
305
319
  var rotationHandler = function rotationHandler() {
@@ -309,7 +323,7 @@
309
323
  if (player.paused() === false) {
310
324
  player.requestFullscreen();
311
325
 
312
- if (options.fullscreen.lockOnRotate && screen.orientation && screen.orientation.lock) {
326
+ if ((options.fullscreen.lockOnRotate || options.fullscreen.lockToLandscapeOnEnter) && screen.orientation && screen.orientation.lock) {
313
327
  screen.orientation.lock('landscape').then(function () {
314
328
  locked = true;
315
329
  }).catch(function (e) {
@@ -339,14 +353,20 @@
339
353
  }
340
354
  }
341
355
 
342
- player.on('ended', function (_) {
343
- if (locked === true) {
356
+ player.on('fullscreenchange', function (_) {
357
+ if (player.isFullscreen() && options.fullscreen.lockToLandscapeOnEnter && getOrientation() === 'portrait') {
358
+ screen.orientation.lock('landscape').then(function () {
359
+ locked = true;
360
+ }).catch(function (e) {
361
+ videojs__default['default'].log('Browser refused orientation lock:', e);
362
+ });
363
+ } else if (!player.isFullscreen() && locked) {
344
364
  screen.orientation.unlock();
345
365
  locked = false;
346
366
  }
347
367
  });
348
- player.on('fullscreenchange', function (_) {
349
- if (!player.isFullscreen() && locked) {
368
+ player.on('ended', function (_) {
369
+ if (locked === true) {
350
370
  screen.orientation.unlock();
351
371
  locked = false;
352
372
  }
@@ -364,17 +384,24 @@
364
384
  * Enables the display regardless of user agent, for testing purposes
365
385
  * @param {Object} [options.fullscreen={}]
366
386
  * Fullscreen options.
387
+ * @param {boolean} [options.fullscreen.disabled=false]
388
+ * If true no fullscreen handling except the *deprecated* iOS fullwindow hack
367
389
  * @param {boolean} [options.fullscreen.enterOnRotate=true]
368
390
  * Whether to go fullscreen when rotating to landscape
369
391
  * @param {boolean} [options.fullscreen.exitOnRotate=true]
370
392
  * Whether to leave fullscreen when rotating to portrait (if not locked)
371
393
  * @param {boolean} [options.fullscreen.lockOnRotate=true]
372
394
  * Whether to lock orientation when rotating to landscape
395
+ * Unlocked when exiting fullscreen or on 'ended
396
+ * @param {boolean} [options.fullscreen.lockToLandscapeOnEnter=false]
397
+ * Whether to always lock orientation to landscape on fullscreen mode
373
398
  * Unlocked when exiting fullscreen or on 'ended'
374
399
  * @param {boolean} [options.fullscreen.iOS=false]
375
- * Whether to disable iOS's native fullscreen so controls can work
400
+ * Deprecated: Whether to disable iOS's native fullscreen so controls can work
376
401
  * @param {Object} [options.touchControls={}]
377
402
  * Touch UI options.
403
+ * @param {boolean} [options.touchControls.disabled=false]
404
+ * If true no touch controls are added.
378
405
  * @param {int} [options.touchControls.seekSeconds=10]
379
406
  * Number of seconds to seek on double-tap
380
407
  * @param {int} [options.touchControls.tapTimeout=300]
@@ -1,2 +1,2 @@
1
- /*! @name videojs-mobile-ui @version 0.6.0 @license MIT */
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js"),require("global/window")):"function"==typeof define&&define.amd?define(["video.js","global/window"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojsMobileUi=t(e.videojs,e.window)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e),i=n(t);function r(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var a=r((function(e){function t(n,o){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(n,o)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})),s=r((function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,a(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0})),l=o.default.getComponent("Component"),u=o.default.dom||o.default,c=function(e){function t(t,n){var o;return(o=e.call(this,t,n)||this).seekSeconds=n.seekSeconds,o.tapTimeout=n.tapTimeout,o.addChild("playToggle",{}),t.on(["playing","userinactive"],(function(e){o.removeClass("show-play-toggle")})),0===o.player_.options_.inactivityTimeout&&(o.player_.options_.inactivityTimeout=5e3),o.enable(),o}s(t,e);var n=t.prototype;return n.createEl=function(){return u.createEl("div",{className:"vjs-touch-overlay",tabIndex:-1})},n.handleTap=function(e){var t=this;e.target===this.el_&&(e.preventDefault(),this.firstTapCaptured?(this.firstTapCaptured=!1,this.timeout&&i.default.clearTimeout(this.timeout),this.handleDoubleTap(e)):(this.firstTapCaptured=!0,this.timeout=i.default.setTimeout((function(){t.firstTapCaptured=!1,t.handleSingleTap(e)}),this.tapTimeout)))},n.handleSingleTap=function(e){this.removeClass("skip"),this.toggleClass("show-play-toggle")},n.handleDoubleTap=function(e){var t=this,n=this.el_.getBoundingClientRect(),o=e.changedTouches[0].clientX-n.left;if(o<.4*n.width)this.player_.currentTime(Math.max(0,this.player_.currentTime()-this.seekSeconds)),this.addClass("reverse");else{if(!(o>n.width-.4*n.width))return;this.player_.currentTime(Math.min(this.player_.duration(),this.player_.currentTime()+this.seekSeconds)),this.removeClass("reverse")}this.removeClass("show-play-toggle"),this.removeClass("skip"),i.default.requestAnimationFrame((function(){t.addClass("skip")}))},n.enable=function(){this.firstTapCaptured=!1,this.on("touchend",this.handleTap)},n.disable=function(){this.off("touchend",this.handleTap)},t}(l);l.registerComponent("TouchOverlay",c);var d={fullscreen:{enterOnRotate:!0,exitOnRotate:!0,lockOnRotate:!0,iOS:!1},touchControls:{seekSeconds:10,tapTimeout:300,disableOnEnd:!1}},p=i.default.screen,f=o.default.registerPlugin||o.default.plugin,h=function(e,t){var n;e.addClass("vjs-mobile-ui"),(t.touchControls.disableOnEnd||"function"==typeof e.endscreen)&&e.addClass("vjs-mobile-ui-disable-end"),t.fullscreen.iOS&&o.default.browser.IS_IOS&&o.default.browser.IOS_VERSION>9&&!e.el_.ownerDocument.querySelector(".bc-iframe")&&(e.tech_.el_.setAttribute("playsinline","playsinline"),e.tech_.supportsFullScreen=function(){return!1});var r=o.default.VERSION.split("."),a=parseInt(r[0],10),s=parseInt(r[1],10);n=a<7||7===a&&s<7?Array.prototype.indexOf.call(e.el_.children,e.getChild("ControlBar").el_):e.children_.indexOf(e.getChild("ControlBar")),e.addChild("TouchOverlay",t.touchControls,n);var l=!1,u=function(){var n=function(){if(p){var e=(p.orientation||{}).type||p.mozOrientation||p.msOrientation||"".split("-");if("landscape"===e||"portrait"===e)return e}return"number"==typeof i.default.orientation?0===i.default.orientation||180===i.default.orientation?"portrait":"landscape":"portrait"}();"landscape"===n&&t.fullscreen.enterOnRotate?!1===e.paused()&&(e.requestFullscreen(),t.fullscreen.lockOnRotate&&p.orientation&&p.orientation.lock&&p.orientation.lock("landscape").then((function(){l=!0})).catch((function(e){o.default.log("Browser refused orientation lock:",e)}))):"portrait"===n&&t.fullscreen.exitOnRotate&&!l&&e.isFullscreen()&&e.exitFullscreen()};(t.fullscreen.enterOnRotate||t.fullscreen.exitOnRotate)&&(o.default.browser.IS_IOS?(i.default.addEventListener("orientationchange",u),e.on("dispose",(function(){i.default.removeEventListener("orientationchange",u)}))):p.orientation&&(p.orientation.onchange=u,e.on("dispose",(function(){p.orientation.onchange=null})))),e.on("ended",(function(e){!0===l&&(p.orientation.unlock(),l=!1)})),e.on("fullscreenchange",(function(t){!e.isFullscreen()&&l&&(p.orientation.unlock(),l=!1)}))},m=function(e){var t=this;void 0===e&&(e={}),(e.forceForTesting||o.default.browser.IS_ANDROID||o.default.browser.IS_IOS)&&this.ready((function(){h(t,o.default.mergeOptions(d,e))}))};return f("mobileUi",m),m.VERSION="0.6.0",m}));
1
+ /*! @name videojs-mobile-ui @version 0.8.0 @license MIT */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js"),require("global/window")):"function"==typeof define&&define.amd?define(["video.js","global/window"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojsMobileUi=t(e.videojs,e.window)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e),i=n(t);function r(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var a=r((function(e){function t(n,o){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(n,o)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})),l=r((function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,a(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0})),s=o.default.getComponent("Component"),u=o.default.dom||o.default,c=function(e){function t(t,n){var o;return(o=e.call(this,t,n)||this).seekSeconds=n.seekSeconds,o.tapTimeout=n.tapTimeout,o.addChild("playToggle",{}),t.on(["playing","userinactive"],(function(e){o.removeClass("show-play-toggle")})),0===o.player_.options_.inactivityTimeout&&(o.player_.options_.inactivityTimeout=5e3),o.enable(),o}l(t,e);var n=t.prototype;return n.createEl=function(){return u.createEl("div",{className:"vjs-touch-overlay",tabIndex:-1})},n.handleTap=function(e){var t=this;e.target===this.el_&&(e.preventDefault(),this.firstTapCaptured?(this.firstTapCaptured=!1,this.timeout&&i.default.clearTimeout(this.timeout),this.handleDoubleTap(e)):(this.firstTapCaptured=!0,this.timeout=i.default.setTimeout((function(){t.firstTapCaptured=!1,t.handleSingleTap(e)}),this.tapTimeout)))},n.handleSingleTap=function(e){this.removeClass("skip"),this.toggleClass("show-play-toggle")},n.handleDoubleTap=function(e){var t=this,n=this.el_.getBoundingClientRect(),o=e.changedTouches[0].clientX-n.left;if(o<.4*n.width)this.player_.currentTime(Math.max(0,this.player_.currentTime()-this.seekSeconds)),this.addClass("reverse");else{if(!(o>n.width-.4*n.width))return;this.player_.currentTime(Math.min(this.player_.duration(),this.player_.currentTime()+this.seekSeconds)),this.removeClass("reverse")}this.removeClass("show-play-toggle"),this.removeClass("skip"),i.default.requestAnimationFrame((function(){t.addClass("skip")}))},n.enable=function(){this.firstTapCaptured=!1,this.on("touchend",this.handleTap)},n.disable=function(){this.off("touchend",this.handleTap)},t}(s);s.registerComponent("TouchOverlay",c);var d={fullscreen:{enterOnRotate:!0,exitOnRotate:!0,lockOnRotate:!0,lockToLandscapeOnEnter:!1,iOS:!1,disabled:!1},touchControls:{seekSeconds:10,tapTimeout:300,disableOnEnd:!1,disabled:!1}},f=i.default.screen,p=function(){if(f){var e=((f.orientation||{}).type||f.mozOrientation||f.msOrientation||"").split("-")[0];if("landscape"===e||"portrait"===e)return e}return"number"==typeof i.default.orientation?0===i.default.orientation||180===i.default.orientation?"portrait":"landscape":"portrait"},h=o.default.registerPlugin||o.default.plugin,m=function(e){var t=this;void 0===e&&(e={}),(e.forceForTesting||o.default.browser.IS_ANDROID||o.default.browser.IS_IOS)&&this.ready((function(){!function(e,t){if(e.addClass("vjs-mobile-ui"),t.fullscreen.iOS&&(o.default.log.warn("videojs-mobile-ui: `fullscreen.iOS` is deprecated. Use Video.js option `preferFullWindow` instead."),o.default.browser.IS_IOS&&o.default.browser.IOS_VERSION>9&&!e.el_.ownerDocument.querySelector(".bc-iframe")&&(e.tech_.el_.setAttribute("playsinline","playsinline"),e.tech_.supportsFullScreen=function(){return!1})),!t.touchControls.disabled){var n;(t.touchControls.disableOnEnd||"function"==typeof e.endscreen)&&e.addClass("vjs-mobile-ui-disable-end");var r=o.default.VERSION.split("."),a=parseInt(r[0],10),l=parseInt(r[1],10);n=a<7||7===a&&l<7?Array.prototype.indexOf.call(e.el_.children,e.getChild("ControlBar").el_):e.children_.indexOf(e.getChild("ControlBar")),e.touchOverlay=e.addChild("TouchOverlay",t.touchControls,n)}if(!t.fullscreen.disabled){var s=!1,u=function(){var n=p();"landscape"===n&&t.fullscreen.enterOnRotate?!1===e.paused()&&(e.requestFullscreen(),(t.fullscreen.lockOnRotate||t.fullscreen.lockToLandscapeOnEnter)&&f.orientation&&f.orientation.lock&&f.orientation.lock("landscape").then((function(){s=!0})).catch((function(e){o.default.log("Browser refused orientation lock:",e)}))):"portrait"===n&&t.fullscreen.exitOnRotate&&!s&&e.isFullscreen()&&e.exitFullscreen()};(t.fullscreen.enterOnRotate||t.fullscreen.exitOnRotate)&&(o.default.browser.IS_IOS?(i.default.addEventListener("orientationchange",u),e.on("dispose",(function(){i.default.removeEventListener("orientationchange",u)}))):f.orientation&&(f.orientation.onchange=u,e.on("dispose",(function(){f.orientation.onchange=null})))),e.on("fullscreenchange",(function(n){e.isFullscreen()&&t.fullscreen.lockToLandscapeOnEnter&&"portrait"===p()?f.orientation.lock("landscape").then((function(){s=!0})).catch((function(e){o.default.log("Browser refused orientation lock:",e)})):!e.isFullscreen()&&s&&(f.orientation.unlock(),s=!1)})),e.on("ended",(function(e){!0===s&&(f.orientation.unlock(),s=!1)}))}}(t,o.default.mergeOptions(d,e))}))};return h("mobileUi",m),m.VERSION="0.8.0",m}));