diff --git a/crates/swc_ecma_minifier/src/compress/mod.rs b/crates/swc_ecma_minifier/src/compress/mod.rs index 30c1ac3cdda3..01eda3c681f9 100644 --- a/crates/swc_ecma_minifier/src/compress/mod.rs +++ b/crates/swc_ecma_minifier/src/compress/mod.rs @@ -28,7 +28,7 @@ use crate::{ compress::hoist_decls::decl_hoister, debug::{dump, AssertValid}, mode::Mode, - option::CompressOptions, + option::{CompressOptions, MangleOptions}, program_data::{analyze, ProgramData}, util::{now, unit::CompileUnit}, }; @@ -41,6 +41,7 @@ mod util; pub(crate) fn compressor<'a, M>( marks: Marks, options: &'a CompressOptions, + mangle_options: Option<&'a MangleOptions>, mode: &'a M, ) -> impl 'a + VisitMut where @@ -49,6 +50,7 @@ where let compressor = Compressor { marks, options, + mangle_options, changed: false, pass: 1, dump_for_infinite_loop: Default::default(), @@ -70,6 +72,7 @@ where struct Compressor<'a> { marks: Marks, options: &'a CompressOptions, + mangle_options: Option<&'a MangleOptions>, changed: bool, pass: usize, @@ -269,6 +272,7 @@ impl Compressor<'_> { let mut visitor = optimizer( self.marks, self.options, + self.mangle_options, &mut data, self.mode, !self.dump_for_infinite_loop.is_empty(), diff --git a/crates/swc_ecma_minifier/src/compress/optimize/inline.rs b/crates/swc_ecma_minifier/src/compress/optimize/inline.rs index 6950cf2e0470..3851696b9110 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/inline.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/inline.rs @@ -203,6 +203,14 @@ impl Optimizer<'_> { ) } + if u.declared_as_fn_decl || u.declared_as_fn_expr { + if self.options.keep_fnames + || self.mangle_options.map_or(false, |v| v.keep_fn_names) + { + should_inline = false + } + } + should_inline } else { false @@ -411,6 +419,14 @@ impl Optimizer<'_> { if init_usage.reassigned || !init_usage.declared { return; } + + if init_usage.declared_as_fn_decl || init_usage.declared_as_fn_expr { + if self.options.keep_fnames + || self.mangle_options.map_or(false, |v| v.keep_fn_names) + { + return; + } + } } } diff --git a/crates/swc_ecma_minifier/src/compress/optimize/mod.rs b/crates/swc_ecma_minifier/src/compress/optimize/mod.rs index feaf1d969b6f..d66b1c337fb8 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/mod.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/mod.rs @@ -30,7 +30,7 @@ use crate::{ debug::AssertValid, maybe_par, mode::Mode, - option::CompressOptions, + option::{CompressOptions, MangleOptions}, program_data::ProgramData, util::{ contains_eval, contains_leaping_continue_with_label, make_number, ExprOptExt, ModuleItemExt, @@ -59,6 +59,7 @@ mod util; pub(super) fn optimizer<'a>( marks: Marks, options: &'a CompressOptions, + mangle_options: Option<&'a MangleOptions>, data: &'a mut ProgramData, mode: &'a dyn Mode, debug_infinite_loop: bool, @@ -82,6 +83,7 @@ pub(super) fn optimizer<'a>( }, changed: false, options, + mangle_options, prepend_stmts: Default::default(), append_stmts: Default::default(), vars: Default::default(), @@ -197,6 +199,7 @@ struct Optimizer<'a> { changed: bool, options: &'a CompressOptions, + mangle_options: Option<&'a MangleOptions>, /// Statements prepended to the current statement. prepend_stmts: SynthesizedStmts, /// Statements appended to the current statement. diff --git a/crates/swc_ecma_minifier/src/eval.rs b/crates/swc_ecma_minifier/src/eval.rs index 26422b959f29..67137351cefd 100644 --- a/crates/swc_ecma_minifier/src/eval.rs +++ b/crates/swc_ecma_minifier/src/eval.rs @@ -87,6 +87,7 @@ impl Evaluator { top_level: Some(TopLevelOptions { functions: true }), ..Default::default() }, + None, &data, )); } diff --git a/crates/swc_ecma_minifier/src/lib.rs b/crates/swc_ecma_minifier/src/lib.rs index 31d4b3fa56ce..b9c37c90126a 100644 --- a/crates/swc_ecma_minifier/src/lib.rs +++ b/crates/swc_ecma_minifier/src/lib.rs @@ -178,25 +178,30 @@ pub fn optimize( if let Some(ref mut t) = timings { t.section("compress"); } - if let Some(options) = &options.compress { + if let Some(c) = &options.compress { { let _timer = timer!("compress ast"); - n.visit_mut_with(&mut compressor(marks, options, &Minification)) + n.visit_mut_with(&mut compressor( + marks, + c, + options.mangle.as_ref(), + &Minification, + )) } // Again, we don't need to validate ast let _timer = timer!("postcompress"); - n.visit_mut_with(&mut postcompress_optimizer(options)); + n.visit_mut_with(&mut postcompress_optimizer(c)); let mut pass = 0; loop { pass += 1; let mut v = pure_optimizer( - options, + c, None, marks, PureOptimizerConfig { @@ -207,7 +212,7 @@ pub fn optimize( }, ); n.visit_mut_with(&mut v); - if !v.changed() || options.passes <= pass { + if !v.changed() || c.passes <= pass { break; } } diff --git a/crates/swc_ecma_minifier/tests/fixture/next/31077/static/chunks/1606726a.10299989c08cb523/output.js b/crates/swc_ecma_minifier/tests/fixture/next/31077/static/chunks/1606726a.10299989c08cb523/output.js index ec4f823aaf50..88dace59c31d 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/31077/static/chunks/1606726a.10299989c08cb523/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/31077/static/chunks/1606726a.10299989c08cb523/output.js @@ -234,27 +234,27 @@ configurable: !0 } }; - ViewDesc.prototype.matchesWidget = function() { + ViewDesc.prototype.matchesWidget = function matchesWidget() { return !1; - }, ViewDesc.prototype.matchesMark = function() { + }, ViewDesc.prototype.matchesMark = function matchesMark() { return !1; - }, ViewDesc.prototype.matchesNode = function() { + }, ViewDesc.prototype.matchesNode = function matchesNode() { return !1; - }, ViewDesc.prototype.matchesHack = function(_nodeName) { + }, ViewDesc.prototype.matchesHack = function matchesHack(_nodeName) { return !1; - }, ViewDesc.prototype.parseRule = function() { + }, ViewDesc.prototype.parseRule = function parseRule() { return null; - }, ViewDesc.prototype.stopEvent = function() { + }, ViewDesc.prototype.stopEvent = function stopEvent() { return !1; }, prototypeAccessors.size.get = function() { for(var size = 0, i = 0; i < this.children.length; i++)size += this.children[i].size; return size; }, prototypeAccessors.border.get = function() { return 0; - }, ViewDesc.prototype.destroy = function() { + }, ViewDesc.prototype.destroy = function destroy() { this.parent = null, this.dom.pmViewDesc == this && (this.dom.pmViewDesc = null); for(var i = 0; i < this.children.length; i++)this.children[i].destroy(); - }, ViewDesc.prototype.posBeforeChild = function(child) { + }, ViewDesc.prototype.posBeforeChild = function posBeforeChild(child) { for(var i = 0, pos = this.posAtStart; i < this.children.length; i++){ var cur = this.children[i]; if (cur == child) return pos; @@ -268,7 +268,7 @@ return this.posBefore + this.size; }, prototypeAccessors.posAtEnd.get = function() { return this.posAtStart + this.size - 2 * this.border; - }, ViewDesc.prototype.localPosFromDOM = function(dom, offset, bias) { + }, ViewDesc.prototype.localPosFromDOM = function localPosFromDOM(dom, offset, bias) { if (this.contentDOM && this.contentDOM.contains(1 == dom.nodeType ? dom : dom.parentNode)) { if (bias < 0) { if (dom == this.contentDOM) domBefore = dom.childNodes[offset - 1]; @@ -306,7 +306,7 @@ } } return (null == atEnd ? bias > 0 : atEnd) ? this.posAtEnd : this.posAtStart; - }, ViewDesc.prototype.nearestDesc = function(dom, onlyNodes) { + }, ViewDesc.prototype.nearestDesc = function nearestDesc(dom, onlyNodes) { for(var first = !0, cur = dom; cur; cur = cur.parentNode){ var desc = this.getDesc(cur); if (desc && (!onlyNodes || desc.node)) { @@ -314,15 +314,15 @@ first = !1; } } - }, ViewDesc.prototype.getDesc = function(dom) { + }, ViewDesc.prototype.getDesc = function getDesc(dom) { for(var desc = dom.pmViewDesc, cur = desc; cur; cur = cur.parent)if (cur == this) return desc; - }, ViewDesc.prototype.posFromDOM = function(dom, offset, bias) { + }, ViewDesc.prototype.posFromDOM = function posFromDOM(dom, offset, bias) { for(var scan = dom; scan; scan = scan.parentNode){ var desc = this.getDesc(scan); if (desc) return desc.localPosFromDOM(dom, offset, bias); } return -1; - }, ViewDesc.prototype.descAt = function(pos) { + }, ViewDesc.prototype.descAt = function descAt(pos) { for(var i = 0, offset = 0; i < this.children.length; i++){ var child = this.children[i], end = offset + child.size; if (offset == pos && end != offset) { @@ -332,7 +332,7 @@ if (pos < end) return child.descAt(pos - offset - child.border); offset = end; } - }, ViewDesc.prototype.domFromPos = function(pos, side) { + }, ViewDesc.prototype.domFromPos = function domFromPos(pos, side) { if (!this.contentDOM) return { node: this.dom, offset: 0 @@ -359,7 +359,7 @@ node: this.contentDOM, offset: next ? domIndex(next.dom) : this.contentDOM.childNodes.length }; - }, ViewDesc.prototype.parseRange = function(from, to, base) { + }, ViewDesc.prototype.parseRange = function parseRange(from, to, base) { if (void 0 === base && (base = 0), 0 == this.children.length) return { node: this.contentDOM, from: from, @@ -405,15 +405,15 @@ fromOffset: fromOffset, toOffset: toOffset }; - }, ViewDesc.prototype.emptyChildAt = function(side) { + }, ViewDesc.prototype.emptyChildAt = function emptyChildAt(side) { if (this.border || !this.contentDOM || !this.children.length) return !1; var child = this.children[side < 0 ? 0 : this.children.length - 1]; return 0 == child.size || child.emptyChildAt(side); - }, ViewDesc.prototype.domAfterPos = function(pos) { + }, ViewDesc.prototype.domAfterPos = function domAfterPos(pos) { var ref = this.domFromPos(pos, 0), node = ref.node, offset = ref.offset; if (1 != node.nodeType || offset == node.childNodes.length) throw RangeError("No node after pos " + pos); return node.childNodes[offset]; - }, ViewDesc.prototype.setSelection = function(anchor, head, root, force) { + }, ViewDesc.prototype.setSelection = function setSelection(anchor, head, root, force) { for(var from = Math.min(anchor, head), to = Math.max(anchor, head), i = 0, offset = 0; i < this.children.length; i++){ var child = this.children[i], end = offset + child.size; if (from > offset && to < end) return child.setSelection(anchor - offset - child.border, head - offset - child.border, root, force); @@ -462,11 +462,11 @@ range.setEnd(headDOM.node, headDOM.offset), range.setStart(anchorDOM.node, anchorDOM.offset), domSel.removeAllRanges(), domSel.addRange(range); } } - }, ViewDesc.prototype.ignoreMutation = function(mutation) { + }, ViewDesc.prototype.ignoreMutation = function ignoreMutation(mutation) { return !this.contentDOM && "selection" != mutation.type; }, prototypeAccessors.contentLost.get = function() { return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM); - }, ViewDesc.prototype.markDirty = function(from, to) { + }, ViewDesc.prototype.markDirty = function markDirty(from, to) { for(var offset = 0, i = 0; i < this.children.length; i++){ var child = this.children[i], end = offset + child.size; if (offset == end ? from <= end && to >= offset : from < end && to > offset) { @@ -480,7 +480,7 @@ offset = end; } this.dirty = 2; - }, ViewDesc.prototype.markParentsDirty = function() { + }, ViewDesc.prototype.markParentsDirty = function markParentsDirty() { for(var level = 1, node = this.parent; node; node = node.parent, level++){ var dirty = 1 == level ? 2 : 1; node.dirty < dirty && (node.dirty = dirty); @@ -510,16 +510,16 @@ configurable: !0 } }; - return WidgetViewDesc.prototype.matchesWidget = function(widget) { + return WidgetViewDesc.prototype.matchesWidget = function matchesWidget(widget) { return 0 == this.dirty && widget.type.eq(this.widget.type); - }, WidgetViewDesc.prototype.parseRule = function() { + }, WidgetViewDesc.prototype.parseRule = function parseRule() { return { ignore: !0 }; - }, WidgetViewDesc.prototype.stopEvent = function(event) { + }, WidgetViewDesc.prototype.stopEvent = function stopEvent(event) { var stop = this.widget.spec.stopEvent; return !!stop && stop(event); - }, WidgetViewDesc.prototype.ignoreMutation = function(mutation) { + }, WidgetViewDesc.prototype.ignoreMutation = function ignoreMutation(mutation) { return "selection" != mutation.type || this.widget.spec.ignoreSelection; }, prototypeAccessors$1.domAtom.get = function() { return !0; @@ -536,37 +536,37 @@ }; return prototypeAccessors$2.size.get = function() { return this.text.length; - }, CompositionViewDesc.prototype.localPosFromDOM = function(dom, offset) { + }, CompositionViewDesc.prototype.localPosFromDOM = function localPosFromDOM(dom, offset) { return dom != this.textDOM ? this.posAtStart + (offset ? this.size : 0) : this.posAtStart + offset; - }, CompositionViewDesc.prototype.domFromPos = function(pos) { + }, CompositionViewDesc.prototype.domFromPos = function domFromPos(pos) { return { node: this.textDOM, offset: pos }; - }, CompositionViewDesc.prototype.ignoreMutation = function(mut) { + }, CompositionViewDesc.prototype.ignoreMutation = function ignoreMutation(mut) { return "characterData" === mut.type && mut.target.nodeValue == mut.oldValue; }, Object.defineProperties(CompositionViewDesc.prototype, prototypeAccessors$2), CompositionViewDesc; }(ViewDesc), MarkViewDesc = function(ViewDesc) { function MarkViewDesc(parent, mark, dom, contentDOM) { ViewDesc.call(this, parent, [], dom, contentDOM), this.mark = mark; } - return ViewDesc && (MarkViewDesc.__proto__ = ViewDesc), MarkViewDesc.prototype = Object.create(ViewDesc && ViewDesc.prototype), MarkViewDesc.prototype.constructor = MarkViewDesc, MarkViewDesc.create = function(parent, mark, inline, view) { + return ViewDesc && (MarkViewDesc.__proto__ = ViewDesc), MarkViewDesc.prototype = Object.create(ViewDesc && ViewDesc.prototype), MarkViewDesc.prototype.constructor = MarkViewDesc, MarkViewDesc.create = function create(parent, mark, inline, view) { var custom = view.nodeViews[mark.type.name], spec = custom && custom(mark, view, inline); return spec && spec.dom || (spec = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__.DOMSerializer.renderSpec(document, mark.type.spec.toDOM(mark, inline))), new MarkViewDesc(parent, mark, spec.dom, spec.contentDOM || spec.dom); - }, MarkViewDesc.prototype.parseRule = function() { + }, MarkViewDesc.prototype.parseRule = function parseRule() { return { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM }; - }, MarkViewDesc.prototype.matchesMark = function(mark) { + }, MarkViewDesc.prototype.matchesMark = function matchesMark(mark) { return 3 != this.dirty && this.mark.eq(mark); - }, MarkViewDesc.prototype.markDirty = function(from, to) { + }, MarkViewDesc.prototype.markDirty = function markDirty(from, to) { if (ViewDesc.prototype.markDirty.call(this, from, to), 0 != this.dirty) { for(var parent = this.parent; !parent.node;)parent = parent.parent; parent.dirty < this.dirty && (parent.dirty = this.dirty), this.dirty = 0; } - }, MarkViewDesc.prototype.slice = function(from, to, view) { + }, MarkViewDesc.prototype.slice = function slice(from, to, view) { var copy = MarkViewDesc.create(this.parent, this.mark, !0, view), nodes = this.children, size = this.size; to < size && (nodes = replaceNodes(nodes, to, size, view)), from > 0 && (nodes = replaceNodes(nodes, 0, from, view)); for(var i = 0; i < nodes.length; i++)nodes[i].parent = copy; @@ -588,7 +588,7 @@ configurable: !0 } }; - return NodeViewDesc.create = function(parent, node, outerDeco, innerDeco, view, pos) { + return NodeViewDesc.create = function create(parent, node, outerDeco, innerDeco, view, pos) { var assign, descObj, custom = view.nodeViews[node.type.name], spec = custom && custom(node, view, function() { return descObj ? descObj.parent ? descObj.parent.posBeforeChild(descObj) : void 0 : pos; }, outerDeco, innerDeco), dom = spec && spec.dom, contentDOM = spec && spec.contentDOM; @@ -600,7 +600,7 @@ contentDOM || node.isText || "BR" == dom.nodeName || (dom.hasAttribute("contenteditable") || (dom.contentEditable = !1), node.type.spec.draggable && (dom.draggable = !0)); var nodeDOM = dom; return (dom = applyOuterDeco(dom, outerDeco, node), spec) ? descObj = new CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, spec, view, pos + 1) : node.isText ? new TextViewDesc(parent, node, outerDeco, innerDeco, dom, nodeDOM, view) : new NodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos + 1); - }, NodeViewDesc.prototype.parseRule = function() { + }, NodeViewDesc.prototype.parseRule = function parseRule() { var this$1 = this; if (this.node.type.spec.reparseInView) return null; var rule = { @@ -610,13 +610,13 @@ return this.node.type.spec.code && (rule.preserveWhitespace = "full"), this.contentDOM && !this.contentLost ? rule.contentElement = this.contentDOM : rule.getContent = function() { return this$1.contentDOM ? prosemirror_model__WEBPACK_IMPORTED_MODULE_1__.Fragment.empty : this$1.node.content; }, rule; - }, NodeViewDesc.prototype.matchesNode = function(node, outerDeco, innerDeco) { + }, NodeViewDesc.prototype.matchesNode = function matchesNode(node, outerDeco, innerDeco) { return 0 == this.dirty && node.eq(this.node) && sameOuterDeco(outerDeco, this.outerDeco) && innerDeco.eq(this.innerDeco); }, prototypeAccessors$3.size.get = function() { return this.node.nodeSize; }, prototypeAccessors$3.border.get = function() { return this.node.isLeaf ? 0 : 1; - }, NodeViewDesc.prototype.updateChildren = function(view, pos) { + }, NodeViewDesc.prototype.updateChildren = function updateChildren(view, pos) { var this$1 = this, inline = this.node.inlineContent, off = pos, composition = view.composing && this.localCompositionInfo(view, pos), localComposition = composition && composition.pos > -1 ? composition : null, compositionInChild = composition && composition.pos < 0, updater = new ViewTreeUpdater(this, localComposition && localComposition.node); (function(parent, deco, onWidget, onNode) { var locals = deco.locals(parent), offset = 0; @@ -680,7 +680,7 @@ dom.style.cssText = oldCSS + "; list-style: square !important", window.getComputedStyle(dom).listStyle, dom.style.cssText = oldCSS; } }(this.dom)); - }, NodeViewDesc.prototype.localCompositionInfo = function(view, pos) { + }, NodeViewDesc.prototype.localCompositionInfo = function localCompositionInfo(view, pos) { var ref = view.state.selection, from = ref.from, to = ref.to; if (view.state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__.TextSelection && !(from < pos) && !(to > pos + this.node.content.size)) { var sel = view.root.getSelection(), textNode = function(node, offset) { @@ -724,7 +724,7 @@ }; } } - }, NodeViewDesc.prototype.protectLocalComposition = function(view, ref) { + }, NodeViewDesc.prototype.protectLocalComposition = function protectLocalComposition(view, ref) { var node = ref.node, pos = ref.pos, text = ref.text; if (!this.getDesc(node)) { for(var topNode = node; topNode.parentNode != this.contentDOM; topNode = topNode.parentNode){ @@ -735,18 +735,18 @@ var desc = new CompositionViewDesc(this, topNode, node, text); view.compositionNodes.push(desc), this.children = replaceNodes(this.children, pos, pos + text.length, view, desc); } - }, NodeViewDesc.prototype.update = function(node, outerDeco, innerDeco, view) { + }, NodeViewDesc.prototype.update = function update(node, outerDeco, innerDeco, view) { return !!(3 != this.dirty && node.sameMarkup(this.node)) && (this.updateInner(node, outerDeco, innerDeco, view), !0); - }, NodeViewDesc.prototype.updateInner = function(node, outerDeco, innerDeco, view) { + }, NodeViewDesc.prototype.updateInner = function updateInner(node, outerDeco, innerDeco, view) { this.updateOuterDeco(outerDeco), this.node = node, this.innerDeco = innerDeco, this.contentDOM && this.updateChildren(view, this.posAtStart), this.dirty = 0; - }, NodeViewDesc.prototype.updateOuterDeco = function(outerDeco) { + }, NodeViewDesc.prototype.updateOuterDeco = function updateOuterDeco(outerDeco) { if (!sameOuterDeco(outerDeco, this.outerDeco)) { var needsWrap = 1 != this.nodeDOM.nodeType, oldDOM = this.dom; this.dom = patchOuterDeco(this.dom, this.nodeDOM, computeOuterDeco(this.outerDeco, this.node, needsWrap), computeOuterDeco(outerDeco, this.node, needsWrap)), this.dom != oldDOM && (oldDOM.pmViewDesc = null, this.dom.pmViewDesc = this), this.outerDeco = outerDeco; } - }, NodeViewDesc.prototype.selectNode = function() { + }, NodeViewDesc.prototype.selectNode = function selectNode() { this.nodeDOM.classList.add("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && (this.dom.draggable = !0); - }, NodeViewDesc.prototype.deselectNode = function() { + }, NodeViewDesc.prototype.deselectNode = function deselectNode() { this.nodeDOM.classList.remove("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && this.dom.removeAttribute("draggable"); }, prototypeAccessors$3.domAtom.get = function() { return this.node.isAtom; @@ -765,29 +765,29 @@ configurable: !0 } }; - return TextViewDesc.prototype.parseRule = function() { + return TextViewDesc.prototype.parseRule = function parseRule() { for(var skip = this.nodeDOM.parentNode; skip && skip != this.dom && !skip.pmIsDeco;)skip = skip.parentNode; return { skip: skip || !0 }; - }, TextViewDesc.prototype.update = function(node, outerDeco, _, view) { + }, TextViewDesc.prototype.update = function update(node, outerDeco, _, view) { return !!(3 != this.dirty && (0 == this.dirty || this.inParent()) && node.sameMarkup(this.node)) && (this.updateOuterDeco(outerDeco), (0 != this.dirty || node.text != this.node.text) && node.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = node.text, view.trackWrites == this.nodeDOM && (view.trackWrites = null)), this.node = node, this.dirty = 0, !0); - }, TextViewDesc.prototype.inParent = function() { + }, TextViewDesc.prototype.inParent = function inParent() { for(var parentDOM = this.parent.contentDOM, n = this.nodeDOM; n; n = n.parentNode)if (n == parentDOM) return !0; return !1; - }, TextViewDesc.prototype.domFromPos = function(pos) { + }, TextViewDesc.prototype.domFromPos = function domFromPos(pos) { return { node: this.nodeDOM, offset: pos }; - }, TextViewDesc.prototype.localPosFromDOM = function(dom, offset, bias) { + }, TextViewDesc.prototype.localPosFromDOM = function localPosFromDOM(dom, offset, bias) { return dom == this.nodeDOM ? this.posAtStart + Math.min(offset, this.node.text.length) : NodeViewDesc.prototype.localPosFromDOM.call(this, dom, offset, bias); - }, TextViewDesc.prototype.ignoreMutation = function(mutation) { + }, TextViewDesc.prototype.ignoreMutation = function ignoreMutation(mutation) { return "characterData" != mutation.type && "selection" != mutation.type; - }, TextViewDesc.prototype.slice = function(from, to, view) { + }, TextViewDesc.prototype.slice = function slice(from, to, view) { var node = this.node.cut(from, to), dom = document.createTextNode(node.text); return new TextViewDesc(this.parent, node, this.outerDeco, this.innerDeco, dom, dom, view); - }, TextViewDesc.prototype.markDirty = function(from, to) { + }, TextViewDesc.prototype.markDirty = function markDirty(from, to) { NodeViewDesc.prototype.markDirty.call(this, from, to), this.dom != this.nodeDOM && (0 == from || to == this.nodeDOM.nodeValue.length) && (this.dirty = 3); }, prototypeAccessors$4.domAtom.get = function() { return !1; @@ -805,11 +805,11 @@ configurable: !0 } }; - return TrailingHackViewDesc.prototype.parseRule = function() { + return TrailingHackViewDesc.prototype.parseRule = function parseRule() { return { ignore: !0 }; - }, TrailingHackViewDesc.prototype.matchesHack = function(nodeName) { + }, TrailingHackViewDesc.prototype.matchesHack = function matchesHack(nodeName) { return 0 == this.dirty && this.dom.nodeName == nodeName; }, prototypeAccessors$5.domAtom.get = function() { return !0; @@ -820,24 +820,24 @@ function CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, spec, view, pos) { NodeViewDesc.call(this, parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos), this.spec = spec; } - return NodeViewDesc && (CustomNodeViewDesc.__proto__ = NodeViewDesc), CustomNodeViewDesc.prototype = Object.create(NodeViewDesc && NodeViewDesc.prototype), CustomNodeViewDesc.prototype.constructor = CustomNodeViewDesc, CustomNodeViewDesc.prototype.update = function(node, outerDeco, innerDeco, view) { + return NodeViewDesc && (CustomNodeViewDesc.__proto__ = NodeViewDesc), CustomNodeViewDesc.prototype = Object.create(NodeViewDesc && NodeViewDesc.prototype), CustomNodeViewDesc.prototype.constructor = CustomNodeViewDesc, CustomNodeViewDesc.prototype.update = function update(node, outerDeco, innerDeco, view) { if (3 == this.dirty) return !1; if (this.spec.update) { var result = this.spec.update(node, outerDeco, innerDeco); return result && this.updateInner(node, outerDeco, innerDeco, view), result; } return (!!this.contentDOM || !!node.isLeaf) && NodeViewDesc.prototype.update.call(this, node, outerDeco, innerDeco, view); - }, CustomNodeViewDesc.prototype.selectNode = function() { + }, CustomNodeViewDesc.prototype.selectNode = function selectNode() { this.spec.selectNode ? this.spec.selectNode() : NodeViewDesc.prototype.selectNode.call(this); - }, CustomNodeViewDesc.prototype.deselectNode = function() { + }, CustomNodeViewDesc.prototype.deselectNode = function deselectNode() { this.spec.deselectNode ? this.spec.deselectNode() : NodeViewDesc.prototype.deselectNode.call(this); - }, CustomNodeViewDesc.prototype.setSelection = function(anchor, head, root, force) { + }, CustomNodeViewDesc.prototype.setSelection = function setSelection(anchor, head, root, force) { this.spec.setSelection ? this.spec.setSelection(anchor, head, root) : NodeViewDesc.prototype.setSelection.call(this, anchor, head, root, force); - }, CustomNodeViewDesc.prototype.destroy = function() { + }, CustomNodeViewDesc.prototype.destroy = function destroy() { this.spec.destroy && this.spec.destroy(), NodeViewDesc.prototype.destroy.call(this); - }, CustomNodeViewDesc.prototype.stopEvent = function(event) { + }, CustomNodeViewDesc.prototype.stopEvent = function stopEvent(event) { return !!this.spec.stopEvent && this.spec.stopEvent(event); - }, CustomNodeViewDesc.prototype.ignoreMutation = function(mutation) { + }, CustomNodeViewDesc.prototype.ignoreMutation = function ignoreMutation(mutation) { return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : NodeViewDesc.prototype.ignoreMutation.call(this, mutation); }, CustomNodeViewDesc; }(NodeViewDesc); @@ -973,14 +973,14 @@ view.domObserver.setCurSelection(), view.domObserver.connectSelection(); } } - ViewTreeUpdater.prototype.destroyBetween = function(start, end) { + ViewTreeUpdater.prototype.destroyBetween = function destroyBetween(start, end) { if (start != end) { for(var i = start; i < end; i++)this.top.children[i].destroy(); this.top.children.splice(start, end - start), this.changed = !0; } - }, ViewTreeUpdater.prototype.destroyRest = function() { + }, ViewTreeUpdater.prototype.destroyRest = function destroyRest() { this.destroyBetween(this.index, this.top.children.length); - }, ViewTreeUpdater.prototype.syncToMarks = function(marks, inline, view) { + }, ViewTreeUpdater.prototype.syncToMarks = function syncToMarks(marks, inline, view) { for(var keep = 0, depth = this.stack.length >> 1, maxKeep = Math.min(depth, marks.length); keep < maxKeep && (keep == depth - 1 ? this.top : this.stack[keep + 1 << 1]).matchesMark(marks[keep]) && !1 !== marks[keep].type.spec.spanning;)keep++; for(; keep < depth;)this.destroyRest(), this.top.dirty = 0, this.index = this.stack.pop(), this.top = this.stack.pop(), depth--; for(; depth < marks.length;){ @@ -996,7 +996,7 @@ } this.index = 0, depth++; } - }, ViewTreeUpdater.prototype.findNodeMatch = function(node, outerDeco, innerDeco, index) { + }, ViewTreeUpdater.prototype.findNodeMatch = function findNodeMatch(node, outerDeco, innerDeco, index) { var children = this.top.children, found = -1; if (index >= this.preMatch.index) { for(var i = this.index; i < children.length; i++)if (children[i].matchesNode(node, outerDeco, innerDeco)) { @@ -1011,9 +1011,9 @@ } } return !(found < 0) && (this.destroyBetween(this.index, found), this.index++, !0); - }, ViewTreeUpdater.prototype.updateNodeAt = function(node, outerDeco, innerDeco, index, view) { + }, ViewTreeUpdater.prototype.updateNodeAt = function updateNodeAt(node, outerDeco, innerDeco, index, view) { return !!this.top.children[index].update(node, outerDeco, innerDeco, view) && (this.destroyBetween(this.index, index), this.index = index + 1, !0); - }, ViewTreeUpdater.prototype.findIndexWithChild = function(domNode) { + }, ViewTreeUpdater.prototype.findIndexWithChild = function findIndexWithChild(domNode) { for(;;){ var parent = domNode.parentNode; if (!parent) return -1; @@ -1026,7 +1026,7 @@ } domNode = parent; } - }, ViewTreeUpdater.prototype.updateNextNode = function(node, outerDeco, innerDeco, view, index) { + }, ViewTreeUpdater.prototype.updateNextNode = function updateNextNode(node, outerDeco, innerDeco, view, index) { for(var i = this.index; i < this.top.children.length; i++){ var next = this.top.children[i]; if (next instanceof NodeViewDesc) { @@ -1038,19 +1038,19 @@ } } return !1; - }, ViewTreeUpdater.prototype.addNode = function(node, outerDeco, innerDeco, view, pos) { + }, ViewTreeUpdater.prototype.addNode = function addNode(node, outerDeco, innerDeco, view, pos) { this.top.children.splice(this.index++, 0, NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos)), this.changed = !0; - }, ViewTreeUpdater.prototype.placeWidget = function(widget, view, pos) { + }, ViewTreeUpdater.prototype.placeWidget = function placeWidget(widget, view, pos) { var next = this.index < this.top.children.length ? this.top.children[this.index] : null; if (next && next.matchesWidget(widget) && (widget == next.widget || !next.widget.type.toDOM.parentNode)) this.index++; else { var desc = new WidgetViewDesc(this.top, widget, view, pos); this.top.children.splice(this.index++, 0, desc), this.changed = !0; } - }, ViewTreeUpdater.prototype.addTextblockHacks = function() { + }, ViewTreeUpdater.prototype.addTextblockHacks = function addTextblockHacks() { for(var lastChild = this.top.children[this.index - 1]; lastChild instanceof MarkViewDesc;)lastChild = lastChild.children[lastChild.children.length - 1]; !(!lastChild || !(lastChild instanceof TextViewDesc) || /\n$/.test(lastChild.node.text)) || ((result.safari || result.chrome) && lastChild && "false" == lastChild.dom.contentEditable && this.addHackNode("IMG"), this.addHackNode("BR")); - }, ViewTreeUpdater.prototype.addHackNode = function(nodeName) { + }, ViewTreeUpdater.prototype.addHackNode = function addHackNode(nodeName) { if (this.index < this.top.children.length && this.top.children[this.index].matchesHack(nodeName)) this.index++; else { var dom = document.createElement(nodeName); @@ -1422,9 +1422,9 @@ }, useCharData = result.ie && result.ie_version <= 11, SelectionState = function() { this.anchorNode = this.anchorOffset = this.focusNode = this.focusOffset = null; }; - SelectionState.prototype.set = function(sel) { + SelectionState.prototype.set = function set(sel) { this.anchorNode = sel.anchorNode, this.anchorOffset = sel.anchorOffset, this.focusNode = sel.focusNode, this.focusOffset = sel.focusOffset; - }, SelectionState.prototype.eq = function(sel) { + }, SelectionState.prototype.eq = function eq(sel) { return sel.anchorNode == this.anchorNode && sel.anchorOffset == this.anchorOffset && sel.focusNode == this.focusNode && sel.focusOffset == this.focusOffset; }; var DOMObserver = function(view, handleDOMChange) { @@ -1442,16 +1442,16 @@ }), this$1.flushSoon(); }), this.onSelectionChange = this.onSelectionChange.bind(this), this.suppressingSelectionUpdates = !1; }; - DOMObserver.prototype.flushSoon = function() { + DOMObserver.prototype.flushSoon = function flushSoon() { var this$1 = this; this.flushingSoon < 0 && (this.flushingSoon = window.setTimeout(function() { this$1.flushingSoon = -1, this$1.flush(); }, 20)); - }, DOMObserver.prototype.forceFlush = function() { + }, DOMObserver.prototype.forceFlush = function forceFlush() { this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush()); - }, DOMObserver.prototype.start = function() { + }, DOMObserver.prototype.start = function start() { this.observer && this.observer.observe(this.view.dom, observeOptions), useCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection(); - }, DOMObserver.prototype.stop = function() { + }, DOMObserver.prototype.stop = function stop() { var this$1 = this; if (this.observer) { var take = this.observer.takeRecords(); @@ -1464,16 +1464,16 @@ this.observer.disconnect(); } useCharData && this.view.dom.removeEventListener("DOMCharacterDataModified", this.onCharData), this.disconnectSelection(); - }, DOMObserver.prototype.connectSelection = function() { + }, DOMObserver.prototype.connectSelection = function connectSelection() { this.view.dom.ownerDocument.addEventListener("selectionchange", this.onSelectionChange); - }, DOMObserver.prototype.disconnectSelection = function() { + }, DOMObserver.prototype.disconnectSelection = function disconnectSelection() { this.view.dom.ownerDocument.removeEventListener("selectionchange", this.onSelectionChange); - }, DOMObserver.prototype.suppressSelectionUpdates = function() { + }, DOMObserver.prototype.suppressSelectionUpdates = function suppressSelectionUpdates() { var this$1 = this; this.suppressingSelectionUpdates = !0, setTimeout(function() { return this$1.suppressingSelectionUpdates = !1; }, 50); - }, DOMObserver.prototype.onSelectionChange = function() { + }, DOMObserver.prototype.onSelectionChange = function onSelectionChange() { var view; if ((!(view = this.view).editable || view.root.activeElement == view.dom) && hasSelection(view)) { if (this.suppressingSelectionUpdates) return selectionToDOM(this.view); @@ -1483,16 +1483,16 @@ } this.flush(); } - }, DOMObserver.prototype.setCurSelection = function() { + }, DOMObserver.prototype.setCurSelection = function setCurSelection() { this.currentSelection.set(this.view.root.getSelection()); - }, DOMObserver.prototype.ignoreSelectionChange = function(sel) { + }, DOMObserver.prototype.ignoreSelectionChange = function ignoreSelectionChange(sel) { if (0 == sel.rangeCount) return !0; var container = sel.getRangeAt(0).commonAncestorContainer, desc = this.view.docView.nearestDesc(container); if (desc && desc.ignoreMutation({ type: "selection", target: 3 == container.nodeType ? container.parentNode : container })) return this.setCurSelection(), !0; - }, DOMObserver.prototype.flush = function() { + }, DOMObserver.prototype.flush = function flush() { if (this.view.docView && !(this.flushingSoon > -1)) { var view, mutations = this.observer ? this.observer.takeRecords() : []; this.queue.length && (mutations = this.queue.concat(mutations), this.queue.length = 0); @@ -1512,7 +1512,7 @@ } (from > -1 || newSel) && (from > -1 && (this.view.docView.markDirty(from, to), view = this.view, cssChecked || (cssChecked = !0, "normal" == getComputedStyle(view.dom).whiteSpace && console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."))), this.handleDOMChange(from, to, typeOver, added), this.view.docView.dirty ? this.view.updateState(this.view.state) : this.currentSelection.eq(sel) || selectionToDOM(this.view), this.currentSelection.set(sel)); } - }, DOMObserver.prototype.registerMutation = function(mut, added) { + }, DOMObserver.prototype.registerMutation = function registerMutation(mut, added) { if (added.indexOf(mut.target) > -1) return null; var desc = this.view.docView.nearestDesc(mut.target); if ("attributes" == mut.type && (desc == this.view.docView || "contenteditable" == mut.attributeName || "style" == mut.attributeName && !mut.oldValue && !mut.target.getAttribute("style")) || !desc || desc.ignoreMutation(mut)) return null; @@ -1686,12 +1686,12 @@ function inOrNearComposition(view, event) { return !!view.composing || !!(result.safari && 500 > Math.abs(event.timeStamp - view.compositionEndedAt)) && (view.compositionEndedAt = -200000000, !0); } - MouseDown.prototype.done = function() { + MouseDown.prototype.done = function done() { var this$1 = this; this.view.root.removeEventListener("mouseup", this.up), this.view.root.removeEventListener("mousemove", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(function() { return selectionToDOM(this$1.view); }), this.view.mouseDown = null; - }, MouseDown.prototype.up = function(event) { + }, MouseDown.prototype.up = function up(event) { if (this.done(), this.view.dom.contains(3 == event.target.nodeType ? event.target.parentNode : event.target)) { var view, pos, inside, selectNode, pos1 = this.pos; (this.view.state.doc != this.startDoc && (pos1 = this.view.posAtCoords(eventCoords(event))), this.allowDefault || !pos1) ? setSelectionOrigin(this.view, "pointer") : (view = this.view, pos = pos1.pos, inside = pos1.inside, selectNode = this.selectNode, runHandlerOnContext(view, "handleClickOn", pos, inside, event) || view.someProp("handleClick", function(f) { @@ -1714,7 +1714,7 @@ return !!(node && node.isAtom && prosemirror_state__WEBPACK_IMPORTED_MODULE_0__.NodeSelection.isSelectable(node)) && (updateSelection(view, new prosemirror_state__WEBPACK_IMPORTED_MODULE_0__.NodeSelection($pos), "pointer"), !0); }(view, inside))) ? event.preventDefault() : 0 == event.button && (this.flushed || result.safari && this.mightDrag && !this.mightDrag.node.isAtom || result.chrome && !(this.view.state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__.TextSelection) && 2 >= Math.min(Math.abs(pos1.pos - this.view.state.selection.from), Math.abs(pos1.pos - this.view.state.selection.to))) ? (updateSelection(this.view, prosemirror_state__WEBPACK_IMPORTED_MODULE_0__.Selection.near(this.view.state.doc.resolve(pos1.pos)), "pointer"), event.preventDefault()) : setSelectionOrigin(this.view, "pointer"); } - }, MouseDown.prototype.move = function(event) { + }, MouseDown.prototype.move = function move(event) { !this.allowDefault && (Math.abs(this.event.x - event.clientX) > 4 || Math.abs(this.event.y - event.clientY) > 4) && (this.allowDefault = !0), setSelectionOrigin(this.view, "pointer"), 0 == event.buttons && this.done(); }, handlers.touchdown = function(view) { endComposition(view), setSelectionOrigin(view, "pointer"); @@ -1887,39 +1887,39 @@ var WidgetType = function(toDOM, spec) { this.spec = spec || noSpec, this.side = this.spec.side || 0, this.toDOM = toDOM; }; - WidgetType.prototype.map = function(mapping, span, offset, oldOffset) { + WidgetType.prototype.map = function map(mapping, span, offset, oldOffset) { var ref = mapping.mapResult(span.from + oldOffset, this.side < 0 ? -1 : 1), pos = ref.pos; return ref.deleted ? null : new Decoration(pos - offset, pos - offset, this); - }, WidgetType.prototype.valid = function() { + }, WidgetType.prototype.valid = function valid() { return !0; - }, WidgetType.prototype.eq = function(other) { + }, WidgetType.prototype.eq = function eq(other) { return this == other || other instanceof WidgetType && (this.spec.key && this.spec.key == other.spec.key || this.toDOM == other.toDOM && compareObjs(this.spec, other.spec)); }; var InlineType = function(attrs, spec) { this.spec = spec || noSpec, this.attrs = attrs; }; - InlineType.prototype.map = function(mapping, span, offset, oldOffset) { + InlineType.prototype.map = function map(mapping, span, offset, oldOffset) { var from = mapping.map(span.from + oldOffset, this.spec.inclusiveStart ? -1 : 1) - offset, to = mapping.map(span.to + oldOffset, this.spec.inclusiveEnd ? 1 : -1) - offset; return from >= to ? null : new Decoration(from, to, this); - }, InlineType.prototype.valid = function(_, span) { + }, InlineType.prototype.valid = function valid(_, span) { return span.from < span.to; - }, InlineType.prototype.eq = function(other) { + }, InlineType.prototype.eq = function eq(other) { return this == other || other instanceof InlineType && compareObjs(this.attrs, other.attrs) && compareObjs(this.spec, other.spec); - }, InlineType.is = function(span) { + }, InlineType.is = function is(span) { return span.type instanceof InlineType; }; var NodeType = function(attrs, spec) { this.spec = spec || noSpec, this.attrs = attrs; }; - NodeType.prototype.map = function(mapping, span, offset, oldOffset) { + NodeType.prototype.map = function map(mapping, span, offset, oldOffset) { var from = mapping.mapResult(span.from + oldOffset, 1); if (from.deleted) return null; var to = mapping.mapResult(span.to + oldOffset, -1); return to.deleted || to.pos <= from.pos ? null : new Decoration(from.pos - offset, to.pos - offset, this); - }, NodeType.prototype.valid = function(node, span) { + }, NodeType.prototype.valid = function valid(node, span) { var child, ref = node.content.findIndex(span.from), index = ref.index, offset = ref.offset; return offset == span.from && !(child = node.child(index)).isText && offset + child.nodeSize == span.to; - }, NodeType.prototype.eq = function(other) { + }, NodeType.prototype.eq = function eq(other) { return this == other || other instanceof NodeType && compareObjs(this.attrs, other.attrs) && compareObjs(this.spec, other.spec); }; var Decoration = function(from, to, type) { @@ -1932,17 +1932,17 @@ configurable: !0 } }; - Decoration.prototype.copy = function(from, to) { + Decoration.prototype.copy = function copy(from, to) { return new Decoration(from, to, this.type); - }, Decoration.prototype.eq = function(other, offset) { + }, Decoration.prototype.eq = function eq(other, offset) { return void 0 === offset && (offset = 0), this.type.eq(other.type) && this.from + offset == other.from && this.to + offset == other.to; - }, Decoration.prototype.map = function(mapping, offset, oldOffset) { + }, Decoration.prototype.map = function map(mapping, offset, oldOffset) { return this.type.map(mapping, this, offset, oldOffset); - }, Decoration.widget = function(pos, toDOM, spec) { + }, Decoration.widget = function widget(pos, toDOM, spec) { return new Decoration(pos, pos, new WidgetType(toDOM, spec)); - }, Decoration.inline = function(from, to, attrs, spec) { + }, Decoration.inline = function inline(from, to, attrs, spec) { return new Decoration(from, to, new InlineType(attrs, spec)); - }, Decoration.node = function(from, to, attrs, spec) { + }, Decoration.node = function node(from, to, attrs, spec) { return new Decoration(from, to, new NodeType(attrs, spec)); }, prototypeAccessors$1.spec.get = function() { return this.type.spec; @@ -1952,12 +1952,12 @@ var none = [], noSpec = {}, DecorationSet = function(local, children) { this.local = local && local.length ? local : none, this.children = children && children.length ? children : none; }; - DecorationSet.create = function(doc, decorations) { + DecorationSet.create = function create(doc, decorations) { return decorations.length ? buildTree(decorations, doc, 0, noSpec) : empty; - }, DecorationSet.prototype.find = function(start, end, predicate) { + }, DecorationSet.prototype.find = function find(start, end, predicate) { var result = []; return this.findInner(null == start ? 0 : start, null == end ? 1e9 : end, result, 0, predicate), result; - }, DecorationSet.prototype.findInner = function(start, end, result, offset, predicate) { + }, DecorationSet.prototype.findInner = function findInner(start, end, result, offset, predicate) { for(var i = 0; i < this.local.length; i++){ var span = this.local[i]; span.from <= end && span.to >= start && (!predicate || predicate(span.spec)) && result.push(span.copy(span.from + offset, span.to + offset)); @@ -1966,9 +1966,9 @@ var childOff = this.children[i$1] + 1; this.children[i$1 + 2].findInner(start - childOff, end - childOff, result, offset + childOff, predicate); } - }, DecorationSet.prototype.map = function(mapping, doc, options) { + }, DecorationSet.prototype.map = function map(mapping, doc, options) { return this == empty || 0 == mapping.maps.length ? this : this.mapInner(mapping, doc, 0, 0, options || noSpec); - }, DecorationSet.prototype.mapInner = function(mapping, node, offset, oldOffset, options) { + }, DecorationSet.prototype.mapInner = function mapInner(mapping, node, offset, oldOffset, options) { for(var newLocal, i = 0; i < this.local.length; i++){ var mapped = this.local[i].map(mapping, offset, oldOffset); mapped && mapped.type.valid(node, mapped) ? (newLocal || (newLocal = [])).push(mapped) : options.onRemove && options.onRemove(this.local[i].spec); @@ -2012,9 +2012,9 @@ } return new DecorationSet(newLocal && newLocal.sort(byPos), children); }(this.children, newLocal, mapping, node, offset, oldOffset, options) : newLocal ? new DecorationSet(newLocal.sort(byPos)) : empty; - }, DecorationSet.prototype.add = function(doc, decorations) { + }, DecorationSet.prototype.add = function add(doc, decorations) { return decorations.length ? this == empty ? DecorationSet.create(doc, decorations) : this.addInner(doc, decorations, 0) : this; - }, DecorationSet.prototype.addInner = function(doc, decorations, offset) { + }, DecorationSet.prototype.addInner = function addInner(doc, decorations, offset) { var children, this$1 = this, childIndex = 0; doc.forEach(function(childNode, childOffset) { var found, baseOffset = childOffset + offset; @@ -2025,9 +2025,9 @@ }); for(var local = moveSpans(childIndex ? withoutNulls(decorations) : decorations, -offset), i = 0; i < local.length; i++)local[i].type.valid(doc, local[i]) || local.splice(i--, 1); return new DecorationSet(local.length ? this.local.concat(local).sort(byPos) : this.local, children || this.children); - }, DecorationSet.prototype.remove = function(decorations) { + }, DecorationSet.prototype.remove = function remove(decorations) { return 0 == decorations.length || this == empty ? this : this.removeInner(decorations, 0); - }, DecorationSet.prototype.removeInner = function(decorations, offset) { + }, DecorationSet.prototype.removeInner = function removeInner(decorations, offset) { for(var children = this.children, local = this.local, i = 0; i < children.length; i += 3){ for(var found = void 0, from = children[i] + offset, to = children[i + 1] + offset, j = 0, span = void 0; j < decorations.length; j++)(span = decorations[j]) && span.from > from && span.to < to && (decorations[j] = null, (found || (found = [])).push(span)); if (found) { @@ -2040,7 +2040,7 @@ for(var i$1 = 0, span$1 = void 0; i$1 < decorations.length; i$1++)if (span$1 = decorations[i$1]) for(var j$1 = 0; j$1 < local.length; j$1++)local[j$1].eq(span$1, offset) && (local == this.local && (local = this.local.slice()), local.splice(j$1--, 1)); } return children == this.children && local == this.local ? this : local.length || children.length ? new DecorationSet(local, children) : empty; - }, DecorationSet.prototype.forChild = function(offset, node) { + }, DecorationSet.prototype.forChild = function forChild(offset, node) { if (this == empty) return this; if (node.isLeaf) return DecorationSet.empty; for(var child, local, i = 0; i < this.children.length; i += 3)if (this.children[i] >= offset) { @@ -2062,15 +2062,15 @@ ]) : localSet; } return child || empty; - }, DecorationSet.prototype.eq = function(other) { + }, DecorationSet.prototype.eq = function eq(other) { if (this == other) return !0; if (!(other instanceof DecorationSet) || this.local.length != other.local.length || this.children.length != other.children.length) return !1; for(var i = 0; i < this.local.length; i++)if (!this.local[i].eq(other.local[i])) return !1; for(var i$1 = 0; i$1 < this.children.length; i$1 += 3)if (this.children[i$1] != other.children[i$1] || this.children[i$1 + 1] != other.children[i$1 + 1] || !this.children[i$1 + 2].eq(other.children[i$1 + 2])) return !1; return !0; - }, DecorationSet.prototype.locals = function(node) { + }, DecorationSet.prototype.locals = function locals(node) { return removeOverlap(this.localsInner(node)); - }, DecorationSet.prototype.localsInner = function(node) { + }, DecorationSet.prototype.localsInner = function localsInner(node) { if (this == empty) return none; if (node.inlineContent || !this.local.some(InlineType.is)) return this.local; for(var result = [], i = 0; i < this.local.length; i++)this.local[i].type instanceof InlineType || result.push(this.local[i]); @@ -2142,23 +2142,23 @@ view.cursorWrapper.deco ])), DecorationGroup.from(found); } - DecorationGroup.prototype.map = function(mapping, doc) { + DecorationGroup.prototype.map = function map(mapping, doc) { var mappedDecos = this.members.map(function(member) { return member.map(mapping, doc, noSpec); }); return DecorationGroup.from(mappedDecos); - }, DecorationGroup.prototype.forChild = function(offset, child) { + }, DecorationGroup.prototype.forChild = function forChild(offset, child) { if (child.isLeaf) return DecorationSet.empty; for(var found = [], i = 0; i < this.members.length; i++){ var result = this.members[i].forChild(offset, child); result != empty && (result instanceof DecorationGroup ? found = found.concat(result.members) : found.push(result)); } return DecorationGroup.from(found); - }, DecorationGroup.prototype.eq = function(other) { + }, DecorationGroup.prototype.eq = function eq(other) { if (!(other instanceof DecorationGroup) || other.members.length != this.members.length) return !1; for(var i = 0; i < this.members.length; i++)if (!this.members[i].eq(other.members[i])) return !1; return !0; - }, DecorationGroup.prototype.locals = function(node) { + }, DecorationGroup.prototype.locals = function locals(node) { for(var result, sorted = !0, i = 0; i < this.members.length; i++){ var locals = this.members[i].localsInner(node); if (locals.length) { @@ -2169,7 +2169,7 @@ } } return result ? removeOverlap(sorted ? result : result.sort(byPos)) : none; - }, DecorationGroup.from = function(members) { + }, DecorationGroup.from = function from(members) { switch(members.length){ case 0: return empty; @@ -2421,16 +2421,16 @@ this._props.state = this.state; } return this._props; - }, EditorView.prototype.update = function(props) { + }, EditorView.prototype.update = function update(props) { props.handleDOMEvents != this._props.handleDOMEvents && ensureListeners(this), this._props = props, props.plugins && (props.plugins.forEach(checkStateComponent), this.directPlugins = props.plugins), this.updateStateInner(props.state, !0); - }, EditorView.prototype.setProps = function(props) { + }, EditorView.prototype.setProps = function setProps(props) { var updated = {}; for(var name in this._props)updated[name] = this._props[name]; for(var name$1 in updated.state = this.state, props)updated[name$1] = props[name$1]; this.update(updated); - }, EditorView.prototype.updateState = function(state) { + }, EditorView.prototype.updateState = function updateState(state) { this.updateStateInner(state, this.state.plugins != state.plugins); - }, EditorView.prototype.updateStateInner = function(state, reconfigured) { + }, EditorView.prototype.updateStateInner = function updateStateInner(state, reconfigured) { var refDOM, refTop, newRefTop, this$1 = this, prev = this.state, redraw = !1, updateSel = !1; if (state.storedMarks && this.composing && (clearComposition(this), updateSel = !0), this.state = state, reconfigured) { var nodeViews = buildNodeViews(this); @@ -2480,9 +2480,9 @@ return f(this$1); }) || (state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__.NodeSelection ? scrollRectIntoView(this, this.docView.domAfterPos(state.selection.from).getBoundingClientRect(), startDOM) : scrollRectIntoView(this, this.coordsAtPos(state.selection.head, 1), startDOM)); } else oldScrollPos && (refDOM = oldScrollPos.refDOM, refTop = oldScrollPos.refTop, restoreScrollStack(oldScrollPos.stack, 0 == (newRefTop = refDOM ? refDOM.getBoundingClientRect().top : 0) ? 0 : newRefTop - refTop)); - }, EditorView.prototype.destroyPluginViews = function() { + }, EditorView.prototype.destroyPluginViews = function destroyPluginViews() { for(var view; view = this.pluginViews.pop();)view.destroy && view.destroy(); - }, EditorView.prototype.updatePluginViews = function(prevState) { + }, EditorView.prototype.updatePluginViews = function updatePluginViews(prevState) { if (prevState && prevState.plugins == this.state.plugins && this.directPlugins == this.prevDirectPlugins) for(var i$2 = 0; i$2 < this.pluginViews.length; i$2++){ var pluginView = this.pluginViews[i$2]; pluginView.update && pluginView.update(this, prevState); @@ -2498,7 +2498,7 @@ plugin$1.spec.view && this.pluginViews.push(plugin$1.spec.view(this)); } } - }, EditorView.prototype.someProp = function(propName, f) { + }, EditorView.prototype.someProp = function someProp(propName, f) { var value, prop = this._props && this._props[propName]; if (null != prop && (value = f ? f(prop) : prop)) return value; for(var i = 0; i < this.directPlugins.length; i++){ @@ -2510,9 +2510,9 @@ var prop$2 = plugins[i$1].props[propName]; if (null != prop$2 && (value = f ? f(prop$2) : prop$2)) return value; } - }, EditorView.prototype.hasFocus = function() { + }, EditorView.prototype.hasFocus = function hasFocus() { return this.root.activeElement == this.dom; - }, EditorView.prototype.focus = function() { + }, EditorView.prototype.focus = function focus() { this.domObserver.stop(), this.editable && function(dom) { if (dom.setActive) return dom.setActive(); if (preventScrollSupported) return dom.focus(preventScrollSupported); @@ -2533,7 +2533,7 @@ }), this._root = search; } return cached || document; - }, EditorView.prototype.posAtCoords = function(coords) { + }, EditorView.prototype.posAtCoords = function posAtCoords$1(coords) { return function(view, coords) { var node, offset, doc = view.dom.ownerDocument; if (doc.caretPositionFromPoint) try { @@ -2636,19 +2636,19 @@ inside: desc ? desc.posAtStart - desc.border : -1 }; }(this, coords); - }, EditorView.prototype.coordsAtPos = function(pos, side) { + }, EditorView.prototype.coordsAtPos = function coordsAtPos$1(pos, side) { return void 0 === side && (side = 1), coordsAtPos(this, pos, side); - }, EditorView.prototype.domAtPos = function(pos, side) { + }, EditorView.prototype.domAtPos = function domAtPos(pos, side) { return void 0 === side && (side = 0), this.docView.domFromPos(pos, side); - }, EditorView.prototype.nodeDOM = function(pos) { + }, EditorView.prototype.nodeDOM = function nodeDOM(pos) { var desc = this.docView.descAt(pos); return desc ? desc.nodeDOM : null; - }, EditorView.prototype.posAtDOM = function(node, offset, bias) { + }, EditorView.prototype.posAtDOM = function posAtDOM(node, offset, bias) { void 0 === bias && (bias = -1); var pos = this.docView.posFromDOM(node, offset, bias); if (null == pos) throw RangeError("DOM position not inside the editor"); return pos; - }, EditorView.prototype.endOfTextblock = function(dir, state) { + }, EditorView.prototype.endOfTextblock = function endOfTextblock$1(dir, state) { var view, state1, sel, $pos; return view = this, state1 = state || this.state, cachedState == state1 && cachedDir == dir ? cachedResult : (cachedState = state1, cachedDir = dir, cachedResult = "up" == dir || "down" == dir ? (sel = state1.selection, $pos = "up" == dir ? sel.$from : sel.$to, withFlushedState(view, state1, function() { for(var dom = view.docView.domFromPos($pos.pos, "up" == dir ? -1 : 1).node;;){ @@ -2684,14 +2684,14 @@ return sel.removeAllRanges(), sel.addRange(oldRange), null != oldBidiLevel && (sel.caretBidiLevel = oldBidiLevel), result; }) : "left" == dir || "backward" == dir ? !offset : atEnd; }(view, state1, dir)); - }, EditorView.prototype.destroy = function() { + }, EditorView.prototype.destroy = function destroy() { this.docView && (function(view) { for(var type in view.domObserver.stop(), view.eventHandlers)view.dom.removeEventListener(type, view.eventHandlers[type]); clearTimeout(view.composingTimeout), clearTimeout(view.lastIOSEnterFallbackTimeout); }(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], viewDecorations(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null); - }, EditorView.prototype.dispatchEvent = function(event) { + }, EditorView.prototype.dispatchEvent = function dispatchEvent$1(event) { runCustomHandler(this, event) || !handlers[event.type] || !this.editable && event.type in editHandlers || handlers[event.type](this, event); - }, EditorView.prototype.dispatch = function(tr) { + }, EditorView.prototype.dispatch = function dispatch(tr) { var dispatchTransaction = this._props.dispatchTransaction; dispatchTransaction ? dispatchTransaction.call(this, tr) : this.updateState(this.state.apply(tr)); }, Object.defineProperties(EditorView.prototype, prototypeAccessors$2); diff --git a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/d6e1aeb5-38a8d7ae57119c23/output.js b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/d6e1aeb5-38a8d7ae57119c23/output.js index 644adb940bc3..5f9bd01ff4fe 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/d6e1aeb5-38a8d7ae57119c23/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/d6e1aeb5-38a8d7ae57119c23/output.js @@ -402,16 +402,16 @@ this.vdata = "vdata" + Math.floor(global_window__WEBPACK_IMPORTED_MODULE_0___default().performance && global_window__WEBPACK_IMPORTED_MODULE_0___default().performance.now() || Date.now()), this.data = {}; } var _proto = FakeWeakMap.prototype; - return _proto.set = function(key, value) { + return _proto.set = function set(key, value) { var access = key[this.vdata] || _guid++; return key[this.vdata] || (key[this.vdata] = access), this.data[access] = value, this; - }, _proto.get = function(key) { + }, _proto.get = function get(key) { var access = key[this.vdata]; if (access) return this.data[access]; log$1("We have no data for this element", key); - }, _proto.has = function(key) { + }, _proto.has = function has(key) { return key[this.vdata] in this.data; - }, _proto.delete = function(key) { + }, _proto.delete = function _delete(key) { var access = key[this.vdata]; access && (delete this.data[access], delete key[this.vdata]); }, FakeWeakMap; @@ -458,7 +458,7 @@ _supportsPassive = !1; try { var opts = Object.defineProperty({}, "passive", { - get: function() { + get: function get() { _supportsPassive = !0; } }); @@ -633,7 +633,7 @@ }, listen = function(target, method, type, listener) { validateTarget(target, target, method), target.nodeName ? Events[method](target, type, listener) : target[method](type, listener); }, EventedMixin = { - on: function() { + on: function on() { for(var _this = this, _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key]; var _normalizeListenArgs = normalizeListenArgs(this, args, "on"), isTargetingSelf = _normalizeListenArgs.isTargetingSelf, target = _normalizeListenArgs.target, type = _normalizeListenArgs.type, listener = _normalizeListenArgs.listener; if (listen(target, "on", type, listener), !isTargetingSelf) { @@ -647,7 +647,7 @@ removeRemoverOnTargetDispose.guid = listener.guid, listen(this, "on", "dispose", removeListenerOnDispose), listen(target, "on", "dispose", removeRemoverOnTargetDispose); } }, - one: function() { + one: function one() { for(var _this2 = this, _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++)args[_key2] = arguments[_key2]; var _normalizeListenArgs2 = normalizeListenArgs(this, args, "one"), isTargetingSelf = _normalizeListenArgs2.isTargetingSelf, target = _normalizeListenArgs2.target, type = _normalizeListenArgs2.type, listener = _normalizeListenArgs2.listener; if (isTargetingSelf) listen(target, "one", type, listener); @@ -660,7 +660,7 @@ wrapper.guid = listener.guid, listen(target, "one", type, wrapper); } }, - any: function() { + any: function any() { for(var _this3 = this, _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++)args[_key4] = arguments[_key4]; var _normalizeListenArgs3 = normalizeListenArgs(this, args, "any"), isTargetingSelf = _normalizeListenArgs3.isTargetingSelf, target = _normalizeListenArgs3.target, type = _normalizeListenArgs3.type, listener = _normalizeListenArgs3.listener; if (isTargetingSelf) listen(target, "any", type, listener); @@ -673,10 +673,10 @@ wrapper.guid = listener.guid, listen(target, "any", type, wrapper); } }, - off: function(targetOrType, typeOrListener, listener) { + off: function off$1(targetOrType, typeOrListener, listener) { !targetOrType || isValidEventType(targetOrType) ? off(this.eventBusEl_, targetOrType, typeOrListener) : (validateTarget(targetOrType, this, "off"), validateEventType(typeOrListener, this, "off"), validateListener(listener, this, "off"), listener = bind(this, listener), this.off("dispose", listener), targetOrType.nodeName ? (off(targetOrType, typeOrListener, listener), off(targetOrType, "dispose", listener)) : isEvented(targetOrType) && (targetOrType.off(typeOrListener, listener), targetOrType.off("dispose", listener))); }, - trigger: function(event, hash) { + trigger: function trigger$1(event, hash) { if (validateTarget(this.eventBusEl_, this, "trigger"), !isValidEventType(event && "string" != typeof event ? event.type : event)) { 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); @@ -710,7 +710,7 @@ } var StatefulMixin = { state: {}, - setState: function(stateUpdates) { + setState: function setState(stateUpdates) { var changes, _this = this; return "function" == typeof stateUpdates && (stateUpdates = stateUpdates()), each(stateUpdates, function(value, key) { _this.state[key] !== value && ((changes = changes || {})[key] = { @@ -752,14 +752,14 @@ this.map_ = {}; } var _proto = MapSham.prototype; - return _proto.has = function(key) { + return _proto.has = function has(key) { return key in this.map_; - }, _proto.delete = function(key) { + }, _proto.delete = function _delete(key) { var has = this.has(key); return delete this.map_[key], has; - }, _proto.set = function(key, value) { + }, _proto.set = function set(key, value) { return this.map_[key] = value, this; - }, _proto.forEach = function(callback, thisArg) { + }, _proto.forEach = function forEach(callback, thisArg) { for(var key in this.map_)callback.call(thisArg, this.map_[key], key, this); }, MapSham; }(), Map$1 = global_window__WEBPACK_IMPORTED_MODULE_0___default().Map ? global_window__WEBPACK_IMPORTED_MODULE_0___default().Map : MapSham, SetSham = function() { @@ -767,14 +767,14 @@ this.set_ = {}; } var _proto = SetSham.prototype; - return _proto.has = function(key) { + return _proto.has = function has(key) { return key in this.set_; - }, _proto.delete = function(key) { + }, _proto.delete = function _delete(key) { var has = this.has(key); return delete this.set_[key], has; - }, _proto.add = function(key) { + }, _proto.add = function add(key) { return this.set_[key] = 1, this; - }, _proto.forEach = function(callback, thisArg) { + }, _proto.forEach = function forEach(callback, thisArg) { for(var key in this.set_)callback.call(thisArg, key, key, this); }, SetSham; }(), Set = global_window__WEBPACK_IMPORTED_MODULE_0___default().Set ? global_window__WEBPACK_IMPORTED_MODULE_0___default().Set : SetSham, Component$1 = function() { @@ -788,7 +788,7 @@ }), this.handleLanguagechange = this.handleLanguagechange.bind(this), this.on(this.player_, "languagechange", this.handleLanguagechange)), stateful(this, this.constructor.defaultState), this.children_ = [], this.childIndex_ = {}, this.childNameIndex_ = {}, this.setTimeoutIds_ = new Set(), this.setIntervalIds_ = new Set(), this.rafIds_ = new Set(), this.namedRafs_ = new Map$1(), this.clearingTimersOnDispose_ = !1, !1 !== options.initChildren && this.initChildren(), this.ready(ready), !1 !== options.reportTouchActivity && this.enableTouchActivity(); } var _proto = Component.prototype; - return _proto.dispose = function() { + return _proto.dispose = function dispose() { if (!this.isDisposed_) { if (this.readyQueue_ && (this.readyQueue_.length = 0), this.trigger({ type: "dispose", @@ -796,43 +796,43 @@ }), this.isDisposed_ = !0, this.children_) for(var i = this.children_.length - 1; i >= 0; i--)this.children_[i].dispose && this.children_[i].dispose(); this.children_ = null, this.childIndex_ = null, this.childNameIndex_ = null, this.parentComponent_ = null, this.el_ && (this.el_.parentNode && this.el_.parentNode.removeChild(this.el_), this.el_ = null), this.player_ = null; } - }, _proto.isDisposed = function() { + }, _proto.isDisposed = function isDisposed() { return !!this.isDisposed_; - }, _proto.player = function() { + }, _proto.player = function player() { return this.player_; - }, _proto.options = function(obj) { + }, _proto.options = function options(obj) { return obj && (this.options_ = mergeOptions$3(this.options_, obj)), this.options_; - }, _proto.el = function() { + }, _proto.el = function el() { return this.el_; - }, _proto.createEl = function(tagName, properties, attributes) { + }, _proto.createEl = function createEl$1(tagName, properties, attributes) { return createEl(tagName, properties, attributes); - }, _proto.localize = function(string, tokens, defaultValue) { + }, _proto.localize = function localize(string, tokens, defaultValue) { void 0 === defaultValue && (defaultValue = string); var code = this.player_.language && this.player_.language(), languages = this.player_.languages && this.player_.languages(), language = languages && languages[code], primaryCode = code && code.split("-")[0], primaryLang = languages && languages[primaryCode], localizedString = defaultValue; return language && language[string] ? localizedString = language[string] : primaryLang && primaryLang[string] && (localizedString = primaryLang[string]), tokens && (localizedString = localizedString.replace(/\{(\d+)\}/g, function(match, index) { var value = tokens[index - 1], ret = value; return void 0 === value && (ret = match), ret; })), localizedString; - }, _proto.handleLanguagechange = function() {}, _proto.contentEl = function() { + }, _proto.handleLanguagechange = function handleLanguagechange() {}, _proto.contentEl = function contentEl() { return this.contentEl_ || this.el_; - }, _proto.id = function() { + }, _proto.id = function id() { return this.id_; - }, _proto.name = function() { + }, _proto.name = function name() { return this.name_; - }, _proto.children = function() { + }, _proto.children = function children() { return this.children_; - }, _proto.getChildById = function(id) { + }, _proto.getChildById = function getChildById(id) { return this.childIndex_[id]; - }, _proto.getChild = function(name) { + }, _proto.getChild = function getChild(name) { if (name) return this.childNameIndex_[name]; - }, _proto.getDescendant = function() { + }, _proto.getDescendant = function getDescendant() { for(var _len = arguments.length, names = Array(_len), _key = 0; _key < _len; _key++)names[_key] = arguments[_key]; names = names.reduce(function(acc, n) { return acc.concat(n); }, []); for(var currentChild = this, i = 0; i < names.length; i++)if (!(currentChild = currentChild.getChild(names[i])) || !currentChild.getChild) return; return currentChild; - }, _proto.addChild = function(child, options, index) { + }, _proto.addChild = function addChild(child, options, index) { if (void 0 === options && (options = {}), void 0 === index && (index = this.children_.length), "string" == typeof child) { componentName = toTitleCase$1(child); var component, componentName, componentClassName = options.componentClass || componentName; @@ -847,7 +847,7 @@ this.children_[index + 1] && (this.children_[index + 1].el_ ? refNode = this.children_[index + 1].el_ : isEl(this.children_[index + 1]) && (refNode = this.children_[index + 1])), this.contentEl().insertBefore(component.el(), refNode); } return component; - }, _proto.removeChild = function(component) { + }, _proto.removeChild = function removeChild(component) { if ("string" == typeof component && (component = this.getChild(component)), component && this.children_) { for(var childFound = !1, i = this.children_.length - 1; i >= 0; i--)if (this.children_[i] === component) { childFound = !0, this.children_.splice(i, 1); @@ -859,7 +859,7 @@ compEl && compEl.parentNode === this.contentEl() && this.contentEl().removeChild(component.el()); } } - }, _proto.initChildren = function() { + }, _proto.initChildren = function initChildren() { var _this = this, children = this.options_.children; if (children) { var workingChildren, parentOptions = this.options_, Tech = Component.getComponent("Tech"); @@ -885,9 +885,9 @@ } }); } - }, _proto.buildCSSClass = function() { + }, _proto.buildCSSClass = function buildCSSClass() { return ""; - }, _proto.ready = function(fn, sync) { + }, _proto.ready = function ready(fn, sync) { if (void 0 === sync && (sync = !1), fn) { if (!this.isReady_) { this.readyQueue_ = this.readyQueue_ || [], this.readyQueue_.push(fn); @@ -895,46 +895,46 @@ } sync ? fn.call(this) : this.setTimeout(fn, 1); } - }, _proto.triggerReady = function() { + }, _proto.triggerReady = function triggerReady() { this.isReady_ = !0, this.setTimeout(function() { var readyQueue = this.readyQueue_; this.readyQueue_ = [], readyQueue && readyQueue.length > 0 && readyQueue.forEach(function(fn) { fn.call(this); }, this), this.trigger("ready"); }, 1); - }, _proto.$ = function(selector, context) { + }, _proto.$ = function $$1(selector, context) { return $(selector, context || this.contentEl()); - }, _proto.$$ = function(selector, context) { + }, _proto.$$ = function $$$1(selector, context) { return $$(selector, context || this.contentEl()); - }, _proto.hasClass = function(classToCheck) { + }, _proto.hasClass = function hasClass$1(classToCheck) { return hasClass(this.el_, classToCheck); - }, _proto.addClass = function(classToAdd) { + }, _proto.addClass = function addClass$1(classToAdd) { addClass(this.el_, classToAdd); - }, _proto.removeClass = function(classToRemove) { + }, _proto.removeClass = function removeClass$1(classToRemove) { removeClass(this.el_, classToRemove); - }, _proto.toggleClass = function(classToToggle, predicate) { + }, _proto.toggleClass = function toggleClass$1(classToToggle, predicate) { toggleClass(this.el_, classToToggle, predicate); - }, _proto.show = function() { + }, _proto.show = function show() { this.removeClass("vjs-hidden"); - }, _proto.hide = function() { + }, _proto.hide = function hide() { this.addClass("vjs-hidden"); - }, _proto.lockShowing = function() { + }, _proto.lockShowing = function lockShowing() { this.addClass("vjs-lock-showing"); - }, _proto.unlockShowing = function() { + }, _proto.unlockShowing = function unlockShowing() { this.removeClass("vjs-lock-showing"); - }, _proto.getAttribute = function(attribute) { + }, _proto.getAttribute = function getAttribute$1(attribute) { return getAttribute(this.el_, attribute); - }, _proto.setAttribute = function(attribute, value) { + }, _proto.setAttribute = function setAttribute$1(attribute, value) { setAttribute(this.el_, attribute, value); - }, _proto.removeAttribute = function(attribute) { + }, _proto.removeAttribute = function removeAttribute$1(attribute) { removeAttribute(this.el_, attribute); - }, _proto.width = function(num, skipListeners) { + }, _proto.width = function width(num, skipListeners) { return this.dimension("width", num, skipListeners); - }, _proto.height = function(num, skipListeners) { + }, _proto.height = function height(num, skipListeners) { return this.dimension("height", num, skipListeners); - }, _proto.dimensions = function(width, height) { + }, _proto.dimensions = function dimensions(width, height) { this.width(width, !0), this.height(height); - }, _proto.dimension = function(widthOrHeight, num, skipListeners) { + }, _proto.dimension = function dimension(widthOrHeight, num, skipListeners) { if (void 0 !== num) { (null === num || num != num) && (num = 0), -1 !== ("" + num).indexOf("%") || -1 !== ("" + num).indexOf("px") ? this.el_.style[widthOrHeight] = num : "auto" === num ? this.el_.style[widthOrHeight] = "" : this.el_.style[widthOrHeight] = num + "px", skipListeners || this.trigger("componentresize"); return; @@ -942,7 +942,7 @@ if (!this.el_) return 0; var val = this.el_.style[widthOrHeight], pxIndex = val.indexOf("px"); return -1 !== pxIndex ? parseInt(val.slice(0, pxIndex), 10) : parseInt(this.el_["offset" + toTitleCase$1(widthOrHeight)], 10); - }, _proto.currentDimension = function(widthOrHeight) { + }, _proto.currentDimension = function currentDimension(widthOrHeight) { var computedWidthOrHeight = 0; if ("width" !== widthOrHeight && "height" !== widthOrHeight) throw Error("currentDimension only accepts width or height value"); if (0 === (computedWidthOrHeight = parseFloat(computedWidthOrHeight = computedStyle(this.el_, widthOrHeight))) || isNaN(computedWidthOrHeight)) { @@ -950,24 +950,24 @@ computedWidthOrHeight = this.el_[rule]; } return computedWidthOrHeight; - }, _proto.currentDimensions = function() { + }, _proto.currentDimensions = function currentDimensions() { return { width: this.currentDimension("width"), height: this.currentDimension("height") }; - }, _proto.currentWidth = function() { + }, _proto.currentWidth = function currentWidth() { return this.currentDimension("width"); - }, _proto.currentHeight = function() { + }, _proto.currentHeight = function currentHeight() { return this.currentDimension("height"); - }, _proto.focus = function() { + }, _proto.focus = function focus() { this.el_.focus(); - }, _proto.blur = function() { + }, _proto.blur = function blur() { this.el_.blur(); - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { this.player_ && (event.stopPropagation(), this.player_.handleKeyDown(event)); - }, _proto.handleKeyPress = function(event) { + }, _proto.handleKeyPress = function handleKeyPress(event) { this.handleKeyDown(event); - }, _proto.emitTapEvents = function() { + }, _proto.emitTapEvents = function emitTapEvents() { var couldBeTap, touchStart = 0, firstTouch = null; this.on("touchstart", function(event) { 1 === event.touches.length && (firstTouch = { @@ -987,7 +987,7 @@ this.on("touchleave", noTap), this.on("touchcancel", noTap), this.on("touchend", function(event) { firstTouch = null, !0 === couldBeTap && global_window__WEBPACK_IMPORTED_MODULE_0___default().performance.now() - touchStart < 200 && (event.preventDefault(), this.trigger("tap")); }); - }, _proto.enableTouchActivity = function() { + }, _proto.enableTouchActivity = function enableTouchActivity() { if (this.player() && this.player().reportUserActivity) { var touchHolding, report = bind(this.player(), this.player().reportUserActivity); this.on("touchstart", function() { @@ -998,25 +998,25 @@ }; this.on("touchmove", report), this.on("touchend", touchEnd), this.on("touchcancel", touchEnd); } - }, _proto.setTimeout = function(fn, timeout) { + }, _proto.setTimeout = function setTimeout1(fn, timeout) { var timeoutId, _this2 = this; return fn = bind(this, fn), this.clearTimersOnDispose_(), timeoutId = global_window__WEBPACK_IMPORTED_MODULE_0___default().setTimeout(function() { _this2.setTimeoutIds_.has(timeoutId) && _this2.setTimeoutIds_.delete(timeoutId), fn(); }, timeout), this.setTimeoutIds_.add(timeoutId), timeoutId; - }, _proto.clearTimeout = function(timeoutId) { + }, _proto.clearTimeout = function clearTimeout1(timeoutId) { return this.setTimeoutIds_.has(timeoutId) && (this.setTimeoutIds_.delete(timeoutId), global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(timeoutId)), timeoutId; - }, _proto.setInterval = function(fn, interval) { + }, _proto.setInterval = function setInterval(fn, interval) { fn = bind(this, fn), this.clearTimersOnDispose_(); var intervalId = global_window__WEBPACK_IMPORTED_MODULE_0___default().setInterval(fn, interval); return this.setIntervalIds_.add(intervalId), intervalId; - }, _proto.clearInterval = function(intervalId) { + }, _proto.clearInterval = function clearInterval(intervalId) { return this.setIntervalIds_.has(intervalId) && (this.setIntervalIds_.delete(intervalId), global_window__WEBPACK_IMPORTED_MODULE_0___default().clearInterval(intervalId)), intervalId; - }, _proto.requestAnimationFrame = function(fn) { + }, _proto.requestAnimationFrame = function requestAnimationFrame(fn) { var id, _this3 = this; return this.supportsRaf_ ? (this.clearTimersOnDispose_(), fn = bind(this, fn), id = global_window__WEBPACK_IMPORTED_MODULE_0___default().requestAnimationFrame(function() { _this3.rafIds_.has(id) && _this3.rafIds_.delete(id), fn(); }), this.rafIds_.add(id), id) : this.setTimeout(fn, 1000 / 60); - }, _proto.requestNamedAnimationFrame = function(name, fn) { + }, _proto.requestNamedAnimationFrame = function requestNamedAnimationFrame(name, fn) { var _this4 = this; if (!this.namedRafs_.has(name)) { this.clearTimersOnDispose_(), fn = bind(this, fn); @@ -1025,11 +1025,11 @@ }); return this.namedRafs_.set(name, id), name; } - }, _proto.cancelNamedAnimationFrame = function(name) { + }, _proto.cancelNamedAnimationFrame = function cancelNamedAnimationFrame(name) { this.namedRafs_.has(name) && (this.cancelAnimationFrame(this.namedRafs_.get(name)), this.namedRafs_.delete(name)); - }, _proto.cancelAnimationFrame = function(id) { + }, _proto.cancelAnimationFrame = function cancelAnimationFrame(id) { return this.supportsRaf_ ? (this.rafIds_.has(id) && (this.rafIds_.delete(id), global_window__WEBPACK_IMPORTED_MODULE_0___default().cancelAnimationFrame(id)), id) : this.clearTimeout(id); - }, _proto.clearTimersOnDispose_ = function() { + }, _proto.clearTimersOnDispose_ = function clearTimersOnDispose_() { var _this5 = this; this.clearingTimersOnDispose_ || (this.clearingTimersOnDispose_ = !0, this.one("dispose", function() { [ @@ -1056,7 +1056,7 @@ }); }), _this5.clearingTimersOnDispose_ = !1; })); - }, Component.registerComponent = function(name, ComponentToRegister) { + }, Component.registerComponent = function registerComponent(name, ComponentToRegister) { if ("string" != typeof name || !name) throw Error('Illegal component name, "' + name + '"; must be a non-empty string.'); var Tech = Component.getComponent("Tech"), isTech = Tech && Tech.isTech(ComponentToRegister), isComp = Component === ComponentToRegister || Component.prototype.isPrototypeOf(ComponentToRegister.prototype); if (isTech || !isComp) throw Error('Illegal component, "' + name + '"; ' + (isTech ? "techs must be registered using Tech.registerTech()" : "must be a Component subclass") + "."); @@ -1069,7 +1069,7 @@ }).every(Boolean)) throw Error("Can not register Player component after player has been created."); } return Component.components_[name] = ComponentToRegister, Component.components_[toLowerCase(name)] = ComponentToRegister, ComponentToRegister; - }, Component.getComponent = function(name) { + }, Component.getComponent = function getComponent(name) { if (name && Component.components_) return Component.components_[name]; }, Component; }(); @@ -1082,10 +1082,10 @@ var timeRangesObj; return timeRangesObj = void 0 === ranges || 0 === ranges.length ? { length: 0, - start: function() { + start: function start() { throw Error("This TimeRanges object is empty"); }, - end: function() { + end: function end() { throw Error("This TimeRanges object is empty"); } } : { @@ -1196,7 +1196,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(ModalDialog, _Component); var _proto = ModalDialog.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl() { return _Component.prototype.createEl.call(this, "div", { className: this.buildCSSClass(), tabIndex: -1 @@ -1206,28 +1206,28 @@ "aria-label": this.label(), role: "dialog" }); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.contentEl_ = null, this.descEl_ = null, this.previouslyActiveEl_ = null, _Component.prototype.dispose.call(this); - }, _proto.buildCSSClass = function() { + }, _proto.buildCSSClass = function buildCSSClass() { return MODAL_CLASS_NAME + " vjs-hidden " + _Component.prototype.buildCSSClass.call(this); - }, _proto.label = function() { + }, _proto.label = function label() { return this.localize(this.options_.label || "Modal Window"); - }, _proto.description = function() { + }, _proto.description = function description() { var desc = this.options_.description || this.localize("This is a modal window."); return this.closeable() && (desc += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.")), desc; - }, _proto.open = function() { + }, _proto.open = function open() { if (!this.opened_) { var player = this.player(); this.trigger("beforemodalopen"), this.opened_ = !0, !this.options_.fillAlways && (this.hasBeenOpened_ || this.hasBeenFilled_) || this.fill(), this.wasPlaying_ = !player.paused(), this.options_.pauseOnOpen && this.wasPlaying_ && player.pause(), this.on("keydown", this.handleKeyDown_), this.hadControls_ = player.controls(), player.controls(!1), this.show(), this.conditionalFocus_(), this.el().setAttribute("aria-hidden", "false"), this.trigger("modalopen"), this.hasBeenOpened_ = !0; } - }, _proto.opened = function(value) { + }, _proto.opened = function opened(value) { return "boolean" == typeof value && this[value ? "open" : "close"](), this.opened_; - }, _proto.close = function() { + }, _proto.close = function close() { if (this.opened_) { var player = this.player(); this.trigger("beforemodalclose"), this.opened_ = !1, this.wasPlaying_ && this.options_.pauseOnOpen && player.play(), this.off("keydown", this.handleKeyDown_), this.hadControls_ && player.controls(!0), this.hide(), this.el().setAttribute("aria-hidden", "true"), this.trigger("modalclose"), this.conditionalBlur_(), this.options_.temporary && this.dispose(); } - }, _proto.closeable = function(value) { + }, _proto.closeable = function closeable(value) { if ("boolean" == typeof value) { var closeable = this.closeable_ = !!value, close = this.getChild("closeButton"); if (closeable && !close) { @@ -1239,23 +1239,23 @@ !closeable && close && (this.off(close, "close", this.close_), this.removeChild(close), close.dispose()); } return this.closeable_; - }, _proto.fill = function() { + }, _proto.fill = function fill() { this.fillWith(this.content()); - }, _proto.fillWith = function(content) { + }, _proto.fillWith = function fillWith(content) { var contentEl = this.contentEl(), parentEl = contentEl.parentNode, nextSiblingEl = contentEl.nextSibling; this.trigger("beforemodalfill"), this.hasBeenFilled_ = !0, parentEl.removeChild(contentEl), this.empty(), insertContent(contentEl, content), this.trigger("modalfill"), nextSiblingEl ? parentEl.insertBefore(contentEl, nextSiblingEl) : parentEl.appendChild(contentEl); var closeButton = this.getChild("closeButton"); closeButton && parentEl.appendChild(closeButton.el_); - }, _proto.empty = function() { + }, _proto.empty = function empty() { this.trigger("beforemodalempty"), emptyEl(this.contentEl()), this.trigger("modalempty"); - }, _proto.content = function(value) { + }, _proto.content = function content(value) { return void 0 !== value && (this.content_ = value), this.content_; - }, _proto.conditionalFocus_ = function() { + }, _proto.conditionalFocus_ = function conditionalFocus_() { var activeEl = global_document__WEBPACK_IMPORTED_MODULE_1___default().activeElement, playerEl = this.player_.el_; this.previouslyActiveEl_ = null, (playerEl.contains(activeEl) || playerEl === activeEl) && (this.previouslyActiveEl_ = activeEl, this.focus()); - }, _proto.conditionalBlur_ = function() { + }, _proto.conditionalBlur_ = function conditionalBlur_() { this.previouslyActiveEl_ && (this.previouslyActiveEl_.focus(), this.previouslyActiveEl_ = null); - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { if (event.stopPropagation(), keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Escape") && this.closeable()) { event.preventDefault(), this.close(); return; @@ -1267,7 +1267,7 @@ } global_document__WEBPACK_IMPORTED_MODULE_1___default().activeElement === this.el_ && (focusIndex = 0), event.shiftKey && 0 === focusIndex ? (focusableEls[focusableEls.length - 1].focus(), event.preventDefault()) : event.shiftKey || focusIndex !== focusableEls.length - 1 || (focusableEls[0].focus(), event.preventDefault()); } - }, _proto.focusableEls_ = function() { + }, _proto.focusableEls_ = function focusableEls_() { var allChildren = this.el_.querySelectorAll("*"); return Array.prototype.filter.call(allChildren, function(child) { return (child instanceof global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLAnchorElement || child instanceof global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLAreaElement) && child.hasAttribute("href") || (child instanceof global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLInputElement || child instanceof global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLSelectElement || child instanceof global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLTextAreaElement || child instanceof global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLButtonElement) && !child.hasAttribute("disabled") || child instanceof global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLIFrameElement || child instanceof global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLObjectElement || child instanceof global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLEmbedElement || child.hasAttribute("tabindex") && -1 !== child.getAttribute("tabindex") || child.hasAttribute("contenteditable"); @@ -1282,7 +1282,7 @@ function TrackList(tracks) { var _this; void 0 === tracks && (tracks = []), (_this = _EventTarget.call(this) || this).tracks_ = [], Object.defineProperty((0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this), "length", { - get: function() { + get: function get() { return this.tracks_.length; } }); @@ -1291,10 +1291,10 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TrackList, _EventTarget); var _proto = TrackList.prototype; - return _proto.addTrack = function(track) { + return _proto.addTrack = function addTrack(track) { var _this2 = this, index = this.tracks_.length; "" + index in this || Object.defineProperty(this, index, { - get: function() { + get: function get() { return this.tracks_[index]; } }), -1 === this.tracks_.indexOf(track) && (this.tracks_.push(track), this.trigger({ @@ -1308,7 +1308,7 @@ target: _this2 }); }, isEvented(track) && track.addEventListener("labelchange", track.labelchange_); - }, _proto.removeTrack = function(rtrack) { + }, _proto.removeTrack = function removeTrack(rtrack) { for(var track, i = 0, l = this.length; i < l; i++)if (this[i] === rtrack) { (track = this[i]).off && track.off(), this.tracks_.splice(i, 1); break; @@ -1318,7 +1318,7 @@ type: "removetrack", target: this }); - }, _proto.getTrackById = function(id) { + }, _proto.getTrackById = function getTrackById(id) { for(var result = null, i = 0, l = this.length; i < l; i++){ var track = this[i]; if (track.id === id) { @@ -1349,12 +1349,12 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(AudioTrackList, _TrackList); var _proto = AudioTrackList.prototype; - return _proto.addTrack = function(track) { + return _proto.addTrack = function addTrack(track) { var _this2 = this; track.enabled && disableOthers$1(this, track), _TrackList.prototype.addTrack.call(this, track), track.addEventListener && (track.enabledChange_ = function() { _this2.changing_ || (_this2.changing_ = !0, disableOthers$1(_this2, track), _this2.changing_ = !1, _this2.trigger("change")); }, track.addEventListener("enabledchange", track.enabledChange_)); - }, _proto.removeTrack = function(rtrack) { + }, _proto.removeTrack = function removeTrack(rtrack) { _TrackList.prototype.removeTrack.call(this, rtrack), rtrack.removeEventListener && rtrack.enabledChange_ && (rtrack.removeEventListener("enabledchange", rtrack.enabledChange_), rtrack.enabledChange_ = null); }, AudioTrackList; }(TrackList), disableOthers = function(list, track) { @@ -1368,21 +1368,21 @@ break; } return (_this = _TrackList.call(this, tracks) || this).changing_ = !1, Object.defineProperty((0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this), "selectedIndex", { - get: function() { + get: function get() { for(var _i = 0; _i < this.length; _i++)if (this[_i].selected) return _i; return -1; }, - set: function() {} + set: function set() {} }), _this; } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(VideoTrackList, _TrackList); var _proto = VideoTrackList.prototype; - return _proto.addTrack = function(track) { + return _proto.addTrack = function addTrack(track) { var _this2 = this; track.selected && disableOthers(this, track), _TrackList.prototype.addTrack.call(this, track), track.addEventListener && (track.selectedChange_ = function() { _this2.changing_ || (_this2.changing_ = !0, disableOthers(_this2, track), _this2.changing_ = !1, _this2.trigger("change")); }, track.addEventListener("selectedchange", track.selectedChange_)); - }, _proto.removeTrack = function(rtrack) { + }, _proto.removeTrack = function removeTrack(rtrack) { _TrackList.prototype.removeTrack.call(this, rtrack), rtrack.removeEventListener && rtrack.selectedChange_ && (rtrack.removeEventListener("selectedchange", rtrack.selectedChange_), rtrack.selectedChange_ = null); }, VideoTrackList; }(TrackList), TextTrackList = function(_TrackList) { @@ -1391,7 +1391,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TextTrackList, _TrackList); var _proto = TextTrackList.prototype; - return _proto.addTrack = function(track) { + return _proto.addTrack = function addTrack(track) { var _this = this; _TrackList.prototype.addTrack.call(this, track), this.queueChange_ || (this.queueChange_ = function() { return _this.queueTrigger("change"); @@ -1401,33 +1401,33 @@ "metadata", "chapters" ].indexOf(track.kind) && track.addEventListener("modechange", this.triggerSelectedlanguagechange_); - }, _proto.removeTrack = function(rtrack) { + }, _proto.removeTrack = function removeTrack(rtrack) { _TrackList.prototype.removeTrack.call(this, rtrack), rtrack.removeEventListener && (this.queueChange_ && rtrack.removeEventListener("modechange", this.queueChange_), this.selectedlanguagechange_ && rtrack.removeEventListener("modechange", this.triggerSelectedlanguagechange_)); }, TextTrackList; }(TrackList), HtmlTrackElementList = function() { function HtmlTrackElementList(trackElements) { void 0 === trackElements && (trackElements = []), this.trackElements_ = [], Object.defineProperty(this, "length", { - get: function() { + get: function get() { return this.trackElements_.length; } }); for(var i = 0, length = trackElements.length; i < length; i++)this.addTrackElement_(trackElements[i]); } var _proto = HtmlTrackElementList.prototype; - return _proto.addTrackElement_ = function(trackElement) { + return _proto.addTrackElement_ = function addTrackElement_(trackElement) { var index = this.trackElements_.length; "" + index in this || Object.defineProperty(this, index, { - get: function() { + get: function get() { return this.trackElements_[index]; } }), -1 === this.trackElements_.indexOf(trackElement) && this.trackElements_.push(trackElement); - }, _proto.getTrackElementByTrack_ = function(track) { + }, _proto.getTrackElementByTrack_ = function getTrackElementByTrack_(track) { for(var trackElement_, i = 0, length = this.trackElements_.length; i < length; i++)if (track === this.trackElements_[i].track) { trackElement_ = this.trackElements_[i]; break; } return trackElement_; - }, _proto.removeTrackElement_ = function(trackElement) { + }, _proto.removeTrackElement_ = function removeTrackElement_(trackElement) { for(var i = 0, length = this.trackElements_.length; i < length; i++)if (trackElement === this.trackElements_[i]) { this.trackElements_[i].track && "function" == typeof this.trackElements_[i].track.off && this.trackElements_[i].track.off(), "function" == typeof this.trackElements_[i].off && this.trackElements_[i].off(), this.trackElements_.splice(i, 1); break; @@ -1436,24 +1436,24 @@ }(), TextTrackCueList = function() { function TextTrackCueList(cues) { TextTrackCueList.prototype.setCues_.call(this, cues), Object.defineProperty(this, "length", { - get: function() { + get: function get() { return this.length_; } }); } var _proto = TextTrackCueList.prototype; - return _proto.setCues_ = function(cues) { + return _proto.setCues_ = function setCues_(cues) { var oldLength = this.length || 0, i = 0, l = cues.length; this.cues_ = cues, this.length_ = cues.length; var defineProp = function(index) { "" + index in this || Object.defineProperty(this, "" + index, { - get: function() { + get: function get() { return this.cues_[index]; } }); }; if (oldLength < l) for(i = oldLength; i < l; i++)defineProp.call(this, i); - }, _proto.getCueById = function(id) { + }, _proto.getCueById = function getCueById(id) { for(var result = null, i = 0, l = this.length; i < l; i++){ var cue = this[i]; if (cue.id === id) { @@ -1496,18 +1496,18 @@ language: options.language || "" }, label = options.label || "", _loop = function(key) { Object.defineProperty((0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this), key, { - get: function() { + get: function get() { return trackProps[key]; }, - set: function() {} + set: function set() {} }); }; for(var key in trackProps)_loop(key); return Object.defineProperty((0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this), "label", { - get: function() { + get: function get() { return label; }, - set: function(newLabel) { + set: function set(newLabel) { newLabel !== label && (label = newLabel, this.trigger("labelchange")); } }), _this; @@ -1596,27 +1596,27 @@ _this.tech_.off("timeupdate", timeupdateHandler); }), "disabled" !== mode && _this.tech_.on("timeupdate", timeupdateHandler), Object.defineProperties((0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this), { default: { - get: function() { + get: function get() { return default_; }, - set: function() {} + set: function set() {} }, mode: { - get: function() { + get: function get() { return mode; }, - set: function(newMode) { + set: function set(newMode) { TextTrackMode[newMode] && mode !== newMode && (mode = newMode, this.preload_ || "disabled" === mode || 0 !== this.cues.length || loadTrack(this.src, this), this.tech_.off("timeupdate", timeupdateHandler), "disabled" !== mode && this.tech_.on("timeupdate", timeupdateHandler), this.trigger("modechange")); } }, cues: { - get: function() { + get: function get() { return this.loaded_ ? cues : null; }, - set: function() {} + set: function set() {} }, activeCues: { - get: function() { + get: function get() { if (!this.loaded_) return null; if (0 === this.cues.length) return activeCues; for(var ct = this.tech_.currentTime(), active = [], i = 0, l = this.cues.length; i < l; i++){ @@ -1627,13 +1627,13 @@ else for(var _i = 0; _i < active.length; _i++)-1 === this.activeCues_.indexOf(active[_i]) && (changed = !0); return this.activeCues_ = active, activeCues.setCues_(this.activeCues_), activeCues; }, - set: function() {} + set: function set() {} } }), settings.src ? (_this.src = settings.src, _this.preload_ || (_this.loaded_ = !0), (_this.preload_ || "subtitles" !== settings.kind && "captions" !== settings.kind) && loadTrack(_this.src, (0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this))) : _this.loaded_ = !0, _this; } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TextTrack, _Track); var _proto = TextTrack.prototype; - return _proto.addCue = function(originalCue) { + return _proto.addCue = function addCue(originalCue) { var cue = originalCue; if (global_window__WEBPACK_IMPORTED_MODULE_0___default().vttjs && !(originalCue instanceof global_window__WEBPACK_IMPORTED_MODULE_0___default().vttjs.VTTCue)) { for(var prop in cue = new (global_window__WEBPACK_IMPORTED_MODULE_0___default()).vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text), originalCue)prop in cue || (cue[prop] = originalCue[prop]); @@ -1641,7 +1641,7 @@ } for(var tracks = this.tech_.textTracks(), i = 0; i < tracks.length; i++)tracks[i] !== this && tracks[i].removeCue(cue); this.cues_.push(cue), this.cues.setCues_(this.cues_); - }, _proto.removeCue = function(_removeCue) { + }, _proto.removeCue = function removeCue(_removeCue) { for(var i = this.cues_.length; i--;){ var cue = this.cues_[i]; if (cue === _removeCue || cue.originalCue_ && cue.originalCue_ === _removeCue) { @@ -1663,10 +1663,10 @@ _this = _Track.call(this, settings) || this; var enabled = !1; return Object.defineProperty((0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this), "enabled", { - get: function() { + get: function get() { return enabled; }, - set: function(newEnabled) { + set: function set(newEnabled) { "boolean" == typeof newEnabled && newEnabled !== enabled && (enabled = newEnabled, this.trigger("enabledchange")); } }), settings.enabled && (_this.enabled = settings.enabled), _this.loaded_ = !0, _this; @@ -1681,10 +1681,10 @@ _this = _Track.call(this, settings) || this; var selected = !1; return Object.defineProperty((0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this), "selected", { - get: function() { + get: function get() { return selected; }, - set: function(newSelected) { + set: function set(newSelected) { "boolean" == typeof newSelected && newSelected !== selected && (selected = newSelected, this.trigger("selectedchange")); } }), settings.selected && (_this.selected = settings.selected), _this; @@ -1696,12 +1696,12 @@ var _this, readyState, track = new TextTrack(options); return _this.kind = track.kind, _this.src = track.src, _this.srclang = track.language, _this.label = track.label, _this.default = track.default, Object.defineProperties((0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this), { readyState: { - get: function() { + get: function get() { return readyState; } }, track: { - get: function() { + get: function get() { return track; } } @@ -1757,7 +1757,7 @@ var Tech = function(_Component) { function Tech(options, ready) { var _this; - return void 0 === options && (options = {}), void 0 === ready && (ready = function() {}), options.reportTouchActivity = !1, (_this = _Component.call(this, null, options, ready) || this).onDurationChange_ = function(e) { + return void 0 === options && (options = {}), void 0 === ready && (ready = function ready() {}), options.reportTouchActivity = !1, (_this = _Component.call(this, null, options, ready) || this).onDurationChange_ = function(e) { return _this.onDurationChange(e); }, _this.trackProgress_ = function(e) { return _this.trackProgress(e); @@ -1784,7 +1784,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(Tech, _Component); var _proto = Tech.prototype; - return _proto.triggerSourceset = function(src) { + return _proto.triggerSourceset = function triggerSourceset(src) { var _this2 = this; this.isReady_ || this.one("ready", function() { return _this2.setTimeout(function() { @@ -1794,28 +1794,28 @@ src: src, type: "sourceset" }); - }, _proto.manualProgressOn = function() { + }, _proto.manualProgressOn = function manualProgressOn() { this.on("durationchange", this.onDurationChange_), this.manualProgress = !0, this.one("ready", this.trackProgress_); - }, _proto.manualProgressOff = function() { + }, _proto.manualProgressOff = function manualProgressOff() { this.manualProgress = !1, this.stopTrackingProgress(), this.off("durationchange", this.onDurationChange_); - }, _proto.trackProgress = function(event) { + }, _proto.trackProgress = function trackProgress(event) { this.stopTrackingProgress(), this.progressInterval = this.setInterval(bind(this, function() { var numBufferedPercent = this.bufferedPercent(); this.bufferedPercent_ !== numBufferedPercent && this.trigger("progress"), this.bufferedPercent_ = numBufferedPercent, 1 === numBufferedPercent && this.stopTrackingProgress(); }), 500); - }, _proto.onDurationChange = function(event) { + }, _proto.onDurationChange = function onDurationChange(event) { this.duration_ = this.duration(); - }, _proto.buffered = function() { + }, _proto.buffered = function buffered() { return createTimeRanges(0, 0); - }, _proto.bufferedPercent = function() { + }, _proto.bufferedPercent = function bufferedPercent$1() { return bufferedPercent(this.buffered(), this.duration_); - }, _proto.stopTrackingProgress = function() { + }, _proto.stopTrackingProgress = function stopTrackingProgress() { this.clearInterval(this.progressInterval); - }, _proto.manualTimeUpdatesOn = function() { + }, _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() { this.manualTimeUpdates = !0, this.on("play", this.trackCurrentTime_), this.on("pause", this.stopTrackingCurrentTime_); - }, _proto.manualTimeUpdatesOff = function() { + }, _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() { this.manualTimeUpdates = !1, this.stopTrackingCurrentTime(), this.off("play", this.trackCurrentTime_), this.off("pause", this.stopTrackingCurrentTime_); - }, _proto.trackCurrentTime = function() { + }, _proto.trackCurrentTime = function trackCurrentTime() { this.currentTimeInterval && this.stopTrackingCurrentTime(), this.currentTimeInterval = this.setInterval(function() { this.trigger({ type: "timeupdate", @@ -1823,15 +1823,15 @@ manuallyTriggered: !0 }); }, 250); - }, _proto.stopTrackingCurrentTime = function() { + }, _proto.stopTrackingCurrentTime = function stopTrackingCurrentTime() { this.clearInterval(this.currentTimeInterval), this.trigger({ type: "timeupdate", target: this, manuallyTriggered: !0 }); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.clearTracks(NORMAL.names), this.manualProgress && this.manualProgressOff(), this.manualTimeUpdates && this.manualTimeUpdatesOff(), _Component.prototype.dispose.call(this); - }, _proto.clearTracks = function(types) { + }, _proto.clearTracks = function clearTracks(types) { var _this3 = this; (types = [].concat(types)).forEach(function(type) { for(var list = _this3[type + "Tracks"]() || [], i = list.length; i--;){ @@ -1839,22 +1839,22 @@ "text" === type && _this3.removeRemoteTextTrack(track), list.removeTrack(track); } }); - }, _proto.cleanupAutoTextTracks = function() { + }, _proto.cleanupAutoTextTracks = function cleanupAutoTextTracks() { for(var list = this.autoRemoteTextTracks_ || [], i = list.length; i--;){ var track = list[i]; this.removeRemoteTextTrack(track); } - }, _proto.reset = function() {}, _proto.crossOrigin = function() {}, _proto.setCrossOrigin = function() {}, _proto.error = function(err) { + }, _proto.reset = function reset() {}, _proto.crossOrigin = function crossOrigin() {}, _proto.setCrossOrigin = function setCrossOrigin() {}, _proto.error = function error(err) { return void 0 !== err && (this.error_ = new MediaError(err), this.trigger("error")), this.error_; - }, _proto.played = function() { + }, _proto.played = function played() { return this.hasStarted_ ? createTimeRanges(0, 0) : createTimeRanges(); - }, _proto.play = function() {}, _proto.setScrubbing = function() {}, _proto.scrubbing = function() {}, _proto.setCurrentTime = function() { + }, _proto.play = function play() {}, _proto.setScrubbing = function setScrubbing() {}, _proto.scrubbing = function scrubbing() {}, _proto.setCurrentTime = function setCurrentTime() { this.manualTimeUpdates && this.trigger({ type: "timeupdate", target: this, manuallyTriggered: !0 }); - }, _proto.initTrackListeners = function() { + }, _proto.initTrackListeners = function initTrackListeners() { var _this4 = this; NORMAL.names.forEach(function(name) { var props = NORMAL[name], trackListChanges = function() { @@ -1864,7 +1864,7 @@ tracks.removeEventListener("removetrack", trackListChanges), tracks.removeEventListener("addtrack", trackListChanges); }); }); - }, _proto.addWebVttScript_ = function() { + }, _proto.addWebVttScript_ = function addWebVttScript_() { var _this5 = this; if (!global_window__WEBPACK_IMPORTED_MODULE_0___default().WebVTT) { if (global_document__WEBPACK_IMPORTED_MODULE_1___default().body.contains(this.el())) { @@ -1882,7 +1882,7 @@ }), global_window__WEBPACK_IMPORTED_MODULE_0___default().WebVTT = !0, this.el().parentNode.appendChild(script); } else this.ready(this.addWebVttScript_); } - }, _proto.emulateTextTracks = function() { + }, _proto.emulateTextTracks = function emulateTextTracks() { var _this6 = this, tracks = this.textTracks(), remoteTracks = this.remoteTextTracks(), handleAddTrack = function(e) { return tracks.addTrack(e.track); }, handleRemoveTrack = function(e) { @@ -1902,46 +1902,46 @@ remoteTracks.off("addtrack", handleAddTrack), remoteTracks.off("removetrack", handleRemoveTrack), tracks.removeEventListener("change", textTracksChanges), tracks.removeEventListener("addtrack", textTracksChanges), tracks.removeEventListener("removetrack", textTracksChanges); for(var i = 0; i < tracks.length; i++)tracks[i].removeEventListener("cuechange", updateDisplay); }); - }, _proto.addTextTrack = function(kind, label, language) { + }, _proto.addTextTrack = function addTextTrack(kind, label, language) { var options, tracks, track; if (!kind) throw Error("TextTrack kind is required but was not provided"); return void 0 === options && (options = {}), tracks = this.textTracks(), options.kind = kind, label && (options.label = label), language && (options.language = language), options.tech = this, track = new ALL.text.TrackClass(options), tracks.addTrack(track), track; - }, _proto.createRemoteTextTrack = function(options) { + }, _proto.createRemoteTextTrack = function createRemoteTextTrack(options) { var track = mergeOptions$3(options, { tech: this }); return new REMOTE.remoteTextEl.TrackClass(track); - }, _proto.addRemoteTextTrack = function(options, manualCleanup) { + }, _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) { var _this7 = this; void 0 === options && (options = {}); var htmlTrackElement = this.createRemoteTextTrack(options); return !0 !== manualCleanup && !1 !== manualCleanup && (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 = !0), this.remoteTextTrackEls().addTrackElement_(htmlTrackElement), this.remoteTextTracks().addTrack(htmlTrackElement.track), !0 !== manualCleanup && this.ready(function() { return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track); }), htmlTrackElement; - }, _proto.removeRemoteTextTrack = function(track) { + }, _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) { var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); this.remoteTextTrackEls().removeTrackElement_(trackElement), this.remoteTextTracks().removeTrack(track), this.autoRemoteTextTracks_.removeTrack(track); - }, _proto.getVideoPlaybackQuality = function() { + }, _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() { return {}; - }, _proto.requestPictureInPicture = function() { + }, _proto.requestPictureInPicture = function requestPictureInPicture() { var PromiseClass = this.options_.Promise || global_window__WEBPACK_IMPORTED_MODULE_0___default().Promise; if (PromiseClass) return PromiseClass.reject(); - }, _proto.disablePictureInPicture = function() { + }, _proto.disablePictureInPicture = function disablePictureInPicture() { return !0; - }, _proto.setDisablePictureInPicture = function() {}, _proto.setPoster = function() {}, _proto.playsinline = function() {}, _proto.setPlaysinline = function() {}, _proto.overrideNativeAudioTracks = function() {}, _proto.overrideNativeVideoTracks = function() {}, _proto.canPlayType = function() { + }, _proto.setDisablePictureInPicture = function setDisablePictureInPicture() {}, _proto.setPoster = function setPoster() {}, _proto.playsinline = function playsinline() {}, _proto.setPlaysinline = function setPlaysinline() {}, _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks() {}, _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks() {}, _proto.canPlayType = function canPlayType() { return ""; - }, Tech.canPlayType = function() { + }, Tech.canPlayType = function canPlayType() { return ""; - }, Tech.canPlaySource = function(srcObj, options) { + }, Tech.canPlaySource = function canPlaySource(srcObj, options) { return Tech.canPlayType(srcObj.type); - }, Tech.isTech = function(component) { + }, Tech.isTech = function isTech(component) { return component.prototype instanceof Tech || component instanceof Tech || component === Tech; - }, Tech.registerTech = function(name, tech) { + }, Tech.registerTech = function registerTech(name, tech) { if (Tech.techs_ || (Tech.techs_ = {}), !Tech.isTech(tech)) throw Error("Tech " + name + " must be a Tech"); if (!Tech.canPlayType) throw Error("Techs must have a static canPlayType method on them"); if (!Tech.canPlaySource) throw Error("Techs must have a static canPlaySource method on them"); return name = toTitleCase$1(name), Tech.techs_[name] = tech, Tech.techs_[toLowerCase(name)] = tech, "Tech" !== name && Tech.defaultTechOrder_.push(name), tech; - }, Tech.getTech = function(name) { + }, Tech.getTech = function getTech(name) { return name ? Tech.techs_ && Tech.techs_[name] ? Tech.techs_[name] : (name = toTitleCase$1(name), global_window__WEBPACK_IMPORTED_MODULE_0___default() && global_window__WEBPACK_IMPORTED_MODULE_0___default().videojs && global_window__WEBPACK_IMPORTED_MODULE_0___default().videojs[name]) ? (log$1.warn("The " + name + " tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"), global_window__WEBPACK_IMPORTED_MODULE_0___default().videojs[name]) : void 0 : void 0; }, Tech; }(Component$1); @@ -2106,7 +2106,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(ClickableComponent, _Component); var _proto = ClickableComponent.prototype; - return _proto.createEl = function(tag, props, attributes) { + return _proto.createEl = function createEl$1(tag, props, attributes) { void 0 === tag && (tag = "div"), void 0 === props && (props = {}), void 0 === attributes && (attributes = {}), props = assign({ className: this.buildCSSClass(), tabIndex: 0 @@ -2119,35 +2119,35 @@ }, { "aria-hidden": !0 })), this.createControlTextEl(el), el; - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.controlTextEl_ = null, _Component.prototype.dispose.call(this); - }, _proto.createControlTextEl = function(el) { + }, _proto.createControlTextEl = function createControlTextEl(el) { return this.controlTextEl_ = createEl("span", { className: "vjs-control-text" }, { "aria-live": "polite" }), el && el.appendChild(this.controlTextEl_), this.controlText(this.controlText_, el), this.controlTextEl_; - }, _proto.controlText = function(text, el) { + }, _proto.controlText = function controlText(text, el) { if (void 0 === el && (el = this.el()), void 0 === text) return this.controlText_ || "Need Text"; var localizedText = this.localize(text); this.controlText_ = text, textContent(this.controlTextEl_, localizedText), this.nonIconControl || this.player_.options_.noUITitleAttributes || el.setAttribute("title", localizedText); - }, _proto.buildCSSClass = function() { + }, _proto.buildCSSClass = function buildCSSClass() { return "vjs-control vjs-button " + _Component.prototype.buildCSSClass.call(this); - }, _proto.enable = function() { + }, _proto.enable = function enable() { this.enabled_ || (this.enabled_ = !0, this.removeClass("vjs-disabled"), this.el_.setAttribute("aria-disabled", "false"), void 0 !== this.tabIndex_ && this.el_.setAttribute("tabIndex", this.tabIndex_), this.on([ "tap", "click" ], this.handleClick_), this.on("keydown", this.handleKeyDown_)); - }, _proto.disable = function() { + }, _proto.disable = function disable() { this.enabled_ = !1, this.addClass("vjs-disabled"), this.el_.setAttribute("aria-disabled", "true"), void 0 !== this.tabIndex_ && this.el_.removeAttribute("tabIndex"), this.off("mouseover", this.handleMouseOver_), this.off("mouseout", this.handleMouseOut_), this.off([ "tap", "click" ], this.handleClick_), this.off("keydown", this.handleKeyDown_); - }, _proto.handleLanguagechange = function() { + }, _proto.handleLanguagechange = function handleLanguagechange() { this.controlText(this.controlText_); - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { this.options_.clickHandler && this.options_.clickHandler.call(this, arguments); - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Space") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Enter") ? (event.preventDefault(), event.stopPropagation(), this.trigger("click")) : _Component.prototype.handleKeyDown.call(this, event); }, ClickableComponent; }(Component$1); @@ -2161,20 +2161,20 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(PosterImage, _ClickableComponent); var _proto = PosterImage.prototype; - return _proto.dispose = function() { + return _proto.dispose = function dispose() { this.player().off("posterchange", this.update_), _ClickableComponent.prototype.dispose.call(this); - }, _proto.createEl = function() { + }, _proto.createEl = function createEl$1() { return createEl("div", { className: "vjs-poster", tabIndex: -1 }); - }, _proto.update = function(event) { + }, _proto.update = function update(event) { var url = this.player().poster(); this.setSrc(url), url ? this.show() : this.hide(); - }, _proto.setSrc = function(url) { + }, _proto.setSrc = function setSrc(url) { var backgroundImage = ""; url && (backgroundImage = 'url("' + url + '")'), this.el_.style.backgroundImage = backgroundImage; - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { if (this.player_.controls()) { var sourceIsEncrypted = this.player_.usingPlugin("eme") && this.player_.eme.sessions && this.player_.eme.sessions.length > 0; this.player_.tech(!0) && !((IE_VERSION || IS_EDGE) && sourceIsEncrypted) && this.player_.tech(!0).focus(), this.player_.paused() ? silencePromise(this.player_.play()) : this.player_.pause(); @@ -2232,7 +2232,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TextTrackDisplay, _Component); var _proto = TextTrackDisplay.prototype; - return _proto.preselectTrack = function() { + return _proto.preselectTrack = function preselectTrack() { for(var firstDesc, firstCaptions, preferredTrack, modes = { captions: 1, subtitles: 1 @@ -2241,9 +2241,9 @@ userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes ? track.kind === userPref.kind ? preferredTrack = track : preferredTrack || (preferredTrack = track) : userPref && !userPref.enabled ? (preferredTrack = null, firstDesc = null, firstCaptions = null) : track.default && ("descriptions" !== track.kind || firstDesc ? track.kind in modes && !firstCaptions && (firstCaptions = track) : firstDesc = track); } preferredTrack ? preferredTrack.mode = "showing" : firstCaptions ? firstCaptions.mode = "showing" : firstDesc && (firstDesc.mode = "showing"); - }, _proto.toggleDisplay = function() { + }, _proto.toggleDisplay = function toggleDisplay() { this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks ? this.hide() : this.show(); - }, _proto.createEl = function() { + }, _proto.createEl = function createEl() { return _Component.prototype.createEl.call(this, "div", { className: "vjs-text-track-display" }, { @@ -2251,9 +2251,9 @@ "aria-live": "off", "aria-atomic": "true" }); - }, _proto.clearDisplay = function() { + }, _proto.clearDisplay = function clearDisplay() { "function" == typeof global_window__WEBPACK_IMPORTED_MODULE_0___default().WebVTT && global_window__WEBPACK_IMPORTED_MODULE_0___default().WebVTT.processCues(global_window__WEBPACK_IMPORTED_MODULE_0___default(), [], this.el_); - }, _proto.updateDisplay = function() { + }, _proto.updateDisplay = function updateDisplay() { var tracks = this.player_.textTracks(), allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks; if (this.clearDisplay(), allowMultipleShowingTracks) { for(var showingTracks = [], _i = 0; _i < tracks.length; ++_i){ @@ -2268,7 +2268,7 @@ "showing" === _track.mode && ("descriptions" === _track.kind ? descriptionsTrack = _track : captionsSubtitlesTrack = _track); } captionsSubtitlesTrack ? ("off" !== this.getAttribute("aria-live") && this.setAttribute("aria-live", "off"), this.updateForTrack(captionsSubtitlesTrack)) : descriptionsTrack && ("assertive" !== this.getAttribute("aria-live") && this.setAttribute("aria-live", "assertive"), this.updateForTrack(descriptionsTrack)); - }, _proto.updateDisplayState = function(track) { + }, _proto.updateDisplayState = function updateDisplayState(track) { for(var overrides = this.player_.textTrackSettings.getValues(), cues = track.activeCues, i = cues.length; i--;){ var cue = cues[i]; if (cue) { @@ -2280,7 +2280,7 @@ overrides.fontFamily && "default" !== overrides.fontFamily && ("small-caps" === overrides.fontFamily ? cueDiv.firstChild.style.fontVariant = "small-caps" : cueDiv.firstChild.style.fontFamily = fontMap[overrides.fontFamily]); } } - }, _proto.updateForTrack = function(tracks) { + }, _proto.updateForTrack = function updateForTrack(tracks) { if (Array.isArray(tracks) || (tracks = [ tracks ]), !("function" != typeof global_window__WEBPACK_IMPORTED_MODULE_0___default().WebVTT || tracks.every(function(track) { @@ -2303,7 +2303,7 @@ function LoadingSpinner() { return _Component.apply(this, arguments) || this; } - return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(LoadingSpinner, _Component), LoadingSpinner.prototype.createEl = function() { + return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(LoadingSpinner, _Component), LoadingSpinner.prototype.createEl = function createEl$1() { var isAudio = this.player_.isAudio(), playerType = this.localize(isAudio ? "Audio Player" : "Video Player"), controlText = createEl("span", { className: "vjs-control-text", textContent: this.localize("{1} is loading.", [ @@ -2323,7 +2323,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(Button, _ClickableComponent); var _proto = Button.prototype; - return _proto.createEl = function(tag, props, attributes) { + return _proto.createEl = function createEl$1(tag, props, attributes) { void 0 === props && (props = {}), void 0 === attributes && (attributes = {}); var el = createEl("button", props = assign({ className: this.buildCSSClass() @@ -2335,15 +2335,15 @@ }, { "aria-hidden": !0 })), this.createControlTextEl(el), el; - }, _proto.addChild = function(child, options) { + }, _proto.addChild = function addChild(child, options) { void 0 === options && (options = {}); var className = this.constructor.name; return log$1.warn("Adding an actionable (user controllable) child to a Button (" + className + ") is not supported; use a ClickableComponent instead."), Component$1.prototype.addChild.call(this, child, options); - }, _proto.enable = function() { + }, _proto.enable = function enable() { _ClickableComponent.prototype.enable.call(this), this.el_.removeAttribute("disabled"); - }, _proto.disable = function() { + }, _proto.disable = function disable() { _ClickableComponent.prototype.disable.call(this), this.el_.setAttribute("disabled", "disabled"); - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { if (keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Space") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Enter")) { event.stopPropagation(); return; @@ -2361,9 +2361,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(BigPlayButton, _Button); var _proto = BigPlayButton.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-big-play-button"; - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { var playPromise = this.player_.play(); if (this.mouseused_ && event.clientX && event.clientY) { var sourceIsEncrypted = this.player_.usingPlugin("eme") && this.player_.eme.sessions && this.player_.eme.sessions.length > 0; @@ -2379,9 +2379,9 @@ return playToggle.focus(); }; isPromise(playPromise) ? playPromise.then(playFocus, function() {}) : this.setTimeout(playFocus, 1); - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { this.mouseused_ = !1, _Button.prototype.handleKeyDown.call(this, event); - }, _proto.handleMouseDown = function(event) { + }, _proto.handleMouseDown = function handleMouseDown(event) { this.mouseused_ = !0; }, BigPlayButton; }(Button); @@ -2393,14 +2393,14 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(CloseButton, _Button); var _proto = CloseButton.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-close-button " + _Button.prototype.buildCSSClass.call(this); - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { this.trigger({ type: "close", bubbles: !1 }); - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Esc") ? (event.preventDefault(), event.stopPropagation(), this.trigger("click")) : _Button.prototype.handleKeyDown.call(this, event); }, CloseButton; }(Button); @@ -2418,17 +2418,17 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(PlayToggle, _Button); var _proto = PlayToggle.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-play-control " + _Button.prototype.buildCSSClass.call(this); - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { this.player_.paused() ? silencePromise(this.player_.play()) : this.player_.pause(); - }, _proto.handleSeeked = function(event) { + }, _proto.handleSeeked = function handleSeeked(event) { this.removeClass("vjs-ended"), this.player_.paused() ? this.handlePause(event) : this.handlePlay(event); - }, _proto.handlePlay = function(event) { + }, _proto.handlePlay = function handlePlay(event) { this.removeClass("vjs-ended"), this.removeClass("vjs-paused"), this.addClass("vjs-playing"), this.controlText("Pause"); - }, _proto.handlePause = function(event) { + }, _proto.handlePause = function handlePause(event) { this.removeClass("vjs-playing"), this.addClass("vjs-paused"), this.controlText("Play"); - }, _proto.handleEnded = function(event) { + }, _proto.handleEnded = function handleEnded(event) { var _this2 = this; this.removeClass("vjs-playing"), this.addClass("vjs-ended"), this.controlText("Replay"), this.one(this.player_, "seeked", function(e) { return _this2.handleSeeked(e); @@ -2455,7 +2455,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TimeDisplay, _Component); var _proto = TimeDisplay.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl$1() { var className = this.buildCSSClass(), el = _Component.prototype.createEl.call(this, "div", { className: className + " vjs-time-control vjs-control" }), span = createEl("span", { @@ -2470,9 +2470,9 @@ "aria-live": "off", role: "presentation" }), el.appendChild(this.contentEl_), el; - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.contentEl_ = null, this.textNode_ = null, _Component.prototype.dispose.call(this); - }, _proto.updateTextNode_ = function(time) { + }, _proto.updateTextNode_ = function updateTextNode_(time) { var _this2 = this; void 0 === time && (time = 0), time = formatTime(time), this.formattedTime_ !== time && (this.formattedTime_ = time, this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_", function() { if (_this2.contentEl_) { @@ -2480,7 +2480,7 @@ oldNode && _this2.contentEl_.firstChild !== oldNode && (oldNode = null, log$1.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")), _this2.textNode_ = global_document__WEBPACK_IMPORTED_MODULE_1___default().createTextNode(_this2.formattedTime_), _this2.textNode_ && (oldNode ? _this2.contentEl_.replaceChild(_this2.textNode_, oldNode) : _this2.contentEl_.appendChild(_this2.textNode_)); } })); - }, _proto.updateContent = function(event) {}, TimeDisplay; + }, _proto.updateContent = function updateContent(event) {}, TimeDisplay; }(Component$1); TimeDisplay.prototype.labelText_ = "Time", TimeDisplay.prototype.controlText_ = "Time", Component$1.registerComponent("TimeDisplay", TimeDisplay); var CurrentTimeDisplay = function(_TimeDisplay) { @@ -2489,9 +2489,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(CurrentTimeDisplay, _TimeDisplay); var _proto = CurrentTimeDisplay.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-current-time"; - }, _proto.updateContent = function(event) { + }, _proto.updateContent = function updateContent(event) { var time; time = this.player_.ended() ? this.player_.duration() : this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(), this.updateTextNode_(time); }, CurrentTimeDisplay; @@ -2507,9 +2507,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(DurationDisplay, _TimeDisplay); var _proto = DurationDisplay.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-duration"; - }, _proto.updateContent = function(event) { + }, _proto.updateContent = function updateContent(event) { var duration = this.player_.duration(); this.updateTextNode_(duration); }, DurationDisplay; @@ -2519,7 +2519,7 @@ function TimeDivider() { return _Component.apply(this, arguments) || this; } - return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TimeDivider, _Component), TimeDivider.prototype.createEl = function() { + return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TimeDivider, _Component), TimeDivider.prototype.createEl = function createEl() { var el = _Component.prototype.createEl.call(this, "div", { className: "vjs-time-control vjs-time-divider" }, { @@ -2540,14 +2540,14 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(RemainingTimeDisplay, _TimeDisplay); var _proto = RemainingTimeDisplay.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-remaining-time"; - }, _proto.createEl = function() { + }, _proto.createEl = function createEl$1() { var el = _TimeDisplay.prototype.createEl.call(this); return el.insertBefore(createEl("span", {}, { "aria-hidden": !0 }, "-"), this.contentEl_), el; - }, _proto.updateContent = function(event) { + }, _proto.updateContent = function updateContent(event) { var time; "number" == typeof this.player_.duration() && (time = this.player_.ended() ? 0 : this.player_.remainingTimeDisplay ? this.player_.remainingTimeDisplay() : this.player_.remainingTime(), this.updateTextNode_(time)); }, RemainingTimeDisplay; @@ -2562,7 +2562,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(LiveDisplay, _Component); var _proto = LiveDisplay.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl$1() { var el = _Component.prototype.createEl.call(this, "div", { className: "vjs-live-control vjs-control" }); @@ -2574,9 +2574,9 @@ className: "vjs-control-text", textContent: this.localize("Stream Type") + "\xA0" })), this.contentEl_.appendChild(global_document__WEBPACK_IMPORTED_MODULE_1___default().createTextNode(this.localize("LIVE"))), el.appendChild(this.contentEl_), el; - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.contentEl_ = null, _Component.prototype.dispose.call(this); - }, _proto.updateShowing = function(event) { + }, _proto.updateShowing = function updateShowing(event) { this.player().duration() === 1 / 0 ? this.show() : this.hide(); }, LiveDisplay; }(Component$1); @@ -2590,7 +2590,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(SeekToLive, _Button); var _proto = SeekToLive.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl$1() { var el = _Button.prototype.createEl.call(this, "button", { className: "vjs-seek-to-live-control vjs-control" }); @@ -2600,11 +2600,11 @@ }, { "aria-hidden": "true" }), el.appendChild(this.textEl_), el; - }, _proto.updateLiveEdgeStatus = function() { + }, _proto.updateLiveEdgeStatus = function updateLiveEdgeStatus() { !this.player_.liveTracker || this.player_.liveTracker.atLiveEdge() ? (this.setAttribute("aria-disabled", !0), this.addClass("vjs-at-live-edge"), this.controlText("Seek to live, currently playing live")) : (this.setAttribute("aria-disabled", !1), this.removeClass("vjs-at-live-edge"), this.controlText("Seek to live, currently behind live")); - }, _proto.handleClick = function() { + }, _proto.handleClick = function handleClick() { this.player_.liveTracker.seekToLiveEdge(); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.player_.liveTracker && this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatusHandler_), this.textEl_ = null, _Button.prototype.dispose.call(this); }, SeekToLive; }(Button); @@ -2630,16 +2630,16 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(Slider, _Component); var _proto = Slider.prototype; - return _proto.enabled = function() { + return _proto.enabled = function enabled() { return this.enabled_; - }, _proto.enable = function() { + }, _proto.enable = function enable() { this.enabled() || (this.on("mousedown", this.handleMouseDown_), this.on("touchstart", this.handleMouseDown_), this.on("keydown", this.handleKeyDown_), this.on("click", this.handleClick_), this.on(this.player_, "controlsvisible", this.update), this.playerEvent && this.on(this.player_, this.playerEvent, this.update), this.removeClass("disabled"), this.setAttribute("tabindex", 0), this.enabled_ = !0); - }, _proto.disable = function() { + }, _proto.disable = function disable() { if (this.enabled()) { var doc = this.bar.el_.ownerDocument; this.off("mousedown", this.handleMouseDown_), this.off("touchstart", this.handleMouseDown_), this.off("keydown", this.handleKeyDown_), this.off("click", this.handleClick_), this.off(this.player_, "controlsvisible", this.update_), this.off(doc, "mousemove", this.handleMouseMove_), this.off(doc, "mouseup", this.handleMouseUp_), this.off(doc, "touchmove", this.handleMouseMove_), this.off(doc, "touchend", this.handleMouseUp_), this.removeAttribute("tabindex"), this.addClass("disabled"), this.playerEvent && this.off(this.player_, this.playerEvent, this.update), this.enabled_ = !1; } - }, _proto.createEl = function(type, props, attributes) { + }, _proto.createEl = function createEl(type, props, attributes) { return void 0 === props && (props = {}), void 0 === attributes && (attributes = {}), props.className = props.className + " vjs-slider", props = assign({ tabIndex: 0 }, props), attributes = assign({ @@ -2649,13 +2649,13 @@ "aria-valuemax": 100, tabIndex: 0 }, attributes), _Component.prototype.createEl.call(this, type, props, attributes); - }, _proto.handleMouseDown = function(event) { + }, _proto.handleMouseDown = function handleMouseDown(event) { var doc = this.bar.el_.ownerDocument; "mousedown" === event.type && event.preventDefault(), "touchstart" !== event.type || IS_CHROME || event.preventDefault(), blockTextSelection(), this.addClass("vjs-sliding"), this.trigger("slideractive"), this.on(doc, "mousemove", this.handleMouseMove_), this.on(doc, "mouseup", this.handleMouseUp_), this.on(doc, "touchmove", this.handleMouseMove_), this.on(doc, "touchend", this.handleMouseUp_), this.handleMouseMove(event); - }, _proto.handleMouseMove = function(event) {}, _proto.handleMouseUp = function() { + }, _proto.handleMouseMove = function handleMouseMove(event) {}, _proto.handleMouseUp = function handleMouseUp() { var doc = this.bar.el_.ownerDocument; unblockTextSelection(), this.removeClass("vjs-sliding"), this.trigger("sliderinactive"), this.off(doc, "mousemove", this.handleMouseMove_), this.off(doc, "mouseup", this.handleMouseUp_), this.off(doc, "touchmove", this.handleMouseMove_), this.off(doc, "touchend", this.handleMouseUp_), this.update(); - }, _proto.update = function() { + }, _proto.update = function update() { var _this2 = this; if (this.el_ && this.bar) { var progress = this.getProgress(); @@ -2664,16 +2664,16 @@ _this2.bar.el().style[sizeKey] = (100 * progress).toFixed(2) + "%"; })), progress; } - }, _proto.getProgress = function() { + }, _proto.getProgress = function getProgress() { return Number(clamp(this.getPercent(), 0, 1).toFixed(4)); - }, _proto.calculateDistance = function(event) { + }, _proto.calculateDistance = function calculateDistance(event) { var position = getPointerPosition(this.el_, event); return this.vertical() ? position.y : position.x; - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Left") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Down") ? (event.preventDefault(), event.stopPropagation(), this.stepBack()) : keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Right") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Up") ? (event.preventDefault(), event.stopPropagation(), this.stepForward()) : _Component.prototype.handleKeyDown.call(this, event); - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { event.stopPropagation(), event.preventDefault(); - }, _proto.vertical = function(bool) { + }, _proto.vertical = function vertical(bool) { if (void 0 === bool) return this.vertical_ || !1; this.vertical_ = !!bool, this.vertical_ ? this.addClass("vjs-slider-vertical") : this.addClass("vjs-slider-horizontal"); }, Slider; @@ -2690,7 +2690,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(LoadProgressBar, _Component); var _proto = LoadProgressBar.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl$1() { var el = _Component.prototype.createEl.call(this, "div", { className: "vjs-load-progress" }), wrapper = createEl("span", { @@ -2702,9 +2702,9 @@ className: "vjs-control-text-loaded-percentage", textContent: "0%" }), el.appendChild(wrapper), wrapper.appendChild(loadedText), wrapper.appendChild(separator), wrapper.appendChild(this.percentageEl_), el; - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.partEls_ = null, this.percentageEl_ = null, _Component.prototype.dispose.call(this); - }, _proto.update = function(event) { + }, _proto.update = function update(event) { var _this2 = this; this.requestNamedAnimationFrame("LoadProgressBar#update", function() { var liveTracker = _this2.player_.liveTracker, buffered = _this2.player_.buffered(), duration = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : _this2.player_.duration(), bufferedEnd = _this2.player_.bufferedEnd(), children = _this2.partEls_, percent = percentify(bufferedEnd, duration); @@ -2726,21 +2726,21 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TimeTooltip, _Component); var _proto = TimeTooltip.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl() { return _Component.prototype.createEl.call(this, "div", { className: "vjs-time-tooltip" }, { "aria-hidden": "true" }); - }, _proto.update = function(seekBarRect, seekBarPoint, content) { + }, _proto.update = function update(seekBarRect, seekBarPoint, content) { var tooltipRect = findPosition(this.el_), playerRect = getBoundingClientRect(this.player_.el()), seekBarPointPx = seekBarRect.width * seekBarPoint; if (playerRect && tooltipRect) { var spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx, spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right), pullTooltipBy = tooltipRect.width / 2; spaceLeftOfPoint < pullTooltipBy ? pullTooltipBy += pullTooltipBy - spaceLeftOfPoint : spaceRightOfPoint < pullTooltipBy && (pullTooltipBy = spaceRightOfPoint), pullTooltipBy < 0 ? pullTooltipBy = 0 : pullTooltipBy > tooltipRect.width && (pullTooltipBy = tooltipRect.width), pullTooltipBy = Math.round(pullTooltipBy), this.el_.style.right = "-" + pullTooltipBy + "px", this.write(content); } - }, _proto.write = function(content) { + }, _proto.write = function write(content) { textContent(this.el_, content); - }, _proto.updateTime = function(seekBarRect, seekBarPoint, time, cb) { + }, _proto.updateTime = function updateTime(seekBarRect, seekBarPoint, time, cb) { var _this2 = this; this.requestNamedAnimationFrame("TimeTooltip#updateTime", function() { var content, duration = _this2.player_.duration(); @@ -2760,13 +2760,13 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(PlayProgressBar, _Component); var _proto = PlayProgressBar.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl() { return _Component.prototype.createEl.call(this, "div", { className: "vjs-play-progress vjs-slider-bar" }, { "aria-hidden": "true" }); - }, _proto.update = function(seekBarRect, seekBarPoint) { + }, _proto.update = function update(seekBarRect, seekBarPoint) { var timeTooltip = this.getChild("timeTooltip"); if (timeTooltip) { var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); @@ -2784,11 +2784,11 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(MouseTimeDisplay, _Component); var _proto = MouseTimeDisplay.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl() { return _Component.prototype.createEl.call(this, "div", { className: "vjs-mouse-display" }); - }, _proto.update = function(seekBarRect, seekBarPoint) { + }, _proto.update = function update(seekBarRect, seekBarPoint) { var _this2 = this, time = seekBarPoint * this.player_.duration(); this.getChild("timeTooltip").updateTime(seekBarRect, seekBarPoint, time, function() { _this2.el_.style.left = seekBarRect.width * seekBarPoint + "px"; @@ -2807,7 +2807,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(SeekBar, _Slider); var _proto = SeekBar.prototype; - return _proto.setEventHandlers_ = function() { + return _proto.setEventHandlers_ = function setEventHandlers_() { var _this2 = this; this.update_ = bind(this, this.update), this.update = throttle(this.update_, 30), this.on(this.player_, [ "ended", @@ -2824,19 +2824,19 @@ "pause", "waiting" ], this.disableIntervalHandler_), "hidden" in global_document__WEBPACK_IMPORTED_MODULE_1___default() && "visibilityState" in global_document__WEBPACK_IMPORTED_MODULE_1___default() && this.on(global_document__WEBPACK_IMPORTED_MODULE_1___default(), "visibilitychange", this.toggleVisibility_); - }, _proto.toggleVisibility_ = function(e) { + }, _proto.toggleVisibility_ = function toggleVisibility_(e) { "hidden" === global_document__WEBPACK_IMPORTED_MODULE_1___default().visibilityState ? (this.cancelNamedAnimationFrame("SeekBar#update"), this.cancelNamedAnimationFrame("Slider#update"), this.disableInterval_(e)) : (this.player_.ended() || this.player_.paused() || this.enableInterval_(), this.update()); - }, _proto.enableInterval_ = function() { + }, _proto.enableInterval_ = function enableInterval_() { this.updateInterval || (this.updateInterval = this.setInterval(this.update, 30)); - }, _proto.disableInterval_ = function(e) { + }, _proto.disableInterval_ = function disableInterval_(e) { this.player_.liveTracker && this.player_.liveTracker.isLive() && e && "ended" !== e.type || !this.updateInterval || (this.clearInterval(this.updateInterval), this.updateInterval = null); - }, _proto.createEl = function() { + }, _proto.createEl = function createEl() { return _Slider.prototype.createEl.call(this, "div", { className: "vjs-progress-holder" }, { "aria-label": this.localize("Progress Bar") }); - }, _proto.update = function(event) { + }, _proto.update = function update(event) { var _this3 = this; if ("hidden" !== global_document__WEBPACK_IMPORTED_MODULE_1___default().visibilityState) { var percent = _Slider.prototype.update.call(this); @@ -2848,16 +2848,16 @@ ], "{1} of {2}")), _this3.currentTime_ = currentTime, _this3.duration_ = duration), _this3.bar && _this3.bar.update(getBoundingClientRect(_this3.el()), _this3.getProgress()); }), percent; } - }, _proto.userSeek_ = function(ct) { + }, _proto.userSeek_ = function userSeek_(ct) { this.player_.liveTracker && this.player_.liveTracker.isLive() && this.player_.liveTracker.nextSeekedFromUser(), this.player_.currentTime(ct); - }, _proto.getCurrentTime_ = function() { + }, _proto.getCurrentTime_ = function getCurrentTime_() { return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); - }, _proto.getPercent = function() { + }, _proto.getPercent = function getPercent() { var percent, currentTime = this.getCurrentTime_(), liveTracker = this.player_.liveTracker; return liveTracker && liveTracker.isLive() ? (percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow(), liveTracker.atLiveEdge() && (percent = 1)) : percent = currentTime / this.player_.duration(), percent; - }, _proto.handleMouseDown = function(event) { + }, _proto.handleMouseDown = function handleMouseDown(event) { isSingleLeftClick(event) && (event.stopPropagation(), this.player_.scrubbing(!0), this.videoWasPlaying = !this.player_.paused(), this.player_.pause(), _Slider.prototype.handleMouseDown.call(this, event)); - }, _proto.handleMouseMove = function(event) { + }, _proto.handleMouseMove = function handleMouseMove(event) { if (isSingleLeftClick(event)) { var newTime, distance = this.calculateDistance(event), liveTracker = this.player_.liveTracker; if (liveTracker && liveTracker.isLive()) { @@ -2870,27 +2870,27 @@ } else (newTime = distance * this.player_.duration()) === this.player_.duration() && (newTime -= 0.1); this.userSeek_(newTime); } - }, _proto.enable = function() { + }, _proto.enable = function enable() { _Slider.prototype.enable.call(this); var mouseTimeDisplay = this.getChild("mouseTimeDisplay"); mouseTimeDisplay && mouseTimeDisplay.show(); - }, _proto.disable = function() { + }, _proto.disable = function disable() { _Slider.prototype.disable.call(this); var mouseTimeDisplay = this.getChild("mouseTimeDisplay"); mouseTimeDisplay && mouseTimeDisplay.hide(); - }, _proto.handleMouseUp = function(event) { + }, _proto.handleMouseUp = function handleMouseUp(event) { _Slider.prototype.handleMouseUp.call(this, event), event && event.stopPropagation(), this.player_.scrubbing(!1), this.player_.trigger({ type: "timeupdate", target: this, manuallyTriggered: !0 }), this.videoWasPlaying ? silencePromise(this.player_.play()) : this.update_(); - }, _proto.stepForward = function() { + }, _proto.stepForward = function stepForward() { this.userSeek_(this.player_.currentTime() + 5); - }, _proto.stepBack = function() { + }, _proto.stepBack = function stepBack() { this.userSeek_(this.player_.currentTime() - 5); - }, _proto.handleAction = function(event) { + }, _proto.handleAction = function handleAction(event) { this.player_.paused() ? this.player_.play() : this.player_.pause(); - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { var liveTracker = this.player_.liveTracker; if (keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Space") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Enter")) event.preventDefault(), event.stopPropagation(), this.handleAction(event); else if (keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Home")) event.preventDefault(), event.stopPropagation(), this.userSeek_(0); @@ -2900,7 +2900,7 @@ var gotoFraction = (keycode__WEBPACK_IMPORTED_MODULE_3___default().codes[keycode__WEBPACK_IMPORTED_MODULE_3___default()(event)] - keycode__WEBPACK_IMPORTED_MODULE_3___default().codes[0]) * 10.0 / 100.0; liveTracker && liveTracker.isLive() ? this.userSeek_(liveTracker.seekableStart() + liveTracker.liveWindow() * gotoFraction) : this.userSeek_(this.player_.duration() * gotoFraction); } else keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "PgDn") ? (event.preventDefault(), event.stopPropagation(), this.userSeek_(this.player_.currentTime() - 60)) : keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "PgUp") ? (event.preventDefault(), event.stopPropagation(), this.userSeek_(this.player_.currentTime() + 60)) : _Slider.prototype.handleKeyDown.call(this, event); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.disableInterval_(), this.off(this.player_, [ "ended", "durationchange", @@ -2932,11 +2932,11 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(ProgressControl, _Component); var _proto = ProgressControl.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl() { return _Component.prototype.createEl.call(this, "div", { className: "vjs-progress-control vjs-control" }); - }, _proto.handleMouseMove = function(event) { + }, _proto.handleMouseMove = function handleMouseMove(event) { var seekBar = this.getChild("seekBar"); if (seekBar) { var playProgressBar = seekBar.getChild("playProgressBar"), mouseTimeDisplay = seekBar.getChild("mouseTimeDisplay"); @@ -2945,12 +2945,12 @@ seekBarPoint = clamp(seekBarPoint, 0, 1), mouseTimeDisplay && mouseTimeDisplay.update(seekBarRect, seekBarPoint), playProgressBar && playProgressBar.update(seekBarRect, seekBar.getProgress()); } } - }, _proto.handleMouseSeek = function(event) { + }, _proto.handleMouseSeek = function handleMouseSeek(event) { var seekBar = this.getChild("seekBar"); seekBar && seekBar.handleMouseMove(event); - }, _proto.enabled = function() { + }, _proto.enabled = function enabled() { return this.enabled_; - }, _proto.disable = function() { + }, _proto.disable = function disable() { if (this.children().forEach(function(child) { return child.disable && child.disable(); }), this.enabled() && (this.off([ @@ -2960,20 +2960,20 @@ var seekBar = this.getChild("seekBar"); this.player_.scrubbing(!1), seekBar.videoWasPlaying && silencePromise(this.player_.play()); } - }, _proto.enable = function() { + }, _proto.enable = function enable() { this.children().forEach(function(child) { return child.enable && child.enable(); }), this.enabled() || (this.on([ "mousedown", "touchstart" ], this.handleMouseDownHandler_), this.on(this.el_, "mousemove", this.handleMouseMove), this.removeClass("disabled"), this.enabled_ = !0); - }, _proto.removeListenersAddedOnMousedownAndTouchstart = function() { + }, _proto.removeListenersAddedOnMousedownAndTouchstart = function removeListenersAddedOnMousedownAndTouchstart() { var doc = this.el_.ownerDocument; this.off(doc, "mousemove", this.throttledHandleMouseSeek), this.off(doc, "touchmove", this.throttledHandleMouseSeek), this.off(doc, "mouseup", this.handleMouseUpHandler_), this.off(doc, "touchend", this.handleMouseUpHandler_); - }, _proto.handleMouseDown = function(event) { + }, _proto.handleMouseDown = function handleMouseDown(event) { var doc = this.el_.ownerDocument, seekBar = this.getChild("seekBar"); seekBar && seekBar.handleMouseDown(event), this.on(doc, "mousemove", this.throttledHandleMouseSeek), this.on(doc, "touchmove", this.throttledHandleMouseSeek), this.on(doc, "mouseup", this.handleMouseUpHandler_), this.on(doc, "touchend", this.handleMouseUpHandler_); - }, _proto.handleMouseUp = function(event) { + }, _proto.handleMouseUp = function handleMouseUp(event) { var seekBar = this.getChild("seekBar"); seekBar && seekBar.handleMouseUp(event), this.removeListenersAddedOnMousedownAndTouchstart(); }, ProgressControl; @@ -3000,13 +3000,13 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(PictureInPictureToggle, _Button); var _proto = PictureInPictureToggle.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-picture-in-picture-control " + _Button.prototype.buildCSSClass.call(this); - }, _proto.handlePictureInPictureEnabledChange = function() { + }, _proto.handlePictureInPictureEnabledChange = function handlePictureInPictureEnabledChange() { global_document__WEBPACK_IMPORTED_MODULE_1___default().pictureInPictureEnabled && !1 === this.player_.disablePictureInPicture() ? this.enable() : this.disable(); - }, _proto.handlePictureInPictureChange = function(event) { + }, _proto.handlePictureInPictureChange = function handlePictureInPictureChange(event) { this.player_.isInPictureInPicture() ? this.controlText("Exit Picture-in-Picture") : this.controlText("Picture-in-Picture"), this.handlePictureInPictureEnabledChange(); - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { this.player_.isInPictureInPicture() ? this.player_.exitPictureInPicture() : this.player_.requestPictureInPicture(); }, PictureInPictureToggle; }(Button); @@ -3020,11 +3020,11 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(FullscreenToggle, _Button); var _proto = FullscreenToggle.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-fullscreen-control " + _Button.prototype.buildCSSClass.call(this); - }, _proto.handleFullscreenChange = function(event) { + }, _proto.handleFullscreenChange = function handleFullscreenChange(event) { this.player_.isFullscreen() ? this.controlText("Non-Fullscreen") : this.controlText("Fullscreen"); - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { this.player_.isFullscreen() ? this.player_.exitFullscreen() : this.player_.requestFullscreen(); }, FullscreenToggle; }(Button); @@ -3037,7 +3037,7 @@ function VolumeLevel() { return _Component.apply(this, arguments) || this; } - return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(VolumeLevel, _Component), VolumeLevel.prototype.createEl = function() { + return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(VolumeLevel, _Component), VolumeLevel.prototype.createEl = function createEl() { var el = _Component.prototype.createEl.call(this, "div", { className: "vjs-volume-level" }); @@ -3054,13 +3054,13 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(VolumeLevelTooltip, _Component); var _proto = VolumeLevelTooltip.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl() { return _Component.prototype.createEl.call(this, "div", { className: "vjs-volume-tooltip" }, { "aria-hidden": "true" }); - }, _proto.update = function(rangeBarRect, rangeBarPoint, vertical, content) { + }, _proto.update = function update(rangeBarRect, rangeBarPoint, vertical, content) { if (!vertical) { var tooltipRect = getBoundingClientRect(this.el_), playerRect = getBoundingClientRect(this.player_.el()), volumeBarPointPx = rangeBarRect.width * rangeBarPoint; if (!playerRect || !tooltipRect) return; @@ -3068,9 +3068,9 @@ spaceLeftOfPoint < pullTooltipBy ? pullTooltipBy += pullTooltipBy - spaceLeftOfPoint : spaceRightOfPoint < pullTooltipBy && (pullTooltipBy = spaceRightOfPoint), pullTooltipBy < 0 ? pullTooltipBy = 0 : pullTooltipBy > tooltipRect.width && (pullTooltipBy = tooltipRect.width), this.el_.style.right = "-" + pullTooltipBy + "px"; } this.write(content + "%"); - }, _proto.write = function(content) { + }, _proto.write = function write(content) { textContent(this.el_, content); - }, _proto.updateVolume = function(rangeBarRect, rangeBarPoint, vertical, volume, cb) { + }, _proto.updateVolume = function updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, cb) { var _this2 = this; this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume", function() { _this2.update(rangeBarRect, rangeBarPoint, vertical, volume.toFixed(0)), cb && cb(); @@ -3085,11 +3085,11 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(MouseVolumeLevelDisplay, _Component); var _proto = MouseVolumeLevelDisplay.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl() { return _Component.prototype.createEl.call(this, "div", { className: "vjs-mouse-display" }); - }, _proto.update = function(rangeBarRect, rangeBarPoint, vertical) { + }, _proto.update = function update(rangeBarRect, rangeBarPoint, vertical) { var _this2 = this, volume = 100 * rangeBarPoint; this.getChild("volumeLevelTooltip").updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, function() { vertical ? _this2.el_.style.bottom = rangeBarRect.height * rangeBarPoint + "px" : _this2.el_.style.left = rangeBarRect.width * rangeBarPoint + "px"; @@ -3114,36 +3114,36 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(VolumeBar, _Slider); var _proto = VolumeBar.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl() { return _Slider.prototype.createEl.call(this, "div", { className: "vjs-volume-bar vjs-slider-bar" }, { "aria-label": this.localize("Volume Level"), "aria-live": "polite" }); - }, _proto.handleMouseDown = function(event) { + }, _proto.handleMouseDown = function handleMouseDown(event) { isSingleLeftClick(event) && _Slider.prototype.handleMouseDown.call(this, event); - }, _proto.handleMouseMove = function(event) { + }, _proto.handleMouseMove = function handleMouseMove(event) { var mouseVolumeLevelDisplay = this.getChild("mouseVolumeLevelDisplay"); if (mouseVolumeLevelDisplay) { var volumeBarEl = this.el(), volumeBarRect = getBoundingClientRect(volumeBarEl), vertical = this.vertical(), volumeBarPoint = getPointerPosition(volumeBarEl, event); volumeBarPoint = clamp(volumeBarPoint = vertical ? volumeBarPoint.y : volumeBarPoint.x, 0, 1), mouseVolumeLevelDisplay.update(volumeBarRect, volumeBarPoint, vertical); } isSingleLeftClick(event) && (this.checkMuted(), this.player_.volume(this.calculateDistance(event))); - }, _proto.checkMuted = function() { + }, _proto.checkMuted = function checkMuted() { this.player_.muted() && this.player_.muted(!1); - }, _proto.getPercent = function() { + }, _proto.getPercent = function getPercent() { return this.player_.muted() ? 0 : this.player_.volume(); - }, _proto.stepForward = function() { + }, _proto.stepForward = function stepForward() { this.checkMuted(), this.player_.volume(this.player_.volume() + 0.1); - }, _proto.stepBack = function() { + }, _proto.stepBack = function stepBack() { this.checkMuted(), this.player_.volume(this.player_.volume() - 0.1); - }, _proto.updateARIAAttributes = function(event) { + }, _proto.updateARIAAttributes = function updateARIAAttributes(event) { var ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_(); this.el_.setAttribute("aria-valuenow", ariaValue), this.el_.setAttribute("aria-valuetext", ariaValue + "%"); - }, _proto.volumeAsPercentage_ = function() { + }, _proto.volumeAsPercentage_ = function volumeAsPercentage_() { return Math.round(100 * this.player_.volume()); - }, _proto.updateLastVolume_ = function() { + }, _proto.updateLastVolume_ = function updateLastVolume_() { var _this2 = this, volumeBeforeDrag = this.player_.volume(); this.one("sliderinactive", function() { 0 === _this2.player_.volume() && _this2.player_.lastVolume_(volumeBeforeDrag); @@ -3181,18 +3181,18 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(VolumeControl, _Component); var _proto = VolumeControl.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl() { var orientationClass = "vjs-volume-horizontal"; return this.options_.vertical && (orientationClass = "vjs-volume-vertical"), _Component.prototype.createEl.call(this, "div", { className: "vjs-volume-control vjs-control " + orientationClass }); - }, _proto.handleMouseDown = function(event) { + }, _proto.handleMouseDown = function handleMouseDown(event) { var doc = this.el_.ownerDocument; this.on(doc, "mousemove", this.throttledHandleMouseMove), this.on(doc, "touchmove", this.throttledHandleMouseMove), this.on(doc, "mouseup", this.handleMouseUpHandler_), this.on(doc, "touchend", this.handleMouseUpHandler_); - }, _proto.handleMouseUp = function(event) { + }, _proto.handleMouseUp = function handleMouseUp(event) { var doc = this.el_.ownerDocument; this.off(doc, "mousemove", this.throttledHandleMouseMove), this.off(doc, "touchmove", this.throttledHandleMouseMove), this.off(doc, "mouseup", this.handleMouseUpHandler_), this.off(doc, "touchend", this.handleMouseUpHandler_); - }, _proto.handleMouseMove = function(event) { + }, _proto.handleMouseMove = function handleMouseMove(event) { this.volumeBar.handleMouseMove(event); }, VolumeControl; }(Component$1); @@ -3217,22 +3217,22 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(MuteToggle, _Button); var _proto = MuteToggle.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-mute-control " + _Button.prototype.buildCSSClass.call(this); - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { var vol = this.player_.volume(), lastVolume = this.player_.lastVolume_(); if (0 === vol) { var volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume; this.player_.volume(volumeToSet), this.player_.muted(!1); } else this.player_.muted(!this.player_.muted()); - }, _proto.update = function(event) { + }, _proto.update = function update(event) { this.updateIcon_(), this.updateControlText_(); - }, _proto.updateIcon_ = function() { + }, _proto.updateIcon_ = function updateIcon_() { var vol = this.player_.volume(), level = 3; IS_IOS && this.player_.tech_ && this.player_.tech_.el_ && this.player_.muted(this.player_.tech_.el_.muted), 0 === vol || this.player_.muted() ? level = 0 : vol < 0.33 ? level = 1 : vol < 0.67 && (level = 2); for(var i = 0; i < 4; i++)removeClass(this.el_, "vjs-vol-" + i); addClass(this.el_, "vjs-vol-" + level); - }, _proto.updateControlText_ = function() { + }, _proto.updateControlText_ = function updateControlText_() { var text = this.player_.muted() || 0 === this.player_.volume() ? "Unmute" : "Mute"; this.controlText() !== text && this.controlText(text); }, MuteToggle; @@ -3265,26 +3265,26 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(VolumePanel, _Component); var _proto = VolumePanel.prototype; - return _proto.sliderActive_ = function() { + return _proto.sliderActive_ = function sliderActive_() { this.addClass("vjs-slider-active"); - }, _proto.sliderInactive_ = function() { + }, _proto.sliderInactive_ = function sliderInactive_() { this.removeClass("vjs-slider-active"); - }, _proto.volumePanelState_ = function() { + }, _proto.volumePanelState_ = function volumePanelState_() { this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden") && this.addClass("vjs-hidden"), this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden") && this.addClass("vjs-mute-toggle-only"); - }, _proto.createEl = function() { + }, _proto.createEl = function createEl() { var orientationClass = "vjs-volume-panel-horizontal"; return this.options_.inline || (orientationClass = "vjs-volume-panel-vertical"), _Component.prototype.createEl.call(this, "div", { className: "vjs-volume-panel vjs-control " + orientationClass }); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.handleMouseOut(), _Component.prototype.dispose.call(this); - }, _proto.handleVolumeControlKeyUp = function(event) { + }, _proto.handleVolumeControlKeyUp = function handleVolumeControlKeyUp(event) { keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Esc") && this.muteToggle.focus(); - }, _proto.handleMouseOver = function(event) { + }, _proto.handleMouseOver = function handleMouseOver(event) { this.addClass("vjs-hover"), on(global_document__WEBPACK_IMPORTED_MODULE_1___default(), "keyup", this.handleKeyPressHandler_); - }, _proto.handleMouseOut = function(event) { + }, _proto.handleMouseOut = function handleMouseOut(event) { this.removeClass("vjs-hover"), off(global_document__WEBPACK_IMPORTED_MODULE_1___default(), "keyup", this.handleKeyPressHandler_); - }, _proto.handleKeyPress = function(event) { + }, _proto.handleKeyPress = function handleKeyPress(event) { keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Esc") && this.handleMouseOut(); }, VolumePanel; }(Component$1); @@ -3307,22 +3307,22 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(Menu, _Component); var _proto = Menu.prototype; - return _proto.addEventListenerForItem = function(component) { + return _proto.addEventListenerForItem = function addEventListenerForItem(component) { component instanceof Component$1 && (this.on(component, "blur", this.boundHandleBlur_), this.on(component, [ "tap", "click" ], this.boundHandleTapClick_)); - }, _proto.removeEventListenerForItem = function(component) { + }, _proto.removeEventListenerForItem = function removeEventListenerForItem(component) { component instanceof Component$1 && (this.off(component, "blur", this.boundHandleBlur_), this.off(component, [ "tap", "click" ], this.boundHandleTapClick_)); - }, _proto.removeChild = function(component) { + }, _proto.removeChild = function removeChild(component) { "string" == typeof component && (component = this.getChild(component)), this.removeEventListenerForItem(component), _Component.prototype.removeChild.call(this, component); - }, _proto.addItem = function(component) { + }, _proto.addItem = function addItem(component) { var childComponent = this.addChild(component); childComponent && this.addEventListenerForItem(childComponent); - }, _proto.createEl = function() { + }, _proto.createEl = function createEl$1() { var contentElType = this.options_.contentElType || "ul"; this.contentEl_ = createEl(contentElType, { className: "vjs-menu-content" @@ -3334,9 +3334,9 @@ return el.appendChild(this.contentEl_), on(el, "click", function(event) { event.preventDefault(), event.stopImmediatePropagation(); }), el; - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.contentEl_ = null, this.boundHandleBlur_ = null, this.boundHandleTapClick_ = null, _Component.prototype.dispose.call(this); - }, _proto.handleBlur = function(event) { + }, _proto.handleBlur = function handleBlur(event) { var relatedTarget = event.relatedTarget || global_document__WEBPACK_IMPORTED_MODULE_1___default().activeElement; if (!this.children().some(function(element) { return element.el() === relatedTarget; @@ -3344,7 +3344,7 @@ var btn = this.menuButton_; btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild && btn.unpressButton(); } - }, _proto.handleTapClick = function(event) { + }, _proto.handleTapClick = function handleTapClick(event) { if (this.menuButton_) { this.menuButton_.unpressButton(); var childComponents = this.children(); @@ -3355,15 +3355,15 @@ foundComponent && "CaptionSettingsMenuItem" !== foundComponent.name() && this.menuButton_.focus(); } } - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Left") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Down") ? (event.preventDefault(), event.stopPropagation(), this.stepForward()) : (keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Right") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Up")) && (event.preventDefault(), event.stopPropagation(), this.stepBack()); - }, _proto.stepForward = function() { + }, _proto.stepForward = function stepForward() { var stepChild = 0; void 0 !== this.focusedChild_ && (stepChild = this.focusedChild_ + 1), this.focus(stepChild); - }, _proto.stepBack = function() { + }, _proto.stepBack = function stepBack() { var stepChild = 0; void 0 !== this.focusedChild_ && (stepChild = this.focusedChild_ - 1), this.focus(stepChild); - }, _proto.focus = function(item) { + }, _proto.focus = function focus(item) { void 0 === item && (item = 0); var children = this.children().slice(); children.length && children[0].hasClass("vjs-menu-title") && children.shift(), children.length > 0 && (item < 0 ? item = 0 : item >= children.length && (item = children.length - 1), this.focusedChild_ = item, children[item].el_.focus()); @@ -3392,10 +3392,10 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(MenuButton, _Component); var _proto = MenuButton.prototype; - return _proto.update = function() { + return _proto.update = function update() { var menu = this.createMenu(); this.menu && (this.menu.dispose(), this.removeChild(this.menu)), this.menu = menu, this.addChild(menu), this.buttonPressed_ = !1, this.menuButton_.el_.setAttribute("aria-expanded", "false"), this.items && this.items.length <= this.hideThreshold_ ? this.hide() : this.show(); - }, _proto.createMenu = function() { + }, _proto.createMenu = function createMenu() { var menu = new Menu(this.player_, { menuButton: this }); @@ -3411,43 +3411,43 @@ } if (this.items = this.createItems(), this.items) for(var i = 0; i < this.items.length; i++)menu.addItem(this.items[i]); return menu; - }, _proto.createItems = function() {}, _proto.createEl = function() { + }, _proto.createItems = function createItems() {}, _proto.createEl = function createEl() { return _Component.prototype.createEl.call(this, "div", { className: this.buildWrapperCSSClass() }, {}); - }, _proto.buildWrapperCSSClass = function() { + }, _proto.buildWrapperCSSClass = function buildWrapperCSSClass() { var menuButtonClass = "vjs-menu-button"; return !0 === this.options_.inline ? menuButtonClass += "-inline" : menuButtonClass += "-popup", "vjs-menu-button " + menuButtonClass + " " + Button.prototype.buildCSSClass() + " " + _Component.prototype.buildCSSClass.call(this); - }, _proto.buildCSSClass = function() { + }, _proto.buildCSSClass = function buildCSSClass() { var menuButtonClass = "vjs-menu-button"; return !0 === this.options_.inline ? menuButtonClass += "-inline" : menuButtonClass += "-popup", "vjs-menu-button " + menuButtonClass + " " + _Component.prototype.buildCSSClass.call(this); - }, _proto.controlText = function(text, el) { + }, _proto.controlText = function controlText(text, el) { return void 0 === el && (el = this.menuButton_.el()), this.menuButton_.controlText(text, el); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.handleMouseLeave(), _Component.prototype.dispose.call(this); - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { this.buttonPressed_ ? this.unpressButton() : this.pressButton(); - }, _proto.handleMouseLeave = function(event) { + }, _proto.handleMouseLeave = function handleMouseLeave(event) { this.removeClass("vjs-hover"), off(global_document__WEBPACK_IMPORTED_MODULE_1___default(), "keyup", this.handleMenuKeyUp_); - }, _proto.focus = function() { + }, _proto.focus = function focus() { this.menuButton_.focus(); - }, _proto.blur = function() { + }, _proto.blur = function blur() { this.menuButton_.blur(); - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Esc") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Tab") ? (this.buttonPressed_ && this.unpressButton(), keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Tab") || (event.preventDefault(), this.menuButton_.focus())) : (keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Up") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Down")) && !this.buttonPressed_ && (event.preventDefault(), this.pressButton()); - }, _proto.handleMenuKeyUp = function(event) { + }, _proto.handleMenuKeyUp = function handleMenuKeyUp(event) { (keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Esc") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Tab")) && this.removeClass("vjs-hover"); - }, _proto.handleSubmenuKeyPress = function(event) { + }, _proto.handleSubmenuKeyPress = function handleSubmenuKeyPress(event) { this.handleSubmenuKeyDown(event); - }, _proto.handleSubmenuKeyDown = function(event) { + }, _proto.handleSubmenuKeyDown = function handleSubmenuKeyDown(event) { (keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Esc") || keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Tab")) && (this.buttonPressed_ && this.unpressButton(), keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Tab") || (event.preventDefault(), this.menuButton_.focus())); - }, _proto.pressButton = function() { + }, _proto.pressButton = function pressButton() { this.enabled_ && (this.buttonPressed_ = !0, this.menu.show(), this.menu.lockShowing(), this.menuButton_.el_.setAttribute("aria-expanded", "true"), IS_IOS && isInFrame() || this.menu.focus()); - }, _proto.unpressButton = function() { + }, _proto.unpressButton = function unpressButton() { this.enabled_ && (this.buttonPressed_ = !1, this.menu.unlockShowing(), this.menu.hide(), this.menuButton_.el_.setAttribute("aria-expanded", "false")); - }, _proto.disable = function() { + }, _proto.disable = function disable() { this.unpressButton(), this.enabled_ = !1, this.addClass("vjs-disabled"), this.menuButton_.disable(); - }, _proto.enable = function() { + }, _proto.enable = function enable() { this.enabled_ = !0, this.removeClass("vjs-disabled"), this.menuButton_.enable(); }, MenuButton; }(Component$1); @@ -3478,7 +3478,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(MenuItem, _ClickableComponent); var _proto = MenuItem.prototype; - return _proto.createEl = function(type, props, attrs) { + return _proto.createEl = function createEl$1(type, props, attrs) { this.nonIconControl = !0; var el = _ClickableComponent.prototype.createEl.call(this, "li", assign({ className: "vjs-menu-item", @@ -3488,13 +3488,13 @@ className: "vjs-menu-item-text", textContent: this.localize(this.options_.label) }), el.querySelector(".vjs-icon-placeholder")), el; - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { MenuKeys.some(function(key) { return keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, key); }) || _ClickableComponent.prototype.handleKeyDown.call(this, event); - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { this.selected(!0); - }, _proto.selected = function(_selected) { + }, _proto.selected = function selected(_selected) { this.selectable && (_selected ? (this.addClass("vjs-selected"), this.el_.setAttribute("aria-checked", "true"), this.controlText(", selected"), this.isSelected_ = !0) : (this.removeClass("vjs-selected"), this.el_.setAttribute("aria-checked", "false"), this.controlText(""), this.isSelected_ = !1)); }, MenuItem; }(ClickableComponent); @@ -3532,16 +3532,16 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TextTrackMenuItem, _MenuItem); var _proto = TextTrackMenuItem.prototype; - return _proto.handleClick = function(event) { + return _proto.handleClick = function handleClick(event) { var referenceTrack = this.track, tracks = this.player_.textTracks(); if (_MenuItem.prototype.handleClick.call(this, event), tracks) for(var i = 0; i < tracks.length; i++){ var track = tracks[i]; -1 !== this.kinds.indexOf(track.kind) && (track === referenceTrack ? "showing" !== track.mode && (track.mode = "showing") : "disabled" !== track.mode && (track.mode = "disabled")); } - }, _proto.handleTracksChange = function(event) { + }, _proto.handleTracksChange = function handleTracksChange(event) { var shouldBeSelected = "showing" === this.track.mode; shouldBeSelected !== this.isSelected_ && this.selected(shouldBeSelected); - }, _proto.handleSelectedLanguageChange = function(event) { + }, _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event) { if ("showing" === this.track.mode) { var selectedLanguage = this.player_.cache_.selectedLanguage; selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind || (this.player_.cache_.selectedLanguage = { @@ -3550,7 +3550,7 @@ kind: this.track.kind }); } - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.track = null, _MenuItem.prototype.dispose.call(this); }, TextTrackMenuItem; }(MenuItem); @@ -3569,7 +3569,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(OffTextTrackMenuItem, _TextTrackMenuItem); var _proto = OffTextTrackMenuItem.prototype; - return _proto.handleTracksChange = function(event) { + return _proto.handleTracksChange = function handleTracksChange(event) { for(var tracks = this.player().textTracks(), shouldBeSelected = !0, i = 0, l = tracks.length; i < l; i++){ var track = tracks[i]; if (this.options_.kinds.indexOf(track.kind) > -1 && "showing" === track.mode) { @@ -3578,7 +3578,7 @@ } } shouldBeSelected !== this.isSelected_ && this.selected(shouldBeSelected); - }, _proto.handleSelectedLanguageChange = function(event) { + }, _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event) { for(var tracks = this.player().textTracks(), allHidden = !0, i = 0, l = tracks.length; i < l; i++){ var track = tracks[i]; if ([ @@ -3600,7 +3600,7 @@ function TextTrackButton(player, options) { return void 0 === options && (options = {}), options.tracks = player.textTracks(), _TrackButton.call(this, player, options) || this; } - return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TextTrackButton, _TrackButton), TextTrackButton.prototype.createItems = function(items, TrackMenuItem) { + return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TextTrackButton, _TrackButton), TextTrackButton.prototype.createItems = function createItems(items, TrackMenuItem) { void 0 === items && (items = []), void 0 === TrackMenuItem && (TrackMenuItem = TextTrackMenuItem), this.label_ && (label = this.label_ + " off"), items.push(new OffTextTrackMenuItem(this.player_, { kinds: this.kinds_, kind: this.kind_, @@ -3634,9 +3634,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(ChaptersTrackMenuItem, _MenuItem); var _proto = ChaptersTrackMenuItem.prototype; - return _proto.handleClick = function(event) { + return _proto.handleClick = function handleClick(event) { _MenuItem.prototype.handleClick.call(this), this.player_.currentTime(this.cue.startTime), this.update(this.cue.startTime); - }, _proto.update = function(event) { + }, _proto.update = function update(event) { var cue = this.cue, currentTime = this.player_.currentTime(); this.selected(cue.startTime <= currentTime && currentTime < cue.endTime); }, ChaptersTrackMenuItem; @@ -3648,13 +3648,13 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(ChaptersButton, _TextTrackButton); var _proto = ChaptersButton.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-chapters-button " + _TextTrackButton.prototype.buildCSSClass.call(this); - }, _proto.buildWrapperCSSClass = function() { + }, _proto.buildWrapperCSSClass = function buildWrapperCSSClass() { return "vjs-chapters-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this); - }, _proto.update = function(event) { + }, _proto.update = function update(event) { (!this.track_ || event && ("addtrack" === event.type || "removetrack" === event.type)) && this.setTrack(this.findChaptersTrack()), _TextTrackButton.prototype.update.call(this); - }, _proto.setTrack = function(track) { + }, _proto.setTrack = function setTrack(track) { if (this.track_ !== track) { if (this.updateHandler_ || (this.updateHandler_ = this.update.bind(this)), this.track_) { var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_); @@ -3666,16 +3666,16 @@ _remoteTextTrackEl && _remoteTextTrackEl.addEventListener("load", this.updateHandler_); } } - }, _proto.findChaptersTrack = function() { + }, _proto.findChaptersTrack = function findChaptersTrack() { for(var tracks = this.player_.textTracks() || [], i = tracks.length - 1; i >= 0; i--){ var track = tracks[i]; if (track.kind === this.kind_) return track; } - }, _proto.getMenuCaption = function() { + }, _proto.getMenuCaption = function getMenuCaption() { return this.track_ && this.track_.label ? this.track_.label : this.localize(toTitleCase$1(this.kind_)); - }, _proto.createMenu = function() { + }, _proto.createMenu = function createMenu() { return this.options_.title = this.getMenuCaption(), _TextTrackButton.prototype.createMenu.call(this); - }, _proto.createItems = function() { + }, _proto.createItems = function createItems() { var items = []; if (!this.track_) return items; var cues = this.track_.cues; @@ -3701,7 +3701,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(DescriptionsButton, _TextTrackButton); var _proto = DescriptionsButton.prototype; - return _proto.handleTracksChange = function(event) { + return _proto.handleTracksChange = function handleTracksChange(event) { for(var tracks = this.player().textTracks(), disabled = !1, i = 0, l = tracks.length; i < l; i++){ var track = tracks[i]; if (track.kind !== this.kind_ && "showing" === track.mode) { @@ -3710,9 +3710,9 @@ } } disabled ? this.disable() : this.enable(); - }, _proto.buildCSSClass = function() { + }, _proto.buildCSSClass = function buildCSSClass() { return "vjs-descriptions-button " + _TextTrackButton.prototype.buildCSSClass.call(this); - }, _proto.buildWrapperCSSClass = function() { + }, _proto.buildWrapperCSSClass = function buildWrapperCSSClass() { return "vjs-descriptions-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this); }, DescriptionsButton; }(TextTrackButton); @@ -3723,9 +3723,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(SubtitlesButton, _TextTrackButton); var _proto = SubtitlesButton.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-subtitles-button " + _TextTrackButton.prototype.buildCSSClass.call(this); - }, _proto.buildWrapperCSSClass = function() { + }, _proto.buildWrapperCSSClass = function buildWrapperCSSClass() { return "vjs-subtitles-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this); }, SubtitlesButton; }(TextTrackButton); @@ -3742,7 +3742,7 @@ mode: "disabled" }, options.selectable = !1, options.name = "CaptionSettingsMenuItem", (_this = _TextTrackMenuItem.call(this, player, options) || this).addClass("vjs-texttrack-settings"), _this.controlText(", opens " + options.kind + " settings dialog"), _this; } - return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(CaptionSettingsMenuItem, _TextTrackMenuItem), CaptionSettingsMenuItem.prototype.handleClick = function(event) { + return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(CaptionSettingsMenuItem, _TextTrackMenuItem), CaptionSettingsMenuItem.prototype.handleClick = function handleClick(event) { this.player().getChild("textTrackSettings").open(); }, CaptionSettingsMenuItem; }(TextTrackMenuItem); @@ -3753,11 +3753,11 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(CaptionsButton, _TextTrackButton); var _proto = CaptionsButton.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-captions-button " + _TextTrackButton.prototype.buildCSSClass.call(this); - }, _proto.buildWrapperCSSClass = function() { + }, _proto.buildWrapperCSSClass = function buildWrapperCSSClass() { return "vjs-captions-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this); - }, _proto.createItems = function() { + }, _proto.createItems = function createItems() { var items = []; return !(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings") && (items.push(new CaptionSettingsMenuItem(this.player_, { kind: this.kind_ @@ -3769,7 +3769,7 @@ function SubsCapsMenuItem() { return _TextTrackMenuItem.apply(this, arguments) || this; } - return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(SubsCapsMenuItem, _TextTrackMenuItem), SubsCapsMenuItem.prototype.createEl = function(type, props, attrs) { + return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(SubsCapsMenuItem, _TextTrackMenuItem), SubsCapsMenuItem.prototype.createEl = function createEl$1(type, props, attrs) { var el = _TextTrackMenuItem.prototype.createEl.call(this, type, props, attrs), parentSpan = el.querySelector(".vjs-menu-item-text"); return "captions" === this.options_.track.kind && (parentSpan.appendChild(createEl("span", { className: "vjs-icon-placeholder" @@ -3794,11 +3794,11 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(SubsCapsButton, _TextTrackButton); var _proto = SubsCapsButton.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-subs-caps-button " + _TextTrackButton.prototype.buildCSSClass.call(this); - }, _proto.buildWrapperCSSClass = function() { + }, _proto.buildWrapperCSSClass = function buildWrapperCSSClass() { return "vjs-subs-caps-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this); - }, _proto.createItems = function() { + }, _proto.createItems = function createItems() { var items = []; return !(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings") && (items.push(new CaptionSettingsMenuItem(this.player_, { kind: this.label_ @@ -3823,7 +3823,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(AudioTrackMenuItem, _MenuItem); var _proto = AudioTrackMenuItem.prototype; - return _proto.createEl = function(type, props, attrs) { + return _proto.createEl = function createEl(type, props, attrs) { var el = _MenuItem.prototype.createEl.call(this, type, props, attrs), parentSpan = el.querySelector(".vjs-menu-item-text"); return "main-desc" === this.options_.track.kind && (parentSpan.appendChild(_MenuItem.prototype.createEl.call(this, "span", { className: "vjs-icon-placeholder" @@ -3833,9 +3833,9 @@ className: "vjs-control-text", textContent: this.localize("Descriptions") }))), el; - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { _MenuItem.prototype.handleClick.call(this, event), this.track.enabled = !0; - }, _proto.handleTracksChange = function(event) { + }, _proto.handleTracksChange = function handleTracksChange(event) { this.selected(this.track.enabled); }, AudioTrackMenuItem; }(MenuItem); @@ -3846,11 +3846,11 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(AudioTrackButton, _TrackButton); var _proto = AudioTrackButton.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-audio-button " + _TrackButton.prototype.buildCSSClass.call(this); - }, _proto.buildWrapperCSSClass = function() { + }, _proto.buildWrapperCSSClass = function buildWrapperCSSClass() { return "vjs-audio-button " + _TrackButton.prototype.buildWrapperCSSClass.call(this); - }, _proto.createItems = function(items) { + }, _proto.createItems = function createItems(items) { void 0 === items && (items = []), this.hideThreshold_ = 1; for(var tracks = this.player_.audioTracks(), i = 0; i < tracks.length; i++){ var track = tracks[i]; @@ -3873,9 +3873,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(PlaybackRateMenuItem, _MenuItem); var _proto = PlaybackRateMenuItem.prototype; - return _proto.handleClick = function(event) { + return _proto.handleClick = function handleClick(event) { _MenuItem.prototype.handleClick.call(this), this.player().playbackRate(this.rate); - }, _proto.update = function(event) { + }, _proto.update = function update(event) { this.selected(this.player().playbackRate() === this.rate); }, PlaybackRateMenuItem; }(MenuItem); @@ -3893,42 +3893,42 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(PlaybackRateMenuButton, _MenuButton); var _proto = PlaybackRateMenuButton.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl$1() { var el = _MenuButton.prototype.createEl.call(this); return this.labelElId_ = "vjs-playback-rate-value-label-" + this.id_, this.labelEl_ = createEl("div", { className: "vjs-playback-rate-value", id: this.labelElId_, textContent: "1x" }), el.appendChild(this.labelEl_), el; - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.labelEl_ = null, _MenuButton.prototype.dispose.call(this); - }, _proto.buildCSSClass = function() { + }, _proto.buildCSSClass = function buildCSSClass() { return "vjs-playback-rate " + _MenuButton.prototype.buildCSSClass.call(this); - }, _proto.buildWrapperCSSClass = function() { + }, _proto.buildWrapperCSSClass = function buildWrapperCSSClass() { return "vjs-playback-rate " + _MenuButton.prototype.buildWrapperCSSClass.call(this); - }, _proto.createItems = function() { + }, _proto.createItems = function createItems() { for(var rates = this.playbackRates(), items = [], i = rates.length - 1; i >= 0; i--)items.push(new PlaybackRateMenuItem(this.player(), { rate: rates[i] + "x" })); return items; - }, _proto.updateARIAAttributes = function() { + }, _proto.updateARIAAttributes = function updateARIAAttributes() { this.el().setAttribute("aria-valuenow", this.player().playbackRate()); - }, _proto.handleClick = function(event) { + }, _proto.handleClick = function handleClick(event) { for(var currentRate = this.player().playbackRate(), rates = this.playbackRates(), newRate = rates[0], i = 0; i < rates.length; i++)if (rates[i] > currentRate) { newRate = rates[i]; break; } this.player().playbackRate(newRate); - }, _proto.handlePlaybackRateschange = function(event) { + }, _proto.handlePlaybackRateschange = function handlePlaybackRateschange(event) { this.update(); - }, _proto.playbackRates = function() { + }, _proto.playbackRates = function playbackRates() { var player = this.player(); return player.playbackRates && player.playbackRates() || []; - }, _proto.playbackRateSupported = function() { + }, _proto.playbackRateSupported = function playbackRateSupported() { return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0; - }, _proto.updateVisibility = function(event) { + }, _proto.updateVisibility = function updateVisibility(event) { this.playbackRateSupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden"); - }, _proto.updateLabel = function(event) { + }, _proto.updateLabel = function updateLabel(event) { this.playbackRateSupported() && (this.labelEl_.textContent = this.player().playbackRate() + "x"); }, PlaybackRateMenuButton; }(MenuButton); @@ -3939,9 +3939,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(Spacer, _Component); var _proto = Spacer.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-spacer " + _Component.prototype.buildCSSClass.call(this); - }, _proto.createEl = function(tag, props, attributes) { + }, _proto.createEl = function createEl(tag, props, attributes) { return void 0 === tag && (tag = "div"), void 0 === props && (props = {}), void 0 === attributes && (attributes = {}), props.className || (props.className = this.buildCSSClass()), _Component.prototype.createEl.call(this, tag, props, attributes); }, Spacer; }(Component$1); @@ -3952,9 +3952,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(CustomControlSpacer, _Spacer); var _proto = CustomControlSpacer.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-custom-control-spacer " + _Spacer.prototype.buildCSSClass.call(this); - }, _proto.createEl = function() { + }, _proto.createEl = function createEl() { return _Spacer.prototype.createEl.call(this, "div", { className: this.buildCSSClass(), textContent: "\xA0" @@ -3966,7 +3966,7 @@ function ControlBar() { return _Component.apply(this, arguments) || this; } - return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(ControlBar, _Component), ControlBar.prototype.createEl = function() { + return (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(ControlBar, _Component), ControlBar.prototype.createEl = function createEl() { return _Component.prototype.createEl.call(this, "div", { className: "vjs-control-bar", dir: "ltr" @@ -4002,9 +4002,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(ErrorDisplay, _ModalDialog); var _proto = ErrorDisplay.prototype; - return _proto.buildCSSClass = function() { + return _proto.buildCSSClass = function buildCSSClass() { return "vjs-error-display " + _ModalDialog.prototype.buildCSSClass.call(this); - }, _proto.content = function() { + }, _proto.content = function content() { var error = this.player().error(); return error ? this.localize(error.message) : ""; }, ErrorDisplay; @@ -4194,7 +4194,7 @@ ] ], default: 2, - parser: function(v) { + parser: function parser(v) { return "1.00" === v ? null : Number(v); } }, @@ -4243,9 +4243,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TextTrackSettings, _ModalDialog); var _proto = TextTrackSettings.prototype; - return _proto.dispose = function() { + return _proto.dispose = function dispose() { this.endDialog = null, _ModalDialog.prototype.dispose.call(this); - }, _proto.createElSelect_ = function(key, legendId, type) { + }, _proto.createElSelect_ = function createElSelect_(key, legendId, type) { var _this2 = this; void 0 === legendId && (legendId = ""), void 0 === type && (type = "label"); var config = selectConfigs[key], id = config.id.replace("%s", this.id_), selectLabelledbyIds = [ @@ -4266,7 +4266,7 @@ "" ].join(""); })).concat("").join(""); - }, _proto.createElFgColor_ = function() { + }, _proto.createElFgColor_ = function createElFgColor_() { var legendId = "captions-text-legend-" + this.id_; return [ '
" ].join(""); - }, _proto.createElBgColor_ = function() { + }, _proto.createElBgColor_ = function createElBgColor_() { var legendId = "captions-background-" + this.id_; return [ '" ].join(""); - }, _proto.createElWinColor_ = function() { + }, _proto.createElWinColor_ = function createElWinColor_() { var legendId = "captions-window-" + this.id_; return [ '" ].join(""); - }, _proto.createElColors_ = function() { + }, _proto.createElColors_ = function createElColors_() { return createEl("div", { className: "vjs-track-settings-colors", innerHTML: [ @@ -4314,7 +4314,7 @@ this.createElWinColor_() ].join("") }); - }, _proto.createElFont_ = function() { + }, _proto.createElFont_ = function createElFont_() { return createEl("div", { className: "vjs-track-settings-font", innerHTML: [ @@ -4329,7 +4329,7 @@ "" ].join("") }); - }, _proto.createElControls_ = function() { + }, _proto.createElControls_ = function createElControls_() { var defaultsDescription = this.localize("restore all settings to the default values"); return createEl("div", { className: "vjs-track-settings-controls", @@ -4341,19 +4341,19 @@ '" ].join("") }); - }, _proto.content = function() { + }, _proto.content = function content() { return [ this.createElColors_(), this.createElFont_(), this.createElControls_() ]; - }, _proto.label = function() { + }, _proto.label = function label() { return this.localize("Caption Settings Dialog"); - }, _proto.description = function() { + }, _proto.description = function description() { return this.localize("Beginning of dialog window. Escape will cancel and close the window."); - }, _proto.buildCSSClass = function() { + }, _proto.buildCSSClass = function buildCSSClass() { return _ModalDialog.prototype.buildCSSClass.call(this) + " vjs-text-track-settings"; - }, _proto.getValues = function() { + }, _proto.getValues = function getValues() { var fn, _this3 = this; return fn = function(accum, config, key) { var el, parser, value = (el = _this3.$(config.selector), parser = config.parser, parseOptionValue(el.options[el.options.selectedIndex].value, parser)); @@ -4361,7 +4361,7 @@ }, keys(selectConfigs).reduce(function(accum, key) { return fn(accum, selectConfigs[key], key); }, {}); - }, _proto.setValues = function(values) { + }, _proto.setValues = function setValues(values) { var _this4 = this; each(selectConfigs, function(config, key) { !function(el, value, parser) { @@ -4373,13 +4373,13 @@ } }(_this4.$(config.selector), values[key], config.parser); }); - }, _proto.setDefaults = function() { + }, _proto.setDefaults = function setDefaults() { var _this5 = this; each(selectConfigs, function(config) { var index = config.hasOwnProperty("default") ? config.default : 0; _this5.$(config.selector).selectedIndex = index; }); - }, _proto.restoreSettings = function() { + }, _proto.restoreSettings = function restoreSettings() { var values; try { values = JSON.parse(global_window__WEBPACK_IMPORTED_MODULE_0___default().localStorage.getItem(LOCAL_STORAGE_KEY$1)); @@ -4387,7 +4387,7 @@ log$1.warn(err); } values && this.setValues(values); - }, _proto.saveSettings = function() { + }, _proto.saveSettings = function saveSettings() { if (this.options_.persistTextTrackSettings) { var values = this.getValues(); try { @@ -4396,10 +4396,10 @@ log$1.warn(err); } } - }, _proto.updateDisplay = function() { + }, _proto.updateDisplay = function updateDisplay() { var ttDisplay = this.player_.getChild("textTrackDisplay"); ttDisplay && ttDisplay.updateDisplay(); - }, _proto.conditionalBlur_ = function() { + }, _proto.conditionalBlur_ = function conditionalBlur_() { this.previouslyActiveEl_ = null; var cb = this.player_.controlBar, subsCapsBtn = cb && cb.subsCapsButton, ccBtn = cb && cb.captionsButton; subsCapsBtn ? subsCapsBtn.focus() : ccBtn && ccBtn.focus(); @@ -4427,16 +4427,16 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(ResizeManager, _Component); var _proto = ResizeManager.prototype; - return _proto.createEl = function() { + return _proto.createEl = function createEl() { return _Component.prototype.createEl.call(this, "iframe", { className: "vjs-resize-manager", tabIndex: -1 }, { "aria-hidden": "true" }); - }, _proto.resizeHandler = function() { + }, _proto.resizeHandler = function resizeHandler() { this.player_ && this.player_.trigger && this.player_.trigger("playerresize"); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.debouncedHandler_ && this.debouncedHandler_.cancel(), this.resizeObserver_ && (this.player_.el() && this.resizeObserver_.unobserve(this.player_.el()), this.resizeObserver_.disconnect()), this.loadListener_ && this.off("load", this.loadListener_), this.el_ && this.el_.contentWindow && this.unloadListener_ && this.unloadListener_.call(this.el_.contentWindow), this.ResizeObserver = null, this.resizeObserver = null, this.debouncedHandler_ = null, this.loadListener_ = null, _Component.prototype.dispose.call(this); }, ResizeManager; }(Component$1); @@ -4469,9 +4469,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(LiveTracker, _Component); var _proto = LiveTracker.prototype; - return _proto.handleVisibilityChange = function() { + return _proto.handleVisibilityChange = function handleVisibilityChange() { this.player_.duration() === 1 / 0 && (global_document__WEBPACK_IMPORTED_MODULE_1___default().hidden ? this.stopTracking() : this.startTracking()); - }, _proto.trackLive_ = function() { + }, _proto.trackLive_ = function trackLive_() { var seekable = this.player_.seekable(); if (seekable && seekable.length) { var newTime = Number(global_window__WEBPACK_IMPORTED_MODULE_0___default().performance.now().toFixed(4)), deltaTime = -1 === this.lastTime_ ? 0 : (newTime - this.lastTime_) / 1000; @@ -4479,56 +4479,56 @@ var liveCurrentTime = this.liveCurrentTime(), currentTime = this.player_.currentTime(), isBehind = this.player_.paused() || this.seekedBehindLive_ || Math.abs(liveCurrentTime - currentTime) > this.options_.liveTolerance; this.timeupdateSeen_ && liveCurrentTime !== 1 / 0 || (isBehind = !1), isBehind !== this.behindLiveEdge_ && (this.behindLiveEdge_ = isBehind, this.trigger("liveedgechange")); } - }, _proto.handleDurationchange = function() { + }, _proto.handleDurationchange = function handleDurationchange() { this.toggleTracking(); - }, _proto.toggleTracking = function() { + }, _proto.toggleTracking = function toggleTracking() { this.player_.duration() === 1 / 0 && this.liveWindow() >= this.options_.trackingThreshold ? (this.player_.options_.liveui && this.player_.addClass("vjs-liveui"), this.startTracking()) : (this.player_.removeClass("vjs-liveui"), this.stopTracking()); - }, _proto.startTracking = function() { + }, _proto.startTracking = function startTracking() { this.isTracking() || (this.timeupdateSeen_ || (this.timeupdateSeen_ = this.player_.hasStarted()), this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, 30), this.trackLive_(), this.on(this.player_, [ "play", "pause" ], this.trackLiveHandler_), this.timeupdateSeen_ ? this.on(this.player_, "seeked", this.handleSeeked_) : (this.one(this.player_, "play", this.handlePlay_), this.one(this.player_, "timeupdate", this.handleFirstTimeupdate_))); - }, _proto.handleFirstTimeupdate = function() { + }, _proto.handleFirstTimeupdate = function handleFirstTimeupdate() { this.timeupdateSeen_ = !0, this.on(this.player_, "seeked", this.handleSeeked_); - }, _proto.handleSeeked = function() { + }, _proto.handleSeeked = function handleSeeked() { var timeDiff = Math.abs(this.liveCurrentTime() - this.player_.currentTime()); this.seekedBehindLive_ = this.nextSeekedFromUser_ && timeDiff > 2, this.nextSeekedFromUser_ = !1, this.trackLive_(); - }, _proto.handlePlay = function() { + }, _proto.handlePlay = function handlePlay() { this.one(this.player_, "timeupdate", this.seekToLiveEdge_); - }, _proto.reset_ = function() { + }, _proto.reset_ = function reset_() { this.lastTime_ = -1, this.pastSeekEnd_ = 0, this.lastSeekEnd_ = -1, this.behindLiveEdge_ = !0, this.timeupdateSeen_ = !1, this.seekedBehindLive_ = !1, this.nextSeekedFromUser_ = !1, this.clearInterval(this.trackingInterval_), this.trackingInterval_ = null, this.off(this.player_, [ "play", "pause" ], this.trackLiveHandler_), this.off(this.player_, "seeked", this.handleSeeked_), this.off(this.player_, "play", this.handlePlay_), this.off(this.player_, "timeupdate", this.handleFirstTimeupdate_), this.off(this.player_, "timeupdate", this.seekToLiveEdge_); - }, _proto.nextSeekedFromUser = function() { + }, _proto.nextSeekedFromUser = function nextSeekedFromUser() { this.nextSeekedFromUser_ = !0; - }, _proto.stopTracking = function() { + }, _proto.stopTracking = function stopTracking() { this.isTracking() && (this.reset_(), this.trigger("liveedgechange")); - }, _proto.seekableEnd = function() { + }, _proto.seekableEnd = function seekableEnd() { for(var seekable = this.player_.seekable(), seekableEnds = [], i = seekable ? seekable.length : 0; i--;)seekableEnds.push(seekable.end(i)); return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : 1 / 0; - }, _proto.seekableStart = function() { + }, _proto.seekableStart = function seekableStart() { for(var seekable = this.player_.seekable(), seekableStarts = [], i = seekable ? seekable.length : 0; i--;)seekableStarts.push(seekable.start(i)); return seekableStarts.length ? seekableStarts.sort()[0] : 0; - }, _proto.liveWindow = function() { + }, _proto.liveWindow = function liveWindow() { var liveCurrentTime = this.liveCurrentTime(); return liveCurrentTime === 1 / 0 ? 0 : liveCurrentTime - this.seekableStart(); - }, _proto.isLive = function() { + }, _proto.isLive = function isLive() { return this.isTracking(); - }, _proto.atLiveEdge = function() { + }, _proto.atLiveEdge = function atLiveEdge() { return !this.behindLiveEdge(); - }, _proto.liveCurrentTime = function() { + }, _proto.liveCurrentTime = function liveCurrentTime() { return this.pastSeekEnd() + this.seekableEnd(); - }, _proto.pastSeekEnd = function() { + }, _proto.pastSeekEnd = function pastSeekEnd() { var seekableEnd = this.seekableEnd(); return -1 !== this.lastSeekEnd_ && seekableEnd !== this.lastSeekEnd_ && (this.pastSeekEnd_ = 0), this.lastSeekEnd_ = seekableEnd, this.pastSeekEnd_; - }, _proto.behindLiveEdge = function() { + }, _proto.behindLiveEdge = function behindLiveEdge() { return this.behindLiveEdge_; - }, _proto.isTracking = function() { + }, _proto.isTracking = function isTracking() { return "number" == typeof this.trackingInterval_; - }, _proto.seekToLiveEdge = function() { + }, _proto.seekToLiveEdge = function seekToLiveEdge() { this.seekedBehindLive_ = !1, this.atLiveEdge() || (this.nextSeekedFromUser_ = !1, this.player_.currentTime(this.liveCurrentTime())); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.off(global_document__WEBPACK_IMPORTED_MODULE_1___default(), "visibilitychange", this.handleVisibilityChange_), this.stopTracking(), _Component.prototype.dispose.call(this); }, LiveTracker; }(Component$1); @@ -4544,10 +4544,10 @@ } return !!srcUrls.length && (1 === srcUrls.length && (src = srcUrls[0]), tech.triggerSourceset(src), !0); }, innerHTMLDescriptorPolyfill = Object.defineProperty({}, "innerHTML", { - get: function() { + get: function get() { return this.cloneNode(!0).innerHTML; }, - set: function(v) { + set: function set(v) { var dummy = global_document__WEBPACK_IMPORTED_MODULE_1___default().createElement(this.nodeName.toLowerCase()); dummy.innerHTML = v; for(var docFrag = global_document__WEBPACK_IMPORTED_MODULE_1___default().createDocumentFragment(); dummy.childNodes.length;)docFrag.appendChild(dummy.childNodes[0]); @@ -4586,10 +4586,10 @@ }, tech.one("sourceset", el.resetSourceWatch_); } }, srcDescriptorPolyfill = Object.defineProperty({}, "src", { - get: function() { + get: function get() { return this.hasAttribute("src") ? getAbsoluteURL(global_window__WEBPACK_IMPORTED_MODULE_0___default().Element.prototype.getAttribute.call(this, "src")) : ""; }, - set: function(v) { + set: function set(v) { return global_window__WEBPACK_IMPORTED_MODULE_0___default().Element.prototype.setAttribute.call(this, "src", v), v; } }), setupSourceset = function(tech) { @@ -4602,7 +4602,7 @@ srcDescriptorPolyfill ], "src"), oldSetAttribute = el.setAttribute, oldLoad = el.load; Object.defineProperty(el, "src", mergeOptions$3(srcDescriptor, { - set: function(v) { + set: function set(v) { var retval = srcDescriptor.set.call(el, v); return tech.triggerSourceset(el.src), retval; } @@ -4628,7 +4628,7 @@ }, options = { configurable: !0, enumerable: !0, - get: function() { + get: function get() { var value = getValue(); return set(value), value; } @@ -4649,11 +4649,11 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(Html5, _Tech); var _proto = Html5.prototype; - return _proto.dispose = function() { + return _proto.dispose = function dispose() { this.el_ && this.el_.resetSourceset_ && this.el_.resetSourceset_(), Html5.disposeMediaElement(this.el_), this.options_ = null, _Tech.prototype.dispose.call(this); - }, _proto.setupSourcesetHandling_ = function() { + }, _proto.setupSourcesetHandling_ = function setupSourcesetHandling_() { setupSourceset(this); - }, _proto.restoreMetadataTracksInIOSNativePlayer_ = function() { + }, _proto.restoreMetadataTracksInIOSNativePlayer_ = function restoreMetadataTracksInIOSNativePlayer_() { var metadataTracksPreFullscreenState, textTracks = this.textTracks(), takeMetadataTrackSnapshot = function() { metadataTracksPreFullscreenState = []; for(var i = 0; i < textTracks.length; i++){ @@ -4679,7 +4679,7 @@ }), this.on("webkitendfullscreen", function() { textTracks.removeEventListener("change", takeMetadataTrackSnapshot), textTracks.addEventListener("change", takeMetadataTrackSnapshot), textTracks.removeEventListener("change", restoreTrackMode); }); - }, _proto.overrideNative_ = function(type, override) { + }, _proto.overrideNative_ = function overrideNative_(type, override) { var _this2 = this; if (override === this["featuresNative" + type + "Tracks"]) { var lowerCaseType = type.toLowerCase(); @@ -4687,15 +4687,15 @@ _this2.el()[lowerCaseType + "Tracks"].removeEventListener(eventName, _this2[lowerCaseType + "TracksListeners_"][eventName]); }), this["featuresNative" + type + "Tracks"] = !override, this[lowerCaseType + "TracksListeners_"] = null, this.proxyNativeTracksForType_(lowerCaseType); } - }, _proto.overrideNativeAudioTracks = function(override) { + }, _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks(override) { this.overrideNative_("Audio", override); - }, _proto.overrideNativeVideoTracks = function(override) { + }, _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks(override) { this.overrideNative_("Video", override); - }, _proto.proxyNativeTracksForType_ = function(name) { + }, _proto.proxyNativeTracksForType_ = function proxyNativeTracksForType_(name) { var _this3 = this, props = NORMAL[name], elTracks = this.el()[props.getterName], techTracks = this[props.getterName](); if (this["featuresNative" + props.capitalName + "Tracks"] && elTracks && elTracks.addEventListener) { var listeners = { - change: function(e) { + change: function change(e) { var event = { type: "change", target: techTracks, @@ -4704,10 +4704,10 @@ }; techTracks.trigger(event), "text" === name && _this3[REMOTE.remoteText.getterName]().trigger(event); }, - addtrack: function(e) { + addtrack: function addtrack(e) { techTracks.addTrack(e.track); }, - removetrack: function(e) { + removetrack: function removetrack(e) { techTracks.removeTrack(e.track); } }, removeOldTracks = function() { @@ -4729,12 +4729,12 @@ return _this3.off("loadstart", removeOldTracks); }); } - }, _proto.proxyNativeTracks_ = function() { + }, _proto.proxyNativeTracks_ = function proxyNativeTracks_() { var _this4 = this; NORMAL.names.forEach(function(name) { _this4.proxyNativeTracksForType_(name); }); - }, _proto.createEl = function() { + }, _proto.createEl = function createEl() { var el = this.options_.tag; if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) { if (el) { @@ -4761,7 +4761,7 @@ void 0 !== value && (value ? setAttribute(el, attr, attr) : removeAttribute(el, attr), el[attr] = value); } return el; - }, _proto.handleLateInit_ = function(el) { + }, _proto.handleLateInit_ = function handleLateInit_(el) { if (0 !== el.networkState && 3 !== el.networkState) { if (0 === el.readyState) { var loadstartFired = !1, setLoadstartFired = function() { @@ -4785,26 +4785,26 @@ }, this); }); } - }, _proto.setScrubbing = function(isScrubbing) { + }, _proto.setScrubbing = function setScrubbing(isScrubbing) { this.isScrubbing_ = isScrubbing; - }, _proto.scrubbing = function() { + }, _proto.scrubbing = function scrubbing() { return this.isScrubbing_; - }, _proto.setCurrentTime = function(seconds) { + }, _proto.setCurrentTime = function setCurrentTime(seconds) { try { this.isScrubbing_ && this.el_.fastSeek && IS_ANY_SAFARI ? this.el_.fastSeek(seconds) : this.el_.currentTime = seconds; } catch (e) { log$1(e, "Video is not ready. (Video.js)"); } - }, _proto.duration = function() { + }, _proto.duration = function duration() { var _this5 = this; return this.el_.duration === 1 / 0 && IS_ANDROID && IS_CHROME && 0 === this.el_.currentTime ? (this.on("timeupdate", function checkProgress() { _this5.el_.currentTime > 0 && (_this5.el_.duration === 1 / 0 && _this5.trigger("durationchange"), _this5.off("timeupdate", checkProgress)); }), NaN) : this.el_.duration || NaN; - }, _proto.width = function() { + }, _proto.width = function width() { return this.el_.offsetWidth; - }, _proto.height = function() { + }, _proto.height = function height() { return this.el_.offsetHeight; - }, _proto.proxyWebkitFullscreen_ = function() { + }, _proto.proxyWebkitFullscreen_ = function proxyWebkitFullscreen_() { var _this6 = this; if ("webkitDisplayingFullscreen" in this.el_) { var endFn = function() { @@ -4821,13 +4821,13 @@ _this6.off("webkitbeginfullscreen", beginFn), _this6.off("webkitendfullscreen", endFn); }); } - }, _proto.supportsFullScreen = function() { + }, _proto.supportsFullScreen = function supportsFullScreen() { if ("function" == typeof this.el_.webkitEnterFullScreen) { var userAgent = global_window__WEBPACK_IMPORTED_MODULE_0___default().navigator && global_window__WEBPACK_IMPORTED_MODULE_0___default().navigator.userAgent || ""; if (/Android/.test(userAgent) || !/Chrome|Mac OS X 10.5/.test(userAgent)) return !0; } return !1; - }, _proto.enterFullScreen = function() { + }, _proto.enterFullScreen = function enterFullScreen() { var video = this.el_; if (video.paused && video.networkState <= video.HAVE_METADATA) silencePromise(this.el_.play()), this.setTimeout(function() { video.pause(); @@ -4842,35 +4842,35 @@ } catch (e) { this.trigger("fullscreenerror", e); } - }, _proto.exitFullScreen = function() { + }, _proto.exitFullScreen = function exitFullScreen() { if (!this.el_.webkitDisplayingFullscreen) { this.trigger("fullscreenerror", Error("The video is not fullscreen")); return; } this.el_.webkitExitFullScreen(); - }, _proto.requestPictureInPicture = function() { + }, _proto.requestPictureInPicture = function requestPictureInPicture() { return this.el_.requestPictureInPicture(); - }, _proto.src = function(_src) { + }, _proto.src = function src(_src) { if (void 0 === _src) return this.el_.src; this.setSrc(_src); - }, _proto.reset = function() { + }, _proto.reset = function reset() { Html5.resetMediaElement(this.el_); - }, _proto.currentSrc = function() { + }, _proto.currentSrc = function currentSrc() { return this.currentSource_ ? this.currentSource_.src : this.el_.currentSrc; - }, _proto.setControls = function(val) { + }, _proto.setControls = function setControls(val) { this.el_.controls = !!val; - }, _proto.addTextTrack = function(kind, label, language) { + }, _proto.addTextTrack = function addTextTrack(kind, label, language) { return this.featuresNativeTextTracks ? this.el_.addTextTrack(kind, label, language) : _Tech.prototype.addTextTrack.call(this, kind, label, language); - }, _proto.createRemoteTextTrack = function(options) { + }, _proto.createRemoteTextTrack = function createRemoteTextTrack(options) { if (!this.featuresNativeTextTracks) return _Tech.prototype.createRemoteTextTrack.call(this, options); var htmlTrackElement = global_document__WEBPACK_IMPORTED_MODULE_1___default().createElement("track"); return options.kind && (htmlTrackElement.kind = options.kind), options.label && (htmlTrackElement.label = options.label), (options.language || options.srclang) && (htmlTrackElement.srclang = options.language || options.srclang), options.default && (htmlTrackElement.default = options.default), options.id && (htmlTrackElement.id = options.id), options.src && (htmlTrackElement.src = options.src), htmlTrackElement; - }, _proto.addRemoteTextTrack = function(options, manualCleanup) { + }, _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) { var htmlTrackElement = _Tech.prototype.addRemoteTextTrack.call(this, options, manualCleanup); return this.featuresNativeTextTracks && this.el().appendChild(htmlTrackElement), htmlTrackElement; - }, _proto.removeRemoteTextTrack = function(track) { + }, _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) { if (_Tech.prototype.removeRemoteTextTrack.call(this, track), this.featuresNativeTextTracks) for(var tracks = this.$$("track"), i = tracks.length; i--;)(track === tracks[i] || track === tracks[i].track) && this.el().removeChild(tracks[i]); - }, _proto.getVideoPlaybackQuality = function() { + }, _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() { if ("function" == typeof this.el().getVideoPlaybackQuality) return this.el().getVideoPlaybackQuality(); var videoPlaybackQuality = {}; return void 0 !== this.el().webkitDroppedFrameCount && void 0 !== this.el().webkitDecodedFrameCount && (videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount, videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount), global_window__WEBPACK_IMPORTED_MODULE_0___default().performance && "function" == typeof global_window__WEBPACK_IMPORTED_MODULE_0___default().performance.now ? videoPlaybackQuality.creationTime = global_window__WEBPACK_IMPORTED_MODULE_0___default().performance.now() : global_window__WEBPACK_IMPORTED_MODULE_0___default().performance && global_window__WEBPACK_IMPORTED_MODULE_0___default().performance.timing && "number" == typeof global_window__WEBPACK_IMPORTED_MODULE_0___default().performance.timing.navigationStart && (videoPlaybackQuality.creationTime = global_window__WEBPACK_IMPORTED_MODULE_0___default().Date.now() - global_window__WEBPACK_IMPORTED_MODULE_0___default().performance.timing.navigationStart), videoPlaybackQuality; @@ -5211,13 +5211,13 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(Player, _Component); var _proto = Player.prototype; - return _proto.dispose = function() { + return _proto.dispose = function dispose() { var _this2 = this; this.trigger("dispose"), this.off("dispose"), off(global_document__WEBPACK_IMPORTED_MODULE_1___default(), this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_), off(global_document__WEBPACK_IMPORTED_MODULE_1___default(), "keydown", this.boundFullWindowOnEscKey_), this.styleEl_ && this.styleEl_.parentNode && (this.styleEl_.parentNode.removeChild(this.styleEl_), this.styleEl_ = null), Player.players[this.id_] = null, this.tag && this.tag.player && (this.tag.player = null), this.el_ && this.el_.player && (this.el_.player = null), this.tech_ && (this.tech_.dispose(), this.isPosterFromTech_ = !1, this.poster_ = ""), this.playerElIngest_ && (this.playerElIngest_ = null), this.tag && (this.tag = null), middlewareInstances[this.id()] = null, ALL.names.forEach(function(name) { var list = _this2[ALL[name].getterName](); list && list.off && list.off(); }), _Component.prototype.dispose.call(this); - }, _proto.createEl = function() { + }, _proto.createEl = function createEl() { var el, tag = this.tag, playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute("data-vjs-player"), divEmbed = "video-js" === this.tag.tagName.toLowerCase(); playerElIngest ? el = this.el_ = tag.parentNode : divEmbed || (el = this.el_ = _Component.prototype.createEl.call(this, "div")); var attrs = getAttributes(tag); @@ -5242,18 +5242,18 @@ addClass(linkEl, "vjs-hidden"), linkEl.setAttribute("hidden", "hidden"); } return tag.initNetworkState_ = tag.networkState, tag.parentNode && !playerElIngest && tag.parentNode.insertBefore(el, tag), prependTo(tag, el), this.children_.unshift(tag), this.el_.setAttribute("lang", this.language_), this.el_.setAttribute("translate", "no"), this.el_ = el, el; - }, _proto.crossOrigin = function(value) { + }, _proto.crossOrigin = function crossOrigin(value) { if (!value) return this.techGet_("crossOrigin"); if ("anonymous" !== value && "use-credentials" !== value) { log$1.warn('crossOrigin must be "anonymous" or "use-credentials", given "' + value + '"'); return; } this.techCall_("setCrossOrigin", value); - }, _proto.width = function(value) { + }, _proto.width = function width(value) { return this.dimension("width", value); - }, _proto.height = function(value) { + }, _proto.height = function height(value) { return this.dimension("height", value); - }, _proto.dimension = function(_dimension, value) { + }, _proto.dimension = function dimension(_dimension, value) { var privDimension = _dimension + "_"; if (void 0 === value) return this[privDimension] || 0; if ("" === value || "auto" === value) { @@ -5266,7 +5266,7 @@ return; } this[privDimension] = parsedVal, this.updateStyleEl_(); - }, _proto.fluid = function(bool) { + }, _proto.fluid = function fluid(bool) { var _this3 = this; if (void 0 === bool) return !!this.fluid_; this.fluid_ = !!bool, isEvented(this) && this.off([ @@ -5278,14 +5278,14 @@ "resize" ], _this3.boundUpdateStyleEl_); })) : this.removeClass("vjs-fluid"), this.updateStyleEl_(); - }, _proto.fill = function(bool) { + }, _proto.fill = function fill(bool) { if (void 0 === bool) return !!this.fill_; this.fill_ = !!bool, bool ? (this.addClass("vjs-fill"), this.fluid(!1)) : this.removeClass("vjs-fill"); - }, _proto.aspectRatio = function(ratio) { + }, _proto.aspectRatio = function aspectRatio(ratio) { if (void 0 === ratio) return this.aspectRatio_; if (!/^\d+\:\d+$/.test(ratio)) throw Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9."); this.aspectRatio_ = ratio, this.fluid(!0), this.updateStyleEl_(); - }, _proto.updateStyleEl_ = function() { + }, _proto.updateStyleEl_ = function updateStyleEl_() { if (!0 === global_window__WEBPACK_IMPORTED_MODULE_0___default().VIDEOJS_NO_DYNAMIC_STYLE) { var width, height, idClass, _width = "number" == typeof this.width_ ? this.width_ : this.options_.width, _height = "number" == typeof this.height_ ? this.height_ : this.options_.height, techEl = this.tech_ && this.tech_.el(); techEl && (_width >= 0 && (techEl.width = _width), _height >= 0 && (techEl.height = _height)); @@ -5293,7 +5293,7 @@ } var ratioParts = (void 0 !== this.aspectRatio_ && "auto" !== this.aspectRatio_ ? this.aspectRatio_ : this.videoWidth() > 0 ? this.videoWidth() + ":" + this.videoHeight() : "16:9").split(":"), ratioMultiplier = ratioParts[1] / ratioParts[0]; width = void 0 !== this.width_ ? this.width_ : void 0 !== this.height_ ? this.height_ / ratioMultiplier : this.videoWidth() || 300, height = void 0 !== this.height_ ? this.height_ : width * ratioMultiplier, idClass = /^[^a-zA-Z]/.test(this.id()) ? "dimensions-" + this.id() : this.id() + "-dimensions", this.addClass(idClass), setTextContent(this.styleEl_, "\n ." + idClass + " {\n width: " + width + "px;\n height: " + height + "px;\n }\n\n ." + idClass + ".vjs-fluid {\n padding-top: " + 100 * ratioMultiplier + "%;\n }\n "); - }, _proto.loadTech_ = function(techName, source) { + }, _proto.loadTech_ = function loadTech_(techName, source) { var _this4 = this; this.tech_ && this.unloadTech_(); var titleTechName = toTitleCase$1(techName), camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1); @@ -5375,23 +5375,23 @@ }), this.on(this.tech_, "ratechange", function(e) { return _this4.handleTechRateChange_(e); }), this.on(this.tech_, "loadedmetadata", this.boundUpdateStyleEl_), this.usingNativeControls(this.techGet_("controls")), this.controls() && !this.usingNativeControls() && this.addTechControlsListeners_(), this.tech_.el().parentNode === this.el() || "Html5" === titleTechName && this.tag || prependTo(this.tech_.el(), this.el()), this.tag && (this.tag.player = null, this.tag = null); - }, _proto.unloadTech_ = function() { + }, _proto.unloadTech_ = function unloadTech_() { var _this5 = this; ALL.names.forEach(function(name) { var props = ALL[name]; _this5[props.privateName] = _this5[props.getterName](); }), this.textTracksJson_ = textTrackConverter.textTracksToJson(this.tech_), this.isReady_ = !1, this.tech_.dispose(), this.tech_ = !1, this.isPosterFromTech_ && (this.poster_ = "", this.trigger("posterchange")), this.isPosterFromTech_ = !1; - }, _proto.tech = function(safety) { + }, _proto.tech = function tech(safety) { return void 0 === safety && log$1.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"), this.tech_; - }, _proto.addTechControlsListeners_ = function() { + }, _proto.addTechControlsListeners_ = function addTechControlsListeners_() { this.removeTechControlsListeners_(), this.on(this.tech_, "click", this.boundHandleTechClick_), this.on(this.tech_, "dblclick", this.boundHandleTechDoubleClick_), this.on(this.tech_, "touchstart", this.boundHandleTechTouchStart_), this.on(this.tech_, "touchmove", this.boundHandleTechTouchMove_), this.on(this.tech_, "touchend", this.boundHandleTechTouchEnd_), this.on(this.tech_, "tap", this.boundHandleTechTap_); - }, _proto.removeTechControlsListeners_ = function() { + }, _proto.removeTechControlsListeners_ = function removeTechControlsListeners_() { this.off(this.tech_, "tap", this.boundHandleTechTap_), this.off(this.tech_, "touchstart", this.boundHandleTechTouchStart_), this.off(this.tech_, "touchmove", this.boundHandleTechTouchMove_), this.off(this.tech_, "touchend", this.boundHandleTechTouchEnd_), this.off(this.tech_, "click", this.boundHandleTechClick_), this.off(this.tech_, "dblclick", this.boundHandleTechDoubleClick_); - }, _proto.handleTechReady_ = function() { + }, _proto.handleTechReady_ = function handleTechReady_() { this.triggerReady(), this.cache_.volume && this.techCall_("setVolume", this.cache_.volume), this.handleTechPosterChange_(), this.handleTechDurationChange_(); - }, _proto.handleTechLoadStart_ = function() { + }, _proto.handleTechLoadStart_ = function handleTechLoadStart_() { this.removeClass("vjs-ended"), this.removeClass("vjs-seeking"), this.error(null), this.handleTechDurationChange_(), this.paused() ? (this.hasStarted(!1), this.trigger("loadstart")) : (this.trigger("loadstart"), this.trigger("firstplay")), this.manualAutoplay_(!0 === this.autoplay() && this.options_.normalizeAutoplay ? "play" : this.autoplay()); - }, _proto.manualAutoplay_ = function(type) { + }, _proto.manualAutoplay_ = function manualAutoplay_(type) { var promise, _this6 = this; if (this.tech_ && "string" == typeof type) { var resolveMuted = function() { @@ -5418,7 +5418,7 @@ }); }); } - }, _proto.updateSourceCaches_ = function(srcObj) { + }, _proto.updateSourceCaches_ = function updateSourceCaches_(srcObj) { void 0 === srcObj && (srcObj = ""); var src = srcObj, type = ""; "string" != typeof src && (src = srcObj.src, type = srcObj.type), this.cache_.source = this.cache_.source || {}, this.cache_.sources = this.cache_.sources || [], src && !type && (type = findMimetype(this, src)), this.cache_.source = mergeOptions$3({}, srcObj, { @@ -5434,13 +5434,13 @@ matchingSourceEls.length && !matchingSources.length ? this.cache_.sources = sourceElSources : matchingSources.length || (this.cache_.sources = [ this.cache_.source ]), this.cache_.src = src; - }, _proto.handleTechSourceset_ = function(event) { + }, _proto.handleTechSourceset_ = function handleTechSourceset_(event) { var _this7 = this; if (!this.changingSrc_) { var updateSourceCaches = function(src) { return _this7.updateSourceCaches_(src); }, playerSrc = this.currentSource().src, eventSrc = event.src; - playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc) && (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) && (updateSourceCaches = function() {}), updateSourceCaches(eventSrc), event.src || this.tech_.any([ + playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc) && (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) && (updateSourceCaches = function updateSourceCaches() {}), updateSourceCaches(eventSrc), event.src || this.tech_.any([ "sourceset", "loadstart" ], function(e) { @@ -5457,83 +5457,83 @@ src: event.src, type: "sourceset" }); - }, _proto.hasStarted = function(request) { + }, _proto.hasStarted = function hasStarted(request) { if (void 0 === request) return this.hasStarted_; request !== this.hasStarted_ && (this.hasStarted_ = request, this.hasStarted_ ? (this.addClass("vjs-has-started"), this.trigger("firstplay")) : this.removeClass("vjs-has-started")); - }, _proto.handleTechPlay_ = function() { + }, _proto.handleTechPlay_ = function handleTechPlay_() { this.removeClass("vjs-ended"), this.removeClass("vjs-paused"), this.addClass("vjs-playing"), this.hasStarted(!0), this.trigger("play"); - }, _proto.handleTechRateChange_ = function() { + }, _proto.handleTechRateChange_ = function handleTechRateChange_() { this.tech_.playbackRate() > 0 && 0 === this.cache_.lastPlaybackRate && (this.queuedCallbacks_.forEach(function(queued) { return queued.callback(queued.event); }), this.queuedCallbacks_ = []), this.cache_.lastPlaybackRate = this.tech_.playbackRate(), this.trigger("ratechange"); - }, _proto.handleTechWaiting_ = function() { + }, _proto.handleTechWaiting_ = function handleTechWaiting_() { var _this8 = this; this.addClass("vjs-waiting"), this.trigger("waiting"); var timeWhenWaiting = this.currentTime(); this.on("timeupdate", function timeUpdateListener() { timeWhenWaiting !== _this8.currentTime() && (_this8.removeClass("vjs-waiting"), _this8.off("timeupdate", timeUpdateListener)); }); - }, _proto.handleTechCanPlay_ = function() { + }, _proto.handleTechCanPlay_ = function handleTechCanPlay_() { this.removeClass("vjs-waiting"), this.trigger("canplay"); - }, _proto.handleTechCanPlayThrough_ = function() { + }, _proto.handleTechCanPlayThrough_ = function handleTechCanPlayThrough_() { this.removeClass("vjs-waiting"), this.trigger("canplaythrough"); - }, _proto.handleTechPlaying_ = function() { + }, _proto.handleTechPlaying_ = function handleTechPlaying_() { this.removeClass("vjs-waiting"), this.trigger("playing"); - }, _proto.handleTechSeeking_ = function() { + }, _proto.handleTechSeeking_ = function handleTechSeeking_() { this.addClass("vjs-seeking"), this.trigger("seeking"); - }, _proto.handleTechSeeked_ = function() { + }, _proto.handleTechSeeked_ = function handleTechSeeked_() { this.removeClass("vjs-seeking"), this.removeClass("vjs-ended"), this.trigger("seeked"); - }, _proto.handleTechFirstPlay_ = function() { + }, _proto.handleTechFirstPlay_ = function handleTechFirstPlay_() { this.options_.starttime && (log$1.warn("Passing the `starttime` option to the player will be deprecated in 6.0"), this.currentTime(this.options_.starttime)), this.addClass("vjs-has-started"), this.trigger("firstplay"); - }, _proto.handleTechPause_ = function() { + }, _proto.handleTechPause_ = function handleTechPause_() { this.removeClass("vjs-playing"), this.addClass("vjs-paused"), this.trigger("pause"); - }, _proto.handleTechEnded_ = function() { + }, _proto.handleTechEnded_ = function handleTechEnded_() { this.addClass("vjs-ended"), this.removeClass("vjs-waiting"), this.options_.loop ? (this.currentTime(0), this.play()) : this.paused() || this.pause(), this.trigger("ended"); - }, _proto.handleTechDurationChange_ = function() { + }, _proto.handleTechDurationChange_ = function handleTechDurationChange_() { this.duration(this.techGet_("duration")); - }, _proto.handleTechClick_ = function(event) { + }, _proto.handleTechClick_ = function handleTechClick_(event) { this.controls_ && (void 0 === this.options_ || void 0 === this.options_.userActions || void 0 === this.options_.userActions.click || !1 !== this.options_.userActions.click) && (void 0 !== this.options_ && void 0 !== this.options_.userActions && "function" == typeof this.options_.userActions.click ? this.options_.userActions.click.call(this, event) : this.paused() ? silencePromise(this.play()) : this.pause()); - }, _proto.handleTechDoubleClick_ = function(event) { + }, _proto.handleTechDoubleClick_ = function handleTechDoubleClick_(event) { this.controls_ && (Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), function(el) { return el.contains(event.target); }) || void 0 !== this.options_ && void 0 !== this.options_.userActions && void 0 !== this.options_.userActions.doubleClick && !1 === this.options_.userActions.doubleClick || (void 0 !== this.options_ && void 0 !== this.options_.userActions && "function" == typeof this.options_.userActions.doubleClick ? this.options_.userActions.doubleClick.call(this, event) : this.isFullscreen() ? this.exitFullscreen() : this.requestFullscreen())); - }, _proto.handleTechTap_ = function() { + }, _proto.handleTechTap_ = function handleTechTap_() { this.userActive(!this.userActive()); - }, _proto.handleTechTouchStart_ = function() { + }, _proto.handleTechTouchStart_ = function handleTechTouchStart_() { this.userWasActive = this.userActive(); - }, _proto.handleTechTouchMove_ = function() { + }, _proto.handleTechTouchMove_ = function handleTechTouchMove_() { this.userWasActive && this.reportUserActivity(); - }, _proto.handleTechTouchEnd_ = function(event) { + }, _proto.handleTechTouchEnd_ = function handleTechTouchEnd_(event) { event.cancelable && event.preventDefault(); - }, _proto.handleStageClick_ = function() { + }, _proto.handleStageClick_ = function handleStageClick_() { this.reportUserActivity(); - }, _proto.toggleFullscreenClass_ = function() { + }, _proto.toggleFullscreenClass_ = function toggleFullscreenClass_() { this.isFullscreen() ? this.addClass("vjs-fullscreen") : this.removeClass("vjs-fullscreen"); - }, _proto.documentFullscreenChange_ = function(e) { + }, _proto.documentFullscreenChange_ = function documentFullscreenChange_(e) { var targetPlayer = e.target.player; if (!targetPlayer || targetPlayer === this) { var el = this.el(), isFs = global_document__WEBPACK_IMPORTED_MODULE_1___default()[this.fsApi_.fullscreenElement] === el; !isFs && el.matches ? isFs = el.matches(":" + this.fsApi_.fullscreen) : !isFs && el.msMatchesSelector && (isFs = el.msMatchesSelector(":" + this.fsApi_.fullscreen)), this.isFullscreen(isFs); } - }, _proto.handleTechFullscreenChange_ = function(event, data) { + }, _proto.handleTechFullscreenChange_ = function handleTechFullscreenChange_(event, data) { data && (data.nativeIOSFullscreen && this.toggleClass("vjs-ios-native-fs"), this.isFullscreen(data.isFullscreen)); - }, _proto.handleTechFullscreenError_ = function(event, err) { + }, _proto.handleTechFullscreenError_ = function handleTechFullscreenError_(event, err) { this.trigger("fullscreenerror", err); - }, _proto.togglePictureInPictureClass_ = function() { + }, _proto.togglePictureInPictureClass_ = function togglePictureInPictureClass_() { this.isInPictureInPicture() ? this.addClass("vjs-picture-in-picture") : this.removeClass("vjs-picture-in-picture"); - }, _proto.handleTechEnterPictureInPicture_ = function(event) { + }, _proto.handleTechEnterPictureInPicture_ = function handleTechEnterPictureInPicture_(event) { this.isInPictureInPicture(!0); - }, _proto.handleTechLeavePictureInPicture_ = function(event) { + }, _proto.handleTechLeavePictureInPicture_ = function handleTechLeavePictureInPicture_(event) { this.isInPictureInPicture(!1); - }, _proto.handleTechError_ = function() { + }, _proto.handleTechError_ = function handleTechError_() { var error = this.tech_.error(); this.error(error); - }, _proto.handleTechTextData_ = function() { + }, _proto.handleTechTextData_ = function handleTechTextData_() { var data = null; arguments.length > 1 && (data = arguments[1]), this.trigger("textdata", data); - }, _proto.getCache = function() { + }, _proto.getCache = function getCache() { return this.cache_; - }, _proto.resetCache_ = function() { + }, _proto.resetCache_ = function resetCache_() { this.cache_ = { currentTime: 0, initTime: 0, @@ -5548,7 +5548,7 @@ playbackRates: [], volume: 1 }; - }, _proto.techCall_ = function(method, arg) { + }, _proto.techCall_ = function techCall_(method, arg) { this.ready(function() { if (method in allowedSetters) { var middleware; @@ -5561,7 +5561,7 @@ throw log$1(e), e; } }, !0); - }, _proto.techGet_ = function(method) { + }, _proto.techGet_ = function techGet_(method) { if (this.tech_ && this.tech_.isReady_) { if (method in allowedGetters) { var middleware, tech; @@ -5576,12 +5576,12 @@ throw log$1(e), e; } } - }, _proto.play = function() { + }, _proto.play = function play() { var _this9 = this, PromiseClass = this.options_.Promise || global_window__WEBPACK_IMPORTED_MODULE_0___default().Promise; return PromiseClass ? new PromiseClass(function(resolve) { _this9.play_(resolve); }) : this.play_(); - }, _proto.play_ = function(callback) { + }, _proto.play_ = function play_(callback) { var _this10 = this; void 0 === callback && (callback = silencePromise), this.playCallbacks_.push(callback); var isSrcReady = !!(!this.changingSrc_ && (this.src() || this.currentSrc())); @@ -5599,26 +5599,26 @@ } var val = this.techGet_("play"); null === val ? this.runPlayTerminatedQueue_() : this.runPlayCallbacks_(val); - }, _proto.runPlayTerminatedQueue_ = function() { + }, _proto.runPlayTerminatedQueue_ = function runPlayTerminatedQueue_() { var queue = this.playTerminatedQueue_.slice(0); this.playTerminatedQueue_ = [], queue.forEach(function(q) { q(); }); - }, _proto.runPlayCallbacks_ = function(val) { + }, _proto.runPlayCallbacks_ = function runPlayCallbacks_(val) { var callbacks = this.playCallbacks_.slice(0); this.playCallbacks_ = [], this.playTerminatedQueue_ = [], callbacks.forEach(function(cb) { cb(val); }); - }, _proto.pause = function() { + }, _proto.pause = function pause() { this.techCall_("pause"); - }, _proto.paused = function() { + }, _proto.paused = function paused() { return !1 !== this.techGet_("paused"); - }, _proto.played = function() { + }, _proto.played = function played() { return this.techGet_("played") || createTimeRanges(0, 0); - }, _proto.scrubbing = function(isScrubbing) { + }, _proto.scrubbing = function scrubbing(isScrubbing) { if (void 0 === isScrubbing) return this.scrubbing_; this.scrubbing_ = !!isScrubbing, this.techCall_("setScrubbing", this.scrubbing_), isScrubbing ? this.addClass("vjs-scrubbing") : this.removeClass("vjs-scrubbing"); - }, _proto.currentTime = function(seconds) { + }, _proto.currentTime = function currentTime(seconds) { if (void 0 !== seconds) { if (seconds < 0 && (seconds = 0), !this.isReady_ || this.changingSrc_ || !this.tech_ || !this.tech_.isReady_) { this.cache_.initTime = seconds, this.off("canplay", this.boundApplyInitTime_), this.one("canplay", this.boundApplyInitTime_); @@ -5628,54 +5628,54 @@ return; } return this.cache_.currentTime = this.techGet_("currentTime") || 0, this.cache_.currentTime; - }, _proto.applyInitTime_ = function() { + }, _proto.applyInitTime_ = function applyInitTime_() { this.currentTime(this.cache_.initTime); - }, _proto.duration = function(seconds) { + }, _proto.duration = function duration(seconds) { if (void 0 === seconds) return void 0 !== this.cache_.duration ? this.cache_.duration : NaN; (seconds = parseFloat(seconds)) < 0 && (seconds = 1 / 0), seconds === this.cache_.duration || (this.cache_.duration = seconds, seconds === 1 / 0 ? this.addClass("vjs-live") : this.removeClass("vjs-live"), isNaN(seconds) || this.trigger("durationchange")); - }, _proto.remainingTime = function() { + }, _proto.remainingTime = function remainingTime() { return this.duration() - this.currentTime(); - }, _proto.remainingTimeDisplay = function() { + }, _proto.remainingTimeDisplay = function remainingTimeDisplay() { return Math.floor(this.duration()) - Math.floor(this.currentTime()); - }, _proto.buffered = function() { + }, _proto.buffered = function buffered() { var buffered = this.techGet_("buffered"); return buffered && buffered.length || (buffered = createTimeRanges(0, 0)), buffered; - }, _proto.bufferedPercent = function() { + }, _proto.bufferedPercent = function bufferedPercent$1() { return bufferedPercent(this.buffered(), this.duration()); - }, _proto.bufferedEnd = function() { + }, _proto.bufferedEnd = function bufferedEnd() { var buffered = this.buffered(), duration = this.duration(), end = buffered.end(buffered.length - 1); return end > duration && (end = duration), end; - }, _proto.volume = function(percentAsDecimal) { + }, _proto.volume = function volume(percentAsDecimal) { var vol; if (void 0 !== percentAsDecimal) { vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal))), this.cache_.volume = vol, this.techCall_("setVolume", vol), vol > 0 && this.lastVolume_(vol); return; } return isNaN(vol = parseFloat(this.techGet_("volume"))) ? 1 : vol; - }, _proto.muted = function(_muted) { + }, _proto.muted = function muted(_muted) { if (void 0 !== _muted) { this.techCall_("setMuted", _muted); return; } return this.techGet_("muted") || !1; - }, _proto.defaultMuted = function(_defaultMuted) { + }, _proto.defaultMuted = function defaultMuted(_defaultMuted) { return void 0 !== _defaultMuted ? this.techCall_("setDefaultMuted", _defaultMuted) : this.techGet_("defaultMuted") || !1; - }, _proto.lastVolume_ = function(percentAsDecimal) { + }, _proto.lastVolume_ = function lastVolume_(percentAsDecimal) { if (void 0 !== percentAsDecimal && 0 !== percentAsDecimal) { this.cache_.lastVolume = percentAsDecimal; return; } return this.cache_.lastVolume; - }, _proto.supportsFullScreen = function() { + }, _proto.supportsFullScreen = function supportsFullScreen() { return this.techGet_("supportsFullScreen") || !1; - }, _proto.isFullscreen = function(isFS) { + }, _proto.isFullscreen = function isFullscreen(isFS) { if (void 0 !== isFS) { var oldValue = this.isFullscreen_; this.isFullscreen_ = !!isFS, this.isFullscreen_ !== oldValue && this.fsApi_.prefixed && this.trigger("fullscreenchange"), this.toggleFullscreenClass_(); return; } return this.isFullscreen_; - }, _proto.requestFullscreen = function(fullscreenOptions) { + }, _proto.requestFullscreen = function requestFullscreen(fullscreenOptions) { var PromiseClass = this.options_.Promise || global_window__WEBPACK_IMPORTED_MODULE_0___default().Promise; if (PromiseClass) { var self1 = this; @@ -5695,7 +5695,7 @@ }); } return this.requestFullscreenHelper_(); - }, _proto.requestFullscreenHelper_ = function(fullscreenOptions) { + }, _proto.requestFullscreenHelper_ = function requestFullscreenHelper_(fullscreenOptions) { var fsOptions, _this11 = this; if (this.fsApi_.prefixed || (fsOptions = this.options_.fullscreen && this.options_.fullscreen.options || {}, void 0 === fullscreenOptions || (fsOptions = fullscreenOptions)), this.fsApi_.requestFullscreen) { var promise = this.el_[this.fsApi_.requestFullscreen](fsOptions); @@ -5706,7 +5706,7 @@ }), promise; } this.tech_.supportsFullScreen() && !0 == !this.options_.preferFullWindow ? this.techCall_("enterFullScreen") : this.enterFullWindow(); - }, _proto.exitFullscreen = function() { + }, _proto.exitFullscreen = function exitFullscreen() { var PromiseClass = this.options_.Promise || global_window__WEBPACK_IMPORTED_MODULE_0___default().Promise; if (PromiseClass) { var self1 = this; @@ -5726,7 +5726,7 @@ }); } return this.exitFullscreenHelper_(); - }, _proto.exitFullscreenHelper_ = function() { + }, _proto.exitFullscreenHelper_ = function exitFullscreenHelper_() { var _this12 = this; if (this.fsApi_.requestFullscreen) { var promise = global_document__WEBPACK_IMPORTED_MODULE_1___default()[this.fsApi_.exitFullscreen](); @@ -5735,26 +5735,26 @@ })), promise; } this.tech_.supportsFullScreen() && !0 == !this.options_.preferFullWindow ? this.techCall_("exitFullScreen") : this.exitFullWindow(); - }, _proto.enterFullWindow = function() { + }, _proto.enterFullWindow = function enterFullWindow() { this.isFullscreen(!0), this.isFullWindow = !0, this.docOrigOverflow = global_document__WEBPACK_IMPORTED_MODULE_1___default().documentElement.style.overflow, on(global_document__WEBPACK_IMPORTED_MODULE_1___default(), "keydown", this.boundFullWindowOnEscKey_), global_document__WEBPACK_IMPORTED_MODULE_1___default().documentElement.style.overflow = "hidden", addClass(global_document__WEBPACK_IMPORTED_MODULE_1___default().body, "vjs-full-window"), this.trigger("enterFullWindow"); - }, _proto.fullWindowOnEscKey = function(event) { + }, _proto.fullWindowOnEscKey = function fullWindowOnEscKey(event) { keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(event, "Esc") && !0 === this.isFullscreen() && (this.isFullWindow ? this.exitFullWindow() : this.exitFullscreen()); - }, _proto.exitFullWindow = function() { + }, _proto.exitFullWindow = function exitFullWindow() { this.isFullscreen(!1), this.isFullWindow = !1, off(global_document__WEBPACK_IMPORTED_MODULE_1___default(), "keydown", this.boundFullWindowOnEscKey_), global_document__WEBPACK_IMPORTED_MODULE_1___default().documentElement.style.overflow = this.docOrigOverflow, removeClass(global_document__WEBPACK_IMPORTED_MODULE_1___default().body, "vjs-full-window"), this.trigger("exitFullWindow"); - }, _proto.disablePictureInPicture = function(value) { + }, _proto.disablePictureInPicture = function disablePictureInPicture(value) { if (void 0 === value) return this.techGet_("disablePictureInPicture"); this.techCall_("setDisablePictureInPicture", value), this.options_.disablePictureInPicture = value, this.trigger("disablepictureinpicturechanged"); - }, _proto.isInPictureInPicture = function(isPiP) { + }, _proto.isInPictureInPicture = function isInPictureInPicture(isPiP) { if (void 0 !== isPiP) { this.isInPictureInPicture_ = !!isPiP, this.togglePictureInPictureClass_(); return; } return !!this.isInPictureInPicture_; - }, _proto.requestPictureInPicture = function() { + }, _proto.requestPictureInPicture = function requestPictureInPicture() { if ("pictureInPictureEnabled" in global_document__WEBPACK_IMPORTED_MODULE_1___default() && !1 === this.disablePictureInPicture()) return this.techGet_("requestPictureInPicture"); - }, _proto.exitPictureInPicture = function() { + }, _proto.exitPictureInPicture = function exitPictureInPicture() { if ("pictureInPictureEnabled" in global_document__WEBPACK_IMPORTED_MODULE_1___default()) return global_document__WEBPACK_IMPORTED_MODULE_1___default().exitPictureInPicture(); - }, _proto.handleKeyDown = function(event) { + }, _proto.handleKeyDown = function handleKeyDown(event) { var el, tagName, userActions = this.options_.userActions; userActions && userActions.hotkeys && (tagName = (el = this.el_.ownerDocument.activeElement).tagName.toLowerCase(), el.isContentEditable || ("input" === tagName ? -1 === [ "button", @@ -5766,7 +5766,7 @@ ].indexOf(el.type) : -1 !== [ "textarea" ].indexOf(tagName)) || ("function" == typeof userActions.hotkeys ? userActions.hotkeys.call(this, event) : this.handleHotkeys(event))); - }, _proto.handleHotkeys = function(event) { + }, _proto.handleHotkeys = function handleHotkeys(event) { var hotkeys = this.options_.userActions ? this.options_.userActions.hotkeys : {}, _hotkeys$fullscreenKe = hotkeys.fullscreenKey, fullscreenKey = void 0 === _hotkeys$fullscreenKe ? function(keydownEvent) { return keycode__WEBPACK_IMPORTED_MODULE_3___default().isEventKey(keydownEvent, "f"); } : _hotkeys$fullscreenKe, _hotkeys$muteKey = hotkeys.muteKey, muteKey = void 0 === _hotkeys$muteKey ? function(keydownEvent) { @@ -5779,7 +5779,7 @@ var FSToggle = Component$1.getComponent("FullscreenToggle"); !1 !== global_document__WEBPACK_IMPORTED_MODULE_1___default()[this.fsApi_.fullscreenEnabled] && FSToggle.prototype.handleClick.call(this, event); } else muteKey.call(this, event) ? (event.preventDefault(), event.stopPropagation(), Component$1.getComponent("MuteToggle").prototype.handleClick.call(this, event)) : playPauseKey.call(this, event) && (event.preventDefault(), event.stopPropagation(), Component$1.getComponent("PlayToggle").prototype.handleClick.call(this, event)); - }, _proto.canPlayType = function(type) { + }, _proto.canPlayType = function canPlayType(type) { for(var can, i = 0, j = this.options_.techOrder; i < j.length; i++){ var techName = j[i], tech = Tech.getTech(techName); if (tech || (tech = Component$1.getComponent(techName)), !tech) { @@ -5789,7 +5789,7 @@ if (tech.isSupported() && (can = tech.canPlayType(type))) return can; } return ""; - }, _proto.selectSource = function(sources) { + }, _proto.selectSource = function selectSource(sources) { var _this13 = this, techs = this.options_.techOrder.map(function(techName) { return [ techName, @@ -5815,7 +5815,7 @@ return (this.options_.sourceOrder ? findFirstPassingTechSourcePair(sources, techs, function(a, b) { return finder(b, a); }) : findFirstPassingTechSourcePair(techs, sources, finder)) || !1; - }, _proto.handleSrc_ = function(source, isRetry) { + }, _proto.handleSrc_ = function handleSrc_(source, isRetry) { var _this14 = this; if (void 0 === source) return this.cache_.src || ""; this.resetRetryOnError_ && this.resetRetryOnError_(); @@ -5883,9 +5883,9 @@ _this14.off("error", retry), _this14.off("playing", stopListeningForErrors); }; } - }, _proto.src = function(source) { + }, _proto.src = function src(source) { return this.handleSrc_(source, !1); - }, _proto.src_ = function(source) { + }, _proto.src_ = function src_(source) { var str1, str2, _this15 = this, sourceTech = this.selectSource([ source ]); @@ -5894,67 +5894,67 @@ })) : this.ready(function() { this.tech_.constructor.prototype.hasOwnProperty("setSource") ? this.techCall_("setSource", source) : this.techCall_("src", source.src), this.changingSrc_ = !1; }, !0), !1); - }, _proto.load = function() { + }, _proto.load = function load() { this.techCall_("load"); - }, _proto.reset = function() { + }, _proto.reset = function reset() { var _this16 = this, PromiseClass = this.options_.Promise || global_window__WEBPACK_IMPORTED_MODULE_0___default().Promise; this.paused() || !PromiseClass ? this.doReset_() : silencePromise(this.play().then(function() { return _this16.doReset_(); })); - }, _proto.doReset_ = function() { + }, _proto.doReset_ = function doReset_() { this.tech_ && this.tech_.clearTracks("text"), this.resetCache_(), this.poster(""), this.loadTech_(this.options_.techOrder[0], null), this.techCall_("reset"), this.resetControlBarUI_(), isEvented(this) && this.trigger("playerreset"); - }, _proto.resetControlBarUI_ = function() { + }, _proto.resetControlBarUI_ = function resetControlBarUI_() { this.resetProgressBar_(), this.resetPlaybackRate_(), this.resetVolumeBar_(); - }, _proto.resetProgressBar_ = function() { + }, _proto.resetProgressBar_ = function resetProgressBar_() { this.currentTime(0); var _this$controlBar = this.controlBar, durationDisplay = _this$controlBar.durationDisplay, remainingTimeDisplay = _this$controlBar.remainingTimeDisplay; durationDisplay && durationDisplay.updateContent(), remainingTimeDisplay && remainingTimeDisplay.updateContent(); - }, _proto.resetPlaybackRate_ = function() { + }, _proto.resetPlaybackRate_ = function resetPlaybackRate_() { this.playbackRate(this.defaultPlaybackRate()), this.handleTechRateChange_(); - }, _proto.resetVolumeBar_ = function() { + }, _proto.resetVolumeBar_ = function resetVolumeBar_() { this.volume(1.0), this.trigger("volumechange"); - }, _proto.currentSources = function() { + }, _proto.currentSources = function currentSources() { var source = this.currentSource(), sources = []; return 0 !== Object.keys(source).length && sources.push(source), this.cache_.sources || sources; - }, _proto.currentSource = function() { + }, _proto.currentSource = function currentSource() { return this.cache_.source || {}; - }, _proto.currentSrc = function() { + }, _proto.currentSrc = function currentSrc() { return this.currentSource() && this.currentSource().src || ""; - }, _proto.currentType = function() { + }, _proto.currentType = function currentType() { return this.currentSource() && this.currentSource().type || ""; - }, _proto.preload = function(value) { + }, _proto.preload = function preload(value) { if (void 0 !== value) { this.techCall_("setPreload", value), this.options_.preload = value; return; } return this.techGet_("preload"); - }, _proto.autoplay = function(value) { + }, _proto.autoplay = function autoplay(value) { var techAutoplay; if (void 0 === value) return this.options_.autoplay || !1; "string" == typeof value && /(any|play|muted)/.test(value) || !0 === value && this.options_.normalizeAutoplay ? (this.options_.autoplay = value, this.manualAutoplay_("string" == typeof value ? value : "play"), techAutoplay = !1) : value ? this.options_.autoplay = !0 : this.options_.autoplay = !1, techAutoplay = void 0 === techAutoplay ? this.options_.autoplay : techAutoplay, this.tech_ && this.techCall_("setAutoplay", techAutoplay); - }, _proto.playsinline = function(value) { + }, _proto.playsinline = function playsinline(value) { return void 0 !== value ? (this.techCall_("setPlaysinline", value), this.options_.playsinline = value, this) : this.techGet_("playsinline"); - }, _proto.loop = function(value) { + }, _proto.loop = function loop(value) { if (void 0 !== value) { this.techCall_("setLoop", value), this.options_.loop = value; return; } return this.techGet_("loop"); - }, _proto.poster = function(src) { + }, _proto.poster = function poster(src) { if (void 0 === src) return this.poster_; src || (src = ""), src !== this.poster_ && (this.poster_ = src, this.techCall_("setPoster", src), this.isPosterFromTech_ = !1, this.trigger("posterchange")); - }, _proto.handleTechPosterChange_ = function() { + }, _proto.handleTechPosterChange_ = function handleTechPosterChange_() { if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) { var newPoster = this.tech_.poster() || ""; newPoster !== this.poster_ && (this.poster_ = newPoster, this.isPosterFromTech_ = !0, this.trigger("posterchange")); } - }, _proto.controls = function(bool) { + }, _proto.controls = function controls(bool) { if (void 0 === bool) return !!this.controls_; bool = !!bool, this.controls_ !== bool && (this.controls_ = bool, this.usingNativeControls() && this.techCall_("setControls", bool), this.controls_ ? (this.removeClass("vjs-controls-disabled"), this.addClass("vjs-controls-enabled"), this.trigger("controlsenabled"), this.usingNativeControls() || this.addTechControlsListeners_()) : (this.removeClass("vjs-controls-enabled"), this.addClass("vjs-controls-disabled"), this.trigger("controlsdisabled"), this.usingNativeControls() || this.removeTechControlsListeners_())); - }, _proto.usingNativeControls = function(bool) { + }, _proto.usingNativeControls = function usingNativeControls(bool) { if (void 0 === bool) return !!this.usingNativeControls_; bool = !!bool, this.usingNativeControls_ !== bool && (this.usingNativeControls_ = bool, this.usingNativeControls_ ? (this.addClass("vjs-using-native-controls"), this.trigger("usingnativecontrols")) : (this.removeClass("vjs-using-native-controls"), this.trigger("usingcustomcontrols"))); - }, _proto.error = function(err) { + }, _proto.error = function error(err) { var _this17 = this; if (void 0 === err) return this.error_ || null; if (hooks("beforeerror").forEach(function(hookFunction) { @@ -5986,9 +5986,9 @@ this.error_ = new MediaError(err), this.addClass("vjs-error"), log$1.error("(CODE:" + this.error_.code + " " + MediaError.errorTypes[this.error_.code] + ")", this.error_.message, this.error_), this.trigger("error"), hooks("error").forEach(function(hookFunction) { return hookFunction(_this17, _this17.error_); }); - }, _proto.reportUserActivity = function(event) { + }, _proto.reportUserActivity = function reportUserActivity(event) { this.userActivity_ = !0; - }, _proto.userActive = function(bool) { + }, _proto.userActive = function userActive(bool) { if (void 0 === bool) return this.userActive_; if ((bool = !!bool) !== this.userActive_) { if (this.userActive_ = bool, this.userActive_) { @@ -5999,7 +5999,7 @@ e.stopPropagation(), e.preventDefault(); }), this.userActivity_ = !1, this.removeClass("vjs-user-active"), this.addClass("vjs-user-inactive"), this.trigger("userinactive"); } - }, _proto.listenForUserActivity_ = function() { + }, _proto.listenForUserActivity_ = function listenForUserActivity_() { var mouseInProgress, lastMoveX, lastMoveY, inactivityTimeout, handleActivity = bind(this, this.reportUserActivity), handleMouseUpAndMouseLeave = function(event) { handleActivity(), this.clearInterval(mouseInProgress); }; @@ -6022,40 +6022,40 @@ }, timeout)); } }, 250); - }, _proto.playbackRate = function(rate) { + }, _proto.playbackRate = function playbackRate(rate) { if (void 0 !== rate) { this.techCall_("setPlaybackRate", rate); return; } return this.tech_ && this.tech_.featuresPlaybackRate ? this.cache_.lastPlaybackRate || this.techGet_("playbackRate") : 1.0; - }, _proto.defaultPlaybackRate = function(rate) { + }, _proto.defaultPlaybackRate = function defaultPlaybackRate(rate) { return void 0 !== rate ? this.techCall_("setDefaultPlaybackRate", rate) : this.tech_ && this.tech_.featuresPlaybackRate ? this.techGet_("defaultPlaybackRate") : 1.0; - }, _proto.isAudio = function(bool) { + }, _proto.isAudio = function isAudio(bool) { if (void 0 !== bool) { this.isAudio_ = !!bool; return; } return !!this.isAudio_; - }, _proto.addTextTrack = function(kind, label, language) { + }, _proto.addTextTrack = function addTextTrack(kind, label, language) { if (this.tech_) return this.tech_.addTextTrack(kind, label, language); - }, _proto.addRemoteTextTrack = function(options, manualCleanup) { + }, _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) { if (this.tech_) return this.tech_.addRemoteTextTrack(options, manualCleanup); - }, _proto.removeRemoteTextTrack = function(obj) { + }, _proto.removeRemoteTextTrack = function removeRemoteTextTrack(obj) { void 0 === obj && (obj = {}); var track = obj.track; if (track || (track = obj), this.tech_) return this.tech_.removeRemoteTextTrack(track); - }, _proto.getVideoPlaybackQuality = function() { + }, _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() { return this.techGet_("getVideoPlaybackQuality"); - }, _proto.videoWidth = function() { + }, _proto.videoWidth = function videoWidth() { return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0; - }, _proto.videoHeight = function() { + }, _proto.videoHeight = function videoHeight() { return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0; - }, _proto.language = function(code) { + }, _proto.language = function language(code) { if (void 0 === code) return this.language_; this.language_ !== String(code).toLowerCase() && (this.language_ = String(code).toLowerCase(), isEvented(this) && this.trigger("languagechange")); - }, _proto.languages = function() { + }, _proto.languages = function languages() { return mergeOptions$3(Player.prototype.options_.languages, this.languages_); - }, _proto.toJSON = function() { + }, _proto.toJSON = function toJSON() { var options = mergeOptions$3(this.options_), tracks = options.tracks; options.tracks = []; for(var i = 0; i < tracks.length; i++){ @@ -6063,14 +6063,14 @@ (track = mergeOptions$3(track)).player = void 0, options.tracks[i] = track; } return options; - }, _proto.createModal = function(content, options) { + }, _proto.createModal = function createModal(content, options) { var _this18 = this; (options = options || {}).content = content || ""; var modal = new ModalDialog(this, options); return this.addChild(modal), modal.on("dispose", function() { _this18.removeChild(modal); }), modal.open(), modal; - }, _proto.updateCurrentBreakpoint_ = function() { + }, _proto.updateCurrentBreakpoint_ = function updateCurrentBreakpoint_() { if (this.responsive()) for(var currentBreakpoint = this.currentBreakpoint(), currentWidth = this.currentWidth(), i = 0; i < BREAKPOINT_ORDER.length; i++){ var candidateBreakpoint = BREAKPOINT_ORDER[i]; if (currentWidth <= this.breakpoints_[candidateBreakpoint]) { @@ -6079,18 +6079,18 @@ break; } } - }, _proto.removeCurrentBreakpoint_ = function() { + }, _proto.removeCurrentBreakpoint_ = function removeCurrentBreakpoint_() { var className = this.currentBreakpointClass(); this.breakpoint_ = "", className && this.removeClass(className); - }, _proto.breakpoints = function(_breakpoints) { + }, _proto.breakpoints = function breakpoints(_breakpoints) { return void 0 === _breakpoints || (this.breakpoint_ = "", this.breakpoints_ = assign({}, DEFAULT_BREAKPOINTS, _breakpoints), this.updateCurrentBreakpoint_()), assign(this.breakpoints_); - }, _proto.responsive = function(value) { + }, _proto.responsive = function responsive(value) { return void 0 === value ? this.responsive_ : (value = !!value) !== this.responsive_ ? (this.responsive_ = value, value ? (this.on("playerresize", this.boundUpdateCurrentBreakpoint_), this.updateCurrentBreakpoint_()) : (this.off("playerresize", this.boundUpdateCurrentBreakpoint_), this.removeCurrentBreakpoint_()), value) : void 0; - }, _proto.currentBreakpoint = function() { + }, _proto.currentBreakpoint = function currentBreakpoint() { return this.breakpoint_; - }, _proto.currentBreakpointClass = function() { + }, _proto.currentBreakpointClass = function currentBreakpointClass() { return BREAKPOINT_CLASSES[this.breakpoint_] || ""; - }, _proto.loadMedia = function(media, ready) { + }, _proto.loadMedia = function loadMedia(media, ready) { var _this19 = this; if (media && "object" == typeof media) { this.reset(), this.cache_.media = mergeOptions$3(media); @@ -6104,7 +6104,7 @@ return _this19.addRemoteTextTrack(tt, !1); }), this.ready(ready); } - }, _proto.getMedia = function() { + }, _proto.getMedia = function getMedia() { if (!this.cache_.media) { var poster = this.poster(), media = { src: this.currentSources(), @@ -6125,7 +6125,7 @@ ]), media; } return mergeOptions$3(this.cache_.media); - }, Player.getTagSettings = function(tag) { + }, Player.getTagSettings = function getTagSettings(tag) { var baseOptions = { sources: [], tracks: [] @@ -6139,13 +6139,13 @@ "source" === childName ? baseOptions.sources.push(getAttributes(child)) : "track" === childName && baseOptions.tracks.push(getAttributes(child)); } return baseOptions; - }, _proto.flexNotSupported_ = function() { + }, _proto.flexNotSupported_ = function flexNotSupported_() { var elem = global_document__WEBPACK_IMPORTED_MODULE_1___default().createElement("i"); return !("flexBasis" in elem.style || "webkitFlexBasis" in elem.style || "mozFlexBasis" in elem.style || "msFlexBasis" in elem.style || "msFlexOrder" in elem.style); - }, _proto.debug = function(enabled) { + }, _proto.debug = function debug(enabled) { if (void 0 === enabled) return this.debugEnabled_; enabled ? (this.trigger("debugon"), this.previousLogLevel_ = this.log.level, this.log.level("debug"), this.debugEnabled_ = !0) : (this.trigger("debugoff"), this.log.level(this.previousLogLevel_), this.previousLogLevel_ = void 0, this.debugEnabled_ = !1); - }, _proto.playbackRates = function(newRates) { + }, _proto.playbackRates = function playbackRates(newRates) { if (void 0 === newRates) return this.cache_.playbackRates; Array.isArray(newRates) && newRates.every(function(rate) { return "number" == typeof rate; @@ -6250,34 +6250,34 @@ this.player = player, this.log || (this.log = this.player.log.createLogger(this.name)), evented(this), delete this.trigger, stateful(this, this.constructor.defaultState), markPluginAsActive(player, this.name), this.dispose = this.dispose.bind(this), player.on("dispose", this.dispose); } var _proto = Plugin.prototype; - return _proto.version = function() { + return _proto.version = function version() { return this.constructor.VERSION; - }, _proto.getEventHash = function(hash) { + }, _proto.getEventHash = function getEventHash(hash) { return void 0 === hash && (hash = {}), hash.name = this.name, hash.plugin = this.constructor, hash.instance = this, hash; - }, _proto.trigger = function(event, hash) { + }, _proto.trigger = function trigger$1(event, hash) { return void 0 === hash && (hash = {}), trigger(this.eventBusEl_, event, this.getEventHash(hash)); - }, _proto.handleStateChanged = function(e) {}, _proto.dispose = function() { + }, _proto.handleStateChanged = function handleStateChanged(e) {}, _proto.dispose = function dispose() { var name = this.name, player = this.player; this.trigger("dispose"), this.off(), player.off("dispose", this.dispose), player[PLUGIN_CACHE_KEY][name] = !1, this.player = this.state = null, player[name] = createPluginFactory(name, pluginStorage[name]); - }, Plugin.isBasic = function(plugin) { + }, Plugin.isBasic = function isBasic(plugin) { var p = "string" == typeof plugin ? getPlugin(plugin) : plugin; return "function" == typeof p && !Plugin.prototype.isPrototypeOf(p.prototype); - }, Plugin.registerPlugin = function(name, plugin) { + }, Plugin.registerPlugin = function registerPlugin(name, plugin) { if ("string" != typeof name) throw Error('Illegal plugin name, "' + name + '", must be a string, was ' + typeof name + "."); if (pluginExists(name)) log$1.warn('A plugin named "' + name + '" already exists. You may want to avoid re-registering plugins!'); else if (Player.prototype.hasOwnProperty(name)) throw Error('Illegal plugin name, "' + name + '", cannot share a name with an existing player method!'); if ("function" != typeof plugin) throw Error('Illegal plugin for "' + name + '", must be a function, was ' + typeof plugin + "."); return pluginStorage[name] = plugin, name !== BASE_PLUGIN_NAME && (Plugin.isBasic(plugin) ? Player.prototype[name] = createBasicPlugin(name, plugin) : Player.prototype[name] = createPluginFactory(name, plugin)), plugin; - }, Plugin.deregisterPlugin = function(name) { + }, Plugin.deregisterPlugin = function deregisterPlugin(name) { if (name === BASE_PLUGIN_NAME) throw Error("Cannot de-register base plugin."); pluginExists(name) && (delete pluginStorage[name], delete Player.prototype[name]); - }, Plugin.getPlugins = function(names) { + }, Plugin.getPlugins = function getPlugins(names) { var result; return void 0 === names && (names = Object.keys(pluginStorage)), names.forEach(function(name) { var plugin = getPlugin(name); plugin && ((result = result || {})[name] = plugin); }), result; - }, Plugin.getPluginVersion = function(name) { + }, Plugin.getPluginVersion = function getPluginVersion(name) { var plugin = getPlugin(name); return plugin && plugin.VERSION || ""; }, Plugin; @@ -6913,7 +6913,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(PlaylistLoader, _EventTarget); var _proto = PlaylistLoader.prototype; - return _proto.handleMediaupdatetimeout_ = function() { + return _proto.handleMediaupdatetimeout_ = function handleMediaupdatetimeout_() { var _this2 = this; if ("HAVE_METADATA" === this.state) { var media = this.media(), uri = resolveUrl(this.master.uri, media.uri); @@ -6931,7 +6931,7 @@ } }); } - }, _proto.playlistRequestError = function(xhr, playlist, startingState) { + }, _proto.playlistRequestError = function playlistRequestError(xhr, playlist, startingState) { var uri = playlist.uri, id = playlist.id; this.request = null, startingState && (this.state = startingState), this.error = { playlist: this.master.playlists[id], @@ -6940,14 +6940,14 @@ responseText: xhr.responseText, code: xhr.status >= 500 ? 4 : 2 }, this.trigger("error"); - }, _proto.parseManifest_ = function(_ref) { + }, _proto.parseManifest_ = function parseManifest_(_ref) { var _this3 = this, url = _ref.url; return parseManifest({ - onwarn: function(_ref2) { + onwarn: function onwarn(_ref2) { var message = _ref2.message; return _this3.logger_("m3u8-parser warn for " + url + ": " + message); }, - oninfo: function(_ref3) { + oninfo: function oninfo(_ref3) { var message = _ref3.message; return _this3.logger_("m3u8-parser info for " + url + ": " + message); }, @@ -6956,7 +6956,7 @@ customTagMappers: this.customTagMappers, experimentalLLHLS: this.experimentalLLHLS }); - }, _proto.haveMetadata = function(_ref4) { + }, _proto.haveMetadata = function haveMetadata(_ref4) { var playlistString = _ref4.playlistString, playlistObject = _ref4.playlistObject, url = _ref4.url, id = _ref4.id; this.request = null, this.state = "HAVE_METADATA"; var playlist = playlistObject || this.parseManifest_({ @@ -6970,14 +6970,14 @@ }); var update = updateMaster$1(this.master, playlist); this.targetDuration = playlist.partTargetDuration || playlist.targetDuration, this.pendingMedia_ = null, update ? (this.master = update, this.media_ = this.master.playlists[id]) : this.trigger("playlistunchanged"), this.updateMediaUpdateTimeout_(refreshDelay(this.media(), !!update)), this.trigger("loadedplaylist"); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.trigger("dispose"), this.stopRequest(), global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.mediaUpdateTimeout), global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.finalRenditionTimeout), this.off(); - }, _proto.stopRequest = function() { + }, _proto.stopRequest = function stopRequest() { if (this.request) { var oldRequest = this.request; this.request = null, oldRequest.onreadystatechange = null, oldRequest.abort(); } - }, _proto.media = function(playlist, shouldDelay) { + }, _proto.media = function media(playlist, shouldDelay) { var _this4 = this; if (!playlist) return this.media_; if ("HAVE_NOTHING" === this.state) throw Error("Cannot switch media playlist from " + this.state); @@ -7014,9 +7014,9 @@ } }); } - }, _proto.pause = function() { + }, _proto.pause = function pause() { this.mediaUpdateTimeout && (global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.mediaUpdateTimeout), this.mediaUpdateTimeout = null), this.stopRequest(), "HAVE_NOTHING" === this.state && (this.started = !1), "SWITCHING_MEDIA" === this.state ? this.media_ ? this.state = "HAVE_METADATA" : this.state = "HAVE_MASTER" : "HAVE_CURRENT_METADATA" === this.state && (this.state = "HAVE_METADATA"); - }, _proto.load = function(shouldDelay) { + }, _proto.load = function load(shouldDelay) { var _this5 = this; this.mediaUpdateTimeout && (global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.mediaUpdateTimeout), this.mediaUpdateTimeout = null); var media = this.media(); @@ -7032,12 +7032,12 @@ return; } media && !media.endList ? this.trigger("mediaupdatetimeout") : this.trigger("loadedplaylist"); - }, _proto.updateMediaUpdateTimeout_ = function(delay) { + }, _proto.updateMediaUpdateTimeout_ = function updateMediaUpdateTimeout_(delay) { var _this6 = this; this.mediaUpdateTimeout && (global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.mediaUpdateTimeout), this.mediaUpdateTimeout = null), this.media() && !this.media().endList && (this.mediaUpdateTimeout = global_window__WEBPACK_IMPORTED_MODULE_0___default().setTimeout(function() { _this6.mediaUpdateTimeout = null, _this6.trigger("mediaupdatetimeout"), _this6.updateMediaUpdateTimeout_(delay); }, delay)); - }, _proto.start = function() { + }, _proto.start = function start() { var _this7 = this; if (this.started = !0, "object" == typeof this.src) { this.src.uri || (this.src.uri = global_window__WEBPACK_IMPORTED_MODULE_0___default().location.href), this.src.resolvedUri = this.src.uri, setTimeout(function() { @@ -7064,9 +7064,9 @@ _this7.setupInitialPlaylist(manifest); } }); - }, _proto.srcUri = function() { + }, _proto.srcUri = function srcUri() { return "string" == typeof this.src ? this.src : this.src.uri; - }, _proto.setupInitialPlaylist = function(manifest) { + }, _proto.setupInitialPlaylist = function setupInitialPlaylist(manifest) { if (this.state = "HAVE_MASTER", manifest.playlists) { this.master = manifest, addPropertiesToMaster(this.master, this.srcUri()), manifest.playlists.forEach(function(playlist) { playlist.segments = getAllSegments(playlist), playlist.segments.forEach(function(segment) { @@ -7268,7 +7268,7 @@ } }, request = xhr({ uri: uri, - beforeSend: function(request) { + beforeSend: function beforeSend(request) { request.overrideMimeType("text/plain; charset=x-user-defined"), request.addEventListener("progress", function(_ref) { return _ref.total, _ref.loaded, callbackWrapper(request, null, { statusCode: request.status @@ -7349,14 +7349,14 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(DashPlaylistLoader, _EventTarget); var _proto = DashPlaylistLoader.prototype; - return _proto.requestErrored_ = function(err, request, startingState) { + return _proto.requestErrored_ = function requestErrored_(err, request, startingState) { return !this.request || ((this.request = null, err) ? (this.error = "object" != typeof err || err instanceof Error ? { status: request.status, message: "DASH request error at URL: " + request.uri, response: request.response, code: 2 } : err, startingState && (this.state = startingState), this.trigger("error"), !0) : void 0); - }, _proto.addSidxSegments_ = function(playlist, startingState, cb) { + }, _proto.addSidxSegments_ = function addSidxSegments_(playlist, startingState, cb) { var _this2 = this, sidxKey = playlist.sidx && (0, mpd_parser__WEBPACK_IMPORTED_MODULE_9__.mm)(playlist.sidx); if (!playlist.sidx || !sidxKey || this.masterPlaylistLoader_.sidxMapping_[sidxKey]) { this.mediaRequest_ = global_window__WEBPACK_IMPORTED_MODULE_0___default().setTimeout(function() { @@ -7404,16 +7404,16 @@ }) }, fin); }); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.trigger("dispose"), this.stopRequest(), this.loadedPlaylists_ = {}, global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.minimumUpdatePeriodTimeout_), global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.mediaRequest_), global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.mediaUpdateTimeout), this.mediaUpdateTimeout = null, this.mediaRequest_ = null, this.minimumUpdatePeriodTimeout_ = null, this.masterPlaylistLoader_.createMupOnMedia_ && (this.off("loadedmetadata", this.masterPlaylistLoader_.createMupOnMedia_), this.masterPlaylistLoader_.createMupOnMedia_ = null), this.off(); - }, _proto.hasPendingRequest = function() { + }, _proto.hasPendingRequest = function hasPendingRequest() { return this.request || this.mediaRequest_; - }, _proto.stopRequest = function() { + }, _proto.stopRequest = function stopRequest() { if (this.request) { var oldRequest = this.request; this.request = null, oldRequest.onreadystatechange = null, oldRequest.abort(); } - }, _proto.media = function(playlist) { + }, _proto.media = function media(playlist) { var _this3 = this; if (!playlist) return this.media_; if ("HAVE_NOTHING" === this.state) throw Error("Cannot switch media playlist from " + this.state); @@ -7433,12 +7433,12 @@ playlist: playlist }); })); - }, _proto.haveMetadata = function(_ref2) { + }, _proto.haveMetadata = function haveMetadata(_ref2) { var startingState = _ref2.startingState, playlist = _ref2.playlist; this.state = "HAVE_METADATA", this.loadedPlaylists_[playlist.id] = playlist, this.mediaRequest_ = null, this.refreshMedia_(playlist.id), "HAVE_MASTER" === startingState ? this.trigger("loadedmetadata") : this.trigger("mediachange"); - }, _proto.pause = function() { + }, _proto.pause = function pause() { this.masterPlaylistLoader_.createMupOnMedia_ && (this.off("loadedmetadata", this.masterPlaylistLoader_.createMupOnMedia_), this.masterPlaylistLoader_.createMupOnMedia_ = null), this.stopRequest(), global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.mediaUpdateTimeout), this.mediaUpdateTimeout = null, this.isMaster_ && (global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_), this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_ = null), "HAVE_NOTHING" === this.state && (this.started = !1); - }, _proto.load = function(isFinalRendition) { + }, _proto.load = function load(isFinalRendition) { var _this4 = this; global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.mediaUpdateTimeout), this.mediaUpdateTimeout = null; var media = this.media(); @@ -7454,7 +7454,7 @@ return; } media && !media.endList ? (this.isMaster_ && !this.minimumUpdatePeriodTimeout_ && (this.trigger("minimumUpdatePeriod"), this.updateMinimumUpdatePeriodTimeout_()), this.trigger("mediaupdatetimeout")) : this.trigger("loadedplaylist"); - }, _proto.start = function() { + }, _proto.start = function start() { var _this5 = this; if (this.started = !0, !this.isMaster_) { this.mediaRequest_ = global_window__WEBPACK_IMPORTED_MODULE_0___default().setTimeout(function() { @@ -7465,7 +7465,7 @@ this.requestMaster_(function(req, masterChanged) { _this5.haveMaster_(), _this5.hasPendingRequest() || _this5.media_ || _this5.media(_this5.masterPlaylistLoader_.master.playlists[0]); }); - }, _proto.requestMaster_ = function(cb) { + }, _proto.requestMaster_ = function requestMaster_(cb) { var _this6 = this; this.request = this.vhs_.xhr({ uri: this.masterPlaylistLoader_.srcUrl, @@ -7484,7 +7484,7 @@ } return cb(req, masterChanged); }); - }, _proto.syncClientServerClock_ = function(done) { + }, _proto.syncClientServerClock_ = function syncClientServerClock_(done) { var _this7 = this, utcTiming = (0, mpd_parser__WEBPACK_IMPORTED_MODULE_9__.LG)(this.masterPlaylistLoader_.masterXml_); return null === utcTiming ? (this.masterPlaylistLoader_.clientOffset_ = this.masterLoaded_ - Date.now(), done()) : "DIRECT" === utcTiming.method ? (this.masterPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now(), done()) : void (this.request = this.vhs_.xhr({ uri: resolveUrl(this.masterPlaylistLoader_.srcUrl, utcTiming.value), @@ -7497,9 +7497,9 @@ serverTime = "HEAD" === utcTiming.method ? req.responseHeaders && req.responseHeaders.date ? Date.parse(req.responseHeaders.date) : _this7.masterLoaded_ : Date.parse(req.responseText), _this7.masterPlaylistLoader_.clientOffset_ = serverTime - Date.now(), done(); } })); - }, _proto.haveMaster_ = function() { + }, _proto.haveMaster_ = function haveMaster_() { this.state = "HAVE_MASTER", this.isMaster_ ? this.trigger("loadedplaylist") : this.media_ || this.media(this.childPlaylist_); - }, _proto.handleMaster_ = function() { + }, _proto.handleMaster_ = function handleMaster_() { this.mediaRequest_ = null; var newMaster = parseMasterXml({ masterXml: this.masterPlaylistLoader_.masterXml_, @@ -7510,7 +7510,7 @@ oldMaster && (newMaster = updateMaster(oldMaster, newMaster, this.masterPlaylistLoader_.sidxMapping_)), this.masterPlaylistLoader_.master = newMaster || oldMaster; var location = this.masterPlaylistLoader_.master.locations && this.masterPlaylistLoader_.master.locations[0]; return location && location !== this.masterPlaylistLoader_.srcUrl && (this.masterPlaylistLoader_.srcUrl = location), (!oldMaster || newMaster && newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) && this.updateMinimumUpdatePeriodTimeout_(), !!newMaster; - }, _proto.updateMinimumUpdatePeriodTimeout_ = function() { + }, _proto.updateMinimumUpdatePeriodTimeout_ = function updateMinimumUpdatePeriodTimeout_() { var mpl = this.masterPlaylistLoader_; mpl.createMupOnMedia_ && (mpl.off("loadedmetadata", mpl.createMupOnMedia_), mpl.createMupOnMedia_ = null), mpl.minimumUpdatePeriodTimeout_ && (global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(mpl.minimumUpdatePeriodTimeout_), mpl.minimumUpdatePeriodTimeout_ = null); var mup = mpl.master && mpl.master.minimumUpdatePeriod; @@ -7519,19 +7519,19 @@ return; } this.createMUPTimeout_(mup); - }, _proto.createMUPTimeout_ = function(mup) { + }, _proto.createMUPTimeout_ = function createMUPTimeout_(mup) { var mpl = this.masterPlaylistLoader_; mpl.minimumUpdatePeriodTimeout_ = global_window__WEBPACK_IMPORTED_MODULE_0___default().setTimeout(function() { mpl.minimumUpdatePeriodTimeout_ = null, mpl.trigger("minimumUpdatePeriod"), mpl.createMUPTimeout_(mup); }, mup); - }, _proto.refreshXml_ = function() { + }, _proto.refreshXml_ = function refreshXml_() { var _this8 = this; this.requestMaster_(function(req, masterChanged) { masterChanged && (_this8.media_ && (_this8.media_ = _this8.masterPlaylistLoader_.master.playlists[_this8.media_.id]), _this8.masterPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings(_this8.masterPlaylistLoader_.master, _this8.masterPlaylistLoader_.sidxMapping_), _this8.addSidxSegments_(_this8.media(), _this8.state, function(sidxChanged) { _this8.refreshMedia_(_this8.media().id); })); }); - }, _proto.refreshMedia_ = function(mediaID) { + }, _proto.refreshMedia_ = function refreshMedia_(mediaID) { var _this9 = this; if (!mediaID) throw Error("refreshMedia_ must take a media id"); this.media_ && this.isMaster_ && this.handleMaster_(); @@ -7835,15 +7835,15 @@ 0x00 ]); } - }(), box = function(type) { + }(), box = function box(type) { var i, result, payload = [], size = 0; for(i = 1; i < arguments.length; i++)payload.push(arguments[i]); for(i = payload.length; i--;)size += payload[i].byteLength; for(result = new Uint8Array(size + 8), new DataView(result.buffer, result.byteOffset, result.byteLength).setUint32(0, result.byteLength), result.set(type, 4), i = 0, size = 8; i < payload.length; i++)result.set(payload[i], size), size += payload[i].byteLength; return result; - }, ftyp = function() { + }, ftyp = function ftyp() { return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND); - }, mdhd = function(track) { + }, mdhd = function mdhd(track) { var result = new Uint8Array([ 0x00, 0x00, @@ -7871,23 +7871,23 @@ 0x00 ]); return track.samplerate && (result[12] = track.samplerate >>> 24 & 0xff, result[13] = track.samplerate >>> 16 & 0xff, result[14] = track.samplerate >>> 8 & 0xff, result[15] = 0xff & track.samplerate), box(types.mdhd, result); - }, mdia = function(track) { + }, mdia = function mdia(track) { var type; return box(types.mdia, mdhd(track), (type = track.type, box(types.hdlr, HDLR_TYPES[type])), minf(track)); - }, minf = function(track) { + }, minf = function minf(track) { return box(types.minf, "video" === track.type ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), box(types.dinf, box(types.dref, DREF)), stbl(track)); - }, moov = function(tracks) { + }, moov = function moov(tracks) { for(var i = tracks.length, boxes = []; i--;)boxes[i] = trak(tracks[i]); return box.apply(null, [ types.moov, mvhd(0xffffffff) ].concat(boxes).concat(mvex(tracks))); - }, mvex = function(tracks) { + }, mvex = function mvex(tracks) { for(var i = tracks.length, boxes = []; i--;)boxes[i] = trex(tracks[i]); return box.apply(null, [ types.mvex ].concat(boxes)); - }, mvhd = function(duration) { + }, mvhd = function mvhd(duration) { var bytes = new Uint8Array([ 0x00, 0x00, @@ -7991,13 +7991,13 @@ 0xff ]); return box(types.mvhd, bytes); - }, sdtp = function(track) { + }, sdtp = function sdtp(track) { var flags, i, samples = track.samples || [], bytes = new Uint8Array(4 + samples.length); for(i = 0; i < samples.length; i++)flags = samples[i].flags, bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy; return box(types.sdtp, bytes); - }, stbl = function(track) { + }, stbl = function stbl(track) { return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO)); - }, stsd = function(track) { + }, stsd = function stsd(track) { return box(types.stsd, new Uint8Array([ 0x00, 0x00, @@ -8008,7 +8008,7 @@ 0x00, 0x01 ]), "video" === track.type ? videoSample(track) : audioSample(track)); - }, videoSample = function(track) { + }, videoSample = function videoSample(track) { var i, avc1Box, sps = track.sps || [], pps = track.pps || [], sequenceParameterSets = [], pictureParameterSets = []; for(i = 0; i < sps.length; i++)sequenceParameterSets.push((0xff00 & sps[i].byteLength) >>> 8), sequenceParameterSets.push(0xff & sps[i].byteLength), sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); for(i = 0; i < pps.length; i++)pictureParameterSets.push((0xff00 & pps[i].byteLength) >>> 8), pictureParameterSets.push(0xff & pps[i].byteLength), pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i])); @@ -8133,7 +8133,7 @@ ]))); } return box.apply(null, avc1Box); - }, audioSample = function(track) { + }, audioSample = function audioSample(track) { return box(types.mp4a, new Uint8Array([ 0x00, 0x00, @@ -8196,7 +8196,7 @@ 0x01, 0x02 ]))); - }, tkhd = function(track) { + }, tkhd = function tkhd(track) { var result = new Uint8Array([ 0x00, 0x00, @@ -8284,7 +8284,7 @@ 0x00 ]); return box(types.tkhd, result); - }, traf = function(track) { + }, traf = function traf(track) { var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime; return (trackFragmentHeader = box(types.tfhd, new Uint8Array([ 0x00, @@ -8325,9 +8325,9 @@ lowerWordBaseMediaDecodeTime >>> 8 & 0xff, 0xff & lowerWordBaseMediaDecodeTime ])), "audio" === track.type) ? (trackFragmentRun = trun$1(track, 92), box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun)) : (sampleDependencyTable = sdtp(track), trackFragmentRun = trun$1(track, sampleDependencyTable.length + 92), box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable)); - }, trak = function(track) { + }, trak = function trak(track) { return track.duration = track.duration || 0xffffffff, box(types.trak, tkhd(track), mdia(track)); - }, trex = function(track) { + }, trex = function trex(track) { var result = new Uint8Array([ 0x00, 0x00, @@ -8355,7 +8355,7 @@ 0x01 ]); return "video" !== track.type && (result[result.length - 1] = 0x00), box(types.trex, result); - }, trunHeader = function(samples, offset) { + }, trunHeader = function trunHeader(samples, offset) { var durationPresent = 0, sizePresent = 0, flagsPresent = 0, compositionTimeOffset = 0; return samples.length && (void 0 !== samples[0].duration && (durationPresent = 0x1), void 0 !== samples[0].size && (sizePresent = 0x2), void 0 !== samples[0].flags && (flagsPresent = 0x4), void 0 !== samples[0].compositionTimeOffset && (compositionTimeOffset = 0x8)), [ 0x00, @@ -8371,23 +8371,23 @@ (0xff00 & offset) >>> 8, 0xff & offset ]; - }, videoTrun = function(track, offset) { + }, videoTrun = function videoTrun(track, offset) { var bytesOffest, bytes, header, samples, sample, i; for(offset += 20 + 16 * (samples = track.samples || []).length, header = trunHeader(samples, offset), (bytes = new Uint8Array(header.length + 16 * samples.length)).set(header), bytesOffest = header.length, i = 0; i < samples.length; i++)sample = samples[i], bytes[bytesOffest++] = (0xff000000 & sample.duration) >>> 24, bytes[bytesOffest++] = (0xff0000 & sample.duration) >>> 16, bytes[bytesOffest++] = (0xff00 & sample.duration) >>> 8, bytes[bytesOffest++] = 0xff & sample.duration, bytes[bytesOffest++] = (0xff000000 & sample.size) >>> 24, bytes[bytesOffest++] = (0xff0000 & sample.size) >>> 16, bytes[bytesOffest++] = (0xff00 & sample.size) >>> 8, bytes[bytesOffest++] = 0xff & sample.size, bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn, bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample, bytes[bytesOffest++] = 61440 & sample.flags.degradationPriority, bytes[bytesOffest++] = 0x0f & sample.flags.degradationPriority, bytes[bytesOffest++] = (0xff000000 & sample.compositionTimeOffset) >>> 24, bytes[bytesOffest++] = (0xff0000 & sample.compositionTimeOffset) >>> 16, bytes[bytesOffest++] = (0xff00 & sample.compositionTimeOffset) >>> 8, bytes[bytesOffest++] = 0xff & sample.compositionTimeOffset; return box(types.trun, bytes); - }, audioTrun = function(track, offset) { + }, audioTrun = function audioTrun(track, offset) { var bytes, bytesOffest, header, samples, sample, i; for(offset += 20 + 8 * (samples = track.samples || []).length, header = trunHeader(samples, offset), (bytes = new Uint8Array(header.length + 8 * samples.length)).set(header), bytesOffest = header.length, i = 0; i < samples.length; i++)sample = samples[i], bytes[bytesOffest++] = (0xff000000 & sample.duration) >>> 24, bytes[bytesOffest++] = (0xff0000 & sample.duration) >>> 16, bytes[bytesOffest++] = (0xff00 & sample.duration) >>> 8, bytes[bytesOffest++] = 0xff & sample.duration, bytes[bytesOffest++] = (0xff000000 & sample.size) >>> 24, bytes[bytesOffest++] = (0xff0000 & sample.size) >>> 16, bytes[bytesOffest++] = (0xff00 & sample.size) >>> 8, bytes[bytesOffest++] = 0xff & sample.size; return box(types.trun, bytes); - }, trun$1 = function(track, offset) { + }, trun$1 = function trun(track, offset) { return "audio" === track.type ? audioTrun(track, offset) : videoTrun(track, offset); }; var mp4Generator = { ftyp: ftyp, - mdat: function(data) { + mdat: function mdat(data) { return box(types.mdat, data); }, - moof: function(sequenceNumber, tracks) { + moof: function moof(sequenceNumber, tracks) { for(var trackFragments = [], i = tracks.length; i--;)trackFragments[i] = traf(tracks[i]); return box.apply(null, [ types.moof, @@ -8404,7 +8404,7 @@ ].concat(trackFragments)); }, moov: moov, - initSegment: function(tracks) { + initSegment: function initSegment(tracks) { var result, fileType = ftyp(), movie = moov(tracks); return (result = new Uint8Array(fileType.byteLength + movie.byteLength)).set(fileType), result.set(movie, fileType.byteLength), result; } @@ -8711,25 +8711,25 @@ return silence; }, clock = { ONE_SECOND_IN_TS: 90000, - secondsToVideoTs: secondsToVideoTs = function(seconds) { + secondsToVideoTs: secondsToVideoTs = function secondsToVideoTs(seconds) { return 90000 * seconds; }, - secondsToAudioTs: secondsToAudioTs = function(seconds, sampleRate) { + secondsToAudioTs: secondsToAudioTs = function secondsToAudioTs(seconds, sampleRate) { return seconds * sampleRate; }, - videoTsToSeconds: videoTsToSeconds = function(timestamp) { + videoTsToSeconds: videoTsToSeconds = function videoTsToSeconds(timestamp) { return timestamp / 90000; }, - audioTsToSeconds: audioTsToSeconds = function(timestamp, sampleRate) { + audioTsToSeconds: audioTsToSeconds = function audioTsToSeconds(timestamp, sampleRate) { return timestamp / sampleRate; }, - audioTsToVideoTs: function(timestamp, sampleRate) { + audioTsToVideoTs: function audioTsToVideoTs(timestamp, sampleRate) { return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate)); }, - videoTsToAudioTs: function(timestamp, sampleRate) { + videoTsToAudioTs: function videoTsToAudioTs(timestamp, sampleRate) { return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate); }, - metadataTsToSeconds: function(timestamp, timelineStartPts, keepOriginalTimestamps) { + metadataTsToSeconds: function metadataTsToSeconds(timestamp, timelineStartPts, keepOriginalTimestamps) { return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts); } }, sumFrameByteLengths = function(array) { @@ -9320,7 +9320,7 @@ }, parseSyncSafeInteger$1 = function(data) { return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3]; }, tagParsers = { - TXXX: function(tag) { + TXXX: function TXXX(tag) { var i; if (3 === tag.data[0]) { for(i = 1; i < tag.data.length; i++)if (0 === tag.data[i]) { @@ -9330,7 +9330,7 @@ tag.data = tag.value; } }, - WXXX: function(tag) { + WXXX: function WXXX(tag) { var i; if (3 === tag.data[0]) { for(i = 1; i < tag.data.length; i++)if (0 === tag.data[i]) { @@ -9339,7 +9339,7 @@ } } }, - PRIV: function(tag) { + PRIV: function PRIV(tag) { var i; for(i = 0; i < tag.data.length; i++)if (0 === tag.data[i]) { tag.owner = unescape(percentEncode$1(tag.data, 0, i)); @@ -9348,7 +9348,7 @@ tag.privateData = tag.data.subarray(i + 1), tag.data = tag.privateData; } }; - (_MetadataStream = function(options) { + (_MetadataStream = function MetadataStream(options) { var i, settings = { descriptor: options && options.descriptor }, tagSize = 0, buffer = [], bufferSize = 0; @@ -9394,7 +9394,7 @@ }; }).prototype = new Stream(); var TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream; - (_TransportPacketStream = function() { + (_TransportPacketStream = function TransportPacketStream() { var buffer = new Uint8Array(188), bytesInBuffer = 0; _TransportPacketStream.prototype.init.call(this), this.push = function(bytes) { var everything, startIndex = 0, endIndex = 188; @@ -9413,14 +9413,14 @@ }, this.reset = function() { bytesInBuffer = 0, this.trigger("reset"); }; - }).prototype = new Stream(), (_TransportParseStream = function() { + }).prototype = new Stream(), (_TransportParseStream = function TransportParseStream() { var parsePsi, parsePat, parsePmt, self1; - _TransportParseStream.prototype.init.call(this), self1 = this, this.packetsWaitingForPmt = [], this.programMapTable = void 0, parsePsi = function(payload, psi) { + _TransportParseStream.prototype.init.call(this), self1 = this, this.packetsWaitingForPmt = [], this.programMapTable = void 0, parsePsi = function parsePsi(payload, psi) { var offset = 0; psi.payloadUnitStartIndicator && (offset += payload[offset] + 1), "pat" === psi.type ? parsePat(payload.subarray(offset), psi) : parsePmt(payload.subarray(offset), psi); - }, parsePat = function(payload, pat) { + }, parsePat = function parsePat(payload, pat) { pat.section_number = payload[7], pat.last_section_number = payload[8], self1.pmtPid = (0x1f & payload[10]) << 8 | payload[11], pat.pmtPid = self1.pmtPid; - }, parsePmt = function(payload, pmt) { + }, parsePmt = function parsePmt(payload, pmt) { var tableEnd, offset; if (0x01 & payload[5]) { for(self1.programMapTable = { @@ -9448,7 +9448,7 @@ }).prototype = new Stream(), _TransportParseStream.STREAM_TYPES = { h264: 0x1b, adts: 0x0f - }, (_ElementaryStream = function() { + }, (_ElementaryStream = function ElementaryStream() { var programMapTable, self1 = this, segmentHadPmt = !1, video = { data: [], size: 0 @@ -9472,8 +9472,8 @@ }; _ElementaryStream.prototype.init.call(this), this.push = function(data) { ({ - pat: function() {}, - pes: function() { + pat: function pat() {}, + pes: function pes() { var stream, streamType; switch(data.streamType){ case streamTypes.H264_STREAM_TYPE: @@ -9490,7 +9490,7 @@ } data.payloadUnitStartIndicator && flushStream(stream, streamType, !0), stream.data.push(data), stream.size += data.data.byteLength; }, - pmt: function() { + pmt: function pmt() { var event = { type: "metadata", tracks: [] @@ -9569,7 +9569,7 @@ 8000, 7350 ]; - (_AdtsStream = function(handlePartialSegments) { + (_AdtsStream = function AdtsStream(handlePartialSegments) { var buffer, frameNum = 0; _AdtsStream.prototype.init.call(this), this.skipWarn_ = function(start, end) { this.trigger("log", { @@ -9643,7 +9643,7 @@ return this.readBits(8); }, this.loadWord(); }; - (_NalByteStream = function() { + (_NalByteStream = function NalByteStream() { var i, buffer, syncPoint = 0; _NalByteStream.prototype.init.call(this), this.push = function(data) { buffer ? ((swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength)).set(buffer), swapBuffer.set(data.data, buffer.byteLength), buffer = swapBuffer) : buffer = data.data; @@ -9697,7 +9697,7 @@ 138: !0, 139: !0, 134: !0 - }, (_H264Stream = function() { + }, (_H264Stream = function H264Stream() { var self1, trackId, currentPts, currentDts, discardEmulationPreventionBytes, readSequenceParameterSet, skipScalingList, nalByteStream = new _NalByteStream(); _H264Stream.prototype.init.call(this), self1 = this, this.push = function(packet) { "video" === packet.type && (trackId = packet.trackId, currentPts = packet.pts, currentDts = packet.dts, nalByteStream.push(packet)); @@ -9742,17 +9742,17 @@ nalByteStream.reset(); }, this.endTimeline = function() { nalByteStream.endTimeline(); - }, skipScalingList = function(count, expGolombDecoder) { + }, skipScalingList = function skipScalingList(count, expGolombDecoder) { var j, lastScale = 8, nextScale = 8; for(j = 0; j < count; j++)0 !== nextScale && (nextScale = (lastScale + expGolombDecoder.readExpGolomb() + 256) % 256), lastScale = 0 === nextScale ? lastScale : nextScale; - }, discardEmulationPreventionBytes = function(data) { + }, discardEmulationPreventionBytes = function discardEmulationPreventionBytes(data) { for(var newLength, newData, length = data.byteLength, emulationPreventionBytesPositions = [], i = 1; i < length - 2;)0 === data[i] && 0 === data[i + 1] && 0x03 === data[i + 2] ? (emulationPreventionBytesPositions.push(i + 2), i += 2) : i++; if (0 === emulationPreventionBytesPositions.length) return data; newLength = length - emulationPreventionBytesPositions.length, newData = new Uint8Array(newLength); var sourceIndex = 0; for(i = 0; i < newLength; sourceIndex++, i++)sourceIndex === emulationPreventionBytesPositions[0] && (sourceIndex++, emulationPreventionBytesPositions.shift()), newData[i] = data[sourceIndex]; return newData; - }, readSequenceParameterSet = function(data) { + }, readSequenceParameterSet = function readSequenceParameterSet(data) { var expGolombDecoder, profileIdc, levelIdc, profileCompatibility, chromaFormatIdc, picOrderCntType, numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1, picHeightInMapUnitsMinus1, frameMbsOnlyFlag, scalingListCount, i, frameCropLeftOffset = 0, frameCropRightOffset = 0, frameCropTopOffset = 0, frameCropBottomOffset = 0, sarRatio = [ 1, 1 @@ -9944,7 +9944,7 @@ return null; } }; - (_AacStream = function() { + (_AacStream = function AacStream() { var everything = new Uint8Array(), timeStamp = 0; _AacStream.prototype.init.call(this), this.setTimestamp = function(timestamp) { timeStamp = timestamp; @@ -10017,7 +10017,7 @@ baseMediaDecodeTime: baseMediaDecodeTime }; }; - (_AudioSegmentStream = function(track, options) { + (_AudioSegmentStream = function AudioSegmentStream(track, options) { var sequenceNumber, adtsFrames = [], earliestAllowedDts = 0, audioAppendStartTs = 0, videoBaseMediaDecodeTime = 1 / 0; sequenceNumber = (options = options || {}).firstSequenceNumber || 0, _AudioSegmentStream.prototype.init.call(this), this.push = function(data) { trackDecodeInfo.collectDtsInfo(track, data), track && audioProperties.forEach(function(prop) { @@ -10047,7 +10047,7 @@ }, this.reset = function() { trackDecodeInfo.clearDtsInfo(track), adtsFrames = [], this.trigger("reset"); }; - }).prototype = new Stream(), (_VideoSegmentStream = function(track, options) { + }).prototype = new Stream(), (_VideoSegmentStream = function VideoSegmentStream(track, options) { var sequenceNumber, config, pps, nalUnits = [], gopsToAlignWith = []; sequenceNumber = (options = options || {}).firstSequenceNumber || 0, _VideoSegmentStream.prototype.init.call(this), delete track.minPTS, this.gopCache_ = [], this.push = function(nalUnit) { trackDecodeInfo.collectDtsInfo(track, nalUnit), "seq_parameter_set_rbsp" !== nalUnit.nalUnitType || config || (config = nalUnit.config, track.sps = [ @@ -10136,7 +10136,7 @@ }, this.alignGopsWith = function(newGopsToAlignWith) { gopsToAlignWith = newGopsToAlignWith; }; - }).prototype = new Stream(), (_CoalesceStream = function(options, metadataStream) { + }).prototype = new Stream(), (_CoalesceStream = function CoalesceStream(options, metadataStream) { this.numberOfTracks = 0, this.metadataStream = metadataStream, void 0 !== (options = options || {}).remux ? this.remuxTracks = !!options.remux : this.remuxTracks = !0, "boolean" == typeof options.keepOriginalTimestamps ? this.keepOriginalTimestamps = options.keepOriginalTimestamps : this.keepOriginalTimestamps = !1, this.pendingTracks = [], this.videoTrack = null, this.pendingBoxes = [], this.pendingCaptions = [], this.pendingMetadata = [], this.pendingBytes = 0, this.emittedTracks = 0, _CoalesceStream.prototype.init.call(this), this.push = function(output) { return output.text ? this.pendingCaptions.push(output) : output.frames ? this.pendingMetadata.push(output) : void (this.pendingTracks.push(output.track), this.pendingBytes += output.boxes.byteLength, "video" === output.track.type && (this.videoTrack = output.track, this.pendingBoxes.push(output.boxes)), "audio" === output.track.type && (this.audioTrack = output.track, this.pendingBoxes.unshift(output.boxes))); }; @@ -10168,7 +10168,7 @@ this.emittedTracks >= this.numberOfTracks && (this.trigger("done"), this.emittedTracks = 0); }, _CoalesceStream.prototype.setRemux = function(val) { this.remuxTracks = val; - }, (_Transmuxer = function(options) { + }, (_Transmuxer = function Transmuxer(options) { var videoTrack, audioTrack, self1 = this, hasFlushed = !0; _Transmuxer.prototype.init.call(this), options = options || {}, this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0, this.transmuxPipeline_ = {}, this.setupAacPipeline = function() { var pipeline = {}; @@ -10411,7 +10411,7 @@ }, toUnsigned = bin.toUnsigned, toHexString = bin.toHexString, probe$2 = { findBox: findBox_1, parseType: parseType_1, - timescale: function(init) { + timescale: function timescale(init) { return findBox_1(init, [ "moov", "trak" @@ -10425,7 +10425,7 @@ ])[0]) ? (index = 0 === mdhd[0] ? 12 : 20, result[id] = toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]), result) : null; }, {}); }, - startTime: function(timescale, fragment) { + startTime: function startTime(timescale, fragment) { var trafs, baseTimes, result; return trafs = findBox_1(fragment, [ "moof", @@ -10444,7 +10444,7 @@ }); })), isFinite(result = Math.min.apply(null, baseTimes)) ? result : 0; }, - compositionStartTime: function(timescales, fragment) { + compositionStartTime: function compositionStartTime(timescales, fragment) { var trackId, trafBoxes = findBox_1(fragment, [ "moof", "traf" @@ -10464,7 +10464,7 @@ } return (baseMediaDecodeTime + compositionTimeOffset) / (timescales[trackId] || 90e3); }, - videoTrackIds: function(init) { + videoTrackIds: function getVideoTrackIds(init) { var traks = findBox_1(init, [ "moov", "trak" @@ -10482,7 +10482,7 @@ }); }), videoTrackIds; }, - tracks: function(init) { + tracks: function getTracks(init) { var traks = findBox_1(init, [ "moov", "trak" @@ -10521,7 +10521,7 @@ mdhd && (track.timescale = getTimescaleFromMediaHeader(mdhd)), tracks.push(track); }), tracks; }, - getTimescaleFromMediaHeader: getTimescaleFromMediaHeader = function(mdhd) { + getTimescaleFromMediaHeader: getTimescaleFromMediaHeader = function getTimescaleFromMediaHeader(mdhd) { var index = 0 === mdhd[0] ? 12 : 20; return toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]); } @@ -10861,9 +10861,9 @@ this.options = options || {}, this.self = self1, this.init(); } var _proto = MessageHandlers.prototype; - return _proto.init = function() { + return _proto.init = function init() { this.transmuxer && this.transmuxer.dispose(), this.transmuxer = new transmuxer.Transmuxer(this.options), wireTransmuxerEvents(this.self, this.transmuxer); - }, _proto.pushMp4Captions = function(data) { + }, _proto.pushMp4Captions = function pushMp4Captions(data) { this.captionParser || (this.captionParser = new captionParser(), this.captionParser.init()); var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength), parsed = this.captionParser.parse(segment, data.trackIds, data.timescales); this.self.postMessage({ @@ -10874,7 +10874,7 @@ }, [ segment.buffer ]); - }, _proto.probeMp4StartTime = function(_ref) { + }, _proto.probeMp4StartTime = function probeMp4StartTime(_ref) { var timescales = _ref.timescales, data = _ref.data, startTime = probe$2.startTime(timescales, data); this.self.postMessage({ action: "probeMp4StartTime", @@ -10883,7 +10883,7 @@ }, [ data.buffer ]); - }, _proto.probeMp4Tracks = function(_ref2) { + }, _proto.probeMp4Tracks = function probeMp4Tracks(_ref2) { var data = _ref2.data, tracks = probe$2.tracks(data); this.self.postMessage({ action: "probeMp4Tracks", @@ -10892,7 +10892,7 @@ }, [ data.buffer ]); - }, _proto.probeTs = function(_ref3) { + }, _proto.probeTs = function probeTs(_ref3) { var data = _ref3.data, baseStartTime = _ref3.baseStartTime, tsStartTime = "number" != typeof baseStartTime || isNaN(baseStartTime) ? void 0 : baseStartTime * clock.ONE_SECOND_IN_TS, timeInfo = tsInspector.inspect(data, tsStartTime), result = null; timeInfo && ((result = { hasVideo: timeInfo.video && 2 === timeInfo.video.length || !1, @@ -10904,33 +10904,33 @@ }, [ data.buffer ]); - }, _proto.clearAllMp4Captions = function() { + }, _proto.clearAllMp4Captions = function clearAllMp4Captions() { this.captionParser && this.captionParser.clearAllCaptions(); - }, _proto.clearParsedMp4Captions = function() { + }, _proto.clearParsedMp4Captions = function clearParsedMp4Captions() { this.captionParser && this.captionParser.clearParsedCaptions(); - }, _proto.push = function(data) { + }, _proto.push = function push(data) { var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength); this.transmuxer.push(segment); - }, _proto.reset = function() { + }, _proto.reset = function reset() { this.transmuxer.reset(); - }, _proto.setTimestampOffset = function(data) { + }, _proto.setTimestampOffset = function setTimestampOffset(data) { var timestampOffset = data.timestampOffset || 0; this.transmuxer.setBaseMediaDecodeTime(Math.round(clock.secondsToVideoTs(timestampOffset))); - }, _proto.setAudioAppendStart = function(data) { + }, _proto.setAudioAppendStart = function setAudioAppendStart(data) { this.transmuxer.setAudioAppendStart(Math.ceil(clock.secondsToVideoTs(data.appendStart))); - }, _proto.setRemux = function(data) { + }, _proto.setRemux = function setRemux(data) { this.transmuxer.setRemux(data.remux); - }, _proto.flush = function(data) { + }, _proto.flush = function flush(data) { this.transmuxer.flush(), self.postMessage({ action: "done", type: "transmuxed" }); - }, _proto.endTimeline = function() { + }, _proto.endTimeline = function endTimeline() { this.transmuxer.endTimeline(), self.postMessage({ action: "endedtimeline", type: "transmuxed" }); - }, _proto.alignGopsWith = function(data) { + }, _proto.alignGopsWith = function alignGopsWith(data) { this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice()); }, MessageHandlers; }(); @@ -11116,7 +11116,7 @@ action: "probeMp4Tracks", data: segment.map.bytes, transmuxer: segment.transmuxer, - callback: function(_ref) { + callback: function callback(_ref) { var tracks = _ref.tracks, data = _ref.data; return segment.map.bytes = data, tracks.forEach(function(track) { segment.map.tracks = segment.map.tracks || {}, !segment.map.tracks[track.type] && (segment.map.tracks[track.type] = track, "number" == typeof track.id && track.timescale && (segment.map.timescales = segment.map.timescales || {}, segment.map.timescales[track.id] = track.timescale)); @@ -11154,7 +11154,7 @@ transmuxer: segment.transmuxer, data: bytes, baseStartTime: segment.baseStartTime, - callback: function(data) { + callback: function callback(data) { segment.bytes = bytes = data.data; var probeResult = data.result; probeResult && (trackInfoFn(segment, { @@ -11167,38 +11167,38 @@ audioAppendStart: segment.audioAppendStart, gopsToAlignWith: segment.gopsToAlignWith, remux: isMuxed, - onData: function(result) { + onData: function onData(result) { result.type = "combined" === result.type ? "video" : result.type, dataFn(segment, result); }, - onTrackInfo: function(trackInfo) { + onTrackInfo: function onTrackInfo(trackInfo) { trackInfoFn && (isMuxed && (trackInfo.isMuxed = !0), trackInfoFn(segment, trackInfo)); }, - onAudioTimingInfo: function(audioTimingInfo) { + onAudioTimingInfo: function onAudioTimingInfo(audioTimingInfo) { audioStartFn && void 0 !== audioTimingInfo.start && (audioStartFn(audioTimingInfo.start), audioStartFn = null), audioEndFn && void 0 !== audioTimingInfo.end && audioEndFn(audioTimingInfo.end); }, - onVideoTimingInfo: function(videoTimingInfo) { + onVideoTimingInfo: function onVideoTimingInfo(videoTimingInfo) { videoStartFn && void 0 !== videoTimingInfo.start && (videoStartFn(videoTimingInfo.start), videoStartFn = null), videoEndFn && void 0 !== videoTimingInfo.end && videoEndFn(videoTimingInfo.end); }, - onVideoSegmentTimingInfo: function(videoSegmentTimingInfo) { + onVideoSegmentTimingInfo: function onVideoSegmentTimingInfo(videoSegmentTimingInfo) { videoSegmentTimingInfoFn(videoSegmentTimingInfo); }, - onAudioSegmentTimingInfo: function(audioSegmentTimingInfo) { + onAudioSegmentTimingInfo: function onAudioSegmentTimingInfo(audioSegmentTimingInfo) { audioSegmentTimingInfoFn(audioSegmentTimingInfo); }, - onId3: function(id3Frames, dispatchType) { + onId3: function onId3(id3Frames, dispatchType) { id3Fn(segment, id3Frames, dispatchType); }, - onCaptions: function(captions) { + onCaptions: function onCaptions(captions) { captionsFn(segment, [ captions ]); }, isEndOfTimeline: isEndOfTimeline, - onEndedTimeline: function() { + onEndedTimeline: function onEndedTimeline() { endedTimelineFn(); }, onTransmuxerLog: onTransmuxerLog, - onDone: function(result) { + onDone: function onDone(result) { doneFn && (result.type = "combined" === result.type ? "video" : result.type, doneFn(null, segment, result)); } }); @@ -11225,7 +11225,7 @@ timescales: segment.map.timescales, data: bytesAsUint8Array, transmuxer: segment.transmuxer, - callback: function(_ref6) { + callback: function callback(_ref6) { var data = _ref6.data, startTime = _ref6.startTime; if (bytes = data.buffer, segment.bytes = bytesAsUint8Array = data, trackInfo.hasAudio && !trackInfo.isMuxed && timingInfoFn(segment, "audio", "start", startTime), trackInfo.hasVideo && timingInfoFn(segment, "video", "start", startTime), !tracks.video || !data.byteLength || !segment.transmuxer) { finishLoading(); @@ -11240,7 +11240,7 @@ trackIds: [ tracks.video.id ], - callback: function(message) { + callback: function callback(message) { bytes = message.data.buffer, segment.bytes = bytesAsUint8Array = message.data, message.logs.forEach(function(log) { onTransmuxerLog(videojs.mergeOptions(log, { stream: "mp4CaptionParser" @@ -11657,17 +11657,17 @@ }, deprecateOldCue = function(cue) { Object.defineProperties(cue.frame, { id: { - get: function() { + get: function get() { return videojs.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."), cue.value.key; } }, value: { - get: function() { + get: function get() { return videojs.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."), cue.value.data; } }, privateData: { - get: function() { + get: function get() { return videojs.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."), cue.value.data; } } @@ -11823,10 +11823,10 @@ }, _this.syncController_.on("syncinfoupdate", _this.triggerSyncInfoUpdate_), _this.mediaSource_.addEventListener("sourceopen", function() { _this.isEndOfStream_() || (_this.ended_ = !1); }), _this.fetchAtBuffer_ = !1, _this.logger_ = logger("SegmentLoader[" + _this.loaderType_ + "]"), Object.defineProperty((0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this), "state", { - get: function() { + get: function get() { return this.state_; }, - set: function(newState) { + set: function set(newState) { newState !== this.state_ && (this.logger_(this.state_ + " -> " + newState), this.state_ = newState, this.trigger("statechange")); } }), _this.sourceUpdater_.on("ready", function() { @@ -11839,7 +11839,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(SegmentLoader, _videojs$EventTarget); var _proto = SegmentLoader.prototype; - return _proto.createTransmuxer_ = function() { + return _proto.createTransmuxer_ = function createTransmuxer_() { return segmentTransmuxer.createTransmuxer({ remux: !1, alignGopsAtEnd: this.safeAppend_, @@ -11847,27 +11847,27 @@ parse708captions: this.parse708captions_, captionServices: this.captionServices_ }); - }, _proto.resetStats_ = function() { + }, _proto.resetStats_ = function resetStats_() { this.mediaBytesTransferred = 0, this.mediaRequests = 0, this.mediaRequestsAborted = 0, this.mediaRequestsTimedout = 0, this.mediaRequestsErrored = 0, this.mediaTransferDuration = 0, this.mediaSecondsLoaded = 0, this.mediaAppends = 0; - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.trigger("dispose"), this.state = "DISPOSED", this.pause(), this.abort_(), this.transmuxer_ && this.transmuxer_.terminate(), this.resetStats_(), this.checkBufferTimeout_ && global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.checkBufferTimeout_), this.syncController_ && this.triggerSyncInfoUpdate_ && this.syncController_.off("syncinfoupdate", this.triggerSyncInfoUpdate_), this.off(); - }, _proto.setAudio = function(enable) { + }, _proto.setAudio = function setAudio(enable) { this.audioDisabled_ = !enable, enable ? this.appendInitSegment_.audio = !0 : this.sourceUpdater_.removeAudio(0, this.duration_()); - }, _proto.abort = function() { + }, _proto.abort = function abort() { if ("WAITING" !== this.state) { this.pendingSegment_ && (this.pendingSegment_ = null); return; } this.abort_(), this.state = "READY", this.paused() || this.monitorBuffer_(); - }, _proto.abort_ = function() { + }, _proto.abort_ = function abort_() { this.pendingSegment_ && this.pendingSegment_.abortRequests && this.pendingSegment_.abortRequests(), this.pendingSegment_ = null, this.callQueue_ = [], this.loadQueue_ = [], this.metadataQueue_.id3 = [], this.metadataQueue_.caption = [], this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_), this.waitingOnRemove_ = !1, global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.quotaExceededErrorRetryTimeout_), this.quotaExceededErrorRetryTimeout_ = null; - }, _proto.checkForAbort_ = function(requestId) { + }, _proto.checkForAbort_ = function checkForAbort_(requestId) { return "APPENDING" !== this.state || this.pendingSegment_ ? !this.pendingSegment_ || this.pendingSegment_.requestId !== requestId : (this.state = "READY", !0); - }, _proto.error = function(_error) { + }, _proto.error = function error(_error) { return void 0 !== _error && (this.logger_("error occurred:", _error), this.error_ = _error), this.pendingSegment_ = null, this.error_; - }, _proto.endOfStream = function() { + }, _proto.endOfStream = function endOfStream() { this.ended_ = !0, this.transmuxer_ && segmentTransmuxer.reset(this.transmuxer_), this.gopBuffer_.length = 0, this.pause(), this.trigger("ended"); - }, _proto.buffered_ = function() { + }, _proto.buffered_ = function buffered_() { var trackInfo = this.getMediaInfo_(); if (!this.sourceUpdater_ || !trackInfo) return videojs.createTimeRanges(); if ("main" === this.loaderType_) { @@ -11876,7 +11876,7 @@ if (hasVideo) return this.sourceUpdater_.videoBuffered(); } return this.sourceUpdater_.audioBuffered(); - }, _proto.initSegmentForMap = function(map, set) { + }, _proto.initSegmentForMap = function initSegmentForMap(map, set) { if (void 0 === set && (set = !1), !map) return null; var id = initSegmentId(map), storedMap = this.initSegments_[id]; return set && !storedMap && map.bytes && (this.initSegments_[id] = storedMap = { @@ -11886,7 +11886,7 @@ tracks: map.tracks, timescales: map.timescales }), storedMap || map; - }, _proto.segmentKey = function(key, set) { + }, _proto.segmentKey = function segmentKey(key, set) { if (void 0 === set && (set = !1), !key) return null; var id = segmentKeyId(key), storedKey = this.keyCache_[id]; this.cacheEncryptionKeys_ && set && !storedKey && key.bytes && (this.keyCache_[id] = storedKey = { @@ -11897,16 +11897,16 @@ resolvedUri: (storedKey || key).resolvedUri }; return storedKey && (result.bytes = storedKey.bytes), result; - }, _proto.couldBeginLoading_ = function() { + }, _proto.couldBeginLoading_ = function couldBeginLoading_() { return this.playlist_ && !this.paused(); - }, _proto.load = function() { + }, _proto.load = function load() { if (this.monitorBuffer_(), this.playlist_) { if ("INIT" === this.state && this.couldBeginLoading_()) return this.init_(); this.couldBeginLoading_() && ("READY" === this.state || "INIT" === this.state) && (this.state = "READY"); } - }, _proto.init_ = function() { + }, _proto.init_ = function init_() { return this.state = "READY", this.resetEverything(), this.monitorBuffer_(); - }, _proto.playlist = function(newPlaylist, options) { + }, _proto.playlist = function playlist(newPlaylist, options) { if (void 0 === options && (options = {}), newPlaylist) { var oldPlaylist = this.playlist_, segmentInfo = this.pendingSegment_; this.playlist_ = newPlaylist, this.xhrOptions_ = options, "INIT" === this.state && (newPlaylist.syncInfo = { @@ -11932,11 +11932,11 @@ } segmentInfo && (segmentInfo.mediaIndex -= mediaSequenceDiff, segmentInfo.mediaIndex < 0 ? (segmentInfo.mediaIndex = null, segmentInfo.partIndex = null) : (segmentInfo.mediaIndex >= 0 && (segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex]), segmentInfo.partIndex >= 0 && segmentInfo.segment.parts && (segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex]))), this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist); } - }, _proto.pause = function() { + }, _proto.pause = function pause() { this.checkBufferTimeout_ && (global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.checkBufferTimeout_), this.checkBufferTimeout_ = null); - }, _proto.paused = function() { + }, _proto.paused = function paused() { return null === this.checkBufferTimeout_; - }, _proto.resetEverything = function(done) { + }, _proto.resetEverything = function resetEverything(done) { this.ended_ = !1, this.appendInitSegment_ = { audio: !0, video: !0 @@ -11945,14 +11945,14 @@ }), this.transmuxer_.postMessage({ action: "reset" })); - }, _proto.resetLoader = function() { + }, _proto.resetLoader = function resetLoader() { this.fetchAtBuffer_ = !1, this.resyncLoader(); - }, _proto.resyncLoader = function() { + }, _proto.resyncLoader = function resyncLoader() { this.transmuxer_ && segmentTransmuxer.reset(this.transmuxer_), this.mediaIndex = null, this.partIndex = null, this.syncPoint_ = null, this.isPendingTimestampOffset_ = !1, this.callQueue_ = [], this.loadQueue_ = [], this.metadataQueue_.id3 = [], this.metadataQueue_.caption = [], this.abort(), this.transmuxer_ && this.transmuxer_.postMessage({ action: "clearParsedMp4Captions" }); - }, _proto.remove = function(start, end, done, force) { - if (void 0 === done && (done = function() {}), void 0 === force && (force = !1), end === 1 / 0 && (end = this.duration_()), end <= start) { + }, _proto.remove = function remove(start, end, done, force) { + if (void 0 === done && (done = function done() {}), void 0 === force && (force = !1), end === 1 / 0 && (end = this.duration_()), end <= start) { this.logger_("skipping remove because end ${end} is <= start ${start}"); return; } @@ -11965,11 +11965,11 @@ }; for(var track in (force || !this.audioDisabled_) && (removesRemaining++, this.sourceUpdater_.removeAudio(start, end, removeFinished)), (force || "main" === this.loaderType_) && (this.gopBuffer_ = removeGopBuffer(this.gopBuffer_, start, end, this.timeMapping_), removesRemaining++, this.sourceUpdater_.removeVideo(start, end, removeFinished)), this.inbandTextTracks_)removeCuesFromTrack(start, end, this.inbandTextTracks_[track]); removeCuesFromTrack(start, end, this.segmentMetadataTrack_), removeFinished(); - }, _proto.monitorBuffer_ = function() { + }, _proto.monitorBuffer_ = function monitorBuffer_() { this.checkBufferTimeout_ && global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.checkBufferTimeout_), this.checkBufferTimeout_ = global_window__WEBPACK_IMPORTED_MODULE_0___default().setTimeout(this.monitorBufferTick_.bind(this), 1); - }, _proto.monitorBufferTick_ = function() { + }, _proto.monitorBufferTick_ = function monitorBufferTick_() { "READY" === this.state && this.fillBuffer_(), this.checkBufferTimeout_ && global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.checkBufferTimeout_), this.checkBufferTimeout_ = global_window__WEBPACK_IMPORTED_MODULE_0___default().setTimeout(this.monitorBufferTick_.bind(this), 500); - }, _proto.fillBuffer_ = function() { + }, _proto.fillBuffer_ = function fillBuffer_() { if (!this.sourceUpdater_.updating()) { var segmentInfo = this.chooseNextRequest_(); segmentInfo && ("number" == typeof segmentInfo.timestampOffset && (this.isPendingTimestampOffset_ = !1, this.timelineChangeController_.pendingTimelineChange({ @@ -11978,11 +11978,11 @@ to: segmentInfo.timeline })), this.loadSegment_(segmentInfo)); } - }, _proto.isEndOfStream_ = function(mediaIndex, playlist, partIndex) { + }, _proto.isEndOfStream_ = function isEndOfStream_(mediaIndex, playlist, partIndex) { if (void 0 === mediaIndex && (mediaIndex = this.mediaIndex), void 0 === playlist && (playlist = this.playlist_), void 0 === partIndex && (partIndex = this.partIndex), !playlist || !this.mediaSource_) return !1; var segment = "number" == typeof mediaIndex && playlist.segments[mediaIndex], appendedLastSegment = mediaIndex + 1 === playlist.segments.length, appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length; return playlist.endList && "open" === this.mediaSource_.readyState && appendedLastSegment && appendedLastPart; - }, _proto.chooseNextRequest_ = function() { + }, _proto.chooseNextRequest_ = function chooseNextRequest_() { var buffered = this.buffered_(), bufferedEnd = lastBufferedEnd(buffered) || 0, bufferedTime = timeAheadOf(buffered, this.currentTime_()), preloaded = !this.hasPlayed_() && bufferedTime >= 1, haveEnoughBuffer = bufferedTime >= this.goalBufferLength_(), segments = this.playlist_.segments; if (!segments.length || preloaded || haveEnoughBuffer) return null; this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_()); @@ -12018,7 +12018,7 @@ } var ended = this.mediaSource_ && "ended" === this.mediaSource_.readyState; return next.mediaIndex >= segments.length - 1 && ended && !this.seeking_() ? null : this.generateSegmentInfo_(next); - }, _proto.generateSegmentInfo_ = function(options) { + }, _proto.generateSegmentInfo_ = function generateSegmentInfo_(options) { var independent = options.independent, playlist = options.playlist, mediaIndex = options.mediaIndex, startOfSegment = options.startOfSegment, isSyncRequest = options.isSyncRequest, partIndex = options.partIndex, forceTimestampOffset = options.forceTimestampOffset, getMediaInfoForTime = options.getMediaInfoForTime, segment = playlist.segments[mediaIndex], part = "number" == typeof partIndex && segment.parts[partIndex], segmentInfo = { requestId: "segment-loader-" + Math.random(), uri: part && part.resolvedUri || segment.resolvedUri, @@ -12048,9 +12048,9 @@ }); var audioBufferedEnd = lastBufferedEnd(this.sourceUpdater_.audioBuffered()); return "number" == typeof audioBufferedEnd && (segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset()), this.sourceUpdater_.videoBuffered().length && (segmentInfo.gopsToAlignWith = gopsSafeToAlignWith(this.gopBuffer_, this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(), this.timeMapping_)), segmentInfo; - }, _proto.timestampOffsetForSegment_ = function(options) { + }, _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_(options) { return timestampOffsetForSegment(options); - }, _proto.earlyAbortWhenNeeded_ = function(stats) { + }, _proto.earlyAbortWhenNeeded_ = function earlyAbortWhenNeeded_(stats) { if (!(this.vhs_.tech_.paused() || !this.xhrOptions_.timeout || !this.playlist_.attributes.BANDWIDTH || Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1000)) { var buffered, playbackRate, currentTime = this.currentTime_(), measuredBandwidth = stats.bandwidth, segmentDuration = this.pendingSegment_.duration, requestTimeRemaining = Playlist.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived), timeUntilRebuffer$1 = (buffered = this.buffered_(), void 0 === (playbackRate = this.vhs_.tech_.playbackRate()) && (playbackRate = 1), ((buffered.length ? buffered.end(buffered.length - 1) : 0) - currentTime) / playbackRate - 1); if (!(requestTimeRemaining <= timeUntilRebuffer$1)) { @@ -12070,21 +12070,21 @@ } } } - }, _proto.handleAbort_ = function(segmentInfo) { + }, _proto.handleAbort_ = function handleAbort_(segmentInfo) { this.logger_("Aborting " + segmentInfoString(segmentInfo)), this.mediaRequestsAborted += 1; - }, _proto.handleProgress_ = function(event, simpleSegment) { + }, _proto.handleProgress_ = function handleProgress_(event, simpleSegment) { this.earlyAbortWhenNeeded_(simpleSegment.stats), this.checkForAbort_(simpleSegment.requestId) || this.trigger("progress"); - }, _proto.handleTrackInfo_ = function(simpleSegment, trackInfo) { + }, _proto.handleTrackInfo_ = function handleTrackInfo_(simpleSegment, trackInfo) { this.earlyAbortWhenNeeded_(simpleSegment.stats), this.checkForAbort_(simpleSegment.requestId) || this.checkForIllegalMediaSwitch(trackInfo) || (trackInfo = trackInfo || {}, shallowEqual(this.currentMediaInfo_, trackInfo) || (this.appendInitSegment_ = { audio: !0, video: !0 }, this.startingMediaInfo_ = trackInfo, this.currentMediaInfo_ = trackInfo, this.logger_("trackinfo update", trackInfo), this.trigger("trackinfo")), !this.checkForAbort_(simpleSegment.requestId) && (this.pendingSegment_.trackInfo = trackInfo, this.hasEnoughInfoToAppend_() && this.processCallQueue_())); - }, _proto.handleTimingInfo_ = function(simpleSegment, mediaType, timeType, time) { + }, _proto.handleTimingInfo_ = function handleTimingInfo_(simpleSegment, mediaType, timeType, time) { if (this.earlyAbortWhenNeeded_(simpleSegment.stats), !this.checkForAbort_(simpleSegment.requestId)) { var segmentInfo = this.pendingSegment_, timingInfoProperty = timingInfoPropertyForMedia(mediaType); segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {}, segmentInfo[timingInfoProperty][timeType] = time, this.logger_("timinginfo: " + mediaType + " - " + timeType + " - " + time), this.hasEnoughInfoToAppend_() && this.processCallQueue_(); } - }, _proto.handleCaptions_ = function(simpleSegment, captionData) { + }, _proto.handleCaptions_ = function handleCaptions_(simpleSegment, captionData) { var _this2 = this; if (this.earlyAbortWhenNeeded_(simpleSegment.stats), !this.checkForAbort_(simpleSegment.requestId)) { if (0 === captionData.length) { @@ -12115,7 +12115,7 @@ action: "clearParsedMp4Captions" }); } - }, _proto.handleId3_ = function(simpleSegment, id3Frames, dispatchType) { + }, _proto.handleId3_ = function handleId3_(simpleSegment, id3Frames, dispatchType) { if (this.earlyAbortWhenNeeded_(simpleSegment.stats), !this.checkForAbort_(simpleSegment.requestId)) { if (!this.pendingSegment_.hasAppendedData_) { this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType)); @@ -12129,23 +12129,23 @@ videoDuration: this.duration_() }); } - }, _proto.processMetadataQueue_ = function() { + }, _proto.processMetadataQueue_ = function processMetadataQueue_() { this.metadataQueue_.id3.forEach(function(fn) { return fn(); }), this.metadataQueue_.caption.forEach(function(fn) { return fn(); }), this.metadataQueue_.id3 = [], this.metadataQueue_.caption = []; - }, _proto.processCallQueue_ = function() { + }, _proto.processCallQueue_ = function processCallQueue_() { var callQueue = this.callQueue_; this.callQueue_ = [], callQueue.forEach(function(fun) { return fun(); }); - }, _proto.processLoadQueue_ = function() { + }, _proto.processLoadQueue_ = function processLoadQueue_() { var loadQueue = this.loadQueue_; this.loadQueue_ = [], loadQueue.forEach(function(fun) { return fun(); }); - }, _proto.hasEnoughInfoToLoad_ = function() { + }, _proto.hasEnoughInfoToLoad_ = function hasEnoughInfoToLoad_() { if ("audio" !== this.loaderType_) return !0; var segmentInfo = this.pendingSegment_; return !!segmentInfo && (!this.getCurrentMediaInfo_() || !shouldWaitForTimelineChange({ @@ -12155,11 +12155,11 @@ loaderType: this.loaderType_, audioDisabled: this.audioDisabled_ })); - }, _proto.getCurrentMediaInfo_ = function(segmentInfo) { + }, _proto.getCurrentMediaInfo_ = function getCurrentMediaInfo_(segmentInfo) { return void 0 === segmentInfo && (segmentInfo = this.pendingSegment_), segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_; - }, _proto.getMediaInfo_ = function(segmentInfo) { + }, _proto.getMediaInfo_ = function getMediaInfo_(segmentInfo) { return void 0 === segmentInfo && (segmentInfo = this.pendingSegment_), this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_; - }, _proto.hasEnoughInfoToAppend_ = function() { + }, _proto.hasEnoughInfoToAppend_ = function hasEnoughInfoToAppend_() { if (!this.sourceUpdater_.ready() || this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) return !1; var segmentInfo = this.pendingSegment_, trackInfo = this.getCurrentMediaInfo_(); if (!segmentInfo || !trackInfo) return !1; @@ -12171,7 +12171,7 @@ loaderType: this.loaderType_, audioDisabled: this.audioDisabled_ })); - }, _proto.handleData_ = function(simpleSegment, result) { + }, _proto.handleData_ = function handleData_(simpleSegment, result) { if (this.earlyAbortWhenNeeded_(simpleSegment.stats), !this.checkForAbort_(simpleSegment.requestId)) { if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) { this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result)); @@ -12208,12 +12208,12 @@ segmentInfo.hasAppendedData_ = !0, this.processMetadataQueue_(), this.appendData_(segmentInfo, result); } } - }, _proto.updateAppendInitSegmentStatus = function(segmentInfo, type) { + }, _proto.updateAppendInitSegmentStatus = function updateAppendInitSegmentStatus(segmentInfo, type) { "main" !== this.loaderType_ || "number" != typeof segmentInfo.timestampOffset || segmentInfo.changedTimestampOffset || (this.appendInitSegment_ = { audio: !0, video: !0 }), this.playlistOfLastInitSegment_[type] !== segmentInfo.playlist && (this.appendInitSegment_[type] = !0); - }, _proto.getInitSegmentAndUpdateState_ = function(_ref4) { + }, _proto.getInitSegmentAndUpdateState_ = function getInitSegmentAndUpdateState_(_ref4) { var type = _ref4.type, initSegment = _ref4.initSegment, map = _ref4.map, playlist = _ref4.playlist; if (map) { var id = initSegmentId(map); @@ -12221,7 +12221,7 @@ initSegment = this.initSegmentForMap(map, !0).bytes, this.activeInitSegmentId_ = id; } return initSegment && this.appendInitSegment_[type] ? (this.playlistOfLastInitSegment_[type] = playlist, this.appendInitSegment_[type] = !1, this.activeInitSegmentId_ = null, initSegment) : null; - }, _proto.handleQuotaExceededError_ = function(_ref5, error) { + }, _proto.handleQuotaExceededError_ = function handleQuotaExceededError_(_ref5, error) { var _this3 = this, segmentInfo = _ref5.segmentInfo, type = _ref5.type, bytes = _ref5.bytes, audioBuffered = this.sourceUpdater_.audioBuffered(), videoBuffered = this.sourceUpdater_.videoBuffered(); audioBuffered.length > 1 && this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: " + timeRangesToArray(audioBuffered).join(", ")), videoBuffered.length > 1 && this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: " + timeRangesToArray(videoBuffered).join(", ")); var audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0, audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0, videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0, videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0; @@ -12243,7 +12243,7 @@ _this3.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"), _this3.quotaExceededErrorRetryTimeout_ = null, _this3.processCallQueue_(); }, 1000); }, !0); - }, _proto.handleAppendError_ = function(_ref6, error) { + }, _proto.handleAppendError_ = function handleAppendError_(_ref6, error) { var segmentInfo = _ref6.segmentInfo, type = _ref6.type, bytes = _ref6.bytes; if (error) { if (22 === error.code) { @@ -12256,7 +12256,7 @@ } this.logger_("Received non QUOTA_EXCEEDED_ERR on append", error), this.error(type + " append of " + bytes.length + "b failed for segment #" + segmentInfo.mediaIndex + " in playlist " + segmentInfo.playlist.id), this.trigger("appenderror"); } - }, _proto.appendToSourceBuffer_ = function(_ref7) { + }, _proto.appendToSourceBuffer_ = function appendToSourceBuffer_(_ref7) { var segmentInfo = _ref7.segmentInfo, type = _ref7.type, initSegment = _ref7.initSegment, data = _ref7.data, bytes = _ref7.bytes; if (!bytes) { var segments = [ @@ -12276,12 +12276,12 @@ type: type, bytes: bytes })); - }, _proto.handleSegmentTimingInfo_ = function(type, requestId, segmentTimingInfo) { + }, _proto.handleSegmentTimingInfo_ = function handleSegmentTimingInfo_(type, requestId, segmentTimingInfo) { if (this.pendingSegment_ && requestId === this.pendingSegment_.requestId) { var segment = this.pendingSegment_.segment, timingInfoProperty = type + "TimingInfo"; segment[timingInfoProperty] || (segment[timingInfoProperty] = {}), segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0, segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation, segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode, segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation, segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode, segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime; } - }, _proto.appendData_ = function(segmentInfo, result) { + }, _proto.appendData_ = function appendData_(segmentInfo, result) { var type = result.type, data = result.data; if (data && data.byteLength && ("audio" !== type || !this.audioDisabled_)) { var initSegment = this.getInitSegmentAndUpdateState_({ @@ -12297,7 +12297,7 @@ data: data }); } - }, _proto.loadSegment_ = function(segmentInfo) { + }, _proto.loadSegment_ = function loadSegment_(segmentInfo) { var _this4 = this; if (this.state = "WAITING", this.pendingSegment_ = segmentInfo, this.trimBackBuffer_(segmentInfo), "number" == typeof segmentInfo.timestampOffset && this.transmuxer_ && this.transmuxer_.postMessage({ action: "clearAllMp4Captions" @@ -12311,7 +12311,7 @@ return; } this.updateTransmuxerAndRequestSegment_(segmentInfo); - }, _proto.updateTransmuxerAndRequestSegment_ = function(segmentInfo) { + }, _proto.updateTransmuxerAndRequestSegment_ = function updateTransmuxerAndRequestSegment_(segmentInfo) { var _this5 = this; this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset) && (this.gopBuffer_.length = 0, segmentInfo.gopsToAlignWith = [], this.timeMapping_ = 0, this.transmuxer_.postMessage({ action: "reset" @@ -12336,21 +12336,21 @@ audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "audio", segmentInfo.requestId), captionsFn: this.handleCaptions_.bind(this), isEndOfTimeline: isEndOfStream || isWalkingForward && isDiscontinuity, - endedTimelineFn: function() { + endedTimelineFn: function endedTimelineFn() { _this5.logger_("received endedtimeline callback"); }, id3Fn: this.handleId3_.bind(this), dataFn: this.handleData_.bind(this), doneFn: this.segmentRequestFinished_.bind(this), - onTransmuxerLog: function(_ref8) { + onTransmuxerLog: function onTransmuxerLog(_ref8) { var message = _ref8.message, level = _ref8.level, stream = _ref8.stream; _this5.logger_(segmentInfoString(segmentInfo) + " logged from transmuxer stream " + stream + " as a " + level + ": " + message); } }); - }, _proto.trimBackBuffer_ = function(segmentInfo) { + }, _proto.trimBackBuffer_ = function trimBackBuffer_(segmentInfo) { var removeToTime = safeBackBufferTrimTime(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10); removeToTime > 0 && this.remove(0, removeToTime); - }, _proto.createSimplifiedSegmentObj_ = function(segmentInfo) { + }, _proto.createSimplifiedSegmentObj_ = function createSimplifiedSegmentObj_(segmentInfo) { var segment = segmentInfo.segment, part = segmentInfo.part, simpleSegment = { resolvedUri: part ? part.resolvedUri : segment.resolvedUri, byterange: part ? part.byterange : segment.byterange, @@ -12370,17 +12370,17 @@ simpleSegment.key = this.segmentKey(segment.key), simpleSegment.key.iv = iv; } return segment.map && (simpleSegment.map = this.initSegmentForMap(segment.map)), simpleSegment; - }, _proto.saveTransferStats_ = function(stats) { + }, _proto.saveTransferStats_ = function saveTransferStats_(stats) { this.mediaRequests += 1, stats && (this.mediaBytesTransferred += stats.bytesReceived, this.mediaTransferDuration += stats.roundTripTime); - }, _proto.saveBandwidthRelatedStats_ = function(duration, stats) { + }, _proto.saveBandwidthRelatedStats_ = function saveBandwidthRelatedStats_(duration, stats) { if (this.pendingSegment_.byteLength = stats.bytesReceived, duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) { this.logger_("Ignoring segment's bandwidth because its duration of " + duration + " is less than the min to record " + MIN_SEGMENT_DURATION_TO_SAVE_STATS); return; } this.bandwidth = stats.bandwidth, this.roundTrip = stats.roundTripTime; - }, _proto.handleTimeout_ = function() { + }, _proto.handleTimeout_ = function handleTimeout_() { this.mediaRequestsTimedout += 1, this.bandwidth = 1, this.roundTrip = NaN, this.trigger("bandwidthupdate"); - }, _proto.segmentRequestFinished_ = function(error, simpleSegment, result) { + }, _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) { if (this.callQueue_.length) { this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result)); return; @@ -12398,20 +12398,20 @@ var segmentInfo = this.pendingSegment_; this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats), segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests, result.gopInfo && (this.gopBuffer_ = updateGopBuffer(this.gopBuffer_, result.gopInfo, this.safeAppend_)), this.state = "APPENDING", this.trigger("appending"), this.waitForAppendsToComplete_(segmentInfo); } - }, _proto.setTimeMapping_ = function(timeline) { + }, _proto.setTimeMapping_ = function setTimeMapping_(timeline) { var timelineMapping = this.syncController_.mappingForTimeline(timeline); null !== timelineMapping && (this.timeMapping_ = timelineMapping); - }, _proto.updateMediaSecondsLoaded_ = function(segment) { + }, _proto.updateMediaSecondsLoaded_ = function updateMediaSecondsLoaded_(segment) { "number" == typeof segment.start && "number" == typeof segment.end ? this.mediaSecondsLoaded += segment.end - segment.start : this.mediaSecondsLoaded += segment.duration; - }, _proto.shouldUpdateTransmuxerTimestampOffset_ = function(timestampOffset) { + }, _proto.shouldUpdateTransmuxerTimestampOffset_ = function shouldUpdateTransmuxerTimestampOffset_(timestampOffset) { return null !== timestampOffset && ("main" === this.loaderType_ && timestampOffset !== this.sourceUpdater_.videoTimestampOffset() || !this.audioDisabled_ && timestampOffset !== this.sourceUpdater_.audioTimestampOffset()); - }, _proto.trueSegmentStart_ = function(_ref9) { + }, _proto.trueSegmentStart_ = function trueSegmentStart_(_ref9) { var currentStart = _ref9.currentStart, playlist = _ref9.playlist, mediaIndex = _ref9.mediaIndex, firstVideoFrameTimeForData = _ref9.firstVideoFrameTimeForData, currentVideoTimestampOffset = _ref9.currentVideoTimestampOffset, useVideoTimingInfo = _ref9.useVideoTimingInfo, videoTimingInfo = _ref9.videoTimingInfo, audioTimingInfo = _ref9.audioTimingInfo; if (void 0 !== currentStart) return currentStart; if (!useVideoTimingInfo) return audioTimingInfo.start; var previousSegment = playlist.segments[mediaIndex - 1]; return 0 !== mediaIndex && previousSegment && void 0 !== previousSegment.start && previousSegment.end === firstVideoFrameTimeForData + currentVideoTimestampOffset ? videoTimingInfo.start : firstVideoFrameTimeForData; - }, _proto.waitForAppendsToComplete_ = function(segmentInfo) { + }, _proto.waitForAppendsToComplete_ = function waitForAppendsToComplete_(segmentInfo) { var trackInfo = this.getCurrentMediaInfo_(segmentInfo); if (!trackInfo) { this.error({ @@ -12428,24 +12428,24 @@ return; } waitForVideo && segmentInfo.waitingOnAppends++, waitForAudio && segmentInfo.waitingOnAppends++, waitForVideo && this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo)), waitForAudio && this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo)); - }, _proto.checkAppendsDone_ = function(segmentInfo) { + }, _proto.checkAppendsDone_ = function checkAppendsDone_(segmentInfo) { this.checkForAbort_(segmentInfo.requestId) || (segmentInfo.waitingOnAppends--, 0 === segmentInfo.waitingOnAppends && this.handleAppendsDone_()); - }, _proto.checkForIllegalMediaSwitch = function(trackInfo) { + }, _proto.checkForIllegalMediaSwitch = function checkForIllegalMediaSwitch(trackInfo) { var loaderType, startingMedia, illegalMediaSwitchError = (loaderType = this.loaderType_, startingMedia = this.getCurrentMediaInfo_(), "main" === loaderType && startingMedia && trackInfo ? trackInfo.hasAudio || trackInfo.hasVideo ? startingMedia.hasVideo && !trackInfo.hasVideo ? "Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest." : !startingMedia.hasVideo && trackInfo.hasVideo ? "Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest." : null : "Neither audio nor video found in segment." : null); return !!illegalMediaSwitchError && (this.error({ message: illegalMediaSwitchError, blacklistDuration: 1 / 0 }), this.trigger("error"), !0); - }, _proto.updateSourceBufferTimestampOffset_ = function(segmentInfo) { + }, _proto.updateSourceBufferTimestampOffset_ = function updateSourceBufferTimestampOffset_(segmentInfo) { if (null !== segmentInfo.timestampOffset && "number" == typeof segmentInfo.timingInfo.start && !segmentInfo.changedTimestampOffset && "main" === this.loaderType_) { var didChange = !1; segmentInfo.timestampOffset -= segmentInfo.timingInfo.start, segmentInfo.changedTimestampOffset = !0, segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset() && (this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset), didChange = !0), segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset() && (this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset), didChange = !0), didChange && this.trigger("timestampoffset"); } - }, _proto.updateTimingInfoEnd_ = function(segmentInfo) { + }, _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_(segmentInfo) { segmentInfo.timingInfo = segmentInfo.timingInfo || {}; var trackInfo = this.getMediaInfo_(), prioritizedTimingInfo = "main" === this.loaderType_ && trackInfo && trackInfo.hasVideo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo; prioritizedTimingInfo && (segmentInfo.timingInfo.end = "number" == typeof prioritizedTimingInfo.end ? prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration); - }, _proto.handleAppendsDone_ = function() { + }, _proto.handleAppendsDone_ = function handleAppendsDone_() { if (this.pendingSegment_ && this.trigger("appendsdone"), !this.pendingSegment_) { this.state = "READY", this.paused() || this.monitorBuffer_(); return; @@ -12475,14 +12475,14 @@ return; } null !== this.mediaIndex && this.trigger("bandwidthupdate"), this.trigger("progress"), this.mediaIndex = segmentInfo.mediaIndex, this.partIndex = segmentInfo.partIndex, this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex) && this.endOfStream(), this.trigger("appended"), segmentInfo.hasAppendedData_ && this.mediaAppends++, this.paused() || this.monitorBuffer_(); - }, _proto.recordThroughput_ = function(segmentInfo) { + }, _proto.recordThroughput_ = function recordThroughput_(segmentInfo) { if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) { this.logger_("Ignoring segment's throughput because its duration of " + segmentInfo.duration + " is less than the min to record " + MIN_SEGMENT_DURATION_TO_SAVE_STATS); return; } var rate = this.throughput.rate, segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1, segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8000); this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count; - }, _proto.addSegmentMetadataCue_ = function(segmentInfo) { + }, _proto.addSegmentMetadataCue_ = function addSegmentMetadataCue_(segmentInfo) { if (this.segmentMetadataTrack_) { var segment = segmentInfo.segment, start = segment.start, end = segment.end; if (finite(start) && finite(end)) { @@ -12548,7 +12548,7 @@ }, inSourceBuffers = function(mediaSource, sourceBuffer) { return mediaSource && sourceBuffer && -1 !== Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer); }, actions = { - appendBuffer: function(bytes, segmentInfo, onError) { + appendBuffer: function appendBuffer(bytes, segmentInfo, onError) { return function(type, sourceUpdater) { var sourceBuffer = sourceUpdater[type + "Buffer"]; if (inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) { @@ -12561,7 +12561,7 @@ } }; }, - remove: function(start, end) { + remove: function remove(start, end) { return function(type, sourceUpdater) { var sourceBuffer = sourceUpdater[type + "Buffer"]; if (inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) { @@ -12574,18 +12574,18 @@ } }; }, - timestampOffset: function(offset) { + timestampOffset: function timestampOffset(offset) { return function(type, sourceUpdater) { var sourceBuffer = sourceUpdater[type + "Buffer"]; inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer) && (sourceUpdater.logger_("Setting " + type + "timestampOffset to " + offset), sourceBuffer.timestampOffset = offset); }; }, - callback: function(_callback) { + callback: function callback(_callback) { return function(type, sourceUpdater) { _callback(); }; }, - endOfStream: function(error) { + endOfStream: function endOfStream(error) { return function(sourceUpdater) { if ("open" === sourceUpdater.mediaSource.readyState) { sourceUpdater.logger_("Calling mediaSource endOfStream(" + (error || "") + ")"); @@ -12597,7 +12597,7 @@ } }; }, - duration: function(_duration) { + duration: function duration(_duration) { return function(sourceUpdater) { sourceUpdater.logger_("Setting mediaSource duration to " + _duration); try { @@ -12607,7 +12607,7 @@ } }; }, - abort: function() { + abort: function abort() { return function(type, sourceUpdater) { if ("open" === sourceUpdater.mediaSource.readyState) { var sourceBuffer = sourceUpdater[type + "Buffer"]; @@ -12622,7 +12622,7 @@ } }; }, - addSourceBuffer: function(type, codec) { + addSourceBuffer: function addSourceBuffer(type, codec) { return function(sourceUpdater) { var titleType = toTitleCase(type), mime = (0, _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__._5)(codec); sourceUpdater.logger_("Adding " + type + "Buffer with codec " + codec + " to mediaSource"); @@ -12630,7 +12630,7 @@ sourceBuffer.addEventListener("updateend", sourceUpdater["on" + titleType + "UpdateEnd_"]), sourceBuffer.addEventListener("error", sourceUpdater["on" + titleType + "Error_"]), sourceUpdater.codecs[type] = codec, sourceUpdater[type + "Buffer"] = sourceBuffer; }; }, - removeSourceBuffer: function(type) { + removeSourceBuffer: function removeSourceBuffer(type) { return function(sourceUpdater) { var sourceBuffer = sourceUpdater[type + "Buffer"]; if (cleanupBuffer(type, sourceUpdater), inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) { @@ -12643,7 +12643,7 @@ } }; }, - changeType: function(codec) { + changeType: function changeType(codec) { return function(type, sourceUpdater) { var sourceBuffer = sourceUpdater[type + "Buffer"], mime = (0, _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__._5)(codec); inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer) && sourceUpdater.codecs[type] !== codec && (sourceUpdater.logger_("changing " + type + "Buffer codec from " + sourceUpdater.codecs[type] + " to " + codec), sourceBuffer.changeType(mime), sourceUpdater.codecs[type] = codec); @@ -12681,33 +12681,33 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(SourceUpdater, _videojs$EventTarget); var _proto = SourceUpdater.prototype; - return _proto.initializedEme = function() { + return _proto.initializedEme = function initializedEme() { this.initializedEme_ = !0, this.triggerReady(); - }, _proto.hasCreatedSourceBuffers = function() { + }, _proto.hasCreatedSourceBuffers = function hasCreatedSourceBuffers() { return this.createdSourceBuffers_; - }, _proto.hasInitializedAnyEme = function() { + }, _proto.hasInitializedAnyEme = function hasInitializedAnyEme() { return this.initializedEme_; - }, _proto.ready = function() { + }, _proto.ready = function ready() { return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme(); - }, _proto.createSourceBuffers = function(codecs) { + }, _proto.createSourceBuffers = function createSourceBuffers(codecs) { this.hasCreatedSourceBuffers() || (this.addOrChangeSourceBuffers(codecs), this.createdSourceBuffers_ = !0, this.trigger("createdsourcebuffers"), this.triggerReady()); - }, _proto.triggerReady = function() { + }, _proto.triggerReady = function triggerReady() { this.ready() && !this.triggeredReady_ && (this.triggeredReady_ = !0, this.trigger("ready")); - }, _proto.addSourceBuffer = function(type, codec) { + }, _proto.addSourceBuffer = function addSourceBuffer(type, codec) { pushQueue({ type: "mediaSource", sourceUpdater: this, action: actions.addSourceBuffer(type, codec), name: "addSourceBuffer" }); - }, _proto.abort = function(type) { + }, _proto.abort = function abort(type) { pushQueue({ type: type, sourceUpdater: this, action: actions.abort(type), name: "abort" }); - }, _proto.removeSourceBuffer = function(type) { + }, _proto.removeSourceBuffer = function removeSourceBuffer(type) { if (!this.canRemoveSourceBuffer()) { videojs.log.error("removeSourceBuffer is not supported!"); return; @@ -12718,13 +12718,13 @@ action: actions.removeSourceBuffer(type), name: "removeSourceBuffer" }); - }, _proto.canRemoveSourceBuffer = function() { + }, _proto.canRemoveSourceBuffer = function canRemoveSourceBuffer() { return !videojs.browser.IE_VERSION && !videojs.browser.IS_FIREFOX && global_window__WEBPACK_IMPORTED_MODULE_0___default().MediaSource && global_window__WEBPACK_IMPORTED_MODULE_0___default().MediaSource.prototype && "function" == typeof global_window__WEBPACK_IMPORTED_MODULE_0___default().MediaSource.prototype.removeSourceBuffer; - }, SourceUpdater.canChangeType = function() { + }, SourceUpdater.canChangeType = function canChangeType() { return global_window__WEBPACK_IMPORTED_MODULE_0___default().SourceBuffer && global_window__WEBPACK_IMPORTED_MODULE_0___default().SourceBuffer.prototype && "function" == typeof global_window__WEBPACK_IMPORTED_MODULE_0___default().SourceBuffer.prototype.changeType; - }, _proto.canChangeType = function() { + }, _proto.canChangeType = function canChangeType() { return this.constructor.canChangeType(); - }, _proto.changeType = function(type, codec) { + }, _proto.changeType = function changeType(type, codec) { if (!this.canChangeType()) { videojs.log.error("changeType is not supported!"); return; @@ -12735,7 +12735,7 @@ action: actions.changeType(codec), name: "changeType" }); - }, _proto.addOrChangeSourceBuffers = function(codecs) { + }, _proto.addOrChangeSourceBuffers = function addOrChangeSourceBuffers(codecs) { var _this2 = this; if (!codecs || "object" != typeof codecs || 0 === Object.keys(codecs).length) throw Error("Cannot addOrChangeSourceBuffers to undefined codecs"); Object.keys(codecs).forEach(function(type) { @@ -12743,7 +12743,7 @@ if (!_this2.hasCreatedSourceBuffers()) return _this2.addSourceBuffer(type, codec); _this2.canChangeType() && _this2.changeType(type, codec); }); - }, _proto.appendBuffer = function(options, doneFn) { + }, _proto.appendBuffer = function appendBuffer(options, doneFn) { var _this3 = this, segmentInfo = options.segmentInfo, type = options.type, bytes = options.bytes; if (this.processedAppend_ = !0, "audio" === type && this.videoBuffer && !this.videoAppendQueued_) { this.delayedAudioAppendQueue_.push([ @@ -12767,14 +12767,14 @@ _this3.appendBuffer.apply(_this3, que); }); } - }, _proto.audioBuffered = function() { + }, _proto.audioBuffered = function audioBuffered() { return inSourceBuffers(this.mediaSource, this.audioBuffer) && this.audioBuffer.buffered ? this.audioBuffer.buffered : videojs.createTimeRange(); - }, _proto.videoBuffered = function() { + }, _proto.videoBuffered = function videoBuffered() { return inSourceBuffers(this.mediaSource, this.videoBuffer) && this.videoBuffer.buffered ? this.videoBuffer.buffered : videojs.createTimeRange(); - }, _proto.buffered = function() { + }, _proto.buffered = function buffered() { var video = inSourceBuffers(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null, audio = inSourceBuffers(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null; return audio && !video ? this.audioBuffered() : video && !audio ? this.videoBuffered() : bufferIntersection(this.audioBuffered(), this.videoBuffered()); - }, _proto.setDuration = function(duration, doneFn) { + }, _proto.setDuration = function setDuration(duration, doneFn) { void 0 === doneFn && (doneFn = noop), pushQueue({ type: "mediaSource", sourceUpdater: this, @@ -12782,7 +12782,7 @@ name: "duration", doneFn: doneFn }); - }, _proto.endOfStream = function(error, doneFn) { + }, _proto.endOfStream = function endOfStream(error, doneFn) { void 0 === error && (error = null), void 0 === doneFn && (doneFn = noop), "string" != typeof error && (error = void 0), pushQueue({ type: "mediaSource", sourceUpdater: this, @@ -12790,7 +12790,7 @@ name: "endOfStream", doneFn: doneFn }); - }, _proto.removeAudio = function(start, end, done) { + }, _proto.removeAudio = function removeAudio(start, end, done) { if (void 0 === done && (done = noop), !this.audioBuffered().length || 0 === this.audioBuffered().end(0)) { done(); return; @@ -12802,7 +12802,7 @@ doneFn: done, name: "remove" }); - }, _proto.removeVideo = function(start, end, done) { + }, _proto.removeVideo = function removeVideo(start, end, done) { if (void 0 === done && (done = noop), !this.videoBuffered().length || 0 === this.videoBuffered().end(0)) { done(); return; @@ -12814,37 +12814,37 @@ doneFn: done, name: "remove" }); - }, _proto.updating = function() { + }, _proto.updating = function updating() { return !!(_updating("audio", this) || _updating("video", this)); - }, _proto.audioTimestampOffset = function(offset) { + }, _proto.audioTimestampOffset = function audioTimestampOffset(offset) { return void 0 !== offset && this.audioBuffer && this.audioTimestampOffset_ !== offset && (pushQueue({ type: "audio", sourceUpdater: this, action: actions.timestampOffset(offset), name: "timestampOffset" }), this.audioTimestampOffset_ = offset), this.audioTimestampOffset_; - }, _proto.videoTimestampOffset = function(offset) { + }, _proto.videoTimestampOffset = function videoTimestampOffset(offset) { return void 0 !== offset && this.videoBuffer && this.videoTimestampOffset !== offset && (pushQueue({ type: "video", sourceUpdater: this, action: actions.timestampOffset(offset), name: "timestampOffset" }), this.videoTimestampOffset_ = offset), this.videoTimestampOffset_; - }, _proto.audioQueueCallback = function(callback) { + }, _proto.audioQueueCallback = function audioQueueCallback(callback) { this.audioBuffer && pushQueue({ type: "audio", sourceUpdater: this, action: actions.callback(callback), name: "callback" }); - }, _proto.videoQueueCallback = function(callback) { + }, _proto.videoQueueCallback = function videoQueueCallback(callback) { this.videoBuffer && pushQueue({ type: "video", sourceUpdater: this, action: actions.callback(callback), name: "callback" }); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { var _this4 = this; this.trigger("dispose"), bufferTypes.forEach(function(type) { _this4.abort(type), _this4.canRemoveSourceBuffer() ? _this4.removeSourceBuffer(type) : _this4[type + "QueueCallback"](function() { @@ -12863,9 +12863,9 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(VTTSegmentLoader, _SegmentLoader); var _proto = VTTSegmentLoader.prototype; - return _proto.createTransmuxer_ = function() { + return _proto.createTransmuxer_ = function createTransmuxer_() { return null; - }, _proto.buffered_ = function() { + }, _proto.buffered_ = function buffered_() { if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) return videojs.createTimeRanges(); var cues = this.subtitlesTrack_.cues, start = cues[0].startTime, end = cues[cues.length - 1].startTime; return videojs.createTimeRanges([ @@ -12874,7 +12874,7 @@ end ] ]); - }, _proto.initSegmentForMap = function(map, set) { + }, _proto.initSegmentForMap = function initSegmentForMap(map, set) { if (void 0 === set && (set = !1), !map) return null; var id = initSegmentId(map), storedMap = this.initSegments_[id]; if (set && !storedMap && map.bytes) { @@ -12886,15 +12886,15 @@ }; } return storedMap || map; - }, _proto.couldBeginLoading_ = function() { + }, _proto.couldBeginLoading_ = function couldBeginLoading_() { return this.playlist_ && this.subtitlesTrack_ && !this.paused(); - }, _proto.init_ = function() { + }, _proto.init_ = function init_() { return this.state = "READY", this.resetEverything(), this.monitorBuffer_(); - }, _proto.track = function(_track) { + }, _proto.track = function track(_track) { return void 0 === _track || (this.subtitlesTrack_ = _track, "INIT" === this.state && this.couldBeginLoading_() && this.init_()), this.subtitlesTrack_; - }, _proto.remove = function(start, end) { + }, _proto.remove = function remove(start, end) { removeCuesFromTrack(start, end, this.subtitlesTrack_); - }, _proto.fillBuffer_ = function() { + }, _proto.fillBuffer_ = function fillBuffer_() { var _this2 = this, segmentInfo = this.chooseNextRequest_(); if (segmentInfo) { if (null === this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline)) { @@ -12905,11 +12905,11 @@ } this.loadSegment_(segmentInfo); } - }, _proto.timestampOffsetForSegment_ = function() { + }, _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_() { return null; - }, _proto.chooseNextRequest_ = function() { + }, _proto.chooseNextRequest_ = function chooseNextRequest_() { return this.skipEmptySegments_(_SegmentLoader.prototype.chooseNextRequest_.call(this)); - }, _proto.skipEmptySegments_ = function(segmentInfo) { + }, _proto.skipEmptySegments_ = function skipEmptySegments_(segmentInfo) { for(; segmentInfo && segmentInfo.segment.empty;){ if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) { segmentInfo = null; @@ -12923,9 +12923,9 @@ }); } return segmentInfo; - }, _proto.stopForError = function(error) { + }, _proto.stopForError = function stopForError(error) { this.error(error), this.state = "READY", this.pause(), this.trigger("error"); - }, _proto.segmentRequestFinished_ = function(error, simpleSegment, result) { + }, _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) { var _this3 = this; if (!this.subtitlesTrack_) { this.state = "READY"; @@ -12948,7 +12948,7 @@ message: "Error loading vtt.js" }); }; - loadHandler = function() { + loadHandler = function loadHandler() { _this3.subtitlesTrack_.tech_.off("vttjserror", errorHandler), _this3.segmentRequestFinished_(error, simpleSegment, result); }, this.state = "WAITING_ON_VTTJS", this.subtitlesTrack_.tech_.one("vttjsloaded", loadHandler), this.subtitlesTrack_.tech_.one("vttjserror", errorHandler); return; @@ -12975,7 +12975,7 @@ segmentInfo.byteLength = segmentInfo.bytes.byteLength, this.mediaSecondsLoaded += segment.duration, segmentInfo.cues.forEach(function(cue) { _this3.subtitlesTrack_.addCue(_this3.featuresNativeTextTracks_ ? new (global_window__WEBPACK_IMPORTED_MODULE_0___default()).VTTCue(cue.startTime, cue.endTime, cue.text) : cue); }), removeDuplicateCuesFromTrack(this.subtitlesTrack_), this.handleAppendsDone_(); - }, _proto.handleData_ = function() {}, _proto.updateTimingInfoEnd_ = function() {}, _proto.parseVTTCues_ = function(segmentInfo) { + }, _proto.handleData_ = function handleData_() {}, _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_() {}, _proto.parseVTTCues_ = function parseVTTCues_(segmentInfo) { var decoder, decodeBytesToString = !1; "function" == typeof global_window__WEBPACK_IMPORTED_MODULE_0___default().TextDecoder ? decoder = new (global_window__WEBPACK_IMPORTED_MODULE_0___default()).TextDecoder("utf8") : (decoder = global_window__WEBPACK_IMPORTED_MODULE_0___default().WebVTT.StringDecoder(), decodeBytesToString = !0); var parser = new (global_window__WEBPACK_IMPORTED_MODULE_0___default()).WebVTT.Parser(global_window__WEBPACK_IMPORTED_MODULE_0___default(), global_window__WEBPACK_IMPORTED_MODULE_0___default().vttjs, decoder); @@ -12992,7 +12992,7 @@ } var segmentData = segmentInfo.bytes; decodeBytesToString && (segmentData = uint8ToUtf8(segmentData)), parser.parse(segmentData), parser.flush(); - }, _proto.updateTimeMapping_ = function(segmentInfo, mappingObj, playlist) { + }, _proto.updateTimeMapping_ = function updateTimeMapping_(segmentInfo, mappingObj, playlist) { var segment = segmentInfo.segment; if (mappingObj) { if (!segmentInfo.cues.length) { @@ -13039,7 +13039,7 @@ }, syncPointStrategies = [ { name: "VOD", - run: function(syncController, playlist, duration, currentTimeline, currentTime) { + run: function run(syncController, playlist, duration, currentTimeline, currentTime) { return duration !== 1 / 0 ? { time: 0, segmentIndex: 0, @@ -13049,7 +13049,7 @@ }, { name: "ProgramDateTime", - run: function(syncController, playlist, duration, currentTimeline, currentTime) { + run: function run(syncController, playlist, duration, currentTimeline, currentTime) { if (!Object.keys(syncController.timelineToDatetimeMappings).length) return null; var syncPoint = null, lastDistance = null, partsAndSegments = getPartsAndSegments(playlist); currentTime = currentTime || 0; @@ -13072,7 +13072,7 @@ }, { name: "Segment", - run: function(syncController, playlist, duration, currentTimeline, currentTime) { + run: function run(syncController, playlist, duration, currentTimeline, currentTime) { var syncPoint = null, lastDistance = null; currentTime = currentTime || 0; for(var partsAndSegments = getPartsAndSegments(playlist), i = 0; i < partsAndSegments.length; i++){ @@ -13092,7 +13092,7 @@ }, { name: "Discontinuity", - run: function(syncController, playlist, duration, currentTimeline, currentTime) { + run: function run(syncController, playlist, duration, currentTimeline, currentTime) { var syncPoint = null; if (currentTime = currentTime || 0, playlist.discontinuityStarts && playlist.discontinuityStarts.length) for(var lastDistance = null, i = 0; i < playlist.discontinuityStarts.length; i++){ var segmentIndex = playlist.discontinuityStarts[i], discontinuity = playlist.discontinuitySequence + i + 1, discontinuitySync = syncController.discontinuities[discontinuity]; @@ -13111,7 +13111,7 @@ }, { name: "Playlist", - run: function(syncController, playlist, duration, currentTimeline, currentTime) { + run: function run(syncController, playlist, duration, currentTimeline, currentTime) { return playlist.syncInfo ? { time: playlist.syncInfo.time, segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence, @@ -13126,13 +13126,13 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(SyncController, _videojs$EventTarget); var _proto = SyncController.prototype; - return _proto.getSyncPoint = function(playlist, duration, currentTimeline, currentTime) { + return _proto.getSyncPoint = function getSyncPoint(playlist, duration, currentTimeline, currentTime) { var syncPoints = this.runStrategies_(playlist, duration, currentTimeline, currentTime); return syncPoints.length ? this.selectSyncPoint_(syncPoints, { key: "time", value: currentTime }) : null; - }, _proto.getExpiredTime = function(playlist, duration) { + }, _proto.getExpiredTime = function getExpiredTime(playlist, duration) { if (!playlist || !playlist.segments) return null; var syncPoints = this.runStrategies_(playlist, duration, playlist.discontinuitySequence, 0); if (!syncPoints.length) return null; @@ -13146,7 +13146,7 @@ startIndex: syncPoint.segmentIndex, endIndex: 0 })); - }, _proto.runStrategies_ = function(playlist, duration, currentTimeline, currentTime) { + }, _proto.runStrategies_ = function runStrategies_(playlist, duration, currentTimeline, currentTime) { for(var syncPoints = [], i = 0; i < syncPointStrategies.length; i++){ var strategy = syncPointStrategies[i], syncPoint = strategy.run(this, playlist, duration, currentTimeline, currentTime); syncPoint && (syncPoint.strategy = strategy.name, syncPoints.push({ @@ -13155,13 +13155,13 @@ })); } return syncPoints; - }, _proto.selectSyncPoint_ = function(syncPoints, target) { + }, _proto.selectSyncPoint_ = function selectSyncPoint_(syncPoints, target) { for(var bestSyncPoint = syncPoints[0].syncPoint, bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value), bestStrategy = syncPoints[0].strategy, i = 1; i < syncPoints.length; i++){ var newDistance = Math.abs(syncPoints[i].syncPoint[target.key] - target.value); newDistance < bestDistance && (bestDistance = newDistance, bestSyncPoint = syncPoints[i].syncPoint, bestStrategy = syncPoints[i].strategy); } return this.logger_("syncPoint for [" + target.key + ": " + target.value + "] chosen with strategy [" + bestStrategy + "]: [time:" + bestSyncPoint.time + ", segmentIndex:" + bestSyncPoint.segmentIndex + ("number" == typeof bestSyncPoint.partIndex ? ",partIndex:" + bestSyncPoint.partIndex : "") + "]"), bestSyncPoint; - }, _proto.saveExpiredSegmentInfo = function(oldPlaylist, newPlaylist) { + }, _proto.saveExpiredSegmentInfo = function saveExpiredSegmentInfo(oldPlaylist, newPlaylist) { var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence; if (mediaSequenceDiff > 86400) { videojs.log.warn("Not saving expired segment info. Media sequence gap " + mediaSequenceDiff + " is too large."); @@ -13177,12 +13177,12 @@ break; } } - }, _proto.setDateTimeMappingForStart = function(playlist) { + }, _proto.setDateTimeMappingForStart = function setDateTimeMappingForStart(playlist) { if (this.timelineToDatetimeMappings = {}, playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) { var firstSegment = playlist.segments[0], playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1000; this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp; } - }, _proto.saveSegmentTimingInfo = function(_ref) { + }, _proto.saveSegmentTimingInfo = function saveSegmentTimingInfo(_ref) { var segmentInfo = _ref.segmentInfo, shouldSaveTimelineMapping = _ref.shouldSaveTimelineMapping, didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping), segment = segmentInfo.segment; didCalculateSegmentTimeMapping && (this.saveDiscontinuitySyncInfo_(segmentInfo), segmentInfo.playlist.syncInfo || (segmentInfo.playlist.syncInfo = { mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex, @@ -13190,11 +13190,11 @@ })); var dateTime = segment.dateTimeObject; segment.discontinuity && shouldSaveTimelineMapping && dateTime && (this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1000)); - }, _proto.timestampOffsetForTimeline = function(timeline) { + }, _proto.timestampOffsetForTimeline = function timestampOffsetForTimeline(timeline) { return void 0 === this.timelines[timeline] ? null : this.timelines[timeline].time; - }, _proto.mappingForTimeline = function(timeline) { + }, _proto.mappingForTimeline = function mappingForTimeline(timeline) { return void 0 === this.timelines[timeline] ? null : this.timelines[timeline].mapping; - }, _proto.calculateSegmentTimeMapping_ = function(segmentInfo, timingInfo, shouldSaveTimelineMapping) { + }, _proto.calculateSegmentTimeMapping_ = function calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) { var start, end, segment = segmentInfo.segment, part = segmentInfo.part, mappingObj = this.timelines[segmentInfo.timeline]; if ("number" == typeof segmentInfo.timestampOffset) mappingObj = { time: segmentInfo.startOfSegment, @@ -13205,7 +13205,7 @@ start = timingInfo.start + mappingObj.mapping, end = timingInfo.end + mappingObj.mapping; } return part && (part.start = start, part.end = end), (!segment.start || start < segment.start) && (segment.start = start), segment.end = end, !0; - }, _proto.saveDiscontinuitySyncInfo_ = function(segmentInfo) { + }, _proto.saveDiscontinuitySyncInfo_ = function saveDiscontinuitySyncInfo_(segmentInfo) { var playlist = segmentInfo.playlist, segment = segmentInfo.segment; if (segment.discontinuity) this.discontinuities[segment.timeline] = { time: segment.start, @@ -13231,7 +13231,7 @@ }; } } - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.trigger("dispose"), this.off(); }, SyncController; }(videojs.EventTarget), TimelineChangeController = function(_videojs$EventTarget) { @@ -13241,23 +13241,23 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(TimelineChangeController, _videojs$EventTarget); var _proto = TimelineChangeController.prototype; - return _proto.clearPendingTimelineChange = function(type) { + return _proto.clearPendingTimelineChange = function clearPendingTimelineChange(type) { this.pendingTimelineChanges_[type] = null, this.trigger("pendingtimelinechange"); - }, _proto.pendingTimelineChange = function(_ref) { + }, _proto.pendingTimelineChange = function pendingTimelineChange(_ref) { var type = _ref.type, from = _ref.from, to = _ref.to; return "number" == typeof from && "number" == typeof to && (this.pendingTimelineChanges_[type] = { type: type, from: from, to: to }, this.trigger("pendingtimelinechange")), this.pendingTimelineChanges_[type]; - }, _proto.lastTimelineChange = function(_ref2) { + }, _proto.lastTimelineChange = function lastTimelineChange(_ref2) { var type = _ref2.type, from = _ref2.from, to = _ref2.to; return "number" == typeof from && "number" == typeof to && (this.lastTimelineChanges_[type] = { type: type, from: from, to: to }, delete this.pendingTimelineChanges_[type], this.trigger("timelinechange")), this.lastTimelineChanges_[type]; - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.trigger("dispose"), this.pendingTimelineChanges_ = {}, this.lastTimelineChanges_ = {}, this.off(); }, TimelineChangeController; }(videojs.EventTarget), Decrypter = factory(transform(getWorkerString(function() { @@ -13265,7 +13265,7 @@ return fn(module = { path: basedir, exports: {}, - require: function(path, base) { + require: function require(path, base) { return function() { throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs"); }(path, null == base ? module.path : base); @@ -13284,7 +13284,7 @@ }, module.exports.default = module.exports, module.exports.__esModule = !0; }), setPrototypeOf = createCommonjsModule(function(module) { function _setPrototypeOf(o, p) { - return module.exports = _setPrototypeOf = Object.setPrototypeOf || function(o, p) { + return module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { return o.__proto__ = p, o; }, module.exports.default = module.exports, module.exports.__esModule = !0, _setPrototypeOf(o, p); } @@ -13298,21 +13298,21 @@ this.listeners = {}; } var _proto = Stream.prototype; - return _proto.on = function(type, listener) { + return _proto.on = function on(type, listener) { this.listeners[type] || (this.listeners[type] = []), this.listeners[type].push(listener); - }, _proto.off = function(type, listener) { + }, _proto.off = function off(type, listener) { if (!this.listeners[type]) return !1; var index = this.listeners[type].indexOf(listener); return this.listeners[type] = this.listeners[type].slice(0), this.listeners[type].splice(index, 1), index > -1; - }, _proto.trigger = function(type) { + }, _proto.trigger = function trigger(type) { var callbacks = this.listeners[type]; if (callbacks) { if (2 == arguments.length) for(var length = callbacks.length, i = 0; i < length; ++i)callbacks[i].call(this, arguments[1]); else for(var args = Array.prototype.slice.call(arguments, 1), _length = callbacks.length, _i = 0; _i < _length; ++_i)callbacks[_i].apply(this, args); } - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.listeners = {}; - }, _proto.pipe = function(destination) { + }, _proto.pipe = function pipe(destination) { this.on("data", function(data) { destination.push(data); }); @@ -13365,7 +13365,7 @@ ], i = keyLen; i < 4 * keyLen + 28; i++)tmp = encKey[i - 1], (i % keyLen == 0 || 8 === keyLen && i % keyLen == 4) && (tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[255 & tmp], i % keyLen == 0 && (tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24, rcon = rcon << 1 ^ (rcon >> 7) * 283)), encKey[i] = encKey[i - keyLen] ^ tmp; for(j = 0; i; j++, i--)tmp = encKey[3 & j ? i : i - 4], i <= 4 || j < 4 ? decKey[j] = tmp : decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[255 & tmp]]; } - return AES.prototype.decrypt = function(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) { + return AES.prototype.decrypt = function decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) { var a2, b2, c2, i, key = this._key[1], a = encrypted0 ^ key[0], b = encrypted3 ^ key[1], c = encrypted2 ^ key[2], d = encrypted1 ^ key[3], nInnerRounds = key.length / 4 - 2, kIndex = 4, table = this._tables[1], table0 = table[0], table1 = table[1], table2 = table[2], table3 = table[3], sbox = table[4]; for(i = 0; i < nInnerRounds; i++)a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[255 & d] ^ key[kIndex], b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[255 & a] ^ key[kIndex + 1], c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[255 & b] ^ key[kIndex + 2], d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[255 & c] ^ key[kIndex + 3], kIndex += 4, a = a2, b = b2, c = c2; for(i = 0; i < 4; i++)out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[255 & d] ^ key[kIndex++], a2 = a, a = b, b = c, c = d, d = a2; @@ -13377,9 +13377,9 @@ } inheritsLoose(AsyncStream, _Stream); var _proto = AsyncStream.prototype; - return _proto.processJob_ = function() { + return _proto.processJob_ = function processJob_() { this.jobs.shift()(), this.jobs.length ? this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay) : this.timeout_ = null; - }, _proto.push = function(job) { + }, _proto.push = function push(job) { this.jobs.push(job), this.timeout_ || (this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay)); }, AsyncStream; }(Stream), ntoh = function(word) { @@ -13401,7 +13401,7 @@ done(null, decrypted.subarray(0, decrypted.byteLength - decrypted[decrypted.byteLength - 1])); }); } - return Decrypter.prototype.decryptChunk_ = function(encrypted, key, initVector, decrypted) { + return Decrypter.prototype.decryptChunk_ = function decryptChunk_(encrypted, key, initVector, decrypted) { return function() { var bytes = decrypt(encrypted, key, initVector); decrypted.set(bytes, encrypted.byteOffset); @@ -13409,7 +13409,7 @@ }, createClass(Decrypter, null, [ { key: "STEP", - get: function() { + get: function get() { return 32000; } } @@ -13444,7 +13444,7 @@ }, startLoaders = function(playlistLoader, mediaType) { mediaType.activePlaylistLoader = playlistLoader, playlistLoader.load(); }, onError = { - AUDIO: function(type, settings) { + AUDIO: function AUDIO(type, settings) { return function() { var segmentLoader = settings.segmentLoaders[type], mediaType = settings.mediaTypes[type], blacklistCurrentPlaylist = settings.blacklistCurrentPlaylist; stopLoaders(segmentLoader, mediaType); @@ -13461,7 +13461,7 @@ mediaType.onTrackChanged(); }; }, - SUBTITLES: function(type, settings) { + SUBTITLES: function SUBTITLES(type, settings) { return function() { var segmentLoader = settings.segmentLoaders[type], mediaType = settings.mediaTypes[type]; videojs.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."), stopLoaders(segmentLoader, mediaType); @@ -13470,7 +13470,7 @@ }; } }, setupListeners = { - AUDIO: function(type, playlistLoader, settings) { + AUDIO: function AUDIO(type, playlistLoader, settings) { if (playlistLoader) { var tech = settings.tech, requestOptions = settings.requestOptions, segmentLoader = settings.segmentLoaders[type]; playlistLoader.on("loadedmetadata", function() { @@ -13481,7 +13481,7 @@ }), playlistLoader.on("error", onError[type](type, settings)); } }, - SUBTITLES: function(type, playlistLoader, settings) { + SUBTITLES: function SUBTITLES(type, playlistLoader, settings) { var tech = settings.tech, requestOptions = settings.requestOptions, segmentLoader = settings.segmentLoaders[type], mediaType = settings.mediaTypes[type]; playlistLoader.on("loadedmetadata", function() { var media = playlistLoader.media(); @@ -13491,7 +13491,7 @@ }), playlistLoader.on("error", onError[type](type, settings)); } }, initialize = { - AUDIO: function(type, settings) { + AUDIO: function AUDIO(type, settings) { var vhs = settings.vhs, sourceType = settings.sourceType, segmentLoader = settings.segmentLoaders[type], requestOptions = settings.requestOptions, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$ = settings.mediaTypes[type], groups = _settings$mediaTypes$.groups, tracks = _settings$mediaTypes$.tracks, logger_ = _settings$mediaTypes$.logger_, masterPlaylistLoader = settings.masterPlaylistLoader, audioOnlyMaster = isAudioOnly(masterPlaylistLoader.master); for(var groupId in (!mediaGroups[type] || 0 === Object.keys(mediaGroups[type]).length) && (mediaGroups[type] = { main: { @@ -13518,7 +13518,7 @@ } segmentLoader.on("error", onError[type](type, settings)); }, - SUBTITLES: function(type, settings) { + SUBTITLES: function SUBTITLES(type, settings) { var tech = settings.tech, vhs = settings.vhs, sourceType = settings.sourceType, segmentLoader = settings.segmentLoaders[type], requestOptions = settings.requestOptions, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$2 = settings.mediaTypes[type], groups = _settings$mediaTypes$2.groups, tracks = _settings$mediaTypes$2.tracks, masterPlaylistLoader = settings.masterPlaylistLoader; for(var groupId in mediaGroups[type])for(var variantLabel in groups[groupId] || (groups[groupId] = []), mediaGroups[type][groupId])if (!mediaGroups[type][groupId][variantLabel].forced) { var properties = mediaGroups[type][groupId][variantLabel], playlistLoader = void 0; @@ -13545,7 +13545,7 @@ } segmentLoader.on("error", onError[type](type, settings)); }, - "CLOSED-CAPTIONS": function(type, settings) { + "CLOSED-CAPTIONS": function CLOSEDCAPTIONS(type, settings) { var tech = settings.tech, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$3 = settings.mediaTypes[type], groups = _settings$mediaTypes$3.groups, tracks = _settings$mediaTypes$3.tracks; for(var groupId in mediaGroups[type])for(var variantLabel in groups[groupId] || (groups[groupId] = []), mediaGroups[type][groupId]){ var properties = mediaGroups[type][groupId][variantLabel]; @@ -13575,14 +13575,14 @@ for(var i = 0; i < list.length; i++)if (playlistMatch(media, list[i]) || list[i].playlists && groupMatch(list[i].playlists, media)) return !0; return !1; }, activeTrack = { - AUDIO: function(type, settings) { + AUDIO: function AUDIO(type, settings) { return function() { var tracks = settings.mediaTypes[type].tracks; for(var id in tracks)if (tracks[id].enabled) return tracks[id]; return null; }; }, - SUBTITLES: function(type, settings) { + SUBTITLES: function SUBTITLES(type, settings) { return function() { var tracks = settings.mediaTypes[type].tracks; for(var id in tracks)if ("showing" === tracks[id].mode || "hidden" === tracks[id].mode) return tracks[id]; @@ -13769,19 +13769,19 @@ captionServices: captionServices, mediaSource: _this.mediaSource, currentTime: _this.tech_.currentTime.bind(_this.tech_), - seekable: function() { + seekable: function seekable() { return _this.seekable(); }, - seeking: function() { + seeking: function seeking() { return _this.tech_.seeking(); }, - duration: function() { + duration: function duration() { return _this.duration(); }, - hasPlayed: function() { + hasPlayed: function hasPlayed() { return _this.hasPlayed_; }, - goalBufferLength: function() { + goalBufferLength: function goalBufferLength() { return _this.goalBufferLength(); }, bandwidth: bandwidth, @@ -13823,32 +13823,32 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(MasterPlaylistController, _videojs$EventTarget); var _proto = MasterPlaylistController.prototype; - return _proto.mainAppendsToLoadedData_ = function() { + return _proto.mainAppendsToLoadedData_ = function mainAppendsToLoadedData_() { return this.mainAppendsToLoadedData__; - }, _proto.audioAppendsToLoadedData_ = function() { + }, _proto.audioAppendsToLoadedData_ = function audioAppendsToLoadedData_() { return this.audioAppendsToLoadedData__; - }, _proto.appendsToLoadedData_ = function() { + }, _proto.appendsToLoadedData_ = function appendsToLoadedData_() { var main = this.mainAppendsToLoadedData_(), audio = this.audioAppendsToLoadedData_(); return -1 === main || -1 === audio ? -1 : main + audio; - }, _proto.timeToLoadedData_ = function() { + }, _proto.timeToLoadedData_ = function timeToLoadedData_() { return this.timeToLoadedData__; - }, _proto.checkABR_ = function() { + }, _proto.checkABR_ = function checkABR_() { var nextPlaylist = this.selectPlaylist(); nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist) && this.switchMedia_(nextPlaylist, "abr"); - }, _proto.switchMedia_ = function(playlist, cause, delay) { + }, _proto.switchMedia_ = function switchMedia_(playlist, cause, delay) { var oldMedia = this.media(), oldId = oldMedia && (oldMedia.id || oldMedia.uri), newId = playlist.id || playlist.uri; oldId && oldId !== newId && (this.logger_("switch media " + oldId + " -> " + newId + " from " + cause), this.tech_.trigger({ type: "usage", name: "vhs-rendition-change-" + cause })), this.masterPlaylistLoader_.media(playlist, delay); - }, _proto.startABRTimer_ = function() { + }, _proto.startABRTimer_ = function startABRTimer_() { var _this2 = this; this.stopABRTimer_(), this.abrTimer_ = global_window__WEBPACK_IMPORTED_MODULE_0___default().setInterval(function() { return _this2.checkABR_(); }, 250); - }, _proto.stopABRTimer_ = function() { + }, _proto.stopABRTimer_ = function stopABRTimer_() { this.tech_.scrubbing && this.tech_.scrubbing() || (global_window__WEBPACK_IMPORTED_MODULE_0___default().clearInterval(this.abrTimer_), this.abrTimer_ = null); - }, _proto.getAudioTrackPlaylists_ = function() { + }, _proto.getAudioTrackPlaylists_ = function getAudioTrackPlaylists_() { var track, master = this.master(), defaultPlaylists = master && master.playlists || []; if (!master || !master.mediaGroups || !master.mediaGroups.AUDIO) return defaultPlaylists; var AUDIO = master.mediaGroups.AUDIO, groupKeys = Object.keys(AUDIO); @@ -13874,7 +13874,7 @@ } } return playlists.length ? playlists : defaultPlaylists; - }, _proto.setupMasterPlaylistLoaderListeners_ = function() { + }, _proto.setupMasterPlaylistLoaderListeners_ = function setupMasterPlaylistLoaderListeners_() { var _this3 = this; this.masterPlaylistLoader_.on("loadedmetadata", function() { var media = _this3.masterPlaylistLoader_.media(), requestTimeout = 1500 * media.targetDuration; @@ -13936,9 +13936,9 @@ name: "hls-rendition-enabled" }); }); - }, _proto.handleUpdatedMediaPlaylist = function(updatedPlaylist) { + }, _proto.handleUpdatedMediaPlaylist = function handleUpdatedMediaPlaylist(updatedPlaylist) { this.useCueTags_ && this.updateAdCues_(updatedPlaylist), this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_), this.updateDuration(!updatedPlaylist.endList), !this.tech_.paused() && (this.mainSegmentLoader_.load(), this.audioSegmentLoader_ && this.audioSegmentLoader_.load()); - }, _proto.triggerPresenceUsage_ = function(master, media) { + }, _proto.triggerPresenceUsage_ = function triggerPresenceUsage_(master, media) { var mediaGroups = master.mediaGroups || {}, defaultDemuxed = !0, audioGroupKeys = Object.keys(mediaGroups.AUDIO); for(var mediaGroup in mediaGroups.AUDIO)for(var label in mediaGroups.AUDIO[mediaGroup])mediaGroups.AUDIO[mediaGroup][label].uri || (defaultDemuxed = !1); defaultDemuxed && (this.tech_.trigger({ @@ -13972,7 +13972,7 @@ type: "usage", name: "hls-playlist-cue-tags" })); - }, _proto.shouldSwitchToMedia_ = function(nextPlaylist) { + }, _proto.shouldSwitchToMedia_ = function shouldSwitchToMedia_(nextPlaylist) { var currentPlaylist = this.masterPlaylistLoader_.media() || this.masterPlaylistLoader_.pendingMedia_, currentTime = this.tech_.currentTime(), bufferLowWaterLine = this.bufferLowWaterLine(), bufferHighWaterLine = this.bufferHighWaterLine(); return shouldSwitchToMedia({ buffered: this.tech_.buffered(), @@ -13985,7 +13985,7 @@ experimentalBufferBasedABR: this.experimentalBufferBasedABR, log: this.logger_ }); - }, _proto.setupSegmentLoaderListeners_ = function() { + }, _proto.setupSegmentLoaderListeners_ = function setupSegmentLoaderListeners_() { var _this4 = this; this.experimentalBufferBasedABR || (this.mainSegmentLoader_.on("bandwidthupdate", function() { var nextPlaylist = _this4.selectPlaylist(); @@ -14043,13 +14043,13 @@ }), this.audioSegmentLoader_.on("ended", function() { _this4.logger_("audioSegmentLoader ended"), _this4.onEndOfStream(); }); - }, _proto.mediaSecondsLoaded_ = function() { + }, _proto.mediaSecondsLoaded_ = function mediaSecondsLoaded_() { return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded); - }, _proto.load = function() { + }, _proto.load = function load() { this.mainSegmentLoader_.load(), this.mediaTypes_.AUDIO.activePlaylistLoader && this.audioSegmentLoader_.load(), this.mediaTypes_.SUBTITLES.activePlaylistLoader && this.subtitleSegmentLoader_.load(); - }, _proto.smoothQualityChange_ = function(media) { + }, _proto.smoothQualityChange_ = function smoothQualityChange_(media) { void 0 === media && (media = this.selectPlaylist()), this.fastQualityChange_(media); - }, _proto.fastQualityChange_ = function(media) { + }, _proto.fastQualityChange_ = function fastQualityChange_(media) { var _this5 = this; if (void 0 === media && (media = this.selectPlaylist()), media === this.masterPlaylistLoader_.media()) { this.logger_("skipping fastQualityChange because new media is same as old"); @@ -14058,13 +14058,13 @@ this.switchMedia_(media, "fast-quality"), this.mainSegmentLoader_.resetEverything(function() { videojs.browser.IE_VERSION || videojs.browser.IS_EDGE ? _this5.tech_.setCurrentTime(_this5.tech_.currentTime() + 0.04) : _this5.tech_.setCurrentTime(_this5.tech_.currentTime()); }); - }, _proto.play = function() { + }, _proto.play = function play() { if (!this.setupFirstPlay()) { this.tech_.ended() && this.tech_.setCurrentTime(0), this.hasPlayed_ && this.load(); var seekable = this.tech_.seekable(); if (this.tech_.duration() === 1 / 0 && this.tech_.currentTime() < seekable.start(0)) return this.tech_.setCurrentTime(seekable.end(seekable.length - 1)); } - }, _proto.setupFirstPlay = function() { + }, _proto.setupFirstPlay = function setupFirstPlay() { var _this6 = this, media = this.masterPlaylistLoader_.media(); if (!media || this.tech_.paused() || this.hasPlayed_) return !1; if (!media.endList) { @@ -14076,13 +14076,13 @@ this.trigger("firstplay"), this.tech_.setCurrentTime(seekable.end(0)); } return this.hasPlayed_ = !0, this.load(), !0; - }, _proto.handleSourceOpen_ = function() { + }, _proto.handleSourceOpen_ = function handleSourceOpen_() { if (this.tryToCreateSourceBuffers_(), this.tech_.autoplay()) { var playPromise = this.tech_.play(); void 0 !== playPromise && "function" == typeof playPromise.then && playPromise.then(null, function(e) {}); } this.trigger("sourceopen"); - }, _proto.handleSourceEnded_ = function() { + }, _proto.handleSourceEnded_ = function handleSourceEnded_() { if (this.inbandTextTracks_.metadataTrack_) { var cues = this.inbandTextTracks_.metadataTrack_.cues; if (cues && cues.length) { @@ -14090,16 +14090,16 @@ cues[cues.length - 1].endTime = isNaN(duration) || Math.abs(duration) === 1 / 0 ? Number.MAX_VALUE : duration; } } - }, _proto.handleDurationChange_ = function() { + }, _proto.handleDurationChange_ = function handleDurationChange_() { this.tech_.trigger("durationchange"); - }, _proto.onEndOfStream = function() { + }, _proto.onEndOfStream = function onEndOfStream() { var isEndOfStream = this.mainSegmentLoader_.ended_; if (this.mediaTypes_.AUDIO.activePlaylistLoader) { var mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_(); isEndOfStream = !mainMediaInfo || mainMediaInfo.hasVideo ? isEndOfStream && this.audioSegmentLoader_.ended_ : this.audioSegmentLoader_.ended_; } isEndOfStream && (this.stopABRTimer_(), this.sourceUpdater_.endOfStream()); - }, _proto.stuckAtPlaylistEnd_ = function(playlist) { + }, _proto.stuckAtPlaylistEnd_ = function stuckAtPlaylistEnd_(playlist) { if (!this.seekable().length) return !1; var expired = this.syncController_.getExpiredTime(playlist, this.duration()); if (null === expired) return !1; @@ -14107,7 +14107,7 @@ if (!buffered.length) return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA; var bufferedEnd = buffered.end(buffered.length - 1); return bufferedEnd - currentTime <= SAFE_TIME_DELTA && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA; - }, _proto.blacklistCurrentPlaylist = function(error, blacklistDuration) { + }, _proto.blacklistCurrentPlaylist = function blacklistCurrentPlaylist(error, blacklistDuration) { void 0 === error && (error = {}); var excludeUntil, currentPlaylist = error.playlist || this.masterPlaylistLoader_.media(); if (blacklistDuration = blacklistDuration || error.blacklistDuration || this.blacklistDuration, !currentPlaylist) { @@ -14151,12 +14151,12 @@ ]); var delayDuration = nextPlaylist.targetDuration / 2 * 1000 || 5000, shouldDelay = "number" == typeof nextPlaylist.lastRequest && Date.now() - nextPlaylist.lastRequest <= delayDuration; return this.switchMedia_(nextPlaylist, "exclude", isFinalRendition || shouldDelay); - }, _proto.pauseLoading = function() { + }, _proto.pauseLoading = function pauseLoading() { this.delegateLoaders_("all", [ "abort", "pause" ]), this.stopABRTimer_(); - }, _proto.delegateLoaders_ = function(filter, fnNames) { + }, _proto.delegateLoaders_ = function delegateLoaders_(filter, fnNames) { var _this7 = this, loaders = [], dontFilterPlaylist = "all" === filter; (dontFilterPlaylist || "main" === filter) && loaders.push(this.masterPlaylistLoader_); var mediaTypes = []; @@ -14175,16 +14175,16 @@ "function" == typeof loader[fnName] && loader[fnName](); }); }); - }, _proto.setCurrentTime = function(currentTime) { + }, _proto.setCurrentTime = function setCurrentTime(currentTime) { var buffered = findRange(this.tech_.buffered(), currentTime); return this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media() && this.masterPlaylistLoader_.media().segments ? buffered && buffered.length ? currentTime : void (this.mainSegmentLoader_.resetEverything(), this.mainSegmentLoader_.abort(), this.mediaTypes_.AUDIO.activePlaylistLoader && (this.audioSegmentLoader_.resetEverything(), this.audioSegmentLoader_.abort()), this.mediaTypes_.SUBTITLES.activePlaylistLoader && (this.subtitleSegmentLoader_.resetEverything(), this.subtitleSegmentLoader_.abort()), this.load()) : 0; - }, _proto.duration = function() { + }, _proto.duration = function duration() { if (!this.masterPlaylistLoader_) return 0; var media = this.masterPlaylistLoader_.media(); return media ? media.endList ? this.mediaSource ? this.mediaSource.duration : Vhs$1.Playlist.duration(media) : 1 / 0 : 0; - }, _proto.seekable = function() { + }, _proto.seekable = function seekable() { return this.seekable_; - }, _proto.onSyncInfoUpdate_ = function() { + }, _proto.onSyncInfoUpdate_ = function onSyncInfoUpdate_() { if (!(!this.masterPlaylistLoader_ || this.sourceUpdater_.hasCreatedSourceBuffers())) { var audioSeekable, oldEnd, oldStart, media = this.masterPlaylistLoader_.media(); if (media) { @@ -14200,7 +14200,7 @@ } } } - }, _proto.updateDuration = function(isLive) { + }, _proto.updateDuration = function updateDuration(isLive) { if (this.updateDuration_ && (this.mediaSource.removeEventListener("sourceopen", this.updateDuration_), this.updateDuration_ = null), "open" !== this.mediaSource.readyState) { this.updateDuration_ = this.updateDuration.bind(this, isLive), this.mediaSource.addEventListener("sourceopen", this.updateDuration_); return; @@ -14213,7 +14213,7 @@ } var buffered = this.tech_.buffered(), duration = Vhs$1.Playlist.duration(this.masterPlaylistLoader_.media()); buffered.length > 0 && (duration = Math.max(duration, buffered.end(buffered.length - 1))), this.mediaSource.duration !== duration && this.sourceUpdater_.setDuration(duration); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { var _this8 = this; this.trigger("dispose"), this.decrypter_.terminate(), this.masterPlaylistLoader_.dispose(), this.mainSegmentLoader_.dispose(), this.loadOnPlay_ && this.tech_.off("play", this.loadOnPlay_), [ "AUDIO", @@ -14224,14 +14224,14 @@ group.playlistLoader && group.playlistLoader.dispose(); }); }), this.audioSegmentLoader_.dispose(), this.subtitleSegmentLoader_.dispose(), this.sourceUpdater_.dispose(), this.timelineChangeController_.dispose(), this.stopABRTimer_(), this.updateDuration_ && this.mediaSource.removeEventListener("sourceopen", this.updateDuration_), this.mediaSource.removeEventListener("durationchange", this.handleDurationChange_), this.mediaSource.removeEventListener("sourceopen", this.handleSourceOpen_), this.mediaSource.removeEventListener("sourceended", this.handleSourceEnded_), this.off(); - }, _proto.master = function() { + }, _proto.master = function master() { return this.masterPlaylistLoader_.master; - }, _proto.media = function() { + }, _proto.media = function media() { return this.masterPlaylistLoader_.media() || this.initialMedia_; - }, _proto.areMediaTypesKnown_ = function() { + }, _proto.areMediaTypesKnown_ = function areMediaTypesKnown_() { var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader, hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_(), hasAudioMediaInfo = !usingAudioLoader || !!this.audioSegmentLoader_.getCurrentMediaInfo_(); return !!hasMainMediaInfo && !!hasAudioMediaInfo; - }, _proto.getCodecsOrExclude_ = function() { + }, _proto.getCodecsOrExclude_ = function getCodecsOrExclude_() { var unsupportedAudio, _this9 = this, media = { main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {}, audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {} @@ -14293,7 +14293,7 @@ } } return codecs; - }, _proto.tryToCreateSourceBuffers_ = function() { + }, _proto.tryToCreateSourceBuffers_ = function tryToCreateSourceBuffers_() { if (!("open" !== this.mediaSource.readyState || this.sourceUpdater_.hasCreatedSourceBuffers()) && this.areMediaTypesKnown_()) { var codecs = this.getCodecsOrExclude_(); if (codecs) { @@ -14305,7 +14305,7 @@ this.excludeIncompatibleVariants_(codecString); } } - }, _proto.excludeUnsupportedVariants_ = function() { + }, _proto.excludeUnsupportedVariants_ = function excludeUnsupportedVariants_() { var _this10 = this, playlists = this.master().playlists, ids = []; Object.keys(playlists).forEach(function(key) { var variant = playlists[key]; @@ -14315,7 +14315,7 @@ !codecs.audio || (0, _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__.Hi)(codecs.audio) || (0, _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__.p7)(codecs.audio) || unsupported.push("audio codec " + codecs.audio), !codecs.video || (0, _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__.Hi)(codecs.video) || (0, _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__.p7)(codecs.video) || unsupported.push("video codec " + codecs.video), codecs.text && "stpp.ttml.im1t" === codecs.text && unsupported.push("text codec " + codecs.text), unsupported.length && (variant.excludeUntil = 1 / 0, _this10.logger_("excluding " + variant.id + " for unsupported: " + unsupported.join(", "))); } }); - }, _proto.excludeIncompatibleVariants_ = function(codecString) { + }, _proto.excludeIncompatibleVariants_ = function excludeIncompatibleVariants_(codecString) { var _this11 = this, ids = [], playlists = this.master().playlists, codecs = unwrapCodecList((0, _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__.kS)(codecString)), codecCount_ = codecCount(codecs), videoDetails = codecs.video && (0, _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__.kS)(codecs.video)[0] || null, audioDetails = codecs.audio && (0, _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__.kS)(codecs.audio)[0] || null; Object.keys(playlists).forEach(function(key) { var variant = playlists[key]; @@ -14331,16 +14331,16 @@ } } }); - }, _proto.updateAdCues_ = function(media) { + }, _proto.updateAdCues_ = function updateAdCues_(media) { var offset = 0, seekable = this.seekable(); seekable.length && (offset = seekable.start(0)), updateAdCues(media, this.cueTagsTrack_, offset); - }, _proto.goalBufferLength = function() { + }, _proto.goalBufferLength = function goalBufferLength() { var currentTime = this.tech_.currentTime(), initial = Config.GOAL_BUFFER_LENGTH, rate = Config.GOAL_BUFFER_LENGTH_RATE, max = Math.max(initial, Config.MAX_GOAL_BUFFER_LENGTH); return Math.min(initial + currentTime * rate, max); - }, _proto.bufferLowWaterLine = function() { + }, _proto.bufferLowWaterLine = function bufferLowWaterLine() { var currentTime = this.tech_.currentTime(), initial = Config.BUFFER_LOW_WATER_LINE, rate = Config.BUFFER_LOW_WATER_LINE_RATE, max = Math.max(initial, Config.MAX_BUFFER_LOW_WATER_LINE), newMax = Math.max(initial, Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE); return Math.min(initial + currentTime * rate, this.experimentalBufferBasedABR ? newMax : max); - }, _proto.bufferHighWaterLine = function() { + }, _proto.bufferHighWaterLine = function bufferHighWaterLine() { return Config.BUFFER_HIGH_WATER_LINE; }, MasterPlaylistController; }(videojs.EventTarget), Representation = function(vhsHandler, playlist, id) { @@ -14387,10 +14387,10 @@ ], loaderChecks = {}; loaderTypes.forEach(function(type) { loaderChecks[type] = { - reset: function() { + reset: function reset() { return _this.resetSegmentDownloads_(type); }, - updateend: function() { + updateend: function updateend() { return _this.checkSegmentDownloads_(type); } }, mpc[type + "SegmentLoader_"].on("appendsdone", loaderChecks[type].updateend), mpc[type + "SegmentLoader_"].on("playlistupdate", loaderChecks[type].reset), _this.tech_.on([ @@ -14422,12 +14422,12 @@ }; } var _proto = PlaybackWatcher.prototype; - return _proto.monitorCurrentTime_ = function() { + return _proto.monitorCurrentTime_ = function monitorCurrentTime_() { this.checkCurrentTime_(), this.checkCurrentTimeTimeout_ && global_window__WEBPACK_IMPORTED_MODULE_0___default().clearTimeout(this.checkCurrentTimeTimeout_), this.checkCurrentTimeTimeout_ = global_window__WEBPACK_IMPORTED_MODULE_0___default().setTimeout(this.monitorCurrentTime_.bind(this), 250); - }, _proto.resetSegmentDownloads_ = function(type) { + }, _proto.resetSegmentDownloads_ = function resetSegmentDownloads_(type) { var loader = this.masterPlaylistController_[type + "SegmentLoader_"]; this[type + "StalledDownloads_"] > 0 && this.logger_("resetting possible stalled download count for " + type + " loader"), this[type + "StalledDownloads_"] = 0, this[type + "Buffered_"] = loader.buffered_(); - }, _proto.checkSegmentDownloads_ = function(type) { + }, _proto.checkSegmentDownloads_ = function checkSegmentDownloads_(type) { var mpc = this.masterPlaylistController_, loader = mpc[type + "SegmentLoader_"], buffered = loader.buffered_(), isBufferedDifferent = isRangeDifferent(this[type + "Buffered_"], buffered); if (this[type + "Buffered_"] = buffered, isBufferedDifferent) { this.resetSegmentDownloads_(type); @@ -14442,15 +14442,15 @@ }), "subtitle" !== type && mpc.blacklistCurrentPlaylist({ message: "Excessive " + type + " segment downloading detected." }, 1 / 0)); - }, _proto.checkCurrentTime_ = function() { + }, _proto.checkCurrentTime_ = function checkCurrentTime_() { if (!(this.tech_.paused() || this.tech_.seeking())) { var currentTime = this.tech_.currentTime(), buffered = this.tech_.buffered(); if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA >= buffered.end(buffered.length - 1))) return this.techWaiting_(); this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime ? (this.consecutiveUpdates++, this.waiting_()) : currentTime === this.lastRecordedTime ? this.consecutiveUpdates++ : (this.consecutiveUpdates = 0, this.lastRecordedTime = currentTime); } - }, _proto.cancelTimer_ = function() { + }, _proto.cancelTimer_ = function cancelTimer_() { this.consecutiveUpdates = 0, this.timer_ && (this.logger_("cancelTimer_"), clearTimeout(this.timer_)), this.timer_ = null; - }, _proto.fixesBadSeeks_ = function() { + }, _proto.fixesBadSeeks_ = function fixesBadSeeks_() { if (!this.tech_.seeking()) return !1; var seekTo, seekable = this.seekable(), currentTime = this.tech_.currentTime(); if (this.afterSeekableWindow_(seekable, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow) && (seekTo = seekable.end(seekable.length - 1)), this.beforeSeekableWindow_(seekable, currentTime)) { @@ -14464,7 +14464,7 @@ ], i = 0; i < bufferedToCheck.length; i++)if (bufferedToCheck[i] && timeAheadOf(bufferedToCheck[i], currentTime) < minAppendedDuration) return !1; var nextRange = findNextRange(buffered, currentTime); return 0 !== nextRange.length && (seekTo = nextRange.start(0) + SAFE_TIME_DELTA, this.logger_("Buffered region starts (" + nextRange.start(0) + ") just beyond seek point (" + currentTime + "). Seeking to " + seekTo + "."), this.tech_.setCurrentTime(seekTo), !0); - }, _proto.waiting_ = function() { + }, _proto.waiting_ = function waiting_() { if (!this.techWaiting_()) { var currentTime = this.tech_.currentTime(), currentRange = findRange(this.tech_.buffered(), currentTime); if (currentRange.length && currentTime + 3 <= currentRange.end(0)) { @@ -14478,7 +14478,7 @@ return; } } - }, _proto.techWaiting_ = function() { + }, _proto.techWaiting_ = function techWaiting_() { var seekable = this.seekable(), currentTime = this.tech_.currentTime(); if (this.tech_.seeking() || null !== this.timer_) return !0; if (this.beforeSeekableWindow_(seekable, currentTime)) { @@ -14509,13 +14509,13 @@ return this.logger_("Stopped at " + currentTime + ", setting timer for " + difference + ", seeking to " + nextRange.start(0)), this.cancelTimer_(), this.timer_ = setTimeout(this.skipTheGap_.bind(this), 1000 * difference, currentTime), !0; } return !1; - }, _proto.afterSeekableWindow_ = function(seekable, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow) { + }, _proto.afterSeekableWindow_ = function afterSeekableWindow_(seekable, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow) { if (void 0 === allowSeeksWithinUnsafeLiveWindow && (allowSeeksWithinUnsafeLiveWindow = !1), !seekable.length) return !1; var allowedEnd = seekable.end(seekable.length - 1) + SAFE_TIME_DELTA; return !playlist.endList && allowSeeksWithinUnsafeLiveWindow && (allowedEnd = seekable.end(seekable.length - 1) + 3 * playlist.targetDuration), currentTime > allowedEnd; - }, _proto.beforeSeekableWindow_ = function(seekable, currentTime) { + }, _proto.beforeSeekableWindow_ = function beforeSeekableWindow_(seekable, currentTime) { return !!(seekable.length && seekable.start(0) > 0 && currentTime < seekable.start(0) - this.liveRangeSafeTimeDelta); - }, _proto.videoUnderflow_ = function(_ref) { + }, _proto.videoUnderflow_ = function videoUnderflow_(_ref) { var gap, videoBuffered = _ref.videoBuffered, audioBuffered = _ref.audioBuffered, currentTime = _ref.currentTime; if (videoBuffered) { if (videoBuffered.length && audioBuffered.length) { @@ -14527,7 +14527,7 @@ } else findNextRange(videoBuffered, currentTime).length || (gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime)); return !!gap && (this.logger_("Encountered a gap in video from " + gap.start + " to " + gap.end + ". Seeking to current time " + currentTime), !0); } - }, _proto.skipTheGap_ = function(scheduledCurrentTime) { + }, _proto.skipTheGap_ = function skipTheGap_(scheduledCurrentTime) { var buffered = this.tech_.buffered(), currentTime = this.tech_.currentTime(), nextRange = findNextRange(buffered, currentTime); this.cancelTimer_(), 0 !== nextRange.length && currentTime === scheduledCurrentTime && (this.logger_("skipTheGap_:", "currentTime:", currentTime, "scheduled currentTime:", scheduledCurrentTime, "nextRange start:", nextRange.start(0)), this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR), this.tech_.trigger({ type: "usage", @@ -14536,7 +14536,7 @@ type: "usage", name: "hls-gap-skip" })); - }, _proto.gapFromVideoUnderflow_ = function(buffered, currentTime) { + }, _proto.gapFromVideoUnderflow_ = function gapFromVideoUnderflow_(buffered, currentTime) { for(var gaps = findGaps(buffered), i = 0; i < gaps.length; i++){ var start = gaps.start(i), end = gaps.end(i); if (currentTime - start < 4 && currentTime - start > 2) return { @@ -14548,7 +14548,7 @@ }, PlaybackWatcher; }(), defaultOptions = { errorInterval: 30, - getSource: function(next) { + getSource: function getSource(next) { return next(this.tech({ IWillNotUseThisInPlugins: !0 }).currentSource_ || this.currentSource()); @@ -14627,10 +14627,10 @@ }; Object.keys(Config).forEach(function(prop) { Object.defineProperty(Vhs, prop, { - get: function() { + get: function get() { return videojs.log.warn("using Vhs." + prop + " is UNSAFE be sure you know what you are doing"), Config[prop]; }, - set: function(value) { + set: function set(value) { if (videojs.log.warn("using Vhs." + prop + " is UNSAFE be sure you know what you are doing"), "number" != typeof value || value < 0) { videojs.log.warn("value of Vhs." + prop + " must be greater than or equal to 0"); return; @@ -14744,7 +14744,7 @@ if (_this = _Component.call(this, tech, videojs.mergeOptions(options.hls, options.vhs)) || this, options.hls && Object.keys(options.hls).length && videojs.log.warn("Using hls options is deprecated. Use vhs instead."), "number" == typeof options.initialBandwidth && (_this.options_.bandwidth = options.initialBandwidth), _this.logger_ = logger("VhsHandler"), tech.options_ && tech.options_.playerId) { var _player = videojs(tech.options_.playerId); _player.hasOwnProperty("hls") || Object.defineProperty(_player, "hls", { - get: function() { + get: function get() { return videojs.log.warn("player.hls is deprecated. Use player.tech().vhs instead."), tech.trigger({ type: "usage", name: "hls-player-access" @@ -14752,7 +14752,7 @@ }, configurable: !0 }), _player.hasOwnProperty("vhs") || Object.defineProperty(_player, "vhs", { - get: function() { + get: function get() { return videojs.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."), tech.trigger({ type: "usage", name: "vhs-player-access" @@ -14760,7 +14760,7 @@ }, configurable: !0 }), _player.hasOwnProperty("dash") || Object.defineProperty(_player, "dash", { - get: function() { + get: function get() { return videojs.log.warn("player.dash is deprecated. Use player.tech().vhs instead."), (0, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__.Z)(_this); }, configurable: !0 @@ -14788,7 +14788,7 @@ } (0, _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__.Z)(VhsHandler, _Component); var _proto = VhsHandler.prototype; - return _proto.setOptions_ = function() { + return _proto.setOptions_ = function setOptions_() { var _this2 = this; if (this.options_.withCredentials = this.options_.withCredentials || !1, this.options_.handleManifestRedirects = !1 !== this.options_.handleManifestRedirects, this.options_.limitRenditionByPlayerDimensions = !1 !== this.options_.limitRenditionByPlayerDimensions, this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || !1, this.options_.smoothQualityChange = this.options_.smoothQualityChange || !1, this.options_.useBandwidthFromLocalStorage = void 0 !== this.source_.useBandwidthFromLocalStorage ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || !1, this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || !1, this.options_.customTagParsers = this.options_.customTagParsers || [], this.options_.customTagMappers = this.options_.customTagMappers || [], this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || !1, "number" != typeof this.options_.blacklistDuration && (this.options_.blacklistDuration = 300), "number" != typeof this.options_.bandwidth && this.options_.useBandwidthFromLocalStorage) { var storedObject = getVhsLocalStorage(); @@ -14827,7 +14827,7 @@ ].forEach(function(option) { void 0 !== _this2.source_[option] && (_this2.options_[option] = _this2.source_[option]); }), this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions, this.useDevicePixelRatio = this.options_.useDevicePixelRatio; - }, _proto.src = function(_src, type) { + }, _proto.src = function src(_src, type) { var dataUri, _this3 = this; if (_src) { this.setOptions_(), this.options_.src = 0 === (dataUri = this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,") ? JSON.parse(dataUri.substring(dataUri.indexOf(",") + 1)) : dataUri, this.options_.tech = this.tech_, this.options_.externVhs = Vhs, this.options_.sourceType = (0, _videojs_vhs_utils_es_media_types_js__WEBPACK_IMPORTED_MODULE_20__.t)(type), this.options_.seekTo = function(time) { @@ -14836,10 +14836,10 @@ var playbackWatcherOptions = videojs.mergeOptions({ liveRangeSafeTimeDelta: SAFE_TIME_DELTA }, this.options_, { - seekable: function() { + seekable: function seekable() { return _this3.seekable(); }, - media: function() { + media: function media() { return _this3.masterPlaylistController_.media(); }, masterPlaylistController: this.masterPlaylistController_ @@ -14854,23 +14854,23 @@ var defaultSelector = this.options_.experimentalBufferBasedABR ? Vhs.movingAverageBandwidthSelector(0.55) : Vhs.STANDARD_PLAYLIST_SELECTOR; this.masterPlaylistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this), this.masterPlaylistController_.selectInitialPlaylist = Vhs.INITIAL_PLAYLIST_SELECTOR.bind(this), this.playlists = this.masterPlaylistController_.masterPlaylistLoader_, this.mediaSource = this.masterPlaylistController_.mediaSource, Object.defineProperties(this, { selectPlaylist: { - get: function() { + get: function get() { return this.masterPlaylistController_.selectPlaylist; }, - set: function(selectPlaylist) { + set: function set(selectPlaylist) { this.masterPlaylistController_.selectPlaylist = selectPlaylist.bind(this); } }, throughput: { - get: function() { + get: function get() { return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate; }, - set: function(throughput) { + set: function set(throughput) { this.masterPlaylistController_.mainSegmentLoader_.throughput.rate = throughput, this.masterPlaylistController_.mainSegmentLoader_.throughput.count = 1; } }, bandwidth: { - get: function() { + get: function get() { var playerBandwidthEst = this.masterPlaylistController_.mainSegmentLoader_.bandwidth, networkInformation = global_window__WEBPACK_IMPORTED_MODULE_0___default().navigator.connection || global_window__WEBPACK_IMPORTED_MODULE_0___default().navigator.mozConnection || global_window__WEBPACK_IMPORTED_MODULE_0___default().navigator.webkitConnection; if (this.options_.useNetworkInformationApi && networkInformation) { var networkInfoBandwidthEstBitsPerSec = 1000000 * networkInformation.downlink; @@ -14878,7 +14878,7 @@ } return playerBandwidthEst; }, - set: function(bandwidth) { + set: function set(bandwidth) { this.masterPlaylistController_.mainSegmentLoader_.bandwidth = bandwidth, this.masterPlaylistController_.mainSegmentLoader_.throughput = { rate: 0, count: 0 @@ -14886,148 +14886,148 @@ } }, systemBandwidth: { - get: function() { + get: function get() { return Math.floor(1 / (1 / (this.bandwidth || 1) + (this.throughput > 0 ? 1 / this.throughput : 0))); }, - set: function() { + set: function set() { videojs.log.error('The "systemBandwidth" property is read-only'); } } }), this.options_.bandwidth && (this.bandwidth = this.options_.bandwidth), this.options_.throughput && (this.throughput = this.options_.throughput), Object.defineProperties(this.stats, { bandwidth: { - get: function() { + get: function get() { return _this3.bandwidth || 0; }, enumerable: !0 }, mediaRequests: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.mediaRequests_() || 0; }, enumerable: !0 }, mediaRequestsAborted: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.mediaRequestsAborted_() || 0; }, enumerable: !0 }, mediaRequestsTimedout: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.mediaRequestsTimedout_() || 0; }, enumerable: !0 }, mediaRequestsErrored: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.mediaRequestsErrored_() || 0; }, enumerable: !0 }, mediaTransferDuration: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.mediaTransferDuration_() || 0; }, enumerable: !0 }, mediaBytesTransferred: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.mediaBytesTransferred_() || 0; }, enumerable: !0 }, mediaSecondsLoaded: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.mediaSecondsLoaded_() || 0; }, enumerable: !0 }, mediaAppends: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.mediaAppends_() || 0; }, enumerable: !0 }, mainAppendsToLoadedData: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.mainAppendsToLoadedData_() || 0; }, enumerable: !0 }, audioAppendsToLoadedData: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.audioAppendsToLoadedData_() || 0; }, enumerable: !0 }, appendsToLoadedData: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.appendsToLoadedData_() || 0; }, enumerable: !0 }, timeToLoadedData: { - get: function() { + get: function get() { return _this3.masterPlaylistController_.timeToLoadedData_() || 0; }, enumerable: !0 }, buffered: { - get: function() { + get: function get() { return timeRangesToArray(_this3.tech_.buffered()); }, enumerable: !0 }, currentTime: { - get: function() { + get: function get() { return _this3.tech_.currentTime(); }, enumerable: !0 }, currentSource: { - get: function() { + get: function get() { return _this3.tech_.currentSource_; }, enumerable: !0 }, currentTech: { - get: function() { + get: function get() { return _this3.tech_.name_; }, enumerable: !0 }, duration: { - get: function() { + get: function get() { return _this3.tech_.duration(); }, enumerable: !0 }, master: { - get: function() { + get: function get() { return _this3.playlists.master; }, enumerable: !0 }, playerDimensions: { - get: function() { + get: function get() { return _this3.tech_.currentDimensions(); }, enumerable: !0 }, seekable: { - get: function() { + get: function get() { return timeRangesToArray(_this3.tech_.seekable()); }, enumerable: !0 }, timestamp: { - get: function() { + get: function get() { return Date.now(); }, enumerable: !0 }, videoPlaybackQuality: { - get: function() { + get: function get() { return _this3.tech_.getVideoPlaybackQuality(); }, enumerable: !0 @@ -15047,7 +15047,7 @@ this.ignoreNextSeekingEvent_ = !0; }), this.setupQualityLevels_(), this.tech_.el() && (this.mediaSourceUrl_ = global_window__WEBPACK_IMPORTED_MODULE_0___default().URL.createObjectURL(this.masterPlaylistController_.mediaSource), this.tech_.src(this.mediaSourceUrl_)); } - }, _proto.setupEme_ = function() { + }, _proto.setupEme_ = function setupEme_() { var _this4 = this, audioPlaylistLoader = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader, didSetupEmeOptions = setupEmeOptions({ player: this.player_, sourceKeySystems: this.source_.keySystems, @@ -15077,14 +15077,14 @@ code: 3 }); }); - }, _proto.setupQualityLevels_ = function() { + }, _proto.setupQualityLevels_ = function setupQualityLevels_() { var _this5 = this, player = videojs.players[this.tech_.options_.playerId]; player && player.qualityLevels && !this.qualityLevels_ && (this.qualityLevels_ = player.qualityLevels(), this.masterPlaylistController_.on("selectedinitialmedia", function() { handleVhsLoadedMetadata(_this5.qualityLevels_, _this5); }), this.playlists.on("mediachange", function() { handleVhsMediaChange(_this5.qualityLevels_, _this5.playlists); })); - }, VhsHandler.version = function() { + }, VhsHandler.version = function version$5() { return { "@videojs/http-streaming": version$4, "mux.js": "5.14.1", @@ -15092,27 +15092,27 @@ "m3u8-parser": "4.7.0", "aes-decrypter": "3.1.2" }; - }, _proto.version = function() { + }, _proto.version = function version() { return this.constructor.version(); - }, _proto.canChangeType = function() { + }, _proto.canChangeType = function canChangeType() { return SourceUpdater.canChangeType(); - }, _proto.play = function() { + }, _proto.play = function play() { this.masterPlaylistController_.play(); - }, _proto.setCurrentTime = function(currentTime) { + }, _proto.setCurrentTime = function setCurrentTime(currentTime) { this.masterPlaylistController_.setCurrentTime(currentTime); - }, _proto.duration = function() { + }, _proto.duration = function duration() { return this.masterPlaylistController_.duration(); - }, _proto.seekable = function() { + }, _proto.seekable = function seekable() { return this.masterPlaylistController_.seekable(); - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.playbackWatcher_ && this.playbackWatcher_.dispose(), this.masterPlaylistController_ && this.masterPlaylistController_.dispose(), this.qualityLevels_ && this.qualityLevels_.dispose(), this.player_ && (delete this.player_.vhs, delete this.player_.dash, delete this.player_.hls), this.tech_ && this.tech_.vhs && delete this.tech_.vhs, this.tech_ && delete this.tech_.hls, this.mediaSourceUrl_ && global_window__WEBPACK_IMPORTED_MODULE_0___default().URL.revokeObjectURL && (global_window__WEBPACK_IMPORTED_MODULE_0___default().URL.revokeObjectURL(this.mediaSourceUrl_), this.mediaSourceUrl_ = null), _Component.prototype.dispose.call(this); - }, _proto.convertToProgramTime = function(time, callback) { + }, _proto.convertToProgramTime = function convertToProgramTime(time, callback) { return getProgramTime({ playlist: this.masterPlaylistController_.media(), time: time, callback: callback }); - }, _proto.seekToProgramTime = function(programTime, callback, pauseAfterSeek, retryCount) { + }, _proto.seekToProgramTime = function seekToProgramTime$1(programTime, callback, pauseAfterSeek, retryCount) { return void 0 === pauseAfterSeek && (pauseAfterSeek = !0), void 0 === retryCount && (retryCount = 2), seekToProgramTime({ programTime: programTime, playlist: this.masterPlaylistController_.media(), @@ -15126,39 +15126,39 @@ }(videojs.getComponent("Component")), VhsSourceHandler = { name: "videojs-http-streaming", VERSION: version$4, - canHandleSource: function(srcObj, options) { + canHandleSource: function canHandleSource(srcObj, options) { void 0 === options && (options = {}); var localOptions = videojs.mergeOptions(videojs.options, options); return VhsSourceHandler.canPlayType(srcObj.type, localOptions); }, - handleSource: function(source, tech, options) { + handleSource: function handleSource(source, tech, options) { void 0 === options && (options = {}); var localOptions = videojs.mergeOptions(videojs.options, options); return tech.vhs = new VhsHandler(source, tech, localOptions), videojs.hasOwnProperty("hls") || Object.defineProperty(tech, "hls", { - get: function() { + get: function get() { return videojs.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."), tech.vhs; }, configurable: !0 }), tech.vhs.xhr = xhrFactory(), tech.vhs.src(source.src, source.type), tech.vhs; }, - canPlayType: function(type, options) { + canPlayType: function canPlayType(type, options) { void 0 === options && (options = {}); var _videojs$mergeOptions2 = videojs.mergeOptions(videojs.options, options).vhs.overrideNative, overrideNative = void 0 === _videojs$mergeOptions2 ? !videojs.browser.IS_ANY_SAFARI : _videojs$mergeOptions2, supportedType = (0, _videojs_vhs_utils_es_media_types_js__WEBPACK_IMPORTED_MODULE_20__.t)(type); return supportedType && (!Vhs.supportsTypeNatively(supportedType) || overrideNative) ? "maybe" : ""; } }; (0, _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__.p7)("avc1.4d400d,mp4a.40.2") && videojs.getTech("Html5").registerSourceHandler(VhsSourceHandler, 0), videojs.VhsHandler = VhsHandler, Object.defineProperty(videojs, "HlsHandler", { - get: function() { + get: function get() { return videojs.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."), VhsHandler; }, configurable: !0 }), videojs.VhsSourceHandler = VhsSourceHandler, Object.defineProperty(videojs, "HlsSourceHandler", { - get: function() { + get: function get() { return videojs.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."), VhsSourceHandler; }, configurable: !0 }), videojs.Vhs = Vhs, Object.defineProperty(videojs, "Hls", { - get: function() { + get: function get() { return videojs.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."), Vhs; }, configurable: !0 diff --git a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js index d4a5e467e79b..76efd59b92e1 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js @@ -266,7 +266,7 @@ DESCRIPTORS = [ { id: 0x03, - parser: function(bytes) { + parser: function parser(bytes) { var desc = { tag: 0x03, id: bytes[0] << 8 | bytes[1], @@ -286,7 +286,7 @@ }, { id: 0x04, - parser: function(bytes) { + parser: function parser(bytes) { return { tag: 0x04, oti: bytes[0], @@ -300,7 +300,7 @@ }, { id: 0x05, - parser: function(bytes) { + parser: function parser(bytes) { return { tag: 0x05, bytes: bytes @@ -309,7 +309,7 @@ }, { id: 0x06, - parser: function(bytes) { + parser: function parser(bytes) { return { tag: 0x06, bytes: bytes @@ -595,7 +595,7 @@ 0x66 ]) }, _isLikely = { - aac: function(bytes) { + aac: function aac(bytes) { var offset = (0, id3_helpers.c)(bytes); return (0, byte_helpers.G3)(bytes, [ 0xff, @@ -608,7 +608,7 @@ ] }); }, - mp3: function(bytes) { + mp3: function mp3(bytes) { var offset = (0, id3_helpers.c)(bytes); return (0, byte_helpers.G3)(bytes, [ 0xff, @@ -621,21 +621,21 @@ ] }); }, - webm: function(bytes) { + webm: function webm(bytes) { var docType = findEbml(bytes, [ EBML_TAGS.EBML, EBML_TAGS.DocType ])[0]; return (0, byte_helpers.G3)(docType, CONSTANTS.webm); }, - mkv: function(bytes) { + mkv: function mkv(bytes) { var docType = findEbml(bytes, [ EBML_TAGS.EBML, EBML_TAGS.DocType ])[0]; return (0, byte_helpers.G3)(docType, CONSTANTS.matroska); }, - mp4: function(bytes) { + mp4: function mp4(bytes) { return !(_isLikely["3gp"](bytes) || _isLikely.mov(bytes)) && (!!((0, byte_helpers.G3)(bytes, CONSTANTS.mp4, { offset: 4 }) || (0, byte_helpers.G3)(bytes, CONSTANTS.fmp4, { @@ -646,23 +646,23 @@ offset: 4 })) || void 0); }, - mov: function(bytes) { + mov: function mov(bytes) { return (0, byte_helpers.G3)(bytes, CONSTANTS.mov, { offset: 4 }); }, - "3gp": function(bytes) { + "3gp": function gp(bytes) { return (0, byte_helpers.G3)(bytes, CONSTANTS["3gp"], { offset: 4 }); }, - ac3: function(bytes) { + ac3: function ac3(bytes) { var offset = (0, id3_helpers.c)(bytes); return (0, byte_helpers.G3)(bytes, CONSTANTS.ac3, { offset: offset }); }, - ts: function(bytes) { + ts: function ts(bytes) { if (bytes.length < 189 && bytes.length >= 1) return 0x47 === bytes[0]; for(var i = 0; i + 188 < bytes.length && i < 188;){ if (0x47 === bytes[i] && 0x47 === bytes[i + 188]) return !0; @@ -670,29 +670,29 @@ } return !1; }, - flac: function(bytes) { + flac: function flac(bytes) { var offset = (0, id3_helpers.c)(bytes); return (0, byte_helpers.G3)(bytes, CONSTANTS.flac, { offset: offset }); }, - ogg: function(bytes) { + ogg: function ogg(bytes) { return (0, byte_helpers.G3)(bytes, CONSTANTS.ogg); }, - avi: function(bytes) { + avi: function avi(bytes) { return (0, byte_helpers.G3)(bytes, CONSTANTS.riff) && (0, byte_helpers.G3)(bytes, CONSTANTS.avi, { offset: 8 }); }, - wav: function(bytes) { + wav: function wav(bytes) { return (0, byte_helpers.G3)(bytes, CONSTANTS.riff) && (0, byte_helpers.G3)(bytes, CONSTANTS.wav, { offset: 8 }); }, - h264: function(bytes) { + h264: function h264(bytes) { return findNal(bytes, "h264", 7, 3).length; }, - h265: function(bytes) { + h265: function h265(bytes) { return findNal(bytes, "h265", [ 32, 33 @@ -2238,7 +2238,7 @@ var foundNamedKey = aliases[search.toLowerCase()]; return foundNamedKey || (1 === search.length ? search.charCodeAt(0) : void 0); } - keyCode.isEventKey = function(event, nameOrCode) { + keyCode.isEventKey = function isEventKey(event, nameOrCode) { if (event && "object" == typeof event) { var keyCode = event.which || event.keyCode || event.charCode; if (null == keyCode) return !1; @@ -2337,21 +2337,21 @@ this.listeners = {}; } var _proto = Stream.prototype; - return _proto.on = function(type, listener) { + return _proto.on = function on(type, listener) { this.listeners[type] || (this.listeners[type] = []), this.listeners[type].push(listener); - }, _proto.off = function(type, listener) { + }, _proto.off = function off(type, listener) { if (!this.listeners[type]) return !1; var index = this.listeners[type].indexOf(listener); return this.listeners[type] = this.listeners[type].slice(0), this.listeners[type].splice(index, 1), index > -1; - }, _proto.trigger = function(type) { + }, _proto.trigger = function trigger(type) { var callbacks = this.listeners[type]; if (callbacks) { if (2 == arguments.length) for(var length = callbacks.length, i = 0; i < length; ++i)callbacks[i].call(this, arguments[1]); else for(var args = Array.prototype.slice.call(arguments, 1), _length = callbacks.length, _i = 0; _i < _length; ++_i)callbacks[_i].apply(this, args); } - }, _proto.dispose = function() { + }, _proto.dispose = function dispose() { this.listeners = {}; - }, _proto.pipe = function(destination) { + }, _proto.pipe = function pipe(destination) { this.on("data", function(data) { destination.push(data); }); @@ -2361,7 +2361,7 @@ var _this; return (_this = _Stream.call(this) || this).buffer = "", _this; } - return (0, inheritsLoose.Z)(LineStream, _Stream), LineStream.prototype.push = function(data) { + return (0, inheritsLoose.Z)(LineStream, _Stream), LineStream.prototype.push = function push(data) { var nextNewline; for(this.buffer += data, nextNewline = this.buffer.indexOf("\n"); nextNewline > -1; nextNewline = this.buffer.indexOf("\n"))this.trigger("data", this.buffer.substring(0, nextNewline)), this.buffer = this.buffer.substring(nextNewline + 1); }, LineStream; @@ -2378,7 +2378,7 @@ } (0, inheritsLoose.Z)(ParseStream, _Stream); var _proto = ParseStream.prototype; - return _proto.push = function(line) { + return _proto.push = function push(line) { var match, event, _this2 = this; if (0 !== (line = line.trim()).length) { if ("#" !== line[0]) { @@ -2641,9 +2641,9 @@ }); }); } - }, _proto.addParser = function(_ref) { + }, _proto.addParser = function addParser(_ref) { var _this3 = this, expression = _ref.expression, customType = _ref.customType, dataParser = _ref.dataParser, segment = _ref.segment; - "function" != typeof dataParser && (dataParser = function(line) { + "function" != typeof dataParser && (dataParser = function dataParser(line) { return line; }), this.customParsers.push(function(line) { if (expression.exec(line)) return _this3.trigger("data", { @@ -2653,7 +2653,7 @@ segment: segment }), !0; }); - }, _proto.addTagMapper = function(_ref2) { + }, _proto.addTagMapper = function addTagMapper(_ref2) { var expression = _ref2.expression, map = _ref2.map; this.tagMappers.push(function(line) { return expression.test(line) ? map(line) : line; @@ -2700,24 +2700,24 @@ }), _this.parseStream.on("data", function(entry) { var mediaGroup, rendition; ({ - tag: function() { + tag: function tag() { (({ - version: function() { + version: function version() { entry.version && (this.manifest.version = entry.version); }, - "allow-cache": function() { + "allow-cache": function allowCache() { this.manifest.allowCache = entry.allowed, "allowed" in entry || (this.trigger("info", { message: "defaulting allowCache to YES" }), this.manifest.allowCache = !0); }, - byterange: function() { + byterange: function byterange() { var byterange = {}; "length" in entry && (currentUri.byterange = byterange, byterange.length = entry.length, "offset" in entry || (entry.offset = lastByterangeEnd)), "offset" in entry && (currentUri.byterange = byterange, byterange.offset = entry.offset), lastByterangeEnd = byterange.offset + byterange.length; }, - endlist: function() { + endlist: function endlist() { this.manifest.endList = !0; }, - inf: function() { + inf: function inf() { "mediaSequence" in this.manifest || (this.manifest.mediaSequence = 0, this.trigger("info", { message: "defaulting media sequence to zero" })), "discontinuitySequence" in this.manifest || (this.manifest.discontinuitySequence = 0, this.trigger("info", { @@ -2726,7 +2726,7 @@ message: "updating zero segment duration to a small value" })), this.manifest.segments = uris; }, - key: function() { + key: function key() { if (!entry.attributes) { this.trigger("warn", { message: "ignoring key declaration without attribute list" @@ -2790,7 +2790,7 @@ uri: entry.attributes.URI }, void 0 !== entry.attributes.IV && (_key.iv = entry.attributes.IV); }, - "media-sequence": function() { + "media-sequence": function mediaSequence() { if (!isFinite(entry.number)) { this.trigger("warn", { message: "ignoring invalid media sequence: " + entry.number @@ -2799,7 +2799,7 @@ } this.manifest.mediaSequence = entry.number; }, - "discontinuity-sequence": function() { + "discontinuity-sequence": function discontinuitySequence() { if (!isFinite(entry.number)) { this.trigger("warn", { message: "ignoring invalid discontinuity sequence: " + entry.number @@ -2808,7 +2808,7 @@ } this.manifest.discontinuitySequence = entry.number, currentTimeline = entry.number; }, - "playlist-type": function() { + "playlist-type": function playlistType() { if (!/VOD|EVENT/.test(entry.playlistType)) { this.trigger("warn", { message: "ignoring unknown playlist type: " + entry.playlist @@ -2817,10 +2817,10 @@ } this.manifest.playlistType = entry.playlistType; }, - map: function() { + map: function map() { currentMap = {}, entry.uri && (currentMap.uri = entry.uri), entry.byterange && (currentMap.byterange = entry.byterange), _key && (currentMap.key = _key); }, - "stream-inf": function() { + "stream-inf": function streamInf() { if (this.manifest.playlists = uris, this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups, !entry.attributes) { this.trigger("warn", { message: "ignoring empty stream-inf attributes" @@ -2829,7 +2829,7 @@ } currentUri.attributes || (currentUri.attributes = {}), (0, esm_extends.Z)(currentUri.attributes, entry.attributes); }, - media: function() { + media: function media() { if (this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups, !(entry.attributes && entry.attributes.TYPE && entry.attributes["GROUP-ID"] && entry.attributes.NAME)) { this.trigger("warn", { message: "ignoring incomplete or missing media group" @@ -2841,13 +2841,13 @@ default: /yes/i.test(entry.attributes.DEFAULT) }).default ? rendition.autoselect = !0 : rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT), entry.attributes.LANGUAGE && (rendition.language = entry.attributes.LANGUAGE), entry.attributes.URI && (rendition.uri = entry.attributes.URI), entry.attributes["INSTREAM-ID"] && (rendition.instreamId = entry.attributes["INSTREAM-ID"]), entry.attributes.CHARACTERISTICS && (rendition.characteristics = entry.attributes.CHARACTERISTICS), entry.attributes.FORCED && (rendition.forced = /yes/i.test(entry.attributes.FORCED)), mediaGroup[entry.attributes.NAME] = rendition; }, - discontinuity: function() { + discontinuity: function discontinuity() { currentTimeline += 1, currentUri.discontinuity = !0, this.manifest.discontinuityStarts.push(uris.length); }, - "program-date-time": function() { + "program-date-time": function programDateTime() { void 0 === this.manifest.dateTimeString && (this.manifest.dateTimeString = entry.dateTimeString, this.manifest.dateTimeObject = entry.dateTimeObject), currentUri.dateTimeString = entry.dateTimeString, currentUri.dateTimeObject = entry.dateTimeObject; }, - targetduration: function() { + targetduration: function targetduration() { if (!isFinite(entry.duration) || entry.duration < 0) { this.trigger("warn", { message: "ignoring invalid target duration: " + entry.duration @@ -2856,7 +2856,7 @@ } this.manifest.targetDuration = entry.duration, setHoldBack.call(this, this.manifest); }, - start: function() { + start: function start() { if (!entry.attributes || isNaN(entry.attributes["TIME-OFFSET"])) { this.trigger("warn", { message: "ignoring start declaration without appropriate attribute list" @@ -2868,21 +2868,21 @@ precise: entry.attributes.PRECISE }; }, - "cue-out": function() { + "cue-out": function cueOut() { currentUri.cueOut = entry.data; }, - "cue-out-cont": function() { + "cue-out-cont": function cueOutCont() { currentUri.cueOutCont = entry.data; }, - "cue-in": function() { + "cue-in": function cueIn() { currentUri.cueIn = entry.data; }, - skip: function() { + skip: function skip() { this.manifest.skip = camelCaseKeys(entry.attributes), this.warnOnMissingAttributes_("#EXT-X-SKIP", entry.attributes, [ "SKIPPED-SEGMENTS" ]); }, - part: function() { + part: function part() { var _this2 = this; hasParts = !0; var segmentIndex = this.manifest.segments.length, part = camelCaseKeys(entry.attributes); @@ -2897,7 +2897,7 @@ }); }); }, - "server-control": function() { + "server-control": function serverControl() { var attrs = this.manifest.serverControl = camelCaseKeys(entry.attributes); attrs.hasOwnProperty("canBlockReload") || (attrs.canBlockReload = !1, this.trigger("info", { message: "#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false" @@ -2905,7 +2905,7 @@ message: "#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set" }); }, - "preload-hint": function() { + "preload-hint": function preloadHint() { var segmentIndex = this.manifest.segments.length, hint = camelCaseKeys(entry.attributes), isPart = hint.type && "PART" === hint.type; currentUri.preloadHints = currentUri.preloadHints || [], currentUri.preloadHints.push(hint), hint.byterange && !hint.byterange.hasOwnProperty("offset") && (hint.byterange.offset = isPart ? lastPartByterangeEnd : 0, isPart && (lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length)); var index = currentUri.preloadHints.length - 1; @@ -2919,7 +2919,7 @@ }); } }, - "rendition-report": function() { + "rendition-report": function renditionReport() { var report = camelCaseKeys(entry.attributes); this.manifest.renditionReports = this.manifest.renditionReports || [], this.manifest.renditionReports.push(report); var index = this.manifest.renditionReports.length - 1, required = [ @@ -2928,20 +2928,20 @@ ]; hasParts && required.push("LAST-PART"), this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #" + index, entry.attributes, required); }, - "part-inf": function() { + "part-inf": function partInf() { this.manifest.partInf = camelCaseKeys(entry.attributes), this.warnOnMissingAttributes_("#EXT-X-PART-INF", entry.attributes, [ "PART-TARGET" ]), this.manifest.partInf.partTarget && (this.manifest.partTargetDuration = this.manifest.partInf.partTarget), setHoldBack.call(this, this.manifest); } })[entry.tagType] || noop).call(self1); }, - uri: function() { + uri: function uri() { currentUri.uri = entry.uri, uris.push(currentUri), !this.manifest.targetDuration || "duration" in currentUri || (this.trigger("warn", { message: "defaulting segment duration to the target duration" }), currentUri.duration = this.manifest.targetDuration), _key && (currentUri.key = _key), currentUri.timeline = currentTimeline, currentMap && (currentUri.map = currentMap), lastPartByterangeEnd = 0, currentUri = {}; }, - comment: function() {}, - custom: function() { + comment: function comment() {}, + custom: function custom() { entry.segment ? (currentUri.custom = currentUri.custom || {}, currentUri.custom[entry.customType] = entry.data) : (this.manifest.custom = this.manifest.custom || {}, this.manifest.custom[entry.customType] = entry.data); } })[entry.type].call(self1); @@ -2949,20 +2949,20 @@ } (0, inheritsLoose.Z)(Parser, _Stream); var _proto = Parser.prototype; - return _proto.warnOnMissingAttributes_ = function(identifier, attributes, required) { + return _proto.warnOnMissingAttributes_ = function warnOnMissingAttributes_(identifier, attributes, required) { var missing = []; required.forEach(function(key) { attributes.hasOwnProperty(key) || missing.push(key); }), missing.length && this.trigger("warn", { message: identifier + " lacks required attribute(s): " + missing.join(", ") }); - }, _proto.push = function(chunk) { + }, _proto.push = function push(chunk) { this.lineStream.push(chunk); - }, _proto.end = function() { + }, _proto.end = function end() { this.lineStream.push("\n"), this.trigger("end"); - }, _proto.addParser = function(options) { + }, _proto.addParser = function addParser(options) { this.parseStream.addParser(options); - }, _proto.addTagMapper = function(options) { + }, _proto.addTagMapper = function addTagMapper(options) { this.parseStream.addTagMapper(options); }, Parser; }(Stream); @@ -3029,7 +3029,7 @@ }, parseEndNumber = function(endNumber) { return (endNumber && "number" != typeof endNumber && (endNumber = parseInt(endNumber, 10)), isNaN(endNumber)) ? null : endNumber; }, segmentRange = { - static: function(attributes) { + static: function _static(attributes) { var duration = attributes.duration, _attributes$timescale = attributes.timescale, sourceDuration = attributes.sourceDuration, periodDuration = attributes.periodDuration, endNumber = parseEndNumber(attributes.endNumber), segmentDuration = duration / (void 0 === _attributes$timescale ? 1 : _attributes$timescale); return "number" == typeof endNumber ? { start: 0, @@ -3042,7 +3042,7 @@ end: sourceDuration / segmentDuration }; }, - dynamic: function(attributes) { + dynamic: function dynamic(attributes) { var NOW = attributes.NOW, clientOffset = attributes.clientOffset, availabilityStartTime = attributes.availabilityStartTime, _attributes$timescale2 = attributes.timescale, timescale = void 0 === _attributes$timescale2 ? 1 : _attributes$timescale2, duration = attributes.duration, _attributes$start = attributes.start, _attributes$minimumUp = attributes.minimumUpdatePeriod, _attributes$timeShift = attributes.timeShiftBufferDepth, endNumber = parseEndNumber(attributes.endNumber), now = (NOW + clientOffset) / 1000, periodStartWC = availabilityStartTime + (void 0 === _attributes$start ? 0 : _attributes$start); return { start: Math.max(0, Math.floor((now - periodStartWC - (void 0 === _attributes$timeShift ? 1 / 0 : _attributes$timeShift)) * timescale / duration)), @@ -3362,60 +3362,60 @@ var _match$slice = match.slice(1), year = _match$slice[0], month = _match$slice[1], day = _match$slice[2], hour = _match$slice[3], minute = _match$slice[4], second = _match$slice[5]; return 31536000 * parseFloat(year || 0) + 2592000 * parseFloat(month || 0) + 86400 * parseFloat(day || 0) + 3600 * parseFloat(hour || 0) + 60 * parseFloat(minute || 0) + parseFloat(second || 0); }, parsers = { - mediaPresentationDuration: function(value) { + mediaPresentationDuration: function mediaPresentationDuration(value) { return parseDuration(value); }, - availabilityStartTime: function(value) { + availabilityStartTime: function availabilityStartTime(value) { var str; return str = value, /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(str) && (str += "Z"), Date.parse(str) / 1000; }, - minimumUpdatePeriod: function(value) { + minimumUpdatePeriod: function minimumUpdatePeriod(value) { return parseDuration(value); }, - suggestedPresentationDelay: function(value) { + suggestedPresentationDelay: function suggestedPresentationDelay(value) { return parseDuration(value); }, - type: function(value) { + type: function type(value) { return value; }, - timeShiftBufferDepth: function(value) { + timeShiftBufferDepth: function timeShiftBufferDepth(value) { return parseDuration(value); }, - start: function(value) { + start: function start(value) { return parseDuration(value); }, - width: function(value) { + width: function width(value) { return parseInt(value, 10); }, - height: function(value) { + height: function height(value) { return parseInt(value, 10); }, - bandwidth: function(value) { + bandwidth: function bandwidth(value) { return parseInt(value, 10); }, - startNumber: function(value) { + startNumber: function startNumber(value) { return parseInt(value, 10); }, - timescale: function(value) { + timescale: function timescale(value) { return parseInt(value, 10); }, - presentationTimeOffset: function(value) { + presentationTimeOffset: function presentationTimeOffset(value) { return parseInt(value, 10); }, - duration: function(value) { + duration: function duration(value) { var parsedValue = parseInt(value, 10); return isNaN(parsedValue) ? parseDuration(value) : parsedValue; }, - d: function(value) { + d: function d(value) { return parseInt(value, 10); }, - t: function(value) { + t: function t(value) { return parseInt(value, 10); }, - r: function(value) { + r: function r(value) { return parseInt(value, 10); }, - DEFAULT: function(value) { + DEFAULT: function DEFAULT(value) { return value; } }, parseAttributes = function(el) { @@ -5355,9 +5355,9 @@ return allocUnsafe(size); }, Buffer.allocUnsafeSlow = function(size) { return allocUnsafe(size); - }, Buffer.isBuffer = function(b) { + }, Buffer.isBuffer = function isBuffer(b) { return null != b && !0 === b._isBuffer && b !== Buffer.prototype; - }, Buffer.compare = function(a, b) { + }, Buffer.compare = function compare(a, b) { if (isInstance(a, Uint8Array) && (a = Buffer.from(a, a.offset, a.byteLength)), isInstance(b, Uint8Array) && (b = Buffer.from(b, b.offset, b.byteLength)), !Buffer.isBuffer(a) || !Buffer.isBuffer(b)) throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); if (a === b) return 0; for(var x = a.length, y = b.length, i = 0, len = Math.min(x, y); i < len; ++i)if (a[i] !== b[i]) { @@ -5365,7 +5365,7 @@ break; } return x < y ? -1 : y < x ? 1 : 0; - }, Buffer.isEncoding = function(encoding) { + }, Buffer.isEncoding = function isEncoding(encoding) { switch(String(encoding).toLowerCase()){ case "hex": case "utf8": @@ -5382,7 +5382,7 @@ default: return !1; } - }, Buffer.concat = function(list, length) { + }, Buffer.concat = function concat(list, length) { if (!Array.isArray(list)) throw TypeError('"list" argument must be an Array of Buffers'); if (0 === list.length) return Buffer.alloc(0); if (void 0 === length) for(i = 0, length = 0; i < list.length; ++i)length += list[i].length; @@ -5393,31 +5393,31 @@ buf.copy(buffer, pos), pos += buf.length; } return buffer; - }, Buffer.byteLength = byteLength, Buffer.prototype._isBuffer = !0, Buffer.prototype.swap16 = function() { + }, Buffer.byteLength = byteLength, Buffer.prototype._isBuffer = !0, Buffer.prototype.swap16 = function swap16() { var len = this.length; if (len % 2 != 0) throw RangeError("Buffer size must be a multiple of 16-bits"); for(var i = 0; i < len; i += 2)swap(this, i, i + 1); return this; - }, Buffer.prototype.swap32 = function() { + }, Buffer.prototype.swap32 = function swap32() { var len = this.length; if (len % 4 != 0) throw RangeError("Buffer size must be a multiple of 32-bits"); for(var i = 0; i < len; i += 4)swap(this, i, i + 3), swap(this, i + 1, i + 2); return this; - }, Buffer.prototype.swap64 = function() { + }, Buffer.prototype.swap64 = function swap64() { var len = this.length; if (len % 8 != 0) throw RangeError("Buffer size must be a multiple of 64-bits"); for(var i = 0; i < len; i += 8)swap(this, i, i + 7), swap(this, i + 1, i + 6), swap(this, i + 2, i + 5), swap(this, i + 3, i + 4); return this; - }, Buffer.prototype.toString = function() { + }, Buffer.prototype.toString = function toString() { var length = this.length; return 0 === length ? "" : 0 == arguments.length ? utf8Slice(this, 0, length) : slowToString.apply(this, arguments); - }, Buffer.prototype.toLocaleString = Buffer.prototype.toString, Buffer.prototype.equals = function(b) { + }, Buffer.prototype.toLocaleString = Buffer.prototype.toString, Buffer.prototype.equals = function equals(b) { if (!Buffer.isBuffer(b)) throw TypeError("Argument must be a Buffer"); return this === b || 0 === Buffer.compare(this, b); - }, Buffer.prototype.inspect = function() { + }, Buffer.prototype.inspect = function inspect() { var str = "", max = exports.INSPECT_MAX_BYTES; return str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(), this.length > max && (str += " ... "), "