From: Sweidan Omar Date: Tue, 22 Feb 2022 15:15:08 +0000 (+0000) Subject: video-js update X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=528d074ccdef86a00aa3f15b0cf1bf7569c23a77;p=mediacube.git video-js update git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32992 --- diff --git a/server/user.mediacube.gui/css/video-js.css b/server/user.mediacube.gui/css/video-js.css index 169f1de2..d7908dad 100644 --- a/server/user.mediacube.gui/css/video-js.css +++ b/server/user.mediacube.gui/css/video-js.css @@ -1,4 +1,5 @@ @charset "UTF-8"; + .vjs-modal-dialog .vjs-modal-dialog-content, .video-js .vjs-modal-dialog, .vjs-button > .vjs-icon-placeholder:before, .video-js .vjs-big-play-button .vjs-icon-placeholder:before { position: absolute; top: 0; @@ -379,7 +380,9 @@ .video-js.vjs-fluid, .video-js.vjs-16-9, -.video-js.vjs-4-3 { +.video-js.vjs-4-3, +.video-js.vjs-9-16, +.video-js.vjs-1-1 { width: 100%; max-width: 100%; height: 0; @@ -393,6 +396,14 @@ padding-top: 75%; } +.video-js.vjs-9-16 { + padding-top: 177.7777777778%; +} + +.video-js.vjs-1-1 { + padding-top: 100%; +} + .video-js.vjs-fill { width: 100%; height: 100%; @@ -422,7 +433,7 @@ body.vjs-full-window { right: 0; } -.video-js.vjs-fullscreen { +.video-js.vjs-fullscreen:not(.vjs-ios-native-fs) { width: 100% !important; height: 100% !important; padding-top: 0 !important; @@ -451,8 +462,8 @@ body.vjs-full-window { .vjs-lock-showing { display: block !important; - opacity: 1; - visibility: visible; + opacity: 1 !important; + visibility: visible !important; } .vjs-no-js { @@ -614,6 +625,11 @@ body.vjs-full-window { color: #2B333F; } +.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible), +.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible) { + background: none; +} + .vjs-menu li.vjs-menu-title { text-align: center; text-transform: uppercase; @@ -746,6 +762,7 @@ body.vjs-full-window { .vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar { visibility: visible; opacity: 0; + pointer-events: none; transition: visibility 1s, opacity 1s; } @@ -779,6 +796,10 @@ body.vjs-full-window { line-height: 1.67; } +.vjs-button > .vjs-icon-placeholder { + display: block; +} + .video-js .vjs-control:focus:before, .video-js .vjs-control:hover:before, .video-js .vjs-control:focus { @@ -1074,6 +1095,7 @@ body.vjs-full-window { .video-js .vjs-volume-level:before { position: absolute; font-size: 0.9em; + z-index: 1; } .vjs-slider-vertical .vjs-volume-level { @@ -1082,6 +1104,7 @@ body.vjs-full-window { .vjs-slider-vertical .vjs-volume-level:before { top: -0.5em; left: -0.3em; + z-index: 1; } .vjs-slider-horizontal .vjs-volume-level { @@ -1116,6 +1139,77 @@ body.vjs-full-window { left: -2em; } +.video-js .vjs-volume-tooltip { + background-color: #fff; + background-color: rgba(255, 255, 255, 0.8); + border-radius: 0.3em; + color: #000; + float: right; + font-family: Arial, Helvetica, sans-serif; + font-size: 1em; + padding: 6px 8px 8px 8px; + pointer-events: none; + position: absolute; + top: -3.4em; + visibility: hidden; + z-index: 1; +} + +.video-js .vjs-volume-control:hover .vjs-volume-tooltip, +.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip { + display: block; + font-size: 1em; + visibility: visible; +} + +.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip, +.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip { + left: 1em; + top: -12px; +} + +.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip { + font-size: 1em; +} + +.video-js .vjs-volume-control .vjs-mouse-display { + display: none; + position: absolute; + width: 100%; + height: 1px; + background-color: #000; + z-index: 1; +} + +.video-js .vjs-volume-horizontal .vjs-mouse-display { + width: 1px; + height: 100%; +} + +.vjs-no-flex .vjs-volume-control .vjs-mouse-display { + z-index: 0; +} + +.video-js .vjs-volume-control:hover .vjs-mouse-display { + display: block; +} + +.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display { + visibility: hidden; + opacity: 0; + transition: visibility 1s, opacity 1s; +} + +.video-js.vjs-user-inactive.vjs-no-flex .vjs-volume-control .vjs-mouse-display { + display: none; +} + +.vjs-mouse-display .vjs-volume-tooltip { + color: #fff; + background-color: #000; + background-color: rgba(0, 0, 0, 0.8); +} + .vjs-poster { display: inline-block; vertical-align: middle; @@ -1166,6 +1260,7 @@ body.vjs-full-window { } .video-js .vjs-seek-to-live-control { + align-items: center; cursor: pointer; flex: none; display: inline-flex; @@ -1210,10 +1305,8 @@ body.vjs-full-window { width: auto; padding-left: 1em; padding-right: 1em; - display: none; } - .vjs-live .vjs-time-control { display: none; } @@ -1223,15 +1316,6 @@ body.vjs-full-window { display: none; } -/**/ -.video-js .vjs-current-time { - display: block; -} -.video-js .vjs-remaining-time { - display: none; -} -/**/ - .video-js .vjs-duration, .vjs-no-flex .vjs-duration { display: none; @@ -1486,60 +1570,54 @@ video::-webkit-media-text-track-display { line-height: inherit; } -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-current-time, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-time-divider, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-duration, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-remaining-time, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-playback-rate, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-chapters-button, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-descriptions-button, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-captions-button, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-subtitles-button, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-audio-button, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-control, .video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-current-time, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-time-divider, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-duration, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-remaining-time, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-playback-rate, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-chapters-button, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-descriptions-button, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-captions-button, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-subtitles-button, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-audio-button, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-control, .video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-current-time, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-time-divider, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-duration, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-remaining-time, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-playback-rate, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-chapters-button, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-descriptions-button, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-captions-button, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-subtitles-button, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-audio-button, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-control { +.video-js.vjs-layout-small .vjs-current-time, +.video-js.vjs-layout-small .vjs-time-divider, +.video-js.vjs-layout-small .vjs-duration, +.video-js.vjs-layout-small .vjs-remaining-time, +.video-js.vjs-layout-small .vjs-playback-rate, +.video-js.vjs-layout-small .vjs-chapters-button, +.video-js.vjs-layout-small .vjs-descriptions-button, +.video-js.vjs-layout-small .vjs-captions-button, +.video-js.vjs-layout-small .vjs-subtitles-button, +.video-js.vjs-layout-small .vjs-audio-button, +.video-js.vjs-layout-small .vjs-volume-control, .video-js.vjs-layout-x-small .vjs-current-time, +.video-js.vjs-layout-x-small .vjs-time-divider, +.video-js.vjs-layout-x-small .vjs-duration, +.video-js.vjs-layout-x-small .vjs-remaining-time, +.video-js.vjs-layout-x-small .vjs-playback-rate, +.video-js.vjs-layout-x-small .vjs-chapters-button, +.video-js.vjs-layout-x-small .vjs-descriptions-button, +.video-js.vjs-layout-x-small .vjs-captions-button, +.video-js.vjs-layout-x-small .vjs-subtitles-button, +.video-js.vjs-layout-x-small .vjs-audio-button, +.video-js.vjs-layout-x-small .vjs-volume-control, .video-js.vjs-layout-tiny .vjs-current-time, +.video-js.vjs-layout-tiny .vjs-time-divider, +.video-js.vjs-layout-tiny .vjs-duration, +.video-js.vjs-layout-tiny .vjs-remaining-time, +.video-js.vjs-layout-tiny .vjs-playback-rate, +.video-js.vjs-layout-tiny .vjs-chapters-button, +.video-js.vjs-layout-tiny .vjs-descriptions-button, +.video-js.vjs-layout-tiny .vjs-captions-button, +.video-js.vjs-layout-tiny .vjs-subtitles-button, +.video-js.vjs-layout-tiny .vjs-audio-button, +.video-js.vjs-layout-tiny .vjs-volume-control { display: none; } -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active, -.video-js:not(.vjs-fullscreen).vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active, .video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active, -.video-js:not(.vjs-fullscreen).vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active, .video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active, -.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active { +.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover, .video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active, .video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active, .video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover, .video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover, .video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active, .video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active, .video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover, .video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover, .video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active, .video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active, .video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover { width: auto; width: initial; } -.video-js:not(.vjs-fullscreen).vjs-layout-x-small:not(.vjs-liveui) .vjs-subs-caps-button, .video-js:not(.vjs-fullscreen).vjs-layout-x-small:not(.vjs-live) .vjs-subs-caps-button, .video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-subs-caps-button { +.video-js.vjs-layout-x-small:not(.vjs-liveui) .vjs-subs-caps-button, .video-js.vjs-layout-x-small:not(.vjs-live) .vjs-subs-caps-button, .video-js.vjs-layout-tiny .vjs-subs-caps-button { display: none; } -.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui .vjs-custom-control-spacer, .video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-custom-control-spacer { +.video-js.vjs-layout-x-small.vjs-liveui .vjs-custom-control-spacer, .video-js.vjs-layout-tiny .vjs-custom-control-spacer { flex: auto; display: block; } -.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui.vjs-no-flex .vjs-custom-control-spacer, .video-js:not(.vjs-fullscreen).vjs-layout-tiny.vjs-no-flex .vjs-custom-control-spacer { +.video-js.vjs-layout-x-small.vjs-liveui.vjs-no-flex .vjs-custom-control-spacer, .video-js.vjs-layout-tiny.vjs-no-flex .vjs-custom-control-spacer { width: auto; } -.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui .vjs-progress-control, .video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-progress-control { +.video-js.vjs-layout-x-small.vjs-liveui .vjs-progress-control, .video-js.vjs-layout-tiny .vjs-progress-control { display: none; } @@ -1664,11 +1742,8 @@ video::-webkit-media-text-track-display { .js-focus-visible .video-js *:focus:not(.focus-visible) { outline: none; - background: none; } -.video-js *:focus:not(:focus-visible), -.video-js .vjs-menu *:focus:not(:focus-visible) { +.video-js *:focus:not(:focus-visible) { outline: none; - background: none; } diff --git a/server/user.mediacube.gui/js/video.js b/server/user.mediacube.gui/js/video.js index 70074754..3a6f9d68 100644 --- a/server/user.mediacube.gui/js/video.js +++ b/server/user.mediacube.gui/js/video.js @@ -1,31 +1,159 @@ /** * @license - * Video.js 7.8.0 + * Video.js 7.17.0 * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 - * + * * * Includes vtt.js * Available under Apache License Version 2.0 - * + * */ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('global/window'), require('global/document')) : - typeof define === 'function' && define.amd ? define(['global/window', 'global/document'], factory) : - (global = global || self, global.videojs = factory(global.window, global.document)); -}(this, (function (window$3, document) { 'use strict'; + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.videojs = factory()); +}(this, (function () { 'use strict'; - window$3 = window$3 && Object.prototype.hasOwnProperty.call(window$3, 'default') ? window$3['default'] : window$3; - document = document && Object.prototype.hasOwnProperty.call(document, 'default') ? document['default'] : document; + var version$5 = "7.17.0"; - var version = "7.8.0"; + /** + * An Object that contains lifecycle hooks as keys which point to an array + * of functions that are run when a lifecycle is triggered + * + * @private + */ + var hooks_ = {}; + /** + * Get a list of hooks for a specific lifecycle + * + * @param {string} type + * the lifecyle to get hooks from + * + * @param {Function|Function[]} [fn] + * Optionally add a hook (or hooks) to the lifecycle that your are getting. + * + * @return {Array} + * an array of hooks, or an empty array if there are none. + */ + + var hooks = function hooks(type, fn) { + hooks_[type] = hooks_[type] || []; + + if (fn) { + hooks_[type] = hooks_[type].concat(fn); + } + + return hooks_[type]; + }; + /** + * Add a function hook to a specific videojs lifecycle. + * + * @param {string} type + * the lifecycle to hook the function to. + * + * @param {Function|Function[]} + * The function or array of functions to attach. + */ + + + var hook = function hook(type, fn) { + hooks(type, fn); + }; + /** + * Remove a hook from a specific videojs lifecycle. + * + * @param {string} type + * the lifecycle that the function hooked to + * + * @param {Function} fn + * The hooked function to remove + * + * @return {boolean} + * The function that was removed or undef + */ + + + var removeHook = function removeHook(type, fn) { + var index = hooks(type).indexOf(fn); + + if (index <= -1) { + return false; + } + + hooks_[type] = hooks_[type].slice(); + hooks_[type].splice(index, 1); + return true; + }; + /** + * Add a function hook that will only run once to a specific videojs lifecycle. + * + * @param {string} type + * the lifecycle to hook the function to. + * + * @param {Function|Function[]} + * The function or array of functions to attach. + */ + + + var hookOnce = function hookOnce(type, fn) { + hooks(type, [].concat(fn).map(function (original) { + var wrapper = function wrapper() { + removeHook(type, wrapper); + return original.apply(void 0, arguments); + }; + + return wrapper; + })); + }; + + /** + * @file fullscreen-api.js + * @module fullscreen-api + * @private + */ + + /** + * Store the browser-specific methods for the fullscreen API. + * + * @type {Object} + * @see [Specification]{@link https://fullscreen.spec.whatwg.org} + * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js} + */ + var FullscreenApi = { + prefixed: true + }; // browser API methods + + var apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror', 'fullscreen'], // WebKit + ['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror', '-webkit-full-screen'], // Mozilla + ['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror', '-moz-full-screen'], // Microsoft + ['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError', '-ms-fullscreen']]; + var specApi = apiMap[0]; + var browserApi; // determine the supported set of functions + + for (var i = 0; i < apiMap.length; i++) { + // check for exitFullscreen function + if (apiMap[i][1] in document) { + browserApi = apiMap[i]; + break; + } + } // map the browser API names to the spec API names + + + if (browserApi) { + for (var _i = 0; _i < browserApi.length; _i++) { + FullscreenApi[specApi[_i]] = browserApi[_i]; + } + + FullscreenApi.prefixed = browserApi[0] !== specApi[0]; + } /** * @file create-logger.js * @module create-logger */ - + // This is the private tracking variable for the logging history. var history = []; /** * Log messages to the console and history based on the type of message @@ -60,19 +188,19 @@ // still be stored in history. - if (!window$3.console) { + if (!window.console) { return; } // Was setting these once outside of this function, but containing them // in the function makes it easier to test cases where console doesn't exist // when the module is executed. - var fn = window$3.console[type]; + var fn = window.console[type]; if (!fn && type === 'debug') { // Certain browsers don't have support for console.debug. For those, we // should default to the closest comparable log. - fn = window$3.console.info || window$3.console.log; + fn = window.console.info || window.console.log; } // Bail out if there's no console or if this type is not allowed by the // current logging level. @@ -81,11 +209,11 @@ return; } - fn[Array.isArray(args) ? 'apply' : 'call'](window$3.console, args); + fn[Array.isArray(args) ? 'apply' : 'call'](window.console, args); }; }; - function createLogger(name) { + function createLogger$1(name) { // This is the private tracking variable for logging level. var level = 'info'; // the curried logByType bound to the specific log and history @@ -137,7 +265,7 @@ */ log.createLogger = function (subname) { - return createLogger(name + ': ' + subname); + return createLogger$1(name + ': ' + subname); }; /** * Enumeration of available logging levels, where the keys are the level names @@ -310,8 +438,10 @@ * @file log.js * @module log */ - var log = createLogger('VIDEOJS'); - var createLogger$1 = log.createLogger; + var log$1 = createLogger$1('VIDEOJS'); + var createLogger = log$1.createLogger; + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; @@ -369,7 +499,7 @@ * @return {Mixed} * The new accumulated value. */ - var toString = Object.prototype.toString; + var toString$1 = Object.prototype.toString; /** * Get the keys of an Object * @@ -384,7 +514,7 @@ */ var keys = function keys(object) { - return isObject(object) ? Object.keys(object) : []; + return isObject$1(object) ? Object.keys(object) : []; }; /** * Array-like iteration for objects. @@ -468,7 +598,7 @@ * @return {boolean} */ - function isObject(value) { + function isObject$1(value) { return !!value && typeof value === 'object'; } /** @@ -480,13 +610,14 @@ */ function isPlain(value) { - return isObject(value) && toString.call(value) === '[object Object]' && value.constructor === Object; + return isObject$1(value) && toString$1.call(value) === '[object Object]' && value.constructor === Object; } /** * @file computed-style.js * @module computed-style */ + /** * A safe getComputedStyle. * @@ -503,20 +634,259 @@ * * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397 */ - function computedStyle(el, prop) { if (!el || !prop) { return ''; } - if (typeof window$3.getComputedStyle === 'function') { - var computedStyleValue = window$3.getComputedStyle(el); + if (typeof window.getComputedStyle === 'function') { + var computedStyleValue; + + try { + computedStyleValue = window.getComputedStyle(el); + } catch (e) { + return ''; + } + return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : ''; } return ''; } + /** + * @file browser.js + * @module browser + */ + var USER_AGENT = window.navigator && window.navigator.userAgent || ''; + var webkitVersionMap = /AppleWebKit\/([\d.]+)/i.exec(USER_AGENT); + var appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null; + /** + * Whether or not this device is an iPod. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_IPOD = /iPod/i.test(USER_AGENT); + /** + * The detected iOS version - or `null`. + * + * @static + * @const + * @type {string|null} + */ + + var IOS_VERSION = function () { + var match = USER_AGENT.match(/OS (\d+)_/i); + + if (match && match[1]) { + return match[1]; + } + + return null; + }(); + /** + * Whether or not this is an Android device. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_ANDROID = /Android/i.test(USER_AGENT); + /** + * The detected Android version - or `null`. + * + * @static + * @const + * @type {number|string|null} + */ + + var ANDROID_VERSION = function () { + // This matches Android Major.Minor.Patch versions + // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned + var match = USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i); + + if (!match) { + return null; + } + + var major = match[1] && parseFloat(match[1]); + var minor = match[2] && parseFloat(match[2]); + + if (major && minor) { + return parseFloat(match[1] + '.' + match[2]); + } else if (major) { + return major; + } + + return null; + }(); + /** + * Whether or not this is a native Android browser. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537; + /** + * Whether or not this is Mozilla Firefox. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_FIREFOX = /Firefox/i.test(USER_AGENT); + /** + * Whether or not this is Microsoft Edge. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_EDGE = /Edg/i.test(USER_AGENT); + /** + * Whether or not this is Google Chrome. + * + * This will also be `true` for Chrome on iOS, which will have different support + * as it is actually Safari under the hood. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT)); + /** + * The detected Google Chrome version - or `null`. + * + * @static + * @const + * @type {number|null} + */ + + var CHROME_VERSION = function () { + var match = USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/); + + if (match && match[2]) { + return parseFloat(match[2]); + } + + return null; + }(); + /** + * The detected Internet Explorer version - or `null`. + * + * @static + * @const + * @type {number|null} + */ + + var IE_VERSION = function () { + var result = /MSIE\s(\d+)\.\d/.exec(USER_AGENT); + var version = result && parseFloat(result[1]); + + if (!version && /Trident\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) { + // IE 11 has a different user agent string than other IE versions + version = 11.0; + } + + return version; + }(); + /** + * Whether or not this is desktop Safari. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE; + /** + * Whether or not this is a Windows machine. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_WINDOWS = /Windows/i.test(USER_AGENT); + /** + * Whether or not this device is touch-enabled. + * + * @static + * @const + * @type {Boolean} + */ + + var TOUCH_ENABLED = Boolean(isReal() && ('ontouchstart' in window || window.navigator.maxTouchPoints || window.DocumentTouch && window.document instanceof window.DocumentTouch)); + /** + * Whether or not this device is an iPad. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_IPAD = /iPad/i.test(USER_AGENT) || IS_SAFARI && TOUCH_ENABLED && !/iPhone/i.test(USER_AGENT); + /** + * Whether or not this device is an iPhone. + * + * @static + * @const + * @type {Boolean} + */ + // The Facebook app's UIWebView identifies as both an iPhone and iPad, so + // to identify iPhones, we need to exclude iPads. + // http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/ + + var IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD; + /** + * Whether or not this is an iOS device. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD; + /** + * Whether or not this is any flavor of Safari - including iOS. + * + * @static + * @const + * @type {Boolean} + */ + + var IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME; + + var browser = /*#__PURE__*/Object.freeze({ + __proto__: null, + IS_IPOD: IS_IPOD, + IOS_VERSION: IOS_VERSION, + IS_ANDROID: IS_ANDROID, + ANDROID_VERSION: ANDROID_VERSION, + IS_NATIVE_ANDROID: IS_NATIVE_ANDROID, + IS_FIREFOX: IS_FIREFOX, + IS_EDGE: IS_EDGE, + IS_CHROME: IS_CHROME, + CHROME_VERSION: CHROME_VERSION, + IE_VERSION: IE_VERSION, + IS_SAFARI: IS_SAFARI, + IS_WINDOWS: IS_WINDOWS, + TOUCH_ENABLED: TOUCH_ENABLED, + IS_IPAD: IS_IPAD, + IS_IPHONE: IS_IPHONE, + IS_IOS: IS_IOS, + IS_ANY_SAFARI: IS_ANY_SAFARI + }); + /** * @file dom.js * @module dom @@ -586,7 +956,7 @@ function isReal() { // Both document and window will never be undefined thanks to `global`. - return document === window$3.document; + return document === window.document; } /** * Determines, via duck typing, whether or not a value is a DOM element. @@ -599,7 +969,7 @@ */ function isEl(value) { - return isObject(value) && value.nodeType === 1; + return isObject$1(value) && value.nodeType === 1; } /** * Determines if the current DOM is embedded in an iframe. @@ -613,7 +983,7 @@ // We need a try/catch here because Safari will throw errors when attempting // to get either `parent` or `self` try { - return window$3.parent !== window$3.self; + return window.parent !== window.self; } catch (x) { return true; } @@ -683,12 +1053,12 @@ // same object, but that doesn't work so well. if (propName.indexOf('aria-') !== -1 || propName === 'role' || propName === 'type') { - log.warn('Setting attributes in the second argument of createEl()\n' + 'has been deprecated. Use the third argument instead.\n' + ("createEl(type, properties, attributes). Attempting to set " + propName + " to " + val + ".")); + log$1.warn('Setting attributes in the second argument of createEl()\n' + 'has been deprecated. Use the third argument instead.\n' + ("createEl(type, properties, attributes). Attempting to set " + propName + " to " + val + ".")); el.setAttribute(propName, val); // Handle textContent since it's not supported everywhere and we have a // method for it. } else if (propName === 'textContent') { textContent(el, val); - } else if (el[propName] !== val) { + } else if (el[propName] !== val || propName === 'tabIndex') { el[propName] = val; } }); @@ -803,6 +1173,12 @@ */ function removeClass(element, classToRemove) { + // Protect in case the player gets disposed + if (!element) { + log$1.warn("removeClass was called with an element that doesn't exist"); + return null; + } + if (element.classList) { element.classList.remove(classToRemove); } else { @@ -1071,31 +1447,31 @@ */ function findPosition(el) { - var box; - - if (el.getBoundingClientRect && el.parentNode) { - box = el.getBoundingClientRect(); - } - - if (!box) { + if (!el || el && !el.offsetParent) { return { left: 0, - top: 0 + top: 0, + width: 0, + height: 0 }; } - var docEl = document.documentElement; - var body = document.body; - var clientLeft = docEl.clientLeft || body.clientLeft || 0; - var scrollLeft = window$3.pageXOffset || body.scrollLeft; - var left = box.left + scrollLeft - clientLeft; - var clientTop = docEl.clientTop || body.clientTop || 0; - var scrollTop = window$3.pageYOffset || body.scrollTop; - var top = box.top + scrollTop - clientTop; // Android sometimes returns slightly off decimal values, so need to round + var width = el.offsetWidth; + var height = el.offsetHeight; + var left = 0; + var top = 0; + + while (el.offsetParent && el !== document[FullscreenApi.fullscreenElement]) { + left += el.offsetLeft; + top += el.offsetTop; + el = el.offsetParent; + } return { - left: Math.round(left), - top: Math.round(top) + left: left, + top: top, + width: width, + height: height }; } /** @@ -1127,22 +1503,52 @@ */ function getPointerPosition(el, event) { + var translated = { + x: 0, + y: 0 + }; + + if (IS_IOS) { + var item = el; + + while (item && item.nodeName.toLowerCase() !== 'html') { + var transform = computedStyle(item, 'transform'); + + if (/^matrix/.test(transform)) { + var values = transform.slice(7, -1).split(/,\s/).map(Number); + translated.x += values[4]; + translated.y += values[5]; + } else if (/^matrix3d/.test(transform)) { + var _values = transform.slice(9, -1).split(/,\s/).map(Number); + + translated.x += _values[12]; + translated.y += _values[13]; + } + + item = item.parentNode; + } + } + var position = {}; + var boxTarget = findPosition(event.target); var box = findPosition(el); - var boxW = el.offsetWidth; - var boxH = el.offsetHeight; - var boxY = box.top; - var boxX = box.left; - var pageY = event.pageY; - var pageX = event.pageX; + var boxW = box.width; + var boxH = box.height; + var offsetY = event.offsetY - (box.top - boxTarget.top); + var offsetX = event.offsetX - (box.left - boxTarget.left); if (event.changedTouches) { - pageX = event.changedTouches[0].pageX; - pageY = event.changedTouches[0].pageY; + offsetX = event.changedTouches[0].pageX - box.left; + offsetY = event.changedTouches[0].pageY + box.top; + + if (IS_IOS) { + offsetX -= translated.x; + offsetY -= translated.y; + } } - position.y = Math.max(0, Math.min(1, (boxY - pageY + boxH) / boxH)); - position.x = Math.max(0, Math.min(1, (pageX - boxX) / boxW)); + position.y = 1 - Math.max(0, Math.min(1, offsetY / boxH)); + position.x = Math.max(0, Math.min(1, offsetX / boxW)); return position; } /** @@ -1156,7 +1562,7 @@ */ function isTextNode(value) { - return isObject(value) && value.nodeType === 3; + return isObject$1(value) && value.nodeType === 3; } /** * Empties the contents of an element. @@ -1399,14 +1805,13 @@ * @module setup */ var _windowLoaded = false; - var videojs; + var videojs$1; /** * Set up any tags that have a data-setup `attribute` when the player is started. */ var autoSetup = function autoSetup() { - // Protect against breakage in non-browser environments and check global autoSetup option. - if (!isReal() || videojs.options.autoSetup === false) { + if (videojs$1.options.autoSetup === false) { return; } @@ -1427,7 +1832,7 @@ if (options !== null) { // Create new video.js instance. - videojs(mediaEl); + videojs$1(mediaEl); } } // If getAttribute isn't defined, we need to wait for the DOM. @@ -1454,11 +1859,16 @@ function autoSetupTimeout(wait, vjs) { + // Protect against breakage in non-browser environments + if (!isReal()) { + return; + } + if (vjs) { - videojs = vjs; + videojs$1 = vjs; } - window$3.setTimeout(autoSetup, wait); + window.setTimeout(autoSetup, wait); } /** * Used to set the internal tracking of window loaded state to true. @@ -1469,7 +1879,7 @@ function setWindowLoaded() { _windowLoaded = true; - window$3.removeEventListener('load', setWindowLoaded); + window.removeEventListener('load', setWindowLoaded); } if (isReal()) { @@ -1484,7 +1894,7 @@ * * @listens load */ - window$3.addEventListener('load', setWindowLoaded); + window.addEventListener('load', setWindowLoaded); } } @@ -1492,6 +1902,7 @@ * @file stylesheet.js * @module stylesheet */ + /** * Create a DOM syle element given a className for it. * @@ -1501,7 +1912,6 @@ * @return {Element} * The element that was created. */ - var createStyleElement = function createStyleElement(className) { var style = document.createElement('style'); style.className = className; @@ -1560,10 +1970,10 @@ */ var FakeWeakMap; - if (!window$3.WeakMap) { + if (!window.WeakMap) { FakeWeakMap = /*#__PURE__*/function () { function FakeWeakMap() { - this.vdata = 'vdata' + Math.floor(window$3.performance && window$3.performance.now() || Date.now()); + this.vdata = 'vdata' + Math.floor(window.performance && window.performance.now() || Date.now()); this.data = {}; } @@ -1589,7 +1999,7 @@ // return undefined explicitly as that's the contract for this method - log('We have no data for this element', key); + log$1('We have no data for this element', key); return undefined; }; @@ -1622,7 +2032,7 @@ */ - var DomData = window$3.WeakMap ? new WeakMap() : new FakeWeakMap(); + var DomData = window.WeakMap ? new WeakMap() : new FakeWeakMap(); /** * @file events.js. An Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/) @@ -1726,8 +2136,8 @@ // with the Javascript Ninja code. So we're just overriding all events now. - if (!event || !event.isPropagationStopped) { - var old = event || window$3.event; + if (!event || !event.isPropagationStopped || !event.isImmediatePropagationStopped) { + var old = event || window.event; event = {}; // Clone the old object so that we can modify the values event = {}; // IE8 Doesn't like when you mess with native event properties // Firefox returns false for event.hasOwnProperty('type') and other props @@ -1834,8 +2244,8 @@ _supportsPassive = true; } }); - window$3.addEventListener('test', null, opts); - window$3.removeEventListener('test', null, opts); + window.addEventListener('test', null, opts); + window.removeEventListener('test', null, opts); } catch (e) {// disregard } } @@ -1911,7 +2321,7 @@ try { handlersCopy[m].call(elem, event, hash); } catch (e) { - log.error(e); + log$1.error(e); } } } @@ -2196,10 +2606,10 @@ */ var throttle = function throttle(fn, wait) { - var last = window$3.performance.now(); + var last = window.performance.now(); var throttled = function throttled() { - var now = window$3.performance.now(); + var now = window.performance.now(); if (now - last >= wait) { fn.apply(void 0, arguments); @@ -2238,7 +2648,7 @@ var debounce = function debounce(func, wait, immediate, context) { if (context === void 0) { - context = window$3; + context = window; } var timeout; @@ -2289,7 +2699,7 @@ * @class EventTarget */ - var EventTarget = function EventTarget() {}; + var EventTarget$2 = function EventTarget() {}; /** * A Custom DOM event. * @@ -2321,7 +2731,7 @@ */ - EventTarget.prototype.allowedEvents_ = {}; + EventTarget$2.prototype.allowedEvents_ = {}; /** * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a * function that will get called when an event with a certain name gets triggered. @@ -2333,7 +2743,7 @@ * The function to call with `EventTarget`s */ - EventTarget.prototype.on = function (type, fn) { + EventTarget$2.prototype.on = function (type, fn) { // Remove the addEventListener alias before calling Events.on // so we don't get into an infinite type loop var ael = this.addEventListener; @@ -2352,7 +2762,7 @@ */ - EventTarget.prototype.addEventListener = EventTarget.prototype.on; + EventTarget$2.prototype.addEventListener = EventTarget$2.prototype.on; /** * Removes an `event listener` for a specific event from an instance of `EventTarget`. * This makes it so that the `event listener` will no longer get called when the @@ -2365,7 +2775,7 @@ * The function to remove. */ - EventTarget.prototype.off = function (type, fn) { + EventTarget$2.prototype.off = function (type, fn) { off(this, type, fn); }; /** @@ -2377,7 +2787,7 @@ */ - EventTarget.prototype.removeEventListener = EventTarget.prototype.off; + EventTarget$2.prototype.removeEventListener = EventTarget$2.prototype.off; /** * This function will add an `event listener` that gets triggered only once. After the * first trigger it will get removed. This is like adding an `event listener` @@ -2390,7 +2800,7 @@ * The function to be called once for each event name. */ - EventTarget.prototype.one = function (type, fn) { + EventTarget$2.prototype.one = function (type, fn) { // Remove the addEventListener aliasing Events.on // so we don't get into an infinite type loop var ael = this.addEventListener; @@ -2401,7 +2811,7 @@ this.addEventListener = ael; }; - EventTarget.prototype.any = function (type, fn) { + EventTarget$2.prototype.any = function (type, fn) { // Remove the addEventListener aliasing Events.on // so we don't get into an infinite type loop var ael = this.addEventListener; @@ -2429,7 +2839,7 @@ */ - EventTarget.prototype.trigger = function (event) { + EventTarget$2.prototype.trigger = function (event) { var type = event.type || event; // deprecation // In a future version we should default target to `this` // similar to how we default the target to `elem` in @@ -2459,10 +2869,10 @@ */ - EventTarget.prototype.dispatchEvent = EventTarget.prototype.trigger; + EventTarget$2.prototype.dispatchEvent = EventTarget$2.prototype.trigger; var EVENT_MAP; - EventTarget.prototype.queueTrigger = function (event) { + EventTarget$2.prototype.queueTrigger = function (event) { var _this = this; // only set up EVENT_MAP if it'll be used @@ -2480,8 +2890,8 @@ var oldTimeout = map.get(type); map["delete"](type); - window$3.clearTimeout(oldTimeout); - var timeout = window$3.setTimeout(function () { + window.clearTimeout(oldTimeout); + var timeout = window.setTimeout(function () { // if we cleared out all timeouts for the current target, delete its map if (map.size === 0) { map = null; @@ -2497,6 +2907,26 @@ * @file mixins/evented.js * @module evented */ + + var objName = function objName(obj) { + if (typeof obj.name === 'function') { + return obj.name(); + } + + if (typeof obj.name === 'string') { + return obj.name; + } + + if (obj.name_) { + return obj.name_; + } + + if (obj.constructor && obj.constructor.name) { + return obj.constructor.name; + } + + return typeof obj; + }; /** * Returns whether or not an object has had the evented mixin applied. * @@ -2507,8 +2937,9 @@ * Whether or not the object appears to be evented. */ + var isEvented = function isEvented(object) { - return object instanceof EventTarget || !!object.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every(function (k) { + return object instanceof EventTarget$2 || !!object.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every(function (k) { return typeof object[k] === 'function'; }); }; @@ -2560,12 +2991,18 @@ * * @param {Object} target * The object to test. + * + * @param {Object} obj + * The evented object we are validating for + * + * @param {string} fnName + * The name of the evented mixin function that called this. */ - var validateTarget = function validateTarget(target) { - if (!target.nodeName && !isEvented(target)) { - throw new Error('Invalid target; must be a DOM node or evented object.'); + var validateTarget = function validateTarget(target, obj, fnName) { + if (!target || !target.nodeName && !isEvented(target)) { + throw new Error("Invalid target for " + objName(obj) + "#" + fnName + "; must be a DOM node or evented object."); } }; /** @@ -2577,12 +3014,18 @@ * * @param {string|Array} type * The type to test. + * + * @param {Object} obj + * The evented object we are validating for + * + * @param {string} fnName + * The name of the evented mixin function that called this. */ - var validateEventType = function validateEventType(type) { + var validateEventType = function validateEventType(type, obj, fnName) { if (!isValidEventType(type)) { - throw new Error('Invalid event type; must be a non-empty string or array.'); + throw new Error("Invalid event type for " + objName(obj) + "#" + fnName + "; must be a non-empty string or array."); } }; /** @@ -2594,12 +3037,18 @@ * * @param {Function} listener * The listener to test. + * + * @param {Object} obj + * The evented object we are validating for + * + * @param {string} fnName + * The name of the evented mixin function that called this. */ - var validateListener = function validateListener(listener) { + var validateListener = function validateListener(listener, obj, fnName) { if (typeof listener !== 'function') { - throw new Error('Invalid listener; must be a function.'); + throw new Error("Invalid listener for " + objName(obj) + "#" + fnName + "; must be a function."); } }; /** @@ -2614,12 +3063,15 @@ * @param {Array} args * An array of arguments passed to `on()` or `one()`. * + * @param {string} fnName + * The name of the evented mixin function that called this. + * * @return {Object} * An object containing useful values for `on()` or `one()` calls. */ - var normalizeListenArgs = function normalizeListenArgs(self, args) { + var normalizeListenArgs = function normalizeListenArgs(self, args, fnName) { // If the number of arguments is less than 3, the target is always the // evented object itself. var isTargetingSelf = args.length < 3 || args[0] === self || args[0] === self.eventBusEl_; @@ -2643,9 +3095,9 @@ listener = args[2]; } - validateTarget(target); - validateEventType(type); - validateListener(listener); + validateTarget(target, self, fnName); + validateEventType(type, self, fnName); + validateListener(listener, self, fnName); listener = bind(self, listener); return { isTargetingSelf: isTargetingSelf, @@ -2674,7 +3126,7 @@ var listen = function listen(target, method, type, listener) { - validateTarget(target); + validateTarget(target, target, method); if (target.nodeName) { Events[method](target, type, listener); @@ -2721,7 +3173,7 @@ args[_key] = arguments[_key]; } - var _normalizeListenArgs = normalizeListenArgs(this, args), + var _normalizeListenArgs = normalizeListenArgs(this, args, 'on'), isTargetingSelf = _normalizeListenArgs.isTargetingSelf, target = _normalizeListenArgs.target, type = _normalizeListenArgs.type, @@ -2783,7 +3235,7 @@ args[_key2] = arguments[_key2]; } - var _normalizeListenArgs2 = normalizeListenArgs(this, args), + var _normalizeListenArgs2 = normalizeListenArgs(this, args, 'one'), isTargetingSelf = _normalizeListenArgs2.isTargetingSelf, target = _normalizeListenArgs2.target, type = _normalizeListenArgs2.type, @@ -2845,7 +3297,7 @@ args[_key4] = arguments[_key4]; } - var _normalizeListenArgs3 = normalizeListenArgs(this, args), + var _normalizeListenArgs3 = normalizeListenArgs(this, args, 'any'), isTargetingSelf = _normalizeListenArgs3.isTargetingSelf, target = _normalizeListenArgs3.target, type = _normalizeListenArgs3.type, @@ -2899,9 +3351,9 @@ var target = targetOrType; var type = typeOrListener; // Fail fast and in a meaningful way! - validateTarget(target); - validateEventType(type); - validateListener(listener); // Ensure there's at least a guid, even if the function hasn't been used + validateTarget(target, this, 'off'); + validateEventType(type, this, 'off'); + validateListener(listener, this, 'off'); // Ensure there's at least a guid, even if the function hasn't been used listener = bind(this, listener); // Remove the dispose listener on this evented object, which was given // the same guid as the event listener in on(). @@ -2931,6 +3383,19 @@ * Whether or not the default behavior was prevented. */ trigger: function trigger$1(event, hash) { + validateTarget(this.eventBusEl_, this, 'trigger'); + var type = event && typeof event !== 'string' ? event.type : event; + + if (!isValidEventType(type)) { + var error = "Invalid event type for " + objName(this) + "#trigger; " + 'must be a non-empty string or object with a type key that has a non-empty value.'; + + if (event) { + (this.log || log$1).error(error); + } else { + throw new Error(error); + } + } + return trigger(this.eventBusEl_, event, hash); } }; @@ -2983,7 +3448,12 @@ target.on('dispose', function () { target.off(); - window$3.setTimeout(function () { + [target, target.el_, target.eventBusEl_].forEach(function (val) { + if (val && DomData.has(val)) { + DomData["delete"](val); + } + }); + window.setTimeout(function () { target.eventBusEl_ = null; }, 0); }); @@ -3134,7 +3604,7 @@ * The string with an uppercased first letter */ - var toTitleCase = function toTitleCase(string) { + var toTitleCase$1 = function toTitleCase(string) { if (typeof string !== 'string') { return string; } @@ -3157,7 +3627,7 @@ */ var titleCaseEquals = function titleCaseEquals(str1, str2) { - return toTitleCase(str1) === toTitleCase(str2); + return toTitleCase$1(str1) === toTitleCase$1(str2); }; /** @@ -3182,7 +3652,7 @@ * A new object that is the merged result of all sources. */ - function mergeOptions() { + function mergeOptions$3() { var result = {}; for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) { @@ -3204,12 +3674,78 @@ result[key] = {}; } - result[key] = mergeOptions(result[key], value); + result[key] = mergeOptions$3(result[key], value); }); }); return result; } + var MapSham = /*#__PURE__*/function () { + function MapSham() { + this.map_ = {}; + } + + var _proto = MapSham.prototype; + + _proto.has = function has(key) { + return key in this.map_; + }; + + _proto["delete"] = function _delete(key) { + var has = this.has(key); + delete this.map_[key]; + return has; + }; + + _proto.set = function set(key, value) { + this.map_[key] = value; + return this; + }; + + _proto.forEach = function forEach(callback, thisArg) { + for (var key in this.map_) { + callback.call(thisArg, this.map_[key], key, this); + } + }; + + return MapSham; + }(); + + var Map$1 = window.Map ? window.Map : MapSham; + + var SetSham = /*#__PURE__*/function () { + function SetSham() { + this.set_ = {}; + } + + var _proto = SetSham.prototype; + + _proto.has = function has(key) { + return key in this.set_; + }; + + _proto["delete"] = function _delete(key) { + var has = this.has(key); + delete this.set_[key]; + return has; + }; + + _proto.add = function add(key) { + this.set_[key] = 1; + return this; + }; + + _proto.forEach = function forEach(callback, thisArg) { + for (var key in this.set_) { + callback.call(thisArg, key, key, this); + } + }; + + return SetSham; + }(); + + var Set = window.Set ? window.Set : SetSham; + /** * Player Component - Base class for all UI objects * @@ -3224,7 +3760,7 @@ * Components can also use methods from {@link EventTarget} */ - var Component = /*#__PURE__*/function () { + var Component$1 = /*#__PURE__*/function () { /** * A callback that is called when a component is ready. Does not have any * paramters and any callback value will be ignored. @@ -3262,9 +3798,9 @@ this.parentComponent_ = null; // Make a copy of prototype.options_ to protect against overriding defaults - this.options_ = mergeOptions({}, this.options_); // Updated options with supplied options + this.options_ = mergeOptions$3({}, this.options_); // Updated options with supplied options - options = this.options_ = mergeOptions(this.options_, options); // Get ID from options or options element if one is supplied + options = this.options_ = mergeOptions$3(this.options_, options); // Get ID from options or options element if one is supplied this.id_ = options.id || options.el && options.el.id; // If there was no ID from the options, generate one @@ -3288,59 +3824,28 @@ evented(this, { eventBusKey: this.el_ ? 'el_' : null }); + this.handleLanguagechange = this.handleLanguagechange.bind(this); + this.on(this.player_, 'languagechange', this.handleLanguagechange); } stateful(this, this.constructor.defaultState); this.children_ = []; this.childIndex_ = {}; this.childNameIndex_ = {}; - var SetSham; - - if (!window$3.Set) { - SetSham = /*#__PURE__*/function () { - function SetSham() { - this.set_ = {}; - } - - var _proto2 = SetSham.prototype; - - _proto2.has = function has(key) { - return key in this.set_; - }; - - _proto2["delete"] = function _delete(key) { - var has = this.has(key); - delete this.set_[key]; - return has; - }; - - _proto2.add = function add(key) { - this.set_[key] = 1; - return this; - }; - - _proto2.forEach = function forEach(callback, thisArg) { - for (var key in this.set_) { - callback.call(thisArg, key, key, this); - } - }; - - return SetSham; - }(); - } - - this.setTimeoutIds_ = window$3.Set ? new Set() : new SetSham(); - this.setIntervalIds_ = window$3.Set ? new Set() : new SetSham(); - this.rafIds_ = window$3.Set ? new Set() : new SetSham(); + this.setTimeoutIds_ = new Set(); + this.setIntervalIds_ = new Set(); + this.rafIds_ = new Set(); + this.namedRafs_ = new Map$1(); this.clearingTimersOnDispose_ = false; // Add any child components in options if (options.initChildren !== false) { this.initChildren(); - } - - this.ready(ready); // Don't want to trigger ready here or it will before init is actually + } // Don't want to trigger ready here or it will go before init is actually // finished for all children that run this constructor + + this.ready(ready); + if (options.reportTouchActivity !== false) { this.enableTouchActivity(); } @@ -3359,6 +3864,10 @@ if (this.isDisposed_) { return; } + + if (this.readyQueue_) { + this.readyQueue_.length = 0; + } /** * Triggered when a `Component` is disposed. * @@ -3397,10 +3906,6 @@ this.el_.parentNode.removeChild(this.el_); } - if (DomData.has(this.el_)) { - DomData["delete"](this.el_); - } - this.el_ = null; } // remove reference to the player after disposing of the element @@ -3447,7 +3952,7 @@ return this.options_; } - this.options_ = mergeOptions(this.options_, obj); + this.options_ = mergeOptions$3(this.options_, obj); return this.options_; } /** @@ -3554,6 +4059,14 @@ return localizedString; } + /** + * Handles language change for the player in components. Should be overriden by sub-components. + * + * @abstract + */ + ; + + _proto.handleLanguagechange = function handleLanguagechange() {} /** * Return the `Component`s DOM element. This is where children get inserted. * This will usually be the the same as the element returned in {@link Component#el}. @@ -3702,7 +4215,7 @@ var componentName; // If child is a string, create component with options if (typeof child === 'string') { - componentName = toTitleCase(child); + componentName = toTitleCase$1(child); var componentClassName = options.componentClass || componentName; // Set name through options options.name = componentName; // Create a new object & element for this controls set @@ -3740,7 +4253,7 @@ // name function of the component - componentName = componentName || component.name && toTitleCase(component.name()); + componentName = componentName || component.name && toTitleCase$1(component.name()); if (componentName) { this.childNameIndex_[componentName] = component; @@ -3753,8 +4266,13 @@ // If inserting before a component, insert before that component's element var refNode = null; - if (this.children_[index + 1] && this.children_[index + 1].el_) { - refNode = this.children_[index + 1].el_; + if (this.children_[index + 1]) { + // Most children are components, but the video tech is an HTML element + if (this.children_[index + 1].el_) { + refNode = this.children_[index + 1].el_; + } else if (isEl(this.children_[index + 1])) { + refNode = this.children_[index + 1]; + } } this.contentEl().insertBefore(component.el(), refNode); @@ -3797,7 +4315,7 @@ component.parentComponent_ = null; this.childIndex_[component.id()] = null; - this.childNameIndex_[toTitleCase(component.name())] = null; + this.childNameIndex_[toTitleCase$1(component.name())] = null; this.childNameIndex_[toLowerCase(component.name())] = null; var compEl = component.el(); @@ -3896,7 +4414,7 @@ // we have to make sure that child.name isn't in the techOrder since // techs are registerd as Components but can't aren't compatible // See https://github.com/videojs/video.js/issues/2772 - var c = Component.getComponent(child.opts.componentClass || toTitleCase(child.name)); + var c = Component.getComponent(child.opts.componentClass || toTitleCase$1(child.name)); return c && !Tech.isTech(c); }).forEach(handleAdd); } @@ -4300,7 +4818,7 @@ // TODO: handle display:none and no dimension style using px - return parseInt(this.el_['offset' + toTitleCase(widthOrHeight)], 10); + return parseInt(this.el_['offset' + toTitleCase$1(widthOrHeight)], 10); } /** * Get the computed width or the height of the component's element. @@ -4330,7 +4848,7 @@ // This code also runs wherever getComputedStyle doesn't exist. if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) { - var rule = "offset" + toTitleCase(widthOrHeight); + var rule = "offset" + toTitleCase$1(widthOrHeight); computedWidthOrHeight = this.el_[rule]; } @@ -4474,7 +4992,7 @@ pageY: event.touches[0].pageY }; // Record start time so we can detect a tap vs. "touch and hold" - touchStart = window$3.performance.now(); // Reset couldBeTap tracking + touchStart = window.performance.now(); // Reset couldBeTap tracking couldBeTap = true; } @@ -4510,7 +5028,7 @@ if (couldBeTap === true) { // Measure how long the touch lasted - var touchTime = window$3.performance.now() - touchStart; // Make sure the touch was less than the threshold to be considered a tap + var touchTime = window.performance.now() - touchStart; // Make sure the touch was less than the threshold to be considered a tap if (touchTime < touchTimeThreshold) { // Don't let browser turn this into a click @@ -4626,7 +5144,7 @@ var timeoutId; fn = bind(this, fn); this.clearTimersOnDispose_(); - timeoutId = window$3.setTimeout(function () { + timeoutId = window.setTimeout(function () { if (_this2.setTimeoutIds_.has(timeoutId)) { _this2.setTimeoutIds_["delete"](timeoutId); } @@ -4656,7 +5174,7 @@ _proto.clearTimeout = function clearTimeout(timeoutId) { if (this.setTimeoutIds_.has(timeoutId)) { this.setTimeoutIds_["delete"](timeoutId); - window$3.clearTimeout(timeoutId); + window.clearTimeout(timeoutId); } return timeoutId; @@ -4686,7 +5204,7 @@ _proto.setInterval = function setInterval(fn, interval) { fn = bind(this, fn); this.clearTimersOnDispose_(); - var intervalId = window$3.setInterval(fn, interval); + var intervalId = window.setInterval(fn, interval); this.setIntervalIds_.add(intervalId); return intervalId; } @@ -4710,7 +5228,7 @@ _proto.clearInterval = function clearInterval(intervalId) { if (this.setIntervalIds_.has(intervalId)) { this.setIntervalIds_["delete"](intervalId); - window$3.clearInterval(intervalId); + window.clearInterval(intervalId); } return intervalId; @@ -4755,7 +5273,7 @@ var id; fn = bind(this, fn); - id = window$3.requestAnimationFrame(function () { + id = window.requestAnimationFrame(function () { if (_this3.rafIds_.has(id)) { _this3.rafIds_["delete"](id); } @@ -4765,6 +5283,55 @@ this.rafIds_.add(id); return id; } + /** + * Request an animation frame, but only one named animation + * frame will be queued. Another will never be added until + * the previous one finishes. + * + * @param {string} name + * The name to give this requestAnimationFrame + * + * @param {Component~GenericCallback} fn + * A function that will be bound to this component and executed just + * before the browser's next repaint. + */ + ; + + _proto.requestNamedAnimationFrame = function requestNamedAnimationFrame(name, fn) { + var _this4 = this; + + if (this.namedRafs_.has(name)) { + return; + } + + this.clearTimersOnDispose_(); + fn = bind(this, fn); + var id = this.requestAnimationFrame(function () { + fn(); + + if (_this4.namedRafs_.has(name)) { + _this4.namedRafs_["delete"](name); + } + }); + this.namedRafs_.set(name, id); + return name; + } + /** + * Cancels a current named animation frame if it exists. + * + * @param {string} name + * The name of the requestAnimationFrame to cancel. + */ + ; + + _proto.cancelNamedAnimationFrame = function cancelNamedAnimationFrame(name) { + if (!this.namedRafs_.has(name)) { + return; + } + + this.cancelAnimationFrame(this.namedRafs_.get(name)); + this.namedRafs_["delete"](name); + } /** * Cancels a queued callback passed to {@link Component#requestAnimationFrame} * (rAF). @@ -4791,7 +5358,7 @@ if (this.rafIds_.has(id)) { this.rafIds_["delete"](id); - window$3.cancelAnimationFrame(id); + window.cancelAnimationFrame(id); } return id; @@ -4809,7 +5376,7 @@ ; _proto.clearTimersOnDispose_ = function clearTimersOnDispose_() { - var _this4 = this; + var _this5 = this; if (this.clearingTimersOnDispose_) { return; @@ -4817,13 +5384,18 @@ this.clearingTimersOnDispose_ = true; this.one('dispose', function () { - [['rafIds_', 'cancelAnimationFrame'], ['setTimeoutIds_', 'clearTimeout'], ['setIntervalIds_', 'clearInterval']].forEach(function (_ref) { + [['namedRafs_', 'cancelNamedAnimationFrame'], ['rafIds_', 'cancelAnimationFrame'], ['setTimeoutIds_', 'clearTimeout'], ['setIntervalIds_', 'clearInterval']].forEach(function (_ref) { var idName = _ref[0], cancelName = _ref[1]; - _this4[idName].forEach(_this4[cancelName], _this4); + // for a `Set` key will actually be the value again + // so forEach((val, val) =>` but for maps we want to use + // the key. + _this5[idName].forEach(function (val, key) { + return _this5[cancelName](key); + }); }); - _this4.clearingTimersOnDispose_ = false; + _this5.clearingTimersOnDispose_ = false; }); } /** @@ -4869,7 +5441,7 @@ throw new Error("Illegal component, \"" + name + "\"; " + reason + "."); } - name = toTitleCase(name); + name = toTitleCase$1(name); if (!Component.components_) { Component.components_ = {}; @@ -4903,11 +5475,6 @@ * * @return {Component} * The `Component` that got registered under the given name. - * - * @deprecated In `videojs` 6 this will not return `Component`s that were not - * registered using {@link Component.registerComponent}. Currently we - * check the global `videojs` object for a `Component` name and - * return that if it exists. */ ; @@ -4931,8 +5498,8 @@ */ - Component.prototype.supportsRaf_ = typeof window$3.requestAnimationFrame === 'function' && typeof window$3.cancelAnimationFrame === 'function'; - Component.registerComponent('Component', Component); + Component$1.prototype.supportsRaf_ = typeof window.requestAnimationFrame === 'function' && typeof window.cancelAnimationFrame === 'function'; + Component$1.registerComponent('Component', Component$1); function _assertThisInitialized(self) { if (self === void 0) { @@ -4944,37 +5511,6 @@ var assertThisInitialized = _assertThisInitialized; - var _typeof_1 = createCommonjsModule(function (module) { - function _typeof(obj) { - "@babel/helpers - typeof"; - - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - module.exports = _typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - module.exports = _typeof = function _typeof(obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); - } - - module.exports = _typeof; - }); - - var getPrototypeOf = createCommonjsModule(function (module) { - function _getPrototypeOf(o) { - module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - - module.exports = _getPrototypeOf; - }); - function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; @@ -4983,239 +5519,6 @@ var inheritsLoose = _inheritsLoose; - /** - * @file browser.js - * @module browser - */ - var USER_AGENT = window$3.navigator && window$3.navigator.userAgent || ''; - var webkitVersionMap = /AppleWebKit\/([\d.]+)/i.exec(USER_AGENT); - var appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null; - /** - * Whether or not this device is an iPod. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_IPOD = /iPod/i.test(USER_AGENT); - /** - * The detected iOS version - or `null`. - * - * @static - * @const - * @type {string|null} - */ - - var IOS_VERSION = function () { - var match = USER_AGENT.match(/OS (\d+)_/i); - - if (match && match[1]) { - return match[1]; - } - - return null; - }(); - /** - * Whether or not this is an Android device. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_ANDROID = /Android/i.test(USER_AGENT); - /** - * The detected Android version - or `null`. - * - * @static - * @const - * @type {number|string|null} - */ - - var ANDROID_VERSION = function () { - // This matches Android Major.Minor.Patch versions - // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned - var match = USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i); - - if (!match) { - return null; - } - - var major = match[1] && parseFloat(match[1]); - var minor = match[2] && parseFloat(match[2]); - - if (major && minor) { - return parseFloat(match[1] + '.' + match[2]); - } else if (major) { - return major; - } - - return null; - }(); - /** - * Whether or not this is a native Android browser. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537; - /** - * Whether or not this is Mozilla Firefox. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_FIREFOX = /Firefox/i.test(USER_AGENT); - /** - * Whether or not this is Microsoft Edge. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_EDGE = /Edg/i.test(USER_AGENT); - /** - * Whether or not this is Google Chrome. - * - * This will also be `true` for Chrome on iOS, which will have different support - * as it is actually Safari under the hood. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT)); - /** - * The detected Google Chrome version - or `null`. - * - * @static - * @const - * @type {number|null} - */ - - var CHROME_VERSION = function () { - var match = USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/); - - if (match && match[2]) { - return parseFloat(match[2]); - } - - return null; - }(); - /** - * The detected Internet Explorer version - or `null`. - * - * @static - * @const - * @type {number|null} - */ - - var IE_VERSION = function () { - var result = /MSIE\s(\d+)\.\d/.exec(USER_AGENT); - var version = result && parseFloat(result[1]); - - if (!version && /Trident\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) { - // IE 11 has a different user agent string than other IE versions - version = 11.0; - } - - return version; - }(); - /** - * Whether or not this is desktop Safari. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE; - /** - * Whether or not this is a Windows machine. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_WINDOWS = /Windows/i.test(USER_AGENT); - /** - * Whether or not this device is touch-enabled. - * - * @static - * @const - * @type {Boolean} - */ - - var TOUCH_ENABLED = isReal() && ('ontouchstart' in window$3 || window$3.navigator.maxTouchPoints || window$3.DocumentTouch && window$3.document instanceof window$3.DocumentTouch); - /** - * Whether or not this device is an iPad. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_IPAD = /iPad/i.test(USER_AGENT) || IS_SAFARI && TOUCH_ENABLED && !/iPhone/i.test(USER_AGENT); - /** - * Whether or not this device is an iPhone. - * - * @static - * @const - * @type {Boolean} - */ - // The Facebook app's UIWebView identifies as both an iPhone and iPad, so - // to identify iPhones, we need to exclude iPads. - // http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/ - - var IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD; - /** - * Whether or not this is an iOS device. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD; - /** - * Whether or not this is any flavor of Safari - including iOS. - * - * @static - * @const - * @type {Boolean} - */ - - var IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME; - - var browser = /*#__PURE__*/Object.freeze({ - __proto__: null, - IS_IPOD: IS_IPOD, - IOS_VERSION: IOS_VERSION, - IS_ANDROID: IS_ANDROID, - ANDROID_VERSION: ANDROID_VERSION, - IS_NATIVE_ANDROID: IS_NATIVE_ANDROID, - IS_FIREFOX: IS_FIREFOX, - IS_EDGE: IS_EDGE, - IS_CHROME: IS_CHROME, - CHROME_VERSION: CHROME_VERSION, - IE_VERSION: IE_VERSION, - IS_SAFARI: IS_SAFARI, - IS_WINDOWS: IS_WINDOWS, - TOUCH_ENABLED: TOUCH_ENABLED, - IS_IPAD: IS_IPAD, - IS_IPHONE: IS_IPHONE, - IS_IOS: IS_IOS, - IS_ANY_SAFARI: IS_ANY_SAFARI - }); - /** * @file time-ranges.js * @module time-ranges @@ -5314,8 +5617,10 @@ function createTimeRangesObj(ranges) { + var timeRangesObj; + if (ranges === undefined || ranges.length === 0) { - return { + timeRangesObj = { length: 0, start: function start() { throw new Error('This TimeRanges object is empty'); @@ -5324,13 +5629,21 @@ throw new Error('This TimeRanges object is empty'); } }; + } else { + timeRangesObj = { + length: ranges.length, + start: getRange.bind(null, 'start', 0, ranges), + end: getRange.bind(null, 'end', 1, ranges) + }; } - return { - length: ranges.length, - start: getRange.bind(null, 'start', 0, ranges), - end: getRange.bind(null, 'end', 1, ranges) - }; + if (window.Symbol && window.Symbol.iterator) { + timeRangesObj[window.Symbol.iterator] = function () { + return (ranges || []).values(); + }; + } + + return timeRangesObj; } /** * Create a `TimeRange` object which mimics an @@ -5400,47 +5713,6 @@ return bufferedDuration / duration; } - /** - * @file fullscreen-api.js - * @module fullscreen-api - * @private - */ - /** - * Store the browser-specific methods for the fullscreen API. - * - * @type {Object} - * @see [Specification]{@link https://fullscreen.spec.whatwg.org} - * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js} - */ - - var FullscreenApi = { - prefixed: true - }; // browser API methods - - var apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror', 'fullscreen'], // WebKit - ['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror', '-webkit-full-screen'], // Mozilla - ['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror', '-moz-full-screen'], // Microsoft - ['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError', '-ms-fullscreen']]; - var specApi = apiMap[0]; - var browserApi; // determine the supported set of functions - - for (var i = 0; i < apiMap.length; i++) { - // check for exitFullscreen function - if (apiMap[i][1] in document) { - browserApi = apiMap[i]; - break; - } - } // map the browser API names to the spec API names - - - if (browserApi) { - for (var _i = 0; _i < browserApi.length; _i++) { - FullscreenApi[specApi[_i]] = browserApi[_i]; - } - - FullscreenApi.prefixed = browserApi[0] !== specApi[0]; - } - /** * @file media-error.js */ @@ -5474,7 +5746,7 @@ } else if (typeof value === 'string') { // default code is zero, so this is a custom error this.message = value; - } else if (isObject(value)) { + } else if (isObject$1(value)) { // We assign the `code` property manually because native `MediaError` objects // do not expose it as an own/enumerable property of the object. if (typeof value.code === 'number') { @@ -5885,11 +6157,11 @@ codes[alias] = aliases[alias]; } }); - var keycode_1 = keycode.code; - var keycode_2 = keycode.codes; - var keycode_3 = keycode.aliases; - var keycode_4 = keycode.names; - var keycode_5 = keycode.title; + keycode.code; + keycode.codes; + keycode.aliases; + keycode.names; + keycode.title; var MODAL_CLASS_NAME = 'vjs-modal-dialog'; /** @@ -5945,6 +6217,15 @@ var _this; _this = _Component.call(this, player, options) || this; + + _this.handleKeyDown_ = function (e) { + return _this.handleKeyDown(e); + }; + + _this.close_ = function (e) { + return _this.close(e); + }; + _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false; _this.closeable(!_this.options_.uncloseable); @@ -6074,7 +6355,7 @@ player.pause(); } - this.on('keydown', this.handleKeyDown); // Hide controls and note if they were enabled. + this.on('keydown', this.handleKeyDown_); // Hide controls and note if they were enabled. this.hadControls_ = player.controls(); player.controls(false); @@ -6139,7 +6420,7 @@ player.play(); } - this.off('keydown', this.handleKeyDown); + this.off('keydown', this.handleKeyDown_); if (this.hadControls_) { player.controls(true); @@ -6186,12 +6467,12 @@ controlText: 'Close Modal Dialog' }); this.contentEl_ = temp; - this.on(close, 'close', this.close); + this.on(close, 'close', this.close_); } // If this is being made uncloseable and has a close button, remove it. if (!closeable && close) { - this.off(close, 'close', this.close); + this.off(close, 'close', this.close_); this.removeChild(close); close.dispose(); } @@ -6395,12 +6676,12 @@ _proto.focusableEls_ = function focusableEls_() { var allChildren = this.el_.querySelectorAll('*'); return Array.prototype.filter.call(allChildren, function (child) { - return (child instanceof window$3.HTMLAnchorElement || child instanceof window$3.HTMLAreaElement) && child.hasAttribute('href') || (child instanceof window$3.HTMLInputElement || child instanceof window$3.HTMLSelectElement || child instanceof window$3.HTMLTextAreaElement || child instanceof window$3.HTMLButtonElement) && !child.hasAttribute('disabled') || child instanceof window$3.HTMLIFrameElement || child instanceof window$3.HTMLObjectElement || child instanceof window$3.HTMLEmbedElement || child.hasAttribute('tabindex') && child.getAttribute('tabindex') !== -1 || child.hasAttribute('contenteditable'); + return (child instanceof window.HTMLAnchorElement || child instanceof window.HTMLAreaElement) && child.hasAttribute('href') || (child instanceof window.HTMLInputElement || child instanceof window.HTMLSelectElement || child instanceof window.HTMLTextAreaElement || child instanceof window.HTMLButtonElement) && !child.hasAttribute('disabled') || child instanceof window.HTMLIFrameElement || child instanceof window.HTMLObjectElement || child instanceof window.HTMLEmbedElement || child.hasAttribute('tabindex') && child.getAttribute('tabindex') !== -1 || child.hasAttribute('contenteditable'); }); }; return ModalDialog; - }(Component); + }(Component$1); /** * Default options for `ModalDialog` default options. * @@ -6413,7 +6694,7 @@ pauseOnOpen: true, temporary: true }; - Component.registerComponent('ModalDialog', ModalDialog); + Component$1.registerComponent('ModalDialog', ModalDialog); /** * Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and @@ -6474,6 +6755,8 @@ var _proto = TrackList.prototype; _proto.addTrack = function addTrack(track) { + var _this2 = this; + var index = this.tracks_.length; if (!('' + index in this)) { @@ -6502,6 +6785,27 @@ target: this }); } + /** + * Triggered when a track label is changed. + * + * @event TrackList#addtrack + * @type {EventTarget~Event} + * @property {Track} track + * A reference to track that was added. + */ + + + track.labelchange_ = function () { + _this2.trigger({ + track: track, + type: 'labelchange', + target: _this2 + }); + }; + + if (isEvented(track)) { + track.addEventListener('labelchange', track.labelchange_); + } } /** * Remove a {@link Track} from the `TrackList` @@ -6574,7 +6878,7 @@ }; return TrackList; - }(EventTarget); + }(EventTarget$2); /** * Triggered when a different track is selected/enabled. * @@ -6593,7 +6897,8 @@ TrackList.prototype.allowedEvents_ = { change: 'change', addtrack: 'addtrack', - removetrack: 'removetrack' + removetrack: 'removetrack', + labelchange: 'labelchange' }; // emulate attribute EventHandler support to allow for feature detection for (var event in TrackList.prototype.allowedEvents_) { @@ -6613,7 +6918,7 @@ * @private */ - var disableOthers = function disableOthers(list, track) { + var disableOthers$1 = function disableOthers(list, track) { for (var i = 0; i < list.length; i++) { if (!Object.keys(list[i]).length || track.id === list[i].id) { continue; @@ -6651,7 +6956,7 @@ // sorted from last index to first index for (var i = tracks.length - 1; i >= 0; i--) { if (tracks[i].enabled) { - disableOthers(tracks, tracks[i]); + disableOthers$1(tracks, tracks[i]); break; } } @@ -6676,7 +6981,7 @@ var _this2 = this; if (track.enabled) { - disableOthers(this, track); + disableOthers$1(this, track); } _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this @@ -6695,7 +7000,7 @@ } _this2.changing_ = true; - disableOthers(_this2, track); + disableOthers$1(_this2, track); _this2.changing_ = false; _this2.trigger('change'); @@ -6733,7 +7038,7 @@ * @private */ - var disableOthers$1 = function disableOthers(list, track) { + var disableOthers = function disableOthers(list, track) { for (var i = 0; i < list.length; i++) { if (!Object.keys(list[i]).length || track.id === list[i].id) { continue; @@ -6771,7 +7076,7 @@ // sorted from last index to first index for (var i = tracks.length - 1; i >= 0; i--) { if (tracks[i].selected) { - disableOthers$1(tracks, tracks[i]); + disableOthers(tracks, tracks[i]); break; } } @@ -6813,7 +7118,7 @@ var _this2 = this; if (track.selected) { - disableOthers$1(this, track); + disableOthers(this, track); } _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this @@ -6829,7 +7134,7 @@ } _this2.changing_ = true; - disableOthers$1(_this2, track); + disableOthers(_this2, track); _this2.changing_ = false; _this2.trigger('change'); @@ -7273,9 +7578,9 @@ var trackProps = { id: options.id || 'vjs_track_' + newGUID(), kind: options.kind || '', - label: options.label || '', language: options.language || '' }; + var label = options.label || ''; /** * @memberof Track * @member {string} id @@ -7294,15 +7599,6 @@ * @readonly */ - /** - * @memberof Track - * @member {string} label - * The label of this track. Cannot be changed after creation. - * @instance - * - * @readonly - */ - /** * @memberof Track * @member {string} language @@ -7325,17 +7621,47 @@ for (var key in trackProps) { _loop(key); } + /** + * @memberof Track + * @member {string} label + * The label of this track. Cannot be changed after creation. + * @instance + * + * @fires Track#labelchange + */ + + + Object.defineProperty(assertThisInitialized(_this), 'label', { + get: function get() { + return label; + }, + set: function set(newLabel) { + if (newLabel !== label) { + label = newLabel; + /** + * An event that fires when label changes on this track. + * + * > Note: This is not part of the spec! + * + * @event Track#labelchange + * @type {EventTarget~Event} + */ + this.trigger('labelchange'); + } + } + }); return _this; } return Track; - }(EventTarget); + }(EventTarget$2); /** * @file url.js * @module url */ + /** * @typedef {Object} url:URLObject * @@ -7371,35 +7697,20 @@ * @return {url:URLObject} * An object of url details */ - var parseUrl = function parseUrl(url) { + // This entire method can be replace with URL once we are able to drop IE11 var props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host']; // add the url to an anchor and let the browser parse the URL var a = document.createElement('a'); - a.href = url; // IE8 (and 9?) Fix - // ie8 doesn't parse the URL correctly until the anchor is actually - // added to the body, and an innerHTML is needed to trigger the parsing - - var addToBody = a.host === '' && a.protocol !== 'file:'; - var div; - - if (addToBody) { - div = document.createElement('div'); - div.innerHTML = ""; - a = div.firstChild; // prevent the div from affecting layout - - div.setAttribute('style', 'display:none; position:absolute;'); - document.body.appendChild(div); - } // Copy the specific URL properties to a new object - // This is also needed for IE8 because the anchor loses its + a.href = url; // Copy the specific URL properties to a new object + // This is also needed for IE because the anchor loses its // properties when it's removed from the dom - var details = {}; for (var i = 0; i < props.length; i++) { details[props[i]] = a[props[i]]; - } // IE9 adds the port to the host property unlike everyone else. If + } // IE adds the port to the host property unlike everyone else. If // a port identifier is added for standard ports, strip it. @@ -7412,11 +7723,13 @@ } if (!details.protocol) { - details.protocol = window$3.location.protocol; + details.protocol = window.location.protocol; } + /* istanbul ignore if */ - if (addToBody) { - document.body.removeChild(div); + + if (!details.host) { + details.host = window.location.host; } return details; @@ -7438,9 +7751,10 @@ // Check if absolute URL if (!url.match(/^https?:\/\//)) { // Convert to absolute URL. Flash hosted off-site needs an absolute URL. - var div = document.createElement('div'); - div.innerHTML = "x"; - url = div.firstChild.href; + // add the url to an anchor and let the browser parse the URL + var a = document.createElement('a'); + a.href = url; + url = a.href; } return url; @@ -7492,7 +7806,7 @@ var isCrossOrigin = function isCrossOrigin(url, winLoc) { if (winLoc === void 0) { - winLoc = window$3.location; + winLoc = window.location; } var urlInfo = parseUrl(url); // IE8 protocol relative urls will return ':' for protocol @@ -7512,15 +7826,93 @@ isCrossOrigin: isCrossOrigin }); + var win; + + if (typeof window !== "undefined") { + win = window; + } else if (typeof commonjsGlobal !== "undefined") { + win = commonjsGlobal; + } else if (typeof self !== "undefined") { + win = self; + } else { + win = {}; + } + + var window_1 = win; + var isFunction_1 = isFunction; - var toString$1 = Object.prototype.toString; + var toString = Object.prototype.toString; function isFunction(fn) { - var string = toString$1.call(fn); + if (!fn) { + return false; + } + + var string = toString.call(fn); return string === '[object Function]' || typeof fn === 'function' && string !== '[object RegExp]' || typeof window !== 'undefined' && ( // IE8 and below fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt); } + var httpResponseHandler = function httpResponseHandler(callback, decodeResponseBody) { + if (decodeResponseBody === void 0) { + decodeResponseBody = false; + } + + return function (err, response, responseBody) { + // if the XHR failed, return that error + if (err) { + callback(err); + return; + } // if the HTTP status code is 4xx or 5xx, the request also failed + + + if (response.statusCode >= 400 && response.statusCode <= 599) { + var cause = responseBody; + + if (decodeResponseBody) { + if (window_1.TextDecoder) { + var charset = getCharset(response.headers && response.headers['content-type']); + + try { + cause = new TextDecoder(charset).decode(responseBody); + } catch (e) {} + } else { + cause = String.fromCharCode.apply(null, new Uint8Array(responseBody)); + } + } + + callback({ + cause: cause + }); + return; + } // otherwise, request succeeded + + + callback(null, responseBody); + }; + }; + + function getCharset(contentTypeHeader) { + if (contentTypeHeader === void 0) { + contentTypeHeader = ''; + } + + return contentTypeHeader.toLowerCase().split(';').reduce(function (charset, contentType) { + var _contentType$split = contentType.split('='), + type = _contentType$split[0], + value = _contentType$split[1]; + + if (type.trim() === 'charset') { + return value.trim(); + } + + return charset; + }, 'utf-8'); + } + + var httpHandler = httpResponseHandler; + + createXHR.httpHandler = httpHandler; /** * @license * slighly modified parse-headers 2.0.2 @@ -7529,7 +7921,6 @@ * */ - var parseHeaders = function parseHeaders(headers) { var result = {}; @@ -7553,11 +7944,11 @@ return result; }; - var xhr = createXHR; // Allow use of default import syntax in TypeScript + var lib = createXHR; // Allow use of default import syntax in TypeScript var default_1 = createXHR; - createXHR.XMLHttpRequest = window$3.XMLHttpRequest || noop; - createXHR.XDomainRequest = "withCredentials" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window$3.XDomainRequest; + createXHR.XMLHttpRequest = window_1.XMLHttpRequest || noop$1; + createXHR.XDomainRequest = "withCredentials" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window_1.XDomainRequest; forEachArray(["get", "put", "post", "patch", "head", "delete"], function (method) { createXHR[method === "delete" ? "del" : method] = function (uri, options, callback) { options = initParams(uri, options, callback); @@ -7808,8 +8199,8 @@ return null; } - function noop() {} - xhr["default"] = default_1; + function noop$1() {} + lib["default"] = default_1; /** * Takes a webvtt file contents and parses it into cues @@ -7824,7 +8215,7 @@ */ var parseCues = function parseCues(srcContent, track) { - var parser = new window$3.WebVTT.Parser(window$3, window$3.vttjs, window$3.WebVTT.StringDecoder()); + var parser = new window.WebVTT.Parser(window, window.vttjs, window.WebVTT.StringDecoder()); var errors = []; parser.oncue = function (cue) { @@ -7845,16 +8236,16 @@ parser.parse(srcContent); if (errors.length > 0) { - if (window$3.console && window$3.console.groupCollapsed) { - window$3.console.groupCollapsed("Text Track parsing errors for " + track.src); + if (window.console && window.console.groupCollapsed) { + window.console.groupCollapsed("Text Track parsing errors for " + track.src); } errors.forEach(function (error) { - return log.error(error); + return log$1.error(error); }); - if (window$3.console && window$3.console.groupEnd) { - window$3.console.groupEnd(); + if (window.console && window.console.groupEnd) { + window.console.groupEnd(); } } @@ -7883,21 +8274,27 @@ opts.cors = crossOrigin; } - xhr(opts, bind(this, function (err, response, responseBody) { + var withCredentials = track.tech_.crossOrigin() === 'use-credentials'; + + if (withCredentials) { + opts.withCredentials = withCredentials; + } + + lib(opts, bind(this, function (err, response, responseBody) { if (err) { - return log.error(err, response); + return log$1.error(err, response); } track.loaded_ = true; // Make sure that vttjs has loaded, otherwise, wait till it finished loading // NOTE: this is only used for the alt/video.novtt.js build - if (typeof window$3.WebVTT !== 'function') { + if (typeof window.WebVTT !== 'function') { if (track.tech_) { // to prevent use before define eslint error, we define loadHandler // as a let here track.tech_.any(['vttjsloaded', 'vttjserror'], function (event) { if (event.type === 'vttjserror') { - log.error("vttjs failed to load, stopping trying to process " + track.src); + log$1.error("vttjs failed to load, stopping trying to process " + track.src); return; } @@ -7965,7 +8362,7 @@ throw new Error('A tech was not provided.'); } - var settings = mergeOptions(options, { + var settings = mergeOptions$3(options, { kind: TextTrackKind[options.kind] || 'subtitles', language: options.language || options.srclang || '' }); @@ -7985,10 +8382,14 @@ var activeCues = new TextTrackCueList(_this.activeCues_); var changed = false; var timeupdateHandler = bind(assertThisInitialized(_this), function () { - // Accessing this.activeCues for the side-effects of updating itself + if (!this.tech_.isReady_ || this.tech_.isDisposed()) { + return; + } // Accessing this.activeCues for the side-effects of updating itself // due to its nature as a getter function. Do not remove or cues will // stop updating! // Use the setter to prevent deletion from uglify (pure_getters rule) + + this.activeCues = this.activeCues; if (changed) { @@ -7997,10 +8398,14 @@ } }); + var disposeHandler = function disposeHandler() { + _this.tech_.off('timeupdate', timeupdateHandler); + }; + + _this.tech_.one('dispose', disposeHandler); + if (mode !== 'disabled') { - _this.tech_.ready(function () { - _this.tech_.on('timeupdate', timeupdateHandler); - }, true); + _this.tech_.on('timeupdate', timeupdateHandler); } Object.defineProperties(assertThisInitialized(_this), { @@ -8034,12 +8439,14 @@ return mode; }, set: function set(newMode) { - var _this2 = this; - if (!TextTrackMode[newMode]) { return; } + if (mode === newMode) { + return; + } + mode = newMode; if (!this.preload_ && mode !== 'disabled' && this.cues.length === 0) { @@ -8047,12 +8454,10 @@ loadTrack(this.src, this); } + this.tech_.off('timeupdate', timeupdateHandler); + if (mode !== 'disabled') { - this.tech_.ready(function () { - _this2.tech_.on('timeupdate', timeupdateHandler); - }, true); - } else { - this.tech_.off('timeupdate', timeupdateHandler); + this.tech_.on('timeupdate', timeupdateHandler); } /** * An event that fires when mode changes on this track. This allows @@ -8146,7 +8551,7 @@ _this.loaded_ = true; } - if (_this.preload_ || default_ || settings.kind !== 'subtitles' && settings.kind !== 'captions') { + if (_this.preload_ || settings.kind !== 'subtitles' && settings.kind !== 'captions') { loadTrack(_this.src, assertThisInitialized(_this)); } } else { @@ -8168,8 +8573,8 @@ _proto.addCue = function addCue(originalCue) { var cue = originalCue; - if (window$3.vttjs && !(originalCue instanceof window$3.vttjs.VTTCue)) { - cue = new window$3.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text); + if (window.vttjs && !(originalCue instanceof window.vttjs.VTTCue)) { + cue = new window.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text); for (var prop in originalCue) { if (!(prop in cue)) { @@ -8266,7 +8671,7 @@ options = {}; } - var settings = mergeOptions(options, { + var settings = mergeOptions$3(options, { kind: AudioTrackKind[options.kind] || '' }); _this = _Track.call(this, settings) || this; @@ -8358,7 +8763,7 @@ options = {}; } - var settings = mergeOptions(options, { + var settings = mergeOptions$3(options, { kind: VideoTrackKind[options.kind] || '' }); _this = _Track.call(this, settings) || this; @@ -8457,7 +8862,7 @@ * * @param {string} [options.srclang=''] * A valid two character language code. An alternative, but deprioritized - * vesion of `options.language` + * version of `options.language` * * @param {string} [options.src] * A url to TextTrack cues. @@ -8524,7 +8929,7 @@ } return HTMLTrackElement; - }(EventTarget); + }(EventTarget$2); HTMLTrackElement.prototype.allowedEvents_ = { load: 'load' @@ -8583,6 +8988,23 @@ NORMAL.names = Object.keys(NORMAL); ALL.names = [].concat(REMOTE.names).concat(NORMAL.names); + var minDoc = {}; + + var topLevel = typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof window !== 'undefined' ? window : {}; + var doccy; + + if (typeof document !== 'undefined') { + doccy = document; + } else { + doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; + + if (!doccy) { + doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; + } + } + + var document_1 = doccy; + /** * Copyright 2013 vtt.js Contributors * @@ -8711,9 +9133,8 @@ }, // Accept a setting if its a valid percentage. percent: function percent(k, v) { - var m; - if (m = v.match(/^([\d]{1,3})(\.[\d]*)?%$/)) { + if (v.match(/^([\d]{1,3})(\.[\d]*)?%$/)) { v = parseFloat(v); if (v >= 0 && v <= 100) { @@ -8878,9 +9299,11 @@ skipWhitespace(); consumeCueSettings(input, cue); - } + } // When evaluating this file as part of a Webpack bundle for server + // side rendering, `document` is an empty object. + - var TEXTAREA_ELEMENT = document.createElement("textarea"); + var TEXTAREA_ELEMENT = document_1.createElement && document_1.createElement("textarea"); var TAG_NAME = { c: "span", i: "i", @@ -9522,8 +9945,8 @@ styleBox.move(bestPosition.toCSSCompatValues(containerBox)); } - function WebVTT$1() {} // Nothing - // Helper to allow strings to be decoded instead of the default binary utf8 data. + function WebVTT$1() {// Nothing + } // Helper to allow strings to be decoded instead of the default binary utf8 data. WebVTT$1.StringDecoder = function () { @@ -10415,30 +10838,30 @@ VTTCue: vttcue, VTTRegion: vttregion }; - window$3.vttjs = vttjs; - window$3.WebVTT = vttjs.WebVTT; + window_1.vttjs = vttjs; + window_1.WebVTT = vttjs.WebVTT; var cueShim = vttjs.VTTCue; var regionShim = vttjs.VTTRegion; - var nativeVTTCue = window$3.VTTCue; - var nativeVTTRegion = window$3.VTTRegion; + var nativeVTTCue = window_1.VTTCue; + var nativeVTTRegion = window_1.VTTRegion; vttjs.shim = function () { - window$3.VTTCue = cueShim; - window$3.VTTRegion = regionShim; + window_1.VTTCue = cueShim; + window_1.VTTRegion = regionShim; }; vttjs.restore = function () { - window$3.VTTCue = nativeVTTCue; - window$3.VTTRegion = nativeVTTRegion; + window_1.VTTCue = nativeVTTCue; + window_1.VTTRegion = nativeVTTRegion; }; - if (!window$3.VTTCue) { + if (!window_1.VTTCue) { vttjs.shim(); } }); - var browserIndex_1 = browserIndex.WebVTT; - var browserIndex_2 = browserIndex.VTTCue; - var browserIndex_3 = browserIndex.VTTRegion; + browserIndex.WebVTT; + browserIndex.VTTCue; + browserIndex.VTTRegion; /** * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string @@ -10502,7 +10925,7 @@ } /** * This is the base class for media playback technology controllers, such as - * {@link Flash} and {@link HTML5} + * {@link HTML5} * * @extends Component */ @@ -10534,9 +10957,30 @@ // we don't want the tech to report user activity automatically. // This is done manually in addControlsListeners options.reportTouchActivity = false; - _this = _Component.call(this, null, options, ready) || this; // keep track of whether the current source has played at all to + _this = _Component.call(this, null, options, ready) || this; + + _this.onDurationChange_ = function (e) { + return _this.onDurationChange(e); + }; + + _this.trackProgress_ = function (e) { + return _this.trackProgress(e); + }; + + _this.trackCurrentTime_ = function (e) { + return _this.trackCurrentTime(e); + }; + + _this.stopTrackingCurrentTime_ = function (e) { + return _this.stopTrackingCurrentTime(e); + }; + + _this.disposeSourceHandler_ = function (e) { + return _this.disposeSourceHandler(e); + }; // keep track of whether the current source has played at all to // implement a very limited played() + _this.hasStarted_ = false; _this.on('playing', function () { @@ -10553,11 +10997,11 @@ if (options && options[props.getterName]) { _this[props.privateName] = options[props.getterName]; } - }); // Manually track progress in cases where the browser/flash player doesn't report it. + }); // Manually track progress in cases where the browser/tech doesn't report it. if (!_this.featuresProgressEvents) { _this.manualProgressOn(); - } // Manually track timeupdates in cases where the browser/flash player doesn't report it. + } // Manually track timeupdates in cases where the browser/tech doesn't report it. if (!_this.featuresTimeupdateEvents) { @@ -10645,10 +11089,10 @@ ; _proto.manualProgressOn = function manualProgressOn() { - this.on('durationchange', this.onDurationChange); + this.on('durationchange', this.onDurationChange_); this.manualProgress = true; // Trigger progress watching when a source begins loading - this.one('ready', this.trackProgress); + this.one('ready', this.trackProgress_); } /** * Turn off the polyfill for `progress` events that was created in @@ -10659,7 +11103,7 @@ _proto.manualProgressOff = function manualProgressOff() { this.manualProgress = false; this.stopTrackingProgress(); - this.off('durationchange', this.onDurationChange); + this.off('durationchange', this.onDurationChange_); } /** * This is used to trigger a `progress` event when the buffered percent changes. It @@ -10757,8 +11201,8 @@ _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() { this.manualTimeUpdates = true; - this.on('play', this.trackCurrentTime); - this.on('pause', this.stopTrackingCurrentTime); + this.on('play', this.trackCurrentTime_); + this.on('pause', this.stopTrackingCurrentTime_); } /** * Turn off the polyfill for `timeupdate` events that was created in @@ -10769,8 +11213,8 @@ _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() { this.manualTimeUpdates = false; this.stopTrackingCurrentTime(); - this.off('play', this.trackCurrentTime); - this.off('pause', this.stopTrackingCurrentTime); + this.off('play', this.trackCurrentTime_); + this.off('pause', this.stopTrackingCurrentTime_); } /** * Sets up an interval function to track current time and trigger `timeupdate` every @@ -10895,6 +11339,27 @@ ; _proto.reset = function reset() {} + /** + * Get the value of `crossOrigin` from the tech. + * + * @abstract + * + * @see {Html5#crossOrigin} + */ + ; + + _proto.crossOrigin = function crossOrigin() {} + /** + * Set the value of `crossOrigin` on the tech. + * + * @abstract + * + * @param {string} crossOrigin the crossOrigin value + * @see {Html5#setCrossOrigin} + */ + ; + + _proto.setCrossOrigin = function setCrossOrigin() {} /** * Get or set an error on the Tech. * @@ -10933,6 +11398,36 @@ return createTimeRanges(); } + /** + * Start playback + * + * @abstract + * + * @see {Html5#play} + */ + ; + + _proto.play = function play() {} + /** + * Set whether we are scrubbing or not + * + * @abstract + * + * @see {Html5#setScrubbing} + */ + ; + + _proto.setScrubbing = function setScrubbing() {} + /** + * Get whether we are scrubbing or not + * + * @abstract + * + * @see {Html5#scrubbing} + */ + ; + + _proto.scrubbing = function scrubbing() {} /** * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was * previously called. @@ -11021,7 +11516,7 @@ _proto.addWebVttScript_ = function addWebVttScript_() { var _this5 = this; - if (window$3.WebVTT) { + if (window.WebVTT) { return; } // Initially, Tech.el_ is a child of a dummy-div wait until the Component system // signals that the Tech is ready at which point Tech.el_ is part of the DOM @@ -11068,7 +11563,7 @@ }); // but have not loaded yet and we set it to true before the inject so that // we don't overwrite the injected window.WebVTT if it loads right away - window$3.WebVTT = true; + window.WebVTT = true; this.el().parentNode.appendChild(script); } else { this.ready(this.addWebVttScript_); @@ -11180,7 +11675,7 @@ ; _proto.createRemoteTextTrack = function createRemoteTextTrack(options) { - var track = mergeOptions(options, { + var track = mergeOptions$3(options, { tech: this }); return new REMOTE.remoteTextEl.TrackClass(track); @@ -11218,7 +11713,7 @@ if (manualCleanup !== true && manualCleanup !== false) { // deprecation warning - log.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'); + log$1.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'); manualCleanup = true; } // store HTMLTrackElement and TextTrack to remote list @@ -11283,12 +11778,31 @@ ; _proto.requestPictureInPicture = function requestPictureInPicture() { - var PromiseClass = this.options_.Promise || window$3.Promise; + var PromiseClass = this.options_.Promise || window.Promise; if (PromiseClass) { return PromiseClass.reject(); } } + /** + * A method to check for the value of the 'disablePictureInPicture'