UNPKG

videojs-overlay

Version:

A plugin to display simple overlays during video playback.

2,545 lines (2,535 loc) 112 kB
/*! @name videojs-overlay @version 4.0.0 @license Apache-2.0 */ (function (QUnit, sinon, videojs) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var QUnit__default = /*#__PURE__*/_interopDefaultLegacy(QUnit); var sinon__default = /*#__PURE__*/_interopDefaultLegacy(sinon); var videojs__default = /*#__PURE__*/_interopDefaultLegacy(videojs); var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function getAugmentedNamespace(n) { if (n.__esModule) return n; var a = Object.defineProperty({}, '__esModule', {value: true}); Object.keys(n).forEach(function (k) { var d = Object.getOwnPropertyDescriptor(n, k); Object.defineProperty(a, k, d.get ? d : { enumerable: true, get: function () { return n[k]; } }); }); return a; } var _nodeResolve_empty = {}; var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ __proto__: null, 'default': _nodeResolve_empty }); var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1); var topLevel = typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof window !== 'undefined' ? window : {}; var minDoc = require$$0; 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; 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; function cov_1eue1x6p4a() { var path = "/Users/wseymour/Desktop/devOS/videojs-overlay/src/overlay-component.js"; var hash = "5bb093f3651781fad28e03be6e55ae8e9b7b478f"; var global = new Function("return this")(); var gcv = "__coverage__"; var coverageData = { path: "/Users/wseymour/Desktop/devOS/videojs-overlay/src/overlay-component.js", statementMap: { "0": { start: { line: 3, column: 29 }, end: { line: 284, column: 1 } }, "1": { start: { line: 4, column: 20 }, end: { line: 4, column: 53 } }, "2": { start: { line: 6, column: 14 }, end: { line: 6, column: 36 } }, "3": { start: { line: 18, column: 19 }, end: { line: 18, column: 56 } }, "4": { start: { line: 18, column: 24 }, end: { line: 18, column: 56 } }, "5": { start: { line: 27, column: 26 }, end: { line: 27, column: 73 } }, "6": { start: { line: 27, column: 31 }, end: { line: 27, column: 73 } }, "7": { start: { line: 38, column: 6 }, end: { line: 38, column: 29 } }, "8": { start: { line: 40, column: 6 }, end: { line: 52, column: 9 } }, "9": { start: { line: 41, column: 22 }, end: { line: 41, column: 40 } }, "10": { start: { line: 43, column: 8 }, end: { line: 51, column: 9 } }, "11": { start: { line: 44, column: 10 }, end: { line: 44, column: 46 } }, "12": { start: { line: 45, column: 15 }, end: { line: 51, column: 9 } }, "13": { start: { line: 46, column: 10 }, end: { line: 46, column: 39 } }, "14": { start: { line: 49, column: 15 }, end: { line: 51, column: 9 } }, "15": { start: { line: 50, column: 10 }, end: { line: 50, column: 79 } }, "16": { start: { line: 61, column: 6 }, end: { line: 63, column: 9 } }, "17": { start: { line: 62, column: 8 }, end: { line: 62, column: 66 } }, "18": { start: { line: 62, column: 28 }, end: { line: 62, column: 65 } }, "19": { start: { line: 67, column: 6 }, end: { line: 69, column: 7 } }, "20": { start: { line: 68, column: 8 }, end: { line: 68, column: 60 } }, "21": { start: { line: 71, column: 6 }, end: { line: 71, column: 123 } }, "22": { start: { line: 73, column: 6 }, end: { line: 73, column: 18 } }, "23": { start: { line: 77, column: 22 }, end: { line: 77, column: 35 } }, "24": { start: { line: 78, column: 22 }, end: { line: 78, column: 37 } }, "25": { start: { line: 80, column: 25 }, end: { line: 80, column: 104 } }, "26": { start: { line: 81, column: 17 }, end: { line: 89, column: 8 } }, "27": { start: { line: 91, column: 6 }, end: { line: 97, column: 7 } }, "28": { start: { line: 92, column: 8 }, end: { line: 92, column: 31 } }, "29": { start: { line: 93, column: 13 }, end: { line: 97, column: 7 } }, "30": { start: { line: 94, column: 8 }, end: { line: 94, column: 32 } }, "31": { start: { line: 96, column: 8 }, end: { line: 96, column: 39 } }, "32": { start: { line: 99, column: 6 }, end: { line: 99, column: 16 } }, "33": { start: { line: 109, column: 6 }, end: { line: 111, column: 7 } }, "34": { start: { line: 110, column: 8 }, end: { line: 110, column: 15 } }, "35": { start: { line: 113, column: 18 }, end: { line: 113, column: 29 } }, "36": { start: { line: 114, column: 15 }, end: { line: 114, column: 18 } }, "37": { start: { line: 117, column: 6 }, end: { line: 119, column: 7 } }, "38": { start: { line: 118, column: 8 }, end: { line: 118, column: 31 } }, "39": { start: { line: 121, column: 6 }, end: { line: 121, column: 49 } }, "40": { start: { line: 130, column: 6 }, end: { line: 130, column: 19 } }, "41": { start: { line: 132, column: 6 }, end: { line: 132, column: 27 } }, "42": { start: { line: 133, column: 6 }, end: { line: 133, column: 70 } }, "43": { start: { line: 136, column: 6 }, end: { line: 139, column: 7 } }, "44": { start: { line: 137, column: 8 }, end: { line: 137, column: 72 } }, "45": { start: { line: 138, column: 8 }, end: { line: 138, column: 67 } }, "46": { start: { line: 141, column: 6 }, end: { line: 141, column: 68 } }, "47": { start: { line: 143, column: 6 }, end: { line: 143, column: 18 } }, "48": { start: { line: 156, column: 18 }, end: { line: 156, column: 35 } }, "49": { start: { line: 158, column: 6 }, end: { line: 158, column: 58 } }, "50": { start: { line: 167, column: 6 }, end: { line: 167, column: 19 } }, "51": { start: { line: 168, column: 6 }, end: { line: 168, column: 69 } }, "52": { start: { line: 169, column: 6 }, end: { line: 169, column: 26 } }, "53": { start: { line: 170, column: 6 }, end: { line: 170, column: 74 } }, "54": { start: { line: 173, column: 6 }, end: { line: 176, column: 7 } }, "55": { start: { line: 174, column: 8 }, end: { line: 174, column: 68 } }, "56": { start: { line: 175, column: 8 }, end: { line: 175, column: 66 } }, "57": { start: { line: 178, column: 6 }, end: { line: 178, column: 18 } }, "58": { start: { line: 191, column: 20 }, end: { line: 191, column: 39 } }, "59": { start: { line: 192, column: 18 }, end: { line: 192, column: 35 } }, "60": { start: { line: 194, column: 6 }, end: { line: 211, column: 7 } }, "61": { start: { line: 196, column: 8 }, end: { line: 204, column: 9 } }, "62": { start: { line: 197, column: 10 }, end: { line: 197, column: 45 } }, "63": { start: { line: 201, column: 15 }, end: { line: 204, column: 9 } }, "64": { start: { line: 202, column: 10 }, end: { line: 202, column: 41 } }, "65": { start: { line: 203, column: 10 }, end: { line: 203, column: 31 } }, "66": { start: { line: 210, column: 8 }, end: { line: 210, column: 42 } }, "67": { start: { line: 213, column: 6 }, end: { line: 213, column: 28 } }, "68": { start: { line: 222, column: 19 }, end: { line: 222, column: 46 } }, "69": { start: { line: 224, column: 6 }, end: { line: 226, column: 7 } }, "70": { start: { line: 225, column: 8 }, end: { line: 225, column: 20 } }, "71": { start: { line: 235, column: 19 }, end: { line: 235, column: 46 } }, "72": { start: { line: 237, column: 6 }, end: { line: 239, column: 7 } }, "73": { start: { line: 238, column: 8 }, end: { line: 238, column: 20 } }, "74": { start: { line: 249, column: 19 }, end: { line: 249, column: 46 } }, "75": { start: { line: 250, column: 23 }, end: { line: 250, column: 41 } }, "76": { start: { line: 251, column: 20 }, end: { line: 251, column: 39 } }, "77": { start: { line: 252, column: 18 }, end: { line: 252, column: 35 } }, "78": { start: { line: 255, column: 6 }, end: { line: 275, column: 7 } }, "79": { start: { line: 256, column: 8 }, end: { line: 256, column: 38 } }, "80": { start: { line: 261, column: 8 }, end: { line: 274, column: 9 } }, "81": { start: { line: 262, column: 10 }, end: { line: 262, column: 94 } }, "82": { start: { line: 263, column: 10 }, end: { line: 263, column: 42 } }, "83": { start: { line: 264, column: 10 }, end: { line: 264, column: 22 } }, "84": { start: { line: 270, column: 15 }, end: { line: 274, column: 9 } }, "85": { start: { line: 271, column: 10 }, end: { line: 271, column: 113 } }, "86": { start: { line: 272, column: 10 }, end: { line: 272, column: 42 } }, "87": { start: { line: 273, column: 10 }, end: { line: 273, column: 22 } }, "88": { start: { line: 277, column: 6 }, end: { line: 277, column: 32 } }, "89": { start: { line: 281, column: 2 }, end: { line: 281, column: 48 } }, "90": { start: { line: 283, column: 2 }, end: { line: 283, column: 17 } } }, fnMap: { "0": { name: "(anonymous_0)", decl: { start: { line: 3, column: 29 }, end: { line: 3, column: 30 } }, loc: { start: { line: 3, column: 42 }, end: { line: 284, column: 1 } }, line: 3 }, "1": { name: "(anonymous_1)", decl: { start: { line: 18, column: 19 }, end: { line: 18, column: 20 } }, loc: { start: { line: 18, column: 24 }, end: { line: 18, column: 56 } }, line: 18 }, "2": { name: "(anonymous_2)", decl: { start: { line: 27, column: 26 }, end: { line: 27, column: 27 } }, loc: { start: { line: 27, column: 31 }, end: { line: 27, column: 73 } }, line: 27 }, "3": { name: "(anonymous_3)", decl: { start: { line: 37, column: 4 }, end: { line: 37, column: 5 } }, loc: { start: { line: 37, column: 33 }, end: { line: 74, column: 5 } }, line: 37 }, "4": { name: "(anonymous_4)", decl: { start: { line: 40, column: 31 }, end: { line: 40, column: 32 } }, loc: { start: { line: 40, column: 38 }, end: { line: 52, column: 7 } }, line: 40 }, "5": { name: "(anonymous_5)", decl: { start: { line: 61, column: 68 }, end: { line: 61, column: 69 } }, loc: { start: { line: 61, column: 76 }, end: { line: 63, column: 7 } }, line: 61 }, "6": { name: "(anonymous_6)", decl: { start: { line: 62, column: 21 }, end: { line: 62, column: 22 } }, loc: { start: { line: 62, column: 28 }, end: { line: 62, column: 65 } }, line: 62 }, "7": { name: "(anonymous_7)", decl: { start: { line: 76, column: 4 }, end: { line: 76, column: 5 } }, loc: { start: { line: 76, column: 15 }, end: { line: 100, column: 5 } }, line: 76 }, "8": { name: "(anonymous_8)", decl: { start: { line: 108, column: 4 }, end: { line: 108, column: 5 } }, loc: { start: { line: 108, column: 19 }, end: { line: 122, column: 5 } }, line: 108 }, "9": { name: "(anonymous_9)", decl: { start: { line: 129, column: 4 }, end: { line: 129, column: 5 } }, loc: { start: { line: 129, column: 11 }, end: { line: 144, column: 5 } }, line: 129 }, "10": { name: "(anonymous_10)", decl: { start: { line: 155, column: 4 }, end: { line: 155, column: 5 } }, loc: { start: { line: 155, column: 28 }, end: { line: 159, column: 5 } }, line: 155 }, "11": { name: "(anonymous_11)", decl: { start: { line: 166, column: 4 }, end: { line: 166, column: 5 } }, loc: { start: { line: 166, column: 11 }, end: { line: 179, column: 5 } }, line: 166 }, "12": { name: "(anonymous_12)", decl: { start: { line: 190, column: 4 }, end: { line: 190, column: 5 } }, loc: { start: { line: 190, column: 28 }, end: { line: 214, column: 5 } }, line: 190 }, "13": { name: "(anonymous_13)", decl: { start: { line: 221, column: 4 }, end: { line: 221, column: 5 } }, loc: { start: { line: 221, column: 22 }, end: { line: 227, column: 5 } }, line: 221 }, "14": { name: "(anonymous_14)", decl: { start: { line: 234, column: 4 }, end: { line: 234, column: 5 } }, loc: { start: { line: 234, column: 20 }, end: { line: 240, column: 5 } }, line: 234 }, "15": { name: "(anonymous_15)", decl: { start: { line: 248, column: 4 }, end: { line: 248, column: 5 } }, loc: { start: { line: 248, column: 23 }, end: { line: 278, column: 5 } }, line: 248 } }, branchMap: { "0": { loc: { start: { line: 6, column: 14 }, end: { line: 6, column: 36 } }, type: "binary-expr", locations: [{ start: { line: 6, column: 14 }, end: { line: 6, column: 25 } }, { start: { line: 6, column: 29 }, end: { line: 6, column: 36 } }], line: 6 }, "1": { loc: { start: { line: 18, column: 24 }, end: { line: 18, column: 56 } }, type: "binary-expr", locations: [{ start: { line: 18, column: 24 }, end: { line: 18, column: 45 } }, { start: { line: 18, column: 49 }, end: { line: 18, column: 56 } }], line: 18 }, "2": { loc: { start: { line: 27, column: 31 }, end: { line: 27, column: 73 } }, type: "binary-expr", locations: [{ start: { line: 27, column: 31 }, end: { line: 27, column: 52 } }, { start: { line: 27, column: 56 }, end: { line: 27, column: 73 } }], line: 27 }, "3": { loc: { start: { line: 43, column: 8 }, end: { line: 51, column: 9 } }, type: "if", locations: [{ start: { line: 43, column: 8 }, end: { line: 51, column: 9 } }, { start: { line: 43, column: 8 }, end: { line: 51, column: 9 } }], line: 43 }, "4": { loc: { start: { line: 45, column: 15 }, end: { line: 51, column: 9 } }, type: "if", locations: [{ start: { line: 45, column: 15 }, end: { line: 51, column: 9 } }, { start: { line: 45, column: 15 }, end: { line: 51, column: 9 } }], line: 45 }, "5": { loc: { start: { line: 49, column: 15 }, end: { line: 51, column: 9 } }, type: "if", locations: [{ start: { line: 49, column: 15 }, end: { line: 51, column: 9 } }, { start: { line: 49, column: 15 }, end: { line: 51, column: 9 } }], line: 49 }, "6": { loc: { start: { line: 67, column: 6 }, end: { line: 69, column: 7 } }, type: "if", locations: [{ start: { line: 67, column: 6 }, end: { line: 69, column: 7 } }, { start: { line: 67, column: 6 }, end: { line: 69, column: 7 } }], line: 67 }, "7": { loc: { start: { line: 71, column: 81 }, end: { line: 71, column: 108 } }, type: "binary-expr", locations: [{ start: { line: 71, column: 81 }, end: { line: 71, column: 95 } }, { start: { line: 71, column: 99 }, end: { line: 71, column: 108 } }], line: 71 }, "8": { loc: { start: { line: 80, column: 25 }, end: { line: 80, column: 104 } }, type: "cond-expr", locations: [{ start: { line: 80, column: 50 }, end: { line: 80, column: 74 } }, { start: { line: 80, column: 77 }, end: { line: 80, column: 104 } }], line: 80 }, "9": { loc: { start: { line: 91, column: 6 }, end: { line: 97, column: 7 } }, type: "if", locations: [{ start: { line: 91, column: 6 }, end: { line: 97, column: 7 } }, { start: { line: 91, column: 6 }, end: { line: 97, column: 7 } }], line: 91 }, "10": { loc: { start: { line: 93, column: 13 }, end: { line: 97, column: 7 } }, type: "if", locations: [{ start: { line: 93, column: 13 }, end: { line: 97, column: 7 } }, { start: { line: 93, column: 13 }, end: { line: 97, column: 7 } }], line: 93 }, "11": { loc: { start: { line: 109, column: 6 }, end: { line: 111, column: 7 } }, type: "if", locations: [{ start: { line: 109, column: 6 }, end: { line: 111, column: 7 } }, { start: { line: 109, column: 6 }, end: { line: 111, column: 7 } }], line: 109 }, "12": { loc: { start: { line: 117, column: 6 }, end: { line: 119, column: 7 } }, type: "if", locations: [{ start: { line: 117, column: 6 }, end: { line: 119, column: 7 } }, { start: { line: 117, column: 6 }, end: { line: 119, column: 7 } }], line: 117 }, "13": { loc: { start: { line: 117, column: 10 }, end: { line: 117, column: 75 } }, type: "binary-expr", locations: [{ start: { line: 117, column: 10 }, end: { line: 117, column: 37 } }, { start: { line: 117, column: 41 }, end: { line: 117, column: 75 } }], line: 117 }, "14": { loc: { start: { line: 136, column: 6 }, end: { line: 139, column: 7 } }, type: "if", locations: [{ start: { line: 136, column: 6 }, end: { line: 139, column: 7 } }, { start: { line: 136, column: 6 }, end: { line: 139, column: 7 } }], line: 136 }, "15": { loc: { start: { line: 158, column: 13 }, end: { line: 158, column: 57 } }, type: "cond-expr", locations: [{ start: { line: 158, column: 30 }, end: { line: 158, column: 41 } }, { start: { line: 158, column: 45 }, end: { line: 158, column: 57 } }], line: 158 }, "16": { loc: { start: { line: 173, column: 6 }, end: { line: 176, column: 7 } }, type: "if", locations: [{ start: { line: 173, column: 6 }, end: { line: 176, column: 7 } }, { start: { line: 173, column: 6 }, end: { line: 176, column: 7 } }], line: 173 }, "17": { loc: { start: { line: 194, column: 6 }, end: { line: 211, column: 7 } }, type: "if", locations: [{ start: { line: 194, column: 6 }, end: { line: 211, column: 7 } }, { start: { line: 194, column: 6 }, end: { line: 211, column: 7 } }], line: 194 }, "18": { loc: { start: { line: 196, column: 8 }, end: { line: 204, column: 9 } }, type: "if", locations: [{ start: { line: 196, column: 8 }, end: { line: 204, column: 9 } }, { start: { line: 196, column: 8 }, end: { line: 204, column: 9 } }], line: 196 }, "19": { loc: { start: { line: 197, column: 17 }, end: { line: 197, column: 44 } }, type: "binary-expr", locations: [{ start: { line: 197, column: 17 }, end: { line: 197, column: 30 } }, { start: { line: 197, column: 34 }, end: { line: 197, column: 44 } }], line: 197 }, "20": { loc: { start: { line: 201, column: 15 }, end: { line: 204, column: 9 } }, type: "if", locations: [{ start: { line: 201, column: 15 }, end: { line: 204, column: 9 } }, { start: { line: 201, column: 15 }, end: { line: 204, column: 9 } }], line: 201 }, "21": { loc: { start: { line: 224, column: 6 }, end: { line: 226, column: 7 } }, type: "if", locations: [{ start: { line: 224, column: 6 }, end: { line: 226, column: 7 } }, { start: { line: 224, column: 6 }, end: { line: 226, column: 7 } }], line: 224 }, "22": { loc: { start: { line: 237, column: 6 }, end: { line: 239, column: 7 } }, type: "if", locations: [{ start: { line: 237, column: 6 }, end: { line: 239, column: 7 } }, { start: { line: 237, column: 6 }, end: { line: 239, column: 7 } }], line: 237 }, "23": { loc: { start: { line: 255, column: 6 }, end: { line: 275, column: 7 } }, type: "if", locations: [{ start: { line: 255, column: 6 }, end: { line: 275, column: 7 } }, { start: { line: 255, column: 6 }, end: { line: 275, column: 7 } }], line: 255 }, "24": { loc: { start: { line: 261, column: 8 }, end: { line: 274, column: 9 } }, type: "if", locations: [{ start: { line: 261, column: 8 }, end: { line: 274, column: 9 } }, { start: { line: 261, column: 8 }, end: { line: 274, column: 9 } }], line: 261 }, "25": { loc: { start: { line: 261, column: 12 }, end: { line: 261, column: 52 } }, type: "binary-expr", locations: [{ start: { line: 261, column: 12 }, end: { line: 261, column: 25 } }, { start: { line: 261, column: 29 }, end: { line: 261, column: 52 } }], line: 261 }, "26": { loc: { start: { line: 270, column: 15 }, end: { line: 274, column: 9 } }, type: "if", locations: [{ start: { line: 270, column: 15 }, end: { line: 274, column: 9 } }, { start: { line: 270, column: 15 }, end: { line: 274, column: 9 } }], line: 270 }, "27": { loc: { start: { line: 270, column: 19 }, end: { line: 270, column: 55 } }, type: "binary-expr", locations: [{ start: { line: 270, column: 19 }, end: { line: 270, column: 39 } }, { start: { line: 270, column: 43 }, end: { line: 270, column: 55 } }], line: 270 } }, s: { "0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, "10": 0, "11": 0, "12": 0, "13": 0, "14": 0, "15": 0, "16": 0, "17": 0, "18": 0, "19": 0, "20": 0, "21": 0, "22": 0, "23": 0, "24": 0, "25": 0, "26": 0, "27": 0, "28": 0, "29": 0, "30": 0, "31": 0, "32": 0, "33": 0, "34": 0, "35": 0, "36": 0, "37": 0, "38": 0, "39": 0, "40": 0, "41": 0, "42": 0, "43": 0, "44": 0, "45": 0, "46": 0, "47": 0, "48": 0, "49": 0, "50": 0, "51": 0, "52": 0, "53": 0, "54": 0, "55": 0, "56": 0, "57": 0, "58": 0, "59": 0, "60": 0, "61": 0, "62": 0, "63": 0, "64": 0, "65": 0, "66": 0, "67": 0, "68": 0, "69": 0, "70": 0, "71": 0, "72": 0, "73": 0, "74": 0, "75": 0, "76": 0, "77": 0, "78": 0, "79": 0, "80": 0, "81": 0, "82": 0, "83": 0, "84": 0, "85": 0, "86": 0, "87": 0, "88": 0, "89": 0, "90": 0 }, f: { "0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, "10": 0, "11": 0, "12": 0, "13": 0, "14": 0, "15": 0 }, b: { "0": [0, 0], "1": [0, 0], "2": [0, 0], "3": [0, 0], "4": [0, 0], "5": [0, 0], "6": [0, 0], "7": [0, 0], "8": [0, 0], "9": [0, 0], "10": [0, 0], "11": [0, 0], "12": [0, 0], "13": [0, 0], "14": [0, 0], "15": [0, 0], "16": [0, 0], "17": [0, 0], "18": [0, 0], "19": [0, 0], "20": [0, 0], "21": [0, 0], "22": [0, 0], "23": [0, 0], "24": [0, 0], "25": [0, 0], "26": [0, 0], "27": [0, 0] }, _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9", hash: "5bb093f3651781fad28e03be6e55ae8e9b7b478f" }; var coverage = global[gcv] || (global[gcv] = {}); if (!coverage[path] || coverage[path].hash !== hash) { coverage[path] = coverageData; } var actualCoverage = coverage[path]; { // @ts-ignore cov_1eue1x6p4a = function () { return actualCoverage; }; } return actualCoverage; } cov_1eue1x6p4a(); cov_1eue1x6p4a().s[0]++; const initOverlayComponent = videojs => { cov_1eue1x6p4a().f[0]++; const Component = (cov_1eue1x6p4a().s[1]++, videojs.getComponent('Component')); const dom = (cov_1eue1x6p4a().s[2]++, (cov_1eue1x6p4a().b[0][0]++, videojs.dom) || (cov_1eue1x6p4a().b[0][1]++, videojs)); /** * Whether the value is a `Number`. * * Both `Infinity` and `-Infinity` are accepted, but `NaN` is not. * * @param {Number} n * @return {Boolean} */ /* eslint-disable no-self-compare */ cov_1eue1x6p4a().s[3]++; const isNumber = n => { cov_1eue1x6p4a().f[1]++; cov_1eue1x6p4a().s[4]++; return (cov_1eue1x6p4a().b[1][0]++, typeof n === 'number') && (cov_1eue1x6p4a().b[1][1]++, n === n); }; /* eslint-enable no-self-compare */ /** * Whether a value is a string with no whitespace. * * @param {string} s * @return {boolean} */ cov_1eue1x6p4a().s[5]++; const hasNoWhitespace = s => { cov_1eue1x6p4a().f[2]++; cov_1eue1x6p4a().s[6]++; return (cov_1eue1x6p4a().b[2][0]++, typeof s === 'string') && (cov_1eue1x6p4a().b[2][1]++, /^\S+$/.test(s)); }; /** * Overlay component. * * @class Overlay * @extends {videojs.Component} */ class Overlay extends Component { constructor(player, options) { cov_1eue1x6p4a().f[3]++; cov_1eue1x6p4a().s[7]++; super(player, options); cov_1eue1x6p4a().s[8]++; ['start', 'end'].forEach(key => { cov_1eue1x6p4a().f[4]++; const value = (cov_1eue1x6p4a().s[9]++, this.options_[key]); cov_1eue1x6p4a().s[10]++; if (isNumber(value)) { cov_1eue1x6p4a().b[3][0]++; cov_1eue1x6p4a().s[11]++; this[key + 'Event_'] = 'timeupdate'; } else { cov_1eue1x6p4a().b[3][1]++; cov_1eue1x6p4a().s[12]++; if (hasNoWhitespace(value)) { cov_1eue1x6p4a().b[4][0]++; cov_1eue1x6p4a().s[13]++; this[key + 'Event_'] = value; // An overlay MUST have a start option. Otherwise, it's pointless. } else { cov_1eue1x6p4a().b[4][1]++; cov_1eue1x6p4a().s[14]++; if (key === 'start') { cov_1eue1x6p4a().b[5][0]++; cov_1eue1x6p4a().s[15]++; throw new Error('invalid "start" option; expected number or string'); } else { cov_1eue1x6p4a().b[5][1]++; } } } }); // video.js does not like components with multiple instances binding // events to the player because it tracks them at the player level, // not at the level of the object doing the binding. This could also be // solved with Function.prototype.bind (but not videojs.bind because of // its GUID magic), but the anonymous function approach avoids any issues // caused by crappy libraries clobbering Function.prototype.bind. // - https://github.com/videojs/video.js/issues/3097 cov_1eue1x6p4a().s[16]++; ['endListener_', 'rewindListener_', 'startListener_'].forEach(name => { cov_1eue1x6p4a().f[5]++; cov_1eue1x6p4a().s[17]++; this[name] = e => { cov_1eue1x6p4a().f[6]++; cov_1eue1x6p4a().s[18]++; return Overlay.prototype[name].call(this, e); }; }); // If the start event is a timeupdate, we need to watch for rewinds (i.e., // when the user seeks backward). cov_1eue1x6p4a().s[19]++; if (this.startEvent_ === 'timeupdate') { cov_1eue1x6p4a().b[6][0]++; cov_1eue1x6p4a().s[20]++; this.on(player, 'timeupdate', this.rewindListener_); } else { cov_1eue1x6p4a().b[6][1]++; } cov_1eue1x6p4a().s[21]++; this.debug(`created, listening to "${this.startEvent_}" for "start" and "