1/*! 2 * vidbg.js v2.1.0 (https://github.com/blakewilson/vidbg) 3 * vidbg.js by Blake Wilson (https://blake.id) 4 * @license MIT (https://github.com/blakewilson/vidbg/blob/master/LICENSE) 5 */ 6! function (e, t) { 7 "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.vidbg = t() : e.vidbg = t() 8}(this, (function () { 9 return function () { 10 "use strict"; 11 var e = { 12 293: function (e) { 13 var t = "a-f\\d", 14 o = "#?[".concat(t, "]{3}[").concat(t, "]?"), 15 n = "#?[".concat(t, "]{6}([").concat(t, "]{2})?"), 16 r = new RegExp("[^#".concat(t, "]"), "gi"), 17 i = new RegExp("^".concat(o, "$|^").concat(n, "$"), "i"); 18 e.exports = function (e) { 19 var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; 20 if ("string" != typeof e || r.test(e) || !i.test(e)) throw new TypeError("Expected a valid hex string"); 21 var o = 1; 22 8 === (e = e.replace(/^#/, "")).length && (o = Number.parseInt(e.slice(6, 8), 16) / 255, e = e.slice(0, 6)), 4 === e.length && (o = Number.parseInt(e.slice(3, 4).repeat(2), 16) / 255, e = e.slice(0, 3)), 3 === e.length && (e = e[0] + e[0] + e[1] + e[1] + e[2] + e[2]); 23 var n = Number.parseInt(e, 16), 24 a = n >> 16, 25 c = n >> 8 & 255, 26 l = 255 & n, 27 s = "number" == typeof t.alpha ? t.alpha : o; 28 if ("array" === t.format) return [a, c, l, s]; 29 if ("css" === t.format) { 30 var u = 1 === s ? "" : " / ".concat(Number((100 * s).toFixed(2)), "%"); 31 return "rgb(".concat(a, " ").concat(c, " ").concat(l).concat(u, ")") 32 } 33 return { 34 red: a, 35 green: c, 36 blue: l, 37 alpha: s 38 } 39 } 40 } 41 }, 42 t = {}; 43 44 function o(n) { 45 var r = t[n]; 46 if (void 0 !== r) return r.exports; 47 var i = t[n] = { 48 exports: {} 49 }; 50 return e[n](i, i.exports, o), i.exports 51 } 52 o.n = function (e) { 53 var t = e && e.__esModule ? function () { 54 return e.default 55 } : function () { 56 return e 57 }; 58 return o.d(t, { 59 a: t 60 }), t 61 }, o.d = function (e, t) { 62 for (var n in t) o.o(t, n) && !o.o(e, n) && Object.defineProperty(e, n, { 63 enumerable: !0, 64 get: t[n] 65 }) 66 }, o.o = function (e, t) { 67 return Object.prototype.hasOwnProperty.call(e, t) 68 }; 69 var n = {}; 70 return function () { 71 o.d(n, { 72 default: function () { 73 return d 74 } 75 }); 76 var e, t = o(293), 77 r = o.n(t), 78 i = { 79 mp4: null, 80 webm: null, 81 poster: null, 82 overlay: !1, 83 overlayColor: "#000", 84 overlayAlpha: .3 85 }, 86 a = { 87 controls: !1, 88 loop: !0, 89 muted: !0, 90 playsInline: !0 91 }, 92 c = (e = function (t, o) { 93 return (e = Object.setPrototypeOf || { 94 __proto__: [] 95 } 96 instanceof Array && function (e, t) { 97 e.__proto__ = t 98 } || function (e, t) { 99 for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]) 100 })(t, o) 101 }, function (t, o) { 102 if ("function" != typeof o && null !== o) throw new TypeError("Class extends value " + String(o) + " is not a constructor or null"); 103 104 function n() { 105 this.constructor = t 106 } 107 e(t, o), t.prototype = null === o ? Object.create(o) : (n.prototype = o.prototype, new n) 108 }), 109 l = function (e) { 110 function t(t) { 111 var o = e.call(this, t) || this; 112 return o.name = "InvalidSelectorError", o 113 } 114 return c(t, e), t 115 }(Error), 116 s = function () { 117 var e = function (t, o) { 118 return (e = Object.setPrototypeOf || { 119 __proto__: [] 120 } 121 instanceof Array && function (e, t) { 122 e.__proto__ = t 123 } || function (e, t) { 124 for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]) 125 })(t, o) 126 }; 127 return function (t, o) { 128 if ("function" != typeof o && null !== o) throw new TypeError("Class extends value " + String(o) + " is not a constructor or null"); 129 130 function n() { 131 this.constructor = t 132 } 133 e(t, o), t.prototype = null === o ? Object.create(o) : (n.prototype = o.prototype, new n) 134 } 135 }(), 136 u = function (e) { 137 function t(t) { 138 var o = e.call(this, t) || this; 139 return o.name = "VideoSourceNotSpecifiedError", o 140 } 141 return s(t, e), t 142 }(Error), 143 p = function () { 144 return (p = Object.assign || function (e) { 145 for (var t, o = 1, n = arguments.length; o < n; o++) 146 for (var r in t = arguments[o]) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]); 147 return e 148 }).apply(this, arguments) 149 }, 150 d = function () { 151 function e(e, t, o) { 152 var n = this; 153 if (this.createContainer = function () { 154 n.containerEl = document.createElement("div"), n.containerEl.className = "vidbg-container", n.createPoster(), n.el.appendChild(n.containerEl) 155 }, this.createOverlay = function () { 156 if (n.overlayEl = document.createElement("div"), n.overlayEl.className = "vidbg-overlay", n.options.overlay) { 157 var e = r()(n.options.overlayColor, { 158 format: "array" 159 }), 160 t = [e[0], e[1], e[2], n.options.overlayAlpha]; 161 n.overlayEl.style.backgroundColor = "rgba(" + t.join(", ") + ")" 162 } 163 n.containerEl.appendChild(n.overlayEl) 164 }, this.createPoster = function () { 165 n.options.poster && (n.containerEl.style.backgroundImage = "url(" + n.options.poster + ")") 166 }, this.createVideo = function () { 167 for (var e in n.videoEl = document.createElement("video"), n.videoEl.addEventListener("playing", n.onPlayEvent), n.attributes) n.videoEl[e] = n.attributes[e]; 168 if (n.options.mp4) { 169 var t = document.createElement("source"); 170 t.src = n.options.mp4, t.type = "video/mp4", n.videoEl.appendChild(t) 171 } 172 if (n.options.webm) { 173 var o = document.createElement("source"); 174 o.src = n.options.webm, o.type = "video/webm", n.videoEl.appendChild(o) 175 } 176 n.containerEl.appendChild(n.videoEl); 177 var r = n.videoEl.play(); 178 void 0 !== r && r.catch((function (e) { 179 console.error(e), console.error("Autoplay is not supported. The video element will be removed."), n.removeVideo() 180 })) 181 }, this.onPlayEvent = function () { 182 n.resize(), n.videoEl.style.opacity = "1" 183 }, this.removeVideo = function () { 184 n.videoEl.remove() 185 }, this.getVideo = function () { 186 return n.videoEl 187 }, this.getEl = function () { 188 return n.el 189 }, this.isVideoPlaying = function () { 190 return !n.videoEl.paused 191 }, this.playVideo = function () { 192 return n.videoEl.play() 193 }, this.pauseVideo = function () { 194 return n.videoEl.pause() 195 }, this.destroy = function () { 196 n.containerEl.remove() 197 }, this.resize = function () { 198 var e = n.containerEl.offsetWidth, 199 t = n.containerEl.offsetHeight; 200 e / n.videoEl.videoWidth > t / n.videoEl.videoHeight ? (n.videoEl.style.width = e + "px", n.videoEl.style.height = "auto") : (n.videoEl.style.width = "auto", n.videoEl.style.height = t + "px") 201 }, !e) throw new l("A selector is required!"); 202 var c = document.querySelector(e); 203 if (!c) throw new l('The selector you specified, "' + e + '", does not exist!'); 204 if (this.el = c, this.options = p(p({}, i), t), this.attributes = p(p({}, a), o), !this.options.mp4 && !this.options.webm) throw new u("Please provide an mp4, webm, or both"); 205 this.init() 206 } 207 return e.prototype.init = function () { 208 this.el.style.position = "relative", this.el.style.zIndex = "1", this.createContainer(), this.createVideo(), this.createOverlay(), window.addEventListener("resize", this.resize) 209 }, e 210 }() 211 }(), n = n.default 212 }() 213}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.