{"version":3,"sources":["webpack:///./node_modules/lodash.frompairs/index.js","webpack:///./node_modules/@faithlife/video-player/node_modules/mux.js/lib/tools/parse-sidx.js","webpack:///./node_modules/ngcomponent/index.js","webpack:///./node_modules/@faithlife/video-player/dist/video-player.js","webpack:///./node_modules/react2angular/index.js","webpack:///./node_modules/@faithlife/video-player/node_modules/mux.js/lib/utils/clock.js"],"names":["module","exports","pairs","index","length","result","pair","MAX_UINT32","Math","pow","data","view","DataView","buffer","byteOffset","byteLength","version","flags","Uint8Array","subarray","references","referenceId","getUint32","timescale","i","earliestPresentationTime","firstOffset","referenceCount","getUint16","push","referenceType","referencedSize","subsegmentDuration","startsWithSap","sapType","sapDeltaTime","Object","defineProperty","value","assign","mapValues","some","NgComponent","this","__isFirstRender","state","props","prototype","$onChanges","changes","oldProps","newProps","nextProps","componentWillMount","render","didPropsChange","componentWillReceiveProps","shouldUpdate","shouldComponentUpdate","componentWillUpdate","componentDidUpdate","$postLink","componentDidMount","$onDestroy","componentWillUnmount","v","k","_props","_nextProps","_nextState","_state","default","modules","installedModules","__webpack_require__","moduleId","l","call","m","c","d","name","getter","o","enumerable","get","r","Symbol","toStringTag","t","mode","__esModule","ns","create","key","bind","n","object","property","hasOwnProperty","p","s","global","win","window","self","doccy","topLevel","minDoc","document","setPrototypeOf","subClass","superClass","constructor","ReferenceError","keyCode","searchInput","hasKeyCode","which","charCode","names","foundNamedKey","search","String","codes","toLowerCase","aliases","charCodeAt","isEventKey","event","nameOrCode","code","fromCharCode","title","alias","__webpack_exports__","a","b","DESCRIPTORS","global_window","window_default","global_document","document_default","helpers_extends","extends_default","assertThisInitialized","assertThisInitialized_default","inheritsLoose","inheritsLoose_default","tuple","tuple_default","keycode","keycode_default","lib","lib_default","browser_index","browser_index_default","construct","construct_default","inherits","inherits_default","url_toolkit","url_toolkit_default","resolve_url","baseUrl","relativeUrl","test","location","href","nativeURL","URL","protocolLess","removeLocation","buildAbsoluteURL","newUrl","slice","protocol","helpers_inheritsLoose","helpers_inheritsLoose_default","Stream","listeners","_proto","on","type","listener","off","indexOf","splice","trigger","callbacks","arguments","args","Array","_length","_i","apply","dispose","pipe","destination","runtime_helpers_extends","helpers_extends_default","helpers_assertThisInitialized","helpers_assertThisInitialized_default","decode_b64_to_uint8_array","m3u8_parser_es_LineStream","_Stream","LineStream","_this","nextNewline","substring","TAB","parseByterange","byterangeString","match","exec","parseInt","offset","parseAttributes","attributes","attr","attrs","split","RegExp","replace","m3u8_parser_es_ParseStream","ParseStream","customParsers","tagMappers","line","_this2","trim","reduce","acc","mapper","mappedLine","concat","forEach","newLine","tagType","duration","parseFloat","number","playlistType","allowed","URI","uri","BYTERANGE","byterange","RESOLUTION","resolution","width","height","BANDWIDTH","dateTimeString","dateTimeObject","Date","IV","Uint32Array","PRECISE","subkey","text","addParser","_ref","_this3","expression","customType","dataParser","segment","addTagMapper","_ref2","map","camelCaseKeys","keys","str","toUpperCase","setHoldBack","manifest","serverControl","targetDuration","partTargetDuration","tag","hb","phb","minTargetDuration","minPartDuration","message","m3u8_parser_es_Parser","Parser","lineStream","parseStream","currentMap","_key","uris","currentUri","hasParts","noop","defaultMediaGroups","currentTimeline","allowCache","discontinuityStarts","segments","lastByterangeEnd","lastPartByterangeEnd","parts","preloadHints","timeline","preloadSegment","entry","mediaGroup","rendition","endlist","endList","inf","mediaSequence","discontinuitySequence","METHOD","KEYFORMAT","contentProtection","KEYID","schemeIdUri","keyId","pssh","method","iv","isFinite","playlist","playlists","mediaGroups","media","TYPE","NAME","mediaGroupType","DEFAULT","autoselect","AUTOSELECT","LANGUAGE","language","instreamId","CHARACTERISTICS","characteristics","FORCED","forced","discontinuity","targetduration","start","isNaN","timeOffset","precise","cueOut","cueOutCont","cueIn","skip","warnOnMissingAttributes_","segmentIndex","part","partIndex","renditionReports","canBlockReload","canSkipDateranges","hint","isPart","otherHint","report","required","partInf","partTarget","comment","custom","identifier","missing","join","chunk","end","options","regexs","mp4","webm","ogg","video","audio","muxerVideo","muxerAudio","muxerText","mediaTypes","upperMediaTypes","translateLegacyCodec","codec","orig","profile","avcLevel","Number","toString","parseCodecs","codecString","codecs","codecType","details","mediaType","isAudioCodec","getMimeForCodec","container","every","codecs_browserSupportsCodec","MediaSource","isTypeSupported","muxerSupportsCodec","MPEGURL_REGEX","DASH_REGEX","simpleTypeFromSourceType","xmldom_lib","isObject","obj","merge","_len","objects","source","isArray","flatten","lists","x","y","from","list","mpd_parser_es_errors","mpd_parser_es_urlTypeToSegment","_ref$baseUrl","_ref$source","_ref$range","range","_ref$indexRange","indexRange","resolvedUri","ranges","startRange","endRange","parseEndNumber","endNumber","segmentRange","static","_attributes$timescale","sourceDuration","periodDuration","segmentDuration","dynamic","NOW","clientOffset","availabilityStartTime","_attributes$timescale2","_attributes$start","_attributes$minimumUp","minimumUpdatePeriod","_attributes$timeShift","timeShiftBufferDepth","Infinity","now","periodStartWC","segmentCount","ceil","availableStart","floor","availableEnd","max","min","parseByDuration","_attributes$timescale4","_segmentRange$type","mpd_parser_es_range","_attributes$timescale3","periodIndex","_attributes$startNumb","startNumber","time","toSegments","sectionDuration","segmentsFromBase","_attributes$initializ","initialization","_attributes$indexRang","Error","initSegment","sourceURL","segmentTimeInfo","addSidxSegmentsToPlaylist","sidx","sidxByteRange","sidxEnd","mediaReferences","filter","startIndex","reference","size","generateSidxKey","mergeDiscontiguousPlaylists","_acc$name$segments","id","lang","e","addSidxSegmentsToPlaylist$1","sidxMapping","sidxKey","sidxMatch","addSidxSegmentsToPlaylists","formatVideoPlaylist","_ref3","_attributes2","AUDIO","SUBTITLES","CODECS","bandwidth","videoOnly","_ref4","mimeType","contentType","audioOnly","_ref5","vttOnly","_ref6","toM3u8","dashPlaylists","locations","_mediaGroups","_dashPlaylists$0$attr","suggestedPresentationDelay","videoPlaylists","audioPlaylists","vttPlaylists","captions","captionServices","Boolean","VIDEO","isAudioOnly","mainPlaylist","formattedPlaylists","role","label","roleLabel","formatted","_attributes","formatAudioPlaylist","organizeAudioPlaylists","subs","_m3u8Attributes","m3u8Attributes","formatVttPlaylist","organizeVttPlaylists","cc","svcObj","svc","service","channel","aspectRatio","easyReader","getLiveRValue","parseByTimeline","segmentTimeline","_attributes$minimumUp2","_attributes$media","sIndex","S","repeat","segmentTime","count","nextS","identifierPattern","constructTemplateUrl","url","values","format","identifierReplacement","mpd_parser_es_segmentsFromTemplate","templateValues","RepresentationID","Bandwidth","mapSegment","parseTemplateInfo","Time","presentationTimeOffset","presentationTime","periodStart","segmentsFromList","_attributes$segmentUr","segmentUrls","segmentUrlMap","segmentUrlObject","segmentUrl","mediaRange","SegmentURLToSegmentObject","generateSegments","segmentAttributes","segmentsFn","segmentInfo","template","base","segmentsInfo","_segmentAttributes","_segmentAttributes$ti","findChildren","element","childNodes","tagName","getContent","textContent","parseDuration","_match$slice","year","month","day","hour","minute","second","parsers","mediaPresentationDuration","parse","parsedValue","mpd_parser_es_parseAttributes","el","parseFn","keySystemsMap","mpd_parser_es_buildBaseUrls","referenceUrls","baseUrlElements","baseUrlElement","getSegmentInformation","adaptationSet","segmentTemplate","segmentList","segmentBase","segmentTimelineParentNode","segmentInitializationParentNode","segmentInitialization","toRepresentations","periodAttributes","periodBaseUrls","periodSegmentInfo","adaptationSetAttributes","adaptationSetBaseUrls","roleAttributes","accessibility","_value$split","undefined","_value$split2","_value$split2$","opts","opt","_opt$split","val","labelVal","nodeValue","node","keySystem","psshNode","psshBuffer","representations","adaptationSetSegmentInfo","representation","repBaseUrlElements","repBaseUrls","representationSegmentInfo","inheritBaseUrls","mpd_parser_es_toAdaptationSets","mpdAttributes","mpdBaseUrls","period","parsedPeriodId","adaptationSets","mpd_parser_es_stringToMpdXml","manifestString","xml","mpd","parser","parseFromString","documentElement","getElementsByTagName","parsedManifestInfo","_options","_options$manifestUri","manifestUri","_options$NOW","_options$clientOffset","periodNodes","periods","priorPeriod","priorPeriodAttributes","mpdType","getPeriodStart","representationInfo","inheritAttributes","parseUTCTiming","UTCTimingNode","parseUTCTimingScheme","parse_sidx_","parse_sidx_default","toUint8","bytes","ArrayBuffer","isView","BigInt","BYTE_TABLE","bytesToNumber","Uint16Array","_temp","_ref$signed","signed","_ref$le","le","fn","total","byte","exponent","abs","numberToBytes","_temp2","_ref2$le","byteCount","countBits","byteIndex","bytesToString","string","decodeURIComponent","escape","stringToBytes","stringIsBytes","unescape","encodeURIComponent","bytesMatch","_temp3","_ref3$offset","_ref3$mask","mask","bByte","ID3","id3_helpers_getId3Offset","getId3Offset","returnSize","id3_helpers_getId3Size","mp4_helpers_normalizePath","path","mp4_helpers_parseDescriptors","results","headerSize","z","_DESCRIPTORS$z","desc","dependsOnEsId","ocrEsId","descriptors","len","oti","streamType","bufferSize","maxBitrate","avgBitrate","mp4_helpers_findBox","findBox","paths","complete","normalizePaths","EBML_TAGS","EBML","DocType","Segment","SegmentInfo","Tracks","Track","TrackNumber","DefaultDuration","TrackEntry","TrackType","FlagDefault","CodecID","CodecPrivate","VideoTrack","AudioTrack","Cluster","Timestamp","TimestampScale","BlockGroup","BlockDuration","Block","SimpleBlock","LENGTH_TABLE","ebml_helpers_getvint","removeLength","getLength","valueBytes","ebml_helpers_normalizePath","normalizePath","ebml_helpers_getInfinityDataSize","getInfinityDataSize","innerid","dataHeader","ebml_helpers_findEbml","findEbml","ebml_helpers_normalizePaths","dataStart","dataEnd","NAL_TYPE_ONE","NAL_TYPE_TWO","EMULATION_PREVENTION","nal_helpers_discardEmulationPreventionBytes","positions","newLength","newData","sourceIndex","shift","nal_helpers_findNal","dataType","types","nalLimit","nalStart","nalsFound","nalOffset","nalType","CONSTANTS","_isLikely","aac","mp3","docType","mkv","matroska","mov","fmp4","moof","moov","ac3","ts","flac","avi","riff","wav","findH264Nal","findH265Nal","isLikelyTypes","isLikelyFn","browserApi","isLikely","containers_detectContainerForBytes","clock_","hooks_","hooks","removeHook","FullscreenApi","prefixed","apiMap","specApi","video_es_i","dist_video_es_i","video_es_history","log$1","createLogger$1","logByType","level","log","lvl","levels","lvlRegExp","unshift","console","info","video_es_LogByTypeFactory","createLogger","subname","all","debug","warn","error","history","fname","historyItem","clear","disable","enable","_len2","_key2","_len3","_key3","_len4","_key4","video_es_toString","video_es_isObject","each","video_es_assign","target","sources","isPlain","computedStyle","prop","getComputedStyle","computedStyleValue","getPropertyValue","USER_AGENT","navigator","userAgent","webkitVersionMap","appleWebkitVersion","pop","IS_IPOD","IOS_VERSION","IS_ANDROID","ANDROID_VERSION","major","minor","IS_NATIVE_ANDROID","IS_FIREFOX","IS_EDGE","IS_CHROME","CHROME_VERSION","IE_VERSION","IS_SAFARI","IS_WINDOWS","TOUCH_ENABLED","isReal","maxTouchPoints","DocumentTouch","IS_IPAD","IS_IPHONE","IS_IOS","IS_ANY_SAFARI","browser","freeze","__proto__","isNonBlankString","throwIfWhitespace","isEl","nodeType","isInFrame","parent","createQuerier","selector","context","querySelector","ctx","video_es_createEl","properties","content","createElement","getOwnPropertyNames","propName","setAttribute","attrName","appendContent","innerText","prependTo","child","firstChild","insertBefore","appendChild","hasClass","classToCheck","classList","contains","className","addClass","classToAdd","add","removeClass","classToRemove","remove","toggleClass","classToToggle","predicate","has","setAttributes","attrValue","removeAttribute","getAttributes","knownBooleans","attrVal","getAttribute","attribute","blockTextSelection","body","focus","onselectstart","unblockTextSelection","getBoundingClientRect","parentNode","rect","findPosition","offsetParent","left","top","offsetWidth","offsetHeight","fullscreenElement","offsetLeft","offsetTop","getPointerPosition","translated","item","nodeName","transform","_values","position","boxTarget","box","boxW","boxH","offsetY","offsetX","changedTouches","pageX","pageY","isTextNode","emptyEl","removeChild","normalizeContent","createTextNode","insertContent","isSingleLeftClick","button","buttons","videojs$1","$","$$","Dom","createEl","_windowLoaded","video_es_autoSetup","autoSetup","vids","audios","divs","mediaEls","mediaEl","autoSetupTimeout","player","wait","vjs","setTimeout","setWindowLoaded","removeEventListener","readyState","addEventListener","video_es_FakeWeakMap","video_es_createStyleElement","style","setTextContent","styleSheet","cssText","_guid","newGUID","WeakMap","FakeWeakMap","vdata","performance","set","access","_supportsPassive","DomData","_cleanUpEvents","elem","handlers","dispatcher","detachEvent","disabled","_handleMultipleEvents","callback","fixEvent","fixed_","returnTrue","returnFalse","isPropagationStopped","isImmediatePropagationStopped","old","preventDefault","srcElement","relatedTarget","fromElement","toElement","returnValue","defaultPrevented","stopPropagation","cancelBubble","stopImmediatePropagation","clientX","doc","scrollLeft","clientLeft","clientY","scrollTop","clientTop","passiveEvents","guid","hash","handlersCopy","video_es_supportsPassive","passive","attachEvent","removeType","elemData","ownerDocument","bubbles","targetData","one","func","any","EVENT_MAP","Events","uid","bound","video_es_throttle","last","EventTarget$2","allowedEvents_","ael","dispatchEvent","queueTrigger","Map","oldTimeout","clearTimeout","timeout","objName","name_","isEvented","eventBusEl_","isValidEventType","validateTarget","fnName","validateEventType","validateListener","normalizeListenArgs","isTargetingSelf","listen","EventedMixin","_normalizeListenArgs","removeListenerOnDispose","removeRemoverOnTargetDispose","_normalizeListenArgs2","wrapper","largs","_normalizeListenArgs3","_len5","_key5","targetOrType","typeOrListener","evented","eventBusKey","eventedCallbacks","el_","StatefulMixin","setState","stateUpdates","to","stateful","defaultState","handleStateChanged","w","toTitleCase$1","mergeOptions$3","MapSham","map_","thisArg","Map$1","SetSham","set_","Set","Component$1","Component","ready","play","player_","isDisposed_","parentComponent_","options_","id_","handleLanguagechange","children_","childIndex_","childNameIndex_","setTimeoutIds_","setIntervalIds_","rafIds_","namedRafs_","clearingTimersOnDispose_","initChildren","reportTouchActivity","enableTouchActivity","readyQueue_","isDisposed","localize","tokens","defaultValue","languages","primaryCode","primaryLang","localizedString","ret","contentEl","contentEl_","children","getChildById","getChild","getDescendant","currentChild","addChild","component","componentName","componentClassName","componentClass","ComponentClass","getComponent","refNode","childFound","compEl","workingChildren","parentOptions","Tech","wchild","isTech","playerOptions","newChild","buildCSSClass","sync","isReady_","triggerReady","readyQueue","show","hide","lockShowing","unlockShowing","num","skipListeners","dimension","dimensions","widthOrHeight","pxIndex","currentDimension","computedWidthOrHeight","rule","currentDimensions","currentWidth","currentHeight","blur","handleKeyDown","handleKeyPress","emitTapEvents","couldBeTap","touchStart","firstTouch","touches","xdiff","ydiff","sqrt","noTap","reportUserActivity","touchHolding","clearInterval","setInterval","touchEnd","timeoutId","clearTimersOnDispose_","interval","intervalId","requestAnimationFrame","supportsRaf_","requestNamedAnimationFrame","_this4","cancelNamedAnimationFrame","cancelAnimationFrame","_this5","idName","cancelName","registerComponent","ComponentToRegister","reason","isComp","isPrototypeOf","components_","Player","players","playerNames","pname","getRange","valueIndex","rangeIndex","maxIndex","rangeCheck","createTimeRangesObj","timeRangesObj","iterator","createTimeRanges","bufferedPercent","buffered","bufferedDuration","MediaError","defaultMessages","status","errorTypes","1","2","3","4","5","errNum","isPromise","then","silencePromise","trackToJson_","track","cues","cue","startTime","endTime","textTrackConverter","tech","trackEls","trackObjs","trackEl","json","src","textTracks","addedTrack","addRemoteTextTrack","addCue","video_es_ModalDialog","_Component","ModalDialog","handleKeyDown_","close_","close","opened_","hasBeenOpened_","hasBeenFilled_","closeable","uncloseable","MODAL_CLASS_NAME","descEl_","description","tabIndex","previouslyActiveEl_","open","fillAlways","fill","wasPlaying_","paused","pauseOnOpen","pause","hadControls_","controls","conditionalFocus_","opened","conditionalBlur_","temporary","closeable_","temp","controlText","fillWith","parentEl","nextSiblingEl","nextSibling","empty","closeButton","content_","activeEl","activeElement","playerEl","focusIndex","focusableEls","focusableEls_","shiftKey","allChildren","querySelectorAll","HTMLAnchorElement","HTMLAreaElement","hasAttribute","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLButtonElement","HTMLIFrameElement","HTMLObjectElement","HTMLEmbedElement","video_es_TrackList","_EventTarget","TrackList","tracks","tracks_","addTrack","labelchange_","removeTrack","rtrack","getTrackById","video_es_event","change","addtrack","removetrack","labelchange","disableOthers$1","enabled","video_es_AudioTrackList","_TrackList","AudioTrackList","changing_","enabledChange_","disableOthers","selected","video_es_VideoTrackList","VideoTrackList","selectedChange_","video_es_TextTrackList","TextTrackList","queueChange_","triggerSelectedlanguagechange","triggerSelectedlanguagechange_","kind","selectedlanguagechange_","HtmlTrackElementList","trackElements","trackElements_","addTrackElement_","trackElement","getTrackElementByTrack_","trackElement_","removeTrackElement_","TextTrackCueList","setCues_","length_","oldLength","cues_","defineProp","getCueById","VideoTrackKind","alternative","main","sign","subtitles","commentary","AudioTrackKind","TextTrackKind","descriptions","chapters","metadata","TextTrackMode","hidden","showing","video_es_Track","trackProps","_loop","newLabel","video_es_parseUrl","host","video_es_getAbsoluteURL","getFileExtension","pathParts","video_es_isCrossOrigin","winLoc","urlInfo","Url","parseUrl","getAbsoluteURL","isCrossOrigin","video_es_parseCues","srcContent","WebVTT","vttjs","StringDecoder","errors","oncue","onparsingerror","onflush","groupCollapsed","groupEnd","flush","video_es_loadTrack","crossOrigin","cors","withCredentials","tech_","err","response","responseBody","loaded_","video_es_TextTrack","_Track","TextTrack","settings","srclang","default_","activeCues_","preload_","preloadTextTracks","activeCues","changed","timeupdateHandler","defineProperties","newMode","ct","currentTime","active","originalCue","VTTCue","originalCue_","removeCue","_removeCue","cuechange","video_es_AudioTrack","newEnabled","video_es_VideoTrack","newSelected","video_es_HTMLTrackElement","HTMLTrackElement","load","NONE","LOADING","LOADED","ERROR","NORMAL","ListClass","TrackClass","capitalName","getterName","privateName","REMOTE","remoteText","remoteTextEl","ALL","video_es_Tech","onDurationChange_","onDurationChange","trackProgress_","trackProgress","trackCurrentTime_","trackCurrentTime","stopTrackingCurrentTime_","stopTrackingCurrentTime","disposeSourceHandler_","disposeSourceHandler","hasStarted_","featuresProgressEvents","manualProgressOn","featuresTimeupdateEvents","manualTimeUpdatesOn","nativeCaptions","nativeTextTracks","featuresNativeTextTracks","emulateTextTracks","autoRemoteTextTracks_","initTrackListeners","nativeControlsForTouch","triggerSourceset","manualProgress","manualProgressOff","stopTrackingProgress","progressInterval","numBufferedPercent","bufferedPercent_","duration_","manualTimeUpdates","manualTimeUpdatesOff","currentTimeInterval","manuallyTriggered","clearTracks","removeRemoteTextTrack","cleanupAutoTextTracks","reset","setCrossOrigin","error_","played","setScrubbing","scrubbing","setCurrentTime","trackListChanges","addWebVttScript_","script","onload","onerror","_this6","remoteTracks","remoteTextTracks","handleAddTrack","handleRemoveTrack","updateDisplay","textTracksChanges","addTextTrack","createTrackHelper","createRemoteTextTrack","manualCleanup","_this7","htmlTrackElement","remoteTextTrackEls","getVideoPlaybackQuality","requestPictureInPicture","PromiseClass","Promise","reject","disablePictureInPicture","setDisablePictureInPicture","setPoster","playsinline","setPlaysinline","overrideNativeAudioTracks","overrideNativeVideoTracks","canPlayType","canPlaySource","srcObj","registerTech","techs_","defaultTechOrder_","getTech","videojs","featuresVolumeControl","featuresMuteControl","featuresFullscreenResize","featuresPlaybackRate","featuresSourceset","withSourceHandlers","_Tech","registerSourceHandler","handler","sourceHandlers","can","selectSourceHandler","canHandleSource","sh","originalFn","sourceHandler_","setSource","nativeSourceHandler","currentSource_","handleSource","middlewares","middlewareInstances","TERMINATOR","next","setSourceHelper","middleware","lastRun","_middleware","mwFactory","mwrest","mw","mws","_mws$i","mwf","mwi","getOrCreateFactory","_src","mediate","arg","callMethod","middlewareValue","middlewareIterator","terminated","executeRight","allowedGetters","muted","seekable","volume","ended","allowedSetters","setMuted","setVolume","allowedMediators","MimetypesKind","opus","ogv","m4v","m4a","caf","oga","m3u8","jpg","jpeg","gif","png","svg","webp","getMimetype","ext","fixSource","mimetype","video_es_MediaLoader","MediaLoader","j","techOrder","techName","isSupported","loadTech_","video_es_ClickableComponent","ClickableComponent","handleMouseOver_","handleMouseOver","handleMouseOut_","handleMouseOut","handleClick_","handleClick","tabIndex_","createControlTextEl","controlTextEl_","controlText_","localizedText","nonIconControl","noUITitleAttributes","enabled_","clickHandler","video_es_PosterImage","_ClickableComponent","PosterImage","update","update_","poster","setSrc","backgroundImage","sourceIsEncrypted","usingPlugin","eme","sessions","fontMap","monospace","sansSerif","serif","monospaceSansSerif","monospaceSerif","proportionalSansSerif","proportionalSerif","casual","smallcaps","constructColor","color","opacity","hex","tryUpdateStyle","video_es_TextTrackDisplay","TextTrackDisplay","updateDisplayHandler","toggleDisplay","preselectTrack","firstDesc","firstCaptions","preferredTrack","modes","trackList","userPref","cache_","selectedLanguage","clearDisplay","processCues","allowMultipleShowingTracks","showingTracks","updateForTrack","descriptionsTrack","captionsSubtitlesTrack","_track","updateDisplayState","overrides","textTrackSettings","getValues","cueDiv","displayState","textOpacity","backgroundColor","backgroundOpacity","windowColor","windowOpacity","edgeStyle","textShadow","fontPercent","fontSize","fontFamily","fontVariant","_i2","_track2","_j","cueEl","video_es_LoadingSpinner","LoadingSpinner","isAudio","playerType","dir","video_es_Button","Button","video_es_BigPlayButton","_Button","BigPlayButton","mouseused_","handleMouseDown","playPromise","cb","playToggle","playFocus","video_es_CloseButton","CloseButton","video_es_PlayToggle","PlayToggle","replay","handlePlay","handlePause","handleEnded","handleSeeked","defaultImplementation","seconds","guide","h","gm","gh","implementation","formatTime","video_es_TimeDisplay","TimeDisplay","updateContent","updateTextNode_","span","labelText_","textNode_","formattedTime_","oldNode","replaceChild","video_es_CurrentTimeDisplay","_TimeDisplay","CurrentTimeDisplay","getCache","video_es_DurationDisplay","DurationDisplay","video_es_TimeDivider","TimeDivider","div","video_es_RemainingTimeDisplay","RemainingTimeDisplay","remainingTimeDisplay","remainingTime","video_es_LiveDisplay","LiveDisplay","updateShowing","video_es_SeekToLive","SeekToLive","updateLiveEdgeStatus","liveTracker","updateLiveEdgeStatusHandler_","textEl_","atLiveEdge","seekToLiveEdge","clamp","video_es_Slider","Slider","handleMouseDown_","handleMouseUp_","handleMouseUp","handleMouseMove_","handleMouseMove","bar","barName","vertical","playerEvent","progress","getProgress","progress_","sizeKey","toFixed","getPercent","calculateDistance","stepBack","stepForward","bool","vertical_","percentify","video_es_LoadProgressBar","LoadProgressBar","partEls_","loadedText","separator","percentageEl_","isLive","seekableEnd","bufferedEnd","percent","percent_","dataset","video_es_TimeTooltip","TimeTooltip","seekBarRect","seekBarPoint","tooltipRect","playerRect","seekBarPointPx","spaceLeftOfPoint","spaceRightOfPoint","right","pullTooltipBy","round","write","updateTime","liveWindow","secondsBehind","video_es_PlayProgressBar","PlayProgressBar","timeTooltip","video_es_MouseTimeDisplay","MouseTimeDisplay","video_es_SeekBar","_Slider","SeekBar","setEventHandlers_","updateInterval","enableIntervalHandler_","enableInterval_","disableIntervalHandler_","disableInterval_","toggleVisibility_","visibilityState","getCurrentTime_","liveCurrentTime","currentTime_","userSeek_","nextSeekedFromUser","seekableStart","videoWasPlaying","newTime","distance","mouseTimeDisplay","handleAction","gotoFraction","STEP_SECONDS","video_es_ProgressControl","ProgressControl","throttledHandleMouseSeek","handleMouseSeek","handleMouseUpHandler_","handleMouseDownHandler_","seekBar","playProgressBar","seekBarEl","removeListenersAddedOnMousedownAndTouchstart","video_es_PictureInPictureToggle","PictureInPictureToggle","handlePictureInPictureChange","handlePictureInPictureEnabledChange","pictureInPictureEnabled","isInPictureInPicture","exitPictureInPicture","video_es_FullscreenToggle","FullscreenToggle","handleFullscreenChange","fsApi_","fullscreenEnabled","isFullscreen","exitFullscreen","requestFullscreen","video_es_VolumeLevel","VolumeLevel","video_es_VolumeLevelTooltip","VolumeLevelTooltip","rangeBarRect","rangeBarPoint","volumeBarPointPx","updateVolume","video_es_MouseVolumeLevelDisplay","MouseVolumeLevelDisplay","bottom","video_es_VolumeBar","VolumeBar","updateLastVolume_","updateARIAAttributes","mouseVolumeLevelDisplay","volumeBarEl","volumeBarRect","volumeBarPoint","checkMuted","ariaValue","volumeAsPercentage_","volumeBeforeDrag","lastVolume_","video_es_VolumeControl","VolumeControl","volumeBar","checkVolumeSupport","throttledHandleMouseMove","orientationClass","video_es_MuteToggle","MuteToggle","checkMuteSupport","vol","lastVolume","volumeToSet","updateIcon_","updateControlText_","video_es_VolumePanel","VolumePanel","inline","volumeControl","handleKeyPressHandler_","volumePanelState_","muteToggle","handleVolumeControlKeyUp","sliderActive_","sliderInactive_","video_es_Menu","Menu","menuButton_","menuButton","focusedChild_","boundHandleBlur_","handleBlur","boundHandleTapClick_","handleTapClick","addEventListenerForItem","removeEventListenerForItem","addItem","childComponent","contentElType","append","btn","buttonPressed_","unpressButton","childComponents","foundComponent","stepChild","video_es_MenuButton","MenuButton","buttonClass","handleMenuKeyUp_","handleMenuKeyUp","menu","handleMouseLeave","handleSubmenuKeyDown","createMenu","items","hideThreshold_","titleEl","titleComponent","createItems","buildWrapperCSSClass","menuButtonClass","pressButton","handleSubmenuKeyPress","video_es_TrackButton","_MenuButton","TrackButton","updateHandler","MenuKeys","video_es_MenuItem","MenuItem","selectable","isSelected_","multiSelectable","_selected","video_es_TextTrackMenuItem","_MenuItem","TextTrackMenuItem","kinds","changeHandler","handleTracksChange","selectedLanguageChangeHandler","handleSelectedLanguageChange","onchange","Event","createEvent","initEvent","referenceTrack","shouldBeSelected","video_es_OffTextTrackMenuItem","_TextTrackMenuItem","OffTextTrackMenuItem","allHidden","video_es_TextTrackButton","_TrackButton","TextTrackButton","TrackMenuItem","label_","kinds_","kind_","video_es_ChaptersTrackMenuItem","ChaptersTrackMenuItem","video_es_ChaptersButton","_TextTrackButton","ChaptersButton","track_","setTrack","findChaptersTrack","updateHandler_","remoteTextTrackEl","_remoteTextTrackEl","getMenuCaption","mi","video_es_DescriptionsButton","DescriptionsButton","video_es_SubtitlesButton","SubtitlesButton","video_es_CaptionSettingsMenuItem","CaptionSettingsMenuItem","video_es_CaptionsButton","CaptionsButton","video_es_SubsCapsMenuItem","SubsCapsMenuItem","parentSpan","video_es_SubsCapsButton","SubsCapsButton","language_","video_es_AudioTrackMenuItem","AudioTrackMenuItem","audioTracks","video_es_AudioTrackButton","AudioTrackButton","video_es_PlaybackRateMenuItem","PlaybackRateMenuItem","rate","playbackRate","video_es_PlaybackRateMenuButton","PlaybackRateMenuButton","labelElId_","updateVisibility","updateLabel","handlePlaybackRateschange","labelEl_","rates","playbackRates","currentRate","newRate","playbackRateSupported","video_es_Spacer","Spacer","video_es_CustomControlSpacer","_Spacer","CustomControlSpacer","video_es_ControlBar","ControlBar","video_es_ErrorDisplay","_ModalDialog","ErrorDisplay","COLOR_BLACK","COLOR_BLUE","COLOR_CYAN","COLOR_GREEN","COLOR_MAGENTA","COLOR_RED","COLOR_WHITE","COLOR_YELLOW","OPACITY_OPAQUE","OPACITY_SEMI","OPACITY_TRANS","selectConfigs","parseOptionValue","video_es_TextTrackSettings","TextTrackSettings","endDialog","setDefaults","persistTextTrackSettings","saveSettings","config","restoreSettings","createElSelect_","legendId","selectLabelledbyIds","optionId","createElFgColor_","createElBgColor_","createElWinColor_","createElColors_","innerHTML","createElFont_","createElControls_","defaultsDescription","initial","accum","selectedIndex","setValues","setSelectedOption","JSON","localStorage","getItem","setItem","stringify","removeItem","ttDisplay","controlBar","subsCapsBtn","subsCapsButton","ccBtn","captionsButton","video_es_ResizeManager","ResizeManager","RESIZE_OBSERVER_AVAILABLE","ResizeObserver","loadListener_","resizeObserver_","debouncedHandler_","immediate","debounced","_later","cancel","video_es_debounce","resizeHandler","observe","contentWindow","unloadListener_","unobserve","disconnect","resizeObserver","defaults","trackingThreshold","liveTolerance","video_es_LiveTracker","LiveTracker","handleVisibilityChange_","handleVisibilityChange","trackLiveHandler_","trackLive_","handlePlay_","handleFirstTimeupdate_","handleFirstTimeupdate","handleSeeked_","seekToLiveEdge_","reset_","handleDurationchange","toggleTracking","stopTracking","startTracking","deltaTime","lastTime_","pastSeekEnd_","pastSeekEnd","isBehind","seekedBehindLive_","timeupdateSeen_","behindLiveEdge_","liveui","isTracking","hasStarted","trackingInterval_","timeDiff","nextSeekedFromUser_","lastSeekEnd_","seekableEnds","sort","seekableStarts","behindLiveEdge","video_es_canPlayType","sourcesetLoad","srcUrls","innerHTMLDescriptorPolyfill","cloneNode","dummy","docFrag","createDocumentFragment","Element","getDescriptor","priority","descriptor","getOwnPropertyDescriptor","configurable","firstSourceWatch","resetSourceWatch_","innerDescriptor","HTMLMediaElement","video_es_getInnerHTMLDescriptor","appendWrapper","appendFn","retval","srcDescriptorPolyfill","setupSourceset","resetSourceset_","srcDescriptor","video_es_getSrcDescriptor","oldSetAttribute","oldLoad","currentSrc","defineLazyProperty","getValue","setter","writable","video_es_Html5","Html5","crossoriginTracks","initNetworkState_","handleLateInit_","enableSourceset","setupSourcesetHandling_","isScrubbing_","hasChildNodes","nodes","nodesLength","removeNodes","proxyNativeTracks_","restoreMetadataTracksInIOSNativePlayer_","setControls","proxyWebkitFullscreen_","disposeMediaElement","metadataTracksPreFullscreenState","takeMetadataTrackSnapshot","storedMode","restoreTrackMode","storedTrack","overrideNative_","override","lowerCaseType","eventName","proxyNativeTracksForType_","elTracks","techTracks","currentTarget","removeOldTracks","removeTracks","found","playerElIngest","movingMediaElementInDOM","clone","techId","playerId","preload","settingsAttrs","networkState","loadstartFired","setLoadstartFired","triggerLoadstart","eventsToTrigger","isScrubbing","fastSeek","checkProgress","NaN","endFn","beginFn","webkitPresentationMode","nativeIOSFullscreen","supportsFullScreen","webkitEnterFullScreen","enterFullScreen","HAVE_METADATA","exitFullScreen","webkitDisplayingFullscreen","webkitExitFullScreen","resetMediaElement","videoPlaybackQuality","webkitDroppedFrameCount","webkitDecodedFrameCount","droppedVideoFrames","totalVideoFrames","creationTime","timing","navigationStart","TEST_VID","canControlVolume","canMuteVolume","canControlPlaybackRate","canOverrideAttributes","supportsNativeTextTracks","supportsNativeVideoTracks","videoTracks","supportsNativeAudioTracks","patchCanPlayType","unpatchCanPlayType","TECH_EVENTS_RETRIGGER","TECH_EVENTS_QUEUE","canplay","canplaythrough","playing","seeked","BREAKPOINT_ORDER","BREAKPOINT_CLASSES","charAt","DEFAULT_BREAKPOINTS","tiny","xsmall","small","medium","large","xlarge","huge","video_es_Player","getTagSettings","closest","boundDocumentFullscreenChange_","documentFullscreenChange_","boundFullWindowOnEscKey_","fullWindowOnEscKey","boundUpdateStyleEl_","updateStyleEl_","boundApplyInitTime_","applyInitTime_","boundUpdateCurrentBreakpoint_","updateCurrentBreakpoint_","boundHandleTechClick_","handleTechClick_","boundHandleTechDoubleClick_","handleTechDoubleClick_","boundHandleTechTouchStart_","handleTechTouchStart_","boundHandleTechTouchMove_","handleTechTouchMove_","boundHandleTechTouchEnd_","handleTechTouchEnd_","boundHandleTechTap_","handleTechTap_","isFullscreen_","isPosterFromTech_","queuedCallbacks_","userActive_","debugEnabled_","tagAttributes","languagesToLower","languages_","resetCache_","poster_","controls_","changingSrc_","playCallbacks_","playTerminatedQueue_","autoplay","plugins","scrubbing_","fullscreenchange","fluid_","playerOptionsCopy","middleware_","flexNotSupported_","majorVersion","userActive","listenForUserActivity_","handleStageClick_","breakpoints","responsive","styleEl_","playerElIngest_","divEmbed","tabindex","VIDEOJS_NO_DYNAMIC_STYLE","defaultsStyleEl","head","fill_","fluid","crossorigin","links","linkEl","techGet_","techCall_","_dimension","privDimension","parsedVal","ratio","aspectRatio_","idClass","ratioParts","videoWidth","videoHeight","ratioMultiplier","width_","height_","_width","_height","techEl","unloadTech_","titleTechName","camelTechName","techName_","normalizeAutoplay","techOptions","loop","techCanOverridePoster","TechClass","handleTechReady_","textTracksJson_","eventObj","seeking","handleTechLoadStart_","handleTechSourceset_","handleTechWaiting_","handleTechEnded_","handleTechSeeking_","handleTechPlay_","handleTechFirstPlay_","handleTechPause_","handleTechDurationChange_","handleTechFullscreenChange_","handleTechFullscreenError_","handleTechEnterPictureInPicture_","handleTechLeavePictureInPicture_","handleTechError_","handleTechPosterChange_","handleTechTextData_","handleTechRateChange_","usingNativeControls","addTechControlsListeners_","safety","removeTechControlsListeners_","manualAutoplay_","promise","resolveMuted","previouslyMuted","restoreMuted","mutedPromise","updateSourceCaches_","matchingSources","findMimetype","sourceElSources","sourceEls","matchingSourceEls","sourceObj","updateSourceCaches","playerSrc","currentSource","eventSrc","lastSource_","techSrc","techGet","request","lastPlaybackRate","queued","_this8","timeWhenWaiting","timeUpdateListener","handleTechCanPlay_","handleTechCanPlayThrough_","handleTechPlaying_","handleTechSeeked_","starttime","userActions","doubleClick","userWasActive","cancelable","toggleFullscreenClass_","targetPlayer","isFs","matches","fullscreen","msMatchesSelector","togglePictureInPictureClass_","initTime","inactivityTimeout","defaultPlaybackRate","video_es_set","reduceRight","video_es_get","_this9","resolve","play_","_this10","isSrcReady","waitToPlay_","runPlayTerminatedQueue_","runPlayCallbacks_","queue","q","percentAsDecimal","_muted","defaultMuted","_defaultMuted","isFS","oldValue","fullscreenOptions","offHandler","errorHandler","requestFullscreenHelper_","fsOptions","_this11","preferFullWindow","enterFullWindow","exitFullscreenHelper_","_this12","exitFullWindow","isFullWindow","docOrigOverflow","overflow","isPiP","isInPictureInPicture_","hotkeys","isContentEditable","excludeElement","handleHotkeys","_hotkeys$fullscreenKe","fullscreenKey","keydownEvent","_hotkeys$muteKey","muteKey","_hotkeys$playPauseKey","playPauseKey","FSToggle","selectSource","_this13","techs","findFirstPassingTechSourcePair","outerArray","innerArray","tester","outerChoice","innerChoice","finder","sourceOrder","handleSrc_","isRetry","_this14","resetRetryOnError_","filterSource","newsrc","srcobj","middlewareSource","src_","notSupportedMessage","setTech","retryOnError","retry","stopListeningForErrors","str1","str2","_this15","sourceTech","_this16","doReset_","resetControlBarUI_","resetProgressBar_","resetPlaybackRate_","resetVolumeBar_","_this$controlBar","durationDisplay","currentSources","currentType","techAutoplay","newPoster","usingNativeControls_","_this17","hookFunction","newErr","suppressNotSupportedError","triggerSuppressedError","errorDisplay","userActivity_","mouseInProgress","lastMoveX","lastMoveY","handleActivity","handleMouseUpAndMouseLeave","screenX","screenY","isAudio_","toJSON","createModal","_this18","modal","currentBreakpoint","candidateBreakpoint","breakpoints_","breakpoint_","removeCurrentBreakpoint_","currentBreakpointClass","_breakpoints","responsive_","loadMedia","_this19","_this$cache_$media","artwork","tt","getMedia","baseOptions","tagOptions","dataSetup","_safeParseTuple","childName","previousLogLevel_","newRates","video_es_navigator","html5","userLanguage","navigationUI","pluginStorage","pluginExists","getPlugin","markPluginAsActive","triggerSetupEvent","before","video_es_createPluginFactory","PluginSubClass","plugin","instance","getEventHash","Plugin","VERSION","isBasic","registerPlugin","basicPluginWrapper","createBasicPlugin","deregisterPlugin","getPlugins","getPluginVersion","BASE_PLUGIN_NAME","hasPlugin","normalizeId","getPlayer","TypeError","defaultView","PlayerComponent","hook","hookOnce","original","video_es_style","video_es_head","getPlayers","nId","_tag","_player","getAllPlayers","comp","use","writeable","extend","subClassMethods","methods","super_","mergeOptions","addLanguage","_mergeOptions","createTimeRange","setFormatTime","customImplementation","resetFormatTime","EventTarget","xhr","dom","video_es_resolveUrl","resolveManifestRedirect","handleManifestRedirect","req","responseURL","logger","filterRanges","timeRanges","findRange","TIME_FUDGE_FACTOR","findNextRange","printableRange","strArr","timeRangesToArray","timeRangesList","lastBufferedEnd","getPartsAndSegments","si","pi","getLastParts","lastSegment","getKnownPartCount","partCount","liveEdgeDelay","master","partHoldBack","holdBack","intervalDuration","endSequence","expired","backward","backwardDuration","forward","forwardDuration","video_es_duration","totalDuration","sumDurations","defaultDuration","durationList","endIndex","durations","playlistEnd","useSafeLiveEnd","liveEdgePadding","lastSegmentTime","isBlacklisted","excludeUntil","isIncompatible","isEnabled","blacklisted","isLowestEnabledRendition","currentBandwidth","MAX_VALUE","playlistMatch","someAudioVariant","groupName","video_es_isAudioOnly","variant","_ret","Playlist","getMediaInfoForTime","startingSegmentIndex","startingPartIndex","experimentalExactManifestTimings","partsAndSegments","partAndSegment","_partAndSegment","_i3","_i4","_partAndSegment2","isDisabled","isAes","estimateSegmentRequestTime","bytesReceived","video_es_log","createPlaylistID","forEachMediaGroup","groupKey","labelKey","mediaProperties","setupMediaPlaylist","playlistErrors_","video_es_addPropertiesToMaster","phonyUri","audioOnlyMaster","groupId","setupMediaPlaylists","resolveMediaGroupUris","mergeOptions$2","EventTarget$1","updateSegment","skipped","resolveSegmentUris","baseUri","getAllSegments","isPlaylistUnchanged","updateMaster$1","newMedia","unchangedCheck","oldMedia","mergedPlaylist","skippedSegments","oldSegments","newSegments","newIndex","oldSegment","newSegment","updateSegments","refreshDelay","lastPart","lastDuration","video_es_PlaylistLoader","PlaylistLoader","vhs","logger_","_options$withCredenti","_options$handleManife","handleManifestRedirects","vhs_","vhsOptions","customTagParsers","customTagMappers","experimentalLLHLS","handleMediaupdatetimeout_","query","nextMSN","nextPart","canSkipUntil","addLLHLSQueryDirectives","playlistRequestError","haveMetadata","playlistString","responseText","startingState","parseManifest_","onwarn","oninfo","_ref$customTagParsers","_ref$customTagMappers","customParser","video_es_parseManifest","playlistObject","lastRequest","media_","updateMediaUpdateTimeout_","stopRequest","mediaUpdateTimeout","finalRenditionTimeout","oldRequest","onreadystatechange","abort","shouldDelay","delay","mediaChange","masterPlaylistRef","started","setupInitialPlaylist","srcUri","video_es_masterForMedia","videojsXHR","mergeOptions$1","callbackWrapper","reqResponse","responseType","responseTime","roundTripTime","requestTime","headers","responseHeaders","timedout","aborted","statusCode","xhrFactory","XhrFunction","beforeRequest","Vhs","newOptions","originalAbort","segmentXhrHeaders","byterangeEnd","Range","textRange","formatHexString","formatAsciiString","createTransferableMessage","transferable","initSegmentId","segmentKeyId","hexDump","utils","tagDump","textRanges","getProgramTime","_ref$time","matchedSegment","segmentEnd","videoTimingInfo","transmuxedPresentationEnd","estimatedStart","transmuxedPresentationStart","findSegmentForPlayerTime","seekTime","programTimeObject","mediaSeconds","programTime","playerTime","transmuxerPrependedSeconds","offsetFromSegmentStart","getTime","playerTimeToProgramTime","programDateTime","toISOString","seekToProgramTime","_ref2$retryCount","retryCount","seekTo","_ref2$pauseAfterSeek","pauseAfterSeek","verifyProgramDateTimeTags","lastSegmentStart","lastSegmentDuration","findSegmentForProgramTime","mediaOffset","comparisonTimeStamp","segmentDateTime","segmentTimeEpoch","getOffsetFromTimestamp","seekToTime","callbackOnCompleted","video_es_containerRequest","id3Offset","finished","endRequestAndCallback","_bytes","progressListener","newPart","buffers","totalLen","buf","tempBuffer","concatTypedArrays","beforeSend","overrideMimeType","loaded","dashPlaylistUnchanged","aSegment","bSegment","aByterange","bByterange","equivalentSidx","video_es_compareSidxEntry","oldSidxMapping","newSidxMapping","currentSidxInfo","savedSidxInfo","sidxInfo","video_es_DashPlaylistLoader","DashPlaylistLoader","srcUrlOrPlaylist","masterPlaylistLoader","masterPlaylistLoader_","isMaster_","refreshXml_","refreshMedia_","loadedPlaylists_","srcUrl","sidxMapping_","childPlaylist_","requestErrored_","addSidxSegments_","fin","internal","blacklistDuration","_playlist$sidx$bytera","mediaRequest_","minimumUpdatePeriodTimeout_","createMupOnMedia_","hasPendingRequest","sidxChanged","isFinalRendition","updateMinimumUpdatePeriodTimeout_","requestMaster_","masterChanged","haveMaster_","masterXml_","date","masterLoaded_","handleMaster_","syncClientServerClock_","done","utcTiming","clientOffset_","serverTime","masterXml","newMaster","oldMaster","noChanges","playlistUpdate","group","_playlistUpdate","video_es_updateMaster","mpl","mup","createMUPTimeout_","mediaGroupSidx","mediaID","mediaChanged","createMediaUpdateTimeout","Config","GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","BACK_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","INITIAL_BANDWIDTH","BANDWIDTH_VARIANCE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BUFFER_HIGH_WATER_LINE","browserWorkerPolyFill","workerObj","factory","objectUrl","createObjectURL","Blob","blob","BlobBuilder","getBlob","worker","Worker","objURL","terminate","revokeObjectURL","getWorkerString","TransmuxWorker","init","flushSource","partialFlush","endTimeline","dinf","esds","ftyp","mfhd","minf","mvex","mvhd","trak","tkhd","mdia","mdhd","hdlr","sdtp","stbl","stsd","traf","trex","trun$1","MAJOR_BRAND","MINOR_VERSION","AVC1_BRAND","VIDEO_HDLR","AUDIO_HDLR","HDLR_TYPES","VMHD","SMHD","DREF","STCO","STSC","STSZ","STTS","videoSample","audioSample","audioTrun","videoTrun","trunHeader","stream","UINT32_MAX","avc1","avcC","btrt","dref","mdat","mp4a","pasp","smhd","stco","stsc","stsz","stts","styp","tfdt","tfhd","trun","vmhd","payload","setUint32","audioobjecttype","samplingfrequencyindex","channelcount","samplerate","sequenceNumber","trackFragments","boxes","samples","dependsOn","isDependedOn","hasRedundancy","avc1Box","sps","pps","sequenceParameterSets","pictureParameterSets","profileIdc","profileCompatibility","levelIdc","sarRatio","hSpacing","vSpacing","samplesize","trackFragmentHeader","trackFragmentDecodeTime","trackFragmentRun","sampleDependencyTable","upperWordBaseMediaDecodeTime","lowerWordBaseMediaDecodeTime","baseMediaDecodeTime","durationPresent","sizePresent","flagsPresent","compositionTimeOffset","bytesOffest","header","sample","isLeading","paddingValue","isNonSyncSample","degradationPriority","silence","secondsToVideoTs","secondsToAudioTs","videoTsToSeconds","audioTsToSeconds","audioTsToVideoTs","videoTsToAudioTs","metadataTsToSeconds","mp4Generator","fileType","movie","sampleForFrame","frame","dataOffset","pts","dts","keyFrame","frameUtils","nalUnits","currentNal","currentFrame","frames","nalCount","nalUnitType","currentGop","gops","baseDataOffset","nalsByteLength","numberOfNals","highPrefix","lowPrefix","zeroFill","silence_1","coneOfSilence","96000","88200","64000","48000","44100","32000","24000","16000","12000","11025","8000","metaTable","arr","timestamp","sampleRate","timelineStartPts","keepOriginalTimestamps","clock","audioFrameUtils","audioAppendStartTs","videoBaseMediaDecodeTime","baseMediaDecodeTimeTs","frameDuration","silentFrame","firstFrame","audioGapDuration","audioFillFrameCount","audioFillDuration","adtsFrames","earliestAllowedDts","minSegmentDts","minSegmentPts","array","sum","sumFrameByteLengths","ONE_SECOND_IN_TS$3","trackDecodeInfo","maxSegmentDts","maxSegmentPts","timelineStartInfo","captionPacketParser","payloadType","payloadSize","sei","userData","ccData","emulationPreventionBytesPositions","CaptionStream$1","CaptionStream","parse708captions_","parse708captions","captionPackets_","ccStreams_","Cea608Stream","cc708Stream_","Cea708Stream","newCaptionPackets","escapedRBSP","latestDts_","ignoreNextEqualDts_","numSameDts_","flushCCStreams","flushType","flushStream","idx","presortIndex","packet","dispatchCea608Packet","dispatchCea708Packet","activeCea608Channel_","ccStream","setsTextOrXDSActive","setsChannel1Active","setsChannel2Active","CHARACTER_TRANSLATION_708","within708TextBlock","Cea708Window","windowNum","clearText","pendingNewLine","winAttr","penAttr","penLoc","penColor","visible","rowLock","columnLock","relativePositioning","anchorVertical","anchorHorizontal","anchorPoint","rowCount","virtualRowCount","columnCount","windowStyle","penStyle","getText","rows","rowIdx","beforeRowOverflow","isEmpty","addText","backspace","row","substr","Cea708Service","serviceNum","currentWindow","windows","startPts","setCurrentWindow","current708Packet","services","new708Packet","add708Bytes","push708Packet","ptsVals","byte0","byte1","packet708","packetData","blockSize","seq","sizeCode","pushServiceBlock","initService","handleText","extendedCommands","defineWindow","clearWindows","deleteWindows","displayWindows","hideWindows","toggleWindows","setWindowAttributes","setPenAttributes","setPenColor","setPenLocation","getPts","flushDisplayed","isExtended","newCode","_char","fillOpacity","fillRed","fillGreen","fillBlue","borderType","borderRed","borderGreen","borderBlue","wordWrap","printDirection","scrollDirection","justify","effectSpeed","effectDirection","displayEffect","displayedText","winId","endPts","pushCaption","textTag","penSize","italics","underline","edgeType","fontStyle","fgOpacity","fgRed","fgGreen","fgBlue","bgOpacity","bgRed","bgGreen","bgBlue","edgeRed","edgeGreen","edgeBlue","column","CHARACTER_TRANSLATION","getCharFromCode","ROWS","createDisplayBuffer","BOTTOM_ROW","field","dataChannel","field_","dataChannel_","setConstants","swap","char0","char1","lastControlCode_","PADDING_","RESUME_CAPTION_LOADING_","mode_","END_OF_CAPTION_","clearFormatting","displayed_","nonDisplayed_","startPts_","ROLL_UP_2_ROWS_","rollUpRows_","setRollUp","ROLL_UP_3_ROWS_","ROLL_UP_4_ROWS_","CARRIAGE_RETURN_","shiftRowsUp_","BACKSPACE_","row_","ERASE_DISPLAYED_MEMORY_","ERASE_NON_DISPLAYED_MEMORY_","RESUME_DIRECT_CAPTIONING_","isSpecialCharacter","column_","isExtCharacter","isMidRowCode","addFormatting","isOffsetControlCode","isPAC","formatting_","isColorPAC","isNormalChar","topRow_","BASE_","EXT_","CONTROL_","OFFSET_","_char2","newBaseRow","reverse","popOn","baseRow","rollUp","paintOn","captionStream","streamTypes","H264_STREAM_TYPE","ADTS_STREAM_TYPE","METADATA_STREAM_TYPE","handleRollover$1","direction","TimestampRolloverStream$1","TimestampRolloverStream","lastDTS","referenceDTS","type_","_MetadataStream","timestampRolloverStream","percentEncode$1","parseUtf8","parseSyncSafeInteger$1","tagParsers","TXXX","WXXX","PRIV","owner","privateData","tagSize","dispatchType","frameStart","frameSize","dataAlignmentIndicator","timeStamp","_TransportPacketStream","_TransportParseStream","_ElementaryStream","metadataStream","bytesInBuffer","everything","parsePsi","parsePat","parsePmt","packetsWaitingForPmt","programMapTable","psi","payloadUnitStartIndicator","pat","section_number","last_section_number","pmtPid","pmt","tableEnd","pid","processPes_","STREAM_TYPES","h264","adts","segmentHadPmt","timedMetadata","forceFlush","packetFlushable","fragment","trackId","pes","ptsDtsFlags","startPrefix","packetLength","flushStreams_","m2ts","PAT_PID","MP2T_PACKET_LENGTH","TransportPacketStream","TransportParseStream","ElementaryStream","MetadataStream","_AdtsStream","m2ts_1","ONE_SECOND_IN_TS$2","ADTS_SAMPLING_FREQUENCIES$1","handlePartialSegments","frameNum","skipWarn_","frameLength","protectionSkipBytes","oldBuffer","sampleCount","adtsFrameDuration","_H264Stream","_NalByteStream","PROFILES_WITH_OPTIONAL_SPS_DATA","expGolomb","workingData","workingBytesAvailable","workingWord","workingBitsAvailable","bitsAvailable","loadWord","workingBytes","availableBytes","skipBits","skipBytes","readBits","bits","valu","skipLeadingZeros","leadingZeroCount","skipUnsignedExpGolomb","skipExpGolomb","readUnsignedExpGolomb","clz","readExpGolomb","readBoolean","readUnsignedByte","syncPoint","swapBuffer","100","110","122","244","44","83","86","118","128","138","139","134","currentPts","currentDts","discardEmulationPreventionBytes","readSequenceParameterSet","skipScalingList","nalByteStream","nalUnitTypeCode","expGolombDecoder","lastScale","nextScale","chromaFormatIdc","picOrderCntType","numRefFramesInPicOrderCntCycle","picWidthInMbsMinus1","picHeightInMapUnitsMinus1","frameMbsOnlyFlag","scalingListCount","frameCropLeftOffset","frameCropRightOffset","frameCropTopOffset","frameCropBottomOffset","_AacStream","H264Stream","NalByteStream","ADTS_SAMPLING_FREQUENCIES","parseId3TagSize","parseSyncSafeInteger","isLikelyAacData","parseAdtsSize","lowThree","middle","parseType","parseSampleRate","parseAacTimestamp","percentEncode","setTimestamp","bytesLeft","tempLength","_VideoSegmentStream","_AudioSegmentStream","_Transmuxer","_CoalesceStream","audioProperties","videoProperties","ONE_SECOND_IN_TS$1","arrayEquals","generateSegmentTimingInfo","startDts","endDts","prependedContentDuration","firstSequenceNumber","setEarliestDts","earliestDts","setVideoBaseMediaDecodeTime","setAudioAppendStart","videoClockCyclesOfSilencePrefixed","gopsToAlignWith","minPTS","gopCache_","nalUnit","gopForFusion","firstGop","lastGop","resetStream_","getGopForFusion_","alignedGops","alignGopsAtEnd","alignGopsAtEnd_","alignGopsAtStart_","gop","dtsDistance","nearestGopObj","currentGopObj","nearestDistance","alignIndex","gopIndex","align","alignEndIndex","matchFound","trimIndex","alignGopsWith","newGopsToAlignWith","numberOfTracks","remux","remuxTracks","pendingTracks","videoTrack","pendingBoxes","pendingCaptions","pendingMetadata","pendingBytes","emittedTracks","output","audioTrack","caption","id3","captionStreams","cueTime","setRemux","hasFlushed","transmuxPipeline_","setupAacPipeline","pipeline","aacStream","audioTimestampRolloverStream","timedMetadataTimestampRolloverStream","adtsStream","coalesceStream","headOfPipeline","audioSegmentStream","getLogTrigger_","hasAudio","hasVideo","setupTsPipeline","packetStream","elementaryStream","h264Stream","videoSegmentStream","id3Frame","setBaseMediaDecodeTime","isAac","resetCaptions","getTracks","getTimescaleFromMediaHeader","transmuxer","Transmuxer","VideoSegmentStream","AudioSegmentStream","AUDIO_PROPERTIES","VIDEO_PROPERTIES","bin","parseType_1","toUnsigned$2","findBox_1","subresults","toUnsigned$1","parseTfdt","parseSampleFlags_1","parseTrun","dataOffsetPresent","firstSampleFlagsPresent","sampleDurationPresent","sampleSizePresent","sampleFlagsPresent","sampleCompositionTimeOffsetPresent","getInt32","parseTfhd","baseDataOffsetPresent","sampleDescriptionIndexPresent","defaultSampleDurationPresent","defaultSampleSizePresent","defaultSampleFlagsPresent","durationIsEmpty","defaultBaseIsMoof","sampleDescriptionIndex","defaultSampleDuration","defaultSampleSize","defaultSampleFlags","baseDataOffsetIsMoof","mapToSample","approximateOffset","parseCaptionNals","videoTrackId","trafs","mdats","captionNals","mdatTrafPairs","matchingTraf","headerInfo","truns","avcStream","seiNal","lastMatchedSample","avcView","logs","seiNals","matchingSample","findSeiNals","allSamples","parseSamples","captionParser","segmentCache","parsedCaptions","parsingPartial","isInitialized","isPartial","isNewInit","videoTrackIds","timescales","parsedData","cachedSegment","trackNals","parseEmbeddedCaptions","pushNals","nals","nal","clearParsedCaptions","resetCaptionStream","clearAllCaptions","toUnsigned","toHexString","baseTimes","scale","baseTime","traks","tkhdVersion","getUint8","sampleDescriptions","codecConfig","codecBox","probe$2","parsePid","parsePayloadUnitStartIndicator","parseAdaptionField","parseNalUnitType","probe$1","pusi","payloadOffset","parsePesType","parsePesTime","videoPacketContainsKeyFrame","frameBuffer","frameI","frameSyncPoint","foundKeyFrame","handleRollover","probe","ONE_SECOND_IN_TS","parseAudioPes_","pesType","parsed","endLoop","table","parseVideoPes_","firstKeyFrame","inspectTs_","parsePsi_","tsInspector","baseTimestamp","audioCount","audioTimescale","inspectAac_","audioBaseTimestamp","dtsTime","ptsTime","videoBaseTimestamp","adjustTimestamp_","MessageHandlers","initArray","typedArray","postMessage","action","gopInfo","timingInfo","videoSegmentTimingInfo","decode","presentation","audioSegmentTimingInfo","trackInfo","audioTimingInfo","wireTransmuxerEvents","pushMp4Captions","trackIds","probeMp4StartTime","probeMp4Tracks","probeTs","baseStartTime","tsStartTime","timeInfo","videoStart","audioStart","clearAllMp4Captions","clearParsedMp4Captions","setTimestampOffset","timestampOffset","appendStart","onmessage","messageHandlers","processTransmux","audioAppendStart","onData","onTrackInfo","onAudioTimingInfo","onVideoTimingInfo","onVideoSegmentTimingInfo","onAudioSegmentTimingInfo","onId3","onCaptions","onDone","onEndedTimeline","onTransmuxerLog","isEndOfTimeline","transmuxedData","waitForEndedTimelineEvent","currentTransmux","_event$data$segment","videoFrameDtsTime","videoFramePtsTime","handleData_","handleGopInfo_","handleDone_","dequeue","transmuxQueue","processAction","enqueueAction","transmux","segmentTransmuxer","term","video_es_workerCallback","endAction","listenForEndEvent","isArrayBuffer","transfers","REQUEST_ERRORS","abortAll","activeXhrs","handleErrors","handleKeyResponse","finishProcessingFn","errorObj","video_es_parseInitSegment","_callback","handleSegmentResponse","newBytes","stringToArrayBuffer","lastReachedChar","stats","getRequestStats","encryptedBytes","transmuxAndNotify","trackInfoFn","timingInfoFn","videoSegmentTimingInfoFn","audioSegmentTimingInfoFn","id3Fn","captionsFn","endedTimelineFn","dataFn","doneFn","fmp4Tracks","isMuxed","audioStartFn","audioEndFn","videoStartFn","videoEndFn","probeResult","id3Frames","video_es_handleSegmentBytes","bytesAsUint8Array","containers_isLikelyFmp4MediaSegment","isFmp4","audioCodec","videoCodec","finishLoading","decrypt","_ref7","keyBytes","decryptionWorker","decryptionHandler","decrypted","encrypted","waitForCompletion","_ref9","didError","segmentFinish","_ref8","requestId","decryptedBytes","decryptSegment","endOfAllRequests","parseError","handleProgress","_ref11","progressFn","progressEvent","getProgressStats","firstBytesReceivedAt","mediaSegmentRequest","_ref12","xhrOptions","abortFn","keyXhr","mapKeyXhr","initSegmentXhr","handleInitSegmentResponse","segmentRequestOptions","segmentXhr","loadendState","activeXhr","_ref10","calledAbortFn","handleLoadEnd","logFn$1","isMaat","mediaAttributes","video_es_unwrapCodecList","codecList","codecCount","codecObj","video_es_codecsForPlaylist","codecInfo","video_es_getCodecs","audioGroup","defaultCodecs","audioGroupId","audioType","codecsFromDefault","logFn","representationToString","video_es_safeGetComputedStyle","stableSort","sortFn","newArray","cmp","video_es_comparePlaylistBandwidth","leftBandwidth","rightBandwidth","video_es_simpleSelector","playerBandwidth","playerWidth","playerHeight","limitRenditionByPlayerDimensions","masterPlaylistController","getAudioTrackPlaylists_","sortedPlaylistReps","enabledPlaylistReps","rep","bandwidthPlaylistReps","highestRemainingBandwidthRep","bandwidthBestRep","_chosenRep","haveResolution","resolutionBestRepList","resolutionPlusOneList","resolutionPlusOneSmallest","resolutionPlusOneRep","leastPixelDiffRep","resolutionBestRep","experimentalLeastPixelDiffSelector","leastPixelDiffList","pixelDiff","chosenRep","_type","video_es_lastBandwidthSelector","pixelRatio","useDevicePixelRatio","devicePixelRatio","systemBandwidth","masterPlaylistController_","video_es_addMetadata","inbandTextTracks","metadataArray","videoDuration","Cue","WebKitDataCue","metadataTrack","metadataTrack_","deprecateOldCue","cuesArray","cuesGroupedByStartTime","timeSlot","sortedStartTimes","cueGroup","nextTime","removeCuesFromTrack","finite","segmentInfoString","startOfSegment","_segmentInfo$playlist","_segmentInfo$playlist2","mediaIndex","segmentLen","selection","isSyncRequest","hasPartIndex","zeroBasedPartCount","timingInfoPropertyForMedia","shouldWaitForTimelineChange","timelineChangeController","loaderType","audioDisabled","lastMainTimelineChange","lastTimelineChange","pendingAudioTimelineChange","pendingTimelineChange","segmentTooLong","maxDuration","getTroublesomeSegmentDurationMessage","sourceType","audioDuration","isSegmentWayTooLong","isSegmentSlightlyTooLong","segmentTooLongMessage","severity","video_es_SegmentLoader","_videojs$EventTarget","SegmentLoader","mediaSource","throughput","roundTrip","resetStats_","hasPlayed_","hasPlayed","seekable_","seeking_","mediaSource_","loaderType_","currentMediaInfo_","startingMediaInfo_","segmentMetadataTrack_","segmentMetadataTrack","goalBufferLength_","goalBufferLength","sourceType_","sourceUpdater_","sourceUpdater","inbandTextTracks_","state_","timelineChangeController_","shouldSaveSegmentTimingInfo_","checkBufferTimeout_","currentTimeline_","pendingSegment_","xhrOptions_","pendingSegments_","audioDisabled_","isPendingTimestampOffset_","gopBuffer_","timeMapping_","safeAppend_","appendInitSegment_","playlistOfLastInitSegment_","callQueue_","loadQueue_","metadataQueue_","waitingOnRemove_","quotaExceededErrorRetryTimeout_","activeInitSegmentId_","initSegments_","cacheEncryptionKeys_","cacheEncryptionKeys","keyCache_","decrypter_","decrypter","syncController_","syncController","syncPoint_","transmuxer_","createTransmuxer_","triggerSyncInfoUpdate_","isEndOfStream_","ended_","fetchAtBuffer_","newState","hasEnoughInfoToAppend_","processCallQueue_","hasEnoughInfoToLoad_","processLoadQueue_","mediaBytesTransferred","mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaSecondsLoaded","mediaAppends","abort_","setAudio","removeAudio","monitorBuffer_","abortRequests","clearPendingTimelineChange","checkForAbort_","_error","endOfStream","buffered_","getMediaInfo_","videoBuffered","audioBuffered","initSegmentForMap","storedMap","segmentKey","storedKey","couldBeginLoading_","playlist_","init_","resetEverything","newPlaylist","oldPlaylist","syncInfo","setDateTimeMappingForStart","oldId","resyncLoader","mediaSequenceDiff","resetLoader","saveExpiredSegmentInfo","force","removesRemaining","removeFinished","mapping","updatedBuffer","video_es_removeGopBuffer","removeVideo","monitorBufferTick_","fillBuffer_","updating","chooseNextRequest_","loadSegment_","appendedLastSegment","appendedLastPart","bufferedTime","preloaded","haveEnoughBuffer","getSyncPoint","targetTime","timelineSegments","getSyncSegmentCandidate","_Playlist$getMediaInf","_partIndex","nextSegment","generateSegmentInfo_","forceTimestampOffset","random","overrideCheck","timestampOffsetForSegment_","audioBufferedEnd","audioTimestampOffset","currentTimePts","video_es_gopsSafeToAlignWith","videoTimestampOffset","earlyAbortWhenNeeded_","measuredBandwidth","requestTimeRemaining","timeUntilRebuffer$1","timeUntilRebuffer","switchCandidate","compatiblePlaylists","enabledPlaylists","rebufferingEstimates","numRequests","rebufferingImpact","noRebufferingPlaylists","estimate","minRebufferMaxBandwidthSelector","timeSavedBySwitching","minimumTimeSaving","handleAbort_","handleProgress_","simpleSegment","handleTrackInfo_","checkForIllegalMediaSwitch","akeys","bkeys","shallowEqual","handleTimingInfo_","timeType","timingInfoProperty","handleCaptions_","captionData","hasAppendedData_","captionTracks","captionTrack","trackName","_captionTracks$trackN","def","captionService","createCaptionsTrackIfNotExists","captionArray","video_es_addCaptionData","handleId3_","inBandMetadataTrackDispatchType","createMetadataTrackIfNotExists","processMetadataQueue_","callQueue","fun","loadQueue","getCurrentMediaInfo_","setTimeMapping_","updateMediaSecondsLoaded_","firstVideoFrameTimeForData","useVideoTimingInfo","trueSegmentStart_","currentStart","currentVideoTimestampOffset","updateAppendInitSegmentStatus","updateSourceBufferTimestampOffset_","updateTimingInfoEnd_","saveSegmentTimingInfo","shouldSaveTimelineMapping","appendData_","changedTimestampOffset","getInitSegmentAndUpdateState_","handleQuotaExceededError_","audioBufferStart","audioBufferEnd","videoBufferStart","videoBufferEnd","appendToSourceBuffer_","timeToRemoveUntil","MIN_BACK_BUFFER","handleAppendError_","segmentObj","appendBuffer","handleSegmentTimingInfo_","segmentTimingInfo","transmuxedDecodeStart","transmuxedDecodeEnd","trimBackBuffer_","updateTransmuxerAndRequestSegment_","shouldUpdateTransmuxerTimestampOffset_","createSimplifiedSegmentObj_","isEndOfStream","isWalkingForward","isDiscontinuity","segmentRequestFinished_","removeToTime","trimTime","maxTrimTime","safeBackBufferTrimTime","previousSegment","saveTransferStats_","saveBandwidthRelatedStats_","handleTimeout_","updateGopBuffer","waitForAppendsToComplete_","timelineMapping","mappingForTimeline","waitForVideo","waitForAudio","waitingOnAppends","checkAppendsDone_","videoQueueCallback","audioQueueCallback","handleAppendsDone_","illegalMediaSwitchError","startingMedia","illegalMediaSwitch","didChange","prioritizedTimingInfo","segmentDurationMessage","recordThroughput_","addSegmentMetadataCue_","segmentProcessingTime","segmentProcessingThroughput","video_es_noop","Vhs$1","toTitleCase","bufferTypes","_updating","sourceBuffer","queuePending","shiftQueue","queueIndex","queueEntry","nextQueueIndexOfType","cleanupBuffer","titleType","inSourceBuffers","sourceBuffers","actions","onError","_duration","mime","addSourceBuffer","removeSourceBuffer","changeType","pushQueue","onUpdateend","video_es_SourceUpdater","SourceUpdater","sourceopenListener_","audioTimestampOffset_","videoTimestampOffset_","delayedAudioAppendQueue_","videoAppendQueued_","onVideoUpdateEnd_","onAudioUpdateEnd_","onVideoError_","videoError_","onAudioError_","audioError_","createdSourceBuffers_","initializedEme_","triggeredReady_","initializedEme","hasCreatedSourceBuffers","hasInitializedAnyEme","createSourceBuffers","addOrChangeSourceBuffers","canRemoveSourceBuffer","canChangeType","SourceBuffer","processedAppend_","videoBuffer","que","audioBuffer","bufferA","bufferB","arity","extents","bufferIntersection","setDuration","uint8ToUtf8","uintArray","VTT_LINE_TERMINATORS","_char3","video_es_VTTSegmentLoader","_SegmentLoader","VTTSegmentLoader","subtitlesTrack_","featuresNativeTextTracks_","combinedByteLength","combinedSegment","timestampOffsetForTimeline","skipEmptySegments_","stopForError","loadHandler","requested","parseVTTCues_","updateTimeMapping_","timelines","duplicates","occurrences","dupe","removeDuplicateCuesFromTrack","decoder","decodeBytesToString","TextDecoder","timestampmap","MPEGTS","LOCAL","ontimestampmap","mapData","segmentData","mappingObj","diff","firstStart","lastStart","findAdCue","mediaTime","adStartTime","adEndTime","syncPointStrategies","run","timelineToDatetimeMappings","lastDistance","datetimeMapping","discontinuitySync","discontinuities","video_es_SyncController","SyncController","syncPoints","runStrategies_","selectSyncPoint_","getExpiredTime","strategy","bestSyncPoint","bestDistance","bestStrategy","newDistance","lastRemovedSegment","firstSegment","playlistTimestamp","didCalculateSegmentTimeMapping","calculateSegmentTimeMapping_","saveDiscontinuitySyncInfo_","dateTime","accuracy","mediaIndexDiff","video_es_TimelineChangeController","TimelineChangeController","pendingTimelineChanges_","lastTimelineChanges_","Decrypter","createCommonjsModule","basedir","require","commonjsRequire","createClass","_defineProperties","Constructor","protoProps","staticProps","_setPrototypeOf","aesTables","AES","tmp","xInv","x2","x4","tEnc","tDec","tables","encTable","decTable","sbox","sboxInv","th","precompute","_tables","keyLen","rcon","encKey","decKey","encrypted0","encrypted1","encrypted2","encrypted3","out","a2","b2","c2","nInnerRounds","kIndex","table0","table1","table2","table3","AsyncStream","jobs","timeout_","processJob_","job","ntoh","word","initVector","step","STEP","encrypted32","Int32Array","asyncStream_","decryptChunk_","padded","init0","init1","init2","init3","wordIx","decipher","decrypted32","audioTrackKind_","stopLoaders","segmentLoader","activePlaylistLoader","startLoaders","playlistLoader","segmentLoaders","blacklistCurrentPlaylist","activeTrack","activeGroup","defaultTrack","onTrackChanged","setupListeners","requestOptions","initialize","_settings$mediaTypes$","groups","variantLabel","isMasterPlaylist","_settings$mediaTypes$2","_settings$mediaTypes$3","groupMatch","setupMediaGroups","_settings$segmentLoad3","audioSegmentLoader","mainSegmentLoader","variants","groupKeys","groupPropertyList","onGroupChanged","_settings$segmentLoad","getActiveGroup","previousActiveLoader","lastGroup","lastGroup_","lastTrack_","onGroupChanging","_settings$segmentLoad2","lastTrack","mpc","selectPlaylist","fastQualityChange_","activeTrack_","onAudioTrackChanged","loaderStats","sumLoaderStat","stat","audioSegmentLoader_","mainSegmentLoader_","video_es_MasterPlaylistController","MasterPlaylistController","externVhs","useCueTags","enableLowInitialPlaylist","experimentalBufferBasedABR","maxPlaylistRetries","useCueTags_","cueTagsTrack_","requestOptions_","pauseLoading","mediaTypes_","createMediaTypes","handleDurationChange_","handleSourceOpen_","handleSourceEnded_","segmentLoaderSettings","setupMasterPlaylistLoaderListeners_","subtitleSegmentLoader_","setupSegmentLoaderListeners_","startABRTimer_","stopABRTimer_","triggeredFmp4Usage","loadOnPlay_","timeToLoadedData__","mainAppendsToLoadedData__","audioAppendsToLoadedData__","timeToLoadedDataStart","mainAppendsToLoadedData_","audioAppendsToLoadedData_","appendsToLoadedData_","timeToLoadedData_","checkABR_","nextPlaylist","shouldSwitchToMedia_","switchMedia_","cause","newId","abrTimer_","defaultPlaylists","defaultGroup","requestTimeout","triggerPresenceUsage_","setupFirstPlay","updatedPlaylist","selectedMedia","excludeUnsupportedVariants_","selectInitialPlaylist","initialMedia_","handleUpdatedMediaPlaylist","lastExcludeReason_","stuckAtPlaylistEnd_","updateAdCues_","updateDuration","defaultDemuxed","audioGroupKeys","currentPlaylist","forwardBuffer","bufferLowWaterLine","bufferHighWaterLine","sharedLogLine","maxBufferLowWaterLine","nextBandwidth","currBandwidth","logLine","_logLine","shouldSwitchToMedia","onSyncInfoUpdate_","onEndOfStream","delegateLoaders_","updateCodecs","tryToCreateSourceBuffers_","getCodecsOrExclude_","mediaSecondsLoaded_","smoothQualityChange_","mainMediaInfo","absolutePlaylistEnd","reincluded","errorMessage","delayDuration","fnNames","loaders","dontFilterPlaylist","loader","audioSeekable","mainSeekable","oldEnd","oldStart","updateDuration_","areMediaTypesKnown_","usingAudioLoader","hasMainMediaInfo","hasAudioMediaInfo","playlistCodecs","unsupportedAudio","unsupportedCodecs","supporter","switchMessages","newCodec","oldCodec","excludeIncompatibleVariants_","ids","unsupported","codecCount_","videoDetails","audioDetails","blacklistReasons","variantCodecs","variantCodecCount","variantVideoDetails","variantAudioDetails","_segment$cueOutCont$s","adOffset","adTotal","video_es_updateAdCues","newMax","Representation","vhsHandler","playlistID","changePlaylistFn","qualityChangeFunction","smoothQualityChange","incompatible","currentlyEnabled","timerCancelEvents","video_es_PlaybackWatcher","PlaybackWatcher","allowSeeksWithinUnsafeLiveWindow","liveRangeSafeTimeDelta","consecutiveUpdates","lastRecordedTime","timer_","checkCurrentTimeTimeout_","playHandler","monitorCurrentTime_","canPlayHandler","waitingHandler","techWaiting_","cancelTimerHandler","cancelTimer_","fixesBadSeeksHandler","fixesBadSeeks_","loaderTypes","loaderChecks","resetSegmentDownloads_","updateend","checkSegmentDownloads_","checkCurrentTime_","isBufferedDifferent","isRangeDifferent","playlistId","waiting_","afterSeekableWindow_","beforeSeekableWindow_","closeToBufferedContent","currentRange","livePoint","videoUnderflow_","nextRange","difference","skipTheGap_","allowedEnd","gap","lastVideoRange","videoRange","audioRange","gapFromVideoUnderflow_","scheduledCurrentTime","gaps","findGaps","defaultOptions","errorInterval","getSource","IWillNotUseThisInPlugins","reloadSourceOnError","initPlugin","lastCalled","localOptions","loadedMetadataHandler","cleanupEvents","STANDARD_PLAYLIST_SELECTOR","INITIAL_PLAYLIST_SELECTOR","lastBandwidthSelector","movingAverageBandwidthSelector","decay","average","lastSystemBandwidth","comparePlaylistBandwidth","comparePlaylistResolution","leftWidth","rightWidth","handleVhsMediaChange","qualityLevels","selectedIndex_","waitForKeySessionCreation","sourceKeySystems","audioMedia","mainPlaylists","initializeMediaKeys","keySystemsOptionsArr","keySystems","keySystemsArr","keySystemsOptions","keySystemsObj","keySystemOptions","getAllPsshKeySystemsOptions","initializationFinishedPromises","keySessionCreatedPromises","race","setupEmeOptions","sourceOptions","audioPlaylist","videoContentType","audioContentType","keySystemContentTypes","video_es_emeKeySystems","video_es_getVhsLocalStorage","storedObject","supportsNativeHls","canItPlay","supportsNativeDash","supportsTypeNatively","video_es_VhsHandler","VhsHandler","hls","initialBandwidth","source_","ignoreNextSeekingEvent_","setOptions_","overrideNative","featuresNativeVideoTracks","featuresNativeAudioTracks","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement","useBandwidthFromLocalStorage","option","dataUri","playbackWatcherOptions","playbackWatcher_","defaultSelector","invThroughput","invBandwidth","mediaRequests_","mediaRequestsAborted_","mediaRequestsTimedout_","mediaRequestsErrored_","mediaTransferDuration_","mediaBytesTransferred_","mediaAppends_","mainAppendsToLoadedData","audioAppendsToLoadedData","appendsToLoadedData","timeToLoadedData","currentTech","playerDimensions","objectToStore","video_es_updateVhsLocalStorage","setupEme_","setupQualityLevels_","mediaSourceUrl_","audioPlaylistLoader","didSetupEmeOptions","qualityLevels_","addQualityLevel","dash","convertToProgramTime","VhsSourceHandler","_videojs$mergeOptions2","supportedType","store","USE_SYMBOL","Function","__g","it","_extends","g","dP","createDesc","f","anObject","IE8_DOM_DEFINE","toPrimitive","O","P","Attributes","SRC","$toString","TPL","inspectSource","safe","isFunction","core","__e","redefine","$export","own","exp","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","expProto","U","W","R","px","aFunction","that","IObject","defined","oc","MIME_TYPE","HTML","isHTML","XML_APPLICATION","XML_TEXT","XML_XHTML_APPLICATION","XML_SVG_IMAGE","NAMESPACE","SVG","XML","XMLNS","VTTRegion","cueShim","regionShim","nativeVTTCue","nativeVTTRegion","shim","restore","Buffer","decodeB64ToUint8Array","global_window__WEBPACK_IMPORTED_MODULE_0__","global_window__WEBPACK_IMPORTED_MODULE_0___default","b64Text","decodedString","atob","bitmap","LIBRARY","Iterators","$iterCreate","setToStringTag","getPrototypeOf","ITERATOR","BUGGY","returnThis","Base","IS_SET","IteratorPrototype","getMethod","proto","TAG","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","entries","shared","createXHR","httpHandler","initParams","params","_createXHR","called","getBody","responseXML","firefoxBugTakenEffect","getXml","isJson","errorFunc","evt","timeoutTimer","failureResponse","loadFunc","useXDR","rawRequest","getAllResponseHeaders","parseHeaders","XDomainRequest","XMLHttpRequest","onprogress","onabort","ontimeout","username","password","setRequestHeader","send","forEachArray","URL_REGEX","FIRST_SEGMENT_REGEX","SLASH_DOT_REGEX","SLASH_DOT_DOT_REGEX","URLToolkit","baseURL","relativeURL","alwaysNormalize","basePartsForNormalise","parseURL","buildURLFromParts","relativeParts","scheme","baseParts","netLoc","builtParts","baseURLPath","newPath","lastIndexOf","is","valueOf","regExp","replacer","cof","ARG","T","tryGet","callee","dPs","enumBugKeys","IE_PROTO","Empty","createDict","iframeDocument","iframe","display","lt","Properties","$keys","toInteger","forbiddenField","isArrayIter","toLength","getIterFn","BREAK","RETURN","iterable","iterFn","META","setDesc","isExtensible","FREEZE","preventExtensions","setMeta","meta","KEY","NEED","fastKey","getWeak","onFreeze","_t","notEmptyString","input","orderedSetReducer","current","toOrderedSet","splitOnASCIIWhitespace","copy","dest","Class","Super","pt","NodeType","ELEMENT_NODE","ATTRIBUTE_NODE","TEXT_NODE","CDATA_SECTION_NODE","ENTITY_REFERENCE_NODE","ENTITY_NODE","PROCESSING_INSTRUCTION_NODE","COMMENT_NODE","DOCUMENT_NODE","DOCUMENT_TYPE_NODE","DOCUMENT_FRAGMENT_NODE","NOTATION_NODE","ExceptionCode","ExceptionMessage","HIERARCHY_REQUEST_ERR","INDEX_SIZE_ERR","DOMSTRING_SIZE_ERR","NOT_FOUND_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR","NO_DATA_ALLOWED_ERR","NO_MODIFICATION_ALLOWED_ERR","INUSE_ATTRIBUTE_ERR","NOT_SUPPORTED_ERR","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR","DOMException","captureStackTrace","NodeList","LiveNodeList","refresh","_node","_refresh","_updateLiveList","inc","_inc","ls","__set__","NamedNodeMap","_findNodeIndex","_addNamedNode","newAttr","oldAttr","ownerElement","_onRemoveAttribute","namespaceURI","_nsMap","prefix","localName","_onAddAttribute","_removeNamedNode","lastIndex","DOMImplementation","Node","_xmlEncoder","_visitNode","Document","_onUpdateChild","cs","_removeChild","previous","previousSibling","lastChild","_insertBefore","nextChild","cp","newFirst","newLast","pre","Attr","CharacterData","Text","Comment","CDATASection","DocumentType","Notation","Entity","EntityReference","DocumentFragment","ProcessingInstruction","XMLSerializer","nodeSerializeToString","isHtml","nodeFilter","lookupPrefix","visibleNamespaces","namespace","serializeToString","needNamespaceDefine","addSerializedAttribute","qualifiedName","prefixedNodeName","defaultNS","ai","nsi","pubid","publicId","sysid","systemId","sub","internalSubset","getNamedItem","setNamedItem","_ownerElement","setNamedItemNS","getNamedItemNS","removeNamedItem","removeNamedItemNS","hasFeature","feature","createDocument","doctype","root","createElementNS","createDocumentType","refChild","oldChild","deep","node2","attrs2","setAttributeNode","normalize","appendData","hasAttributes","lookupNamespaceURI","isDefaultNamespace","importNode","importedNode","getElementById","rtv","getElementsByClassName","classNames","classNamesSet","nodeClassNames","nodeClassNamesSet","createComment","createCDATASection","createProcessingInstruction","createAttribute","specified","createEntityReference","pl","createAttributeNS","getAttributeNode","removeAttributeNode","_appendSingleChild","setAttributeNodeNS","removeAttributeNS","getAttributeNodeNS","hasAttributeNS","getAttributeNS","setAttributeNS","getElementsByTagNameNS","substringData","insertData","replaceData","deleteData","splitText","newText","newNode","$$length","getTextContent","ChromecastSessionManager","hasConnected","getCastContext","cast","framework","CastContext","getInstance","_sessionListener","_onSessionStateChange","_castListener","_onCastStateChange","_addCastContextEventListeners","_removeCastContextEventListeners","_notifyPlayerOfDevicesAvailabilityChange","getCastState","remotePlayer","RemotePlayer","remotePlayerController","RemotePlayerController","sessionStateChangedEvt","CastContextEventType","SESSION_STATE_CHANGED","castStateChangedEvt","CAST_STATE_CHANGED","sessionState","SessionState","SESSION_ENDED","_reloadTech","castState","hasAvailableDevices","CastState","NOT_CONNECTED","CONNECTING","CONNECTED","openCastMenu","onSessionSuccess","requestSession","wasPaused","getRemotePlayer","getRemotePlayerController","isChromecastAPIAvailable","chrome","isChromecastConnected","initializing","fnTest","xyz","_super","WebKitPlaybackTargetAvailabilityEvent","rng","bytesToUuid","rnds","ii","argsTag","mapTag","objectTag","setTag","reIsHostCtor","reIsUint","typedArrayTags","freeGlobal","freeSelf","freeExports","freeModule","moduleExports","freeProcess","process","nodeUtil","binding","nodeIsTypedArray","isTypedArray","arraySome","mapToArray","setToArray","arrayProto","funcProto","objectProto","coreJsData","funcToString","maskSrcKey","nativeObjectToString","reIsNative","propertyIsEnumerable","symToStringTag","nativeGetSymbols","getOwnPropertySymbols","nativeIsBuffer","isBuffer","nativeKeys","getNative","nativeCreate","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","Hash","ListCache","MapCache","SetCache","__data__","Stack","arrayLikeKeys","inherited","isArr","isArg","isArguments","isBuff","isType","skipIndexes","iteratee","isIndex","assocIndexOf","eq","baseGetTag","isOwn","unmasked","getRawTag","objectToString","baseIsArguments","isObjectLike","baseIsEqual","other","bitmask","customizer","stack","equalFunc","objIsArr","othIsArr","objTag","getTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","convert","stacked","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","getAllKeys","objLength","othLength","skipCtor","objValue","othValue","compared","objCtor","othCtor","equalObjects","baseIsEqualDeep","baseIsNative","isMasked","baseKeys","Ctor","arrLength","seen","arrValue","othIndex","keysFunc","symbolsFunc","arrayPush","baseGetAllKeys","getSymbols","getMapData","LARGE_ARRAY_SIZE","resIndex","arrayFilter","symbol","ctorString","isLength","baseUnary","reviver","isNativeReflectConstruct","_construct","Parent","Reflect","DOMParser","emptyFunction","invariant","ReactPropTypesSecret","propFullName","secret","getShim","isRequired","ReactPropTypes","arrayOf","instanceOf","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","makeEmptyFunction","thatReturns","thatReturnsFalse","thatReturnsTrue","thatReturnsNull","thatReturnsThis","thatReturnsArgument","condition","argIndex","framesToPop","crypto","msCrypto","getRandomValues","rnds8","byteToHex","bth","webpackPolyfill","deprecate","$re","escapeHTML","unescapeHTML","classof","$at","iterated","point","TO_STRING","pos","getKeys","toIObject","arrayIndexOf","toAbsoluteIndex","IS_INCLUDES","$this","fromIndex","toObject","ObjectProto","$iterators","wks","TO_STRING_TAG","ArrayValues","DOMIterables","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","MediaList","MimeTypeArray","PaintRequestList","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TouchList","collections","explicit","Collection","addToUnscopables","_k","Arguments","UNSCOPABLES","ArrayProto","strong","validate","getEntry","redefineAll","anInstance","forOf","$iterDefine","setSpecies","SIZE","_f","getConstructor","IS_MAP","ADDER","C","_l","prev","callbackfn","setStrong","getIteratorMethod","SPECIES","fails","$iterDetect","inheritIfRequired","common","IS_WEAK","fixMethod","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","iter","BUGGY_ZERO","$instance","SAFE_CLOSING","riter","skipClosing","check","buggy","pIE","gOPD","video_js__WEBPACK_IMPORTED_MODULE_0__","preloadWebComponents","alert","confirm","prompt","decodeResponseBody","charset","contentTypeHeader","_contentType$split","getCharset","_objCreate","ParsingError","errorData","parseTimeStamp","computeSeconds","Settings","parseOptions","keyValueDelim","groupDelim","kv","parseCue","regionList","oInput","consumeTimeStamp","Errors","BadTimeStamp","skipWhitespace","region","alt","vals","vals0","integer","lineAlign","snapToLines","center","positionAlign","consumeCueSettings","BadSignature","dflt","defaultKey","TEXTAREA_ELEMENT","TAG_NAME","u","ruby","rt","DEFAULT_COLOR_CLASS","white","lime","cyan","red","yellow","magenta","blue","black","TAG_ANNOTATION","NEEDS_PARENT","parseContent","nextToken","shouldAdd","annotation","rootDiv","tagStack","classes","cl","bgColor","colorName","propValue","strongRTLRanges","isStrongRTLChar","determineBidi","nodeStack","pushNodes","nextTextNode","StyleBox","CueStyleBox","styleOptions","styles","writingMode","unicodeBidi","applyStyles","textAlign","font","whiteSpace","textPos","formatStyle","move","BoxPosition","lh","rects","getClientRects","lineHeight","moveBoxToLinePosition","styleBox","containerBox","boxPositions","boxPosition","linePos","textTrackList","mediaElement","computeLinePos","axis","maxPosition","initialAxis","calculatedPercentage","bestPosition","specifiedPosition","percentage","overlapsOppositeAxis","within","overlapsAny","intersectPercentage","findBestPosition","toCSSCompatValues","unit","toMove","overlaps","getSimpleBoxPosition","convertCueToDOMTree","cuetext","overlay","paddedOverlay","margin","hasBeenReset","shouldCompute","reportOrThrowError","collectNextLine","parseHeader","parseTimestampMap","xy","anchor","lines","regionAnchorX","regionAnchorY","viewportAnchorX","viewportAnchorY","scroll","onregion","parseRegion","alreadyCollectedLine","hasSubstring","directionSetting","alignSetting","findAlignSetting","_id","_pauseOnExit","_startTime","_endTime","_text","_region","_vertical","_snapToLines","_line","_lineAlign","_position","_positionAlign","_size","_align","setting","findDirectionSetting","SyntaxError","getCueAsHTML","scrollSetting","isValidPercentValue","_lines","_regionAnchorX","_regionAnchorY","_viewportAnchorX","_viewportAnchorY","_scroll","findScrollSetting","sham","Proxy","base64","ieee754","kMaxLength","TYPED_ARRAY_SUPPORT","createBuffer","RangeError","encodingOrOffset","allocUnsafe","fromArrayLike","fromArrayBuffer","encoding","isEncoding","actual","fromString","checked","fromObject","assertSize","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","bidirectionalIndexOf","indexSize","valLength","read","readUInt16BE","foundIndex","hexWrite","remaining","strLen","utf8Write","blitBuffer","asciiWrite","byteArray","asciiToBytes","latin1Write","base64Write","ucs2Write","units","hi","lo","utf16leToBytes","fromByteArray","res","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","codePoints","decodeCodePointsArray","SlowBuffer","alloc","INSPECT_MAX_BYTES","foo","typedArraySupport","poolSize","_augment","species","allocUnsafeSlow","_isBuffer","compare","swap16","swap32","swap64","equals","inspect","thisStart","thisEnd","thisCopy","targetCopy","includes","_arr","toHex","checkOffset","checkInt","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","writeDouble","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","INVALID_BASE64_RE","leadSurrogate","toByteArray","stringtrim","base64clean","dst","b64","placeHoldersCount","placeHolders","Arr","L","revLookup","uint8","extraBytes","len2","encodeChunk","lookup","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","LN2","conventions","entities","sax","ParseError","XMLReader","locator","DOMHandler","cdata","lineNumber","columnNumber","_locator","_toString","chars","java","appendElement","hander","currentElement","domBuilder","defaultNSMap","xmlns","entityMap","HTML_ENTITIES","XML_ENTITIES","setDocumentLocator","errorImpl","isCallback","build","msg","buildErrorHandler","startDocument","documentURI","startElement","qName","getURI","getQName","getLocator","endElement","startPrefixMapping","endPrefixMapping","processingInstruction","ins","ignorableWhitespace","ch","characters","charNode","skippedEntity","endDocument","comm","startCDATA","endCDATA","startDTD","impl","dt","warning","fatalError","__DOMHandler","amp","apos","gt","quot","Agrave","Aacute","Acirc","Atilde","Auml","Aring","AElig","Ccedil","Egrave","Eacute","Ecirc","Euml","Igrave","Iacute","Icirc","Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde","Ouml","Oslash","Ugrave","Uacute","Ucirc","Uuml","Yacute","THORN","szlig","agrave","aacute","acirc","atilde","auml","aring","aelig","ccedil","egrave","eacute","ecirc","euml","igrave","iacute","icirc","iuml","eth","ntilde","ograve","oacute","ocirc","otilde","ouml","oslash","ugrave","uacute","ucirc","uuml","yacute","thorn","yuml","nbsp","iexcl","cent","pound","curren","yen","brvbar","sect","uml","ordf","laquo","not","shy","reg","macr","deg","plusmn","sup2","sup3","acute","micro","para","middot","cedil","sup1","ordm","raquo","frac14","frac12","frac34","iquest","times","divide","forall","exist","nabla","isin","notin","ni","prod","minus","lowast","radic","infin","ang","and","or","cap","cup","there4","sim","cong","asymp","ne","equiv","ge","sup","nsub","sube","supe","oplus","otimes","perp","sdot","Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega","alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","rho","sigmaf","sigma","tau","upsilon","phi","chi","omega","thetasym","upsih","piv","OElig","oelig","Scaron","scaron","Yuml","fnof","circ","tilde","ensp","emsp","thinsp","zwnj","zwj","lrm","rlm","ndash","mdash","lsquo","rsquo","sbquo","ldquo","rdquo","bdquo","dagger","Dagger","bull","hellip","permil","prime","Prime","lsaquo","rsaquo","oline","euro","trade","larr","uarr","rarr","darr","harr","crarr","lceil","rceil","lfloor","rfloor","loz","spades","clubs","hearts","diams","nameStartChar","nameChar","tagNamePattern","copyLocator","parseElementStartPart","currentNSMap","entityReplacer","addAttribute","qname","attributeNames","addValue","setTagName","closed","localNSMap","nsp","nsPrefix","_copy","parseHtmlSpecialContent","elStartEnd","elEndStart","fixSelfClosed","closeMap","parseDCC","matchs","lastMatch","endDTD","parseInstruction","ElementAttributes","defaultNSMapCopy","surrogate1","surrogate2","fixedFromCharCode","appendText","xt","lineEnd","linePattern","lineStart","parseStack","tagStart","endMatch","locator2","getLocalName","global_document__WEBPACK_IMPORTED_MODULE_1__","global_document__WEBPACK_IMPORTED_MODULE_1___default","_assertThisInitialized","QualityLevel","IS_IE8","bitrate","QualityLevelList","levels_","qualityLevel","getQualityLevelById","removeQualityLevel","removed","addqualitylevel","removequalitylevel","originalPluginFn","qualityLevelList","disposeHandler","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","pEl","def_options","volumeStep","seekStep","enableMute","enableVolumeScroll","enableHoverScroll","enableFullscreen","enableNumbers","enableJogStyle","alwaysCaptureHotkeys","captureDocumentHotkeys","documentHotkeysFocusElementFilter","enableModifiersForNumbers","enableInactiveFocus","skipInitialFocus","rewindKey","forwardKey","volumeUpKey","volumeDownKey","customKeys","util","enableFull","videojsVer","outline","cancelFocusingPlayer","focusingPlayerTimeout","parentElement","ifblocker","keyDown","wasPlaying","ewhich","ePreventDefault","checkKeys","seekStepD","metaKey","ctrlKey","altKey","customKey","customHotkey","volumeHover","volumeSelector","onmouseover","onmouseout","mouseScroll","wheelDelta","detail","hasCookieItem","sKey","cookie","hasLocalStorage","getStorageItem","reg_ex","getCookieItem","setStorageItem","sValue","vEnd","sPath","sDomain","bSecure","sExpires","toGMTString","setCookieItem","registerFn","persistedVolume","persistedMute","createChromecastButton","createChromecastTech","enableChromecast","userOpts","doesUserAgentContainString","needsWebComponents","registerElement","iosChrome","scope","WebComponents","noOpts","register","CustomElements","hasWorkingUrl","forceJURL","pathname","relative","relativePathDotMapping","EOF","ALPHA","ALPHANUMERIC","jURL","_isInvalid","_url","authority","_username","_password","_isRelative","_query","_fragment","_scheme","_port","_host","hostname","port","_path","_schemeData","OriginalURL","isRelativeScheme","invalid","IDNAToASCII","percentEscape","unicode","percentEscapeQuery","stateOverride","cursor","seenAt","seenBracket","nextC","nextNextC","tempC","counter","JsMutationObserver","setImmediate","registrationsTable","setImmediateQueue","sentinel","currentRecord","recordWithOldValue","isScheduled","scheduledObservers","uidCounter","ShadowDOMPolyfill","wrapIfNeeded","childList","characterData","attributeOldValue","attributeFilter","characterDataOldValue","registration","registrations","observer","removeListeners","Registration","nodes_","addListeners","records_","takeRecords","copyOfRecords","enqueue","record","records","recordToReplaceLast","selectRecord","dispatchCallbacks","addListeners_","subtree","removeListeners_","addTransientObserver","transientObservedNodes","removeTransientObservers","handleEvent","relatedNode","getRecord","attributeName","attributeNamespace","attrChange","MutationEvent","ADDITION","prevValue","forEachAncestorAndObserverEnqueueRecord","getRecordWithOldValue","addedNodes","removedNodes","changedNode","MutationObserver","_isPolyfilled","observers","o1","o2","uid_","anyNonEmpty","removeTransientObserversFor","callback_","MutationRecord","lastRecord","newRecord","needsTemplate","HTMLTemplateElement","needsCloning","t2","TemplateImpl","contentDoc","createHTMLDocument","canDecorate","templateStyle","TEMPLATE_TAG","firstElementChild","HTMLElement","decorate","outerHTML","escapeDataRegExp","escapeReplace","bootstrap","templates","nativeCloneNode","fixClonedDom","s$","t$","originalImportNode","nativeRaf","webkitRequestAnimationFrame","mozRequestAnimationFrame","webkitCancelAnimationFrame","mozCancelAnimationFrame","origPreventDefault","isIE","CustomEvent","inType","initCustomEvent","origEvent","HTMLImports","useNative","hasShadowDOMPolyfill","wrap","rootDocument","currentScriptDescriptor","currentScript","scripts","whenReady","whenDocumentReady","requiredReadyState","isDocumentReady","checkReady","imports","parsedCount","importCount","newImports","errorImports","checkDone","allImports","loadedImports","loadedImport","markTargetLoaded","errorLoadingImport","imp","link","__loaded","import","__importParsed","watchImportsLoad","handleImports","rel","handleImport","mxns","readyTime","IMPORT_LINK_TYPE","addModule","initializeModules","CSS_URL_REGEXP","CSS_IMPORT_REGEXP","resolveUrlsInStyle","linkUrl","resolver","resolveUrlsInCssText","urlObj","replaceUrls","regexp","post","urlPath","async","ok","nextContext","bust","redirectedUrl","locationHeader","getResponseHeader","origin","loadDocument","Loader","onLoad","onComplete","cache","oncomplete","inflight","pending","addNodes","addNode","elt","__nodeUrl","dedupe","fetch","tail","pieces","receive","receiveXhr","resource","$p","Observer","addCallback","mo","mutations","IMPORT_SELECTOR","importParser","documentSelectors","importsSelectors","dynamicElements","parseNext","nextToParse","isParsed","markParsing","parseDynamic","quiet","parsingElement","markParsingComplete","markDynamicParsingComplete","__importElement","parseImport","__doc","__importsParsingHook","__resource","__error","__pending","parseLink","linkElt","nodeIsImport","parseGeneric","parseStyle","__appliedElement","addElementToDocument","rootImportForElement","__importLink","fakeLoad","sheet","csr","cssRules","CSSRule","IMPORT_RULE","parseScript","scriptElt","scriptContent","__importedScripts","moniker","baseURI","generateSourceMapHint","generateScriptContent","generateScriptDataUrl","_mayParse","nextToParseInDoc","nextToParseDynamic","parseSelectorsForNode","hasResource","needsDynamicParsing","importer","documents","documentPreloadSelectors","importsPreloadSelectors","loadNode","importLoader","loadSubtree","marshalNodes","loadSelectorsForNode","isLinkRel","isImportLink","_URL","hasBaseURIAccessor","makeDocument","bootDocument","loadedAll","baseURIDescriptor","added","loading","shouldLoadNode","shouldParseNode","matchesSelector","webkitMatchesSelector","mozMatchesSelector","hasNative","forSubtree","findAllElements","find","nextElementSibling","forRoots","shadowRoot","olderShadowRoot","forDocumentTree","_forDocumentTree","processingDocuments","addedNode","isAttached","addedSubtree","upgrade","attached","hasThrottledAttached","hasPolyfillMutations","isPendingMutations","pendingMutations","deferMutation","takeMutations","_attached","__upgraded__","__attached","attachedCallback","detached","_detached","detachedCallback","mx","inDocument","inRoot","__observer","upgradeDocument","originalCreateShadowRoot","createShadowRoot","watchShadow","__watched","upgradeDocumentTree","upgradeSubtree","upgradeAll","upgradeWithDefinition","definition","implementPrototype","createdCallback","created","inTarget","inSrc","inNative","used","customMixin","native","getRegisteredDefinition","extends","changeAttribute","operation","newValue","attributeChangedCallback","reservedTagList","registry","typeExtension","ctor","domCreateElement","isInstance","domCreateElementNS","wrapDomMethodToForceUpgrade","methodName","isReservedTag","__name","lifecycle","ancestry","extnds","extendee","baseTag","resolveTagName","nativePrototype","inst","ancestor","foundPrototype","resolvePrototypeChain","_polyfilled","overrideAttributeApi","registerDefinition","instantiate","generateConstructor","instanceof","nop","elapsed","unwrap","unwrapIfNeeded","eager","loadEvent","ChromecastButton","_onChromecastConnected","_onChromecastDisconnected","_onChromecastDevicesAvailable","_onChromecastDevicesUnavailable","chromecastSessionManager","_isChromecastConnected","_reloadCSSClasses","ChromecastButtonImpl","ChromecastTech","ChromecastTechUI","subclass","_eventListeners","videojsPlayer","_chromecastSessionManager","_ui","updatePoster","_remotePlayer","_remotePlayerController","_listenToPlayerControllerEvents","_removeAllEventListeners","_hasPlayedAnyItem","_requestTitle","requestTitleFn","_requestSubtitle","requestSubtitleFn","_requestCustomData","requestCustomDataFn","_initialStartTime","_playSource","getDOMElement","_isMediaLoading","playOrPause","canPause","isPaused","playerState","_currentSource","castSession","_getCastSession","mediaInfo","MediaInfo","subtitle","customData","_clearSessionTimeout","GenericMediaMetadata","metadataType","MetadataType","GENERIC","StreamType","LIVE","BUFFERED","updateTitle","updateSubtitle","LoadRequest","_hasPlayedCurrentItem","_getMediaSession","addUpdateListener","_onMediaSessionStatusChanged","_triggerErrorEvent","canSeek","seek","_triggerTimeUpdateEvent","mediaSession","_hasMediaSessionEnded","idleReason","IdleReason","FINISHED","volumeLevel","setVolumeLevel","_triggerVolumeChangeEvent","isMuted","muteOrUnmute","getPoster","setAutoplay","setPlaybackRate","eventTypes","RemotePlayerEventType","_addEventListener","PLAYER_STATE_CHANGED","_onPlayerStateChanged","VOLUME_LEVEL_CHANGED","IS_MUTED_CHANGED","CURRENT_TIME_CHANGED","DURATION_CHANGED","_triggerDurationChangeEvent","_removeEventListener","states","PlayerState","PLAYING","PAUSED","IDLE","_closeSessionOnTimeout","BUFFERING","isAlive","_sessionTimeoutID","endSession","_getCastContext","getCurrentSession","getMediaSession","ChromecastTechImpl","_el","_createDOMElement","_createElement","posterContainerEl","posterImageEl","subtitleEl","titleContainer","_findPosterEl","_findPosterImageEl","_findTitleEl","_findSubtitleEl","_poster","_title","_subtitle","onChromecastRequested","setOptions","receiverApplicationId","receiverAppID","DEFAULT_MEDIA_RECEIVER_APP_ID","autoJoinPolicy","AutoJoinPolicy","ORIGIN_SCOPED","configureCastContext","createSessionManager","indexOpt","addButtonToControlBar","buttonPositionIndex","setUpChromecastButton","pluginOptions","intervalID","tries","CHECK_AVAILABILITY_TIMEOUT","waitUntilChromecastAPIsAreAvailable","createAirPlayButton","createAirPlayPlugin","AirPlayButton","hasAirPlayAPISupport","_reactToAirPlayAvailableEvents","_getMediaEl","availability","AirPlayButtonImpl","onAirPlayRequested","webkitShowPlaybackTargetPicker","enableAirPlay","listenForAirPlayEvents","existingAirPlayButton","getExistingAirPlayButton","ensureAirPlayButtonExists","VideoPlayer","external_react_","external_react_default","prop_types","prop_types_default","v4","v4_default","lodash_isequal","setupDefaultValues","startPlayback","elementCallback","_elementCallback","playResult","sendOutput","catch","playError","can_autoplay_es","_typeof","_objectSpread","ownKeys","sym","_defineProperty","_slicedToArray","_arrayWithHoles","_n","_d","_e","_s","_iterableToArrayLimit","_nonIterableRest","_toConsumableArray","arr2","_arrayWithoutHoles","_iterableToArray","_nonIterableSpread","_classCallCheck","_possibleConstructorReturn","_getPrototypeOf","debug_overlay_DebugOverlay","DebugOverlay","_getPrototypeOf2","onDismiss","_inherits","debugInfo","_this$props$debugInfo","selectedQualityLevel","textLines","sortQualityLevels","resize","boxSizing","padding","zIndex","onClick","dismiss","getDebugInfo","audioDecodedByteCount","webkitAudioDecodedByteCount","videoDecodedByteCount","webkitVideoDecodedByteCount","decodedFrameCount","droppedFrameCount","live_stream_viewer_count_typeof","live_stream_viewer_count_classCallCheck","live_stream_viewer_count_defineProperties","live_stream_viewer_count_possibleConstructorReturn","live_stream_viewer_count_assertThisInitialized","live_stream_viewer_count_getPrototypeOf","live_stream_viewer_count_setPrototypeOf","live_stream_viewer_count_LiveStreamViewerCount","LiveStreamViewerCount","live_stream_viewer_count_inherits","liveStreamActiveViewerCount","video_typeof","video_objectSpread","video_defineProperty","video_classCallCheck","video_defineProperties","video_possibleConstructorReturn","video_assertThisInitialized","video_getPrototypeOf","video_inherits","video_setPrototypeOf","nextPlayerId","percentages","video_Video","Video","showDebugInfo","videoPlayer","prevState","countdownSeconds","countdownInterval","playNextVideo","playId","trackedPercentages","isLiveStream","posterUrl","windowLocation","upNext","showBrandingBug","brandingBugCampaign","embeddedPlayerCampaign","brandButtonImageUri","onBack","registerApiCallback","disableFullscreen","autoPlay","hasNextVideo","playerElement","latestTrackedTime","volumePanel","fullscreenToggle","isError","logError","trackVideoPlay","timeUpdatesSinceTracking","persistvolume","chromecast","airPlay","segmentStartTime","trackVideoWaiting","handleVideoEnded","VjsButton","VjsComponent","BrandButton","_VjsButton","VideoTitle","_VjsComponent","NextButton","_VjsButton2","vjsPlayer","BackButton","_VjsComponent2","ShareButton","_VjsComponent3","showShareOverlay","BrandingBug","_VjsComponent4","campaign","existingNextButtons","hasNextButton","nextOptions","lastControlBarChild","titleProps","existingTitleElements","hasTitleElement","titleOptions","customControlSpacer","existingRatesElements","hasRateElement","rButton","playbackRateMenuButton","paintCurrentFrameOnCanvas","canvas","imgContext","getContext","drawImage","getCurrentTime","getDuration","brandLink","buttonProps","existingBrandButtons","hasBrandButton","brandOptions","encodeURI","_lastControlBarChild","shareButton","shareButtons","existingBrandingBugs","hasBrandingBug","brandingBug","bugEl","controlBarEl","existingBackButtons","hasBackButton","backButton","fsToggle","marginLeft","nextButtons","nextButton","marginRight","updateDebugState","_this$props","onPlayNextVideo","nextItemId","rg4js","mediaId","videoId","ref","_this$props2","useGoogleAnalytics","useAmplitude","ga","hitType","eventCategory","eventAction","eventLabel","nonInteraction","amplitude","logEvent","Title","_this$props3","onVideoSegmentPlayed","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","eventValue","_this$props4","eventProps","isInteger","showRatingOverlay","_this$props5","onVideoEnd","startDelay","doCountdown","initializePlayer","prevProps","disposePlayer","remountPlayer","_this$props6","suggestedVideoEndcap","ratingInfo","isEmbedded","EndCapComponent","UpNextComponent","RatingOverlayComponent","ShareOverlayComponent","_this$state","canDisplayUpNext","canDisplayEndCap","canDisplayRating","canRate","canDisplayLiveStreamViewerCount","setPlayerRef","adParams","itemId","cover","nextCover","countdown","nextVideoId","browseId","parentItemId","ratingItemId","ratingItemTitle","returnUrl","hideRating","hideRatingOverlay","hideDebugOverlay","hideShare","hideShareOverlay","extendStatics","__extends","__","__assign","fromPairs","ngcomponent_1","React","react_dom_1","react2angular","bindingNames","injectNames","propTypes","bindings","_","controller","class_1","$element","injectedProps","isDestroyed","unmountComponentAtNode"],"mappings":"yFAmCAA,OAAOC,QAZP,SAAmBC,OAKjB,IAJA,IAAIC,OAAS,EACTC,OAASF,MAAQA,MAAME,OAAS,EAChCC,OAAS,KAEJF,MAAQC,QAAQ,CACvB,IAAIE,KAAOJ,MAAMC,OACjBE,OAAOC,KAAK,IAAMA,KAAK,GAEzB,OAAOD,S,8BChCT,IAAIE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AOy+D,SAAS,GAAI1zN,KAAKG,MAAOH,KAAKw0N,gBAAiBx0N,KAAKu0N,SAAS,KAGnHD,QAAQl0N,UAAUiB,qBAAuB,WACrCrB,KAAKy0N,aAAc,EACnBX,YAAYY,uBAAuB10N,KAAKu0N,SAAS,KAE9CD,QAhC6C,CAiCtDV,cAAchyN,c,8BC5E5B,IAEEigG,iBACAC,iBACAC,iBACAC,iBACAC,iBACAC,iBACAC,oBAEFN,iBAAmB,SAASz0C,SAC1B,OAVmB,IAUZA,SAGT00C,iBAAmB,SAAS10C,QAASw3C,YACnC,OAAOx3C,QAAUw3C,YAGnB7C,iBAAmB,SAAS4C,WAC1B,OAAOA,UAlBY,KAqBrB3C,iBAAmB,SAAS2C,UAAWC,YACrC,OAAOD,UAAYC,YAGrB3C,iBAAmB,SAAS0C,UAAWC,YACrC,OAAO/C,iBAAiBG,iBAAiB2C,UAAWC,cAGtD1C,iBAAmB,SAASyC,UAAWC,YACrC,OAAO9C,iBAAiBC,iBAAiB4C,WAAYC,aAOvDzC,oBAAsB,SAASwC,UAAWE,iBAAkBC,wBAC1D,OAAO/C,iBAAiB+C,uBAAyBH,UAAYA,UAAYE,mBAG3ExnG,OAAOC,QAAU,CACfkrH,iBA1CmB,IA2CnB3mB,iBAAkBA,iBAClBC,iBAAkBA,iBAClBC,iBAAkBA,iBAClBC,iBAAkBA,iBAClBC,iBAAkBA,iBAClBC,iBAAkBA,iBAClBC,oBAAqBA","file":"9.03888299.chunk.js","sourcesContent":["/**\n * lodash 4.0.1 (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license <https://lodash.com/license>\n */\n\n/**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['fred', 30], ['barney', 40]]);\n * // => { 'fred': 30, 'barney': 40 }\n */\nfunction fromPairs(pairs) {\n var index = -1,\n length = pairs ? pairs.length : 0,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n}\n\nmodule.exports = fromPairs;\n","var MAX_UINT32 = Math.pow(2, 32);\n\nvar parseSidx = function(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n references: [],\n referenceId: view.getUint32(4),\n timescale: view.getUint32(8)\n },\n i = 12;\n\n if (result.version === 0) {\n result.earliestPresentationTime = view.getUint32(i);\n result.firstOffset = view.getUint32(i + 4);\n i += 8;\n } else {\n // read 64 bits\n result.earliestPresentationTime = (view.getUint32(i) * MAX_UINT32) + view.getUint32(i + 4);\n result.firstOffset = (view.getUint32(i + 8) * MAX_UINT32) + view.getUint32(i + 12);\n i += 16;\n }\n\n i += 2; // reserved\n\n var referenceCount = view.getUint16(i);\n\n i += 2; // start of references\n\n for (; referenceCount > 0; i += 12, referenceCount--) {\n result.references.push({\n referenceType: (data[i] & 0x80) >>> 7,\n referencedSize: view.getUint32(i) & 0x7FFFFFFF,\n subsegmentDuration: view.getUint32(i + 4),\n startsWithSap: !!(data[i + 8] & 0x80),\n sapType: (data[i + 8] & 0x70) >>> 4,\n sapDeltaTime: view.getUint32(i + 8) & 0x0FFFFFFF\n });\n }\n\n return result;\n};\n\n\nmodule.exports = parseSidx;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar assign = require(\"lodash/assign\");\nvar mapValues = require(\"lodash/mapValues\");\nvar some = require(\"lodash/some\");\nvar NgComponent = /** @class */ (function () {\n function NgComponent() {\n this.__isFirstRender = true;\n this.state = {};\n this.props = {};\n }\n /*\n eg. {\n as: {currentValue: [1, 2, 3], previousValue: [1, 2]},\n bs: {currentValue: 42, previousValue: undefined}\n }\n */\n // nb: this method is explicity exposed for unit testing\n NgComponent.prototype.$onChanges = function (changes) {\n var oldProps = this.props;\n // TODO: fix Lodash typings upstream\n var newProps = mapValues(changes, 'currentValue');\n // TODO: implement nextState (which also means implement this.setState)\n var nextProps = assign({}, this.props, newProps);\n if (this.__isFirstRender) {\n assign(this, { props: nextProps });\n this.componentWillMount();\n this.render();\n this.__isFirstRender = false;\n }\n else {\n if (!this.didPropsChange(newProps, oldProps))\n return;\n this.componentWillReceiveProps(nextProps);\n var shouldUpdate = this.shouldComponentUpdate(nextProps, this.state);\n assign(this, { props: nextProps });\n if (!shouldUpdate)\n return;\n this.componentWillUpdate(this.props, this.state);\n this.render();\n this.componentDidUpdate(this.props, this.state);\n }\n };\n NgComponent.prototype.$postLink = function () {\n this.componentDidMount();\n };\n NgComponent.prototype.$onDestroy = function () {\n this.componentWillUnmount();\n };\n NgComponent.prototype.didPropsChange = function (newProps, oldProps) {\n return some(newProps, function (v, k) { return v !== oldProps[k]; });\n };\n /*\n lifecycle hooks\n */\n NgComponent.prototype.componentWillMount = function () { };\n NgComponent.prototype.componentDidMount = function () { };\n NgComponent.prototype.componentWillReceiveProps = function (_props) { };\n NgComponent.prototype.shouldComponentUpdate = function (_nextProps, _nextState) { return true; };\n NgComponent.prototype.componentWillUpdate = function (_props, _state) { };\n NgComponent.prototype.componentDidUpdate = function (_props, _state) { };\n NgComponent.prototype.componentWillUnmount = function () { };\n NgComponent.prototype.render = function () { };\n return NgComponent;\n}());\nexports.default = NgComponent;\n//# sourceMappingURL=index.js.map","module.exports =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 145);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {var win;\n\nif (typeof window !== \"undefined\") {\n win = window;\n} else if (typeof global !== \"undefined\") {\n win = global;\n} else if (typeof self !== \"undefined\"){\n win = self;\n} else {\n win = {};\n}\n\nmodule.exports = win;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(14)))\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {var topLevel = typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window : {}\nvar minDoc = __webpack_require__(115);\n\nvar doccy;\n\nif (typeof document !== 'undefined') {\n doccy = document;\n} else {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];\n\n if (!doccy) {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;\n }\n}\n\nmodule.exports = doccy;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(14)))\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar setPrototypeOf = __webpack_require__(37);\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inheritsLoose;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (false) { var throwOnDirectAccess, isValidElement, REACT_ELEMENT_TYPE; } else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = __webpack_require__(71)();\n}\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n// Source: http://jsfiddle.net/vWx8V/\n// http://stackoverflow.com/questions/5603195/full-list-of-javascript-keycodes\n\n/**\n * Conenience method returns corresponding value for given keyName or keyCode.\n *\n * @param {Mixed} keyCode {Number} or keyName {String}\n * @return {Mixed}\n * @api public\n */\n\nfunction keyCode(searchInput) {\n // Keyboard Events\n if (searchInput && 'object' === typeof searchInput) {\n var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode\n if (hasKeyCode) searchInput = hasKeyCode\n }\n\n // Numbers\n if ('number' === typeof searchInput) return names[searchInput]\n\n // Everything else (cast to string)\n var search = String(searchInput)\n\n // check codes\n var foundNamedKey = codes[search.toLowerCase()]\n if (foundNamedKey) return foundNamedKey\n\n // check aliases\n var foundNamedKey = aliases[search.toLowerCase()]\n if (foundNamedKey) return foundNamedKey\n\n // weird character?\n if (search.length === 1) return search.charCodeAt(0)\n\n return undefined\n}\n\n/**\n * Compares a keyboard event with a given keyCode or keyName.\n *\n * @param {Event} event Keyboard event that should be tested\n * @param {Mixed} keyCode {Number} or keyName {String}\n * @return {Boolean}\n * @api public\n */\nkeyCode.isEventKey = function isEventKey(event, nameOrCode) {\n if (event && 'object' === typeof event) {\n var keyCode = event.which || event.keyCode || event.charCode\n if (keyCode === null || keyCode === undefined) { return false; }\n if (typeof nameOrCode === 'string') {\n // check codes\n var foundNamedKey = codes[nameOrCode.toLowerCase()]\n if (foundNamedKey) { return foundNamedKey === keyCode; }\n \n // check aliases\n var foundNamedKey = aliases[nameOrCode.toLowerCase()]\n if (foundNamedKey) { return foundNamedKey === keyCode; }\n } else if (typeof nameOrCode === 'number') {\n return nameOrCode === keyCode;\n }\n return false;\n }\n}\n\nexports = module.exports = keyCode;\n\n/**\n * Get by name\n *\n * exports.code['enter'] // => 13\n */\n\nvar codes = exports.code = exports.codes = {\n 'backspace': 8,\n 'tab': 9,\n 'enter': 13,\n 'shift': 16,\n 'ctrl': 17,\n 'alt': 18,\n 'pause/break': 19,\n 'caps lock': 20,\n 'esc': 27,\n 'space': 32,\n 'page up': 33,\n 'page down': 34,\n 'end': 35,\n 'home': 36,\n 'left': 37,\n 'up': 38,\n 'right': 39,\n 'down': 40,\n 'insert': 45,\n 'delete': 46,\n 'command': 91,\n 'left command': 91,\n 'right command': 93,\n 'numpad *': 106,\n 'numpad +': 107,\n 'numpad -': 109,\n 'numpad .': 110,\n 'numpad /': 111,\n 'num lock': 144,\n 'scroll lock': 145,\n 'my computer': 182,\n 'my calculator': 183,\n ';': 186,\n '=': 187,\n ',': 188,\n '-': 189,\n '.': 190,\n '/': 191,\n '`': 192,\n '[': 219,\n '\\\\': 220,\n ']': 221,\n \"'\": 222\n}\n\n// Helper aliases\n\nvar aliases = exports.aliases = {\n 'windows': 91,\n '⇧': 16,\n '⌥': 18,\n '⌃': 17,\n '⌘': 91,\n 'ctl': 17,\n 'control': 17,\n 'option': 18,\n 'pause': 19,\n 'break': 19,\n 'caps': 20,\n 'return': 13,\n 'escape': 27,\n 'spc': 32,\n 'spacebar': 32,\n 'pgup': 33,\n 'pgdn': 34,\n 'ins': 45,\n 'del': 46,\n 'cmd': 91\n}\n\n/*!\n * Programatically add the following\n */\n\n// lower case chars\nfor (i = 97; i < 123; i++) codes[String.fromCharCode(i)] = i - 32\n\n// numbers\nfor (var i = 48; i < 58; i++) codes[i - 48] = i\n\n// function keys\nfor (i = 1; i < 13; i++) codes['f'+i] = i + 111\n\n// numpad keys\nfor (i = 0; i < 10; i++) codes['numpad '+i] = i + 96\n\n/**\n * Get by code\n *\n * exports.name[13] // => 'Enter'\n */\n\nvar names = exports.names = exports.title = {} // title for backward compat\n\n// Create reverse mapping\nfor (i in codes) names[codes[i]] = i\n\n// Add aliases\nfor (var alias in aliases) {\n codes[alias] = aliases[alias]\n}\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"react\");\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/global/window.js\nvar global_window = __webpack_require__(0);\nvar window_default = /*#__PURE__*/__webpack_require__.n(global_window);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/global/document.js\nvar global_document = __webpack_require__(1);\nvar document_default = /*#__PURE__*/__webpack_require__.n(global_document);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/video.js/node_modules/@babel/runtime/helpers/extends.js\nvar helpers_extends = __webpack_require__(11);\nvar extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/video.js/node_modules/@babel/runtime/helpers/assertThisInitialized.js\nvar assertThisInitialized = __webpack_require__(4);\nvar assertThisInitialized_default = /*#__PURE__*/__webpack_require__.n(assertThisInitialized);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/video.js/node_modules/@babel/runtime/helpers/inheritsLoose.js\nvar inheritsLoose = __webpack_require__(2);\nvar inheritsLoose_default = /*#__PURE__*/__webpack_require__.n(inheritsLoose);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/safe-json-parse/tuple.js\nvar tuple = __webpack_require__(65);\nvar tuple_default = /*#__PURE__*/__webpack_require__.n(tuple);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/keycode/index.js\nvar keycode = __webpack_require__(5);\nvar keycode_default = /*#__PURE__*/__webpack_require__.n(keycode);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/xhr/lib/index.js\nvar lib = __webpack_require__(38);\nvar lib_default = /*#__PURE__*/__webpack_require__.n(lib);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/videojs-vtt.js/lib/browser-index.js\nvar browser_index = __webpack_require__(28);\nvar browser_index_default = /*#__PURE__*/__webpack_require__.n(browser_index);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/video.js/node_modules/@babel/runtime/helpers/construct.js\nvar construct = __webpack_require__(66);\nvar construct_default = /*#__PURE__*/__webpack_require__.n(construct);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/video.js/node_modules/@babel/runtime/helpers/inherits.js\nvar inherits = __webpack_require__(67);\nvar inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/node_modules/url-toolkit/src/url-toolkit.js\nvar url_toolkit = __webpack_require__(39);\nvar url_toolkit_default = /*#__PURE__*/__webpack_require__.n(url_toolkit);\n\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/resolve-url.js\n\n\nvar DEFAULT_LOCATION = 'http://example.com';\n\nvar resolve_url_resolveUrl = function resolveUrl(baseUrl, relativeUrl) {\n // return early if we don't need to resolve\n if (/^[a-z]+:/i.test(relativeUrl)) {\n return relativeUrl;\n } // if baseUrl is a data URI, ignore it and resolve everything relative to window.location\n\n\n if (/^data:/.test(baseUrl)) {\n baseUrl = window_default.a.location && window_default.a.location.href || '';\n } // IE11 supports URL but not the URL constructor\n // feature detect the behavior we want\n\n\n var nativeURL = typeof window_default.a.URL === 'function';\n var protocolLess = /^\\/\\//.test(baseUrl); // remove location if window.location isn't available (i.e. we're in node)\n // and if baseUrl isn't an absolute url\n\n var removeLocation = !window_default.a.location && !/\\/\\//i.test(baseUrl); // if the base URL is relative then combine with the current location\n\n if (nativeURL) {\n baseUrl = new window_default.a.URL(baseUrl, window_default.a.location || DEFAULT_LOCATION);\n } else if (!/\\/\\//i.test(baseUrl)) {\n baseUrl = url_toolkit_default.a.buildAbsoluteURL(window_default.a.location && window_default.a.location.href || '', baseUrl);\n }\n\n if (nativeURL) {\n var newUrl = new URL(relativeUrl, baseUrl); // if we're a protocol-less url, remove the protocol\n // and if we're location-less, remove the location\n // otherwise, return the url unmodified\n\n if (removeLocation) {\n return newUrl.href.slice(DEFAULT_LOCATION.length);\n } else if (protocolLess) {\n return newUrl.href.slice(newUrl.protocol.length);\n }\n\n return newUrl.href;\n }\n\n return url_toolkit_default.a.buildAbsoluteURL(baseUrl, relativeUrl);\n};\n\n/* harmony default export */ var resolve_url = (resolve_url_resolveUrl);\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/m3u8-parser/node_modules/@babel/runtime/helpers/inheritsLoose.js\nvar helpers_inheritsLoose = __webpack_require__(30);\nvar helpers_inheritsLoose_default = /*#__PURE__*/__webpack_require__.n(helpers_inheritsLoose);\n\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/stream.js\n/**\n * @file stream.js\n */\n\n/**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\nvar Stream = /*#__PURE__*/function () {\n function Stream() {\n this.listeners = {};\n }\n /**\n * Add a listener for a specified event type.\n *\n * @param {string} type the event name\n * @param {Function} listener the callback to be invoked when an event of\n * the specified type occurs\n */\n\n\n var _proto = Stream.prototype;\n\n _proto.on = function on(type, listener) {\n if (!this.listeners[type]) {\n this.listeners[type] = [];\n }\n\n this.listeners[type].push(listener);\n }\n /**\n * Remove a listener for a specified event type.\n *\n * @param {string} type the event name\n * @param {Function} listener a function previously registered for this\n * type of event through `on`\n * @return {boolean} if we could turn it off or not\n */\n ;\n\n _proto.off = function off(type, listener) {\n if (!this.listeners[type]) {\n return false;\n }\n\n var index = this.listeners[type].indexOf(listener); // TODO: which is better?\n // In Video.js we slice listener functions\n // on trigger so that it does not mess up the order\n // while we loop through.\n //\n // Here we slice on off so that the loop in trigger\n // can continue using it's old reference to loop without\n // messing up the order.\n\n this.listeners[type] = this.listeners[type].slice(0);\n this.listeners[type].splice(index, 1);\n return index > -1;\n }\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n *\n * @param {string} type the event name\n */\n ;\n\n _proto.trigger = function trigger(type) {\n var callbacks = this.listeners[type];\n\n if (!callbacks) {\n return;\n } // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n\n\n if (arguments.length === 2) {\n var length = callbacks.length;\n\n for (var i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var _length = callbacks.length;\n\n for (var _i = 0; _i < _length; ++_i) {\n callbacks[_i].apply(this, args);\n }\n }\n }\n /**\n * Destroys the stream and cleans up.\n */\n ;\n\n _proto.dispose = function dispose() {\n this.listeners = {};\n }\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n *\n * @param {Stream} destination the stream that will receive all `data` events\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n ;\n\n _proto.pipe = function pipe(destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n };\n\n return Stream;\n}();\n\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/m3u8-parser/node_modules/@babel/runtime/helpers/extends.js\nvar runtime_helpers_extends = __webpack_require__(40);\nvar helpers_extends_default = /*#__PURE__*/__webpack_require__.n(runtime_helpers_extends);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/m3u8-parser/node_modules/@babel/runtime/helpers/assertThisInitialized.js\nvar helpers_assertThisInitialized = __webpack_require__(68);\nvar helpers_assertThisInitialized_default = /*#__PURE__*/__webpack_require__.n(helpers_assertThisInitialized);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/decode-b64-to-uint8-array.js\nvar decode_b64_to_uint8_array = __webpack_require__(29);\n\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/m3u8-parser/dist/m3u8-parser.es.js\n/*! @name m3u8-parser @version 4.7.0 @license Apache-2.0 */\n\n\n\n\n\n\n/**\n * A stream that buffers string input and generates a `data` event for each\n * line.\n *\n * @class LineStream\n * @extends Stream\n */\n\nvar m3u8_parser_es_LineStream = /*#__PURE__*/function (_Stream) {\n helpers_inheritsLoose_default()(LineStream, _Stream);\n\n function LineStream() {\n var _this;\n\n _this = _Stream.call(this) || this;\n _this.buffer = '';\n return _this;\n }\n /**\n * Add new data to be parsed.\n *\n * @param {string} data the text to process\n */\n\n\n var _proto = LineStream.prototype;\n\n _proto.push = function push(data) {\n var nextNewline;\n this.buffer += data;\n nextNewline = this.buffer.indexOf('\\n');\n\n for (; nextNewline > -1; nextNewline = this.buffer.indexOf('\\n')) {\n this.trigger('data', this.buffer.substring(0, nextNewline));\n this.buffer = this.buffer.substring(nextNewline + 1);\n }\n };\n\n return LineStream;\n}(Stream);\n\nvar TAB = String.fromCharCode(0x09);\n\nvar parseByterange = function parseByterange(byterangeString) {\n // optionally match and capture 0+ digits before `@`\n // optionally match and capture 0+ digits after `@`\n var match = /([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString || '');\n var result = {};\n\n if (match[1]) {\n result.length = parseInt(match[1], 10);\n }\n\n if (match[2]) {\n result.offset = parseInt(match[2], 10);\n }\n\n return result;\n};\n/**\n * \"forgiving\" attribute list psuedo-grammar:\n * attributes -> keyvalue (',' keyvalue)*\n * keyvalue -> key '=' value\n * key -> [^=]*\n * value -> '\"' [^\"]* '\"' | [^,]*\n */\n\n\nvar attributeSeparator = function attributeSeparator() {\n var key = '[^=]*';\n var value = '\"[^\"]*\"|[^,]*';\n var keyvalue = '(?:' + key + ')=(?:' + value + ')';\n return new RegExp('(?:^|,)(' + keyvalue + ')');\n};\n/**\n * Parse attributes from a line given the separator\n *\n * @param {string} attributes the attribute line to parse\n */\n\n\nvar parseAttributes = function parseAttributes(attributes) {\n // split the string using attributes as the separator\n var attrs = attributes.split(attributeSeparator());\n var result = {};\n var i = attrs.length;\n var attr;\n\n while (i--) {\n // filter out unmatched portions of the string\n if (attrs[i] === '') {\n continue;\n } // split the key and value\n\n\n attr = /([^=]*)=(.*)/.exec(attrs[i]).slice(1); // trim whitespace and remove optional quotes around the value\n\n attr[0] = attr[0].replace(/^\\s+|\\s+$/g, '');\n attr[1] = attr[1].replace(/^\\s+|\\s+$/g, '');\n attr[1] = attr[1].replace(/^['\"](.*)['\"]$/g, '$1');\n result[attr[0]] = attr[1];\n }\n\n return result;\n};\n/**\n * A line-level M3U8 parser event stream. It expects to receive input one\n * line at a time and performs a context-free parse of its contents. A stream\n * interpretation of a manifest can be useful if the manifest is expected to\n * be too large to fit comfortably into memory or the entirety of the input\n * is not immediately available. Otherwise, it's probably much easier to work\n * with a regular `Parser` object.\n *\n * Produces `data` events with an object that captures the parser's\n * interpretation of the input. That object has a property `tag` that is one\n * of `uri`, `comment`, or `tag`. URIs only have a single additional\n * property, `line`, which captures the entirety of the input without\n * interpretation. Comments similarly have a single additional property\n * `text` which is the input without the leading `#`.\n *\n * Tags always have a property `tagType` which is the lower-cased version of\n * the M3U8 directive without the `#EXT` or `#EXT-X-` prefix. For instance,\n * `#EXT-X-MEDIA-SEQUENCE` becomes `media-sequence` when parsed. Unrecognized\n * tags are given the tag type `unknown` and a single additional property\n * `data` with the remainder of the input.\n *\n * @class ParseStream\n * @extends Stream\n */\n\n\nvar m3u8_parser_es_ParseStream = /*#__PURE__*/function (_Stream) {\n helpers_inheritsLoose_default()(ParseStream, _Stream);\n\n function ParseStream() {\n var _this;\n\n _this = _Stream.call(this) || this;\n _this.customParsers = [];\n _this.tagMappers = [];\n return _this;\n }\n /**\n * Parses an additional line of input.\n *\n * @param {string} line a single line of an M3U8 file to parse\n */\n\n\n var _proto = ParseStream.prototype;\n\n _proto.push = function push(line) {\n var _this2 = this;\n\n var match;\n var event; // strip whitespace\n\n line = line.trim();\n\n if (line.length === 0) {\n // ignore empty lines\n return;\n } // URIs\n\n\n if (line[0] !== '#') {\n this.trigger('data', {\n type: 'uri',\n uri: line\n });\n return;\n } // map tags\n\n\n var newLines = this.tagMappers.reduce(function (acc, mapper) {\n var mappedLine = mapper(line); // skip if unchanged\n\n if (mappedLine === line) {\n return acc;\n }\n\n return acc.concat([mappedLine]);\n }, [line]);\n newLines.forEach(function (newLine) {\n for (var i = 0; i < _this2.customParsers.length; i++) {\n if (_this2.customParsers[i].call(_this2, newLine)) {\n return;\n }\n } // Comments\n\n\n if (newLine.indexOf('#EXT') !== 0) {\n _this2.trigger('data', {\n type: 'comment',\n text: newLine.slice(1)\n });\n\n return;\n } // strip off any carriage returns here so the regex matching\n // doesn't have to account for them.\n\n\n newLine = newLine.replace('\\r', ''); // Tags\n\n match = /^#EXTM3U/.exec(newLine);\n\n if (match) {\n _this2.trigger('data', {\n type: 'tag',\n tagType: 'm3u'\n });\n\n return;\n }\n\n match = /^#EXTINF:?([0-9\\.]*)?,?(.*)?$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'inf'\n };\n\n if (match[1]) {\n event.duration = parseFloat(match[1]);\n }\n\n if (match[2]) {\n event.title = match[2];\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'targetduration'\n };\n\n if (match[1]) {\n event.duration = parseInt(match[1], 10);\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'version'\n };\n\n if (match[1]) {\n event.version = parseInt(match[1], 10);\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-MEDIA-SEQUENCE:?(\\-?[0-9.]*)?/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'media-sequence'\n };\n\n if (match[1]) {\n event.number = parseInt(match[1], 10);\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\\-?[0-9.]*)?/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'discontinuity-sequence'\n };\n\n if (match[1]) {\n event.number = parseInt(match[1], 10);\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'playlist-type'\n };\n\n if (match[1]) {\n event.playlistType = match[1];\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-BYTERANGE:?(.*)?$/.exec(newLine);\n\n if (match) {\n event = helpers_extends_default()(parseByterange(match[1]), {\n type: 'tag',\n tagType: 'byterange'\n });\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'allow-cache'\n };\n\n if (match[1]) {\n event.allowed = !/NO/.test(match[1]);\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-MAP:?(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'map'\n };\n\n if (match[1]) {\n var attributes = parseAttributes(match[1]);\n\n if (attributes.URI) {\n event.uri = attributes.URI;\n }\n\n if (attributes.BYTERANGE) {\n event.byterange = parseByterange(attributes.BYTERANGE);\n }\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-STREAM-INF:?(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'stream-inf'\n };\n\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n\n if (event.attributes.RESOLUTION) {\n var split = event.attributes.RESOLUTION.split('x');\n var resolution = {};\n\n if (split[0]) {\n resolution.width = parseInt(split[0], 10);\n }\n\n if (split[1]) {\n resolution.height = parseInt(split[1], 10);\n }\n\n event.attributes.RESOLUTION = resolution;\n }\n\n if (event.attributes.BANDWIDTH) {\n event.attributes.BANDWIDTH = parseInt(event.attributes.BANDWIDTH, 10);\n }\n\n if (event.attributes['PROGRAM-ID']) {\n event.attributes['PROGRAM-ID'] = parseInt(event.attributes['PROGRAM-ID'], 10);\n }\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-MEDIA:?(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'media'\n };\n\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-ENDLIST/.exec(newLine);\n\n if (match) {\n _this2.trigger('data', {\n type: 'tag',\n tagType: 'endlist'\n });\n\n return;\n }\n\n match = /^#EXT-X-DISCONTINUITY/.exec(newLine);\n\n if (match) {\n _this2.trigger('data', {\n type: 'tag',\n tagType: 'discontinuity'\n });\n\n return;\n }\n\n match = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'program-date-time'\n };\n\n if (match[1]) {\n event.dateTimeString = match[1];\n event.dateTimeObject = new Date(match[1]);\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-KEY:?(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'key'\n };\n\n if (match[1]) {\n event.attributes = parseAttributes(match[1]); // parse the IV string into a Uint32Array\n\n if (event.attributes.IV) {\n if (event.attributes.IV.substring(0, 2).toLowerCase() === '0x') {\n event.attributes.IV = event.attributes.IV.substring(2);\n }\n\n event.attributes.IV = event.attributes.IV.match(/.{8}/g);\n event.attributes.IV[0] = parseInt(event.attributes.IV[0], 16);\n event.attributes.IV[1] = parseInt(event.attributes.IV[1], 16);\n event.attributes.IV[2] = parseInt(event.attributes.IV[2], 16);\n event.attributes.IV[3] = parseInt(event.attributes.IV[3], 16);\n event.attributes.IV = new Uint32Array(event.attributes.IV);\n }\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-START:?(.*)$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'start'\n };\n\n if (match[1]) {\n event.attributes = parseAttributes(match[1]);\n event.attributes['TIME-OFFSET'] = parseFloat(event.attributes['TIME-OFFSET']);\n event.attributes.PRECISE = /YES/.test(event.attributes.PRECISE);\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-out-cont'\n };\n\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-out'\n };\n\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-CUE-IN:?(.*)?$/.exec(newLine);\n\n if (match) {\n event = {\n type: 'tag',\n tagType: 'cue-in'\n };\n\n if (match[1]) {\n event.data = match[1];\n } else {\n event.data = '';\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-SKIP:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'skip'\n };\n event.attributes = parseAttributes(match[1]);\n\n if (event.attributes.hasOwnProperty('SKIPPED-SEGMENTS')) {\n event.attributes['SKIPPED-SEGMENTS'] = parseInt(event.attributes['SKIPPED-SEGMENTS'], 10);\n }\n\n if (event.attributes.hasOwnProperty('RECENTLY-REMOVED-DATERANGES')) {\n event.attributes['RECENTLY-REMOVED-DATERANGES'] = event.attributes['RECENTLY-REMOVED-DATERANGES'].split(TAB);\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-PART:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'part'\n };\n event.attributes = parseAttributes(match[1]);\n ['DURATION'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseFloat(event.attributes[key]);\n }\n });\n ['INDEPENDENT', 'GAP'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = /YES/.test(event.attributes[key]);\n }\n });\n\n if (event.attributes.hasOwnProperty('BYTERANGE')) {\n event.attributes.byterange = parseByterange(event.attributes.BYTERANGE);\n }\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'server-control'\n };\n event.attributes = parseAttributes(match[1]);\n ['CAN-SKIP-UNTIL', 'PART-HOLD-BACK', 'HOLD-BACK'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseFloat(event.attributes[key]);\n }\n });\n ['CAN-SKIP-DATERANGES', 'CAN-BLOCK-RELOAD'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = /YES/.test(event.attributes[key]);\n }\n });\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-PART-INF:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'part-inf'\n };\n event.attributes = parseAttributes(match[1]);\n ['PART-TARGET'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseFloat(event.attributes[key]);\n }\n });\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'preload-hint'\n };\n event.attributes = parseAttributes(match[1]);\n ['BYTERANGE-START', 'BYTERANGE-LENGTH'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseInt(event.attributes[key], 10);\n var subkey = key === 'BYTERANGE-LENGTH' ? 'length' : 'offset';\n event.attributes.byterange = event.attributes.byterange || {};\n event.attributes.byterange[subkey] = event.attributes[key]; // only keep the parsed byterange object.\n\n delete event.attributes[key];\n }\n });\n\n _this2.trigger('data', event);\n\n return;\n }\n\n match = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine);\n\n if (match && match[1]) {\n event = {\n type: 'tag',\n tagType: 'rendition-report'\n };\n event.attributes = parseAttributes(match[1]);\n ['LAST-MSN', 'LAST-PART'].forEach(function (key) {\n if (event.attributes.hasOwnProperty(key)) {\n event.attributes[key] = parseInt(event.attributes[key], 10);\n }\n });\n\n _this2.trigger('data', event);\n\n return;\n } // unknown tag type\n\n\n _this2.trigger('data', {\n type: 'tag',\n data: newLine.slice(4)\n });\n });\n }\n /**\n * Add a parser for custom headers\n *\n * @param {Object} options a map of options for the added parser\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {string} options.customType the custom type to register to the output\n * @param {Function} [options.dataParser] function to parse the line into an object\n * @param {boolean} [options.segment] should tag data be attached to the segment object\n */\n ;\n\n _proto.addParser = function addParser(_ref) {\n var _this3 = this;\n\n var expression = _ref.expression,\n customType = _ref.customType,\n dataParser = _ref.dataParser,\n segment = _ref.segment;\n\n if (typeof dataParser !== 'function') {\n dataParser = function dataParser(line) {\n return line;\n };\n }\n\n this.customParsers.push(function (line) {\n var match = expression.exec(line);\n\n if (match) {\n _this3.trigger('data', {\n type: 'custom',\n data: dataParser(line),\n customType: customType,\n segment: segment\n });\n\n return true;\n }\n });\n }\n /**\n * Add a custom header mapper\n *\n * @param {Object} options\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {Function} options.map function to translate tag into a different tag\n */\n ;\n\n _proto.addTagMapper = function addTagMapper(_ref2) {\n var expression = _ref2.expression,\n map = _ref2.map;\n\n var mapFn = function mapFn(line) {\n if (expression.test(line)) {\n return map(line);\n }\n\n return line;\n };\n\n this.tagMappers.push(mapFn);\n };\n\n return ParseStream;\n}(Stream);\n\nvar camelCase = function camelCase(str) {\n return str.toLowerCase().replace(/-(\\w)/g, function (a) {\n return a[1].toUpperCase();\n });\n};\n\nvar camelCaseKeys = function camelCaseKeys(attributes) {\n var result = {};\n Object.keys(attributes).forEach(function (key) {\n result[camelCase(key)] = attributes[key];\n });\n return result;\n}; // set SERVER-CONTROL hold back based upon targetDuration and partTargetDuration\n// we need this helper because defaults are based upon targetDuration and\n// partTargetDuration being set, but they may not be if SERVER-CONTROL appears before\n// target durations are set.\n\n\nvar setHoldBack = function setHoldBack(manifest) {\n var serverControl = manifest.serverControl,\n targetDuration = manifest.targetDuration,\n partTargetDuration = manifest.partTargetDuration;\n\n if (!serverControl) {\n return;\n }\n\n var tag = '#EXT-X-SERVER-CONTROL';\n var hb = 'holdBack';\n var phb = 'partHoldBack';\n var minTargetDuration = targetDuration && targetDuration * 3;\n var minPartDuration = partTargetDuration && partTargetDuration * 2;\n\n if (targetDuration && !serverControl.hasOwnProperty(hb)) {\n serverControl[hb] = minTargetDuration;\n this.trigger('info', {\n message: tag + \" defaulting HOLD-BACK to targetDuration * 3 (\" + minTargetDuration + \").\"\n });\n }\n\n if (minTargetDuration && serverControl[hb] < minTargetDuration) {\n this.trigger('warn', {\n message: tag + \" clamping HOLD-BACK (\" + serverControl[hb] + \") to targetDuration * 3 (\" + minTargetDuration + \")\"\n });\n serverControl[hb] = minTargetDuration;\n } // default no part hold back to part target duration * 3\n\n\n if (partTargetDuration && !serverControl.hasOwnProperty(phb)) {\n serverControl[phb] = partTargetDuration * 3;\n this.trigger('info', {\n message: tag + \" defaulting PART-HOLD-BACK to partTargetDuration * 3 (\" + serverControl[phb] + \").\"\n });\n } // if part hold back is too small default it to part target duration * 2\n\n\n if (partTargetDuration && serverControl[phb] < minPartDuration) {\n this.trigger('warn', {\n message: tag + \" clamping PART-HOLD-BACK (\" + serverControl[phb] + \") to partTargetDuration * 2 (\" + minPartDuration + \").\"\n });\n serverControl[phb] = minPartDuration;\n }\n};\n/**\n * A parser for M3U8 files. The current interpretation of the input is\n * exposed as a property `manifest` on parser objects. It's just two lines to\n * create and parse a manifest once you have the contents available as a string:\n *\n * ```js\n * var parser = new m3u8.Parser();\n * parser.push(xhr.responseText);\n * ```\n *\n * New input can later be applied to update the manifest object by calling\n * `push` again.\n *\n * The parser attempts to create a usable manifest object even if the\n * underlying input is somewhat nonsensical. It emits `info` and `warning`\n * events during the parse if it encounters input that seems invalid or\n * requires some property of the manifest object to be defaulted.\n *\n * @class Parser\n * @extends Stream\n */\n\n\nvar m3u8_parser_es_Parser = /*#__PURE__*/function (_Stream) {\n helpers_inheritsLoose_default()(Parser, _Stream);\n\n function Parser() {\n var _this;\n\n _this = _Stream.call(this) || this;\n _this.lineStream = new m3u8_parser_es_LineStream();\n _this.parseStream = new m3u8_parser_es_ParseStream();\n\n _this.lineStream.pipe(_this.parseStream);\n /* eslint-disable consistent-this */\n\n\n var self = helpers_assertThisInitialized_default()(_this);\n /* eslint-enable consistent-this */\n\n\n var uris = [];\n var currentUri = {}; // if specified, the active EXT-X-MAP definition\n\n var currentMap; // if specified, the active decryption key\n\n var _key;\n\n var hasParts = false;\n\n var noop = function noop() {};\n\n var defaultMediaGroups = {\n 'AUDIO': {},\n 'VIDEO': {},\n 'CLOSED-CAPTIONS': {},\n 'SUBTITLES': {}\n }; // This is the Widevine UUID from DASH IF IOP. The same exact string is\n // used in MPDs with Widevine encrypted streams.\n\n var widevineUuid = 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed'; // group segments into numbered timelines delineated by discontinuities\n\n var currentTimeline = 0; // the manifest is empty until the parse stream begins delivering data\n\n _this.manifest = {\n allowCache: true,\n discontinuityStarts: [],\n segments: []\n }; // keep track of the last seen segment's byte range end, as segments are not required\n // to provide the offset, in which case it defaults to the next byte after the\n // previous segment\n\n var lastByterangeEnd = 0; // keep track of the last seen part's byte range end.\n\n var lastPartByterangeEnd = 0;\n\n _this.on('end', function () {\n // only add preloadSegment if we don't yet have a uri for it.\n // and we actually have parts/preloadHints\n if (currentUri.uri || !currentUri.parts && !currentUri.preloadHints) {\n return;\n }\n\n if (!currentUri.map && currentMap) {\n currentUri.map = currentMap;\n }\n\n if (!currentUri.key && _key) {\n currentUri.key = _key;\n }\n\n if (!currentUri.timeline && typeof currentTimeline === 'number') {\n currentUri.timeline = currentTimeline;\n }\n\n _this.manifest.preloadSegment = currentUri;\n }); // update the manifest with the m3u8 entry from the parse stream\n\n\n _this.parseStream.on('data', function (entry) {\n var mediaGroup;\n var rendition;\n ({\n tag: function tag() {\n // switch based on the tag type\n (({\n version: function version() {\n if (entry.version) {\n this.manifest.version = entry.version;\n }\n },\n 'allow-cache': function allowCache() {\n this.manifest.allowCache = entry.allowed;\n\n if (!('allowed' in entry)) {\n this.trigger('info', {\n message: 'defaulting allowCache to YES'\n });\n this.manifest.allowCache = true;\n }\n },\n byterange: function byterange() {\n var byterange = {};\n\n if ('length' in entry) {\n currentUri.byterange = byterange;\n byterange.length = entry.length;\n\n if (!('offset' in entry)) {\n /*\n * From the latest spec (as of this writing):\n * https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.2.2\n *\n * Same text since EXT-X-BYTERANGE's introduction in draft 7:\n * https://tools.ietf.org/html/draft-pantos-http-live-streaming-07#section-3.3.1)\n *\n * \"If o [offset] is not present, the sub-range begins at the next byte\n * following the sub-range of the previous media segment.\"\n */\n entry.offset = lastByterangeEnd;\n }\n }\n\n if ('offset' in entry) {\n currentUri.byterange = byterange;\n byterange.offset = entry.offset;\n }\n\n lastByterangeEnd = byterange.offset + byterange.length;\n },\n endlist: function endlist() {\n this.manifest.endList = true;\n },\n inf: function inf() {\n if (!('mediaSequence' in this.manifest)) {\n this.manifest.mediaSequence = 0;\n this.trigger('info', {\n message: 'defaulting media sequence to zero'\n });\n }\n\n if (!('discontinuitySequence' in this.manifest)) {\n this.manifest.discontinuitySequence = 0;\n this.trigger('info', {\n message: 'defaulting discontinuity sequence to zero'\n });\n }\n\n if (entry.duration > 0) {\n currentUri.duration = entry.duration;\n }\n\n if (entry.duration === 0) {\n currentUri.duration = 0.01;\n this.trigger('info', {\n message: 'updating zero segment duration to a small value'\n });\n }\n\n this.manifest.segments = uris;\n },\n key: function key() {\n if (!entry.attributes) {\n this.trigger('warn', {\n message: 'ignoring key declaration without attribute list'\n });\n return;\n } // clear the active encryption key\n\n\n if (entry.attributes.METHOD === 'NONE') {\n _key = null;\n return;\n }\n\n if (!entry.attributes.URI) {\n this.trigger('warn', {\n message: 'ignoring key declaration without URI'\n });\n return;\n }\n\n if (entry.attributes.KEYFORMAT === 'com.apple.streamingkeydelivery') {\n this.manifest.contentProtection = this.manifest.contentProtection || {}; // TODO: add full support for this.\n\n this.manifest.contentProtection['com.apple.fps.1_0'] = {\n attributes: entry.attributes\n };\n return;\n } // check if the content is encrypted for Widevine\n // Widevine/HLS spec: https://storage.googleapis.com/wvdocs/Widevine_DRM_HLS.pdf\n\n\n if (entry.attributes.KEYFORMAT === widevineUuid) {\n var VALID_METHODS = ['SAMPLE-AES', 'SAMPLE-AES-CTR', 'SAMPLE-AES-CENC'];\n\n if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {\n this.trigger('warn', {\n message: 'invalid key method provided for Widevine'\n });\n return;\n }\n\n if (entry.attributes.METHOD === 'SAMPLE-AES-CENC') {\n this.trigger('warn', {\n message: 'SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead'\n });\n }\n\n if (entry.attributes.URI.substring(0, 23) !== 'data:text/plain;base64,') {\n this.trigger('warn', {\n message: 'invalid key URI provided for Widevine'\n });\n return;\n }\n\n if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === '0x')) {\n this.trigger('warn', {\n message: 'invalid key ID provided for Widevine'\n });\n return;\n } // if Widevine key attributes are valid, store them as `contentProtection`\n // on the manifest to emulate Widevine tag structure in a DASH mpd\n\n\n this.manifest.contentProtection = this.manifest.contentProtection || {};\n this.manifest.contentProtection['com.widevine.alpha'] = {\n attributes: {\n schemeIdUri: entry.attributes.KEYFORMAT,\n // remove '0x' from the key id string\n keyId: entry.attributes.KEYID.substring(2)\n },\n // decode the base64-encoded PSSH box\n pssh: Object(decode_b64_to_uint8_array[\"a\" /* default */])(entry.attributes.URI.split(',')[1])\n };\n return;\n }\n\n if (!entry.attributes.METHOD) {\n this.trigger('warn', {\n message: 'defaulting key method to AES-128'\n });\n } // setup an encryption key for upcoming segments\n\n\n _key = {\n method: entry.attributes.METHOD || 'AES-128',\n uri: entry.attributes.URI\n };\n\n if (typeof entry.attributes.IV !== 'undefined') {\n _key.iv = entry.attributes.IV;\n }\n },\n 'media-sequence': function mediaSequence() {\n if (!isFinite(entry.number)) {\n this.trigger('warn', {\n message: 'ignoring invalid media sequence: ' + entry.number\n });\n return;\n }\n\n this.manifest.mediaSequence = entry.number;\n },\n 'discontinuity-sequence': function discontinuitySequence() {\n if (!isFinite(entry.number)) {\n this.trigger('warn', {\n message: 'ignoring invalid discontinuity sequence: ' + entry.number\n });\n return;\n }\n\n this.manifest.discontinuitySequence = entry.number;\n currentTimeline = entry.number;\n },\n 'playlist-type': function playlistType() {\n if (!/VOD|EVENT/.test(entry.playlistType)) {\n this.trigger('warn', {\n message: 'ignoring unknown playlist type: ' + entry.playlist\n });\n return;\n }\n\n this.manifest.playlistType = entry.playlistType;\n },\n map: function map() {\n currentMap = {};\n\n if (entry.uri) {\n currentMap.uri = entry.uri;\n }\n\n if (entry.byterange) {\n currentMap.byterange = entry.byterange;\n }\n\n if (_key) {\n currentMap.key = _key;\n }\n },\n 'stream-inf': function streamInf() {\n this.manifest.playlists = uris;\n this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n if (!entry.attributes) {\n this.trigger('warn', {\n message: 'ignoring empty stream-inf attributes'\n });\n return;\n }\n\n if (!currentUri.attributes) {\n currentUri.attributes = {};\n }\n\n helpers_extends_default()(currentUri.attributes, entry.attributes);\n },\n media: function media() {\n this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;\n\n if (!(entry.attributes && entry.attributes.TYPE && entry.attributes['GROUP-ID'] && entry.attributes.NAME)) {\n this.trigger('warn', {\n message: 'ignoring incomplete or missing media group'\n });\n return;\n } // find the media group, creating defaults as necessary\n\n\n var mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];\n mediaGroupType[entry.attributes['GROUP-ID']] = mediaGroupType[entry.attributes['GROUP-ID']] || {};\n mediaGroup = mediaGroupType[entry.attributes['GROUP-ID']]; // collect the rendition metadata\n\n rendition = {\n default: /yes/i.test(entry.attributes.DEFAULT)\n };\n\n if (rendition.default) {\n rendition.autoselect = true;\n } else {\n rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);\n }\n\n if (entry.attributes.LANGUAGE) {\n rendition.language = entry.attributes.LANGUAGE;\n }\n\n if (entry.attributes.URI) {\n rendition.uri = entry.attributes.URI;\n }\n\n if (entry.attributes['INSTREAM-ID']) {\n rendition.instreamId = entry.attributes['INSTREAM-ID'];\n }\n\n if (entry.attributes.CHARACTERISTICS) {\n rendition.characteristics = entry.attributes.CHARACTERISTICS;\n }\n\n if (entry.attributes.FORCED) {\n rendition.forced = /yes/i.test(entry.attributes.FORCED);\n } // insert the new rendition\n\n\n mediaGroup[entry.attributes.NAME] = rendition;\n },\n discontinuity: function discontinuity() {\n currentTimeline += 1;\n currentUri.discontinuity = true;\n this.manifest.discontinuityStarts.push(uris.length);\n },\n 'program-date-time': function programDateTime() {\n if (typeof this.manifest.dateTimeString === 'undefined') {\n // PROGRAM-DATE-TIME is a media-segment tag, but for backwards\n // compatibility, we add the first occurence of the PROGRAM-DATE-TIME tag\n // to the manifest object\n // TODO: Consider removing this in future major version\n this.manifest.dateTimeString = entry.dateTimeString;\n this.manifest.dateTimeObject = entry.dateTimeObject;\n }\n\n currentUri.dateTimeString = entry.dateTimeString;\n currentUri.dateTimeObject = entry.dateTimeObject;\n },\n targetduration: function targetduration() {\n if (!isFinite(entry.duration) || entry.duration < 0) {\n this.trigger('warn', {\n message: 'ignoring invalid target duration: ' + entry.duration\n });\n return;\n }\n\n this.manifest.targetDuration = entry.duration;\n setHoldBack.call(this, this.manifest);\n },\n start: function start() {\n if (!entry.attributes || isNaN(entry.attributes['TIME-OFFSET'])) {\n this.trigger('warn', {\n message: 'ignoring start declaration without appropriate attribute list'\n });\n return;\n }\n\n this.manifest.start = {\n timeOffset: entry.attributes['TIME-OFFSET'],\n precise: entry.attributes.PRECISE\n };\n },\n 'cue-out': function cueOut() {\n currentUri.cueOut = entry.data;\n },\n 'cue-out-cont': function cueOutCont() {\n currentUri.cueOutCont = entry.data;\n },\n 'cue-in': function cueIn() {\n currentUri.cueIn = entry.data;\n },\n 'skip': function skip() {\n this.manifest.skip = camelCaseKeys(entry.attributes);\n this.warnOnMissingAttributes_('#EXT-X-SKIP', entry.attributes, ['SKIPPED-SEGMENTS']);\n },\n 'part': function part() {\n var _this2 = this;\n\n hasParts = true; // parts are always specifed before a segment\n\n var segmentIndex = this.manifest.segments.length;\n var part = camelCaseKeys(entry.attributes);\n currentUri.parts = currentUri.parts || [];\n currentUri.parts.push(part);\n\n if (part.byterange) {\n if (!part.byterange.hasOwnProperty('offset')) {\n part.byterange.offset = lastPartByterangeEnd;\n }\n\n lastPartByterangeEnd = part.byterange.offset + part.byterange.length;\n }\n\n var partIndex = currentUri.parts.length - 1;\n this.warnOnMissingAttributes_(\"#EXT-X-PART #\" + partIndex + \" for segment #\" + segmentIndex, entry.attributes, ['URI', 'DURATION']);\n\n if (this.manifest.renditionReports) {\n this.manifest.renditionReports.forEach(function (r, i) {\n if (!r.hasOwnProperty('lastPart')) {\n _this2.trigger('warn', {\n message: \"#EXT-X-RENDITION-REPORT #\" + i + \" lacks required attribute(s): LAST-PART\"\n });\n }\n });\n }\n },\n 'server-control': function serverControl() {\n var attrs = this.manifest.serverControl = camelCaseKeys(entry.attributes);\n\n if (!attrs.hasOwnProperty('canBlockReload')) {\n attrs.canBlockReload = false;\n this.trigger('info', {\n message: '#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false'\n });\n }\n\n setHoldBack.call(this, this.manifest);\n\n if (attrs.canSkipDateranges && !attrs.hasOwnProperty('canSkipUntil')) {\n this.trigger('warn', {\n message: '#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set'\n });\n }\n },\n 'preload-hint': function preloadHint() {\n // parts are always specifed before a segment\n var segmentIndex = this.manifest.segments.length;\n var hint = camelCaseKeys(entry.attributes);\n var isPart = hint.type && hint.type === 'PART';\n currentUri.preloadHints = currentUri.preloadHints || [];\n currentUri.preloadHints.push(hint);\n\n if (hint.byterange) {\n if (!hint.byterange.hasOwnProperty('offset')) {\n // use last part byterange end or zero if not a part.\n hint.byterange.offset = isPart ? lastPartByterangeEnd : 0;\n\n if (isPart) {\n lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length;\n }\n }\n }\n\n var index = currentUri.preloadHints.length - 1;\n this.warnOnMissingAttributes_(\"#EXT-X-PRELOAD-HINT #\" + index + \" for segment #\" + segmentIndex, entry.attributes, ['TYPE', 'URI']);\n\n if (!hint.type) {\n return;\n } // search through all preload hints except for the current one for\n // a duplicate type.\n\n\n for (var i = 0; i < currentUri.preloadHints.length - 1; i++) {\n var otherHint = currentUri.preloadHints[i];\n\n if (!otherHint.type) {\n continue;\n }\n\n if (otherHint.type === hint.type) {\n this.trigger('warn', {\n message: \"#EXT-X-PRELOAD-HINT #\" + index + \" for segment #\" + segmentIndex + \" has the same TYPE \" + hint.type + \" as preload hint #\" + i\n });\n }\n }\n },\n 'rendition-report': function renditionReport() {\n var report = camelCaseKeys(entry.attributes);\n this.manifest.renditionReports = this.manifest.renditionReports || [];\n this.manifest.renditionReports.push(report);\n var index = this.manifest.renditionReports.length - 1;\n var required = ['LAST-MSN', 'URI'];\n\n if (hasParts) {\n required.push('LAST-PART');\n }\n\n this.warnOnMissingAttributes_(\"#EXT-X-RENDITION-REPORT #\" + index, entry.attributes, required);\n },\n 'part-inf': function partInf() {\n this.manifest.partInf = camelCaseKeys(entry.attributes);\n this.warnOnMissingAttributes_('#EXT-X-PART-INF', entry.attributes, ['PART-TARGET']);\n\n if (this.manifest.partInf.partTarget) {\n this.manifest.partTargetDuration = this.manifest.partInf.partTarget;\n }\n\n setHoldBack.call(this, this.manifest);\n }\n })[entry.tagType] || noop).call(self);\n },\n uri: function uri() {\n currentUri.uri = entry.uri;\n uris.push(currentUri); // if no explicit duration was declared, use the target duration\n\n if (this.manifest.targetDuration && !('duration' in currentUri)) {\n this.trigger('warn', {\n message: 'defaulting segment duration to the target duration'\n });\n currentUri.duration = this.manifest.targetDuration;\n } // annotate with encryption information, if necessary\n\n\n if (_key) {\n currentUri.key = _key;\n }\n\n currentUri.timeline = currentTimeline; // annotate with initialization segment information, if necessary\n\n if (currentMap) {\n currentUri.map = currentMap;\n } // reset the last byterange end as it needs to be 0 between parts\n\n\n lastPartByterangeEnd = 0; // prepare for the next URI\n\n currentUri = {};\n },\n comment: function comment() {// comments are not important for playback\n },\n custom: function custom() {\n // if this is segment-level data attach the output to the segment\n if (entry.segment) {\n currentUri.custom = currentUri.custom || {};\n currentUri.custom[entry.customType] = entry.data; // if this is manifest-level data attach to the top level manifest object\n } else {\n this.manifest.custom = this.manifest.custom || {};\n this.manifest.custom[entry.customType] = entry.data;\n }\n }\n })[entry.type].call(self);\n });\n\n return _this;\n }\n\n var _proto = Parser.prototype;\n\n _proto.warnOnMissingAttributes_ = function warnOnMissingAttributes_(identifier, attributes, required) {\n var missing = [];\n required.forEach(function (key) {\n if (!attributes.hasOwnProperty(key)) {\n missing.push(key);\n }\n });\n\n if (missing.length) {\n this.trigger('warn', {\n message: identifier + \" lacks required attribute(s): \" + missing.join(', ')\n });\n }\n }\n /**\n * Parse the input string and update the manifest object.\n *\n * @param {string} chunk a potentially incomplete portion of the manifest\n */\n ;\n\n _proto.push = function push(chunk) {\n this.lineStream.push(chunk);\n }\n /**\n * Flush any remaining input. This can be handy if the last line of an M3U8\n * manifest did not contain a trailing newline but the file has been\n * completely received.\n */\n ;\n\n _proto.end = function end() {\n // flush any buffered input\n this.lineStream.push('\\n');\n this.trigger('end');\n }\n /**\n * Add an additional parser for non-standard tags\n *\n * @param {Object} options a map of options for the added parser\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {string} options.type the type to register to the output\n * @param {Function} [options.dataParser] function to parse the line into an object\n * @param {boolean} [options.segment] should tag data be attached to the segment object\n */\n ;\n\n _proto.addParser = function addParser(options) {\n this.parseStream.addParser(options);\n }\n /**\n * Add a custom header mapper\n *\n * @param {Object} options\n * @param {RegExp} options.expression a regular expression to match the custom header\n * @param {Function} options.map function to translate tag into a different tag\n */\n ;\n\n _proto.addTagMapper = function addTagMapper(options) {\n this.parseStream.addTagMapper(options);\n };\n\n return Parser;\n}(Stream);\n\n\n\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/codecs.js\n\nvar regexs = {\n // to determine mime types\n mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,\n webm: /^(vp0?[89]|av0?1|opus|vorbis)/,\n ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,\n // to determine if a codec is audio or video\n video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,\n audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,\n text: /^(stpp.ttml.im1t)/,\n // mux.js support regex\n muxerVideo: /^(avc0?1)/,\n muxerAudio: /^(mp4a)/,\n // match nothing as muxer does not support text right now.\n // there cannot never be a character before the start of a string\n // so this matches nothing.\n muxerText: /a^/\n};\nvar mediaTypes = ['video', 'audio', 'text'];\nvar upperMediaTypes = ['Video', 'Audio', 'Text'];\n/**\n * Replace the old apple-style `avc1.<dd>.<dd>` codec string with the standard\n * `avc1.<hhhhhh>`\n *\n * @param {string} codec\n * Codec string to translate\n * @return {string}\n * The translated codec string\n */\n\nvar translateLegacyCodec = function translateLegacyCodec(codec) {\n if (!codec) {\n return codec;\n }\n\n return codec.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (orig, profile, avcLevel) {\n var profileHex = ('00' + Number(profile).toString(16)).slice(-2);\n var avcLevelHex = ('00' + Number(avcLevel).toString(16)).slice(-2);\n return 'avc1.' + profileHex + '00' + avcLevelHex;\n });\n};\n/**\n * Replace the old apple-style `avc1.<dd>.<dd>` codec strings with the standard\n * `avc1.<hhhhhh>`\n *\n * @param {string[]} codecs\n * An array of codec strings to translate\n * @return {string[]}\n * The translated array of codec strings\n */\n\nvar translateLegacyCodecs = function translateLegacyCodecs(codecs) {\n return codecs.map(translateLegacyCodec);\n};\n/**\n * Replace codecs in the codec string with the old apple-style `avc1.<dd>.<dd>` to the\n * standard `avc1.<hhhhhh>`.\n *\n * @param {string} codecString\n * The codec string\n * @return {string}\n * The codec string with old apple-style codecs replaced\n *\n * @private\n */\n\nvar mapLegacyAvcCodecs = function mapLegacyAvcCodecs(codecString) {\n return codecString.replace(/avc1\\.(\\d+)\\.(\\d+)/i, function (match) {\n return translateLegacyCodecs([match])[0];\n });\n};\n/**\n * @typedef {Object} ParsedCodecInfo\n * @property {number} codecCount\n * Number of codecs parsed\n * @property {string} [videoCodec]\n * Parsed video codec (if found)\n * @property {string} [videoObjectTypeIndicator]\n * Video object type indicator (if found)\n * @property {string|null} audioProfile\n * Audio profile\n */\n\n/**\n * Parses a codec string to retrieve the number of codecs specified, the video codec and\n * object type indicator, and the audio profile.\n *\n * @param {string} [codecString]\n * The codec string to parse\n * @return {ParsedCodecInfo}\n * Parsed codec info\n */\n\nvar parseCodecs = function parseCodecs(codecString) {\n if (codecString === void 0) {\n codecString = '';\n }\n\n var codecs = codecString.split(',');\n var result = [];\n codecs.forEach(function (codec) {\n codec = codec.trim();\n var codecType;\n mediaTypes.forEach(function (name) {\n var match = regexs[name].exec(codec.toLowerCase());\n\n if (!match || match.length <= 1) {\n return;\n }\n\n codecType = name; // maintain codec case\n\n var type = codec.substring(0, match[1].length);\n var details = codec.replace(type, '');\n result.push({\n type: type,\n details: details,\n mediaType: name\n });\n });\n\n if (!codecType) {\n result.push({\n type: codec,\n details: '',\n mediaType: 'unknown'\n });\n }\n });\n return result;\n};\n/**\n * Returns a ParsedCodecInfo object for the default alternate audio playlist if there is\n * a default alternate audio playlist for the provided audio group.\n *\n * @param {Object} master\n * The master playlist\n * @param {string} audioGroupId\n * ID of the audio group for which to find the default codec info\n * @return {ParsedCodecInfo}\n * Parsed codec info\n */\n\nvar codecsFromDefault = function codecsFromDefault(master, audioGroupId) {\n if (!master.mediaGroups.AUDIO || !audioGroupId) {\n return null;\n }\n\n var audioGroup = master.mediaGroups.AUDIO[audioGroupId];\n\n if (!audioGroup) {\n return null;\n }\n\n for (var name in audioGroup) {\n var audioType = audioGroup[name];\n\n if (audioType.default && audioType.playlists) {\n // codec should be the same for all playlists within the audio type\n return parseCodecs(audioType.playlists[0].attributes.CODECS);\n }\n }\n\n return null;\n};\nvar isVideoCodec = function isVideoCodec(codec) {\n if (codec === void 0) {\n codec = '';\n }\n\n return regexs.video.test(codec.trim().toLowerCase());\n};\nvar isAudioCodec = function isAudioCodec(codec) {\n if (codec === void 0) {\n codec = '';\n }\n\n return regexs.audio.test(codec.trim().toLowerCase());\n};\nvar isTextCodec = function isTextCodec(codec) {\n if (codec === void 0) {\n codec = '';\n }\n\n return regexs.text.test(codec.trim().toLowerCase());\n};\nvar getMimeForCodec = function getMimeForCodec(codecString) {\n if (!codecString || typeof codecString !== 'string') {\n return;\n }\n\n var codecs = codecString.toLowerCase().split(',').map(function (c) {\n return translateLegacyCodec(c.trim());\n }); // default to video type\n\n var type = 'video'; // only change to audio type if the only codec we have is\n // audio\n\n if (codecs.length === 1 && isAudioCodec(codecs[0])) {\n type = 'audio';\n } else if (codecs.length === 1 && isTextCodec(codecs[0])) {\n // text uses application/<container> for now\n type = 'application';\n } // default the container to mp4\n\n\n var container = 'mp4'; // every codec must be able to go into the container\n // for that container to be the correct one\n\n if (codecs.every(function (c) {\n return regexs.mp4.test(c);\n })) {\n container = 'mp4';\n } else if (codecs.every(function (c) {\n return regexs.webm.test(c);\n })) {\n container = 'webm';\n } else if (codecs.every(function (c) {\n return regexs.ogg.test(c);\n })) {\n container = 'ogg';\n }\n\n return type + \"/\" + container + \";codecs=\\\"\" + codecString + \"\\\"\";\n};\nvar codecs_browserSupportsCodec = function browserSupportsCodec(codecString) {\n if (codecString === void 0) {\n codecString = '';\n }\n\n return window_default.a.MediaSource && window_default.a.MediaSource.isTypeSupported && window_default.a.MediaSource.isTypeSupported(getMimeForCodec(codecString)) || false;\n};\nvar muxerSupportsCodec = function muxerSupportsCodec(codecString) {\n if (codecString === void 0) {\n codecString = '';\n }\n\n return codecString.toLowerCase().split(',').every(function (codec) {\n codec = codec.trim(); // any match is supported.\n\n for (var i = 0; i < upperMediaTypes.length; i++) {\n var type = upperMediaTypes[i];\n\n if (regexs[\"muxer\" + type].test(codec)) {\n return true;\n }\n }\n\n return false;\n });\n};\nvar DEFAULT_AUDIO_CODEC = 'mp4a.40.2';\nvar DEFAULT_VIDEO_CODEC = 'avc1.4d400d';\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/media-types.js\nvar MPEGURL_REGEX = /^(audio|video|application)\\/(x-|vnd\\.apple\\.)?mpegurl/i;\nvar DASH_REGEX = /^application\\/dash\\+xml/i;\n/**\n * Returns a string that describes the type of source based on a video source object's\n * media type.\n *\n * @see {@link https://dev.w3.org/html5/pf-summary/video.html#dom-source-type|Source Type}\n *\n * @param {string} type\n * Video source object media type\n * @return {('hls'|'dash'|'vhs-json'|null)}\n * VHS source type string\n */\n\nvar simpleTypeFromSourceType = function simpleTypeFromSourceType(type) {\n if (MPEGURL_REGEX.test(type)) {\n return 'hls';\n }\n\n if (DASH_REGEX.test(type)) {\n return 'dash';\n } // Denotes the special case of a manifest object passed to http-streaming instead of a\n // source URL.\n //\n // See https://en.wikipedia.org/wiki/Media_type for details on specifying media types.\n //\n // In this case, vnd stands for vendor, video.js for the organization, VHS for this\n // project, and the +json suffix identifies the structure of the media type.\n\n\n if (type === 'application/vnd.videojs.vhs+json') {\n return 'vhs-json';\n }\n\n return null;\n};\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@xmldom/xmldom/lib/index.js\nvar xmldom_lib = __webpack_require__(69);\n\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/mpd-parser/dist/mpd-parser.es.js\n/*! @name mpd-parser @version 0.19.0 @license Apache-2.0 */\n\n\n\n\n\nvar mpd_parser_es_version = \"0.19.0\";\n\nvar isObject = function isObject(obj) {\n return !!obj && typeof obj === 'object';\n};\n\nvar merge = function merge() {\n for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {\n objects[_key] = arguments[_key];\n }\n\n return objects.reduce(function (result, source) {\n if (typeof source !== 'object') {\n return result;\n }\n\n Object.keys(source).forEach(function (key) {\n if (Array.isArray(result[key]) && Array.isArray(source[key])) {\n result[key] = result[key].concat(source[key]);\n } else if (isObject(result[key]) && isObject(source[key])) {\n result[key] = merge(result[key], source[key]);\n } else {\n result[key] = source[key];\n }\n });\n return result;\n }, {});\n};\nvar mpd_parser_es_values = function values(o) {\n return Object.keys(o).map(function (k) {\n return o[k];\n });\n};\n\nvar mpd_parser_es_range = function range(start, end) {\n var result = [];\n\n for (var i = start; i < end; i++) {\n result.push(i);\n }\n\n return result;\n};\nvar flatten = function flatten(lists) {\n return lists.reduce(function (x, y) {\n return x.concat(y);\n }, []);\n};\nvar from = function from(list) {\n if (!list.length) {\n return [];\n }\n\n var result = [];\n\n for (var i = 0; i < list.length; i++) {\n result.push(list[i]);\n }\n\n return result;\n};\nvar findIndexes = function findIndexes(l, key) {\n return l.reduce(function (a, e, i) {\n if (e[key]) {\n a.push(i);\n }\n\n return a;\n }, []);\n};\n\nvar mpd_parser_es_errors = {\n INVALID_NUMBER_OF_PERIOD: 'INVALID_NUMBER_OF_PERIOD',\n DASH_EMPTY_MANIFEST: 'DASH_EMPTY_MANIFEST',\n DASH_INVALID_XML: 'DASH_INVALID_XML',\n NO_BASE_URL: 'NO_BASE_URL',\n MISSING_SEGMENT_INFORMATION: 'MISSING_SEGMENT_INFORMATION',\n SEGMENT_TIME_UNSPECIFIED: 'SEGMENT_TIME_UNSPECIFIED',\n UNSUPPORTED_UTC_TIMING_SCHEME: 'UNSUPPORTED_UTC_TIMING_SCHEME'\n};\n\n/**\n * @typedef {Object} SingleUri\n * @property {string} uri - relative location of segment\n * @property {string} resolvedUri - resolved location of segment\n * @property {Object} byterange - Object containing information on how to make byte range\n * requests following byte-range-spec per RFC2616.\n * @property {String} byterange.length - length of range request\n * @property {String} byterange.offset - byte offset of range request\n *\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1\n */\n\n/**\n * Converts a URLType node (5.3.9.2.3 Table 13) to a segment object\n * that conforms to how m3u8-parser is structured\n *\n * @see https://github.com/videojs/m3u8-parser\n *\n * @param {string} baseUrl - baseUrl provided by <BaseUrl> nodes\n * @param {string} source - source url for segment\n * @param {string} range - optional range used for range calls,\n * follows RFC 2616, Clause 14.35.1\n * @return {SingleUri} full segment information transformed into a format similar\n * to m3u8-parser\n */\n\nvar mpd_parser_es_urlTypeToSegment = function urlTypeToSegment(_ref) {\n var _ref$baseUrl = _ref.baseUrl,\n baseUrl = _ref$baseUrl === void 0 ? '' : _ref$baseUrl,\n _ref$source = _ref.source,\n source = _ref$source === void 0 ? '' : _ref$source,\n _ref$range = _ref.range,\n range = _ref$range === void 0 ? '' : _ref$range,\n _ref$indexRange = _ref.indexRange,\n indexRange = _ref$indexRange === void 0 ? '' : _ref$indexRange;\n var segment = {\n uri: source,\n resolvedUri: resolve_url(baseUrl || '', source)\n };\n\n if (range || indexRange) {\n var rangeStr = range ? range : indexRange;\n var ranges = rangeStr.split('-');\n var startRange = parseInt(ranges[0], 10);\n var endRange = parseInt(ranges[1], 10); // byterange should be inclusive according to\n // RFC 2616, Clause 14.35.1\n\n segment.byterange = {\n length: endRange - startRange + 1,\n offset: startRange\n };\n }\n\n return segment;\n};\nvar byteRangeToString = function byteRangeToString(byterange) {\n // `endRange` is one less than `offset + length` because the HTTP range\n // header uses inclusive ranges\n var endRange = byterange.offset + byterange.length - 1;\n return byterange.offset + \"-\" + endRange;\n};\n\n/**\n * parse the end number attribue that can be a string\n * number, or undefined.\n *\n * @param {string|number|undefined} endNumber\n * The end number attribute.\n *\n * @return {number|null}\n * The result of parsing the end number.\n */\n\nvar parseEndNumber = function parseEndNumber(endNumber) {\n if (endNumber && typeof endNumber !== 'number') {\n endNumber = parseInt(endNumber, 10);\n }\n\n if (isNaN(endNumber)) {\n return null;\n }\n\n return endNumber;\n};\n/**\n * Functions for calculating the range of available segments in static and dynamic\n * manifests.\n */\n\n\nvar segmentRange = {\n /**\n * Returns the entire range of available segments for a static MPD\n *\n * @param {Object} attributes\n * Inheritied MPD attributes\n * @return {{ start: number, end: number }}\n * The start and end numbers for available segments\n */\n static: function _static(attributes) {\n var duration = attributes.duration,\n _attributes$timescale = attributes.timescale,\n timescale = _attributes$timescale === void 0 ? 1 : _attributes$timescale,\n sourceDuration = attributes.sourceDuration,\n periodDuration = attributes.periodDuration;\n var endNumber = parseEndNumber(attributes.endNumber);\n var segmentDuration = duration / timescale;\n\n if (typeof endNumber === 'number') {\n return {\n start: 0,\n end: endNumber\n };\n }\n\n if (typeof periodDuration === 'number') {\n return {\n start: 0,\n end: periodDuration / segmentDuration\n };\n }\n\n return {\n start: 0,\n end: sourceDuration / segmentDuration\n };\n },\n\n /**\n * Returns the current live window range of available segments for a dynamic MPD\n *\n * @param {Object} attributes\n * Inheritied MPD attributes\n * @return {{ start: number, end: number }}\n * The start and end numbers for available segments\n */\n dynamic: function dynamic(attributes) {\n var NOW = attributes.NOW,\n clientOffset = attributes.clientOffset,\n availabilityStartTime = attributes.availabilityStartTime,\n _attributes$timescale2 = attributes.timescale,\n timescale = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2,\n duration = attributes.duration,\n _attributes$start = attributes.start,\n start = _attributes$start === void 0 ? 0 : _attributes$start,\n _attributes$minimumUp = attributes.minimumUpdatePeriod,\n minimumUpdatePeriod = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp,\n _attributes$timeShift = attributes.timeShiftBufferDepth,\n timeShiftBufferDepth = _attributes$timeShift === void 0 ? Infinity : _attributes$timeShift;\n var endNumber = parseEndNumber(attributes.endNumber);\n var now = (NOW + clientOffset) / 1000;\n var periodStartWC = availabilityStartTime + start;\n var periodEndWC = now + minimumUpdatePeriod;\n var periodDuration = periodEndWC - periodStartWC;\n var segmentCount = Math.ceil(periodDuration * timescale / duration);\n var availableStart = Math.floor((now - periodStartWC - timeShiftBufferDepth) * timescale / duration);\n var availableEnd = Math.floor((now - periodStartWC) * timescale / duration);\n return {\n start: Math.max(0, availableStart),\n end: typeof endNumber === 'number' ? endNumber : Math.min(segmentCount, availableEnd)\n };\n }\n};\n/**\n * Maps a range of numbers to objects with information needed to build the corresponding\n * segment list\n *\n * @name toSegmentsCallback\n * @function\n * @param {number} number\n * Number of the segment\n * @param {number} index\n * Index of the number in the range list\n * @return {{ number: Number, duration: Number, timeline: Number, time: Number }}\n * Object with segment timing and duration info\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping a range of numbers to\n * information needed to build the segment list.\n *\n * @param {Object} attributes\n * Inherited MPD attributes\n * @return {toSegmentsCallback}\n * Callback map function\n */\n\nvar toSegments = function toSegments(attributes) {\n return function (number, index) {\n var duration = attributes.duration,\n _attributes$timescale3 = attributes.timescale,\n timescale = _attributes$timescale3 === void 0 ? 1 : _attributes$timescale3,\n periodIndex = attributes.periodIndex,\n _attributes$startNumb = attributes.startNumber,\n startNumber = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb;\n return {\n number: startNumber + number,\n duration: duration / timescale,\n timeline: periodIndex,\n time: index * duration\n };\n };\n};\n/**\n * Returns a list of objects containing segment timing and duration info used for\n * building the list of segments. This uses the @duration attribute specified\n * in the MPD manifest to derive the range of segments.\n *\n * @param {Object} attributes\n * Inherited MPD attributes\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\nvar parseByDuration = function parseByDuration(attributes) {\n var type = attributes.type,\n duration = attributes.duration,\n _attributes$timescale4 = attributes.timescale,\n timescale = _attributes$timescale4 === void 0 ? 1 : _attributes$timescale4,\n periodDuration = attributes.periodDuration,\n sourceDuration = attributes.sourceDuration;\n\n var _segmentRange$type = segmentRange[type](attributes),\n start = _segmentRange$type.start,\n end = _segmentRange$type.end;\n\n var segments = mpd_parser_es_range(start, end).map(toSegments(attributes));\n\n if (type === 'static') {\n var index = segments.length - 1; // section is either a period or the full source\n\n var sectionDuration = typeof periodDuration === 'number' ? periodDuration : sourceDuration; // final segment may be less than full segment duration\n\n segments[index].duration = sectionDuration - duration / timescale * index;\n }\n\n return segments;\n};\n\n/**\n * Translates SegmentBase into a set of segments.\n * (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes. Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @return {Object.<Array>} list of segments\n */\n\nvar segmentsFromBase = function segmentsFromBase(attributes) {\n var baseUrl = attributes.baseUrl,\n _attributes$initializ = attributes.initialization,\n initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ,\n sourceDuration = attributes.sourceDuration,\n _attributes$indexRang = attributes.indexRange,\n indexRange = _attributes$indexRang === void 0 ? '' : _attributes$indexRang,\n duration = attributes.duration; // base url is required for SegmentBase to work, per spec (Section 5.3.9.2.1)\n\n if (!baseUrl) {\n throw new Error(mpd_parser_es_errors.NO_BASE_URL);\n }\n\n var initSegment = mpd_parser_es_urlTypeToSegment({\n baseUrl: baseUrl,\n source: initialization.sourceURL,\n range: initialization.range\n });\n var segment = mpd_parser_es_urlTypeToSegment({\n baseUrl: baseUrl,\n source: baseUrl,\n indexRange: indexRange\n });\n segment.map = initSegment; // If there is a duration, use it, otherwise use the given duration of the source\n // (since SegmentBase is only for one total segment)\n\n if (duration) {\n var segmentTimeInfo = parseByDuration(attributes);\n\n if (segmentTimeInfo.length) {\n segment.duration = segmentTimeInfo[0].duration;\n segment.timeline = segmentTimeInfo[0].timeline;\n }\n } else if (sourceDuration) {\n segment.duration = sourceDuration;\n segment.timeline = 0;\n } // This is used for mediaSequence\n\n\n segment.number = 0;\n return [segment];\n};\n/**\n * Given a playlist, a sidx box, and a baseUrl, update the segment list of the playlist\n * according to the sidx information given.\n *\n * playlist.sidx has metadadata about the sidx where-as the sidx param\n * is the parsed sidx box itself.\n *\n * @param {Object} playlist the playlist to update the sidx information for\n * @param {Object} sidx the parsed sidx box\n * @return {Object} the playlist object with the updated sidx information\n */\n\nvar addSidxSegmentsToPlaylist = function addSidxSegmentsToPlaylist(playlist, sidx, baseUrl) {\n // Retain init segment information\n var initSegment = playlist.sidx.map ? playlist.sidx.map : null; // Retain source duration from initial main manifest parsing\n\n var sourceDuration = playlist.sidx.duration; // Retain source timeline\n\n var timeline = playlist.timeline || 0;\n var sidxByteRange = playlist.sidx.byterange;\n var sidxEnd = sidxByteRange.offset + sidxByteRange.length; // Retain timescale of the parsed sidx\n\n var timescale = sidx.timescale; // referenceType 1 refers to other sidx boxes\n\n var mediaReferences = sidx.references.filter(function (r) {\n return r.referenceType !== 1;\n });\n var segments = [];\n var type = playlist.endList ? 'static' : 'dynamic'; // firstOffset is the offset from the end of the sidx box\n\n var startIndex = sidxEnd + sidx.firstOffset;\n\n for (var i = 0; i < mediaReferences.length; i++) {\n var reference = sidx.references[i]; // size of the referenced (sub)segment\n\n var size = reference.referencedSize; // duration of the referenced (sub)segment, in the timescale\n // this will be converted to seconds when generating segments\n\n var duration = reference.subsegmentDuration; // should be an inclusive range\n\n var endIndex = startIndex + size - 1;\n var indexRange = startIndex + \"-\" + endIndex;\n var attributes = {\n baseUrl: baseUrl,\n timescale: timescale,\n timeline: timeline,\n // this is used in parseByDuration\n periodIndex: timeline,\n duration: duration,\n sourceDuration: sourceDuration,\n indexRange: indexRange,\n type: type\n };\n var segment = segmentsFromBase(attributes)[0];\n\n if (initSegment) {\n segment.map = initSegment;\n }\n\n segments.push(segment);\n startIndex += size;\n }\n\n playlist.segments = segments;\n return playlist;\n};\n\nvar generateSidxKey = function generateSidxKey(sidx) {\n return sidx && sidx.uri + '-' + byteRangeToString(sidx.byterange);\n};\n\nvar mergeDiscontiguousPlaylists = function mergeDiscontiguousPlaylists(playlists) {\n var mergedPlaylists = mpd_parser_es_values(playlists.reduce(function (acc, playlist) {\n // assuming playlist IDs are the same across periods\n // TODO: handle multiperiod where representation sets are not the same\n // across periods\n var name = playlist.attributes.id + (playlist.attributes.lang || ''); // Periods after first\n\n if (acc[name]) {\n var _acc$name$segments;\n\n // first segment of subsequent periods signal a discontinuity\n if (playlist.segments[0]) {\n playlist.segments[0].discontinuity = true;\n }\n\n (_acc$name$segments = acc[name].segments).push.apply(_acc$name$segments, playlist.segments); // bubble up contentProtection, this assumes all DRM content\n // has the same contentProtection\n\n\n if (playlist.attributes.contentProtection) {\n acc[name].attributes.contentProtection = playlist.attributes.contentProtection;\n }\n } else {\n // first Period\n acc[name] = playlist;\n }\n\n return acc;\n }, {}));\n return mergedPlaylists.map(function (playlist) {\n playlist.discontinuityStarts = findIndexes(playlist.segments, 'discontinuity');\n return playlist;\n });\n};\n\nvar addSidxSegmentsToPlaylist$1 = function addSidxSegmentsToPlaylist$1(playlist, sidxMapping) {\n var sidxKey = generateSidxKey(playlist.sidx);\n var sidxMatch = sidxKey && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx;\n\n if (sidxMatch) {\n addSidxSegmentsToPlaylist(playlist, sidxMatch, playlist.sidx.resolvedUri);\n }\n\n return playlist;\n};\nvar addSidxSegmentsToPlaylists = function addSidxSegmentsToPlaylists(playlists, sidxMapping) {\n if (sidxMapping === void 0) {\n sidxMapping = {};\n }\n\n if (!Object.keys(sidxMapping).length) {\n return playlists;\n }\n\n for (var i in playlists) {\n playlists[i] = addSidxSegmentsToPlaylist$1(playlists[i], sidxMapping);\n }\n\n return playlists;\n};\nvar formatAudioPlaylist = function formatAudioPlaylist(_ref, isAudioOnly) {\n var _attributes;\n\n var attributes = _ref.attributes,\n segments = _ref.segments,\n sidx = _ref.sidx;\n var playlist = {\n attributes: (_attributes = {\n NAME: attributes.id,\n BANDWIDTH: attributes.bandwidth,\n CODECS: attributes.codecs\n }, _attributes['PROGRAM-ID'] = 1, _attributes),\n uri: '',\n endList: attributes.type === 'static',\n timeline: attributes.periodIndex,\n resolvedUri: '',\n targetDuration: attributes.duration,\n segments: segments,\n mediaSequence: segments.length ? segments[0].number : 1\n };\n\n if (attributes.contentProtection) {\n playlist.contentProtection = attributes.contentProtection;\n }\n\n if (sidx) {\n playlist.sidx = sidx;\n }\n\n if (isAudioOnly) {\n playlist.attributes.AUDIO = 'audio';\n playlist.attributes.SUBTITLES = 'subs';\n }\n\n return playlist;\n};\nvar formatVttPlaylist = function formatVttPlaylist(_ref2) {\n var _m3u8Attributes;\n\n var attributes = _ref2.attributes,\n segments = _ref2.segments;\n\n if (typeof segments === 'undefined') {\n // vtt tracks may use single file in BaseURL\n segments = [{\n uri: attributes.baseUrl,\n timeline: attributes.periodIndex,\n resolvedUri: attributes.baseUrl || '',\n duration: attributes.sourceDuration,\n number: 0\n }]; // targetDuration should be the same duration as the only segment\n\n attributes.duration = attributes.sourceDuration;\n }\n\n var m3u8Attributes = (_m3u8Attributes = {\n NAME: attributes.id,\n BANDWIDTH: attributes.bandwidth\n }, _m3u8Attributes['PROGRAM-ID'] = 1, _m3u8Attributes);\n\n if (attributes.codecs) {\n m3u8Attributes.CODECS = attributes.codecs;\n }\n\n return {\n attributes: m3u8Attributes,\n uri: '',\n endList: attributes.type === 'static',\n timeline: attributes.periodIndex,\n resolvedUri: attributes.baseUrl || '',\n targetDuration: attributes.duration,\n segments: segments,\n mediaSequence: segments.length ? segments[0].number : 1\n };\n};\nvar organizeAudioPlaylists = function organizeAudioPlaylists(playlists, sidxMapping, isAudioOnly) {\n if (sidxMapping === void 0) {\n sidxMapping = {};\n }\n\n if (isAudioOnly === void 0) {\n isAudioOnly = false;\n }\n\n var mainPlaylist;\n var formattedPlaylists = playlists.reduce(function (a, playlist) {\n var role = playlist.attributes.role && playlist.attributes.role.value || '';\n var language = playlist.attributes.lang || '';\n var label = playlist.attributes.label || 'main';\n\n if (language && !playlist.attributes.label) {\n var roleLabel = role ? \" (\" + role + \")\" : '';\n label = \"\" + playlist.attributes.lang + roleLabel;\n }\n\n if (!a[label]) {\n a[label] = {\n language: language,\n autoselect: true,\n default: role === 'main',\n playlists: [],\n uri: ''\n };\n }\n\n var formatted = addSidxSegmentsToPlaylist$1(formatAudioPlaylist(playlist, isAudioOnly), sidxMapping);\n a[label].playlists.push(formatted);\n\n if (typeof mainPlaylist === 'undefined' && role === 'main') {\n mainPlaylist = playlist;\n mainPlaylist.default = true;\n }\n\n return a;\n }, {}); // if no playlists have role \"main\", mark the first as main\n\n if (!mainPlaylist) {\n var firstLabel = Object.keys(formattedPlaylists)[0];\n formattedPlaylists[firstLabel].default = true;\n }\n\n return formattedPlaylists;\n};\nvar organizeVttPlaylists = function organizeVttPlaylists(playlists, sidxMapping) {\n if (sidxMapping === void 0) {\n sidxMapping = {};\n }\n\n return playlists.reduce(function (a, playlist) {\n var label = playlist.attributes.lang || 'text';\n\n if (!a[label]) {\n a[label] = {\n language: label,\n default: false,\n autoselect: false,\n playlists: [],\n uri: ''\n };\n }\n\n a[label].playlists.push(addSidxSegmentsToPlaylist$1(formatVttPlaylist(playlist), sidxMapping));\n return a;\n }, {});\n};\n\nvar organizeCaptionServices = function organizeCaptionServices(captionServices) {\n return captionServices.reduce(function (svcObj, svc) {\n if (!svc) {\n return svcObj;\n }\n\n svc.forEach(function (service) {\n var channel = service.channel,\n language = service.language;\n svcObj[language] = {\n autoselect: false,\n default: false,\n instreamId: channel,\n language: language\n };\n\n if (service.hasOwnProperty('aspectRatio')) {\n svcObj[language].aspectRatio = service.aspectRatio;\n }\n\n if (service.hasOwnProperty('easyReader')) {\n svcObj[language].easyReader = service.easyReader;\n }\n\n if (service.hasOwnProperty('3D')) {\n svcObj[language]['3D'] = service['3D'];\n }\n });\n return svcObj;\n }, {});\n};\n\nvar formatVideoPlaylist = function formatVideoPlaylist(_ref3) {\n var _attributes2;\n\n var attributes = _ref3.attributes,\n segments = _ref3.segments,\n sidx = _ref3.sidx;\n var playlist = {\n attributes: (_attributes2 = {\n NAME: attributes.id,\n AUDIO: 'audio',\n SUBTITLES: 'subs',\n RESOLUTION: {\n width: attributes.width,\n height: attributes.height\n },\n CODECS: attributes.codecs,\n BANDWIDTH: attributes.bandwidth\n }, _attributes2['PROGRAM-ID'] = 1, _attributes2),\n uri: '',\n endList: attributes.type === 'static',\n timeline: attributes.periodIndex,\n resolvedUri: '',\n targetDuration: attributes.duration,\n segments: segments,\n mediaSequence: segments.length ? segments[0].number : 1\n };\n\n if (attributes.contentProtection) {\n playlist.contentProtection = attributes.contentProtection;\n }\n\n if (sidx) {\n playlist.sidx = sidx;\n }\n\n return playlist;\n};\n\nvar videoOnly = function videoOnly(_ref4) {\n var attributes = _ref4.attributes;\n return attributes.mimeType === 'video/mp4' || attributes.mimeType === 'video/webm' || attributes.contentType === 'video';\n};\n\nvar audioOnly = function audioOnly(_ref5) {\n var attributes = _ref5.attributes;\n return attributes.mimeType === 'audio/mp4' || attributes.mimeType === 'audio/webm' || attributes.contentType === 'audio';\n};\n\nvar vttOnly = function vttOnly(_ref6) {\n var attributes = _ref6.attributes;\n return attributes.mimeType === 'text/vtt' || attributes.contentType === 'text';\n};\n\nvar toM3u8 = function toM3u8(dashPlaylists, locations, sidxMapping) {\n var _mediaGroups;\n\n if (sidxMapping === void 0) {\n sidxMapping = {};\n }\n\n if (!dashPlaylists.length) {\n return {};\n } // grab all main manifest attributes\n\n\n var _dashPlaylists$0$attr = dashPlaylists[0].attributes,\n duration = _dashPlaylists$0$attr.sourceDuration,\n type = _dashPlaylists$0$attr.type,\n suggestedPresentationDelay = _dashPlaylists$0$attr.suggestedPresentationDelay,\n minimumUpdatePeriod = _dashPlaylists$0$attr.minimumUpdatePeriod;\n var videoPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist);\n var audioPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly));\n var vttPlaylists = dashPlaylists.filter(vttOnly);\n var captions = dashPlaylists.map(function (playlist) {\n return playlist.attributes.captionServices;\n }).filter(Boolean);\n var manifest = {\n allowCache: true,\n discontinuityStarts: [],\n segments: [],\n endList: true,\n mediaGroups: (_mediaGroups = {\n AUDIO: {},\n VIDEO: {}\n }, _mediaGroups['CLOSED-CAPTIONS'] = {}, _mediaGroups.SUBTITLES = {}, _mediaGroups),\n uri: '',\n duration: duration,\n playlists: addSidxSegmentsToPlaylists(videoPlaylists, sidxMapping)\n };\n\n if (minimumUpdatePeriod >= 0) {\n manifest.minimumUpdatePeriod = minimumUpdatePeriod * 1000;\n }\n\n if (locations) {\n manifest.locations = locations;\n }\n\n if (type === 'dynamic') {\n manifest.suggestedPresentationDelay = suggestedPresentationDelay;\n }\n\n var isAudioOnly = manifest.playlists.length === 0;\n\n if (audioPlaylists.length) {\n manifest.mediaGroups.AUDIO.audio = organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly);\n }\n\n if (vttPlaylists.length) {\n manifest.mediaGroups.SUBTITLES.subs = organizeVttPlaylists(vttPlaylists, sidxMapping);\n }\n\n if (captions.length) {\n manifest.mediaGroups['CLOSED-CAPTIONS'].cc = organizeCaptionServices(captions);\n }\n\n return manifest;\n};\n\n/**\n * Calculates the R (repetition) value for a live stream (for the final segment\n * in a manifest where the r value is negative 1)\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {number} time\n * current time (typically the total time up until the final segment)\n * @param {number} duration\n * duration property for the given <S />\n *\n * @return {number}\n * R value to reach the end of the given period\n */\nvar getLiveRValue = function getLiveRValue(attributes, time, duration) {\n var NOW = attributes.NOW,\n clientOffset = attributes.clientOffset,\n availabilityStartTime = attributes.availabilityStartTime,\n _attributes$timescale = attributes.timescale,\n timescale = _attributes$timescale === void 0 ? 1 : _attributes$timescale,\n _attributes$start = attributes.start,\n start = _attributes$start === void 0 ? 0 : _attributes$start,\n _attributes$minimumUp = attributes.minimumUpdatePeriod,\n minimumUpdatePeriod = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp;\n var now = (NOW + clientOffset) / 1000;\n var periodStartWC = availabilityStartTime + start;\n var periodEndWC = now + minimumUpdatePeriod;\n var periodDuration = periodEndWC - periodStartWC;\n return Math.ceil((periodDuration * timescale - time) / duration);\n};\n/**\n * Uses information provided by SegmentTemplate.SegmentTimeline to determine segment\n * timing and duration\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n *\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\n\nvar parseByTimeline = function parseByTimeline(attributes, segmentTimeline) {\n var type = attributes.type,\n _attributes$minimumUp2 = attributes.minimumUpdatePeriod,\n minimumUpdatePeriod = _attributes$minimumUp2 === void 0 ? 0 : _attributes$minimumUp2,\n _attributes$media = attributes.media,\n media = _attributes$media === void 0 ? '' : _attributes$media,\n sourceDuration = attributes.sourceDuration,\n _attributes$timescale2 = attributes.timescale,\n timescale = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2,\n _attributes$startNumb = attributes.startNumber,\n startNumber = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb,\n timeline = attributes.periodIndex;\n var segments = [];\n var time = -1;\n\n for (var sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {\n var S = segmentTimeline[sIndex];\n var duration = S.d;\n var repeat = S.r || 0;\n var segmentTime = S.t || 0;\n\n if (time < 0) {\n // first segment\n time = segmentTime;\n }\n\n if (segmentTime && segmentTime > time) {\n // discontinuity\n // TODO: How to handle this type of discontinuity\n // timeline++ here would treat it like HLS discontuity and content would\n // get appended without gap\n // E.G.\n // <S t=\"0\" d=\"1\" />\n // <S d=\"1\" />\n // <S d=\"1\" />\n // <S t=\"5\" d=\"1\" />\n // would have $Time$ values of [0, 1, 2, 5]\n // should this be appened at time positions [0, 1, 2, 3],(#EXT-X-DISCONTINUITY)\n // or [0, 1, 2, gap, gap, 5]? (#EXT-X-GAP)\n // does the value of sourceDuration consider this when calculating arbitrary\n // negative @r repeat value?\n // E.G. Same elements as above with this added at the end\n // <S d=\"1\" r=\"-1\" />\n // with a sourceDuration of 10\n // Would the 2 gaps be included in the time duration calculations resulting in\n // 8 segments with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9] or 10 segments\n // with $Time$ values of [0, 1, 2, 5, 6, 7, 8, 9, 10, 11] ?\n time = segmentTime;\n }\n\n var count = void 0;\n\n if (repeat < 0) {\n var nextS = sIndex + 1;\n\n if (nextS === segmentTimeline.length) {\n // last segment\n if (type === 'dynamic' && minimumUpdatePeriod > 0 && media.indexOf('$Number$') > 0) {\n count = getLiveRValue(attributes, time, duration);\n } else {\n // TODO: This may be incorrect depending on conclusion of TODO above\n count = (sourceDuration * timescale - time) / duration;\n }\n } else {\n count = (segmentTimeline[nextS].t - time) / duration;\n }\n } else {\n count = repeat + 1;\n }\n\n var end = startNumber + segments.length + count;\n var number = startNumber + segments.length;\n\n while (number < end) {\n segments.push({\n number: number,\n duration: duration / timescale,\n time: time,\n timeline: timeline\n });\n time += duration;\n number++;\n }\n }\n\n return segments;\n};\n\nvar identifierPattern = /\\$([A-z]*)(?:(%0)([0-9]+)d)?\\$/g;\n/**\n * Replaces template identifiers with corresponding values. To be used as the callback\n * for String.prototype.replace\n *\n * @name replaceCallback\n * @function\n * @param {string} match\n * Entire match of identifier\n * @param {string} identifier\n * Name of matched identifier\n * @param {string} format\n * Format tag string. Its presence indicates that padding is expected\n * @param {string} width\n * Desired length of the replaced value. Values less than this width shall be left\n * zero padded\n * @return {string}\n * Replacement for the matched identifier\n */\n\n/**\n * Returns a function to be used as a callback for String.prototype.replace to replace\n * template identifiers\n *\n * @param {Obect} values\n * Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n * Value of the Representation@id attribute\n * @param {number} values.Number\n * Number of the corresponding segment\n * @param {number} values.Bandwidth\n * Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n * Timestamp value of the corresponding segment\n * @return {replaceCallback}\n * Callback to be used with String.prototype.replace to replace identifiers\n */\n\nvar identifierReplacement = function identifierReplacement(values) {\n return function (match, identifier, format, width) {\n if (match === '$$') {\n // escape sequence\n return '$';\n }\n\n if (typeof values[identifier] === 'undefined') {\n return match;\n }\n\n var value = '' + values[identifier];\n\n if (identifier === 'RepresentationID') {\n // Format tag shall not be present with RepresentationID\n return value;\n }\n\n if (!format) {\n width = 1;\n } else {\n width = parseInt(width, 10);\n }\n\n if (value.length >= width) {\n return value;\n }\n\n return \"\" + new Array(width - value.length + 1).join('0') + value;\n };\n};\n/**\n * Constructs a segment url from a template string\n *\n * @param {string} url\n * Template string to construct url from\n * @param {Obect} values\n * Object containing values that shall be used to replace known identifiers\n * @param {number} values.RepresentationID\n * Value of the Representation@id attribute\n * @param {number} values.Number\n * Number of the corresponding segment\n * @param {number} values.Bandwidth\n * Value of the Representation@bandwidth attribute.\n * @param {number} values.Time\n * Timestamp value of the corresponding segment\n * @return {string}\n * Segment url with identifiers replaced\n */\n\nvar constructTemplateUrl = function constructTemplateUrl(url, values) {\n return url.replace(identifierPattern, identifierReplacement(values));\n};\n/**\n * Generates a list of objects containing timing and duration information about each\n * segment needed to generate segment uris and the complete segment object\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {{number: number, duration: number, time: number, timeline: number}[]}\n * List of Objects with segment timing and duration info\n */\n\nvar parseTemplateInfo = function parseTemplateInfo(attributes, segmentTimeline) {\n if (!attributes.duration && !segmentTimeline) {\n // if neither @duration or SegmentTimeline are present, then there shall be exactly\n // one media segment\n return [{\n number: attributes.startNumber || 1,\n duration: attributes.sourceDuration,\n time: 0,\n timeline: attributes.periodIndex\n }];\n }\n\n if (attributes.duration) {\n return parseByDuration(attributes);\n }\n\n return parseByTimeline(attributes, segmentTimeline);\n};\n/**\n * Generates a list of segments using information provided by the SegmentTemplate element\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {Object[]}\n * List of segment objects\n */\n\nvar mpd_parser_es_segmentsFromTemplate = function segmentsFromTemplate(attributes, segmentTimeline) {\n var templateValues = {\n RepresentationID: attributes.id,\n Bandwidth: attributes.bandwidth || 0\n };\n var _attributes$initializ = attributes.initialization,\n initialization = _attributes$initializ === void 0 ? {\n sourceURL: '',\n range: ''\n } : _attributes$initializ;\n var mapSegment = mpd_parser_es_urlTypeToSegment({\n baseUrl: attributes.baseUrl,\n source: constructTemplateUrl(initialization.sourceURL, templateValues),\n range: initialization.range\n });\n var segments = parseTemplateInfo(attributes, segmentTimeline);\n return segments.map(function (segment) {\n templateValues.Number = segment.number;\n templateValues.Time = segment.time;\n var uri = constructTemplateUrl(attributes.media || '', templateValues); // See DASH spec section 5.3.9.2.2\n // - if timescale isn't present on any level, default to 1.\n\n var timescale = attributes.timescale || 1; // - if presentationTimeOffset isn't present on any level, default to 0\n\n var presentationTimeOffset = attributes.presentationTimeOffset || 0;\n var presentationTime = // Even if the @t attribute is not specified for the segment, segment.time is\n // calculated in mpd-parser prior to this, so it's assumed to be available.\n attributes.periodStart + (segment.time - presentationTimeOffset) / timescale;\n var map = {\n uri: uri,\n timeline: segment.timeline,\n duration: segment.duration,\n resolvedUri: resolve_url(attributes.baseUrl || '', uri),\n map: mapSegment,\n number: segment.number,\n presentationTime: presentationTime\n };\n return map;\n });\n};\n\n/**\n * Converts a <SegmentUrl> (of type URLType from the DASH spec 5.3.9.2 Table 14)\n * to an object that matches the output of a segment in videojs/mpd-parser\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object} segmentUrl\n * <SegmentURL> node to translate into a segment object\n * @return {Object} translated segment object\n */\n\nvar SegmentURLToSegmentObject = function SegmentURLToSegmentObject(attributes, segmentUrl) {\n var baseUrl = attributes.baseUrl,\n _attributes$initializ = attributes.initialization,\n initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ;\n var initSegment = mpd_parser_es_urlTypeToSegment({\n baseUrl: baseUrl,\n source: initialization.sourceURL,\n range: initialization.range\n });\n var segment = mpd_parser_es_urlTypeToSegment({\n baseUrl: baseUrl,\n source: segmentUrl.media,\n range: segmentUrl.mediaRange\n });\n segment.map = initSegment;\n return segment;\n};\n/**\n * Generates a list of segments using information provided by the SegmentList element\n * SegmentList (DASH SPEC Section 5.3.9.3.2) contains a set of <SegmentURL> nodes. Each\n * node should be translated into segment.\n *\n * @param {Object} attributes\n * Object containing all inherited attributes from parent elements with attribute\n * names as keys\n * @param {Object[]|undefined} segmentTimeline\n * List of objects representing the attributes of each S element contained within\n * the SegmentTimeline element\n * @return {Object.<Array>} list of segments\n */\n\n\nvar segmentsFromList = function segmentsFromList(attributes, segmentTimeline) {\n var duration = attributes.duration,\n _attributes$segmentUr = attributes.segmentUrls,\n segmentUrls = _attributes$segmentUr === void 0 ? [] : _attributes$segmentUr,\n periodStart = attributes.periodStart; // Per spec (5.3.9.2.1) no way to determine segment duration OR\n // if both SegmentTimeline and @duration are defined, it is outside of spec.\n\n if (!duration && !segmentTimeline || duration && segmentTimeline) {\n throw new Error(mpd_parser_es_errors.SEGMENT_TIME_UNSPECIFIED);\n }\n\n var segmentUrlMap = segmentUrls.map(function (segmentUrlObject) {\n return SegmentURLToSegmentObject(attributes, segmentUrlObject);\n });\n var segmentTimeInfo;\n\n if (duration) {\n segmentTimeInfo = parseByDuration(attributes);\n }\n\n if (segmentTimeline) {\n segmentTimeInfo = parseByTimeline(attributes, segmentTimeline);\n }\n\n var segments = segmentTimeInfo.map(function (segmentTime, index) {\n if (segmentUrlMap[index]) {\n var segment = segmentUrlMap[index]; // See DASH spec section 5.3.9.2.2\n // - if timescale isn't present on any level, default to 1.\n\n var timescale = attributes.timescale || 1; // - if presentationTimeOffset isn't present on any level, default to 0\n\n var presentationTimeOffset = attributes.presentationTimeOffset || 0;\n segment.timeline = segmentTime.timeline;\n segment.duration = segmentTime.duration;\n segment.number = segmentTime.number;\n segment.presentationTime = periodStart + (segmentTime.time - presentationTimeOffset) / timescale;\n return segment;\n } // Since we're mapping we should get rid of any blank segments (in case\n // the given SegmentTimeline is handling for more elements than we have\n // SegmentURLs for).\n\n }).filter(function (segment) {\n return segment;\n });\n return segments;\n};\n\nvar generateSegments = function generateSegments(_ref) {\n var attributes = _ref.attributes,\n segmentInfo = _ref.segmentInfo;\n var segmentAttributes;\n var segmentsFn;\n\n if (segmentInfo.template) {\n segmentsFn = mpd_parser_es_segmentsFromTemplate;\n segmentAttributes = merge(attributes, segmentInfo.template);\n } else if (segmentInfo.base) {\n segmentsFn = segmentsFromBase;\n segmentAttributes = merge(attributes, segmentInfo.base);\n } else if (segmentInfo.list) {\n segmentsFn = segmentsFromList;\n segmentAttributes = merge(attributes, segmentInfo.list);\n }\n\n var segmentsInfo = {\n attributes: attributes\n };\n\n if (!segmentsFn) {\n return segmentsInfo;\n }\n\n var segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline); // The @duration attribute will be used to determin the playlist's targetDuration which\n // must be in seconds. Since we've generated the segment list, we no longer need\n // @duration to be in @timescale units, so we can convert it here.\n\n if (segmentAttributes.duration) {\n var _segmentAttributes = segmentAttributes,\n duration = _segmentAttributes.duration,\n _segmentAttributes$ti = _segmentAttributes.timescale,\n timescale = _segmentAttributes$ti === void 0 ? 1 : _segmentAttributes$ti;\n segmentAttributes.duration = duration / timescale;\n } else if (segments.length) {\n // if there is no @duration attribute, use the largest segment duration as\n // as target duration\n segmentAttributes.duration = segments.reduce(function (max, segment) {\n return Math.max(max, Math.ceil(segment.duration));\n }, 0);\n } else {\n segmentAttributes.duration = 0;\n }\n\n segmentsInfo.attributes = segmentAttributes;\n segmentsInfo.segments = segments; // This is a sidx box without actual segment information\n\n if (segmentInfo.base && segmentAttributes.indexRange) {\n segmentsInfo.sidx = segments[0];\n segmentsInfo.segments = [];\n }\n\n return segmentsInfo;\n};\nvar toPlaylists = function toPlaylists(representations) {\n return representations.map(generateSegments);\n};\n\nvar findChildren = function findChildren(element, name) {\n return from(element.childNodes).filter(function (_ref) {\n var tagName = _ref.tagName;\n return tagName === name;\n });\n};\nvar getContent = function getContent(element) {\n return element.textContent.trim();\n};\n\nvar parseDuration = function parseDuration(str) {\n var SECONDS_IN_YEAR = 365 * 24 * 60 * 60;\n var SECONDS_IN_MONTH = 30 * 24 * 60 * 60;\n var SECONDS_IN_DAY = 24 * 60 * 60;\n var SECONDS_IN_HOUR = 60 * 60;\n var SECONDS_IN_MIN = 60; // P10Y10M10DT10H10M10.1S\n\n var durationRegex = /P(?:(\\d*)Y)?(?:(\\d*)M)?(?:(\\d*)D)?(?:T(?:(\\d*)H)?(?:(\\d*)M)?(?:([\\d.]*)S)?)?/;\n var match = durationRegex.exec(str);\n\n if (!match) {\n return 0;\n }\n\n var _match$slice = match.slice(1),\n year = _match$slice[0],\n month = _match$slice[1],\n day = _match$slice[2],\n hour = _match$slice[3],\n minute = _match$slice[4],\n second = _match$slice[5];\n\n return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);\n};\nvar parseDate = function parseDate(str) {\n // Date format without timezone according to ISO 8601\n // YYY-MM-DDThh:mm:ss.ssssss\n var dateRegex = /^\\d+-\\d+-\\d+T\\d+:\\d+:\\d+(\\.\\d+)?$/; // If the date string does not specifiy a timezone, we must specifiy UTC. This is\n // expressed by ending with 'Z'\n\n if (dateRegex.test(str)) {\n str += 'Z';\n }\n\n return Date.parse(str);\n};\n\nvar parsers = {\n /**\n * Specifies the duration of the entire Media Presentation. Format is a duration string\n * as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n mediaPresentationDuration: function mediaPresentationDuration(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the Segment availability start time for all Segments referred to in this\n * MPD. For a dynamic manifest, it specifies the anchor for the earliest availability\n * time. Format is a date string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The date as seconds from unix epoch\n */\n availabilityStartTime: function availabilityStartTime(value) {\n return parseDate(value) / 1000;\n },\n\n /**\n * Specifies the smallest period between potential changes to the MPD. Format is a\n * duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n minimumUpdatePeriod: function minimumUpdatePeriod(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the suggested presentation delay. Format is a\n * duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n suggestedPresentationDelay: function suggestedPresentationDelay(value) {\n return parseDuration(value);\n },\n\n /**\n * specifices the type of mpd. Can be either \"static\" or \"dynamic\"\n *\n * @param {string} value\n * value of attribute as a string\n *\n * @return {string}\n * The type as a string\n */\n type: function type(value) {\n return value;\n },\n\n /**\n * Specifies the duration of the smallest time shifting buffer for any Representation\n * in the MPD. Format is a duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n timeShiftBufferDepth: function timeShiftBufferDepth(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the PeriodStart time of the Period relative to the availabilityStarttime.\n * Format is a duration string as specified in ISO 8601\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The duration in seconds\n */\n start: function start(value) {\n return parseDuration(value);\n },\n\n /**\n * Specifies the width of the visual presentation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed width\n */\n width: function width(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the height of the visual presentation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed height\n */\n height: function height(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the bitrate of the representation\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed bandwidth\n */\n bandwidth: function bandwidth(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the number of the first Media Segment in this Representation in the Period\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed number\n */\n startNumber: function startNumber(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the timescale in units per seconds\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed timescale\n */\n timescale: function timescale(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the presentationTimeOffset.\n *\n * @param {string} value\n * value of the attribute as a string\n *\n * @return {number}\n * The parsed presentationTimeOffset\n */\n presentationTimeOffset: function presentationTimeOffset(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the constant approximate Segment duration\n * NOTE: The <Period> element also contains an @duration attribute. This duration\n * specifies the duration of the Period. This attribute is currently not\n * supported by the rest of the parser, however we still check for it to prevent\n * errors.\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed duration\n */\n duration: function duration(value) {\n var parsedValue = parseInt(value, 10);\n\n if (isNaN(parsedValue)) {\n return parseDuration(value);\n }\n\n return parsedValue;\n },\n\n /**\n * Specifies the Segment duration, in units of the value of the @timescale.\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed duration\n */\n d: function d(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the MPD start time, in @timescale units, the first Segment in the series\n * starts relative to the beginning of the Period\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed time\n */\n t: function t(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Specifies the repeat count of the number of following contiguous Segments with the\n * same duration expressed by the value of @d\n *\n * @param {string} value\n * value of attribute as a string\n * @return {number}\n * The parsed number\n */\n r: function r(value) {\n return parseInt(value, 10);\n },\n\n /**\n * Default parser for all other attributes. Acts as a no-op and just returns the value\n * as a string\n *\n * @param {string} value\n * value of attribute as a string\n * @return {string}\n * Unparsed value\n */\n DEFAULT: function DEFAULT(value) {\n return value;\n }\n};\n/**\n * Gets all the attributes and values of the provided node, parses attributes with known\n * types, and returns an object with attribute names mapped to values.\n *\n * @param {Node} el\n * The node to parse attributes from\n * @return {Object}\n * Object with all attributes of el parsed\n */\n\nvar mpd_parser_es_parseAttributes = function parseAttributes(el) {\n if (!(el && el.attributes)) {\n return {};\n }\n\n return from(el.attributes).reduce(function (a, e) {\n var parseFn = parsers[e.name] || parsers.DEFAULT;\n a[e.name] = parseFn(e.value);\n return a;\n }, {});\n};\n\nvar keySystemsMap = {\n 'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',\n 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',\n 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',\n 'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime'\n};\n/**\n * Builds a list of urls that is the product of the reference urls and BaseURL values\n *\n * @param {string[]} referenceUrls\n * List of reference urls to resolve to\n * @param {Node[]} baseUrlElements\n * List of BaseURL nodes from the mpd\n * @return {string[]}\n * List of resolved urls\n */\n\nvar mpd_parser_es_buildBaseUrls = function buildBaseUrls(referenceUrls, baseUrlElements) {\n if (!baseUrlElements.length) {\n return referenceUrls;\n }\n\n return flatten(referenceUrls.map(function (reference) {\n return baseUrlElements.map(function (baseUrlElement) {\n return resolve_url(reference, getContent(baseUrlElement));\n });\n }));\n};\n/**\n * Contains all Segment information for its containing AdaptationSet\n *\n * @typedef {Object} SegmentInformation\n * @property {Object|undefined} template\n * Contains the attributes for the SegmentTemplate node\n * @property {Object[]|undefined} segmentTimeline\n * Contains a list of atrributes for each S node within the SegmentTimeline node\n * @property {Object|undefined} list\n * Contains the attributes for the SegmentList node\n * @property {Object|undefined} base\n * Contains the attributes for the SegmentBase node\n */\n\n/**\n * Returns all available Segment information contained within the AdaptationSet node\n *\n * @param {Node} adaptationSet\n * The AdaptationSet node to get Segment information from\n * @return {SegmentInformation}\n * The Segment information contained within the provided AdaptationSet\n */\n\nvar getSegmentInformation = function getSegmentInformation(adaptationSet) {\n var segmentTemplate = findChildren(adaptationSet, 'SegmentTemplate')[0];\n var segmentList = findChildren(adaptationSet, 'SegmentList')[0];\n var segmentUrls = segmentList && findChildren(segmentList, 'SegmentURL').map(function (s) {\n return merge({\n tag: 'SegmentURL'\n }, mpd_parser_es_parseAttributes(s));\n });\n var segmentBase = findChildren(adaptationSet, 'SegmentBase')[0];\n var segmentTimelineParentNode = segmentList || segmentTemplate;\n var segmentTimeline = segmentTimelineParentNode && findChildren(segmentTimelineParentNode, 'SegmentTimeline')[0];\n var segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;\n var segmentInitialization = segmentInitializationParentNode && findChildren(segmentInitializationParentNode, 'Initialization')[0]; // SegmentTemplate is handled slightly differently, since it can have both\n // @initialization and an <Initialization> node. @initialization can be templated,\n // while the node can have a url and range specified. If the <SegmentTemplate> has\n // both @initialization and an <Initialization> subelement we opt to override with\n // the node, as this interaction is not defined in the spec.\n\n var template = segmentTemplate && mpd_parser_es_parseAttributes(segmentTemplate);\n\n if (template && segmentInitialization) {\n template.initialization = segmentInitialization && mpd_parser_es_parseAttributes(segmentInitialization);\n } else if (template && template.initialization) {\n // If it is @initialization we convert it to an object since this is the format that\n // later functions will rely on for the initialization segment. This is only valid\n // for <SegmentTemplate>\n template.initialization = {\n sourceURL: template.initialization\n };\n }\n\n var segmentInfo = {\n template: template,\n segmentTimeline: segmentTimeline && findChildren(segmentTimeline, 'S').map(function (s) {\n return mpd_parser_es_parseAttributes(s);\n }),\n list: segmentList && merge(mpd_parser_es_parseAttributes(segmentList), {\n segmentUrls: segmentUrls,\n initialization: mpd_parser_es_parseAttributes(segmentInitialization)\n }),\n base: segmentBase && merge(mpd_parser_es_parseAttributes(segmentBase), {\n initialization: mpd_parser_es_parseAttributes(segmentInitialization)\n })\n };\n Object.keys(segmentInfo).forEach(function (key) {\n if (!segmentInfo[key]) {\n delete segmentInfo[key];\n }\n });\n return segmentInfo;\n};\n/**\n * Contains Segment information and attributes needed to construct a Playlist object\n * from a Representation\n *\n * @typedef {Object} RepresentationInformation\n * @property {SegmentInformation} segmentInfo\n * Segment information for this Representation\n * @property {Object} attributes\n * Inherited attributes for this Representation\n */\n\n/**\n * Maps a Representation node to an object containing Segment information and attributes\n *\n * @name inheritBaseUrlsCallback\n * @function\n * @param {Node} representation\n * Representation node from the mpd\n * @return {RepresentationInformation}\n * Representation information needed to construct a Playlist object\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Representation nodes to\n * Segment information and attributes using inherited BaseURL nodes.\n *\n * @param {Object} adaptationSetAttributes\n * Contains attributes inherited by the AdaptationSet\n * @param {string[]} adaptationSetBaseUrls\n * Contains list of resolved base urls inherited by the AdaptationSet\n * @param {SegmentInformation} adaptationSetSegmentInfo\n * Contains Segment information for the AdaptationSet\n * @return {inheritBaseUrlsCallback}\n * Callback map function\n */\n\nvar inheritBaseUrls = function inheritBaseUrls(adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) {\n return function (representation) {\n var repBaseUrlElements = findChildren(representation, 'BaseURL');\n var repBaseUrls = mpd_parser_es_buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements);\n var attributes = merge(adaptationSetAttributes, mpd_parser_es_parseAttributes(representation));\n var representationSegmentInfo = getSegmentInformation(representation);\n return repBaseUrls.map(function (baseUrl) {\n return {\n segmentInfo: merge(adaptationSetSegmentInfo, representationSegmentInfo),\n attributes: merge(attributes, {\n baseUrl: baseUrl\n })\n };\n });\n };\n};\n/**\n * Tranforms a series of content protection nodes to\n * an object containing pssh data by key system\n *\n * @param {Node[]} contentProtectionNodes\n * Content protection nodes\n * @return {Object}\n * Object containing pssh data by key system\n */\n\nvar mpd_parser_es_generateKeySystemInformation = function generateKeySystemInformation(contentProtectionNodes) {\n return contentProtectionNodes.reduce(function (acc, node) {\n var attributes = mpd_parser_es_parseAttributes(node);\n var keySystem = keySystemsMap[attributes.schemeIdUri];\n\n if (keySystem) {\n acc[keySystem] = {\n attributes: attributes\n };\n var psshNode = findChildren(node, 'cenc:pssh')[0];\n\n if (psshNode) {\n var pssh = getContent(psshNode);\n var psshBuffer = pssh && Object(decode_b64_to_uint8_array[\"a\" /* default */])(pssh);\n acc[keySystem].pssh = psshBuffer;\n }\n }\n\n return acc;\n }, {});\n}; // defined in ANSI_SCTE 214-1 2016\n\n\nvar parseCaptionServiceMetadata = function parseCaptionServiceMetadata(service) {\n // 608 captions\n if (service.schemeIdUri === 'urn:scte:dash:cc:cea-608:2015') {\n var values = service.value.split(';');\n return values.map(function (value) {\n var channel;\n var language; // default language to value\n\n language = value;\n\n if (/^CC\\d=/.test(value)) {\n var _value$split = value.split('=');\n\n channel = _value$split[0];\n language = _value$split[1];\n } else if (/^CC\\d$/.test(value)) {\n channel = value;\n }\n\n return {\n channel: channel,\n language: language\n };\n });\n } else if (service.schemeIdUri === 'urn:scte:dash:cc:cea-708:2015') {\n var _values = service.value.split(';');\n\n return _values.map(function (value) {\n var flags = {\n // service or channel number 1-63\n 'channel': undefined,\n // language is a 3ALPHA per ISO 639.2/B\n // field is required\n 'language': undefined,\n // BIT 1/0 or ?\n // default value is 1, meaning 16:9 aspect ratio, 0 is 4:3, ? is unknown\n 'aspectRatio': 1,\n // BIT 1/0\n // easy reader flag indicated the text is tailed to the needs of beginning readers\n // default 0, or off\n 'easyReader': 0,\n // BIT 1/0\n // If 3d metadata is present (CEA-708.1) then 1\n // default 0\n '3D': 0\n };\n\n if (/=/.test(value)) {\n var _value$split2 = value.split('='),\n channel = _value$split2[0],\n _value$split2$ = _value$split2[1],\n opts = _value$split2$ === void 0 ? '' : _value$split2$;\n\n flags.channel = channel;\n flags.language = value;\n opts.split(',').forEach(function (opt) {\n var _opt$split = opt.split(':'),\n name = _opt$split[0],\n val = _opt$split[1];\n\n if (name === 'lang') {\n flags.language = val; // er for easyReadery\n } else if (name === 'er') {\n flags.easyReader = Number(val); // war for wide aspect ratio\n } else if (name === 'war') {\n flags.aspectRatio = Number(val);\n } else if (name === '3D') {\n flags['3D'] = Number(val);\n }\n });\n } else {\n flags.language = value;\n }\n\n if (flags.channel) {\n flags.channel = 'SERVICE' + flags.channel;\n }\n\n return flags;\n });\n }\n};\n/**\n * Maps an AdaptationSet node to a list of Representation information objects\n *\n * @name toRepresentationsCallback\n * @function\n * @param {Node} adaptationSet\n * AdaptationSet node from the mpd\n * @return {RepresentationInformation[]}\n * List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping AdaptationSet nodes to a list of\n * Representation information objects\n *\n * @param {Object} periodAttributes\n * Contains attributes inherited by the Period\n * @param {string[]} periodBaseUrls\n * Contains list of resolved base urls inherited by the Period\n * @param {string[]} periodSegmentInfo\n * Contains Segment Information at the period level\n * @return {toRepresentationsCallback}\n * Callback map function\n */\n\nvar toRepresentations = function toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo) {\n return function (adaptationSet) {\n var adaptationSetAttributes = mpd_parser_es_parseAttributes(adaptationSet);\n var adaptationSetBaseUrls = mpd_parser_es_buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, 'BaseURL'));\n var role = findChildren(adaptationSet, 'Role')[0];\n var roleAttributes = {\n role: mpd_parser_es_parseAttributes(role)\n };\n var attrs = merge(periodAttributes, adaptationSetAttributes, roleAttributes);\n var accessibility = findChildren(adaptationSet, 'Accessibility')[0];\n var captionServices = parseCaptionServiceMetadata(mpd_parser_es_parseAttributes(accessibility));\n\n if (captionServices) {\n attrs = merge(attrs, {\n captionServices: captionServices\n });\n }\n\n var label = findChildren(adaptationSet, 'Label')[0];\n\n if (label && label.childNodes.length) {\n var labelVal = label.childNodes[0].nodeValue.trim();\n attrs = merge(attrs, {\n label: labelVal\n });\n }\n\n var contentProtection = mpd_parser_es_generateKeySystemInformation(findChildren(adaptationSet, 'ContentProtection'));\n\n if (Object.keys(contentProtection).length) {\n attrs = merge(attrs, {\n contentProtection: contentProtection\n });\n }\n\n var segmentInfo = getSegmentInformation(adaptationSet);\n var representations = findChildren(adaptationSet, 'Representation');\n var adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo);\n return flatten(representations.map(inheritBaseUrls(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));\n };\n};\n/**\n * Contains all period information for mapping nodes onto adaptation sets.\n *\n * @typedef {Object} PeriodInformation\n * @property {Node} period.node\n * Period node from the mpd\n * @property {Object} period.attributes\n * Parsed period attributes from node plus any added\n */\n\n/**\n * Maps a PeriodInformation object to a list of Representation information objects for all\n * AdaptationSet nodes contained within the Period.\n *\n * @name toAdaptationSetsCallback\n * @function\n * @param {PeriodInformation} period\n * Period object containing necessary period information\n * @param {number} periodIndex\n * Index of the Period within the mpd\n * @return {RepresentationInformation[]}\n * List of objects containing Representaion information\n */\n\n/**\n * Returns a callback for Array.prototype.map for mapping Period nodes to a list of\n * Representation information objects\n *\n * @param {Object} mpdAttributes\n * Contains attributes inherited by the mpd\n * @param {string[]} mpdBaseUrls\n * Contains list of resolved base urls inherited by the mpd\n * @return {toAdaptationSetsCallback}\n * Callback map function\n */\n\nvar mpd_parser_es_toAdaptationSets = function toAdaptationSets(mpdAttributes, mpdBaseUrls) {\n return function (period, index) {\n var periodBaseUrls = mpd_parser_es_buildBaseUrls(mpdBaseUrls, findChildren(period.node, 'BaseURL'));\n var parsedPeriodId = parseInt(period.attributes.id, 10); // fallback to mapping index if Period@id is not a number\n\n var periodIndex = window_default.a.isNaN(parsedPeriodId) ? index : parsedPeriodId;\n var periodAttributes = merge(mpdAttributes, {\n periodIndex: periodIndex,\n periodStart: period.attributes.start\n });\n\n if (typeof period.attributes.duration === 'number') {\n periodAttributes.periodDuration = period.attributes.duration;\n }\n\n var adaptationSets = findChildren(period.node, 'AdaptationSet');\n var periodSegmentInfo = getSegmentInformation(period.node);\n return flatten(adaptationSets.map(toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo)));\n };\n};\n/**\n * Gets Period@start property for a given period.\n *\n * @param {Object} options\n * Options object\n * @param {Object} options.attributes\n * Period attributes\n * @param {Object} [options.priorPeriodAttributes]\n * Prior period attributes (if prior period is available)\n * @param {string} options.mpdType\n * The MPD@type these periods came from\n * @return {number|null}\n * The period start, or null if it's an early available period or error\n */\n\nvar getPeriodStart = function getPeriodStart(_ref) {\n var attributes = _ref.attributes,\n priorPeriodAttributes = _ref.priorPeriodAttributes,\n mpdType = _ref.mpdType;\n\n // Summary of period start time calculation from DASH spec section 5.3.2.1\n //\n // A period's start is the first period's start + time elapsed after playing all\n // prior periods to this one. Periods continue one after the other in time (without\n // gaps) until the end of the presentation.\n //\n // The value of Period@start should be:\n // 1. if Period@start is present: value of Period@start\n // 2. if previous period exists and it has @duration: previous Period@start +\n // previous Period@duration\n // 3. if this is first period and MPD@type is 'static': 0\n // 4. in all other cases, consider the period an \"early available period\" (note: not\n // currently supported)\n // (1)\n if (typeof attributes.start === 'number') {\n return attributes.start;\n } // (2)\n\n\n if (priorPeriodAttributes && typeof priorPeriodAttributes.start === 'number' && typeof priorPeriodAttributes.duration === 'number') {\n return priorPeriodAttributes.start + priorPeriodAttributes.duration;\n } // (3)\n\n\n if (!priorPeriodAttributes && mpdType === 'static') {\n return 0;\n } // (4)\n // There is currently no logic for calculating the Period@start value if there is\n // no Period@start or prior Period@start and Period@duration available. This is not made\n // explicit by the DASH interop guidelines or the DASH spec, however, since there's\n // nothing about any other resolution strategies, it's implied. Thus, this case should\n // be considered an early available period, or error, and null should suffice for both\n // of those cases.\n\n\n return null;\n};\n/**\n * Traverses the mpd xml tree to generate a list of Representation information objects\n * that have inherited attributes from parent nodes\n *\n * @param {Node} mpd\n * The root node of the mpd\n * @param {Object} options\n * Available options for inheritAttributes\n * @param {string} options.manifestUri\n * The uri source of the mpd\n * @param {number} options.NOW\n * Current time per DASH IOP. Default is current time in ms since epoch\n * @param {number} options.clientOffset\n * Client time difference from NOW (in milliseconds)\n * @return {RepresentationInformation[]}\n * List of objects containing Representation information\n */\n\nvar inheritAttributes = function inheritAttributes(mpd, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$manifestUri = _options.manifestUri,\n manifestUri = _options$manifestUri === void 0 ? '' : _options$manifestUri,\n _options$NOW = _options.NOW,\n NOW = _options$NOW === void 0 ? Date.now() : _options$NOW,\n _options$clientOffset = _options.clientOffset,\n clientOffset = _options$clientOffset === void 0 ? 0 : _options$clientOffset;\n var periodNodes = findChildren(mpd, 'Period');\n\n if (!periodNodes.length) {\n throw new Error(mpd_parser_es_errors.INVALID_NUMBER_OF_PERIOD);\n }\n\n var locations = findChildren(mpd, 'Location');\n var mpdAttributes = mpd_parser_es_parseAttributes(mpd);\n var mpdBaseUrls = mpd_parser_es_buildBaseUrls([manifestUri], findChildren(mpd, 'BaseURL')); // See DASH spec section 5.3.1.2, Semantics of MPD element. Default type to 'static'.\n\n mpdAttributes.type = mpdAttributes.type || 'static';\n mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;\n mpdAttributes.NOW = NOW;\n mpdAttributes.clientOffset = clientOffset;\n\n if (locations.length) {\n mpdAttributes.locations = locations.map(getContent);\n }\n\n var periods = []; // Since toAdaptationSets acts on individual periods right now, the simplest approach to\n // adding properties that require looking at prior periods is to parse attributes and add\n // missing ones before toAdaptationSets is called. If more such properties are added, it\n // may be better to refactor toAdaptationSets.\n\n periodNodes.forEach(function (node, index) {\n var attributes = mpd_parser_es_parseAttributes(node); // Use the last modified prior period, as it may contain added information necessary\n // for this period.\n\n var priorPeriod = periods[index - 1];\n attributes.start = getPeriodStart({\n attributes: attributes,\n priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,\n mpdType: mpdAttributes.type\n });\n periods.push({\n node: node,\n attributes: attributes\n });\n });\n return {\n locations: mpdAttributes.locations,\n representationInfo: flatten(periods.map(mpd_parser_es_toAdaptationSets(mpdAttributes, mpdBaseUrls)))\n };\n};\n\nvar mpd_parser_es_stringToMpdXml = function stringToMpdXml(manifestString) {\n if (manifestString === '') {\n throw new Error(mpd_parser_es_errors.DASH_EMPTY_MANIFEST);\n }\n\n var parser = new xmldom_lib[\"DOMParser\"]();\n var xml;\n var mpd;\n\n try {\n xml = parser.parseFromString(manifestString, 'application/xml');\n mpd = xml && xml.documentElement.tagName === 'MPD' ? xml.documentElement : null;\n } catch (e) {// ie 11 throwsw on invalid xml\n }\n\n if (!mpd || mpd && mpd.getElementsByTagName('parsererror').length > 0) {\n throw new Error(mpd_parser_es_errors.DASH_INVALID_XML);\n }\n\n return mpd;\n};\n\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} mpd\n * XML string of the MPD manifest\n * @return {Object|null}\n * Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\nvar parseUTCTimingScheme = function parseUTCTimingScheme(mpd) {\n var UTCTimingNode = findChildren(mpd, 'UTCTiming')[0];\n\n if (!UTCTimingNode) {\n return null;\n }\n\n var attributes = mpd_parser_es_parseAttributes(UTCTimingNode);\n\n switch (attributes.schemeIdUri) {\n case 'urn:mpeg:dash:utc:http-head:2014':\n case 'urn:mpeg:dash:utc:http-head:2012':\n attributes.method = 'HEAD';\n break;\n\n case 'urn:mpeg:dash:utc:http-xsdate:2014':\n case 'urn:mpeg:dash:utc:http-iso:2014':\n case 'urn:mpeg:dash:utc:http-xsdate:2012':\n case 'urn:mpeg:dash:utc:http-iso:2012':\n attributes.method = 'GET';\n break;\n\n case 'urn:mpeg:dash:utc:direct:2014':\n case 'urn:mpeg:dash:utc:direct:2012':\n attributes.method = 'DIRECT';\n attributes.value = Date.parse(attributes.value);\n break;\n\n case 'urn:mpeg:dash:utc:http-ntp:2014':\n case 'urn:mpeg:dash:utc:ntp:2014':\n case 'urn:mpeg:dash:utc:sntp:2014':\n default:\n throw new Error(mpd_parser_es_errors.UNSUPPORTED_UTC_TIMING_SCHEME);\n }\n\n return attributes;\n};\n\nvar VERSION = mpd_parser_es_version;\n\nvar parse = function parse(manifestString, options) {\n if (options === void 0) {\n options = {};\n }\n\n var parsedManifestInfo = inheritAttributes(mpd_parser_es_stringToMpdXml(manifestString), options);\n var playlists = toPlaylists(parsedManifestInfo.representationInfo);\n return toM3u8(playlists, parsedManifestInfo.locations, options.sidxMapping);\n};\n/**\n * Parses the manifest for a UTCTiming node, returning the nodes attributes if found\n *\n * @param {string} manifestString\n * XML string of the MPD manifest\n * @return {Object|null}\n * Attributes of UTCTiming node specified in the manifest. Null if none found\n */\n\n\nvar parseUTCTiming = function parseUTCTiming(manifestString) {\n return parseUTCTimingScheme(mpd_parser_es_stringToMpdXml(manifestString));\n};\n\n\n\n// EXTERNAL MODULE: external \"mux.js/lib/tools/parse-sidx\"\nvar parse_sidx_ = __webpack_require__(70);\nvar parse_sidx_default = /*#__PURE__*/__webpack_require__.n(parse_sidx_);\n\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/byte-helpers.js\n // const log2 = Math.log2 ? Math.log2 : (x) => (Math.log(x) / Math.log(2));\n\nvar repeat = function repeat(str, len) {\n var acc = '';\n\n while (len--) {\n acc += str;\n }\n\n return acc;\n}; // count the number of bits it would take to represent a number\n// we used to do this with log2 but BigInt does not support builtin math\n// Math.ceil(log2(x));\n\n\nvar countBits = function countBits(x) {\n return x.toString(2).length;\n}; // count the number of whole bytes it would take to represent a number\n\nvar countBytes = function countBytes(x) {\n return Math.ceil(countBits(x) / 8);\n};\nvar padStart = function padStart(b, len, str) {\n if (str === void 0) {\n str = ' ';\n }\n\n return (repeat(str, len) + b.toString()).slice(-len);\n};\nvar isTypedArray = function isTypedArray(obj) {\n return ArrayBuffer.isView(obj);\n};\nvar toUint8 = function toUint8(bytes) {\n if (bytes instanceof Uint8Array) {\n return bytes;\n }\n\n if (!Array.isArray(bytes) && !isTypedArray(bytes) && !(bytes instanceof ArrayBuffer)) {\n // any non-number or NaN leads to empty uint8array\n // eslint-disable-next-line\n if (typeof bytes !== 'number' || typeof bytes === 'number' && bytes !== bytes) {\n bytes = 0;\n } else {\n bytes = [bytes];\n }\n }\n\n return new Uint8Array(bytes && bytes.buffer || bytes, bytes && bytes.byteOffset || 0, bytes && bytes.byteLength || 0);\n};\nvar toHexString = function toHexString(bytes) {\n bytes = toUint8(bytes);\n var str = '';\n\n for (var i = 0; i < bytes.length; i++) {\n str += padStart(bytes[i].toString(16), 2, '0');\n }\n\n return str;\n};\nvar toBinaryString = function toBinaryString(bytes) {\n bytes = toUint8(bytes);\n var str = '';\n\n for (var i = 0; i < bytes.length; i++) {\n str += padStart(bytes[i].toString(2), 8, '0');\n }\n\n return str;\n};\nvar BigInt = window_default.a.BigInt || Number;\nvar BYTE_TABLE = [BigInt('0x1'), BigInt('0x100'), BigInt('0x10000'), BigInt('0x1000000'), BigInt('0x100000000'), BigInt('0x10000000000'), BigInt('0x1000000000000'), BigInt('0x100000000000000'), BigInt('0x10000000000000000')];\nvar ENDIANNESS = function () {\n var a = new Uint16Array([0xFFCC]);\n var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);\n\n if (b[0] === 0xFF) {\n return 'big';\n }\n\n if (b[0] === 0xCC) {\n return 'little';\n }\n\n return 'unknown';\n}();\nvar IS_BIG_ENDIAN = ENDIANNESS === 'big';\nvar IS_LITTLE_ENDIAN = ENDIANNESS === 'little';\nvar bytesToNumber = function bytesToNumber(bytes, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$signed = _ref.signed,\n signed = _ref$signed === void 0 ? false : _ref$signed,\n _ref$le = _ref.le,\n le = _ref$le === void 0 ? false : _ref$le;\n\n bytes = toUint8(bytes);\n var fn = le ? 'reduce' : 'reduceRight';\n var obj = bytes[fn] ? bytes[fn] : Array.prototype[fn];\n var number = obj.call(bytes, function (total, byte, i) {\n var exponent = le ? i : Math.abs(i + 1 - bytes.length);\n return total + BigInt(byte) * BYTE_TABLE[exponent];\n }, BigInt(0));\n\n if (signed) {\n var max = BYTE_TABLE[bytes.length] / BigInt(2) - BigInt(1);\n number = BigInt(number);\n\n if (number > max) {\n number -= max;\n number -= max;\n number -= BigInt(2);\n }\n }\n\n return Number(number);\n};\nvar numberToBytes = function numberToBytes(number, _temp2) {\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n _ref2$le = _ref2.le,\n le = _ref2$le === void 0 ? false : _ref2$le;\n\n // eslint-disable-next-line\n if (typeof number !== 'bigint' && typeof number !== 'number' || typeof number === 'number' && number !== number) {\n number = 0;\n }\n\n number = BigInt(number);\n var byteCount = countBytes(number);\n var bytes = new Uint8Array(new ArrayBuffer(byteCount));\n\n for (var i = 0; i < byteCount; i++) {\n var byteIndex = le ? i : Math.abs(i + 1 - bytes.length);\n bytes[byteIndex] = Number(number / BYTE_TABLE[i] & BigInt(0xFF));\n\n if (number < 0) {\n bytes[byteIndex] = Math.abs(~bytes[byteIndex]);\n bytes[byteIndex] -= i === 0 ? 1 : 2;\n }\n }\n\n return bytes;\n};\nvar bytesToString = function bytesToString(bytes) {\n if (!bytes) {\n return '';\n } // TODO: should toUint8 handle cases where we only have 8 bytes\n // but report more since this is a Uint16+ Array?\n\n\n bytes = Array.prototype.slice.call(bytes);\n var string = String.fromCharCode.apply(null, toUint8(bytes));\n\n try {\n return decodeURIComponent(escape(string));\n } catch (e) {// if decodeURIComponent/escape fails, we are dealing with partial\n // or full non string data. Just return the potentially garbled string.\n }\n\n return string;\n};\nvar stringToBytes = function stringToBytes(string, stringIsBytes) {\n if (typeof string !== 'string' && string && typeof string.toString === 'function') {\n string = string.toString();\n }\n\n if (typeof string !== 'string') {\n return new Uint8Array();\n } // If the string already is bytes, we don't have to do this\n // otherwise we do this so that we split multi length characters\n // into individual bytes\n\n\n if (!stringIsBytes) {\n string = unescape(encodeURIComponent(string));\n }\n\n var view = new Uint8Array(string.length);\n\n for (var i = 0; i < string.length; i++) {\n view[i] = string.charCodeAt(i);\n }\n\n return view;\n};\nvar concatTypedArrays = function concatTypedArrays() {\n for (var _len = arguments.length, buffers = new Array(_len), _key = 0; _key < _len; _key++) {\n buffers[_key] = arguments[_key];\n }\n\n buffers = buffers.filter(function (b) {\n return b && (b.byteLength || b.length) && typeof b !== 'string';\n });\n\n if (buffers.length <= 1) {\n // for 0 length we will return empty uint8\n // for 1 length we return the first uint8\n return toUint8(buffers[0]);\n }\n\n var totalLen = buffers.reduce(function (total, buf, i) {\n return total + (buf.byteLength || buf.length);\n }, 0);\n var tempBuffer = new Uint8Array(totalLen);\n var offset = 0;\n buffers.forEach(function (buf) {\n buf = toUint8(buf);\n tempBuffer.set(buf, offset);\n offset += buf.byteLength;\n });\n return tempBuffer;\n};\n/**\n * Check if the bytes \"b\" are contained within bytes \"a\".\n *\n * @param {Uint8Array|Array} a\n * Bytes to check in\n *\n * @param {Uint8Array|Array} b\n * Bytes to check for\n *\n * @param {Object} options\n * options\n *\n * @param {Array|Uint8Array} [offset=0]\n * offset to use when looking at bytes in a\n *\n * @param {Array|Uint8Array} [mask=[]]\n * mask to use on bytes before comparison.\n *\n * @return {boolean}\n * If all bytes in b are inside of a, taking into account\n * bit masks.\n */\n\nvar bytesMatch = function bytesMatch(a, b, _temp3) {\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n _ref3$offset = _ref3.offset,\n offset = _ref3$offset === void 0 ? 0 : _ref3$offset,\n _ref3$mask = _ref3.mask,\n mask = _ref3$mask === void 0 ? [] : _ref3$mask;\n\n a = toUint8(a);\n b = toUint8(b); // ie 11 does not support uint8 every\n\n var fn = b.every ? b.every : Array.prototype.every;\n return b.length && a.length - offset >= b.length && // ie 11 doesn't support every on uin8\n fn.call(b, function (bByte, i) {\n var aByte = mask[i] ? mask[i] & a[offset + i] : a[offset + i];\n return bByte === aByte;\n });\n};\nvar sliceBytes = function sliceBytes(src, start, end) {\n if (Uint8Array.prototype.slice) {\n return Uint8Array.prototype.slice.call(src, start, end);\n }\n\n return new Uint8Array(Array.prototype.slice.call(src, start, end));\n};\nvar reverseBytes = function reverseBytes(src) {\n if (src.reverse) {\n return src.reverse();\n }\n\n return Array.prototype.reverse.call(src);\n};\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/id3-helpers.js\n\nvar ID3 = toUint8([0x49, 0x44, 0x33]);\nvar id3_helpers_getId3Size = function getId3Size(bytes, offset) {\n if (offset === void 0) {\n offset = 0;\n }\n\n bytes = toUint8(bytes);\n var flags = bytes[offset + 5];\n var returnSize = bytes[offset + 6] << 21 | bytes[offset + 7] << 14 | bytes[offset + 8] << 7 | bytes[offset + 9];\n var footerPresent = (flags & 16) >> 4;\n\n if (footerPresent) {\n return returnSize + 20;\n }\n\n return returnSize + 10;\n};\nvar id3_helpers_getId3Offset = function getId3Offset(bytes, offset) {\n if (offset === void 0) {\n offset = 0;\n }\n\n bytes = toUint8(bytes);\n\n if (bytes.length - offset < 10 || !bytesMatch(bytes, ID3, {\n offset: offset\n })) {\n return offset;\n }\n\n offset += id3_helpers_getId3Size(bytes, offset); // recursive check for id3 tags as some files\n // have multiple ID3 tag sections even though\n // they should not.\n\n return getId3Offset(bytes, offset);\n};\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/codec-helpers.js\n // https://aomediacodec.github.io/av1-isobmff/#av1codecconfigurationbox-syntax\n// https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter#AV1\n\nvar codec_helpers_getAv1Codec = function getAv1Codec(bytes) {\n var codec = '';\n var profile = bytes[1] >>> 3;\n var level = bytes[1] & 0x1F;\n var tier = bytes[2] >>> 7;\n var highBitDepth = (bytes[2] & 0x40) >> 6;\n var twelveBit = (bytes[2] & 0x20) >> 5;\n var monochrome = (bytes[2] & 0x10) >> 4;\n var chromaSubsamplingX = (bytes[2] & 0x08) >> 3;\n var chromaSubsamplingY = (bytes[2] & 0x04) >> 2;\n var chromaSamplePosition = bytes[2] & 0x03;\n codec += profile + \".\" + padStart(level, 2, '0');\n\n if (tier === 0) {\n codec += 'M';\n } else if (tier === 1) {\n codec += 'H';\n }\n\n var bitDepth;\n\n if (profile === 2 && highBitDepth) {\n bitDepth = twelveBit ? 12 : 10;\n } else {\n bitDepth = highBitDepth ? 10 : 8;\n }\n\n codec += \".\" + padStart(bitDepth, 2, '0'); // TODO: can we parse color range??\n\n codec += \".\" + monochrome;\n codec += \".\" + chromaSubsamplingX + chromaSubsamplingY + chromaSamplePosition;\n return codec;\n};\nvar codec_helpers_getAvcCodec = function getAvcCodec(bytes) {\n var profileId = toHexString(bytes[1]);\n var constraintFlags = toHexString(bytes[2] & 0xFC);\n var levelId = toHexString(bytes[3]);\n return \"\" + profileId + constraintFlags + levelId;\n};\nvar codec_helpers_getHvcCodec = function getHvcCodec(bytes) {\n var codec = '';\n var profileSpace = bytes[1] >> 6;\n var profileId = bytes[1] & 0x1F;\n var tierFlag = (bytes[1] & 0x20) >> 5;\n var profileCompat = bytes.subarray(2, 6);\n var constraintIds = bytes.subarray(6, 12);\n var levelId = bytes[12];\n\n if (profileSpace === 1) {\n codec += 'A';\n } else if (profileSpace === 2) {\n codec += 'B';\n } else if (profileSpace === 3) {\n codec += 'C';\n }\n\n codec += profileId + \".\"; // ffmpeg does this in big endian\n\n var profileCompatVal = parseInt(toBinaryString(profileCompat).split('').reverse().join(''), 2); // apple does this in little endian...\n\n if (profileCompatVal > 255) {\n profileCompatVal = parseInt(toBinaryString(profileCompat), 2);\n }\n\n codec += profileCompatVal.toString(16) + \".\";\n\n if (tierFlag === 0) {\n codec += 'L';\n } else {\n codec += 'H';\n }\n\n codec += levelId;\n var constraints = '';\n\n for (var i = 0; i < constraintIds.length; i++) {\n var v = constraintIds[i];\n\n if (v) {\n if (constraints) {\n constraints += '.';\n }\n\n constraints += v.toString(16);\n }\n }\n\n if (constraints) {\n codec += \".\" + constraints;\n }\n\n return codec;\n};\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/opus-helpers.js\nvar OPUS_HEAD = new Uint8Array([// O, p, u, s\n0x4f, 0x70, 0x75, 0x73, // H, e, a, d\n0x48, 0x65, 0x61, 0x64]); // https://wiki.xiph.org/OggOpus\n// https://vfrmaniac.fushizen.eu/contents/opus_in_isobmff.html\n// https://opus-codec.org/docs/opusfile_api-0.7/structOpusHead.html\n\nvar parseOpusHead = function parseOpusHead(bytes) {\n var view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n var version = view.getUint8(0); // version 0, from mp4, does not use littleEndian.\n\n var littleEndian = version !== 0;\n var config = {\n version: version,\n channels: view.getUint8(1),\n preSkip: view.getUint16(2, littleEndian),\n sampleRate: view.getUint32(4, littleEndian),\n outputGain: view.getUint16(8, littleEndian),\n channelMappingFamily: view.getUint8(10)\n };\n\n if (config.channelMappingFamily > 0 && bytes.length > 10) {\n config.streamCount = view.getUint8(11);\n config.twoChannelStreamCount = view.getUint8(12);\n config.channelMapping = [];\n\n for (var c = 0; c < config.channels; c++) {\n config.channelMapping.push(view.getUint8(13 + c));\n }\n }\n\n return config;\n};\nvar setOpusHead = function setOpusHead(config) {\n var size = config.channelMappingFamily <= 0 ? 11 : 12 + config.channels;\n var view = new DataView(new ArrayBuffer(size));\n var littleEndian = config.version !== 0;\n view.setUint8(0, config.version);\n view.setUint8(1, config.channels);\n view.setUint16(2, config.preSkip, littleEndian);\n view.setUint32(4, config.sampleRate, littleEndian);\n view.setUint16(8, config.outputGain, littleEndian);\n view.setUint8(10, config.channelMappingFamily);\n\n if (config.channelMappingFamily > 0) {\n view.setUint8(11, config.streamCount);\n config.channelMapping.foreach(function (cm, i) {\n view.setUint8(12 + i, cm);\n });\n }\n\n return new Uint8Array(view.buffer);\n};\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/mp4-helpers.js\n\n\n\n\nvar mp4_helpers_normalizePath = function normalizePath(path) {\n if (typeof path === 'string') {\n return stringToBytes(path);\n }\n\n if (typeof path === 'number') {\n return path;\n }\n\n return path;\n};\n\nvar normalizePaths = function normalizePaths(paths) {\n if (!Array.isArray(paths)) {\n return [mp4_helpers_normalizePath(paths)];\n }\n\n return paths.map(function (p) {\n return mp4_helpers_normalizePath(p);\n });\n};\n\nvar DESCRIPTORS;\nvar mp4_helpers_parseDescriptors = function parseDescriptors(bytes) {\n bytes = toUint8(bytes);\n var results = [];\n var i = 0;\n\n while (bytes.length > i) {\n var tag = bytes[i];\n var size = 0;\n var headerSize = 0; // tag\n\n headerSize++;\n var byte = bytes[headerSize]; // first byte\n\n headerSize++;\n\n while (byte & 0x80) {\n size = (byte & 0x7F) << 7;\n byte = bytes[headerSize];\n headerSize++;\n }\n\n size += byte & 0x7F;\n\n for (var z = 0; z < DESCRIPTORS.length; z++) {\n var _DESCRIPTORS$z = DESCRIPTORS[z],\n id = _DESCRIPTORS$z.id,\n parser = _DESCRIPTORS$z.parser;\n\n if (tag === id) {\n results.push(parser(bytes.subarray(headerSize, headerSize + size)));\n break;\n }\n }\n\n i += size + headerSize;\n }\n\n return results;\n};\nDESCRIPTORS = [{\n id: 0x03,\n parser: function parser(bytes) {\n var desc = {\n tag: 0x03,\n id: bytes[0] << 8 | bytes[1],\n flags: bytes[2],\n size: 3,\n dependsOnEsId: 0,\n ocrEsId: 0,\n descriptors: [],\n url: ''\n }; // depends on es id\n\n if (desc.flags & 0x80) {\n desc.dependsOnEsId = bytes[desc.size] << 8 | bytes[desc.size + 1];\n desc.size += 2;\n } // url\n\n\n if (desc.flags & 0x40) {\n var len = bytes[desc.size];\n desc.url = bytesToString(bytes.subarray(desc.size + 1, desc.size + 1 + len));\n desc.size += len;\n } // ocr es id\n\n\n if (desc.flags & 0x20) {\n desc.ocrEsId = bytes[desc.size] << 8 | bytes[desc.size + 1];\n desc.size += 2;\n }\n\n desc.descriptors = mp4_helpers_parseDescriptors(bytes.subarray(desc.size)) || [];\n return desc;\n }\n}, {\n id: 0x04,\n parser: function parser(bytes) {\n // DecoderConfigDescriptor\n var desc = {\n tag: 0x04,\n oti: bytes[0],\n streamType: bytes[1],\n bufferSize: bytes[2] << 16 | bytes[3] << 8 | bytes[4],\n maxBitrate: bytes[5] << 24 | bytes[6] << 16 | bytes[7] << 8 | bytes[8],\n avgBitrate: bytes[9] << 24 | bytes[10] << 16 | bytes[11] << 8 | bytes[12],\n descriptors: mp4_helpers_parseDescriptors(bytes.subarray(13))\n };\n return desc;\n }\n}, {\n id: 0x05,\n parser: function parser(bytes) {\n // DecoderSpecificInfo\n return {\n tag: 0x05,\n bytes: bytes\n };\n }\n}, {\n id: 0x06,\n parser: function parser(bytes) {\n // SLConfigDescriptor\n return {\n tag: 0x06,\n bytes: bytes\n };\n }\n}];\n/**\n * find any number of boxes by name given a path to it in an iso bmff\n * such as mp4.\n *\n * @param {TypedArray} bytes\n * bytes for the iso bmff to search for boxes in\n *\n * @param {Uint8Array[]|string[]|string|Uint8Array} name\n * An array of paths or a single path representing the name\n * of boxes to search through in bytes. Paths may be\n * uint8 (character codes) or strings.\n *\n * @param {boolean} [complete=false]\n * Should we search only for complete boxes on the final path.\n * This is very useful when you do not want to get back partial boxes\n * in the case of streaming files.\n *\n * @return {Uint8Array[]}\n * An array of the end paths that we found.\n */\n\nvar mp4_helpers_findBox = function findBox(bytes, paths, complete) {\n if (complete === void 0) {\n complete = false;\n }\n\n paths = normalizePaths(paths);\n bytes = toUint8(bytes);\n var results = [];\n\n if (!paths.length) {\n // short-circuit the search for empty paths\n return results;\n }\n\n var i = 0;\n\n while (i < bytes.length) {\n var size = (bytes[i] << 24 | bytes[i + 1] << 16 | bytes[i + 2] << 8 | bytes[i + 3]) >>> 0;\n var type = bytes.subarray(i + 4, i + 8); // invalid box format.\n\n if (size === 0) {\n break;\n }\n\n var end = i + size;\n\n if (end > bytes.length) {\n // this box is bigger than the number of bytes we have\n // and complete is set, we cannot find any more boxes.\n if (complete) {\n break;\n }\n\n end = bytes.length;\n }\n\n var data = bytes.subarray(i + 8, end);\n\n if (bytesMatch(type, paths[0])) {\n if (paths.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data);\n } else {\n // recursively search for the next box along the path\n results.push.apply(results, findBox(data, paths.slice(1), complete));\n }\n }\n\n i = end;\n } // we've finished searching all of bytes\n\n\n return results;\n};\n/**\n * Search for a single matching box by name in an iso bmff format like\n * mp4. This function is useful for finding codec boxes which\n * can be placed arbitrarily in sample descriptions depending\n * on the version of the file or file type.\n *\n * @param {TypedArray} bytes\n * bytes for the iso bmff to search for boxes in\n *\n * @param {string|Uint8Array} name\n * The name of the box to find.\n *\n * @return {Uint8Array[]}\n * a subarray of bytes representing the name boxed we found.\n */\n\nvar mp4_helpers_findNamedBox = function findNamedBox(bytes, name) {\n name = mp4_helpers_normalizePath(name);\n\n if (!name.length) {\n // short-circuit the search for empty paths\n return bytes.subarray(bytes.length);\n }\n\n var i = 0;\n\n while (i < bytes.length) {\n if (bytesMatch(bytes.subarray(i, i + name.length), name)) {\n var size = (bytes[i - 4] << 24 | bytes[i - 3] << 16 | bytes[i - 2] << 8 | bytes[i - 1]) >>> 0;\n var end = size > 1 ? i + size : bytes.byteLength;\n return bytes.subarray(i + 4, end);\n }\n\n i++;\n } // we've finished searching all of bytes\n\n\n return bytes.subarray(bytes.length);\n};\n\nvar mp4_helpers_parseSamples = function parseSamples(data, entrySize, parseEntry) {\n if (entrySize === void 0) {\n entrySize = 4;\n }\n\n if (parseEntry === void 0) {\n parseEntry = function parseEntry(d) {\n return bytesToNumber(d);\n };\n }\n\n var entries = [];\n\n if (!data || !data.length) {\n return entries;\n }\n\n var entryCount = bytesToNumber(data.subarray(4, 8));\n\n for (var i = 8; entryCount; i += entrySize, entryCount--) {\n entries.push(parseEntry(data.subarray(i, i + entrySize)));\n }\n\n return entries;\n};\n\nvar mp4_helpers_buildFrameTable = function buildFrameTable(stbl, timescale) {\n var keySamples = mp4_helpers_parseSamples(mp4_helpers_findBox(stbl, ['stss'])[0]);\n var chunkOffsets = mp4_helpers_parseSamples(mp4_helpers_findBox(stbl, ['stco'])[0]);\n var timeToSamples = mp4_helpers_parseSamples(mp4_helpers_findBox(stbl, ['stts'])[0], 8, function (entry) {\n return {\n sampleCount: bytesToNumber(entry.subarray(0, 4)),\n sampleDelta: bytesToNumber(entry.subarray(4, 8))\n };\n });\n var samplesToChunks = mp4_helpers_parseSamples(mp4_helpers_findBox(stbl, ['stsc'])[0], 12, function (entry) {\n return {\n firstChunk: bytesToNumber(entry.subarray(0, 4)),\n samplesPerChunk: bytesToNumber(entry.subarray(4, 8)),\n sampleDescriptionIndex: bytesToNumber(entry.subarray(8, 12))\n };\n });\n var stsz = mp4_helpers_findBox(stbl, ['stsz'])[0]; // stsz starts with a 4 byte sampleSize which we don't need\n\n var sampleSizes = mp4_helpers_parseSamples(stsz && stsz.length && stsz.subarray(4) || null);\n var frames = [];\n\n for (var chunkIndex = 0; chunkIndex < chunkOffsets.length; chunkIndex++) {\n var samplesInChunk = void 0;\n\n for (var i = 0; i < samplesToChunks.length; i++) {\n var sampleToChunk = samplesToChunks[i];\n var isThisOne = chunkIndex + 1 >= sampleToChunk.firstChunk && (i + 1 >= samplesToChunks.length || chunkIndex + 1 < samplesToChunks[i + 1].firstChunk);\n\n if (isThisOne) {\n samplesInChunk = sampleToChunk.samplesPerChunk;\n break;\n }\n }\n\n var chunkOffset = chunkOffsets[chunkIndex];\n\n for (var _i = 0; _i < samplesInChunk; _i++) {\n var frameEnd = sampleSizes[frames.length]; // if we don't have key samples every frame is a keyframe\n\n var keyframe = !keySamples.length;\n\n if (keySamples.length && keySamples.indexOf(frames.length + 1) !== -1) {\n keyframe = true;\n }\n\n var frame = {\n keyframe: keyframe,\n start: chunkOffset,\n end: chunkOffset + frameEnd\n };\n\n for (var k = 0; k < timeToSamples.length; k++) {\n var _timeToSamples$k = timeToSamples[k],\n sampleCount = _timeToSamples$k.sampleCount,\n sampleDelta = _timeToSamples$k.sampleDelta;\n\n if (frames.length <= sampleCount) {\n // ms to ns\n var lastTimestamp = frames.length ? frames[frames.length - 1].timestamp : 0;\n frame.timestamp = lastTimestamp + sampleDelta / timescale * 1000;\n frame.duration = sampleDelta;\n break;\n }\n }\n\n frames.push(frame);\n chunkOffset += frameEnd;\n }\n }\n\n return frames;\n};\nvar mp4_helpers_addSampleDescription = function addSampleDescription(track, bytes) {\n var codec = bytesToString(bytes.subarray(0, 4));\n\n if (track.type === 'video') {\n track.info = track.info || {};\n track.info.width = bytes[28] << 8 | bytes[29];\n track.info.height = bytes[30] << 8 | bytes[31];\n } else if (track.type === 'audio') {\n track.info = track.info || {};\n track.info.channels = bytes[20] << 8 | bytes[21];\n track.info.bitDepth = bytes[22] << 8 | bytes[23];\n track.info.sampleRate = bytes[28] << 8 | bytes[29];\n }\n\n if (codec === 'avc1') {\n var avcC = mp4_helpers_findNamedBox(bytes, 'avcC'); // AVCDecoderConfigurationRecord\n\n codec += \".\" + codec_helpers_getAvcCodec(avcC);\n track.info.avcC = avcC; // TODO: do we need to parse all this?\n\n /* {\n configurationVersion: avcC[0],\n profile: avcC[1],\n profileCompatibility: avcC[2],\n level: avcC[3],\n lengthSizeMinusOne: avcC[4] & 0x3\n };\n let spsNalUnitCount = avcC[5] & 0x1F;\n const spsNalUnits = track.info.avc.spsNalUnits = [];\n // past spsNalUnitCount\n let offset = 6;\n while (spsNalUnitCount--) {\n const nalLen = avcC[offset] << 8 | avcC[offset + 1];\n spsNalUnits.push(avcC.subarray(offset + 2, offset + 2 + nalLen));\n offset += nalLen + 2;\n }\n let ppsNalUnitCount = avcC[offset];\n const ppsNalUnits = track.info.avc.ppsNalUnits = [];\n // past ppsNalUnitCount\n offset += 1;\n while (ppsNalUnitCount--) {\n const nalLen = avcC[offset] << 8 | avcC[offset + 1];\n ppsNalUnits.push(avcC.subarray(offset + 2, offset + 2 + nalLen));\n offset += nalLen + 2;\n }*/\n // HEVCDecoderConfigurationRecord\n } else if (codec === 'hvc1' || codec === 'hev1') {\n codec += \".\" + codec_helpers_getHvcCodec(mp4_helpers_findNamedBox(bytes, 'hvcC'));\n } else if (codec === 'mp4a' || codec === 'mp4v') {\n var esds = mp4_helpers_findNamedBox(bytes, 'esds');\n var esDescriptor = mp4_helpers_parseDescriptors(esds.subarray(4))[0];\n var decoderConfig = esDescriptor && esDescriptor.descriptors.filter(function (_ref) {\n var tag = _ref.tag;\n return tag === 0x04;\n })[0];\n\n if (decoderConfig) {\n // most codecs do not have a further '.'\n // such as 0xa5 for ac-3 and 0xa6 for e-ac-3\n codec += '.' + toHexString(decoderConfig.oti);\n\n if (decoderConfig.oti === 0x40) {\n codec += '.' + (decoderConfig.descriptors[0].bytes[0] >> 3).toString();\n } else if (decoderConfig.oti === 0x20) {\n codec += '.' + decoderConfig.descriptors[0].bytes[4].toString();\n } else if (decoderConfig.oti === 0xdd) {\n codec = 'vorbis';\n }\n } else if (track.type === 'audio') {\n codec += '.40.2';\n } else {\n codec += '.20.9';\n }\n } else if (codec === 'av01') {\n // AV1DecoderConfigurationRecord\n codec += \".\" + codec_helpers_getAv1Codec(mp4_helpers_findNamedBox(bytes, 'av1C'));\n } else if (codec === 'vp09') {\n // VPCodecConfigurationRecord\n var vpcC = mp4_helpers_findNamedBox(bytes, 'vpcC'); // https://www.webmproject.org/vp9/mp4/\n\n var profile = vpcC[0];\n var level = vpcC[1];\n var bitDepth = vpcC[2] >> 4;\n var chromaSubsampling = (vpcC[2] & 0x0F) >> 1;\n var videoFullRangeFlag = (vpcC[2] & 0x0F) >> 3;\n var colourPrimaries = vpcC[3];\n var transferCharacteristics = vpcC[4];\n var matrixCoefficients = vpcC[5];\n codec += \".\" + padStart(profile, 2, '0');\n codec += \".\" + padStart(level, 2, '0');\n codec += \".\" + padStart(bitDepth, 2, '0');\n codec += \".\" + padStart(chromaSubsampling, 2, '0');\n codec += \".\" + padStart(colourPrimaries, 2, '0');\n codec += \".\" + padStart(transferCharacteristics, 2, '0');\n codec += \".\" + padStart(matrixCoefficients, 2, '0');\n codec += \".\" + padStart(videoFullRangeFlag, 2, '0');\n } else if (codec === 'theo') {\n codec = 'theora';\n } else if (codec === 'spex') {\n codec = 'speex';\n } else if (codec === '.mp3') {\n codec = 'mp4a.40.34';\n } else if (codec === 'msVo') {\n codec = 'vorbis';\n } else if (codec === 'Opus') {\n codec = 'opus';\n var dOps = mp4_helpers_findNamedBox(bytes, 'dOps');\n track.info.opus = parseOpusHead(dOps); // TODO: should this go into the webm code??\n // Firefox requires a codecDelay for opus playback\n // see https://bugzilla.mozilla.org/show_bug.cgi?id=1276238\n\n track.info.codecDelay = 6500000;\n } else {\n codec = codec.toLowerCase();\n }\n /* eslint-enable */\n // flac, ac-3, ec-3, opus\n\n\n track.codec = codec;\n};\nvar mp4_helpers_parseTracks = function parseTracks(bytes, frameTable) {\n if (frameTable === void 0) {\n frameTable = true;\n }\n\n bytes = toUint8(bytes);\n var traks = mp4_helpers_findBox(bytes, ['moov', 'trak'], true);\n var tracks = [];\n traks.forEach(function (trak) {\n var track = {\n bytes: trak\n };\n var mdia = mp4_helpers_findBox(trak, ['mdia'])[0];\n var hdlr = mp4_helpers_findBox(mdia, ['hdlr'])[0];\n var trakType = bytesToString(hdlr.subarray(8, 12));\n\n if (trakType === 'soun') {\n track.type = 'audio';\n } else if (trakType === 'vide') {\n track.type = 'video';\n } else {\n track.type = trakType;\n }\n\n var tkhd = mp4_helpers_findBox(trak, ['tkhd'])[0];\n\n if (tkhd) {\n var view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n var tkhdVersion = view.getUint8(0);\n track.number = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);\n }\n\n var mdhd = mp4_helpers_findBox(mdia, ['mdhd'])[0];\n\n if (mdhd) {\n // mdhd is a FullBox, meaning it will have its own version as the first byte\n var version = mdhd[0];\n var index = version === 0 ? 12 : 20;\n track.timescale = (mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]) >>> 0;\n }\n\n var stbl = mp4_helpers_findBox(mdia, ['minf', 'stbl'])[0];\n var stsd = mp4_helpers_findBox(stbl, ['stsd'])[0];\n var descriptionCount = bytesToNumber(stsd.subarray(4, 8));\n var offset = 8; // add codec and codec info\n\n while (descriptionCount--) {\n var len = bytesToNumber(stsd.subarray(offset, offset + 4));\n var sampleDescriptor = stsd.subarray(offset + 4, offset + 4 + len);\n mp4_helpers_addSampleDescription(track, sampleDescriptor);\n offset += 4 + len;\n }\n\n if (frameTable) {\n track.frameTable = mp4_helpers_buildFrameTable(stbl, track.timescale);\n } // codec has no sub parameters\n\n\n tracks.push(track);\n });\n return tracks;\n};\nvar mp4_helpers_parseMediaInfo = function parseMediaInfo(bytes) {\n var mvhd = mp4_helpers_findBox(bytes, ['moov', 'mvhd'], true)[0];\n\n if (!mvhd || !mvhd.length) {\n return;\n }\n\n var info = {}; // ms to ns\n // mvhd v1 has 8 byte duration and other fields too\n\n if (mvhd[0] === 1) {\n info.timestampScale = bytesToNumber(mvhd.subarray(20, 24));\n info.duration = bytesToNumber(mvhd.subarray(24, 32));\n } else {\n info.timestampScale = bytesToNumber(mvhd.subarray(12, 16));\n info.duration = bytesToNumber(mvhd.subarray(16, 20));\n }\n\n info.bytes = mvhd;\n return info;\n};\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/ebml-helpers.js\n\n // relevant specs for this parser:\n// https://matroska-org.github.io/libebml/specs.html\n// https://www.matroska.org/technical/elements.html\n// https://www.webmproject.org/docs/container/\n\nvar EBML_TAGS = {\n EBML: toUint8([0x1A, 0x45, 0xDF, 0xA3]),\n DocType: toUint8([0x42, 0x82]),\n Segment: toUint8([0x18, 0x53, 0x80, 0x67]),\n SegmentInfo: toUint8([0x15, 0x49, 0xA9, 0x66]),\n Tracks: toUint8([0x16, 0x54, 0xAE, 0x6B]),\n Track: toUint8([0xAE]),\n TrackNumber: toUint8([0xd7]),\n DefaultDuration: toUint8([0x23, 0xe3, 0x83]),\n TrackEntry: toUint8([0xAE]),\n TrackType: toUint8([0x83]),\n FlagDefault: toUint8([0x88]),\n CodecID: toUint8([0x86]),\n CodecPrivate: toUint8([0x63, 0xA2]),\n VideoTrack: toUint8([0xe0]),\n AudioTrack: toUint8([0xe1]),\n // Not used yet, but will be used for live webm/mkv\n // see https://www.matroska.org/technical/basics.html#block-structure\n // see https://www.matroska.org/technical/basics.html#simpleblock-structure\n Cluster: toUint8([0x1F, 0x43, 0xB6, 0x75]),\n Timestamp: toUint8([0xE7]),\n TimestampScale: toUint8([0x2A, 0xD7, 0xB1]),\n BlockGroup: toUint8([0xA0]),\n BlockDuration: toUint8([0x9B]),\n Block: toUint8([0xA1]),\n SimpleBlock: toUint8([0xA3])\n};\n/**\n * This is a simple table to determine the length\n * of things in ebml. The length is one based (starts at 1,\n * rather than zero) and for every zero bit before a one bit\n * we add one to length. We also need this table because in some\n * case we have to xor all the length bits from another value.\n */\n\nvar LENGTH_TABLE = [128, 64, 32, 16, 8, 4, 2, 1];\n\nvar getLength = function getLength(byte) {\n var len = 1;\n\n for (var i = 0; i < LENGTH_TABLE.length; i++) {\n if (byte & LENGTH_TABLE[i]) {\n break;\n }\n\n len++;\n }\n\n return len;\n}; // length in ebml is stored in the first 4 to 8 bits\n// of the first byte. 4 for the id length and 8 for the\n// data size length. Length is measured by converting the number to binary\n// then 1 + the number of zeros before a 1 is encountered starting\n// from the left.\n\n\nvar ebml_helpers_getvint = function getvint(bytes, offset, removeLength, signed) {\n if (removeLength === void 0) {\n removeLength = true;\n }\n\n if (signed === void 0) {\n signed = false;\n }\n\n var length = getLength(bytes[offset]);\n var valueBytes = bytes.subarray(offset, offset + length); // NOTE that we do **not** subarray here because we need to copy these bytes\n // as they will be modified below to remove the dataSizeLen bits and we do not\n // want to modify the original data. normally we could just call slice on\n // uint8array but ie 11 does not support that...\n\n if (removeLength) {\n valueBytes = Array.prototype.slice.call(bytes, offset, offset + length);\n valueBytes[0] ^= LENGTH_TABLE[length - 1];\n }\n\n return {\n length: length,\n value: bytesToNumber(valueBytes, {\n signed: signed\n }),\n bytes: valueBytes\n };\n};\n\nvar ebml_helpers_normalizePath = function normalizePath(path) {\n if (typeof path === 'string') {\n return path.match(/.{1,2}/g).map(function (p) {\n return normalizePath(p);\n });\n }\n\n if (typeof path === 'number') {\n return numberToBytes(path);\n }\n\n return path;\n};\n\nvar ebml_helpers_normalizePaths = function normalizePaths(paths) {\n if (!Array.isArray(paths)) {\n return [ebml_helpers_normalizePath(paths)];\n }\n\n return paths.map(function (p) {\n return ebml_helpers_normalizePath(p);\n });\n};\n\nvar ebml_helpers_getInfinityDataSize = function getInfinityDataSize(id, bytes, offset) {\n if (offset >= bytes.length) {\n return bytes.length;\n }\n\n var innerid = ebml_helpers_getvint(bytes, offset, false);\n\n if (bytesMatch(id.bytes, innerid.bytes)) {\n return offset;\n }\n\n var dataHeader = ebml_helpers_getvint(bytes, offset + innerid.length);\n return getInfinityDataSize(id, bytes, offset + dataHeader.length + dataHeader.value + innerid.length);\n};\n/**\n * Notes on the EBLM format.\n *\n * EBLM uses \"vints\" tags. Every vint tag contains\n * two parts\n *\n * 1. The length from the first byte. You get this by\n * converting the byte to binary and counting the zeros\n * before a 1. Then you add 1 to that. Examples\n * 00011111 = length 4 because there are 3 zeros before a 1.\n * 00100000 = length 3 because there are 2 zeros before a 1.\n * 00000011 = length 7 because there are 6 zeros before a 1.\n *\n * 2. The bits used for length are removed from the first byte\n * Then all the bytes are merged into a value. NOTE: this\n * is not the case for id ebml tags as there id includes\n * length bits.\n *\n */\n\n\nvar ebml_helpers_findEbml = function findEbml(bytes, paths) {\n paths = ebml_helpers_normalizePaths(paths);\n bytes = toUint8(bytes);\n var results = [];\n\n if (!paths.length) {\n return results;\n }\n\n var i = 0;\n\n while (i < bytes.length) {\n var id = ebml_helpers_getvint(bytes, i, false);\n var dataHeader = ebml_helpers_getvint(bytes, i + id.length);\n var dataStart = i + id.length + dataHeader.length; // dataSize is unknown or this is a live stream\n\n if (dataHeader.value === 0x7f) {\n dataHeader.value = ebml_helpers_getInfinityDataSize(id, bytes, dataStart);\n\n if (dataHeader.value !== bytes.length) {\n dataHeader.value -= dataStart;\n }\n }\n\n var dataEnd = dataStart + dataHeader.value > bytes.length ? bytes.length : dataStart + dataHeader.value;\n var data = bytes.subarray(dataStart, dataEnd);\n\n if (bytesMatch(paths[0], id.bytes)) {\n if (paths.length === 1) {\n // this is the end of the paths and we've found the tag we were\n // looking for\n results.push(data);\n } else {\n // recursively search for the next tag inside of the data\n // of this one\n results = results.concat(findEbml(data, paths.slice(1)));\n }\n }\n\n var totalLength = id.length + dataHeader.length + data.length; // move past this tag entirely, we are not looking for it\n\n i += totalLength;\n }\n\n return results;\n}; // see https://www.matroska.org/technical/basics.html#block-structure\n\nvar ebml_helpers_decodeBlock = function decodeBlock(block, type, timestampScale, clusterTimestamp) {\n var duration;\n\n if (type === 'group') {\n duration = ebml_helpers_findEbml(block, [EBML_TAGS.BlockDuration])[0];\n\n if (duration) {\n duration = bytesToNumber(duration);\n duration = 1 / timestampScale * duration * timestampScale / 1000;\n }\n\n block = ebml_helpers_findEbml(block, [EBML_TAGS.Block])[0];\n type = 'block'; // treat data as a block after this point\n }\n\n var dv = new DataView(block.buffer, block.byteOffset, block.byteLength);\n var trackNumber = ebml_helpers_getvint(block, 0);\n var timestamp = dv.getInt16(trackNumber.length, false);\n var flags = block[trackNumber.length + 2];\n var data = block.subarray(trackNumber.length + 3); // pts/dts in seconds\n\n var ptsdts = 1 / timestampScale * (clusterTimestamp + timestamp) * timestampScale / 1000; // return the frame\n\n var parsed = {\n duration: duration,\n trackNumber: trackNumber.value,\n keyframe: type === 'simple' && flags >> 7 === 1,\n invisible: (flags & 0x08) >> 3 === 1,\n lacing: (flags & 0x06) >> 1,\n discardable: type === 'simple' && (flags & 0x01) === 1,\n frames: [],\n pts: ptsdts,\n dts: ptsdts,\n timestamp: timestamp\n };\n\n if (!parsed.lacing) {\n parsed.frames.push(data);\n return parsed;\n }\n\n var numberOfFrames = data[0] + 1;\n var frameSizes = [];\n var offset = 1; // Fixed\n\n if (parsed.lacing === 2) {\n var sizeOfFrame = (data.length - offset) / numberOfFrames;\n\n for (var i = 0; i < numberOfFrames; i++) {\n frameSizes.push(sizeOfFrame);\n }\n } // xiph\n\n\n if (parsed.lacing === 1) {\n for (var _i = 0; _i < numberOfFrames - 1; _i++) {\n var size = 0;\n\n do {\n size += data[offset];\n offset++;\n } while (data[offset - 1] === 0xFF);\n\n frameSizes.push(size);\n }\n } // ebml\n\n\n if (parsed.lacing === 3) {\n // first vint is unsinged\n // after that vints are singed and\n // based on a compounding size\n var _size = 0;\n\n for (var _i2 = 0; _i2 < numberOfFrames - 1; _i2++) {\n var vint = _i2 === 0 ? ebml_helpers_getvint(data, offset) : ebml_helpers_getvint(data, offset, true, true);\n _size += vint.value;\n frameSizes.push(_size);\n offset += vint.length;\n }\n }\n\n frameSizes.forEach(function (size) {\n parsed.frames.push(data.subarray(offset, offset + size));\n offset += size;\n });\n return parsed;\n}; // VP9 Codec Feature Metadata (CodecPrivate)\n// https://www.webmproject.org/docs/container/\n\nvar parseVp9Private = function parseVp9Private(bytes) {\n var i = 0;\n var params = {};\n\n while (i < bytes.length) {\n var id = bytes[i] & 0x7f;\n var len = bytes[i + 1];\n var val = void 0;\n\n if (len === 1) {\n val = bytes[i + 2];\n } else {\n val = bytes.subarray(i + 2, i + 2 + len);\n }\n\n if (id === 1) {\n params.profile = val;\n } else if (id === 2) {\n params.level = val;\n } else if (id === 3) {\n params.bitDepth = val;\n } else if (id === 4) {\n params.chromaSubsampling = val;\n } else {\n params[id] = val;\n }\n\n i += 2 + len;\n }\n\n return params;\n};\n\nvar ebml_helpers_parseTracks = function parseTracks(bytes) {\n bytes = toUint8(bytes);\n var decodedTracks = [];\n var tracks = ebml_helpers_findEbml(bytes, [EBML_TAGS.Segment, EBML_TAGS.Tracks, EBML_TAGS.Track]);\n\n if (!tracks.length) {\n tracks = ebml_helpers_findEbml(bytes, [EBML_TAGS.Tracks, EBML_TAGS.Track]);\n }\n\n if (!tracks.length) {\n tracks = ebml_helpers_findEbml(bytes, [EBML_TAGS.Track]);\n }\n\n if (!tracks.length) {\n return decodedTracks;\n }\n\n tracks.forEach(function (track) {\n var trackType = ebml_helpers_findEbml(track, EBML_TAGS.TrackType)[0];\n\n if (!trackType || !trackType.length) {\n return;\n } // 1 is video, 2 is audio, 17 is subtitle\n // other values are unimportant in this context\n\n\n if (trackType[0] === 1) {\n trackType = 'video';\n } else if (trackType[0] === 2) {\n trackType = 'audio';\n } else if (trackType[0] === 17) {\n trackType = 'subtitle';\n } else {\n return;\n } // todo parse language\n\n\n var decodedTrack = {\n rawCodec: bytesToString(ebml_helpers_findEbml(track, [EBML_TAGS.CodecID])[0]),\n type: trackType,\n codecPrivate: ebml_helpers_findEbml(track, [EBML_TAGS.CodecPrivate])[0],\n number: bytesToNumber(ebml_helpers_findEbml(track, [EBML_TAGS.TrackNumber])[0]),\n defaultDuration: bytesToNumber(ebml_helpers_findEbml(track, [EBML_TAGS.DefaultDuration])[0]),\n default: ebml_helpers_findEbml(track, [EBML_TAGS.FlagDefault])[0],\n rawData: track\n };\n var codec = '';\n\n if (/V_MPEG4\\/ISO\\/AVC/.test(decodedTrack.rawCodec)) {\n codec = \"avc1.\" + codec_helpers_getAvcCodec(decodedTrack.codecPrivate);\n } else if (/V_MPEGH\\/ISO\\/HEVC/.test(decodedTrack.rawCodec)) {\n codec = \"hev1.\" + codec_helpers_getHvcCodec(decodedTrack.codecPrivate);\n } else if (/V_MPEG4\\/ISO\\/ASP/.test(decodedTrack.rawCodec)) {\n if (decodedTrack.codecPrivate) {\n codec = 'mp4v.20.' + decodedTrack.codecPrivate[4].toString();\n } else {\n codec = 'mp4v.20.9';\n }\n } else if (/^V_THEORA/.test(decodedTrack.rawCodec)) {\n codec = 'theora';\n } else if (/^V_VP8/.test(decodedTrack.rawCodec)) {\n codec = 'vp8';\n } else if (/^V_VP9/.test(decodedTrack.rawCodec)) {\n if (decodedTrack.codecPrivate) {\n var _parseVp9Private = parseVp9Private(decodedTrack.codecPrivate),\n profile = _parseVp9Private.profile,\n level = _parseVp9Private.level,\n bitDepth = _parseVp9Private.bitDepth,\n chromaSubsampling = _parseVp9Private.chromaSubsampling;\n\n codec = 'vp09.';\n codec += padStart(profile, 2, '0') + \".\";\n codec += padStart(level, 2, '0') + \".\";\n codec += padStart(bitDepth, 2, '0') + \".\";\n codec += \"\" + padStart(chromaSubsampling, 2, '0'); // Video -> Colour -> Ebml name\n\n var matrixCoefficients = ebml_helpers_findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xB1]])[0] || [];\n var videoFullRangeFlag = ebml_helpers_findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xB9]])[0] || [];\n var transferCharacteristics = ebml_helpers_findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xBA]])[0] || [];\n var colourPrimaries = ebml_helpers_findEbml(track, [0xE0, [0x55, 0xB0], [0x55, 0xBB]])[0] || []; // if we find any optional codec parameter specify them all.\n\n if (matrixCoefficients.length || videoFullRangeFlag.length || transferCharacteristics.length || colourPrimaries.length) {\n codec += \".\" + padStart(colourPrimaries[0], 2, '0');\n codec += \".\" + padStart(transferCharacteristics[0], 2, '0');\n codec += \".\" + padStart(matrixCoefficients[0], 2, '0');\n codec += \".\" + padStart(videoFullRangeFlag[0], 2, '0');\n }\n } else {\n codec = 'vp9';\n }\n } else if (/^V_AV1/.test(decodedTrack.rawCodec)) {\n codec = \"av01.\" + codec_helpers_getAv1Codec(decodedTrack.codecPrivate);\n } else if (/A_ALAC/.test(decodedTrack.rawCodec)) {\n codec = 'alac';\n } else if (/A_MPEG\\/L2/.test(decodedTrack.rawCodec)) {\n codec = 'mp2';\n } else if (/A_MPEG\\/L3/.test(decodedTrack.rawCodec)) {\n codec = 'mp3';\n } else if (/^A_AAC/.test(decodedTrack.rawCodec)) {\n if (decodedTrack.codecPrivate) {\n codec = 'mp4a.40.' + (decodedTrack.codecPrivate[0] >>> 3).toString();\n } else {\n codec = 'mp4a.40.2';\n }\n } else if (/^A_AC3/.test(decodedTrack.rawCodec)) {\n codec = 'ac-3';\n } else if (/^A_PCM/.test(decodedTrack.rawCodec)) {\n codec = 'pcm';\n } else if (/^A_MS\\/ACM/.test(decodedTrack.rawCodec)) {\n codec = 'speex';\n } else if (/^A_EAC3/.test(decodedTrack.rawCodec)) {\n codec = 'ec-3';\n } else if (/^A_VORBIS/.test(decodedTrack.rawCodec)) {\n codec = 'vorbis';\n } else if (/^A_FLAC/.test(decodedTrack.rawCodec)) {\n codec = 'flac';\n } else if (/^A_OPUS/.test(decodedTrack.rawCodec)) {\n codec = 'opus';\n }\n\n decodedTrack.codec = codec;\n decodedTracks.push(decodedTrack);\n });\n return decodedTracks.sort(function (a, b) {\n return a.number - b.number;\n });\n};\nvar ebml_helpers_parseData = function parseData(data, tracks) {\n var allBlocks = [];\n var segment = ebml_helpers_findEbml(data, [EBML_TAGS.Segment])[0];\n var timestampScale = ebml_helpers_findEbml(segment, [EBML_TAGS.SegmentInfo, EBML_TAGS.TimestampScale])[0]; // in nanoseconds, defaults to 1ms\n\n if (timestampScale && timestampScale.length) {\n timestampScale = bytesToNumber(timestampScale);\n } else {\n timestampScale = 1000000;\n }\n\n var clusters = ebml_helpers_findEbml(segment, [EBML_TAGS.Cluster]);\n\n if (!tracks) {\n tracks = ebml_helpers_parseTracks(segment);\n }\n\n clusters.forEach(function (cluster, ci) {\n var simpleBlocks = ebml_helpers_findEbml(cluster, [EBML_TAGS.SimpleBlock]).map(function (b) {\n return {\n type: 'simple',\n data: b\n };\n });\n var blockGroups = ebml_helpers_findEbml(cluster, [EBML_TAGS.BlockGroup]).map(function (b) {\n return {\n type: 'group',\n data: b\n };\n });\n var timestamp = ebml_helpers_findEbml(cluster, [EBML_TAGS.Timestamp])[0] || 0;\n\n if (timestamp && timestamp.length) {\n timestamp = bytesToNumber(timestamp);\n } // get all blocks then sort them into the correct order\n\n\n var blocks = simpleBlocks.concat(blockGroups).sort(function (a, b) {\n return a.data.byteOffset - b.data.byteOffset;\n });\n blocks.forEach(function (block, bi) {\n var decoded = ebml_helpers_decodeBlock(block.data, block.type, timestampScale, timestamp);\n allBlocks.push(decoded);\n });\n });\n return {\n tracks: tracks,\n blocks: allBlocks\n };\n};\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/nal-helpers.js\n\nvar NAL_TYPE_ONE = toUint8([0x00, 0x00, 0x00, 0x01]);\nvar NAL_TYPE_TWO = toUint8([0x00, 0x00, 0x01]);\nvar EMULATION_PREVENTION = toUint8([0x00, 0x00, 0x03]);\n/**\n * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n * Sequence Payload\"\n *\n * @param data {Uint8Array} the bytes of a RBSP from a NAL\n * unit\n * @return {Uint8Array} the RBSP without any Emulation\n * Prevention Bytes\n */\n\nvar nal_helpers_discardEmulationPreventionBytes = function discardEmulationPreventionBytes(bytes) {\n var positions = [];\n var i = 1; // Find all `Emulation Prevention Bytes`\n\n while (i < bytes.length - 2) {\n if (bytesMatch(bytes.subarray(i, i + 3), EMULATION_PREVENTION)) {\n positions.push(i + 2);\n i++;\n }\n\n i++;\n } // If no Emulation Prevention Bytes were found just return the original\n // array\n\n\n if (positions.length === 0) {\n return bytes;\n } // Create a new array to hold the NAL unit data\n\n\n var newLength = bytes.length - positions.length;\n var newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === positions[0]) {\n // Skip this byte\n sourceIndex++; // Remove this position index\n\n positions.shift();\n }\n\n newData[i] = bytes[sourceIndex];\n }\n\n return newData;\n};\nvar nal_helpers_findNal = function findNal(bytes, dataType, types, nalLimit) {\n if (nalLimit === void 0) {\n nalLimit = Infinity;\n }\n\n bytes = toUint8(bytes);\n types = [].concat(types);\n var i = 0;\n var nalStart;\n var nalsFound = 0; // keep searching until:\n // we reach the end of bytes\n // we reach the maximum number of nals they want to seach\n // NOTE: that we disregard nalLimit when we have found the start\n // of the nal we want so that we can find the end of the nal we want.\n\n while (i < bytes.length && (nalsFound < nalLimit || nalStart)) {\n var nalOffset = void 0;\n\n if (bytesMatch(bytes.subarray(i), NAL_TYPE_ONE)) {\n nalOffset = 4;\n } else if (bytesMatch(bytes.subarray(i), NAL_TYPE_TWO)) {\n nalOffset = 3;\n } // we are unsynced,\n // find the next nal unit\n\n\n if (!nalOffset) {\n i++;\n continue;\n }\n\n nalsFound++;\n\n if (nalStart) {\n return nal_helpers_discardEmulationPreventionBytes(bytes.subarray(nalStart, i));\n }\n\n var nalType = void 0;\n\n if (dataType === 'h264') {\n nalType = bytes[i + nalOffset] & 0x1f;\n } else if (dataType === 'h265') {\n nalType = bytes[i + nalOffset] >> 1 & 0x3f;\n }\n\n if (types.indexOf(nalType) !== -1) {\n nalStart = i + nalOffset;\n } // nal header is 1 length for h264, and 2 for h265\n\n\n i += nalOffset + (dataType === 'h264' ? 1 : 2);\n }\n\n return bytes.subarray(0, 0);\n};\nvar findH264Nal = function findH264Nal(bytes, type, nalLimit) {\n return nal_helpers_findNal(bytes, 'h264', type, nalLimit);\n};\nvar findH265Nal = function findH265Nal(bytes, type, nalLimit) {\n return nal_helpers_findNal(bytes, 'h265', type, nalLimit);\n};\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@videojs/vhs-utils/es/containers.js\n\n\n\n\n\nvar CONSTANTS = {\n // \"webm\" string literal in hex\n 'webm': toUint8([0x77, 0x65, 0x62, 0x6d]),\n // \"matroska\" string literal in hex\n 'matroska': toUint8([0x6d, 0x61, 0x74, 0x72, 0x6f, 0x73, 0x6b, 0x61]),\n // \"fLaC\" string literal in hex\n 'flac': toUint8([0x66, 0x4c, 0x61, 0x43]),\n // \"OggS\" string literal in hex\n 'ogg': toUint8([0x4f, 0x67, 0x67, 0x53]),\n // ac-3 sync byte, also works for ec-3 as that is simply a codec\n // of ac-3\n 'ac3': toUint8([0x0b, 0x77]),\n // \"RIFF\" string literal in hex used for wav and avi\n 'riff': toUint8([0x52, 0x49, 0x46, 0x46]),\n // \"AVI\" string literal in hex\n 'avi': toUint8([0x41, 0x56, 0x49]),\n // \"WAVE\" string literal in hex\n 'wav': toUint8([0x57, 0x41, 0x56, 0x45]),\n // \"ftyp3g\" string literal in hex\n '3gp': toUint8([0x66, 0x74, 0x79, 0x70, 0x33, 0x67]),\n // \"ftyp\" string literal in hex\n 'mp4': toUint8([0x66, 0x74, 0x79, 0x70]),\n // \"styp\" string literal in hex\n 'fmp4': toUint8([0x73, 0x74, 0x79, 0x70]),\n // \"ftypqt\" string literal in hex\n 'mov': toUint8([0x66, 0x74, 0x79, 0x70, 0x71, 0x74]),\n // moov string literal in hex\n 'moov': toUint8([0x6D, 0x6F, 0x6F, 0x76]),\n // moof string literal in hex\n 'moof': toUint8([0x6D, 0x6F, 0x6F, 0x66])\n};\nvar _isLikely = {\n aac: function aac(bytes) {\n var offset = id3_helpers_getId3Offset(bytes);\n return bytesMatch(bytes, [0xFF, 0x10], {\n offset: offset,\n mask: [0xFF, 0x16]\n });\n },\n mp3: function mp3(bytes) {\n var offset = id3_helpers_getId3Offset(bytes);\n return bytesMatch(bytes, [0xFF, 0x02], {\n offset: offset,\n mask: [0xFF, 0x06]\n });\n },\n webm: function webm(bytes) {\n var docType = ebml_helpers_findEbml(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0]; // check if DocType EBML tag is webm\n\n return bytesMatch(docType, CONSTANTS.webm);\n },\n mkv: function mkv(bytes) {\n var docType = ebml_helpers_findEbml(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0]; // check if DocType EBML tag is matroska\n\n return bytesMatch(docType, CONSTANTS.matroska);\n },\n mp4: function mp4(bytes) {\n // if this file is another base media file format, it is not mp4\n if (_isLikely['3gp'](bytes) || _isLikely.mov(bytes)) {\n return false;\n } // if this file starts with a ftyp or styp box its mp4\n\n\n if (bytesMatch(bytes, CONSTANTS.mp4, {\n offset: 4\n }) || bytesMatch(bytes, CONSTANTS.fmp4, {\n offset: 4\n })) {\n return true;\n } // if this file starts with a moof/moov box its mp4\n\n\n if (bytesMatch(bytes, CONSTANTS.moof, {\n offset: 4\n }) || bytesMatch(bytes, CONSTANTS.moov, {\n offset: 4\n })) {\n return true;\n }\n },\n mov: function mov(bytes) {\n return bytesMatch(bytes, CONSTANTS.mov, {\n offset: 4\n });\n },\n '3gp': function gp(bytes) {\n return bytesMatch(bytes, CONSTANTS['3gp'], {\n offset: 4\n });\n },\n ac3: function ac3(bytes) {\n var offset = id3_helpers_getId3Offset(bytes);\n return bytesMatch(bytes, CONSTANTS.ac3, {\n offset: offset\n });\n },\n ts: function ts(bytes) {\n if (bytes.length < 189 && bytes.length >= 1) {\n return bytes[0] === 0x47;\n }\n\n var i = 0; // check the first 376 bytes for two matching sync bytes\n\n while (i + 188 < bytes.length && i < 188) {\n if (bytes[i] === 0x47 && bytes[i + 188] === 0x47) {\n return true;\n }\n\n i += 1;\n }\n\n return false;\n },\n flac: function flac(bytes) {\n var offset = id3_helpers_getId3Offset(bytes);\n return bytesMatch(bytes, CONSTANTS.flac, {\n offset: offset\n });\n },\n ogg: function ogg(bytes) {\n return bytesMatch(bytes, CONSTANTS.ogg);\n },\n avi: function avi(bytes) {\n return bytesMatch(bytes, CONSTANTS.riff) && bytesMatch(bytes, CONSTANTS.avi, {\n offset: 8\n });\n },\n wav: function wav(bytes) {\n return bytesMatch(bytes, CONSTANTS.riff) && bytesMatch(bytes, CONSTANTS.wav, {\n offset: 8\n });\n },\n 'h264': function h264(bytes) {\n // find seq_parameter_set_rbsp\n return findH264Nal(bytes, 7, 3).length;\n },\n 'h265': function h265(bytes) {\n // find video_parameter_set_rbsp or seq_parameter_set_rbsp\n return findH265Nal(bytes, [32, 33], 3).length;\n }\n}; // get all the isLikely functions\n// but make sure 'ts' is above h264 and h265\n// but below everything else as it is the least specific\n\nvar isLikelyTypes = Object.keys(_isLikely) // remove ts, h264, h265\n.filter(function (t) {\n return t !== 'ts' && t !== 'h264' && t !== 'h265';\n}) // add it back to the bottom\n.concat(['ts', 'h264', 'h265']); // make sure we are dealing with uint8 data.\n\nisLikelyTypes.forEach(function (type) {\n var isLikelyFn = _isLikely[type];\n\n _isLikely[type] = function (bytes) {\n return isLikelyFn(toUint8(bytes));\n };\n}); // export after wrapping\n\nvar isLikely = _isLikely; // A useful list of file signatures can be found here\n// https://en.wikipedia.org/wiki/List_of_file_signatures\n\nvar containers_detectContainerForBytes = function detectContainerForBytes(bytes) {\n bytes = toUint8(bytes);\n\n for (var i = 0; i < isLikelyTypes.length; i++) {\n var type = isLikelyTypes[i];\n\n if (isLikely[type](bytes)) {\n return type;\n }\n }\n\n return '';\n}; // fmp4 is not a container\n\nvar containers_isLikelyFmp4MediaSegment = function isLikelyFmp4MediaSegment(bytes) {\n return mp4_helpers_findBox(bytes, ['moof']).length > 0;\n};\n// EXTERNAL MODULE: external \"mux.js/lib/utils/clock\"\nvar clock_ = __webpack_require__(21);\n\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/video.js/dist/video.es.js\n/**\n * @license\n * Video.js 7.15.4 <http://videojs.com/>\n * Copyright Brightcove, Inc. <https://www.brightcove.com/>\n * Available under Apache License Version 2.0\n * <https://github.com/videojs/video.js/blob/main/LICENSE>\n *\n * Includes vtt.js <https://github.com/mozilla/vtt.js>\n * Available under Apache License Version 2.0\n * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar version$5 = \"7.15.4\";\n\n/**\n * An Object that contains lifecycle hooks as keys which point to an array\n * of functions that are run when a lifecycle is triggered\n *\n * @private\n */\nvar hooks_ = {};\n/**\n * Get a list of hooks for a specific lifecycle\n *\n * @param {string} type\n * the lifecyle to get hooks from\n *\n * @param {Function|Function[]} [fn]\n * Optionally add a hook (or hooks) to the lifecycle that your are getting.\n *\n * @return {Array}\n * an array of hooks, or an empty array if there are none.\n */\n\nvar hooks = function hooks(type, fn) {\n hooks_[type] = hooks_[type] || [];\n\n if (fn) {\n hooks_[type] = hooks_[type].concat(fn);\n }\n\n return hooks_[type];\n};\n/**\n * Add a function hook to a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle to hook the function to.\n *\n * @param {Function|Function[]}\n * The function or array of functions to attach.\n */\n\n\nvar hook = function hook(type, fn) {\n hooks(type, fn);\n};\n/**\n * Remove a hook from a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle that the function hooked to\n *\n * @param {Function} fn\n * The hooked function to remove\n *\n * @return {boolean}\n * The function that was removed or undef\n */\n\n\nvar removeHook = function removeHook(type, fn) {\n var index = hooks(type).indexOf(fn);\n\n if (index <= -1) {\n return false;\n }\n\n hooks_[type] = hooks_[type].slice();\n hooks_[type].splice(index, 1);\n return true;\n};\n/**\n * Add a function hook that will only run once to a specific videojs lifecycle.\n *\n * @param {string} type\n * the lifecycle to hook the function to.\n *\n * @param {Function|Function[]}\n * The function or array of functions to attach.\n */\n\n\nvar hookOnce = function hookOnce(type, fn) {\n hooks(type, [].concat(fn).map(function (original) {\n var wrapper = function wrapper() {\n removeHook(type, wrapper);\n return original.apply(void 0, arguments);\n };\n\n return wrapper;\n }));\n};\n\n/**\n * @file fullscreen-api.js\n * @module fullscreen-api\n * @private\n */\n/**\n * Store the browser-specific methods for the fullscreen API.\n *\n * @type {Object}\n * @see [Specification]{@link https://fullscreen.spec.whatwg.org}\n * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js}\n */\n\nvar FullscreenApi = {\n prefixed: true\n}; // browser API methods\n\nvar apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror', 'fullscreen'], // WebKit\n['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror', '-webkit-full-screen'], // Mozilla\n['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror', '-moz-full-screen'], // Microsoft\n['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError', '-ms-fullscreen']];\nvar specApi = apiMap[0];\nvar browserApi; // determine the supported set of functions\n\nfor (var video_es_i = 0; video_es_i < apiMap.length; video_es_i++) {\n // check for exitFullscreen function\n if (apiMap[video_es_i][1] in document_default.a) {\n browserApi = apiMap[video_es_i];\n break;\n }\n} // map the browser API names to the spec API names\n\n\nif (browserApi) {\n for (var dist_video_es_i = 0; dist_video_es_i < browserApi.length; dist_video_es_i++) {\n FullscreenApi[specApi[dist_video_es_i]] = browserApi[dist_video_es_i];\n }\n\n FullscreenApi.prefixed = browserApi[0] !== specApi[0];\n}\n\n/**\n * @file create-logger.js\n * @module create-logger\n */\n\nvar video_es_history = [];\n/**\n * Log messages to the console and history based on the type of message\n *\n * @private\n * @param {string} type\n * The name of the console method to use.\n *\n * @param {Array} args\n * The arguments to be passed to the matching console method.\n */\n\nvar video_es_LogByTypeFactory = function LogByTypeFactory(name, log) {\n return function (type, level, args) {\n var lvl = log.levels[level];\n var lvlRegExp = new RegExp(\"^(\" + lvl + \")$\");\n\n if (type !== 'log') {\n // Add the type to the front of the message when it's not \"log\".\n args.unshift(type.toUpperCase() + ':');\n } // Add console prefix after adding to history.\n\n\n args.unshift(name + ':'); // Add a clone of the args at this point to history.\n\n if (video_es_history) {\n video_es_history.push([].concat(args)); // only store 1000 history entries\n\n var splice = video_es_history.length - 1000;\n video_es_history.splice(0, splice > 0 ? splice : 0);\n } // If there's no console then don't try to output messages, but they will\n // still be stored in history.\n\n\n if (!window_default.a.console) {\n return;\n } // Was setting these once outside of this function, but containing them\n // in the function makes it easier to test cases where console doesn't exist\n // when the module is executed.\n\n\n var fn = window_default.a.console[type];\n\n if (!fn && type === 'debug') {\n // Certain browsers don't have support for console.debug. For those, we\n // should default to the closest comparable log.\n fn = window_default.a.console.info || window_default.a.console.log;\n } // Bail out if there's no console or if this type is not allowed by the\n // current logging level.\n\n\n if (!fn || !lvl || !lvlRegExp.test(type)) {\n return;\n }\n\n fn[Array.isArray(args) ? 'apply' : 'call'](window_default.a.console, args);\n };\n};\n\nfunction createLogger$1(name) {\n // This is the private tracking variable for logging level.\n var level = 'info'; // the curried logByType bound to the specific log and history\n\n var logByType;\n /**\n * Logs plain debug messages. Similar to `console.log`.\n *\n * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n * of our JSDoc template, we cannot properly document this as both a function\n * and a namespace, so its function signature is documented here.\n *\n * #### Arguments\n * ##### *args\n * Mixed[]\n *\n * Any combination of values that could be passed to `console.log()`.\n *\n * #### Return Value\n *\n * `undefined`\n *\n * @namespace\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged.\n */\n\n var log = function log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n logByType('log', level, args);\n }; // This is the logByType helper that the logging methods below use\n\n\n logByType = video_es_LogByTypeFactory(name, log);\n /**\n * Create a new sublogger which chains the old name to the new name.\n *\n * For example, doing `videojs.log.createLogger('player')` and then using that logger will log the following:\n * ```js\n * mylogger('foo');\n * // > VIDEOJS: player: foo\n * ```\n *\n * @param {string} name\n * The name to add call the new logger\n * @return {Object}\n */\n\n log.createLogger = function (subname) {\n return createLogger$1(name + ': ' + subname);\n };\n /**\n * Enumeration of available logging levels, where the keys are the level names\n * and the values are `|`-separated strings containing logging methods allowed\n * in that logging level. These strings are used to create a regular expression\n * matching the function name being called.\n *\n * Levels provided by Video.js are:\n *\n * - `off`: Matches no calls. Any value that can be cast to `false` will have\n * this effect. The most restrictive.\n * - `all`: Matches only Video.js-provided functions (`debug`, `log`,\n * `log.warn`, and `log.error`).\n * - `debug`: Matches `log.debug`, `log`, `log.warn`, and `log.error` calls.\n * - `info` (default): Matches `log`, `log.warn`, and `log.error` calls.\n * - `warn`: Matches `log.warn` and `log.error` calls.\n * - `error`: Matches only `log.error` calls.\n *\n * @type {Object}\n */\n\n\n log.levels = {\n all: 'debug|log|warn|error',\n off: '',\n debug: 'debug|log|warn|error',\n info: 'log|warn|error',\n warn: 'warn|error',\n error: 'error',\n DEFAULT: level\n };\n /**\n * Get or set the current logging level.\n *\n * If a string matching a key from {@link module:log.levels} is provided, acts\n * as a setter.\n *\n * @param {string} [lvl]\n * Pass a valid level to set a new logging level.\n *\n * @return {string}\n * The current logging level.\n */\n\n log.level = function (lvl) {\n if (typeof lvl === 'string') {\n if (!log.levels.hasOwnProperty(lvl)) {\n throw new Error(\"\\\"\" + lvl + \"\\\" in not a valid log level\");\n }\n\n level = lvl;\n }\n\n return level;\n };\n /**\n * Returns an array containing everything that has been logged to the history.\n *\n * This array is a shallow clone of the internal history record. However, its\n * contents are _not_ cloned; so, mutating objects inside this array will\n * mutate them in history.\n *\n * @return {Array}\n */\n\n\n log.history = function () {\n return video_es_history ? [].concat(video_es_history) : [];\n };\n /**\n * Allows you to filter the history by the given logger name\n *\n * @param {string} fname\n * The name to filter by\n *\n * @return {Array}\n * The filtered list to return\n */\n\n\n log.history.filter = function (fname) {\n return (video_es_history || []).filter(function (historyItem) {\n // if the first item in each historyItem includes `fname`, then it's a match\n return new RegExp(\".*\" + fname + \".*\").test(historyItem[0]);\n });\n };\n /**\n * Clears the internal history tracking, but does not prevent further history\n * tracking.\n */\n\n\n log.history.clear = function () {\n if (video_es_history) {\n video_es_history.length = 0;\n }\n };\n /**\n * Disable history tracking if it is currently enabled.\n */\n\n\n log.history.disable = function () {\n if (video_es_history !== null) {\n video_es_history.length = 0;\n video_es_history = null;\n }\n };\n /**\n * Enable history tracking if it is currently disabled.\n */\n\n\n log.history.enable = function () {\n if (video_es_history === null) {\n video_es_history = [];\n }\n };\n /**\n * Logs error messages. Similar to `console.error`.\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as an error\n */\n\n\n log.error = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return logByType('error', level, args);\n };\n /**\n * Logs warning messages. Similar to `console.warn`.\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as a warning.\n */\n\n\n log.warn = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return logByType('warn', level, args);\n };\n /**\n * Logs debug messages. Similar to `console.debug`, but may also act as a comparable\n * log if `console.debug` is not available\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as debug.\n */\n\n\n log.debug = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return logByType('debug', level, args);\n };\n\n return log;\n}\n\n/**\n * @file log.js\n * @module log\n */\nvar log$1 = createLogger$1('VIDEOJS');\nvar createLogger = log$1.createLogger;\n\n/**\n * @file obj.js\n * @module obj\n */\n\n/**\n * @callback obj:EachCallback\n *\n * @param {Mixed} value\n * The current key for the object that is being iterated over.\n *\n * @param {string} key\n * The current key-value for object that is being iterated over\n */\n\n/**\n * @callback obj:ReduceCallback\n *\n * @param {Mixed} accum\n * The value that is accumulating over the reduce loop.\n *\n * @param {Mixed} value\n * The current key for the object that is being iterated over.\n *\n * @param {string} key\n * The current key-value for object that is being iterated over\n *\n * @return {Mixed}\n * The new accumulated value.\n */\nvar video_es_toString = Object.prototype.toString;\n/**\n * Get the keys of an Object\n *\n * @param {Object}\n * The Object to get the keys from\n *\n * @return {string[]}\n * An array of the keys from the object. Returns an empty array if the\n * object passed in was invalid or had no keys.\n *\n * @private\n */\n\nvar keys = function keys(object) {\n return video_es_isObject(object) ? Object.keys(object) : [];\n};\n/**\n * Array-like iteration for objects.\n *\n * @param {Object} object\n * The object to iterate over\n *\n * @param {obj:EachCallback} fn\n * The callback function which is called for each key in the object.\n */\n\n\nfunction each(object, fn) {\n keys(object).forEach(function (key) {\n return fn(object[key], key);\n });\n}\n/**\n * Array-like reduce for objects.\n *\n * @param {Object} object\n * The Object that you want to reduce.\n *\n * @param {Function} fn\n * A callback function which is called for each key in the object. It\n * receives the accumulated value and the per-iteration value and key\n * as arguments.\n *\n * @param {Mixed} [initial = 0]\n * Starting value\n *\n * @return {Mixed}\n * The final accumulated value.\n */\n\nfunction reduce(object, fn, initial) {\n if (initial === void 0) {\n initial = 0;\n }\n\n return keys(object).reduce(function (accum, key) {\n return fn(accum, object[key], key);\n }, initial);\n}\n/**\n * Object.assign-style object shallow merge/extend.\n *\n * @param {Object} target\n * @param {Object} ...sources\n * @return {Object}\n */\n\nfunction video_es_assign(target) {\n for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n sources[_key - 1] = arguments[_key];\n }\n\n if (Object.assign) {\n return extends_default.a.apply(void 0, [target].concat(sources));\n }\n\n sources.forEach(function (source) {\n if (!source) {\n return;\n }\n\n each(source, function (value, key) {\n target[key] = value;\n });\n });\n return target;\n}\n/**\n * Returns whether a value is an object of any kind - including DOM nodes,\n * arrays, regular expressions, etc. Not functions, though.\n *\n * This avoids the gotcha where using `typeof` on a `null` value\n * results in `'object'`.\n *\n * @param {Object} value\n * @return {boolean}\n */\n\nfunction video_es_isObject(value) {\n return !!value && typeof value === 'object';\n}\n/**\n * Returns whether an object appears to be a \"plain\" object - that is, a\n * direct instance of `Object`.\n *\n * @param {Object} value\n * @return {boolean}\n */\n\nfunction isPlain(value) {\n return video_es_isObject(value) && video_es_toString.call(value) === '[object Object]' && value.constructor === Object;\n}\n\n/**\n * @file computed-style.js\n * @module computed-style\n */\n/**\n * A safe getComputedStyle.\n *\n * This is needed because in Firefox, if the player is loaded in an iframe with\n * `display:none`, then `getComputedStyle` returns `null`, so, we do a\n * null-check to make sure that the player doesn't break in these cases.\n *\n * @function\n * @param {Element} el\n * The element you want the computed style of\n *\n * @param {string} prop\n * The property name you want\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n */\n\nfunction computedStyle(el, prop) {\n if (!el || !prop) {\n return '';\n }\n\n if (typeof window_default.a.getComputedStyle === 'function') {\n var computedStyleValue;\n\n try {\n computedStyleValue = window_default.a.getComputedStyle(el);\n } catch (e) {\n return '';\n }\n\n return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : '';\n }\n\n return '';\n}\n\n/**\n * @file browser.js\n * @module browser\n */\nvar USER_AGENT = window_default.a.navigator && window_default.a.navigator.userAgent || '';\nvar webkitVersionMap = /AppleWebKit\\/([\\d.]+)/i.exec(USER_AGENT);\nvar appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;\n/**\n * Whether or not this device is an iPod.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IPOD = /iPod/i.test(USER_AGENT);\n/**\n * The detected iOS version - or `null`.\n *\n * @static\n * @const\n * @type {string|null}\n */\n\nvar IOS_VERSION = function () {\n var match = USER_AGENT.match(/OS (\\d+)_/i);\n\n if (match && match[1]) {\n return match[1];\n }\n\n return null;\n}();\n/**\n * Whether or not this is an Android device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_ANDROID = /Android/i.test(USER_AGENT);\n/**\n * The detected Android version - or `null`.\n *\n * @static\n * @const\n * @type {number|string|null}\n */\n\nvar ANDROID_VERSION = function () {\n // This matches Android Major.Minor.Patch versions\n // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned\n var match = USER_AGENT.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);\n\n if (!match) {\n return null;\n }\n\n var major = match[1] && parseFloat(match[1]);\n var minor = match[2] && parseFloat(match[2]);\n\n if (major && minor) {\n return parseFloat(match[1] + '.' + match[2]);\n } else if (major) {\n return major;\n }\n\n return null;\n}();\n/**\n * Whether or not this is a native Android browser.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537;\n/**\n * Whether or not this is Mozilla Firefox.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_FIREFOX = /Firefox/i.test(USER_AGENT);\n/**\n * Whether or not this is Microsoft Edge.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_EDGE = /Edg/i.test(USER_AGENT);\n/**\n * Whether or not this is Google Chrome.\n *\n * This will also be `true` for Chrome on iOS, which will have different support\n * as it is actually Safari under the hood.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT));\n/**\n * The detected Google Chrome version - or `null`.\n *\n * @static\n * @const\n * @type {number|null}\n */\n\nvar CHROME_VERSION = function () {\n var match = USER_AGENT.match(/(Chrome|CriOS)\\/(\\d+)/);\n\n if (match && match[2]) {\n return parseFloat(match[2]);\n }\n\n return null;\n}();\n/**\n * The detected Internet Explorer version - or `null`.\n *\n * @static\n * @const\n * @type {number|null}\n */\n\nvar IE_VERSION = function () {\n var result = /MSIE\\s(\\d+)\\.\\d/.exec(USER_AGENT);\n var version = result && parseFloat(result[1]);\n\n if (!version && /Trident\\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) {\n // IE 11 has a different user agent string than other IE versions\n version = 11.0;\n }\n\n return version;\n}();\n/**\n * Whether or not this is desktop Safari.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;\n/**\n * Whether or not this is a Windows machine.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_WINDOWS = /Windows/i.test(USER_AGENT);\n/**\n * Whether or not this device is touch-enabled.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar TOUCH_ENABLED = Boolean(isReal() && ('ontouchstart' in window_default.a || window_default.a.navigator.maxTouchPoints || window_default.a.DocumentTouch && window_default.a.document instanceof window_default.a.DocumentTouch));\n/**\n * Whether or not this device is an iPad.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IPAD = /iPad/i.test(USER_AGENT) || IS_SAFARI && TOUCH_ENABLED && !/iPhone/i.test(USER_AGENT);\n/**\n * Whether or not this device is an iPhone.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n// The Facebook app's UIWebView identifies as both an iPhone and iPad, so\n// to identify iPhones, we need to exclude iPads.\n// http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/\n\nvar IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD;\n/**\n * Whether or not this is an iOS device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;\n/**\n * Whether or not this is any flavor of Safari - including iOS.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\nvar IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME;\n\nvar browser = /*#__PURE__*/Object.freeze({\n __proto__: null,\n IS_IPOD: IS_IPOD,\n IOS_VERSION: IOS_VERSION,\n IS_ANDROID: IS_ANDROID,\n ANDROID_VERSION: ANDROID_VERSION,\n IS_NATIVE_ANDROID: IS_NATIVE_ANDROID,\n IS_FIREFOX: IS_FIREFOX,\n IS_EDGE: IS_EDGE,\n IS_CHROME: IS_CHROME,\n CHROME_VERSION: CHROME_VERSION,\n IE_VERSION: IE_VERSION,\n IS_SAFARI: IS_SAFARI,\n IS_WINDOWS: IS_WINDOWS,\n TOUCH_ENABLED: TOUCH_ENABLED,\n IS_IPAD: IS_IPAD,\n IS_IPHONE: IS_IPHONE,\n IS_IOS: IS_IOS,\n IS_ANY_SAFARI: IS_ANY_SAFARI\n});\n\n/**\n * @file dom.js\n * @module dom\n */\n/**\n * Detect if a value is a string with any non-whitespace characters.\n *\n * @private\n * @param {string} str\n * The string to check\n *\n * @return {boolean}\n * Will be `true` if the string is non-blank, `false` otherwise.\n *\n */\n\nfunction isNonBlankString(str) {\n // we use str.trim as it will trim any whitespace characters\n // from the front or back of non-whitespace characters. aka\n // Any string that contains non-whitespace characters will\n // still contain them after `trim` but whitespace only strings\n // will have a length of 0, failing this check.\n return typeof str === 'string' && Boolean(str.trim());\n}\n/**\n * Throws an error if the passed string has whitespace. This is used by\n * class methods to be relatively consistent with the classList API.\n *\n * @private\n * @param {string} str\n * The string to check for whitespace.\n *\n * @throws {Error}\n * Throws an error if there is whitespace in the string.\n */\n\n\nfunction throwIfWhitespace(str) {\n // str.indexOf instead of regex because str.indexOf is faster performance wise.\n if (str.indexOf(' ') >= 0) {\n throw new Error('class has illegal whitespace characters');\n }\n}\n/**\n * Produce a regular expression for matching a className within an elements className.\n *\n * @private\n * @param {string} className\n * The className to generate the RegExp for.\n *\n * @return {RegExp}\n * The RegExp that will check for a specific `className` in an elements\n * className.\n */\n\n\nfunction classRegExp(className) {\n return new RegExp('(^|\\\\s)' + className + '($|\\\\s)');\n}\n/**\n * Whether the current DOM interface appears to be real (i.e. not simulated).\n *\n * @return {boolean}\n * Will be `true` if the DOM appears to be real, `false` otherwise.\n */\n\n\nfunction isReal() {\n // Both document and window will never be undefined thanks to `global`.\n return document_default.a === window_default.a.document;\n}\n/**\n * Determines, via duck typing, whether or not a value is a DOM element.\n *\n * @param {Mixed} value\n * The value to check.\n *\n * @return {boolean}\n * Will be `true` if the value is a DOM element, `false` otherwise.\n */\n\nfunction isEl(value) {\n return video_es_isObject(value) && value.nodeType === 1;\n}\n/**\n * Determines if the current DOM is embedded in an iframe.\n *\n * @return {boolean}\n * Will be `true` if the DOM is embedded in an iframe, `false`\n * otherwise.\n */\n\nfunction isInFrame() {\n // We need a try/catch here because Safari will throw errors when attempting\n // to get either `parent` or `self`\n try {\n return window_default.a.parent !== window_default.a.self;\n } catch (x) {\n return true;\n }\n}\n/**\n * Creates functions to query the DOM using a given method.\n *\n * @private\n * @param {string} method\n * The method to create the query with.\n *\n * @return {Function}\n * The query method\n */\n\nfunction createQuerier(method) {\n return function (selector, context) {\n if (!isNonBlankString(selector)) {\n return document_default.a[method](null);\n }\n\n if (isNonBlankString(context)) {\n context = document_default.a.querySelector(context);\n }\n\n var ctx = isEl(context) ? context : document_default.a;\n return ctx[method] && ctx[method](selector);\n };\n}\n/**\n * Creates an element and applies properties, attributes, and inserts content.\n *\n * @param {string} [tagName='div']\n * Name of tag to be created.\n *\n * @param {Object} [properties={}]\n * Element properties to be applied.\n *\n * @param {Object} [attributes={}]\n * Element attributes to be applied.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor object.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\nfunction video_es_createEl(tagName, properties, attributes, content) {\n if (tagName === void 0) {\n tagName = 'div';\n }\n\n if (properties === void 0) {\n properties = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n var el = document_default.a.createElement(tagName);\n Object.getOwnPropertyNames(properties).forEach(function (propName) {\n var val = properties[propName]; // See #2176\n // We originally were accepting both properties and attributes in the\n // same object, but that doesn't work so well.\n\n if (propName.indexOf('aria-') !== -1 || propName === 'role' || propName === 'type') {\n log$1.warn('Setting attributes in the second argument of createEl()\\n' + 'has been deprecated. Use the third argument instead.\\n' + (\"createEl(type, properties, attributes). Attempting to set \" + propName + \" to \" + val + \".\"));\n el.setAttribute(propName, val); // Handle textContent since it's not supported everywhere and we have a\n // method for it.\n } else if (propName === 'textContent') {\n textContent(el, val);\n } else if (el[propName] !== val || propName === 'tabIndex') {\n el[propName] = val;\n }\n });\n Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n el.setAttribute(attrName, attributes[attrName]);\n });\n\n if (content) {\n appendContent(el, content);\n }\n\n return el;\n}\n/**\n * Injects text into an element, replacing any existing contents entirely.\n *\n * @param {Element} el\n * The element to add text content into\n *\n * @param {string} text\n * The text content to add.\n *\n * @return {Element}\n * The element with added text content.\n */\n\nfunction textContent(el, text) {\n if (typeof el.textContent === 'undefined') {\n el.innerText = text;\n } else {\n el.textContent = text;\n }\n\n return el;\n}\n/**\n * Insert an element as the first child node of another\n *\n * @param {Element} child\n * Element to insert\n *\n * @param {Element} parent\n * Element to insert child into\n */\n\nfunction prependTo(child, parent) {\n if (parent.firstChild) {\n parent.insertBefore(child, parent.firstChild);\n } else {\n parent.appendChild(child);\n }\n}\n/**\n * Check if an element has a class name.\n *\n * @param {Element} element\n * Element to check\n *\n * @param {string} classToCheck\n * Class name to check for\n *\n * @return {boolean}\n * Will be `true` if the element has a class, `false` otherwise.\n *\n * @throws {Error}\n * Throws an error if `classToCheck` has white space.\n */\n\nfunction hasClass(element, classToCheck) {\n throwIfWhitespace(classToCheck);\n\n if (element.classList) {\n return element.classList.contains(classToCheck);\n }\n\n return classRegExp(classToCheck).test(element.className);\n}\n/**\n * Add a class name to an element.\n *\n * @param {Element} element\n * Element to add class name to.\n *\n * @param {string} classToAdd\n * Class name to add.\n *\n * @return {Element}\n * The DOM element with the added class name.\n */\n\nfunction addClass(element, classToAdd) {\n if (element.classList) {\n element.classList.add(classToAdd); // Don't need to `throwIfWhitespace` here because `hasElClass` will do it\n // in the case of classList not being supported.\n } else if (!hasClass(element, classToAdd)) {\n element.className = (element.className + ' ' + classToAdd).trim();\n }\n\n return element;\n}\n/**\n * Remove a class name from an element.\n *\n * @param {Element} element\n * Element to remove a class name from.\n *\n * @param {string} classToRemove\n * Class name to remove\n *\n * @return {Element}\n * The DOM element with class name removed.\n */\n\nfunction removeClass(element, classToRemove) {\n // Protect in case the player gets disposed\n if (!element) {\n log$1.warn(\"removeClass was called with an element that doesn't exist\");\n return null;\n }\n\n if (element.classList) {\n element.classList.remove(classToRemove);\n } else {\n throwIfWhitespace(classToRemove);\n element.className = element.className.split(/\\s+/).filter(function (c) {\n return c !== classToRemove;\n }).join(' ');\n }\n\n return element;\n}\n/**\n * The callback definition for toggleClass.\n *\n * @callback module:dom~PredicateCallback\n * @param {Element} element\n * The DOM element of the Component.\n *\n * @param {string} classToToggle\n * The `className` that wants to be toggled\n *\n * @return {boolean|undefined}\n * If `true` is returned, the `classToToggle` will be added to the\n * `element`. If `false`, the `classToToggle` will be removed from\n * the `element`. If `undefined`, the callback will be ignored.\n */\n\n/**\n * Adds or removes a class name to/from an element depending on an optional\n * condition or the presence/absence of the class name.\n *\n * @param {Element} element\n * The element to toggle a class name on.\n *\n * @param {string} classToToggle\n * The class that should be toggled.\n *\n * @param {boolean|module:dom~PredicateCallback} [predicate]\n * See the return value for {@link module:dom~PredicateCallback}\n *\n * @return {Element}\n * The element with a class that has been toggled.\n */\n\nfunction toggleClass(element, classToToggle, predicate) {\n // This CANNOT use `classList` internally because IE11 does not support the\n // second parameter to the `classList.toggle()` method! Which is fine because\n // `classList` will be used by the add/remove functions.\n var has = hasClass(element, classToToggle);\n\n if (typeof predicate === 'function') {\n predicate = predicate(element, classToToggle);\n }\n\n if (typeof predicate !== 'boolean') {\n predicate = !has;\n } // If the necessary class operation matches the current state of the\n // element, no action is required.\n\n\n if (predicate === has) {\n return;\n }\n\n if (predicate) {\n addClass(element, classToToggle);\n } else {\n removeClass(element, classToToggle);\n }\n\n return element;\n}\n/**\n * Apply attributes to an HTML element.\n *\n * @param {Element} el\n * Element to add attributes to.\n *\n * @param {Object} [attributes]\n * Attributes to be applied.\n */\n\nfunction setAttributes(el, attributes) {\n Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n var attrValue = attributes[attrName];\n\n if (attrValue === null || typeof attrValue === 'undefined' || attrValue === false) {\n el.removeAttribute(attrName);\n } else {\n el.setAttribute(attrName, attrValue === true ? '' : attrValue);\n }\n });\n}\n/**\n * Get an element's attribute values, as defined on the HTML tag.\n *\n * Attributes are not the same as properties. They're defined on the tag\n * or with setAttribute.\n *\n * @param {Element} tag\n * Element from which to get tag attributes.\n *\n * @return {Object}\n * All attributes of the element. Boolean attributes will be `true` or\n * `false`, others will be strings.\n */\n\nfunction getAttributes(tag) {\n var obj = {}; // known boolean attributes\n // we can check for matching boolean properties, but not all browsers\n // and not all tags know about these attributes, so, we still want to check them manually\n\n var knownBooleans = ',' + 'autoplay,controls,playsinline,loop,muted,default,defaultMuted' + ',';\n\n if (tag && tag.attributes && tag.attributes.length > 0) {\n var attrs = tag.attributes;\n\n for (var i = attrs.length - 1; i >= 0; i--) {\n var attrName = attrs[i].name;\n var attrVal = attrs[i].value; // check for known booleans\n // the matching element property will return a value for typeof\n\n if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) {\n // the value of an included boolean attribute is typically an empty\n // string ('') which would equal false if we just check for a false value.\n // we also don't want support bad code like autoplay='false'\n attrVal = attrVal !== null ? true : false;\n }\n\n obj[attrName] = attrVal;\n }\n }\n\n return obj;\n}\n/**\n * Get the value of an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to get the value of.\n *\n * @return {string}\n * The value of the attribute.\n */\n\nfunction getAttribute(el, attribute) {\n return el.getAttribute(attribute);\n}\n/**\n * Set the value of an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to set.\n *\n * @param {string} value\n * Value to set the attribute to.\n */\n\nfunction setAttribute(el, attribute, value) {\n el.setAttribute(attribute, value);\n}\n/**\n * Remove an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to remove.\n */\n\nfunction removeAttribute(el, attribute) {\n el.removeAttribute(attribute);\n}\n/**\n * Attempt to block the ability to select text.\n */\n\nfunction blockTextSelection() {\n document_default.a.body.focus();\n\n document_default.a.onselectstart = function () {\n return false;\n };\n}\n/**\n * Turn off text selection blocking.\n */\n\nfunction unblockTextSelection() {\n document_default.a.onselectstart = function () {\n return true;\n };\n}\n/**\n * Identical to the native `getBoundingClientRect` function, but ensures that\n * the method is supported at all (it is in all browsers we claim to support)\n * and that the element is in the DOM before continuing.\n *\n * This wrapper function also shims properties which are not provided by some\n * older browsers (namely, IE8).\n *\n * Additionally, some browsers do not support adding properties to a\n * `ClientRect`/`DOMRect` object; so, we shallow-copy it with the standard\n * properties (except `x` and `y` which are not widely supported). This helps\n * avoid implementations where keys are non-enumerable.\n *\n * @param {Element} el\n * Element whose `ClientRect` we want to calculate.\n *\n * @return {Object|undefined}\n * Always returns a plain object - or `undefined` if it cannot.\n */\n\nfunction getBoundingClientRect(el) {\n if (el && el.getBoundingClientRect && el.parentNode) {\n var rect = el.getBoundingClientRect();\n var result = {};\n ['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(function (k) {\n if (rect[k] !== undefined) {\n result[k] = rect[k];\n }\n });\n\n if (!result.height) {\n result.height = parseFloat(computedStyle(el, 'height'));\n }\n\n if (!result.width) {\n result.width = parseFloat(computedStyle(el, 'width'));\n }\n\n return result;\n }\n}\n/**\n * Represents the position of a DOM element on the page.\n *\n * @typedef {Object} module:dom~Position\n *\n * @property {number} left\n * Pixels to the left.\n *\n * @property {number} top\n * Pixels from the top.\n */\n\n/**\n * Get the position of an element in the DOM.\n *\n * Uses `getBoundingClientRect` technique from John Resig.\n *\n * @see http://ejohn.org/blog/getboundingclientrect-is-awesome/\n *\n * @param {Element} el\n * Element from which to get offset.\n *\n * @return {module:dom~Position}\n * The position of the element that was passed in.\n */\n\nfunction findPosition(el) {\n if (!el || el && !el.offsetParent) {\n return {\n left: 0,\n top: 0,\n width: 0,\n height: 0\n };\n }\n\n var width = el.offsetWidth;\n var height = el.offsetHeight;\n var left = 0;\n var top = 0;\n\n while (el.offsetParent && el !== document_default.a[FullscreenApi.fullscreenElement]) {\n left += el.offsetLeft;\n top += el.offsetTop;\n el = el.offsetParent;\n }\n\n return {\n left: left,\n top: top,\n width: width,\n height: height\n };\n}\n/**\n * Represents x and y coordinates for a DOM element or mouse pointer.\n *\n * @typedef {Object} module:dom~Coordinates\n *\n * @property {number} x\n * x coordinate in pixels\n *\n * @property {number} y\n * y coordinate in pixels\n */\n\n/**\n * Get the pointer position within an element.\n *\n * The base on the coordinates are the bottom left of the element.\n *\n * @param {Element} el\n * Element on which to get the pointer position on.\n *\n * @param {EventTarget~Event} event\n * Event object.\n *\n * @return {module:dom~Coordinates}\n * A coordinates object corresponding to the mouse position.\n *\n */\n\nfunction getPointerPosition(el, event) {\n var translated = {\n x: 0,\n y: 0\n };\n\n if (IS_IOS) {\n var item = el;\n\n while (item && item.nodeName.toLowerCase() !== 'html') {\n var transform = computedStyle(item, 'transform');\n\n if (/^matrix/.test(transform)) {\n var values = transform.slice(7, -1).split(/,\\s/).map(Number);\n translated.x += values[4];\n translated.y += values[5];\n } else if (/^matrix3d/.test(transform)) {\n var _values = transform.slice(9, -1).split(/,\\s/).map(Number);\n\n translated.x += _values[12];\n translated.y += _values[13];\n }\n\n item = item.parentNode;\n }\n }\n\n var position = {};\n var boxTarget = findPosition(event.target);\n var box = findPosition(el);\n var boxW = box.width;\n var boxH = box.height;\n var offsetY = event.offsetY - (box.top - boxTarget.top);\n var offsetX = event.offsetX - (box.left - boxTarget.left);\n\n if (event.changedTouches) {\n offsetX = event.changedTouches[0].pageX - box.left;\n offsetY = event.changedTouches[0].pageY + box.top;\n\n if (IS_IOS) {\n offsetX -= translated.x;\n offsetY -= translated.y;\n }\n }\n\n position.y = 1 - Math.max(0, Math.min(1, offsetY / boxH));\n position.x = Math.max(0, Math.min(1, offsetX / boxW));\n return position;\n}\n/**\n * Determines, via duck typing, whether or not a value is a text node.\n *\n * @param {Mixed} value\n * Check if this value is a text node.\n *\n * @return {boolean}\n * Will be `true` if the value is a text node, `false` otherwise.\n */\n\nfunction isTextNode(value) {\n return video_es_isObject(value) && value.nodeType === 3;\n}\n/**\n * Empties the contents of an element.\n *\n * @param {Element} el\n * The element to empty children from\n *\n * @return {Element}\n * The element with no children\n */\n\nfunction emptyEl(el) {\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n\n return el;\n}\n/**\n * This is a mixed value that describes content to be injected into the DOM\n * via some method. It can be of the following types:\n *\n * Type | Description\n * -----------|-------------\n * `string` | The value will be normalized into a text node.\n * `Element` | The value will be accepted as-is.\n * `TextNode` | The value will be accepted as-is.\n * `Array` | A one-dimensional array of strings, elements, text nodes, or functions. These functions should return a string, element, or text node (any other return value, like an array, will be ignored).\n * `Function` | A function, which is expected to return a string, element, text node, or array - any of the other possible values described above. This means that a content descriptor could be a function that returns an array of functions, but those second-level functions must return strings, elements, or text nodes.\n *\n * @typedef {string|Element|TextNode|Array|Function} module:dom~ContentDescriptor\n */\n\n/**\n * Normalizes content for eventual insertion into the DOM.\n *\n * This allows a wide range of content definition methods, but helps protect\n * from falling into the trap of simply writing to `innerHTML`, which could\n * be an XSS concern.\n *\n * The content for an element can be passed in multiple types and\n * combinations, whose behavior is as follows:\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Array}\n * All of the content that was passed in, normalized to an array of\n * elements or text nodes.\n */\n\nfunction normalizeContent(content) {\n // First, invoke content if it is a function. If it produces an array,\n // that needs to happen before normalization.\n if (typeof content === 'function') {\n content = content();\n } // Next up, normalize to an array, so one or many items can be normalized,\n // filtered, and returned.\n\n\n return (Array.isArray(content) ? content : [content]).map(function (value) {\n // First, invoke value if it is a function to produce a new value,\n // which will be subsequently normalized to a Node of some kind.\n if (typeof value === 'function') {\n value = value();\n }\n\n if (isEl(value) || isTextNode(value)) {\n return value;\n }\n\n if (typeof value === 'string' && /\\S/.test(value)) {\n return document_default.a.createTextNode(value);\n }\n }).filter(function (value) {\n return value;\n });\n}\n/**\n * Normalizes and appends content to an element.\n *\n * @param {Element} el\n * Element to append normalized content to.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Element}\n * The element with appended normalized content.\n */\n\nfunction appendContent(el, content) {\n normalizeContent(content).forEach(function (node) {\n return el.appendChild(node);\n });\n return el;\n}\n/**\n * Normalizes and inserts content into an element; this is identical to\n * `appendContent()`, except it empties the element first.\n *\n * @param {Element} el\n * Element to insert normalized content into.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Element}\n * The element with inserted normalized content.\n */\n\nfunction insertContent(el, content) {\n return appendContent(emptyEl(el), content);\n}\n/**\n * Check if an event was a single left click.\n *\n * @param {EventTarget~Event} event\n * Event object.\n *\n * @return {boolean}\n * Will be `true` if a single left click, `false` otherwise.\n */\n\nfunction isSingleLeftClick(event) {\n // Note: if you create something draggable, be sure to\n // call it on both `mousedown` and `mousemove` event,\n // otherwise `mousedown` should be enough for a button\n if (event.button === undefined && event.buttons === undefined) {\n // Why do we need `buttons` ?\n // Because, middle mouse sometimes have this:\n // e.button === 0 and e.buttons === 4\n // Furthermore, we want to prevent combination click, something like\n // HOLD middlemouse then left click, that would be\n // e.button === 0, e.buttons === 5\n // just `button` is not gonna work\n // Alright, then what this block does ?\n // this is for chrome `simulate mobile devices`\n // I want to support this as well\n return true;\n }\n\n if (event.button === 0 && event.buttons === undefined) {\n // Touch screen, sometimes on some specific device, `buttons`\n // doesn't have anything (safari on ios, blackberry...)\n return true;\n } // `mouseup` event on a single left click has\n // `button` and `buttons` equal to 0\n\n\n if (event.type === 'mouseup' && event.button === 0 && event.buttons === 0) {\n return true;\n }\n\n if (event.button !== 0 || event.buttons !== 1) {\n // This is the reason we have those if else block above\n // if any special case we can catch and let it slide\n // we do it above, when get to here, this definitely\n // is-not-left-click\n return false;\n }\n\n return true;\n}\n/**\n * Finds a single DOM element matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param {Element|String} [context=document]\n * A DOM element within which to query. Can also be a selector\n * string in which case the first matching element will be used\n * as context. If missing (or no element matches selector), falls\n * back to `document`.\n *\n * @return {Element|null}\n * The element that was found or null.\n */\n\nvar $ = createQuerier('querySelector');\n/**\n * Finds a all DOM elements matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param {Element|String} [context=document]\n * A DOM element within which to query. Can also be a selector\n * string in which case the first matching element will be used\n * as context. If missing (or no element matches selector), falls\n * back to `document`.\n *\n * @return {NodeList}\n * A element list of elements that were found. Will be empty if none\n * were found.\n *\n */\n\nvar $$ = createQuerier('querySelectorAll');\n\nvar Dom = /*#__PURE__*/Object.freeze({\n __proto__: null,\n isReal: isReal,\n isEl: isEl,\n isInFrame: isInFrame,\n createEl: video_es_createEl,\n textContent: textContent,\n prependTo: prependTo,\n hasClass: hasClass,\n addClass: addClass,\n removeClass: removeClass,\n toggleClass: toggleClass,\n setAttributes: setAttributes,\n getAttributes: getAttributes,\n getAttribute: getAttribute,\n setAttribute: setAttribute,\n removeAttribute: removeAttribute,\n blockTextSelection: blockTextSelection,\n unblockTextSelection: unblockTextSelection,\n getBoundingClientRect: getBoundingClientRect,\n findPosition: findPosition,\n getPointerPosition: getPointerPosition,\n isTextNode: isTextNode,\n emptyEl: emptyEl,\n normalizeContent: normalizeContent,\n appendContent: appendContent,\n insertContent: insertContent,\n isSingleLeftClick: isSingleLeftClick,\n $: $,\n $$: $$\n});\n\n/**\n * @file setup.js - Functions for setting up a player without\n * user interaction based on the data-setup `attribute` of the video tag.\n *\n * @module setup\n */\nvar _windowLoaded = false;\nvar videojs$1;\n/**\n * Set up any tags that have a data-setup `attribute` when the player is started.\n */\n\nvar video_es_autoSetup = function autoSetup() {\n if (videojs$1.options.autoSetup === false) {\n return;\n }\n\n var vids = Array.prototype.slice.call(document_default.a.getElementsByTagName('video'));\n var audios = Array.prototype.slice.call(document_default.a.getElementsByTagName('audio'));\n var divs = Array.prototype.slice.call(document_default.a.getElementsByTagName('video-js'));\n var mediaEls = vids.concat(audios, divs); // Check if any media elements exist\n\n if (mediaEls && mediaEls.length > 0) {\n for (var i = 0, e = mediaEls.length; i < e; i++) {\n var mediaEl = mediaEls[i]; // Check if element exists, has getAttribute func.\n\n if (mediaEl && mediaEl.getAttribute) {\n // Make sure this player hasn't already been set up.\n if (mediaEl.player === undefined) {\n var options = mediaEl.getAttribute('data-setup'); // Check if data-setup attr exists.\n // We only auto-setup if they've added the data-setup attr.\n\n if (options !== null) {\n // Create new video.js instance.\n videojs$1(mediaEl);\n }\n } // If getAttribute isn't defined, we need to wait for the DOM.\n\n } else {\n autoSetupTimeout(1);\n break;\n }\n } // No videos were found, so keep looping unless page is finished loading.\n\n } else if (!_windowLoaded) {\n autoSetupTimeout(1);\n }\n};\n/**\n * Wait until the page is loaded before running autoSetup. This will be called in\n * autoSetup if `hasLoaded` returns false.\n *\n * @param {number} wait\n * How long to wait in ms\n *\n * @param {module:videojs} [vjs]\n * The videojs library function\n */\n\n\nfunction autoSetupTimeout(wait, vjs) {\n // Protect against breakage in non-browser environments\n if (!isReal()) {\n return;\n }\n\n if (vjs) {\n videojs$1 = vjs;\n }\n\n window_default.a.setTimeout(video_es_autoSetup, wait);\n}\n/**\n * Used to set the internal tracking of window loaded state to true.\n *\n * @private\n */\n\n\nfunction setWindowLoaded() {\n _windowLoaded = true;\n window_default.a.removeEventListener('load', setWindowLoaded);\n}\n\nif (isReal()) {\n if (document_default.a.readyState === 'complete') {\n setWindowLoaded();\n } else {\n /**\n * Listen for the load event on window, and set _windowLoaded to true.\n *\n * We use a standard event listener here to avoid incrementing the GUID\n * before any players are created.\n *\n * @listens load\n */\n window_default.a.addEventListener('load', setWindowLoaded);\n }\n}\n\n/**\n * @file stylesheet.js\n * @module stylesheet\n */\n/**\n * Create a DOM syle element given a className for it.\n *\n * @param {string} className\n * The className to add to the created style element.\n *\n * @return {Element}\n * The element that was created.\n */\n\nvar video_es_createStyleElement = function createStyleElement(className) {\n var style = document_default.a.createElement('style');\n style.className = className;\n return style;\n};\n/**\n * Add text to a DOM element.\n *\n * @param {Element} el\n * The Element to add text content to.\n *\n * @param {string} content\n * The text to add to the element.\n */\n\nvar setTextContent = function setTextContent(el, content) {\n if (el.styleSheet) {\n el.styleSheet.cssText = content;\n } else {\n el.textContent = content;\n }\n};\n\n/**\n * @file guid.js\n * @module guid\n */\n// Default value for GUIDs. This allows us to reset the GUID counter in tests.\n//\n// The initial GUID is 3 because some users have come to rely on the first\n// default player ID ending up as `vjs_video_3`.\n//\n// See: https://github.com/videojs/video.js/pull/6216\nvar _initialGuid = 3;\n/**\n * Unique ID for an element or function\n *\n * @type {Number}\n */\n\nvar _guid = _initialGuid;\n/**\n * Get a unique auto-incrementing ID by number that has not been returned before.\n *\n * @return {number}\n * A new unique ID.\n */\n\nfunction newGUID() {\n return _guid++;\n}\n\n/**\n * @file dom-data.js\n * @module dom-data\n */\nvar video_es_FakeWeakMap;\n\nif (!window_default.a.WeakMap) {\n video_es_FakeWeakMap = /*#__PURE__*/function () {\n function FakeWeakMap() {\n this.vdata = 'vdata' + Math.floor(window_default.a.performance && window_default.a.performance.now() || Date.now());\n this.data = {};\n }\n\n var _proto = FakeWeakMap.prototype;\n\n _proto.set = function set(key, value) {\n var access = key[this.vdata] || newGUID();\n\n if (!key[this.vdata]) {\n key[this.vdata] = access;\n }\n\n this.data[access] = value;\n return this;\n };\n\n _proto.get = function get(key) {\n var access = key[this.vdata]; // we have data, return it\n\n if (access) {\n return this.data[access];\n } // we don't have data, return nothing.\n // return undefined explicitly as that's the contract for this method\n\n\n log$1('We have no data for this element', key);\n return undefined;\n };\n\n _proto.has = function has(key) {\n var access = key[this.vdata];\n return access in this.data;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var access = key[this.vdata];\n\n if (access) {\n delete this.data[access];\n delete key[this.vdata];\n }\n };\n\n return FakeWeakMap;\n }();\n}\n/**\n * Element Data Store.\n *\n * Allows for binding data to an element without putting it directly on the\n * element. Ex. Event listeners are stored here.\n * (also from jsninja.com, slightly modified and updated for closure compiler)\n *\n * @type {Object}\n * @private\n */\n\n\nvar DomData = window_default.a.WeakMap ? new WeakMap() : new video_es_FakeWeakMap();\n\n/**\n * @file events.js. An Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/)\n * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible)\n * This should work very similarly to jQuery's events, however it's based off the book version which isn't as\n * robust as jquery's, so there's probably some differences.\n *\n * @file events.js\n * @module events\n */\n/**\n * Clean up the listener cache and dispatchers\n *\n * @param {Element|Object} elem\n * Element to clean up\n *\n * @param {string} type\n * Type of event to clean up\n */\n\nfunction _cleanUpEvents(elem, type) {\n if (!DomData.has(elem)) {\n return;\n }\n\n var data = DomData.get(elem); // Remove the events of a particular type if there are none left\n\n if (data.handlers[type].length === 0) {\n delete data.handlers[type]; // data.handlers[type] = null;\n // Setting to null was causing an error with data.handlers\n // Remove the meta-handler from the element\n\n if (elem.removeEventListener) {\n elem.removeEventListener(type, data.dispatcher, false);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + type, data.dispatcher);\n }\n } // Remove the events object if there are no types left\n\n\n if (Object.getOwnPropertyNames(data.handlers).length <= 0) {\n delete data.handlers;\n delete data.dispatcher;\n delete data.disabled;\n } // Finally remove the element data if there is no data left\n\n\n if (Object.getOwnPropertyNames(data).length === 0) {\n DomData[\"delete\"](elem);\n }\n}\n/**\n * Loops through an array of event types and calls the requested method for each type.\n *\n * @param {Function} fn\n * The event method we want to use.\n *\n * @param {Element|Object} elem\n * Element or object to bind listeners to\n *\n * @param {string} type\n * Type of event to bind to.\n *\n * @param {EventTarget~EventListener} callback\n * Event listener.\n */\n\n\nfunction _handleMultipleEvents(fn, elem, types, callback) {\n types.forEach(function (type) {\n // Call the event method for each one of the types\n fn(elem, type, callback);\n });\n}\n/**\n * Fix a native event to have standard property values\n *\n * @param {Object} event\n * Event object to fix.\n *\n * @return {Object}\n * Fixed event object.\n */\n\n\nfunction fixEvent(event) {\n if (event.fixed_) {\n return event;\n }\n\n function returnTrue() {\n return true;\n }\n\n function returnFalse() {\n return false;\n } // Test if fixing up is needed\n // Used to check if !event.stopPropagation instead of isPropagationStopped\n // But native events return true for stopPropagation, but don't have\n // other expected methods like isPropagationStopped. Seems to be a problem\n // with the Javascript Ninja code. So we're just overriding all events now.\n\n\n if (!event || !event.isPropagationStopped || !event.isImmediatePropagationStopped) {\n var old = event || window_default.a.event;\n event = {}; // Clone the old object so that we can modify the values event = {};\n // IE8 Doesn't like when you mess with native event properties\n // Firefox returns false for event.hasOwnProperty('type') and other props\n // which makes copying more difficult.\n // TODO: Probably best to create a whitelist of event props\n\n for (var key in old) {\n // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y\n // Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation\n // and webkitMovementX/Y\n if (key !== 'layerX' && key !== 'layerY' && key !== 'keyLocation' && key !== 'webkitMovementX' && key !== 'webkitMovementY') {\n // Chrome 32+ warns if you try to copy deprecated returnValue, but\n // we still want to if preventDefault isn't supported (IE8).\n if (!(key === 'returnValue' && old.preventDefault)) {\n event[key] = old[key];\n }\n }\n } // The event occurred on this element\n\n\n if (!event.target) {\n event.target = event.srcElement || document_default.a;\n } // Handle which other element the event is related to\n\n\n if (!event.relatedTarget) {\n event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;\n } // Stop the default browser action\n\n\n event.preventDefault = function () {\n if (old.preventDefault) {\n old.preventDefault();\n }\n\n event.returnValue = false;\n old.returnValue = false;\n event.defaultPrevented = true;\n };\n\n event.defaultPrevented = false; // Stop the event from bubbling\n\n event.stopPropagation = function () {\n if (old.stopPropagation) {\n old.stopPropagation();\n }\n\n event.cancelBubble = true;\n old.cancelBubble = true;\n event.isPropagationStopped = returnTrue;\n };\n\n event.isPropagationStopped = returnFalse; // Stop the event from bubbling and executing other handlers\n\n event.stopImmediatePropagation = function () {\n if (old.stopImmediatePropagation) {\n old.stopImmediatePropagation();\n }\n\n event.isImmediatePropagationStopped = returnTrue;\n event.stopPropagation();\n };\n\n event.isImmediatePropagationStopped = returnFalse; // Handle mouse position\n\n if (event.clientX !== null && event.clientX !== undefined) {\n var doc = document_default.a.documentElement;\n var body = document_default.a.body;\n event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);\n event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);\n } // Handle key presses\n\n\n event.which = event.charCode || event.keyCode; // Fix button for mouse clicks:\n // 0 == left; 1 == middle; 2 == right\n\n if (event.button !== null && event.button !== undefined) {\n // The following is disabled because it does not pass videojs-standard\n // and... yikes.\n\n /* eslint-disable */\n event.button = event.button & 1 ? 0 : event.button & 4 ? 1 : event.button & 2 ? 2 : 0;\n /* eslint-enable */\n }\n }\n\n event.fixed_ = true; // Returns fixed-up instance\n\n return event;\n}\n/**\n * Whether passive event listeners are supported\n */\n\nvar _supportsPassive;\n\nvar video_es_supportsPassive = function supportsPassive() {\n if (typeof _supportsPassive !== 'boolean') {\n _supportsPassive = false;\n\n try {\n var opts = Object.defineProperty({}, 'passive', {\n get: function get() {\n _supportsPassive = true;\n }\n });\n window_default.a.addEventListener('test', null, opts);\n window_default.a.removeEventListener('test', null, opts);\n } catch (e) {// disregard\n }\n }\n\n return _supportsPassive;\n};\n/**\n * Touch events Chrome expects to be passive\n */\n\n\nvar passiveEvents = ['touchstart', 'touchmove'];\n/**\n * Add an event listener to element\n * It stores the handler function in a separate cache object\n * and adds a generic handler to the element's event,\n * along with a unique id (guid) to the element.\n *\n * @param {Element|Object} elem\n * Element or object to bind listeners to\n *\n * @param {string|string[]} type\n * Type of event to bind to.\n *\n * @param {EventTarget~EventListener} fn\n * Event listener.\n */\n\nfunction on(elem, type, fn) {\n if (Array.isArray(type)) {\n return _handleMultipleEvents(on, elem, type, fn);\n }\n\n if (!DomData.has(elem)) {\n DomData.set(elem, {});\n }\n\n var data = DomData.get(elem); // We need a place to store all our handler data\n\n if (!data.handlers) {\n data.handlers = {};\n }\n\n if (!data.handlers[type]) {\n data.handlers[type] = [];\n }\n\n if (!fn.guid) {\n fn.guid = newGUID();\n }\n\n data.handlers[type].push(fn);\n\n if (!data.dispatcher) {\n data.disabled = false;\n\n data.dispatcher = function (event, hash) {\n if (data.disabled) {\n return;\n }\n\n event = fixEvent(event);\n var handlers = data.handlers[event.type];\n\n if (handlers) {\n // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off.\n var handlersCopy = handlers.slice(0);\n\n for (var m = 0, n = handlersCopy.length; m < n; m++) {\n if (event.isImmediatePropagationStopped()) {\n break;\n } else {\n try {\n handlersCopy[m].call(elem, event, hash);\n } catch (e) {\n log$1.error(e);\n }\n }\n }\n }\n };\n }\n\n if (data.handlers[type].length === 1) {\n if (elem.addEventListener) {\n var options = false;\n\n if (video_es_supportsPassive() && passiveEvents.indexOf(type) > -1) {\n options = {\n passive: true\n };\n }\n\n elem.addEventListener(type, data.dispatcher, options);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + type, data.dispatcher);\n }\n }\n}\n/**\n * Removes event listeners from an element\n *\n * @param {Element|Object} elem\n * Object to remove listeners from.\n *\n * @param {string|string[]} [type]\n * Type of listener to remove. Don't include to remove all events from element.\n *\n * @param {EventTarget~EventListener} [fn]\n * Specific listener to remove. Don't include to remove listeners for an event\n * type.\n */\n\nfunction off(elem, type, fn) {\n // Don't want to add a cache object through getElData if not needed\n if (!DomData.has(elem)) {\n return;\n }\n\n var data = DomData.get(elem); // If no events exist, nothing to unbind\n\n if (!data.handlers) {\n return;\n }\n\n if (Array.isArray(type)) {\n return _handleMultipleEvents(off, elem, type, fn);\n } // Utility function\n\n\n var removeType = function removeType(el, t) {\n data.handlers[t] = [];\n\n _cleanUpEvents(el, t);\n }; // Are we removing all bound events?\n\n\n if (type === undefined) {\n for (var t in data.handlers) {\n if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t)) {\n removeType(elem, t);\n }\n }\n\n return;\n }\n\n var handlers = data.handlers[type]; // If no handlers exist, nothing to unbind\n\n if (!handlers) {\n return;\n } // If no listener was provided, remove all listeners for type\n\n\n if (!fn) {\n removeType(elem, type);\n return;\n } // We're only removing a single handler\n\n\n if (fn.guid) {\n for (var n = 0; n < handlers.length; n++) {\n if (handlers[n].guid === fn.guid) {\n handlers.splice(n--, 1);\n }\n }\n }\n\n _cleanUpEvents(elem, type);\n}\n/**\n * Trigger an event for an element\n *\n * @param {Element|Object} elem\n * Element to trigger an event on\n *\n * @param {EventTarget~Event|string} event\n * A string (the type) or an event object with a type attribute\n *\n * @param {Object} [hash]\n * data hash to pass along with the event\n *\n * @return {boolean|undefined}\n * Returns the opposite of `defaultPrevented` if default was\n * prevented. Otherwise, returns `undefined`\n */\n\nfunction trigger(elem, event, hash) {\n // Fetches element data and a reference to the parent (for bubbling).\n // Don't want to add a data object to cache for every parent,\n // so checking hasElData first.\n var elemData = DomData.has(elem) ? DomData.get(elem) : {};\n var parent = elem.parentNode || elem.ownerDocument; // type = event.type || event,\n // handler;\n // If an event name was passed as a string, creates an event out of it\n\n if (typeof event === 'string') {\n event = {\n type: event,\n target: elem\n };\n } else if (!event.target) {\n event.target = elem;\n } // Normalizes the event properties.\n\n\n event = fixEvent(event); // If the passed element has a dispatcher, executes the established handlers.\n\n if (elemData.dispatcher) {\n elemData.dispatcher.call(elem, event, hash);\n } // Unless explicitly stopped or the event does not bubble (e.g. media events)\n // recursively calls this function to bubble the event up the DOM.\n\n\n if (parent && !event.isPropagationStopped() && event.bubbles === true) {\n trigger.call(null, parent, event, hash); // If at the top of the DOM, triggers the default action unless disabled.\n } else if (!parent && !event.defaultPrevented && event.target && event.target[event.type]) {\n if (!DomData.has(event.target)) {\n DomData.set(event.target, {});\n }\n\n var targetData = DomData.get(event.target); // Checks if the target has a default action for this event.\n\n if (event.target[event.type]) {\n // Temporarily disables event dispatching on the target as we have already executed the handler.\n targetData.disabled = true; // Executes the default action.\n\n if (typeof event.target[event.type] === 'function') {\n event.target[event.type]();\n } // Re-enables event dispatching.\n\n\n targetData.disabled = false;\n }\n } // Inform the triggerer if the default was prevented by returning false\n\n\n return !event.defaultPrevented;\n}\n/**\n * Trigger a listener only once for an event.\n *\n * @param {Element|Object} elem\n * Element or object to bind to.\n *\n * @param {string|string[]} type\n * Name/type of event\n *\n * @param {Event~EventListener} fn\n * Event listener function\n */\n\nfunction one(elem, type, fn) {\n if (Array.isArray(type)) {\n return _handleMultipleEvents(one, elem, type, fn);\n }\n\n var func = function func() {\n off(elem, type, func);\n fn.apply(this, arguments);\n }; // copy the guid to the new function so it can removed using the original function's ID\n\n\n func.guid = fn.guid = fn.guid || newGUID();\n on(elem, type, func);\n}\n/**\n * Trigger a listener only once and then turn if off for all\n * configured events\n *\n * @param {Element|Object} elem\n * Element or object to bind to.\n *\n * @param {string|string[]} type\n * Name/type of event\n *\n * @param {Event~EventListener} fn\n * Event listener function\n */\n\nfunction any(elem, type, fn) {\n var func = function func() {\n off(elem, type, func);\n fn.apply(this, arguments);\n }; // copy the guid to the new function so it can removed using the original function's ID\n\n\n func.guid = fn.guid = fn.guid || newGUID(); // multiple ons, but one off for everything\n\n on(elem, type, func);\n}\n\nvar Events = /*#__PURE__*/Object.freeze({\n __proto__: null,\n fixEvent: fixEvent,\n on: on,\n off: off,\n trigger: trigger,\n one: one,\n any: any\n});\n\n/**\n * @file fn.js\n * @module fn\n */\nvar UPDATE_REFRESH_INTERVAL = 30;\n/**\n * Bind (a.k.a proxy or context). A simple method for changing the context of\n * a function.\n *\n * It also stores a unique id on the function so it can be easily removed from\n * events.\n *\n * @function\n * @param {Mixed} context\n * The object to bind as scope.\n *\n * @param {Function} fn\n * The function to be bound to a scope.\n *\n * @param {number} [uid]\n * An optional unique ID for the function to be set\n *\n * @return {Function}\n * The new function that will be bound into the context given\n */\n\nvar bind = function bind(context, fn, uid) {\n // Make sure the function has a unique ID\n if (!fn.guid) {\n fn.guid = newGUID();\n } // Create the new function that changes the context\n\n\n var bound = fn.bind(context); // Allow for the ability to individualize this function\n // Needed in the case where multiple objects might share the same prototype\n // IF both items add an event listener with the same function, then you try to remove just one\n // it will remove both because they both have the same guid.\n // when using this, you need to use the bind method when you remove the listener as well.\n // currently used in text tracks\n\n bound.guid = uid ? uid + '_' + fn.guid : fn.guid;\n return bound;\n};\n/**\n * Wraps the given function, `fn`, with a new function that only invokes `fn`\n * at most once per every `wait` milliseconds.\n *\n * @function\n * @param {Function} fn\n * The function to be throttled.\n *\n * @param {number} wait\n * The number of milliseconds by which to throttle.\n *\n * @return {Function}\n */\n\nvar video_es_throttle = function throttle(fn, wait) {\n var last = window_default.a.performance.now();\n\n var throttled = function throttled() {\n var now = window_default.a.performance.now();\n\n if (now - last >= wait) {\n fn.apply(void 0, arguments);\n last = now;\n }\n };\n\n return throttled;\n};\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked.\n *\n * Inspired by lodash and underscore implementations.\n *\n * @function\n * @param {Function} func\n * The function to wrap with debounce behavior.\n *\n * @param {number} wait\n * The number of milliseconds to wait after the last invocation.\n *\n * @param {boolean} [immediate]\n * Whether or not to invoke the function immediately upon creation.\n *\n * @param {Object} [context=window]\n * The \"context\" in which the debounced function should debounce. For\n * example, if this function should be tied to a Video.js player,\n * the player can be passed here. Alternatively, defaults to the\n * global `window` object.\n *\n * @return {Function}\n * A debounced function.\n */\n\nvar video_es_debounce = function debounce(func, wait, immediate, context) {\n if (context === void 0) {\n context = window_default.a;\n }\n\n var timeout;\n\n var cancel = function cancel() {\n context.clearTimeout(timeout);\n timeout = null;\n };\n /* eslint-disable consistent-this */\n\n\n var debounced = function debounced() {\n var self = this;\n var args = arguments;\n\n var _later = function later() {\n timeout = null;\n _later = null;\n\n if (!immediate) {\n func.apply(self, args);\n }\n };\n\n if (!timeout && immediate) {\n func.apply(self, args);\n }\n\n context.clearTimeout(timeout);\n timeout = context.setTimeout(_later, wait);\n };\n /* eslint-enable consistent-this */\n\n\n debounced.cancel = cancel;\n return debounced;\n};\n\n/**\n * @file src/js/event-target.js\n */\n/**\n * `EventTarget` is a class that can have the same API as the DOM `EventTarget`. It\n * adds shorthand functions that wrap around lengthy functions. For example:\n * the `on` function is a wrapper around `addEventListener`.\n *\n * @see [EventTarget Spec]{@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget}\n * @class EventTarget\n */\n\nvar EventTarget$2 = function EventTarget() {};\n/**\n * A Custom DOM event.\n *\n * @typedef {Object} EventTarget~Event\n * @see [Properties]{@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent}\n */\n\n/**\n * All event listeners should follow the following format.\n *\n * @callback EventTarget~EventListener\n * @this {EventTarget}\n *\n * @param {EventTarget~Event} event\n * the event that triggered this function\n *\n * @param {Object} [hash]\n * hash of data sent during the event\n */\n\n/**\n * An object containing event names as keys and booleans as values.\n *\n * > NOTE: If an event name is set to a true value here {@link EventTarget#trigger}\n * will have extra functionality. See that function for more information.\n *\n * @property EventTarget.prototype.allowedEvents_\n * @private\n */\n\n\nEventTarget$2.prototype.allowedEvents_ = {};\n/**\n * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a\n * function that will get called when an event with a certain name gets triggered.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to call with `EventTarget`s\n */\n\nEventTarget$2.prototype.on = function (type, fn) {\n // Remove the addEventListener alias before calling Events.on\n // so we don't get into an infinite type loop\n var ael = this.addEventListener;\n\n this.addEventListener = function () {};\n\n on(this, type, fn);\n this.addEventListener = ael;\n};\n/**\n * An alias of {@link EventTarget#on}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#on}\n */\n\n\nEventTarget$2.prototype.addEventListener = EventTarget$2.prototype.on;\n/**\n * Removes an `event listener` for a specific event from an instance of `EventTarget`.\n * This makes it so that the `event listener` will no longer get called when the\n * named event happens.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to remove.\n */\n\nEventTarget$2.prototype.off = function (type, fn) {\n off(this, type, fn);\n};\n/**\n * An alias of {@link EventTarget#off}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#off}\n */\n\n\nEventTarget$2.prototype.removeEventListener = EventTarget$2.prototype.off;\n/**\n * This function will add an `event listener` that gets triggered only once. After the\n * first trigger it will get removed. This is like adding an `event listener`\n * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to be called once for each event name.\n */\n\nEventTarget$2.prototype.one = function (type, fn) {\n // Remove the addEventListener aliasing Events.on\n // so we don't get into an infinite type loop\n var ael = this.addEventListener;\n\n this.addEventListener = function () {};\n\n one(this, type, fn);\n this.addEventListener = ael;\n};\n\nEventTarget$2.prototype.any = function (type, fn) {\n // Remove the addEventListener aliasing Events.on\n // so we don't get into an infinite type loop\n var ael = this.addEventListener;\n\n this.addEventListener = function () {};\n\n any(this, type, fn);\n this.addEventListener = ael;\n};\n/**\n * This function causes an event to happen. This will then cause any `event listeners`\n * that are waiting for that event, to get called. If there are no `event listeners`\n * for an event then nothing will happen.\n *\n * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`.\n * Trigger will also call the `on` + `uppercaseEventName` function.\n *\n * Example:\n * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call\n * `onClick` if it exists.\n *\n * @param {string|EventTarget~Event|Object} event\n * The name of the event, an `Event`, or an object with a key of type set to\n * an event name.\n */\n\n\nEventTarget$2.prototype.trigger = function (event) {\n var type = event.type || event; // deprecation\n // In a future version we should default target to `this`\n // similar to how we default the target to `elem` in\n // `Events.trigger`. Right now the default `target` will be\n // `document` due to the `Event.fixEvent` call.\n\n if (typeof event === 'string') {\n event = {\n type: type\n };\n }\n\n event = fixEvent(event);\n\n if (this.allowedEvents_[type] && this['on' + type]) {\n this['on' + type](event);\n }\n\n trigger(this, event);\n};\n/**\n * An alias of {@link EventTarget#trigger}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#trigger}\n */\n\n\nEventTarget$2.prototype.dispatchEvent = EventTarget$2.prototype.trigger;\nvar EVENT_MAP;\n\nEventTarget$2.prototype.queueTrigger = function (event) {\n var _this = this;\n\n // only set up EVENT_MAP if it'll be used\n if (!EVENT_MAP) {\n EVENT_MAP = new Map();\n }\n\n var type = event.type || event;\n var map = EVENT_MAP.get(this);\n\n if (!map) {\n map = new Map();\n EVENT_MAP.set(this, map);\n }\n\n var oldTimeout = map.get(type);\n map[\"delete\"](type);\n window_default.a.clearTimeout(oldTimeout);\n var timeout = window_default.a.setTimeout(function () {\n // if we cleared out all timeouts for the current target, delete its map\n if (map.size === 0) {\n map = null;\n EVENT_MAP[\"delete\"](_this);\n }\n\n _this.trigger(event);\n }, 0);\n map.set(type, timeout);\n};\n\n/**\n * @file mixins/evented.js\n * @module evented\n */\n\nvar objName = function objName(obj) {\n if (typeof obj.name === 'function') {\n return obj.name();\n }\n\n if (typeof obj.name === 'string') {\n return obj.name;\n }\n\n if (obj.name_) {\n return obj.name_;\n }\n\n if (obj.constructor && obj.constructor.name) {\n return obj.constructor.name;\n }\n\n return typeof obj;\n};\n/**\n * Returns whether or not an object has had the evented mixin applied.\n *\n * @param {Object} object\n * An object to test.\n *\n * @return {boolean}\n * Whether or not the object appears to be evented.\n */\n\n\nvar isEvented = function isEvented(object) {\n return object instanceof EventTarget$2 || !!object.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every(function (k) {\n return typeof object[k] === 'function';\n });\n};\n/**\n * Adds a callback to run after the evented mixin applied.\n *\n * @param {Object} object\n * An object to Add\n * @param {Function} callback\n * The callback to run.\n */\n\n\nvar addEventedCallback = function addEventedCallback(target, callback) {\n if (isEvented(target)) {\n callback();\n } else {\n if (!target.eventedCallbacks) {\n target.eventedCallbacks = [];\n }\n\n target.eventedCallbacks.push(callback);\n }\n};\n/**\n * Whether a value is a valid event type - non-empty string or array.\n *\n * @private\n * @param {string|Array} type\n * The type value to test.\n *\n * @return {boolean}\n * Whether or not the type is a valid event type.\n */\n\n\nvar isValidEventType = function isValidEventType(type) {\n return (// The regex here verifies that the `type` contains at least one non-\n // whitespace character.\n typeof type === 'string' && /\\S/.test(type) || Array.isArray(type) && !!type.length\n );\n};\n/**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the target does not appear to be a valid event target.\n *\n * @param {Object} target\n * The object to test.\n *\n * @param {Object} obj\n * The evented object we are validating for\n *\n * @param {string} fnName\n * The name of the evented mixin function that called this.\n */\n\n\nvar validateTarget = function validateTarget(target, obj, fnName) {\n if (!target || !target.nodeName && !isEvented(target)) {\n throw new Error(\"Invalid target for \" + objName(obj) + \"#\" + fnName + \"; must be a DOM node or evented object.\");\n }\n};\n/**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the type does not appear to be a valid event type.\n *\n * @param {string|Array} type\n * The type to test.\n *\n * @param {Object} obj\n* The evented object we are validating for\n *\n * @param {string} fnName\n * The name of the evented mixin function that called this.\n */\n\n\nvar validateEventType = function validateEventType(type, obj, fnName) {\n if (!isValidEventType(type)) {\n throw new Error(\"Invalid event type for \" + objName(obj) + \"#\" + fnName + \"; must be a non-empty string or array.\");\n }\n};\n/**\n * Validates a value to determine if it is a valid listener. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the listener is not a function.\n *\n * @param {Function} listener\n * The listener to test.\n *\n * @param {Object} obj\n * The evented object we are validating for\n *\n * @param {string} fnName\n * The name of the evented mixin function that called this.\n */\n\n\nvar validateListener = function validateListener(listener, obj, fnName) {\n if (typeof listener !== 'function') {\n throw new Error(\"Invalid listener for \" + objName(obj) + \"#\" + fnName + \"; must be a function.\");\n }\n};\n/**\n * Takes an array of arguments given to `on()` or `one()`, validates them, and\n * normalizes them into an object.\n *\n * @private\n * @param {Object} self\n * The evented object on which `on()` or `one()` was called. This\n * object will be bound as the `this` value for the listener.\n *\n * @param {Array} args\n * An array of arguments passed to `on()` or `one()`.\n *\n * @param {string} fnName\n * The name of the evented mixin function that called this.\n *\n * @return {Object}\n * An object containing useful values for `on()` or `one()` calls.\n */\n\n\nvar normalizeListenArgs = function normalizeListenArgs(self, args, fnName) {\n // If the number of arguments is less than 3, the target is always the\n // evented object itself.\n var isTargetingSelf = args.length < 3 || args[0] === self || args[0] === self.eventBusEl_;\n var target;\n var type;\n var listener;\n\n if (isTargetingSelf) {\n target = self.eventBusEl_; // Deal with cases where we got 3 arguments, but we are still listening to\n // the evented object itself.\n\n if (args.length >= 3) {\n args.shift();\n }\n\n type = args[0];\n listener = args[1];\n } else {\n target = args[0];\n type = args[1];\n listener = args[2];\n }\n\n validateTarget(target, self, fnName);\n validateEventType(type, self, fnName);\n validateListener(listener, self, fnName);\n listener = bind(self, listener);\n return {\n isTargetingSelf: isTargetingSelf,\n target: target,\n type: type,\n listener: listener\n };\n};\n/**\n * Adds the listener to the event type(s) on the target, normalizing for\n * the type of target.\n *\n * @private\n * @param {Element|Object} target\n * A DOM node or evented object.\n *\n * @param {string} method\n * The event binding method to use (\"on\" or \"one\").\n *\n * @param {string|Array} type\n * One or more event type(s).\n *\n * @param {Function} listener\n * A listener function.\n */\n\n\nvar listen = function listen(target, method, type, listener) {\n validateTarget(target, target, method);\n\n if (target.nodeName) {\n Events[method](target, type, listener);\n } else {\n target[method](type, listener);\n }\n};\n/**\n * Contains methods that provide event capabilities to an object which is passed\n * to {@link module:evented|evented}.\n *\n * @mixin EventedMixin\n */\n\n\nvar EventedMixin = {\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n on: function on() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var _normalizeListenArgs = normalizeListenArgs(this, args, 'on'),\n isTargetingSelf = _normalizeListenArgs.isTargetingSelf,\n target = _normalizeListenArgs.target,\n type = _normalizeListenArgs.type,\n listener = _normalizeListenArgs.listener;\n\n listen(target, 'on', type, listener); // If this object is listening to another evented object.\n\n if (!isTargetingSelf) {\n // If this object is disposed, remove the listener.\n var removeListenerOnDispose = function removeListenerOnDispose() {\n return _this.off(target, type, listener);\n }; // Use the same function ID as the listener so we can remove it later it\n // using the ID of the original listener.\n\n\n removeListenerOnDispose.guid = listener.guid; // Add a listener to the target's dispose event as well. This ensures\n // that if the target is disposed BEFORE this object, we remove the\n // removal listener that was just added. Otherwise, we create a memory leak.\n\n var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose() {\n return _this.off('dispose', removeListenerOnDispose);\n }; // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n\n\n removeRemoverOnTargetDispose.guid = listener.guid;\n listen(this, 'on', 'dispose', removeListenerOnDispose);\n listen(target, 'on', 'dispose', removeRemoverOnTargetDispose);\n }\n },\n\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object. The listener will be called once per event and then removed.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n one: function one() {\n var _this2 = this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var _normalizeListenArgs2 = normalizeListenArgs(this, args, 'one'),\n isTargetingSelf = _normalizeListenArgs2.isTargetingSelf,\n target = _normalizeListenArgs2.target,\n type = _normalizeListenArgs2.type,\n listener = _normalizeListenArgs2.listener; // Targeting this evented object.\n\n\n if (isTargetingSelf) {\n listen(target, 'one', type, listener); // Targeting another evented object.\n } else {\n // TODO: This wrapper is incorrect! It should only\n // remove the wrapper for the event type that called it.\n // Instead all listners are removed on the first trigger!\n // see https://github.com/videojs/video.js/issues/5962\n var wrapper = function wrapper() {\n _this2.off(target, type, wrapper);\n\n for (var _len3 = arguments.length, largs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n largs[_key3] = arguments[_key3];\n }\n\n listener.apply(null, largs);\n }; // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n\n\n wrapper.guid = listener.guid;\n listen(target, 'one', type, wrapper);\n }\n },\n\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object. The listener will only be called once for the first event that is triggered\n * then removed.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n any: function any() {\n var _this3 = this;\n\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n var _normalizeListenArgs3 = normalizeListenArgs(this, args, 'any'),\n isTargetingSelf = _normalizeListenArgs3.isTargetingSelf,\n target = _normalizeListenArgs3.target,\n type = _normalizeListenArgs3.type,\n listener = _normalizeListenArgs3.listener; // Targeting this evented object.\n\n\n if (isTargetingSelf) {\n listen(target, 'any', type, listener); // Targeting another evented object.\n } else {\n var wrapper = function wrapper() {\n _this3.off(target, type, wrapper);\n\n for (var _len5 = arguments.length, largs = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n largs[_key5] = arguments[_key5];\n }\n\n listener.apply(null, largs);\n }; // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n\n\n wrapper.guid = listener.guid;\n listen(target, 'any', type, wrapper);\n }\n },\n\n /**\n * Removes listener(s) from event(s) on an evented object.\n *\n * @param {string|Array|Element|Object} [targetOrType]\n * If this is a string or array, it represents the event type(s).\n *\n * Another evented object can be passed here instead, in which case\n * ALL 3 arguments are _required_.\n *\n * @param {string|Array|Function} [typeOrListener]\n * If the first argument was a string or array, this may be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function; otherwise, _all_ listeners bound to the\n * event type(s) will be removed.\n */\n off: function off$1(targetOrType, typeOrListener, listener) {\n // Targeting this evented object.\n if (!targetOrType || isValidEventType(targetOrType)) {\n off(this.eventBusEl_, targetOrType, typeOrListener); // Targeting another evented object.\n } else {\n var target = targetOrType;\n var type = typeOrListener; // Fail fast and in a meaningful way!\n\n validateTarget(target, this, 'off');\n validateEventType(type, this, 'off');\n validateListener(listener, this, 'off'); // Ensure there's at least a guid, even if the function hasn't been used\n\n listener = bind(this, listener); // Remove the dispose listener on this evented object, which was given\n // the same guid as the event listener in on().\n\n this.off('dispose', listener);\n\n if (target.nodeName) {\n off(target, type, listener);\n off(target, 'dispose', listener);\n } else if (isEvented(target)) {\n target.off(type, listener);\n target.off('dispose', listener);\n }\n }\n },\n\n /**\n * Fire an event on this evented object, causing its listeners to be called.\n *\n * @param {string|Object} event\n * An event type or an object with a type property.\n *\n * @param {Object} [hash]\n * An additional object to pass along to listeners.\n *\n * @return {boolean}\n * Whether or not the default behavior was prevented.\n */\n trigger: function trigger$1(event, hash) {\n validateTarget(this.eventBusEl_, this, 'trigger');\n var type = event && typeof event !== 'string' ? event.type : event;\n\n if (!isValidEventType(type)) {\n 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.';\n\n if (event) {\n (this.log || log$1).error(error);\n } else {\n throw new Error(error);\n }\n }\n\n return trigger(this.eventBusEl_, event, hash);\n }\n};\n/**\n * Applies {@link module:evented~EventedMixin|EventedMixin} to a target object.\n *\n * @param {Object} target\n * The object to which to add event methods.\n *\n * @param {Object} [options={}]\n * Options for customizing the mixin behavior.\n *\n * @param {string} [options.eventBusKey]\n * By default, adds a `eventBusEl_` DOM element to the target object,\n * which is used as an event bus. If the target object already has a\n * DOM element that should be used, pass its key here.\n *\n * @return {Object}\n * The target object.\n */\n\nfunction evented(target, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n eventBusKey = _options.eventBusKey; // Set or create the eventBusEl_.\n\n if (eventBusKey) {\n if (!target[eventBusKey].nodeName) {\n throw new Error(\"The eventBusKey \\\"\" + eventBusKey + \"\\\" does not refer to an element.\");\n }\n\n target.eventBusEl_ = target[eventBusKey];\n } else {\n target.eventBusEl_ = video_es_createEl('span', {\n className: 'vjs-event-bus'\n });\n }\n\n video_es_assign(target, EventedMixin);\n\n if (target.eventedCallbacks) {\n target.eventedCallbacks.forEach(function (callback) {\n callback();\n });\n } // When any evented object is disposed, it removes all its listeners.\n\n\n target.on('dispose', function () {\n target.off();\n [target, target.el_, target.eventBusEl_].forEach(function (val) {\n if (val && DomData.has(val)) {\n DomData[\"delete\"](val);\n }\n });\n window_default.a.setTimeout(function () {\n target.eventBusEl_ = null;\n }, 0);\n });\n return target;\n}\n\n/**\n * @file mixins/stateful.js\n * @module stateful\n */\n/**\n * Contains methods that provide statefulness to an object which is passed\n * to {@link module:stateful}.\n *\n * @mixin StatefulMixin\n */\n\nvar StatefulMixin = {\n /**\n * A hash containing arbitrary keys and values representing the state of\n * the object.\n *\n * @type {Object}\n */\n state: {},\n\n /**\n * Set the state of an object by mutating its\n * {@link module:stateful~StatefulMixin.state|state} object in place.\n *\n * @fires module:stateful~StatefulMixin#statechanged\n * @param {Object|Function} stateUpdates\n * A new set of properties to shallow-merge into the plugin state.\n * Can be a plain object or a function returning a plain object.\n *\n * @return {Object|undefined}\n * An object containing changes that occurred. If no changes\n * occurred, returns `undefined`.\n */\n setState: function setState(stateUpdates) {\n var _this = this;\n\n // Support providing the `stateUpdates` state as a function.\n if (typeof stateUpdates === 'function') {\n stateUpdates = stateUpdates();\n }\n\n var changes;\n each(stateUpdates, function (value, key) {\n // Record the change if the value is different from what's in the\n // current state.\n if (_this.state[key] !== value) {\n changes = changes || {};\n changes[key] = {\n from: _this.state[key],\n to: value\n };\n }\n\n _this.state[key] = value;\n }); // Only trigger \"statechange\" if there were changes AND we have a trigger\n // function. This allows us to not require that the target object be an\n // evented object.\n\n if (changes && isEvented(this)) {\n /**\n * An event triggered on an object that is both\n * {@link module:stateful|stateful} and {@link module:evented|evented}\n * indicating that its state has changed.\n *\n * @event module:stateful~StatefulMixin#statechanged\n * @type {Object}\n * @property {Object} changes\n * A hash containing the properties that were changed and\n * the values they were changed `from` and `to`.\n */\n this.trigger({\n changes: changes,\n type: 'statechanged'\n });\n }\n\n return changes;\n }\n};\n/**\n * Applies {@link module:stateful~StatefulMixin|StatefulMixin} to a target\n * object.\n *\n * If the target object is {@link module:evented|evented} and has a\n * `handleStateChanged` method, that method will be automatically bound to the\n * `statechanged` event on itself.\n *\n * @param {Object} target\n * The object to be made stateful.\n *\n * @param {Object} [defaultState]\n * A default set of properties to populate the newly-stateful object's\n * `state` property.\n *\n * @return {Object}\n * Returns the `target`.\n */\n\nfunction stateful(target, defaultState) {\n video_es_assign(target, StatefulMixin); // This happens after the mixing-in because we need to replace the `state`\n // added in that step.\n\n target.state = video_es_assign({}, target.state, defaultState); // Auto-bind the `handleStateChanged` method of the target object if it exists.\n\n if (typeof target.handleStateChanged === 'function' && isEvented(target)) {\n target.on('statechanged', target.handleStateChanged);\n }\n\n return target;\n}\n\n/**\n * @file string-cases.js\n * @module to-lower-case\n */\n\n/**\n * Lowercase the first letter of a string.\n *\n * @param {string} string\n * String to be lowercased\n *\n * @return {string}\n * The string with a lowercased first letter\n */\nvar toLowerCase = function toLowerCase(string) {\n if (typeof string !== 'string') {\n return string;\n }\n\n return string.replace(/./, function (w) {\n return w.toLowerCase();\n });\n};\n/**\n * Uppercase the first letter of a string.\n *\n * @param {string} string\n * String to be uppercased\n *\n * @return {string}\n * The string with an uppercased first letter\n */\n\nvar toTitleCase$1 = function toTitleCase(string) {\n if (typeof string !== 'string') {\n return string;\n }\n\n return string.replace(/./, function (w) {\n return w.toUpperCase();\n });\n};\n/**\n * Compares the TitleCase versions of the two strings for equality.\n *\n * @param {string} str1\n * The first string to compare\n *\n * @param {string} str2\n * The second string to compare\n *\n * @return {boolean}\n * Whether the TitleCase versions of the strings are equal\n */\n\nvar titleCaseEquals = function titleCaseEquals(str1, str2) {\n return toTitleCase$1(str1) === toTitleCase$1(str2);\n};\n\n/**\n * @file merge-options.js\n * @module merge-options\n */\n/**\n * Merge two objects recursively.\n *\n * Performs a deep merge like\n * {@link https://lodash.com/docs/4.17.10#merge|lodash.merge}, but only merges\n * plain objects (not arrays, elements, or anything else).\n *\n * Non-plain object values will be copied directly from the right-most\n * argument.\n *\n * @static\n * @param {Object[]} sources\n * One or more objects to merge into a new object.\n *\n * @return {Object}\n * A new object that is the merged result of all sources.\n */\n\nfunction mergeOptions$3() {\n var result = {};\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n sources.forEach(function (source) {\n if (!source) {\n return;\n }\n\n each(source, function (value, key) {\n if (!isPlain(value)) {\n result[key] = value;\n return;\n }\n\n if (!isPlain(result[key])) {\n result[key] = {};\n }\n\n result[key] = mergeOptions$3(result[key], value);\n });\n });\n return result;\n}\n\nvar MapSham = /*#__PURE__*/function () {\n function MapSham() {\n this.map_ = {};\n }\n\n var _proto = MapSham.prototype;\n\n _proto.has = function has(key) {\n return key in this.map_;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var has = this.has(key);\n delete this.map_[key];\n return has;\n };\n\n _proto.set = function set(key, value) {\n this.map_[key] = value;\n return this;\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var key in this.map_) {\n callback.call(thisArg, this.map_[key], key, this);\n }\n };\n\n return MapSham;\n}();\n\nvar Map$1 = window_default.a.Map ? window_default.a.Map : MapSham;\n\nvar SetSham = /*#__PURE__*/function () {\n function SetSham() {\n this.set_ = {};\n }\n\n var _proto = SetSham.prototype;\n\n _proto.has = function has(key) {\n return key in this.set_;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var has = this.has(key);\n delete this.set_[key];\n return has;\n };\n\n _proto.add = function add(key) {\n this.set_[key] = 1;\n return this;\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var key in this.set_) {\n callback.call(thisArg, key, key, this);\n }\n };\n\n return SetSham;\n}();\n\nvar Set = window_default.a.Set ? window_default.a.Set : SetSham;\n\n/**\n * Player Component - Base class for all UI objects\n *\n * @file component.js\n */\n/**\n * Base class for all UI Components.\n * Components are UI objects which represent both a javascript object and an element\n * in the DOM. They can be children of other components, and can have\n * children themselves.\n *\n * Components can also use methods from {@link EventTarget}\n */\n\nvar Component$1 = /*#__PURE__*/function () {\n /**\n * A callback that is called when a component is ready. Does not have any\n * paramters and any callback value will be ignored.\n *\n * @callback Component~ReadyCallback\n * @this Component\n */\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Object[]} [options.children]\n * An array of children objects to intialize this component with. Children objects have\n * a name property that will be used if more than one component of the same type needs to be\n * added.\n *\n * @param {Component~ReadyCallback} [ready]\n * Function that gets called when the `Component` is ready.\n */\n function Component(player, options, ready) {\n // The component might be the player itself and we can't pass `this` to super\n if (!player && this.play) {\n this.player_ = player = this; // eslint-disable-line\n } else {\n this.player_ = player;\n }\n\n this.isDisposed_ = false; // Hold the reference to the parent component via `addChild` method\n\n this.parentComponent_ = null; // Make a copy of prototype.options_ to protect against overriding defaults\n\n this.options_ = mergeOptions$3({}, this.options_); // Updated options with supplied options\n\n options = this.options_ = mergeOptions$3(this.options_, options); // Get ID from options or options element if one is supplied\n\n this.id_ = options.id || options.el && options.el.id; // If there was no ID from the options, generate one\n\n if (!this.id_) {\n // Don't require the player ID function in the case of mock players\n var id = player && player.id && player.id() || 'no_player';\n this.id_ = id + \"_component_\" + newGUID();\n }\n\n this.name_ = options.name || null; // Create element if one wasn't provided in options\n\n if (options.el) {\n this.el_ = options.el;\n } else if (options.createEl !== false) {\n this.el_ = this.createEl();\n } // if evented is anything except false, we want to mixin in evented\n\n\n if (options.evented !== false) {\n // Make this an evented object and use `el_`, if available, as its event bus\n evented(this, {\n eventBusKey: this.el_ ? 'el_' : null\n });\n this.handleLanguagechange = this.handleLanguagechange.bind(this);\n this.on(this.player_, 'languagechange', this.handleLanguagechange);\n }\n\n stateful(this, this.constructor.defaultState);\n this.children_ = [];\n this.childIndex_ = {};\n this.childNameIndex_ = {};\n this.setTimeoutIds_ = new Set();\n this.setIntervalIds_ = new Set();\n this.rafIds_ = new Set();\n this.namedRafs_ = new Map$1();\n this.clearingTimersOnDispose_ = false; // Add any child components in options\n\n if (options.initChildren !== false) {\n this.initChildren();\n } // Don't want to trigger ready here or it will go before init is actually\n // finished for all children that run this constructor\n\n\n this.ready(ready);\n\n if (options.reportTouchActivity !== false) {\n this.enableTouchActivity();\n }\n }\n /**\n * Dispose of the `Component` and all child components.\n *\n * @fires Component#dispose\n */\n\n\n var _proto = Component.prototype;\n\n _proto.dispose = function dispose() {\n // Bail out if the component has already been disposed.\n if (this.isDisposed_) {\n return;\n }\n\n if (this.readyQueue_) {\n this.readyQueue_.length = 0;\n }\n /**\n * Triggered when a `Component` is disposed.\n *\n * @event Component#dispose\n * @type {EventTarget~Event}\n *\n * @property {boolean} [bubbles=false]\n * set to false so that the dispose event does not\n * bubble up\n */\n\n\n this.trigger({\n type: 'dispose',\n bubbles: false\n });\n this.isDisposed_ = true; // Dispose all children.\n\n if (this.children_) {\n for (var i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i].dispose) {\n this.children_[i].dispose();\n }\n }\n } // Delete child references\n\n\n this.children_ = null;\n this.childIndex_ = null;\n this.childNameIndex_ = null;\n this.parentComponent_ = null;\n\n if (this.el_) {\n // Remove element from DOM\n if (this.el_.parentNode) {\n this.el_.parentNode.removeChild(this.el_);\n }\n\n this.el_ = null;\n } // remove reference to the player after disposing of the element\n\n\n this.player_ = null;\n }\n /**\n * Determine whether or not this component has been disposed.\n *\n * @return {boolean}\n * If the component has been disposed, will be `true`. Otherwise, `false`.\n */\n ;\n\n _proto.isDisposed = function isDisposed() {\n return Boolean(this.isDisposed_);\n }\n /**\n * Return the {@link Player} that the `Component` has attached to.\n *\n * @return {Player}\n * The player that this `Component` has attached to.\n */\n ;\n\n _proto.player = function player() {\n return this.player_;\n }\n /**\n * Deep merge of options objects with new options.\n * > Note: When both `obj` and `options` contain properties whose values are objects.\n * The two properties get merged using {@link module:mergeOptions}\n *\n * @param {Object} obj\n * The object that contains new options.\n *\n * @return {Object}\n * A new object of `this.options_` and `obj` merged together.\n */\n ;\n\n _proto.options = function options(obj) {\n if (!obj) {\n return this.options_;\n }\n\n this.options_ = mergeOptions$3(this.options_, obj);\n return this.options_;\n }\n /**\n * Get the `Component`s DOM element\n *\n * @return {Element}\n * The DOM element for this `Component`.\n */\n ;\n\n _proto.el = function el() {\n return this.el_;\n }\n /**\n * Create the `Component`s DOM element.\n *\n * @param {string} [tagName]\n * Element's DOM node type. e.g. 'div'\n *\n * @param {Object} [properties]\n * An object of properties that should be set.\n *\n * @param {Object} [attributes]\n * An object of attributes that should be set.\n *\n * @return {Element}\n * The element that gets created.\n */\n ;\n\n _proto.createEl = function createEl$1(tagName, properties, attributes) {\n return video_es_createEl(tagName, properties, attributes);\n }\n /**\n * Localize a string given the string in english.\n *\n * If tokens are provided, it'll try and run a simple token replacement on the provided string.\n * The tokens it looks for look like `{1}` with the index being 1-indexed into the tokens array.\n *\n * If a `defaultValue` is provided, it'll use that over `string`,\n * if a value isn't found in provided language files.\n * This is useful if you want to have a descriptive key for token replacement\n * but have a succinct localized string and not require `en.json` to be included.\n *\n * Currently, it is used for the progress bar timing.\n * ```js\n * {\n * \"progress bar timing: currentTime={1} duration={2}\": \"{1} of {2}\"\n * }\n * ```\n * It is then used like so:\n * ```js\n * this.localize('progress bar timing: currentTime={1} duration{2}',\n * [this.player_.currentTime(), this.player_.duration()],\n * '{1} of {2}');\n * ```\n *\n * Which outputs something like: `01:23 of 24:56`.\n *\n *\n * @param {string} string\n * The string to localize and the key to lookup in the language files.\n * @param {string[]} [tokens]\n * If the current item has token replacements, provide the tokens here.\n * @param {string} [defaultValue]\n * Defaults to `string`. Can be a default value to use for token replacement\n * if the lookup key is needed to be separate.\n *\n * @return {string}\n * The localized string or if no localization exists the english string.\n */\n ;\n\n _proto.localize = function localize(string, tokens, defaultValue) {\n if (defaultValue === void 0) {\n defaultValue = string;\n }\n\n var code = this.player_.language && this.player_.language();\n var languages = this.player_.languages && this.player_.languages();\n var language = languages && languages[code];\n var primaryCode = code && code.split('-')[0];\n var primaryLang = languages && languages[primaryCode];\n var localizedString = defaultValue;\n\n if (language && language[string]) {\n localizedString = language[string];\n } else if (primaryLang && primaryLang[string]) {\n localizedString = primaryLang[string];\n }\n\n if (tokens) {\n localizedString = localizedString.replace(/\\{(\\d+)\\}/g, function (match, index) {\n var value = tokens[index - 1];\n var ret = value;\n\n if (typeof value === 'undefined') {\n ret = match;\n }\n\n return ret;\n });\n }\n\n return localizedString;\n }\n /**\n * Handles language change for the player in components. Should be overriden by sub-components.\n *\n * @abstract\n */\n ;\n\n _proto.handleLanguagechange = function handleLanguagechange() {}\n /**\n * Return the `Component`s DOM element. This is where children get inserted.\n * This will usually be the the same as the element returned in {@link Component#el}.\n *\n * @return {Element}\n * The content element for this `Component`.\n */\n ;\n\n _proto.contentEl = function contentEl() {\n return this.contentEl_ || this.el_;\n }\n /**\n * Get this `Component`s ID\n *\n * @return {string}\n * The id of this `Component`\n */\n ;\n\n _proto.id = function id() {\n return this.id_;\n }\n /**\n * Get the `Component`s name. The name gets used to reference the `Component`\n * and is set during registration.\n *\n * @return {string}\n * The name of this `Component`.\n */\n ;\n\n _proto.name = function name() {\n return this.name_;\n }\n /**\n * Get an array of all child components\n *\n * @return {Array}\n * The children\n */\n ;\n\n _proto.children = function children() {\n return this.children_;\n }\n /**\n * Returns the child `Component` with the given `id`.\n *\n * @param {string} id\n * The id of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The child `Component` with the given `id` or undefined.\n */\n ;\n\n _proto.getChildById = function getChildById(id) {\n return this.childIndex_[id];\n }\n /**\n * Returns the child `Component` with the given `name`.\n *\n * @param {string} name\n * The name of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The child `Component` with the given `name` or undefined.\n */\n ;\n\n _proto.getChild = function getChild(name) {\n if (!name) {\n return;\n }\n\n return this.childNameIndex_[name];\n }\n /**\n * Returns the descendant `Component` following the givent\n * descendant `names`. For instance ['foo', 'bar', 'baz'] would\n * try to get 'foo' on the current component, 'bar' on the 'foo'\n * component and 'baz' on the 'bar' component and return undefined\n * if any of those don't exist.\n *\n * @param {...string[]|...string} names\n * The name of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The descendant `Component` following the given descendant\n * `names` or undefined.\n */\n ;\n\n _proto.getDescendant = function getDescendant() {\n for (var _len = arguments.length, names = new Array(_len), _key = 0; _key < _len; _key++) {\n names[_key] = arguments[_key];\n }\n\n // flatten array argument into the main array\n names = names.reduce(function (acc, n) {\n return acc.concat(n);\n }, []);\n var currentChild = this;\n\n for (var i = 0; i < names.length; i++) {\n currentChild = currentChild.getChild(names[i]);\n\n if (!currentChild || !currentChild.getChild) {\n return;\n }\n }\n\n return currentChild;\n }\n /**\n * Add a child `Component` inside the current `Component`.\n *\n *\n * @param {string|Component} child\n * The name or instance of a child to add.\n *\n * @param {Object} [options={}]\n * The key/value store of options that will get passed to children of\n * the child.\n *\n * @param {number} [index=this.children_.length]\n * The index to attempt to add a child into.\n *\n * @return {Component}\n * The `Component` that gets added as a child. When using a string the\n * `Component` will get created by this process.\n */\n ;\n\n _proto.addChild = function addChild(child, options, index) {\n if (options === void 0) {\n options = {};\n }\n\n if (index === void 0) {\n index = this.children_.length;\n }\n\n var component;\n var componentName; // If child is a string, create component with options\n\n if (typeof child === 'string') {\n componentName = toTitleCase$1(child);\n var componentClassName = options.componentClass || componentName; // Set name through options\n\n options.name = componentName; // Create a new object & element for this controls set\n // If there's no .player_, this is a player\n\n var ComponentClass = Component.getComponent(componentClassName);\n\n if (!ComponentClass) {\n throw new Error(\"Component \" + componentClassName + \" does not exist\");\n } // data stored directly on the videojs object may be\n // misidentified as a component to retain\n // backwards-compatibility with 4.x. check to make sure the\n // component class can be instantiated.\n\n\n if (typeof ComponentClass !== 'function') {\n return null;\n }\n\n component = new ComponentClass(this.player_ || this, options); // child is a component instance\n } else {\n component = child;\n }\n\n if (component.parentComponent_) {\n component.parentComponent_.removeChild(component);\n }\n\n this.children_.splice(index, 0, component);\n component.parentComponent_ = this;\n\n if (typeof component.id === 'function') {\n this.childIndex_[component.id()] = component;\n } // If a name wasn't used to create the component, check if we can use the\n // name function of the component\n\n\n componentName = componentName || component.name && toTitleCase$1(component.name());\n\n if (componentName) {\n this.childNameIndex_[componentName] = component;\n this.childNameIndex_[toLowerCase(componentName)] = component;\n } // Add the UI object's element to the container div (box)\n // Having an element is not required\n\n\n if (typeof component.el === 'function' && component.el()) {\n // If inserting before a component, insert before that component's element\n var refNode = null;\n\n if (this.children_[index + 1]) {\n // Most children are components, but the video tech is an HTML element\n if (this.children_[index + 1].el_) {\n refNode = this.children_[index + 1].el_;\n } else if (isEl(this.children_[index + 1])) {\n refNode = this.children_[index + 1];\n }\n }\n\n this.contentEl().insertBefore(component.el(), refNode);\n } // Return so it can stored on parent object if desired.\n\n\n return component;\n }\n /**\n * Remove a child `Component` from this `Component`s list of children. Also removes\n * the child `Component`s element from this `Component`s element.\n *\n * @param {Component} component\n * The child `Component` to remove.\n */\n ;\n\n _proto.removeChild = function removeChild(component) {\n if (typeof component === 'string') {\n component = this.getChild(component);\n }\n\n if (!component || !this.children_) {\n return;\n }\n\n var childFound = false;\n\n for (var i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i] === component) {\n childFound = true;\n this.children_.splice(i, 1);\n break;\n }\n }\n\n if (!childFound) {\n return;\n }\n\n component.parentComponent_ = null;\n this.childIndex_[component.id()] = null;\n this.childNameIndex_[toTitleCase$1(component.name())] = null;\n this.childNameIndex_[toLowerCase(component.name())] = null;\n var compEl = component.el();\n\n if (compEl && compEl.parentNode === this.contentEl()) {\n this.contentEl().removeChild(component.el());\n }\n }\n /**\n * Add and initialize default child `Component`s based upon options.\n */\n ;\n\n _proto.initChildren = function initChildren() {\n var _this = this;\n\n var children = this.options_.children;\n\n if (children) {\n // `this` is `parent`\n var parentOptions = this.options_;\n\n var handleAdd = function handleAdd(child) {\n var name = child.name;\n var opts = child.opts; // Allow options for children to be set at the parent options\n // e.g. videojs(id, { controlBar: false });\n // instead of videojs(id, { children: { controlBar: false });\n\n if (parentOptions[name] !== undefined) {\n opts = parentOptions[name];\n } // Allow for disabling default components\n // e.g. options['children']['posterImage'] = false\n\n\n if (opts === false) {\n return;\n } // Allow options to be passed as a simple boolean if no configuration\n // is necessary.\n\n\n if (opts === true) {\n opts = {};\n } // We also want to pass the original player options\n // to each component as well so they don't need to\n // reach back into the player for options later.\n\n\n opts.playerOptions = _this.options_.playerOptions; // Create and add the child component.\n // Add a direct reference to the child by name on the parent instance.\n // If two of the same component are used, different names should be supplied\n // for each\n\n var newChild = _this.addChild(name, opts);\n\n if (newChild) {\n _this[name] = newChild;\n }\n }; // Allow for an array of children details to passed in the options\n\n\n var workingChildren;\n var Tech = Component.getComponent('Tech');\n\n if (Array.isArray(children)) {\n workingChildren = children;\n } else {\n workingChildren = Object.keys(children);\n }\n\n workingChildren // children that are in this.options_ but also in workingChildren would\n // give us extra children we do not want. So, we want to filter them out.\n .concat(Object.keys(this.options_).filter(function (child) {\n return !workingChildren.some(function (wchild) {\n if (typeof wchild === 'string') {\n return child === wchild;\n }\n\n return child === wchild.name;\n });\n })).map(function (child) {\n var name;\n var opts;\n\n if (typeof child === 'string') {\n name = child;\n opts = children[name] || _this.options_[name] || {};\n } else {\n name = child.name;\n opts = child;\n }\n\n return {\n name: name,\n opts: opts\n };\n }).filter(function (child) {\n // we have to make sure that child.name isn't in the techOrder since\n // techs are registerd as Components but can't aren't compatible\n // See https://github.com/videojs/video.js/issues/2772\n var c = Component.getComponent(child.opts.componentClass || toTitleCase$1(child.name));\n return c && !Tech.isTech(c);\n }).forEach(handleAdd);\n }\n }\n /**\n * Builds the default DOM class name. Should be overriden by sub-components.\n *\n * @return {string}\n * The DOM class name for this object.\n *\n * @abstract\n */\n ;\n\n _proto.buildCSSClass = function buildCSSClass() {\n // Child classes can include a function that does:\n // return 'CLASS NAME' + this._super();\n return '';\n }\n /**\n * Bind a listener to the component's ready state.\n * Different from event listeners in that if the ready event has already happened\n * it will trigger the function immediately.\n *\n * @return {Component}\n * Returns itself; method can be chained.\n */\n ;\n\n _proto.ready = function ready(fn, sync) {\n if (sync === void 0) {\n sync = false;\n }\n\n if (!fn) {\n return;\n }\n\n if (!this.isReady_) {\n this.readyQueue_ = this.readyQueue_ || [];\n this.readyQueue_.push(fn);\n return;\n }\n\n if (sync) {\n fn.call(this);\n } else {\n // Call the function asynchronously by default for consistency\n this.setTimeout(fn, 1);\n }\n }\n /**\n * Trigger all the ready listeners for this `Component`.\n *\n * @fires Component#ready\n */\n ;\n\n _proto.triggerReady = function triggerReady() {\n this.isReady_ = true; // Ensure ready is triggered asynchronously\n\n this.setTimeout(function () {\n var readyQueue = this.readyQueue_; // Reset Ready Queue\n\n this.readyQueue_ = [];\n\n if (readyQueue && readyQueue.length > 0) {\n readyQueue.forEach(function (fn) {\n fn.call(this);\n }, this);\n } // Allow for using event listeners also\n\n /**\n * Triggered when a `Component` is ready.\n *\n * @event Component#ready\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('ready');\n }, 1);\n }\n /**\n * Find a single DOM element matching a `selector`. This can be within the `Component`s\n * `contentEl()` or another custom context.\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param {Element|string} [context=this.contentEl()]\n * A DOM element within which to query. Can also be a selector string in\n * which case the first matching element will get used as context. If\n * missing `this.contentEl()` gets used. If `this.contentEl()` returns\n * nothing it falls back to `document`.\n *\n * @return {Element|null}\n * the dom element that was found, or null\n *\n * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n */\n ;\n\n _proto.$ = function $$1(selector, context) {\n return $(selector, context || this.contentEl());\n }\n /**\n * Finds all DOM element matching a `selector`. This can be within the `Component`s\n * `contentEl()` or another custom context.\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param {Element|string} [context=this.contentEl()]\n * A DOM element within which to query. Can also be a selector string in\n * which case the first matching element will get used as context. If\n * missing `this.contentEl()` gets used. If `this.contentEl()` returns\n * nothing it falls back to `document`.\n *\n * @return {NodeList}\n * a list of dom elements that were found\n *\n * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n */\n ;\n\n _proto.$$ = function $$$1(selector, context) {\n return $$(selector, context || this.contentEl());\n }\n /**\n * Check if a component's element has a CSS class name.\n *\n * @param {string} classToCheck\n * CSS class name to check.\n *\n * @return {boolean}\n * - True if the `Component` has the class.\n * - False if the `Component` does not have the class`\n */\n ;\n\n _proto.hasClass = function hasClass$1(classToCheck) {\n return hasClass(this.el_, classToCheck);\n }\n /**\n * Add a CSS class name to the `Component`s element.\n *\n * @param {string} classToAdd\n * CSS class name to add\n */\n ;\n\n _proto.addClass = function addClass$1(classToAdd) {\n addClass(this.el_, classToAdd);\n }\n /**\n * Remove a CSS class name from the `Component`s element.\n *\n * @param {string} classToRemove\n * CSS class name to remove\n */\n ;\n\n _proto.removeClass = function removeClass$1(classToRemove) {\n removeClass(this.el_, classToRemove);\n }\n /**\n * Add or remove a CSS class name from the component's element.\n * - `classToToggle` gets added when {@link Component#hasClass} would return false.\n * - `classToToggle` gets removed when {@link Component#hasClass} would return true.\n *\n * @param {string} classToToggle\n * The class to add or remove based on (@link Component#hasClass}\n *\n * @param {boolean|Dom~predicate} [predicate]\n * An {@link Dom~predicate} function or a boolean\n */\n ;\n\n _proto.toggleClass = function toggleClass$1(classToToggle, predicate) {\n toggleClass(this.el_, classToToggle, predicate);\n }\n /**\n * Show the `Component`s element if it is hidden by removing the\n * 'vjs-hidden' class name from it.\n */\n ;\n\n _proto.show = function show() {\n this.removeClass('vjs-hidden');\n }\n /**\n * Hide the `Component`s element if it is currently showing by adding the\n * 'vjs-hidden` class name to it.\n */\n ;\n\n _proto.hide = function hide() {\n this.addClass('vjs-hidden');\n }\n /**\n * Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing'\n * class name to it. Used during fadeIn/fadeOut.\n *\n * @private\n */\n ;\n\n _proto.lockShowing = function lockShowing() {\n this.addClass('vjs-lock-showing');\n }\n /**\n * Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing'\n * class name from it. Used during fadeIn/fadeOut.\n *\n * @private\n */\n ;\n\n _proto.unlockShowing = function unlockShowing() {\n this.removeClass('vjs-lock-showing');\n }\n /**\n * Get the value of an attribute on the `Component`s element.\n *\n * @param {string} attribute\n * Name of the attribute to get the value from.\n *\n * @return {string|null}\n * - The value of the attribute that was asked for.\n * - Can be an empty string on some browsers if the attribute does not exist\n * or has no value\n * - Most browsers will return null if the attibute does not exist or has\n * no value.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute}\n */\n ;\n\n _proto.getAttribute = function getAttribute$1(attribute) {\n return getAttribute(this.el_, attribute);\n }\n /**\n * Set the value of an attribute on the `Component`'s element\n *\n * @param {string} attribute\n * Name of the attribute to set.\n *\n * @param {string} value\n * Value to set the attribute to.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute}\n */\n ;\n\n _proto.setAttribute = function setAttribute$1(attribute, value) {\n setAttribute(this.el_, attribute, value);\n }\n /**\n * Remove an attribute from the `Component`s element.\n *\n * @param {string} attribute\n * Name of the attribute to remove.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute}\n */\n ;\n\n _proto.removeAttribute = function removeAttribute$1(attribute) {\n removeAttribute(this.el_, attribute);\n }\n /**\n * Get or set the width of the component based upon the CSS styles.\n * See {@link Component#dimension} for more detailed information.\n *\n * @param {number|string} [num]\n * The width that you want to set postfixed with '%', 'px' or nothing.\n *\n * @param {boolean} [skipListeners]\n * Skip the componentresize event trigger\n *\n * @return {number|string}\n * The width when getting, zero if there is no width. Can be a string\n * postpixed with '%' or 'px'.\n */\n ;\n\n _proto.width = function width(num, skipListeners) {\n return this.dimension('width', num, skipListeners);\n }\n /**\n * Get or set the height of the component based upon the CSS styles.\n * See {@link Component#dimension} for more detailed information.\n *\n * @param {number|string} [num]\n * The height that you want to set postfixed with '%', 'px' or nothing.\n *\n * @param {boolean} [skipListeners]\n * Skip the componentresize event trigger\n *\n * @return {number|string}\n * The width when getting, zero if there is no width. Can be a string\n * postpixed with '%' or 'px'.\n */\n ;\n\n _proto.height = function height(num, skipListeners) {\n return this.dimension('height', num, skipListeners);\n }\n /**\n * Set both the width and height of the `Component` element at the same time.\n *\n * @param {number|string} width\n * Width to set the `Component`s element to.\n *\n * @param {number|string} height\n * Height to set the `Component`s element to.\n */\n ;\n\n _proto.dimensions = function dimensions(width, height) {\n // Skip componentresize listeners on width for optimization\n this.width(width, true);\n this.height(height);\n }\n /**\n * Get or set width or height of the `Component` element. This is the shared code\n * for the {@link Component#width} and {@link Component#height}.\n *\n * Things to know:\n * - If the width or height in an number this will return the number postfixed with 'px'.\n * - If the width/height is a percent this will return the percent postfixed with '%'\n * - Hidden elements have a width of 0 with `window.getComputedStyle`. This function\n * defaults to the `Component`s `style.width` and falls back to `window.getComputedStyle`.\n * See [this]{@link http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/}\n * for more information\n * - If you want the computed style of the component, use {@link Component#currentWidth}\n * and {@link {Component#currentHeight}\n *\n * @fires Component#componentresize\n *\n * @param {string} widthOrHeight\n 8 'width' or 'height'\n *\n * @param {number|string} [num]\n 8 New dimension\n *\n * @param {boolean} [skipListeners]\n * Skip componentresize event trigger\n *\n * @return {number}\n * The dimension when getting or 0 if unset\n */\n ;\n\n _proto.dimension = function dimension(widthOrHeight, num, skipListeners) {\n if (num !== undefined) {\n // Set to zero if null or literally NaN (NaN !== NaN)\n if (num === null || num !== num) {\n num = 0;\n } // Check if using css width/height (% or px) and adjust\n\n\n if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) {\n this.el_.style[widthOrHeight] = num;\n } else if (num === 'auto') {\n this.el_.style[widthOrHeight] = '';\n } else {\n this.el_.style[widthOrHeight] = num + 'px';\n } // skipListeners allows us to avoid triggering the resize event when setting both width and height\n\n\n if (!skipListeners) {\n /**\n * Triggered when a component is resized.\n *\n * @event Component#componentresize\n * @type {EventTarget~Event}\n */\n this.trigger('componentresize');\n }\n\n return;\n } // Not setting a value, so getting it\n // Make sure element exists\n\n\n if (!this.el_) {\n return 0;\n } // Get dimension value from style\n\n\n var val = this.el_.style[widthOrHeight];\n var pxIndex = val.indexOf('px');\n\n if (pxIndex !== -1) {\n // Return the pixel value with no 'px'\n return parseInt(val.slice(0, pxIndex), 10);\n } // No px so using % or no style was set, so falling back to offsetWidth/height\n // If component has display:none, offset will return 0\n // TODO: handle display:none and no dimension style using px\n\n\n return parseInt(this.el_['offset' + toTitleCase$1(widthOrHeight)], 10);\n }\n /**\n * Get the computed width or the height of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @param {string} widthOrHeight\n * A string containing 'width' or 'height'. Whichever one you want to get.\n *\n * @return {number}\n * The dimension that gets asked for or 0 if nothing was set\n * for that dimension.\n */\n ;\n\n _proto.currentDimension = function currentDimension(widthOrHeight) {\n var computedWidthOrHeight = 0;\n\n if (widthOrHeight !== 'width' && widthOrHeight !== 'height') {\n throw new Error('currentDimension only accepts width or height value');\n }\n\n computedWidthOrHeight = computedStyle(this.el_, widthOrHeight); // remove 'px' from variable and parse as integer\n\n computedWidthOrHeight = parseFloat(computedWidthOrHeight); // if the computed value is still 0, it's possible that the browser is lying\n // and we want to check the offset values.\n // This code also runs wherever getComputedStyle doesn't exist.\n\n if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) {\n var rule = \"offset\" + toTitleCase$1(widthOrHeight);\n computedWidthOrHeight = this.el_[rule];\n }\n\n return computedWidthOrHeight;\n }\n /**\n * An object that contains width and height values of the `Component`s\n * computed style. Uses `window.getComputedStyle`.\n *\n * @typedef {Object} Component~DimensionObject\n *\n * @property {number} width\n * The width of the `Component`s computed style.\n *\n * @property {number} height\n * The height of the `Component`s computed style.\n */\n\n /**\n * Get an object that contains computed width and height values of the\n * component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {Component~DimensionObject}\n * The computed dimensions of the component's element.\n */\n ;\n\n _proto.currentDimensions = function currentDimensions() {\n return {\n width: this.currentDimension('width'),\n height: this.currentDimension('height')\n };\n }\n /**\n * Get the computed width of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {number}\n * The computed width of the component's element.\n */\n ;\n\n _proto.currentWidth = function currentWidth() {\n return this.currentDimension('width');\n }\n /**\n * Get the computed height of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {number}\n * The computed height of the component's element.\n */\n ;\n\n _proto.currentHeight = function currentHeight() {\n return this.currentDimension('height');\n }\n /**\n * Set the focus to this component\n */\n ;\n\n _proto.focus = function focus() {\n this.el_.focus();\n }\n /**\n * Remove the focus from this component\n */\n ;\n\n _proto.blur = function blur() {\n this.el_.blur();\n }\n /**\n * When this Component receives a `keydown` event which it does not process,\n * it passes the event to the Player for handling.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n if (this.player_) {\n // We only stop propagation here because we want unhandled events to fall\n // back to the browser.\n event.stopPropagation();\n this.player_.handleKeyDown(event);\n }\n }\n /**\n * Many components used to have a `handleKeyPress` method, which was poorly\n * named because it listened to a `keydown` event. This method name now\n * delegates to `handleKeyDown`. This means anyone calling `handleKeyPress`\n * will not see their method calls stop working.\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to be called.\n */\n ;\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n this.handleKeyDown(event);\n }\n /**\n * Emit a 'tap' events when touch event support gets detected. This gets used to\n * support toggling the controls through a tap on the video. They get enabled\n * because every sub-component would have extra overhead otherwise.\n *\n * @private\n * @fires Component#tap\n * @listens Component#touchstart\n * @listens Component#touchmove\n * @listens Component#touchleave\n * @listens Component#touchcancel\n * @listens Component#touchend\n */\n ;\n\n _proto.emitTapEvents = function emitTapEvents() {\n // Track the start time so we can determine how long the touch lasted\n var touchStart = 0;\n var firstTouch = null; // Maximum movement allowed during a touch event to still be considered a tap\n // Other popular libs use anywhere from 2 (hammer.js) to 15,\n // so 10 seems like a nice, round number.\n\n var tapMovementThreshold = 10; // The maximum length a touch can be while still being considered a tap\n\n var touchTimeThreshold = 200;\n var couldBeTap;\n this.on('touchstart', function (event) {\n // If more than one finger, don't consider treating this as a click\n if (event.touches.length === 1) {\n // Copy pageX/pageY from the object\n firstTouch = {\n pageX: event.touches[0].pageX,\n pageY: event.touches[0].pageY\n }; // Record start time so we can detect a tap vs. \"touch and hold\"\n\n touchStart = window_default.a.performance.now(); // Reset couldBeTap tracking\n\n couldBeTap = true;\n }\n });\n this.on('touchmove', function (event) {\n // If more than one finger, don't consider treating this as a click\n if (event.touches.length > 1) {\n couldBeTap = false;\n } else if (firstTouch) {\n // Some devices will throw touchmoves for all but the slightest of taps.\n // So, if we moved only a small distance, this could still be a tap\n var xdiff = event.touches[0].pageX - firstTouch.pageX;\n var ydiff = event.touches[0].pageY - firstTouch.pageY;\n var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n\n if (touchDistance > tapMovementThreshold) {\n couldBeTap = false;\n }\n }\n });\n\n var noTap = function noTap() {\n couldBeTap = false;\n }; // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s\n\n\n this.on('touchleave', noTap);\n this.on('touchcancel', noTap); // When the touch ends, measure how long it took and trigger the appropriate\n // event\n\n this.on('touchend', function (event) {\n firstTouch = null; // Proceed only if the touchmove/leave/cancel event didn't happen\n\n if (couldBeTap === true) {\n // Measure how long the touch lasted\n var touchTime = window_default.a.performance.now() - touchStart; // Make sure the touch was less than the threshold to be considered a tap\n\n if (touchTime < touchTimeThreshold) {\n // Don't let browser turn this into a click\n event.preventDefault();\n /**\n * Triggered when a `Component` is tapped.\n *\n * @event Component#tap\n * @type {EventTarget~Event}\n */\n\n this.trigger('tap'); // It may be good to copy the touchend event object and change the\n // type to tap, if the other event properties aren't exact after\n // Events.fixEvent runs (e.g. event.target)\n }\n }\n });\n }\n /**\n * This function reports user activity whenever touch events happen. This can get\n * turned off by any sub-components that wants touch events to act another way.\n *\n * Report user touch activity when touch events occur. User activity gets used to\n * determine when controls should show/hide. It is simple when it comes to mouse\n * events, because any mouse event should show the controls. So we capture mouse\n * events that bubble up to the player and report activity when that happens.\n * With touch events it isn't as easy as `touchstart` and `touchend` toggle player\n * controls. So touch events can't help us at the player level either.\n *\n * User activity gets checked asynchronously. So what could happen is a tap event\n * on the video turns the controls off. Then the `touchend` event bubbles up to\n * the player. Which, if it reported user activity, would turn the controls right\n * back on. We also don't want to completely block touch events from bubbling up.\n * Furthermore a `touchmove` event and anything other than a tap, should not turn\n * controls back on.\n *\n * @listens Component#touchstart\n * @listens Component#touchmove\n * @listens Component#touchend\n * @listens Component#touchcancel\n */\n ;\n\n _proto.enableTouchActivity = function enableTouchActivity() {\n // Don't continue if the root player doesn't support reporting user activity\n if (!this.player() || !this.player().reportUserActivity) {\n return;\n } // listener for reporting that the user is active\n\n\n var report = bind(this.player(), this.player().reportUserActivity);\n var touchHolding;\n this.on('touchstart', function () {\n report(); // For as long as the they are touching the device or have their mouse down,\n // we consider them active even if they're not moving their finger or mouse.\n // So we want to continue to update that they are active\n\n this.clearInterval(touchHolding); // report at the same interval as activityCheck\n\n touchHolding = this.setInterval(report, 250);\n });\n\n var touchEnd = function touchEnd(event) {\n report(); // stop the interval that maintains activity if the touch is holding\n\n this.clearInterval(touchHolding);\n };\n\n this.on('touchmove', report);\n this.on('touchend', touchEnd);\n this.on('touchcancel', touchEnd);\n }\n /**\n * A callback that has no parameters and is bound into `Component`s context.\n *\n * @callback Component~GenericCallback\n * @this Component\n */\n\n /**\n * Creates a function that runs after an `x` millisecond timeout. This function is a\n * wrapper around `window.setTimeout`. There are a few reasons to use this one\n * instead though:\n * 1. It gets cleared via {@link Component#clearTimeout} when\n * {@link Component#dispose} gets called.\n * 2. The function callback will gets turned into a {@link Component~GenericCallback}\n *\n * > Note: You can't use `window.clearTimeout` on the id returned by this function. This\n * will cause its dispose listener not to get cleaned up! Please use\n * {@link Component#clearTimeout} or {@link Component#dispose} instead.\n *\n * @param {Component~GenericCallback} fn\n * The function that will be run after `timeout`.\n *\n * @param {number} timeout\n * Timeout in milliseconds to delay before executing the specified function.\n *\n * @return {number}\n * Returns a timeout ID that gets used to identify the timeout. It can also\n * get used in {@link Component#clearTimeout} to clear the timeout that\n * was set.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout}\n */\n ;\n\n _proto.setTimeout = function setTimeout(fn, timeout) {\n var _this2 = this;\n\n // declare as variables so they are properly available in timeout function\n // eslint-disable-next-line\n var timeoutId;\n fn = bind(this, fn);\n this.clearTimersOnDispose_();\n timeoutId = window_default.a.setTimeout(function () {\n if (_this2.setTimeoutIds_.has(timeoutId)) {\n _this2.setTimeoutIds_[\"delete\"](timeoutId);\n }\n\n fn();\n }, timeout);\n this.setTimeoutIds_.add(timeoutId);\n return timeoutId;\n }\n /**\n * Clears a timeout that gets created via `window.setTimeout` or\n * {@link Component#setTimeout}. If you set a timeout via {@link Component#setTimeout}\n * use this function instead of `window.clearTimout`. If you don't your dispose\n * listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} timeoutId\n * The id of the timeout to clear. The return value of\n * {@link Component#setTimeout} or `window.setTimeout`.\n *\n * @return {number}\n * Returns the timeout id that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout}\n */\n ;\n\n _proto.clearTimeout = function clearTimeout(timeoutId) {\n if (this.setTimeoutIds_.has(timeoutId)) {\n this.setTimeoutIds_[\"delete\"](timeoutId);\n window_default.a.clearTimeout(timeoutId);\n }\n\n return timeoutId;\n }\n /**\n * Creates a function that gets run every `x` milliseconds. This function is a wrapper\n * around `window.setInterval`. There are a few reasons to use this one instead though.\n * 1. It gets cleared via {@link Component#clearInterval} when\n * {@link Component#dispose} gets called.\n * 2. The function callback will be a {@link Component~GenericCallback}\n *\n * @param {Component~GenericCallback} fn\n * The function to run every `x` seconds.\n *\n * @param {number} interval\n * Execute the specified function every `x` milliseconds.\n *\n * @return {number}\n * Returns an id that can be used to identify the interval. It can also be be used in\n * {@link Component#clearInterval} to clear the interval.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval}\n */\n ;\n\n _proto.setInterval = function setInterval(fn, interval) {\n fn = bind(this, fn);\n this.clearTimersOnDispose_();\n var intervalId = window_default.a.setInterval(fn, interval);\n this.setIntervalIds_.add(intervalId);\n return intervalId;\n }\n /**\n * Clears an interval that gets created via `window.setInterval` or\n * {@link Component#setInterval}. If you set an inteval via {@link Component#setInterval}\n * use this function instead of `window.clearInterval`. If you don't your dispose\n * listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} intervalId\n * The id of the interval to clear. The return value of\n * {@link Component#setInterval} or `window.setInterval`.\n *\n * @return {number}\n * Returns the interval id that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval}\n */\n ;\n\n _proto.clearInterval = function clearInterval(intervalId) {\n if (this.setIntervalIds_.has(intervalId)) {\n this.setIntervalIds_[\"delete\"](intervalId);\n window_default.a.clearInterval(intervalId);\n }\n\n return intervalId;\n }\n /**\n * Queues up a callback to be passed to requestAnimationFrame (rAF), but\n * with a few extra bonuses:\n *\n * - Supports browsers that do not support rAF by falling back to\n * {@link Component#setTimeout}.\n *\n * - The callback is turned into a {@link Component~GenericCallback} (i.e.\n * bound to the component).\n *\n * - Automatic cancellation of the rAF callback is handled if the component\n * is disposed before it is called.\n *\n * @param {Component~GenericCallback} fn\n * A function that will be bound to this component and executed just\n * before the browser's next repaint.\n *\n * @return {number}\n * Returns an rAF ID that gets used to identify the timeout. It can\n * also be used in {@link Component#cancelAnimationFrame} to cancel\n * the animation frame callback.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame}\n */\n ;\n\n _proto.requestAnimationFrame = function requestAnimationFrame(fn) {\n var _this3 = this;\n\n // Fall back to using a timer.\n if (!this.supportsRaf_) {\n return this.setTimeout(fn, 1000 / 60);\n }\n\n this.clearTimersOnDispose_(); // declare as variables so they are properly available in rAF function\n // eslint-disable-next-line\n\n var id;\n fn = bind(this, fn);\n id = window_default.a.requestAnimationFrame(function () {\n if (_this3.rafIds_.has(id)) {\n _this3.rafIds_[\"delete\"](id);\n }\n\n fn();\n });\n this.rafIds_.add(id);\n return id;\n }\n /**\n * Request an animation frame, but only one named animation\n * frame will be queued. Another will never be added until\n * the previous one finishes.\n *\n * @param {string} name\n * The name to give this requestAnimationFrame\n *\n * @param {Component~GenericCallback} fn\n * A function that will be bound to this component and executed just\n * before the browser's next repaint.\n */\n ;\n\n _proto.requestNamedAnimationFrame = function requestNamedAnimationFrame(name, fn) {\n var _this4 = this;\n\n if (this.namedRafs_.has(name)) {\n return;\n }\n\n this.clearTimersOnDispose_();\n fn = bind(this, fn);\n var id = this.requestAnimationFrame(function () {\n fn();\n\n if (_this4.namedRafs_.has(name)) {\n _this4.namedRafs_[\"delete\"](name);\n }\n });\n this.namedRafs_.set(name, id);\n return name;\n }\n /**\n * Cancels a current named animation frame if it exists.\n *\n * @param {string} name\n * The name of the requestAnimationFrame to cancel.\n */\n ;\n\n _proto.cancelNamedAnimationFrame = function cancelNamedAnimationFrame(name) {\n if (!this.namedRafs_.has(name)) {\n return;\n }\n\n this.cancelAnimationFrame(this.namedRafs_.get(name));\n this.namedRafs_[\"delete\"](name);\n }\n /**\n * Cancels a queued callback passed to {@link Component#requestAnimationFrame}\n * (rAF).\n *\n * If you queue an rAF callback via {@link Component#requestAnimationFrame},\n * use this function instead of `window.cancelAnimationFrame`. If you don't,\n * your dispose listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} id\n * The rAF ID to clear. The return value of {@link Component#requestAnimationFrame}.\n *\n * @return {number}\n * Returns the rAF ID that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame}\n */\n ;\n\n _proto.cancelAnimationFrame = function cancelAnimationFrame(id) {\n // Fall back to using a timer.\n if (!this.supportsRaf_) {\n return this.clearTimeout(id);\n }\n\n if (this.rafIds_.has(id)) {\n this.rafIds_[\"delete\"](id);\n window_default.a.cancelAnimationFrame(id);\n }\n\n return id;\n }\n /**\n * A function to setup `requestAnimationFrame`, `setTimeout`,\n * and `setInterval`, clearing on dispose.\n *\n * > Previously each timer added and removed dispose listeners on it's own.\n * For better performance it was decided to batch them all, and use `Set`s\n * to track outstanding timer ids.\n *\n * @private\n */\n ;\n\n _proto.clearTimersOnDispose_ = function clearTimersOnDispose_() {\n var _this5 = this;\n\n if (this.clearingTimersOnDispose_) {\n return;\n }\n\n this.clearingTimersOnDispose_ = true;\n this.one('dispose', function () {\n [['namedRafs_', 'cancelNamedAnimationFrame'], ['rafIds_', 'cancelAnimationFrame'], ['setTimeoutIds_', 'clearTimeout'], ['setIntervalIds_', 'clearInterval']].forEach(function (_ref) {\n var idName = _ref[0],\n cancelName = _ref[1];\n\n // for a `Set` key will actually be the value again\n // so forEach((val, val) =>` but for maps we want to use\n // the key.\n _this5[idName].forEach(function (val, key) {\n return _this5[cancelName](key);\n });\n });\n _this5.clearingTimersOnDispose_ = false;\n });\n }\n /**\n * Register a `Component` with `videojs` given the name and the component.\n *\n * > NOTE: {@link Tech}s should not be registered as a `Component`. {@link Tech}s\n * should be registered using {@link Tech.registerTech} or\n * {@link videojs:videojs.registerTech}.\n *\n * > NOTE: This function can also be seen on videojs as\n * {@link videojs:videojs.registerComponent}.\n *\n * @param {string} name\n * The name of the `Component` to register.\n *\n * @param {Component} ComponentToRegister\n * The `Component` class to register.\n *\n * @return {Component}\n * The `Component` that was registered.\n */\n ;\n\n Component.registerComponent = function registerComponent(name, ComponentToRegister) {\n if (typeof name !== 'string' || !name) {\n throw new Error(\"Illegal component name, \\\"\" + name + \"\\\"; must be a non-empty string.\");\n }\n\n var Tech = Component.getComponent('Tech'); // We need to make sure this check is only done if Tech has been registered.\n\n var isTech = Tech && Tech.isTech(ComponentToRegister);\n var isComp = Component === ComponentToRegister || Component.prototype.isPrototypeOf(ComponentToRegister.prototype);\n\n if (isTech || !isComp) {\n var reason;\n\n if (isTech) {\n reason = 'techs must be registered using Tech.registerTech()';\n } else {\n reason = 'must be a Component subclass';\n }\n\n throw new Error(\"Illegal component, \\\"\" + name + \"\\\"; \" + reason + \".\");\n }\n\n name = toTitleCase$1(name);\n\n if (!Component.components_) {\n Component.components_ = {};\n }\n\n var Player = Component.getComponent('Player');\n\n if (name === 'Player' && Player && Player.players) {\n var players = Player.players;\n var playerNames = Object.keys(players); // If we have players that were disposed, then their name will still be\n // in Players.players. So, we must loop through and verify that the value\n // for each item is not null. This allows registration of the Player component\n // after all players have been disposed or before any were created.\n\n if (players && playerNames.length > 0 && playerNames.map(function (pname) {\n return players[pname];\n }).every(Boolean)) {\n throw new Error('Can not register Player component after player has been created.');\n }\n }\n\n Component.components_[name] = ComponentToRegister;\n Component.components_[toLowerCase(name)] = ComponentToRegister;\n return ComponentToRegister;\n }\n /**\n * Get a `Component` based on the name it was registered with.\n *\n * @param {string} name\n * The Name of the component to get.\n *\n * @return {Component}\n * The `Component` that got registered under the given name.\n *\n * @deprecated In `videojs` 6 this will not return `Component`s that were not\n * registered using {@link Component.registerComponent}. Currently we\n * check the global `videojs` object for a `Component` name and\n * return that if it exists.\n */\n ;\n\n Component.getComponent = function getComponent(name) {\n if (!name || !Component.components_) {\n return;\n }\n\n return Component.components_[name];\n };\n\n return Component;\n}();\n/**\n * Whether or not this component supports `requestAnimationFrame`.\n *\n * This is exposed primarily for testing purposes.\n *\n * @private\n * @type {Boolean}\n */\n\n\nComponent$1.prototype.supportsRaf_ = typeof window_default.a.requestAnimationFrame === 'function' && typeof window_default.a.cancelAnimationFrame === 'function';\nComponent$1.registerComponent('Component', Component$1);\n\n/**\n * @file time-ranges.js\n * @module time-ranges\n */\n/**\n * Returns the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @typedef {Function} TimeRangeIndex\n *\n * @param {number} [index=0]\n * The range number to return the time for.\n *\n * @return {number}\n * The time offset at the specified index.\n *\n * @deprecated The index argument must be provided.\n * In the future, leaving it out will throw an error.\n */\n\n/**\n * An object that contains ranges of time.\n *\n * @typedef {Object} TimeRange\n *\n * @property {number} length\n * The number of time ranges represented by this object.\n *\n * @property {module:time-ranges~TimeRangeIndex} start\n * Returns the time offset at which a specified time range begins.\n *\n * @property {module:time-ranges~TimeRangeIndex} end\n * Returns the time offset at which a specified time range ends.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges\n */\n\n/**\n * Check if any of the time ranges are over the maximum index.\n *\n * @private\n * @param {string} fnName\n * The function name to use for logging\n *\n * @param {number} index\n * The index to check\n *\n * @param {number} maxIndex\n * The maximum possible index\n *\n * @throws {Error} if the timeRanges provided are over the maxIndex\n */\n\nfunction rangeCheck(fnName, index, maxIndex) {\n if (typeof index !== 'number' || index < 0 || index > maxIndex) {\n throw new Error(\"Failed to execute '\" + fnName + \"' on 'TimeRanges': The index provided (\" + index + \") is non-numeric or out of bounds (0-\" + maxIndex + \").\");\n }\n}\n/**\n * Get the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @private\n * @param {string} fnName\n * The function name to use for logging\n *\n * @param {string} valueIndex\n * The property that should be used to get the time. should be\n * 'start' or 'end'\n *\n * @param {Array} ranges\n * An array of time ranges\n *\n * @param {Array} [rangeIndex=0]\n * The index to start the search at\n *\n * @return {number}\n * The time that offset at the specified index.\n *\n * @deprecated rangeIndex must be set to a value, in the future this will throw an error.\n * @throws {Error} if rangeIndex is more than the length of ranges\n */\n\n\nfunction getRange(fnName, valueIndex, ranges, rangeIndex) {\n rangeCheck(fnName, rangeIndex, ranges.length - 1);\n return ranges[rangeIndex][valueIndex];\n}\n/**\n * Create a time range object given ranges of time.\n *\n * @private\n * @param {Array} [ranges]\n * An array of time ranges.\n */\n\n\nfunction createTimeRangesObj(ranges) {\n var timeRangesObj;\n\n if (ranges === undefined || ranges.length === 0) {\n timeRangesObj = {\n length: 0,\n start: function start() {\n throw new Error('This TimeRanges object is empty');\n },\n end: function end() {\n throw new Error('This TimeRanges object is empty');\n }\n };\n } else {\n timeRangesObj = {\n length: ranges.length,\n start: getRange.bind(null, 'start', 0, ranges),\n end: getRange.bind(null, 'end', 1, ranges)\n };\n }\n\n if (window_default.a.Symbol && window_default.a.Symbol.iterator) {\n timeRangesObj[window_default.a.Symbol.iterator] = function () {\n return (ranges || []).values();\n };\n }\n\n return timeRangesObj;\n}\n/**\n * Create a `TimeRange` object which mimics an\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|HTML5 TimeRanges instance}.\n *\n * @param {number|Array[]} start\n * The start of a single range (a number) or an array of ranges (an\n * array of arrays of two numbers each).\n *\n * @param {number} end\n * The end of a single range. Cannot be used with the array form of\n * the `start` argument.\n */\n\n\nfunction createTimeRanges(start, end) {\n if (Array.isArray(start)) {\n return createTimeRangesObj(start);\n } else if (start === undefined || end === undefined) {\n return createTimeRangesObj();\n }\n\n return createTimeRangesObj([[start, end]]);\n}\n\n/**\n * @file buffer.js\n * @module buffer\n */\n/**\n * Compute the percentage of the media that has been buffered.\n *\n * @param {TimeRange} buffered\n * The current `TimeRange` object representing buffered time ranges\n *\n * @param {number} duration\n * Total duration of the media\n *\n * @return {number}\n * Percent buffered of the total duration in decimal form.\n */\n\nfunction bufferedPercent(buffered, duration) {\n var bufferedDuration = 0;\n var start;\n var end;\n\n if (!duration) {\n return 0;\n }\n\n if (!buffered || !buffered.length) {\n buffered = createTimeRanges(0, 0);\n }\n\n for (var i = 0; i < buffered.length; i++) {\n start = buffered.start(i);\n end = buffered.end(i); // buffered end can be bigger than duration by a very small fraction\n\n if (end > duration) {\n end = duration;\n }\n\n bufferedDuration += end - start;\n }\n\n return bufferedDuration / duration;\n}\n\n/**\n * @file media-error.js\n */\n/**\n * A Custom `MediaError` class which mimics the standard HTML5 `MediaError` class.\n *\n * @param {number|string|Object|MediaError} value\n * This can be of multiple types:\n * - number: should be a standard error code\n * - string: an error message (the code will be 0)\n * - Object: arbitrary properties\n * - `MediaError` (native): used to populate a video.js `MediaError` object\n * - `MediaError` (video.js): will return itself if it's already a\n * video.js `MediaError` object.\n *\n * @see [MediaError Spec]{@link https://dev.w3.org/html5/spec-author-view/video.html#mediaerror}\n * @see [Encrypted MediaError Spec]{@link https://www.w3.org/TR/2013/WD-encrypted-media-20130510/#error-codes}\n *\n * @class MediaError\n */\n\nfunction MediaError(value) {\n // Allow redundant calls to this constructor to avoid having `instanceof`\n // checks peppered around the code.\n if (value instanceof MediaError) {\n return value;\n }\n\n if (typeof value === 'number') {\n this.code = value;\n } else if (typeof value === 'string') {\n // default code is zero, so this is a custom error\n this.message = value;\n } else if (video_es_isObject(value)) {\n // We assign the `code` property manually because native `MediaError` objects\n // do not expose it as an own/enumerable property of the object.\n if (typeof value.code === 'number') {\n this.code = value.code;\n }\n\n video_es_assign(this, value);\n }\n\n if (!this.message) {\n this.message = MediaError.defaultMessages[this.code] || '';\n }\n}\n/**\n * The error code that refers two one of the defined `MediaError` types\n *\n * @type {Number}\n */\n\n\nMediaError.prototype.code = 0;\n/**\n * An optional message that to show with the error. Message is not part of the HTML5\n * video spec but allows for more informative custom errors.\n *\n * @type {String}\n */\n\nMediaError.prototype.message = '';\n/**\n * An optional status code that can be set by plugins to allow even more detail about\n * the error. For example a plugin might provide a specific HTTP status code and an\n * error message for that code. Then when the plugin gets that error this class will\n * know how to display an error message for it. This allows a custom message to show\n * up on the `Player` error overlay.\n *\n * @type {Array}\n */\n\nMediaError.prototype.status = null;\n/**\n * Errors indexed by the W3C standard. The order **CANNOT CHANGE**! See the\n * specification listed under {@link MediaError} for more information.\n *\n * @enum {array}\n * @readonly\n * @property {string} 0 - MEDIA_ERR_CUSTOM\n * @property {string} 1 - MEDIA_ERR_ABORTED\n * @property {string} 2 - MEDIA_ERR_NETWORK\n * @property {string} 3 - MEDIA_ERR_DECODE\n * @property {string} 4 - MEDIA_ERR_SRC_NOT_SUPPORTED\n * @property {string} 5 - MEDIA_ERR_ENCRYPTED\n */\n\nMediaError.errorTypes = ['MEDIA_ERR_CUSTOM', 'MEDIA_ERR_ABORTED', 'MEDIA_ERR_NETWORK', 'MEDIA_ERR_DECODE', 'MEDIA_ERR_SRC_NOT_SUPPORTED', 'MEDIA_ERR_ENCRYPTED'];\n/**\n * The default `MediaError` messages based on the {@link MediaError.errorTypes}.\n *\n * @type {Array}\n * @constant\n */\n\nMediaError.defaultMessages = {\n 1: 'You aborted the media playback',\n 2: 'A network error caused the media download to fail part-way.',\n 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.',\n 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.',\n 5: 'The media is encrypted and we do not have the keys to decrypt it.'\n}; // Add types as properties on MediaError\n// e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4;\n\nfor (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) {\n MediaError[MediaError.errorTypes[errNum]] = errNum; // values should be accessible on both the class and instance\n\n MediaError.prototype[MediaError.errorTypes[errNum]] = errNum;\n} // jsdocs for instance/static members added above\n\n/**\n * Returns whether an object is `Promise`-like (i.e. has a `then` method).\n *\n * @param {Object} value\n * An object that may or may not be `Promise`-like.\n *\n * @return {boolean}\n * Whether or not the object is `Promise`-like.\n */\nfunction isPromise(value) {\n return value !== undefined && value !== null && typeof value.then === 'function';\n}\n/**\n * Silence a Promise-like object.\n *\n * This is useful for avoiding non-harmful, but potentially confusing \"uncaught\n * play promise\" rejection error messages.\n *\n * @param {Object} value\n * An object that may or may not be `Promise`-like.\n */\n\nfunction silencePromise(value) {\n if (isPromise(value)) {\n value.then(null, function (e) {});\n }\n}\n\n/**\n * @file text-track-list-converter.js Utilities for capturing text track state and\n * re-creating tracks based on a capture.\n *\n * @module text-track-list-converter\n */\n\n/**\n * Examine a single {@link TextTrack} and return a JSON-compatible javascript object that\n * represents the {@link TextTrack}'s state.\n *\n * @param {TextTrack} track\n * The text track to query.\n *\n * @return {Object}\n * A serializable javascript representation of the TextTrack.\n * @private\n */\nvar trackToJson_ = function trackToJson_(track) {\n var ret = ['kind', 'label', 'language', 'id', 'inBandMetadataTrackDispatchType', 'mode', 'src'].reduce(function (acc, prop, i) {\n if (track[prop]) {\n acc[prop] = track[prop];\n }\n\n return acc;\n }, {\n cues: track.cues && Array.prototype.map.call(track.cues, function (cue) {\n return {\n startTime: cue.startTime,\n endTime: cue.endTime,\n text: cue.text,\n id: cue.id\n };\n })\n });\n return ret;\n};\n/**\n * Examine a {@link Tech} and return a JSON-compatible javascript array that represents the\n * state of all {@link TextTrack}s currently configured. The return array is compatible with\n * {@link text-track-list-converter:jsonToTextTracks}.\n *\n * @param {Tech} tech\n * The tech object to query\n *\n * @return {Array}\n * A serializable javascript representation of the {@link Tech}s\n * {@link TextTrackList}.\n */\n\n\nvar textTracksToJson = function textTracksToJson(tech) {\n var trackEls = tech.$$('track');\n var trackObjs = Array.prototype.map.call(trackEls, function (t) {\n return t.track;\n });\n var tracks = Array.prototype.map.call(trackEls, function (trackEl) {\n var json = trackToJson_(trackEl.track);\n\n if (trackEl.src) {\n json.src = trackEl.src;\n }\n\n return json;\n });\n return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function (track) {\n return trackObjs.indexOf(track) === -1;\n }).map(trackToJson_));\n};\n/**\n * Create a set of remote {@link TextTrack}s on a {@link Tech} based on an array of javascript\n * object {@link TextTrack} representations.\n *\n * @param {Array} json\n * An array of `TextTrack` representation objects, like those that would be\n * produced by `textTracksToJson`.\n *\n * @param {Tech} tech\n * The `Tech` to create the `TextTrack`s on.\n */\n\n\nvar jsonToTextTracks = function jsonToTextTracks(json, tech) {\n json.forEach(function (track) {\n var addedTrack = tech.addRemoteTextTrack(track).track;\n\n if (!track.src && track.cues) {\n track.cues.forEach(function (cue) {\n return addedTrack.addCue(cue);\n });\n }\n });\n return tech.textTracks();\n};\n\nvar textTrackConverter = {\n textTracksToJson: textTracksToJson,\n jsonToTextTracks: jsonToTextTracks,\n trackToJson_: trackToJson_\n};\n\nvar MODAL_CLASS_NAME = 'vjs-modal-dialog';\n/**\n * The `ModalDialog` displays over the video and its controls, which blocks\n * interaction with the player until it is closed.\n *\n * Modal dialogs include a \"Close\" button and will close when that button\n * is activated - or when ESC is pressed anywhere.\n *\n * @extends Component\n */\n\nvar video_es_ModalDialog = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(ModalDialog, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Mixed} [options.content=undefined]\n * Provide customized content for this modal.\n *\n * @param {string} [options.description]\n * A text description for the modal, primarily for accessibility.\n *\n * @param {boolean} [options.fillAlways=false]\n * Normally, modals are automatically filled only the first time\n * they open. This tells the modal to refresh its content\n * every time it opens.\n *\n * @param {string} [options.label]\n * A text label for the modal, primarily for accessibility.\n *\n * @param {boolean} [options.pauseOnOpen=true]\n * If `true`, playback will will be paused if playing when\n * the modal opens, and resumed when it closes.\n *\n * @param {boolean} [options.temporary=true]\n * If `true`, the modal can only be opened once; it will be\n * disposed as soon as it's closed.\n *\n * @param {boolean} [options.uncloseable=false]\n * If `true`, the user will not be able to close the modal\n * through the UI in the normal ways. Programmatic closing is\n * still possible.\n */\n function ModalDialog(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n _this.handleKeyDown_ = function (e) {\n return _this.handleKeyDown(e);\n };\n\n _this.close_ = function (e) {\n return _this.close(e);\n };\n\n _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false;\n\n _this.closeable(!_this.options_.uncloseable);\n\n _this.content(_this.options_.content); // Make sure the contentEl is defined AFTER any children are initialized\n // because we only want the contents of the modal in the contentEl\n // (not the UI elements like the close button).\n\n\n _this.contentEl_ = video_es_createEl('div', {\n className: MODAL_CLASS_NAME + \"-content\"\n }, {\n role: 'document'\n });\n _this.descEl_ = video_es_createEl('p', {\n className: MODAL_CLASS_NAME + \"-description vjs-control-text\",\n id: _this.el().getAttribute('aria-describedby')\n });\n textContent(_this.descEl_, _this.description());\n\n _this.el_.appendChild(_this.descEl_);\n\n _this.el_.appendChild(_this.contentEl_);\n\n return _this;\n }\n /**\n * Create the `ModalDialog`'s DOM element\n *\n * @return {Element}\n * The DOM element that gets created.\n */\n\n\n var _proto = ModalDialog.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: this.buildCSSClass(),\n tabIndex: -1\n }, {\n 'aria-describedby': this.id() + \"_description\",\n 'aria-hidden': 'true',\n 'aria-label': this.label(),\n 'role': 'dialog'\n });\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n this.descEl_ = null;\n this.previouslyActiveEl_ = null;\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n ;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return MODAL_CLASS_NAME + \" vjs-hidden \" + _Component.prototype.buildCSSClass.call(this);\n }\n /**\n * Returns the label string for this modal. Primarily used for accessibility.\n *\n * @return {string}\n * the localized or raw label of this modal.\n */\n ;\n\n _proto.label = function label() {\n return this.localize(this.options_.label || 'Modal Window');\n }\n /**\n * Returns the description string for this modal. Primarily used for\n * accessibility.\n *\n * @return {string}\n * The localized or raw description of this modal.\n */\n ;\n\n _proto.description = function description() {\n var desc = this.options_.description || this.localize('This is a modal window.'); // Append a universal closeability message if the modal is closeable.\n\n if (this.closeable()) {\n desc += ' ' + this.localize('This modal can be closed by pressing the Escape key or activating the close button.');\n }\n\n return desc;\n }\n /**\n * Opens the modal.\n *\n * @fires ModalDialog#beforemodalopen\n * @fires ModalDialog#modalopen\n */\n ;\n\n _proto.open = function open() {\n if (!this.opened_) {\n var player = this.player();\n /**\n * Fired just before a `ModalDialog` is opened.\n *\n * @event ModalDialog#beforemodalopen\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalopen');\n this.opened_ = true; // Fill content if the modal has never opened before and\n // never been filled.\n\n if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {\n this.fill();\n } // If the player was playing, pause it and take note of its previously\n // playing state.\n\n\n this.wasPlaying_ = !player.paused();\n\n if (this.options_.pauseOnOpen && this.wasPlaying_) {\n player.pause();\n }\n\n this.on('keydown', this.handleKeyDown_); // Hide controls and note if they were enabled.\n\n this.hadControls_ = player.controls();\n player.controls(false);\n this.show();\n this.conditionalFocus_();\n this.el().setAttribute('aria-hidden', 'false');\n /**\n * Fired just after a `ModalDialog` is opened.\n *\n * @event ModalDialog#modalopen\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalopen');\n this.hasBeenOpened_ = true;\n }\n }\n /**\n * If the `ModalDialog` is currently open or closed.\n *\n * @param {boolean} [value]\n * If given, it will open (`true`) or close (`false`) the modal.\n *\n * @return {boolean}\n * the current open state of the modaldialog\n */\n ;\n\n _proto.opened = function opened(value) {\n if (typeof value === 'boolean') {\n this[value ? 'open' : 'close']();\n }\n\n return this.opened_;\n }\n /**\n * Closes the modal, does nothing if the `ModalDialog` is\n * not open.\n *\n * @fires ModalDialog#beforemodalclose\n * @fires ModalDialog#modalclose\n */\n ;\n\n _proto.close = function close() {\n if (!this.opened_) {\n return;\n }\n\n var player = this.player();\n /**\n * Fired just before a `ModalDialog` is closed.\n *\n * @event ModalDialog#beforemodalclose\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalclose');\n this.opened_ = false;\n\n if (this.wasPlaying_ && this.options_.pauseOnOpen) {\n player.play();\n }\n\n this.off('keydown', this.handleKeyDown_);\n\n if (this.hadControls_) {\n player.controls(true);\n }\n\n this.hide();\n this.el().setAttribute('aria-hidden', 'true');\n /**\n * Fired just after a `ModalDialog` is closed.\n *\n * @event ModalDialog#modalclose\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalclose');\n this.conditionalBlur_();\n\n if (this.options_.temporary) {\n this.dispose();\n }\n }\n /**\n * Check to see if the `ModalDialog` is closeable via the UI.\n *\n * @param {boolean} [value]\n * If given as a boolean, it will set the `closeable` option.\n *\n * @return {boolean}\n * Returns the final value of the closable option.\n */\n ;\n\n _proto.closeable = function closeable(value) {\n if (typeof value === 'boolean') {\n var closeable = this.closeable_ = !!value;\n var close = this.getChild('closeButton'); // If this is being made closeable and has no close button, add one.\n\n if (closeable && !close) {\n // The close button should be a child of the modal - not its\n // content element, so temporarily change the content element.\n var temp = this.contentEl_;\n this.contentEl_ = this.el_;\n close = this.addChild('closeButton', {\n controlText: 'Close Modal Dialog'\n });\n this.contentEl_ = temp;\n this.on(close, 'close', this.close_);\n } // If this is being made uncloseable and has a close button, remove it.\n\n\n if (!closeable && close) {\n this.off(close, 'close', this.close_);\n this.removeChild(close);\n close.dispose();\n }\n }\n\n return this.closeable_;\n }\n /**\n * Fill the modal's content element with the modal's \"content\" option.\n * The content element will be emptied before this change takes place.\n */\n ;\n\n _proto.fill = function fill() {\n this.fillWith(this.content());\n }\n /**\n * Fill the modal's content element with arbitrary content.\n * The content element will be emptied before this change takes place.\n *\n * @fires ModalDialog#beforemodalfill\n * @fires ModalDialog#modalfill\n *\n * @param {Mixed} [content]\n * The same rules apply to this as apply to the `content` option.\n */\n ;\n\n _proto.fillWith = function fillWith(content) {\n var contentEl = this.contentEl();\n var parentEl = contentEl.parentNode;\n var nextSiblingEl = contentEl.nextSibling;\n /**\n * Fired just before a `ModalDialog` is filled with content.\n *\n * @event ModalDialog#beforemodalfill\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalfill');\n this.hasBeenFilled_ = true; // Detach the content element from the DOM before performing\n // manipulation to avoid modifying the live DOM multiple times.\n\n parentEl.removeChild(contentEl);\n this.empty();\n insertContent(contentEl, content);\n /**\n * Fired just after a `ModalDialog` is filled with content.\n *\n * @event ModalDialog#modalfill\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalfill'); // Re-inject the re-filled content element.\n\n if (nextSiblingEl) {\n parentEl.insertBefore(contentEl, nextSiblingEl);\n } else {\n parentEl.appendChild(contentEl);\n } // make sure that the close button is last in the dialog DOM\n\n\n var closeButton = this.getChild('closeButton');\n\n if (closeButton) {\n parentEl.appendChild(closeButton.el_);\n }\n }\n /**\n * Empties the content element. This happens anytime the modal is filled.\n *\n * @fires ModalDialog#beforemodalempty\n * @fires ModalDialog#modalempty\n */\n ;\n\n _proto.empty = function empty() {\n /**\n * Fired just before a `ModalDialog` is emptied.\n *\n * @event ModalDialog#beforemodalempty\n * @type {EventTarget~Event}\n */\n this.trigger('beforemodalempty');\n emptyEl(this.contentEl());\n /**\n * Fired just after a `ModalDialog` is emptied.\n *\n * @event ModalDialog#modalempty\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalempty');\n }\n /**\n * Gets or sets the modal content, which gets normalized before being\n * rendered into the DOM.\n *\n * This does not update the DOM or fill the modal, but it is called during\n * that process.\n *\n * @param {Mixed} [value]\n * If defined, sets the internal content value to be used on the\n * next call(s) to `fill`. This value is normalized before being\n * inserted. To \"clear\" the internal content value, pass `null`.\n *\n * @return {Mixed}\n * The current content of the modal dialog\n */\n ;\n\n _proto.content = function content(value) {\n if (typeof value !== 'undefined') {\n this.content_ = value;\n }\n\n return this.content_;\n }\n /**\n * conditionally focus the modal dialog if focus was previously on the player.\n *\n * @private\n */\n ;\n\n _proto.conditionalFocus_ = function conditionalFocus_() {\n var activeEl = document_default.a.activeElement;\n var playerEl = this.player_.el_;\n this.previouslyActiveEl_ = null;\n\n if (playerEl.contains(activeEl) || playerEl === activeEl) {\n this.previouslyActiveEl_ = activeEl;\n this.focus();\n }\n }\n /**\n * conditionally blur the element and refocus the last focused element\n *\n * @private\n */\n ;\n\n _proto.conditionalBlur_ = function conditionalBlur_() {\n if (this.previouslyActiveEl_) {\n this.previouslyActiveEl_.focus();\n this.previouslyActiveEl_ = null;\n }\n }\n /**\n * Keydown handler. Attached when modal is focused.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n // Do not allow keydowns to reach out of the modal dialog.\n event.stopPropagation();\n\n if (keycode_default.a.isEventKey(event, 'Escape') && this.closeable()) {\n event.preventDefault();\n this.close();\n return;\n } // exit early if it isn't a tab key\n\n\n if (!keycode_default.a.isEventKey(event, 'Tab')) {\n return;\n }\n\n var focusableEls = this.focusableEls_();\n var activeEl = this.el_.querySelector(':focus');\n var focusIndex;\n\n for (var i = 0; i < focusableEls.length; i++) {\n if (activeEl === focusableEls[i]) {\n focusIndex = i;\n break;\n }\n }\n\n if (document_default.a.activeElement === this.el_) {\n focusIndex = 0;\n }\n\n if (event.shiftKey && focusIndex === 0) {\n focusableEls[focusableEls.length - 1].focus();\n event.preventDefault();\n } else if (!event.shiftKey && focusIndex === focusableEls.length - 1) {\n focusableEls[0].focus();\n event.preventDefault();\n }\n }\n /**\n * get all focusable elements\n *\n * @private\n */\n ;\n\n _proto.focusableEls_ = function focusableEls_() {\n var allChildren = this.el_.querySelectorAll('*');\n return Array.prototype.filter.call(allChildren, function (child) {\n return (child instanceof window_default.a.HTMLAnchorElement || child instanceof window_default.a.HTMLAreaElement) && child.hasAttribute('href') || (child instanceof window_default.a.HTMLInputElement || child instanceof window_default.a.HTMLSelectElement || child instanceof window_default.a.HTMLTextAreaElement || child instanceof window_default.a.HTMLButtonElement) && !child.hasAttribute('disabled') || child instanceof window_default.a.HTMLIFrameElement || child instanceof window_default.a.HTMLObjectElement || child instanceof window_default.a.HTMLEmbedElement || child.hasAttribute('tabindex') && child.getAttribute('tabindex') !== -1 || child.hasAttribute('contenteditable');\n });\n };\n\n return ModalDialog;\n}(Component$1);\n/**\n * Default options for `ModalDialog` default options.\n *\n * @type {Object}\n * @private\n */\n\n\nvideo_es_ModalDialog.prototype.options_ = {\n pauseOnOpen: true,\n temporary: true\n};\nComponent$1.registerComponent('ModalDialog', video_es_ModalDialog);\n\n/**\n * Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and\n * {@link VideoTrackList}\n *\n * @extends EventTarget\n */\n\nvar video_es_TrackList = /*#__PURE__*/function (_EventTarget) {\n inheritsLoose_default()(TrackList, _EventTarget);\n\n /**\n * Create an instance of this class\n *\n * @param {Track[]} tracks\n * A list of tracks to initialize the list with.\n *\n * @abstract\n */\n function TrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n _this = _EventTarget.call(this) || this;\n _this.tracks_ = [];\n /**\n * @memberof TrackList\n * @member {number} length\n * The current number of `Track`s in the this Trackist.\n * @instance\n */\n\n Object.defineProperty(assertThisInitialized_default()(_this), 'length', {\n get: function get() {\n return this.tracks_.length;\n }\n });\n\n for (var i = 0; i < tracks.length; i++) {\n _this.addTrack(tracks[i]);\n }\n\n return _this;\n }\n /**\n * Add a {@link Track} to the `TrackList`\n *\n * @param {Track} track\n * The audio, video, or text track to add to the list.\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = TrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var _this2 = this;\n\n var index = this.tracks_.length;\n\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get: function get() {\n return this.tracks_[index];\n }\n });\n } // Do not add duplicate tracks\n\n\n if (this.tracks_.indexOf(track) === -1) {\n this.tracks_.push(track);\n /**\n * Triggered when a track is added to a track list.\n *\n * @event TrackList#addtrack\n * @type {EventTarget~Event}\n * @property {Track} track\n * A reference to track that was added.\n */\n\n this.trigger({\n track: track,\n type: 'addtrack',\n target: this\n });\n }\n /**\n * Triggered when a track label is changed.\n *\n * @event TrackList#addtrack\n * @type {EventTarget~Event}\n * @property {Track} track\n * A reference to track that was added.\n */\n\n\n track.labelchange_ = function () {\n _this2.trigger({\n track: track,\n type: 'labelchange',\n target: _this2\n });\n };\n\n if (isEvented(track)) {\n track.addEventListener('labelchange', track.labelchange_);\n }\n }\n /**\n * Remove a {@link Track} from the `TrackList`\n *\n * @param {Track} rtrack\n * The audio, video, or text track to remove from the list.\n *\n * @fires TrackList#removetrack\n */\n ;\n\n _proto.removeTrack = function removeTrack(rtrack) {\n var track;\n\n for (var i = 0, l = this.length; i < l; i++) {\n if (this[i] === rtrack) {\n track = this[i];\n\n if (track.off) {\n track.off();\n }\n\n this.tracks_.splice(i, 1);\n break;\n }\n }\n\n if (!track) {\n return;\n }\n /**\n * Triggered when a track is removed from track list.\n *\n * @event TrackList#removetrack\n * @type {EventTarget~Event}\n * @property {Track} track\n * A reference to track that was removed.\n */\n\n\n this.trigger({\n track: track,\n type: 'removetrack',\n target: this\n });\n }\n /**\n * Get a Track from the TrackList by a tracks id\n *\n * @param {string} id - the id of the track to get\n * @method getTrackById\n * @return {Track}\n * @private\n */\n ;\n\n _proto.getTrackById = function getTrackById(id) {\n var result = null;\n\n for (var i = 0, l = this.length; i < l; i++) {\n var track = this[i];\n\n if (track.id === id) {\n result = track;\n break;\n }\n }\n\n return result;\n };\n\n return TrackList;\n}(EventTarget$2);\n/**\n * Triggered when a different track is selected/enabled.\n *\n * @event TrackList#change\n * @type {EventTarget~Event}\n */\n\n/**\n * Events that can be called with on + eventName. See {@link EventHandler}.\n *\n * @property {Object} TrackList#allowedEvents_\n * @private\n */\n\n\nvideo_es_TrackList.prototype.allowedEvents_ = {\n change: 'change',\n addtrack: 'addtrack',\n removetrack: 'removetrack',\n labelchange: 'labelchange'\n}; // emulate attribute EventHandler support to allow for feature detection\n\nfor (var video_es_event in video_es_TrackList.prototype.allowedEvents_) {\n video_es_TrackList.prototype['on' + video_es_event] = null;\n}\n\n/**\n * Anywhere we call this function we diverge from the spec\n * as we only support one enabled audiotrack at a time\n *\n * @param {AudioTrackList} list\n * list to work on\n *\n * @param {AudioTrack} track\n * The track to skip\n *\n * @private\n */\n\nvar disableOthers$1 = function disableOthers(list, track) {\n for (var i = 0; i < list.length; i++) {\n if (!Object.keys(list[i]).length || track.id === list[i].id) {\n continue;\n } // another audio track is enabled, disable it\n\n\n list[i].enabled = false;\n }\n};\n/**\n * The current list of {@link AudioTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist}\n * @extends TrackList\n */\n\n\nvar video_es_AudioTrackList = /*#__PURE__*/function (_TrackList) {\n inheritsLoose_default()(AudioTrackList, _TrackList);\n\n /**\n * Create an instance of this class.\n *\n * @param {AudioTrack[]} [tracks=[]]\n * A list of `AudioTrack` to instantiate the list with.\n */\n function AudioTrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n // make sure only 1 track is enabled\n // sorted from last index to first index\n for (var i = tracks.length - 1; i >= 0; i--) {\n if (tracks[i].enabled) {\n disableOthers$1(tracks, tracks[i]);\n break;\n }\n }\n\n _this = _TrackList.call(this, tracks) || this;\n _this.changing_ = false;\n return _this;\n }\n /**\n * Add an {@link AudioTrack} to the `AudioTrackList`.\n *\n * @param {AudioTrack} track\n * The AudioTrack to add to the list\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = AudioTrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var _this2 = this;\n\n if (track.enabled) {\n disableOthers$1(this, track);\n }\n\n _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this\n\n\n if (!track.addEventListener) {\n return;\n }\n\n track.enabledChange_ = function () {\n // when we are disabling other tracks (since we don't support\n // more than one track at a time) we will set changing_\n // to true so that we don't trigger additional change events\n if (_this2.changing_) {\n return;\n }\n\n _this2.changing_ = true;\n disableOthers$1(_this2, track);\n _this2.changing_ = false;\n\n _this2.trigger('change');\n };\n /**\n * @listens AudioTrack#enabledchange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('enabledchange', track.enabledChange_);\n };\n\n _proto.removeTrack = function removeTrack(rtrack) {\n _TrackList.prototype.removeTrack.call(this, rtrack);\n\n if (rtrack.removeEventListener && rtrack.enabledChange_) {\n rtrack.removeEventListener('enabledchange', rtrack.enabledChange_);\n rtrack.enabledChange_ = null;\n }\n };\n\n return AudioTrackList;\n}(video_es_TrackList);\n\n/**\n * Un-select all other {@link VideoTrack}s that are selected.\n *\n * @param {VideoTrackList} list\n * list to work on\n *\n * @param {VideoTrack} track\n * The track to skip\n *\n * @private\n */\n\nvar disableOthers = function disableOthers(list, track) {\n for (var i = 0; i < list.length; i++) {\n if (!Object.keys(list[i]).length || track.id === list[i].id) {\n continue;\n } // another video track is enabled, disable it\n\n\n list[i].selected = false;\n }\n};\n/**\n * The current list of {@link VideoTrack} for a video.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist}\n * @extends TrackList\n */\n\n\nvar video_es_VideoTrackList = /*#__PURE__*/function (_TrackList) {\n inheritsLoose_default()(VideoTrackList, _TrackList);\n\n /**\n * Create an instance of this class.\n *\n * @param {VideoTrack[]} [tracks=[]]\n * A list of `VideoTrack` to instantiate the list with.\n */\n function VideoTrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n // make sure only 1 track is enabled\n // sorted from last index to first index\n for (var i = tracks.length - 1; i >= 0; i--) {\n if (tracks[i].selected) {\n disableOthers(tracks, tracks[i]);\n break;\n }\n }\n\n _this = _TrackList.call(this, tracks) || this;\n _this.changing_ = false;\n /**\n * @member {number} VideoTrackList#selectedIndex\n * The current index of the selected {@link VideoTrack`}.\n */\n\n Object.defineProperty(assertThisInitialized_default()(_this), 'selectedIndex', {\n get: function get() {\n for (var _i = 0; _i < this.length; _i++) {\n if (this[_i].selected) {\n return _i;\n }\n }\n\n return -1;\n },\n set: function set() {}\n });\n return _this;\n }\n /**\n * Add a {@link VideoTrack} to the `VideoTrackList`.\n *\n * @param {VideoTrack} track\n * The VideoTrack to add to the list\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = VideoTrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var _this2 = this;\n\n if (track.selected) {\n disableOthers(this, track);\n }\n\n _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this\n\n\n if (!track.addEventListener) {\n return;\n }\n\n track.selectedChange_ = function () {\n if (_this2.changing_) {\n return;\n }\n\n _this2.changing_ = true;\n disableOthers(_this2, track);\n _this2.changing_ = false;\n\n _this2.trigger('change');\n };\n /**\n * @listens VideoTrack#selectedchange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('selectedchange', track.selectedChange_);\n };\n\n _proto.removeTrack = function removeTrack(rtrack) {\n _TrackList.prototype.removeTrack.call(this, rtrack);\n\n if (rtrack.removeEventListener && rtrack.selectedChange_) {\n rtrack.removeEventListener('selectedchange', rtrack.selectedChange_);\n rtrack.selectedChange_ = null;\n }\n };\n\n return VideoTrackList;\n}(video_es_TrackList);\n\n/**\n * The current list of {@link TextTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist}\n * @extends TrackList\n */\n\nvar video_es_TextTrackList = /*#__PURE__*/function (_TrackList) {\n inheritsLoose_default()(TextTrackList, _TrackList);\n\n function TextTrackList() {\n return _TrackList.apply(this, arguments) || this;\n }\n\n var _proto = TextTrackList.prototype;\n\n /**\n * Add a {@link TextTrack} to the `TextTrackList`\n *\n * @param {TextTrack} track\n * The text track to add to the list.\n *\n * @fires TrackList#addtrack\n */\n _proto.addTrack = function addTrack(track) {\n var _this = this;\n\n _TrackList.prototype.addTrack.call(this, track);\n\n if (!this.queueChange_) {\n this.queueChange_ = function () {\n return _this.queueTrigger('change');\n };\n }\n\n if (!this.triggerSelectedlanguagechange) {\n this.triggerSelectedlanguagechange_ = function () {\n return _this.trigger('selectedlanguagechange');\n };\n }\n /**\n * @listens TextTrack#modechange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('modechange', this.queueChange_);\n var nonLanguageTextTrackKind = ['metadata', 'chapters'];\n\n if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {\n track.addEventListener('modechange', this.triggerSelectedlanguagechange_);\n }\n };\n\n _proto.removeTrack = function removeTrack(rtrack) {\n _TrackList.prototype.removeTrack.call(this, rtrack); // manually remove the event handlers we added\n\n\n if (rtrack.removeEventListener) {\n if (this.queueChange_) {\n rtrack.removeEventListener('modechange', this.queueChange_);\n }\n\n if (this.selectedlanguagechange_) {\n rtrack.removeEventListener('modechange', this.triggerSelectedlanguagechange_);\n }\n }\n };\n\n return TextTrackList;\n}(video_es_TrackList);\n\n/**\n * @file html-track-element-list.js\n */\n\n/**\n * The current list of {@link HtmlTrackElement}s.\n */\nvar HtmlTrackElementList = /*#__PURE__*/function () {\n /**\n * Create an instance of this class.\n *\n * @param {HtmlTrackElement[]} [tracks=[]]\n * A list of `HtmlTrackElement` to instantiate the list with.\n */\n function HtmlTrackElementList(trackElements) {\n if (trackElements === void 0) {\n trackElements = [];\n }\n\n this.trackElements_ = [];\n /**\n * @memberof HtmlTrackElementList\n * @member {number} length\n * The current number of `Track`s in the this Trackist.\n * @instance\n */\n\n Object.defineProperty(this, 'length', {\n get: function get() {\n return this.trackElements_.length;\n }\n });\n\n for (var i = 0, length = trackElements.length; i < length; i++) {\n this.addTrackElement_(trackElements[i]);\n }\n }\n /**\n * Add an {@link HtmlTrackElement} to the `HtmlTrackElementList`\n *\n * @param {HtmlTrackElement} trackElement\n * The track element to add to the list.\n *\n * @private\n */\n\n\n var _proto = HtmlTrackElementList.prototype;\n\n _proto.addTrackElement_ = function addTrackElement_(trackElement) {\n var index = this.trackElements_.length;\n\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get: function get() {\n return this.trackElements_[index];\n }\n });\n } // Do not add duplicate elements\n\n\n if (this.trackElements_.indexOf(trackElement) === -1) {\n this.trackElements_.push(trackElement);\n }\n }\n /**\n * Get an {@link HtmlTrackElement} from the `HtmlTrackElementList` given an\n * {@link TextTrack}.\n *\n * @param {TextTrack} track\n * The track associated with a track element.\n *\n * @return {HtmlTrackElement|undefined}\n * The track element that was found or undefined.\n *\n * @private\n */\n ;\n\n _proto.getTrackElementByTrack_ = function getTrackElementByTrack_(track) {\n var trackElement_;\n\n for (var i = 0, length = this.trackElements_.length; i < length; i++) {\n if (track === this.trackElements_[i].track) {\n trackElement_ = this.trackElements_[i];\n break;\n }\n }\n\n return trackElement_;\n }\n /**\n * Remove a {@link HtmlTrackElement} from the `HtmlTrackElementList`\n *\n * @param {HtmlTrackElement} trackElement\n * The track element to remove from the list.\n *\n * @private\n */\n ;\n\n _proto.removeTrackElement_ = function removeTrackElement_(trackElement) {\n for (var i = 0, length = this.trackElements_.length; i < length; i++) {\n if (trackElement === this.trackElements_[i]) {\n if (this.trackElements_[i].track && typeof this.trackElements_[i].track.off === 'function') {\n this.trackElements_[i].track.off();\n }\n\n if (typeof this.trackElements_[i].off === 'function') {\n this.trackElements_[i].off();\n }\n\n this.trackElements_.splice(i, 1);\n break;\n }\n }\n };\n\n return HtmlTrackElementList;\n}();\n\n/**\n * @file text-track-cue-list.js\n */\n\n/**\n * @typedef {Object} TextTrackCueList~TextTrackCue\n *\n * @property {string} id\n * The unique id for this text track cue\n *\n * @property {number} startTime\n * The start time for this text track cue\n *\n * @property {number} endTime\n * The end time for this text track cue\n *\n * @property {boolean} pauseOnExit\n * Pause when the end time is reached if true.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcue}\n */\n\n/**\n * A List of TextTrackCues.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist}\n */\nvar TextTrackCueList = /*#__PURE__*/function () {\n /**\n * Create an instance of this class..\n *\n * @param {Array} cues\n * A list of cues to be initialized with\n */\n function TextTrackCueList(cues) {\n TextTrackCueList.prototype.setCues_.call(this, cues);\n /**\n * @memberof TextTrackCueList\n * @member {number} length\n * The current number of `TextTrackCue`s in the TextTrackCueList.\n * @instance\n */\n\n Object.defineProperty(this, 'length', {\n get: function get() {\n return this.length_;\n }\n });\n }\n /**\n * A setter for cues in this list. Creates getters\n * an an index for the cues.\n *\n * @param {Array} cues\n * An array of cues to set\n *\n * @private\n */\n\n\n var _proto = TextTrackCueList.prototype;\n\n _proto.setCues_ = function setCues_(cues) {\n var oldLength = this.length || 0;\n var i = 0;\n var l = cues.length;\n this.cues_ = cues;\n this.length_ = cues.length;\n\n var defineProp = function defineProp(index) {\n if (!('' + index in this)) {\n Object.defineProperty(this, '' + index, {\n get: function get() {\n return this.cues_[index];\n }\n });\n }\n };\n\n if (oldLength < l) {\n i = oldLength;\n\n for (; i < l; i++) {\n defineProp.call(this, i);\n }\n }\n }\n /**\n * Get a `TextTrackCue` that is currently in the `TextTrackCueList` by id.\n *\n * @param {string} id\n * The id of the cue that should be searched for.\n *\n * @return {TextTrackCueList~TextTrackCue|null}\n * A single cue or null if none was found.\n */\n ;\n\n _proto.getCueById = function getCueById(id) {\n var result = null;\n\n for (var i = 0, l = this.length; i < l; i++) {\n var cue = this[i];\n\n if (cue.id === id) {\n result = cue;\n break;\n }\n }\n\n return result;\n };\n\n return TextTrackCueList;\n}();\n\n/**\n * @file track-kinds.js\n */\n\n/**\n * All possible `VideoTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-videotrack-kind\n * @typedef VideoTrack~Kind\n * @enum\n */\nvar VideoTrackKind = {\n alternative: 'alternative',\n captions: 'captions',\n main: 'main',\n sign: 'sign',\n subtitles: 'subtitles',\n commentary: 'commentary'\n};\n/**\n * All possible `AudioTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-kind\n * @typedef AudioTrack~Kind\n * @enum\n */\n\nvar AudioTrackKind = {\n 'alternative': 'alternative',\n 'descriptions': 'descriptions',\n 'main': 'main',\n 'main-desc': 'main-desc',\n 'translation': 'translation',\n 'commentary': 'commentary'\n};\n/**\n * All possible `TextTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-texttrack-kind\n * @typedef TextTrack~Kind\n * @enum\n */\n\nvar TextTrackKind = {\n subtitles: 'subtitles',\n captions: 'captions',\n descriptions: 'descriptions',\n chapters: 'chapters',\n metadata: 'metadata'\n};\n/**\n * All possible `TextTrackMode`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode\n * @typedef TextTrack~Mode\n * @enum\n */\n\nvar TextTrackMode = {\n disabled: 'disabled',\n hidden: 'hidden',\n showing: 'showing'\n};\n\n/**\n * A Track class that contains all of the common functionality for {@link AudioTrack},\n * {@link VideoTrack}, and {@link TextTrack}.\n *\n * > Note: This class should not be used directly\n *\n * @see {@link https://html.spec.whatwg.org/multipage/embedded-content.html}\n * @extends EventTarget\n * @abstract\n */\n\nvar video_es_Track = /*#__PURE__*/function (_EventTarget) {\n inheritsLoose_default()(Track, _EventTarget);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {string} [options.kind='']\n * A valid kind for the track type you are creating.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @abstract\n */\n function Track(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _EventTarget.call(this) || this;\n var trackProps = {\n id: options.id || 'vjs_track_' + newGUID(),\n kind: options.kind || '',\n language: options.language || ''\n };\n var label = options.label || '';\n /**\n * @memberof Track\n * @member {string} id\n * The id of this track. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} kind\n * The kind of track that this is. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} language\n * The two letter language code for this track. Cannot be changed after\n * creation.\n * @instance\n *\n * @readonly\n */\n\n var _loop = function _loop(key) {\n Object.defineProperty(assertThisInitialized_default()(_this), key, {\n get: function get() {\n return trackProps[key];\n },\n set: function set() {}\n });\n };\n\n for (var key in trackProps) {\n _loop(key);\n }\n /**\n * @memberof Track\n * @member {string} label\n * The label of this track. Cannot be changed after creation.\n * @instance\n *\n * @fires Track#labelchange\n */\n\n\n Object.defineProperty(assertThisInitialized_default()(_this), 'label', {\n get: function get() {\n return label;\n },\n set: function set(newLabel) {\n if (newLabel !== label) {\n label = newLabel;\n /**\n * An event that fires when label changes on this track.\n *\n * > Note: This is not part of the spec!\n *\n * @event Track#labelchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('labelchange');\n }\n }\n });\n return _this;\n }\n\n return Track;\n}(EventTarget$2);\n\n/**\n * @file url.js\n * @module url\n */\n/**\n * @typedef {Object} url:URLObject\n *\n * @property {string} protocol\n * The protocol of the url that was parsed.\n *\n * @property {string} hostname\n * The hostname of the url that was parsed.\n *\n * @property {string} port\n * The port of the url that was parsed.\n *\n * @property {string} pathname\n * The pathname of the url that was parsed.\n *\n * @property {string} search\n * The search query of the url that was parsed.\n *\n * @property {string} hash\n * The hash of the url that was parsed.\n *\n * @property {string} host\n * The host of the url that was parsed.\n */\n\n/**\n * Resolve and parse the elements of a URL.\n *\n * @function\n * @param {String} url\n * The url to parse\n *\n * @return {url:URLObject}\n * An object of url details\n */\n\nvar video_es_parseUrl = function parseUrl(url) {\n // This entire method can be replace with URL once we are able to drop IE11\n var props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host']; // add the url to an anchor and let the browser parse the URL\n\n var a = document_default.a.createElement('a');\n a.href = url; // Copy the specific URL properties to a new object\n // This is also needed for IE because the anchor loses its\n // properties when it's removed from the dom\n\n var details = {};\n\n for (var i = 0; i < props.length; i++) {\n details[props[i]] = a[props[i]];\n } // IE adds the port to the host property unlike everyone else. If\n // a port identifier is added for standard ports, strip it.\n\n\n if (details.protocol === 'http:') {\n details.host = details.host.replace(/:80$/, '');\n }\n\n if (details.protocol === 'https:') {\n details.host = details.host.replace(/:443$/, '');\n }\n\n if (!details.protocol) {\n details.protocol = window_default.a.location.protocol;\n }\n /* istanbul ignore if */\n\n\n if (!details.host) {\n details.host = window_default.a.location.host;\n }\n\n return details;\n};\n/**\n * Get absolute version of relative URL. Used to tell Flash the correct URL.\n *\n * @function\n * @param {string} url\n * URL to make absolute\n *\n * @return {string}\n * Absolute URL\n *\n * @see http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue\n */\n\nvar video_es_getAbsoluteURL = function getAbsoluteURL(url) {\n // Check if absolute URL\n if (!url.match(/^https?:\\/\\//)) {\n // Convert to absolute URL. Flash hosted off-site needs an absolute URL.\n // add the url to an anchor and let the browser parse the URL\n var a = document_default.a.createElement('a');\n a.href = url;\n url = a.href;\n }\n\n return url;\n};\n/**\n * Returns the extension of the passed file name. It will return an empty string\n * if passed an invalid path.\n *\n * @function\n * @param {string} path\n * The fileName path like '/path/to/file.mp4'\n *\n * @return {string}\n * The extension in lower case or an empty string if no\n * extension could be found.\n */\n\nvar getFileExtension = function getFileExtension(path) {\n if (typeof path === 'string') {\n var splitPathRe = /^(\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?)(\\.([^\\.\\/\\?]+)))(?:[\\/]*|[\\?].*)$/;\n var pathParts = splitPathRe.exec(path);\n\n if (pathParts) {\n return pathParts.pop().toLowerCase();\n }\n }\n\n return '';\n};\n/**\n * Returns whether the url passed is a cross domain request or not.\n *\n * @function\n * @param {string} url\n * The url to check.\n *\n * @param {Object} [winLoc]\n * the domain to check the url against, defaults to window.location\n *\n * @param {string} [winLoc.protocol]\n * The window location protocol defaults to window.location.protocol\n *\n * @param {string} [winLoc.host]\n * The window location host defaults to window.location.host\n *\n * @return {boolean}\n * Whether it is a cross domain request or not.\n */\n\nvar video_es_isCrossOrigin = function isCrossOrigin(url, winLoc) {\n if (winLoc === void 0) {\n winLoc = window_default.a.location;\n }\n\n var urlInfo = video_es_parseUrl(url); // IE8 protocol relative urls will return ':' for protocol\n\n var srcProtocol = urlInfo.protocol === ':' ? winLoc.protocol : urlInfo.protocol; // Check if url is for another domain/origin\n // IE8 doesn't know location.origin, so we won't rely on it here\n\n var crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;\n return crossOrigin;\n};\n\nvar Url = /*#__PURE__*/Object.freeze({\n __proto__: null,\n parseUrl: video_es_parseUrl,\n getAbsoluteURL: video_es_getAbsoluteURL,\n getFileExtension: getFileExtension,\n isCrossOrigin: video_es_isCrossOrigin\n});\n\n/**\n * Takes a webvtt file contents and parses it into cues\n *\n * @param {string} srcContent\n * webVTT file contents\n *\n * @param {TextTrack} track\n * TextTrack to add cues to. Cues come from the srcContent.\n *\n * @private\n */\n\nvar video_es_parseCues = function parseCues(srcContent, track) {\n var parser = new window_default.a.WebVTT.Parser(window_default.a, window_default.a.vttjs, window_default.a.WebVTT.StringDecoder());\n var errors = [];\n\n parser.oncue = function (cue) {\n track.addCue(cue);\n };\n\n parser.onparsingerror = function (error) {\n errors.push(error);\n };\n\n parser.onflush = function () {\n track.trigger({\n type: 'loadeddata',\n target: track\n });\n };\n\n parser.parse(srcContent);\n\n if (errors.length > 0) {\n if (window_default.a.console && window_default.a.console.groupCollapsed) {\n window_default.a.console.groupCollapsed(\"Text Track parsing errors for \" + track.src);\n }\n\n errors.forEach(function (error) {\n return log$1.error(error);\n });\n\n if (window_default.a.console && window_default.a.console.groupEnd) {\n window_default.a.console.groupEnd();\n }\n }\n\n parser.flush();\n};\n/**\n * Load a `TextTrack` from a specified url.\n *\n * @param {string} src\n * Url to load track from.\n *\n * @param {TextTrack} track\n * Track to add cues to. Comes from the content at the end of `url`.\n *\n * @private\n */\n\n\nvar video_es_loadTrack = function loadTrack(src, track) {\n var opts = {\n uri: src\n };\n var crossOrigin = video_es_isCrossOrigin(src);\n\n if (crossOrigin) {\n opts.cors = crossOrigin;\n }\n\n var withCredentials = track.tech_.crossOrigin() === 'use-credentials';\n\n if (withCredentials) {\n opts.withCredentials = withCredentials;\n }\n\n lib_default()(opts, bind(this, function (err, response, responseBody) {\n if (err) {\n return log$1.error(err, response);\n }\n\n track.loaded_ = true; // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n // NOTE: this is only used for the alt/video.novtt.js build\n\n if (typeof window_default.a.WebVTT !== 'function') {\n if (track.tech_) {\n // to prevent use before define eslint error, we define loadHandler\n // as a let here\n track.tech_.any(['vttjsloaded', 'vttjserror'], function (event) {\n if (event.type === 'vttjserror') {\n log$1.error(\"vttjs failed to load, stopping trying to process \" + track.src);\n return;\n }\n\n return video_es_parseCues(responseBody, track);\n });\n }\n } else {\n video_es_parseCues(responseBody, track);\n }\n }));\n};\n/**\n * A representation of a single `TextTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrack}\n * @extends Track\n */\n\n\nvar video_es_TextTrack = /*#__PURE__*/function (_Track) {\n inheritsLoose_default()(TextTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} options={}\n * Object of option names and values\n *\n * @param {Tech} options.tech\n * A reference to the tech that owns this TextTrack.\n *\n * @param {TextTrack~Kind} [options.kind='subtitles']\n * A valid text track kind.\n *\n * @param {TextTrack~Mode} [options.mode='disabled']\n * A valid text track mode.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this TextTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {string} [options.srclang='']\n * A valid two character language code. An alternative, but deprioritized\n * version of `options.language`\n *\n * @param {string} [options.src]\n * A url to TextTrack cues.\n *\n * @param {boolean} [options.default]\n * If this track should default to on or off.\n */\n function TextTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (!options.tech) {\n throw new Error('A tech was not provided.');\n }\n\n var settings = mergeOptions$3(options, {\n kind: TextTrackKind[options.kind] || 'subtitles',\n language: options.language || options.srclang || ''\n });\n var mode = TextTrackMode[settings.mode] || 'disabled';\n var default_ = settings[\"default\"];\n\n if (settings.kind === 'metadata' || settings.kind === 'chapters') {\n mode = 'hidden';\n }\n\n _this = _Track.call(this, settings) || this;\n _this.tech_ = settings.tech;\n _this.cues_ = [];\n _this.activeCues_ = [];\n _this.preload_ = _this.tech_.preloadTextTracks !== false;\n var cues = new TextTrackCueList(_this.cues_);\n var activeCues = new TextTrackCueList(_this.activeCues_);\n var changed = false;\n var timeupdateHandler = bind(assertThisInitialized_default()(_this), function () {\n if (!this.tech_.isReady_ || this.tech_.isDisposed()) {\n return;\n } // Accessing this.activeCues for the side-effects of updating itself\n // due to its nature as a getter function. Do not remove or cues will\n // stop updating!\n // Use the setter to prevent deletion from uglify (pure_getters rule)\n\n\n this.activeCues = this.activeCues;\n\n if (changed) {\n this.trigger('cuechange');\n changed = false;\n }\n });\n\n var disposeHandler = function disposeHandler() {\n _this.tech_.off('timeupdate', timeupdateHandler);\n };\n\n _this.tech_.one('dispose', disposeHandler);\n\n if (mode !== 'disabled') {\n _this.tech_.on('timeupdate', timeupdateHandler);\n }\n\n Object.defineProperties(assertThisInitialized_default()(_this), {\n /**\n * @memberof TextTrack\n * @member {boolean} default\n * If this track was set to be on or off by default. Cannot be changed after\n * creation.\n * @instance\n *\n * @readonly\n */\n \"default\": {\n get: function get() {\n return default_;\n },\n set: function set() {}\n },\n\n /**\n * @memberof TextTrack\n * @member {string} mode\n * Set the mode of this TextTrack to a valid {@link TextTrack~Mode}. Will\n * not be set if setting to an invalid mode.\n * @instance\n *\n * @fires TextTrack#modechange\n */\n mode: {\n get: function get() {\n return mode;\n },\n set: function set(newMode) {\n if (!TextTrackMode[newMode]) {\n return;\n }\n\n if (mode === newMode) {\n return;\n }\n\n mode = newMode;\n\n if (!this.preload_ && mode !== 'disabled' && this.cues.length === 0) {\n // On-demand load.\n video_es_loadTrack(this.src, this);\n }\n\n this.tech_.off('timeupdate', timeupdateHandler);\n\n if (mode !== 'disabled') {\n this.tech_.on('timeupdate', timeupdateHandler);\n }\n /**\n * An event that fires when mode changes on this track. This allows\n * the TextTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec!\n *\n * @event TextTrack#modechange\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('modechange');\n }\n },\n\n /**\n * @memberof TextTrack\n * @member {TextTrackCueList} cues\n * The text track cue list for this TextTrack.\n * @instance\n */\n cues: {\n get: function get() {\n if (!this.loaded_) {\n return null;\n }\n\n return cues;\n },\n set: function set() {}\n },\n\n /**\n * @memberof TextTrack\n * @member {TextTrackCueList} activeCues\n * The list text track cues that are currently active for this TextTrack.\n * @instance\n */\n activeCues: {\n get: function get() {\n if (!this.loaded_) {\n return null;\n } // nothing to do\n\n\n if (this.cues.length === 0) {\n return activeCues;\n }\n\n var ct = this.tech_.currentTime();\n var active = [];\n\n for (var i = 0, l = this.cues.length; i < l; i++) {\n var cue = this.cues[i];\n\n if (cue.startTime <= ct && cue.endTime >= ct) {\n active.push(cue);\n } else if (cue.startTime === cue.endTime && cue.startTime <= ct && cue.startTime + 0.5 >= ct) {\n active.push(cue);\n }\n }\n\n changed = false;\n\n if (active.length !== this.activeCues_.length) {\n changed = true;\n } else {\n for (var _i = 0; _i < active.length; _i++) {\n if (this.activeCues_.indexOf(active[_i]) === -1) {\n changed = true;\n }\n }\n }\n\n this.activeCues_ = active;\n activeCues.setCues_(this.activeCues_);\n return activeCues;\n },\n // /!\\ Keep this setter empty (see the timeupdate handler above)\n set: function set() {}\n }\n });\n\n if (settings.src) {\n _this.src = settings.src;\n\n if (!_this.preload_) {\n // Tracks will load on-demand.\n // Act like we're loaded for other purposes.\n _this.loaded_ = true;\n }\n\n if (_this.preload_ || settings.kind !== 'subtitles' && settings.kind !== 'captions') {\n video_es_loadTrack(_this.src, assertThisInitialized_default()(_this));\n }\n } else {\n _this.loaded_ = true;\n }\n\n return _this;\n }\n /**\n * Add a cue to the internal list of cues.\n *\n * @param {TextTrack~Cue} cue\n * The cue to add to our internal list\n */\n\n\n var _proto = TextTrack.prototype;\n\n _proto.addCue = function addCue(originalCue) {\n var cue = originalCue;\n\n if (window_default.a.vttjs && !(originalCue instanceof window_default.a.vttjs.VTTCue)) {\n cue = new window_default.a.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);\n\n for (var prop in originalCue) {\n if (!(prop in cue)) {\n cue[prop] = originalCue[prop];\n }\n } // make sure that `id` is copied over\n\n\n cue.id = originalCue.id;\n cue.originalCue_ = originalCue;\n }\n\n var tracks = this.tech_.textTracks();\n\n for (var i = 0; i < tracks.length; i++) {\n if (tracks[i] !== this) {\n tracks[i].removeCue(cue);\n }\n }\n\n this.cues_.push(cue);\n this.cues.setCues_(this.cues_);\n }\n /**\n * Remove a cue from our internal list\n *\n * @param {TextTrack~Cue} removeCue\n * The cue to remove from our internal list\n */\n ;\n\n _proto.removeCue = function removeCue(_removeCue) {\n var i = this.cues_.length;\n\n while (i--) {\n var cue = this.cues_[i];\n\n if (cue === _removeCue || cue.originalCue_ && cue.originalCue_ === _removeCue) {\n this.cues_.splice(i, 1);\n this.cues.setCues_(this.cues_);\n break;\n }\n }\n };\n\n return TextTrack;\n}(video_es_Track);\n/**\n * cuechange - One or more cues in the track have become active or stopped being active.\n */\n\n\nvideo_es_TextTrack.prototype.allowedEvents_ = {\n cuechange: 'cuechange'\n};\n\n/**\n * A representation of a single `AudioTrack`. If it is part of an {@link AudioTrackList}\n * only one `AudioTrack` in the list will be enabled at a time.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack}\n * @extends Track\n */\n\nvar video_es_AudioTrack = /*#__PURE__*/function (_Track) {\n inheritsLoose_default()(AudioTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {AudioTrack~Kind} [options.kind='']\n * A valid audio track kind\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {boolean} [options.enabled]\n * If this track is the one that is currently playing. If this track is part of\n * an {@link AudioTrackList}, only one {@link AudioTrack} will be enabled.\n */\n function AudioTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n var settings = mergeOptions$3(options, {\n kind: AudioTrackKind[options.kind] || ''\n });\n _this = _Track.call(this, settings) || this;\n var enabled = false;\n /**\n * @memberof AudioTrack\n * @member {boolean} enabled\n * If this `AudioTrack` is enabled or not. When setting this will\n * fire {@link AudioTrack#enabledchange} if the state of enabled is changed.\n * @instance\n *\n * @fires VideoTrack#selectedchange\n */\n\n Object.defineProperty(assertThisInitialized_default()(_this), 'enabled', {\n get: function get() {\n return enabled;\n },\n set: function set(newEnabled) {\n // an invalid or unchanged value\n if (typeof newEnabled !== 'boolean' || newEnabled === enabled) {\n return;\n }\n\n enabled = newEnabled;\n /**\n * An event that fires when enabled changes on this track. This allows\n * the AudioTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec! Native tracks will do\n * this internally without an event.\n *\n * @event AudioTrack#enabledchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('enabledchange');\n }\n }); // if the user sets this track to selected then\n // set selected to that true value otherwise\n // we keep it false\n\n if (settings.enabled) {\n _this.enabled = settings.enabled;\n }\n\n _this.loaded_ = true;\n return _this;\n }\n\n return AudioTrack;\n}(video_es_Track);\n\n/**\n * A representation of a single `VideoTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotrack}\n * @extends Track\n */\n\nvar video_es_VideoTrack = /*#__PURE__*/function (_Track) {\n inheritsLoose_default()(VideoTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {string} [options.kind='']\n * A valid {@link VideoTrack~Kind}\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {boolean} [options.selected]\n * If this track is the one that is currently playing.\n */\n function VideoTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n var settings = mergeOptions$3(options, {\n kind: VideoTrackKind[options.kind] || ''\n });\n _this = _Track.call(this, settings) || this;\n var selected = false;\n /**\n * @memberof VideoTrack\n * @member {boolean} selected\n * If this `VideoTrack` is selected or not. When setting this will\n * fire {@link VideoTrack#selectedchange} if the state of selected changed.\n * @instance\n *\n * @fires VideoTrack#selectedchange\n */\n\n Object.defineProperty(assertThisInitialized_default()(_this), 'selected', {\n get: function get() {\n return selected;\n },\n set: function set(newSelected) {\n // an invalid or unchanged value\n if (typeof newSelected !== 'boolean' || newSelected === selected) {\n return;\n }\n\n selected = newSelected;\n /**\n * An event that fires when selected changes on this track. This allows\n * the VideoTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec! Native tracks will do\n * this internally without an event.\n *\n * @event VideoTrack#selectedchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('selectedchange');\n }\n }); // if the user sets this track to selected then\n // set selected to that true value otherwise\n // we keep it false\n\n if (settings.selected) {\n _this.selected = settings.selected;\n }\n\n return _this;\n }\n\n return VideoTrack;\n}(video_es_Track);\n\n/**\n * @memberof HTMLTrackElement\n * @typedef {HTMLTrackElement~ReadyState}\n * @enum {number}\n */\n\nvar NONE = 0;\nvar LOADING = 1;\nvar LOADED = 2;\nvar ERROR = 3;\n/**\n * A single track represented in the DOM.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement}\n * @extends EventTarget\n */\n\nvar video_es_HTMLTrackElement = /*#__PURE__*/function (_EventTarget) {\n inheritsLoose_default()(HTMLTrackElement, _EventTarget);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} options={}\n * Object of option names and values\n *\n * @param {Tech} options.tech\n * A reference to the tech that owns this HTMLTrackElement.\n *\n * @param {TextTrack~Kind} [options.kind='subtitles']\n * A valid text track kind.\n *\n * @param {TextTrack~Mode} [options.mode='disabled']\n * A valid text track mode.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this TextTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {string} [options.srclang='']\n * A valid two character language code. An alternative, but deprioritized\n * vesion of `options.language`\n *\n * @param {string} [options.src]\n * A url to TextTrack cues.\n *\n * @param {boolean} [options.default]\n * If this track should default to on or off.\n */\n function HTMLTrackElement(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _EventTarget.call(this) || this;\n var readyState;\n var track = new video_es_TextTrack(options);\n _this.kind = track.kind;\n _this.src = track.src;\n _this.srclang = track.language;\n _this.label = track.label;\n _this[\"default\"] = track[\"default\"];\n Object.defineProperties(assertThisInitialized_default()(_this), {\n /**\n * @memberof HTMLTrackElement\n * @member {HTMLTrackElement~ReadyState} readyState\n * The current ready state of the track element.\n * @instance\n */\n readyState: {\n get: function get() {\n return readyState;\n }\n },\n\n /**\n * @memberof HTMLTrackElement\n * @member {TextTrack} track\n * The underlying TextTrack object.\n * @instance\n *\n */\n track: {\n get: function get() {\n return track;\n }\n }\n });\n readyState = NONE;\n /**\n * @listens TextTrack#loadeddata\n * @fires HTMLTrackElement#load\n */\n\n track.addEventListener('loadeddata', function () {\n readyState = LOADED;\n\n _this.trigger({\n type: 'load',\n target: assertThisInitialized_default()(_this)\n });\n });\n return _this;\n }\n\n return HTMLTrackElement;\n}(EventTarget$2);\n\nvideo_es_HTMLTrackElement.prototype.allowedEvents_ = {\n load: 'load'\n};\nvideo_es_HTMLTrackElement.NONE = NONE;\nvideo_es_HTMLTrackElement.LOADING = LOADING;\nvideo_es_HTMLTrackElement.LOADED = LOADED;\nvideo_es_HTMLTrackElement.ERROR = ERROR;\n\n/*\n * This file contains all track properties that are used in\n * player.js, tech.js, html5.js and possibly other techs in the future.\n */\n\nvar NORMAL = {\n audio: {\n ListClass: video_es_AudioTrackList,\n TrackClass: video_es_AudioTrack,\n capitalName: 'Audio'\n },\n video: {\n ListClass: video_es_VideoTrackList,\n TrackClass: video_es_VideoTrack,\n capitalName: 'Video'\n },\n text: {\n ListClass: video_es_TextTrackList,\n TrackClass: video_es_TextTrack,\n capitalName: 'Text'\n }\n};\nObject.keys(NORMAL).forEach(function (type) {\n NORMAL[type].getterName = type + \"Tracks\";\n NORMAL[type].privateName = type + \"Tracks_\";\n});\nvar REMOTE = {\n remoteText: {\n ListClass: video_es_TextTrackList,\n TrackClass: video_es_TextTrack,\n capitalName: 'RemoteText',\n getterName: 'remoteTextTracks',\n privateName: 'remoteTextTracks_'\n },\n remoteTextEl: {\n ListClass: HtmlTrackElementList,\n TrackClass: video_es_HTMLTrackElement,\n capitalName: 'RemoteTextTrackEls',\n getterName: 'remoteTextTrackEls',\n privateName: 'remoteTextTrackEls_'\n }\n};\n\nvar ALL = extends_default()({}, NORMAL, REMOTE);\n\nREMOTE.names = Object.keys(REMOTE);\nNORMAL.names = Object.keys(NORMAL);\nALL.names = [].concat(REMOTE.names).concat(NORMAL.names);\n\n/**\n * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string\n * that just contains the src url alone.\n * * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};`\n * `var SourceString = 'http://example.com/some-video.mp4';`\n *\n * @typedef {Object|string} Tech~SourceObject\n *\n * @property {string} src\n * The url to the source\n *\n * @property {string} type\n * The mime type of the source\n */\n\n/**\n * A function used by {@link Tech} to create a new {@link TextTrack}.\n *\n * @private\n *\n * @param {Tech} self\n * An instance of the Tech class.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @param {Object} [options={}]\n * An object with additional text track options\n *\n * @return {TextTrack}\n * The text track that was created.\n */\n\nfunction createTrackHelper(self, kind, label, language, options) {\n if (options === void 0) {\n options = {};\n }\n\n var tracks = self.textTracks();\n options.kind = kind;\n\n if (label) {\n options.label = label;\n }\n\n if (language) {\n options.language = language;\n }\n\n options.tech = self;\n var track = new ALL.text.TrackClass(options);\n tracks.addTrack(track);\n return track;\n}\n/**\n * This is the base class for media playback technology controllers, such as\n * {@link HTML5}\n *\n * @extends Component\n */\n\n\nvar video_es_Tech = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(Tech, _Component);\n\n /**\n * Create an instance of this Tech.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} ready\n * Callback function to call when the `HTML5` Tech is ready.\n */\n function Tech(options, ready) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (ready === void 0) {\n ready = function ready() {};\n }\n\n // we don't want the tech to report user activity automatically.\n // This is done manually in addControlsListeners\n options.reportTouchActivity = false;\n _this = _Component.call(this, null, options, ready) || this;\n\n _this.onDurationChange_ = function (e) {\n return _this.onDurationChange(e);\n };\n\n _this.trackProgress_ = function (e) {\n return _this.trackProgress(e);\n };\n\n _this.trackCurrentTime_ = function (e) {\n return _this.trackCurrentTime(e);\n };\n\n _this.stopTrackingCurrentTime_ = function (e) {\n return _this.stopTrackingCurrentTime(e);\n };\n\n _this.disposeSourceHandler_ = function (e) {\n return _this.disposeSourceHandler(e);\n }; // keep track of whether the current source has played at all to\n // implement a very limited played()\n\n\n _this.hasStarted_ = false;\n\n _this.on('playing', function () {\n this.hasStarted_ = true;\n });\n\n _this.on('loadstart', function () {\n this.hasStarted_ = false;\n });\n\n ALL.names.forEach(function (name) {\n var props = ALL[name];\n\n if (options && options[props.getterName]) {\n _this[props.privateName] = options[props.getterName];\n }\n }); // Manually track progress in cases where the browser/tech doesn't report it.\n\n if (!_this.featuresProgressEvents) {\n _this.manualProgressOn();\n } // Manually track timeupdates in cases where the browser/tech doesn't report it.\n\n\n if (!_this.featuresTimeupdateEvents) {\n _this.manualTimeUpdatesOn();\n }\n\n ['Text', 'Audio', 'Video'].forEach(function (track) {\n if (options[\"native\" + track + \"Tracks\"] === false) {\n _this[\"featuresNative\" + track + \"Tracks\"] = false;\n }\n });\n\n if (options.nativeCaptions === false || options.nativeTextTracks === false) {\n _this.featuresNativeTextTracks = false;\n } else if (options.nativeCaptions === true || options.nativeTextTracks === true) {\n _this.featuresNativeTextTracks = true;\n }\n\n if (!_this.featuresNativeTextTracks) {\n _this.emulateTextTracks();\n }\n\n _this.preloadTextTracks = options.preloadTextTracks !== false;\n _this.autoRemoteTextTracks_ = new ALL.text.ListClass();\n\n _this.initTrackListeners(); // Turn on component tap events only if not using native controls\n\n\n if (!options.nativeControlsForTouch) {\n _this.emitTapEvents();\n }\n\n if (_this.constructor) {\n _this.name_ = _this.constructor.name || 'Unknown Tech';\n }\n\n return _this;\n }\n /**\n * A special function to trigger source set in a way that will allow player\n * to re-trigger if the player or tech are not ready yet.\n *\n * @fires Tech#sourceset\n * @param {string} src The source string at the time of the source changing.\n */\n\n\n var _proto = Tech.prototype;\n\n _proto.triggerSourceset = function triggerSourceset(src) {\n var _this2 = this;\n\n if (!this.isReady_) {\n // on initial ready we have to trigger source set\n // 1ms after ready so that player can watch for it.\n this.one('ready', function () {\n return _this2.setTimeout(function () {\n return _this2.triggerSourceset(src);\n }, 1);\n });\n }\n /**\n * Fired when the source is set on the tech causing the media element\n * to reload.\n *\n * @see {@link Player#event:sourceset}\n * @event Tech#sourceset\n * @type {EventTarget~Event}\n */\n\n\n this.trigger({\n src: src,\n type: 'sourceset'\n });\n }\n /* Fallbacks for unsupported event types\n ================================================================================ */\n\n /**\n * Polyfill the `progress` event for browsers that don't support it natively.\n *\n * @see {@link Tech#trackProgress}\n */\n ;\n\n _proto.manualProgressOn = function manualProgressOn() {\n this.on('durationchange', this.onDurationChange_);\n this.manualProgress = true; // Trigger progress watching when a source begins loading\n\n this.one('ready', this.trackProgress_);\n }\n /**\n * Turn off the polyfill for `progress` events that was created in\n * {@link Tech#manualProgressOn}\n */\n ;\n\n _proto.manualProgressOff = function manualProgressOff() {\n this.manualProgress = false;\n this.stopTrackingProgress();\n this.off('durationchange', this.onDurationChange_);\n }\n /**\n * This is used to trigger a `progress` event when the buffered percent changes. It\n * sets an interval function that will be called every 500 milliseconds to check if the\n * buffer end percent has changed.\n *\n * > This function is called by {@link Tech#manualProgressOn}\n *\n * @param {EventTarget~Event} event\n * The `ready` event that caused this to run.\n *\n * @listens Tech#ready\n * @fires Tech#progress\n */\n ;\n\n _proto.trackProgress = function trackProgress(event) {\n this.stopTrackingProgress();\n this.progressInterval = this.setInterval(bind(this, function () {\n // Don't trigger unless buffered amount is greater than last time\n var numBufferedPercent = this.bufferedPercent();\n\n if (this.bufferedPercent_ !== numBufferedPercent) {\n /**\n * See {@link Player#progress}\n *\n * @event Tech#progress\n * @type {EventTarget~Event}\n */\n this.trigger('progress');\n }\n\n this.bufferedPercent_ = numBufferedPercent;\n\n if (numBufferedPercent === 1) {\n this.stopTrackingProgress();\n }\n }), 500);\n }\n /**\n * Update our internal duration on a `durationchange` event by calling\n * {@link Tech#duration}.\n *\n * @param {EventTarget~Event} event\n * The `durationchange` event that caused this to run.\n *\n * @listens Tech#durationchange\n */\n ;\n\n _proto.onDurationChange = function onDurationChange(event) {\n this.duration_ = this.duration();\n }\n /**\n * Get and create a `TimeRange` object for buffering.\n *\n * @return {TimeRange}\n * The time range object that was created.\n */\n ;\n\n _proto.buffered = function buffered() {\n return createTimeRanges(0, 0);\n }\n /**\n * Get the percentage of the current video that is currently buffered.\n *\n * @return {number}\n * A number from 0 to 1 that represents the decimal percentage of the\n * video that is buffered.\n *\n */\n ;\n\n _proto.bufferedPercent = function bufferedPercent$1() {\n return bufferedPercent(this.buffered(), this.duration_);\n }\n /**\n * Turn off the polyfill for `progress` events that was created in\n * {@link Tech#manualProgressOn}\n * Stop manually tracking progress events by clearing the interval that was set in\n * {@link Tech#trackProgress}.\n */\n ;\n\n _proto.stopTrackingProgress = function stopTrackingProgress() {\n this.clearInterval(this.progressInterval);\n }\n /**\n * Polyfill the `timeupdate` event for browsers that don't support it.\n *\n * @see {@link Tech#trackCurrentTime}\n */\n ;\n\n _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() {\n this.manualTimeUpdates = true;\n this.on('play', this.trackCurrentTime_);\n this.on('pause', this.stopTrackingCurrentTime_);\n }\n /**\n * Turn off the polyfill for `timeupdate` events that was created in\n * {@link Tech#manualTimeUpdatesOn}\n */\n ;\n\n _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() {\n this.manualTimeUpdates = false;\n this.stopTrackingCurrentTime();\n this.off('play', this.trackCurrentTime_);\n this.off('pause', this.stopTrackingCurrentTime_);\n }\n /**\n * Sets up an interval function to track current time and trigger `timeupdate` every\n * 250 milliseconds.\n *\n * @listens Tech#play\n * @triggers Tech#timeupdate\n */\n ;\n\n _proto.trackCurrentTime = function trackCurrentTime() {\n if (this.currentTimeInterval) {\n this.stopTrackingCurrentTime();\n }\n\n this.currentTimeInterval = this.setInterval(function () {\n /**\n * Triggered at an interval of 250ms to indicated that time is passing in the video.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n }); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n }, 250);\n }\n /**\n * Stop the interval function created in {@link Tech#trackCurrentTime} so that the\n * `timeupdate` event is no longer triggered.\n *\n * @listens {Tech#pause}\n */\n ;\n\n _proto.stopTrackingCurrentTime = function stopTrackingCurrentTime() {\n this.clearInterval(this.currentTimeInterval); // #1002 - if the video ends right before the next timeupdate would happen,\n // the progress bar won't make it all the way to the end\n\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n }\n /**\n * Turn off all event polyfills, clear the `Tech`s {@link AudioTrackList},\n * {@link VideoTrackList}, and {@link TextTrackList}, and dispose of this Tech.\n *\n * @fires Component#dispose\n */\n ;\n\n _proto.dispose = function dispose() {\n // clear out all tracks because we can't reuse them between techs\n this.clearTracks(NORMAL.names); // Turn off any manual progress or timeupdate tracking\n\n if (this.manualProgress) {\n this.manualProgressOff();\n }\n\n if (this.manualTimeUpdates) {\n this.manualTimeUpdatesOff();\n }\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Clear out a single `TrackList` or an array of `TrackLists` given their names.\n *\n * > Note: Techs without source handlers should call this between sources for `video`\n * & `audio` tracks. You don't want to use them between tracks!\n *\n * @param {string[]|string} types\n * TrackList names to clear, valid names are `video`, `audio`, and\n * `text`.\n */\n ;\n\n _proto.clearTracks = function clearTracks(types) {\n var _this3 = this;\n\n types = [].concat(types); // clear out all tracks because we can't reuse them between techs\n\n types.forEach(function (type) {\n var list = _this3[type + \"Tracks\"]() || [];\n var i = list.length;\n\n while (i--) {\n var track = list[i];\n\n if (type === 'text') {\n _this3.removeRemoteTextTrack(track);\n }\n\n list.removeTrack(track);\n }\n });\n }\n /**\n * Remove any TextTracks added via addRemoteTextTrack that are\n * flagged for automatic garbage collection\n */\n ;\n\n _proto.cleanupAutoTextTracks = function cleanupAutoTextTracks() {\n var list = this.autoRemoteTextTracks_ || [];\n var i = list.length;\n\n while (i--) {\n var track = list[i];\n this.removeRemoteTextTrack(track);\n }\n }\n /**\n * Reset the tech, which will removes all sources and reset the internal readyState.\n *\n * @abstract\n */\n ;\n\n _proto.reset = function reset() {}\n /**\n * Get the value of `crossOrigin` from the tech.\n *\n * @abstract\n *\n * @see {Html5#crossOrigin}\n */\n ;\n\n _proto.crossOrigin = function crossOrigin() {}\n /**\n * Set the value of `crossOrigin` on the tech.\n *\n * @abstract\n *\n * @param {string} crossOrigin the crossOrigin value\n * @see {Html5#setCrossOrigin}\n */\n ;\n\n _proto.setCrossOrigin = function setCrossOrigin() {}\n /**\n * Get or set an error on the Tech.\n *\n * @param {MediaError} [err]\n * Error to set on the Tech\n *\n * @return {MediaError|null}\n * The current error object on the tech, or null if there isn't one.\n */\n ;\n\n _proto.error = function error(err) {\n if (err !== undefined) {\n this.error_ = new MediaError(err);\n this.trigger('error');\n }\n\n return this.error_;\n }\n /**\n * Returns the `TimeRange`s that have been played through for the current source.\n *\n * > NOTE: This implementation is incomplete. It does not track the played `TimeRange`.\n * It only checks whether the source has played at all or not.\n *\n * @return {TimeRange}\n * - A single time range if this video has played\n * - An empty set of ranges if not.\n */\n ;\n\n _proto.played = function played() {\n if (this.hasStarted_) {\n return createTimeRanges(0, 0);\n }\n\n return createTimeRanges();\n }\n /**\n * Start playback\n *\n * @abstract\n *\n * @see {Html5#play}\n */\n ;\n\n _proto.play = function play() {}\n /**\n * Set whether we are scrubbing or not\n *\n * @abstract\n *\n * @see {Html5#setScrubbing}\n */\n ;\n\n _proto.setScrubbing = function setScrubbing() {}\n /**\n * Get whether we are scrubbing or not\n *\n * @abstract\n *\n * @see {Html5#scrubbing}\n */\n ;\n\n _proto.scrubbing = function scrubbing() {}\n /**\n * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was\n * previously called.\n *\n * @fires Tech#timeupdate\n */\n ;\n\n _proto.setCurrentTime = function setCurrentTime() {\n // improve the accuracy of manual timeupdates\n if (this.manualTimeUpdates) {\n /**\n * A manual `timeupdate` event.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n }\n }\n /**\n * Turn on listeners for {@link VideoTrackList}, {@link {AudioTrackList}, and\n * {@link TextTrackList} events.\n *\n * This adds {@link EventTarget~EventListeners} for `addtrack`, and `removetrack`.\n *\n * @fires Tech#audiotrackchange\n * @fires Tech#videotrackchange\n * @fires Tech#texttrackchange\n */\n ;\n\n _proto.initTrackListeners = function initTrackListeners() {\n var _this4 = this;\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link AudioTrackList}\n *\n * @event Tech#audiotrackchange\n * @type {EventTarget~Event}\n */\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link VideoTrackList}\n *\n * @event Tech#videotrackchange\n * @type {EventTarget~Event}\n */\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link TextTrackList}\n *\n * @event Tech#texttrackchange\n * @type {EventTarget~Event}\n */\n NORMAL.names.forEach(function (name) {\n var props = NORMAL[name];\n\n var trackListChanges = function trackListChanges() {\n _this4.trigger(name + \"trackchange\");\n };\n\n var tracks = _this4[props.getterName]();\n\n tracks.addEventListener('removetrack', trackListChanges);\n tracks.addEventListener('addtrack', trackListChanges);\n\n _this4.on('dispose', function () {\n tracks.removeEventListener('removetrack', trackListChanges);\n tracks.removeEventListener('addtrack', trackListChanges);\n });\n });\n }\n /**\n * Emulate TextTracks using vtt.js if necessary\n *\n * @fires Tech#vttjsloaded\n * @fires Tech#vttjserror\n */\n ;\n\n _proto.addWebVttScript_ = function addWebVttScript_() {\n var _this5 = this;\n\n if (window_default.a.WebVTT) {\n return;\n } // Initially, Tech.el_ is a child of a dummy-div wait until the Component system\n // signals that the Tech is ready at which point Tech.el_ is part of the DOM\n // before inserting the WebVTT script\n\n\n if (document_default.a.body.contains(this.el())) {\n // load via require if available and vtt.js script location was not passed in\n // as an option. novtt builds will turn the above require call into an empty object\n // which will cause this if check to always fail.\n if (!this.options_['vtt.js'] && isPlain(browser_index_default.a) && Object.keys(browser_index_default.a).length > 0) {\n this.trigger('vttjsloaded');\n return;\n } // load vtt.js via the script location option or the cdn of no location was\n // passed in\n\n\n var script = document_default.a.createElement('script');\n script.src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js';\n\n script.onload = function () {\n /**\n * Fired when vtt.js is loaded.\n *\n * @event Tech#vttjsloaded\n * @type {EventTarget~Event}\n */\n _this5.trigger('vttjsloaded');\n };\n\n script.onerror = function () {\n /**\n * Fired when vtt.js was not loaded due to an error\n *\n * @event Tech#vttjsloaded\n * @type {EventTarget~Event}\n */\n _this5.trigger('vttjserror');\n };\n\n this.on('dispose', function () {\n script.onload = null;\n script.onerror = null;\n }); // but have not loaded yet and we set it to true before the inject so that\n // we don't overwrite the injected window.WebVTT if it loads right away\n\n window_default.a.WebVTT = true;\n this.el().parentNode.appendChild(script);\n } else {\n this.ready(this.addWebVttScript_);\n }\n }\n /**\n * Emulate texttracks\n *\n */\n ;\n\n _proto.emulateTextTracks = function emulateTextTracks() {\n var _this6 = this;\n\n var tracks = this.textTracks();\n var remoteTracks = this.remoteTextTracks();\n\n var handleAddTrack = function handleAddTrack(e) {\n return tracks.addTrack(e.track);\n };\n\n var handleRemoveTrack = function handleRemoveTrack(e) {\n return tracks.removeTrack(e.track);\n };\n\n remoteTracks.on('addtrack', handleAddTrack);\n remoteTracks.on('removetrack', handleRemoveTrack);\n this.addWebVttScript_();\n\n var updateDisplay = function updateDisplay() {\n return _this6.trigger('texttrackchange');\n };\n\n var textTracksChanges = function textTracksChanges() {\n updateDisplay();\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n track.removeEventListener('cuechange', updateDisplay);\n\n if (track.mode === 'showing') {\n track.addEventListener('cuechange', updateDisplay);\n }\n }\n };\n\n textTracksChanges();\n tracks.addEventListener('change', textTracksChanges);\n tracks.addEventListener('addtrack', textTracksChanges);\n tracks.addEventListener('removetrack', textTracksChanges);\n this.on('dispose', function () {\n remoteTracks.off('addtrack', handleAddTrack);\n remoteTracks.off('removetrack', handleRemoveTrack);\n tracks.removeEventListener('change', textTracksChanges);\n tracks.removeEventListener('addtrack', textTracksChanges);\n tracks.removeEventListener('removetrack', textTracksChanges);\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n track.removeEventListener('cuechange', updateDisplay);\n }\n });\n }\n /**\n * Create and returns a remote {@link TextTrack} object.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @return {TextTrack}\n * The TextTrack that gets created.\n */\n ;\n\n _proto.addTextTrack = function addTextTrack(kind, label, language) {\n if (!kind) {\n throw new Error('TextTrack kind is required but was not provided');\n }\n\n return createTrackHelper(this, kind, label, language);\n }\n /**\n * Create an emulated TextTrack for use by addRemoteTextTrack\n *\n * This is intended to be overridden by classes that inherit from\n * Tech in order to create native or custom TextTracks.\n *\n * @param {Object} options\n * The object should contain the options to initialize the TextTrack with.\n *\n * @param {string} [options.kind]\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n *\n * @param {string} [options.label].\n * Label to identify the text track\n *\n * @param {string} [options.language]\n * Two letter language abbreviation.\n *\n * @return {HTMLTrackElement}\n * The track element that gets created.\n */\n ;\n\n _proto.createRemoteTextTrack = function createRemoteTextTrack(options) {\n var track = mergeOptions$3(options, {\n tech: this\n });\n return new REMOTE.remoteTextEl.TrackClass(track);\n }\n /**\n * Creates a remote text track object and returns an html track element.\n *\n * > Note: This can be an emulated {@link HTMLTrackElement} or a native one.\n *\n * @param {Object} options\n * See {@link Tech#createRemoteTextTrack} for more detailed properties.\n *\n * @param {boolean} [manualCleanup=true]\n * - When false: the TextTrack will be automatically removed from the video\n * element whenever the source changes\n * - When True: The TextTrack will have to be cleaned up manually\n *\n * @return {HTMLTrackElement}\n * An Html Track Element.\n *\n * @deprecated The default functionality for this function will be equivalent\n * to \"manualCleanup=false\" in the future. The manualCleanup parameter will\n * also be removed.\n */\n ;\n\n _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n var _this7 = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var htmlTrackElement = this.createRemoteTextTrack(options);\n\n if (manualCleanup !== true && manualCleanup !== false) {\n // deprecation warning\n 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');\n manualCleanup = true;\n } // store HTMLTrackElement and TextTrack to remote list\n\n\n this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);\n this.remoteTextTracks().addTrack(htmlTrackElement.track);\n\n if (manualCleanup !== true) {\n // create the TextTrackList if it doesn't exist\n this.ready(function () {\n return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track);\n });\n }\n\n return htmlTrackElement;\n }\n /**\n * Remove a remote text track from the remote `TextTrackList`.\n *\n * @param {TextTrack} track\n * `TextTrack` to remove from the `TextTrackList`\n */\n ;\n\n _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {\n var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); // remove HTMLTrackElement and TextTrack from remote list\n\n this.remoteTextTrackEls().removeTrackElement_(trackElement);\n this.remoteTextTracks().removeTrack(track);\n this.autoRemoteTextTracks_.removeTrack(track);\n }\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object}\n * An object with supported media playback quality metrics\n *\n * @abstract\n */\n ;\n\n _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n return {};\n }\n /**\n * Attempt to create a floating video window always on top of other windows\n * so that users may continue consuming media while they interact with other\n * content sites, or applications on their device.\n *\n * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n *\n * @return {Promise|undefined}\n * A promise with a Picture-in-Picture window if the browser supports\n * Promises (or one was passed in as an option). It returns undefined\n * otherwise.\n *\n * @abstract\n */\n ;\n\n _proto.requestPictureInPicture = function requestPictureInPicture() {\n var PromiseClass = this.options_.Promise || window_default.a.Promise;\n\n if (PromiseClass) {\n return PromiseClass.reject();\n }\n }\n /**\n * A method to check for the value of the 'disablePictureInPicture' <video> property.\n * Defaults to true, as it should be considered disabled if the tech does not support pip\n *\n * @abstract\n */\n ;\n\n _proto.disablePictureInPicture = function disablePictureInPicture() {\n return true;\n }\n /**\n * A method to set or unset the 'disablePictureInPicture' <video> property.\n *\n * @abstract\n */\n ;\n\n _proto.setDisablePictureInPicture = function setDisablePictureInPicture() {}\n /**\n * A method to set a poster from a `Tech`.\n *\n * @abstract\n */\n ;\n\n _proto.setPoster = function setPoster() {}\n /**\n * A method to check for the presence of the 'playsinline' <video> attribute.\n *\n * @abstract\n */\n ;\n\n _proto.playsinline = function playsinline() {}\n /**\n * A method to set or unset the 'playsinline' <video> attribute.\n *\n * @abstract\n */\n ;\n\n _proto.setPlaysinline = function setPlaysinline() {}\n /**\n * Attempt to force override of native audio tracks.\n *\n * @param {boolean} override - If set to true native audio will be overridden,\n * otherwise native audio will potentially be used.\n *\n * @abstract\n */\n ;\n\n _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks() {}\n /**\n * Attempt to force override of native video tracks.\n *\n * @param {boolean} override - If set to true native video will be overridden,\n * otherwise native video will potentially be used.\n *\n * @abstract\n */\n ;\n\n _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks() {}\n /*\n * Check if the tech can support the given mime-type.\n *\n * The base tech does not support any type, but source handlers might\n * overwrite this.\n *\n * @param {string} type\n * The mimetype to check for support\n *\n * @return {string}\n * 'probably', 'maybe', or empty string\n *\n * @see [Spec]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType}\n *\n * @abstract\n */\n ;\n\n _proto.canPlayType = function canPlayType() {\n return '';\n }\n /**\n * Check if the type is supported by this tech.\n *\n * The base tech does not support any type, but source handlers might\n * overwrite this.\n *\n * @param {string} type\n * The media type to check\n * @return {string} Returns the native video element's response\n */\n ;\n\n Tech.canPlayType = function canPlayType() {\n return '';\n }\n /**\n * Check if the tech can support the given source\n *\n * @param {Object} srcObj\n * The source object\n * @param {Object} options\n * The options passed to the tech\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n ;\n\n Tech.canPlaySource = function canPlaySource(srcObj, options) {\n return Tech.canPlayType(srcObj.type);\n }\n /*\n * Return whether the argument is a Tech or not.\n * Can be passed either a Class like `Html5` or a instance like `player.tech_`\n *\n * @param {Object} component\n * The item to check\n *\n * @return {boolean}\n * Whether it is a tech or not\n * - True if it is a tech\n * - False if it is not\n */\n ;\n\n Tech.isTech = function isTech(component) {\n return component.prototype instanceof Tech || component instanceof Tech || component === Tech;\n }\n /**\n * Registers a `Tech` into a shared list for videojs.\n *\n * @param {string} name\n * Name of the `Tech` to register.\n *\n * @param {Object} tech\n * The `Tech` class to register.\n */\n ;\n\n Tech.registerTech = function registerTech(name, tech) {\n if (!Tech.techs_) {\n Tech.techs_ = {};\n }\n\n if (!Tech.isTech(tech)) {\n throw new Error(\"Tech \" + name + \" must be a Tech\");\n }\n\n if (!Tech.canPlayType) {\n throw new Error('Techs must have a static canPlayType method on them');\n }\n\n if (!Tech.canPlaySource) {\n throw new Error('Techs must have a static canPlaySource method on them');\n }\n\n name = toTitleCase$1(name);\n Tech.techs_[name] = tech;\n Tech.techs_[toLowerCase(name)] = tech;\n\n if (name !== 'Tech') {\n // camel case the techName for use in techOrder\n Tech.defaultTechOrder_.push(name);\n }\n\n return tech;\n }\n /**\n * Get a `Tech` from the shared list by name.\n *\n * @param {string} name\n * `camelCase` or `TitleCase` name of the Tech to get\n *\n * @return {Tech|undefined}\n * The `Tech` or undefined if there was no tech with the name requested.\n */\n ;\n\n Tech.getTech = function getTech(name) {\n if (!name) {\n return;\n }\n\n if (Tech.techs_ && Tech.techs_[name]) {\n return Tech.techs_[name];\n }\n\n name = toTitleCase$1(name);\n\n if (window_default.a && window_default.a.videojs && window_default.a.videojs[name]) {\n log$1.warn(\"The \" + name + \" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)\");\n return window_default.a.videojs[name];\n }\n };\n\n return Tech;\n}(Component$1);\n/**\n * Get the {@link VideoTrackList}\n *\n * @returns {VideoTrackList}\n * @method Tech.prototype.videoTracks\n */\n\n/**\n * Get the {@link AudioTrackList}\n *\n * @returns {AudioTrackList}\n * @method Tech.prototype.audioTracks\n */\n\n/**\n * Get the {@link TextTrackList}\n *\n * @returns {TextTrackList}\n * @method Tech.prototype.textTracks\n */\n\n/**\n * Get the remote element {@link TextTrackList}\n *\n * @returns {TextTrackList}\n * @method Tech.prototype.remoteTextTracks\n */\n\n/**\n * Get the remote element {@link HtmlTrackElementList}\n *\n * @returns {HtmlTrackElementList}\n * @method Tech.prototype.remoteTextTrackEls\n */\n\n\nALL.names.forEach(function (name) {\n var props = ALL[name];\n\n video_es_Tech.prototype[props.getterName] = function () {\n this[props.privateName] = this[props.privateName] || new props.ListClass();\n return this[props.privateName];\n };\n});\n/**\n * List of associated text tracks\n *\n * @type {TextTrackList}\n * @private\n * @property Tech#textTracks_\n */\n\n/**\n * List of associated audio tracks.\n *\n * @type {AudioTrackList}\n * @private\n * @property Tech#audioTracks_\n */\n\n/**\n * List of associated video tracks.\n *\n * @type {VideoTrackList}\n * @private\n * @property Tech#videoTracks_\n */\n\n/**\n * Boolean indicating whether the `Tech` supports volume control.\n *\n * @type {boolean}\n * @default\n */\n\nvideo_es_Tech.prototype.featuresVolumeControl = true;\n/**\n * Boolean indicating whether the `Tech` supports muting volume.\n *\n * @type {bolean}\n * @default\n */\n\nvideo_es_Tech.prototype.featuresMuteControl = true;\n/**\n * Boolean indicating whether the `Tech` supports fullscreen resize control.\n * Resizing plugins using request fullscreen reloads the plugin\n *\n * @type {boolean}\n * @default\n */\n\nvideo_es_Tech.prototype.featuresFullscreenResize = false;\n/**\n * Boolean indicating whether the `Tech` supports changing the speed at which the video\n * plays. Examples:\n * - Set player to play 2x (twice) as fast\n * - Set player to play 0.5x (half) as fast\n *\n * @type {boolean}\n * @default\n */\n\nvideo_es_Tech.prototype.featuresPlaybackRate = false;\n/**\n * Boolean indicating whether the `Tech` supports the `progress` event. This is currently\n * not triggered by video-js-swf. This will be used to determine if\n * {@link Tech#manualProgressOn} should be called.\n *\n * @type {boolean}\n * @default\n */\n\nvideo_es_Tech.prototype.featuresProgressEvents = false;\n/**\n * Boolean indicating whether the `Tech` supports the `sourceset` event.\n *\n * A tech should set this to `true` and then use {@link Tech#triggerSourceset}\n * to trigger a {@link Tech#event:sourceset} at the earliest time after getting\n * a new source.\n *\n * @type {boolean}\n * @default\n */\n\nvideo_es_Tech.prototype.featuresSourceset = false;\n/**\n * Boolean indicating whether the `Tech` supports the `timeupdate` event. This is currently\n * not triggered by video-js-swf. This will be used to determine if\n * {@link Tech#manualTimeUpdates} should be called.\n *\n * @type {boolean}\n * @default\n */\n\nvideo_es_Tech.prototype.featuresTimeupdateEvents = false;\n/**\n * Boolean indicating whether the `Tech` supports the native `TextTrack`s.\n * This will help us integrate with native `TextTrack`s if the browser supports them.\n *\n * @type {boolean}\n * @default\n */\n\nvideo_es_Tech.prototype.featuresNativeTextTracks = false;\n/**\n * A functional mixin for techs that want to use the Source Handler pattern.\n * Source handlers are scripts for handling specific formats.\n * The source handler pattern is used for adaptive formats (HLS, DASH) that\n * manually load video data and feed it into a Source Buffer (Media Source Extensions)\n * Example: `Tech.withSourceHandlers.call(MyTech);`\n *\n * @param {Tech} _Tech\n * The tech to add source handler functions to.\n *\n * @mixes Tech~SourceHandlerAdditions\n */\n\nvideo_es_Tech.withSourceHandlers = function (_Tech) {\n /**\n * Register a source handler\n *\n * @param {Function} handler\n * The source handler class\n *\n * @param {number} [index]\n * Register it at the following index\n */\n _Tech.registerSourceHandler = function (handler, index) {\n var handlers = _Tech.sourceHandlers;\n\n if (!handlers) {\n handlers = _Tech.sourceHandlers = [];\n }\n\n if (index === undefined) {\n // add to the end of the list\n index = handlers.length;\n }\n\n handlers.splice(index, 0, handler);\n };\n /**\n * Check if the tech can support the given type. Also checks the\n * Techs sourceHandlers.\n *\n * @param {string} type\n * The mimetype to check.\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\n\n _Tech.canPlayType = function (type) {\n var handlers = _Tech.sourceHandlers || [];\n var can;\n\n for (var i = 0; i < handlers.length; i++) {\n can = handlers[i].canPlayType(type);\n\n if (can) {\n return can;\n }\n }\n\n return '';\n };\n /**\n * Returns the first source handler that supports the source.\n *\n * TODO: Answer question: should 'probably' be prioritized over 'maybe'\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Object} options\n * The options passed to the tech\n *\n * @return {SourceHandler|null}\n * The first source handler that supports the source or null if\n * no SourceHandler supports the source\n */\n\n\n _Tech.selectSourceHandler = function (source, options) {\n var handlers = _Tech.sourceHandlers || [];\n var can;\n\n for (var i = 0; i < handlers.length; i++) {\n can = handlers[i].canHandleSource(source, options);\n\n if (can) {\n return handlers[i];\n }\n }\n\n return null;\n };\n /**\n * Check if the tech can support the given source.\n *\n * @param {Tech~SourceObject} srcObj\n * The source object\n *\n * @param {Object} options\n * The options passed to the tech\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\n\n _Tech.canPlaySource = function (srcObj, options) {\n var sh = _Tech.selectSourceHandler(srcObj, options);\n\n if (sh) {\n return sh.canHandleSource(srcObj, options);\n }\n\n return '';\n };\n /**\n * When using a source handler, prefer its implementation of\n * any function normally provided by the tech.\n */\n\n\n var deferrable = ['seekable', 'seeking', 'duration'];\n /**\n * A wrapper around {@link Tech#seekable} that will call a `SourceHandler`s seekable\n * function if it exists, with a fallback to the Techs seekable function.\n *\n * @method _Tech.seekable\n */\n\n /**\n * A wrapper around {@link Tech#duration} that will call a `SourceHandler`s duration\n * function if it exists, otherwise it will fallback to the techs duration function.\n *\n * @method _Tech.duration\n */\n\n deferrable.forEach(function (fnName) {\n var originalFn = this[fnName];\n\n if (typeof originalFn !== 'function') {\n return;\n }\n\n this[fnName] = function () {\n if (this.sourceHandler_ && this.sourceHandler_[fnName]) {\n return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);\n }\n\n return originalFn.apply(this, arguments);\n };\n }, _Tech.prototype);\n /**\n * Create a function for setting the source using a source object\n * and source handlers.\n * Should never be called unless a source handler was found.\n *\n * @param {Tech~SourceObject} source\n * A source object with src and type keys\n */\n\n _Tech.prototype.setSource = function (source) {\n var sh = _Tech.selectSourceHandler(source, this.options_);\n\n if (!sh) {\n // Fall back to a native source hander when unsupported sources are\n // deliberately set\n if (_Tech.nativeSourceHandler) {\n sh = _Tech.nativeSourceHandler;\n } else {\n log$1.error('No source handler found for the current source.');\n }\n } // Dispose any existing source handler\n\n\n this.disposeSourceHandler();\n this.off('dispose', this.disposeSourceHandler_);\n\n if (sh !== _Tech.nativeSourceHandler) {\n this.currentSource_ = source;\n }\n\n this.sourceHandler_ = sh.handleSource(source, this, this.options_);\n this.one('dispose', this.disposeSourceHandler_);\n };\n /**\n * Clean up any existing SourceHandlers and listeners when the Tech is disposed.\n *\n * @listens Tech#dispose\n */\n\n\n _Tech.prototype.disposeSourceHandler = function () {\n // if we have a source and get another one\n // then we are loading something new\n // than clear all of our current tracks\n if (this.currentSource_) {\n this.clearTracks(['audio', 'video']);\n this.currentSource_ = null;\n } // always clean up auto-text tracks\n\n\n this.cleanupAutoTextTracks();\n\n if (this.sourceHandler_) {\n if (this.sourceHandler_.dispose) {\n this.sourceHandler_.dispose();\n }\n\n this.sourceHandler_ = null;\n }\n };\n}; // The base Tech class needs to be registered as a Component. It is the only\n// Tech that can be registered as a Component.\n\n\nComponent$1.registerComponent('Tech', video_es_Tech);\nvideo_es_Tech.registerTech('Tech', video_es_Tech);\n/**\n * A list of techs that should be added to techOrder on Players\n *\n * @private\n */\n\nvideo_es_Tech.defaultTechOrder_ = [];\n\n/**\n * @file middleware.js\n * @module middleware\n */\nvar middlewares = {};\nvar middlewareInstances = {};\nvar TERMINATOR = {};\n/**\n * A middleware object is a plain JavaScript object that has methods that\n * match the {@link Tech} methods found in the lists of allowed\n * {@link module:middleware.allowedGetters|getters},\n * {@link module:middleware.allowedSetters|setters}, and\n * {@link module:middleware.allowedMediators|mediators}.\n *\n * @typedef {Object} MiddlewareObject\n */\n\n/**\n * A middleware factory function that should return a\n * {@link module:middleware~MiddlewareObject|MiddlewareObject}.\n *\n * This factory will be called for each player when needed, with the player\n * passed in as an argument.\n *\n * @callback MiddlewareFactory\n * @param {Player} player\n * A Video.js player.\n */\n\n/**\n * Define a middleware that the player should use by way of a factory function\n * that returns a middleware object.\n *\n * @param {string} type\n * The MIME type to match or `\"*\"` for all MIME types.\n *\n * @param {MiddlewareFactory} middleware\n * A middleware factory function that will be executed for\n * matching types.\n */\n\nfunction use(type, middleware) {\n middlewares[type] = middlewares[type] || [];\n middlewares[type].push(middleware);\n}\n/**\n * Asynchronously sets a source using middleware by recursing through any\n * matching middlewares and calling `setSource` on each, passing along the\n * previous returned value each time.\n *\n * @param {Player} player\n * A {@link Player} instance.\n *\n * @param {Tech~SourceObject} src\n * A source object.\n *\n * @param {Function}\n * The next middleware to run.\n */\n\nfunction setSource(player, src, next) {\n player.setTimeout(function () {\n return setSourceHelper(src, middlewares[src.type], next, player);\n }, 1);\n}\n/**\n * When the tech is set, passes the tech to each middleware's `setTech` method.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * A Video.js tech.\n */\n\nfunction setTech(middleware, tech) {\n middleware.forEach(function (mw) {\n return mw.setTech && mw.setTech(tech);\n });\n}\n/**\n * Calls a getter on the tech first, through each middleware\n * from right to left to the player.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @return {Mixed}\n * The final value from the tech after middleware has intercepted it.\n */\n\nfunction video_es_get(middleware, tech, method) {\n return middleware.reduceRight(middlewareIterator(method), tech[method]());\n}\n/**\n * Takes the argument given to the player and calls the setter method on each\n * middleware from left to right to the tech.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @param {Mixed} arg\n * The value to set on the tech.\n *\n * @return {Mixed}\n * The return value of the `method` of the `tech`.\n */\n\nfunction video_es_set(middleware, tech, method, arg) {\n return tech[method](middleware.reduce(middlewareIterator(method), arg));\n}\n/**\n * Takes the argument given to the player and calls the `call` version of the\n * method on each middleware from left to right.\n *\n * Then, call the passed in method on the tech and return the result unchanged\n * back to the player, through middleware, this time from right to left.\n *\n * @param {Object[]} middleware\n * An array of middleware instances.\n *\n * @param {Tech} tech\n * The current tech.\n *\n * @param {string} method\n * A method name.\n *\n * @param {Mixed} arg\n * The value to set on the tech.\n *\n * @return {Mixed}\n * The return value of the `method` of the `tech`, regardless of the\n * return values of middlewares.\n */\n\nfunction mediate(middleware, tech, method, arg) {\n if (arg === void 0) {\n arg = null;\n }\n\n var callMethod = 'call' + toTitleCase$1(method);\n var middlewareValue = middleware.reduce(middlewareIterator(callMethod), arg);\n var terminated = middlewareValue === TERMINATOR; // deprecated. The `null` return value should instead return TERMINATOR to\n // prevent confusion if a techs method actually returns null.\n\n var returnValue = terminated ? null : tech[method](middlewareValue);\n executeRight(middleware, method, returnValue, terminated);\n return returnValue;\n}\n/**\n * Enumeration of allowed getters where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedGetters = {\n buffered: 1,\n currentTime: 1,\n duration: 1,\n muted: 1,\n played: 1,\n paused: 1,\n seekable: 1,\n volume: 1,\n ended: 1\n};\n/**\n * Enumeration of allowed setters where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedSetters = {\n setCurrentTime: 1,\n setMuted: 1,\n setVolume: 1\n};\n/**\n * Enumeration of allowed mediators where the keys are method names.\n *\n * @type {Object}\n */\n\nvar allowedMediators = {\n play: 1,\n pause: 1\n};\n\nfunction middlewareIterator(method) {\n return function (value, mw) {\n // if the previous middleware terminated, pass along the termination\n if (value === TERMINATOR) {\n return TERMINATOR;\n }\n\n if (mw[method]) {\n return mw[method](value);\n }\n\n return value;\n };\n}\n\nfunction executeRight(mws, method, value, terminated) {\n for (var i = mws.length - 1; i >= 0; i--) {\n var mw = mws[i];\n\n if (mw[method]) {\n mw[method](terminated, value);\n }\n }\n}\n/**\n * Clear the middleware cache for a player.\n *\n * @param {Player} player\n * A {@link Player} instance.\n */\n\n\nfunction clearCacheForPlayer(player) {\n middlewareInstances[player.id()] = null;\n}\n/**\n * {\n * [playerId]: [[mwFactory, mwInstance], ...]\n * }\n *\n * @private\n */\n\nfunction getOrCreateFactory(player, mwFactory) {\n var mws = middlewareInstances[player.id()];\n var mw = null;\n\n if (mws === undefined || mws === null) {\n mw = mwFactory(player);\n middlewareInstances[player.id()] = [[mwFactory, mw]];\n return mw;\n }\n\n for (var i = 0; i < mws.length; i++) {\n var _mws$i = mws[i],\n mwf = _mws$i[0],\n mwi = _mws$i[1];\n\n if (mwf !== mwFactory) {\n continue;\n }\n\n mw = mwi;\n }\n\n if (mw === null) {\n mw = mwFactory(player);\n mws.push([mwFactory, mw]);\n }\n\n return mw;\n}\n\nfunction setSourceHelper(src, middleware, next, player, acc, lastRun) {\n if (src === void 0) {\n src = {};\n }\n\n if (middleware === void 0) {\n middleware = [];\n }\n\n if (acc === void 0) {\n acc = [];\n }\n\n if (lastRun === void 0) {\n lastRun = false;\n }\n\n var _middleware = middleware,\n mwFactory = _middleware[0],\n mwrest = _middleware.slice(1); // if mwFactory is a string, then we're at a fork in the road\n\n\n if (typeof mwFactory === 'string') {\n setSourceHelper(src, middlewares[mwFactory], next, player, acc, lastRun); // if we have an mwFactory, call it with the player to get the mw,\n // then call the mw's setSource method\n } else if (mwFactory) {\n var mw = getOrCreateFactory(player, mwFactory); // if setSource isn't present, implicitly select this middleware\n\n if (!mw.setSource) {\n acc.push(mw);\n return setSourceHelper(src, mwrest, next, player, acc, lastRun);\n }\n\n mw.setSource(video_es_assign({}, src), function (err, _src) {\n // something happened, try the next middleware on the current level\n // make sure to use the old src\n if (err) {\n return setSourceHelper(src, mwrest, next, player, acc, lastRun);\n } // we've succeeded, now we need to go deeper\n\n\n acc.push(mw); // if it's the same type, continue down the current chain\n // otherwise, we want to go down the new chain\n\n setSourceHelper(_src, src.type === _src.type ? mwrest : middlewares[_src.type], next, player, acc, lastRun);\n });\n } else if (mwrest.length) {\n setSourceHelper(src, mwrest, next, player, acc, lastRun);\n } else if (lastRun) {\n next(src, acc);\n } else {\n setSourceHelper(src, middlewares['*'], next, player, acc, true);\n }\n}\n\n/**\n * Mimetypes\n *\n * @see http://hul.harvard.edu/ois/////systems/wax/wax-public-help/mimetypes.htm\n * @typedef Mimetypes~Kind\n * @enum\n */\n\nvar MimetypesKind = {\n opus: 'video/ogg',\n ogv: 'video/ogg',\n mp4: 'video/mp4',\n mov: 'video/mp4',\n m4v: 'video/mp4',\n mkv: 'video/x-matroska',\n m4a: 'audio/mp4',\n mp3: 'audio/mpeg',\n aac: 'audio/aac',\n caf: 'audio/x-caf',\n flac: 'audio/flac',\n oga: 'audio/ogg',\n wav: 'audio/wav',\n m3u8: 'application/x-mpegURL',\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n gif: 'image/gif',\n png: 'image/png',\n svg: 'image/svg+xml',\n webp: 'image/webp'\n};\n/**\n * Get the mimetype of a given src url if possible\n *\n * @param {string} src\n * The url to the src\n *\n * @return {string}\n * return the mimetype if it was known or empty string otherwise\n */\n\nvar getMimetype = function getMimetype(src) {\n if (src === void 0) {\n src = '';\n }\n\n var ext = getFileExtension(src);\n var mimetype = MimetypesKind[ext.toLowerCase()];\n return mimetype || '';\n};\n/**\n * Find the mime type of a given source string if possible. Uses the player\n * source cache.\n *\n * @param {Player} player\n * The player object\n *\n * @param {string} src\n * The source string\n *\n * @return {string}\n * The type that was found\n */\n\nvar findMimetype = function findMimetype(player, src) {\n if (!src) {\n return '';\n } // 1. check for the type in the `source` cache\n\n\n if (player.cache_.source.src === src && player.cache_.source.type) {\n return player.cache_.source.type;\n } // 2. see if we have this source in our `currentSources` cache\n\n\n var matchingSources = player.cache_.sources.filter(function (s) {\n return s.src === src;\n });\n\n if (matchingSources.length) {\n return matchingSources[0].type;\n } // 3. look for the src url in source elements and use the type there\n\n\n var sources = player.$$('source');\n\n for (var i = 0; i < sources.length; i++) {\n var s = sources[i];\n\n if (s.type && s.src && s.src === src) {\n return s.type;\n }\n } // 4. finally fallback to our list of mime types based on src url extension\n\n\n return getMimetype(src);\n};\n\n/**\n * @module filter-source\n */\n/**\n * Filter out single bad source objects or multiple source objects in an\n * array. Also flattens nested source object arrays into a 1 dimensional\n * array of source objects.\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]} src\n * The src object to filter\n *\n * @return {Tech~SourceObject[]}\n * An array of sourceobjects containing only valid sources\n *\n * @private\n */\n\nvar filterSource = function filterSource(src) {\n // traverse array\n if (Array.isArray(src)) {\n var newsrc = [];\n src.forEach(function (srcobj) {\n srcobj = filterSource(srcobj);\n\n if (Array.isArray(srcobj)) {\n newsrc = newsrc.concat(srcobj);\n } else if (video_es_isObject(srcobj)) {\n newsrc.push(srcobj);\n }\n });\n src = newsrc;\n } else if (typeof src === 'string' && src.trim()) {\n // convert string into object\n src = [fixSource({\n src: src\n })];\n } else if (video_es_isObject(src) && typeof src.src === 'string' && src.src && src.src.trim()) {\n // src is already valid\n src = [fixSource(src)];\n } else {\n // invalid source, turn it into an empty array\n src = [];\n }\n\n return src;\n};\n/**\n * Checks src mimetype, adding it when possible\n *\n * @param {Tech~SourceObject} src\n * The src object to check\n * @return {Tech~SourceObject}\n * src Object with known type\n */\n\n\nfunction fixSource(src) {\n if (!src.type) {\n var mimetype = getMimetype(src.src);\n\n if (mimetype) {\n src.type = mimetype;\n }\n }\n\n return src;\n}\n\n/**\n * The `MediaLoader` is the `Component` that decides which playback technology to load\n * when a player is initialized.\n *\n * @extends Component\n */\n\nvar video_es_MediaLoader = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(MediaLoader, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should attach to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function that is run when this component is ready.\n */\n function MediaLoader(player, options, ready) {\n var _this;\n\n // MediaLoader has no element\n var options_ = mergeOptions$3({\n createEl: false\n }, options);\n _this = _Component.call(this, player, options_, ready) || this; // If there are no sources when the player is initialized,\n // load the first supported playback technology.\n\n if (!options.playerOptions.sources || options.playerOptions.sources.length === 0) {\n for (var i = 0, j = options.playerOptions.techOrder; i < j.length; i++) {\n var techName = toTitleCase$1(j[i]);\n var tech = video_es_Tech.getTech(techName); // Support old behavior of techs being registered as components.\n // Remove once that deprecated behavior is removed.\n\n if (!techName) {\n tech = Component$1.getComponent(techName);\n } // Check if the browser supports this technology\n\n\n if (tech && tech.isSupported()) {\n player.loadTech_(techName);\n break;\n }\n }\n } else {\n // Loop through playback technologies (e.g. HTML5) and check for support.\n // Then load the best source.\n // A few assumptions here:\n // All playback technologies respect preload false.\n player.src(options.playerOptions.sources);\n }\n\n return _this;\n }\n\n return MediaLoader;\n}(Component$1);\n\nComponent$1.registerComponent('MediaLoader', video_es_MediaLoader);\n\n/**\n * Component which is clickable or keyboard actionable, but is not a\n * native HTML button.\n *\n * @extends Component\n */\n\nvar video_es_ClickableComponent = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(ClickableComponent, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {function} [options.clickHandler]\n * The function to call when the button is clicked / activated\n */\n function ClickableComponent(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n _this.handleMouseOver_ = function (e) {\n return _this.handleMouseOver(e);\n };\n\n _this.handleMouseOut_ = function (e) {\n return _this.handleMouseOut(e);\n };\n\n _this.handleClick_ = function (e) {\n return _this.handleClick(e);\n };\n\n _this.handleKeyDown_ = function (e) {\n return _this.handleKeyDown(e);\n };\n\n _this.emitTapEvents();\n\n _this.enable();\n\n return _this;\n }\n /**\n * Create the `ClickableComponent`s DOM element.\n *\n * @param {string} [tag=div]\n * The element's node type.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element.\n *\n * @param {Object} [attributes={}]\n * An object of attributes that should be set on the element.\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n var _proto = ClickableComponent.prototype;\n\n _proto.createEl = function createEl$1(tag, props, attributes) {\n if (tag === void 0) {\n tag = 'div';\n }\n\n if (props === void 0) {\n props = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n props = video_es_assign({\n className: this.buildCSSClass(),\n tabIndex: 0\n }, props);\n\n if (tag === 'button') {\n log$1.error(\"Creating a ClickableComponent with an HTML element of \" + tag + \" is not supported; use a Button instead.\");\n } // Add ARIA attributes for clickable element which is not a native HTML button\n\n\n attributes = video_es_assign({\n role: 'button'\n }, attributes);\n this.tabIndex_ = props.tabIndex;\n var el = video_es_createEl(tag, props, attributes);\n el.appendChild(video_es_createEl('span', {\n className: 'vjs-icon-placeholder'\n }, {\n 'aria-hidden': true\n }));\n this.createControlTextEl(el);\n return el;\n };\n\n _proto.dispose = function dispose() {\n // remove controlTextEl_ on dispose\n this.controlTextEl_ = null;\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Create a control text element on this `ClickableComponent`\n *\n * @param {Element} [el]\n * Parent element for the control text.\n *\n * @return {Element}\n * The control text element that gets created.\n */\n ;\n\n _proto.createControlTextEl = function createControlTextEl(el) {\n this.controlTextEl_ = video_es_createEl('span', {\n className: 'vjs-control-text'\n }, {\n // let the screen reader user know that the text of the element may change\n 'aria-live': 'polite'\n });\n\n if (el) {\n el.appendChild(this.controlTextEl_);\n }\n\n this.controlText(this.controlText_, el);\n return this.controlTextEl_;\n }\n /**\n * Get or set the localize text to use for the controls on the `ClickableComponent`.\n *\n * @param {string} [text]\n * Control text for element.\n *\n * @param {Element} [el=this.el()]\n * Element to set the title on.\n *\n * @return {string}\n * - The control text when getting\n */\n ;\n\n _proto.controlText = function controlText(text, el) {\n if (el === void 0) {\n el = this.el();\n }\n\n if (text === undefined) {\n return this.controlText_ || 'Need Text';\n }\n\n var localizedText = this.localize(text);\n this.controlText_ = text;\n textContent(this.controlTextEl_, localizedText);\n\n if (!this.nonIconControl && !this.player_.options_.noUITitleAttributes) {\n // Set title attribute if only an icon is shown\n el.setAttribute('title', localizedText);\n }\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n ;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-control vjs-button \" + _Component.prototype.buildCSSClass.call(this);\n }\n /**\n * Enable this `ClickableComponent`\n */\n ;\n\n _proto.enable = function enable() {\n if (!this.enabled_) {\n this.enabled_ = true;\n this.removeClass('vjs-disabled');\n this.el_.setAttribute('aria-disabled', 'false');\n\n if (typeof this.tabIndex_ !== 'undefined') {\n this.el_.setAttribute('tabIndex', this.tabIndex_);\n }\n\n this.on(['tap', 'click'], this.handleClick_);\n this.on('keydown', this.handleKeyDown_);\n }\n }\n /**\n * Disable this `ClickableComponent`\n */\n ;\n\n _proto.disable = function disable() {\n this.enabled_ = false;\n this.addClass('vjs-disabled');\n this.el_.setAttribute('aria-disabled', 'true');\n\n if (typeof this.tabIndex_ !== 'undefined') {\n this.el_.removeAttribute('tabIndex');\n }\n\n this.off('mouseover', this.handleMouseOver_);\n this.off('mouseout', this.handleMouseOut_);\n this.off(['tap', 'click'], this.handleClick_);\n this.off('keydown', this.handleKeyDown_);\n }\n /**\n * Handles language change in ClickableComponent for the player in components\n *\n *\n */\n ;\n\n _proto.handleLanguagechange = function handleLanguagechange() {\n this.controlText(this.controlText_);\n }\n /**\n * Event handler that is called when a `ClickableComponent` receives a\n * `click` or `tap` event.\n *\n * @param {EventTarget~Event} event\n * The `tap` or `click` event that caused this function to be called.\n *\n * @listens tap\n * @listens click\n * @abstract\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n if (this.options_.clickHandler) {\n this.options_.clickHandler.call(this, arguments);\n }\n }\n /**\n * Event handler that is called when a `ClickableComponent` receives a\n * `keydown` event.\n *\n * By default, if the key is Space or Enter, it will trigger a `click` event.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n // Support Space or Enter key operation to fire a click event. Also,\n // prevent the event from propagating through the DOM and triggering\n // Player hotkeys.\n if (keycode_default.a.isEventKey(event, 'Space') || keycode_default.a.isEventKey(event, 'Enter')) {\n event.preventDefault();\n event.stopPropagation();\n this.trigger('click');\n } else {\n // Pass keypress handling up for unsupported keys\n _Component.prototype.handleKeyDown.call(this, event);\n }\n };\n\n return ClickableComponent;\n}(Component$1);\n\nComponent$1.registerComponent('ClickableComponent', video_es_ClickableComponent);\n\n/**\n * A `ClickableComponent` that handles showing the poster image for the player.\n *\n * @extends ClickableComponent\n */\n\nvar video_es_PosterImage = /*#__PURE__*/function (_ClickableComponent) {\n inheritsLoose_default()(PosterImage, _ClickableComponent);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should attach to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function PosterImage(player, options) {\n var _this;\n\n _this = _ClickableComponent.call(this, player, options) || this;\n\n _this.update();\n\n _this.update_ = function (e) {\n return _this.update(e);\n };\n\n player.on('posterchange', _this.update_);\n return _this;\n }\n /**\n * Clean up and dispose of the `PosterImage`.\n */\n\n\n var _proto = PosterImage.prototype;\n\n _proto.dispose = function dispose() {\n this.player().off('posterchange', this.update_);\n\n _ClickableComponent.prototype.dispose.call(this);\n }\n /**\n * Create the `PosterImage`s DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n ;\n\n _proto.createEl = function createEl$1() {\n var el = video_es_createEl('div', {\n className: 'vjs-poster',\n // Don't want poster to be tabbable.\n tabIndex: -1\n });\n return el;\n }\n /**\n * An {@link EventTarget~EventListener} for {@link Player#posterchange} events.\n *\n * @listens Player#posterchange\n *\n * @param {EventTarget~Event} [event]\n * The `Player#posterchange` event that triggered this function.\n */\n ;\n\n _proto.update = function update(event) {\n var url = this.player().poster();\n this.setSrc(url); // If there's no poster source we should display:none on this component\n // so it's not still clickable or right-clickable\n\n if (url) {\n this.show();\n } else {\n this.hide();\n }\n }\n /**\n * Set the source of the `PosterImage` depending on the display method.\n *\n * @param {string} url\n * The URL to the source for the `PosterImage`.\n */\n ;\n\n _proto.setSrc = function setSrc(url) {\n var backgroundImage = ''; // Any falsy value should stay as an empty string, otherwise\n // this will throw an extra error\n\n if (url) {\n backgroundImage = \"url(\\\"\" + url + \"\\\")\";\n }\n\n this.el_.style.backgroundImage = backgroundImage;\n }\n /**\n * An {@link EventTarget~EventListener} for clicks on the `PosterImage`. See\n * {@link ClickableComponent#handleClick} for instances where this will be triggered.\n *\n * @listens tap\n * @listens click\n * @listens keydown\n *\n * @param {EventTarget~Event} event\n + The `click`, `tap` or `keydown` event that caused this function to be called.\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n // We don't want a click to trigger playback when controls are disabled\n if (!this.player_.controls()) {\n return;\n }\n\n var sourceIsEncrypted = this.player_.usingPlugin('eme') && this.player_.eme.sessions && this.player_.eme.sessions.length > 0;\n\n if (this.player_.tech(true) && // We've observed a bug in IE and Edge when playing back DRM content where\n // calling .focus() on the video element causes the video to go black,\n // so we avoid it in that specific case\n !((IE_VERSION || IS_EDGE) && sourceIsEncrypted)) {\n this.player_.tech(true).focus();\n }\n\n if (this.player_.paused()) {\n silencePromise(this.player_.play());\n } else {\n this.player_.pause();\n }\n };\n\n return PosterImage;\n}(video_es_ClickableComponent);\n\nComponent$1.registerComponent('PosterImage', video_es_PosterImage);\n\nvar darkGray = '#222';\nvar lightGray = '#ccc';\nvar fontMap = {\n monospace: 'monospace',\n sansSerif: 'sans-serif',\n serif: 'serif',\n monospaceSansSerif: '\"Andale Mono\", \"Lucida Console\", monospace',\n monospaceSerif: '\"Courier New\", monospace',\n proportionalSansSerif: 'sans-serif',\n proportionalSerif: 'serif',\n casual: '\"Comic Sans MS\", Impact, fantasy',\n script: '\"Monotype Corsiva\", cursive',\n smallcaps: '\"Andale Mono\", \"Lucida Console\", monospace, sans-serif'\n};\n/**\n * Construct an rgba color from a given hex color code.\n *\n * @param {number} color\n * Hex number for color, like #f0e or #f604e2.\n *\n * @param {number} opacity\n * Value for opacity, 0.0 - 1.0.\n *\n * @return {string}\n * The rgba color that was created, like 'rgba(255, 0, 0, 0.3)'.\n */\n\nfunction constructColor(color, opacity) {\n var hex;\n\n if (color.length === 4) {\n // color looks like \"#f0e\"\n hex = color[1] + color[1] + color[2] + color[2] + color[3] + color[3];\n } else if (color.length === 7) {\n // color looks like \"#f604e2\"\n hex = color.slice(1);\n } else {\n throw new Error('Invalid color code provided, ' + color + '; must be formatted as e.g. #f0e or #f604e2.');\n }\n\n return 'rgba(' + parseInt(hex.slice(0, 2), 16) + ',' + parseInt(hex.slice(2, 4), 16) + ',' + parseInt(hex.slice(4, 6), 16) + ',' + opacity + ')';\n}\n/**\n * Try to update the style of a DOM element. Some style changes will throw an error,\n * particularly in IE8. Those should be noops.\n *\n * @param {Element} el\n * The DOM element to be styled.\n *\n * @param {string} style\n * The CSS property on the element that should be styled.\n *\n * @param {string} rule\n * The style rule that should be applied to the property.\n *\n * @private\n */\n\nfunction tryUpdateStyle(el, style, rule) {\n try {\n el.style[style] = rule;\n } catch (e) {\n // Satisfies linter.\n return;\n }\n}\n/**\n * The component for displaying text track cues.\n *\n * @extends Component\n */\n\n\nvar video_es_TextTrackDisplay = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(TextTrackDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when `TextTrackDisplay` is ready.\n */\n function TextTrackDisplay(player, options, ready) {\n var _this;\n\n _this = _Component.call(this, player, options, ready) || this;\n\n var updateDisplayHandler = function updateDisplayHandler(e) {\n return _this.updateDisplay(e);\n };\n\n player.on('loadstart', function (e) {\n return _this.toggleDisplay(e);\n });\n player.on('texttrackchange', updateDisplayHandler);\n player.on('loadedmetadata', function (e) {\n return _this.preselectTrack(e);\n }); // This used to be called during player init, but was causing an error\n // if a track should show by default and the display hadn't loaded yet.\n // Should probably be moved to an external track loader when we support\n // tracks that don't need a display.\n\n player.ready(bind(assertThisInitialized_default()(_this), function () {\n if (player.tech_ && player.tech_.featuresNativeTextTracks) {\n this.hide();\n return;\n }\n\n player.on('fullscreenchange', updateDisplayHandler);\n player.on('playerresize', updateDisplayHandler);\n window_default.a.addEventListener('orientationchange', updateDisplayHandler);\n player.on('dispose', function () {\n return window_default.a.removeEventListener('orientationchange', updateDisplayHandler);\n });\n var tracks = this.options_.playerOptions.tracks || [];\n\n for (var i = 0; i < tracks.length; i++) {\n this.player_.addRemoteTextTrack(tracks[i], true);\n }\n\n this.preselectTrack();\n }));\n return _this;\n }\n /**\n * Preselect a track following this precedence:\n * - matches the previously selected {@link TextTrack}'s language and kind\n * - matches the previously selected {@link TextTrack}'s language only\n * - is the first default captions track\n * - is the first default descriptions track\n *\n * @listens Player#loadstart\n */\n\n\n var _proto = TextTrackDisplay.prototype;\n\n _proto.preselectTrack = function preselectTrack() {\n var modes = {\n captions: 1,\n subtitles: 1\n };\n var trackList = this.player_.textTracks();\n var userPref = this.player_.cache_.selectedLanguage;\n var firstDesc;\n var firstCaptions;\n var preferredTrack;\n\n for (var i = 0; i < trackList.length; i++) {\n var track = trackList[i];\n\n if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {\n // Always choose the track that matches both language and kind\n if (track.kind === userPref.kind) {\n preferredTrack = track; // or choose the first track that matches language\n } else if (!preferredTrack) {\n preferredTrack = track;\n } // clear everything if offTextTrackMenuItem was clicked\n\n } else if (userPref && !userPref.enabled) {\n preferredTrack = null;\n firstDesc = null;\n firstCaptions = null;\n } else if (track[\"default\"]) {\n if (track.kind === 'descriptions' && !firstDesc) {\n firstDesc = track;\n } else if (track.kind in modes && !firstCaptions) {\n firstCaptions = track;\n }\n }\n } // The preferredTrack matches the user preference and takes\n // precedence over all the other tracks.\n // So, display the preferredTrack before the first default track\n // and the subtitles/captions track before the descriptions track\n\n\n if (preferredTrack) {\n preferredTrack.mode = 'showing';\n } else if (firstCaptions) {\n firstCaptions.mode = 'showing';\n } else if (firstDesc) {\n firstDesc.mode = 'showing';\n }\n }\n /**\n * Turn display of {@link TextTrack}'s from the current state into the other state.\n * There are only two states:\n * - 'shown'\n * - 'hidden'\n *\n * @listens Player#loadstart\n */\n ;\n\n _proto.toggleDisplay = function toggleDisplay() {\n if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {\n this.hide();\n } else {\n this.show();\n }\n }\n /**\n * Create the {@link Component}'s DOM element.\n *\n * @return {Element}\n * The element that was created.\n */\n ;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-text-track-display'\n }, {\n 'aria-live': 'off',\n 'aria-atomic': 'true'\n });\n }\n /**\n * Clear all displayed {@link TextTrack}s.\n */\n ;\n\n _proto.clearDisplay = function clearDisplay() {\n if (typeof window_default.a.WebVTT === 'function') {\n window_default.a.WebVTT.processCues(window_default.a, [], this.el_);\n }\n }\n /**\n * Update the displayed TextTrack when a either a {@link Player#texttrackchange} or\n * a {@link Player#fullscreenchange} is fired.\n *\n * @listens Player#texttrackchange\n * @listens Player#fullscreenchange\n */\n ;\n\n _proto.updateDisplay = function updateDisplay() {\n var tracks = this.player_.textTracks();\n var allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks;\n this.clearDisplay();\n\n if (allowMultipleShowingTracks) {\n var showingTracks = [];\n\n for (var _i = 0; _i < tracks.length; ++_i) {\n var track = tracks[_i];\n\n if (track.mode !== 'showing') {\n continue;\n }\n\n showingTracks.push(track);\n }\n\n this.updateForTrack(showingTracks);\n return;\n } // Track display prioritization model: if multiple tracks are 'showing',\n // display the first 'subtitles' or 'captions' track which is 'showing',\n // otherwise display the first 'descriptions' track which is 'showing'\n\n\n var descriptionsTrack = null;\n var captionsSubtitlesTrack = null;\n var i = tracks.length;\n\n while (i--) {\n var _track = tracks[i];\n\n if (_track.mode === 'showing') {\n if (_track.kind === 'descriptions') {\n descriptionsTrack = _track;\n } else {\n captionsSubtitlesTrack = _track;\n }\n }\n }\n\n if (captionsSubtitlesTrack) {\n if (this.getAttribute('aria-live') !== 'off') {\n this.setAttribute('aria-live', 'off');\n }\n\n this.updateForTrack(captionsSubtitlesTrack);\n } else if (descriptionsTrack) {\n if (this.getAttribute('aria-live') !== 'assertive') {\n this.setAttribute('aria-live', 'assertive');\n }\n\n this.updateForTrack(descriptionsTrack);\n }\n }\n /**\n * Style {@Link TextTrack} activeCues according to {@Link TextTrackSettings}.\n *\n * @param {TextTrack} track\n * Text track object containing active cues to style.\n */\n ;\n\n _proto.updateDisplayState = function updateDisplayState(track) {\n var overrides = this.player_.textTrackSettings.getValues();\n var cues = track.activeCues;\n var i = cues.length;\n\n while (i--) {\n var cue = cues[i];\n\n if (!cue) {\n continue;\n }\n\n var cueDiv = cue.displayState;\n\n if (overrides.color) {\n cueDiv.firstChild.style.color = overrides.color;\n }\n\n if (overrides.textOpacity) {\n tryUpdateStyle(cueDiv.firstChild, 'color', constructColor(overrides.color || '#fff', overrides.textOpacity));\n }\n\n if (overrides.backgroundColor) {\n cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;\n }\n\n if (overrides.backgroundOpacity) {\n tryUpdateStyle(cueDiv.firstChild, 'backgroundColor', constructColor(overrides.backgroundColor || '#000', overrides.backgroundOpacity));\n }\n\n if (overrides.windowColor) {\n if (overrides.windowOpacity) {\n tryUpdateStyle(cueDiv, 'backgroundColor', constructColor(overrides.windowColor, overrides.windowOpacity));\n } else {\n cueDiv.style.backgroundColor = overrides.windowColor;\n }\n }\n\n if (overrides.edgeStyle) {\n if (overrides.edgeStyle === 'dropshadow') {\n cueDiv.firstChild.style.textShadow = \"2px 2px 3px \" + darkGray + \", 2px 2px 4px \" + darkGray + \", 2px 2px 5px \" + darkGray;\n } else if (overrides.edgeStyle === 'raised') {\n cueDiv.firstChild.style.textShadow = \"1px 1px \" + darkGray + \", 2px 2px \" + darkGray + \", 3px 3px \" + darkGray;\n } else if (overrides.edgeStyle === 'depressed') {\n cueDiv.firstChild.style.textShadow = \"1px 1px \" + lightGray + \", 0 1px \" + lightGray + \", -1px -1px \" + darkGray + \", 0 -1px \" + darkGray;\n } else if (overrides.edgeStyle === 'uniform') {\n cueDiv.firstChild.style.textShadow = \"0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray + \", 0 0 4px \" + darkGray;\n }\n }\n\n if (overrides.fontPercent && overrides.fontPercent !== 1) {\n var fontSize = window_default.a.parseFloat(cueDiv.style.fontSize);\n cueDiv.style.fontSize = fontSize * overrides.fontPercent + 'px';\n cueDiv.style.height = 'auto';\n cueDiv.style.top = 'auto';\n }\n\n if (overrides.fontFamily && overrides.fontFamily !== 'default') {\n if (overrides.fontFamily === 'small-caps') {\n cueDiv.firstChild.style.fontVariant = 'small-caps';\n } else {\n cueDiv.firstChild.style.fontFamily = fontMap[overrides.fontFamily];\n }\n }\n }\n }\n /**\n * Add an {@link TextTrack} to to the {@link Tech}s {@link TextTrackList}.\n *\n * @param {TextTrack|TextTrack[]} tracks\n * Text track object or text track array to be added to the list.\n */\n ;\n\n _proto.updateForTrack = function updateForTrack(tracks) {\n if (!Array.isArray(tracks)) {\n tracks = [tracks];\n }\n\n if (typeof window_default.a.WebVTT !== 'function' || tracks.every(function (track) {\n return !track.activeCues;\n })) {\n return;\n }\n\n var cues = []; // push all active track cues\n\n for (var i = 0; i < tracks.length; ++i) {\n var track = tracks[i];\n\n for (var j = 0; j < track.activeCues.length; ++j) {\n cues.push(track.activeCues[j]);\n }\n } // removes all cues before it processes new ones\n\n\n window_default.a.WebVTT.processCues(window_default.a, cues, this.el_); // add unique class to each language text track & add settings styling if necessary\n\n for (var _i2 = 0; _i2 < tracks.length; ++_i2) {\n var _track2 = tracks[_i2];\n\n for (var _j = 0; _j < _track2.activeCues.length; ++_j) {\n var cueEl = _track2.activeCues[_j].displayState;\n addClass(cueEl, 'vjs-text-track-cue');\n addClass(cueEl, 'vjs-text-track-cue-' + (_track2.language ? _track2.language : _i2));\n }\n\n if (this.player_.textTrackSettings) {\n this.updateDisplayState(_track2);\n }\n }\n };\n\n return TextTrackDisplay;\n}(Component$1);\n\nComponent$1.registerComponent('TextTrackDisplay', video_es_TextTrackDisplay);\n\n/**\n * A loading spinner for use during waiting/loading events.\n *\n * @extends Component\n */\n\nvar video_es_LoadingSpinner = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(LoadingSpinner, _Component);\n\n function LoadingSpinner() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = LoadingSpinner.prototype;\n\n /**\n * Create the `LoadingSpinner`s DOM element.\n *\n * @return {Element}\n * The dom element that gets created.\n */\n _proto.createEl = function createEl$1() {\n var isAudio = this.player_.isAudio();\n var playerType = this.localize(isAudio ? 'Audio Player' : 'Video Player');\n var controlText = video_es_createEl('span', {\n className: 'vjs-control-text',\n textContent: this.localize('{1} is loading.', [playerType])\n });\n\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-loading-spinner',\n dir: 'ltr'\n });\n\n el.appendChild(controlText);\n return el;\n };\n\n return LoadingSpinner;\n}(Component$1);\n\nComponent$1.registerComponent('LoadingSpinner', video_es_LoadingSpinner);\n\n/**\n * Base class for all buttons.\n *\n * @extends ClickableComponent\n */\n\nvar video_es_Button = /*#__PURE__*/function (_ClickableComponent) {\n inheritsLoose_default()(Button, _ClickableComponent);\n\n function Button() {\n return _ClickableComponent.apply(this, arguments) || this;\n }\n\n var _proto = Button.prototype;\n\n /**\n * Create the `Button`s DOM element.\n *\n * @param {string} [tag=\"button\"]\n * The element's node type. This argument is IGNORED: no matter what\n * is passed, it will always create a `button` element.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element.\n *\n * @param {Object} [attributes={}]\n * An object of attributes that should be set on the element.\n *\n * @return {Element}\n * The element that gets created.\n */\n _proto.createEl = function createEl$1(tag, props, attributes) {\n if (props === void 0) {\n props = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n tag = 'button';\n props = video_es_assign({\n className: this.buildCSSClass()\n }, props); // Add attributes for button element\n\n attributes = video_es_assign({\n // Necessary since the default button type is \"submit\"\n type: 'button'\n }, attributes);\n\n var el = video_es_createEl(tag, props, attributes);\n\n el.appendChild(video_es_createEl('span', {\n className: 'vjs-icon-placeholder'\n }, {\n 'aria-hidden': true\n }));\n this.createControlTextEl(el);\n return el;\n }\n /**\n * Add a child `Component` inside of this `Button`.\n *\n * @param {string|Component} child\n * The name or instance of a child to add.\n *\n * @param {Object} [options={}]\n * The key/value store of options that will get passed to children of\n * the child.\n *\n * @return {Component}\n * The `Component` that gets added as a child. When using a string the\n * `Component` will get created by this process.\n *\n * @deprecated since version 5\n */\n ;\n\n _proto.addChild = function addChild(child, options) {\n if (options === void 0) {\n options = {};\n }\n\n var className = this.constructor.name;\n log$1.warn(\"Adding an actionable (user controllable) child to a Button (\" + className + \") is not supported; use a ClickableComponent instead.\"); // Avoid the error message generated by ClickableComponent's addChild method\n\n return Component$1.prototype.addChild.call(this, child, options);\n }\n /**\n * Enable the `Button` element so that it can be activated or clicked. Use this with\n * {@link Button#disable}.\n */\n ;\n\n _proto.enable = function enable() {\n _ClickableComponent.prototype.enable.call(this);\n\n this.el_.removeAttribute('disabled');\n }\n /**\n * Disable the `Button` element so that it cannot be activated or clicked. Use this with\n * {@link Button#enable}.\n */\n ;\n\n _proto.disable = function disable() {\n _ClickableComponent.prototype.disable.call(this);\n\n this.el_.setAttribute('disabled', 'disabled');\n }\n /**\n * This gets called when a `Button` has focus and `keydown` is triggered via a key\n * press.\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to get called.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n // Ignore Space or Enter key operation, which is handled by the browser for\n // a button - though not for its super class, ClickableComponent. Also,\n // prevent the event from propagating through the DOM and triggering Player\n // hotkeys. We do not preventDefault here because we _want_ the browser to\n // handle it.\n if (keycode_default.a.isEventKey(event, 'Space') || keycode_default.a.isEventKey(event, 'Enter')) {\n event.stopPropagation();\n return;\n } // Pass keypress handling up for unsupported keys\n\n\n _ClickableComponent.prototype.handleKeyDown.call(this, event);\n };\n\n return Button;\n}(video_es_ClickableComponent);\n\nComponent$1.registerComponent('Button', video_es_Button);\n\n/**\n * The initial play button that shows before the video has played. The hiding of the\n * `BigPlayButton` get done via CSS and `Player` states.\n *\n * @extends Button\n */\n\nvar video_es_BigPlayButton = /*#__PURE__*/function (_Button) {\n inheritsLoose_default()(BigPlayButton, _Button);\n\n function BigPlayButton(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n _this.mouseused_ = false;\n\n _this.on('mousedown', function (e) {\n return _this.handleMouseDown(e);\n });\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object. Always returns 'vjs-big-play-button'.\n */\n\n\n var _proto = BigPlayButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-big-play-button';\n }\n /**\n * This gets called when a `BigPlayButton` \"clicked\". See {@link ClickableComponent}\n * for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n var playPromise = this.player_.play(); // exit early if clicked via the mouse\n\n if (this.mouseused_ && event.clientX && event.clientY) {\n var sourceIsEncrypted = this.player_.usingPlugin('eme') && this.player_.eme.sessions && this.player_.eme.sessions.length > 0;\n silencePromise(playPromise);\n\n if (this.player_.tech(true) && // We've observed a bug in IE and Edge when playing back DRM content where\n // calling .focus() on the video element causes the video to go black,\n // so we avoid it in that specific case\n !((IE_VERSION || IS_EDGE) && sourceIsEncrypted)) {\n this.player_.tech(true).focus();\n }\n\n return;\n }\n\n var cb = this.player_.getChild('controlBar');\n var playToggle = cb && cb.getChild('playToggle');\n\n if (!playToggle) {\n this.player_.tech(true).focus();\n return;\n }\n\n var playFocus = function playFocus() {\n return playToggle.focus();\n };\n\n if (isPromise(playPromise)) {\n playPromise.then(playFocus, function () {});\n } else {\n this.setTimeout(playFocus, 1);\n }\n };\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n this.mouseused_ = false;\n\n _Button.prototype.handleKeyDown.call(this, event);\n };\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n this.mouseused_ = true;\n };\n\n return BigPlayButton;\n}(video_es_Button);\n/**\n * The text that should display over the `BigPlayButton`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_BigPlayButton.prototype.controlText_ = 'Play Video';\nComponent$1.registerComponent('BigPlayButton', video_es_BigPlayButton);\n\n/**\n * The `CloseButton` is a `{@link Button}` that fires a `close` event when\n * it gets clicked.\n *\n * @extends Button\n */\n\nvar video_es_CloseButton = /*#__PURE__*/function (_Button) {\n inheritsLoose_default()(CloseButton, _Button);\n\n /**\n * Creates an instance of the this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function CloseButton(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n\n _this.controlText(options && options.controlText || _this.localize('Close'));\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = CloseButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-close-button \" + _Button.prototype.buildCSSClass.call(this);\n }\n /**\n * This gets called when a `CloseButton` gets clicked. See\n * {@link ClickableComponent#handleClick} for more information on when\n * this will be triggered\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n * @fires CloseButton#close\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n /**\n * Triggered when the a `CloseButton` is clicked.\n *\n * @event CloseButton#close\n * @type {EventTarget~Event}\n *\n * @property {boolean} [bubbles=false]\n * set to false so that the close event does not\n * bubble up to parents if there is no listener\n */\n this.trigger({\n type: 'close',\n bubbles: false\n });\n }\n /**\n * Event handler that is called when a `CloseButton` receives a\n * `keydown` event.\n *\n * By default, if the key is Esc, it will trigger a `click` event.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n // Esc button will trigger `click` event\n if (keycode_default.a.isEventKey(event, 'Esc')) {\n event.preventDefault();\n event.stopPropagation();\n this.trigger('click');\n } else {\n // Pass keypress handling up for unsupported keys\n _Button.prototype.handleKeyDown.call(this, event);\n }\n };\n\n return CloseButton;\n}(video_es_Button);\n\nComponent$1.registerComponent('CloseButton', video_es_CloseButton);\n\n/**\n * Button to toggle between play and pause.\n *\n * @extends Button\n */\n\nvar video_es_PlayToggle = /*#__PURE__*/function (_Button) {\n inheritsLoose_default()(PlayToggle, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function PlayToggle(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _Button.call(this, player, options) || this; // show or hide replay icon\n\n options.replay = options.replay === undefined || options.replay;\n\n _this.on(player, 'play', function (e) {\n return _this.handlePlay(e);\n });\n\n _this.on(player, 'pause', function (e) {\n return _this.handlePause(e);\n });\n\n if (options.replay) {\n _this.on(player, 'ended', function (e) {\n return _this.handleEnded(e);\n });\n }\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = PlayToggle.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-play-control \" + _Button.prototype.buildCSSClass.call(this);\n }\n /**\n * This gets called when an `PlayToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n if (this.player_.paused()) {\n silencePromise(this.player_.play());\n } else {\n this.player_.pause();\n }\n }\n /**\n * This gets called once after the video has ended and the user seeks so that\n * we can change the replay button back to a play button.\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#seeked\n */\n ;\n\n _proto.handleSeeked = function handleSeeked(event) {\n this.removeClass('vjs-ended');\n\n if (this.player_.paused()) {\n this.handlePause(event);\n } else {\n this.handlePlay(event);\n }\n }\n /**\n * Add the vjs-playing class to the element so it can change appearance.\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#play\n */\n ;\n\n _proto.handlePlay = function handlePlay(event) {\n this.removeClass('vjs-ended');\n this.removeClass('vjs-paused');\n this.addClass('vjs-playing'); // change the button text to \"Pause\"\n\n this.controlText('Pause');\n }\n /**\n * Add the vjs-paused class to the element so it can change appearance.\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#pause\n */\n ;\n\n _proto.handlePause = function handlePause(event) {\n this.removeClass('vjs-playing');\n this.addClass('vjs-paused'); // change the button text to \"Play\"\n\n this.controlText('Play');\n }\n /**\n * Add the vjs-ended class to the element so it can change appearance\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#ended\n */\n ;\n\n _proto.handleEnded = function handleEnded(event) {\n var _this2 = this;\n\n this.removeClass('vjs-playing');\n this.addClass('vjs-ended'); // change the button text to \"Replay\"\n\n this.controlText('Replay'); // on the next seek remove the replay button\n\n this.one(this.player_, 'seeked', function (e) {\n return _this2.handleSeeked(e);\n });\n };\n\n return PlayToggle;\n}(video_es_Button);\n/**\n * The text that should display over the `PlayToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_PlayToggle.prototype.controlText_ = 'Play';\nComponent$1.registerComponent('PlayToggle', video_es_PlayToggle);\n\n/**\n * @file format-time.js\n * @module format-time\n */\n\n/**\n * Format seconds as a time string, H:MM:SS or M:SS. Supplying a guide (in\n * seconds) will force a number of leading zeros to cover the length of the\n * guide.\n *\n * @private\n * @param {number} seconds\n * Number of seconds to be turned into a string\n *\n * @param {number} guide\n * Number (in seconds) to model the string after\n *\n * @return {string}\n * Time formatted as H:MM:SS or M:SS\n */\nvar defaultImplementation = function defaultImplementation(seconds, guide) {\n seconds = seconds < 0 ? 0 : seconds;\n var s = Math.floor(seconds % 60);\n var m = Math.floor(seconds / 60 % 60);\n var h = Math.floor(seconds / 3600);\n var gm = Math.floor(guide / 60 % 60);\n var gh = Math.floor(guide / 3600); // handle invalid times\n\n if (isNaN(seconds) || seconds === Infinity) {\n // '-' is false for all relational operators (e.g. <, >=) so this setting\n // will add the minimum number of fields specified by the guide\n h = m = s = '-';\n } // Check if we need to show hours\n\n\n h = h > 0 || gh > 0 ? h + ':' : ''; // If hours are showing, we may need to add a leading zero.\n // Always show at least one digit of minutes.\n\n m = ((h || gm >= 10) && m < 10 ? '0' + m : m) + ':'; // Check if leading zero is need for seconds\n\n s = s < 10 ? '0' + s : s;\n return h + m + s;\n}; // Internal pointer to the current implementation.\n\n\nvar implementation = defaultImplementation;\n/**\n * Replaces the default formatTime implementation with a custom implementation.\n *\n * @param {Function} customImplementation\n * A function which will be used in place of the default formatTime\n * implementation. Will receive the current time in seconds and the\n * guide (in seconds) as arguments.\n */\n\nfunction setFormatTime(customImplementation) {\n implementation = customImplementation;\n}\n/**\n * Resets formatTime to the default implementation.\n */\n\nfunction resetFormatTime() {\n implementation = defaultImplementation;\n}\n/**\n * Delegates to either the default time formatting function or a custom\n * function supplied via `setFormatTime`.\n *\n * Formats seconds as a time string (H:MM:SS or M:SS). Supplying a\n * guide (in seconds) will force a number of leading zeros to cover the\n * length of the guide.\n *\n * @static\n * @example formatTime(125, 600) === \"02:05\"\n * @param {number} seconds\n * Number of seconds to be turned into a string\n *\n * @param {number} guide\n * Number (in seconds) to model the string after\n *\n * @return {string}\n * Time formatted as H:MM:SS or M:SS\n */\n\nfunction formatTime(seconds, guide) {\n if (guide === void 0) {\n guide = seconds;\n }\n\n return implementation(seconds, guide);\n}\n\n/**\n * Displays time information about the video\n *\n * @extends Component\n */\n\nvar video_es_TimeDisplay = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(TimeDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TimeDisplay(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n _this.on(player, ['timeupdate', 'ended'], function (e) {\n return _this.updateContent(e);\n });\n\n _this.updateTextNode_();\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = TimeDisplay.prototype;\n\n _proto.createEl = function createEl$1() {\n var className = this.buildCSSClass();\n\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: className + \" vjs-time-control vjs-control\"\n });\n\n var span = video_es_createEl('span', {\n className: 'vjs-control-text',\n textContent: this.localize(this.labelText_) + \"\\xA0\"\n }, {\n role: 'presentation'\n });\n el.appendChild(span);\n this.contentEl_ = video_es_createEl('span', {\n className: className + \"-display\"\n }, {\n // tell screen readers not to automatically read the time as it changes\n 'aria-live': 'off',\n // span elements have no implicit role, but some screen readers (notably VoiceOver)\n // treat them as a break between items in the DOM when using arrow keys\n // (or left-to-right swipes on iOS) to read contents of a page. Using\n // role='presentation' causes VoiceOver to NOT treat this span as a break.\n 'role': 'presentation'\n });\n el.appendChild(this.contentEl_);\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n this.textNode_ = null;\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Updates the time display text node with a new time\n *\n * @param {number} [time=0] the time to update to\n *\n * @private\n */\n ;\n\n _proto.updateTextNode_ = function updateTextNode_(time) {\n var _this2 = this;\n\n if (time === void 0) {\n time = 0;\n }\n\n time = formatTime(time);\n\n if (this.formattedTime_ === time) {\n return;\n }\n\n this.formattedTime_ = time;\n this.requestNamedAnimationFrame('TimeDisplay#updateTextNode_', function () {\n if (!_this2.contentEl_) {\n return;\n }\n\n var oldNode = _this2.textNode_;\n\n if (oldNode && _this2.contentEl_.firstChild !== oldNode) {\n oldNode = null;\n 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.');\n }\n\n _this2.textNode_ = document_default.a.createTextNode(_this2.formattedTime_);\n\n if (!_this2.textNode_) {\n return;\n }\n\n if (oldNode) {\n _this2.contentEl_.replaceChild(_this2.textNode_, oldNode);\n } else {\n _this2.contentEl_.appendChild(_this2.textNode_);\n }\n });\n }\n /**\n * To be filled out in the child class, should update the displayed time\n * in accordance with the fact that the current time has changed.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` event that caused this to run.\n *\n * @listens Player#timeupdate\n */\n ;\n\n _proto.updateContent = function updateContent(event) {};\n\n return TimeDisplay;\n}(Component$1);\n/**\n * The text that is added to the `TimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_TimeDisplay.prototype.labelText_ = 'Time';\n/**\n * The text that should display over the `TimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nvideo_es_TimeDisplay.prototype.controlText_ = 'Time';\nComponent$1.registerComponent('TimeDisplay', video_es_TimeDisplay);\n\n/**\n * Displays the current time\n *\n * @extends Component\n */\n\nvar video_es_CurrentTimeDisplay = /*#__PURE__*/function (_TimeDisplay) {\n inheritsLoose_default()(CurrentTimeDisplay, _TimeDisplay);\n\n function CurrentTimeDisplay() {\n return _TimeDisplay.apply(this, arguments) || this;\n }\n\n var _proto = CurrentTimeDisplay.prototype;\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-current-time';\n }\n /**\n * Update current time display\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` event that caused this function to run.\n *\n * @listens Player#timeupdate\n */\n ;\n\n _proto.updateContent = function updateContent(event) {\n // Allows for smooth scrubbing, when player can't keep up.\n var time;\n\n if (this.player_.ended()) {\n time = this.player_.duration();\n } else {\n time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n }\n\n this.updateTextNode_(time);\n };\n\n return CurrentTimeDisplay;\n}(video_es_TimeDisplay);\n/**\n * The text that is added to the `CurrentTimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_CurrentTimeDisplay.prototype.labelText_ = 'Current Time';\n/**\n * The text that should display over the `CurrentTimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nvideo_es_CurrentTimeDisplay.prototype.controlText_ = 'Current Time';\nComponent$1.registerComponent('CurrentTimeDisplay', video_es_CurrentTimeDisplay);\n\n/**\n * Displays the duration\n *\n * @extends Component\n */\n\nvar video_es_DurationDisplay = /*#__PURE__*/function (_TimeDisplay) {\n inheritsLoose_default()(DurationDisplay, _TimeDisplay);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function DurationDisplay(player, options) {\n var _this;\n\n _this = _TimeDisplay.call(this, player, options) || this;\n\n var updateContent = function updateContent(e) {\n return _this.updateContent(e);\n }; // we do not want to/need to throttle duration changes,\n // as they should always display the changed duration as\n // it has changed\n\n\n _this.on(player, 'durationchange', updateContent); // Listen to loadstart because the player duration is reset when a new media element is loaded,\n // but the durationchange on the user agent will not fire.\n // @see [Spec]{@link https://www.w3.org/TR/2011/WD-html5-20110113/video.html#media-element-load-algorithm}\n\n\n _this.on(player, 'loadstart', updateContent); // Also listen for timeupdate (in the parent) and loadedmetadata because removing those\n // listeners could have broken dependent applications/libraries. These\n // can likely be removed for 7.0.\n\n\n _this.on(player, 'loadedmetadata', updateContent);\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = DurationDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-duration';\n }\n /**\n * Update duration time display.\n *\n * @param {EventTarget~Event} [event]\n * The `durationchange`, `timeupdate`, or `loadedmetadata` event that caused\n * this function to be called.\n *\n * @listens Player#durationchange\n * @listens Player#timeupdate\n * @listens Player#loadedmetadata\n */\n ;\n\n _proto.updateContent = function updateContent(event) {\n var duration = this.player_.duration();\n this.updateTextNode_(duration);\n };\n\n return DurationDisplay;\n}(video_es_TimeDisplay);\n/**\n * The text that is added to the `DurationDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_DurationDisplay.prototype.labelText_ = 'Duration';\n/**\n * The text that should display over the `DurationDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nvideo_es_DurationDisplay.prototype.controlText_ = 'Duration';\nComponent$1.registerComponent('DurationDisplay', video_es_DurationDisplay);\n\n/**\n * The separator between the current time and duration.\n * Can be hidden if it's not needed in the design.\n *\n * @extends Component\n */\n\nvar video_es_TimeDivider = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(TimeDivider, _Component);\n\n function TimeDivider() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = TimeDivider.prototype;\n\n /**\n * Create the component's DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-time-control vjs-time-divider'\n }, {\n // this element and its contents can be hidden from assistive techs since\n // it is made extraneous by the announcement of the control text\n // for the current time and duration displays\n 'aria-hidden': true\n });\n\n var div = _Component.prototype.createEl.call(this, 'div');\n\n var span = _Component.prototype.createEl.call(this, 'span', {\n textContent: '/'\n });\n\n div.appendChild(span);\n el.appendChild(div);\n return el;\n };\n\n return TimeDivider;\n}(Component$1);\n\nComponent$1.registerComponent('TimeDivider', video_es_TimeDivider);\n\n/**\n * Displays the time left in the video\n *\n * @extends Component\n */\n\nvar video_es_RemainingTimeDisplay = /*#__PURE__*/function (_TimeDisplay) {\n inheritsLoose_default()(RemainingTimeDisplay, _TimeDisplay);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function RemainingTimeDisplay(player, options) {\n var _this;\n\n _this = _TimeDisplay.call(this, player, options) || this;\n\n _this.on(player, 'durationchange', function (e) {\n return _this.updateContent(e);\n });\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = RemainingTimeDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return 'vjs-remaining-time';\n }\n /**\n * Create the `Component`'s DOM element with the \"minus\" characted prepend to the time\n *\n * @return {Element}\n * The element that was created.\n */\n ;\n\n _proto.createEl = function createEl$1() {\n var el = _TimeDisplay.prototype.createEl.call(this);\n\n el.insertBefore(video_es_createEl('span', {}, {\n 'aria-hidden': true\n }, '-'), this.contentEl_);\n return el;\n }\n /**\n * Update remaining time display.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` or `durationchange` event that caused this to run.\n *\n * @listens Player#timeupdate\n * @listens Player#durationchange\n */\n ;\n\n _proto.updateContent = function updateContent(event) {\n if (typeof this.player_.duration() !== 'number') {\n return;\n }\n\n var time; // @deprecated We should only use remainingTimeDisplay\n // as of video.js 7\n\n if (this.player_.ended()) {\n time = 0;\n } else if (this.player_.remainingTimeDisplay) {\n time = this.player_.remainingTimeDisplay();\n } else {\n time = this.player_.remainingTime();\n }\n\n this.updateTextNode_(time);\n };\n\n return RemainingTimeDisplay;\n}(video_es_TimeDisplay);\n/**\n * The text that is added to the `RemainingTimeDisplay` for screen reader users.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_RemainingTimeDisplay.prototype.labelText_ = 'Remaining Time';\n/**\n * The text that should display over the `RemainingTimeDisplay`s controls. Added to for localization.\n *\n * @type {string}\n * @private\n *\n * @deprecated in v7; controlText_ is not used in non-active display Components\n */\n\nvideo_es_RemainingTimeDisplay.prototype.controlText_ = 'Remaining Time';\nComponent$1.registerComponent('RemainingTimeDisplay', video_es_RemainingTimeDisplay);\n\n/**\n * Displays the live indicator when duration is Infinity.\n *\n * @extends Component\n */\n\nvar video_es_LiveDisplay = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(LiveDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function LiveDisplay(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n _this.updateShowing();\n\n _this.on(_this.player(), 'durationchange', function (e) {\n return _this.updateShowing(e);\n });\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = LiveDisplay.prototype;\n\n _proto.createEl = function createEl$1() {\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-live-control vjs-control'\n });\n\n this.contentEl_ = video_es_createEl('div', {\n className: 'vjs-live-display'\n }, {\n 'aria-live': 'off'\n });\n this.contentEl_.appendChild(video_es_createEl('span', {\n className: 'vjs-control-text',\n textContent: this.localize('Stream Type') + \"\\xA0\"\n }));\n this.contentEl_.appendChild(document_default.a.createTextNode(this.localize('LIVE')));\n el.appendChild(this.contentEl_);\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Check the duration to see if the LiveDisplay should be showing or not. Then show/hide\n * it accordingly\n *\n * @param {EventTarget~Event} [event]\n * The {@link Player#durationchange} event that caused this function to run.\n *\n * @listens Player#durationchange\n */\n ;\n\n _proto.updateShowing = function updateShowing(event) {\n if (this.player().duration() === Infinity) {\n this.show();\n } else {\n this.hide();\n }\n };\n\n return LiveDisplay;\n}(Component$1);\n\nComponent$1.registerComponent('LiveDisplay', video_es_LiveDisplay);\n\n/**\n * Displays the live indicator when duration is Infinity.\n *\n * @extends Component\n */\n\nvar video_es_SeekToLive = /*#__PURE__*/function (_Button) {\n inheritsLoose_default()(SeekToLive, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function SeekToLive(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n\n _this.updateLiveEdgeStatus();\n\n if (_this.player_.liveTracker) {\n _this.updateLiveEdgeStatusHandler_ = function (e) {\n return _this.updateLiveEdgeStatus(e);\n };\n\n _this.on(_this.player_.liveTracker, 'liveedgechange', _this.updateLiveEdgeStatusHandler_);\n }\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = SeekToLive.prototype;\n\n _proto.createEl = function createEl$1() {\n var el = _Button.prototype.createEl.call(this, 'button', {\n className: 'vjs-seek-to-live-control vjs-control'\n });\n\n this.textEl_ = video_es_createEl('span', {\n className: 'vjs-seek-to-live-text',\n textContent: this.localize('LIVE')\n }, {\n 'aria-hidden': 'true'\n });\n el.appendChild(this.textEl_);\n return el;\n }\n /**\n * Update the state of this button if we are at the live edge\n * or not\n */\n ;\n\n _proto.updateLiveEdgeStatus = function updateLiveEdgeStatus() {\n // default to live edge\n if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {\n this.setAttribute('aria-disabled', true);\n this.addClass('vjs-at-live-edge');\n this.controlText('Seek to live, currently playing live');\n } else {\n this.setAttribute('aria-disabled', false);\n this.removeClass('vjs-at-live-edge');\n this.controlText('Seek to live, currently behind live');\n }\n }\n /**\n * On click bring us as near to the live point as possible.\n * This requires that we wait for the next `live-seekable-change`\n * event which will happen every segment length seconds.\n */\n ;\n\n _proto.handleClick = function handleClick() {\n this.player_.liveTracker.seekToLiveEdge();\n }\n /**\n * Dispose of the element and stop tracking\n */\n ;\n\n _proto.dispose = function dispose() {\n if (this.player_.liveTracker) {\n this.off(this.player_.liveTracker, 'liveedgechange', this.updateLiveEdgeStatusHandler_);\n }\n\n this.textEl_ = null;\n\n _Button.prototype.dispose.call(this);\n };\n\n return SeekToLive;\n}(video_es_Button);\n\nvideo_es_SeekToLive.prototype.controlText_ = 'Seek to live, currently playing live';\nComponent$1.registerComponent('SeekToLive', video_es_SeekToLive);\n\n/**\n * Keep a number between a min and a max value\n *\n * @param {number} number\n * The number to clamp\n *\n * @param {number} min\n * The minimum value\n * @param {number} max\n * The maximum value\n *\n * @return {number}\n * the clamped number\n */\nvar clamp = function clamp(number, min, max) {\n number = Number(number);\n return Math.min(max, Math.max(min, isNaN(number) ? min : number));\n};\n\n/**\n * The base functionality for a slider. Can be vertical or horizontal.\n * For instance the volume bar or the seek bar on a video is a slider.\n *\n * @extends Component\n */\n\nvar video_es_Slider = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(Slider, _Component);\n\n /**\n * Create an instance of this class\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function Slider(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n _this.handleMouseDown_ = function (e) {\n return _this.handleMouseDown(e);\n };\n\n _this.handleMouseUp_ = function (e) {\n return _this.handleMouseUp(e);\n };\n\n _this.handleKeyDown_ = function (e) {\n return _this.handleKeyDown(e);\n };\n\n _this.handleClick_ = function (e) {\n return _this.handleClick(e);\n };\n\n _this.handleMouseMove_ = function (e) {\n return _this.handleMouseMove(e);\n };\n\n _this.update_ = function (e) {\n return _this.update(e);\n }; // Set property names to bar to match with the child Slider class is looking for\n\n\n _this.bar = _this.getChild(_this.options_.barName); // Set a horizontal or vertical class on the slider depending on the slider type\n\n _this.vertical(!!_this.options_.vertical);\n\n _this.enable();\n\n return _this;\n }\n /**\n * Are controls are currently enabled for this slider or not.\n *\n * @return {boolean}\n * true if controls are enabled, false otherwise\n */\n\n\n var _proto = Slider.prototype;\n\n _proto.enabled = function enabled() {\n return this.enabled_;\n }\n /**\n * Enable controls for this slider if they are disabled\n */\n ;\n\n _proto.enable = function enable() {\n if (this.enabled()) {\n return;\n }\n\n this.on('mousedown', this.handleMouseDown_);\n this.on('touchstart', this.handleMouseDown_);\n this.on('keydown', this.handleKeyDown_);\n this.on('click', this.handleClick_); // TODO: deprecated, controlsvisible does not seem to be fired\n\n this.on(this.player_, 'controlsvisible', this.update);\n\n if (this.playerEvent) {\n this.on(this.player_, this.playerEvent, this.update);\n }\n\n this.removeClass('disabled');\n this.setAttribute('tabindex', 0);\n this.enabled_ = true;\n }\n /**\n * Disable controls for this slider if they are enabled\n */\n ;\n\n _proto.disable = function disable() {\n if (!this.enabled()) {\n return;\n }\n\n var doc = this.bar.el_.ownerDocument;\n this.off('mousedown', this.handleMouseDown_);\n this.off('touchstart', this.handleMouseDown_);\n this.off('keydown', this.handleKeyDown_);\n this.off('click', this.handleClick_);\n this.off(this.player_, 'controlsvisible', this.update_);\n this.off(doc, 'mousemove', this.handleMouseMove_);\n this.off(doc, 'mouseup', this.handleMouseUp_);\n this.off(doc, 'touchmove', this.handleMouseMove_);\n this.off(doc, 'touchend', this.handleMouseUp_);\n this.removeAttribute('tabindex');\n this.addClass('disabled');\n\n if (this.playerEvent) {\n this.off(this.player_, this.playerEvent, this.update);\n }\n\n this.enabled_ = false;\n }\n /**\n * Create the `Slider`s DOM element.\n *\n * @param {string} type\n * Type of element to create.\n *\n * @param {Object} [props={}]\n * List of properties in Object form.\n *\n * @param {Object} [attributes={}]\n * list of attributes in Object form.\n *\n * @return {Element}\n * The element that gets created.\n */\n ;\n\n _proto.createEl = function createEl(type, props, attributes) {\n if (props === void 0) {\n props = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n // Add the slider element class to all sub classes\n props.className = props.className + ' vjs-slider';\n props = video_es_assign({\n tabIndex: 0\n }, props);\n attributes = video_es_assign({\n 'role': 'slider',\n 'aria-valuenow': 0,\n 'aria-valuemin': 0,\n 'aria-valuemax': 100,\n 'tabIndex': 0\n }, attributes);\n return _Component.prototype.createEl.call(this, type, props, attributes);\n }\n /**\n * Handle `mousedown` or `touchstart` events on the `Slider`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n * @fires Slider#slideractive\n */\n ;\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n var doc = this.bar.el_.ownerDocument;\n\n if (event.type === 'mousedown') {\n event.preventDefault();\n } // Do not call preventDefault() on touchstart in Chrome\n // to avoid console warnings. Use a 'touch-action: none' style\n // instead to prevent unintented scrolling.\n // https://developers.google.com/web/updates/2017/01/scrolling-intervention\n\n\n if (event.type === 'touchstart' && !IS_CHROME) {\n event.preventDefault();\n }\n\n blockTextSelection();\n this.addClass('vjs-sliding');\n /**\n * Triggered when the slider is in an active state\n *\n * @event Slider#slideractive\n * @type {EventTarget~Event}\n */\n\n this.trigger('slideractive');\n this.on(doc, 'mousemove', this.handleMouseMove_);\n this.on(doc, 'mouseup', this.handleMouseUp_);\n this.on(doc, 'touchmove', this.handleMouseMove_);\n this.on(doc, 'touchend', this.handleMouseUp_);\n this.handleMouseMove(event);\n }\n /**\n * Handle the `mousemove`, `touchmove`, and `mousedown` events on this `Slider`.\n * The `mousemove` and `touchmove` events will only only trigger this function during\n * `mousedown` and `touchstart`. This is due to {@link Slider#handleMouseDown} and\n * {@link Slider#handleMouseUp}.\n *\n * @param {EventTarget~Event} event\n * `mousedown`, `mousemove`, `touchstart`, or `touchmove` event that triggered\n * this function\n *\n * @listens mousemove\n * @listens touchmove\n */\n ;\n\n _proto.handleMouseMove = function handleMouseMove(event) {}\n /**\n * Handle `mouseup` or `touchend` events on the `Slider`.\n *\n * @param {EventTarget~Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n * @fires Slider#sliderinactive\n */\n ;\n\n _proto.handleMouseUp = function handleMouseUp() {\n var doc = this.bar.el_.ownerDocument;\n unblockTextSelection();\n this.removeClass('vjs-sliding');\n /**\n * Triggered when the slider is no longer in an active state.\n *\n * @event Slider#sliderinactive\n * @type {EventTarget~Event}\n */\n\n this.trigger('sliderinactive');\n this.off(doc, 'mousemove', this.handleMouseMove_);\n this.off(doc, 'mouseup', this.handleMouseUp_);\n this.off(doc, 'touchmove', this.handleMouseMove_);\n this.off(doc, 'touchend', this.handleMouseUp_);\n this.update();\n }\n /**\n * Update the progress bar of the `Slider`.\n *\n * @return {number}\n * The percentage of progress the progress bar represents as a\n * number from 0 to 1.\n */\n ;\n\n _proto.update = function update() {\n var _this2 = this;\n\n // In VolumeBar init we have a setTimeout for update that pops and update\n // to the end of the execution stack. The player is destroyed before then\n // update will cause an error\n // If there's no bar...\n if (!this.el_ || !this.bar) {\n return;\n } // clamp progress between 0 and 1\n // and only round to four decimal places, as we round to two below\n\n\n var progress = this.getProgress();\n\n if (progress === this.progress_) {\n return progress;\n }\n\n this.progress_ = progress;\n this.requestNamedAnimationFrame('Slider#update', function () {\n // Set the new bar width or height\n var sizeKey = _this2.vertical() ? 'height' : 'width'; // Convert to a percentage for css value\n\n _this2.bar.el().style[sizeKey] = (progress * 100).toFixed(2) + '%';\n });\n return progress;\n }\n /**\n * Get the percentage of the bar that should be filled\n * but clamped and rounded.\n *\n * @return {number}\n * percentage filled that the slider is\n */\n ;\n\n _proto.getProgress = function getProgress() {\n return Number(clamp(this.getPercent(), 0, 1).toFixed(4));\n }\n /**\n * Calculate distance for slider\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run.\n *\n * @return {number}\n * The current position of the Slider.\n * - position.x for vertical `Slider`s\n * - position.y for horizontal `Slider`s\n */\n ;\n\n _proto.calculateDistance = function calculateDistance(event) {\n var position = getPointerPosition(this.el_, event);\n\n if (this.vertical()) {\n return position.y;\n }\n\n return position.x;\n }\n /**\n * Handle a `keydown` event on the `Slider`. Watches for left, rigth, up, and down\n * arrow keys. This function will only be called when the slider has focus. See\n * {@link Slider#handleFocus} and {@link Slider#handleBlur}.\n *\n * @param {EventTarget~Event} event\n * the `keydown` event that caused this function to run.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n // Left and Down Arrows\n if (keycode_default.a.isEventKey(event, 'Left') || keycode_default.a.isEventKey(event, 'Down')) {\n event.preventDefault();\n event.stopPropagation();\n this.stepBack(); // Up and Right Arrows\n } else if (keycode_default.a.isEventKey(event, 'Right') || keycode_default.a.isEventKey(event, 'Up')) {\n event.preventDefault();\n event.stopPropagation();\n this.stepForward();\n } else {\n // Pass keydown handling up for unsupported keys\n _Component.prototype.handleKeyDown.call(this, event);\n }\n }\n /**\n * Listener for click events on slider, used to prevent clicks\n * from bubbling up to parent elements like button menus.\n *\n * @param {Object} event\n * Event that caused this object to run\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n event.stopPropagation();\n event.preventDefault();\n }\n /**\n * Get/set if slider is horizontal for vertical\n *\n * @param {boolean} [bool]\n * - true if slider is vertical,\n * - false is horizontal\n *\n * @return {boolean}\n * - true if slider is vertical, and getting\n * - false if the slider is horizontal, and getting\n */\n ;\n\n _proto.vertical = function vertical(bool) {\n if (bool === undefined) {\n return this.vertical_ || false;\n }\n\n this.vertical_ = !!bool;\n\n if (this.vertical_) {\n this.addClass('vjs-slider-vertical');\n } else {\n this.addClass('vjs-slider-horizontal');\n }\n };\n\n return Slider;\n}(Component$1);\n\nComponent$1.registerComponent('Slider', video_es_Slider);\n\nvar percentify = function percentify(time, end) {\n return clamp(time / end * 100, 0, 100).toFixed(2) + '%';\n};\n/**\n * Shows loading progress\n *\n * @extends Component\n */\n\n\nvar video_es_LoadProgressBar = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(LoadProgressBar, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function LoadProgressBar(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.partEls_ = [];\n\n _this.on(player, 'progress', function (e) {\n return _this.update(e);\n });\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = LoadProgressBar.prototype;\n\n _proto.createEl = function createEl$1() {\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-load-progress'\n });\n\n var wrapper = video_es_createEl('span', {\n className: 'vjs-control-text'\n });\n var loadedText = video_es_createEl('span', {\n textContent: this.localize('Loaded')\n });\n var separator = document_default.a.createTextNode(': ');\n this.percentageEl_ = video_es_createEl('span', {\n className: 'vjs-control-text-loaded-percentage',\n textContent: '0%'\n });\n el.appendChild(wrapper);\n wrapper.appendChild(loadedText);\n wrapper.appendChild(separator);\n wrapper.appendChild(this.percentageEl_);\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.partEls_ = null;\n this.percentageEl_ = null;\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Update progress bar\n *\n * @param {EventTarget~Event} [event]\n * The `progress` event that caused this function to run.\n *\n * @listens Player#progress\n */\n ;\n\n _proto.update = function update(event) {\n var _this2 = this;\n\n this.requestNamedAnimationFrame('LoadProgressBar#update', function () {\n var liveTracker = _this2.player_.liveTracker;\n\n var buffered = _this2.player_.buffered();\n\n var duration = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : _this2.player_.duration();\n\n var bufferedEnd = _this2.player_.bufferedEnd();\n\n var children = _this2.partEls_;\n var percent = percentify(bufferedEnd, duration);\n\n if (_this2.percent_ !== percent) {\n // update the width of the progress bar\n _this2.el_.style.width = percent; // update the control-text\n\n textContent(_this2.percentageEl_, percent);\n _this2.percent_ = percent;\n } // add child elements to represent the individual buffered time ranges\n\n\n for (var i = 0; i < buffered.length; i++) {\n var start = buffered.start(i);\n var end = buffered.end(i);\n var part = children[i];\n\n if (!part) {\n part = _this2.el_.appendChild(video_es_createEl());\n children[i] = part;\n } // only update if changed\n\n\n if (part.dataset.start === start && part.dataset.end === end) {\n continue;\n }\n\n part.dataset.start = start;\n part.dataset.end = end; // set the percent based on the width of the progress bar (bufferedEnd)\n\n part.style.left = percentify(start, bufferedEnd);\n part.style.width = percentify(end - start, bufferedEnd);\n } // remove unused buffered range elements\n\n\n for (var _i = children.length; _i > buffered.length; _i--) {\n _this2.el_.removeChild(children[_i - 1]);\n }\n\n children.length = buffered.length;\n });\n };\n\n return LoadProgressBar;\n}(Component$1);\n\nComponent$1.registerComponent('LoadProgressBar', video_es_LoadProgressBar);\n\n/**\n * Time tooltips display a time above the progress bar.\n *\n * @extends Component\n */\n\nvar video_es_TimeTooltip = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(TimeTooltip, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TimeTooltip(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.update = video_es_throttle(bind(assertThisInitialized_default()(_this), _this.update), UPDATE_REFRESH_INTERVAL);\n return _this;\n }\n /**\n * Create the time tooltip DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = TimeTooltip.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-time-tooltip'\n }, {\n 'aria-hidden': 'true'\n });\n }\n /**\n * Updates the position of the time tooltip relative to the `SeekBar`.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n ;\n\n _proto.update = function update(seekBarRect, seekBarPoint, content) {\n var tooltipRect = findPosition(this.el_);\n var playerRect = getBoundingClientRect(this.player_.el());\n var seekBarPointPx = seekBarRect.width * seekBarPoint; // do nothing if either rect isn't available\n // for example, if the player isn't in the DOM for testing\n\n if (!playerRect || !tooltipRect) {\n return;\n } // This is the space left of the `seekBarPoint` available within the bounds\n // of the player. We calculate any gap between the left edge of the player\n // and the left edge of the `SeekBar` and add the number of pixels in the\n // `SeekBar` before hitting the `seekBarPoint`\n\n\n var spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx; // This is the space right of the `seekBarPoint` available within the bounds\n // of the player. We calculate the number of pixels from the `seekBarPoint`\n // to the right edge of the `SeekBar` and add to that any gap between the\n // right edge of the `SeekBar` and the player.\n\n var spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right); // This is the number of pixels by which the tooltip will need to be pulled\n // further to the right to center it over the `seekBarPoint`.\n\n var pullTooltipBy = tooltipRect.width / 2; // Adjust the `pullTooltipBy` distance to the left or right depending on\n // the results of the space calculations above.\n\n if (spaceLeftOfPoint < pullTooltipBy) {\n pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;\n } else if (spaceRightOfPoint < pullTooltipBy) {\n pullTooltipBy = spaceRightOfPoint;\n } // Due to the imprecision of decimal/ratio based calculations and varying\n // rounding behaviors, there are cases where the spacing adjustment is off\n // by a pixel or two. This adds insurance to these calculations.\n\n\n if (pullTooltipBy < 0) {\n pullTooltipBy = 0;\n } else if (pullTooltipBy > tooltipRect.width) {\n pullTooltipBy = tooltipRect.width;\n } // prevent small width fluctuations within 0.4px from\n // changing the value below.\n // This really helps for live to prevent the play\n // progress time tooltip from jittering\n\n\n pullTooltipBy = Math.round(pullTooltipBy);\n this.el_.style.right = \"-\" + pullTooltipBy + \"px\";\n this.write(content);\n }\n /**\n * Write the time to the tooltip DOM element.\n *\n * @param {string} content\n * The formatted time for the tooltip.\n */\n ;\n\n _proto.write = function write(content) {\n textContent(this.el_, content);\n }\n /**\n * Updates the position of the time tooltip relative to the `SeekBar`.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n *\n * @param {number} time\n * The time to update the tooltip to, not used during live playback\n *\n * @param {Function} cb\n * A function that will be called during the request animation frame\n * for tooltips that need to do additional animations from the default\n */\n ;\n\n _proto.updateTime = function updateTime(seekBarRect, seekBarPoint, time, cb) {\n var _this2 = this;\n\n this.requestNamedAnimationFrame('TimeTooltip#updateTime', function () {\n var content;\n\n var duration = _this2.player_.duration();\n\n if (_this2.player_.liveTracker && _this2.player_.liveTracker.isLive()) {\n var liveWindow = _this2.player_.liveTracker.liveWindow();\n\n var secondsBehind = liveWindow - seekBarPoint * liveWindow;\n content = (secondsBehind < 1 ? '' : '-') + formatTime(secondsBehind, liveWindow);\n } else {\n content = formatTime(time, duration);\n }\n\n _this2.update(seekBarRect, seekBarPoint, content);\n\n if (cb) {\n cb();\n }\n });\n };\n\n return TimeTooltip;\n}(Component$1);\n\nComponent$1.registerComponent('TimeTooltip', video_es_TimeTooltip);\n\n/**\n * Used by {@link SeekBar} to display media playback progress as part of the\n * {@link ProgressControl}.\n *\n * @extends Component\n */\n\nvar video_es_PlayProgressBar = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(PlayProgressBar, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function PlayProgressBar(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.update = video_es_throttle(bind(assertThisInitialized_default()(_this), _this.update), UPDATE_REFRESH_INTERVAL);\n return _this;\n }\n /**\n * Create the the DOM element for this class.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = PlayProgressBar.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-play-progress vjs-slider-bar'\n }, {\n 'aria-hidden': 'true'\n });\n }\n /**\n * Enqueues updates to its own DOM as well as the DOM of its\n * {@link TimeTooltip} child.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n ;\n\n _proto.update = function update(seekBarRect, seekBarPoint) {\n var timeTooltip = this.getChild('timeTooltip');\n\n if (!timeTooltip) {\n return;\n }\n\n var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n timeTooltip.updateTime(seekBarRect, seekBarPoint, time);\n };\n\n return PlayProgressBar;\n}(Component$1);\n/**\n * Default options for {@link PlayProgressBar}.\n *\n * @type {Object}\n * @private\n */\n\n\nvideo_es_PlayProgressBar.prototype.options_ = {\n children: []\n}; // Time tooltips should not be added to a player on mobile devices\n\nif (!IS_IOS && !IS_ANDROID) {\n video_es_PlayProgressBar.prototype.options_.children.push('timeTooltip');\n}\n\nComponent$1.registerComponent('PlayProgressBar', video_es_PlayProgressBar);\n\n/**\n * The {@link MouseTimeDisplay} component tracks mouse movement over the\n * {@link ProgressControl}. It displays an indicator and a {@link TimeTooltip}\n * indicating the time which is represented by a given point in the\n * {@link ProgressControl}.\n *\n * @extends Component\n */\n\nvar video_es_MouseTimeDisplay = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(MouseTimeDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function MouseTimeDisplay(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.update = video_es_throttle(bind(assertThisInitialized_default()(_this), _this.update), UPDATE_REFRESH_INTERVAL);\n return _this;\n }\n /**\n * Create the DOM element for this class.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = MouseTimeDisplay.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-mouse-display'\n });\n }\n /**\n * Enqueues updates to its own DOM as well as the DOM of its\n * {@link TimeTooltip} child.\n *\n * @param {Object} seekBarRect\n * The `ClientRect` for the {@link SeekBar} element.\n *\n * @param {number} seekBarPoint\n * A number from 0 to 1, representing a horizontal reference point\n * from the left edge of the {@link SeekBar}\n */\n ;\n\n _proto.update = function update(seekBarRect, seekBarPoint) {\n var _this2 = this;\n\n var time = seekBarPoint * this.player_.duration();\n this.getChild('timeTooltip').updateTime(seekBarRect, seekBarPoint, time, function () {\n _this2.el_.style.left = seekBarRect.width * seekBarPoint + \"px\";\n });\n };\n\n return MouseTimeDisplay;\n}(Component$1);\n/**\n * Default options for `MouseTimeDisplay`\n *\n * @type {Object}\n * @private\n */\n\n\nvideo_es_MouseTimeDisplay.prototype.options_ = {\n children: ['timeTooltip']\n};\nComponent$1.registerComponent('MouseTimeDisplay', video_es_MouseTimeDisplay);\n\nvar STEP_SECONDS = 5; // The multiplier of STEP_SECONDS that PgUp/PgDown move the timeline.\n\nvar PAGE_KEY_MULTIPLIER = 12;\n/**\n * Seek bar and container for the progress bars. Uses {@link PlayProgressBar}\n * as its `bar`.\n *\n * @extends Slider\n */\n\nvar video_es_SeekBar = /*#__PURE__*/function (_Slider) {\n inheritsLoose_default()(SeekBar, _Slider);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function SeekBar(player, options) {\n var _this;\n\n _this = _Slider.call(this, player, options) || this;\n\n _this.setEventHandlers_();\n\n return _this;\n }\n /**\n * Sets the event handlers\n *\n * @private\n */\n\n\n var _proto = SeekBar.prototype;\n\n _proto.setEventHandlers_ = function setEventHandlers_() {\n var _this2 = this;\n\n this.update_ = bind(this, this.update);\n this.update = video_es_throttle(this.update_, UPDATE_REFRESH_INTERVAL);\n this.on(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update);\n\n if (this.player_.liveTracker) {\n this.on(this.player_.liveTracker, 'liveedgechange', this.update);\n } // when playing, let's ensure we smoothly update the play progress bar\n // via an interval\n\n\n this.updateInterval = null;\n\n this.enableIntervalHandler_ = function (e) {\n return _this2.enableInterval_(e);\n };\n\n this.disableIntervalHandler_ = function (e) {\n return _this2.disableInterval_(e);\n };\n\n this.on(this.player_, ['playing'], this.enableIntervalHandler_);\n this.on(this.player_, ['ended', 'pause', 'waiting'], this.disableIntervalHandler_); // we don't need to update the play progress if the document is hidden,\n // also, this causes the CPU to spike and eventually crash the page on IE11.\n\n if ('hidden' in document_default.a && 'visibilityState' in document_default.a) {\n this.on(document_default.a, 'visibilitychange', this.toggleVisibility_);\n }\n };\n\n _proto.toggleVisibility_ = function toggleVisibility_(e) {\n if (document_default.a.visibilityState === 'hidden') {\n this.cancelNamedAnimationFrame('SeekBar#update');\n this.cancelNamedAnimationFrame('Slider#update');\n this.disableInterval_(e);\n } else {\n if (!this.player_.ended() && !this.player_.paused()) {\n this.enableInterval_();\n } // we just switched back to the page and someone may be looking, so, update ASAP\n\n\n this.update();\n }\n };\n\n _proto.enableInterval_ = function enableInterval_() {\n if (this.updateInterval) {\n return;\n }\n\n this.updateInterval = this.setInterval(this.update, UPDATE_REFRESH_INTERVAL);\n };\n\n _proto.disableInterval_ = function disableInterval_(e) {\n if (this.player_.liveTracker && this.player_.liveTracker.isLive() && e && e.type !== 'ended') {\n return;\n }\n\n if (!this.updateInterval) {\n return;\n }\n\n this.clearInterval(this.updateInterval);\n this.updateInterval = null;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n ;\n\n _proto.createEl = function createEl() {\n return _Slider.prototype.createEl.call(this, 'div', {\n className: 'vjs-progress-holder'\n }, {\n 'aria-label': this.localize('Progress Bar')\n });\n }\n /**\n * This function updates the play progress bar and accessibility\n * attributes to whatever is passed in.\n *\n * @param {EventTarget~Event} [event]\n * The `timeupdate` or `ended` event that caused this to run.\n *\n * @listens Player#timeupdate\n *\n * @return {number}\n * The current percent at a number from 0-1\n */\n ;\n\n _proto.update = function update(event) {\n var _this3 = this;\n\n // ignore updates while the tab is hidden\n if (document_default.a.visibilityState === 'hidden') {\n return;\n }\n\n var percent = _Slider.prototype.update.call(this);\n\n this.requestNamedAnimationFrame('SeekBar#update', function () {\n var currentTime = _this3.player_.ended() ? _this3.player_.duration() : _this3.getCurrentTime_();\n var liveTracker = _this3.player_.liveTracker;\n\n var duration = _this3.player_.duration();\n\n if (liveTracker && liveTracker.isLive()) {\n duration = _this3.player_.liveTracker.liveCurrentTime();\n }\n\n if (_this3.percent_ !== percent) {\n // machine readable value of progress bar (percentage complete)\n _this3.el_.setAttribute('aria-valuenow', (percent * 100).toFixed(2));\n\n _this3.percent_ = percent;\n }\n\n if (_this3.currentTime_ !== currentTime || _this3.duration_ !== duration) {\n // human readable value of progress bar (time complete)\n _this3.el_.setAttribute('aria-valuetext', _this3.localize('progress bar timing: currentTime={1} duration={2}', [formatTime(currentTime, duration), formatTime(duration, duration)], '{1} of {2}'));\n\n _this3.currentTime_ = currentTime;\n _this3.duration_ = duration;\n } // update the progress bar time tooltip with the current time\n\n\n if (_this3.bar) {\n _this3.bar.update(getBoundingClientRect(_this3.el()), _this3.getProgress());\n }\n });\n return percent;\n }\n /**\n * Prevent liveThreshold from causing seeks to seem like they\n * are not happening from a user perspective.\n *\n * @param {number} ct\n * current time to seek to\n */\n ;\n\n _proto.userSeek_ = function userSeek_(ct) {\n if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {\n this.player_.liveTracker.nextSeekedFromUser();\n }\n\n this.player_.currentTime(ct);\n }\n /**\n * Get the value of current time but allows for smooth scrubbing,\n * when player can't keep up.\n *\n * @return {number}\n * The current time value to display\n *\n * @private\n */\n ;\n\n _proto.getCurrentTime_ = function getCurrentTime_() {\n return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();\n }\n /**\n * Get the percentage of media played so far.\n *\n * @return {number}\n * The percentage of media played so far (0 to 1).\n */\n ;\n\n _proto.getPercent = function getPercent() {\n var currentTime = this.getCurrentTime_();\n var percent;\n var liveTracker = this.player_.liveTracker;\n\n if (liveTracker && liveTracker.isLive()) {\n percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow(); // prevent the percent from changing at the live edge\n\n if (liveTracker.atLiveEdge()) {\n percent = 1;\n }\n } else {\n percent = currentTime / this.player_.duration();\n }\n\n return percent;\n }\n /**\n * Handle mouse down on seek bar\n *\n * @param {EventTarget~Event} event\n * The `mousedown` event that caused this to run.\n *\n * @listens mousedown\n */\n ;\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n if (!isSingleLeftClick(event)) {\n return;\n } // Stop event propagation to prevent double fire in progress-control.js\n\n\n event.stopPropagation();\n this.player_.scrubbing(true);\n this.videoWasPlaying = !this.player_.paused();\n this.player_.pause();\n\n _Slider.prototype.handleMouseDown.call(this, event);\n }\n /**\n * Handle mouse move on seek bar\n *\n * @param {EventTarget~Event} event\n * The `mousemove` event that caused this to run.\n *\n * @listens mousemove\n */\n ;\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n if (!isSingleLeftClick(event)) {\n return;\n }\n\n var newTime;\n var distance = this.calculateDistance(event);\n var liveTracker = this.player_.liveTracker;\n\n if (!liveTracker || !liveTracker.isLive()) {\n newTime = distance * this.player_.duration(); // Don't let video end while scrubbing.\n\n if (newTime === this.player_.duration()) {\n newTime = newTime - 0.1;\n }\n } else {\n if (distance >= 0.99) {\n liveTracker.seekToLiveEdge();\n return;\n }\n\n var seekableStart = liveTracker.seekableStart();\n var seekableEnd = liveTracker.liveCurrentTime();\n newTime = seekableStart + distance * liveTracker.liveWindow(); // Don't let video end while scrubbing.\n\n if (newTime >= seekableEnd) {\n newTime = seekableEnd;\n } // Compensate for precision differences so that currentTime is not less\n // than seekable start\n\n\n if (newTime <= seekableStart) {\n newTime = seekableStart + 0.1;\n } // On android seekableEnd can be Infinity sometimes,\n // this will cause newTime to be Infinity, which is\n // not a valid currentTime.\n\n\n if (newTime === Infinity) {\n return;\n }\n } // Set new time (tell player to seek to new time)\n\n\n this.userSeek_(newTime);\n };\n\n _proto.enable = function enable() {\n _Slider.prototype.enable.call(this);\n\n var mouseTimeDisplay = this.getChild('mouseTimeDisplay');\n\n if (!mouseTimeDisplay) {\n return;\n }\n\n mouseTimeDisplay.show();\n };\n\n _proto.disable = function disable() {\n _Slider.prototype.disable.call(this);\n\n var mouseTimeDisplay = this.getChild('mouseTimeDisplay');\n\n if (!mouseTimeDisplay) {\n return;\n }\n\n mouseTimeDisplay.hide();\n }\n /**\n * Handle mouse up on seek bar\n *\n * @param {EventTarget~Event} event\n * The `mouseup` event that caused this to run.\n *\n * @listens mouseup\n */\n ;\n\n _proto.handleMouseUp = function handleMouseUp(event) {\n _Slider.prototype.handleMouseUp.call(this, event); // Stop event propagation to prevent double fire in progress-control.js\n\n\n if (event) {\n event.stopPropagation();\n }\n\n this.player_.scrubbing(false);\n /**\n * Trigger timeupdate because we're done seeking and the time has changed.\n * This is particularly useful for if the player is paused to time the time displays.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n\n this.player_.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n\n if (this.videoWasPlaying) {\n silencePromise(this.player_.play());\n } else {\n // We're done seeking and the time has changed.\n // If the player is paused, make sure we display the correct time on the seek bar.\n this.update_();\n }\n }\n /**\n * Move more quickly fast forward for keyboard-only users\n */\n ;\n\n _proto.stepForward = function stepForward() {\n this.userSeek_(this.player_.currentTime() + STEP_SECONDS);\n }\n /**\n * Move more quickly rewind for keyboard-only users\n */\n ;\n\n _proto.stepBack = function stepBack() {\n this.userSeek_(this.player_.currentTime() - STEP_SECONDS);\n }\n /**\n * Toggles the playback state of the player\n * This gets called when enter or space is used on the seekbar\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called\n *\n */\n ;\n\n _proto.handleAction = function handleAction(event) {\n if (this.player_.paused()) {\n this.player_.play();\n } else {\n this.player_.pause();\n }\n }\n /**\n * Called when this SeekBar has focus and a key gets pressed down.\n * Supports the following keys:\n *\n * Space or Enter key fire a click event\n * Home key moves to start of the timeline\n * End key moves to end of the timeline\n * Digit \"0\" through \"9\" keys move to 0%, 10% ... 80%, 90% of the timeline\n * PageDown key moves back a larger step than ArrowDown\n * PageUp key moves forward a large step\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n var liveTracker = this.player_.liveTracker;\n\n if (keycode_default.a.isEventKey(event, 'Space') || keycode_default.a.isEventKey(event, 'Enter')) {\n event.preventDefault();\n event.stopPropagation();\n this.handleAction(event);\n } else if (keycode_default.a.isEventKey(event, 'Home')) {\n event.preventDefault();\n event.stopPropagation();\n this.userSeek_(0);\n } else if (keycode_default.a.isEventKey(event, 'End')) {\n event.preventDefault();\n event.stopPropagation();\n\n if (liveTracker && liveTracker.isLive()) {\n this.userSeek_(liveTracker.liveCurrentTime());\n } else {\n this.userSeek_(this.player_.duration());\n }\n } else if (/^[0-9]$/.test(keycode_default()(event))) {\n event.preventDefault();\n event.stopPropagation();\n var gotoFraction = (keycode_default.a.codes[keycode_default()(event)] - keycode_default.a.codes['0']) * 10.0 / 100.0;\n\n if (liveTracker && liveTracker.isLive()) {\n this.userSeek_(liveTracker.seekableStart() + liveTracker.liveWindow() * gotoFraction);\n } else {\n this.userSeek_(this.player_.duration() * gotoFraction);\n }\n } else if (keycode_default.a.isEventKey(event, 'PgDn')) {\n event.preventDefault();\n event.stopPropagation();\n this.userSeek_(this.player_.currentTime() - STEP_SECONDS * PAGE_KEY_MULTIPLIER);\n } else if (keycode_default.a.isEventKey(event, 'PgUp')) {\n event.preventDefault();\n event.stopPropagation();\n this.userSeek_(this.player_.currentTime() + STEP_SECONDS * PAGE_KEY_MULTIPLIER);\n } else {\n // Pass keydown handling up for unsupported keys\n _Slider.prototype.handleKeyDown.call(this, event);\n }\n };\n\n _proto.dispose = function dispose() {\n this.disableInterval_();\n this.off(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update);\n\n if (this.player_.liveTracker) {\n this.off(this.player_.liveTracker, 'liveedgechange', this.update);\n }\n\n this.off(this.player_, ['playing'], this.enableIntervalHandler_);\n this.off(this.player_, ['ended', 'pause', 'waiting'], this.disableIntervalHandler_); // we don't need to update the play progress if the document is hidden,\n // also, this causes the CPU to spike and eventually crash the page on IE11.\n\n if ('hidden' in document_default.a && 'visibilityState' in document_default.a) {\n this.off(document_default.a, 'visibilitychange', this.toggleVisibility_);\n }\n\n _Slider.prototype.dispose.call(this);\n };\n\n return SeekBar;\n}(video_es_Slider);\n/**\n * Default options for the `SeekBar`\n *\n * @type {Object}\n * @private\n */\n\n\nvideo_es_SeekBar.prototype.options_ = {\n children: ['loadProgressBar', 'playProgressBar'],\n barName: 'playProgressBar'\n}; // MouseTimeDisplay tooltips should not be added to a player on mobile devices\n\nif (!IS_IOS && !IS_ANDROID) {\n video_es_SeekBar.prototype.options_.children.splice(1, 0, 'mouseTimeDisplay');\n}\n\nComponent$1.registerComponent('SeekBar', video_es_SeekBar);\n\n/**\n * The Progress Control component contains the seek bar, load progress,\n * and play progress.\n *\n * @extends Component\n */\n\nvar video_es_ProgressControl = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(ProgressControl, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ProgressControl(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.handleMouseMove = video_es_throttle(bind(assertThisInitialized_default()(_this), _this.handleMouseMove), UPDATE_REFRESH_INTERVAL);\n _this.throttledHandleMouseSeek = video_es_throttle(bind(assertThisInitialized_default()(_this), _this.handleMouseSeek), UPDATE_REFRESH_INTERVAL);\n\n _this.handleMouseUpHandler_ = function (e) {\n return _this.handleMouseUp(e);\n };\n\n _this.handleMouseDownHandler_ = function (e) {\n return _this.handleMouseDown(e);\n };\n\n _this.enable();\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = ProgressControl.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-progress-control vjs-control'\n });\n }\n /**\n * When the mouse moves over the `ProgressControl`, the pointer position\n * gets passed down to the `MouseTimeDisplay` component.\n *\n * @param {EventTarget~Event} event\n * The `mousemove` event that caused this function to run.\n *\n * @listen mousemove\n */\n ;\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n var seekBar = this.getChild('seekBar');\n\n if (!seekBar) {\n return;\n }\n\n var playProgressBar = seekBar.getChild('playProgressBar');\n var mouseTimeDisplay = seekBar.getChild('mouseTimeDisplay');\n\n if (!playProgressBar && !mouseTimeDisplay) {\n return;\n }\n\n var seekBarEl = seekBar.el();\n var seekBarRect = findPosition(seekBarEl);\n var seekBarPoint = getPointerPosition(seekBarEl, event).x; // The default skin has a gap on either side of the `SeekBar`. This means\n // that it's possible to trigger this behavior outside the boundaries of\n // the `SeekBar`. This ensures we stay within it at all times.\n\n seekBarPoint = clamp(seekBarPoint, 0, 1);\n\n if (mouseTimeDisplay) {\n mouseTimeDisplay.update(seekBarRect, seekBarPoint);\n }\n\n if (playProgressBar) {\n playProgressBar.update(seekBarRect, seekBar.getProgress());\n }\n }\n /**\n * A throttled version of the {@link ProgressControl#handleMouseSeek} listener.\n *\n * @method ProgressControl#throttledHandleMouseSeek\n * @param {EventTarget~Event} event\n * The `mousemove` event that caused this function to run.\n *\n * @listen mousemove\n * @listen touchmove\n */\n\n /**\n * Handle `mousemove` or `touchmove` events on the `ProgressControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousemove\n * @listens touchmove\n */\n ;\n\n _proto.handleMouseSeek = function handleMouseSeek(event) {\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n seekBar.handleMouseMove(event);\n }\n }\n /**\n * Are controls are currently enabled for this progress control.\n *\n * @return {boolean}\n * true if controls are enabled, false otherwise\n */\n ;\n\n _proto.enabled = function enabled() {\n return this.enabled_;\n }\n /**\n * Disable all controls on the progress control and its children\n */\n ;\n\n _proto.disable = function disable() {\n this.children().forEach(function (child) {\n return child.disable && child.disable();\n });\n\n if (!this.enabled()) {\n return;\n }\n\n this.off(['mousedown', 'touchstart'], this.handleMouseDownHandler_);\n this.off(this.el_, 'mousemove', this.handleMouseMove);\n this.removeListenersAddedOnMousedownAndTouchstart();\n this.addClass('disabled');\n this.enabled_ = false; // Restore normal playback state if controls are disabled while scrubbing\n\n if (this.player_.scrubbing()) {\n var seekBar = this.getChild('seekBar');\n this.player_.scrubbing(false);\n\n if (seekBar.videoWasPlaying) {\n silencePromise(this.player_.play());\n }\n }\n }\n /**\n * Enable all controls on the progress control and its children\n */\n ;\n\n _proto.enable = function enable() {\n this.children().forEach(function (child) {\n return child.enable && child.enable();\n });\n\n if (this.enabled()) {\n return;\n }\n\n this.on(['mousedown', 'touchstart'], this.handleMouseDownHandler_);\n this.on(this.el_, 'mousemove', this.handleMouseMove);\n this.removeClass('disabled');\n this.enabled_ = true;\n }\n /**\n * Cleanup listeners after the user finishes interacting with the progress controls\n */\n ;\n\n _proto.removeListenersAddedOnMousedownAndTouchstart = function removeListenersAddedOnMousedownAndTouchstart() {\n var doc = this.el_.ownerDocument;\n this.off(doc, 'mousemove', this.throttledHandleMouseSeek);\n this.off(doc, 'touchmove', this.throttledHandleMouseSeek);\n this.off(doc, 'mouseup', this.handleMouseUpHandler_);\n this.off(doc, 'touchend', this.handleMouseUpHandler_);\n }\n /**\n * Handle `mousedown` or `touchstart` events on the `ProgressControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n ;\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n var doc = this.el_.ownerDocument;\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n seekBar.handleMouseDown(event);\n }\n\n this.on(doc, 'mousemove', this.throttledHandleMouseSeek);\n this.on(doc, 'touchmove', this.throttledHandleMouseSeek);\n this.on(doc, 'mouseup', this.handleMouseUpHandler_);\n this.on(doc, 'touchend', this.handleMouseUpHandler_);\n }\n /**\n * Handle `mouseup` or `touchend` events on the `ProgressControl`.\n *\n * @param {EventTarget~Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n */\n ;\n\n _proto.handleMouseUp = function handleMouseUp(event) {\n var seekBar = this.getChild('seekBar');\n\n if (seekBar) {\n seekBar.handleMouseUp(event);\n }\n\n this.removeListenersAddedOnMousedownAndTouchstart();\n };\n\n return ProgressControl;\n}(Component$1);\n/**\n * Default options for `ProgressControl`\n *\n * @type {Object}\n * @private\n */\n\n\nvideo_es_ProgressControl.prototype.options_ = {\n children: ['seekBar']\n};\nComponent$1.registerComponent('ProgressControl', video_es_ProgressControl);\n\n/**\n * Toggle Picture-in-Picture mode\n *\n * @extends Button\n */\n\nvar video_es_PictureInPictureToggle = /*#__PURE__*/function (_Button) {\n inheritsLoose_default()(PictureInPictureToggle, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @listens Player#enterpictureinpicture\n * @listens Player#leavepictureinpicture\n */\n function PictureInPictureToggle(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n\n _this.on(player, ['enterpictureinpicture', 'leavepictureinpicture'], function (e) {\n return _this.handlePictureInPictureChange(e);\n });\n\n _this.on(player, ['disablepictureinpicturechanged', 'loadedmetadata'], function (e) {\n return _this.handlePictureInPictureEnabledChange(e);\n }); // TODO: Deactivate button on player emptied event.\n\n\n _this.disable();\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = PictureInPictureToggle.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-picture-in-picture-control \" + _Button.prototype.buildCSSClass.call(this);\n }\n /**\n * Enables or disables button based on document.pictureInPictureEnabled property value\n * or on value returned by player.disablePictureInPicture() method.\n */\n ;\n\n _proto.handlePictureInPictureEnabledChange = function handlePictureInPictureEnabledChange() {\n if (document_default.a.pictureInPictureEnabled && this.player_.disablePictureInPicture() === false) {\n this.enable();\n } else {\n this.disable();\n }\n }\n /**\n * Handles enterpictureinpicture and leavepictureinpicture on the player and change control text accordingly.\n *\n * @param {EventTarget~Event} [event]\n * The {@link Player#enterpictureinpicture} or {@link Player#leavepictureinpicture} event that caused this function to be\n * called.\n *\n * @listens Player#enterpictureinpicture\n * @listens Player#leavepictureinpicture\n */\n ;\n\n _proto.handlePictureInPictureChange = function handlePictureInPictureChange(event) {\n if (this.player_.isInPictureInPicture()) {\n this.controlText('Exit Picture-in-Picture');\n } else {\n this.controlText('Picture-in-Picture');\n }\n\n this.handlePictureInPictureEnabledChange();\n }\n /**\n * This gets called when an `PictureInPictureToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n if (!this.player_.isInPictureInPicture()) {\n this.player_.requestPictureInPicture();\n } else {\n this.player_.exitPictureInPicture();\n }\n };\n\n return PictureInPictureToggle;\n}(video_es_Button);\n/**\n * The text that should display over the `PictureInPictureToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_PictureInPictureToggle.prototype.controlText_ = 'Picture-in-Picture';\nComponent$1.registerComponent('PictureInPictureToggle', video_es_PictureInPictureToggle);\n\n/**\n * Toggle fullscreen video\n *\n * @extends Button\n */\n\nvar video_es_FullscreenToggle = /*#__PURE__*/function (_Button) {\n inheritsLoose_default()(FullscreenToggle, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function FullscreenToggle(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this;\n\n _this.on(player, 'fullscreenchange', function (e) {\n return _this.handleFullscreenChange(e);\n });\n\n if (document_default.a[player.fsApi_.fullscreenEnabled] === false) {\n _this.disable();\n }\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = FullscreenToggle.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-fullscreen-control \" + _Button.prototype.buildCSSClass.call(this);\n }\n /**\n * Handles fullscreenchange on the player and change control text accordingly.\n *\n * @param {EventTarget~Event} [event]\n * The {@link Player#fullscreenchange} event that caused this function to be\n * called.\n *\n * @listens Player#fullscreenchange\n */\n ;\n\n _proto.handleFullscreenChange = function handleFullscreenChange(event) {\n if (this.player_.isFullscreen()) {\n this.controlText('Non-Fullscreen');\n } else {\n this.controlText('Fullscreen');\n }\n }\n /**\n * This gets called when an `FullscreenToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n if (!this.player_.isFullscreen()) {\n this.player_.requestFullscreen();\n } else {\n this.player_.exitFullscreen();\n }\n };\n\n return FullscreenToggle;\n}(video_es_Button);\n/**\n * The text that should display over the `FullscreenToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_FullscreenToggle.prototype.controlText_ = 'Fullscreen';\nComponent$1.registerComponent('FullscreenToggle', video_es_FullscreenToggle);\n\n/**\n * Check if volume control is supported and if it isn't hide the\n * `Component` that was passed using the `vjs-hidden` class.\n *\n * @param {Component} self\n * The component that should be hidden if volume is unsupported\n *\n * @param {Player} player\n * A reference to the player\n *\n * @private\n */\nvar checkVolumeSupport = function checkVolumeSupport(self, player) {\n // hide volume controls when they're not supported by the current tech\n if (player.tech_ && !player.tech_.featuresVolumeControl) {\n self.addClass('vjs-hidden');\n }\n\n self.on(player, 'loadstart', function () {\n if (!player.tech_.featuresVolumeControl) {\n self.addClass('vjs-hidden');\n } else {\n self.removeClass('vjs-hidden');\n }\n });\n};\n\n/**\n * Shows volume level\n *\n * @extends Component\n */\n\nvar video_es_VolumeLevel = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(VolumeLevel, _Component);\n\n function VolumeLevel() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = VolumeLevel.prototype;\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n var el = _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-volume-level'\n });\n\n el.appendChild(_Component.prototype.createEl.call(this, 'span', {\n className: 'vjs-control-text'\n }));\n return el;\n };\n\n return VolumeLevel;\n}(Component$1);\n\nComponent$1.registerComponent('VolumeLevel', video_es_VolumeLevel);\n\n/**\n * Volume level tooltips display a volume above or side by side the volume bar.\n *\n * @extends Component\n */\n\nvar video_es_VolumeLevelTooltip = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(VolumeLevelTooltip, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function VolumeLevelTooltip(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.update = video_es_throttle(bind(assertThisInitialized_default()(_this), _this.update), UPDATE_REFRESH_INTERVAL);\n return _this;\n }\n /**\n * Create the volume tooltip DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = VolumeLevelTooltip.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-volume-tooltip'\n }, {\n 'aria-hidden': 'true'\n });\n }\n /**\n * Updates the position of the tooltip relative to the `VolumeBar` and\n * its content text.\n *\n * @param {Object} rangeBarRect\n * The `ClientRect` for the {@link VolumeBar} element.\n *\n * @param {number} rangeBarPoint\n * A number from 0 to 1, representing a horizontal/vertical reference point\n * from the left edge of the {@link VolumeBar}\n *\n * @param {boolean} vertical\n * Referees to the Volume control position\n * in the control bar{@link VolumeControl}\n *\n */\n ;\n\n _proto.update = function update(rangeBarRect, rangeBarPoint, vertical, content) {\n if (!vertical) {\n var tooltipRect = getBoundingClientRect(this.el_);\n var playerRect = getBoundingClientRect(this.player_.el());\n var volumeBarPointPx = rangeBarRect.width * rangeBarPoint;\n\n if (!playerRect || !tooltipRect) {\n return;\n }\n\n var spaceLeftOfPoint = rangeBarRect.left - playerRect.left + volumeBarPointPx;\n var spaceRightOfPoint = rangeBarRect.width - volumeBarPointPx + (playerRect.right - rangeBarRect.right);\n var pullTooltipBy = tooltipRect.width / 2;\n\n if (spaceLeftOfPoint < pullTooltipBy) {\n pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;\n } else if (spaceRightOfPoint < pullTooltipBy) {\n pullTooltipBy = spaceRightOfPoint;\n }\n\n if (pullTooltipBy < 0) {\n pullTooltipBy = 0;\n } else if (pullTooltipBy > tooltipRect.width) {\n pullTooltipBy = tooltipRect.width;\n }\n\n this.el_.style.right = \"-\" + pullTooltipBy + \"px\";\n }\n\n this.write(content + \"%\");\n }\n /**\n * Write the volume to the tooltip DOM element.\n *\n * @param {string} content\n * The formatted volume for the tooltip.\n */\n ;\n\n _proto.write = function write(content) {\n textContent(this.el_, content);\n }\n /**\n * Updates the position of the volume tooltip relative to the `VolumeBar`.\n *\n * @param {Object} rangeBarRect\n * The `ClientRect` for the {@link VolumeBar} element.\n *\n * @param {number} rangeBarPoint\n * A number from 0 to 1, representing a horizontal/vertical reference point\n * from the left edge of the {@link VolumeBar}\n *\n * @param {boolean} vertical\n * Referees to the Volume control position\n * in the control bar{@link VolumeControl}\n *\n * @param {number} volume\n * The volume level to update the tooltip to\n *\n * @param {Function} cb\n * A function that will be called during the request animation frame\n * for tooltips that need to do additional animations from the default\n */\n ;\n\n _proto.updateVolume = function updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, cb) {\n var _this2 = this;\n\n this.requestNamedAnimationFrame('VolumeLevelTooltip#updateVolume', function () {\n _this2.update(rangeBarRect, rangeBarPoint, vertical, volume.toFixed(0));\n\n if (cb) {\n cb();\n }\n });\n };\n\n return VolumeLevelTooltip;\n}(Component$1);\n\nComponent$1.registerComponent('VolumeLevelTooltip', video_es_VolumeLevelTooltip);\n\n/**\n * The {@link MouseVolumeLevelDisplay} component tracks mouse movement over the\n * {@link VolumeControl}. It displays an indicator and a {@link VolumeLevelTooltip}\n * indicating the volume level which is represented by a given point in the\n * {@link VolumeBar}.\n *\n * @extends Component\n */\n\nvar video_es_MouseVolumeLevelDisplay = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(MouseVolumeLevelDisplay, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The {@link Player} that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function MouseVolumeLevelDisplay(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.update = video_es_throttle(bind(assertThisInitialized_default()(_this), _this.update), UPDATE_REFRESH_INTERVAL);\n return _this;\n }\n /**\n * Create the DOM element for this class.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = MouseVolumeLevelDisplay.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-mouse-display'\n });\n }\n /**\n * Enquires updates to its own DOM as well as the DOM of its\n * {@link VolumeLevelTooltip} child.\n *\n * @param {Object} rangeBarRect\n * The `ClientRect` for the {@link VolumeBar} element.\n *\n * @param {number} rangeBarPoint\n * A number from 0 to 1, representing a horizontal/vertical reference point\n * from the left edge of the {@link VolumeBar}\n *\n * @param {boolean} vertical\n * Referees to the Volume control position\n * in the control bar{@link VolumeControl}\n *\n */\n ;\n\n _proto.update = function update(rangeBarRect, rangeBarPoint, vertical) {\n var _this2 = this;\n\n var volume = 100 * rangeBarPoint;\n this.getChild('volumeLevelTooltip').updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, function () {\n if (vertical) {\n _this2.el_.style.bottom = rangeBarRect.height * rangeBarPoint + \"px\";\n } else {\n _this2.el_.style.left = rangeBarRect.width * rangeBarPoint + \"px\";\n }\n });\n };\n\n return MouseVolumeLevelDisplay;\n}(Component$1);\n/**\n * Default options for `MouseVolumeLevelDisplay`\n *\n * @type {Object}\n * @private\n */\n\n\nvideo_es_MouseVolumeLevelDisplay.prototype.options_ = {\n children: ['volumeLevelTooltip']\n};\nComponent$1.registerComponent('MouseVolumeLevelDisplay', video_es_MouseVolumeLevelDisplay);\n\n/**\n * The bar that contains the volume level and can be clicked on to adjust the level\n *\n * @extends Slider\n */\n\nvar video_es_VolumeBar = /*#__PURE__*/function (_Slider) {\n inheritsLoose_default()(VolumeBar, _Slider);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function VolumeBar(player, options) {\n var _this;\n\n _this = _Slider.call(this, player, options) || this;\n\n _this.on('slideractive', function (e) {\n return _this.updateLastVolume_(e);\n });\n\n _this.on(player, 'volumechange', function (e) {\n return _this.updateARIAAttributes(e);\n });\n\n player.ready(function () {\n return _this.updateARIAAttributes();\n });\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = VolumeBar.prototype;\n\n _proto.createEl = function createEl() {\n return _Slider.prototype.createEl.call(this, 'div', {\n className: 'vjs-volume-bar vjs-slider-bar'\n }, {\n 'aria-label': this.localize('Volume Level'),\n 'aria-live': 'polite'\n });\n }\n /**\n * Handle mouse down on volume bar\n *\n * @param {EventTarget~Event} event\n * The `mousedown` event that caused this to run.\n *\n * @listens mousedown\n */\n ;\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n if (!isSingleLeftClick(event)) {\n return;\n }\n\n _Slider.prototype.handleMouseDown.call(this, event);\n }\n /**\n * Handle movement events on the {@link VolumeMenuButton}.\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run.\n *\n * @listens mousemove\n */\n ;\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n var mouseVolumeLevelDisplay = this.getChild('mouseVolumeLevelDisplay');\n\n if (mouseVolumeLevelDisplay) {\n var volumeBarEl = this.el();\n var volumeBarRect = getBoundingClientRect(volumeBarEl);\n var vertical = this.vertical();\n var volumeBarPoint = getPointerPosition(volumeBarEl, event);\n volumeBarPoint = vertical ? volumeBarPoint.y : volumeBarPoint.x; // The default skin has a gap on either side of the `VolumeBar`. This means\n // that it's possible to trigger this behavior outside the boundaries of\n // the `VolumeBar`. This ensures we stay within it at all times.\n\n volumeBarPoint = clamp(volumeBarPoint, 0, 1);\n mouseVolumeLevelDisplay.update(volumeBarRect, volumeBarPoint, vertical);\n }\n\n if (!isSingleLeftClick(event)) {\n return;\n }\n\n this.checkMuted();\n this.player_.volume(this.calculateDistance(event));\n }\n /**\n * If the player is muted unmute it.\n */\n ;\n\n _proto.checkMuted = function checkMuted() {\n if (this.player_.muted()) {\n this.player_.muted(false);\n }\n }\n /**\n * Get percent of volume level\n *\n * @return {number}\n * Volume level percent as a decimal number.\n */\n ;\n\n _proto.getPercent = function getPercent() {\n if (this.player_.muted()) {\n return 0;\n }\n\n return this.player_.volume();\n }\n /**\n * Increase volume level for keyboard users\n */\n ;\n\n _proto.stepForward = function stepForward() {\n this.checkMuted();\n this.player_.volume(this.player_.volume() + 0.1);\n }\n /**\n * Decrease volume level for keyboard users\n */\n ;\n\n _proto.stepBack = function stepBack() {\n this.checkMuted();\n this.player_.volume(this.player_.volume() - 0.1);\n }\n /**\n * Update ARIA accessibility attributes\n *\n * @param {EventTarget~Event} [event]\n * The `volumechange` event that caused this function to run.\n *\n * @listens Player#volumechange\n */\n ;\n\n _proto.updateARIAAttributes = function updateARIAAttributes(event) {\n var ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();\n this.el_.setAttribute('aria-valuenow', ariaValue);\n this.el_.setAttribute('aria-valuetext', ariaValue + '%');\n }\n /**\n * Returns the current value of the player volume as a percentage\n *\n * @private\n */\n ;\n\n _proto.volumeAsPercentage_ = function volumeAsPercentage_() {\n return Math.round(this.player_.volume() * 100);\n }\n /**\n * When user starts dragging the VolumeBar, store the volume and listen for\n * the end of the drag. When the drag ends, if the volume was set to zero,\n * set lastVolume to the stored volume.\n *\n * @listens slideractive\n * @private\n */\n ;\n\n _proto.updateLastVolume_ = function updateLastVolume_() {\n var _this2 = this;\n\n var volumeBeforeDrag = this.player_.volume();\n this.one('sliderinactive', function () {\n if (_this2.player_.volume() === 0) {\n _this2.player_.lastVolume_(volumeBeforeDrag);\n }\n });\n };\n\n return VolumeBar;\n}(video_es_Slider);\n/**\n * Default options for the `VolumeBar`\n *\n * @type {Object}\n * @private\n */\n\n\nvideo_es_VolumeBar.prototype.options_ = {\n children: ['volumeLevel'],\n barName: 'volumeLevel'\n}; // MouseVolumeLevelDisplay tooltip should not be added to a player on mobile devices\n\nif (!IS_IOS && !IS_ANDROID) {\n video_es_VolumeBar.prototype.options_.children.splice(0, 0, 'mouseVolumeLevelDisplay');\n}\n/**\n * Call the update event for this Slider when this event happens on the player.\n *\n * @type {string}\n */\n\n\nvideo_es_VolumeBar.prototype.playerEvent = 'volumechange';\nComponent$1.registerComponent('VolumeBar', video_es_VolumeBar);\n\n/**\n * The component for controlling the volume level\n *\n * @extends Component\n */\n\nvar video_es_VolumeControl = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(VolumeControl, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function VolumeControl(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n options.vertical = options.vertical || false; // Pass the vertical option down to the VolumeBar if\n // the VolumeBar is turned on.\n\n if (typeof options.volumeBar === 'undefined' || isPlain(options.volumeBar)) {\n options.volumeBar = options.volumeBar || {};\n options.volumeBar.vertical = options.vertical;\n }\n\n _this = _Component.call(this, player, options) || this; // hide this control if volume support is missing\n\n checkVolumeSupport(assertThisInitialized_default()(_this), player);\n _this.throttledHandleMouseMove = video_es_throttle(bind(assertThisInitialized_default()(_this), _this.handleMouseMove), UPDATE_REFRESH_INTERVAL);\n\n _this.handleMouseUpHandler_ = function (e) {\n return _this.handleMouseUp(e);\n };\n\n _this.on('mousedown', function (e) {\n return _this.handleMouseDown(e);\n });\n\n _this.on('touchstart', function (e) {\n return _this.handleMouseDown(e);\n });\n\n _this.on('mousemove', function (e) {\n return _this.handleMouseMove(e);\n }); // while the slider is active (the mouse has been pressed down and\n // is dragging) or in focus we do not want to hide the VolumeBar\n\n\n _this.on(_this.volumeBar, ['focus', 'slideractive'], function () {\n _this.volumeBar.addClass('vjs-slider-active');\n\n _this.addClass('vjs-slider-active');\n\n _this.trigger('slideractive');\n });\n\n _this.on(_this.volumeBar, ['blur', 'sliderinactive'], function () {\n _this.volumeBar.removeClass('vjs-slider-active');\n\n _this.removeClass('vjs-slider-active');\n\n _this.trigger('sliderinactive');\n });\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = VolumeControl.prototype;\n\n _proto.createEl = function createEl() {\n var orientationClass = 'vjs-volume-horizontal';\n\n if (this.options_.vertical) {\n orientationClass = 'vjs-volume-vertical';\n }\n\n return _Component.prototype.createEl.call(this, 'div', {\n className: \"vjs-volume-control vjs-control \" + orientationClass\n });\n }\n /**\n * Handle `mousedown` or `touchstart` events on the `VolumeControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n ;\n\n _proto.handleMouseDown = function handleMouseDown(event) {\n var doc = this.el_.ownerDocument;\n this.on(doc, 'mousemove', this.throttledHandleMouseMove);\n this.on(doc, 'touchmove', this.throttledHandleMouseMove);\n this.on(doc, 'mouseup', this.handleMouseUpHandler_);\n this.on(doc, 'touchend', this.handleMouseUpHandler_);\n }\n /**\n * Handle `mouseup` or `touchend` events on the `VolumeControl`.\n *\n * @param {EventTarget~Event} event\n * `mouseup` or `touchend` event that triggered this function.\n *\n * @listens touchend\n * @listens mouseup\n */\n ;\n\n _proto.handleMouseUp = function handleMouseUp(event) {\n var doc = this.el_.ownerDocument;\n this.off(doc, 'mousemove', this.throttledHandleMouseMove);\n this.off(doc, 'touchmove', this.throttledHandleMouseMove);\n this.off(doc, 'mouseup', this.handleMouseUpHandler_);\n this.off(doc, 'touchend', this.handleMouseUpHandler_);\n }\n /**\n * Handle `mousedown` or `touchstart` events on the `VolumeControl`.\n *\n * @param {EventTarget~Event} event\n * `mousedown` or `touchstart` event that triggered this function\n *\n * @listens mousedown\n * @listens touchstart\n */\n ;\n\n _proto.handleMouseMove = function handleMouseMove(event) {\n this.volumeBar.handleMouseMove(event);\n };\n\n return VolumeControl;\n}(Component$1);\n/**\n * Default options for the `VolumeControl`\n *\n * @type {Object}\n * @private\n */\n\n\nvideo_es_VolumeControl.prototype.options_ = {\n children: ['volumeBar']\n};\nComponent$1.registerComponent('VolumeControl', video_es_VolumeControl);\n\n/**\n * Check if muting volume is supported and if it isn't hide the mute toggle\n * button.\n *\n * @param {Component} self\n * A reference to the mute toggle button\n *\n * @param {Player} player\n * A reference to the player\n *\n * @private\n */\nvar checkMuteSupport = function checkMuteSupport(self, player) {\n // hide mute toggle button if it's not supported by the current tech\n if (player.tech_ && !player.tech_.featuresMuteControl) {\n self.addClass('vjs-hidden');\n }\n\n self.on(player, 'loadstart', function () {\n if (!player.tech_.featuresMuteControl) {\n self.addClass('vjs-hidden');\n } else {\n self.removeClass('vjs-hidden');\n }\n });\n};\n\n/**\n * A button component for muting the audio.\n *\n * @extends Button\n */\n\nvar video_es_MuteToggle = /*#__PURE__*/function (_Button) {\n inheritsLoose_default()(MuteToggle, _Button);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function MuteToggle(player, options) {\n var _this;\n\n _this = _Button.call(this, player, options) || this; // hide this control if volume support is missing\n\n checkMuteSupport(assertThisInitialized_default()(_this), player);\n\n _this.on(player, ['loadstart', 'volumechange'], function (e) {\n return _this.update(e);\n });\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = MuteToggle.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-mute-control \" + _Button.prototype.buildCSSClass.call(this);\n }\n /**\n * This gets called when an `MuteToggle` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n var vol = this.player_.volume();\n var lastVolume = this.player_.lastVolume_();\n\n if (vol === 0) {\n var volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;\n this.player_.volume(volumeToSet);\n this.player_.muted(false);\n } else {\n this.player_.muted(this.player_.muted() ? false : true);\n }\n }\n /**\n * Update the `MuteToggle` button based on the state of `volume` and `muted`\n * on the player.\n *\n * @param {EventTarget~Event} [event]\n * The {@link Player#loadstart} event if this function was called\n * through an event.\n *\n * @listens Player#loadstart\n * @listens Player#volumechange\n */\n ;\n\n _proto.update = function update(event) {\n this.updateIcon_();\n this.updateControlText_();\n }\n /**\n * Update the appearance of the `MuteToggle` icon.\n *\n * Possible states (given `level` variable below):\n * - 0: crossed out\n * - 1: zero bars of volume\n * - 2: one bar of volume\n * - 3: two bars of volume\n *\n * @private\n */\n ;\n\n _proto.updateIcon_ = function updateIcon_() {\n var vol = this.player_.volume();\n var level = 3; // in iOS when a player is loaded with muted attribute\n // and volume is changed with a native mute button\n // we want to make sure muted state is updated\n\n if (IS_IOS && this.player_.tech_ && this.player_.tech_.el_) {\n this.player_.muted(this.player_.tech_.el_.muted);\n }\n\n if (vol === 0 || this.player_.muted()) {\n level = 0;\n } else if (vol < 0.33) {\n level = 1;\n } else if (vol < 0.67) {\n level = 2;\n } // TODO improve muted icon classes\n\n\n for (var i = 0; i < 4; i++) {\n removeClass(this.el_, \"vjs-vol-\" + i);\n }\n\n addClass(this.el_, \"vjs-vol-\" + level);\n }\n /**\n * If `muted` has changed on the player, update the control text\n * (`title` attribute on `vjs-mute-control` element and content of\n * `vjs-control-text` element).\n *\n * @private\n */\n ;\n\n _proto.updateControlText_ = function updateControlText_() {\n var soundOff = this.player_.muted() || this.player_.volume() === 0;\n var text = soundOff ? 'Unmute' : 'Mute';\n\n if (this.controlText() !== text) {\n this.controlText(text);\n }\n };\n\n return MuteToggle;\n}(video_es_Button);\n/**\n * The text that should display over the `MuteToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_MuteToggle.prototype.controlText_ = 'Mute';\nComponent$1.registerComponent('MuteToggle', video_es_MuteToggle);\n\n/**\n * A Component to contain the MuteToggle and VolumeControl so that\n * they can work together.\n *\n * @extends Component\n */\n\nvar video_es_VolumePanel = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(VolumePanel, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function VolumePanel(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options.inline !== 'undefined') {\n options.inline = options.inline;\n } else {\n options.inline = true;\n } // pass the inline option down to the VolumeControl as vertical if\n // the VolumeControl is on.\n\n\n if (typeof options.volumeControl === 'undefined' || isPlain(options.volumeControl)) {\n options.volumeControl = options.volumeControl || {};\n options.volumeControl.vertical = !options.inline;\n }\n\n _this = _Component.call(this, player, options) || this; // this handler is used by mouse handler methods below\n\n _this.handleKeyPressHandler_ = function (e) {\n return _this.handleKeyPress(e);\n };\n\n _this.on(player, ['loadstart'], function (e) {\n return _this.volumePanelState_(e);\n });\n\n _this.on(_this.muteToggle, 'keyup', function (e) {\n return _this.handleKeyPress(e);\n });\n\n _this.on(_this.volumeControl, 'keyup', function (e) {\n return _this.handleVolumeControlKeyUp(e);\n });\n\n _this.on('keydown', function (e) {\n return _this.handleKeyPress(e);\n });\n\n _this.on('mouseover', function (e) {\n return _this.handleMouseOver(e);\n });\n\n _this.on('mouseout', function (e) {\n return _this.handleMouseOut(e);\n }); // while the slider is active (the mouse has been pressed down and\n // is dragging) we do not want to hide the VolumeBar\n\n\n _this.on(_this.volumeControl, ['slideractive'], _this.sliderActive_);\n\n _this.on(_this.volumeControl, ['sliderinactive'], _this.sliderInactive_);\n\n return _this;\n }\n /**\n * Add vjs-slider-active class to the VolumePanel\n *\n * @listens VolumeControl#slideractive\n * @private\n */\n\n\n var _proto = VolumePanel.prototype;\n\n _proto.sliderActive_ = function sliderActive_() {\n this.addClass('vjs-slider-active');\n }\n /**\n * Removes vjs-slider-active class to the VolumePanel\n *\n * @listens VolumeControl#sliderinactive\n * @private\n */\n ;\n\n _proto.sliderInactive_ = function sliderInactive_() {\n this.removeClass('vjs-slider-active');\n }\n /**\n * Adds vjs-hidden or vjs-mute-toggle-only to the VolumePanel\n * depending on MuteToggle and VolumeControl state\n *\n * @listens Player#loadstart\n * @private\n */\n ;\n\n _proto.volumePanelState_ = function volumePanelState_() {\n // hide volume panel if neither volume control or mute toggle\n // are displayed\n if (this.volumeControl.hasClass('vjs-hidden') && this.muteToggle.hasClass('vjs-hidden')) {\n this.addClass('vjs-hidden');\n } // if only mute toggle is visible we don't want\n // volume panel expanding when hovered or active\n\n\n if (this.volumeControl.hasClass('vjs-hidden') && !this.muteToggle.hasClass('vjs-hidden')) {\n this.addClass('vjs-mute-toggle-only');\n }\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n ;\n\n _proto.createEl = function createEl() {\n var orientationClass = 'vjs-volume-panel-horizontal';\n\n if (!this.options_.inline) {\n orientationClass = 'vjs-volume-panel-vertical';\n }\n\n return _Component.prototype.createEl.call(this, 'div', {\n className: \"vjs-volume-panel vjs-control \" + orientationClass\n });\n }\n /**\n * Dispose of the `volume-panel` and all child components.\n */\n ;\n\n _proto.dispose = function dispose() {\n this.handleMouseOut();\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Handles `keyup` events on the `VolumeControl`, looking for ESC, which closes\n * the volume panel and sets focus on `MuteToggle`.\n *\n * @param {EventTarget~Event} event\n * The `keyup` event that caused this function to be called.\n *\n * @listens keyup\n */\n ;\n\n _proto.handleVolumeControlKeyUp = function handleVolumeControlKeyUp(event) {\n if (keycode_default.a.isEventKey(event, 'Esc')) {\n this.muteToggle.focus();\n }\n }\n /**\n * This gets called when a `VolumePanel` gains hover via a `mouseover` event.\n * Turns on listening for `mouseover` event. When they happen it\n * calls `this.handleMouseOver`.\n *\n * @param {EventTarget~Event} event\n * The `mouseover` event that caused this function to be called.\n *\n * @listens mouseover\n */\n ;\n\n _proto.handleMouseOver = function handleMouseOver(event) {\n this.addClass('vjs-hover');\n on(document_default.a, 'keyup', this.handleKeyPressHandler_);\n }\n /**\n * This gets called when a `VolumePanel` gains hover via a `mouseout` event.\n * Turns on listening for `mouseout` event. When they happen it\n * calls `this.handleMouseOut`.\n *\n * @param {EventTarget~Event} event\n * The `mouseout` event that caused this function to be called.\n *\n * @listens mouseout\n */\n ;\n\n _proto.handleMouseOut = function handleMouseOut(event) {\n this.removeClass('vjs-hover');\n off(document_default.a, 'keyup', this.handleKeyPressHandler_);\n }\n /**\n * Handles `keyup` event on the document or `keydown` event on the `VolumePanel`,\n * looking for ESC, which hides the `VolumeControl`.\n *\n * @param {EventTarget~Event} event\n * The keypress that triggered this event.\n *\n * @listens keydown | keyup\n */\n ;\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n if (keycode_default.a.isEventKey(event, 'Esc')) {\n this.handleMouseOut();\n }\n };\n\n return VolumePanel;\n}(Component$1);\n/**\n * Default options for the `VolumeControl`\n *\n * @type {Object}\n * @private\n */\n\n\nvideo_es_VolumePanel.prototype.options_ = {\n children: ['muteToggle', 'volumeControl']\n};\nComponent$1.registerComponent('VolumePanel', video_es_VolumePanel);\n\n/**\n * The Menu component is used to build popup menus, including subtitle and\n * captions selection menus.\n *\n * @extends Component\n */\n\nvar video_es_Menu = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(Menu, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * the player that this component should attach to\n *\n * @param {Object} [options]\n * Object of option names and values\n *\n */\n function Menu(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n\n if (options) {\n _this.menuButton_ = options.menuButton;\n }\n\n _this.focusedChild_ = -1;\n\n _this.on('keydown', function (e) {\n return _this.handleKeyDown(e);\n }); // All the menu item instances share the same blur handler provided by the menu container.\n\n\n _this.boundHandleBlur_ = function (e) {\n return _this.handleBlur(e);\n };\n\n _this.boundHandleTapClick_ = function (e) {\n return _this.handleTapClick(e);\n };\n\n return _this;\n }\n /**\n * Add event listeners to the {@link MenuItem}.\n *\n * @param {Object} component\n * The instance of the `MenuItem` to add listeners to.\n *\n */\n\n\n var _proto = Menu.prototype;\n\n _proto.addEventListenerForItem = function addEventListenerForItem(component) {\n if (!(component instanceof Component$1)) {\n return;\n }\n\n this.on(component, 'blur', this.boundHandleBlur_);\n this.on(component, ['tap', 'click'], this.boundHandleTapClick_);\n }\n /**\n * Remove event listeners from the {@link MenuItem}.\n *\n * @param {Object} component\n * The instance of the `MenuItem` to remove listeners.\n *\n */\n ;\n\n _proto.removeEventListenerForItem = function removeEventListenerForItem(component) {\n if (!(component instanceof Component$1)) {\n return;\n }\n\n this.off(component, 'blur', this.boundHandleBlur_);\n this.off(component, ['tap', 'click'], this.boundHandleTapClick_);\n }\n /**\n * This method will be called indirectly when the component has been added\n * before the component adds to the new menu instance by `addItem`.\n * In this case, the original menu instance will remove the component\n * by calling `removeChild`.\n *\n * @param {Object} component\n * The instance of the `MenuItem`\n */\n ;\n\n _proto.removeChild = function removeChild(component) {\n if (typeof component === 'string') {\n component = this.getChild(component);\n }\n\n this.removeEventListenerForItem(component);\n\n _Component.prototype.removeChild.call(this, component);\n }\n /**\n * Add a {@link MenuItem} to the menu.\n *\n * @param {Object|string} component\n * The name or instance of the `MenuItem` to add.\n *\n */\n ;\n\n _proto.addItem = function addItem(component) {\n var childComponent = this.addChild(component);\n\n if (childComponent) {\n this.addEventListenerForItem(childComponent);\n }\n }\n /**\n * Create the `Menu`s DOM element.\n *\n * @return {Element}\n * the element that was created\n */\n ;\n\n _proto.createEl = function createEl$1() {\n var contentElType = this.options_.contentElType || 'ul';\n this.contentEl_ = video_es_createEl(contentElType, {\n className: 'vjs-menu-content'\n });\n this.contentEl_.setAttribute('role', 'menu');\n\n var el = _Component.prototype.createEl.call(this, 'div', {\n append: this.contentEl_,\n className: 'vjs-menu'\n });\n\n el.appendChild(this.contentEl_); // Prevent clicks from bubbling up. Needed for Menu Buttons,\n // where a click on the parent is significant\n\n on(el, 'click', function (event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n });\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n this.boundHandleBlur_ = null;\n this.boundHandleTapClick_ = null;\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Called when a `MenuItem` loses focus.\n *\n * @param {EventTarget~Event} event\n * The `blur` event that caused this function to be called.\n *\n * @listens blur\n */\n ;\n\n _proto.handleBlur = function handleBlur(event) {\n var relatedTarget = event.relatedTarget || document_default.a.activeElement; // Close menu popup when a user clicks outside the menu\n\n if (!this.children().some(function (element) {\n return element.el() === relatedTarget;\n })) {\n var btn = this.menuButton_;\n\n if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {\n btn.unpressButton();\n }\n }\n }\n /**\n * Called when a `MenuItem` gets clicked or tapped.\n *\n * @param {EventTarget~Event} event\n * The `click` or `tap` event that caused this function to be called.\n *\n * @listens click,tap\n */\n ;\n\n _proto.handleTapClick = function handleTapClick(event) {\n // Unpress the associated MenuButton, and move focus back to it\n if (this.menuButton_) {\n this.menuButton_.unpressButton();\n var childComponents = this.children();\n\n if (!Array.isArray(childComponents)) {\n return;\n }\n\n var foundComponent = childComponents.filter(function (component) {\n return component.el() === event.target;\n })[0];\n\n if (!foundComponent) {\n return;\n } // don't focus menu button if item is a caption settings item\n // because focus will move elsewhere\n\n\n if (foundComponent.name() !== 'CaptionSettingsMenuItem') {\n this.menuButton_.focus();\n }\n }\n }\n /**\n * Handle a `keydown` event on this menu. This listener is added in the constructor.\n *\n * @param {EventTarget~Event} event\n * A `keydown` event that happened on the menu.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n // Left and Down Arrows\n if (keycode_default.a.isEventKey(event, 'Left') || keycode_default.a.isEventKey(event, 'Down')) {\n event.preventDefault();\n event.stopPropagation();\n this.stepForward(); // Up and Right Arrows\n } else if (keycode_default.a.isEventKey(event, 'Right') || keycode_default.a.isEventKey(event, 'Up')) {\n event.preventDefault();\n event.stopPropagation();\n this.stepBack();\n }\n }\n /**\n * Move to next (lower) menu item for keyboard users.\n */\n ;\n\n _proto.stepForward = function stepForward() {\n var stepChild = 0;\n\n if (this.focusedChild_ !== undefined) {\n stepChild = this.focusedChild_ + 1;\n }\n\n this.focus(stepChild);\n }\n /**\n * Move to previous (higher) menu item for keyboard users.\n */\n ;\n\n _proto.stepBack = function stepBack() {\n var stepChild = 0;\n\n if (this.focusedChild_ !== undefined) {\n stepChild = this.focusedChild_ - 1;\n }\n\n this.focus(stepChild);\n }\n /**\n * Set focus on a {@link MenuItem} in the `Menu`.\n *\n * @param {Object|string} [item=0]\n * Index of child item set focus on.\n */\n ;\n\n _proto.focus = function focus(item) {\n if (item === void 0) {\n item = 0;\n }\n\n var children = this.children().slice();\n var haveTitle = children.length && children[0].hasClass('vjs-menu-title');\n\n if (haveTitle) {\n children.shift();\n }\n\n if (children.length > 0) {\n if (item < 0) {\n item = 0;\n } else if (item >= children.length) {\n item = children.length - 1;\n }\n\n this.focusedChild_ = item;\n children[item].el_.focus();\n }\n };\n\n return Menu;\n}(Component$1);\n\nComponent$1.registerComponent('Menu', video_es_Menu);\n\n/**\n * A `MenuButton` class for any popup {@link Menu}.\n *\n * @extends Component\n */\n\nvar video_es_MenuButton = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(MenuButton, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function MenuButton(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _Component.call(this, player, options) || this;\n _this.menuButton_ = new video_es_Button(player, options);\n\n _this.menuButton_.controlText(_this.controlText_);\n\n _this.menuButton_.el_.setAttribute('aria-haspopup', 'true'); // Add buildCSSClass values to the button, not the wrapper\n\n\n var buttonClass = video_es_Button.prototype.buildCSSClass();\n _this.menuButton_.el_.className = _this.buildCSSClass() + ' ' + buttonClass;\n\n _this.menuButton_.removeClass('vjs-control');\n\n _this.addChild(_this.menuButton_);\n\n _this.update();\n\n _this.enabled_ = true;\n\n var handleClick = function handleClick(e) {\n return _this.handleClick(e);\n };\n\n _this.handleMenuKeyUp_ = function (e) {\n return _this.handleMenuKeyUp(e);\n };\n\n _this.on(_this.menuButton_, 'tap', handleClick);\n\n _this.on(_this.menuButton_, 'click', handleClick);\n\n _this.on(_this.menuButton_, 'keydown', function (e) {\n return _this.handleKeyDown(e);\n });\n\n _this.on(_this.menuButton_, 'mouseenter', function () {\n _this.addClass('vjs-hover');\n\n _this.menu.show();\n\n on(document_default.a, 'keyup', _this.handleMenuKeyUp_);\n });\n\n _this.on('mouseleave', function (e) {\n return _this.handleMouseLeave(e);\n });\n\n _this.on('keydown', function (e) {\n return _this.handleSubmenuKeyDown(e);\n });\n\n return _this;\n }\n /**\n * Update the menu based on the current state of its items.\n */\n\n\n var _proto = MenuButton.prototype;\n\n _proto.update = function update() {\n var menu = this.createMenu();\n\n if (this.menu) {\n this.menu.dispose();\n this.removeChild(this.menu);\n }\n\n this.menu = menu;\n this.addChild(menu);\n /**\n * Track the state of the menu button\n *\n * @type {Boolean}\n * @private\n */\n\n this.buttonPressed_ = false;\n this.menuButton_.el_.setAttribute('aria-expanded', 'false');\n\n if (this.items && this.items.length <= this.hideThreshold_) {\n this.hide();\n } else {\n this.show();\n }\n }\n /**\n * Create the menu and add all items to it.\n *\n * @return {Menu}\n * The constructed menu\n */\n ;\n\n _proto.createMenu = function createMenu() {\n var menu = new video_es_Menu(this.player_, {\n menuButton: this\n });\n /**\n * Hide the menu if the number of items is less than or equal to this threshold. This defaults\n * to 0 and whenever we add items which can be hidden to the menu we'll increment it. We list\n * it here because every time we run `createMenu` we need to reset the value.\n *\n * @protected\n * @type {Number}\n */\n\n this.hideThreshold_ = 0; // Add a title list item to the top\n\n if (this.options_.title) {\n var titleEl = video_es_createEl('li', {\n className: 'vjs-menu-title',\n textContent: toTitleCase$1(this.options_.title),\n tabIndex: -1\n });\n var titleComponent = new Component$1(this.player_, {\n el: titleEl\n });\n menu.addItem(titleComponent);\n }\n\n this.items = this.createItems();\n\n if (this.items) {\n // Add menu items to the menu\n for (var i = 0; i < this.items.length; i++) {\n menu.addItem(this.items[i]);\n }\n }\n\n return menu;\n }\n /**\n * Create the list of menu items. Specific to each subclass.\n *\n * @abstract\n */\n ;\n\n _proto.createItems = function createItems() {}\n /**\n * Create the `MenuButtons`s DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n ;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: this.buildWrapperCSSClass()\n }, {});\n }\n /**\n * Allow sub components to stack CSS class names for the wrapper element\n *\n * @return {string}\n * The constructed wrapper DOM `className`\n */\n ;\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n var menuButtonClass = 'vjs-menu-button'; // If the inline option is passed, we want to use different styles altogether.\n\n if (this.options_.inline === true) {\n menuButtonClass += '-inline';\n } else {\n menuButtonClass += '-popup';\n } // TODO: Fix the CSS so that this isn't necessary\n\n\n var buttonClass = video_es_Button.prototype.buildCSSClass();\n return \"vjs-menu-button \" + menuButtonClass + \" \" + buttonClass + \" \" + _Component.prototype.buildCSSClass.call(this);\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n ;\n\n _proto.buildCSSClass = function buildCSSClass() {\n var menuButtonClass = 'vjs-menu-button'; // If the inline option is passed, we want to use different styles altogether.\n\n if (this.options_.inline === true) {\n menuButtonClass += '-inline';\n } else {\n menuButtonClass += '-popup';\n }\n\n return \"vjs-menu-button \" + menuButtonClass + \" \" + _Component.prototype.buildCSSClass.call(this);\n }\n /**\n * Get or set the localized control text that will be used for accessibility.\n *\n * > NOTE: This will come from the internal `menuButton_` element.\n *\n * @param {string} [text]\n * Control text for element.\n *\n * @param {Element} [el=this.menuButton_.el()]\n * Element to set the title on.\n *\n * @return {string}\n * - The control text when getting\n */\n ;\n\n _proto.controlText = function controlText(text, el) {\n if (el === void 0) {\n el = this.menuButton_.el();\n }\n\n return this.menuButton_.controlText(text, el);\n }\n /**\n * Dispose of the `menu-button` and all child components.\n */\n ;\n\n _proto.dispose = function dispose() {\n this.handleMouseLeave();\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Handle a click on a `MenuButton`.\n * See {@link ClickableComponent#handleClick} for instances where this is called.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n if (this.buttonPressed_) {\n this.unpressButton();\n } else {\n this.pressButton();\n }\n }\n /**\n * Handle `mouseleave` for `MenuButton`.\n *\n * @param {EventTarget~Event} event\n * The `mouseleave` event that caused this function to be called.\n *\n * @listens mouseleave\n */\n ;\n\n _proto.handleMouseLeave = function handleMouseLeave(event) {\n this.removeClass('vjs-hover');\n off(document_default.a, 'keyup', this.handleMenuKeyUp_);\n }\n /**\n * Set the focus to the actual button, not to this element\n */\n ;\n\n _proto.focus = function focus() {\n this.menuButton_.focus();\n }\n /**\n * Remove the focus from the actual button, not this element\n */\n ;\n\n _proto.blur = function blur() {\n this.menuButton_.blur();\n }\n /**\n * Handle tab, escape, down arrow, and up arrow keys for `MenuButton`. See\n * {@link ClickableComponent#handleKeyDown} for instances where this is called.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n // Escape or Tab unpress the 'button'\n if (keycode_default.a.isEventKey(event, 'Esc') || keycode_default.a.isEventKey(event, 'Tab')) {\n if (this.buttonPressed_) {\n this.unpressButton();\n } // Don't preventDefault for Tab key - we still want to lose focus\n\n\n if (!keycode_default.a.isEventKey(event, 'Tab')) {\n event.preventDefault(); // Set focus back to the menu button's button\n\n this.menuButton_.focus();\n } // Up Arrow or Down Arrow also 'press' the button to open the menu\n\n } else if (keycode_default.a.isEventKey(event, 'Up') || keycode_default.a.isEventKey(event, 'Down')) {\n if (!this.buttonPressed_) {\n event.preventDefault();\n this.pressButton();\n }\n }\n }\n /**\n * Handle a `keyup` event on a `MenuButton`. The listener for this is added in\n * the constructor.\n *\n * @param {EventTarget~Event} event\n * Key press event\n *\n * @listens keyup\n */\n ;\n\n _proto.handleMenuKeyUp = function handleMenuKeyUp(event) {\n // Escape hides popup menu\n if (keycode_default.a.isEventKey(event, 'Esc') || keycode_default.a.isEventKey(event, 'Tab')) {\n this.removeClass('vjs-hover');\n }\n }\n /**\n * This method name now delegates to `handleSubmenuKeyDown`. This means\n * anyone calling `handleSubmenuKeyPress` will not see their method calls\n * stop working.\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to be called.\n */\n ;\n\n _proto.handleSubmenuKeyPress = function handleSubmenuKeyPress(event) {\n this.handleSubmenuKeyDown(event);\n }\n /**\n * Handle a `keydown` event on a sub-menu. The listener for this is added in\n * the constructor.\n *\n * @param {EventTarget~Event} event\n * Key press event\n *\n * @listens keydown\n */\n ;\n\n _proto.handleSubmenuKeyDown = function handleSubmenuKeyDown(event) {\n // Escape or Tab unpress the 'button'\n if (keycode_default.a.isEventKey(event, 'Esc') || keycode_default.a.isEventKey(event, 'Tab')) {\n if (this.buttonPressed_) {\n this.unpressButton();\n } // Don't preventDefault for Tab key - we still want to lose focus\n\n\n if (!keycode_default.a.isEventKey(event, 'Tab')) {\n event.preventDefault(); // Set focus back to the menu button's button\n\n this.menuButton_.focus();\n }\n }\n }\n /**\n * Put the current `MenuButton` into a pressed state.\n */\n ;\n\n _proto.pressButton = function pressButton() {\n if (this.enabled_) {\n this.buttonPressed_ = true;\n this.menu.show();\n this.menu.lockShowing();\n this.menuButton_.el_.setAttribute('aria-expanded', 'true'); // set the focus into the submenu, except on iOS where it is resulting in\n // undesired scrolling behavior when the player is in an iframe\n\n if (IS_IOS && isInFrame()) {\n // Return early so that the menu isn't focused\n return;\n }\n\n this.menu.focus();\n }\n }\n /**\n * Take the current `MenuButton` out of a pressed state.\n */\n ;\n\n _proto.unpressButton = function unpressButton() {\n if (this.enabled_) {\n this.buttonPressed_ = false;\n this.menu.unlockShowing();\n this.menu.hide();\n this.menuButton_.el_.setAttribute('aria-expanded', 'false');\n }\n }\n /**\n * Disable the `MenuButton`. Don't allow it to be clicked.\n */\n ;\n\n _proto.disable = function disable() {\n this.unpressButton();\n this.enabled_ = false;\n this.addClass('vjs-disabled');\n this.menuButton_.disable();\n }\n /**\n * Enable the `MenuButton`. Allow it to be clicked.\n */\n ;\n\n _proto.enable = function enable() {\n this.enabled_ = true;\n this.removeClass('vjs-disabled');\n this.menuButton_.enable();\n };\n\n return MenuButton;\n}(Component$1);\n\nComponent$1.registerComponent('MenuButton', video_es_MenuButton);\n\n/**\n * The base class for buttons that toggle specific track types (e.g. subtitles).\n *\n * @extends MenuButton\n */\n\nvar video_es_TrackButton = /*#__PURE__*/function (_MenuButton) {\n inheritsLoose_default()(TrackButton, _MenuButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TrackButton(player, options) {\n var _this;\n\n var tracks = options.tracks;\n _this = _MenuButton.call(this, player, options) || this;\n\n if (_this.items.length <= 1) {\n _this.hide();\n }\n\n if (!tracks) {\n return assertThisInitialized_default()(_this);\n }\n\n var updateHandler = bind(assertThisInitialized_default()(_this), _this.update);\n tracks.addEventListener('removetrack', updateHandler);\n tracks.addEventListener('addtrack', updateHandler);\n tracks.addEventListener('labelchange', updateHandler);\n\n _this.player_.on('ready', updateHandler);\n\n _this.player_.on('dispose', function () {\n tracks.removeEventListener('removetrack', updateHandler);\n tracks.removeEventListener('addtrack', updateHandler);\n tracks.removeEventListener('labelchange', updateHandler);\n });\n\n return _this;\n }\n\n return TrackButton;\n}(video_es_MenuButton);\n\nComponent$1.registerComponent('TrackButton', video_es_TrackButton);\n\n/**\n * @file menu-keys.js\n */\n\n/**\n * All keys used for operation of a menu (`MenuButton`, `Menu`, and `MenuItem`)\n * Note that 'Enter' and 'Space' are not included here (otherwise they would\n * prevent the `MenuButton` and `MenuItem` from being keyboard-clickable)\n * @typedef MenuKeys\n * @array\n */\nvar MenuKeys = ['Tab', 'Esc', 'Up', 'Down', 'Right', 'Left'];\n\n/**\n * The component for a menu item. `<li>`\n *\n * @extends ClickableComponent\n */\n\nvar video_es_MenuItem = /*#__PURE__*/function (_ClickableComponent) {\n inheritsLoose_default()(MenuItem, _ClickableComponent);\n\n /**\n * Creates an instance of the this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n *\n */\n function MenuItem(player, options) {\n var _this;\n\n _this = _ClickableComponent.call(this, player, options) || this;\n _this.selectable = options.selectable;\n _this.isSelected_ = options.selected || false;\n _this.multiSelectable = options.multiSelectable;\n\n _this.selected(_this.isSelected_);\n\n if (_this.selectable) {\n if (_this.multiSelectable) {\n _this.el_.setAttribute('role', 'menuitemcheckbox');\n } else {\n _this.el_.setAttribute('role', 'menuitemradio');\n }\n } else {\n _this.el_.setAttribute('role', 'menuitem');\n }\n\n return _this;\n }\n /**\n * Create the `MenuItem's DOM element\n *\n * @param {string} [type=li]\n * Element's node type, not actually used, always set to `li`.\n *\n * @param {Object} [props={}]\n * An object of properties that should be set on the element\n *\n * @param {Object} [attrs={}]\n * An object of attributes that should be set on the element\n *\n * @return {Element}\n * The element that gets created.\n */\n\n\n var _proto = MenuItem.prototype;\n\n _proto.createEl = function createEl$1(type, props, attrs) {\n // The control is textual, not just an icon\n this.nonIconControl = true;\n\n var el = _ClickableComponent.prototype.createEl.call(this, 'li', video_es_assign({\n className: 'vjs-menu-item',\n tabIndex: -1\n }, props), attrs); // swap icon with menu item text.\n\n\n el.replaceChild(video_es_createEl('span', {\n className: 'vjs-menu-item-text',\n textContent: this.localize(this.options_.label)\n }), el.querySelector('.vjs-icon-placeholder'));\n return el;\n }\n /**\n * Ignore keys which are used by the menu, but pass any other ones up. See\n * {@link ClickableComponent#handleKeyDown} for instances where this is called.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n if (!MenuKeys.some(function (key) {\n return keycode_default.a.isEventKey(event, key);\n })) {\n // Pass keydown handling up for unused keys\n _ClickableComponent.prototype.handleKeyDown.call(this, event);\n }\n }\n /**\n * Any click on a `MenuItem` puts it into the selected state.\n * See {@link ClickableComponent#handleClick} for instances where this is called.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n this.selected(true);\n }\n /**\n * Set the state for this menu item as selected or not.\n *\n * @param {boolean} selected\n * if the menu item is selected or not\n */\n ;\n\n _proto.selected = function selected(_selected) {\n if (this.selectable) {\n if (_selected) {\n this.addClass('vjs-selected');\n this.el_.setAttribute('aria-checked', 'true'); // aria-checked isn't fully supported by browsers/screen readers,\n // so indicate selected state to screen reader in the control text.\n\n this.controlText(', selected');\n this.isSelected_ = true;\n } else {\n this.removeClass('vjs-selected');\n this.el_.setAttribute('aria-checked', 'false'); // Indicate un-selected state to screen reader\n\n this.controlText('');\n this.isSelected_ = false;\n }\n }\n };\n\n return MenuItem;\n}(video_es_ClickableComponent);\n\nComponent$1.registerComponent('MenuItem', video_es_MenuItem);\n\n/**\n * The specific menu item type for selecting a language within a text track kind\n *\n * @extends MenuItem\n */\n\nvar video_es_TextTrackMenuItem = /*#__PURE__*/function (_MenuItem) {\n inheritsLoose_default()(TextTrackMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TextTrackMenuItem(player, options) {\n var _this;\n\n var track = options.track;\n var tracks = player.textTracks(); // Modify options for parent MenuItem class's init.\n\n options.label = track.label || track.language || 'Unknown';\n options.selected = track.mode === 'showing';\n _this = _MenuItem.call(this, player, options) || this;\n _this.track = track; // Determine the relevant kind(s) of tracks for this component and filter\n // out empty kinds.\n\n _this.kinds = (options.kinds || [options.kind || _this.track.kind]).filter(Boolean);\n\n var changeHandler = function changeHandler() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this.handleTracksChange.apply(assertThisInitialized_default()(_this), args);\n };\n\n var selectedLanguageChangeHandler = function selectedLanguageChangeHandler() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this.handleSelectedLanguageChange.apply(assertThisInitialized_default()(_this), args);\n };\n\n player.on(['loadstart', 'texttrackchange'], changeHandler);\n tracks.addEventListener('change', changeHandler);\n tracks.addEventListener('selectedlanguagechange', selectedLanguageChangeHandler);\n\n _this.on('dispose', function () {\n player.off(['loadstart', 'texttrackchange'], changeHandler);\n tracks.removeEventListener('change', changeHandler);\n tracks.removeEventListener('selectedlanguagechange', selectedLanguageChangeHandler);\n }); // iOS7 doesn't dispatch change events to TextTrackLists when an\n // associated track's mode changes. Without something like\n // Object.observe() (also not present on iOS7), it's not\n // possible to detect changes to the mode attribute and polyfill\n // the change event. As a poor substitute, we manually dispatch\n // change events whenever the controls modify the mode.\n\n\n if (tracks.onchange === undefined) {\n var event;\n\n _this.on(['tap', 'click'], function () {\n if (typeof window_default.a.Event !== 'object') {\n // Android 2.3 throws an Illegal Constructor error for window.Event\n try {\n event = new window_default.a.Event('change');\n } catch (err) {// continue regardless of error\n }\n }\n\n if (!event) {\n event = document_default.a.createEvent('Event');\n event.initEvent('change', true, true);\n }\n\n tracks.dispatchEvent(event);\n });\n } // set the default state based on current tracks\n\n\n _this.handleTracksChange();\n\n return _this;\n }\n /**\n * This gets called when an `TextTrackMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} event\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = TextTrackMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n var referenceTrack = this.track;\n var tracks = this.player_.textTracks();\n\n _MenuItem.prototype.handleClick.call(this, event);\n\n if (!tracks) {\n return;\n }\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i]; // If the track from the text tracks list is not of the right kind,\n // skip it. We do not want to affect tracks of incompatible kind(s).\n\n if (this.kinds.indexOf(track.kind) === -1) {\n continue;\n } // If this text track is the component's track and it is not showing,\n // set it to showing.\n\n\n if (track === referenceTrack) {\n if (track.mode !== 'showing') {\n track.mode = 'showing';\n } // If this text track is not the component's track and it is not\n // disabled, set it to disabled.\n\n } else if (track.mode !== 'disabled') {\n track.mode = 'disabled';\n }\n }\n }\n /**\n * Handle text track list change\n *\n * @param {EventTarget~Event} event\n * The `change` event that caused this function to be called.\n *\n * @listens TextTrackList#change\n */\n ;\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n var shouldBeSelected = this.track.mode === 'showing'; // Prevent redundant selected() calls because they may cause\n // screen readers to read the appended control text unnecessarily\n\n if (shouldBeSelected !== this.isSelected_) {\n this.selected(shouldBeSelected);\n }\n };\n\n _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event) {\n if (this.track.mode === 'showing') {\n var selectedLanguage = this.player_.cache_.selectedLanguage; // Don't replace the kind of track across the same language\n\n if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {\n return;\n }\n\n this.player_.cache_.selectedLanguage = {\n enabled: true,\n language: this.track.language,\n kind: this.track.kind\n };\n }\n };\n\n _proto.dispose = function dispose() {\n // remove reference to track object on dispose\n this.track = null;\n\n _MenuItem.prototype.dispose.call(this);\n };\n\n return TextTrackMenuItem;\n}(video_es_MenuItem);\n\nComponent$1.registerComponent('TextTrackMenuItem', video_es_TextTrackMenuItem);\n\n/**\n * A special menu item for turning of a specific type of text track\n *\n * @extends TextTrackMenuItem\n */\n\nvar video_es_OffTextTrackMenuItem = /*#__PURE__*/function (_TextTrackMenuItem) {\n inheritsLoose_default()(OffTextTrackMenuItem, _TextTrackMenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function OffTextTrackMenuItem(player, options) {\n // Create pseudo track info\n // Requires options['kind']\n options.track = {\n player: player,\n // it is no longer necessary to store `kind` or `kinds` on the track itself\n // since they are now stored in the `kinds` property of all instances of\n // TextTrackMenuItem, but this will remain for backwards compatibility\n kind: options.kind,\n kinds: options.kinds,\n \"default\": false,\n mode: 'disabled'\n };\n\n if (!options.kinds) {\n options.kinds = [options.kind];\n }\n\n if (options.label) {\n options.track.label = options.label;\n } else {\n options.track.label = options.kinds.join(' and ') + ' off';\n } // MenuItem is selectable\n\n\n options.selectable = true; // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n\n options.multiSelectable = false;\n return _TextTrackMenuItem.call(this, player, options) || this;\n }\n /**\n * Handle text track change\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run\n */\n\n\n var _proto = OffTextTrackMenuItem.prototype;\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n var tracks = this.player().textTracks();\n var shouldBeSelected = true;\n\n for (var i = 0, l = tracks.length; i < l; i++) {\n var track = tracks[i];\n\n if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === 'showing') {\n shouldBeSelected = false;\n break;\n }\n } // Prevent redundant selected() calls because they may cause\n // screen readers to read the appended control text unnecessarily\n\n\n if (shouldBeSelected !== this.isSelected_) {\n this.selected(shouldBeSelected);\n }\n };\n\n _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event) {\n var tracks = this.player().textTracks();\n var allHidden = true;\n\n for (var i = 0, l = tracks.length; i < l; i++) {\n var track = tracks[i];\n\n if (['captions', 'descriptions', 'subtitles'].indexOf(track.kind) > -1 && track.mode === 'showing') {\n allHidden = false;\n break;\n }\n }\n\n if (allHidden) {\n this.player_.cache_.selectedLanguage = {\n enabled: false\n };\n }\n };\n\n return OffTextTrackMenuItem;\n}(video_es_TextTrackMenuItem);\n\nComponent$1.registerComponent('OffTextTrackMenuItem', video_es_OffTextTrackMenuItem);\n\n/**\n * The base class for buttons that toggle specific text track types (e.g. subtitles)\n *\n * @extends MenuButton\n */\n\nvar video_es_TextTrackButton = /*#__PURE__*/function (_TrackButton) {\n inheritsLoose_default()(TextTrackButton, _TrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function TextTrackButton(player, options) {\n if (options === void 0) {\n options = {};\n }\n\n options.tracks = player.textTracks();\n return _TrackButton.call(this, player, options) || this;\n }\n /**\n * Create a menu item for each text track\n *\n * @param {TextTrackMenuItem[]} [items=[]]\n * Existing array of items to use during creation\n *\n * @return {TextTrackMenuItem[]}\n * Array of menu items that were created\n */\n\n\n var _proto = TextTrackButton.prototype;\n\n _proto.createItems = function createItems(items, TrackMenuItem) {\n if (items === void 0) {\n items = [];\n }\n\n if (TrackMenuItem === void 0) {\n TrackMenuItem = video_es_TextTrackMenuItem;\n }\n\n // Label is an override for the [track] off label\n // USed to localise captions/subtitles\n var label;\n\n if (this.label_) {\n label = this.label_ + \" off\";\n } // Add an OFF menu item to turn all tracks off\n\n\n items.push(new video_es_OffTextTrackMenuItem(this.player_, {\n kinds: this.kinds_,\n kind: this.kind_,\n label: label\n }));\n this.hideThreshold_ += 1;\n var tracks = this.player_.textTracks();\n\n if (!Array.isArray(this.kinds_)) {\n this.kinds_ = [this.kind_];\n }\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i]; // only add tracks that are of an appropriate kind and have a label\n\n if (this.kinds_.indexOf(track.kind) > -1) {\n var item = new TrackMenuItem(this.player_, {\n track: track,\n kinds: this.kinds_,\n kind: this.kind_,\n // MenuItem is selectable\n selectable: true,\n // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n multiSelectable: false\n });\n item.addClass(\"vjs-\" + track.kind + \"-menu-item\");\n items.push(item);\n }\n }\n\n return items;\n };\n\n return TextTrackButton;\n}(video_es_TrackButton);\n\nComponent$1.registerComponent('TextTrackButton', video_es_TextTrackButton);\n\n/**\n * The chapter track menu item\n *\n * @extends MenuItem\n */\n\nvar video_es_ChaptersTrackMenuItem = /*#__PURE__*/function (_MenuItem) {\n inheritsLoose_default()(ChaptersTrackMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ChaptersTrackMenuItem(player, options) {\n var _this;\n\n var track = options.track;\n var cue = options.cue;\n var currentTime = player.currentTime(); // Modify options for parent MenuItem class's init.\n\n options.selectable = true;\n options.multiSelectable = false;\n options.label = cue.text;\n options.selected = cue.startTime <= currentTime && currentTime < cue.endTime;\n _this = _MenuItem.call(this, player, options) || this;\n _this.track = track;\n _this.cue = cue;\n track.addEventListener('cuechange', bind(assertThisInitialized_default()(_this), _this.update));\n return _this;\n }\n /**\n * This gets called when an `ChaptersTrackMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = ChaptersTrackMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n _MenuItem.prototype.handleClick.call(this);\n\n this.player_.currentTime(this.cue.startTime);\n this.update(this.cue.startTime);\n }\n /**\n * Update chapter menu item\n *\n * @param {EventTarget~Event} [event]\n * The `cuechange` event that caused this function to run.\n *\n * @listens TextTrack#cuechange\n */\n ;\n\n _proto.update = function update(event) {\n var cue = this.cue;\n var currentTime = this.player_.currentTime(); // vjs.log(currentTime, cue.startTime);\n\n this.selected(cue.startTime <= currentTime && currentTime < cue.endTime);\n };\n\n return ChaptersTrackMenuItem;\n}(video_es_MenuItem);\n\nComponent$1.registerComponent('ChaptersTrackMenuItem', video_es_ChaptersTrackMenuItem);\n\n/**\n * The button component for toggling and selecting chapters\n * Chapters act much differently than other text tracks\n * Cues are navigation vs. other tracks of alternative languages\n *\n * @extends TextTrackButton\n */\n\nvar video_es_ChaptersButton = /*#__PURE__*/function (_TextTrackButton) {\n inheritsLoose_default()(ChaptersButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this function is ready.\n */\n function ChaptersButton(player, options, ready) {\n return _TextTrackButton.call(this, player, options, ready) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = ChaptersButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-chapters-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-chapters-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n }\n /**\n * Update the menu based on the current state of its items.\n *\n * @param {EventTarget~Event} [event]\n * An event that triggered this function to run.\n *\n * @listens TextTrackList#addtrack\n * @listens TextTrackList#removetrack\n * @listens TextTrackList#change\n */\n ;\n\n _proto.update = function update(event) {\n if (!this.track_ || event && (event.type === 'addtrack' || event.type === 'removetrack')) {\n this.setTrack(this.findChaptersTrack());\n }\n\n _TextTrackButton.prototype.update.call(this);\n }\n /**\n * Set the currently selected track for the chapters button.\n *\n * @param {TextTrack} track\n * The new track to select. Nothing will change if this is the currently selected\n * track.\n */\n ;\n\n _proto.setTrack = function setTrack(track) {\n if (this.track_ === track) {\n return;\n }\n\n if (!this.updateHandler_) {\n this.updateHandler_ = this.update.bind(this);\n } // here this.track_ refers to the old track instance\n\n\n if (this.track_) {\n var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);\n\n if (remoteTextTrackEl) {\n remoteTextTrackEl.removeEventListener('load', this.updateHandler_);\n }\n\n this.track_ = null;\n }\n\n this.track_ = track; // here this.track_ refers to the new track instance\n\n if (this.track_) {\n this.track_.mode = 'hidden';\n\n var _remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);\n\n if (_remoteTextTrackEl) {\n _remoteTextTrackEl.addEventListener('load', this.updateHandler_);\n }\n }\n }\n /**\n * Find the track object that is currently in use by this ChaptersButton\n *\n * @return {TextTrack|undefined}\n * The current track or undefined if none was found.\n */\n ;\n\n _proto.findChaptersTrack = function findChaptersTrack() {\n var tracks = this.player_.textTracks() || [];\n\n for (var i = tracks.length - 1; i >= 0; i--) {\n // We will always choose the last track as our chaptersTrack\n var track = tracks[i];\n\n if (track.kind === this.kind_) {\n return track;\n }\n }\n }\n /**\n * Get the caption for the ChaptersButton based on the track label. This will also\n * use the current tracks localized kind as a fallback if a label does not exist.\n *\n * @return {string}\n * The tracks current label or the localized track kind.\n */\n ;\n\n _proto.getMenuCaption = function getMenuCaption() {\n if (this.track_ && this.track_.label) {\n return this.track_.label;\n }\n\n return this.localize(toTitleCase$1(this.kind_));\n }\n /**\n * Create menu from chapter track\n *\n * @return {Menu}\n * New menu for the chapter buttons\n */\n ;\n\n _proto.createMenu = function createMenu() {\n this.options_.title = this.getMenuCaption();\n return _TextTrackButton.prototype.createMenu.call(this);\n }\n /**\n * Create a menu item for each text track\n *\n * @return {TextTrackMenuItem[]}\n * Array of menu items\n */\n ;\n\n _proto.createItems = function createItems() {\n var items = [];\n\n if (!this.track_) {\n return items;\n }\n\n var cues = this.track_.cues;\n\n if (!cues) {\n return items;\n }\n\n for (var i = 0, l = cues.length; i < l; i++) {\n var cue = cues[i];\n var mi = new video_es_ChaptersTrackMenuItem(this.player_, {\n track: this.track_,\n cue: cue\n });\n items.push(mi);\n }\n\n return items;\n };\n\n return ChaptersButton;\n}(video_es_TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_ChaptersButton.prototype.kind_ = 'chapters';\n/**\n * The text that should display over the `ChaptersButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nvideo_es_ChaptersButton.prototype.controlText_ = 'Chapters';\nComponent$1.registerComponent('ChaptersButton', video_es_ChaptersButton);\n\n/**\n * The button component for toggling and selecting descriptions\n *\n * @extends TextTrackButton\n */\n\nvar video_es_DescriptionsButton = /*#__PURE__*/function (_TextTrackButton) {\n inheritsLoose_default()(DescriptionsButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this component is ready.\n */\n function DescriptionsButton(player, options, ready) {\n var _this;\n\n _this = _TextTrackButton.call(this, player, options, ready) || this;\n var tracks = player.textTracks();\n var changeHandler = bind(assertThisInitialized_default()(_this), _this.handleTracksChange);\n tracks.addEventListener('change', changeHandler);\n\n _this.on('dispose', function () {\n tracks.removeEventListener('change', changeHandler);\n });\n\n return _this;\n }\n /**\n * Handle text track change\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to run\n *\n * @listens TextTrackList#change\n */\n\n\n var _proto = DescriptionsButton.prototype;\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n var tracks = this.player().textTracks();\n var disabled = false; // Check whether a track of a different kind is showing\n\n for (var i = 0, l = tracks.length; i < l; i++) {\n var track = tracks[i];\n\n if (track.kind !== this.kind_ && track.mode === 'showing') {\n disabled = true;\n break;\n }\n } // If another track is showing, disable this menu button\n\n\n if (disabled) {\n this.disable();\n } else {\n this.enable();\n }\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n ;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-descriptions-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-descriptions-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n\n return DescriptionsButton;\n}(video_es_TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_DescriptionsButton.prototype.kind_ = 'descriptions';\n/**\n * The text that should display over the `DescriptionsButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nvideo_es_DescriptionsButton.prototype.controlText_ = 'Descriptions';\nComponent$1.registerComponent('DescriptionsButton', video_es_DescriptionsButton);\n\n/**\n * The button component for toggling and selecting subtitles\n *\n * @extends TextTrackButton\n */\n\nvar video_es_SubtitlesButton = /*#__PURE__*/function (_TextTrackButton) {\n inheritsLoose_default()(SubtitlesButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this component is ready.\n */\n function SubtitlesButton(player, options, ready) {\n return _TextTrackButton.call(this, player, options, ready) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = SubtitlesButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-subtitles-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-subtitles-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n };\n\n return SubtitlesButton;\n}(video_es_TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_SubtitlesButton.prototype.kind_ = 'subtitles';\n/**\n * The text that should display over the `SubtitlesButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nvideo_es_SubtitlesButton.prototype.controlText_ = 'Subtitles';\nComponent$1.registerComponent('SubtitlesButton', video_es_SubtitlesButton);\n\n/**\n * The menu item for caption track settings menu\n *\n * @extends TextTrackMenuItem\n */\n\nvar video_es_CaptionSettingsMenuItem = /*#__PURE__*/function (_TextTrackMenuItem) {\n inheritsLoose_default()(CaptionSettingsMenuItem, _TextTrackMenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function CaptionSettingsMenuItem(player, options) {\n var _this;\n\n options.track = {\n player: player,\n kind: options.kind,\n label: options.kind + ' settings',\n selectable: false,\n \"default\": false,\n mode: 'disabled'\n }; // CaptionSettingsMenuItem has no concept of 'selected'\n\n options.selectable = false;\n options.name = 'CaptionSettingsMenuItem';\n _this = _TextTrackMenuItem.call(this, player, options) || this;\n\n _this.addClass('vjs-texttrack-settings');\n\n _this.controlText(', opens ' + options.kind + ' settings dialog');\n\n return _this;\n }\n /**\n * This gets called when an `CaptionSettingsMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = CaptionSettingsMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n this.player().getChild('textTrackSettings').open();\n };\n\n return CaptionSettingsMenuItem;\n}(video_es_TextTrackMenuItem);\n\nComponent$1.registerComponent('CaptionSettingsMenuItem', video_es_CaptionSettingsMenuItem);\n\n/**\n * The button component for toggling and selecting captions\n *\n * @extends TextTrackButton\n */\n\nvar video_es_CaptionsButton = /*#__PURE__*/function (_TextTrackButton) {\n inheritsLoose_default()(CaptionsButton, _TextTrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} [ready]\n * The function to call when this component is ready.\n */\n function CaptionsButton(player, options, ready) {\n return _TextTrackButton.call(this, player, options, ready) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = CaptionsButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-captions-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-captions-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n }\n /**\n * Create caption menu items\n *\n * @return {CaptionSettingsMenuItem[]}\n * The array of current menu items.\n */\n ;\n\n _proto.createItems = function createItems() {\n var items = [];\n\n if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild('textTrackSettings')) {\n items.push(new video_es_CaptionSettingsMenuItem(this.player_, {\n kind: this.kind_\n }));\n this.hideThreshold_ += 1;\n }\n\n return _TextTrackButton.prototype.createItems.call(this, items);\n };\n\n return CaptionsButton;\n}(video_es_TextTrackButton);\n/**\n * `kind` of TextTrack to look for to associate it with this menu.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_CaptionsButton.prototype.kind_ = 'captions';\n/**\n * The text that should display over the `CaptionsButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\nvideo_es_CaptionsButton.prototype.controlText_ = 'Captions';\nComponent$1.registerComponent('CaptionsButton', video_es_CaptionsButton);\n\n/**\n * SubsCapsMenuItem has an [cc] icon to distinguish captions from subtitles\n * in the SubsCapsMenu.\n *\n * @extends TextTrackMenuItem\n */\n\nvar video_es_SubsCapsMenuItem = /*#__PURE__*/function (_TextTrackMenuItem) {\n inheritsLoose_default()(SubsCapsMenuItem, _TextTrackMenuItem);\n\n function SubsCapsMenuItem() {\n return _TextTrackMenuItem.apply(this, arguments) || this;\n }\n\n var _proto = SubsCapsMenuItem.prototype;\n\n _proto.createEl = function createEl$1(type, props, attrs) {\n var el = _TextTrackMenuItem.prototype.createEl.call(this, type, props, attrs);\n\n var parentSpan = el.querySelector('.vjs-menu-item-text');\n\n if (this.options_.track.kind === 'captions') {\n parentSpan.appendChild(video_es_createEl('span', {\n className: 'vjs-icon-placeholder'\n }, {\n 'aria-hidden': true\n }));\n parentSpan.appendChild(video_es_createEl('span', {\n className: 'vjs-control-text',\n // space added as the text will visually flow with the\n // label\n textContent: \" \" + this.localize('Captions')\n }));\n }\n\n return el;\n };\n\n return SubsCapsMenuItem;\n}(video_es_TextTrackMenuItem);\n\nComponent$1.registerComponent('SubsCapsMenuItem', video_es_SubsCapsMenuItem);\n\n/**\n * The button component for toggling and selecting captions and/or subtitles\n *\n * @extends TextTrackButton\n */\n\nvar video_es_SubsCapsButton = /*#__PURE__*/function (_TextTrackButton) {\n inheritsLoose_default()(SubsCapsButton, _TextTrackButton);\n\n function SubsCapsButton(player, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _TextTrackButton.call(this, player, options) || this; // Although North America uses \"captions\" in most cases for\n // \"captions and subtitles\" other locales use \"subtitles\"\n\n _this.label_ = 'subtitles';\n\n if (['en', 'en-us', 'en-ca', 'fr-ca'].indexOf(_this.player_.language_) > -1) {\n _this.label_ = 'captions';\n }\n\n _this.menuButton_.controlText(toTitleCase$1(_this.label_));\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = SubsCapsButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-subs-caps-button \" + _TextTrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-subs-caps-button \" + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);\n }\n /**\n * Create caption/subtitles menu items\n *\n * @return {CaptionSettingsMenuItem[]}\n * The array of current menu items.\n */\n ;\n\n _proto.createItems = function createItems() {\n var items = [];\n\n if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild('textTrackSettings')) {\n items.push(new video_es_CaptionSettingsMenuItem(this.player_, {\n kind: this.label_\n }));\n this.hideThreshold_ += 1;\n }\n\n items = _TextTrackButton.prototype.createItems.call(this, items, video_es_SubsCapsMenuItem);\n return items;\n };\n\n return SubsCapsButton;\n}(video_es_TextTrackButton);\n/**\n * `kind`s of TextTrack to look for to associate it with this menu.\n *\n * @type {array}\n * @private\n */\n\n\nvideo_es_SubsCapsButton.prototype.kinds_ = ['captions', 'subtitles'];\n/**\n * The text that should display over the `SubsCapsButton`s controls.\n *\n *\n * @type {string}\n * @private\n */\n\nvideo_es_SubsCapsButton.prototype.controlText_ = 'Subtitles';\nComponent$1.registerComponent('SubsCapsButton', video_es_SubsCapsButton);\n\n/**\n * An {@link AudioTrack} {@link MenuItem}\n *\n * @extends MenuItem\n */\n\nvar video_es_AudioTrackMenuItem = /*#__PURE__*/function (_MenuItem) {\n inheritsLoose_default()(AudioTrackMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function AudioTrackMenuItem(player, options) {\n var _this;\n\n var track = options.track;\n var tracks = player.audioTracks(); // Modify options for parent MenuItem class's init.\n\n options.label = track.label || track.language || 'Unknown';\n options.selected = track.enabled;\n _this = _MenuItem.call(this, player, options) || this;\n _this.track = track;\n\n _this.addClass(\"vjs-\" + track.kind + \"-menu-item\");\n\n var changeHandler = function changeHandler() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this.handleTracksChange.apply(assertThisInitialized_default()(_this), args);\n };\n\n tracks.addEventListener('change', changeHandler);\n\n _this.on('dispose', function () {\n tracks.removeEventListener('change', changeHandler);\n });\n\n return _this;\n }\n\n var _proto = AudioTrackMenuItem.prototype;\n\n _proto.createEl = function createEl(type, props, attrs) {\n var el = _MenuItem.prototype.createEl.call(this, type, props, attrs);\n\n var parentSpan = el.querySelector('.vjs-menu-item-text');\n\n if (this.options_.track.kind === 'main-desc') {\n parentSpan.appendChild(_MenuItem.prototype.createEl.call(this, 'span', {\n className: 'vjs-icon-placeholder'\n }, {\n 'aria-hidden': true\n }));\n parentSpan.appendChild(_MenuItem.prototype.createEl.call(this, 'span', {\n className: 'vjs-control-text',\n textContent: this.localize('Descriptions')\n }));\n }\n\n return el;\n }\n /**\n * This gets called when an `AudioTrackMenuItem is \"clicked\". See {@link ClickableComponent}\n * for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n _MenuItem.prototype.handleClick.call(this, event); // the audio track list will automatically toggle other tracks\n // off for us.\n\n\n this.track.enabled = true;\n }\n /**\n * Handle any {@link AudioTrack} change.\n *\n * @param {EventTarget~Event} [event]\n * The {@link AudioTrackList#change} event that caused this to run.\n *\n * @listens AudioTrackList#change\n */\n ;\n\n _proto.handleTracksChange = function handleTracksChange(event) {\n this.selected(this.track.enabled);\n };\n\n return AudioTrackMenuItem;\n}(video_es_MenuItem);\n\nComponent$1.registerComponent('AudioTrackMenuItem', video_es_AudioTrackMenuItem);\n\n/**\n * The base class for buttons that toggle specific {@link AudioTrack} types.\n *\n * @extends TrackButton\n */\n\nvar video_es_AudioTrackButton = /*#__PURE__*/function (_TrackButton) {\n inheritsLoose_default()(AudioTrackButton, _TrackButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options={}]\n * The key/value store of player options.\n */\n function AudioTrackButton(player, options) {\n if (options === void 0) {\n options = {};\n }\n\n options.tracks = player.audioTracks();\n return _TrackButton.call(this, player, options) || this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n\n\n var _proto = AudioTrackButton.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-audio-button \" + _TrackButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-audio-button \" + _TrackButton.prototype.buildWrapperCSSClass.call(this);\n }\n /**\n * Create a menu item for each audio track\n *\n * @param {AudioTrackMenuItem[]} [items=[]]\n * An array of existing menu items to use.\n *\n * @return {AudioTrackMenuItem[]}\n * An array of menu items\n */\n ;\n\n _proto.createItems = function createItems(items) {\n if (items === void 0) {\n items = [];\n }\n\n // if there's only one audio track, there no point in showing it\n this.hideThreshold_ = 1;\n var tracks = this.player_.audioTracks();\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n items.push(new video_es_AudioTrackMenuItem(this.player_, {\n track: track,\n // MenuItem is selectable\n selectable: true,\n // MenuItem is NOT multiSelectable (i.e. only one can be marked \"selected\" at a time)\n multiSelectable: false\n }));\n }\n\n return items;\n };\n\n return AudioTrackButton;\n}(video_es_TrackButton);\n/**\n * The text that should display over the `AudioTrackButton`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_AudioTrackButton.prototype.controlText_ = 'Audio Track';\nComponent$1.registerComponent('AudioTrackButton', video_es_AudioTrackButton);\n\n/**\n * The specific menu item type for selecting a playback rate.\n *\n * @extends MenuItem\n */\n\nvar video_es_PlaybackRateMenuItem = /*#__PURE__*/function (_MenuItem) {\n inheritsLoose_default()(PlaybackRateMenuItem, _MenuItem);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function PlaybackRateMenuItem(player, options) {\n var _this;\n\n var label = options.rate;\n var rate = parseFloat(label, 10); // Modify options for parent MenuItem class's init.\n\n options.label = label;\n options.selected = rate === player.playbackRate();\n options.selectable = true;\n options.multiSelectable = false;\n _this = _MenuItem.call(this, player, options) || this;\n _this.label = label;\n _this.rate = rate;\n\n _this.on(player, 'ratechange', function (e) {\n return _this.update(e);\n });\n\n return _this;\n }\n /**\n * This gets called when an `PlaybackRateMenuItem` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n\n\n var _proto = PlaybackRateMenuItem.prototype;\n\n _proto.handleClick = function handleClick(event) {\n _MenuItem.prototype.handleClick.call(this);\n\n this.player().playbackRate(this.rate);\n }\n /**\n * Update the PlaybackRateMenuItem when the playbackrate changes.\n *\n * @param {EventTarget~Event} [event]\n * The `ratechange` event that caused this function to run.\n *\n * @listens Player#ratechange\n */\n ;\n\n _proto.update = function update(event) {\n this.selected(this.player().playbackRate() === this.rate);\n };\n\n return PlaybackRateMenuItem;\n}(video_es_MenuItem);\n/**\n * The text that should display over the `PlaybackRateMenuItem`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_PlaybackRateMenuItem.prototype.contentElType = 'button';\nComponent$1.registerComponent('PlaybackRateMenuItem', video_es_PlaybackRateMenuItem);\n\n/**\n * The component for controlling the playback rate.\n *\n * @extends MenuButton\n */\n\nvar video_es_PlaybackRateMenuButton = /*#__PURE__*/function (_MenuButton) {\n inheritsLoose_default()(PlaybackRateMenuButton, _MenuButton);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function PlaybackRateMenuButton(player, options) {\n var _this;\n\n _this = _MenuButton.call(this, player, options) || this;\n\n _this.menuButton_.el_.setAttribute('aria-describedby', _this.labelElId_);\n\n _this.updateVisibility();\n\n _this.updateLabel();\n\n _this.on(player, 'loadstart', function (e) {\n return _this.updateVisibility(e);\n });\n\n _this.on(player, 'ratechange', function (e) {\n return _this.updateLabel(e);\n });\n\n _this.on(player, 'playbackrateschange', function (e) {\n return _this.handlePlaybackRateschange(e);\n });\n\n return _this;\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n var _proto = PlaybackRateMenuButton.prototype;\n\n _proto.createEl = function createEl$1() {\n var el = _MenuButton.prototype.createEl.call(this);\n\n this.labelElId_ = 'vjs-playback-rate-value-label-' + this.id_;\n this.labelEl_ = video_es_createEl('div', {\n className: 'vjs-playback-rate-value',\n id: this.labelElId_,\n textContent: '1x'\n });\n el.appendChild(this.labelEl_);\n return el;\n };\n\n _proto.dispose = function dispose() {\n this.labelEl_ = null;\n\n _MenuButton.prototype.dispose.call(this);\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n ;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-playback-rate \" + _MenuButton.prototype.buildCSSClass.call(this);\n };\n\n _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {\n return \"vjs-playback-rate \" + _MenuButton.prototype.buildWrapperCSSClass.call(this);\n }\n /**\n * Create the list of menu items. Specific to each subclass.\n *\n */\n ;\n\n _proto.createItems = function createItems() {\n var rates = this.playbackRates();\n var items = [];\n\n for (var i = rates.length - 1; i >= 0; i--) {\n items.push(new video_es_PlaybackRateMenuItem(this.player(), {\n rate: rates[i] + 'x'\n }));\n }\n\n return items;\n }\n /**\n * Updates ARIA accessibility attributes\n */\n ;\n\n _proto.updateARIAAttributes = function updateARIAAttributes() {\n // Current playback rate\n this.el().setAttribute('aria-valuenow', this.player().playbackRate());\n }\n /**\n * This gets called when an `PlaybackRateMenuButton` is \"clicked\". See\n * {@link ClickableComponent} for more detailed information on what a click can be.\n *\n * @param {EventTarget~Event} [event]\n * The `keydown`, `tap`, or `click` event that caused this function to be\n * called.\n *\n * @listens tap\n * @listens click\n */\n ;\n\n _proto.handleClick = function handleClick(event) {\n // select next rate option\n var currentRate = this.player().playbackRate();\n var rates = this.playbackRates(); // this will select first one if the last one currently selected\n\n var newRate = rates[0];\n\n for (var i = 0; i < rates.length; i++) {\n if (rates[i] > currentRate) {\n newRate = rates[i];\n break;\n }\n }\n\n this.player().playbackRate(newRate);\n }\n /**\n * On playbackrateschange, update the menu to account for the new items.\n *\n * @listens Player#playbackrateschange\n */\n ;\n\n _proto.handlePlaybackRateschange = function handlePlaybackRateschange(event) {\n this.update();\n }\n /**\n * Get possible playback rates\n *\n * @return {Array}\n * All possible playback rates\n */\n ;\n\n _proto.playbackRates = function playbackRates() {\n var player = this.player();\n return player.playbackRates && player.playbackRates() || [];\n }\n /**\n * Get whether playback rates is supported by the tech\n * and an array of playback rates exists\n *\n * @return {boolean}\n * Whether changing playback rate is supported\n */\n ;\n\n _proto.playbackRateSupported = function playbackRateSupported() {\n return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;\n }\n /**\n * Hide playback rate controls when they're no playback rate options to select\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#loadstart\n */\n ;\n\n _proto.updateVisibility = function updateVisibility(event) {\n if (this.playbackRateSupported()) {\n this.removeClass('vjs-hidden');\n } else {\n this.addClass('vjs-hidden');\n }\n }\n /**\n * Update button label when rate changed\n *\n * @param {EventTarget~Event} [event]\n * The event that caused this function to run.\n *\n * @listens Player#ratechange\n */\n ;\n\n _proto.updateLabel = function updateLabel(event) {\n if (this.playbackRateSupported()) {\n this.labelEl_.textContent = this.player().playbackRate() + 'x';\n }\n };\n\n return PlaybackRateMenuButton;\n}(video_es_MenuButton);\n/**\n * The text that should display over the `FullscreenToggle`s controls. Added for localization.\n *\n * @type {string}\n * @private\n */\n\n\nvideo_es_PlaybackRateMenuButton.prototype.controlText_ = 'Playback Rate';\nComponent$1.registerComponent('PlaybackRateMenuButton', video_es_PlaybackRateMenuButton);\n\n/**\n * Just an empty spacer element that can be used as an append point for plugins, etc.\n * Also can be used to create space between elements when necessary.\n *\n * @extends Component\n */\n\nvar video_es_Spacer = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(Spacer, _Component);\n\n function Spacer() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = Spacer.prototype;\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-spacer \" + _Component.prototype.buildCSSClass.call(this);\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n ;\n\n _proto.createEl = function createEl(tag, props, attributes) {\n if (tag === void 0) {\n tag = 'div';\n }\n\n if (props === void 0) {\n props = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n if (!props.className) {\n props.className = this.buildCSSClass();\n }\n\n return _Component.prototype.createEl.call(this, tag, props, attributes);\n };\n\n return Spacer;\n}(Component$1);\n\nComponent$1.registerComponent('Spacer', video_es_Spacer);\n\n/**\n * Spacer specifically meant to be used as an insertion point for new plugins, etc.\n *\n * @extends Spacer\n */\n\nvar video_es_CustomControlSpacer = /*#__PURE__*/function (_Spacer) {\n inheritsLoose_default()(CustomControlSpacer, _Spacer);\n\n function CustomControlSpacer() {\n return _Spacer.apply(this, arguments) || this;\n }\n\n var _proto = CustomControlSpacer.prototype;\n\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-custom-control-spacer \" + _Spacer.prototype.buildCSSClass.call(this);\n }\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n ;\n\n _proto.createEl = function createEl() {\n return _Spacer.prototype.createEl.call(this, 'div', {\n className: this.buildCSSClass(),\n // No-flex/table-cell mode requires there be some content\n // in the cell to fill the remaining space of the table.\n textContent: \"\\xA0\"\n });\n };\n\n return CustomControlSpacer;\n}(video_es_Spacer);\n\nComponent$1.registerComponent('CustomControlSpacer', video_es_CustomControlSpacer);\n\n/**\n * Container of main controls.\n *\n * @extends Component\n */\n\nvar video_es_ControlBar = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(ControlBar, _Component);\n\n function ControlBar() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = ControlBar.prototype;\n\n /**\n * Create the `Component`'s DOM element\n *\n * @return {Element}\n * The element that was created.\n */\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: 'vjs-control-bar',\n dir: 'ltr'\n });\n };\n\n return ControlBar;\n}(Component$1);\n/**\n * Default options for `ControlBar`\n *\n * @type {Object}\n * @private\n */\n\n\nvideo_es_ControlBar.prototype.options_ = {\n children: ['playToggle', 'volumePanel', 'currentTimeDisplay', 'timeDivider', 'durationDisplay', 'progressControl', 'liveDisplay', 'seekToLive', 'remainingTimeDisplay', 'customControlSpacer', 'playbackRateMenuButton', 'chaptersButton', 'descriptionsButton', 'subsCapsButton', 'audioTrackButton', 'fullscreenToggle']\n};\n\nif ('exitPictureInPicture' in document_default.a) {\n video_es_ControlBar.prototype.options_.children.splice(video_es_ControlBar.prototype.options_.children.length - 1, 0, 'pictureInPictureToggle');\n}\n\nComponent$1.registerComponent('ControlBar', video_es_ControlBar);\n\n/**\n * A display that indicates an error has occurred. This means that the video\n * is unplayable.\n *\n * @extends ModalDialog\n */\n\nvar video_es_ErrorDisplay = /*#__PURE__*/function (_ModalDialog) {\n inheritsLoose_default()(ErrorDisplay, _ModalDialog);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function ErrorDisplay(player, options) {\n var _this;\n\n _this = _ModalDialog.call(this, player, options) || this;\n\n _this.on(player, 'error', function (e) {\n return _this.open(e);\n });\n\n return _this;\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n *\n * @deprecated Since version 5.\n */\n\n\n var _proto = ErrorDisplay.prototype;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return \"vjs-error-display \" + _ModalDialog.prototype.buildCSSClass.call(this);\n }\n /**\n * Gets the localized error message based on the `Player`s error.\n *\n * @return {string}\n * The `Player`s error message localized or an empty string.\n */\n ;\n\n _proto.content = function content() {\n var error = this.player().error();\n return error ? this.localize(error.message) : '';\n };\n\n return ErrorDisplay;\n}(video_es_ModalDialog);\n/**\n * The default options for an `ErrorDisplay`.\n *\n * @private\n */\n\n\nvideo_es_ErrorDisplay.prototype.options_ = extends_default()({}, video_es_ModalDialog.prototype.options_, {\n pauseOnOpen: false,\n fillAlways: true,\n temporary: false,\n uncloseable: true\n});\nComponent$1.registerComponent('ErrorDisplay', video_es_ErrorDisplay);\n\nvar LOCAL_STORAGE_KEY$1 = 'vjs-text-track-settings';\nvar COLOR_BLACK = ['#000', 'Black'];\nvar COLOR_BLUE = ['#00F', 'Blue'];\nvar COLOR_CYAN = ['#0FF', 'Cyan'];\nvar COLOR_GREEN = ['#0F0', 'Green'];\nvar COLOR_MAGENTA = ['#F0F', 'Magenta'];\nvar COLOR_RED = ['#F00', 'Red'];\nvar COLOR_WHITE = ['#FFF', 'White'];\nvar COLOR_YELLOW = ['#FF0', 'Yellow'];\nvar OPACITY_OPAQUE = ['1', 'Opaque'];\nvar OPACITY_SEMI = ['0.5', 'Semi-Transparent'];\nvar OPACITY_TRANS = ['0', 'Transparent']; // Configuration for the various <select> elements in the DOM of this component.\n//\n// Possible keys include:\n//\n// `default`:\n// The default option index. Only needs to be provided if not zero.\n// `parser`:\n// A function which is used to parse the value from the selected option in\n// a customized way.\n// `selector`:\n// The selector used to find the associated <select> element.\n\nvar selectConfigs = {\n backgroundColor: {\n selector: '.vjs-bg-color > select',\n id: 'captions-background-color-%s',\n label: 'Color',\n options: [COLOR_BLACK, COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]\n },\n backgroundOpacity: {\n selector: '.vjs-bg-opacity > select',\n id: 'captions-background-opacity-%s',\n label: 'Transparency',\n options: [OPACITY_OPAQUE, OPACITY_SEMI, OPACITY_TRANS]\n },\n color: {\n selector: '.vjs-fg-color > select',\n id: 'captions-foreground-color-%s',\n label: 'Color',\n options: [COLOR_WHITE, COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]\n },\n edgeStyle: {\n selector: '.vjs-edge-style > select',\n id: '%s',\n label: 'Text Edge Style',\n options: [['none', 'None'], ['raised', 'Raised'], ['depressed', 'Depressed'], ['uniform', 'Uniform'], ['dropshadow', 'Dropshadow']]\n },\n fontFamily: {\n selector: '.vjs-font-family > select',\n id: 'captions-font-family-%s',\n label: 'Font Family',\n options: [['proportionalSansSerif', 'Proportional Sans-Serif'], ['monospaceSansSerif', 'Monospace Sans-Serif'], ['proportionalSerif', 'Proportional Serif'], ['monospaceSerif', 'Monospace Serif'], ['casual', 'Casual'], ['script', 'Script'], ['small-caps', 'Small Caps']]\n },\n fontPercent: {\n selector: '.vjs-font-percent > select',\n id: 'captions-font-size-%s',\n label: 'Font Size',\n options: [['0.50', '50%'], ['0.75', '75%'], ['1.00', '100%'], ['1.25', '125%'], ['1.50', '150%'], ['1.75', '175%'], ['2.00', '200%'], ['3.00', '300%'], ['4.00', '400%']],\n \"default\": 2,\n parser: function parser(v) {\n return v === '1.00' ? null : Number(v);\n }\n },\n textOpacity: {\n selector: '.vjs-text-opacity > select',\n id: 'captions-foreground-opacity-%s',\n label: 'Transparency',\n options: [OPACITY_OPAQUE, OPACITY_SEMI]\n },\n // Options for this object are defined below.\n windowColor: {\n selector: '.vjs-window-color > select',\n id: 'captions-window-color-%s',\n label: 'Color'\n },\n // Options for this object are defined below.\n windowOpacity: {\n selector: '.vjs-window-opacity > select',\n id: 'captions-window-opacity-%s',\n label: 'Transparency',\n options: [OPACITY_TRANS, OPACITY_SEMI, OPACITY_OPAQUE]\n }\n};\nselectConfigs.windowColor.options = selectConfigs.backgroundColor.options;\n/**\n * Get the actual value of an option.\n *\n * @param {string} value\n * The value to get\n *\n * @param {Function} [parser]\n * Optional function to adjust the value.\n *\n * @return {Mixed}\n * - Will be `undefined` if no value exists\n * - Will be `undefined` if the given value is \"none\".\n * - Will be the actual value otherwise.\n *\n * @private\n */\n\nfunction parseOptionValue(value, parser) {\n if (parser) {\n value = parser(value);\n }\n\n if (value && value !== 'none') {\n return value;\n }\n}\n/**\n * Gets the value of the selected <option> element within a <select> element.\n *\n * @param {Element} el\n * the element to look in\n *\n * @param {Function} [parser]\n * Optional function to adjust the value.\n *\n * @return {Mixed}\n * - Will be `undefined` if no value exists\n * - Will be `undefined` if the given value is \"none\".\n * - Will be the actual value otherwise.\n *\n * @private\n */\n\n\nfunction getSelectedOptionValue(el, parser) {\n var value = el.options[el.options.selectedIndex].value;\n return parseOptionValue(value, parser);\n}\n/**\n * Sets the selected <option> element within a <select> element based on a\n * given value.\n *\n * @param {Element} el\n * The element to look in.\n *\n * @param {string} value\n * the property to look on.\n *\n * @param {Function} [parser]\n * Optional function to adjust the value before comparing.\n *\n * @private\n */\n\n\nfunction setSelectedOption(el, value, parser) {\n if (!value) {\n return;\n }\n\n for (var i = 0; i < el.options.length; i++) {\n if (parseOptionValue(el.options[i].value, parser) === value) {\n el.selectedIndex = i;\n break;\n }\n }\n}\n/**\n * Manipulate Text Tracks settings.\n *\n * @extends ModalDialog\n */\n\n\nvar video_es_TextTrackSettings = /*#__PURE__*/function (_ModalDialog) {\n inheritsLoose_default()(TextTrackSettings, _ModalDialog);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n */\n function TextTrackSettings(player, options) {\n var _this;\n\n options.temporary = false;\n _this = _ModalDialog.call(this, player, options) || this;\n _this.updateDisplay = _this.updateDisplay.bind(assertThisInitialized_default()(_this)); // fill the modal and pretend we have opened it\n\n _this.fill();\n\n _this.hasBeenOpened_ = _this.hasBeenFilled_ = true;\n _this.endDialog = video_es_createEl('p', {\n className: 'vjs-control-text',\n textContent: _this.localize('End of dialog window.')\n });\n\n _this.el().appendChild(_this.endDialog);\n\n _this.setDefaults(); // Grab `persistTextTrackSettings` from the player options if not passed in child options\n\n\n if (options.persistTextTrackSettings === undefined) {\n _this.options_.persistTextTrackSettings = _this.options_.playerOptions.persistTextTrackSettings;\n }\n\n _this.on(_this.$('.vjs-done-button'), 'click', function () {\n _this.saveSettings();\n\n _this.close();\n });\n\n _this.on(_this.$('.vjs-default-button'), 'click', function () {\n _this.setDefaults();\n\n _this.updateDisplay();\n });\n\n each(selectConfigs, function (config) {\n _this.on(_this.$(config.selector), 'change', _this.updateDisplay);\n });\n\n if (_this.options_.persistTextTrackSettings) {\n _this.restoreSettings();\n }\n\n return _this;\n }\n\n var _proto = TextTrackSettings.prototype;\n\n _proto.dispose = function dispose() {\n this.endDialog = null;\n\n _ModalDialog.prototype.dispose.call(this);\n }\n /**\n * Create a <select> element with configured options.\n *\n * @param {string} key\n * Configuration key to use during creation.\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n ;\n\n _proto.createElSelect_ = function createElSelect_(key, legendId, type) {\n var _this2 = this;\n\n if (legendId === void 0) {\n legendId = '';\n }\n\n if (type === void 0) {\n type = 'label';\n }\n\n var config = selectConfigs[key];\n var id = config.id.replace('%s', this.id_);\n var selectLabelledbyIds = [legendId, id].join(' ').trim();\n return [\"<\" + type + \" id=\\\"\" + id + \"\\\" class=\\\"\" + (type === 'label' ? 'vjs-label' : '') + \"\\\">\", this.localize(config.label), \"</\" + type + \">\", \"<select aria-labelledby=\\\"\" + selectLabelledbyIds + \"\\\">\"].concat(config.options.map(function (o) {\n var optionId = id + '-' + o[1].replace(/\\W+/g, '');\n return [\"<option id=\\\"\" + optionId + \"\\\" value=\\\"\" + o[0] + \"\\\" \", \"aria-labelledby=\\\"\" + selectLabelledbyIds + \" \" + optionId + \"\\\">\", _this2.localize(o[1]), '</option>'].join('');\n })).concat('</select>').join('');\n }\n /**\n * Create foreground color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n ;\n\n _proto.createElFgColor_ = function createElFgColor_() {\n var legendId = \"captions-text-legend-\" + this.id_;\n return ['<fieldset class=\"vjs-fg-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Text'), '</legend>', this.createElSelect_('color', legendId), '<span class=\"vjs-text-opacity vjs-opacity\">', this.createElSelect_('textOpacity', legendId), '</span>', '</fieldset>'].join('');\n }\n /**\n * Create background color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n ;\n\n _proto.createElBgColor_ = function createElBgColor_() {\n var legendId = \"captions-background-\" + this.id_;\n return ['<fieldset class=\"vjs-bg-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Background'), '</legend>', this.createElSelect_('backgroundColor', legendId), '<span class=\"vjs-bg-opacity vjs-opacity\">', this.createElSelect_('backgroundOpacity', legendId), '</span>', '</fieldset>'].join('');\n }\n /**\n * Create window color element for the component\n *\n * @return {string}\n * An HTML string.\n *\n * @private\n */\n ;\n\n _proto.createElWinColor_ = function createElWinColor_() {\n var legendId = \"captions-window-\" + this.id_;\n return ['<fieldset class=\"vjs-window-color vjs-track-setting\">', \"<legend id=\\\"\" + legendId + \"\\\">\", this.localize('Window'), '</legend>', this.createElSelect_('windowColor', legendId), '<span class=\"vjs-window-opacity vjs-opacity\">', this.createElSelect_('windowOpacity', legendId), '</span>', '</fieldset>'].join('');\n }\n /**\n * Create color elements for the component\n *\n * @return {Element}\n * The element that was created\n *\n * @private\n */\n ;\n\n _proto.createElColors_ = function createElColors_() {\n return video_es_createEl('div', {\n className: 'vjs-track-settings-colors',\n innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join('')\n });\n }\n /**\n * Create font elements for the component\n *\n * @return {Element}\n * The element that was created.\n *\n * @private\n */\n ;\n\n _proto.createElFont_ = function createElFont_() {\n return video_es_createEl('div', {\n className: 'vjs-track-settings-font',\n innerHTML: ['<fieldset class=\"vjs-font-percent vjs-track-setting\">', this.createElSelect_('fontPercent', '', 'legend'), '</fieldset>', '<fieldset class=\"vjs-edge-style vjs-track-setting\">', this.createElSelect_('edgeStyle', '', 'legend'), '</fieldset>', '<fieldset class=\"vjs-font-family vjs-track-setting\">', this.createElSelect_('fontFamily', '', 'legend'), '</fieldset>'].join('')\n });\n }\n /**\n * Create controls for the component\n *\n * @return {Element}\n * The element that was created.\n *\n * @private\n */\n ;\n\n _proto.createElControls_ = function createElControls_() {\n var defaultsDescription = this.localize('restore all settings to the default values');\n return video_es_createEl('div', {\n className: 'vjs-track-settings-controls',\n innerHTML: [\"<button type=\\\"button\\\" class=\\\"vjs-default-button\\\" title=\\\"\" + defaultsDescription + \"\\\">\", this.localize('Reset'), \"<span class=\\\"vjs-control-text\\\"> \" + defaultsDescription + \"</span>\", '</button>', \"<button type=\\\"button\\\" class=\\\"vjs-done-button\\\">\" + this.localize('Done') + \"</button>\"].join('')\n });\n };\n\n _proto.content = function content() {\n return [this.createElColors_(), this.createElFont_(), this.createElControls_()];\n };\n\n _proto.label = function label() {\n return this.localize('Caption Settings Dialog');\n };\n\n _proto.description = function description() {\n return this.localize('Beginning of dialog window. Escape will cancel and close the window.');\n };\n\n _proto.buildCSSClass = function buildCSSClass() {\n return _ModalDialog.prototype.buildCSSClass.call(this) + ' vjs-text-track-settings';\n }\n /**\n * Gets an object of text track settings (or null).\n *\n * @return {Object}\n * An object with config values parsed from the DOM or localStorage.\n */\n ;\n\n _proto.getValues = function getValues() {\n var _this3 = this;\n\n return reduce(selectConfigs, function (accum, config, key) {\n var value = getSelectedOptionValue(_this3.$(config.selector), config.parser);\n\n if (value !== undefined) {\n accum[key] = value;\n }\n\n return accum;\n }, {});\n }\n /**\n * Sets text track settings from an object of values.\n *\n * @param {Object} values\n * An object with config values parsed from the DOM or localStorage.\n */\n ;\n\n _proto.setValues = function setValues(values) {\n var _this4 = this;\n\n each(selectConfigs, function (config, key) {\n setSelectedOption(_this4.$(config.selector), values[key], config.parser);\n });\n }\n /**\n * Sets all `<select>` elements to their default values.\n */\n ;\n\n _proto.setDefaults = function setDefaults() {\n var _this5 = this;\n\n each(selectConfigs, function (config) {\n var index = config.hasOwnProperty('default') ? config[\"default\"] : 0;\n _this5.$(config.selector).selectedIndex = index;\n });\n }\n /**\n * Restore texttrack settings from localStorage\n */\n ;\n\n _proto.restoreSettings = function restoreSettings() {\n var values;\n\n try {\n values = JSON.parse(window_default.a.localStorage.getItem(LOCAL_STORAGE_KEY$1));\n } catch (err) {\n log$1.warn(err);\n }\n\n if (values) {\n this.setValues(values);\n }\n }\n /**\n * Save text track settings to localStorage\n */\n ;\n\n _proto.saveSettings = function saveSettings() {\n if (!this.options_.persistTextTrackSettings) {\n return;\n }\n\n var values = this.getValues();\n\n try {\n if (Object.keys(values).length) {\n window_default.a.localStorage.setItem(LOCAL_STORAGE_KEY$1, JSON.stringify(values));\n } else {\n window_default.a.localStorage.removeItem(LOCAL_STORAGE_KEY$1);\n }\n } catch (err) {\n log$1.warn(err);\n }\n }\n /**\n * Update display of text track settings\n */\n ;\n\n _proto.updateDisplay = function updateDisplay() {\n var ttDisplay = this.player_.getChild('textTrackDisplay');\n\n if (ttDisplay) {\n ttDisplay.updateDisplay();\n }\n }\n /**\n * conditionally blur the element and refocus the captions button\n *\n * @private\n */\n ;\n\n _proto.conditionalBlur_ = function conditionalBlur_() {\n this.previouslyActiveEl_ = null;\n var cb = this.player_.controlBar;\n var subsCapsBtn = cb && cb.subsCapsButton;\n var ccBtn = cb && cb.captionsButton;\n\n if (subsCapsBtn) {\n subsCapsBtn.focus();\n } else if (ccBtn) {\n ccBtn.focus();\n }\n };\n\n return TextTrackSettings;\n}(video_es_ModalDialog);\n\nComponent$1.registerComponent('TextTrackSettings', video_es_TextTrackSettings);\n\n/**\n * A Resize Manager. It is in charge of triggering `playerresize` on the player in the right conditions.\n *\n * It'll either create an iframe and use a debounced resize handler on it or use the new {@link https://wicg.github.io/ResizeObserver/|ResizeObserver}.\n *\n * If the ResizeObserver is available natively, it will be used. A polyfill can be passed in as an option.\n * If a `playerresize` event is not needed, the ResizeManager component can be removed from the player, see the example below.\n * @example <caption>How to disable the resize manager</caption>\n * const player = videojs('#vid', {\n * resizeManager: false\n * });\n *\n * @see {@link https://wicg.github.io/ResizeObserver/|ResizeObserver specification}\n *\n * @extends Component\n */\n\nvar video_es_ResizeManager = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(ResizeManager, _Component);\n\n /**\n * Create the ResizeManager.\n *\n * @param {Object} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of ResizeManager options.\n *\n * @param {Object} [options.ResizeObserver]\n * A polyfill for ResizeObserver can be passed in here.\n * If this is set to null it will ignore the native ResizeObserver and fall back to the iframe fallback.\n */\n function ResizeManager(player, options) {\n var _this;\n\n var RESIZE_OBSERVER_AVAILABLE = options.ResizeObserver || window_default.a.ResizeObserver; // if `null` was passed, we want to disable the ResizeObserver\n\n if (options.ResizeObserver === null) {\n RESIZE_OBSERVER_AVAILABLE = false;\n } // Only create an element when ResizeObserver isn't available\n\n\n var options_ = mergeOptions$3({\n createEl: !RESIZE_OBSERVER_AVAILABLE,\n reportTouchActivity: false\n }, options);\n _this = _Component.call(this, player, options_) || this;\n _this.ResizeObserver = options.ResizeObserver || window_default.a.ResizeObserver;\n _this.loadListener_ = null;\n _this.resizeObserver_ = null;\n _this.debouncedHandler_ = video_es_debounce(function () {\n _this.resizeHandler();\n }, 100, false, assertThisInitialized_default()(_this));\n\n if (RESIZE_OBSERVER_AVAILABLE) {\n _this.resizeObserver_ = new _this.ResizeObserver(_this.debouncedHandler_);\n\n _this.resizeObserver_.observe(player.el());\n } else {\n _this.loadListener_ = function () {\n if (!_this.el_ || !_this.el_.contentWindow) {\n return;\n }\n\n var debouncedHandler_ = _this.debouncedHandler_;\n\n var unloadListener_ = _this.unloadListener_ = function () {\n off(this, 'resize', debouncedHandler_);\n off(this, 'unload', unloadListener_);\n unloadListener_ = null;\n }; // safari and edge can unload the iframe before resizemanager dispose\n // we have to dispose of event handlers correctly before that happens\n\n\n on(_this.el_.contentWindow, 'unload', unloadListener_);\n on(_this.el_.contentWindow, 'resize', debouncedHandler_);\n };\n\n _this.one('load', _this.loadListener_);\n }\n\n return _this;\n }\n\n var _proto = ResizeManager.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'iframe', {\n className: 'vjs-resize-manager',\n tabIndex: -1\n }, {\n 'aria-hidden': 'true'\n });\n }\n /**\n * Called when a resize is triggered on the iframe or a resize is observed via the ResizeObserver\n *\n * @fires Player#playerresize\n */\n ;\n\n _proto.resizeHandler = function resizeHandler() {\n /**\n * Called when the player size has changed\n *\n * @event Player#playerresize\n * @type {EventTarget~Event}\n */\n // make sure player is still around to trigger\n // prevents this from causing an error after dispose\n if (!this.player_ || !this.player_.trigger) {\n return;\n }\n\n this.player_.trigger('playerresize');\n };\n\n _proto.dispose = function dispose() {\n if (this.debouncedHandler_) {\n this.debouncedHandler_.cancel();\n }\n\n if (this.resizeObserver_) {\n if (this.player_.el()) {\n this.resizeObserver_.unobserve(this.player_.el());\n }\n\n this.resizeObserver_.disconnect();\n }\n\n if (this.loadListener_) {\n this.off('load', this.loadListener_);\n }\n\n if (this.el_ && this.el_.contentWindow && this.unloadListener_) {\n this.unloadListener_.call(this.el_.contentWindow);\n }\n\n this.ResizeObserver = null;\n this.resizeObserver = null;\n this.debouncedHandler_ = null;\n this.loadListener_ = null;\n\n _Component.prototype.dispose.call(this);\n };\n\n return ResizeManager;\n}(Component$1);\n\nComponent$1.registerComponent('ResizeManager', video_es_ResizeManager);\n\nvar defaults = {\n trackingThreshold: 30,\n liveTolerance: 15\n};\n/*\n track when we are at the live edge, and other helpers for live playback */\n\n/**\n * A class for checking live current time and determining when the player\n * is at or behind the live edge.\n */\n\nvar video_es_LiveTracker = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(LiveTracker, _Component);\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {number} [options.trackingThreshold=30]\n * Number of seconds of live window (seekableEnd - seekableStart) that\n * media needs to have before the liveui will be shown.\n *\n * @param {number} [options.liveTolerance=15]\n * Number of seconds behind live that we have to be\n * before we will be considered non-live. Note that this will only\n * be used when playing at the live edge. This allows large seekable end\n * changes to not effect wether we are live or not.\n */\n function LiveTracker(player, options) {\n var _this;\n\n // LiveTracker does not need an element\n var options_ = mergeOptions$3(defaults, options, {\n createEl: false\n });\n _this = _Component.call(this, player, options_) || this;\n\n _this.handleVisibilityChange_ = function (e) {\n return _this.handleVisibilityChange(e);\n };\n\n _this.trackLiveHandler_ = function () {\n return _this.trackLive_();\n };\n\n _this.handlePlay_ = function (e) {\n return _this.handlePlay(e);\n };\n\n _this.handleFirstTimeupdate_ = function (e) {\n return _this.handleFirstTimeupdate(e);\n };\n\n _this.handleSeeked_ = function (e) {\n return _this.handleSeeked(e);\n };\n\n _this.seekToLiveEdge_ = function (e) {\n return _this.seekToLiveEdge(e);\n };\n\n _this.reset_();\n\n _this.on(_this.player_, 'durationchange', function (e) {\n return _this.handleDurationchange(e);\n }); // we should try to toggle tracking on canplay as native playback engines, like Safari\n // may not have the proper values for things like seekableEnd until then\n\n\n _this.one(_this.player_, 'canplay', function () {\n return _this.toggleTracking();\n }); // we don't need to track live playback if the document is hidden,\n // also, tracking when the document is hidden can\n // cause the CPU to spike and eventually crash the page on IE11.\n\n\n if (IE_VERSION && 'hidden' in document_default.a && 'visibilityState' in document_default.a) {\n _this.on(document_default.a, 'visibilitychange', _this.handleVisibilityChange_);\n }\n\n return _this;\n }\n /**\n * toggle tracking based on document visiblility\n */\n\n\n var _proto = LiveTracker.prototype;\n\n _proto.handleVisibilityChange = function handleVisibilityChange() {\n if (this.player_.duration() !== Infinity) {\n return;\n }\n\n if (document_default.a.hidden) {\n this.stopTracking();\n } else {\n this.startTracking();\n }\n }\n /**\n * all the functionality for tracking when seek end changes\n * and for tracking how far past seek end we should be\n */\n ;\n\n _proto.trackLive_ = function trackLive_() {\n var seekable = this.player_.seekable(); // skip undefined seekable\n\n if (!seekable || !seekable.length) {\n return;\n }\n\n var newTime = Number(window_default.a.performance.now().toFixed(4));\n var deltaTime = this.lastTime_ === -1 ? 0 : (newTime - this.lastTime_) / 1000;\n this.lastTime_ = newTime;\n this.pastSeekEnd_ = this.pastSeekEnd() + deltaTime;\n var liveCurrentTime = this.liveCurrentTime();\n var currentTime = this.player_.currentTime(); // we are behind live if any are true\n // 1. the player is paused\n // 2. the user seeked to a location 2 seconds away from live\n // 3. the difference between live and current time is greater\n // liveTolerance which defaults to 15s\n\n var isBehind = this.player_.paused() || this.seekedBehindLive_ || Math.abs(liveCurrentTime - currentTime) > this.options_.liveTolerance; // we cannot be behind if\n // 1. until we have not seen a timeupdate yet\n // 2. liveCurrentTime is Infinity, which happens on Android and Native Safari\n\n if (!this.timeupdateSeen_ || liveCurrentTime === Infinity) {\n isBehind = false;\n }\n\n if (isBehind !== this.behindLiveEdge_) {\n this.behindLiveEdge_ = isBehind;\n this.trigger('liveedgechange');\n }\n }\n /**\n * handle a durationchange event on the player\n * and start/stop tracking accordingly.\n */\n ;\n\n _proto.handleDurationchange = function handleDurationchange() {\n this.toggleTracking();\n }\n /**\n * start/stop tracking\n */\n ;\n\n _proto.toggleTracking = function toggleTracking() {\n if (this.player_.duration() === Infinity && this.liveWindow() >= this.options_.trackingThreshold) {\n if (this.player_.options_.liveui) {\n this.player_.addClass('vjs-liveui');\n }\n\n this.startTracking();\n } else {\n this.player_.removeClass('vjs-liveui');\n this.stopTracking();\n }\n }\n /**\n * start tracking live playback\n */\n ;\n\n _proto.startTracking = function startTracking() {\n if (this.isTracking()) {\n return;\n } // If we haven't seen a timeupdate, we need to check whether playback\n // began before this component started tracking. This can happen commonly\n // when using autoplay.\n\n\n if (!this.timeupdateSeen_) {\n this.timeupdateSeen_ = this.player_.hasStarted();\n }\n\n this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, UPDATE_REFRESH_INTERVAL);\n this.trackLive_();\n this.on(this.player_, ['play', 'pause'], this.trackLiveHandler_);\n\n if (!this.timeupdateSeen_) {\n this.one(this.player_, 'play', this.handlePlay_);\n this.one(this.player_, 'timeupdate', this.handleFirstTimeupdate_);\n } else {\n this.on(this.player_, 'seeked', this.handleSeeked_);\n }\n }\n /**\n * handle the first timeupdate on the player if it wasn't already playing\n * when live tracker started tracking.\n */\n ;\n\n _proto.handleFirstTimeupdate = function handleFirstTimeupdate() {\n this.timeupdateSeen_ = true;\n this.on(this.player_, 'seeked', this.handleSeeked_);\n }\n /**\n * Keep track of what time a seek starts, and listen for seeked\n * to find where a seek ends.\n */\n ;\n\n _proto.handleSeeked = function handleSeeked() {\n var timeDiff = Math.abs(this.liveCurrentTime() - this.player_.currentTime());\n this.seekedBehindLive_ = this.nextSeekedFromUser_ && timeDiff > 2;\n this.nextSeekedFromUser_ = false;\n this.trackLive_();\n }\n /**\n * handle the first play on the player, and make sure that we seek\n * right to the live edge.\n */\n ;\n\n _proto.handlePlay = function handlePlay() {\n this.one(this.player_, 'timeupdate', this.seekToLiveEdge_);\n }\n /**\n * Stop tracking, and set all internal variables to\n * their initial value.\n */\n ;\n\n _proto.reset_ = function reset_() {\n this.lastTime_ = -1;\n this.pastSeekEnd_ = 0;\n this.lastSeekEnd_ = -1;\n this.behindLiveEdge_ = true;\n this.timeupdateSeen_ = false;\n this.seekedBehindLive_ = false;\n this.nextSeekedFromUser_ = false;\n this.clearInterval(this.trackingInterval_);\n this.trackingInterval_ = null;\n this.off(this.player_, ['play', 'pause'], this.trackLiveHandler_);\n this.off(this.player_, 'seeked', this.handleSeeked_);\n this.off(this.player_, 'play', this.handlePlay_);\n this.off(this.player_, 'timeupdate', this.handleFirstTimeupdate_);\n this.off(this.player_, 'timeupdate', this.seekToLiveEdge_);\n }\n /**\n * The next seeked event is from the user. Meaning that any seek\n * > 2s behind live will be considered behind live for real and\n * liveTolerance will be ignored.\n */\n ;\n\n _proto.nextSeekedFromUser = function nextSeekedFromUser() {\n this.nextSeekedFromUser_ = true;\n }\n /**\n * stop tracking live playback\n */\n ;\n\n _proto.stopTracking = function stopTracking() {\n if (!this.isTracking()) {\n return;\n }\n\n this.reset_();\n this.trigger('liveedgechange');\n }\n /**\n * A helper to get the player seekable end\n * so that we don't have to null check everywhere\n *\n * @return {number}\n * The furthest seekable end or Infinity.\n */\n ;\n\n _proto.seekableEnd = function seekableEnd() {\n var seekable = this.player_.seekable();\n var seekableEnds = [];\n var i = seekable ? seekable.length : 0;\n\n while (i--) {\n seekableEnds.push(seekable.end(i));\n } // grab the furthest seekable end after sorting, or if there are none\n // default to Infinity\n\n\n return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;\n }\n /**\n * A helper to get the player seekable start\n * so that we don't have to null check everywhere\n *\n * @return {number}\n * The earliest seekable start or 0.\n */\n ;\n\n _proto.seekableStart = function seekableStart() {\n var seekable = this.player_.seekable();\n var seekableStarts = [];\n var i = seekable ? seekable.length : 0;\n\n while (i--) {\n seekableStarts.push(seekable.start(i));\n } // grab the first seekable start after sorting, or if there are none\n // default to 0\n\n\n return seekableStarts.length ? seekableStarts.sort()[0] : 0;\n }\n /**\n * Get the live time window aka\n * the amount of time between seekable start and\n * live current time.\n *\n * @return {number}\n * The amount of seconds that are seekable in\n * the live video.\n */\n ;\n\n _proto.liveWindow = function liveWindow() {\n var liveCurrentTime = this.liveCurrentTime(); // if liveCurrenTime is Infinity then we don't have a liveWindow at all\n\n if (liveCurrentTime === Infinity) {\n return 0;\n }\n\n return liveCurrentTime - this.seekableStart();\n }\n /**\n * Determines if the player is live, only checks if this component\n * is tracking live playback or not\n *\n * @return {boolean}\n * Wether liveTracker is tracking\n */\n ;\n\n _proto.isLive = function isLive() {\n return this.isTracking();\n }\n /**\n * Determines if currentTime is at the live edge and won't fall behind\n * on each seekableendchange\n *\n * @return {boolean}\n * Wether playback is at the live edge\n */\n ;\n\n _proto.atLiveEdge = function atLiveEdge() {\n return !this.behindLiveEdge();\n }\n /**\n * get what we expect the live current time to be\n *\n * @return {number}\n * The expected live current time\n */\n ;\n\n _proto.liveCurrentTime = function liveCurrentTime() {\n return this.pastSeekEnd() + this.seekableEnd();\n }\n /**\n * The number of seconds that have occured after seekable end\n * changed. This will be reset to 0 once seekable end changes.\n *\n * @return {number}\n * Seconds past the current seekable end\n */\n ;\n\n _proto.pastSeekEnd = function pastSeekEnd() {\n var seekableEnd = this.seekableEnd();\n\n if (this.lastSeekEnd_ !== -1 && seekableEnd !== this.lastSeekEnd_) {\n this.pastSeekEnd_ = 0;\n }\n\n this.lastSeekEnd_ = seekableEnd;\n return this.pastSeekEnd_;\n }\n /**\n * If we are currently behind the live edge, aka currentTime will be\n * behind on a seekableendchange\n *\n * @return {boolean}\n * If we are behind the live edge\n */\n ;\n\n _proto.behindLiveEdge = function behindLiveEdge() {\n return this.behindLiveEdge_;\n }\n /**\n * Wether live tracker is currently tracking or not.\n */\n ;\n\n _proto.isTracking = function isTracking() {\n return typeof this.trackingInterval_ === 'number';\n }\n /**\n * Seek to the live edge if we are behind the live edge\n */\n ;\n\n _proto.seekToLiveEdge = function seekToLiveEdge() {\n this.seekedBehindLive_ = false;\n\n if (this.atLiveEdge()) {\n return;\n }\n\n this.nextSeekedFromUser_ = false;\n this.player_.currentTime(this.liveCurrentTime());\n }\n /**\n * Dispose of liveTracker\n */\n ;\n\n _proto.dispose = function dispose() {\n this.off(document_default.a, 'visibilitychange', this.handleVisibilityChange_);\n this.stopTracking();\n\n _Component.prototype.dispose.call(this);\n };\n\n return LiveTracker;\n}(Component$1);\n\nComponent$1.registerComponent('LiveTracker', video_es_LiveTracker);\n\n/**\n * This function is used to fire a sourceset when there is something\n * similar to `mediaEl.load()` being called. It will try to find the source via\n * the `src` attribute and then the `<source>` elements. It will then fire `sourceset`\n * with the source that was found or empty string if we cannot know. If it cannot\n * find a source then `sourceset` will not be fired.\n *\n * @param {Html5} tech\n * The tech object that sourceset was setup on\n *\n * @return {boolean}\n * returns false if the sourceset was not fired and true otherwise.\n */\n\nvar sourcesetLoad = function sourcesetLoad(tech) {\n var el = tech.el(); // if `el.src` is set, that source will be loaded.\n\n if (el.hasAttribute('src')) {\n tech.triggerSourceset(el.src);\n return true;\n }\n /**\n * Since there isn't a src property on the media element, source elements will be used for\n * implementing the source selection algorithm. This happens asynchronously and\n * for most cases were there is more than one source we cannot tell what source will\n * be loaded, without re-implementing the source selection algorithm. At this time we are not\n * going to do that. There are three special cases that we do handle here though:\n *\n * 1. If there are no sources, do not fire `sourceset`.\n * 2. If there is only one `<source>` with a `src` property/attribute that is our `src`\n * 3. If there is more than one `<source>` but all of them have the same `src` url.\n * That will be our src.\n */\n\n\n var sources = tech.$$('source');\n var srcUrls = [];\n var src = ''; // if there are no sources, do not fire sourceset\n\n if (!sources.length) {\n return false;\n } // only count valid/non-duplicate source elements\n\n\n for (var i = 0; i < sources.length; i++) {\n var url = sources[i].src;\n\n if (url && srcUrls.indexOf(url) === -1) {\n srcUrls.push(url);\n }\n } // there were no valid sources\n\n\n if (!srcUrls.length) {\n return false;\n } // there is only one valid source element url\n // use that\n\n\n if (srcUrls.length === 1) {\n src = srcUrls[0];\n }\n\n tech.triggerSourceset(src);\n return true;\n};\n/**\n * our implementation of an `innerHTML` descriptor for browsers\n * that do not have one.\n */\n\n\nvar innerHTMLDescriptorPolyfill = Object.defineProperty({}, 'innerHTML', {\n get: function get() {\n return this.cloneNode(true).innerHTML;\n },\n set: function set(v) {\n // make a dummy node to use innerHTML on\n var dummy = document_default.a.createElement(this.nodeName.toLowerCase()); // set innerHTML to the value provided\n\n dummy.innerHTML = v; // make a document fragment to hold the nodes from dummy\n\n var docFrag = document_default.a.createDocumentFragment(); // copy all of the nodes created by the innerHTML on dummy\n // to the document fragment\n\n while (dummy.childNodes.length) {\n docFrag.appendChild(dummy.childNodes[0]);\n } // remove content\n\n\n this.innerText = ''; // now we add all of that html in one by appending the\n // document fragment. This is how innerHTML does it.\n\n window_default.a.Element.prototype.appendChild.call(this, docFrag); // then return the result that innerHTML's setter would\n\n return this.innerHTML;\n }\n});\n/**\n * Get a property descriptor given a list of priorities and the\n * property to get.\n */\n\nvar getDescriptor = function getDescriptor(priority, prop) {\n var descriptor = {};\n\n for (var i = 0; i < priority.length; i++) {\n descriptor = Object.getOwnPropertyDescriptor(priority[i], prop);\n\n if (descriptor && descriptor.set && descriptor.get) {\n break;\n }\n }\n\n descriptor.enumerable = true;\n descriptor.configurable = true;\n return descriptor;\n};\n\nvar video_es_getInnerHTMLDescriptor = function getInnerHTMLDescriptor(tech) {\n return getDescriptor([tech.el(), window_default.a.HTMLMediaElement.prototype, window_default.a.Element.prototype, innerHTMLDescriptorPolyfill], 'innerHTML');\n};\n/**\n * Patches browser internal functions so that we can tell synchronously\n * if a `<source>` was appended to the media element. For some reason this\n * causes a `sourceset` if the the media element is ready and has no source.\n * This happens when:\n * - The page has just loaded and the media element does not have a source.\n * - The media element was emptied of all sources, then `load()` was called.\n *\n * It does this by patching the following functions/properties when they are supported:\n *\n * - `append()` - can be used to add a `<source>` element to the media element\n * - `appendChild()` - can be used to add a `<source>` element to the media element\n * - `insertAdjacentHTML()` - can be used to add a `<source>` element to the media element\n * - `innerHTML` - can be used to add a `<source>` element to the media element\n *\n * @param {Html5} tech\n * The tech object that sourceset is being setup on.\n */\n\n\nvar firstSourceWatch = function firstSourceWatch(tech) {\n var el = tech.el(); // make sure firstSourceWatch isn't setup twice.\n\n if (el.resetSourceWatch_) {\n return;\n }\n\n var old = {};\n var innerDescriptor = video_es_getInnerHTMLDescriptor(tech);\n\n var appendWrapper = function appendWrapper(appendFn) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var retval = appendFn.apply(el, args);\n sourcesetLoad(tech);\n return retval;\n };\n };\n\n ['append', 'appendChild', 'insertAdjacentHTML'].forEach(function (k) {\n if (!el[k]) {\n return;\n } // store the old function\n\n\n old[k] = el[k]; // call the old function with a sourceset if a source\n // was loaded\n\n el[k] = appendWrapper(old[k]);\n });\n Object.defineProperty(el, 'innerHTML', mergeOptions$3(innerDescriptor, {\n set: appendWrapper(innerDescriptor.set)\n }));\n\n el.resetSourceWatch_ = function () {\n el.resetSourceWatch_ = null;\n Object.keys(old).forEach(function (k) {\n el[k] = old[k];\n });\n Object.defineProperty(el, 'innerHTML', innerDescriptor);\n }; // on the first sourceset, we need to revert our changes\n\n\n tech.one('sourceset', el.resetSourceWatch_);\n};\n/**\n * our implementation of a `src` descriptor for browsers\n * that do not have one.\n */\n\n\nvar srcDescriptorPolyfill = Object.defineProperty({}, 'src', {\n get: function get() {\n if (this.hasAttribute('src')) {\n return video_es_getAbsoluteURL(window_default.a.Element.prototype.getAttribute.call(this, 'src'));\n }\n\n return '';\n },\n set: function set(v) {\n window_default.a.Element.prototype.setAttribute.call(this, 'src', v);\n return v;\n }\n});\n\nvar video_es_getSrcDescriptor = function getSrcDescriptor(tech) {\n return getDescriptor([tech.el(), window_default.a.HTMLMediaElement.prototype, srcDescriptorPolyfill], 'src');\n};\n/**\n * setup `sourceset` handling on the `Html5` tech. This function\n * patches the following element properties/functions:\n *\n * - `src` - to determine when `src` is set\n * - `setAttribute()` - to determine when `src` is set\n * - `load()` - this re-triggers the source selection algorithm, and can\n * cause a sourceset.\n *\n * If there is no source when we are adding `sourceset` support or during a `load()`\n * we also patch the functions listed in `firstSourceWatch`.\n *\n * @param {Html5} tech\n * The tech to patch\n */\n\n\nvar setupSourceset = function setupSourceset(tech) {\n if (!tech.featuresSourceset) {\n return;\n }\n\n var el = tech.el(); // make sure sourceset isn't setup twice.\n\n if (el.resetSourceset_) {\n return;\n }\n\n var srcDescriptor = video_es_getSrcDescriptor(tech);\n var oldSetAttribute = el.setAttribute;\n var oldLoad = el.load;\n Object.defineProperty(el, 'src', mergeOptions$3(srcDescriptor, {\n set: function set(v) {\n var retval = srcDescriptor.set.call(el, v); // we use the getter here to get the actual value set on src\n\n tech.triggerSourceset(el.src);\n return retval;\n }\n }));\n\n el.setAttribute = function (n, v) {\n var retval = oldSetAttribute.call(el, n, v);\n\n if (/src/i.test(n)) {\n tech.triggerSourceset(el.src);\n }\n\n return retval;\n };\n\n el.load = function () {\n var retval = oldLoad.call(el); // if load was called, but there was no source to fire\n // sourceset on. We have to watch for a source append\n // as that can trigger a `sourceset` when the media element\n // has no source\n\n if (!sourcesetLoad(tech)) {\n tech.triggerSourceset('');\n firstSourceWatch(tech);\n }\n\n return retval;\n };\n\n if (el.currentSrc) {\n tech.triggerSourceset(el.currentSrc);\n } else if (!sourcesetLoad(tech)) {\n firstSourceWatch(tech);\n }\n\n el.resetSourceset_ = function () {\n el.resetSourceset_ = null;\n el.load = oldLoad;\n el.setAttribute = oldSetAttribute;\n Object.defineProperty(el, 'src', srcDescriptor);\n\n if (el.resetSourceWatch_) {\n el.resetSourceWatch_();\n }\n };\n};\n\n/**\n * Object.defineProperty but \"lazy\", which means that the value is only set after\n * it retrieved the first time, rather than being set right away.\n *\n * @param {Object} obj the object to set the property on\n * @param {string} key the key for the property to set\n * @param {Function} getValue the function used to get the value when it is needed.\n * @param {boolean} setter wether a setter shoould be allowed or not\n */\nvar defineLazyProperty = function defineLazyProperty(obj, key, getValue, setter) {\n if (setter === void 0) {\n setter = true;\n }\n\n var set = function set(value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n writable: true\n });\n };\n\n var options = {\n configurable: true,\n enumerable: true,\n get: function get() {\n var value = getValue();\n set(value);\n return value;\n }\n };\n\n if (setter) {\n options.set = set;\n }\n\n return Object.defineProperty(obj, key, options);\n};\n\n/**\n * HTML5 Media Controller - Wrapper for HTML5 Media API\n *\n * @mixes Tech~SourceHandlerAdditions\n * @extends Tech\n */\n\nvar video_es_Html5 = /*#__PURE__*/function (_Tech) {\n inheritsLoose_default()(Html5, _Tech);\n\n /**\n * Create an instance of this Tech.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} ready\n * Callback function to call when the `HTML5` Tech is ready.\n */\n function Html5(options, ready) {\n var _this;\n\n _this = _Tech.call(this, options, ready) || this;\n var source = options.source;\n var crossoriginTracks = false; // Set the source if one is provided\n // 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted)\n // 2) Check to see if the network state of the tag was failed at init, and if so, reset the source\n // anyway so the error gets fired.\n\n if (source && (_this.el_.currentSrc !== source.src || options.tag && options.tag.initNetworkState_ === 3)) {\n _this.setSource(source);\n } else {\n _this.handleLateInit_(_this.el_);\n } // setup sourceset after late sourceset/init\n\n\n if (options.enableSourceset) {\n _this.setupSourcesetHandling_();\n }\n\n _this.isScrubbing_ = false;\n\n if (_this.el_.hasChildNodes()) {\n var nodes = _this.el_.childNodes;\n var nodesLength = nodes.length;\n var removeNodes = [];\n\n while (nodesLength--) {\n var node = nodes[nodesLength];\n var nodeName = node.nodeName.toLowerCase();\n\n if (nodeName === 'track') {\n if (!_this.featuresNativeTextTracks) {\n // Empty video tag tracks so the built-in player doesn't use them also.\n // This may not be fast enough to stop HTML5 browsers from reading the tags\n // so we'll need to turn off any default tracks if we're manually doing\n // captions and subtitles. videoElement.textTracks\n removeNodes.push(node);\n } else {\n // store HTMLTrackElement and TextTrack to remote list\n _this.remoteTextTrackEls().addTrackElement_(node);\n\n _this.remoteTextTracks().addTrack(node.track);\n\n _this.textTracks().addTrack(node.track);\n\n if (!crossoriginTracks && !_this.el_.hasAttribute('crossorigin') && video_es_isCrossOrigin(node.src)) {\n crossoriginTracks = true;\n }\n }\n }\n }\n\n for (var i = 0; i < removeNodes.length; i++) {\n _this.el_.removeChild(removeNodes[i]);\n }\n }\n\n _this.proxyNativeTracks_();\n\n if (_this.featuresNativeTextTracks && crossoriginTracks) {\n log$1.warn('Text Tracks are being loaded from another origin but the crossorigin attribute isn\\'t used.\\n' + 'This may prevent text tracks from loading.');\n } // prevent iOS Safari from disabling metadata text tracks during native playback\n\n\n _this.restoreMetadataTracksInIOSNativePlayer_(); // Determine if native controls should be used\n // Our goal should be to get the custom controls on mobile solid everywhere\n // so we can remove this all together. Right now this will block custom\n // controls on touch enabled laptops like the Chrome Pixel\n\n\n if ((TOUCH_ENABLED || IS_IPHONE || IS_NATIVE_ANDROID) && options.nativeControlsForTouch === true) {\n _this.setControls(true);\n } // on iOS, we want to proxy `webkitbeginfullscreen` and `webkitendfullscreen`\n // into a `fullscreenchange` event\n\n\n _this.proxyWebkitFullscreen_();\n\n _this.triggerReady();\n\n return _this;\n }\n /**\n * Dispose of `HTML5` media element and remove all tracks.\n */\n\n\n var _proto = Html5.prototype;\n\n _proto.dispose = function dispose() {\n if (this.el_ && this.el_.resetSourceset_) {\n this.el_.resetSourceset_();\n }\n\n Html5.disposeMediaElement(this.el_);\n this.options_ = null; // tech will handle clearing of the emulated track list\n\n _Tech.prototype.dispose.call(this);\n }\n /**\n * Modify the media element so that we can detect when\n * the source is changed. Fires `sourceset` just after the source has changed\n */\n ;\n\n _proto.setupSourcesetHandling_ = function setupSourcesetHandling_() {\n setupSourceset(this);\n }\n /**\n * When a captions track is enabled in the iOS Safari native player, all other\n * tracks are disabled (including metadata tracks), which nulls all of their\n * associated cue points. This will restore metadata tracks to their pre-fullscreen\n * state in those cases so that cue points are not needlessly lost.\n *\n * @private\n */\n ;\n\n _proto.restoreMetadataTracksInIOSNativePlayer_ = function restoreMetadataTracksInIOSNativePlayer_() {\n var textTracks = this.textTracks();\n var metadataTracksPreFullscreenState; // captures a snapshot of every metadata track's current state\n\n var takeMetadataTrackSnapshot = function takeMetadataTrackSnapshot() {\n metadataTracksPreFullscreenState = [];\n\n for (var i = 0; i < textTracks.length; i++) {\n var track = textTracks[i];\n\n if (track.kind === 'metadata') {\n metadataTracksPreFullscreenState.push({\n track: track,\n storedMode: track.mode\n });\n }\n }\n }; // snapshot each metadata track's initial state, and update the snapshot\n // each time there is a track 'change' event\n\n\n takeMetadataTrackSnapshot();\n textTracks.addEventListener('change', takeMetadataTrackSnapshot);\n this.on('dispose', function () {\n return textTracks.removeEventListener('change', takeMetadataTrackSnapshot);\n });\n\n var restoreTrackMode = function restoreTrackMode() {\n for (var i = 0; i < metadataTracksPreFullscreenState.length; i++) {\n var storedTrack = metadataTracksPreFullscreenState[i];\n\n if (storedTrack.track.mode === 'disabled' && storedTrack.track.mode !== storedTrack.storedMode) {\n storedTrack.track.mode = storedTrack.storedMode;\n }\n } // we only want this handler to be executed on the first 'change' event\n\n\n textTracks.removeEventListener('change', restoreTrackMode);\n }; // when we enter fullscreen playback, stop updating the snapshot and\n // restore all track modes to their pre-fullscreen state\n\n\n this.on('webkitbeginfullscreen', function () {\n textTracks.removeEventListener('change', takeMetadataTrackSnapshot); // remove the listener before adding it just in case it wasn't previously removed\n\n textTracks.removeEventListener('change', restoreTrackMode);\n textTracks.addEventListener('change', restoreTrackMode);\n }); // start updating the snapshot again after leaving fullscreen\n\n this.on('webkitendfullscreen', function () {\n // remove the listener before adding it just in case it wasn't previously removed\n textTracks.removeEventListener('change', takeMetadataTrackSnapshot);\n textTracks.addEventListener('change', takeMetadataTrackSnapshot); // remove the restoreTrackMode handler in case it wasn't triggered during fullscreen playback\n\n textTracks.removeEventListener('change', restoreTrackMode);\n });\n }\n /**\n * Attempt to force override of tracks for the given type\n *\n * @param {string} type - Track type to override, possible values include 'Audio',\n * 'Video', and 'Text'.\n * @param {boolean} override - If set to true native audio/video will be overridden,\n * otherwise native audio/video will potentially be used.\n * @private\n */\n ;\n\n _proto.overrideNative_ = function overrideNative_(type, override) {\n var _this2 = this;\n\n // If there is no behavioral change don't add/remove listeners\n if (override !== this[\"featuresNative\" + type + \"Tracks\"]) {\n return;\n }\n\n var lowerCaseType = type.toLowerCase();\n\n if (this[lowerCaseType + \"TracksListeners_\"]) {\n Object.keys(this[lowerCaseType + \"TracksListeners_\"]).forEach(function (eventName) {\n var elTracks = _this2.el()[lowerCaseType + \"Tracks\"];\n\n elTracks.removeEventListener(eventName, _this2[lowerCaseType + \"TracksListeners_\"][eventName]);\n });\n }\n\n this[\"featuresNative\" + type + \"Tracks\"] = !override;\n this[lowerCaseType + \"TracksListeners_\"] = null;\n this.proxyNativeTracksForType_(lowerCaseType);\n }\n /**\n * Attempt to force override of native audio tracks.\n *\n * @param {boolean} override - If set to true native audio will be overridden,\n * otherwise native audio will potentially be used.\n */\n ;\n\n _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks(override) {\n this.overrideNative_('Audio', override);\n }\n /**\n * Attempt to force override of native video tracks.\n *\n * @param {boolean} override - If set to true native video will be overridden,\n * otherwise native video will potentially be used.\n */\n ;\n\n _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks(override) {\n this.overrideNative_('Video', override);\n }\n /**\n * Proxy native track list events for the given type to our track\n * lists if the browser we are playing in supports that type of track list.\n *\n * @param {string} name - Track type; values include 'audio', 'video', and 'text'\n * @private\n */\n ;\n\n _proto.proxyNativeTracksForType_ = function proxyNativeTracksForType_(name) {\n var _this3 = this;\n\n var props = NORMAL[name];\n var elTracks = this.el()[props.getterName];\n var techTracks = this[props.getterName]();\n\n if (!this[\"featuresNative\" + props.capitalName + \"Tracks\"] || !elTracks || !elTracks.addEventListener) {\n return;\n }\n\n var listeners = {\n change: function change(e) {\n var event = {\n type: 'change',\n target: techTracks,\n currentTarget: techTracks,\n srcElement: techTracks\n };\n techTracks.trigger(event); // if we are a text track change event, we should also notify the\n // remote text track list. This can potentially cause a false positive\n // if we were to get a change event on a non-remote track and\n // we triggered the event on the remote text track list which doesn't\n // contain that track. However, best practices mean looping through the\n // list of tracks and searching for the appropriate mode value, so,\n // this shouldn't pose an issue\n\n if (name === 'text') {\n _this3[REMOTE.remoteText.getterName]().trigger(event);\n }\n },\n addtrack: function addtrack(e) {\n techTracks.addTrack(e.track);\n },\n removetrack: function removetrack(e) {\n techTracks.removeTrack(e.track);\n }\n };\n\n var removeOldTracks = function removeOldTracks() {\n var removeTracks = [];\n\n for (var i = 0; i < techTracks.length; i++) {\n var found = false;\n\n for (var j = 0; j < elTracks.length; j++) {\n if (elTracks[j] === techTracks[i]) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n removeTracks.push(techTracks[i]);\n }\n }\n\n while (removeTracks.length) {\n techTracks.removeTrack(removeTracks.shift());\n }\n };\n\n this[props.getterName + 'Listeners_'] = listeners;\n Object.keys(listeners).forEach(function (eventName) {\n var listener = listeners[eventName];\n elTracks.addEventListener(eventName, listener);\n\n _this3.on('dispose', function (e) {\n return elTracks.removeEventListener(eventName, listener);\n });\n }); // Remove (native) tracks that are not used anymore\n\n this.on('loadstart', removeOldTracks);\n this.on('dispose', function (e) {\n return _this3.off('loadstart', removeOldTracks);\n });\n }\n /**\n * Proxy all native track list events to our track lists if the browser we are playing\n * in supports that type of track list.\n *\n * @private\n */\n ;\n\n _proto.proxyNativeTracks_ = function proxyNativeTracks_() {\n var _this4 = this;\n\n NORMAL.names.forEach(function (name) {\n _this4.proxyNativeTracksForType_(name);\n });\n }\n /**\n * Create the `Html5` Tech's DOM element.\n *\n * @return {Element}\n * The element that gets created.\n */\n ;\n\n _proto.createEl = function createEl() {\n var el = this.options_.tag; // Check if this browser supports moving the element into the box.\n // On the iPhone video will break if you move the element,\n // So we have to create a brand new element.\n // If we ingested the player div, we do not need to move the media element.\n\n if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {\n // If the original tag is still there, clone and remove it.\n if (el) {\n var clone = el.cloneNode(true);\n\n if (el.parentNode) {\n el.parentNode.insertBefore(clone, el);\n }\n\n Html5.disposeMediaElement(el);\n el = clone;\n } else {\n el = document_default.a.createElement('video'); // determine if native controls should be used\n\n var tagAttributes = this.options_.tag && getAttributes(this.options_.tag);\n var attributes = mergeOptions$3({}, tagAttributes);\n\n if (!TOUCH_ENABLED || this.options_.nativeControlsForTouch !== true) {\n delete attributes.controls;\n }\n\n setAttributes(el, video_es_assign(attributes, {\n id: this.options_.techId,\n \"class\": 'vjs-tech'\n }));\n }\n\n el.playerId = this.options_.playerId;\n }\n\n if (typeof this.options_.preload !== 'undefined') {\n setAttribute(el, 'preload', this.options_.preload);\n }\n\n if (this.options_.disablePictureInPicture !== undefined) {\n el.disablePictureInPicture = this.options_.disablePictureInPicture;\n } // Update specific tag settings, in case they were overridden\n // `autoplay` has to be *last* so that `muted` and `playsinline` are present\n // when iOS/Safari or other browsers attempt to autoplay.\n\n\n var settingsAttrs = ['loop', 'muted', 'playsinline', 'autoplay'];\n\n for (var i = 0; i < settingsAttrs.length; i++) {\n var attr = settingsAttrs[i];\n var value = this.options_[attr];\n\n if (typeof value !== 'undefined') {\n if (value) {\n setAttribute(el, attr, attr);\n } else {\n removeAttribute(el, attr);\n }\n\n el[attr] = value;\n }\n }\n\n return el;\n }\n /**\n * This will be triggered if the loadstart event has already fired, before videojs was\n * ready. Two known examples of when this can happen are:\n * 1. If we're loading the playback object after it has started loading\n * 2. The media is already playing the (often with autoplay on) then\n *\n * This function will fire another loadstart so that videojs can catchup.\n *\n * @fires Tech#loadstart\n *\n * @return {undefined}\n * returns nothing.\n */\n ;\n\n _proto.handleLateInit_ = function handleLateInit_(el) {\n if (el.networkState === 0 || el.networkState === 3) {\n // The video element hasn't started loading the source yet\n // or didn't find a source\n return;\n }\n\n if (el.readyState === 0) {\n // NetworkState is set synchronously BUT loadstart is fired at the\n // end of the current stack, usually before setInterval(fn, 0).\n // So at this point we know loadstart may have already fired or is\n // about to fire, and either way the player hasn't seen it yet.\n // We don't want to fire loadstart prematurely here and cause a\n // double loadstart so we'll wait and see if it happens between now\n // and the next loop, and fire it if not.\n // HOWEVER, we also want to make sure it fires before loadedmetadata\n // which could also happen between now and the next loop, so we'll\n // watch for that also.\n var loadstartFired = false;\n\n var setLoadstartFired = function setLoadstartFired() {\n loadstartFired = true;\n };\n\n this.on('loadstart', setLoadstartFired);\n\n var triggerLoadstart = function triggerLoadstart() {\n // We did miss the original loadstart. Make sure the player\n // sees loadstart before loadedmetadata\n if (!loadstartFired) {\n this.trigger('loadstart');\n }\n };\n\n this.on('loadedmetadata', triggerLoadstart);\n this.ready(function () {\n this.off('loadstart', setLoadstartFired);\n this.off('loadedmetadata', triggerLoadstart);\n\n if (!loadstartFired) {\n // We did miss the original native loadstart. Fire it now.\n this.trigger('loadstart');\n }\n });\n return;\n } // From here on we know that loadstart already fired and we missed it.\n // The other readyState events aren't as much of a problem if we double\n // them, so not going to go to as much trouble as loadstart to prevent\n // that unless we find reason to.\n\n\n var eventsToTrigger = ['loadstart']; // loadedmetadata: newly equal to HAVE_METADATA (1) or greater\n\n eventsToTrigger.push('loadedmetadata'); // loadeddata: newly increased to HAVE_CURRENT_DATA (2) or greater\n\n if (el.readyState >= 2) {\n eventsToTrigger.push('loadeddata');\n } // canplay: newly increased to HAVE_FUTURE_DATA (3) or greater\n\n\n if (el.readyState >= 3) {\n eventsToTrigger.push('canplay');\n } // canplaythrough: newly equal to HAVE_ENOUGH_DATA (4)\n\n\n if (el.readyState >= 4) {\n eventsToTrigger.push('canplaythrough');\n } // We still need to give the player time to add event listeners\n\n\n this.ready(function () {\n eventsToTrigger.forEach(function (type) {\n this.trigger(type);\n }, this);\n });\n }\n /**\n * Set whether we are scrubbing or not.\n * This is used to decide whether we should use `fastSeek` or not.\n * `fastSeek` is used to provide trick play on Safari browsers.\n *\n * @param {boolean} isScrubbing\n * - true for we are currently scrubbing\n * - false for we are no longer scrubbing\n */\n ;\n\n _proto.setScrubbing = function setScrubbing(isScrubbing) {\n this.isScrubbing_ = isScrubbing;\n }\n /**\n * Get whether we are scrubbing or not.\n *\n * @return {boolean} isScrubbing\n * - true for we are currently scrubbing\n * - false for we are no longer scrubbing\n */\n ;\n\n _proto.scrubbing = function scrubbing() {\n return this.isScrubbing_;\n }\n /**\n * Set current time for the `HTML5` tech.\n *\n * @param {number} seconds\n * Set the current time of the media to this.\n */\n ;\n\n _proto.setCurrentTime = function setCurrentTime(seconds) {\n try {\n if (this.isScrubbing_ && this.el_.fastSeek && IS_ANY_SAFARI) {\n this.el_.fastSeek(seconds);\n } else {\n this.el_.currentTime = seconds;\n }\n } catch (e) {\n log$1(e, 'Video is not ready. (Video.js)'); // this.warning(VideoJS.warnings.videoNotReady);\n }\n }\n /**\n * Get the current duration of the HTML5 media element.\n *\n * @return {number}\n * The duration of the media or 0 if there is no duration.\n */\n ;\n\n _proto.duration = function duration() {\n var _this5 = this;\n\n // Android Chrome will report duration as Infinity for VOD HLS until after\n // playback has started, which triggers the live display erroneously.\n // Return NaN if playback has not started and trigger a durationupdate once\n // the duration can be reliably known.\n if (this.el_.duration === Infinity && IS_ANDROID && IS_CHROME && this.el_.currentTime === 0) {\n // Wait for the first `timeupdate` with currentTime > 0 - there may be\n // several with 0\n var checkProgress = function checkProgress() {\n if (_this5.el_.currentTime > 0) {\n // Trigger durationchange for genuinely live video\n if (_this5.el_.duration === Infinity) {\n _this5.trigger('durationchange');\n }\n\n _this5.off('timeupdate', checkProgress);\n }\n };\n\n this.on('timeupdate', checkProgress);\n return NaN;\n }\n\n return this.el_.duration || NaN;\n }\n /**\n * Get the current width of the HTML5 media element.\n *\n * @return {number}\n * The width of the HTML5 media element.\n */\n ;\n\n _proto.width = function width() {\n return this.el_.offsetWidth;\n }\n /**\n * Get the current height of the HTML5 media element.\n *\n * @return {number}\n * The height of the HTML5 media element.\n */\n ;\n\n _proto.height = function height() {\n return this.el_.offsetHeight;\n }\n /**\n * Proxy iOS `webkitbeginfullscreen` and `webkitendfullscreen` into\n * `fullscreenchange` event.\n *\n * @private\n * @fires fullscreenchange\n * @listens webkitendfullscreen\n * @listens webkitbeginfullscreen\n * @listens webkitbeginfullscreen\n */\n ;\n\n _proto.proxyWebkitFullscreen_ = function proxyWebkitFullscreen_() {\n var _this6 = this;\n\n if (!('webkitDisplayingFullscreen' in this.el_)) {\n return;\n }\n\n var endFn = function endFn() {\n this.trigger('fullscreenchange', {\n isFullscreen: false\n });\n };\n\n var beginFn = function beginFn() {\n if ('webkitPresentationMode' in this.el_ && this.el_.webkitPresentationMode !== 'picture-in-picture') {\n this.one('webkitendfullscreen', endFn);\n this.trigger('fullscreenchange', {\n isFullscreen: true,\n // set a flag in case another tech triggers fullscreenchange\n nativeIOSFullscreen: true\n });\n }\n };\n\n this.on('webkitbeginfullscreen', beginFn);\n this.on('dispose', function () {\n _this6.off('webkitbeginfullscreen', beginFn);\n\n _this6.off('webkitendfullscreen', endFn);\n });\n }\n /**\n * Check if fullscreen is supported on the current playback device.\n *\n * @return {boolean}\n * - True if fullscreen is supported.\n * - False if fullscreen is not supported.\n */\n ;\n\n _proto.supportsFullScreen = function supportsFullScreen() {\n if (typeof this.el_.webkitEnterFullScreen === 'function') {\n var userAgent = window_default.a.navigator && window_default.a.navigator.userAgent || ''; // Seems to be broken in Chromium/Chrome && Safari in Leopard\n\n if (/Android/.test(userAgent) || !/Chrome|Mac OS X 10.5/.test(userAgent)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Request that the `HTML5` Tech enter fullscreen.\n */\n ;\n\n _proto.enterFullScreen = function enterFullScreen() {\n var video = this.el_;\n\n if (video.paused && video.networkState <= video.HAVE_METADATA) {\n // attempt to prime the video element for programmatic access\n // this isn't necessary on the desktop but shouldn't hurt\n silencePromise(this.el_.play()); // playing and pausing synchronously during the transition to fullscreen\n // can get iOS ~6.1 devices into a play/pause loop\n\n this.setTimeout(function () {\n video.pause();\n\n try {\n video.webkitEnterFullScreen();\n } catch (e) {\n this.trigger('fullscreenerror', e);\n }\n }, 0);\n } else {\n try {\n video.webkitEnterFullScreen();\n } catch (e) {\n this.trigger('fullscreenerror', e);\n }\n }\n }\n /**\n * Request that the `HTML5` Tech exit fullscreen.\n */\n ;\n\n _proto.exitFullScreen = function exitFullScreen() {\n if (!this.el_.webkitDisplayingFullscreen) {\n this.trigger('fullscreenerror', new Error('The video is not fullscreen'));\n return;\n }\n\n this.el_.webkitExitFullScreen();\n }\n /**\n * Create a floating video window always on top of other windows so that users may\n * continue consuming media while they interact with other content sites, or\n * applications on their device.\n *\n * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n *\n * @return {Promise}\n * A promise with a Picture-in-Picture window.\n */\n ;\n\n _proto.requestPictureInPicture = function requestPictureInPicture() {\n return this.el_.requestPictureInPicture();\n }\n /**\n * A getter/setter for the `Html5` Tech's source object.\n * > Note: Please use {@link Html5#setSource}\n *\n * @param {Tech~SourceObject} [src]\n * The source object you want to set on the `HTML5` techs element.\n *\n * @return {Tech~SourceObject|undefined}\n * - The current source object when a source is not passed in.\n * - undefined when setting\n *\n * @deprecated Since version 5.\n */\n ;\n\n _proto.src = function src(_src) {\n if (_src === undefined) {\n return this.el_.src;\n } // Setting src through `src` instead of `setSrc` will be deprecated\n\n\n this.setSrc(_src);\n }\n /**\n * Reset the tech by removing all sources and then calling\n * {@link Html5.resetMediaElement}.\n */\n ;\n\n _proto.reset = function reset() {\n Html5.resetMediaElement(this.el_);\n }\n /**\n * Get the current source on the `HTML5` Tech. Falls back to returning the source from\n * the HTML5 media element.\n *\n * @return {Tech~SourceObject}\n * The current source object from the HTML5 tech. With a fallback to the\n * elements source.\n */\n ;\n\n _proto.currentSrc = function currentSrc() {\n if (this.currentSource_) {\n return this.currentSource_.src;\n }\n\n return this.el_.currentSrc;\n }\n /**\n * Set controls attribute for the HTML5 media Element.\n *\n * @param {string} val\n * Value to set the controls attribute to\n */\n ;\n\n _proto.setControls = function setControls(val) {\n this.el_.controls = !!val;\n }\n /**\n * Create and returns a remote {@link TextTrack} object.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @return {TextTrack}\n * The TextTrack that gets created.\n */\n ;\n\n _proto.addTextTrack = function addTextTrack(kind, label, language) {\n if (!this.featuresNativeTextTracks) {\n return _Tech.prototype.addTextTrack.call(this, kind, label, language);\n }\n\n return this.el_.addTextTrack(kind, label, language);\n }\n /**\n * Creates either native TextTrack or an emulated TextTrack depending\n * on the value of `featuresNativeTextTracks`\n *\n * @param {Object} options\n * The object should contain the options to initialize the TextTrack with.\n *\n * @param {string} [options.kind]\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n *\n * @param {string} [options.label]\n * Label to identify the text track\n *\n * @param {string} [options.language]\n * Two letter language abbreviation.\n *\n * @param {boolean} [options.default]\n * Default this track to on.\n *\n * @param {string} [options.id]\n * The internal id to assign this track.\n *\n * @param {string} [options.src]\n * A source url for the track.\n *\n * @return {HTMLTrackElement}\n * The track element that gets created.\n */\n ;\n\n _proto.createRemoteTextTrack = function createRemoteTextTrack(options) {\n if (!this.featuresNativeTextTracks) {\n return _Tech.prototype.createRemoteTextTrack.call(this, options);\n }\n\n var htmlTrackElement = document_default.a.createElement('track');\n\n if (options.kind) {\n htmlTrackElement.kind = options.kind;\n }\n\n if (options.label) {\n htmlTrackElement.label = options.label;\n }\n\n if (options.language || options.srclang) {\n htmlTrackElement.srclang = options.language || options.srclang;\n }\n\n if (options[\"default\"]) {\n htmlTrackElement[\"default\"] = options[\"default\"];\n }\n\n if (options.id) {\n htmlTrackElement.id = options.id;\n }\n\n if (options.src) {\n htmlTrackElement.src = options.src;\n }\n\n return htmlTrackElement;\n }\n /**\n * Creates a remote text track object and returns an html track element.\n *\n * @param {Object} options The object should contain values for\n * kind, language, label, and src (location of the WebVTT file)\n * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be\n * automatically removed from the video element whenever the source changes\n * @return {HTMLTrackElement} An Html Track Element.\n * This can be an emulated {@link HTMLTrackElement} or a native one.\n * @deprecated The default value of the \"manualCleanup\" parameter will default\n * to \"false\" in upcoming versions of Video.js\n */\n ;\n\n _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n var htmlTrackElement = _Tech.prototype.addRemoteTextTrack.call(this, options, manualCleanup);\n\n if (this.featuresNativeTextTracks) {\n this.el().appendChild(htmlTrackElement);\n }\n\n return htmlTrackElement;\n }\n /**\n * Remove remote `TextTrack` from `TextTrackList` object\n *\n * @param {TextTrack} track\n * `TextTrack` object to remove\n */\n ;\n\n _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {\n _Tech.prototype.removeRemoteTextTrack.call(this, track);\n\n if (this.featuresNativeTextTracks) {\n var tracks = this.$$('track');\n var i = tracks.length;\n\n while (i--) {\n if (track === tracks[i] || track === tracks[i].track) {\n this.el().removeChild(tracks[i]);\n }\n }\n }\n }\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object}\n * An object with supported media playback quality metrics\n */\n ;\n\n _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n if (typeof this.el().getVideoPlaybackQuality === 'function') {\n return this.el().getVideoPlaybackQuality();\n }\n\n var videoPlaybackQuality = {};\n\n if (typeof this.el().webkitDroppedFrameCount !== 'undefined' && typeof this.el().webkitDecodedFrameCount !== 'undefined') {\n videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;\n videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;\n }\n\n if (window_default.a.performance && typeof window_default.a.performance.now === 'function') {\n videoPlaybackQuality.creationTime = window_default.a.performance.now();\n } else if (window_default.a.performance && window_default.a.performance.timing && typeof window_default.a.performance.timing.navigationStart === 'number') {\n videoPlaybackQuality.creationTime = window_default.a.Date.now() - window_default.a.performance.timing.navigationStart;\n }\n\n return videoPlaybackQuality;\n };\n\n return Html5;\n}(video_es_Tech);\n/* HTML5 Support Testing ---------------------------------------------------- */\n\n/**\n * Element for testing browser HTML5 media capabilities\n *\n * @type {Element}\n * @constant\n * @private\n */\n\n\ndefineLazyProperty(video_es_Html5, 'TEST_VID', function () {\n if (!isReal()) {\n return;\n }\n\n var video = document_default.a.createElement('video');\n var track = document_default.a.createElement('track');\n track.kind = 'captions';\n track.srclang = 'en';\n track.label = 'English';\n video.appendChild(track);\n return video;\n});\n/**\n * Check if HTML5 media is supported by this browser/device.\n *\n * @return {boolean}\n * - True if HTML5 media is supported.\n * - False if HTML5 media is not supported.\n */\n\nvideo_es_Html5.isSupported = function () {\n // IE with no Media Player is a LIAR! (#984)\n try {\n video_es_Html5.TEST_VID.volume = 0.5;\n } catch (e) {\n return false;\n }\n\n return !!(video_es_Html5.TEST_VID && video_es_Html5.TEST_VID.canPlayType);\n};\n/**\n * Check if the tech can support the given type\n *\n * @param {string} type\n * The mimetype to check\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n\n\nvideo_es_Html5.canPlayType = function (type) {\n return video_es_Html5.TEST_VID.canPlayType(type);\n};\n/**\n * Check if the tech can support the given source\n *\n * @param {Object} srcObj\n * The source object\n * @param {Object} options\n * The options passed to the tech\n * @return {string} 'probably', 'maybe', or '' (empty string)\n */\n\n\nvideo_es_Html5.canPlaySource = function (srcObj, options) {\n return video_es_Html5.canPlayType(srcObj.type);\n};\n/**\n * Check if the volume can be changed in this browser/device.\n * Volume cannot be changed in a lot of mobile devices.\n * Specifically, it can't be changed from 1 on iOS.\n *\n * @return {boolean}\n * - True if volume can be controlled\n * - False otherwise\n */\n\n\nvideo_es_Html5.canControlVolume = function () {\n // IE will error if Windows Media Player not installed #3315\n try {\n var volume = video_es_Html5.TEST_VID.volume;\n video_es_Html5.TEST_VID.volume = volume / 2 + 0.1;\n return volume !== video_es_Html5.TEST_VID.volume;\n } catch (e) {\n return false;\n }\n};\n/**\n * Check if the volume can be muted in this browser/device.\n * Some devices, e.g. iOS, don't allow changing volume\n * but permits muting/unmuting.\n *\n * @return {bolean}\n * - True if volume can be muted\n * - False otherwise\n */\n\n\nvideo_es_Html5.canMuteVolume = function () {\n try {\n var muted = video_es_Html5.TEST_VID.muted; // in some versions of iOS muted property doesn't always\n // work, so we want to set both property and attribute\n\n video_es_Html5.TEST_VID.muted = !muted;\n\n if (video_es_Html5.TEST_VID.muted) {\n setAttribute(video_es_Html5.TEST_VID, 'muted', 'muted');\n } else {\n removeAttribute(video_es_Html5.TEST_VID, 'muted', 'muted');\n }\n\n return muted !== video_es_Html5.TEST_VID.muted;\n } catch (e) {\n return false;\n }\n};\n/**\n * Check if the playback rate can be changed in this browser/device.\n *\n * @return {boolean}\n * - True if playback rate can be controlled\n * - False otherwise\n */\n\n\nvideo_es_Html5.canControlPlaybackRate = function () {\n // Playback rate API is implemented in Android Chrome, but doesn't do anything\n // https://github.com/videojs/video.js/issues/3180\n if (IS_ANDROID && IS_CHROME && CHROME_VERSION < 58) {\n return false;\n } // IE will error if Windows Media Player not installed #3315\n\n\n try {\n var playbackRate = video_es_Html5.TEST_VID.playbackRate;\n video_es_Html5.TEST_VID.playbackRate = playbackRate / 2 + 0.1;\n return playbackRate !== video_es_Html5.TEST_VID.playbackRate;\n } catch (e) {\n return false;\n }\n};\n/**\n * Check if we can override a video/audio elements attributes, with\n * Object.defineProperty.\n *\n * @return {boolean}\n * - True if builtin attributes can be overridden\n * - False otherwise\n */\n\n\nvideo_es_Html5.canOverrideAttributes = function () {\n // if we cannot overwrite the src/innerHTML property, there is no support\n // iOS 7 safari for instance cannot do this.\n try {\n var noop = function noop() {};\n\n Object.defineProperty(document_default.a.createElement('video'), 'src', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document_default.a.createElement('audio'), 'src', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document_default.a.createElement('video'), 'innerHTML', {\n get: noop,\n set: noop\n });\n Object.defineProperty(document_default.a.createElement('audio'), 'innerHTML', {\n get: noop,\n set: noop\n });\n } catch (e) {\n return false;\n }\n\n return true;\n};\n/**\n * Check to see if native `TextTrack`s are supported by this browser/device.\n *\n * @return {boolean}\n * - True if native `TextTrack`s are supported.\n * - False otherwise\n */\n\n\nvideo_es_Html5.supportsNativeTextTracks = function () {\n return IS_ANY_SAFARI || IS_IOS && IS_CHROME;\n};\n/**\n * Check to see if native `VideoTrack`s are supported by this browser/device\n *\n * @return {boolean}\n * - True if native `VideoTrack`s are supported.\n * - False otherwise\n */\n\n\nvideo_es_Html5.supportsNativeVideoTracks = function () {\n return !!(video_es_Html5.TEST_VID && video_es_Html5.TEST_VID.videoTracks);\n};\n/**\n * Check to see if native `AudioTrack`s are supported by this browser/device\n *\n * @return {boolean}\n * - True if native `AudioTrack`s are supported.\n * - False otherwise\n */\n\n\nvideo_es_Html5.supportsNativeAudioTracks = function () {\n return !!(video_es_Html5.TEST_VID && video_es_Html5.TEST_VID.audioTracks);\n};\n/**\n * An array of events available on the Html5 tech.\n *\n * @private\n * @type {Array}\n */\n\n\nvideo_es_Html5.Events = ['loadstart', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'seeking', 'seeked', 'ended', 'durationchange', 'timeupdate', 'progress', 'play', 'pause', 'ratechange', 'resize', 'volumechange'];\n/**\n * Boolean indicating whether the `Tech` supports volume control.\n *\n * @type {boolean}\n * @default {@link Html5.canControlVolume}\n */\n\n/**\n * Boolean indicating whether the `Tech` supports muting volume.\n *\n * @type {bolean}\n * @default {@link Html5.canMuteVolume}\n */\n\n/**\n * Boolean indicating whether the `Tech` supports changing the speed at which the media\n * plays. Examples:\n * - Set player to play 2x (twice) as fast\n * - Set player to play 0.5x (half) as fast\n *\n * @type {boolean}\n * @default {@link Html5.canControlPlaybackRate}\n */\n\n/**\n * Boolean indicating whether the `Tech` supports the `sourceset` event.\n *\n * @type {boolean}\n * @default\n */\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `TextTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeTextTracks}\n */\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `VideoTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeVideoTracks}\n */\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports native `AudioTrack`s.\n *\n * @type {boolean}\n * @default {@link Html5.supportsNativeAudioTracks}\n */\n\n[['featuresVolumeControl', 'canControlVolume'], ['featuresMuteControl', 'canMuteVolume'], ['featuresPlaybackRate', 'canControlPlaybackRate'], ['featuresSourceset', 'canOverrideAttributes'], ['featuresNativeTextTracks', 'supportsNativeTextTracks'], ['featuresNativeVideoTracks', 'supportsNativeVideoTracks'], ['featuresNativeAudioTracks', 'supportsNativeAudioTracks']].forEach(function (_ref) {\n var key = _ref[0],\n fn = _ref[1];\n defineLazyProperty(video_es_Html5.prototype, key, function () {\n return video_es_Html5[fn]();\n }, true);\n});\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the media element\n * moving in the DOM. iOS breaks if you move the media element, so this is set this to\n * false there. Everywhere else this should be true.\n *\n * @type {boolean}\n * @default\n */\n\nvideo_es_Html5.prototype.movingMediaElementInDOM = !IS_IOS; // TODO: Previous comment: No longer appears to be used. Can probably be removed.\n// Is this true?\n\n/**\n * Boolean indicating whether the `HTML5` tech currently supports automatic media resize\n * when going into fullscreen.\n *\n * @type {boolean}\n * @default\n */\n\nvideo_es_Html5.prototype.featuresFullscreenResize = true;\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the progress event.\n * If this is false, manual `progress` events will be triggered instead.\n *\n * @type {boolean}\n * @default\n */\n\nvideo_es_Html5.prototype.featuresProgressEvents = true;\n/**\n * Boolean indicating whether the `HTML5` tech currently supports the timeupdate event.\n * If this is false, manual `timeupdate` events will be triggered instead.\n *\n * @default\n */\n\nvideo_es_Html5.prototype.featuresTimeupdateEvents = true; // HTML5 Feature detection and Device Fixes --------------------------------- //\n\nvar video_es_canPlayType;\n\nvideo_es_Html5.patchCanPlayType = function () {\n // Android 4.0 and above can play HLS to some extent but it reports being unable to do so\n // Firefox and Chrome report correctly\n if (ANDROID_VERSION >= 4.0 && !IS_FIREFOX && !IS_CHROME) {\n video_es_canPlayType = video_es_Html5.TEST_VID && video_es_Html5.TEST_VID.constructor.prototype.canPlayType;\n\n video_es_Html5.TEST_VID.constructor.prototype.canPlayType = function (type) {\n var mpegurlRE = /^application\\/(?:x-|vnd\\.apple\\.)mpegurl/i;\n\n if (type && mpegurlRE.test(type)) {\n return 'maybe';\n }\n\n return video_es_canPlayType.call(this, type);\n };\n }\n};\n\nvideo_es_Html5.unpatchCanPlayType = function () {\n var r = video_es_Html5.TEST_VID.constructor.prototype.canPlayType;\n\n if (video_es_canPlayType) {\n video_es_Html5.TEST_VID.constructor.prototype.canPlayType = video_es_canPlayType;\n }\n\n return r;\n}; // by default, patch the media element\n\n\nvideo_es_Html5.patchCanPlayType();\n\nvideo_es_Html5.disposeMediaElement = function (el) {\n if (!el) {\n return;\n }\n\n if (el.parentNode) {\n el.parentNode.removeChild(el);\n } // remove any child track or source nodes to prevent their loading\n\n\n while (el.hasChildNodes()) {\n el.removeChild(el.firstChild);\n } // remove any src reference. not setting `src=''` because that causes a warning\n // in firefox\n\n\n el.removeAttribute('src'); // force the media element to update its loading state by calling load()\n // however IE on Windows 7N has a bug that throws an error so need a try/catch (#793)\n\n if (typeof el.load === 'function') {\n // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)\n (function () {\n try {\n el.load();\n } catch (e) {// not supported\n }\n })();\n }\n};\n\nvideo_es_Html5.resetMediaElement = function (el) {\n if (!el) {\n return;\n }\n\n var sources = el.querySelectorAll('source');\n var i = sources.length;\n\n while (i--) {\n el.removeChild(sources[i]);\n } // remove any src reference.\n // not setting `src=''` because that throws an error\n\n\n el.removeAttribute('src');\n\n if (typeof el.load === 'function') {\n // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473)\n (function () {\n try {\n el.load();\n } catch (e) {// satisfy linter\n }\n })();\n }\n};\n/* Native HTML5 element property wrapping ----------------------------------- */\n// Wrap native boolean attributes with getters that check both property and attribute\n// The list is as followed:\n// muted, defaultMuted, autoplay, controls, loop, playsinline\n\n\n[\n/**\n * Get the value of `muted` from the media element. `muted` indicates\n * that the volume for the media should be set to silent. This does not actually change\n * the `volume` attribute.\n *\n * @method Html5#muted\n * @return {boolean}\n * - True if the value of `volume` should be ignored and the audio set to silent.\n * - False if the value of `volume` should be used.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}\n */\n'muted',\n/**\n * Get the value of `defaultMuted` from the media element. `defaultMuted` indicates\n * whether the media should start muted or not. Only changes the default state of the\n * media. `muted` and `defaultMuted` can have different values. {@link Html5#muted} indicates the\n * current state.\n *\n * @method Html5#defaultMuted\n * @return {boolean}\n * - The value of `defaultMuted` from the media element.\n * - True indicates that the media should start muted.\n * - False indicates that the media should not start muted\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}\n */\n'defaultMuted',\n/**\n * Get the value of `autoplay` from the media element. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Html5#autoplay\n * @return {boolean}\n * - The value of `autoplay` from the media element.\n * - True indicates that the media should start as soon as the page loads.\n * - False indicates that the media should not start as soon as the page loads.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}\n */\n'autoplay',\n/**\n * Get the value of `controls` from the media element. `controls` indicates\n * whether the native media controls should be shown or hidden.\n *\n * @method Html5#controls\n * @return {boolean}\n * - The value of `controls` from the media element.\n * - True indicates that native controls should be showing.\n * - False indicates that native controls should be hidden.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-controls}\n */\n'controls',\n/**\n * Get the value of `loop` from the media element. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Html5#loop\n * @return {boolean}\n * - The value of `loop` from the media element.\n * - True indicates that playback should seek back to start once\n * the end of a media is reached.\n * - False indicates that playback should not loop back to the start when the\n * end of the media is reached.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}\n */\n'loop',\n/**\n * Get the value of `playsinline` from the media element. `playsinline` indicates\n * to the browser that non-fullscreen playback is preferred when fullscreen\n * playback is the native default, such as in iOS Safari.\n *\n * @method Html5#playsinline\n * @return {boolean}\n * - The value of `playsinline` from the media element.\n * - True indicates that the media should play inline.\n * - False indicates that the media should not play inline.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n'playsinline'].forEach(function (prop) {\n video_es_Html5.prototype[prop] = function () {\n return this.el_[prop] || this.el_.hasAttribute(prop);\n };\n}); // Wrap native boolean attributes with setters that set both property and attribute\n// The list is as followed:\n// setMuted, setDefaultMuted, setAutoplay, setLoop, setPlaysinline\n// setControls is special-cased above\n\n[\n/**\n * Set the value of `muted` on the media element. `muted` indicates that the current\n * audio level should be silent.\n *\n * @method Html5#setMuted\n * @param {boolean} muted\n * - True if the audio should be set to silent\n * - False otherwise\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted}\n */\n'muted',\n/**\n * Set the value of `defaultMuted` on the media element. `defaultMuted` indicates that the current\n * audio level should be silent, but will only effect the muted level on initial playback..\n *\n * @method Html5.prototype.setDefaultMuted\n * @param {boolean} defaultMuted\n * - True if the audio should be set to silent\n * - False otherwise\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted}\n */\n'defaultMuted',\n/**\n * Set the value of `autoplay` on the media element. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Html5#setAutoplay\n * @param {boolean} autoplay\n * - True indicates that the media should start as soon as the page loads.\n * - False indicates that the media should not start as soon as the page loads.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay}\n */\n'autoplay',\n/**\n * Set the value of `loop` on the media element. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Html5#setLoop\n * @param {boolean} loop\n * - True indicates that playback should seek back to start once\n * the end of a media is reached.\n * - False indicates that playback should not loop back to the start when the\n * end of the media is reached.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop}\n */\n'loop',\n/**\n * Set the value of `playsinline` from the media element. `playsinline` indicates\n * to the browser that non-fullscreen playback is preferred when fullscreen\n * playback is the native default, such as in iOS Safari.\n *\n * @method Html5#setPlaysinline\n * @param {boolean} playsinline\n * - True indicates that the media should play inline.\n * - False indicates that the media should not play inline.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n'playsinline'].forEach(function (prop) {\n video_es_Html5.prototype['set' + toTitleCase$1(prop)] = function (v) {\n this.el_[prop] = v;\n\n if (v) {\n this.el_.setAttribute(prop, prop);\n } else {\n this.el_.removeAttribute(prop);\n }\n };\n}); // Wrap native properties with a getter\n// The list is as followed\n// paused, currentTime, buffered, volume, poster, preload, error, seeking\n// seekable, ended, playbackRate, defaultPlaybackRate, disablePictureInPicture\n// played, networkState, readyState, videoWidth, videoHeight, crossOrigin\n\n[\n/**\n * Get the value of `paused` from the media element. `paused` indicates whether the media element\n * is currently paused or not.\n *\n * @method Html5#paused\n * @return {boolean}\n * The value of `paused` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-paused}\n */\n'paused',\n/**\n * Get the value of `currentTime` from the media element. `currentTime` indicates\n * the current second that the media is at in playback.\n *\n * @method Html5#currentTime\n * @return {number}\n * The value of `currentTime` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-currenttime}\n */\n'currentTime',\n/**\n * Get the value of `buffered` from the media element. `buffered` is a `TimeRange`\n * object that represents the parts of the media that are already downloaded and\n * available for playback.\n *\n * @method Html5#buffered\n * @return {TimeRange}\n * The value of `buffered` from the media element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-buffered}\n */\n'buffered',\n/**\n * Get the value of `volume` from the media element. `volume` indicates\n * the current playback volume of audio for a media. `volume` will be a value from 0\n * (silent) to 1 (loudest and default).\n *\n * @method Html5#volume\n * @return {number}\n * The value of `volume` from the media element. Value will be between 0-1.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}\n */\n'volume',\n/**\n * Get the value of `poster` from the media element. `poster` indicates\n * that the url of an image file that can/will be shown when no media data is available.\n *\n * @method Html5#poster\n * @return {string}\n * The value of `poster` from the media element. Value will be a url to an\n * image.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster}\n */\n'poster',\n/**\n * Get the value of `preload` from the media element. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n * media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n * interaction\n *\n * @method Html5#preload\n * @return {string}\n * The value of `preload` from the media element. Will be 'none', 'metadata',\n * or 'auto'.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}\n */\n'preload',\n/**\n * Get the value of the `error` from the media element. `error` indicates any\n * MediaError that may have occurred during playback. If error returns null there is no\n * current error.\n *\n * @method Html5#error\n * @return {MediaError|null}\n * The value of `error` from the media element. Will be `MediaError` if there\n * is a current error and null otherwise.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-error}\n */\n'error',\n/**\n * Get the value of `seeking` from the media element. `seeking` indicates whether the\n * media is currently seeking to a new position or not.\n *\n * @method Html5#seeking\n * @return {boolean}\n * - The value of `seeking` from the media element.\n * - True indicates that the media is currently seeking to a new position.\n * - False indicates that the media is not seeking to a new position at this time.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seeking}\n */\n'seeking',\n/**\n * Get the value of `seekable` from the media element. `seekable` returns a\n * `TimeRange` object indicating ranges of time that can currently be `seeked` to.\n *\n * @method Html5#seekable\n * @return {TimeRange}\n * The value of `seekable` from the media element. A `TimeRange` object\n * indicating the current ranges of time that can be seeked to.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seekable}\n */\n'seekable',\n/**\n * Get the value of `ended` from the media element. `ended` indicates whether\n * the media has reached the end or not.\n *\n * @method Html5#ended\n * @return {boolean}\n * - The value of `ended` from the media element.\n * - True indicates that the media has ended.\n * - False indicates that the media has not ended.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended}\n */\n'ended',\n/**\n * Get the value of `playbackRate` from the media element. `playbackRate` indicates\n * the rate at which the media is currently playing back. Examples:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5#playbackRate\n * @return {number}\n * The value of `playbackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'playbackRate',\n/**\n * Get the value of `defaultPlaybackRate` from the media element. `defaultPlaybackRate` indicates\n * the rate at which the media is currently playing back. This value will not indicate the current\n * `playbackRate` after playback has started, use {@link Html5#playbackRate} for that.\n *\n * Examples:\n * - if defaultPlaybackRate is set to 2, media will play twice as fast.\n * - if defaultPlaybackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5.prototype.defaultPlaybackRate\n * @return {number}\n * The value of `defaultPlaybackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'defaultPlaybackRate',\n/**\n * Get the value of 'disablePictureInPicture' from the video element.\n *\n * @method Html5#disablePictureInPicture\n * @return {boolean} value\n * - The value of `disablePictureInPicture` from the video element.\n * - True indicates that the video can't be played in Picture-In-Picture mode\n * - False indicates that the video can be played in Picture-In-Picture mode\n *\n * @see [Spec]{@link https://w3c.github.io/picture-in-picture/#disable-pip}\n */\n'disablePictureInPicture',\n/**\n * Get the value of `played` from the media element. `played` returns a `TimeRange`\n * object representing points in the media timeline that have been played.\n *\n * @method Html5#played\n * @return {TimeRange}\n * The value of `played` from the media element. A `TimeRange` object indicating\n * the ranges of time that have been played.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-played}\n */\n'played',\n/**\n * Get the value of `networkState` from the media element. `networkState` indicates\n * the current network state. It returns an enumeration from the following list:\n * - 0: NETWORK_EMPTY\n * - 1: NETWORK_IDLE\n * - 2: NETWORK_LOADING\n * - 3: NETWORK_NO_SOURCE\n *\n * @method Html5#networkState\n * @return {number}\n * The value of `networkState` from the media element. This will be a number\n * from the list in the description.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-networkstate}\n */\n'networkState',\n/**\n * Get the value of `readyState` from the media element. `readyState` indicates\n * the current state of the media element. It returns an enumeration from the\n * following list:\n * - 0: HAVE_NOTHING\n * - 1: HAVE_METADATA\n * - 2: HAVE_CURRENT_DATA\n * - 3: HAVE_FUTURE_DATA\n * - 4: HAVE_ENOUGH_DATA\n *\n * @method Html5#readyState\n * @return {number}\n * The value of `readyState` from the media element. This will be a number\n * from the list in the description.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#ready-states}\n */\n'readyState',\n/**\n * Get the value of `videoWidth` from the video element. `videoWidth` indicates\n * the current width of the video in css pixels.\n *\n * @method Html5#videoWidth\n * @return {number}\n * The value of `videoWidth` from the video element. This will be a number\n * in css pixels.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}\n */\n'videoWidth',\n/**\n * Get the value of `videoHeight` from the video element. `videoHeight` indicates\n * the current height of the video in css pixels.\n *\n * @method Html5#videoHeight\n * @return {number}\n * The value of `videoHeight` from the video element. This will be a number\n * in css pixels.\n *\n * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth}\n */\n'videoHeight',\n/**\n * Get the value of `crossOrigin` from the media element. `crossOrigin` indicates\n * to the browser that should sent the cookies along with the requests for the\n * different assets/playlists\n *\n * @method Html5#crossOrigin\n * @return {string}\n * - anonymous indicates that the media should not sent cookies.\n * - use-credentials indicates that the media should sent cookies along the requests.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-media-crossorigin}\n */\n'crossOrigin'].forEach(function (prop) {\n video_es_Html5.prototype[prop] = function () {\n return this.el_[prop];\n };\n}); // Wrap native properties with a setter in this format:\n// set + toTitleCase(name)\n// The list is as follows:\n// setVolume, setSrc, setPoster, setPreload, setPlaybackRate, setDefaultPlaybackRate,\n// setDisablePictureInPicture, setCrossOrigin\n\n[\n/**\n * Set the value of `volume` on the media element. `volume` indicates the current\n * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and\n * so on.\n *\n * @method Html5#setVolume\n * @param {number} percentAsDecimal\n * The volume percent as a decimal. Valid range is from 0-1.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume}\n */\n'volume',\n/**\n * Set the value of `src` on the media element. `src` indicates the current\n * {@link Tech~SourceObject} for the media.\n *\n * @method Html5#setSrc\n * @param {Tech~SourceObject} src\n * The source object to set as the current source.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-src}\n */\n'src',\n/**\n * Set the value of `poster` on the media element. `poster` is the url to\n * an image file that can/will be shown when no media data is available.\n *\n * @method Html5#setPoster\n * @param {string} poster\n * The url to an image that should be used as the `poster` for the media\n * element.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-poster}\n */\n'poster',\n/**\n * Set the value of `preload` on the media element. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n * media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n * interaction\n *\n * @method Html5#setPreload\n * @param {string} preload\n * The value of `preload` to set on the media element. Must be 'none', 'metadata',\n * or 'auto'.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload}\n */\n'preload',\n/**\n * Set the value of `playbackRate` on the media element. `playbackRate` indicates\n * the rate at which the media should play back. Examples:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5#setPlaybackRate\n * @return {number}\n * The value of `playbackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate}\n */\n'playbackRate',\n/**\n * Set the value of `defaultPlaybackRate` on the media element. `defaultPlaybackRate` indicates\n * the rate at which the media should play back upon initial startup. Changing this value\n * after a video has started will do nothing. Instead you should used {@link Html5#setPlaybackRate}.\n *\n * Example Values:\n * - if playbackRate is set to 2, media will play twice as fast.\n * - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Html5.prototype.setDefaultPlaybackRate\n * @return {number}\n * The value of `defaultPlaybackRate` from the media element. A number indicating\n * the current playback speed of the media, where 1 is normal speed.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultplaybackrate}\n */\n'defaultPlaybackRate',\n/**\n * Prevents the browser from suggesting a Picture-in-Picture context menu\n * or to request Picture-in-Picture automatically in some cases.\n *\n * @method Html5#setDisablePictureInPicture\n * @param {boolean} value\n * The true value will disable Picture-in-Picture mode.\n *\n * @see [Spec]{@link https://w3c.github.io/picture-in-picture/#disable-pip}\n */\n'disablePictureInPicture',\n/**\n * Set the value of `crossOrigin` from the media element. `crossOrigin` indicates\n * to the browser that should sent the cookies along with the requests for the\n * different assets/playlists\n *\n * @method Html5#setCrossOrigin\n * @param {string} crossOrigin\n * - anonymous indicates that the media should not sent cookies.\n * - use-credentials indicates that the media should sent cookies along the requests.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-media-crossorigin}\n */\n'crossOrigin'].forEach(function (prop) {\n video_es_Html5.prototype['set' + toTitleCase$1(prop)] = function (v) {\n this.el_[prop] = v;\n };\n}); // wrap native functions with a function\n// The list is as follows:\n// pause, load, play\n\n[\n/**\n * A wrapper around the media elements `pause` function. This will call the `HTML5`\n * media elements `pause` function.\n *\n * @method Html5#pause\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-pause}\n */\n'pause',\n/**\n * A wrapper around the media elements `load` function. This will call the `HTML5`s\n * media element `load` function.\n *\n * @method Html5#load\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-load}\n */\n'load',\n/**\n * A wrapper around the media elements `play` function. This will call the `HTML5`s\n * media element `play` function.\n *\n * @method Html5#play\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-play}\n */\n'play'].forEach(function (prop) {\n video_es_Html5.prototype[prop] = function () {\n return this.el_[prop]();\n };\n});\nvideo_es_Tech.withSourceHandlers(video_es_Html5);\n/**\n * Native source handler for Html5, simply passes the source to the media element.\n *\n * @property {Tech~SourceObject} source\n * The source object\n *\n * @property {Html5} tech\n * The instance of the HTML5 tech.\n */\n\nvideo_es_Html5.nativeSourceHandler = {};\n/**\n * Check if the media element can play the given mime type.\n *\n * @param {string} type\n * The mimetype to check\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n\nvideo_es_Html5.nativeSourceHandler.canPlayType = function (type) {\n // IE without MediaPlayer throws an error (#519)\n try {\n return video_es_Html5.TEST_VID.canPlayType(type);\n } catch (e) {\n return '';\n }\n};\n/**\n * Check if the media element can handle a source natively.\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Object} [options]\n * Options to be passed to the tech.\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string).\n */\n\n\nvideo_es_Html5.nativeSourceHandler.canHandleSource = function (source, options) {\n // If a type was provided we should rely on that\n if (source.type) {\n return video_es_Html5.nativeSourceHandler.canPlayType(source.type); // If no type, fall back to checking 'video/[EXTENSION]'\n } else if (source.src) {\n var ext = getFileExtension(source.src);\n return video_es_Html5.nativeSourceHandler.canPlayType(\"video/\" + ext);\n }\n\n return '';\n};\n/**\n * Pass the source to the native media element.\n *\n * @param {Tech~SourceObject} source\n * The source object\n *\n * @param {Html5} tech\n * The instance of the Html5 tech\n *\n * @param {Object} [options]\n * The options to pass to the source\n */\n\n\nvideo_es_Html5.nativeSourceHandler.handleSource = function (source, tech, options) {\n tech.setSrc(source.src);\n};\n/**\n * A noop for the native dispose function, as cleanup is not needed.\n */\n\n\nvideo_es_Html5.nativeSourceHandler.dispose = function () {}; // Register the native source handler\n\n\nvideo_es_Html5.registerSourceHandler(video_es_Html5.nativeSourceHandler);\nvideo_es_Tech.registerTech('Html5', video_es_Html5);\n\n// on the player when they happen\n\nvar TECH_EVENTS_RETRIGGER = [\n/**\n * Fired while the user agent is downloading media data.\n *\n * @event Player#progress\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `progress` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechProgress_\n * @fires Player#progress\n * @listens Tech#progress\n */\n'progress',\n/**\n * Fires when the loading of an audio/video is aborted.\n *\n * @event Player#abort\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `abort` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechAbort_\n * @fires Player#abort\n * @listens Tech#abort\n */\n'abort',\n/**\n * Fires when the browser is intentionally not getting media data.\n *\n * @event Player#suspend\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `suspend` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechSuspend_\n * @fires Player#suspend\n * @listens Tech#suspend\n */\n'suspend',\n/**\n * Fires when the current playlist is empty.\n *\n * @event Player#emptied\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `emptied` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechEmptied_\n * @fires Player#emptied\n * @listens Tech#emptied\n */\n'emptied',\n/**\n * Fires when the browser is trying to get media data, but data is not available.\n *\n * @event Player#stalled\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `stalled` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechStalled_\n * @fires Player#stalled\n * @listens Tech#stalled\n */\n'stalled',\n/**\n * Fires when the browser has loaded meta data for the audio/video.\n *\n * @event Player#loadedmetadata\n * @type {EventTarget~Event}\n */\n\n/**\n * Retrigger the `stalled` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechLoadedmetadata_\n * @fires Player#loadedmetadata\n * @listens Tech#loadedmetadata\n */\n'loadedmetadata',\n/**\n * Fires when the browser has loaded the current frame of the audio/video.\n *\n * @event Player#loadeddata\n * @type {event}\n */\n\n/**\n * Retrigger the `loadeddata` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechLoaddeddata_\n * @fires Player#loadeddata\n * @listens Tech#loadeddata\n */\n'loadeddata',\n/**\n * Fires when the current playback position has changed.\n *\n * @event Player#timeupdate\n * @type {event}\n */\n\n/**\n * Retrigger the `timeupdate` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechTimeUpdate_\n * @fires Player#timeupdate\n * @listens Tech#timeupdate\n */\n'timeupdate',\n/**\n * Fires when the video's intrinsic dimensions change\n *\n * @event Player#resize\n * @type {event}\n */\n\n/**\n * Retrigger the `resize` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechResize_\n * @fires Player#resize\n * @listens Tech#resize\n */\n'resize',\n/**\n * Fires when the volume has been changed\n *\n * @event Player#volumechange\n * @type {event}\n */\n\n/**\n * Retrigger the `volumechange` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechVolumechange_\n * @fires Player#volumechange\n * @listens Tech#volumechange\n */\n'volumechange',\n/**\n * Fires when the text track has been changed\n *\n * @event Player#texttrackchange\n * @type {event}\n */\n\n/**\n * Retrigger the `texttrackchange` event that was triggered by the {@link Tech}.\n *\n * @private\n * @method Player#handleTechTexttrackchange_\n * @fires Player#texttrackchange\n * @listens Tech#texttrackchange\n */\n'texttrackchange']; // events to queue when playback rate is zero\n// this is a hash for the sole purpose of mapping non-camel-cased event names\n// to camel-cased function names\n\nvar TECH_EVENTS_QUEUE = {\n canplay: 'CanPlay',\n canplaythrough: 'CanPlayThrough',\n playing: 'Playing',\n seeked: 'Seeked'\n};\nvar BREAKPOINT_ORDER = ['tiny', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'huge'];\nvar BREAKPOINT_CLASSES = {}; // grep: vjs-layout-tiny\n// grep: vjs-layout-x-small\n// grep: vjs-layout-small\n// grep: vjs-layout-medium\n// grep: vjs-layout-large\n// grep: vjs-layout-x-large\n// grep: vjs-layout-huge\n\nBREAKPOINT_ORDER.forEach(function (k) {\n var v = k.charAt(0) === 'x' ? \"x-\" + k.substring(1) : k;\n BREAKPOINT_CLASSES[k] = \"vjs-layout-\" + v;\n});\nvar DEFAULT_BREAKPOINTS = {\n tiny: 210,\n xsmall: 320,\n small: 425,\n medium: 768,\n large: 1440,\n xlarge: 2560,\n huge: Infinity\n};\n/**\n * An instance of the `Player` class is created when any of the Video.js setup methods\n * are used to initialize a video.\n *\n * After an instance has been created it can be accessed globally in two ways:\n * 1. By calling `videojs('example_video_1');`\n * 2. By using it directly via `videojs.players.example_video_1;`\n *\n * @extends Component\n */\n\nvar video_es_Player = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(Player, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Element} tag\n * The original video DOM element used for configuring options.\n *\n * @param {Object} [options]\n * Object of option names and values.\n *\n * @param {Component~ReadyCallback} [ready]\n * Ready callback function.\n */\n function Player(tag, options, ready) {\n var _this;\n\n // Make sure tag ID exists\n tag.id = tag.id || options.id || \"vjs_video_\" + newGUID(); // Set Options\n // The options argument overrides options set in the video tag\n // which overrides globally set options.\n // This latter part coincides with the load order\n // (tag must exist before Player)\n\n options = video_es_assign(Player.getTagSettings(tag), options); // Delay the initialization of children because we need to set up\n // player properties first, and can't use `this` before `super()`\n\n options.initChildren = false; // Same with creating the element\n\n options.createEl = false; // don't auto mixin the evented mixin\n\n options.evented = false; // we don't want the player to report touch activity on itself\n // see enableTouchActivity in Component\n\n options.reportTouchActivity = false; // If language is not set, get the closest lang attribute\n\n if (!options.language) {\n if (typeof tag.closest === 'function') {\n var closest = tag.closest('[lang]');\n\n if (closest && closest.getAttribute) {\n options.language = closest.getAttribute('lang');\n }\n } else {\n var element = tag;\n\n while (element && element.nodeType === 1) {\n if (getAttributes(element).hasOwnProperty('lang')) {\n options.language = element.getAttribute('lang');\n break;\n }\n\n element = element.parentNode;\n }\n }\n } // Run base component initializing with new options\n\n\n _this = _Component.call(this, null, options, ready) || this; // Create bound methods for document listeners.\n\n _this.boundDocumentFullscreenChange_ = function (e) {\n return _this.documentFullscreenChange_(e);\n };\n\n _this.boundFullWindowOnEscKey_ = function (e) {\n return _this.fullWindowOnEscKey(e);\n };\n\n _this.boundUpdateStyleEl_ = function (e) {\n return _this.updateStyleEl_(e);\n };\n\n _this.boundApplyInitTime_ = function (e) {\n return _this.applyInitTime_(e);\n };\n\n _this.boundUpdateCurrentBreakpoint_ = function (e) {\n return _this.updateCurrentBreakpoint_(e);\n };\n\n _this.boundHandleTechClick_ = function (e) {\n return _this.handleTechClick_(e);\n };\n\n _this.boundHandleTechDoubleClick_ = function (e) {\n return _this.handleTechDoubleClick_(e);\n };\n\n _this.boundHandleTechTouchStart_ = function (e) {\n return _this.handleTechTouchStart_(e);\n };\n\n _this.boundHandleTechTouchMove_ = function (e) {\n return _this.handleTechTouchMove_(e);\n };\n\n _this.boundHandleTechTouchEnd_ = function (e) {\n return _this.handleTechTouchEnd_(e);\n };\n\n _this.boundHandleTechTap_ = function (e) {\n return _this.handleTechTap_(e);\n }; // default isFullscreen_ to false\n\n\n _this.isFullscreen_ = false; // create logger\n\n _this.log = createLogger(_this.id_); // Hold our own reference to fullscreen api so it can be mocked in tests\n\n _this.fsApi_ = FullscreenApi; // Tracks when a tech changes the poster\n\n _this.isPosterFromTech_ = false; // Holds callback info that gets queued when playback rate is zero\n // and a seek is happening\n\n _this.queuedCallbacks_ = []; // Turn off API access because we're loading a new tech that might load asynchronously\n\n _this.isReady_ = false; // Init state hasStarted_\n\n _this.hasStarted_ = false; // Init state userActive_\n\n _this.userActive_ = false; // Init debugEnabled_\n\n _this.debugEnabled_ = false; // if the global option object was accidentally blown away by\n // someone, bail early with an informative error\n\n if (!_this.options_ || !_this.options_.techOrder || !_this.options_.techOrder.length) {\n throw new Error('No techOrder specified. Did you overwrite ' + 'videojs.options instead of just changing the ' + 'properties you want to override?');\n } // Store the original tag used to set options\n\n\n _this.tag = tag; // Store the tag attributes used to restore html5 element\n\n _this.tagAttributes = tag && getAttributes(tag); // Update current language\n\n _this.language(_this.options_.language); // Update Supported Languages\n\n\n if (options.languages) {\n // Normalise player option languages to lowercase\n var languagesToLower = {};\n Object.getOwnPropertyNames(options.languages).forEach(function (name) {\n languagesToLower[name.toLowerCase()] = options.languages[name];\n });\n _this.languages_ = languagesToLower;\n } else {\n _this.languages_ = Player.prototype.options_.languages;\n }\n\n _this.resetCache_(); // Set poster\n\n\n _this.poster_ = options.poster || ''; // Set controls\n\n _this.controls_ = !!options.controls; // Original tag settings stored in options\n // now remove immediately so native controls don't flash.\n // May be turned back on by HTML5 tech if nativeControlsForTouch is true\n\n tag.controls = false;\n tag.removeAttribute('controls');\n _this.changingSrc_ = false;\n _this.playCallbacks_ = [];\n _this.playTerminatedQueue_ = []; // the attribute overrides the option\n\n if (tag.hasAttribute('autoplay')) {\n _this.autoplay(true);\n } else {\n // otherwise use the setter to validate and\n // set the correct value.\n _this.autoplay(_this.options_.autoplay);\n } // check plugins\n\n\n if (options.plugins) {\n Object.keys(options.plugins).forEach(function (name) {\n if (typeof _this[name] !== 'function') {\n throw new Error(\"plugin \\\"\" + name + \"\\\" does not exist\");\n }\n });\n }\n /*\n * Store the internal state of scrubbing\n *\n * @private\n * @return {Boolean} True if the user is scrubbing\n */\n\n\n _this.scrubbing_ = false;\n _this.el_ = _this.createEl(); // Make this an evented object and use `el_` as its event bus.\n\n evented(assertThisInitialized_default()(_this), {\n eventBusKey: 'el_'\n }); // listen to document and player fullscreenchange handlers so we receive those events\n // before a user can receive them so we can update isFullscreen appropriately.\n // make sure that we listen to fullscreenchange events before everything else to make sure that\n // our isFullscreen method is updated properly for internal components as well as external.\n\n if (_this.fsApi_.requestFullscreen) {\n on(document_default.a, _this.fsApi_.fullscreenchange, _this.boundDocumentFullscreenChange_);\n\n _this.on(_this.fsApi_.fullscreenchange, _this.boundDocumentFullscreenChange_);\n }\n\n if (_this.fluid_) {\n _this.on(['playerreset', 'resize'], _this.boundUpdateStyleEl_);\n } // We also want to pass the original player options to each component and plugin\n // as well so they don't need to reach back into the player for options later.\n // We also need to do another copy of this.options_ so we don't end up with\n // an infinite loop.\n\n\n var playerOptionsCopy = mergeOptions$3(_this.options_); // Load plugins\n\n if (options.plugins) {\n Object.keys(options.plugins).forEach(function (name) {\n _this[name](options.plugins[name]);\n });\n } // Enable debug mode to fire debugon event for all plugins.\n\n\n if (options.debug) {\n _this.debug(true);\n }\n\n _this.options_.playerOptions = playerOptionsCopy;\n _this.middleware_ = [];\n\n _this.playbackRates(options.playbackRates);\n\n _this.initChildren(); // Set isAudio based on whether or not an audio tag was used\n\n\n _this.isAudio(tag.nodeName.toLowerCase() === 'audio'); // Update controls className. Can't do this when the controls are initially\n // set because the element doesn't exist yet.\n\n\n if (_this.controls()) {\n _this.addClass('vjs-controls-enabled');\n } else {\n _this.addClass('vjs-controls-disabled');\n } // Set ARIA label and region role depending on player type\n\n\n _this.el_.setAttribute('role', 'region');\n\n if (_this.isAudio()) {\n _this.el_.setAttribute('aria-label', _this.localize('Audio Player'));\n } else {\n _this.el_.setAttribute('aria-label', _this.localize('Video Player'));\n }\n\n if (_this.isAudio()) {\n _this.addClass('vjs-audio');\n }\n\n if (_this.flexNotSupported_()) {\n _this.addClass('vjs-no-flex');\n } // TODO: Make this smarter. Toggle user state between touching/mousing\n // using events, since devices can have both touch and mouse events.\n // TODO: Make this check be performed again when the window switches between monitors\n // (See https://github.com/videojs/video.js/issues/5683)\n\n\n if (TOUCH_ENABLED) {\n _this.addClass('vjs-touch-enabled');\n } // iOS Safari has broken hover handling\n\n\n if (!IS_IOS) {\n _this.addClass('vjs-workinghover');\n } // Make player easily findable by ID\n\n\n Player.players[_this.id_] = assertThisInitialized_default()(_this); // Add a major version class to aid css in plugins\n\n var majorVersion = version$5.split('.')[0];\n\n _this.addClass(\"vjs-v\" + majorVersion); // When the player is first initialized, trigger activity so components\n // like the control bar show themselves if needed\n\n\n _this.userActive(true);\n\n _this.reportUserActivity();\n\n _this.one('play', function (e) {\n return _this.listenForUserActivity_(e);\n });\n\n _this.on('stageclick', function (e) {\n return _this.handleStageClick_(e);\n });\n\n _this.on('keydown', function (e) {\n return _this.handleKeyDown(e);\n });\n\n _this.on('languagechange', function (e) {\n return _this.handleLanguagechange(e);\n });\n\n _this.breakpoints(_this.options_.breakpoints);\n\n _this.responsive(_this.options_.responsive);\n\n return _this;\n }\n /**\n * Destroys the video player and does any necessary cleanup.\n *\n * This is especially helpful if you are dynamically adding and removing videos\n * to/from the DOM.\n *\n * @fires Player#dispose\n */\n\n\n var _proto = Player.prototype;\n\n _proto.dispose = function dispose() {\n var _this2 = this;\n\n /**\n * Called when the player is being disposed of.\n *\n * @event Player#dispose\n * @type {EventTarget~Event}\n */\n this.trigger('dispose'); // prevent dispose from being called twice\n\n this.off('dispose'); // Make sure all player-specific document listeners are unbound. This is\n\n off(document_default.a, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);\n off(document_default.a, 'keydown', this.boundFullWindowOnEscKey_);\n\n if (this.styleEl_ && this.styleEl_.parentNode) {\n this.styleEl_.parentNode.removeChild(this.styleEl_);\n this.styleEl_ = null;\n } // Kill reference to this player\n\n\n Player.players[this.id_] = null;\n\n if (this.tag && this.tag.player) {\n this.tag.player = null;\n }\n\n if (this.el_ && this.el_.player) {\n this.el_.player = null;\n }\n\n if (this.tech_) {\n this.tech_.dispose();\n this.isPosterFromTech_ = false;\n this.poster_ = '';\n }\n\n if (this.playerElIngest_) {\n this.playerElIngest_ = null;\n }\n\n if (this.tag) {\n this.tag = null;\n }\n\n clearCacheForPlayer(this); // remove all event handlers for track lists\n // all tracks and track listeners are removed on\n // tech dispose\n\n ALL.names.forEach(function (name) {\n var props = ALL[name];\n\n var list = _this2[props.getterName](); // if it is not a native list\n // we have to manually remove event listeners\n\n\n if (list && list.off) {\n list.off();\n }\n }); // the actual .el_ is removed here\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Create the `Player`'s DOM element.\n *\n * @return {Element}\n * The DOM element that gets created.\n */\n ;\n\n _proto.createEl = function createEl() {\n var tag = this.tag;\n var el;\n var playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player');\n var divEmbed = this.tag.tagName.toLowerCase() === 'video-js';\n\n if (playerElIngest) {\n el = this.el_ = tag.parentNode;\n } else if (!divEmbed) {\n el = this.el_ = _Component.prototype.createEl.call(this, 'div');\n } // Copy over all the attributes from the tag, including ID and class\n // ID will now reference player box, not the video tag\n\n\n var attrs = getAttributes(tag);\n\n if (divEmbed) {\n el = this.el_ = tag;\n tag = this.tag = document_default.a.createElement('video');\n\n while (el.children.length) {\n tag.appendChild(el.firstChild);\n }\n\n if (!hasClass(el, 'video-js')) {\n addClass(el, 'video-js');\n }\n\n el.appendChild(tag);\n playerElIngest = this.playerElIngest_ = el; // move properties over from our custom `video-js` element\n // to our new `video` element. This will move things like\n // `src` or `controls` that were set via js before the player\n // was initialized.\n\n Object.keys(el).forEach(function (k) {\n try {\n tag[k] = el[k];\n } catch (e) {// we got a a property like outerHTML which we can't actually copy, ignore it\n }\n });\n } // set tabindex to -1 to remove the video element from the focus order\n\n\n tag.setAttribute('tabindex', '-1');\n attrs.tabindex = '-1'; // Workaround for #4583 (JAWS+IE doesn't announce BPB or play button), and\n // for the same issue with Chrome (on Windows) with JAWS.\n // See https://github.com/FreedomScientific/VFO-standards-support/issues/78\n // Note that we can't detect if JAWS is being used, but this ARIA attribute\n // doesn't change behavior of IE11 or Chrome if JAWS is not being used\n\n if (IE_VERSION || IS_CHROME && IS_WINDOWS) {\n tag.setAttribute('role', 'application');\n attrs.role = 'application';\n } // Remove width/height attrs from tag so CSS can make it 100% width/height\n\n\n tag.removeAttribute('width');\n tag.removeAttribute('height');\n\n if ('width' in attrs) {\n delete attrs.width;\n }\n\n if ('height' in attrs) {\n delete attrs.height;\n }\n\n Object.getOwnPropertyNames(attrs).forEach(function (attr) {\n // don't copy over the class attribute to the player element when we're in a div embed\n // the class is already set up properly in the divEmbed case\n // and we want to make sure that the `video-js` class doesn't get lost\n if (!(divEmbed && attr === 'class')) {\n el.setAttribute(attr, attrs[attr]);\n }\n\n if (divEmbed) {\n tag.setAttribute(attr, attrs[attr]);\n }\n }); // Update tag id/class for use as HTML5 playback tech\n // Might think we should do this after embedding in container so .vjs-tech class\n // doesn't flash 100% width/height, but class only applies with .video-js parent\n\n tag.playerId = tag.id;\n tag.id += '_html5_api';\n tag.className = 'vjs-tech'; // Make player findable on elements\n\n tag.player = el.player = this; // Default state of video is paused\n\n this.addClass('vjs-paused'); // Add a style element in the player that we'll use to set the width/height\n // of the player in a way that's still overrideable by CSS, just like the\n // video element\n\n if (window_default.a.VIDEOJS_NO_DYNAMIC_STYLE !== true) {\n this.styleEl_ = video_es_createStyleElement('vjs-styles-dimensions');\n var defaultsStyleEl = $('.vjs-styles-defaults');\n var head = $('head');\n head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);\n }\n\n this.fill_ = false;\n this.fluid_ = false; // Pass in the width/height/aspectRatio options which will update the style el\n\n this.width(this.options_.width);\n this.height(this.options_.height);\n this.fill(this.options_.fill);\n this.fluid(this.options_.fluid);\n this.aspectRatio(this.options_.aspectRatio); // support both crossOrigin and crossorigin to reduce confusion and issues around the name\n\n this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin); // Hide any links within the video/audio tag,\n // because IE doesn't hide them completely from screen readers.\n\n var links = tag.getElementsByTagName('a');\n\n for (var i = 0; i < links.length; i++) {\n var linkEl = links.item(i);\n addClass(linkEl, 'vjs-hidden');\n linkEl.setAttribute('hidden', 'hidden');\n } // insertElFirst seems to cause the networkState to flicker from 3 to 2, so\n // keep track of the original for later so we can know if the source originally failed\n\n\n tag.initNetworkState_ = tag.networkState; // Wrap video tag in div (el/box) container\n\n if (tag.parentNode && !playerElIngest) {\n tag.parentNode.insertBefore(el, tag);\n } // insert the tag as the first child of the player element\n // then manually add it to the children array so that this.addChild\n // will work properly for other components\n //\n // Breaks iPhone, fixed in HTML5 setup.\n\n\n prependTo(tag, el);\n this.children_.unshift(tag); // Set lang attr on player to ensure CSS :lang() in consistent with player\n // if it's been set to something different to the doc\n\n this.el_.setAttribute('lang', this.language_);\n this.el_ = el;\n return el;\n }\n /**\n * Get or set the `Player`'s crossOrigin option. For the HTML5 player, this\n * sets the `crossOrigin` property on the `<video>` tag to control the CORS\n * behavior.\n *\n * @see [Video Element Attributes]{@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-crossorigin}\n *\n * @param {string} [value]\n * The value to set the `Player`'s crossOrigin to. If an argument is\n * given, must be one of `anonymous` or `use-credentials`.\n *\n * @return {string|undefined}\n * - The current crossOrigin value of the `Player` when getting.\n * - undefined when setting\n */\n ;\n\n _proto.crossOrigin = function crossOrigin(value) {\n if (!value) {\n return this.techGet_('crossOrigin');\n }\n\n if (value !== 'anonymous' && value !== 'use-credentials') {\n log$1.warn(\"crossOrigin must be \\\"anonymous\\\" or \\\"use-credentials\\\", given \\\"\" + value + \"\\\"\");\n return;\n }\n\n this.techCall_('setCrossOrigin', value);\n return;\n }\n /**\n * A getter/setter for the `Player`'s width. Returns the player's configured value.\n * To get the current width use `currentWidth()`.\n *\n * @param {number} [value]\n * The value to set the `Player`'s width to.\n *\n * @return {number}\n * The current width of the `Player` when getting.\n */\n ;\n\n _proto.width = function width(value) {\n return this.dimension('width', value);\n }\n /**\n * A getter/setter for the `Player`'s height. Returns the player's configured value.\n * To get the current height use `currentheight()`.\n *\n * @param {number} [value]\n * The value to set the `Player`'s heigth to.\n *\n * @return {number}\n * The current height of the `Player` when getting.\n */\n ;\n\n _proto.height = function height(value) {\n return this.dimension('height', value);\n }\n /**\n * A getter/setter for the `Player`'s width & height.\n *\n * @param {string} dimension\n * This string can be:\n * - 'width'\n * - 'height'\n *\n * @param {number} [value]\n * Value for dimension specified in the first argument.\n *\n * @return {number}\n * The dimension arguments value when getting (width/height).\n */\n ;\n\n _proto.dimension = function dimension(_dimension, value) {\n var privDimension = _dimension + '_';\n\n if (value === undefined) {\n return this[privDimension] || 0;\n }\n\n if (value === '' || value === 'auto') {\n // If an empty string is given, reset the dimension to be automatic\n this[privDimension] = undefined;\n this.updateStyleEl_();\n return;\n }\n\n var parsedVal = parseFloat(value);\n\n if (isNaN(parsedVal)) {\n log$1.error(\"Improper value \\\"\" + value + \"\\\" supplied for for \" + _dimension);\n return;\n }\n\n this[privDimension] = parsedVal;\n this.updateStyleEl_();\n }\n /**\n * A getter/setter/toggler for the vjs-fluid `className` on the `Player`.\n *\n * Turning this on will turn off fill mode.\n *\n * @param {boolean} [bool]\n * - A value of true adds the class.\n * - A value of false removes the class.\n * - No value will be a getter.\n *\n * @return {boolean|undefined}\n * - The value of fluid when getting.\n * - `undefined` when setting.\n */\n ;\n\n _proto.fluid = function fluid(bool) {\n var _this3 = this;\n\n if (bool === undefined) {\n return !!this.fluid_;\n }\n\n this.fluid_ = !!bool;\n\n if (isEvented(this)) {\n this.off(['playerreset', 'resize'], this.boundUpdateStyleEl_);\n }\n\n if (bool) {\n this.addClass('vjs-fluid');\n this.fill(false);\n addEventedCallback(this, function () {\n _this3.on(['playerreset', 'resize'], _this3.boundUpdateStyleEl_);\n });\n } else {\n this.removeClass('vjs-fluid');\n }\n\n this.updateStyleEl_();\n }\n /**\n * A getter/setter/toggler for the vjs-fill `className` on the `Player`.\n *\n * Turning this on will turn off fluid mode.\n *\n * @param {boolean} [bool]\n * - A value of true adds the class.\n * - A value of false removes the class.\n * - No value will be a getter.\n *\n * @return {boolean|undefined}\n * - The value of fluid when getting.\n * - `undefined` when setting.\n */\n ;\n\n _proto.fill = function fill(bool) {\n if (bool === undefined) {\n return !!this.fill_;\n }\n\n this.fill_ = !!bool;\n\n if (bool) {\n this.addClass('vjs-fill');\n this.fluid(false);\n } else {\n this.removeClass('vjs-fill');\n }\n }\n /**\n * Get/Set the aspect ratio\n *\n * @param {string} [ratio]\n * Aspect ratio for player\n *\n * @return {string|undefined}\n * returns the current aspect ratio when getting\n */\n\n /**\n * A getter/setter for the `Player`'s aspect ratio.\n *\n * @param {string} [ratio]\n * The value to set the `Player`'s aspect ratio to.\n *\n * @return {string|undefined}\n * - The current aspect ratio of the `Player` when getting.\n * - undefined when setting\n */\n ;\n\n _proto.aspectRatio = function aspectRatio(ratio) {\n if (ratio === undefined) {\n return this.aspectRatio_;\n } // Check for width:height format\n\n\n if (!/^\\d+\\:\\d+$/.test(ratio)) {\n throw new Error('Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.');\n }\n\n this.aspectRatio_ = ratio; // We're assuming if you set an aspect ratio you want fluid mode,\n // because in fixed mode you could calculate width and height yourself.\n\n this.fluid(true);\n this.updateStyleEl_();\n }\n /**\n * Update styles of the `Player` element (height, width and aspect ratio).\n *\n * @private\n * @listens Tech#loadedmetadata\n */\n ;\n\n _proto.updateStyleEl_ = function updateStyleEl_() {\n if (window_default.a.VIDEOJS_NO_DYNAMIC_STYLE === true) {\n var _width = typeof this.width_ === 'number' ? this.width_ : this.options_.width;\n\n var _height = typeof this.height_ === 'number' ? this.height_ : this.options_.height;\n\n var techEl = this.tech_ && this.tech_.el();\n\n if (techEl) {\n if (_width >= 0) {\n techEl.width = _width;\n }\n\n if (_height >= 0) {\n techEl.height = _height;\n }\n }\n\n return;\n }\n\n var width;\n var height;\n var aspectRatio;\n var idClass; // The aspect ratio is either used directly or to calculate width and height.\n\n if (this.aspectRatio_ !== undefined && this.aspectRatio_ !== 'auto') {\n // Use any aspectRatio that's been specifically set\n aspectRatio = this.aspectRatio_;\n } else if (this.videoWidth() > 0) {\n // Otherwise try to get the aspect ratio from the video metadata\n aspectRatio = this.videoWidth() + ':' + this.videoHeight();\n } else {\n // Or use a default. The video element's is 2:1, but 16:9 is more common.\n aspectRatio = '16:9';\n } // Get the ratio as a decimal we can use to calculate dimensions\n\n\n var ratioParts = aspectRatio.split(':');\n var ratioMultiplier = ratioParts[1] / ratioParts[0];\n\n if (this.width_ !== undefined) {\n // Use any width that's been specifically set\n width = this.width_;\n } else if (this.height_ !== undefined) {\n // Or calulate the width from the aspect ratio if a height has been set\n width = this.height_ / ratioMultiplier;\n } else {\n // Or use the video's metadata, or use the video el's default of 300\n width = this.videoWidth() || 300;\n }\n\n if (this.height_ !== undefined) {\n // Use any height that's been specifically set\n height = this.height_;\n } else {\n // Otherwise calculate the height from the ratio and the width\n height = width * ratioMultiplier;\n } // Ensure the CSS class is valid by starting with an alpha character\n\n\n if (/^[^a-zA-Z]/.test(this.id())) {\n idClass = 'dimensions-' + this.id();\n } else {\n idClass = this.id() + '-dimensions';\n } // Ensure the right class is still on the player for the style element\n\n\n this.addClass(idClass);\n setTextContent(this.styleEl_, \"\\n .\" + idClass + \" {\\n width: \" + width + \"px;\\n height: \" + height + \"px;\\n }\\n\\n .\" + idClass + \".vjs-fluid {\\n padding-top: \" + ratioMultiplier * 100 + \"%;\\n }\\n \");\n }\n /**\n * Load/Create an instance of playback {@link Tech} including element\n * and API methods. Then append the `Tech` element in `Player` as a child.\n *\n * @param {string} techName\n * name of the playback technology\n *\n * @param {string} source\n * video source\n *\n * @private\n */\n ;\n\n _proto.loadTech_ = function loadTech_(techName, source) {\n var _this4 = this;\n\n // Pause and remove current playback technology\n if (this.tech_) {\n this.unloadTech_();\n }\n\n var titleTechName = toTitleCase$1(techName);\n var camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1); // get rid of the HTML5 video tag as soon as we are using another tech\n\n if (titleTechName !== 'Html5' && this.tag) {\n video_es_Tech.getTech('Html5').disposeMediaElement(this.tag);\n this.tag.player = null;\n this.tag = null;\n }\n\n this.techName_ = titleTechName; // Turn off API access because we're loading a new tech that might load asynchronously\n\n this.isReady_ = false;\n var autoplay = this.autoplay(); // if autoplay is a string (or `true` with normalizeAutoplay: true) we pass false to the tech\n // because the player is going to handle autoplay on `loadstart`\n\n if (typeof this.autoplay() === 'string' || this.autoplay() === true && this.options_.normalizeAutoplay) {\n autoplay = false;\n } // Grab tech-specific options from player options and add source and parent element to use.\n\n\n var techOptions = {\n source: source,\n autoplay: autoplay,\n 'nativeControlsForTouch': this.options_.nativeControlsForTouch,\n 'playerId': this.id(),\n 'techId': this.id() + \"_\" + camelTechName + \"_api\",\n 'playsinline': this.options_.playsinline,\n 'preload': this.options_.preload,\n 'loop': this.options_.loop,\n 'disablePictureInPicture': this.options_.disablePictureInPicture,\n 'muted': this.options_.muted,\n 'poster': this.poster(),\n 'language': this.language(),\n 'playerElIngest': this.playerElIngest_ || false,\n 'vtt.js': this.options_['vtt.js'],\n 'canOverridePoster': !!this.options_.techCanOverridePoster,\n 'enableSourceset': this.options_.enableSourceset,\n 'Promise': this.options_.Promise\n };\n ALL.names.forEach(function (name) {\n var props = ALL[name];\n techOptions[props.getterName] = _this4[props.privateName];\n });\n video_es_assign(techOptions, this.options_[titleTechName]);\n video_es_assign(techOptions, this.options_[camelTechName]);\n video_es_assign(techOptions, this.options_[techName.toLowerCase()]);\n\n if (this.tag) {\n techOptions.tag = this.tag;\n }\n\n if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {\n techOptions.startTime = this.cache_.currentTime;\n } // Initialize tech instance\n\n\n var TechClass = video_es_Tech.getTech(techName);\n\n if (!TechClass) {\n throw new Error(\"No Tech named '\" + titleTechName + \"' exists! '\" + titleTechName + \"' should be registered using videojs.registerTech()'\");\n }\n\n this.tech_ = new TechClass(techOptions); // player.triggerReady is always async, so don't need this to be async\n\n this.tech_.ready(bind(this, this.handleTechReady_), true);\n textTrackConverter.jsonToTextTracks(this.textTracksJson_ || [], this.tech_); // Listen to all HTML5-defined events and trigger them on the player\n\n TECH_EVENTS_RETRIGGER.forEach(function (event) {\n _this4.on(_this4.tech_, event, function (e) {\n return _this4[\"handleTech\" + toTitleCase$1(event) + \"_\"](e);\n });\n });\n Object.keys(TECH_EVENTS_QUEUE).forEach(function (event) {\n _this4.on(_this4.tech_, event, function (eventObj) {\n if (_this4.tech_.playbackRate() === 0 && _this4.tech_.seeking()) {\n _this4.queuedCallbacks_.push({\n callback: _this4[\"handleTech\" + TECH_EVENTS_QUEUE[event] + \"_\"].bind(_this4),\n event: eventObj\n });\n\n return;\n }\n\n _this4[\"handleTech\" + TECH_EVENTS_QUEUE[event] + \"_\"](eventObj);\n });\n });\n this.on(this.tech_, 'loadstart', function (e) {\n return _this4.handleTechLoadStart_(e);\n });\n this.on(this.tech_, 'sourceset', function (e) {\n return _this4.handleTechSourceset_(e);\n });\n this.on(this.tech_, 'waiting', function (e) {\n return _this4.handleTechWaiting_(e);\n });\n this.on(this.tech_, 'ended', function (e) {\n return _this4.handleTechEnded_(e);\n });\n this.on(this.tech_, 'seeking', function (e) {\n return _this4.handleTechSeeking_(e);\n });\n this.on(this.tech_, 'play', function (e) {\n return _this4.handleTechPlay_(e);\n });\n this.on(this.tech_, 'firstplay', function (e) {\n return _this4.handleTechFirstPlay_(e);\n });\n this.on(this.tech_, 'pause', function (e) {\n return _this4.handleTechPause_(e);\n });\n this.on(this.tech_, 'durationchange', function (e) {\n return _this4.handleTechDurationChange_(e);\n });\n this.on(this.tech_, 'fullscreenchange', function (e, data) {\n return _this4.handleTechFullscreenChange_(e, data);\n });\n this.on(this.tech_, 'fullscreenerror', function (e, err) {\n return _this4.handleTechFullscreenError_(e, err);\n });\n this.on(this.tech_, 'enterpictureinpicture', function (e) {\n return _this4.handleTechEnterPictureInPicture_(e);\n });\n this.on(this.tech_, 'leavepictureinpicture', function (e) {\n return _this4.handleTechLeavePictureInPicture_(e);\n });\n this.on(this.tech_, 'error', function (e) {\n return _this4.handleTechError_(e);\n });\n this.on(this.tech_, 'posterchange', function (e) {\n return _this4.handleTechPosterChange_(e);\n });\n this.on(this.tech_, 'textdata', function (e) {\n return _this4.handleTechTextData_(e);\n });\n this.on(this.tech_, 'ratechange', function (e) {\n return _this4.handleTechRateChange_(e);\n });\n this.on(this.tech_, 'loadedmetadata', this.boundUpdateStyleEl_);\n this.usingNativeControls(this.techGet_('controls'));\n\n if (this.controls() && !this.usingNativeControls()) {\n this.addTechControlsListeners_();\n } // Add the tech element in the DOM if it was not already there\n // Make sure to not insert the original video element if using Html5\n\n\n if (this.tech_.el().parentNode !== this.el() && (titleTechName !== 'Html5' || !this.tag)) {\n prependTo(this.tech_.el(), this.el());\n } // Get rid of the original video tag reference after the first tech is loaded\n\n\n if (this.tag) {\n this.tag.player = null;\n this.tag = null;\n }\n }\n /**\n * Unload and dispose of the current playback {@link Tech}.\n *\n * @private\n */\n ;\n\n _proto.unloadTech_ = function unloadTech_() {\n var _this5 = this;\n\n // Save the current text tracks so that we can reuse the same text tracks with the next tech\n ALL.names.forEach(function (name) {\n var props = ALL[name];\n _this5[props.privateName] = _this5[props.getterName]();\n });\n this.textTracksJson_ = textTrackConverter.textTracksToJson(this.tech_);\n this.isReady_ = false;\n this.tech_.dispose();\n this.tech_ = false;\n\n if (this.isPosterFromTech_) {\n this.poster_ = '';\n this.trigger('posterchange');\n }\n\n this.isPosterFromTech_ = false;\n }\n /**\n * Return a reference to the current {@link Tech}.\n * It will print a warning by default about the danger of using the tech directly\n * but any argument that is passed in will silence the warning.\n *\n * @param {*} [safety]\n * Anything passed in to silence the warning\n *\n * @return {Tech}\n * The Tech\n */\n ;\n\n _proto.tech = function tech(safety) {\n if (safety === undefined) {\n log$1.warn('Using the tech directly can be dangerous. I hope you know what you\\'re doing.\\n' + 'See https://github.com/videojs/video.js/issues/2617 for more info.\\n');\n }\n\n return this.tech_;\n }\n /**\n * Set up click and touch listeners for the playback element\n *\n * - On desktops: a click on the video itself will toggle playback\n * - On mobile devices: a click on the video toggles controls\n * which is done by toggling the user state between active and\n * inactive\n * - A tap can signal that a user has become active or has become inactive\n * e.g. a quick tap on an iPhone movie should reveal the controls. Another\n * quick tap should hide them again (signaling the user is in an inactive\n * viewing state)\n * - In addition to this, we still want the user to be considered inactive after\n * a few seconds of inactivity.\n *\n * > Note: the only part of iOS interaction we can't mimic with this setup\n * is a touch and hold on the video element counting as activity in order to\n * keep the controls showing, but that shouldn't be an issue. A touch and hold\n * on any controls will still keep the user active\n *\n * @private\n */\n ;\n\n _proto.addTechControlsListeners_ = function addTechControlsListeners_() {\n // Make sure to remove all the previous listeners in case we are called multiple times.\n this.removeTechControlsListeners_();\n this.on(this.tech_, 'click', this.boundHandleTechClick_);\n this.on(this.tech_, 'dblclick', this.boundHandleTechDoubleClick_); // If the controls were hidden we don't want that to change without a tap event\n // so we'll check if the controls were already showing before reporting user\n // activity\n\n this.on(this.tech_, 'touchstart', this.boundHandleTechTouchStart_);\n this.on(this.tech_, 'touchmove', this.boundHandleTechTouchMove_);\n this.on(this.tech_, 'touchend', this.boundHandleTechTouchEnd_); // The tap listener needs to come after the touchend listener because the tap\n // listener cancels out any reportedUserActivity when setting userActive(false)\n\n this.on(this.tech_, 'tap', this.boundHandleTechTap_);\n }\n /**\n * Remove the listeners used for click and tap controls. This is needed for\n * toggling to controls disabled, where a tap/touch should do nothing.\n *\n * @private\n */\n ;\n\n _proto.removeTechControlsListeners_ = function removeTechControlsListeners_() {\n // We don't want to just use `this.off()` because there might be other needed\n // listeners added by techs that extend this.\n this.off(this.tech_, 'tap', this.boundHandleTechTap_);\n this.off(this.tech_, 'touchstart', this.boundHandleTechTouchStart_);\n this.off(this.tech_, 'touchmove', this.boundHandleTechTouchMove_);\n this.off(this.tech_, 'touchend', this.boundHandleTechTouchEnd_);\n this.off(this.tech_, 'click', this.boundHandleTechClick_);\n this.off(this.tech_, 'dblclick', this.boundHandleTechDoubleClick_);\n }\n /**\n * Player waits for the tech to be ready\n *\n * @private\n */\n ;\n\n _proto.handleTechReady_ = function handleTechReady_() {\n this.triggerReady(); // Keep the same volume as before\n\n if (this.cache_.volume) {\n this.techCall_('setVolume', this.cache_.volume);\n } // Look if the tech found a higher resolution poster while loading\n\n\n this.handleTechPosterChange_(); // Update the duration if available\n\n this.handleTechDurationChange_();\n }\n /**\n * Retrigger the `loadstart` event that was triggered by the {@link Tech}. This\n * function will also trigger {@link Player#firstplay} if it is the first loadstart\n * for a video.\n *\n * @fires Player#loadstart\n * @fires Player#firstplay\n * @listens Tech#loadstart\n * @private\n */\n ;\n\n _proto.handleTechLoadStart_ = function handleTechLoadStart_() {\n // TODO: Update to use `emptied` event instead. See #1277.\n this.removeClass('vjs-ended');\n this.removeClass('vjs-seeking'); // reset the error state\n\n this.error(null); // Update the duration\n\n this.handleTechDurationChange_(); // If it's already playing we want to trigger a firstplay event now.\n // The firstplay event relies on both the play and loadstart events\n // which can happen in any order for a new source\n\n if (!this.paused()) {\n /**\n * Fired when the user agent begins looking for media data\n *\n * @event Player#loadstart\n * @type {EventTarget~Event}\n */\n this.trigger('loadstart');\n this.trigger('firstplay');\n } else {\n // reset the hasStarted state\n this.hasStarted(false);\n this.trigger('loadstart');\n } // autoplay happens after loadstart for the browser,\n // so we mimic that behavior\n\n\n this.manualAutoplay_(this.autoplay() === true && this.options_.normalizeAutoplay ? 'play' : this.autoplay());\n }\n /**\n * Handle autoplay string values, rather than the typical boolean\n * values that should be handled by the tech. Note that this is not\n * part of any specification. Valid values and what they do can be\n * found on the autoplay getter at Player#autoplay()\n */\n ;\n\n _proto.manualAutoplay_ = function manualAutoplay_(type) {\n var _this6 = this;\n\n if (!this.tech_ || typeof type !== 'string') {\n return;\n } // Save original muted() value, set muted to true, and attempt to play().\n // On promise rejection, restore muted from saved value\n\n\n var resolveMuted = function resolveMuted() {\n var previouslyMuted = _this6.muted();\n\n _this6.muted(true);\n\n var restoreMuted = function restoreMuted() {\n _this6.muted(previouslyMuted);\n }; // restore muted on play terminatation\n\n\n _this6.playTerminatedQueue_.push(restoreMuted);\n\n var mutedPromise = _this6.play();\n\n if (!isPromise(mutedPromise)) {\n return;\n }\n\n return mutedPromise[\"catch\"](function (err) {\n restoreMuted();\n throw new Error(\"Rejection at manualAutoplay. Restoring muted value. \" + (err ? err : ''));\n });\n };\n\n var promise; // if muted defaults to true\n // the only thing we can do is call play\n\n if (type === 'any' && !this.muted()) {\n promise = this.play();\n\n if (isPromise(promise)) {\n promise = promise[\"catch\"](resolveMuted);\n }\n } else if (type === 'muted' && !this.muted()) {\n promise = resolveMuted();\n } else {\n promise = this.play();\n }\n\n if (!isPromise(promise)) {\n return;\n }\n\n return promise.then(function () {\n _this6.trigger({\n type: 'autoplay-success',\n autoplay: type\n });\n })[\"catch\"](function () {\n _this6.trigger({\n type: 'autoplay-failure',\n autoplay: type\n });\n });\n }\n /**\n * Update the internal source caches so that we return the correct source from\n * `src()`, `currentSource()`, and `currentSources()`.\n *\n * > Note: `currentSources` will not be updated if the source that is passed in exists\n * in the current `currentSources` cache.\n *\n *\n * @param {Tech~SourceObject} srcObj\n * A string or object source to update our caches to.\n */\n ;\n\n _proto.updateSourceCaches_ = function updateSourceCaches_(srcObj) {\n if (srcObj === void 0) {\n srcObj = '';\n }\n\n var src = srcObj;\n var type = '';\n\n if (typeof src !== 'string') {\n src = srcObj.src;\n type = srcObj.type;\n } // make sure all the caches are set to default values\n // to prevent null checking\n\n\n this.cache_.source = this.cache_.source || {};\n this.cache_.sources = this.cache_.sources || []; // try to get the type of the src that was passed in\n\n if (src && !type) {\n type = findMimetype(this, src);\n } // update `currentSource` cache always\n\n\n this.cache_.source = mergeOptions$3({}, srcObj, {\n src: src,\n type: type\n });\n var matchingSources = this.cache_.sources.filter(function (s) {\n return s.src && s.src === src;\n });\n var sourceElSources = [];\n var sourceEls = this.$$('source');\n var matchingSourceEls = [];\n\n for (var i = 0; i < sourceEls.length; i++) {\n var sourceObj = getAttributes(sourceEls[i]);\n sourceElSources.push(sourceObj);\n\n if (sourceObj.src && sourceObj.src === src) {\n matchingSourceEls.push(sourceObj.src);\n }\n } // if we have matching source els but not matching sources\n // the current source cache is not up to date\n\n\n if (matchingSourceEls.length && !matchingSources.length) {\n this.cache_.sources = sourceElSources; // if we don't have matching source or source els set the\n // sources cache to the `currentSource` cache\n } else if (!matchingSources.length) {\n this.cache_.sources = [this.cache_.source];\n } // update the tech `src` cache\n\n\n this.cache_.src = src;\n }\n /**\n * *EXPERIMENTAL* Fired when the source is set or changed on the {@link Tech}\n * causing the media element to reload.\n *\n * It will fire for the initial source and each subsequent source.\n * This event is a custom event from Video.js and is triggered by the {@link Tech}.\n *\n * The event object for this event contains a `src` property that will contain the source\n * that was available when the event was triggered. This is generally only necessary if Video.js\n * is switching techs while the source was being changed.\n *\n * It is also fired when `load` is called on the player (or media element)\n * because the {@link https://html.spec.whatwg.org/multipage/media.html#dom-media-load|specification for `load`}\n * says that the resource selection algorithm needs to be aborted and restarted.\n * In this case, it is very likely that the `src` property will be set to the\n * empty string `\"\"` to indicate we do not know what the source will be but\n * that it is changing.\n *\n * *This event is currently still experimental and may change in minor releases.*\n * __To use this, pass `enableSourceset` option to the player.__\n *\n * @event Player#sourceset\n * @type {EventTarget~Event}\n * @prop {string} src\n * The source url available when the `sourceset` was triggered.\n * It will be an empty string if we cannot know what the source is\n * but know that the source will change.\n */\n\n /**\n * Retrigger the `sourceset` event that was triggered by the {@link Tech}.\n *\n * @fires Player#sourceset\n * @listens Tech#sourceset\n * @private\n */\n ;\n\n _proto.handleTechSourceset_ = function handleTechSourceset_(event) {\n var _this7 = this;\n\n // only update the source cache when the source\n // was not updated using the player api\n if (!this.changingSrc_) {\n var updateSourceCaches = function updateSourceCaches(src) {\n return _this7.updateSourceCaches_(src);\n };\n\n var playerSrc = this.currentSource().src;\n var eventSrc = event.src; // if we have a playerSrc that is not a blob, and a tech src that is a blob\n\n if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {\n // if both the tech source and the player source were updated we assume\n // something like @videojs/http-streaming did the sourceset and skip updating the source cache.\n if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {\n updateSourceCaches = function updateSourceCaches() {};\n }\n } // update the source to the initial source right away\n // in some cases this will be empty string\n\n\n updateSourceCaches(eventSrc); // if the `sourceset` `src` was an empty string\n // wait for a `loadstart` to update the cache to `currentSrc`.\n // If a sourceset happens before a `loadstart`, we reset the state\n\n if (!event.src) {\n this.tech_.any(['sourceset', 'loadstart'], function (e) {\n // if a sourceset happens before a `loadstart` there\n // is nothing to do as this `handleTechSourceset_`\n // will be called again and this will be handled there.\n if (e.type === 'sourceset') {\n return;\n }\n\n var techSrc = _this7.techGet('currentSrc');\n\n _this7.lastSource_.tech = techSrc;\n\n _this7.updateSourceCaches_(techSrc);\n });\n }\n }\n\n this.lastSource_ = {\n player: this.currentSource().src,\n tech: event.src\n };\n this.trigger({\n src: event.src,\n type: 'sourceset'\n });\n }\n /**\n * Add/remove the vjs-has-started class\n *\n * @fires Player#firstplay\n *\n * @param {boolean} request\n * - true: adds the class\n * - false: remove the class\n *\n * @return {boolean}\n * the boolean value of hasStarted_\n */\n ;\n\n _proto.hasStarted = function hasStarted(request) {\n if (request === undefined) {\n // act as getter, if we have no request to change\n return this.hasStarted_;\n }\n\n if (request === this.hasStarted_) {\n return;\n }\n\n this.hasStarted_ = request;\n\n if (this.hasStarted_) {\n this.addClass('vjs-has-started');\n this.trigger('firstplay');\n } else {\n this.removeClass('vjs-has-started');\n }\n }\n /**\n * Fired whenever the media begins or resumes playback\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play}\n * @fires Player#play\n * @listens Tech#play\n * @private\n */\n ;\n\n _proto.handleTechPlay_ = function handleTechPlay_() {\n this.removeClass('vjs-ended');\n this.removeClass('vjs-paused');\n this.addClass('vjs-playing'); // hide the poster when the user hits play\n\n this.hasStarted(true);\n /**\n * Triggered whenever an {@link Tech#play} event happens. Indicates that\n * playback has started or resumed.\n *\n * @event Player#play\n * @type {EventTarget~Event}\n */\n\n this.trigger('play');\n }\n /**\n * Retrigger the `ratechange` event that was triggered by the {@link Tech}.\n *\n * If there were any events queued while the playback rate was zero, fire\n * those events now.\n *\n * @private\n * @method Player#handleTechRateChange_\n * @fires Player#ratechange\n * @listens Tech#ratechange\n */\n ;\n\n _proto.handleTechRateChange_ = function handleTechRateChange_() {\n if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {\n this.queuedCallbacks_.forEach(function (queued) {\n return queued.callback(queued.event);\n });\n this.queuedCallbacks_ = [];\n }\n\n this.cache_.lastPlaybackRate = this.tech_.playbackRate();\n /**\n * Fires when the playing speed of the audio/video is changed\n *\n * @event Player#ratechange\n * @type {event}\n */\n\n this.trigger('ratechange');\n }\n /**\n * Retrigger the `waiting` event that was triggered by the {@link Tech}.\n *\n * @fires Player#waiting\n * @listens Tech#waiting\n * @private\n */\n ;\n\n _proto.handleTechWaiting_ = function handleTechWaiting_() {\n var _this8 = this;\n\n this.addClass('vjs-waiting');\n /**\n * A readyState change on the DOM element has caused playback to stop.\n *\n * @event Player#waiting\n * @type {EventTarget~Event}\n */\n\n this.trigger('waiting'); // Browsers may emit a timeupdate event after a waiting event. In order to prevent\n // premature removal of the waiting class, wait for the time to change.\n\n var timeWhenWaiting = this.currentTime();\n\n var timeUpdateListener = function timeUpdateListener() {\n if (timeWhenWaiting !== _this8.currentTime()) {\n _this8.removeClass('vjs-waiting');\n\n _this8.off('timeupdate', timeUpdateListener);\n }\n };\n\n this.on('timeupdate', timeUpdateListener);\n }\n /**\n * Retrigger the `canplay` event that was triggered by the {@link Tech}.\n * > Note: This is not consistent between browsers. See #1351\n *\n * @fires Player#canplay\n * @listens Tech#canplay\n * @private\n */\n ;\n\n _proto.handleTechCanPlay_ = function handleTechCanPlay_() {\n this.removeClass('vjs-waiting');\n /**\n * The media has a readyState of HAVE_FUTURE_DATA or greater.\n *\n * @event Player#canplay\n * @type {EventTarget~Event}\n */\n\n this.trigger('canplay');\n }\n /**\n * Retrigger the `canplaythrough` event that was triggered by the {@link Tech}.\n *\n * @fires Player#canplaythrough\n * @listens Tech#canplaythrough\n * @private\n */\n ;\n\n _proto.handleTechCanPlayThrough_ = function handleTechCanPlayThrough_() {\n this.removeClass('vjs-waiting');\n /**\n * The media has a readyState of HAVE_ENOUGH_DATA or greater. This means that the\n * entire media file can be played without buffering.\n *\n * @event Player#canplaythrough\n * @type {EventTarget~Event}\n */\n\n this.trigger('canplaythrough');\n }\n /**\n * Retrigger the `playing` event that was triggered by the {@link Tech}.\n *\n * @fires Player#playing\n * @listens Tech#playing\n * @private\n */\n ;\n\n _proto.handleTechPlaying_ = function handleTechPlaying_() {\n this.removeClass('vjs-waiting');\n /**\n * The media is no longer blocked from playback, and has started playing.\n *\n * @event Player#playing\n * @type {EventTarget~Event}\n */\n\n this.trigger('playing');\n }\n /**\n * Retrigger the `seeking` event that was triggered by the {@link Tech}.\n *\n * @fires Player#seeking\n * @listens Tech#seeking\n * @private\n */\n ;\n\n _proto.handleTechSeeking_ = function handleTechSeeking_() {\n this.addClass('vjs-seeking');\n /**\n * Fired whenever the player is jumping to a new time\n *\n * @event Player#seeking\n * @type {EventTarget~Event}\n */\n\n this.trigger('seeking');\n }\n /**\n * Retrigger the `seeked` event that was triggered by the {@link Tech}.\n *\n * @fires Player#seeked\n * @listens Tech#seeked\n * @private\n */\n ;\n\n _proto.handleTechSeeked_ = function handleTechSeeked_() {\n this.removeClass('vjs-seeking');\n this.removeClass('vjs-ended');\n /**\n * Fired when the player has finished jumping to a new time\n *\n * @event Player#seeked\n * @type {EventTarget~Event}\n */\n\n this.trigger('seeked');\n }\n /**\n * Retrigger the `firstplay` event that was triggered by the {@link Tech}.\n *\n * @fires Player#firstplay\n * @listens Tech#firstplay\n * @deprecated As of 6.0 firstplay event is deprecated.\n * As of 6.0 passing the `starttime` option to the player and the firstplay event are deprecated.\n * @private\n */\n ;\n\n _proto.handleTechFirstPlay_ = function handleTechFirstPlay_() {\n // If the first starttime attribute is specified\n // then we will start at the given offset in seconds\n if (this.options_.starttime) {\n log$1.warn('Passing the `starttime` option to the player will be deprecated in 6.0');\n this.currentTime(this.options_.starttime);\n }\n\n this.addClass('vjs-has-started');\n /**\n * Fired the first time a video is played. Not part of the HLS spec, and this is\n * probably not the best implementation yet, so use sparingly. If you don't have a\n * reason to prevent playback, use `myPlayer.one('play');` instead.\n *\n * @event Player#firstplay\n * @deprecated As of 6.0 firstplay event is deprecated.\n * @type {EventTarget~Event}\n */\n\n this.trigger('firstplay');\n }\n /**\n * Retrigger the `pause` event that was triggered by the {@link Tech}.\n *\n * @fires Player#pause\n * @listens Tech#pause\n * @private\n */\n ;\n\n _proto.handleTechPause_ = function handleTechPause_() {\n this.removeClass('vjs-playing');\n this.addClass('vjs-paused');\n /**\n * Fired whenever the media has been paused\n *\n * @event Player#pause\n * @type {EventTarget~Event}\n */\n\n this.trigger('pause');\n }\n /**\n * Retrigger the `ended` event that was triggered by the {@link Tech}.\n *\n * @fires Player#ended\n * @listens Tech#ended\n * @private\n */\n ;\n\n _proto.handleTechEnded_ = function handleTechEnded_() {\n this.addClass('vjs-ended');\n this.removeClass('vjs-waiting');\n\n if (this.options_.loop) {\n this.currentTime(0);\n this.play();\n } else if (!this.paused()) {\n this.pause();\n }\n /**\n * Fired when the end of the media resource is reached (currentTime == duration)\n *\n * @event Player#ended\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('ended');\n }\n /**\n * Fired when the duration of the media resource is first known or changed\n *\n * @listens Tech#durationchange\n * @private\n */\n ;\n\n _proto.handleTechDurationChange_ = function handleTechDurationChange_() {\n this.duration(this.techGet_('duration'));\n }\n /**\n * Handle a click on the media element to play/pause\n *\n * @param {EventTarget~Event} event\n * the event that caused this function to trigger\n *\n * @listens Tech#click\n * @private\n */\n ;\n\n _proto.handleTechClick_ = function handleTechClick_(event) {\n // When controls are disabled a click should not toggle playback because\n // the click is considered a control\n if (!this.controls_) {\n return;\n }\n\n if (this.paused()) {\n silencePromise(this.play());\n } else {\n this.pause();\n }\n }\n /**\n * Handle a double-click on the media element to enter/exit fullscreen\n *\n * @param {EventTarget~Event} event\n * the event that caused this function to trigger\n *\n * @listens Tech#dblclick\n * @private\n */\n ;\n\n _proto.handleTechDoubleClick_ = function handleTechDoubleClick_(event) {\n if (!this.controls_) {\n return;\n } // we do not want to toggle fullscreen state\n // when double-clicking inside a control bar or a modal\n\n\n var inAllowedEls = Array.prototype.some.call(this.$$('.vjs-control-bar, .vjs-modal-dialog'), function (el) {\n return el.contains(event.target);\n });\n\n if (!inAllowedEls) {\n /*\n * options.userActions.doubleClick\n *\n * If `undefined` or `true`, double-click toggles fullscreen if controls are present\n * Set to `false` to disable double-click handling\n * Set to a function to substitute an external double-click handler\n */\n if (this.options_ === undefined || this.options_.userActions === undefined || this.options_.userActions.doubleClick === undefined || this.options_.userActions.doubleClick !== false) {\n if (this.options_ !== undefined && this.options_.userActions !== undefined && typeof this.options_.userActions.doubleClick === 'function') {\n this.options_.userActions.doubleClick.call(this, event);\n } else if (this.isFullscreen()) {\n this.exitFullscreen();\n } else {\n this.requestFullscreen();\n }\n }\n }\n }\n /**\n * Handle a tap on the media element. It will toggle the user\n * activity state, which hides and shows the controls.\n *\n * @listens Tech#tap\n * @private\n */\n ;\n\n _proto.handleTechTap_ = function handleTechTap_() {\n this.userActive(!this.userActive());\n }\n /**\n * Handle touch to start\n *\n * @listens Tech#touchstart\n * @private\n */\n ;\n\n _proto.handleTechTouchStart_ = function handleTechTouchStart_() {\n this.userWasActive = this.userActive();\n }\n /**\n * Handle touch to move\n *\n * @listens Tech#touchmove\n * @private\n */\n ;\n\n _proto.handleTechTouchMove_ = function handleTechTouchMove_() {\n if (this.userWasActive) {\n this.reportUserActivity();\n }\n }\n /**\n * Handle touch to end\n *\n * @param {EventTarget~Event} event\n * the touchend event that triggered\n * this function\n *\n * @listens Tech#touchend\n * @private\n */\n ;\n\n _proto.handleTechTouchEnd_ = function handleTechTouchEnd_(event) {\n // Stop the mouse events from also happening\n if (event.cancelable) {\n event.preventDefault();\n }\n }\n /**\n * native click events on the SWF aren't triggered on IE11, Win8.1RT\n * use stageclick events triggered from inside the SWF instead\n *\n * @private\n * @listens stageclick\n */\n ;\n\n _proto.handleStageClick_ = function handleStageClick_() {\n this.reportUserActivity();\n }\n /**\n * @private\n */\n ;\n\n _proto.toggleFullscreenClass_ = function toggleFullscreenClass_() {\n if (this.isFullscreen()) {\n this.addClass('vjs-fullscreen');\n } else {\n this.removeClass('vjs-fullscreen');\n }\n }\n /**\n * when the document fschange event triggers it calls this\n */\n ;\n\n _proto.documentFullscreenChange_ = function documentFullscreenChange_(e) {\n var targetPlayer = e.target.player; // if another player was fullscreen\n // do a null check for targetPlayer because older firefox's would put document as e.target\n\n if (targetPlayer && targetPlayer !== this) {\n return;\n }\n\n var el = this.el();\n var isFs = document_default.a[this.fsApi_.fullscreenElement] === el;\n\n if (!isFs && el.matches) {\n isFs = el.matches(':' + this.fsApi_.fullscreen);\n } else if (!isFs && el.msMatchesSelector) {\n isFs = el.msMatchesSelector(':' + this.fsApi_.fullscreen);\n }\n\n this.isFullscreen(isFs);\n }\n /**\n * Handle Tech Fullscreen Change\n *\n * @param {EventTarget~Event} event\n * the fullscreenchange event that triggered this function\n *\n * @param {Object} data\n * the data that was sent with the event\n *\n * @private\n * @listens Tech#fullscreenchange\n * @fires Player#fullscreenchange\n */\n ;\n\n _proto.handleTechFullscreenChange_ = function handleTechFullscreenChange_(event, data) {\n if (data) {\n if (data.nativeIOSFullscreen) {\n this.toggleClass('vjs-ios-native-fs');\n }\n\n this.isFullscreen(data.isFullscreen);\n }\n };\n\n _proto.handleTechFullscreenError_ = function handleTechFullscreenError_(event, err) {\n this.trigger('fullscreenerror', err);\n }\n /**\n * @private\n */\n ;\n\n _proto.togglePictureInPictureClass_ = function togglePictureInPictureClass_() {\n if (this.isInPictureInPicture()) {\n this.addClass('vjs-picture-in-picture');\n } else {\n this.removeClass('vjs-picture-in-picture');\n }\n }\n /**\n * Handle Tech Enter Picture-in-Picture.\n *\n * @param {EventTarget~Event} event\n * the enterpictureinpicture event that triggered this function\n *\n * @private\n * @listens Tech#enterpictureinpicture\n */\n ;\n\n _proto.handleTechEnterPictureInPicture_ = function handleTechEnterPictureInPicture_(event) {\n this.isInPictureInPicture(true);\n }\n /**\n * Handle Tech Leave Picture-in-Picture.\n *\n * @param {EventTarget~Event} event\n * the leavepictureinpicture event that triggered this function\n *\n * @private\n * @listens Tech#leavepictureinpicture\n */\n ;\n\n _proto.handleTechLeavePictureInPicture_ = function handleTechLeavePictureInPicture_(event) {\n this.isInPictureInPicture(false);\n }\n /**\n * Fires when an error occurred during the loading of an audio/video.\n *\n * @private\n * @listens Tech#error\n */\n ;\n\n _proto.handleTechError_ = function handleTechError_() {\n var error = this.tech_.error();\n this.error(error);\n }\n /**\n * Retrigger the `textdata` event that was triggered by the {@link Tech}.\n *\n * @fires Player#textdata\n * @listens Tech#textdata\n * @private\n */\n ;\n\n _proto.handleTechTextData_ = function handleTechTextData_() {\n var data = null;\n\n if (arguments.length > 1) {\n data = arguments[1];\n }\n /**\n * Fires when we get a textdata event from tech\n *\n * @event Player#textdata\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('textdata', data);\n }\n /**\n * Get object for cached values.\n *\n * @return {Object}\n * get the current object cache\n */\n ;\n\n _proto.getCache = function getCache() {\n return this.cache_;\n }\n /**\n * Resets the internal cache object.\n *\n * Using this function outside the player constructor or reset method may\n * have unintended side-effects.\n *\n * @private\n */\n ;\n\n _proto.resetCache_ = function resetCache_() {\n this.cache_ = {\n // Right now, the currentTime is not _really_ cached because it is always\n // retrieved from the tech (see: currentTime). However, for completeness,\n // we set it to zero here to ensure that if we do start actually caching\n // it, we reset it along with everything else.\n currentTime: 0,\n initTime: 0,\n inactivityTimeout: this.options_.inactivityTimeout,\n duration: NaN,\n lastVolume: 1,\n lastPlaybackRate: this.defaultPlaybackRate(),\n media: null,\n src: '',\n source: {},\n sources: [],\n playbackRates: [],\n volume: 1\n };\n }\n /**\n * Pass values to the playback tech\n *\n * @param {string} [method]\n * the method to call\n *\n * @param {Object} arg\n * the argument to pass\n *\n * @private\n */\n ;\n\n _proto.techCall_ = function techCall_(method, arg) {\n // If it's not ready yet, call method when it is\n this.ready(function () {\n if (method in allowedSetters) {\n return video_es_set(this.middleware_, this.tech_, method, arg);\n } else if (method in allowedMediators) {\n return mediate(this.middleware_, this.tech_, method, arg);\n }\n\n try {\n if (this.tech_) {\n this.tech_[method](arg);\n }\n } catch (e) {\n log$1(e);\n throw e;\n }\n }, true);\n }\n /**\n * Get calls can't wait for the tech, and sometimes don't need to.\n *\n * @param {string} method\n * Tech method\n *\n * @return {Function|undefined}\n * the method or undefined\n *\n * @private\n */\n ;\n\n _proto.techGet_ = function techGet_(method) {\n if (!this.tech_ || !this.tech_.isReady_) {\n return;\n }\n\n if (method in allowedGetters) {\n return video_es_get(this.middleware_, this.tech_, method);\n } else if (method in allowedMediators) {\n return mediate(this.middleware_, this.tech_, method);\n } // Flash likes to die and reload when you hide or reposition it.\n // In these cases the object methods go away and we get errors.\n // TODO: Is this needed for techs other than Flash?\n // When that happens we'll catch the errors and inform tech that it's not ready any more.\n\n\n try {\n return this.tech_[method]();\n } catch (e) {\n // When building additional tech libs, an expected method may not be defined yet\n if (this.tech_[method] === undefined) {\n log$1(\"Video.js: \" + method + \" method not defined for \" + this.techName_ + \" playback technology.\", e);\n throw e;\n } // When a method isn't available on the object it throws a TypeError\n\n\n if (e.name === 'TypeError') {\n log$1(\"Video.js: \" + method + \" unavailable on \" + this.techName_ + \" playback technology element.\", e);\n this.tech_.isReady_ = false;\n throw e;\n } // If error unknown, just log and throw\n\n\n log$1(e);\n throw e;\n }\n }\n /**\n * Attempt to begin playback at the first opportunity.\n *\n * @return {Promise|undefined}\n * Returns a promise if the browser supports Promises (or one\n * was passed in as an option). This promise will be resolved on\n * the return value of play. If this is undefined it will fulfill the\n * promise chain otherwise the promise chain will be fulfilled when\n * the promise from play is fulfilled.\n */\n ;\n\n _proto.play = function play() {\n var _this9 = this;\n\n var PromiseClass = this.options_.Promise || window_default.a.Promise;\n\n if (PromiseClass) {\n return new PromiseClass(function (resolve) {\n _this9.play_(resolve);\n });\n }\n\n return this.play_();\n }\n /**\n * The actual logic for play, takes a callback that will be resolved on the\n * return value of play. This allows us to resolve to the play promise if there\n * is one on modern browsers.\n *\n * @private\n * @param {Function} [callback]\n * The callback that should be called when the techs play is actually called\n */\n ;\n\n _proto.play_ = function play_(callback) {\n var _this10 = this;\n\n if (callback === void 0) {\n callback = silencePromise;\n }\n\n this.playCallbacks_.push(callback);\n var isSrcReady = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc())); // treat calls to play_ somewhat like the `one` event function\n\n if (this.waitToPlay_) {\n this.off(['ready', 'loadstart'], this.waitToPlay_);\n this.waitToPlay_ = null;\n } // if the player/tech is not ready or the src itself is not ready\n // queue up a call to play on `ready` or `loadstart`\n\n\n if (!this.isReady_ || !isSrcReady) {\n this.waitToPlay_ = function (e) {\n _this10.play_();\n };\n\n this.one(['ready', 'loadstart'], this.waitToPlay_); // if we are in Safari, there is a high chance that loadstart will trigger after the gesture timeperiod\n // in that case, we need to prime the video element by calling load so it'll be ready in time\n\n if (!isSrcReady && (IS_ANY_SAFARI || IS_IOS)) {\n this.load();\n }\n\n return;\n } // If the player/tech is ready and we have a source, we can attempt playback.\n\n\n var val = this.techGet_('play'); // play was terminated if the returned value is null\n\n if (val === null) {\n this.runPlayTerminatedQueue_();\n } else {\n this.runPlayCallbacks_(val);\n }\n }\n /**\n * These functions will be run when if play is terminated. If play\n * runPlayCallbacks_ is run these function will not be run. This allows us\n * to differenciate between a terminated play and an actual call to play.\n */\n ;\n\n _proto.runPlayTerminatedQueue_ = function runPlayTerminatedQueue_() {\n var queue = this.playTerminatedQueue_.slice(0);\n this.playTerminatedQueue_ = [];\n queue.forEach(function (q) {\n q();\n });\n }\n /**\n * When a callback to play is delayed we have to run these\n * callbacks when play is actually called on the tech. This function\n * runs the callbacks that were delayed and accepts the return value\n * from the tech.\n *\n * @param {undefined|Promise} val\n * The return value from the tech.\n */\n ;\n\n _proto.runPlayCallbacks_ = function runPlayCallbacks_(val) {\n var callbacks = this.playCallbacks_.slice(0);\n this.playCallbacks_ = []; // clear play terminatedQueue since we finished a real play\n\n this.playTerminatedQueue_ = [];\n callbacks.forEach(function (cb) {\n cb(val);\n });\n }\n /**\n * Pause the video playback\n *\n * @return {Player}\n * A reference to the player object this function was called on\n */\n ;\n\n _proto.pause = function pause() {\n this.techCall_('pause');\n }\n /**\n * Check if the player is paused or has yet to play\n *\n * @return {boolean}\n * - false: if the media is currently playing\n * - true: if media is not currently playing\n */\n ;\n\n _proto.paused = function paused() {\n // The initial state of paused should be true (in Safari it's actually false)\n return this.techGet_('paused') === false ? false : true;\n }\n /**\n * Get a TimeRange object representing the current ranges of time that the user\n * has played.\n *\n * @return {TimeRange}\n * A time range object that represents all the increments of time that have\n * been played.\n */\n ;\n\n _proto.played = function played() {\n return this.techGet_('played') || createTimeRanges(0, 0);\n }\n /**\n * Returns whether or not the user is \"scrubbing\". Scrubbing is\n * when the user has clicked the progress bar handle and is\n * dragging it along the progress bar.\n *\n * @param {boolean} [isScrubbing]\n * whether the user is or is not scrubbing\n *\n * @return {boolean}\n * The value of scrubbing when getting\n */\n ;\n\n _proto.scrubbing = function scrubbing(isScrubbing) {\n if (typeof isScrubbing === 'undefined') {\n return this.scrubbing_;\n }\n\n this.scrubbing_ = !!isScrubbing;\n this.techCall_('setScrubbing', this.scrubbing_);\n\n if (isScrubbing) {\n this.addClass('vjs-scrubbing');\n } else {\n this.removeClass('vjs-scrubbing');\n }\n }\n /**\n * Get or set the current time (in seconds)\n *\n * @param {number|string} [seconds]\n * The time to seek to in seconds\n *\n * @return {number}\n * - the current time in seconds when getting\n */\n ;\n\n _proto.currentTime = function currentTime(seconds) {\n if (typeof seconds !== 'undefined') {\n if (seconds < 0) {\n seconds = 0;\n }\n\n if (!this.isReady_ || this.changingSrc_ || !this.tech_ || !this.tech_.isReady_) {\n this.cache_.initTime = seconds;\n this.off('canplay', this.boundApplyInitTime_);\n this.one('canplay', this.boundApplyInitTime_);\n return;\n }\n\n this.techCall_('setCurrentTime', seconds);\n this.cache_.initTime = 0;\n return;\n } // cache last currentTime and return. default to 0 seconds\n //\n // Caching the currentTime is meant to prevent a massive amount of reads on the tech's\n // currentTime when scrubbing, but may not provide much performance benefit afterall.\n // Should be tested. Also something has to read the actual current time or the cache will\n // never get updated.\n\n\n this.cache_.currentTime = this.techGet_('currentTime') || 0;\n return this.cache_.currentTime;\n }\n /**\n * Apply the value of initTime stored in cache as currentTime.\n *\n * @private\n */\n ;\n\n _proto.applyInitTime_ = function applyInitTime_() {\n this.currentTime(this.cache_.initTime);\n }\n /**\n * Normally gets the length in time of the video in seconds;\n * in all but the rarest use cases an argument will NOT be passed to the method\n *\n * > **NOTE**: The video must have started loading before the duration can be\n * known, and depending on preload behaviour may not be known until the video starts\n * playing.\n *\n * @fires Player#durationchange\n *\n * @param {number} [seconds]\n * The duration of the video to set in seconds\n *\n * @return {number}\n * - The duration of the video in seconds when getting\n */\n ;\n\n _proto.duration = function duration(seconds) {\n if (seconds === undefined) {\n // return NaN if the duration is not known\n return this.cache_.duration !== undefined ? this.cache_.duration : NaN;\n }\n\n seconds = parseFloat(seconds); // Standardize on Infinity for signaling video is live\n\n if (seconds < 0) {\n seconds = Infinity;\n }\n\n if (seconds !== this.cache_.duration) {\n // Cache the last set value for optimized scrubbing (esp. Flash)\n // TODO: Required for techs other than Flash?\n this.cache_.duration = seconds;\n\n if (seconds === Infinity) {\n this.addClass('vjs-live');\n } else {\n this.removeClass('vjs-live');\n }\n\n if (!isNaN(seconds)) {\n // Do not fire durationchange unless the duration value is known.\n // @see [Spec]{@link https://www.w3.org/TR/2011/WD-html5-20110113/video.html#media-element-load-algorithm}\n\n /**\n * @event Player#durationchange\n * @type {EventTarget~Event}\n */\n this.trigger('durationchange');\n }\n }\n }\n /**\n * Calculates how much time is left in the video. Not part\n * of the native video API.\n *\n * @return {number}\n * The time remaining in seconds\n */\n ;\n\n _proto.remainingTime = function remainingTime() {\n return this.duration() - this.currentTime();\n }\n /**\n * A remaining time function that is intented to be used when\n * the time is to be displayed directly to the user.\n *\n * @return {number}\n * The rounded time remaining in seconds\n */\n ;\n\n _proto.remainingTimeDisplay = function remainingTimeDisplay() {\n return Math.floor(this.duration()) - Math.floor(this.currentTime());\n } //\n // Kind of like an array of portions of the video that have been downloaded.\n\n /**\n * Get a TimeRange object with an array of the times of the video\n * that have been downloaded. If you just want the percent of the\n * video that's been downloaded, use bufferedPercent.\n *\n * @see [Buffered Spec]{@link http://dev.w3.org/html5/spec/video.html#dom-media-buffered}\n *\n * @return {TimeRange}\n * A mock TimeRange object (following HTML spec)\n */\n ;\n\n _proto.buffered = function buffered() {\n var buffered = this.techGet_('buffered');\n\n if (!buffered || !buffered.length) {\n buffered = createTimeRanges(0, 0);\n }\n\n return buffered;\n }\n /**\n * Get the percent (as a decimal) of the video that's been downloaded.\n * This method is not a part of the native HTML video API.\n *\n * @return {number}\n * A decimal between 0 and 1 representing the percent\n * that is buffered 0 being 0% and 1 being 100%\n */\n ;\n\n _proto.bufferedPercent = function bufferedPercent$1() {\n return bufferedPercent(this.buffered(), this.duration());\n }\n /**\n * Get the ending time of the last buffered time range\n * This is used in the progress bar to encapsulate all time ranges.\n *\n * @return {number}\n * The end of the last buffered time range\n */\n ;\n\n _proto.bufferedEnd = function bufferedEnd() {\n var buffered = this.buffered();\n var duration = this.duration();\n var end = buffered.end(buffered.length - 1);\n\n if (end > duration) {\n end = duration;\n }\n\n return end;\n }\n /**\n * Get or set the current volume of the media\n *\n * @param {number} [percentAsDecimal]\n * The new volume as a decimal percent:\n * - 0 is muted/0%/off\n * - 1.0 is 100%/full\n * - 0.5 is half volume or 50%\n *\n * @return {number}\n * The current volume as a percent when getting\n */\n ;\n\n _proto.volume = function volume(percentAsDecimal) {\n var vol;\n\n if (percentAsDecimal !== undefined) {\n // Force value to between 0 and 1\n vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));\n this.cache_.volume = vol;\n this.techCall_('setVolume', vol);\n\n if (vol > 0) {\n this.lastVolume_(vol);\n }\n\n return;\n } // Default to 1 when returning current volume.\n\n\n vol = parseFloat(this.techGet_('volume'));\n return isNaN(vol) ? 1 : vol;\n }\n /**\n * Get the current muted state, or turn mute on or off\n *\n * @param {boolean} [muted]\n * - true to mute\n * - false to unmute\n *\n * @return {boolean}\n * - true if mute is on and getting\n * - false if mute is off and getting\n */\n ;\n\n _proto.muted = function muted(_muted) {\n if (_muted !== undefined) {\n this.techCall_('setMuted', _muted);\n return;\n }\n\n return this.techGet_('muted') || false;\n }\n /**\n * Get the current defaultMuted state, or turn defaultMuted on or off. defaultMuted\n * indicates the state of muted on initial playback.\n *\n * ```js\n * var myPlayer = videojs('some-player-id');\n *\n * myPlayer.src(\"http://www.example.com/path/to/video.mp4\");\n *\n * // get, should be false\n * console.log(myPlayer.defaultMuted());\n * // set to true\n * myPlayer.defaultMuted(true);\n * // get should be true\n * console.log(myPlayer.defaultMuted());\n * ```\n *\n * @param {boolean} [defaultMuted]\n * - true to mute\n * - false to unmute\n *\n * @return {boolean|Player}\n * - true if defaultMuted is on and getting\n * - false if defaultMuted is off and getting\n * - A reference to the current player when setting\n */\n ;\n\n _proto.defaultMuted = function defaultMuted(_defaultMuted) {\n if (_defaultMuted !== undefined) {\n return this.techCall_('setDefaultMuted', _defaultMuted);\n }\n\n return this.techGet_('defaultMuted') || false;\n }\n /**\n * Get the last volume, or set it\n *\n * @param {number} [percentAsDecimal]\n * The new last volume as a decimal percent:\n * - 0 is muted/0%/off\n * - 1.0 is 100%/full\n * - 0.5 is half volume or 50%\n *\n * @return {number}\n * the current value of lastVolume as a percent when getting\n *\n * @private\n */\n ;\n\n _proto.lastVolume_ = function lastVolume_(percentAsDecimal) {\n if (percentAsDecimal !== undefined && percentAsDecimal !== 0) {\n this.cache_.lastVolume = percentAsDecimal;\n return;\n }\n\n return this.cache_.lastVolume;\n }\n /**\n * Check if current tech can support native fullscreen\n * (e.g. with built in controls like iOS)\n *\n * @return {boolean}\n * if native fullscreen is supported\n */\n ;\n\n _proto.supportsFullScreen = function supportsFullScreen() {\n return this.techGet_('supportsFullScreen') || false;\n }\n /**\n * Check if the player is in fullscreen mode or tell the player that it\n * is or is not in fullscreen mode.\n *\n * > NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official\n * property and instead document.fullscreenElement is used. But isFullscreen is\n * still a valuable property for internal player workings.\n *\n * @param {boolean} [isFS]\n * Set the players current fullscreen state\n *\n * @return {boolean}\n * - true if fullscreen is on and getting\n * - false if fullscreen is off and getting\n */\n ;\n\n _proto.isFullscreen = function isFullscreen(isFS) {\n if (isFS !== undefined) {\n var oldValue = this.isFullscreen_;\n this.isFullscreen_ = Boolean(isFS); // if we changed fullscreen state and we're in prefixed mode, trigger fullscreenchange\n // this is the only place where we trigger fullscreenchange events for older browsers\n // fullWindow mode is treated as a prefixed event and will get a fullscreenchange event as well\n\n if (this.isFullscreen_ !== oldValue && this.fsApi_.prefixed) {\n /**\n * @event Player#fullscreenchange\n * @type {EventTarget~Event}\n */\n this.trigger('fullscreenchange');\n }\n\n this.toggleFullscreenClass_();\n return;\n }\n\n return this.isFullscreen_;\n }\n /**\n * Increase the size of the video to full screen\n * In some browsers, full screen is not supported natively, so it enters\n * \"full window mode\", where the video fills the browser window.\n * In browsers and devices that support native full screen, sometimes the\n * browser's default controls will be shown, and not the Video.js custom skin.\n * This includes most mobile devices (iOS, Android) and older versions of\n * Safari.\n *\n * @param {Object} [fullscreenOptions]\n * Override the player fullscreen options\n *\n * @fires Player#fullscreenchange\n */\n ;\n\n _proto.requestFullscreen = function requestFullscreen(fullscreenOptions) {\n var PromiseClass = this.options_.Promise || window_default.a.Promise;\n\n if (PromiseClass) {\n var self = this;\n return new PromiseClass(function (resolve, reject) {\n function offHandler() {\n self.off('fullscreenerror', errorHandler);\n self.off('fullscreenchange', changeHandler);\n }\n\n function changeHandler() {\n offHandler();\n resolve();\n }\n\n function errorHandler(e, err) {\n offHandler();\n reject(err);\n }\n\n self.one('fullscreenchange', changeHandler);\n self.one('fullscreenerror', errorHandler);\n var promise = self.requestFullscreenHelper_(fullscreenOptions);\n\n if (promise) {\n promise.then(offHandler, offHandler);\n promise.then(resolve, reject);\n }\n });\n }\n\n return this.requestFullscreenHelper_();\n };\n\n _proto.requestFullscreenHelper_ = function requestFullscreenHelper_(fullscreenOptions) {\n var _this11 = this;\n\n var fsOptions; // Only pass fullscreen options to requestFullscreen in spec-compliant browsers.\n // Use defaults or player configured option unless passed directly to this method.\n\n if (!this.fsApi_.prefixed) {\n fsOptions = this.options_.fullscreen && this.options_.fullscreen.options || {};\n\n if (fullscreenOptions !== undefined) {\n fsOptions = fullscreenOptions;\n }\n } // This method works as follows:\n // 1. if a fullscreen api is available, use it\n // 1. call requestFullscreen with potential options\n // 2. if we got a promise from above, use it to update isFullscreen()\n // 2. otherwise, if the tech supports fullscreen, call `enterFullScreen` on it.\n // This is particularly used for iPhone, older iPads, and non-safari browser on iOS.\n // 3. otherwise, use \"fullWindow\" mode\n\n\n if (this.fsApi_.requestFullscreen) {\n var promise = this.el_[this.fsApi_.requestFullscreen](fsOptions);\n\n if (promise) {\n promise.then(function () {\n return _this11.isFullscreen(true);\n }, function () {\n return _this11.isFullscreen(false);\n });\n }\n\n return promise;\n } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {\n // we can't take the video.js controls fullscreen but we can go fullscreen\n // with native controls\n this.techCall_('enterFullScreen');\n } else {\n // fullscreen isn't supported so we'll just stretch the video element to\n // fill the viewport\n this.enterFullWindow();\n }\n }\n /**\n * Return the video to its normal size after having been in full screen mode\n *\n * @fires Player#fullscreenchange\n */\n ;\n\n _proto.exitFullscreen = function exitFullscreen() {\n var PromiseClass = this.options_.Promise || window_default.a.Promise;\n\n if (PromiseClass) {\n var self = this;\n return new PromiseClass(function (resolve, reject) {\n function offHandler() {\n self.off('fullscreenerror', errorHandler);\n self.off('fullscreenchange', changeHandler);\n }\n\n function changeHandler() {\n offHandler();\n resolve();\n }\n\n function errorHandler(e, err) {\n offHandler();\n reject(err);\n }\n\n self.one('fullscreenchange', changeHandler);\n self.one('fullscreenerror', errorHandler);\n var promise = self.exitFullscreenHelper_();\n\n if (promise) {\n promise.then(offHandler, offHandler); // map the promise to our resolve/reject methods\n\n promise.then(resolve, reject);\n }\n });\n }\n\n return this.exitFullscreenHelper_();\n };\n\n _proto.exitFullscreenHelper_ = function exitFullscreenHelper_() {\n var _this12 = this;\n\n if (this.fsApi_.requestFullscreen) {\n var promise = document_default.a[this.fsApi_.exitFullscreen]();\n\n if (promise) {\n // we're splitting the promise here, so, we want to catch the\n // potential error so that this chain doesn't have unhandled errors\n silencePromise(promise.then(function () {\n return _this12.isFullscreen(false);\n }));\n }\n\n return promise;\n } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {\n this.techCall_('exitFullScreen');\n } else {\n this.exitFullWindow();\n }\n }\n /**\n * When fullscreen isn't supported we can stretch the\n * video container to as wide as the browser will let us.\n *\n * @fires Player#enterFullWindow\n */\n ;\n\n _proto.enterFullWindow = function enterFullWindow() {\n this.isFullscreen(true);\n this.isFullWindow = true; // Storing original doc overflow value to return to when fullscreen is off\n\n this.docOrigOverflow = document_default.a.documentElement.style.overflow; // Add listener for esc key to exit fullscreen\n\n on(document_default.a, 'keydown', this.boundFullWindowOnEscKey_); // Hide any scroll bars\n\n document_default.a.documentElement.style.overflow = 'hidden'; // Apply fullscreen styles\n\n addClass(document_default.a.body, 'vjs-full-window');\n /**\n * @event Player#enterFullWindow\n * @type {EventTarget~Event}\n */\n\n this.trigger('enterFullWindow');\n }\n /**\n * Check for call to either exit full window or\n * full screen on ESC key\n *\n * @param {string} event\n * Event to check for key press\n */\n ;\n\n _proto.fullWindowOnEscKey = function fullWindowOnEscKey(event) {\n if (keycode_default.a.isEventKey(event, 'Esc')) {\n if (this.isFullscreen() === true) {\n if (!this.isFullWindow) {\n this.exitFullscreen();\n } else {\n this.exitFullWindow();\n }\n }\n }\n }\n /**\n * Exit full window\n *\n * @fires Player#exitFullWindow\n */\n ;\n\n _proto.exitFullWindow = function exitFullWindow() {\n this.isFullscreen(false);\n this.isFullWindow = false;\n off(document_default.a, 'keydown', this.boundFullWindowOnEscKey_); // Unhide scroll bars.\n\n document_default.a.documentElement.style.overflow = this.docOrigOverflow; // Remove fullscreen styles\n\n removeClass(document_default.a.body, 'vjs-full-window'); // Resize the box, controller, and poster to original sizes\n // this.positionAll();\n\n /**\n * @event Player#exitFullWindow\n * @type {EventTarget~Event}\n */\n\n this.trigger('exitFullWindow');\n }\n /**\n * Disable Picture-in-Picture mode.\n *\n * @param {boolean} value\n * - true will disable Picture-in-Picture mode\n * - false will enable Picture-in-Picture mode\n */\n ;\n\n _proto.disablePictureInPicture = function disablePictureInPicture(value) {\n if (value === undefined) {\n return this.techGet_('disablePictureInPicture');\n }\n\n this.techCall_('setDisablePictureInPicture', value);\n this.options_.disablePictureInPicture = value;\n this.trigger('disablepictureinpicturechanged');\n }\n /**\n * Check if the player is in Picture-in-Picture mode or tell the player that it\n * is or is not in Picture-in-Picture mode.\n *\n * @param {boolean} [isPiP]\n * Set the players current Picture-in-Picture state\n *\n * @return {boolean}\n * - true if Picture-in-Picture is on and getting\n * - false if Picture-in-Picture is off and getting\n */\n ;\n\n _proto.isInPictureInPicture = function isInPictureInPicture(isPiP) {\n if (isPiP !== undefined) {\n this.isInPictureInPicture_ = !!isPiP;\n this.togglePictureInPictureClass_();\n return;\n }\n\n return !!this.isInPictureInPicture_;\n }\n /**\n * Create a floating video window always on top of other windows so that users may\n * continue consuming media while they interact with other content sites, or\n * applications on their device.\n *\n * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n *\n * @fires Player#enterpictureinpicture\n *\n * @return {Promise}\n * A promise with a Picture-in-Picture window.\n */\n ;\n\n _proto.requestPictureInPicture = function requestPictureInPicture() {\n if ('pictureInPictureEnabled' in document_default.a && this.disablePictureInPicture() === false) {\n /**\n * This event fires when the player enters picture in picture mode\n *\n * @event Player#enterpictureinpicture\n * @type {EventTarget~Event}\n */\n return this.techGet_('requestPictureInPicture');\n }\n }\n /**\n * Exit Picture-in-Picture mode.\n *\n * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n *\n * @fires Player#leavepictureinpicture\n *\n * @return {Promise}\n * A promise.\n */\n ;\n\n _proto.exitPictureInPicture = function exitPictureInPicture() {\n if ('pictureInPictureEnabled' in document_default.a) {\n /**\n * This event fires when the player leaves picture in picture mode\n *\n * @event Player#leavepictureinpicture\n * @type {EventTarget~Event}\n */\n return document_default.a.exitPictureInPicture();\n }\n }\n /**\n * Called when this Player has focus and a key gets pressed down, or when\n * any Component of this player receives a key press that it doesn't handle.\n * This allows player-wide hotkeys (either as defined below, or optionally\n * by an external function).\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n var userActions = this.options_.userActions; // Bail out if hotkeys are not configured.\n\n if (!userActions || !userActions.hotkeys) {\n return;\n } // Function that determines whether or not to exclude an element from\n // hotkeys handling.\n\n\n var excludeElement = function excludeElement(el) {\n var tagName = el.tagName.toLowerCase(); // The first and easiest test is for `contenteditable` elements.\n\n if (el.isContentEditable) {\n return true;\n } // Inputs matching these types will still trigger hotkey handling as\n // they are not text inputs.\n\n\n var allowedInputTypes = ['button', 'checkbox', 'hidden', 'radio', 'reset', 'submit'];\n\n if (tagName === 'input') {\n return allowedInputTypes.indexOf(el.type) === -1;\n } // The final test is by tag name. These tags will be excluded entirely.\n\n\n var excludedTags = ['textarea'];\n return excludedTags.indexOf(tagName) !== -1;\n }; // Bail out if the user is focused on an interactive form element.\n\n\n if (excludeElement(this.el_.ownerDocument.activeElement)) {\n return;\n }\n\n if (typeof userActions.hotkeys === 'function') {\n userActions.hotkeys.call(this, event);\n } else {\n this.handleHotkeys(event);\n }\n }\n /**\n * Called when this Player receives a hotkey keydown event.\n * Supported player-wide hotkeys are:\n *\n * f - toggle fullscreen\n * m - toggle mute\n * k or Space - toggle play/pause\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n */\n ;\n\n _proto.handleHotkeys = function handleHotkeys(event) {\n var hotkeys = this.options_.userActions ? this.options_.userActions.hotkeys : {}; // set fullscreenKey, muteKey, playPauseKey from `hotkeys`, use defaults if not set\n\n var _hotkeys$fullscreenKe = hotkeys.fullscreenKey,\n fullscreenKey = _hotkeys$fullscreenKe === void 0 ? function (keydownEvent) {\n return keycode_default.a.isEventKey(keydownEvent, 'f');\n } : _hotkeys$fullscreenKe,\n _hotkeys$muteKey = hotkeys.muteKey,\n muteKey = _hotkeys$muteKey === void 0 ? function (keydownEvent) {\n return keycode_default.a.isEventKey(keydownEvent, 'm');\n } : _hotkeys$muteKey,\n _hotkeys$playPauseKey = hotkeys.playPauseKey,\n playPauseKey = _hotkeys$playPauseKey === void 0 ? function (keydownEvent) {\n return keycode_default.a.isEventKey(keydownEvent, 'k') || keycode_default.a.isEventKey(keydownEvent, 'Space');\n } : _hotkeys$playPauseKey;\n\n if (fullscreenKey.call(this, event)) {\n event.preventDefault();\n event.stopPropagation();\n var FSToggle = Component$1.getComponent('FullscreenToggle');\n\n if (document_default.a[this.fsApi_.fullscreenEnabled] !== false) {\n FSToggle.prototype.handleClick.call(this, event);\n }\n } else if (muteKey.call(this, event)) {\n event.preventDefault();\n event.stopPropagation();\n var MuteToggle = Component$1.getComponent('MuteToggle');\n MuteToggle.prototype.handleClick.call(this, event);\n } else if (playPauseKey.call(this, event)) {\n event.preventDefault();\n event.stopPropagation();\n var PlayToggle = Component$1.getComponent('PlayToggle');\n PlayToggle.prototype.handleClick.call(this, event);\n }\n }\n /**\n * Check whether the player can play a given mimetype\n *\n * @see https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype\n *\n * @param {string} type\n * The mimetype to check\n *\n * @return {string}\n * 'probably', 'maybe', or '' (empty string)\n */\n ;\n\n _proto.canPlayType = function canPlayType(type) {\n var can; // Loop through each playback technology in the options order\n\n for (var i = 0, j = this.options_.techOrder; i < j.length; i++) {\n var techName = j[i];\n var tech = video_es_Tech.getTech(techName); // Support old behavior of techs being registered as components.\n // Remove once that deprecated behavior is removed.\n\n if (!tech) {\n tech = Component$1.getComponent(techName);\n } // Check if the current tech is defined before continuing\n\n\n if (!tech) {\n log$1.error(\"The \\\"\" + techName + \"\\\" tech is undefined. Skipped browser support check for that tech.\");\n continue;\n } // Check if the browser supports this technology\n\n\n if (tech.isSupported()) {\n can = tech.canPlayType(type);\n\n if (can) {\n return can;\n }\n }\n }\n\n return '';\n }\n /**\n * Select source based on tech-order or source-order\n * Uses source-order selection if `options.sourceOrder` is truthy. Otherwise,\n * defaults to tech-order selection\n *\n * @param {Array} sources\n * The sources for a media asset\n *\n * @return {Object|boolean}\n * Object of source and tech order or false\n */\n ;\n\n _proto.selectSource = function selectSource(sources) {\n var _this13 = this;\n\n // Get only the techs specified in `techOrder` that exist and are supported by the\n // current platform\n var techs = this.options_.techOrder.map(function (techName) {\n return [techName, video_es_Tech.getTech(techName)];\n }).filter(function (_ref) {\n var techName = _ref[0],\n tech = _ref[1];\n\n // Check if the current tech is defined before continuing\n if (tech) {\n // Check if the browser supports this technology\n return tech.isSupported();\n }\n\n log$1.error(\"The \\\"\" + techName + \"\\\" tech is undefined. Skipped browser support check for that tech.\");\n return false;\n }); // Iterate over each `innerArray` element once per `outerArray` element and execute\n // `tester` with both. If `tester` returns a non-falsy value, exit early and return\n // that value.\n\n var findFirstPassingTechSourcePair = function findFirstPassingTechSourcePair(outerArray, innerArray, tester) {\n var found;\n outerArray.some(function (outerChoice) {\n return innerArray.some(function (innerChoice) {\n found = tester(outerChoice, innerChoice);\n\n if (found) {\n return true;\n }\n });\n });\n return found;\n };\n\n var foundSourceAndTech;\n\n var flip = function flip(fn) {\n return function (a, b) {\n return fn(b, a);\n };\n };\n\n var finder = function finder(_ref2, source) {\n var techName = _ref2[0],\n tech = _ref2[1];\n\n if (tech.canPlaySource(source, _this13.options_[techName.toLowerCase()])) {\n return {\n source: source,\n tech: techName\n };\n }\n }; // Depending on the truthiness of `options.sourceOrder`, we swap the order of techs and sources\n // to select from them based on their priority.\n\n\n if (this.options_.sourceOrder) {\n // Source-first ordering\n foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));\n } else {\n // Tech-first ordering\n foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);\n }\n\n return foundSourceAndTech || false;\n }\n /**\n * Executes source setting and getting logic\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]|string} [source]\n * A SourceObject, an array of SourceObjects, or a string referencing\n * a URL to a media source. It is _highly recommended_ that an object\n * or array of objects is used here, so that source selection\n * algorithms can take the `type` into account.\n *\n * If not provided, this method acts as a getter.\n * @param {boolean} isRetry\n * Indicates whether this is being called internally as a result of a retry\n *\n * @return {string|undefined}\n * If the `source` argument is missing, returns the current source\n * URL. Otherwise, returns nothing/undefined.\n */\n ;\n\n _proto.handleSrc_ = function handleSrc_(source, isRetry) {\n var _this14 = this;\n\n // getter usage\n if (typeof source === 'undefined') {\n return this.cache_.src || '';\n } // Reset retry behavior for new source\n\n\n if (this.resetRetryOnError_) {\n this.resetRetryOnError_();\n } // filter out invalid sources and turn our source into\n // an array of source objects\n\n\n var sources = filterSource(source); // if a source was passed in then it is invalid because\n // it was filtered to a zero length Array. So we have to\n // show an error\n\n if (!sources.length) {\n this.setTimeout(function () {\n this.error({\n code: 4,\n message: this.localize(this.options_.notSupportedMessage)\n });\n }, 0);\n return;\n } // initial sources\n\n\n this.changingSrc_ = true; // Only update the cached source list if we are not retrying a new source after error,\n // since in that case we want to include the failed source(s) in the cache\n\n if (!isRetry) {\n this.cache_.sources = sources;\n }\n\n this.updateSourceCaches_(sources[0]); // middlewareSource is the source after it has been changed by middleware\n\n setSource(this, sources[0], function (middlewareSource, mws) {\n _this14.middleware_ = mws; // since sourceSet is async we have to update the cache again after we select a source since\n // the source that is selected could be out of order from the cache update above this callback.\n\n if (!isRetry) {\n _this14.cache_.sources = sources;\n }\n\n _this14.updateSourceCaches_(middlewareSource);\n\n var err = _this14.src_(middlewareSource);\n\n if (err) {\n if (sources.length > 1) {\n return _this14.handleSrc_(sources.slice(1));\n }\n\n _this14.changingSrc_ = false; // We need to wrap this in a timeout to give folks a chance to add error event handlers\n\n _this14.setTimeout(function () {\n this.error({\n code: 4,\n message: this.localize(this.options_.notSupportedMessage)\n });\n }, 0); // we could not find an appropriate tech, but let's still notify the delegate that this is it\n // this needs a better comment about why this is needed\n\n\n _this14.triggerReady();\n\n return;\n }\n\n setTech(mws, _this14.tech_);\n }); // Try another available source if this one fails before playback.\n\n if (this.options_.retryOnError && sources.length > 1) {\n var retry = function retry() {\n // Remove the error modal\n _this14.error(null);\n\n _this14.handleSrc_(sources.slice(1), true);\n };\n\n var stopListeningForErrors = function stopListeningForErrors() {\n _this14.off('error', retry);\n };\n\n this.one('error', retry);\n this.one('playing', stopListeningForErrors);\n\n this.resetRetryOnError_ = function () {\n _this14.off('error', retry);\n\n _this14.off('playing', stopListeningForErrors);\n };\n }\n }\n /**\n * Get or set the video source.\n *\n * @param {Tech~SourceObject|Tech~SourceObject[]|string} [source]\n * A SourceObject, an array of SourceObjects, or a string referencing\n * a URL to a media source. It is _highly recommended_ that an object\n * or array of objects is used here, so that source selection\n * algorithms can take the `type` into account.\n *\n * If not provided, this method acts as a getter.\n *\n * @return {string|undefined}\n * If the `source` argument is missing, returns the current source\n * URL. Otherwise, returns nothing/undefined.\n */\n ;\n\n _proto.src = function src(source) {\n return this.handleSrc_(source, false);\n }\n /**\n * Set the source object on the tech, returns a boolean that indicates whether\n * there is a tech that can play the source or not\n *\n * @param {Tech~SourceObject} source\n * The source object to set on the Tech\n *\n * @return {boolean}\n * - True if there is no Tech to playback this source\n * - False otherwise\n *\n * @private\n */\n ;\n\n _proto.src_ = function src_(source) {\n var _this15 = this;\n\n var sourceTech = this.selectSource([source]);\n\n if (!sourceTech) {\n return true;\n }\n\n if (!titleCaseEquals(sourceTech.tech, this.techName_)) {\n this.changingSrc_ = true; // load this technology with the chosen source\n\n this.loadTech_(sourceTech.tech, sourceTech.source);\n this.tech_.ready(function () {\n _this15.changingSrc_ = false;\n });\n return false;\n } // wait until the tech is ready to set the source\n // and set it synchronously if possible (#2326)\n\n\n this.ready(function () {\n // The setSource tech method was added with source handlers\n // so older techs won't support it\n // We need to check the direct prototype for the case where subclasses\n // of the tech do not support source handlers\n if (this.tech_.constructor.prototype.hasOwnProperty('setSource')) {\n this.techCall_('setSource', source);\n } else {\n this.techCall_('src', source.src);\n }\n\n this.changingSrc_ = false;\n }, true);\n return false;\n }\n /**\n * Begin loading the src data.\n */\n ;\n\n _proto.load = function load() {\n this.techCall_('load');\n }\n /**\n * Reset the player. Loads the first tech in the techOrder,\n * removes all the text tracks in the existing `tech`,\n * and calls `reset` on the `tech`.\n */\n ;\n\n _proto.reset = function reset() {\n var _this16 = this;\n\n var PromiseClass = this.options_.Promise || window_default.a.Promise;\n\n if (this.paused() || !PromiseClass) {\n this.doReset_();\n } else {\n var playPromise = this.play();\n silencePromise(playPromise.then(function () {\n return _this16.doReset_();\n }));\n }\n };\n\n _proto.doReset_ = function doReset_() {\n if (this.tech_) {\n this.tech_.clearTracks('text');\n }\n\n this.resetCache_();\n this.poster('');\n this.loadTech_(this.options_.techOrder[0], null);\n this.techCall_('reset');\n this.resetControlBarUI_();\n\n if (isEvented(this)) {\n this.trigger('playerreset');\n }\n }\n /**\n * Reset Control Bar's UI by calling sub-methods that reset\n * all of Control Bar's components\n */\n ;\n\n _proto.resetControlBarUI_ = function resetControlBarUI_() {\n this.resetProgressBar_();\n this.resetPlaybackRate_();\n this.resetVolumeBar_();\n }\n /**\n * Reset tech's progress so progress bar is reset in the UI\n */\n ;\n\n _proto.resetProgressBar_ = function resetProgressBar_() {\n this.currentTime(0);\n var _this$controlBar = this.controlBar,\n durationDisplay = _this$controlBar.durationDisplay,\n remainingTimeDisplay = _this$controlBar.remainingTimeDisplay;\n\n if (durationDisplay) {\n durationDisplay.updateContent();\n }\n\n if (remainingTimeDisplay) {\n remainingTimeDisplay.updateContent();\n }\n }\n /**\n * Reset Playback ratio\n */\n ;\n\n _proto.resetPlaybackRate_ = function resetPlaybackRate_() {\n this.playbackRate(this.defaultPlaybackRate());\n this.handleTechRateChange_();\n }\n /**\n * Reset Volume bar\n */\n ;\n\n _proto.resetVolumeBar_ = function resetVolumeBar_() {\n this.volume(1.0);\n this.trigger('volumechange');\n }\n /**\n * Returns all of the current source objects.\n *\n * @return {Tech~SourceObject[]}\n * The current source objects\n */\n ;\n\n _proto.currentSources = function currentSources() {\n var source = this.currentSource();\n var sources = []; // assume `{}` or `{ src }`\n\n if (Object.keys(source).length !== 0) {\n sources.push(source);\n }\n\n return this.cache_.sources || sources;\n }\n /**\n * Returns the current source object.\n *\n * @return {Tech~SourceObject}\n * The current source object\n */\n ;\n\n _proto.currentSource = function currentSource() {\n return this.cache_.source || {};\n }\n /**\n * Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4\n * Can be used in conjunction with `currentType` to assist in rebuilding the current source object.\n *\n * @return {string}\n * The current source\n */\n ;\n\n _proto.currentSrc = function currentSrc() {\n return this.currentSource() && this.currentSource().src || '';\n }\n /**\n * Get the current source type e.g. video/mp4\n * This can allow you rebuild the current source object so that you could load the same\n * source and tech later\n *\n * @return {string}\n * The source MIME type\n */\n ;\n\n _proto.currentType = function currentType() {\n return this.currentSource() && this.currentSource().type || '';\n }\n /**\n * Get or set the preload attribute\n *\n * @param {boolean} [value]\n * - true means that we should preload\n * - false means that we should not preload\n *\n * @return {string}\n * The preload attribute value when getting\n */\n ;\n\n _proto.preload = function preload(value) {\n if (value !== undefined) {\n this.techCall_('setPreload', value);\n this.options_.preload = value;\n return;\n }\n\n return this.techGet_('preload');\n }\n /**\n * Get or set the autoplay option. When this is a boolean it will\n * modify the attribute on the tech. When this is a string the attribute on\n * the tech will be removed and `Player` will handle autoplay on loadstarts.\n *\n * @param {boolean|string} [value]\n * - true: autoplay using the browser behavior\n * - false: do not autoplay\n * - 'play': call play() on every loadstart\n * - 'muted': call muted() then play() on every loadstart\n * - 'any': call play() on every loadstart. if that fails call muted() then play().\n * - *: values other than those listed here will be set `autoplay` to true\n *\n * @return {boolean|string}\n * The current value of autoplay when getting\n */\n ;\n\n _proto.autoplay = function autoplay(value) {\n // getter usage\n if (value === undefined) {\n return this.options_.autoplay || false;\n }\n\n var techAutoplay; // if the value is a valid string set it to that, or normalize `true` to 'play', if need be\n\n if (typeof value === 'string' && /(any|play|muted)/.test(value) || value === true && this.options_.normalizeAutoplay) {\n this.options_.autoplay = value;\n this.manualAutoplay_(typeof value === 'string' ? value : 'play');\n techAutoplay = false; // any falsy value sets autoplay to false in the browser,\n // lets do the same\n } else if (!value) {\n this.options_.autoplay = false; // any other value (ie truthy) sets autoplay to true\n } else {\n this.options_.autoplay = true;\n }\n\n techAutoplay = typeof techAutoplay === 'undefined' ? this.options_.autoplay : techAutoplay; // if we don't have a tech then we do not queue up\n // a setAutoplay call on tech ready. We do this because the\n // autoplay option will be passed in the constructor and we\n // do not need to set it twice\n\n if (this.tech_) {\n this.techCall_('setAutoplay', techAutoplay);\n }\n }\n /**\n * Set or unset the playsinline attribute.\n * Playsinline tells the browser that non-fullscreen playback is preferred.\n *\n * @param {boolean} [value]\n * - true means that we should try to play inline by default\n * - false means that we should use the browser's default playback mode,\n * which in most cases is inline. iOS Safari is a notable exception\n * and plays fullscreen by default.\n *\n * @return {string|Player}\n * - the current value of playsinline\n * - the player when setting\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline}\n */\n ;\n\n _proto.playsinline = function playsinline(value) {\n if (value !== undefined) {\n this.techCall_('setPlaysinline', value);\n this.options_.playsinline = value;\n return this;\n }\n\n return this.techGet_('playsinline');\n }\n /**\n * Get or set the loop attribute on the video element.\n *\n * @param {boolean} [value]\n * - true means that we should loop the video\n * - false means that we should not loop the video\n *\n * @return {boolean}\n * The current value of loop when getting\n */\n ;\n\n _proto.loop = function loop(value) {\n if (value !== undefined) {\n this.techCall_('setLoop', value);\n this.options_.loop = value;\n return;\n }\n\n return this.techGet_('loop');\n }\n /**\n * Get or set the poster image source url\n *\n * @fires Player#posterchange\n *\n * @param {string} [src]\n * Poster image source URL\n *\n * @return {string}\n * The current value of poster when getting\n */\n ;\n\n _proto.poster = function poster(src) {\n if (src === undefined) {\n return this.poster_;\n } // The correct way to remove a poster is to set as an empty string\n // other falsey values will throw errors\n\n\n if (!src) {\n src = '';\n }\n\n if (src === this.poster_) {\n return;\n } // update the internal poster variable\n\n\n this.poster_ = src; // update the tech's poster\n\n this.techCall_('setPoster', src);\n this.isPosterFromTech_ = false; // alert components that the poster has been set\n\n /**\n * This event fires when the poster image is changed on the player.\n *\n * @event Player#posterchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('posterchange');\n }\n /**\n * Some techs (e.g. YouTube) can provide a poster source in an\n * asynchronous way. We want the poster component to use this\n * poster source so that it covers up the tech's controls.\n * (YouTube's play button). However we only want to use this\n * source if the player user hasn't set a poster through\n * the normal APIs.\n *\n * @fires Player#posterchange\n * @listens Tech#posterchange\n * @private\n */\n ;\n\n _proto.handleTechPosterChange_ = function handleTechPosterChange_() {\n if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {\n var newPoster = this.tech_.poster() || '';\n\n if (newPoster !== this.poster_) {\n this.poster_ = newPoster;\n this.isPosterFromTech_ = true; // Let components know the poster has changed\n\n this.trigger('posterchange');\n }\n }\n }\n /**\n * Get or set whether or not the controls are showing.\n *\n * @fires Player#controlsenabled\n *\n * @param {boolean} [bool]\n * - true to turn controls on\n * - false to turn controls off\n *\n * @return {boolean}\n * The current value of controls when getting\n */\n ;\n\n _proto.controls = function controls(bool) {\n if (bool === undefined) {\n return !!this.controls_;\n }\n\n bool = !!bool; // Don't trigger a change event unless it actually changed\n\n if (this.controls_ === bool) {\n return;\n }\n\n this.controls_ = bool;\n\n if (this.usingNativeControls()) {\n this.techCall_('setControls', bool);\n }\n\n if (this.controls_) {\n this.removeClass('vjs-controls-disabled');\n this.addClass('vjs-controls-enabled');\n /**\n * @event Player#controlsenabled\n * @type {EventTarget~Event}\n */\n\n this.trigger('controlsenabled');\n\n if (!this.usingNativeControls()) {\n this.addTechControlsListeners_();\n }\n } else {\n this.removeClass('vjs-controls-enabled');\n this.addClass('vjs-controls-disabled');\n /**\n * @event Player#controlsdisabled\n * @type {EventTarget~Event}\n */\n\n this.trigger('controlsdisabled');\n\n if (!this.usingNativeControls()) {\n this.removeTechControlsListeners_();\n }\n }\n }\n /**\n * Toggle native controls on/off. Native controls are the controls built into\n * devices (e.g. default iPhone controls) or other techs\n * (e.g. Vimeo Controls)\n * **This should only be set by the current tech, because only the tech knows\n * if it can support native controls**\n *\n * @fires Player#usingnativecontrols\n * @fires Player#usingcustomcontrols\n *\n * @param {boolean} [bool]\n * - true to turn native controls on\n * - false to turn native controls off\n *\n * @return {boolean}\n * The current value of native controls when getting\n */\n ;\n\n _proto.usingNativeControls = function usingNativeControls(bool) {\n if (bool === undefined) {\n return !!this.usingNativeControls_;\n }\n\n bool = !!bool; // Don't trigger a change event unless it actually changed\n\n if (this.usingNativeControls_ === bool) {\n return;\n }\n\n this.usingNativeControls_ = bool;\n\n if (this.usingNativeControls_) {\n this.addClass('vjs-using-native-controls');\n /**\n * player is using the native device controls\n *\n * @event Player#usingnativecontrols\n * @type {EventTarget~Event}\n */\n\n this.trigger('usingnativecontrols');\n } else {\n this.removeClass('vjs-using-native-controls');\n /**\n * player is using the custom HTML controls\n *\n * @event Player#usingcustomcontrols\n * @type {EventTarget~Event}\n */\n\n this.trigger('usingcustomcontrols');\n }\n }\n /**\n * Set or get the current MediaError\n *\n * @fires Player#error\n *\n * @param {MediaError|string|number} [err]\n * A MediaError or a string/number to be turned\n * into a MediaError\n *\n * @return {MediaError|null}\n * The current MediaError when getting (or null)\n */\n ;\n\n _proto.error = function error(err) {\n var _this17 = this;\n\n if (err === undefined) {\n return this.error_ || null;\n } // allow hooks to modify error object\n\n\n hooks('beforeerror').forEach(function (hookFunction) {\n var newErr = hookFunction(_this17, err);\n\n if (!(video_es_isObject(newErr) && !Array.isArray(newErr) || typeof newErr === 'string' || typeof newErr === 'number' || newErr === null)) {\n _this17.log.error('please return a value that MediaError expects in beforeerror hooks');\n\n return;\n }\n\n err = newErr;\n }); // Suppress the first error message for no compatible source until\n // user interaction\n\n if (this.options_.suppressNotSupportedError && err && err.code === 4) {\n var triggerSuppressedError = function triggerSuppressedError() {\n this.error(err);\n };\n\n this.options_.suppressNotSupportedError = false;\n this.any(['click', 'touchstart'], triggerSuppressedError);\n this.one('loadstart', function () {\n this.off(['click', 'touchstart'], triggerSuppressedError);\n });\n return;\n } // restoring to default\n\n\n if (err === null) {\n this.error_ = err;\n this.removeClass('vjs-error');\n\n if (this.errorDisplay) {\n this.errorDisplay.close();\n }\n\n return;\n }\n\n this.error_ = new MediaError(err); // add the vjs-error classname to the player\n\n this.addClass('vjs-error'); // log the name of the error type and any message\n // IE11 logs \"[object object]\" and required you to expand message to see error object\n\n log$1.error(\"(CODE:\" + this.error_.code + \" \" + MediaError.errorTypes[this.error_.code] + \")\", this.error_.message, this.error_);\n /**\n * @event Player#error\n * @type {EventTarget~Event}\n */\n\n this.trigger('error'); // notify hooks of the per player error\n\n hooks('error').forEach(function (hookFunction) {\n return hookFunction(_this17, _this17.error_);\n });\n return;\n }\n /**\n * Report user activity\n *\n * @param {Object} event\n * Event object\n */\n ;\n\n _proto.reportUserActivity = function reportUserActivity(event) {\n this.userActivity_ = true;\n }\n /**\n * Get/set if user is active\n *\n * @fires Player#useractive\n * @fires Player#userinactive\n *\n * @param {boolean} [bool]\n * - true if the user is active\n * - false if the user is inactive\n *\n * @return {boolean}\n * The current value of userActive when getting\n */\n ;\n\n _proto.userActive = function userActive(bool) {\n if (bool === undefined) {\n return this.userActive_;\n }\n\n bool = !!bool;\n\n if (bool === this.userActive_) {\n return;\n }\n\n this.userActive_ = bool;\n\n if (this.userActive_) {\n this.userActivity_ = true;\n this.removeClass('vjs-user-inactive');\n this.addClass('vjs-user-active');\n /**\n * @event Player#useractive\n * @type {EventTarget~Event}\n */\n\n this.trigger('useractive');\n return;\n } // Chrome/Safari/IE have bugs where when you change the cursor it can\n // trigger a mousemove event. This causes an issue when you're hiding\n // the cursor when the user is inactive, and a mousemove signals user\n // activity. Making it impossible to go into inactive mode. Specifically\n // this happens in fullscreen when we really need to hide the cursor.\n //\n // When this gets resolved in ALL browsers it can be removed\n // https://code.google.com/p/chromium/issues/detail?id=103041\n\n\n if (this.tech_) {\n this.tech_.one('mousemove', function (e) {\n e.stopPropagation();\n e.preventDefault();\n });\n }\n\n this.userActivity_ = false;\n this.removeClass('vjs-user-active');\n this.addClass('vjs-user-inactive');\n /**\n * @event Player#userinactive\n * @type {EventTarget~Event}\n */\n\n this.trigger('userinactive');\n }\n /**\n * Listen for user activity based on timeout value\n *\n * @private\n */\n ;\n\n _proto.listenForUserActivity_ = function listenForUserActivity_() {\n var mouseInProgress;\n var lastMoveX;\n var lastMoveY;\n var handleActivity = bind(this, this.reportUserActivity);\n\n var handleMouseMove = function handleMouseMove(e) {\n // #1068 - Prevent mousemove spamming\n // Chrome Bug: https://code.google.com/p/chromium/issues/detail?id=366970\n if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {\n lastMoveX = e.screenX;\n lastMoveY = e.screenY;\n handleActivity();\n }\n };\n\n var handleMouseDown = function handleMouseDown() {\n handleActivity(); // For as long as the they are touching the device or have their mouse down,\n // we consider them active even if they're not moving their finger or mouse.\n // So we want to continue to update that they are active\n\n this.clearInterval(mouseInProgress); // Setting userActivity=true now and setting the interval to the same time\n // as the activityCheck interval (250) should ensure we never miss the\n // next activityCheck\n\n mouseInProgress = this.setInterval(handleActivity, 250);\n };\n\n var handleMouseUpAndMouseLeave = function handleMouseUpAndMouseLeave(event) {\n handleActivity(); // Stop the interval that maintains activity if the mouse/touch is down\n\n this.clearInterval(mouseInProgress);\n }; // Any mouse movement will be considered user activity\n\n\n this.on('mousedown', handleMouseDown);\n this.on('mousemove', handleMouseMove);\n this.on('mouseup', handleMouseUpAndMouseLeave);\n this.on('mouseleave', handleMouseUpAndMouseLeave);\n var controlBar = this.getChild('controlBar'); // Fixes bug on Android & iOS where when tapping progressBar (when control bar is displayed)\n // controlBar would no longer be hidden by default timeout.\n\n if (controlBar && !IS_IOS && !IS_ANDROID) {\n controlBar.on('mouseenter', function (event) {\n if (this.player().options_.inactivityTimeout !== 0) {\n this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout;\n }\n\n this.player().options_.inactivityTimeout = 0;\n });\n controlBar.on('mouseleave', function (event) {\n this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout;\n });\n } // Listen for keyboard navigation\n // Shouldn't need to use inProgress interval because of key repeat\n\n\n this.on('keydown', handleActivity);\n this.on('keyup', handleActivity); // Run an interval every 250 milliseconds instead of stuffing everything into\n // the mousemove/touchmove function itself, to prevent performance degradation.\n // `this.reportUserActivity` simply sets this.userActivity_ to true, which\n // then gets picked up by this loop\n // http://ejohn.org/blog/learning-from-twitter/\n\n var inactivityTimeout;\n this.setInterval(function () {\n // Check to see if mouse/touch activity has happened\n if (!this.userActivity_) {\n return;\n } // Reset the activity tracker\n\n\n this.userActivity_ = false; // If the user state was inactive, set the state to active\n\n this.userActive(true); // Clear any existing inactivity timeout to start the timer over\n\n this.clearTimeout(inactivityTimeout);\n var timeout = this.options_.inactivityTimeout;\n\n if (timeout <= 0) {\n return;\n } // In <timeout> milliseconds, if no more activity has occurred the\n // user will be considered inactive\n\n\n inactivityTimeout = this.setTimeout(function () {\n // Protect against the case where the inactivityTimeout can trigger just\n // before the next user activity is picked up by the activity check loop\n // causing a flicker\n if (!this.userActivity_) {\n this.userActive(false);\n }\n }, timeout);\n }, 250);\n }\n /**\n * Gets or sets the current playback rate. A playback rate of\n * 1.0 represents normal speed and 0.5 would indicate half-speed\n * playback, for instance.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-playbackrate\n *\n * @param {number} [rate]\n * New playback rate to set.\n *\n * @return {number}\n * The current playback rate when getting or 1.0\n */\n ;\n\n _proto.playbackRate = function playbackRate(rate) {\n if (rate !== undefined) {\n // NOTE: this.cache_.lastPlaybackRate is set from the tech handler\n // that is registered above\n this.techCall_('setPlaybackRate', rate);\n return;\n }\n\n if (this.tech_ && this.tech_.featuresPlaybackRate) {\n return this.cache_.lastPlaybackRate || this.techGet_('playbackRate');\n }\n\n return 1.0;\n }\n /**\n * Gets or sets the current default playback rate. A default playback rate of\n * 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.\n * defaultPlaybackRate will only represent what the initial playbackRate of a video was, not\n * not the current playbackRate.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-defaultplaybackrate\n *\n * @param {number} [rate]\n * New default playback rate to set.\n *\n * @return {number|Player}\n * - The default playback rate when getting or 1.0\n * - the player when setting\n */\n ;\n\n _proto.defaultPlaybackRate = function defaultPlaybackRate(rate) {\n if (rate !== undefined) {\n return this.techCall_('setDefaultPlaybackRate', rate);\n }\n\n if (this.tech_ && this.tech_.featuresPlaybackRate) {\n return this.techGet_('defaultPlaybackRate');\n }\n\n return 1.0;\n }\n /**\n * Gets or sets the audio flag\n *\n * @param {boolean} bool\n * - true signals that this is an audio player\n * - false signals that this is not an audio player\n *\n * @return {boolean}\n * The current value of isAudio when getting\n */\n ;\n\n _proto.isAudio = function isAudio(bool) {\n if (bool !== undefined) {\n this.isAudio_ = !!bool;\n return;\n }\n\n return !!this.isAudio_;\n }\n /**\n * A helper method for adding a {@link TextTrack} to our\n * {@link TextTrackList}.\n *\n * In addition to the W3C settings we allow adding additional info through options.\n *\n * @see http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack\n *\n * @param {string} [kind]\n * the kind of TextTrack you are adding\n *\n * @param {string} [label]\n * the label to give the TextTrack label\n *\n * @param {string} [language]\n * the language to set on the TextTrack\n *\n * @return {TextTrack|undefined}\n * the TextTrack that was added or undefined\n * if there is no tech\n */\n ;\n\n _proto.addTextTrack = function addTextTrack(kind, label, language) {\n if (this.tech_) {\n return this.tech_.addTextTrack(kind, label, language);\n }\n }\n /**\n * Create a remote {@link TextTrack} and an {@link HTMLTrackElement}.\n * When manualCleanup is set to false, the track will be automatically removed\n * on source changes.\n *\n * @param {Object} options\n * Options to pass to {@link HTMLTrackElement} during creation. See\n * {@link HTMLTrackElement} for object properties that you should use.\n *\n * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be\n * removed on a source change\n *\n * @return {HtmlTrackElement}\n * the HTMLTrackElement that was created and added\n * to the HtmlTrackElementList and the remote\n * TextTrackList\n *\n * @deprecated The default value of the \"manualCleanup\" parameter will default\n * to \"false\" in upcoming versions of Video.js\n */\n ;\n\n _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n if (this.tech_) {\n return this.tech_.addRemoteTextTrack(options, manualCleanup);\n }\n }\n /**\n * Remove a remote {@link TextTrack} from the respective\n * {@link TextTrackList} and {@link HtmlTrackElementList}.\n *\n * @param {Object} track\n * Remote {@link TextTrack} to remove\n *\n * @return {undefined}\n * does not return anything\n */\n ;\n\n _proto.removeRemoteTextTrack = function removeRemoteTextTrack(obj) {\n if (obj === void 0) {\n obj = {};\n }\n\n var _obj = obj,\n track = _obj.track;\n\n if (!track) {\n track = obj;\n } // destructure the input into an object with a track argument, defaulting to arguments[0]\n // default the whole argument to an empty object if nothing was passed in\n\n\n if (this.tech_) {\n return this.tech_.removeRemoteTextTrack(track);\n }\n }\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object|undefined}\n * An object with supported media playback quality metrics or undefined if there\n * is no tech or the tech does not support it.\n */\n ;\n\n _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n return this.techGet_('getVideoPlaybackQuality');\n }\n /**\n * Get video width\n *\n * @return {number}\n * current video width\n */\n ;\n\n _proto.videoWidth = function videoWidth() {\n return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;\n }\n /**\n * Get video height\n *\n * @return {number}\n * current video height\n */\n ;\n\n _proto.videoHeight = function videoHeight() {\n return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;\n }\n /**\n * The player's language code.\n *\n * Changing the langauge will trigger\n * [languagechange]{@link Player#event:languagechange}\n * which Components can use to update control text.\n * ClickableComponent will update its control text by default on\n * [languagechange]{@link Player#event:languagechange}.\n *\n * @fires Player#languagechange\n *\n * @param {string} [code]\n * the language code to set the player to\n *\n * @return {string}\n * The current language code when getting\n */\n ;\n\n _proto.language = function language(code) {\n if (code === undefined) {\n return this.language_;\n }\n\n if (this.language_ !== String(code).toLowerCase()) {\n this.language_ = String(code).toLowerCase(); // during first init, it's possible some things won't be evented\n\n if (isEvented(this)) {\n /**\n * fires when the player language change\n *\n * @event Player#languagechange\n * @type {EventTarget~Event}\n */\n this.trigger('languagechange');\n }\n }\n }\n /**\n * Get the player's language dictionary\n * Merge every time, because a newly added plugin might call videojs.addLanguage() at any time\n * Languages specified directly in the player options have precedence\n *\n * @return {Array}\n * An array of of supported languages\n */\n ;\n\n _proto.languages = function languages() {\n return mergeOptions$3(Player.prototype.options_.languages, this.languages_);\n }\n /**\n * returns a JavaScript object reperesenting the current track\n * information. **DOES not return it as JSON**\n *\n * @return {Object}\n * Object representing the current of track info\n */\n ;\n\n _proto.toJSON = function toJSON() {\n var options = mergeOptions$3(this.options_);\n var tracks = options.tracks;\n options.tracks = [];\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i]; // deep merge tracks and null out player so no circular references\n\n track = mergeOptions$3(track);\n track.player = undefined;\n options.tracks[i] = track;\n }\n\n return options;\n }\n /**\n * Creates a simple modal dialog (an instance of the {@link ModalDialog}\n * component) that immediately overlays the player with arbitrary\n * content and removes itself when closed.\n *\n * @param {string|Function|Element|Array|null} content\n * Same as {@link ModalDialog#content}'s param of the same name.\n * The most straight-forward usage is to provide a string or DOM\n * element.\n *\n * @param {Object} [options]\n * Extra options which will be passed on to the {@link ModalDialog}.\n *\n * @return {ModalDialog}\n * the {@link ModalDialog} that was created\n */\n ;\n\n _proto.createModal = function createModal(content, options) {\n var _this18 = this;\n\n options = options || {};\n options.content = content || '';\n var modal = new video_es_ModalDialog(this, options);\n this.addChild(modal);\n modal.on('dispose', function () {\n _this18.removeChild(modal);\n });\n modal.open();\n return modal;\n }\n /**\n * Change breakpoint classes when the player resizes.\n *\n * @private\n */\n ;\n\n _proto.updateCurrentBreakpoint_ = function updateCurrentBreakpoint_() {\n if (!this.responsive()) {\n return;\n }\n\n var currentBreakpoint = this.currentBreakpoint();\n var currentWidth = this.currentWidth();\n\n for (var i = 0; i < BREAKPOINT_ORDER.length; i++) {\n var candidateBreakpoint = BREAKPOINT_ORDER[i];\n var maxWidth = this.breakpoints_[candidateBreakpoint];\n\n if (currentWidth <= maxWidth) {\n // The current breakpoint did not change, nothing to do.\n if (currentBreakpoint === candidateBreakpoint) {\n return;\n } // Only remove a class if there is a current breakpoint.\n\n\n if (currentBreakpoint) {\n this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]);\n }\n\n this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]);\n this.breakpoint_ = candidateBreakpoint;\n break;\n }\n }\n }\n /**\n * Removes the current breakpoint.\n *\n * @private\n */\n ;\n\n _proto.removeCurrentBreakpoint_ = function removeCurrentBreakpoint_() {\n var className = this.currentBreakpointClass();\n this.breakpoint_ = '';\n\n if (className) {\n this.removeClass(className);\n }\n }\n /**\n * Get or set breakpoints on the player.\n *\n * Calling this method with an object or `true` will remove any previous\n * custom breakpoints and start from the defaults again.\n *\n * @param {Object|boolean} [breakpoints]\n * If an object is given, it can be used to provide custom\n * breakpoints. If `true` is given, will set default breakpoints.\n * If this argument is not given, will simply return the current\n * breakpoints.\n *\n * @param {number} [breakpoints.tiny]\n * The maximum width for the \"vjs-layout-tiny\" class.\n *\n * @param {number} [breakpoints.xsmall]\n * The maximum width for the \"vjs-layout-x-small\" class.\n *\n * @param {number} [breakpoints.small]\n * The maximum width for the \"vjs-layout-small\" class.\n *\n * @param {number} [breakpoints.medium]\n * The maximum width for the \"vjs-layout-medium\" class.\n *\n * @param {number} [breakpoints.large]\n * The maximum width for the \"vjs-layout-large\" class.\n *\n * @param {number} [breakpoints.xlarge]\n * The maximum width for the \"vjs-layout-x-large\" class.\n *\n * @param {number} [breakpoints.huge]\n * The maximum width for the \"vjs-layout-huge\" class.\n *\n * @return {Object}\n * An object mapping breakpoint names to maximum width values.\n */\n ;\n\n _proto.breakpoints = function breakpoints(_breakpoints) {\n // Used as a getter.\n if (_breakpoints === undefined) {\n return video_es_assign(this.breakpoints_);\n }\n\n this.breakpoint_ = '';\n this.breakpoints_ = video_es_assign({}, DEFAULT_BREAKPOINTS, _breakpoints); // When breakpoint definitions change, we need to update the currently\n // selected breakpoint.\n\n this.updateCurrentBreakpoint_(); // Clone the breakpoints before returning.\n\n return video_es_assign(this.breakpoints_);\n }\n /**\n * Get or set a flag indicating whether or not this player should adjust\n * its UI based on its dimensions.\n *\n * @param {boolean} value\n * Should be `true` if the player should adjust its UI based on its\n * dimensions; otherwise, should be `false`.\n *\n * @return {boolean}\n * Will be `true` if this player should adjust its UI based on its\n * dimensions; otherwise, will be `false`.\n */\n ;\n\n _proto.responsive = function responsive(value) {\n // Used as a getter.\n if (value === undefined) {\n return this.responsive_;\n }\n\n value = Boolean(value);\n var current = this.responsive_; // Nothing changed.\n\n if (value === current) {\n return;\n } // The value actually changed, set it.\n\n\n this.responsive_ = value; // Start listening for breakpoints and set the initial breakpoint if the\n // player is now responsive.\n\n if (value) {\n this.on('playerresize', this.boundUpdateCurrentBreakpoint_);\n this.updateCurrentBreakpoint_(); // Stop listening for breakpoints if the player is no longer responsive.\n } else {\n this.off('playerresize', this.boundUpdateCurrentBreakpoint_);\n this.removeCurrentBreakpoint_();\n }\n\n return value;\n }\n /**\n * Get current breakpoint name, if any.\n *\n * @return {string}\n * If there is currently a breakpoint set, returns a the key from the\n * breakpoints object matching it. Otherwise, returns an empty string.\n */\n ;\n\n _proto.currentBreakpoint = function currentBreakpoint() {\n return this.breakpoint_;\n }\n /**\n * Get the current breakpoint class name.\n *\n * @return {string}\n * The matching class name (e.g. `\"vjs-layout-tiny\"` or\n * `\"vjs-layout-large\"`) for the current breakpoint. Empty string if\n * there is no current breakpoint.\n */\n ;\n\n _proto.currentBreakpointClass = function currentBreakpointClass() {\n return BREAKPOINT_CLASSES[this.breakpoint_] || '';\n }\n /**\n * An object that describes a single piece of media.\n *\n * Properties that are not part of this type description will be retained; so,\n * this can be viewed as a generic metadata storage mechanism as well.\n *\n * @see {@link https://wicg.github.io/mediasession/#the-mediametadata-interface}\n * @typedef {Object} Player~MediaObject\n *\n * @property {string} [album]\n * Unused, except if this object is passed to the `MediaSession`\n * API.\n *\n * @property {string} [artist]\n * Unused, except if this object is passed to the `MediaSession`\n * API.\n *\n * @property {Object[]} [artwork]\n * Unused, except if this object is passed to the `MediaSession`\n * API. If not specified, will be populated via the `poster`, if\n * available.\n *\n * @property {string} [poster]\n * URL to an image that will display before playback.\n *\n * @property {Tech~SourceObject|Tech~SourceObject[]|string} [src]\n * A single source object, an array of source objects, or a string\n * referencing a URL to a media source. It is _highly recommended_\n * that an object or array of objects is used here, so that source\n * selection algorithms can take the `type` into account.\n *\n * @property {string} [title]\n * Unused, except if this object is passed to the `MediaSession`\n * API.\n *\n * @property {Object[]} [textTracks]\n * An array of objects to be used to create text tracks, following\n * the {@link https://www.w3.org/TR/html50/embedded-content-0.html#the-track-element|native track element format}.\n * For ease of removal, these will be created as \"remote\" text\n * tracks and set to automatically clean up on source changes.\n *\n * These objects may have properties like `src`, `kind`, `label`,\n * and `language`, see {@link Tech#createRemoteTextTrack}.\n */\n\n /**\n * Populate the player using a {@link Player~MediaObject|MediaObject}.\n *\n * @param {Player~MediaObject} media\n * A media object.\n *\n * @param {Function} ready\n * A callback to be called when the player is ready.\n */\n ;\n\n _proto.loadMedia = function loadMedia(media, ready) {\n var _this19 = this;\n\n if (!media || typeof media !== 'object') {\n return;\n }\n\n this.reset(); // Clone the media object so it cannot be mutated from outside.\n\n this.cache_.media = mergeOptions$3(media);\n var _this$cache_$media = this.cache_.media,\n artwork = _this$cache_$media.artwork,\n poster = _this$cache_$media.poster,\n src = _this$cache_$media.src,\n textTracks = _this$cache_$media.textTracks; // If `artwork` is not given, create it using `poster`.\n\n if (!artwork && poster) {\n this.cache_.media.artwork = [{\n src: poster,\n type: getMimetype(poster)\n }];\n }\n\n if (src) {\n this.src(src);\n }\n\n if (poster) {\n this.poster(poster);\n }\n\n if (Array.isArray(textTracks)) {\n textTracks.forEach(function (tt) {\n return _this19.addRemoteTextTrack(tt, false);\n });\n }\n\n this.ready(ready);\n }\n /**\n * Get a clone of the current {@link Player~MediaObject} for this player.\n *\n * If the `loadMedia` method has not been used, will attempt to return a\n * {@link Player~MediaObject} based on the current state of the player.\n *\n * @return {Player~MediaObject}\n */\n ;\n\n _proto.getMedia = function getMedia() {\n if (!this.cache_.media) {\n var poster = this.poster();\n var src = this.currentSources();\n var textTracks = Array.prototype.map.call(this.remoteTextTracks(), function (tt) {\n return {\n kind: tt.kind,\n label: tt.label,\n language: tt.language,\n src: tt.src\n };\n });\n var media = {\n src: src,\n textTracks: textTracks\n };\n\n if (poster) {\n media.poster = poster;\n media.artwork = [{\n src: media.poster,\n type: getMimetype(media.poster)\n }];\n }\n\n return media;\n }\n\n return mergeOptions$3(this.cache_.media);\n }\n /**\n * Gets tag settings\n *\n * @param {Element} tag\n * The player tag\n *\n * @return {Object}\n * An object containing all of the settings\n * for a player tag\n */\n ;\n\n Player.getTagSettings = function getTagSettings(tag) {\n var baseOptions = {\n sources: [],\n tracks: []\n };\n var tagOptions = getAttributes(tag);\n var dataSetup = tagOptions['data-setup'];\n\n if (hasClass(tag, 'vjs-fill')) {\n tagOptions.fill = true;\n }\n\n if (hasClass(tag, 'vjs-fluid')) {\n tagOptions.fluid = true;\n } // Check if data-setup attr exists.\n\n\n if (dataSetup !== null) {\n // Parse options JSON\n // If empty string, make it a parsable json object.\n var _safeParseTuple = tuple_default()(dataSetup || '{}'),\n err = _safeParseTuple[0],\n data = _safeParseTuple[1];\n\n if (err) {\n log$1.error(err);\n }\n\n video_es_assign(tagOptions, data);\n }\n\n video_es_assign(baseOptions, tagOptions); // Get tag children settings\n\n if (tag.hasChildNodes()) {\n var children = tag.childNodes;\n\n for (var i = 0, j = children.length; i < j; i++) {\n var child = children[i]; // Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/\n\n var childName = child.nodeName.toLowerCase();\n\n if (childName === 'source') {\n baseOptions.sources.push(getAttributes(child));\n } else if (childName === 'track') {\n baseOptions.tracks.push(getAttributes(child));\n }\n }\n }\n\n return baseOptions;\n }\n /**\n * Determine whether or not flexbox is supported\n *\n * @return {boolean}\n * - true if flexbox is supported\n * - false if flexbox is not supported\n */\n ;\n\n _proto.flexNotSupported_ = function flexNotSupported_() {\n var elem = document_default.a.createElement('i'); // Note: We don't actually use flexBasis (or flexOrder), but it's one of the more\n // common flex features that we can rely on when checking for flex support.\n\n return !('flexBasis' in elem.style || 'webkitFlexBasis' in elem.style || 'mozFlexBasis' in elem.style || 'msFlexBasis' in elem.style || // IE10-specific (2012 flex spec), available for completeness\n 'msFlexOrder' in elem.style);\n }\n /**\n * Set debug mode to enable/disable logs at info level.\n *\n * @param {boolean} enabled\n * @fires Player#debugon\n * @fires Player#debugoff\n */\n ;\n\n _proto.debug = function debug(enabled) {\n if (enabled === undefined) {\n return this.debugEnabled_;\n }\n\n if (enabled) {\n this.trigger('debugon');\n this.previousLogLevel_ = this.log.level;\n this.log.level('debug');\n this.debugEnabled_ = true;\n } else {\n this.trigger('debugoff');\n this.log.level(this.previousLogLevel_);\n this.previousLogLevel_ = undefined;\n this.debugEnabled_ = false;\n }\n }\n /**\n * Set or get current playback rates.\n * Takes an array and updates the playback rates menu with the new items.\n * Pass in an empty array to hide the menu.\n * Values other than arrays are ignored.\n *\n * @fires Player#playbackrateschange\n * @param {number[]} newRates\n * The new rates that the playback rates menu should update to.\n * An empty array will hide the menu\n * @return {number[]} When used as a getter will return the current playback rates\n */\n ;\n\n _proto.playbackRates = function playbackRates(newRates) {\n if (newRates === undefined) {\n return this.cache_.playbackRates;\n } // ignore any value that isn't an array\n\n\n if (!Array.isArray(newRates)) {\n return;\n } // ignore any arrays that don't only contain numbers\n\n\n if (!newRates.every(function (rate) {\n return typeof rate === 'number';\n })) {\n return;\n }\n\n this.cache_.playbackRates = newRates;\n /**\n * fires when the playback rates in a player are changed\n *\n * @event Player#playbackrateschange\n * @type {EventTarget~Event}\n */\n\n this.trigger('playbackrateschange');\n };\n\n return Player;\n}(Component$1);\n/**\n * Get the {@link VideoTrackList}\n * @link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist\n *\n * @return {VideoTrackList}\n * the current video track list\n *\n * @method Player.prototype.videoTracks\n */\n\n/**\n * Get the {@link AudioTrackList}\n * @link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist\n *\n * @return {AudioTrackList}\n * the current audio track list\n *\n * @method Player.prototype.audioTracks\n */\n\n/**\n * Get the {@link TextTrackList}\n *\n * @link http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks\n *\n * @return {TextTrackList}\n * the current text track list\n *\n * @method Player.prototype.textTracks\n */\n\n/**\n * Get the remote {@link TextTrackList}\n *\n * @return {TextTrackList}\n * The current remote text track list\n *\n * @method Player.prototype.remoteTextTracks\n */\n\n/**\n * Get the remote {@link HtmlTrackElementList} tracks.\n *\n * @return {HtmlTrackElementList}\n * The current remote text track element list\n *\n * @method Player.prototype.remoteTextTrackEls\n */\n\n\nALL.names.forEach(function (name) {\n var props = ALL[name];\n\n video_es_Player.prototype[props.getterName] = function () {\n if (this.tech_) {\n return this.tech_[props.getterName]();\n } // if we have not yet loadTech_, we create {video,audio,text}Tracks_\n // these will be passed to the tech during loading\n\n\n this[props.privateName] = this[props.privateName] || new props.ListClass();\n return this[props.privateName];\n };\n});\n/**\n * Get or set the `Player`'s crossorigin option. For the HTML5 player, this\n * sets the `crossOrigin` property on the `<video>` tag to control the CORS\n * behavior.\n *\n * @see [Video Element Attributes]{@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-crossorigin}\n *\n * @param {string} [value]\n * The value to set the `Player`'s crossorigin to. If an argument is\n * given, must be one of `anonymous` or `use-credentials`.\n *\n * @return {string|undefined}\n * - The current crossorigin value of the `Player` when getting.\n * - undefined when setting\n */\n\nvideo_es_Player.prototype.crossorigin = video_es_Player.prototype.crossOrigin;\n/**\n * Global enumeration of players.\n *\n * The keys are the player IDs and the values are either the {@link Player}\n * instance or `null` for disposed players.\n *\n * @type {Object}\n */\n\nvideo_es_Player.players = {};\nvar video_es_navigator = window_default.a.navigator;\n/*\n * Player instance options, surfaced using options\n * options = Player.prototype.options_\n * Make changes in options, not here.\n *\n * @type {Object}\n * @private\n */\n\nvideo_es_Player.prototype.options_ = {\n // Default order of fallback technology\n techOrder: video_es_Tech.defaultTechOrder_,\n html5: {},\n // default inactivity timeout\n inactivityTimeout: 2000,\n // default playback rates\n playbackRates: [],\n // Add playback rate selection by adding rates\n // 'playbackRates': [0.5, 1, 1.5, 2],\n liveui: false,\n // Included control sets\n children: ['mediaLoader', 'posterImage', 'textTrackDisplay', 'loadingSpinner', 'bigPlayButton', 'liveTracker', 'controlBar', 'errorDisplay', 'textTrackSettings', 'resizeManager'],\n language: video_es_navigator && (video_es_navigator.languages && video_es_navigator.languages[0] || video_es_navigator.userLanguage || video_es_navigator.language) || 'en',\n // locales and their language translations\n languages: {},\n // Default message to show when a video cannot be played.\n notSupportedMessage: 'No compatible source was found for this media.',\n normalizeAutoplay: false,\n fullscreen: {\n options: {\n navigationUI: 'hide'\n }\n },\n breakpoints: {},\n responsive: false\n};\n[\n/**\n * Returns whether or not the player is in the \"ended\" state.\n *\n * @return {Boolean} True if the player is in the ended state, false if not.\n * @method Player#ended\n */\n'ended',\n/**\n * Returns whether or not the player is in the \"seeking\" state.\n *\n * @return {Boolean} True if the player is in the seeking state, false if not.\n * @method Player#seeking\n */\n'seeking',\n/**\n * Returns the TimeRanges of the media that are currently available\n * for seeking to.\n *\n * @return {TimeRanges} the seekable intervals of the media timeline\n * @method Player#seekable\n */\n'seekable',\n/**\n * Returns the current state of network activity for the element, from\n * the codes in the list below.\n * - NETWORK_EMPTY (numeric value 0)\n * The element has not yet been initialised. All attributes are in\n * their initial states.\n * - NETWORK_IDLE (numeric value 1)\n * The element's resource selection algorithm is active and has\n * selected a resource, but it is not actually using the network at\n * this time.\n * - NETWORK_LOADING (numeric value 2)\n * The user agent is actively trying to download data.\n * - NETWORK_NO_SOURCE (numeric value 3)\n * The element's resource selection algorithm is active, but it has\n * not yet found a resource to use.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#network-states\n * @return {number} the current network activity state\n * @method Player#networkState\n */\n'networkState',\n/**\n * Returns a value that expresses the current state of the element\n * with respect to rendering the current playback position, from the\n * codes in the list below.\n * - HAVE_NOTHING (numeric value 0)\n * No information regarding the media resource is available.\n * - HAVE_METADATA (numeric value 1)\n * Enough of the resource has been obtained that the duration of the\n * resource is available.\n * - HAVE_CURRENT_DATA (numeric value 2)\n * Data for the immediate current playback position is available.\n * - HAVE_FUTURE_DATA (numeric value 3)\n * Data for the immediate current playback position is available, as\n * well as enough data for the user agent to advance the current\n * playback position in the direction of playback.\n * - HAVE_ENOUGH_DATA (numeric value 4)\n * The user agent estimates that enough data is available for\n * playback to proceed uninterrupted.\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-readystate\n * @return {number} the current playback rendering state\n * @method Player#readyState\n */\n'readyState'].forEach(function (fn) {\n video_es_Player.prototype[fn] = function () {\n return this.techGet_(fn);\n };\n});\nTECH_EVENTS_RETRIGGER.forEach(function (event) {\n video_es_Player.prototype[\"handleTech\" + toTitleCase$1(event) + \"_\"] = function () {\n return this.trigger(event);\n };\n});\n/**\n * Fired when the player has initial duration and dimension information\n *\n * @event Player#loadedmetadata\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the player has downloaded data at the current playback position\n *\n * @event Player#loadeddata\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the current playback position has changed *\n * During playback this is fired every 15-250 milliseconds, depending on the\n * playback technology in use.\n *\n * @event Player#timeupdate\n * @type {EventTarget~Event}\n */\n\n/**\n * Fired when the volume changes\n *\n * @event Player#volumechange\n * @type {EventTarget~Event}\n */\n\n/**\n * Reports whether or not a player has a plugin available.\n *\n * This does not report whether or not the plugin has ever been initialized\n * on this player. For that, [usingPlugin]{@link Player#usingPlugin}.\n *\n * @method Player#hasPlugin\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not this player has the requested plugin available.\n */\n\n/**\n * Reports whether or not a player is using a plugin by name.\n *\n * For basic plugins, this only reports whether the plugin has _ever_ been\n * initialized on this player.\n *\n * @method Player#usingPlugin\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not this player is using the requested plugin.\n */\n\nComponent$1.registerComponent('Player', video_es_Player);\n\n/**\n * The base plugin name.\n *\n * @private\n * @constant\n * @type {string}\n */\n\nvar BASE_PLUGIN_NAME = 'plugin';\n/**\n * The key on which a player's active plugins cache is stored.\n *\n * @private\n * @constant\n * @type {string}\n */\n\nvar PLUGIN_CACHE_KEY = 'activePlugins_';\n/**\n * Stores registered plugins in a private space.\n *\n * @private\n * @type {Object}\n */\n\nvar pluginStorage = {};\n/**\n * Reports whether or not a plugin has been registered.\n *\n * @private\n * @param {string} name\n * The name of a plugin.\n *\n * @return {boolean}\n * Whether or not the plugin has been registered.\n */\n\nvar pluginExists = function pluginExists(name) {\n return pluginStorage.hasOwnProperty(name);\n};\n/**\n * Get a single registered plugin by name.\n *\n * @private\n * @param {string} name\n * The name of a plugin.\n *\n * @return {Function|undefined}\n * The plugin (or undefined).\n */\n\n\nvar getPlugin = function getPlugin(name) {\n return pluginExists(name) ? pluginStorage[name] : undefined;\n};\n/**\n * Marks a plugin as \"active\" on a player.\n *\n * Also, ensures that the player has an object for tracking active plugins.\n *\n * @private\n * @param {Player} player\n * A Video.js player instance.\n *\n * @param {string} name\n * The name of a plugin.\n */\n\n\nvar markPluginAsActive = function markPluginAsActive(player, name) {\n player[PLUGIN_CACHE_KEY] = player[PLUGIN_CACHE_KEY] || {};\n player[PLUGIN_CACHE_KEY][name] = true;\n};\n/**\n * Triggers a pair of plugin setup events.\n *\n * @private\n * @param {Player} player\n * A Video.js player instance.\n *\n * @param {Plugin~PluginEventHash} hash\n * A plugin event hash.\n *\n * @param {boolean} [before]\n * If true, prefixes the event name with \"before\". In other words,\n * use this to trigger \"beforepluginsetup\" instead of \"pluginsetup\".\n */\n\n\nvar triggerSetupEvent = function triggerSetupEvent(player, hash, before) {\n var eventName = (before ? 'before' : '') + 'pluginsetup';\n player.trigger(eventName, hash);\n player.trigger(eventName + ':' + hash.name, hash);\n};\n/**\n * Takes a basic plugin function and returns a wrapper function which marks\n * on the player that the plugin has been activated.\n *\n * @private\n * @param {string} name\n * The name of the plugin.\n *\n * @param {Function} plugin\n * The basic plugin.\n *\n * @return {Function}\n * A wrapper function for the given plugin.\n */\n\n\nvar createBasicPlugin = function createBasicPlugin(name, plugin) {\n var basicPluginWrapper = function basicPluginWrapper() {\n // We trigger the \"beforepluginsetup\" and \"pluginsetup\" events on the player\n // regardless, but we want the hash to be consistent with the hash provided\n // for advanced plugins.\n //\n // The only potentially counter-intuitive thing here is the `instance` in\n // the \"pluginsetup\" event is the value returned by the `plugin` function.\n triggerSetupEvent(this, {\n name: name,\n plugin: plugin,\n instance: null\n }, true);\n var instance = plugin.apply(this, arguments);\n markPluginAsActive(this, name);\n triggerSetupEvent(this, {\n name: name,\n plugin: plugin,\n instance: instance\n });\n return instance;\n };\n\n Object.keys(plugin).forEach(function (prop) {\n basicPluginWrapper[prop] = plugin[prop];\n });\n return basicPluginWrapper;\n};\n/**\n * Takes a plugin sub-class and returns a factory function for generating\n * instances of it.\n *\n * This factory function will replace itself with an instance of the requested\n * sub-class of Plugin.\n *\n * @private\n * @param {string} name\n * The name of the plugin.\n *\n * @param {Plugin} PluginSubClass\n * The advanced plugin.\n *\n * @return {Function}\n */\n\n\nvar video_es_createPluginFactory = function createPluginFactory(name, PluginSubClass) {\n // Add a `name` property to the plugin prototype so that each plugin can\n // refer to itself by name.\n PluginSubClass.prototype.name = name;\n return function () {\n triggerSetupEvent(this, {\n name: name,\n plugin: PluginSubClass,\n instance: null\n }, true);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var instance = construct_default()(PluginSubClass, [this].concat(args)); // The plugin is replaced by a function that returns the current instance.\n\n\n this[name] = function () {\n return instance;\n };\n\n triggerSetupEvent(this, instance.getEventHash());\n return instance;\n };\n};\n/**\n * Parent class for all advanced plugins.\n *\n * @mixes module:evented~EventedMixin\n * @mixes module:stateful~StatefulMixin\n * @fires Player#beforepluginsetup\n * @fires Player#beforepluginsetup:$name\n * @fires Player#pluginsetup\n * @fires Player#pluginsetup:$name\n * @listens Player#dispose\n * @throws {Error}\n * If attempting to instantiate the base {@link Plugin} class\n * directly instead of via a sub-class.\n */\n\n\nvar Plugin = /*#__PURE__*/function () {\n /**\n * Creates an instance of this class.\n *\n * Sub-classes should call `super` to ensure plugins are properly initialized.\n *\n * @param {Player} player\n * A Video.js player instance.\n */\n function Plugin(player) {\n if (this.constructor === Plugin) {\n throw new Error('Plugin must be sub-classed; not directly instantiated.');\n }\n\n this.player = player;\n\n if (!this.log) {\n this.log = this.player.log.createLogger(this.name);\n } // Make this object evented, but remove the added `trigger` method so we\n // use the prototype version instead.\n\n\n evented(this);\n delete this.trigger;\n stateful(this, this.constructor.defaultState);\n markPluginAsActive(player, this.name); // Auto-bind the dispose method so we can use it as a listener and unbind\n // it later easily.\n\n this.dispose = this.dispose.bind(this); // If the player is disposed, dispose the plugin.\n\n player.on('dispose', this.dispose);\n }\n /**\n * Get the version of the plugin that was set on <pluginName>.VERSION\n */\n\n\n var _proto = Plugin.prototype;\n\n _proto.version = function version() {\n return this.constructor.VERSION;\n }\n /**\n * Each event triggered by plugins includes a hash of additional data with\n * conventional properties.\n *\n * This returns that object or mutates an existing hash.\n *\n * @param {Object} [hash={}]\n * An object to be used as event an event hash.\n *\n * @return {Plugin~PluginEventHash}\n * An event hash object with provided properties mixed-in.\n */\n ;\n\n _proto.getEventHash = function getEventHash(hash) {\n if (hash === void 0) {\n hash = {};\n }\n\n hash.name = this.name;\n hash.plugin = this.constructor;\n hash.instance = this;\n return hash;\n }\n /**\n * Triggers an event on the plugin object and overrides\n * {@link module:evented~EventedMixin.trigger|EventedMixin.trigger}.\n *\n * @param {string|Object} event\n * An event type or an object with a type property.\n *\n * @param {Object} [hash={}]\n * Additional data hash to merge with a\n * {@link Plugin~PluginEventHash|PluginEventHash}.\n *\n * @return {boolean}\n * Whether or not default was prevented.\n */\n ;\n\n _proto.trigger = function trigger$1(event, hash) {\n if (hash === void 0) {\n hash = {};\n }\n\n return trigger(this.eventBusEl_, event, this.getEventHash(hash));\n }\n /**\n * Handles \"statechanged\" events on the plugin. No-op by default, override by\n * subclassing.\n *\n * @abstract\n * @param {Event} e\n * An event object provided by a \"statechanged\" event.\n *\n * @param {Object} e.changes\n * An object describing changes that occurred with the \"statechanged\"\n * event.\n */\n ;\n\n _proto.handleStateChanged = function handleStateChanged(e) {}\n /**\n * Disposes a plugin.\n *\n * Subclasses can override this if they want, but for the sake of safety,\n * it's probably best to subscribe the \"dispose\" event.\n *\n * @fires Plugin#dispose\n */\n ;\n\n _proto.dispose = function dispose() {\n var name = this.name,\n player = this.player;\n /**\n * Signals that a advanced plugin is about to be disposed.\n *\n * @event Plugin#dispose\n * @type {EventTarget~Event}\n */\n\n this.trigger('dispose');\n this.off();\n player.off('dispose', this.dispose); // Eliminate any possible sources of leaking memory by clearing up\n // references between the player and the plugin instance and nulling out\n // the plugin's state and replacing methods with a function that throws.\n\n player[PLUGIN_CACHE_KEY][name] = false;\n this.player = this.state = null; // Finally, replace the plugin name on the player with a new factory\n // function, so that the plugin is ready to be set up again.\n\n player[name] = video_es_createPluginFactory(name, pluginStorage[name]);\n }\n /**\n * Determines if a plugin is a basic plugin (i.e. not a sub-class of `Plugin`).\n *\n * @param {string|Function} plugin\n * If a string, matches the name of a plugin. If a function, will be\n * tested directly.\n *\n * @return {boolean}\n * Whether or not a plugin is a basic plugin.\n */\n ;\n\n Plugin.isBasic = function isBasic(plugin) {\n var p = typeof plugin === 'string' ? getPlugin(plugin) : plugin;\n return typeof p === 'function' && !Plugin.prototype.isPrototypeOf(p.prototype);\n }\n /**\n * Register a Video.js plugin.\n *\n * @param {string} name\n * The name of the plugin to be registered. Must be a string and\n * must not match an existing plugin or a method on the `Player`\n * prototype.\n *\n * @param {Function} plugin\n * A sub-class of `Plugin` or a function for basic plugins.\n *\n * @return {Function}\n * For advanced plugins, a factory function for that plugin. For\n * basic plugins, a wrapper function that initializes the plugin.\n */\n ;\n\n Plugin.registerPlugin = function registerPlugin(name, plugin) {\n if (typeof name !== 'string') {\n throw new Error(\"Illegal plugin name, \\\"\" + name + \"\\\", must be a string, was \" + typeof name + \".\");\n }\n\n if (pluginExists(name)) {\n log$1.warn(\"A plugin named \\\"\" + name + \"\\\" already exists. You may want to avoid re-registering plugins!\");\n } else if (video_es_Player.prototype.hasOwnProperty(name)) {\n throw new Error(\"Illegal plugin name, \\\"\" + name + \"\\\", cannot share a name with an existing player method!\");\n }\n\n if (typeof plugin !== 'function') {\n throw new Error(\"Illegal plugin for \\\"\" + name + \"\\\", must be a function, was \" + typeof plugin + \".\");\n }\n\n pluginStorage[name] = plugin; // Add a player prototype method for all sub-classed plugins (but not for\n // the base Plugin class).\n\n if (name !== BASE_PLUGIN_NAME) {\n if (Plugin.isBasic(plugin)) {\n video_es_Player.prototype[name] = createBasicPlugin(name, plugin);\n } else {\n video_es_Player.prototype[name] = video_es_createPluginFactory(name, plugin);\n }\n }\n\n return plugin;\n }\n /**\n * De-register a Video.js plugin.\n *\n * @param {string} name\n * The name of the plugin to be de-registered. Must be a string that\n * matches an existing plugin.\n *\n * @throws {Error}\n * If an attempt is made to de-register the base plugin.\n */\n ;\n\n Plugin.deregisterPlugin = function deregisterPlugin(name) {\n if (name === BASE_PLUGIN_NAME) {\n throw new Error('Cannot de-register base plugin.');\n }\n\n if (pluginExists(name)) {\n delete pluginStorage[name];\n delete video_es_Player.prototype[name];\n }\n }\n /**\n * Gets an object containing multiple Video.js plugins.\n *\n * @param {Array} [names]\n * If provided, should be an array of plugin names. Defaults to _all_\n * plugin names.\n *\n * @return {Object|undefined}\n * An object containing plugin(s) associated with their name(s) or\n * `undefined` if no matching plugins exist).\n */\n ;\n\n Plugin.getPlugins = function getPlugins(names) {\n if (names === void 0) {\n names = Object.keys(pluginStorage);\n }\n\n var result;\n names.forEach(function (name) {\n var plugin = getPlugin(name);\n\n if (plugin) {\n result = result || {};\n result[name] = plugin;\n }\n });\n return result;\n }\n /**\n * Gets a plugin's version, if available\n *\n * @param {string} name\n * The name of a plugin.\n *\n * @return {string}\n * The plugin's version or an empty string.\n */\n ;\n\n Plugin.getPluginVersion = function getPluginVersion(name) {\n var plugin = getPlugin(name);\n return plugin && plugin.VERSION || '';\n };\n\n return Plugin;\n}();\n/**\n * Gets a plugin by name if it exists.\n *\n * @static\n * @method getPlugin\n * @memberOf Plugin\n * @param {string} name\n * The name of a plugin.\n *\n * @returns {Function|undefined}\n * The plugin (or `undefined`).\n */\n\n\nPlugin.getPlugin = getPlugin;\n/**\n * The name of the base plugin class as it is registered.\n *\n * @type {string}\n */\n\nPlugin.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME;\nPlugin.registerPlugin(BASE_PLUGIN_NAME, Plugin);\n/**\n * Documented in player.js\n *\n * @ignore\n */\n\nvideo_es_Player.prototype.usingPlugin = function (name) {\n return !!this[PLUGIN_CACHE_KEY] && this[PLUGIN_CACHE_KEY][name] === true;\n};\n/**\n * Documented in player.js\n *\n * @ignore\n */\n\n\nvideo_es_Player.prototype.hasPlugin = function (name) {\n return !!pluginExists(name);\n};\n/**\n * Signals that a plugin is about to be set up on a player.\n *\n * @event Player#beforepluginsetup\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin is about to be set up on a player - by name. The name\n * is the name of the plugin.\n *\n * @event Player#beforepluginsetup:$name\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin has just been set up on a player.\n *\n * @event Player#pluginsetup\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * Signals that a plugin has just been set up on a player - by name. The name\n * is the name of the plugin.\n *\n * @event Player#pluginsetup:$name\n * @type {Plugin~PluginEventHash}\n */\n\n/**\n * @typedef {Object} Plugin~PluginEventHash\n *\n * @property {string} instance\n * For basic plugins, the return value of the plugin function. For\n * advanced plugins, the plugin instance on which the event is fired.\n *\n * @property {string} name\n * The name of the plugin.\n *\n * @property {string} plugin\n * For basic plugins, the plugin function. For advanced plugins, the\n * plugin class/constructor.\n */\n\n/**\n * @file extend.js\n * @module extend\n */\n/**\n * Used to subclass an existing class by emulating ES subclassing using the\n * `extends` keyword.\n *\n * @function\n * @example\n * var MyComponent = videojs.extend(videojs.getComponent('Component'), {\n * myCustomMethod: function() {\n * // Do things in my method.\n * }\n * });\n *\n * @param {Function} superClass\n * The class to inherit from\n *\n * @param {Object} [subClassMethods={}]\n * Methods of the new class\n *\n * @return {Function}\n * The new class with subClassMethods that inherited superClass.\n */\n\nvar video_es_extend = function extend(superClass, subClassMethods) {\n if (subClassMethods === void 0) {\n subClassMethods = {};\n }\n\n var subClass = function subClass() {\n superClass.apply(this, arguments);\n };\n\n var methods = {};\n\n if (typeof subClassMethods === 'object') {\n if (subClassMethods.constructor !== Object.prototype.constructor) {\n subClass = subClassMethods.constructor;\n }\n\n methods = subClassMethods;\n } else if (typeof subClassMethods === 'function') {\n subClass = subClassMethods;\n }\n\n inherits_default()(subClass, superClass); // this is needed for backward-compatibility and node compatibility.\n\n\n if (superClass) {\n subClass.super_ = superClass;\n } // Extend subObj's prototype with functions and other properties from props\n\n\n for (var name in methods) {\n if (methods.hasOwnProperty(name)) {\n subClass.prototype[name] = methods[name];\n }\n }\n\n return subClass;\n};\n\n/**\n * @file video.js\n * @module videojs\n */\n/**\n * Normalize an `id` value by trimming off a leading `#`\n *\n * @private\n * @param {string} id\n * A string, maybe with a leading `#`.\n *\n * @return {string}\n * The string, without any leading `#`.\n */\n\nvar normalizeId = function normalizeId(id) {\n return id.indexOf('#') === 0 ? id.slice(1) : id;\n};\n/**\n * The `videojs()` function doubles as the main function for users to create a\n * {@link Player} instance as well as the main library namespace.\n *\n * It can also be used as a getter for a pre-existing {@link Player} instance.\n * However, we _strongly_ recommend using `videojs.getPlayer()` for this\n * purpose because it avoids any potential for unintended initialization.\n *\n * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n * of our JSDoc template, we cannot properly document this as both a function\n * and a namespace, so its function signature is documented here.\n *\n * #### Arguments\n * ##### id\n * string|Element, **required**\n *\n * Video element or video element ID.\n *\n * ##### options\n * Object, optional\n *\n * Options object for providing settings.\n * See: [Options Guide](https://docs.videojs.com/tutorial-options.html).\n *\n * ##### ready\n * {@link Component~ReadyCallback}, optional\n *\n * A function to be called when the {@link Player} and {@link Tech} are ready.\n *\n * #### Return Value\n *\n * The `videojs()` function returns a {@link Player} instance.\n *\n * @namespace\n *\n * @borrows AudioTrack as AudioTrack\n * @borrows Component.getComponent as getComponent\n * @borrows module:computed-style~computedStyle as computedStyle\n * @borrows module:events.on as on\n * @borrows module:events.one as one\n * @borrows module:events.off as off\n * @borrows module:events.trigger as trigger\n * @borrows EventTarget as EventTarget\n * @borrows module:extend~extend as extend\n * @borrows module:fn.bind as bind\n * @borrows module:format-time.formatTime as formatTime\n * @borrows module:format-time.resetFormatTime as resetFormatTime\n * @borrows module:format-time.setFormatTime as setFormatTime\n * @borrows module:merge-options.mergeOptions as mergeOptions\n * @borrows module:middleware.use as use\n * @borrows Player.players as players\n * @borrows Plugin.registerPlugin as registerPlugin\n * @borrows Plugin.deregisterPlugin as deregisterPlugin\n * @borrows Plugin.getPlugins as getPlugins\n * @borrows Plugin.getPlugin as getPlugin\n * @borrows Plugin.getPluginVersion as getPluginVersion\n * @borrows Tech.getTech as getTech\n * @borrows Tech.registerTech as registerTech\n * @borrows TextTrack as TextTrack\n * @borrows module:time-ranges.createTimeRanges as createTimeRange\n * @borrows module:time-ranges.createTimeRanges as createTimeRanges\n * @borrows module:url.isCrossOrigin as isCrossOrigin\n * @borrows module:url.parseUrl as parseUrl\n * @borrows VideoTrack as VideoTrack\n *\n * @param {string|Element} id\n * Video element or video element ID.\n *\n * @param {Object} [options]\n * Options object for providing settings.\n * See: [Options Guide](https://docs.videojs.com/tutorial-options.html).\n *\n * @param {Component~ReadyCallback} [ready]\n * A function to be called when the {@link Player} and {@link Tech} are\n * ready.\n *\n * @return {Player}\n * The `videojs()` function returns a {@link Player|Player} instance.\n */\n\n\nfunction videojs(id, options, ready) {\n var player = videojs.getPlayer(id);\n\n if (player) {\n if (options) {\n log$1.warn(\"Player \\\"\" + id + \"\\\" is already initialised. Options will not be applied.\");\n }\n\n if (ready) {\n player.ready(ready);\n }\n\n return player;\n }\n\n var el = typeof id === 'string' ? $('#' + normalizeId(id)) : id;\n\n if (!isEl(el)) {\n throw new TypeError('The element or ID supplied is not valid. (videojs)');\n } // document.body.contains(el) will only check if el is contained within that one document.\n // This causes problems for elements in iframes.\n // Instead, use the element's ownerDocument instead of the global document.\n // This will make sure that the element is indeed in the dom of that document.\n // Additionally, check that the document in question has a default view.\n // If the document is no longer attached to the dom, the defaultView of the document will be null.\n\n\n if (!el.ownerDocument.defaultView || !el.ownerDocument.body.contains(el)) {\n log$1.warn('The element supplied is not included in the DOM');\n }\n\n options = options || {};\n hooks('beforesetup').forEach(function (hookFunction) {\n var opts = hookFunction(el, mergeOptions$3(options));\n\n if (!video_es_isObject(opts) || Array.isArray(opts)) {\n log$1.error('please return an object in beforesetup hooks');\n return;\n }\n\n options = mergeOptions$3(options, opts);\n }); // We get the current \"Player\" component here in case an integration has\n // replaced it with a custom player.\n\n var PlayerComponent = Component$1.getComponent('Player');\n player = new PlayerComponent(el, options, ready);\n hooks('setup').forEach(function (hookFunction) {\n return hookFunction(player);\n });\n return player;\n}\n\nvideojs.hooks_ = hooks_;\nvideojs.hooks = hooks;\nvideojs.hook = hook;\nvideojs.hookOnce = hookOnce;\nvideojs.removeHook = removeHook; // Add default styles\n\nif (window_default.a.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal()) {\n var video_es_style = $('.vjs-styles-defaults');\n\n if (!video_es_style) {\n video_es_style = video_es_createStyleElement('vjs-styles-defaults');\n var video_es_head = $('head');\n\n if (video_es_head) {\n video_es_head.insertBefore(video_es_style, video_es_head.firstChild);\n }\n\n setTextContent(video_es_style, \"\\n .video-js {\\n width: 300px;\\n height: 150px;\\n }\\n\\n .vjs-fluid {\\n padding-top: 56.25%\\n }\\n \");\n }\n} // Run Auto-load players\n// You have to wait at least once in case this script is loaded after your\n// video in the DOM (weird behavior only with minified version)\n\n\nautoSetupTimeout(1, videojs);\n/**\n * Current Video.js version. Follows [semantic versioning](https://semver.org/).\n *\n * @type {string}\n */\n\nvideojs.VERSION = version$5;\n/**\n * The global options object. These are the settings that take effect\n * if no overrides are specified when the player is created.\n *\n * @type {Object}\n */\n\nvideojs.options = video_es_Player.prototype.options_;\n/**\n * Get an object with the currently created players, keyed by player ID\n *\n * @return {Object}\n * The created players\n */\n\nvideojs.getPlayers = function () {\n return video_es_Player.players;\n};\n/**\n * Get a single player based on an ID or DOM element.\n *\n * This is useful if you want to check if an element or ID has an associated\n * Video.js player, but not create one if it doesn't.\n *\n * @param {string|Element} id\n * An HTML element - `<video>`, `<audio>`, or `<video-js>` -\n * or a string matching the `id` of such an element.\n *\n * @return {Player|undefined}\n * A player instance or `undefined` if there is no player instance\n * matching the argument.\n */\n\n\nvideojs.getPlayer = function (id) {\n var players = video_es_Player.players;\n var tag;\n\n if (typeof id === 'string') {\n var nId = normalizeId(id);\n var player = players[nId];\n\n if (player) {\n return player;\n }\n\n tag = $('#' + nId);\n } else {\n tag = id;\n }\n\n if (isEl(tag)) {\n var _tag = tag,\n _player = _tag.player,\n playerId = _tag.playerId; // Element may have a `player` property referring to an already created\n // player instance. If so, return that.\n\n if (_player || players[playerId]) {\n return _player || players[playerId];\n }\n }\n};\n/**\n * Returns an array of all current players.\n *\n * @return {Array}\n * An array of all players. The array will be in the order that\n * `Object.keys` provides, which could potentially vary between\n * JavaScript engines.\n *\n */\n\n\nvideojs.getAllPlayers = function () {\n return (// Disposed players leave a key with a `null` value, so we need to make sure\n // we filter those out.\n Object.keys(video_es_Player.players).map(function (k) {\n return video_es_Player.players[k];\n }).filter(Boolean)\n );\n};\n\nvideojs.players = video_es_Player.players;\nvideojs.getComponent = Component$1.getComponent;\n/**\n * Register a component so it can referred to by name. Used when adding to other\n * components, either through addChild `component.addChild('myComponent')` or through\n * default children options `{ children: ['myComponent'] }`.\n *\n * > NOTE: You could also just initialize the component before adding.\n * `component.addChild(new MyComponent());`\n *\n * @param {string} name\n * The class name of the component\n *\n * @param {Component} comp\n * The component class\n *\n * @return {Component}\n * The newly registered component\n */\n\nvideojs.registerComponent = function (name, comp) {\n if (video_es_Tech.isTech(comp)) {\n log$1.warn(\"The \" + name + \" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)\");\n }\n\n Component$1.registerComponent.call(Component$1, name, comp);\n};\n\nvideojs.getTech = video_es_Tech.getTech;\nvideojs.registerTech = video_es_Tech.registerTech;\nvideojs.use = use;\n/**\n * An object that can be returned by a middleware to signify\n * that the middleware is being terminated.\n *\n * @type {object}\n * @property {object} middleware.TERMINATOR\n */\n\nObject.defineProperty(videojs, 'middleware', {\n value: {},\n writeable: false,\n enumerable: true\n});\nObject.defineProperty(videojs.middleware, 'TERMINATOR', {\n value: TERMINATOR,\n writeable: false,\n enumerable: true\n});\n/**\n * A reference to the {@link module:browser|browser utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:browser|browser}\n */\n\nvideojs.browser = browser;\n/**\n * Use {@link module:browser.TOUCH_ENABLED|browser.TOUCH_ENABLED} instead; only\n * included for backward-compatibility with 4.x.\n *\n * @deprecated Since version 5.0, use {@link module:browser.TOUCH_ENABLED|browser.TOUCH_ENABLED instead.\n * @type {boolean}\n */\n\nvideojs.TOUCH_ENABLED = TOUCH_ENABLED;\nvideojs.extend = video_es_extend;\nvideojs.mergeOptions = mergeOptions$3;\nvideojs.bind = bind;\nvideojs.registerPlugin = Plugin.registerPlugin;\nvideojs.deregisterPlugin = Plugin.deregisterPlugin;\n/**\n * Deprecated method to register a plugin with Video.js\n *\n * @deprecated videojs.plugin() is deprecated; use videojs.registerPlugin() instead\n *\n * @param {string} name\n * The plugin name\n *\n * @param {Plugin|Function} plugin\n * The plugin sub-class or function\n */\n\nvideojs.plugin = function (name, plugin) {\n log$1.warn('videojs.plugin() is deprecated; use videojs.registerPlugin() instead');\n return Plugin.registerPlugin(name, plugin);\n};\n\nvideojs.getPlugins = Plugin.getPlugins;\nvideojs.getPlugin = Plugin.getPlugin;\nvideojs.getPluginVersion = Plugin.getPluginVersion;\n/**\n * Adding languages so that they're available to all players.\n * Example: `videojs.addLanguage('es', { 'Hello': 'Hola' });`\n *\n * @param {string} code\n * The language code or dictionary property\n *\n * @param {Object} data\n * The data values to be translated\n *\n * @return {Object}\n * The resulting language dictionary object\n */\n\nvideojs.addLanguage = function (code, data) {\n var _mergeOptions;\n\n code = ('' + code).toLowerCase();\n videojs.options.languages = mergeOptions$3(videojs.options.languages, (_mergeOptions = {}, _mergeOptions[code] = data, _mergeOptions));\n return videojs.options.languages[code];\n};\n/**\n * A reference to the {@link module:log|log utility module} as an object.\n *\n * @type {Function}\n * @see {@link module:log|log}\n */\n\n\nvideojs.log = log$1;\nvideojs.createLogger = createLogger;\nvideojs.createTimeRange = videojs.createTimeRanges = createTimeRanges;\nvideojs.formatTime = formatTime;\nvideojs.setFormatTime = setFormatTime;\nvideojs.resetFormatTime = resetFormatTime;\nvideojs.parseUrl = video_es_parseUrl;\nvideojs.isCrossOrigin = video_es_isCrossOrigin;\nvideojs.EventTarget = EventTarget$2;\nvideojs.on = on;\nvideojs.one = one;\nvideojs.off = off;\nvideojs.trigger = trigger;\n/**\n * A cross-browser XMLHttpRequest wrapper.\n *\n * @function\n * @param {Object} options\n * Settings for the request.\n *\n * @return {XMLHttpRequest|XDomainRequest}\n * The request object.\n *\n * @see https://github.com/Raynos/xhr\n */\n\nvideojs.xhr = lib_default.a;\nvideojs.TextTrack = video_es_TextTrack;\nvideojs.AudioTrack = video_es_AudioTrack;\nvideojs.VideoTrack = video_es_VideoTrack;\n['isEl', 'isTextNode', 'createEl', 'hasClass', 'addClass', 'removeClass', 'toggleClass', 'setAttributes', 'getAttributes', 'emptyEl', 'appendContent', 'insertContent'].forEach(function (k) {\n videojs[k] = function () {\n log$1.warn(\"videojs.\" + k + \"() is deprecated; use videojs.dom.\" + k + \"() instead\");\n return Dom[k].apply(null, arguments);\n };\n});\nvideojs.computedStyle = computedStyle;\n/**\n * A reference to the {@link module:dom|DOM utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:dom|dom}\n */\n\nvideojs.dom = Dom;\n/**\n * A reference to the {@link module:url|URL utility module} as an object.\n *\n * @type {Object}\n * @see {@link module:url|url}\n */\n\nvideojs.url = Url;\nvideojs.defineLazyProperty = defineLazyProperty; // Adding less ambiguous text for fullscreen button.\n// In a major update this could become the default text and key.\n\nvideojs.addLanguage('en', {\n 'Non-Fullscreen': 'Exit Fullscreen'\n});\n\n/*! @name @videojs/http-streaming @version 2.10.2 @license Apache-2.0 */\n/**\n * @file resolve-url.js - Handling how URLs are resolved and manipulated\n */\n\nvar video_es_resolveUrl = resolve_url;\n/**\n * Checks whether xhr request was redirected and returns correct url depending\n * on `handleManifestRedirects` option\n *\n * @api private\n *\n * @param {string} url - an url being requested\n * @param {XMLHttpRequest} req - xhr request result\n *\n * @return {string}\n */\n\nvar resolveManifestRedirect = function resolveManifestRedirect(handleManifestRedirect, url, req) {\n // To understand how the responseURL below is set and generated:\n // - https://fetch.spec.whatwg.org/#concept-response-url\n // - https://fetch.spec.whatwg.org/#atomic-http-redirect-handling\n if (handleManifestRedirect && req && req.responseURL && url !== req.responseURL) {\n return req.responseURL;\n }\n\n return url;\n};\n\nvar logger = function logger(source) {\n if (videojs.log.debug) {\n return videojs.log.debug.bind(videojs, 'VHS:', source + \" >\");\n }\n\n return function () {};\n};\n/**\n * ranges\n *\n * Utilities for working with TimeRanges.\n *\n */\n\n\nvar TIME_FUDGE_FACTOR = 1 / 30; // Comparisons between time values such as current time and the end of the buffered range\n// can be misleading because of precision differences or when the current media has poorly\n// aligned audio and video, which can cause values to be slightly off from what you would\n// expect. This value is what we consider to be safe to use in such comparisons to account\n// for these scenarios.\n\nvar SAFE_TIME_DELTA = TIME_FUDGE_FACTOR * 3;\n\nvar filterRanges = function filterRanges(timeRanges, predicate) {\n var results = [];\n var i;\n\n if (timeRanges && timeRanges.length) {\n // Search for ranges that match the predicate\n for (i = 0; i < timeRanges.length; i++) {\n if (predicate(timeRanges.start(i), timeRanges.end(i))) {\n results.push([timeRanges.start(i), timeRanges.end(i)]);\n }\n }\n }\n\n return videojs.createTimeRanges(results);\n};\n/**\n * Attempts to find the buffered TimeRange that contains the specified\n * time.\n *\n * @param {TimeRanges} buffered - the TimeRanges object to query\n * @param {number} time - the time to filter on.\n * @return {TimeRanges} a new TimeRanges object\n */\n\n\nvar findRange = function findRange(buffered, time) {\n return filterRanges(buffered, function (start, end) {\n return start - SAFE_TIME_DELTA <= time && end + SAFE_TIME_DELTA >= time;\n });\n};\n/**\n * Returns the TimeRanges that begin later than the specified time.\n *\n * @param {TimeRanges} timeRanges - the TimeRanges object to query\n * @param {number} time - the time to filter on.\n * @return {TimeRanges} a new TimeRanges object.\n */\n\n\nvar findNextRange = function findNextRange(timeRanges, time) {\n return filterRanges(timeRanges, function (start) {\n return start - TIME_FUDGE_FACTOR >= time;\n });\n};\n/**\n * Returns gaps within a list of TimeRanges\n *\n * @param {TimeRanges} buffered - the TimeRanges object\n * @return {TimeRanges} a TimeRanges object of gaps\n */\n\n\nvar findGaps = function findGaps(buffered) {\n if (buffered.length < 2) {\n return videojs.createTimeRanges();\n }\n\n var ranges = [];\n\n for (var i = 1; i < buffered.length; i++) {\n var start = buffered.end(i - 1);\n var end = buffered.start(i);\n ranges.push([start, end]);\n }\n\n return videojs.createTimeRanges(ranges);\n};\n/**\n * Calculate the intersection of two TimeRanges\n *\n * @param {TimeRanges} bufferA\n * @param {TimeRanges} bufferB\n * @return {TimeRanges} The interesection of `bufferA` with `bufferB`\n */\n\n\nvar bufferIntersection = function bufferIntersection(bufferA, bufferB) {\n var start = null;\n var end = null;\n var arity = 0;\n var extents = [];\n var ranges = [];\n\n if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {\n return videojs.createTimeRange();\n } // Handle the case where we have both buffers and create an\n // intersection of the two\n\n\n var count = bufferA.length; // A) Gather up all start and end times\n\n while (count--) {\n extents.push({\n time: bufferA.start(count),\n type: 'start'\n });\n extents.push({\n time: bufferA.end(count),\n type: 'end'\n });\n }\n\n count = bufferB.length;\n\n while (count--) {\n extents.push({\n time: bufferB.start(count),\n type: 'start'\n });\n extents.push({\n time: bufferB.end(count),\n type: 'end'\n });\n } // B) Sort them by time\n\n\n extents.sort(function (a, b) {\n return a.time - b.time;\n }); // C) Go along one by one incrementing arity for start and decrementing\n // arity for ends\n\n for (count = 0; count < extents.length; count++) {\n if (extents[count].type === 'start') {\n arity++; // D) If arity is ever incremented to 2 we are entering an\n // overlapping range\n\n if (arity === 2) {\n start = extents[count].time;\n }\n } else if (extents[count].type === 'end') {\n arity--; // E) If arity is ever decremented to 1 we leaving an\n // overlapping range\n\n if (arity === 1) {\n end = extents[count].time;\n }\n } // F) Record overlapping ranges\n\n\n if (start !== null && end !== null) {\n ranges.push([start, end]);\n start = null;\n end = null;\n }\n }\n\n return videojs.createTimeRanges(ranges);\n};\n/**\n * Gets a human readable string for a TimeRange\n *\n * @param {TimeRange} range\n * @return {string} a human readable string\n */\n\n\nvar printableRange = function printableRange(range) {\n var strArr = [];\n\n if (!range || !range.length) {\n return '';\n }\n\n for (var i = 0; i < range.length; i++) {\n strArr.push(range.start(i) + ' => ' + range.end(i));\n }\n\n return strArr.join(', ');\n};\n/**\n * Calculates the amount of time left in seconds until the player hits the end of the\n * buffer and causes a rebuffer\n *\n * @param {TimeRange} buffered\n * The state of the buffer\n * @param {Numnber} currentTime\n * The current time of the player\n * @param {number} playbackRate\n * The current playback rate of the player. Defaults to 1.\n * @return {number}\n * Time until the player has to start rebuffering in seconds.\n * @function timeUntilRebuffer\n */\n\n\nvar timeUntilRebuffer = function timeUntilRebuffer(buffered, currentTime, playbackRate) {\n if (playbackRate === void 0) {\n playbackRate = 1;\n }\n\n var bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;\n return (bufferedEnd - currentTime) / playbackRate;\n};\n/**\n * Converts a TimeRanges object into an array representation\n *\n * @param {TimeRanges} timeRanges\n * @return {Array}\n */\n\n\nvar timeRangesToArray = function timeRangesToArray(timeRanges) {\n var timeRangesList = [];\n\n for (var i = 0; i < timeRanges.length; i++) {\n timeRangesList.push({\n start: timeRanges.start(i),\n end: timeRanges.end(i)\n });\n }\n\n return timeRangesList;\n};\n/**\n * Determines if two time range objects are different.\n *\n * @param {TimeRange} a\n * the first time range object to check\n *\n * @param {TimeRange} b\n * the second time range object to check\n *\n * @return {Boolean}\n * Whether the time range objects differ\n */\n\n\nvar isRangeDifferent = function isRangeDifferent(a, b) {\n // same object\n if (a === b) {\n return false;\n } // one or the other is undefined\n\n\n if (!a && b || !b && a) {\n return true;\n } // length is different\n\n\n if (a.length !== b.length) {\n return true;\n } // see if any start/end pair is different\n\n\n for (var i = 0; i < a.length; i++) {\n if (a.start(i) !== b.start(i) || a.end(i) !== b.end(i)) {\n return true;\n }\n } // if the length and every pair is the same\n // this is the same time range\n\n\n return false;\n};\n\nvar lastBufferedEnd = function lastBufferedEnd(a) {\n if (!a || !a.length || !a.end) {\n return;\n }\n\n return a.end(a.length - 1);\n};\n/**\n * @file playlist.js\n *\n * Playlist related utilities.\n */\n\n\nvar createTimeRange = videojs.createTimeRange;\n/**\n * A function to get a combined list of parts and segments with durations\n * and indexes.\n *\n * @param {Playlist} playlist the playlist to get the list for.\n *\n * @return {Array} The part/segment list.\n */\n\nvar getPartsAndSegments = function getPartsAndSegments(playlist) {\n return (playlist.segments || []).reduce(function (acc, segment, si) {\n if (segment.parts) {\n segment.parts.forEach(function (part, pi) {\n acc.push({\n duration: part.duration,\n segmentIndex: si,\n partIndex: pi,\n part: part,\n segment: segment\n });\n });\n } else {\n acc.push({\n duration: segment.duration,\n segmentIndex: si,\n partIndex: null,\n segment: segment,\n part: null\n });\n }\n\n return acc;\n }, []);\n};\n\nvar getLastParts = function getLastParts(media) {\n var lastSegment = media.segments && media.segments.length && media.segments[media.segments.length - 1];\n return lastSegment && lastSegment.parts || [];\n};\n\nvar getKnownPartCount = function getKnownPartCount(_ref) {\n var preloadSegment = _ref.preloadSegment;\n\n if (!preloadSegment) {\n return;\n }\n\n var parts = preloadSegment.parts,\n preloadHints = preloadSegment.preloadHints;\n var partCount = (preloadHints || []).reduce(function (count, hint) {\n return count + (hint.type === 'PART' ? 1 : 0);\n }, 0);\n partCount += parts && parts.length ? parts.length : 0;\n return partCount;\n};\n/**\n * Get the number of seconds to delay from the end of a\n * live playlist.\n *\n * @param {Playlist} master the master playlist\n * @param {Playlist} media the media playlist\n * @return {number} the hold back in seconds.\n */\n\n\nvar liveEdgeDelay = function liveEdgeDelay(master, media) {\n if (media.endList) {\n return 0;\n } // dash suggestedPresentationDelay trumps everything\n\n\n if (master && master.suggestedPresentationDelay) {\n return master.suggestedPresentationDelay;\n }\n\n var hasParts = getLastParts(media).length > 0; // look for \"part\" delays from ll-hls first\n\n if (hasParts && media.serverControl && media.serverControl.partHoldBack) {\n return media.serverControl.partHoldBack;\n } else if (hasParts && media.partTargetDuration) {\n return media.partTargetDuration * 3; // finally look for full segment delays\n } else if (media.serverControl && media.serverControl.holdBack) {\n return media.serverControl.holdBack;\n } else if (media.targetDuration) {\n return media.targetDuration * 3;\n }\n\n return 0;\n};\n/**\n * walk backward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {Number} endSequence the mediaSequence to stop walking on\n */\n\n\nvar backwardDuration = function backwardDuration(playlist, endSequence) {\n var result = 0;\n var i = endSequence - playlist.mediaSequence; // if a start time is available for segment immediately following\n // the interval, use it\n\n var segment = playlist.segments[i]; // Walk backward until we find the latest segment with timeline\n // information that is earlier than endSequence\n\n if (segment) {\n if (typeof segment.start !== 'undefined') {\n return {\n result: segment.start,\n precise: true\n };\n }\n\n if (typeof segment.end !== 'undefined') {\n return {\n result: segment.end - segment.duration,\n precise: true\n };\n }\n }\n\n while (i--) {\n segment = playlist.segments[i];\n\n if (typeof segment.end !== 'undefined') {\n return {\n result: result + segment.end,\n precise: true\n };\n }\n\n result += segment.duration;\n\n if (typeof segment.start !== 'undefined') {\n return {\n result: result + segment.start,\n precise: true\n };\n }\n }\n\n return {\n result: result,\n precise: false\n };\n};\n/**\n * walk forward until we find a duration we can use\n * or return a failure\n *\n * @param {Playlist} playlist the playlist to walk through\n * @param {number} endSequence the mediaSequence to stop walking on\n */\n\n\nvar forwardDuration = function forwardDuration(playlist, endSequence) {\n var result = 0;\n var segment;\n var i = endSequence - playlist.mediaSequence; // Walk forward until we find the earliest segment with timeline\n // information\n\n for (; i < playlist.segments.length; i++) {\n segment = playlist.segments[i];\n\n if (typeof segment.start !== 'undefined') {\n return {\n result: segment.start - result,\n precise: true\n };\n }\n\n result += segment.duration;\n\n if (typeof segment.end !== 'undefined') {\n return {\n result: segment.end - result,\n precise: true\n };\n }\n } // indicate we didn't find a useful duration estimate\n\n\n return {\n result: -1,\n precise: false\n };\n};\n/**\n * Calculate the media duration from the segments associated with a\n * playlist. The duration of a subinterval of the available segments\n * may be calculated by specifying an end index.\n *\n * @param {Object} playlist a media playlist object\n * @param {number=} endSequence an exclusive upper boundary\n * for the playlist. Defaults to playlist length.\n * @param {number} expired the amount of time that has dropped\n * off the front of the playlist in a live scenario\n * @return {number} the duration between the first available segment\n * and end index.\n */\n\n\nvar intervalDuration = function intervalDuration(playlist, endSequence, expired) {\n if (typeof endSequence === 'undefined') {\n endSequence = playlist.mediaSequence + playlist.segments.length;\n }\n\n if (endSequence < playlist.mediaSequence) {\n return 0;\n } // do a backward walk to estimate the duration\n\n\n var backward = backwardDuration(playlist, endSequence);\n\n if (backward.precise) {\n // if we were able to base our duration estimate on timing\n // information provided directly from the Media Source, return\n // it\n return backward.result;\n } // walk forward to see if a precise duration estimate can be made\n // that way\n\n\n var forward = forwardDuration(playlist, endSequence);\n\n if (forward.precise) {\n // we found a segment that has been buffered and so it's\n // position is known precisely\n return forward.result;\n } // return the less-precise, playlist-based duration estimate\n\n\n return backward.result + expired;\n};\n/**\n * Calculates the duration of a playlist. If a start and end index\n * are specified, the duration will be for the subset of the media\n * timeline between those two indices. The total duration for live\n * playlists is always Infinity.\n *\n * @param {Object} playlist a media playlist object\n * @param {number=} endSequence an exclusive upper\n * boundary for the playlist. Defaults to the playlist media\n * sequence number plus its length.\n * @param {number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @return {number} the duration between the start index and end\n * index.\n */\n\n\nvar video_es_duration = function duration(playlist, endSequence, expired) {\n if (!playlist) {\n return 0;\n }\n\n if (typeof expired !== 'number') {\n expired = 0;\n } // if a slice of the total duration is not requested, use\n // playlist-level duration indicators when they're present\n\n\n if (typeof endSequence === 'undefined') {\n // if present, use the duration specified in the playlist\n if (playlist.totalDuration) {\n return playlist.totalDuration;\n } // duration should be Infinity for live playlists\n\n\n if (!playlist.endList) {\n return window_default.a.Infinity;\n }\n } // calculate the total duration based on the segment durations\n\n\n return intervalDuration(playlist, endSequence, expired);\n};\n/**\n * Calculate the time between two indexes in the current playlist\n * neight the start- nor the end-index need to be within the current\n * playlist in which case, the targetDuration of the playlist is used\n * to approximate the durations of the segments\n *\n * @param {Array} options.durationList list to iterate over for durations.\n * @param {number} options.defaultDuration duration to use for elements before or after the durationList\n * @param {number} options.startIndex partsAndSegments index to start\n * @param {number} options.endIndex partsAndSegments index to end.\n * @return {number} the number of seconds between startIndex and endIndex\n */\n\n\nvar sumDurations = function sumDurations(_ref2) {\n var defaultDuration = _ref2.defaultDuration,\n durationList = _ref2.durationList,\n startIndex = _ref2.startIndex,\n endIndex = _ref2.endIndex;\n var durations = 0;\n\n if (startIndex > endIndex) {\n var _ref3 = [endIndex, startIndex];\n startIndex = _ref3[0];\n endIndex = _ref3[1];\n }\n\n if (startIndex < 0) {\n for (var i = startIndex; i < Math.min(0, endIndex); i++) {\n durations += defaultDuration;\n }\n\n startIndex = 0;\n }\n\n for (var _i = startIndex; _i < endIndex; _i++) {\n durations += durationList[_i].duration;\n }\n\n return durations;\n};\n/**\n * Calculates the playlist end time\n *\n * @param {Object} playlist a media playlist object\n * @param {number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @param {boolean|false} useSafeLiveEnd a boolean value indicating whether or not the\n * playlist end calculation should consider the safe live end\n * (truncate the playlist end by three segments). This is normally\n * used for calculating the end of the playlist's seekable range.\n * This takes into account the value of liveEdgePadding.\n * Setting liveEdgePadding to 0 is equivalent to setting this to false.\n * @param {number} liveEdgePadding a number indicating how far from the end of the playlist we should be in seconds.\n * If this is provided, it is used in the safe live end calculation.\n * Setting useSafeLiveEnd=false or liveEdgePadding=0 are equivalent.\n * Corresponds to suggestedPresentationDelay in DASH manifests.\n * @return {number} the end time of playlist\n * @function playlistEnd\n */\n\n\nvar playlistEnd = function playlistEnd(playlist, expired, useSafeLiveEnd, liveEdgePadding) {\n if (!playlist || !playlist.segments) {\n return null;\n }\n\n if (playlist.endList) {\n return video_es_duration(playlist);\n }\n\n if (expired === null) {\n return null;\n }\n\n expired = expired || 0;\n var lastSegmentTime = intervalDuration(playlist, playlist.mediaSequence + playlist.segments.length, expired);\n\n if (useSafeLiveEnd) {\n liveEdgePadding = typeof liveEdgePadding === 'number' ? liveEdgePadding : liveEdgeDelay(null, playlist);\n lastSegmentTime -= liveEdgePadding;\n } // don't return a time less than zero\n\n\n return Math.max(0, lastSegmentTime);\n};\n/**\n * Calculates the interval of time that is currently seekable in a\n * playlist. The returned time ranges are relative to the earliest\n * moment in the specified playlist that is still available. A full\n * seekable implementation for live streams would need to offset\n * these values by the duration of content that has expired from the\n * stream.\n *\n * @param {Object} playlist a media playlist object\n * dropped off the front of the playlist in a live scenario\n * @param {number=} expired the amount of time that has\n * dropped off the front of the playlist in a live scenario\n * @param {number} liveEdgePadding how far from the end of the playlist we should be in seconds.\n * Corresponds to suggestedPresentationDelay in DASH manifests.\n * @return {TimeRanges} the periods of time that are valid targets\n * for seeking\n */\n\n\nvar video_es_seekable = function seekable(playlist, expired, liveEdgePadding) {\n var useSafeLiveEnd = true;\n var seekableStart = expired || 0;\n var seekableEnd = playlistEnd(playlist, expired, useSafeLiveEnd, liveEdgePadding);\n\n if (seekableEnd === null) {\n return createTimeRange();\n }\n\n return createTimeRange(seekableStart, seekableEnd);\n};\n/**\n * Determine the index and estimated starting time of the segment that\n * contains a specified playback position in a media playlist.\n *\n * @param {Object} options.playlist the media playlist to query\n * @param {number} options.currentTime The number of seconds since the earliest\n * possible position to determine the containing segment for\n * @param {number} options.startTime the time when the segment/part starts\n * @param {number} options.startingSegmentIndex the segment index to start looking at.\n * @param {number?} [options.startingPartIndex] the part index to look at within the segment.\n *\n * @return {Object} an object with partIndex, segmentIndex, and startTime.\n */\n\n\nvar getMediaInfoForTime = function getMediaInfoForTime(_ref4) {\n var playlist = _ref4.playlist,\n currentTime = _ref4.currentTime,\n startingSegmentIndex = _ref4.startingSegmentIndex,\n startingPartIndex = _ref4.startingPartIndex,\n startTime = _ref4.startTime,\n experimentalExactManifestTimings = _ref4.experimentalExactManifestTimings;\n var time = currentTime - startTime;\n var partsAndSegments = getPartsAndSegments(playlist);\n var startIndex = 0;\n\n for (var i = 0; i < partsAndSegments.length; i++) {\n var partAndSegment = partsAndSegments[i];\n\n if (startingSegmentIndex !== partAndSegment.segmentIndex) {\n continue;\n } // skip this if part index does not match.\n\n\n if (typeof startingPartIndex === 'number' && typeof partAndSegment.partIndex === 'number' && startingPartIndex !== partAndSegment.partIndex) {\n continue;\n }\n\n startIndex = i;\n break;\n }\n\n if (time < 0) {\n // Walk backward from startIndex in the playlist, adding durations\n // until we find a segment that contains `time` and return it\n if (startIndex > 0) {\n for (var _i2 = startIndex - 1; _i2 >= 0; _i2--) {\n var _partAndSegment = partsAndSegments[_i2];\n time += _partAndSegment.duration;\n\n if (experimentalExactManifestTimings) {\n if (time < 0) {\n continue;\n }\n } else if (time + TIME_FUDGE_FACTOR <= 0) {\n continue;\n }\n\n return {\n partIndex: _partAndSegment.partIndex,\n segmentIndex: _partAndSegment.segmentIndex,\n startTime: startTime - sumDurations({\n defaultDuration: playlist.targetDuration,\n durationList: partsAndSegments,\n startIndex: startIndex,\n endIndex: _i2\n })\n };\n }\n } // We were unable to find a good segment within the playlist\n // so select the first segment\n\n\n return {\n partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,\n segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,\n startTime: currentTime\n };\n } // When startIndex is negative, we first walk forward to first segment\n // adding target durations. If we \"run out of time\" before getting to\n // the first segment, return the first segment\n\n\n if (startIndex < 0) {\n for (var _i3 = startIndex; _i3 < 0; _i3++) {\n time -= playlist.targetDuration;\n\n if (time < 0) {\n return {\n partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,\n segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,\n startTime: currentTime\n };\n }\n }\n\n startIndex = 0;\n } // Walk forward from startIndex in the playlist, subtracting durations\n // until we find a segment that contains `time` and return it\n\n\n for (var _i4 = startIndex; _i4 < partsAndSegments.length; _i4++) {\n var _partAndSegment2 = partsAndSegments[_i4];\n time -= _partAndSegment2.duration;\n\n if (experimentalExactManifestTimings) {\n if (time > 0) {\n continue;\n }\n } else if (time - TIME_FUDGE_FACTOR >= 0) {\n continue;\n }\n\n return {\n partIndex: _partAndSegment2.partIndex,\n segmentIndex: _partAndSegment2.segmentIndex,\n startTime: startTime + sumDurations({\n defaultDuration: playlist.targetDuration,\n durationList: partsAndSegments,\n startIndex: startIndex,\n endIndex: _i4\n })\n };\n } // We are out of possible candidates so load the last one...\n\n\n return {\n segmentIndex: partsAndSegments[partsAndSegments.length - 1].segmentIndex,\n partIndex: partsAndSegments[partsAndSegments.length - 1].partIndex,\n startTime: currentTime\n };\n};\n/**\n * Check whether the playlist is blacklisted or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is blacklisted or not\n * @function isBlacklisted\n */\n\n\nvar isBlacklisted = function isBlacklisted(playlist) {\n return playlist.excludeUntil && playlist.excludeUntil > Date.now();\n};\n/**\n * Check whether the playlist is compatible with current playback configuration or has\n * been blacklisted permanently for being incompatible.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is incompatible or not\n * @function isIncompatible\n */\n\n\nvar isIncompatible = function isIncompatible(playlist) {\n return playlist.excludeUntil && playlist.excludeUntil === Infinity;\n};\n/**\n * Check whether the playlist is enabled or not.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is enabled or not\n * @function isEnabled\n */\n\n\nvar isEnabled = function isEnabled(playlist) {\n var blacklisted = isBlacklisted(playlist);\n return !playlist.disabled && !blacklisted;\n};\n/**\n * Check whether the playlist has been manually disabled through the representations api.\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist is disabled manually or not\n * @function isDisabled\n */\n\n\nvar isDisabled = function isDisabled(playlist) {\n return playlist.disabled;\n};\n/**\n * Returns whether the current playlist is an AES encrypted HLS stream\n *\n * @return {boolean} true if it's an AES encrypted HLS stream\n */\n\n\nvar isAes = function isAes(media) {\n for (var i = 0; i < media.segments.length; i++) {\n if (media.segments[i].key) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * Checks if the playlist has a value for the specified attribute\n *\n * @param {string} attr\n * Attribute to check for\n * @param {Object} playlist\n * The media playlist object\n * @return {boolean}\n * Whether the playlist contains a value for the attribute or not\n * @function hasAttribute\n */\n\n\nvar hasAttribute = function hasAttribute(attr, playlist) {\n return playlist.attributes && playlist.attributes[attr];\n};\n/**\n * Estimates the time required to complete a segment download from the specified playlist\n *\n * @param {number} segmentDuration\n * Duration of requested segment\n * @param {number} bandwidth\n * Current measured bandwidth of the player\n * @param {Object} playlist\n * The media playlist object\n * @param {number=} bytesReceived\n * Number of bytes already received for the request. Defaults to 0\n * @return {number|NaN}\n * The estimated time to request the segment. NaN if bandwidth information for\n * the given playlist is unavailable\n * @function estimateSegmentRequestTime\n */\n\n\nvar estimateSegmentRequestTime = function estimateSegmentRequestTime(segmentDuration, bandwidth, playlist, bytesReceived) {\n if (bytesReceived === void 0) {\n bytesReceived = 0;\n }\n\n if (!hasAttribute('BANDWIDTH', playlist)) {\n return NaN;\n }\n\n var size = segmentDuration * playlist.attributes.BANDWIDTH;\n return (size - bytesReceived * 8) / bandwidth;\n};\n/*\n * Returns whether the current playlist is the lowest rendition\n *\n * @return {Boolean} true if on lowest rendition\n */\n\n\nvar isLowestEnabledRendition = function isLowestEnabledRendition(master, media) {\n if (master.playlists.length === 1) {\n return true;\n }\n\n var currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;\n return master.playlists.filter(function (playlist) {\n if (!isEnabled(playlist)) {\n return false;\n }\n\n return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;\n }).length === 0;\n};\n\nvar playlistMatch = function playlistMatch(a, b) {\n // both playlits are null\n // or only one playlist is non-null\n // no match\n if (!a && !b || !a && b || a && !b) {\n return false;\n } // playlist objects are the same, match\n\n\n if (a === b) {\n return true;\n } // first try to use id as it should be the most\n // accurate\n\n\n if (a.id && b.id && a.id === b.id) {\n return true;\n } // next try to use reslovedUri as it should be the\n // second most accurate.\n\n\n if (a.resolvedUri && b.resolvedUri && a.resolvedUri === b.resolvedUri) {\n return true;\n } // finally try to use uri as it should be accurate\n // but might miss a few cases for relative uris\n\n\n if (a.uri && b.uri && a.uri === b.uri) {\n return true;\n }\n\n return false;\n};\n\nvar someAudioVariant = function someAudioVariant(master, callback) {\n var AUDIO = master && master.mediaGroups && master.mediaGroups.AUDIO || {};\n var found = false;\n\n for (var groupName in AUDIO) {\n for (var label in AUDIO[groupName]) {\n found = callback(AUDIO[groupName][label]);\n\n if (found) {\n break;\n }\n }\n\n if (found) {\n break;\n }\n }\n\n return !!found;\n};\n\nvar video_es_isAudioOnly = function isAudioOnly(master) {\n // we are audio only if we have no main playlists but do\n // have media group playlists.\n if (!master || !master.playlists || !master.playlists.length) {\n // without audio variants or playlists this\n // is not an audio only master.\n var found = someAudioVariant(master, function (variant) {\n return variant.playlists && variant.playlists.length || variant.uri;\n });\n return found;\n } // if every playlist has only an audio codec it is audio only\n\n\n var _loop = function _loop(i) {\n var playlist = master.playlists[i];\n var CODECS = playlist.attributes && playlist.attributes.CODECS; // all codecs are audio, this is an audio playlist.\n\n if (CODECS && CODECS.split(',').every(function (c) {\n return isAudioCodec(c);\n })) {\n return \"continue\";\n } // playlist is in an audio group it is audio only\n\n\n var found = someAudioVariant(master, function (variant) {\n return playlistMatch(playlist, variant);\n });\n\n if (found) {\n return \"continue\";\n } // if we make it here this playlist isn't audio and we\n // are not audio only\n\n\n return {\n v: false\n };\n };\n\n for (var i = 0; i < master.playlists.length; i++) {\n var _ret = _loop(i);\n\n if (_ret === \"continue\") continue;\n if (typeof _ret === \"object\") return _ret.v;\n } // if we make it past every playlist without returning, then\n // this is an audio only playlist.\n\n\n return true;\n}; // exports\n\n\nvar Playlist = {\n liveEdgeDelay: liveEdgeDelay,\n duration: video_es_duration,\n seekable: video_es_seekable,\n getMediaInfoForTime: getMediaInfoForTime,\n isEnabled: isEnabled,\n isDisabled: isDisabled,\n isBlacklisted: isBlacklisted,\n isIncompatible: isIncompatible,\n playlistEnd: playlistEnd,\n isAes: isAes,\n hasAttribute: hasAttribute,\n estimateSegmentRequestTime: estimateSegmentRequestTime,\n isLowestEnabledRendition: isLowestEnabledRendition,\n isAudioOnly: video_es_isAudioOnly,\n playlistMatch: playlistMatch\n};\nvar video_es_log = videojs.log;\n\nvar createPlaylistID = function createPlaylistID(index, uri) {\n return index + \"-\" + uri;\n};\n/**\n * Parses a given m3u8 playlist\n *\n * @param {Function} [onwarn]\n * a function to call when the parser triggers a warning event.\n * @param {Function} [oninfo]\n * a function to call when the parser triggers an info event.\n * @param {string} manifestString\n * The downloaded manifest string\n * @param {Object[]} [customTagParsers]\n * An array of custom tag parsers for the m3u8-parser instance\n * @param {Object[]} [customTagMappers]\n * An array of custom tag mappers for the m3u8-parser instance\n * @param {boolean} [experimentalLLHLS=false]\n * Whether to keep ll-hls features in the manifest after parsing.\n * @return {Object}\n * The manifest object\n */\n\n\nvar video_es_parseManifest = function parseManifest(_ref) {\n var onwarn = _ref.onwarn,\n oninfo = _ref.oninfo,\n manifestString = _ref.manifestString,\n _ref$customTagParsers = _ref.customTagParsers,\n customTagParsers = _ref$customTagParsers === void 0 ? [] : _ref$customTagParsers,\n _ref$customTagMappers = _ref.customTagMappers,\n customTagMappers = _ref$customTagMappers === void 0 ? [] : _ref$customTagMappers,\n experimentalLLHLS = _ref.experimentalLLHLS;\n var parser = new m3u8_parser_es_Parser();\n\n if (onwarn) {\n parser.on('warn', onwarn);\n }\n\n if (oninfo) {\n parser.on('info', oninfo);\n }\n\n customTagParsers.forEach(function (customParser) {\n return parser.addParser(customParser);\n });\n customTagMappers.forEach(function (mapper) {\n return parser.addTagMapper(mapper);\n });\n parser.push(manifestString);\n parser.end();\n var manifest = parser.manifest; // remove llhls features from the parsed manifest\n // if we don't want llhls support.\n\n if (!experimentalLLHLS) {\n ['preloadSegment', 'skip', 'serverControl', 'renditionReports', 'partInf', 'partTargetDuration'].forEach(function (k) {\n if (manifest.hasOwnProperty(k)) {\n delete manifest[k];\n }\n });\n\n if (manifest.segments) {\n manifest.segments.forEach(function (segment) {\n ['parts', 'preloadHints'].forEach(function (k) {\n if (segment.hasOwnProperty(k)) {\n delete segment[k];\n }\n });\n });\n }\n }\n\n if (!manifest.targetDuration) {\n var targetDuration = 10;\n\n if (manifest.segments && manifest.segments.length) {\n targetDuration = manifest.segments.reduce(function (acc, s) {\n return Math.max(acc, s.duration);\n }, 0);\n }\n\n if (onwarn) {\n onwarn(\"manifest has no targetDuration defaulting to \" + targetDuration);\n }\n\n manifest.targetDuration = targetDuration;\n }\n\n var parts = getLastParts(manifest);\n\n if (parts.length && !manifest.partTargetDuration) {\n var partTargetDuration = parts.reduce(function (acc, p) {\n return Math.max(acc, p.duration);\n }, 0);\n\n if (onwarn) {\n onwarn(\"manifest has no partTargetDuration defaulting to \" + partTargetDuration);\n video_es_log.error('LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.');\n }\n\n manifest.partTargetDuration = partTargetDuration;\n }\n\n return manifest;\n};\n/**\n * Loops through all supported media groups in master and calls the provided\n * callback for each group\n *\n * @param {Object} master\n * The parsed master manifest object\n * @param {Function} callback\n * Callback to call for each media group\n */\n\n\nvar forEachMediaGroup = function forEachMediaGroup(master, callback) {\n if (!master.mediaGroups) {\n return;\n }\n\n ['AUDIO', 'SUBTITLES'].forEach(function (mediaType) {\n if (!master.mediaGroups[mediaType]) {\n return;\n }\n\n for (var groupKey in master.mediaGroups[mediaType]) {\n for (var labelKey in master.mediaGroups[mediaType][groupKey]) {\n var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];\n callback(mediaProperties, mediaType, groupKey, labelKey);\n }\n }\n });\n};\n/**\n * Adds properties and attributes to the playlist to keep consistent functionality for\n * playlists throughout VHS.\n *\n * @param {Object} config\n * Arguments object\n * @param {Object} config.playlist\n * The media playlist\n * @param {string} [config.uri]\n * The uri to the media playlist (if media playlist is not from within a master\n * playlist)\n * @param {string} id\n * ID to use for the playlist\n */\n\n\nvar setupMediaPlaylist = function setupMediaPlaylist(_ref2) {\n var playlist = _ref2.playlist,\n uri = _ref2.uri,\n id = _ref2.id;\n playlist.id = id;\n playlist.playlistErrors_ = 0;\n\n if (uri) {\n // For media playlists, m3u8-parser does not have access to a URI, as HLS media\n // playlists do not contain their own source URI, but one is needed for consistency in\n // VHS.\n playlist.uri = uri;\n } // For HLS master playlists, even though certain attributes MUST be defined, the\n // stream may still be played without them.\n // For HLS media playlists, m3u8-parser does not attach an attributes object to the\n // manifest.\n //\n // To avoid undefined reference errors through the project, and make the code easier\n // to write/read, add an empty attributes object for these cases.\n\n\n playlist.attributes = playlist.attributes || {};\n};\n/**\n * Adds ID, resolvedUri, and attributes properties to each playlist of the master, where\n * necessary. In addition, creates playlist IDs for each playlist and adds playlist ID to\n * playlist references to the playlists array.\n *\n * @param {Object} master\n * The master playlist\n */\n\n\nvar setupMediaPlaylists = function setupMediaPlaylists(master) {\n var i = master.playlists.length;\n\n while (i--) {\n var playlist = master.playlists[i];\n setupMediaPlaylist({\n playlist: playlist,\n id: createPlaylistID(i, playlist.uri)\n });\n playlist.resolvedUri = video_es_resolveUrl(master.uri, playlist.uri);\n master.playlists[playlist.id] = playlist; // URI reference added for backwards compatibility\n\n master.playlists[playlist.uri] = playlist; // Although the spec states an #EXT-X-STREAM-INF tag MUST have a BANDWIDTH attribute,\n // the stream can be played without it. Although an attributes property may have been\n // added to the playlist to prevent undefined references, issue a warning to fix the\n // manifest.\n\n if (!playlist.attributes.BANDWIDTH) {\n video_es_log.warn('Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.');\n }\n }\n};\n/**\n * Adds resolvedUri properties to each media group.\n *\n * @param {Object} master\n * The master playlist\n */\n\n\nvar resolveMediaGroupUris = function resolveMediaGroupUris(master) {\n forEachMediaGroup(master, function (properties) {\n if (properties.uri) {\n properties.resolvedUri = video_es_resolveUrl(master.uri, properties.uri);\n }\n });\n};\n/**\n * Creates a master playlist wrapper to insert a sole media playlist into.\n *\n * @param {Object} media\n * Media playlist\n * @param {string} uri\n * The media URI\n *\n * @return {Object}\n * Master playlist\n */\n\n\nvar video_es_masterForMedia = function masterForMedia(media, uri) {\n var id = createPlaylistID(0, uri);\n var master = {\n mediaGroups: {\n 'AUDIO': {},\n 'VIDEO': {},\n 'CLOSED-CAPTIONS': {},\n 'SUBTITLES': {}\n },\n uri: window_default.a.location.href,\n resolvedUri: window_default.a.location.href,\n playlists: [{\n uri: uri,\n id: id,\n resolvedUri: uri,\n // m3u8-parser does not attach an attributes property to media playlists so make\n // sure that the property is attached to avoid undefined reference errors\n attributes: {}\n }]\n }; // set up ID reference\n\n master.playlists[id] = master.playlists[0]; // URI reference added for backwards compatibility\n\n master.playlists[uri] = master.playlists[0];\n return master;\n};\n/**\n * Does an in-place update of the master manifest to add updated playlist URI references\n * as well as other properties needed by VHS that aren't included by the parser.\n *\n * @param {Object} master\n * Master manifest object\n * @param {string} uri\n * The source URI\n */\n\n\nvar video_es_addPropertiesToMaster = function addPropertiesToMaster(master, uri) {\n master.uri = uri;\n\n for (var i = 0; i < master.playlists.length; i++) {\n if (!master.playlists[i].uri) {\n // Set up phony URIs for the playlists since playlists are referenced by their URIs\n // throughout VHS, but some formats (e.g., DASH) don't have external URIs\n // TODO: consider adding dummy URIs in mpd-parser\n var phonyUri = \"placeholder-uri-\" + i;\n master.playlists[i].uri = phonyUri;\n }\n }\n\n var audioOnlyMaster = video_es_isAudioOnly(master);\n forEachMediaGroup(master, function (properties, mediaType, groupKey, labelKey) {\n var groupId = \"placeholder-uri-\" + mediaType + \"-\" + groupKey + \"-\" + labelKey; // add a playlist array under properties\n\n if (!properties.playlists || !properties.playlists.length) {\n // If the manifest is audio only and this media group does not have a uri, check\n // if the media group is located in the main list of playlists. If it is, don't add\n // placeholder properties as it shouldn't be considered an alternate audio track.\n if (audioOnlyMaster && mediaType === 'AUDIO' && !properties.uri) {\n for (var _i = 0; _i < master.playlists.length; _i++) {\n var p = master.playlists[_i];\n\n if (p.attributes && p.attributes.AUDIO && p.attributes.AUDIO === groupKey) {\n return;\n }\n }\n }\n\n properties.playlists = [extends_default()({}, properties)];\n }\n\n properties.playlists.forEach(function (p, i) {\n var id = createPlaylistID(i, groupId);\n\n if (p.uri) {\n p.resolvedUri = p.resolvedUri || video_es_resolveUrl(master.uri, p.uri);\n } else {\n // DEPRECATED, this has been added to prevent a breaking change.\n // previously we only ever had a single media group playlist, so\n // we mark the first playlist uri without prepending the index as we used to\n // ideally we would do all of the playlists the same way.\n p.uri = i === 0 ? groupId : id; // don't resolve a placeholder uri to an absolute url, just use\n // the placeholder again\n\n p.resolvedUri = p.uri;\n }\n\n p.id = p.id || id; // add an empty attributes object, all playlists are\n // expected to have this.\n\n p.attributes = p.attributes || {}; // setup ID and URI references (URI for backwards compatibility)\n\n master.playlists[p.id] = p;\n master.playlists[p.uri] = p;\n });\n });\n setupMediaPlaylists(master);\n resolveMediaGroupUris(master);\n};\n\nvar mergeOptions$2 = videojs.mergeOptions,\n EventTarget$1 = videojs.EventTarget;\n\nvar addLLHLSQueryDirectives = function addLLHLSQueryDirectives(uri, media) {\n if (media.endList) {\n return uri;\n }\n\n var query = [];\n\n if (media.serverControl && media.serverControl.canBlockReload) {\n var preloadSegment = media.preloadSegment; // next msn is a zero based value, length is not.\n\n var nextMSN = media.mediaSequence + media.segments.length; // If preload segment has parts then it is likely\n // that we are going to request a part of that preload segment.\n // the logic below is used to determine that.\n\n if (preloadSegment) {\n var parts = preloadSegment.parts || []; // _HLS_part is a zero based index\n\n var nextPart = getKnownPartCount(media) - 1; // if nextPart is > -1 and not equal to just the\n // length of parts, then we know we had part preload hints\n // and we need to add the _HLS_part= query\n\n if (nextPart > -1 && nextPart !== parts.length - 1) {\n // add existing parts to our preload hints\n query.push(\"_HLS_part=\" + nextPart);\n } // this if statement makes sure that we request the msn\n // of the preload segment if:\n // 1. the preload segment had parts (and was not yet a full segment)\n // but was added to our segments array\n // 2. the preload segment had preload hints for parts that are not in\n // the manifest yet.\n // in all other cases we want the segment after the preload segment\n // which will be given by using media.segments.length because it is 1 based\n // rather than 0 based.\n\n\n if (nextPart > -1 || parts.length) {\n nextMSN--;\n }\n } // add _HLS_msn= in front of any _HLS_part query\n\n\n query.unshift(\"_HLS_msn=\" + nextMSN);\n }\n\n if (media.serverControl && media.serverControl.canSkipUntil) {\n // add _HLS_skip= infront of all other queries.\n query.unshift('_HLS_skip=' + (media.serverControl.canSkipDateranges ? 'v2' : 'YES'));\n }\n\n query.forEach(function (str, i) {\n var symbol = i === 0 ? '?' : '&';\n uri += \"\" + symbol + str;\n });\n return uri;\n};\n/**\n * Returns a new segment object with properties and\n * the parts array merged.\n *\n * @param {Object} a the old segment\n * @param {Object} b the new segment\n *\n * @return {Object} the merged segment\n */\n\n\nvar updateSegment = function updateSegment(a, b) {\n if (!a) {\n return b;\n }\n\n var result = mergeOptions$2(a, b); // if only the old segment has preload hints\n // and the new one does not, remove preload hints.\n\n if (a.preloadHints && !b.preloadHints) {\n delete result.preloadHints;\n } // if only the old segment has parts\n // then the parts are no longer valid\n\n\n if (a.parts && !b.parts) {\n delete result.parts; // if both segments have parts\n // copy part propeties from the old segment\n // to the new one.\n } else if (a.parts && b.parts) {\n for (var i = 0; i < b.parts.length; i++) {\n if (a.parts && a.parts[i]) {\n result.parts[i] = mergeOptions$2(a.parts[i], b.parts[i]);\n }\n }\n } // set skipped to false for segments that have\n // have had information merged from the old segment.\n\n\n if (!a.skipped && b.skipped) {\n result.skipped = false;\n } // set preload to false for segments that have\n // had information added in the new segment.\n\n\n if (a.preload && !b.preload) {\n result.preload = false;\n }\n\n return result;\n};\n/**\n * Returns a new array of segments that is the result of merging\n * properties from an older list of segments onto an updated\n * list. No properties on the updated playlist will be ovewritten.\n *\n * @param {Array} original the outdated list of segments\n * @param {Array} update the updated list of segments\n * @param {number=} offset the index of the first update\n * segment in the original segment list. For non-live playlists,\n * this should always be zero and does not need to be\n * specified. For live playlists, it should be the difference\n * between the media sequence numbers in the original and updated\n * playlists.\n * @return {Array} a list of merged segment objects\n */\n\n\nvar updateSegments = function updateSegments(original, update, offset) {\n var oldSegments = original.slice();\n var newSegments = update.slice();\n offset = offset || 0;\n var result = [];\n var currentMap;\n\n for (var newIndex = 0; newIndex < newSegments.length; newIndex++) {\n var oldSegment = oldSegments[newIndex + offset];\n var newSegment = newSegments[newIndex];\n\n if (oldSegment) {\n currentMap = oldSegment.map || currentMap;\n result.push(updateSegment(oldSegment, newSegment));\n } else {\n // carry over map to new segment if it is missing\n if (currentMap && !newSegment.map) {\n newSegment.map = currentMap;\n }\n\n result.push(newSegment);\n }\n }\n\n return result;\n};\n\nvar resolveSegmentUris = function resolveSegmentUris(segment, baseUri) {\n // preloadSegment will not have a uri at all\n // as the segment isn't actually in the manifest yet, only parts\n if (!segment.resolvedUri && segment.uri) {\n segment.resolvedUri = video_es_resolveUrl(baseUri, segment.uri);\n }\n\n if (segment.key && !segment.key.resolvedUri) {\n segment.key.resolvedUri = video_es_resolveUrl(baseUri, segment.key.uri);\n }\n\n if (segment.map && !segment.map.resolvedUri) {\n segment.map.resolvedUri = video_es_resolveUrl(baseUri, segment.map.uri);\n }\n\n if (segment.map && segment.map.key && !segment.map.key.resolvedUri) {\n segment.map.key.resolvedUri = video_es_resolveUrl(baseUri, segment.map.key.uri);\n }\n\n if (segment.parts && segment.parts.length) {\n segment.parts.forEach(function (p) {\n if (p.resolvedUri) {\n return;\n }\n\n p.resolvedUri = video_es_resolveUrl(baseUri, p.uri);\n });\n }\n\n if (segment.preloadHints && segment.preloadHints.length) {\n segment.preloadHints.forEach(function (p) {\n if (p.resolvedUri) {\n return;\n }\n\n p.resolvedUri = video_es_resolveUrl(baseUri, p.uri);\n });\n }\n};\n\nvar getAllSegments = function getAllSegments(media) {\n var segments = media.segments || [];\n var preloadSegment = media.preloadSegment; // a preloadSegment with only preloadHints is not currently\n // a usable segment, only include a preloadSegment that has\n // parts.\n\n if (preloadSegment && preloadSegment.parts && preloadSegment.parts.length) {\n // if preloadHints has a MAP that means that the\n // init segment is going to change. We cannot use any of the parts\n // from this preload segment.\n if (preloadSegment.preloadHints) {\n for (var i = 0; i < preloadSegment.preloadHints.length; i++) {\n if (preloadSegment.preloadHints[i].type === 'MAP') {\n return segments;\n }\n }\n } // set the duration for our preload segment to target duration.\n\n\n preloadSegment.duration = media.targetDuration;\n preloadSegment.preload = true;\n segments.push(preloadSegment);\n }\n\n return segments;\n}; // consider the playlist unchanged if the playlist object is the same or\n// the number of segments is equal, the media sequence number is unchanged,\n// and this playlist hasn't become the end of the playlist\n\n\nvar isPlaylistUnchanged = function isPlaylistUnchanged(a, b) {\n return a === b || a.segments && b.segments && a.segments.length === b.segments.length && a.endList === b.endList && a.mediaSequence === b.mediaSequence;\n};\n/**\n * Returns a new master playlist that is the result of merging an\n * updated media playlist into the original version. If the\n * updated media playlist does not match any of the playlist\n * entries in the original master playlist, null is returned.\n *\n * @param {Object} master a parsed master M3U8 object\n * @param {Object} media a parsed media M3U8 object\n * @return {Object} a new object that represents the original\n * master playlist with the updated media playlist merged in, or\n * null if the merge produced no change.\n */\n\n\nvar updateMaster$1 = function updateMaster(master, newMedia, unchangedCheck) {\n if (unchangedCheck === void 0) {\n unchangedCheck = isPlaylistUnchanged;\n }\n\n var result = mergeOptions$2(master, {});\n var oldMedia = result.playlists[newMedia.id];\n\n if (!oldMedia) {\n return null;\n }\n\n if (unchangedCheck(oldMedia, newMedia)) {\n return null;\n }\n\n newMedia.segments = getAllSegments(newMedia);\n var mergedPlaylist = mergeOptions$2(oldMedia, newMedia); // always use the new media's preload segment\n\n if (mergedPlaylist.preloadSegment && !newMedia.preloadSegment) {\n delete mergedPlaylist.preloadSegment;\n } // if the update could overlap existing segment information, merge the two segment lists\n\n\n if (oldMedia.segments) {\n if (newMedia.skip) {\n newMedia.segments = newMedia.segments || []; // add back in objects for skipped segments, so that we merge\n // old properties into the new segments\n\n for (var i = 0; i < newMedia.skip.skippedSegments; i++) {\n newMedia.segments.unshift({\n skipped: true\n });\n }\n }\n\n mergedPlaylist.segments = updateSegments(oldMedia.segments, newMedia.segments, newMedia.mediaSequence - oldMedia.mediaSequence);\n } // resolve any segment URIs to prevent us from having to do it later\n\n\n mergedPlaylist.segments.forEach(function (segment) {\n resolveSegmentUris(segment, mergedPlaylist.resolvedUri);\n }); // TODO Right now in the playlists array there are two references to each playlist, one\n // that is referenced by index, and one by URI. The index reference may no longer be\n // necessary.\n\n for (var _i = 0; _i < result.playlists.length; _i++) {\n if (result.playlists[_i].id === newMedia.id) {\n result.playlists[_i] = mergedPlaylist;\n }\n }\n\n result.playlists[newMedia.id] = mergedPlaylist; // URI reference added for backwards compatibility\n\n result.playlists[newMedia.uri] = mergedPlaylist; // update media group playlist references.\n\n forEachMediaGroup(master, function (properties, mediaType, groupKey, labelKey) {\n if (!properties.playlists) {\n return;\n }\n\n for (var _i2 = 0; _i2 < properties.playlists.length; _i2++) {\n if (newMedia.id === properties.playlists[_i2].id) {\n properties.playlists[_i2] = newMedia;\n }\n }\n });\n return result;\n};\n/**\n * Calculates the time to wait before refreshing a live playlist\n *\n * @param {Object} media\n * The current media\n * @param {boolean} update\n * True if there were any updates from the last refresh, false otherwise\n * @return {number}\n * The time in ms to wait before refreshing the live playlist\n */\n\n\nvar refreshDelay = function refreshDelay(media, update) {\n var lastSegment = media.segments[media.segments.length - 1];\n var lastPart = lastSegment && lastSegment.parts && lastSegment.parts[lastSegment.parts.length - 1];\n var lastDuration = lastPart && lastPart.duration || lastSegment && lastSegment.duration;\n\n if (update && lastDuration) {\n return lastDuration * 1000;\n } // if the playlist is unchanged since the last reload or last segment duration\n // cannot be determined, try again after half the target duration\n\n\n return (media.partTargetDuration || media.targetDuration || 10) * 500;\n};\n/**\n * Load a playlist from a remote location\n *\n * @class PlaylistLoader\n * @extends Stream\n * @param {string|Object} src url or object of manifest\n * @param {boolean} withCredentials the withCredentials xhr option\n * @class\n */\n\n\nvar video_es_PlaylistLoader = /*#__PURE__*/function (_EventTarget) {\n inheritsLoose_default()(PlaylistLoader, _EventTarget);\n\n function PlaylistLoader(src, vhs, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _EventTarget.call(this) || this;\n\n if (!src) {\n throw new Error('A non-empty playlist URL or object is required');\n }\n\n _this.logger_ = logger('PlaylistLoader');\n var _options = options,\n _options$withCredenti = _options.withCredentials,\n withCredentials = _options$withCredenti === void 0 ? false : _options$withCredenti,\n _options$handleManife = _options.handleManifestRedirects,\n handleManifestRedirects = _options$handleManife === void 0 ? false : _options$handleManife;\n _this.src = src;\n _this.vhs_ = vhs;\n _this.withCredentials = withCredentials;\n _this.handleManifestRedirects = handleManifestRedirects;\n var vhsOptions = vhs.options_;\n _this.customTagParsers = vhsOptions && vhsOptions.customTagParsers || [];\n _this.customTagMappers = vhsOptions && vhsOptions.customTagMappers || [];\n _this.experimentalLLHLS = vhsOptions && vhsOptions.experimentalLLHLS || false; // initialize the loader state\n\n _this.state = 'HAVE_NOTHING'; // live playlist staleness timeout\n\n _this.handleMediaupdatetimeout_ = _this.handleMediaupdatetimeout_.bind(assertThisInitialized_default()(_this));\n\n _this.on('mediaupdatetimeout', _this.handleMediaupdatetimeout_);\n\n return _this;\n }\n\n var _proto = PlaylistLoader.prototype;\n\n _proto.handleMediaupdatetimeout_ = function handleMediaupdatetimeout_() {\n var _this2 = this;\n\n if (this.state !== 'HAVE_METADATA') {\n // only refresh the media playlist if no other activity is going on\n return;\n }\n\n var media = this.media();\n var uri = video_es_resolveUrl(this.master.uri, media.uri);\n\n if (this.experimentalLLHLS) {\n uri = addLLHLSQueryDirectives(uri, media);\n }\n\n this.state = 'HAVE_CURRENT_METADATA';\n this.request = this.vhs_.xhr({\n uri: uri,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this2.request) {\n return;\n }\n\n if (error) {\n return _this2.playlistRequestError(_this2.request, _this2.media(), 'HAVE_METADATA');\n }\n\n _this2.haveMetadata({\n playlistString: _this2.request.responseText,\n url: _this2.media().uri,\n id: _this2.media().id\n });\n });\n };\n\n _proto.playlistRequestError = function playlistRequestError(xhr, playlist, startingState) {\n var uri = playlist.uri,\n id = playlist.id; // any in-flight request is now finished\n\n this.request = null;\n\n if (startingState) {\n this.state = startingState;\n }\n\n this.error = {\n playlist: this.master.playlists[id],\n status: xhr.status,\n message: \"HLS playlist request error at URL: \" + uri + \".\",\n responseText: xhr.responseText,\n code: xhr.status >= 500 ? 4 : 2\n };\n this.trigger('error');\n };\n\n _proto.parseManifest_ = function parseManifest_(_ref) {\n var _this3 = this;\n\n var url = _ref.url,\n manifestString = _ref.manifestString;\n return video_es_parseManifest({\n onwarn: function onwarn(_ref2) {\n var message = _ref2.message;\n return _this3.logger_(\"m3u8-parser warn for \" + url + \": \" + message);\n },\n oninfo: function oninfo(_ref3) {\n var message = _ref3.message;\n return _this3.logger_(\"m3u8-parser info for \" + url + \": \" + message);\n },\n manifestString: manifestString,\n customTagParsers: this.customTagParsers,\n customTagMappers: this.customTagMappers,\n experimentalLLHLS: this.experimentalLLHLS\n });\n }\n /**\n * Update the playlist loader's state in response to a new or updated playlist.\n *\n * @param {string} [playlistString]\n * Playlist string (if playlistObject is not provided)\n * @param {Object} [playlistObject]\n * Playlist object (if playlistString is not provided)\n * @param {string} url\n * URL of playlist\n * @param {string} id\n * ID to use for playlist\n */\n ;\n\n _proto.haveMetadata = function haveMetadata(_ref4) {\n var playlistString = _ref4.playlistString,\n playlistObject = _ref4.playlistObject,\n url = _ref4.url,\n id = _ref4.id; // any in-flight request is now finished\n\n this.request = null;\n this.state = 'HAVE_METADATA';\n var playlist = playlistObject || this.parseManifest_({\n url: url,\n manifestString: playlistString\n });\n playlist.lastRequest = Date.now();\n setupMediaPlaylist({\n playlist: playlist,\n uri: url,\n id: id\n }); // merge this playlist into the master\n\n var update = updateMaster$1(this.master, playlist);\n this.targetDuration = playlist.partTargetDuration || playlist.targetDuration;\n\n if (update) {\n this.master = update;\n this.media_ = this.master.playlists[id];\n } else {\n this.trigger('playlistunchanged');\n }\n\n this.updateMediaUpdateTimeout_(refreshDelay(this.media(), !!update));\n this.trigger('loadedplaylist');\n }\n /**\n * Abort any outstanding work and clean up.\n */\n ;\n\n _proto.dispose = function dispose() {\n this.trigger('dispose');\n this.stopRequest();\n window_default.a.clearTimeout(this.mediaUpdateTimeout);\n window_default.a.clearTimeout(this.finalRenditionTimeout);\n this.off();\n };\n\n _proto.stopRequest = function stopRequest() {\n if (this.request) {\n var oldRequest = this.request;\n this.request = null;\n oldRequest.onreadystatechange = null;\n oldRequest.abort();\n }\n }\n /**\n * When called without any arguments, returns the currently\n * active media playlist. When called with a single argument,\n * triggers the playlist loader to asynchronously switch to the\n * specified media playlist. Calling this method while the\n * loader is in the HAVE_NOTHING causes an error to be emitted\n * but otherwise has no effect.\n *\n * @param {Object=} playlist the parsed media playlist\n * object to switch to\n * @param {boolean=} shouldDelay whether we should delay the request by half target duration\n *\n * @return {Playlist} the current loaded media\n */\n ;\n\n _proto.media = function media(playlist, shouldDelay) {\n var _this4 = this; // getter\n\n\n if (!playlist) {\n return this.media_;\n } // setter\n\n\n if (this.state === 'HAVE_NOTHING') {\n throw new Error('Cannot switch media playlist from ' + this.state);\n } // find the playlist object if the target playlist has been\n // specified by URI\n\n\n if (typeof playlist === 'string') {\n if (!this.master.playlists[playlist]) {\n throw new Error('Unknown playlist URI: ' + playlist);\n }\n\n playlist = this.master.playlists[playlist];\n }\n\n window_default.a.clearTimeout(this.finalRenditionTimeout);\n\n if (shouldDelay) {\n var delay = (playlist.partTargetDuration || playlist.targetDuration) / 2 * 1000 || 5 * 1000;\n this.finalRenditionTimeout = window_default.a.setTimeout(this.media.bind(this, playlist, false), delay);\n return;\n }\n\n var startingState = this.state;\n var mediaChange = !this.media_ || playlist.id !== this.media_.id;\n var masterPlaylistRef = this.master.playlists[playlist.id]; // switch to fully loaded playlists immediately\n\n if (masterPlaylistRef && masterPlaylistRef.endList || // handle the case of a playlist object (e.g., if using vhs-json with a resolved\n // media playlist or, for the case of demuxed audio, a resolved audio media group)\n playlist.endList && playlist.segments.length) {\n // abort outstanding playlist requests\n if (this.request) {\n this.request.onreadystatechange = null;\n this.request.abort();\n this.request = null;\n }\n\n this.state = 'HAVE_METADATA';\n this.media_ = playlist; // trigger media change if the active media has been updated\n\n if (mediaChange) {\n this.trigger('mediachanging');\n\n if (startingState === 'HAVE_MASTER') {\n // The initial playlist was a master manifest, and the first media selected was\n // also provided (in the form of a resolved playlist object) as part of the\n // source object (rather than just a URL). Therefore, since the media playlist\n // doesn't need to be requested, loadedmetadata won't trigger as part of the\n // normal flow, and needs an explicit trigger here.\n this.trigger('loadedmetadata');\n } else {\n this.trigger('mediachange');\n }\n }\n\n return;\n } // We update/set the timeout here so that live playlists\n // that are not a media change will \"start\" the loader as expected.\n // We expect that this function will start the media update timeout\n // cycle again. This also prevents a playlist switch failure from\n // causing us to stall during live.\n\n\n this.updateMediaUpdateTimeout_(refreshDelay(playlist, true)); // switching to the active playlist is a no-op\n\n if (!mediaChange) {\n return;\n }\n\n this.state = 'SWITCHING_MEDIA'; // there is already an outstanding playlist request\n\n if (this.request) {\n if (playlist.resolvedUri === this.request.url) {\n // requesting to switch to the same playlist multiple times\n // has no effect after the first\n return;\n }\n\n this.request.onreadystatechange = null;\n this.request.abort();\n this.request = null;\n } // request the new playlist\n\n\n if (this.media_) {\n this.trigger('mediachanging');\n }\n\n this.request = this.vhs_.xhr({\n uri: playlist.resolvedUri,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this4.request) {\n return;\n }\n\n playlist.lastRequest = Date.now();\n playlist.resolvedUri = resolveManifestRedirect(_this4.handleManifestRedirects, playlist.resolvedUri, req);\n\n if (error) {\n return _this4.playlistRequestError(_this4.request, playlist, startingState);\n }\n\n _this4.haveMetadata({\n playlistString: req.responseText,\n url: playlist.uri,\n id: playlist.id\n }); // fire loadedmetadata the first time a media playlist is loaded\n\n\n if (startingState === 'HAVE_MASTER') {\n _this4.trigger('loadedmetadata');\n } else {\n _this4.trigger('mediachange');\n }\n });\n }\n /**\n * pause loading of the playlist\n */\n ;\n\n _proto.pause = function pause() {\n if (this.mediaUpdateTimeout) {\n window_default.a.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n }\n\n this.stopRequest();\n\n if (this.state === 'HAVE_NOTHING') {\n // If we pause the loader before any data has been retrieved, its as if we never\n // started, so reset to an unstarted state.\n this.started = false;\n } // Need to restore state now that no activity is happening\n\n\n if (this.state === 'SWITCHING_MEDIA') {\n // if the loader was in the process of switching media, it should either return to\n // HAVE_MASTER or HAVE_METADATA depending on if the loader has loaded a media\n // playlist yet. This is determined by the existence of loader.media_\n if (this.media_) {\n this.state = 'HAVE_METADATA';\n } else {\n this.state = 'HAVE_MASTER';\n }\n } else if (this.state === 'HAVE_CURRENT_METADATA') {\n this.state = 'HAVE_METADATA';\n }\n }\n /**\n * start loading of the playlist\n */\n ;\n\n _proto.load = function load(shouldDelay) {\n var _this5 = this;\n\n if (this.mediaUpdateTimeout) {\n window_default.a.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n }\n\n var media = this.media();\n\n if (shouldDelay) {\n var delay = media ? (media.partTargetDuration || media.targetDuration) / 2 * 1000 : 5 * 1000;\n this.mediaUpdateTimeout = window_default.a.setTimeout(function () {\n _this5.mediaUpdateTimeout = null;\n\n _this5.load();\n }, delay);\n return;\n }\n\n if (!this.started) {\n this.start();\n return;\n }\n\n if (media && !media.endList) {\n this.trigger('mediaupdatetimeout');\n } else {\n this.trigger('loadedplaylist');\n }\n };\n\n _proto.updateMediaUpdateTimeout_ = function updateMediaUpdateTimeout_(delay) {\n var _this6 = this;\n\n if (this.mediaUpdateTimeout) {\n window_default.a.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n } // we only have use mediaupdatetimeout for live playlists.\n\n\n if (!this.media() || this.media().endList) {\n return;\n }\n\n this.mediaUpdateTimeout = window_default.a.setTimeout(function () {\n _this6.mediaUpdateTimeout = null;\n\n _this6.trigger('mediaupdatetimeout');\n\n _this6.updateMediaUpdateTimeout_(delay);\n }, delay);\n }\n /**\n * start loading of the playlist\n */\n ;\n\n _proto.start = function start() {\n var _this7 = this;\n\n this.started = true;\n\n if (typeof this.src === 'object') {\n // in the case of an entirely constructed manifest object (meaning there's no actual\n // manifest on a server), default the uri to the page's href\n if (!this.src.uri) {\n this.src.uri = window_default.a.location.href;\n } // resolvedUri is added on internally after the initial request. Since there's no\n // request for pre-resolved manifests, add on resolvedUri here.\n\n\n this.src.resolvedUri = this.src.uri; // Since a manifest object was passed in as the source (instead of a URL), the first\n // request can be skipped (since the top level of the manifest, at a minimum, is\n // already available as a parsed manifest object). However, if the manifest object\n // represents a master playlist, some media playlists may need to be resolved before\n // the starting segment list is available. Therefore, go directly to setup of the\n // initial playlist, and let the normal flow continue from there.\n //\n // Note that the call to setup is asynchronous, as other sections of VHS may assume\n // that the first request is asynchronous.\n\n setTimeout(function () {\n _this7.setupInitialPlaylist(_this7.src);\n }, 0);\n return;\n } // request the specified URL\n\n\n this.request = this.vhs_.xhr({\n uri: this.src,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this7.request) {\n return;\n } // clear the loader's request reference\n\n\n _this7.request = null;\n\n if (error) {\n _this7.error = {\n status: req.status,\n message: \"HLS playlist request error at URL: \" + _this7.src + \".\",\n responseText: req.responseText,\n // MEDIA_ERR_NETWORK\n code: 2\n };\n\n if (_this7.state === 'HAVE_NOTHING') {\n _this7.started = false;\n }\n\n return _this7.trigger('error');\n }\n\n _this7.src = resolveManifestRedirect(_this7.handleManifestRedirects, _this7.src, req);\n\n var manifest = _this7.parseManifest_({\n manifestString: req.responseText,\n url: _this7.src\n });\n\n _this7.setupInitialPlaylist(manifest);\n });\n };\n\n _proto.srcUri = function srcUri() {\n return typeof this.src === 'string' ? this.src : this.src.uri;\n }\n /**\n * Given a manifest object that's either a master or media playlist, trigger the proper\n * events and set the state of the playlist loader.\n *\n * If the manifest object represents a master playlist, `loadedplaylist` will be\n * triggered to allow listeners to select a playlist. If none is selected, the loader\n * will default to the first one in the playlists array.\n *\n * If the manifest object represents a media playlist, `loadedplaylist` will be\n * triggered followed by `loadedmetadata`, as the only available playlist is loaded.\n *\n * In the case of a media playlist, a master playlist object wrapper with one playlist\n * will be created so that all logic can handle playlists in the same fashion (as an\n * assumed manifest object schema).\n *\n * @param {Object} manifest\n * The parsed manifest object\n */\n ;\n\n _proto.setupInitialPlaylist = function setupInitialPlaylist(manifest) {\n this.state = 'HAVE_MASTER';\n\n if (manifest.playlists) {\n this.master = manifest;\n video_es_addPropertiesToMaster(this.master, this.srcUri()); // If the initial master playlist has playlists wtih segments already resolved,\n // then resolve URIs in advance, as they are usually done after a playlist request,\n // which may not happen if the playlist is resolved.\n\n manifest.playlists.forEach(function (playlist) {\n playlist.segments = getAllSegments(playlist);\n playlist.segments.forEach(function (segment) {\n resolveSegmentUris(segment, playlist.resolvedUri);\n });\n });\n this.trigger('loadedplaylist');\n\n if (!this.request) {\n // no media playlist was specifically selected so start\n // from the first listed one\n this.media(this.master.playlists[0]);\n }\n\n return;\n } // In order to support media playlists passed in as vhs-json, the case where the uri\n // is not provided as part of the manifest should be considered, and an appropriate\n // default used.\n\n\n var uri = this.srcUri() || window_default.a.location.href;\n this.master = video_es_masterForMedia(manifest, uri);\n this.haveMetadata({\n playlistObject: manifest,\n url: uri,\n id: this.master.playlists[0].id\n });\n this.trigger('loadedmetadata');\n };\n\n return PlaylistLoader;\n}(EventTarget$1);\n/**\n * @file xhr.js\n */\n\n\nvar videojsXHR = videojs.xhr,\n mergeOptions$1 = videojs.mergeOptions;\n\nvar callbackWrapper = function callbackWrapper(request, error, response, callback) {\n var reqResponse = request.responseType === 'arraybuffer' ? request.response : request.responseText;\n\n if (!error && reqResponse) {\n request.responseTime = Date.now();\n request.roundTripTime = request.responseTime - request.requestTime;\n request.bytesReceived = reqResponse.byteLength || reqResponse.length;\n\n if (!request.bandwidth) {\n request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1000);\n }\n }\n\n if (response.headers) {\n request.responseHeaders = response.headers;\n } // videojs.xhr now uses a specific code on the error\n // object to signal that a request has timed out instead\n // of setting a boolean on the request object\n\n\n if (error && error.code === 'ETIMEDOUT') {\n request.timedout = true;\n } // videojs.xhr no longer considers status codes outside of 200 and 0\n // (for file uris) to be errors, but the old XHR did, so emulate that\n // behavior. Status 206 may be used in response to byterange requests.\n\n\n if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {\n error = new Error('XHR Failed with a response of: ' + (request && (reqResponse || request.responseText)));\n }\n\n callback(error, request);\n};\n\nvar xhrFactory = function xhrFactory() {\n var xhr = function XhrFunction(options, callback) {\n // Add a default timeout\n options = mergeOptions$1({\n timeout: 45e3\n }, options); // Allow an optional user-specified function to modify the option\n // object before we construct the xhr request\n\n var beforeRequest = XhrFunction.beforeRequest || videojs.Vhs.xhr.beforeRequest;\n\n if (beforeRequest && typeof beforeRequest === 'function') {\n var newOptions = beforeRequest(options);\n\n if (newOptions) {\n options = newOptions;\n }\n } // Use the standard videojs.xhr() method unless `videojs.Vhs.xhr` has been overriden\n // TODO: switch back to videojs.Vhs.xhr.name === 'XhrFunction' when we drop IE11\n\n\n var xhrMethod = videojs.Vhs.xhr.original === true ? videojsXHR : videojs.Vhs.xhr;\n var request = xhrMethod(options, function (error, response) {\n return callbackWrapper(request, error, response, callback);\n });\n var originalAbort = request.abort;\n\n request.abort = function () {\n request.aborted = true;\n return originalAbort.apply(request, arguments);\n };\n\n request.uri = options.uri;\n request.requestTime = Date.now();\n return request;\n };\n\n xhr.original = true;\n return xhr;\n};\n/**\n * Turns segment byterange into a string suitable for use in\n * HTTP Range requests\n *\n * @param {Object} byterange - an object with two values defining the start and end\n * of a byte-range\n */\n\n\nvar byterangeStr = function byterangeStr(byterange) {\n // `byterangeEnd` is one less than `offset + length` because the HTTP range\n // header uses inclusive ranges\n var byterangeEnd = byterange.offset + byterange.length - 1;\n var byterangeStart = byterange.offset;\n return 'bytes=' + byterangeStart + '-' + byterangeEnd;\n};\n/**\n * Defines headers for use in the xhr request for a particular segment.\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n */\n\n\nvar segmentXhrHeaders = function segmentXhrHeaders(segment) {\n var headers = {};\n\n if (segment.byterange) {\n headers.Range = byterangeStr(segment.byterange);\n }\n\n return headers;\n};\n/**\n * @file bin-utils.js\n */\n\n/**\n * convert a TimeRange to text\n *\n * @param {TimeRange} range the timerange to use for conversion\n * @param {number} i the iterator on the range to convert\n * @return {string} the range in string format\n */\n\n\nvar textRange = function textRange(range, i) {\n return range.start(i) + '-' + range.end(i);\n};\n/**\n * format a number as hex string\n *\n * @param {number} e The number\n * @param {number} i the iterator\n * @return {string} the hex formatted number as a string\n */\n\n\nvar formatHexString = function formatHexString(e, i) {\n var value = e.toString(16);\n return '00'.substring(0, 2 - value.length) + value + (i % 2 ? ' ' : '');\n};\n\nvar formatAsciiString = function formatAsciiString(e) {\n if (e >= 0x20 && e < 0x7e) {\n return String.fromCharCode(e);\n }\n\n return '.';\n};\n/**\n * Creates an object for sending to a web worker modifying properties that are TypedArrays\n * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n *\n * @param {Object} message\n * Object of properties and values to send to the web worker\n * @return {Object}\n * Modified message with TypedArray values expanded\n * @function createTransferableMessage\n */\n\n\nvar createTransferableMessage = function createTransferableMessage(message) {\n var transferable = {};\n Object.keys(message).forEach(function (key) {\n var value = message[key];\n\n if (ArrayBuffer.isView(value)) {\n transferable[key] = {\n bytes: value.buffer,\n byteOffset: value.byteOffset,\n byteLength: value.byteLength\n };\n } else {\n transferable[key] = value;\n }\n });\n return transferable;\n};\n/**\n * Returns a unique string identifier for a media initialization\n * segment.\n *\n * @param {Object} initSegment\n * the init segment object.\n *\n * @return {string} the generated init segment id\n */\n\n\nvar initSegmentId = function initSegmentId(initSegment) {\n var byterange = initSegment.byterange || {\n length: Infinity,\n offset: 0\n };\n return [byterange.length, byterange.offset, initSegment.resolvedUri].join(',');\n};\n/**\n * Returns a unique string identifier for a media segment key.\n *\n * @param {Object} key the encryption key\n * @return {string} the unique id for the media segment key.\n */\n\n\nvar segmentKeyId = function segmentKeyId(key) {\n return key.resolvedUri;\n};\n/**\n * utils to help dump binary data to the console\n *\n * @param {Array|TypedArray} data\n * data to dump to a string\n *\n * @return {string} the data as a hex string.\n */\n\n\nvar hexDump = function hexDump(data) {\n var bytes = Array.prototype.slice.call(data);\n var step = 16;\n var result = '';\n var hex;\n var ascii;\n\n for (var j = 0; j < bytes.length / step; j++) {\n hex = bytes.slice(j * step, j * step + step).map(formatHexString).join('');\n ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join('');\n result += hex + ' ' + ascii + '\\n';\n }\n\n return result;\n};\n\nvar tagDump = function tagDump(_ref) {\n var bytes = _ref.bytes;\n return hexDump(bytes);\n};\n\nvar textRanges = function textRanges(ranges) {\n var result = '';\n var i;\n\n for (i = 0; i < ranges.length; i++) {\n result += textRange(ranges, i) + ' ';\n }\n\n return result;\n};\n\nvar utils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n createTransferableMessage: createTransferableMessage,\n initSegmentId: initSegmentId,\n segmentKeyId: segmentKeyId,\n hexDump: hexDump,\n tagDump: tagDump,\n textRanges: textRanges\n}); // TODO handle fmp4 case where the timing info is accurate and doesn't involve transmux\n// 25% was arbitrarily chosen, and may need to be refined over time.\n\nvar SEGMENT_END_FUDGE_PERCENT = 0.25;\n/**\n * Converts a player time (any time that can be gotten/set from player.currentTime(),\n * e.g., any time within player.seekable().start(0) to player.seekable().end(0)) to a\n * program time (any time referencing the real world (e.g., EXT-X-PROGRAM-DATE-TIME)).\n *\n * The containing segment is required as the EXT-X-PROGRAM-DATE-TIME serves as an \"anchor\n * point\" (a point where we have a mapping from program time to player time, with player\n * time being the post transmux start of the segment).\n *\n * For more details, see [this doc](../../docs/program-time-from-player-time.md).\n *\n * @param {number} playerTime the player time\n * @param {Object} segment the segment which contains the player time\n * @return {Date} program time\n */\n\nvar playerTimeToProgramTime = function playerTimeToProgramTime(playerTime, segment) {\n if (!segment.dateTimeObject) {\n // Can't convert without an \"anchor point\" for the program time (i.e., a time that can\n // be used to map the start of a segment with a real world time).\n return null;\n }\n\n var transmuxerPrependedSeconds = segment.videoTimingInfo.transmuxerPrependedSeconds;\n var transmuxedStart = segment.videoTimingInfo.transmuxedPresentationStart; // get the start of the content from before old content is prepended\n\n var startOfSegment = transmuxedStart + transmuxerPrependedSeconds;\n var offsetFromSegmentStart = playerTime - startOfSegment;\n return new Date(segment.dateTimeObject.getTime() + offsetFromSegmentStart * 1000);\n};\n\nvar originalSegmentVideoDuration = function originalSegmentVideoDuration(videoTimingInfo) {\n return videoTimingInfo.transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds;\n};\n/**\n * Finds a segment that contains the time requested given as an ISO-8601 string. The\n * returned segment might be an estimate or an accurate match.\n *\n * @param {string} programTime The ISO-8601 programTime to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\n\nvar findSegmentForProgramTime = function findSegmentForProgramTime(programTime, playlist) {\n // Assumptions:\n // - verifyProgramDateTimeTags has already been run\n // - live streams have been started\n var dateTimeObject;\n\n try {\n dateTimeObject = new Date(programTime);\n } catch (e) {\n return null;\n }\n\n if (!playlist || !playlist.segments || playlist.segments.length === 0) {\n return null;\n }\n\n var segment = playlist.segments[0];\n\n if (dateTimeObject < segment.dateTimeObject) {\n // Requested time is before stream start.\n return null;\n }\n\n for (var i = 0; i < playlist.segments.length - 1; i++) {\n segment = playlist.segments[i];\n var nextSegmentStart = playlist.segments[i + 1].dateTimeObject;\n\n if (dateTimeObject < nextSegmentStart) {\n break;\n }\n }\n\n var lastSegment = playlist.segments[playlist.segments.length - 1];\n var lastSegmentStart = lastSegment.dateTimeObject;\n var lastSegmentDuration = lastSegment.videoTimingInfo ? originalSegmentVideoDuration(lastSegment.videoTimingInfo) : lastSegment.duration + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT;\n var lastSegmentEnd = new Date(lastSegmentStart.getTime() + lastSegmentDuration * 1000);\n\n if (dateTimeObject > lastSegmentEnd) {\n // Beyond the end of the stream, or our best guess of the end of the stream.\n return null;\n }\n\n if (dateTimeObject > lastSegmentStart) {\n segment = lastSegment;\n }\n\n return {\n segment: segment,\n estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)),\n // Although, given that all segments have accurate date time objects, the segment\n // selected should be accurate, unless the video has been transmuxed at some point\n // (determined by the presence of the videoTimingInfo object), the segment's \"player\n // time\" (the start time in the player) can't be considered accurate.\n type: segment.videoTimingInfo ? 'accurate' : 'estimate'\n };\n};\n/**\n * Finds a segment that contains the given player time(in seconds).\n *\n * @param {number} time The player time to find a match for\n * @param {Object} playlist A playlist object to search within\n */\n\n\nvar findSegmentForPlayerTime = function findSegmentForPlayerTime(time, playlist) {\n // Assumptions:\n // - there will always be a segment.duration\n // - we can start from zero\n // - segments are in time order\n if (!playlist || !playlist.segments || playlist.segments.length === 0) {\n return null;\n }\n\n var segmentEnd = 0;\n var segment;\n\n for (var i = 0; i < playlist.segments.length; i++) {\n segment = playlist.segments[i]; // videoTimingInfo is set after the segment is downloaded and transmuxed, and\n // should contain the most accurate values we have for the segment's player times.\n //\n // Use the accurate transmuxedPresentationEnd value if it is available, otherwise fall\n // back to an estimate based on the manifest derived (inaccurate) segment.duration, to\n // calculate an end value.\n\n segmentEnd = segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationEnd : segmentEnd + segment.duration;\n\n if (time <= segmentEnd) {\n break;\n }\n }\n\n var lastSegment = playlist.segments[playlist.segments.length - 1];\n\n if (lastSegment.videoTimingInfo && lastSegment.videoTimingInfo.transmuxedPresentationEnd < time) {\n // The time requested is beyond the stream end.\n return null;\n }\n\n if (time > segmentEnd) {\n // The time is within or beyond the last segment.\n //\n // Check to see if the time is beyond a reasonable guess of the end of the stream.\n if (time > segmentEnd + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT) {\n // Technically, because the duration value is only an estimate, the time may still\n // exist in the last segment, however, there isn't enough information to make even\n // a reasonable estimate.\n return null;\n }\n\n segment = lastSegment;\n }\n\n return {\n segment: segment,\n estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : segmentEnd - segment.duration,\n // Because videoTimingInfo is only set after transmux, it is the only way to get\n // accurate timing values.\n type: segment.videoTimingInfo ? 'accurate' : 'estimate'\n };\n};\n/**\n * Gives the offset of the comparisonTimestamp from the programTime timestamp in seconds.\n * If the offset returned is positive, the programTime occurs after the\n * comparisonTimestamp.\n * If the offset is negative, the programTime occurs before the comparisonTimestamp.\n *\n * @param {string} comparisonTimeStamp An ISO-8601 timestamp to compare against\n * @param {string} programTime The programTime as an ISO-8601 string\n * @return {number} offset\n */\n\n\nvar getOffsetFromTimestamp = function getOffsetFromTimestamp(comparisonTimeStamp, programTime) {\n var segmentDateTime;\n var programDateTime;\n\n try {\n segmentDateTime = new Date(comparisonTimeStamp);\n programDateTime = new Date(programTime);\n } catch (e) {// TODO handle error\n }\n\n var segmentTimeEpoch = segmentDateTime.getTime();\n var programTimeEpoch = programDateTime.getTime();\n return (programTimeEpoch - segmentTimeEpoch) / 1000;\n};\n/**\n * Checks that all segments in this playlist have programDateTime tags.\n *\n * @param {Object} playlist A playlist object\n */\n\n\nvar verifyProgramDateTimeTags = function verifyProgramDateTimeTags(playlist) {\n if (!playlist.segments || playlist.segments.length === 0) {\n return false;\n }\n\n for (var i = 0; i < playlist.segments.length; i++) {\n var segment = playlist.segments[i];\n\n if (!segment.dateTimeObject) {\n return false;\n }\n }\n\n return true;\n};\n/**\n * Returns the programTime of the media given a playlist and a playerTime.\n * The playlist must have programDateTime tags for a programDateTime tag to be returned.\n * If the segments containing the time requested have not been buffered yet, an estimate\n * may be returned to the callback.\n *\n * @param {Object} args\n * @param {Object} args.playlist A playlist object to search within\n * @param {number} time A playerTime in seconds\n * @param {Function} callback(err, programTime)\n * @return {string} err.message A detailed error message\n * @return {Object} programTime\n * @return {number} programTime.mediaSeconds The streamTime in seconds\n * @return {string} programTime.programDateTime The programTime as an ISO-8601 String\n */\n\n\nvar getProgramTime = function getProgramTime(_ref) {\n var playlist = _ref.playlist,\n _ref$time = _ref.time,\n time = _ref$time === void 0 ? undefined : _ref$time,\n callback = _ref.callback;\n\n if (!callback) {\n throw new Error('getProgramTime: callback must be provided');\n }\n\n if (!playlist || time === undefined) {\n return callback({\n message: 'getProgramTime: playlist and time must be provided'\n });\n }\n\n var matchedSegment = findSegmentForPlayerTime(time, playlist);\n\n if (!matchedSegment) {\n return callback({\n message: 'valid programTime was not found'\n });\n }\n\n if (matchedSegment.type === 'estimate') {\n return callback({\n message: 'Accurate programTime could not be determined.' + ' Please seek to e.seekTime and try again',\n seekTime: matchedSegment.estimatedStart\n });\n }\n\n var programTimeObject = {\n mediaSeconds: time\n };\n var programTime = playerTimeToProgramTime(time, matchedSegment.segment);\n\n if (programTime) {\n programTimeObject.programDateTime = programTime.toISOString();\n }\n\n return callback(null, programTimeObject);\n};\n/**\n * Seeks in the player to a time that matches the given programTime ISO-8601 string.\n *\n * @param {Object} args\n * @param {string} args.programTime A programTime to seek to as an ISO-8601 String\n * @param {Object} args.playlist A playlist to look within\n * @param {number} args.retryCount The number of times to try for an accurate seek. Default is 2.\n * @param {Function} args.seekTo A method to perform a seek\n * @param {boolean} args.pauseAfterSeek Whether to end in a paused state after seeking. Default is true.\n * @param {Object} args.tech The tech to seek on\n * @param {Function} args.callback(err, newTime) A callback to return the new time to\n * @return {string} err.message A detailed error message\n * @return {number} newTime The exact time that was seeked to in seconds\n */\n\n\nvar seekToProgramTime = function seekToProgramTime(_ref2) {\n var programTime = _ref2.programTime,\n playlist = _ref2.playlist,\n _ref2$retryCount = _ref2.retryCount,\n retryCount = _ref2$retryCount === void 0 ? 2 : _ref2$retryCount,\n seekTo = _ref2.seekTo,\n _ref2$pauseAfterSeek = _ref2.pauseAfterSeek,\n pauseAfterSeek = _ref2$pauseAfterSeek === void 0 ? true : _ref2$pauseAfterSeek,\n tech = _ref2.tech,\n callback = _ref2.callback;\n\n if (!callback) {\n throw new Error('seekToProgramTime: callback must be provided');\n }\n\n if (typeof programTime === 'undefined' || !playlist || !seekTo) {\n return callback({\n message: 'seekToProgramTime: programTime, seekTo and playlist must be provided'\n });\n }\n\n if (!playlist.endList && !tech.hasStarted_) {\n return callback({\n message: 'player must be playing a live stream to start buffering'\n });\n }\n\n if (!verifyProgramDateTimeTags(playlist)) {\n return callback({\n message: 'programDateTime tags must be provided in the manifest ' + playlist.resolvedUri\n });\n }\n\n var matchedSegment = findSegmentForProgramTime(programTime, playlist); // no match\n\n if (!matchedSegment) {\n return callback({\n message: programTime + \" was not found in the stream\"\n });\n }\n\n var segment = matchedSegment.segment;\n var mediaOffset = getOffsetFromTimestamp(segment.dateTimeObject, programTime);\n\n if (matchedSegment.type === 'estimate') {\n // we've run out of retries\n if (retryCount === 0) {\n return callback({\n message: programTime + \" is not buffered yet. Try again\"\n });\n }\n\n seekTo(matchedSegment.estimatedStart + mediaOffset);\n tech.one('seeked', function () {\n seekToProgramTime({\n programTime: programTime,\n playlist: playlist,\n retryCount: retryCount - 1,\n seekTo: seekTo,\n pauseAfterSeek: pauseAfterSeek,\n tech: tech,\n callback: callback\n });\n });\n return;\n } // Since the segment.start value is determined from the buffered end or ending time\n // of the prior segment, the seekToTime doesn't need to account for any transmuxer\n // modifications.\n\n\n var seekToTime = segment.start + mediaOffset;\n\n var seekedCallback = function seekedCallback() {\n return callback(null, tech.currentTime());\n }; // listen for seeked event\n\n\n tech.one('seeked', seekedCallback); // pause before seeking as video.js will restore this state\n\n if (pauseAfterSeek) {\n tech.pause();\n }\n\n seekTo(seekToTime);\n}; // which will only happen if the request is complete.\n\n\nvar callbackOnCompleted = function callbackOnCompleted(request, cb) {\n if (request.readyState === 4) {\n return cb();\n }\n\n return;\n};\n\nvar video_es_containerRequest = function containerRequest(uri, xhr, cb) {\n var bytes = [];\n var id3Offset;\n var finished = false;\n\n var endRequestAndCallback = function endRequestAndCallback(err, req, type, _bytes) {\n req.abort();\n finished = true;\n return cb(err, req, type, _bytes);\n };\n\n var progressListener = function progressListener(error, request) {\n if (finished) {\n return;\n }\n\n if (error) {\n return endRequestAndCallback(error, request, '', bytes);\n } // grap the new part of content that was just downloaded\n\n\n var newPart = request.responseText.substring(bytes && bytes.byteLength || 0, request.responseText.length); // add that onto bytes\n\n bytes = concatTypedArrays(bytes, stringToBytes(newPart, true));\n id3Offset = id3Offset || id3_helpers_getId3Offset(bytes); // we need at least 10 bytes to determine a type\n // or we need at least two bytes after an id3Offset\n\n if (bytes.length < 10 || id3Offset && bytes.length < id3Offset + 2) {\n return callbackOnCompleted(request, function () {\n return endRequestAndCallback(error, request, '', bytes);\n });\n }\n\n var type = containers_detectContainerForBytes(bytes); // if this looks like a ts segment but we don't have enough data\n // to see the second sync byte, wait until we have enough data\n // before declaring it ts\n\n if (type === 'ts' && bytes.length < 188) {\n return callbackOnCompleted(request, function () {\n return endRequestAndCallback(error, request, '', bytes);\n });\n } // this may be an unsynced ts segment\n // wait for 376 bytes before detecting no container\n\n\n if (!type && bytes.length < 376) {\n return callbackOnCompleted(request, function () {\n return endRequestAndCallback(error, request, '', bytes);\n });\n }\n\n return endRequestAndCallback(null, request, type, bytes);\n };\n\n var options = {\n uri: uri,\n beforeSend: function beforeSend(request) {\n // this forces the browser to pass the bytes to us unprocessed\n request.overrideMimeType('text/plain; charset=x-user-defined');\n request.addEventListener('progress', function (_ref) {\n _ref.total;\n _ref.loaded;\n return callbackWrapper(request, null, {\n statusCode: request.status\n }, progressListener);\n });\n }\n };\n var request = xhr(options, function (error, response) {\n return callbackWrapper(request, error, response, progressListener);\n });\n return request;\n};\n\nvar EventTarget = videojs.EventTarget,\n mergeOptions = videojs.mergeOptions;\n\nvar dashPlaylistUnchanged = function dashPlaylistUnchanged(a, b) {\n if (!isPlaylistUnchanged(a, b)) {\n return false;\n } // for dash the above check will often return true in scenarios where\n // the playlist actually has changed because mediaSequence isn't a\n // dash thing, and we often set it to 1. So if the playlists have the same amount\n // of segments we return true.\n // So for dash we need to make sure that the underlying segments are different.\n // if sidx changed then the playlists are different.\n\n\n if (a.sidx && b.sidx && (a.sidx.offset !== b.sidx.offset || a.sidx.length !== b.sidx.length)) {\n return false;\n } else if (!a.sidx && b.sidx || a.sidx && !b.sidx) {\n return false;\n } // one or the other does not have segments\n // there was a change.\n\n\n if (a.segments && !b.segments || !a.segments && b.segments) {\n return false;\n } // neither has segments nothing changed\n\n\n if (!a.segments && !b.segments) {\n return true;\n } // check segments themselves\n\n\n for (var i = 0; i < a.segments.length; i++) {\n var aSegment = a.segments[i];\n var bSegment = b.segments[i]; // if uris are different between segments there was a change\n\n if (aSegment.uri !== bSegment.uri) {\n return false;\n } // neither segment has a byterange, there will be no byterange change.\n\n\n if (!aSegment.byterange && !bSegment.byterange) {\n continue;\n }\n\n var aByterange = aSegment.byterange;\n var bByterange = bSegment.byterange; // if byterange only exists on one of the segments, there was a change.\n\n if (aByterange && !bByterange || !aByterange && bByterange) {\n return false;\n } // if both segments have byterange with different offsets, there was a change.\n\n\n if (aByterange.offset !== bByterange.offset || aByterange.length !== bByterange.length) {\n return false;\n }\n } // if everything was the same with segments, this is the same playlist.\n\n\n return true;\n};\n/**\n * Parses the master XML string and updates playlist URI references.\n *\n * @param {Object} config\n * Object of arguments\n * @param {string} config.masterXml\n * The mpd XML\n * @param {string} config.srcUrl\n * The mpd URL\n * @param {Date} config.clientOffset\n * A time difference between server and client\n * @param {Object} config.sidxMapping\n * SIDX mappings for moof/mdat URIs and byte ranges\n * @return {Object}\n * The parsed mpd manifest object\n */\n\n\nvar video_es_parseMasterXml = function parseMasterXml(_ref) {\n var masterXml = _ref.masterXml,\n srcUrl = _ref.srcUrl,\n clientOffset = _ref.clientOffset,\n sidxMapping = _ref.sidxMapping;\n var master = parse(masterXml, {\n manifestUri: srcUrl,\n clientOffset: clientOffset,\n sidxMapping: sidxMapping\n });\n video_es_addPropertiesToMaster(master, srcUrl);\n return master;\n};\n/**\n * Returns a new master manifest that is the result of merging an updated master manifest\n * into the original version.\n *\n * @param {Object} oldMaster\n * The old parsed mpd object\n * @param {Object} newMaster\n * The updated parsed mpd object\n * @return {Object}\n * A new object representing the original master manifest with the updated media\n * playlists merged in\n */\n\n\nvar video_es_updateMaster = function updateMaster(oldMaster, newMaster, sidxMapping) {\n var noChanges = true;\n var update = mergeOptions(oldMaster, {\n // These are top level properties that can be updated\n duration: newMaster.duration,\n minimumUpdatePeriod: newMaster.minimumUpdatePeriod\n }); // First update the playlists in playlist list\n\n for (var i = 0; i < newMaster.playlists.length; i++) {\n var playlist = newMaster.playlists[i];\n\n if (playlist.sidx) {\n var sidxKey = generateSidxKey(playlist.sidx); // add sidx segments to the playlist if we have all the sidx info already\n\n if (sidxMapping && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx) {\n addSidxSegmentsToPlaylist(playlist, sidxMapping[sidxKey].sidx, playlist.sidx.resolvedUri);\n }\n }\n\n var playlistUpdate = updateMaster$1(update, playlist, dashPlaylistUnchanged);\n\n if (playlistUpdate) {\n update = playlistUpdate;\n noChanges = false;\n }\n } // Then update media group playlists\n\n\n forEachMediaGroup(newMaster, function (properties, type, group, label) {\n if (properties.playlists && properties.playlists.length) {\n var id = properties.playlists[0].id;\n\n var _playlistUpdate = updateMaster$1(update, properties.playlists[0], dashPlaylistUnchanged);\n\n if (_playlistUpdate) {\n update = _playlistUpdate; // update the playlist reference within media groups\n\n update.mediaGroups[type][group][label].playlists[0] = update.playlists[id];\n noChanges = false;\n }\n }\n });\n\n if (newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) {\n noChanges = false;\n }\n\n if (noChanges) {\n return null;\n }\n\n return update;\n}; // SIDX should be equivalent if the URI and byteranges of the SIDX match.\n// If the SIDXs have maps, the two maps should match,\n// both `a` and `b` missing SIDXs is considered matching.\n// If `a` or `b` but not both have a map, they aren't matching.\n\n\nvar equivalentSidx = function equivalentSidx(a, b) {\n var neitherMap = Boolean(!a.map && !b.map);\n var equivalentMap = neitherMap || Boolean(a.map && b.map && a.map.byterange.offset === b.map.byterange.offset && a.map.byterange.length === b.map.byterange.length);\n return equivalentMap && a.uri === b.uri && a.byterange.offset === b.byterange.offset && a.byterange.length === b.byterange.length;\n}; // exported for testing\n\n\nvar video_es_compareSidxEntry = function compareSidxEntry(playlists, oldSidxMapping) {\n var newSidxMapping = {};\n\n for (var id in playlists) {\n var playlist = playlists[id];\n var currentSidxInfo = playlist.sidx;\n\n if (currentSidxInfo) {\n var key = generateSidxKey(currentSidxInfo);\n\n if (!oldSidxMapping[key]) {\n break;\n }\n\n var savedSidxInfo = oldSidxMapping[key].sidxInfo;\n\n if (equivalentSidx(savedSidxInfo, currentSidxInfo)) {\n newSidxMapping[key] = oldSidxMapping[key];\n }\n }\n }\n\n return newSidxMapping;\n};\n/**\n * A function that filters out changed items as they need to be requested separately.\n *\n * The method is exported for testing\n *\n * @param {Object} master the parsed mpd XML returned via mpd-parser\n * @param {Object} oldSidxMapping the SIDX to compare against\n */\n\n\nvar filterChangedSidxMappings = function filterChangedSidxMappings(master, oldSidxMapping) {\n var videoSidx = video_es_compareSidxEntry(master.playlists, oldSidxMapping);\n var mediaGroupSidx = videoSidx;\n forEachMediaGroup(master, function (properties, mediaType, groupKey, labelKey) {\n if (properties.playlists && properties.playlists.length) {\n var playlists = properties.playlists;\n mediaGroupSidx = mergeOptions(mediaGroupSidx, video_es_compareSidxEntry(playlists, oldSidxMapping));\n }\n });\n return mediaGroupSidx;\n};\n\nvar video_es_DashPlaylistLoader = /*#__PURE__*/function (_EventTarget) {\n inheritsLoose_default()(DashPlaylistLoader, _EventTarget); // DashPlaylistLoader must accept either a src url or a playlist because subsequent\n // playlist loader setups from media groups will expect to be able to pass a playlist\n // (since there aren't external URLs to media playlists with DASH)\n\n\n function DashPlaylistLoader(srcUrlOrPlaylist, vhs, options, masterPlaylistLoader) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _EventTarget.call(this) || this;\n _this.masterPlaylistLoader_ = masterPlaylistLoader || assertThisInitialized_default()(_this);\n\n if (!masterPlaylistLoader) {\n _this.isMaster_ = true;\n }\n\n var _options = options,\n _options$withCredenti = _options.withCredentials,\n withCredentials = _options$withCredenti === void 0 ? false : _options$withCredenti,\n _options$handleManife = _options.handleManifestRedirects,\n handleManifestRedirects = _options$handleManife === void 0 ? false : _options$handleManife;\n _this.vhs_ = vhs;\n _this.withCredentials = withCredentials;\n _this.handleManifestRedirects = handleManifestRedirects;\n\n if (!srcUrlOrPlaylist) {\n throw new Error('A non-empty playlist URL or object is required');\n } // event naming?\n\n\n _this.on('minimumUpdatePeriod', function () {\n _this.refreshXml_();\n }); // live playlist staleness timeout\n\n\n _this.on('mediaupdatetimeout', function () {\n _this.refreshMedia_(_this.media().id);\n });\n\n _this.state = 'HAVE_NOTHING';\n _this.loadedPlaylists_ = {};\n _this.logger_ = logger('DashPlaylistLoader'); // initialize the loader state\n // The masterPlaylistLoader will be created with a string\n\n if (_this.isMaster_) {\n _this.masterPlaylistLoader_.srcUrl = srcUrlOrPlaylist; // TODO: reset sidxMapping between period changes\n // once multi-period is refactored\n\n _this.masterPlaylistLoader_.sidxMapping_ = {};\n } else {\n _this.childPlaylist_ = srcUrlOrPlaylist;\n }\n\n return _this;\n }\n\n var _proto = DashPlaylistLoader.prototype;\n\n _proto.requestErrored_ = function requestErrored_(err, request, startingState) {\n // disposed\n if (!this.request) {\n return true;\n } // pending request is cleared\n\n\n this.request = null;\n\n if (err) {\n // use the provided error object or create one\n // based on the request/response\n this.error = typeof err === 'object' && !(err instanceof Error) ? err : {\n status: request.status,\n message: 'DASH request error at URL: ' + request.uri,\n response: request.response,\n // MEDIA_ERR_NETWORK\n code: 2\n };\n\n if (startingState) {\n this.state = startingState;\n }\n\n this.trigger('error');\n return true;\n }\n }\n /**\n * Verify that the container of the sidx segment can be parsed\n * and if it can, get and parse that segment.\n */\n ;\n\n _proto.addSidxSegments_ = function addSidxSegments_(playlist, startingState, cb) {\n var _this2 = this;\n\n var sidxKey = playlist.sidx && generateSidxKey(playlist.sidx); // playlist lacks sidx or sidx segments were added to this playlist already.\n\n if (!playlist.sidx || !sidxKey || this.masterPlaylistLoader_.sidxMapping_[sidxKey]) {\n // keep this function async\n this.mediaRequest_ = window_default.a.setTimeout(function () {\n return cb(false);\n }, 0);\n return;\n } // resolve the segment URL relative to the playlist\n\n\n var uri = resolveManifestRedirect(this.handleManifestRedirects, playlist.sidx.resolvedUri);\n\n var fin = function fin(err, request) {\n if (_this2.requestErrored_(err, request, startingState)) {\n return;\n }\n\n var sidxMapping = _this2.masterPlaylistLoader_.sidxMapping_;\n var sidx;\n\n try {\n sidx = parse_sidx_default()(toUint8(request.response).subarray(8));\n } catch (e) {\n // sidx parsing failed.\n _this2.requestErrored_(e, request, startingState);\n\n return;\n }\n\n sidxMapping[sidxKey] = {\n sidxInfo: playlist.sidx,\n sidx: sidx\n };\n addSidxSegmentsToPlaylist(playlist, sidx, playlist.sidx.resolvedUri);\n return cb(true);\n };\n\n this.request = video_es_containerRequest(uri, this.vhs_.xhr, function (err, request, container, bytes) {\n if (err) {\n return fin(err, request);\n }\n\n if (!container || container !== 'mp4') {\n return fin({\n status: request.status,\n message: \"Unsupported \" + (container || 'unknown') + \" container type for sidx segment at URL: \" + uri,\n // response is just bytes in this case\n // but we really don't want to return that.\n response: '',\n playlist: playlist,\n internal: true,\n blacklistDuration: Infinity,\n // MEDIA_ERR_NETWORK\n code: 2\n }, request);\n } // if we already downloaded the sidx bytes in the container request, use them\n\n\n var _playlist$sidx$bytera = playlist.sidx.byterange,\n offset = _playlist$sidx$bytera.offset,\n length = _playlist$sidx$bytera.length;\n\n if (bytes.length >= length + offset) {\n return fin(err, {\n response: bytes.subarray(offset, offset + length),\n status: request.status,\n uri: request.uri\n });\n } // otherwise request sidx bytes\n\n\n _this2.request = _this2.vhs_.xhr({\n uri: uri,\n responseType: 'arraybuffer',\n headers: segmentXhrHeaders({\n byterange: playlist.sidx.byterange\n })\n }, fin);\n });\n };\n\n _proto.dispose = function dispose() {\n this.trigger('dispose');\n this.stopRequest();\n this.loadedPlaylists_ = {};\n window_default.a.clearTimeout(this.minimumUpdatePeriodTimeout_);\n window_default.a.clearTimeout(this.mediaRequest_);\n window_default.a.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n this.mediaRequest_ = null;\n this.minimumUpdatePeriodTimeout_ = null;\n\n if (this.masterPlaylistLoader_.createMupOnMedia_) {\n this.off('loadedmetadata', this.masterPlaylistLoader_.createMupOnMedia_);\n this.masterPlaylistLoader_.createMupOnMedia_ = null;\n }\n\n this.off();\n };\n\n _proto.hasPendingRequest = function hasPendingRequest() {\n return this.request || this.mediaRequest_;\n };\n\n _proto.stopRequest = function stopRequest() {\n if (this.request) {\n var oldRequest = this.request;\n this.request = null;\n oldRequest.onreadystatechange = null;\n oldRequest.abort();\n }\n };\n\n _proto.media = function media(playlist) {\n var _this3 = this; // getter\n\n\n if (!playlist) {\n return this.media_;\n } // setter\n\n\n if (this.state === 'HAVE_NOTHING') {\n throw new Error('Cannot switch media playlist from ' + this.state);\n }\n\n var startingState = this.state; // find the playlist object if the target playlist has been specified by URI\n\n if (typeof playlist === 'string') {\n if (!this.masterPlaylistLoader_.master.playlists[playlist]) {\n throw new Error('Unknown playlist URI: ' + playlist);\n }\n\n playlist = this.masterPlaylistLoader_.master.playlists[playlist];\n }\n\n var mediaChange = !this.media_ || playlist.id !== this.media_.id; // switch to previously loaded playlists immediately\n\n if (mediaChange && this.loadedPlaylists_[playlist.id] && this.loadedPlaylists_[playlist.id].endList) {\n this.state = 'HAVE_METADATA';\n this.media_ = playlist; // trigger media change if the active media has been updated\n\n if (mediaChange) {\n this.trigger('mediachanging');\n this.trigger('mediachange');\n }\n\n return;\n } // switching to the active playlist is a no-op\n\n\n if (!mediaChange) {\n return;\n } // switching from an already loaded playlist\n\n\n if (this.media_) {\n this.trigger('mediachanging');\n }\n\n this.addSidxSegments_(playlist, startingState, function (sidxChanged) {\n // everything is ready just continue to haveMetadata\n _this3.haveMetadata({\n startingState: startingState,\n playlist: playlist\n });\n });\n };\n\n _proto.haveMetadata = function haveMetadata(_ref2) {\n var startingState = _ref2.startingState,\n playlist = _ref2.playlist;\n this.state = 'HAVE_METADATA';\n this.loadedPlaylists_[playlist.id] = playlist;\n this.mediaRequest_ = null; // This will trigger loadedplaylist\n\n this.refreshMedia_(playlist.id); // fire loadedmetadata the first time a media playlist is loaded\n // to resolve setup of media groups\n\n if (startingState === 'HAVE_MASTER') {\n this.trigger('loadedmetadata');\n } else {\n // trigger media change if the active media has been updated\n this.trigger('mediachange');\n }\n };\n\n _proto.pause = function pause() {\n if (this.masterPlaylistLoader_.createMupOnMedia_) {\n this.off('loadedmetadata', this.masterPlaylistLoader_.createMupOnMedia_);\n this.masterPlaylistLoader_.createMupOnMedia_ = null;\n }\n\n this.stopRequest();\n window_default.a.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n\n if (this.isMaster_) {\n window_default.a.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_);\n this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_ = null;\n }\n\n if (this.state === 'HAVE_NOTHING') {\n // If we pause the loader before any data has been retrieved, its as if we never\n // started, so reset to an unstarted state.\n this.started = false;\n }\n };\n\n _proto.load = function load(isFinalRendition) {\n var _this4 = this;\n\n window_default.a.clearTimeout(this.mediaUpdateTimeout);\n this.mediaUpdateTimeout = null;\n var media = this.media();\n\n if (isFinalRendition) {\n var delay = media ? media.targetDuration / 2 * 1000 : 5 * 1000;\n this.mediaUpdateTimeout = window_default.a.setTimeout(function () {\n return _this4.load();\n }, delay);\n return;\n } // because the playlists are internal to the manifest, load should either load the\n // main manifest, or do nothing but trigger an event\n\n\n if (!this.started) {\n this.start();\n return;\n }\n\n if (media && !media.endList) {\n // Check to see if this is the master loader and the MUP was cleared (this happens\n // when the loader was paused). `media` should be set at this point since one is always\n // set during `start()`.\n if (this.isMaster_ && !this.minimumUpdatePeriodTimeout_) {\n // Trigger minimumUpdatePeriod to refresh the master manifest\n this.trigger('minimumUpdatePeriod'); // Since there was no prior minimumUpdatePeriodTimeout it should be recreated\n\n this.updateMinimumUpdatePeriodTimeout_();\n }\n\n this.trigger('mediaupdatetimeout');\n } else {\n this.trigger('loadedplaylist');\n }\n };\n\n _proto.start = function start() {\n var _this5 = this;\n\n this.started = true; // We don't need to request the master manifest again\n // Call this asynchronously to match the xhr request behavior below\n\n if (!this.isMaster_) {\n this.mediaRequest_ = window_default.a.setTimeout(function () {\n return _this5.haveMaster_();\n }, 0);\n return;\n }\n\n this.requestMaster_(function (req, masterChanged) {\n _this5.haveMaster_();\n\n if (!_this5.hasPendingRequest() && !_this5.media_) {\n _this5.media(_this5.masterPlaylistLoader_.master.playlists[0]);\n }\n });\n };\n\n _proto.requestMaster_ = function requestMaster_(cb) {\n var _this6 = this;\n\n this.request = this.vhs_.xhr({\n uri: this.masterPlaylistLoader_.srcUrl,\n withCredentials: this.withCredentials\n }, function (error, req) {\n if (_this6.requestErrored_(error, req)) {\n if (_this6.state === 'HAVE_NOTHING') {\n _this6.started = false;\n }\n\n return;\n }\n\n var masterChanged = req.responseText !== _this6.masterPlaylistLoader_.masterXml_;\n _this6.masterPlaylistLoader_.masterXml_ = req.responseText;\n\n if (req.responseHeaders && req.responseHeaders.date) {\n _this6.masterLoaded_ = Date.parse(req.responseHeaders.date);\n } else {\n _this6.masterLoaded_ = Date.now();\n }\n\n _this6.masterPlaylistLoader_.srcUrl = resolveManifestRedirect(_this6.handleManifestRedirects, _this6.masterPlaylistLoader_.srcUrl, req);\n\n if (masterChanged) {\n _this6.handleMaster_();\n\n _this6.syncClientServerClock_(function () {\n return cb(req, masterChanged);\n });\n\n return;\n }\n\n return cb(req, masterChanged);\n });\n }\n /**\n * Parses the master xml for UTCTiming node to sync the client clock to the server\n * clock. If the UTCTiming node requires a HEAD or GET request, that request is made.\n *\n * @param {Function} done\n * Function to call when clock sync has completed\n */\n ;\n\n _proto.syncClientServerClock_ = function syncClientServerClock_(done) {\n var _this7 = this;\n\n var utcTiming = parseUTCTiming(this.masterPlaylistLoader_.masterXml_); // No UTCTiming element found in the mpd. Use Date header from mpd request as the\n // server clock\n\n if (utcTiming === null) {\n this.masterPlaylistLoader_.clientOffset_ = this.masterLoaded_ - Date.now();\n return done();\n }\n\n if (utcTiming.method === 'DIRECT') {\n this.masterPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now();\n return done();\n }\n\n this.request = this.vhs_.xhr({\n uri: video_es_resolveUrl(this.masterPlaylistLoader_.srcUrl, utcTiming.value),\n method: utcTiming.method,\n withCredentials: this.withCredentials\n }, function (error, req) {\n // disposed\n if (!_this7.request) {\n return;\n }\n\n if (error) {\n // sync request failed, fall back to using date header from mpd\n // TODO: log warning\n _this7.masterPlaylistLoader_.clientOffset_ = _this7.masterLoaded_ - Date.now();\n return done();\n }\n\n var serverTime;\n\n if (utcTiming.method === 'HEAD') {\n if (!req.responseHeaders || !req.responseHeaders.date) {\n // expected date header not preset, fall back to using date header from mpd\n // TODO: log warning\n serverTime = _this7.masterLoaded_;\n } else {\n serverTime = Date.parse(req.responseHeaders.date);\n }\n } else {\n serverTime = Date.parse(req.responseText);\n }\n\n _this7.masterPlaylistLoader_.clientOffset_ = serverTime - Date.now();\n done();\n });\n };\n\n _proto.haveMaster_ = function haveMaster_() {\n this.state = 'HAVE_MASTER';\n\n if (this.isMaster_) {\n // We have the master playlist at this point, so\n // trigger this to allow MasterPlaylistController\n // to make an initial playlist selection\n this.trigger('loadedplaylist');\n } else if (!this.media_) {\n // no media playlist was specifically selected so select\n // the one the child playlist loader was created with\n this.media(this.childPlaylist_);\n }\n };\n\n _proto.handleMaster_ = function handleMaster_() {\n // clear media request\n this.mediaRequest_ = null;\n var newMaster = video_es_parseMasterXml({\n masterXml: this.masterPlaylistLoader_.masterXml_,\n srcUrl: this.masterPlaylistLoader_.srcUrl,\n clientOffset: this.masterPlaylistLoader_.clientOffset_,\n sidxMapping: this.masterPlaylistLoader_.sidxMapping_\n });\n var oldMaster = this.masterPlaylistLoader_.master; // if we have an old master to compare the new master against\n\n if (oldMaster) {\n newMaster = video_es_updateMaster(oldMaster, newMaster, this.masterPlaylistLoader_.sidxMapping_);\n } // only update master if we have a new master\n\n\n this.masterPlaylistLoader_.master = newMaster ? newMaster : oldMaster;\n var location = this.masterPlaylistLoader_.master.locations && this.masterPlaylistLoader_.master.locations[0];\n\n if (location && location !== this.masterPlaylistLoader_.srcUrl) {\n this.masterPlaylistLoader_.srcUrl = location;\n }\n\n if (!oldMaster || newMaster && newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) {\n this.updateMinimumUpdatePeriodTimeout_();\n }\n\n return Boolean(newMaster);\n };\n\n _proto.updateMinimumUpdatePeriodTimeout_ = function updateMinimumUpdatePeriodTimeout_() {\n var mpl = this.masterPlaylistLoader_; // cancel any pending creation of mup on media\n // a new one will be added if needed.\n\n if (mpl.createMupOnMedia_) {\n mpl.off('loadedmetadata', mpl.createMupOnMedia_);\n mpl.createMupOnMedia_ = null;\n } // clear any pending timeouts\n\n\n if (mpl.minimumUpdatePeriodTimeout_) {\n window_default.a.clearTimeout(mpl.minimumUpdatePeriodTimeout_);\n mpl.minimumUpdatePeriodTimeout_ = null;\n }\n\n var mup = mpl.master && mpl.master.minimumUpdatePeriod; // If the minimumUpdatePeriod has a value of 0, that indicates that the current\n // MPD has no future validity, so a new one will need to be acquired when new\n // media segments are to be made available. Thus, we use the target duration\n // in this case\n\n if (mup === 0) {\n if (mpl.media()) {\n mup = mpl.media().targetDuration * 1000;\n } else {\n mpl.createMupOnMedia_ = mpl.updateMinimumUpdatePeriodTimeout_;\n mpl.one('loadedmetadata', mpl.createMupOnMedia_);\n }\n } // if minimumUpdatePeriod is invalid or <= zero, which\n // can happen when a live video becomes VOD. skip timeout\n // creation.\n\n\n if (typeof mup !== 'number' || mup <= 0) {\n if (mup < 0) {\n this.logger_(\"found invalid minimumUpdatePeriod of \" + mup + \", not setting a timeout\");\n }\n\n return;\n }\n\n this.createMUPTimeout_(mup);\n };\n\n _proto.createMUPTimeout_ = function createMUPTimeout_(mup) {\n var mpl = this.masterPlaylistLoader_;\n mpl.minimumUpdatePeriodTimeout_ = window_default.a.setTimeout(function () {\n mpl.minimumUpdatePeriodTimeout_ = null;\n mpl.trigger('minimumUpdatePeriod');\n mpl.createMUPTimeout_(mup);\n }, mup);\n }\n /**\n * Sends request to refresh the master xml and updates the parsed master manifest\n */\n ;\n\n _proto.refreshXml_ = function refreshXml_() {\n var _this8 = this;\n\n this.requestMaster_(function (req, masterChanged) {\n if (!masterChanged) {\n return;\n }\n\n if (_this8.media_) {\n _this8.media_ = _this8.masterPlaylistLoader_.master.playlists[_this8.media_.id];\n } // This will filter out updated sidx info from the mapping\n\n\n _this8.masterPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings(_this8.masterPlaylistLoader_.master, _this8.masterPlaylistLoader_.sidxMapping_);\n\n _this8.addSidxSegments_(_this8.media(), _this8.state, function (sidxChanged) {\n // TODO: do we need to reload the current playlist?\n _this8.refreshMedia_(_this8.media().id);\n });\n });\n }\n /**\n * Refreshes the media playlist by re-parsing the master xml and updating playlist\n * references. If this is an alternate loader, the updated parsed manifest is retrieved\n * from the master loader.\n */\n ;\n\n _proto.refreshMedia_ = function refreshMedia_(mediaID) {\n var _this9 = this;\n\n if (!mediaID) {\n throw new Error('refreshMedia_ must take a media id');\n } // for master we have to reparse the master xml\n // to re-create segments based on current timing values\n // which may change media. We only skip updating master\n // if this is the first time this.media_ is being set.\n // as master was just parsed in that case.\n\n\n if (this.media_ && this.isMaster_) {\n this.handleMaster_();\n }\n\n var playlists = this.masterPlaylistLoader_.master.playlists;\n var mediaChanged = !this.media_ || this.media_ !== playlists[mediaID];\n\n if (mediaChanged) {\n this.media_ = playlists[mediaID];\n } else {\n this.trigger('playlistunchanged');\n }\n\n if (!this.mediaUpdateTimeout) {\n var createMediaUpdateTimeout = function createMediaUpdateTimeout() {\n if (_this9.media().endList) {\n return;\n }\n\n _this9.mediaUpdateTimeout = window_default.a.setTimeout(function () {\n _this9.trigger('mediaupdatetimeout');\n\n createMediaUpdateTimeout();\n }, refreshDelay(_this9.media(), Boolean(mediaChanged)));\n };\n\n createMediaUpdateTimeout();\n }\n\n this.trigger('loadedplaylist');\n };\n\n return DashPlaylistLoader;\n}(EventTarget);\n\nvar Config = {\n GOAL_BUFFER_LENGTH: 30,\n MAX_GOAL_BUFFER_LENGTH: 60,\n BACK_BUFFER_LENGTH: 30,\n GOAL_BUFFER_LENGTH_RATE: 1,\n // 0.5 MB/s\n INITIAL_BANDWIDTH: 4194304,\n // A fudge factor to apply to advertised playlist bitrates to account for\n // temporary flucations in client bandwidth\n BANDWIDTH_VARIANCE: 1.2,\n // How much of the buffer must be filled before we consider upswitching\n BUFFER_LOW_WATER_LINE: 0,\n MAX_BUFFER_LOW_WATER_LINE: 30,\n // TODO: Remove this when experimentalBufferBasedABR is removed\n EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,\n BUFFER_LOW_WATER_LINE_RATE: 1,\n // If the buffer is greater than the high water line, we won't switch down\n BUFFER_HIGH_WATER_LINE: 30\n};\n\nvar stringToArrayBuffer = function stringToArrayBuffer(string) {\n var view = new Uint8Array(new ArrayBuffer(string.length));\n\n for (var i = 0; i < string.length; i++) {\n view[i] = string.charCodeAt(i);\n }\n\n return view.buffer;\n};\n/* global Blob, BlobBuilder, Worker */\n// unify worker interface\n\n\nvar browserWorkerPolyFill = function browserWorkerPolyFill(workerObj) {\n // node only supports on/off\n workerObj.on = workerObj.addEventListener;\n workerObj.off = workerObj.removeEventListener;\n return workerObj;\n};\n\nvar createObjectURL = function createObjectURL(str) {\n try {\n return URL.createObjectURL(new Blob([str], {\n type: 'application/javascript'\n }));\n } catch (e) {\n var blob = new BlobBuilder();\n blob.append(str);\n return URL.createObjectURL(blob.getBlob());\n }\n};\n\nvar factory = function factory(code) {\n return function () {\n var objectUrl = createObjectURL(code);\n var worker = browserWorkerPolyFill(new Worker(objectUrl));\n worker.objURL = objectUrl;\n var terminate = worker.terminate;\n worker.on = worker.addEventListener;\n worker.off = worker.removeEventListener;\n\n worker.terminate = function () {\n URL.revokeObjectURL(objectUrl);\n return terminate.call(this);\n };\n\n return worker;\n };\n};\n\nvar transform = function transform(code) {\n return \"var browserWorkerPolyFill = \" + browserWorkerPolyFill.toString() + \";\\n\" + 'browserWorkerPolyFill(self);\\n' + code;\n};\n\nvar getWorkerString = function getWorkerString(fn) {\n return fn.toString().replace(/^function.+?{/, '').slice(0, -1);\n};\n/* rollup-plugin-worker-factory start for worker!/Users/bcasey/Projects/videojs-http-streaming/src/transmuxer-worker.js */\n\n\nvar workerCode$1 = transform(getWorkerString(function () {\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * A lightweight readable stream implemention that handles event dispatching.\n * Objects that inherit from streams should call init in their constructors.\n */\n var Stream = function Stream() {\n this.init = function () {\n var listeners = {};\n /**\n * Add a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} the callback to be invoked when an event of\n * the specified type occurs\n */\n\n this.on = function (type, listener) {\n if (!listeners[type]) {\n listeners[type] = [];\n }\n\n listeners[type] = listeners[type].concat(listener);\n };\n /**\n * Remove a listener for a specified event type.\n * @param type {string} the event name\n * @param listener {function} a function previously registered for this\n * type of event through `on`\n */\n\n\n this.off = function (type, listener) {\n var index;\n\n if (!listeners[type]) {\n return false;\n }\n\n index = listeners[type].indexOf(listener);\n listeners[type] = listeners[type].slice();\n listeners[type].splice(index, 1);\n return index > -1;\n };\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n * @param type {string} the event name\n */\n\n\n this.trigger = function (type) {\n var callbacks, i, length, args;\n callbacks = listeners[type];\n\n if (!callbacks) {\n return;\n } // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n\n\n if (arguments.length === 2) {\n length = callbacks.length;\n\n for (i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n args = [];\n i = arguments.length;\n\n for (i = 1; i < arguments.length; ++i) {\n args.push(arguments[i]);\n }\n\n length = callbacks.length;\n\n for (i = 0; i < length; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n };\n /**\n * Destroys the stream and cleans up.\n */\n\n\n this.dispose = function () {\n listeners = {};\n };\n };\n };\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n * @param destination {stream} the stream that will receive all `data` events\n * @param autoFlush {boolean} if false, we will not call `flush` on the destination\n * when the current stream emits a 'done' event\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n\n\n Stream.prototype.pipe = function (destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n this.on('done', function (flushSource) {\n destination.flush(flushSource);\n });\n this.on('partialdone', function (flushSource) {\n destination.partialFlush(flushSource);\n });\n this.on('endedtimeline', function (flushSource) {\n destination.endTimeline(flushSource);\n });\n this.on('reset', function (flushSource) {\n destination.reset(flushSource);\n });\n return destination;\n }; // Default stream functions that are expected to be overridden to perform\n // actual work. These are provided by the prototype as a sort of no-op\n // implementation so that we don't have to check for their existence in the\n // `pipe` function above.\n\n\n Stream.prototype.push = function (data) {\n this.trigger('data', data);\n };\n\n Stream.prototype.flush = function (flushSource) {\n this.trigger('done', flushSource);\n };\n\n Stream.prototype.partialFlush = function (flushSource) {\n this.trigger('partialdone', flushSource);\n };\n\n Stream.prototype.endTimeline = function (flushSource) {\n this.trigger('endedtimeline', flushSource);\n };\n\n Stream.prototype.reset = function (flushSource) {\n this.trigger('reset', flushSource);\n };\n\n var stream = Stream;\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Functions that generate fragmented MP4s suitable for use with Media\n * Source Extensions.\n */\n\n var UINT32_MAX = Math.pow(2, 32) - 1;\n var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS; // pre-calculate constants\n\n (function () {\n var i;\n types = {\n avc1: [],\n // codingname\n avcC: [],\n btrt: [],\n dinf: [],\n dref: [],\n esds: [],\n ftyp: [],\n hdlr: [],\n mdat: [],\n mdhd: [],\n mdia: [],\n mfhd: [],\n minf: [],\n moof: [],\n moov: [],\n mp4a: [],\n // codingname\n mvex: [],\n mvhd: [],\n pasp: [],\n sdtp: [],\n smhd: [],\n stbl: [],\n stco: [],\n stsc: [],\n stsd: [],\n stsz: [],\n stts: [],\n styp: [],\n tfdt: [],\n tfhd: [],\n traf: [],\n trak: [],\n trun: [],\n trex: [],\n tkhd: [],\n vmhd: []\n }; // In environments where Uint8Array is undefined (e.g., IE8), skip set up so that we\n // don't throw an error\n\n if (typeof Uint8Array === 'undefined') {\n return;\n }\n\n for (i in types) {\n if (types.hasOwnProperty(i)) {\n types[i] = [i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3)];\n }\n }\n\n MAJOR_BRAND = new Uint8Array(['i'.charCodeAt(0), 's'.charCodeAt(0), 'o'.charCodeAt(0), 'm'.charCodeAt(0)]);\n AVC1_BRAND = new Uint8Array(['a'.charCodeAt(0), 'v'.charCodeAt(0), 'c'.charCodeAt(0), '1'.charCodeAt(0)]);\n MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);\n VIDEO_HDLR = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x56, 0x69, 0x64, 0x65, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'\n ]);\n AUDIO_HDLR = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'\n ]);\n HDLR_TYPES = {\n video: VIDEO_HDLR,\n audio: AUDIO_HDLR\n };\n DREF = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // entry_count\n 0x00, 0x00, 0x00, 0x0c, // entry_size\n 0x75, 0x72, 0x6c, 0x20, // 'url' type\n 0x00, // version 0\n 0x00, 0x00, 0x01 // entry_flags\n ]);\n SMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, // balance, 0 means centered\n 0x00, 0x00 // reserved\n ]);\n STCO = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00 // entry_count\n ]);\n STSC = STCO;\n STSZ = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x00, // sample_size\n 0x00, 0x00, 0x00, 0x00 // sample_count\n ]);\n STTS = STCO;\n VMHD = new Uint8Array([0x00, // version\n 0x00, 0x00, 0x01, // flags\n 0x00, 0x00, // graphicsmode\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // opcolor\n ]);\n })();\n\n box = function box(type) {\n var payload = [],\n size = 0,\n i,\n result,\n view;\n\n for (i = 1; i < arguments.length; i++) {\n payload.push(arguments[i]);\n }\n\n i = payload.length; // calculate the total size we need to allocate\n\n while (i--) {\n size += payload[i].byteLength;\n }\n\n result = new Uint8Array(size + 8);\n view = new DataView(result.buffer, result.byteOffset, result.byteLength);\n view.setUint32(0, result.byteLength);\n result.set(type, 4); // copy the payload into the result\n\n for (i = 0, size = 8; i < payload.length; i++) {\n result.set(payload[i], size);\n size += payload[i].byteLength;\n }\n\n return result;\n };\n\n dinf = function dinf() {\n return box(types.dinf, box(types.dref, DREF));\n };\n\n esds = function esds(track) {\n return box(types.esds, new Uint8Array([0x00, // version\n 0x00, 0x00, 0x00, // flags\n // ES_Descriptor\n 0x03, // tag, ES_DescrTag\n 0x19, // length\n 0x00, 0x00, // ES_ID\n 0x00, // streamDependenceFlag, URL_flag, reserved, streamPriority\n // DecoderConfigDescriptor\n 0x04, // tag, DecoderConfigDescrTag\n 0x11, // length\n 0x40, // object type\n 0x15, // streamType\n 0x00, 0x06, 0x00, // bufferSizeDB\n 0x00, 0x00, 0xda, 0xc0, // maxBitrate\n 0x00, 0x00, 0xda, 0xc0, // avgBitrate\n // DecoderSpecificInfo\n 0x05, // tag, DecoderSpecificInfoTag\n 0x02, // length\n // ISO/IEC 14496-3, AudioSpecificConfig\n // for samplingFrequencyIndex see ISO/IEC 13818-7:2006, 8.1.3.2.2, Table 35\n track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1, track.samplingfrequencyindex << 7 | track.channelcount << 3, 0x06, 0x01, 0x02 // GASpecificConfig\n ]));\n };\n\n ftyp = function ftyp() {\n return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);\n };\n\n hdlr = function hdlr(type) {\n return box(types.hdlr, HDLR_TYPES[type]);\n };\n\n mdat = function mdat(data) {\n return box(types.mdat, data);\n };\n\n mdhd = function mdhd(track) {\n var result = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x02, // creation_time\n 0x00, 0x00, 0x00, 0x03, // modification_time\n 0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n track.duration >>> 24 & 0xFF, track.duration >>> 16 & 0xFF, track.duration >>> 8 & 0xFF, track.duration & 0xFF, // duration\n 0x55, 0xc4, // 'und' language (undetermined)\n 0x00, 0x00]); // Use the sample rate from the track metadata, when it is\n // defined. The sample rate can be parsed out of an ADTS header, for\n // instance.\n\n if (track.samplerate) {\n result[12] = track.samplerate >>> 24 & 0xFF;\n result[13] = track.samplerate >>> 16 & 0xFF;\n result[14] = track.samplerate >>> 8 & 0xFF;\n result[15] = track.samplerate & 0xFF;\n }\n\n return box(types.mdhd, result);\n };\n\n mdia = function mdia(track) {\n return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));\n };\n\n mfhd = function mfhd(sequenceNumber) {\n return box(types.mfhd, new Uint8Array([0x00, 0x00, 0x00, 0x00, // flags\n (sequenceNumber & 0xFF000000) >> 24, (sequenceNumber & 0xFF0000) >> 16, (sequenceNumber & 0xFF00) >> 8, sequenceNumber & 0xFF // sequence_number\n ]));\n };\n\n minf = function minf(track) {\n return box(types.minf, track.type === 'video' ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));\n };\n\n moof = function moof(sequenceNumber, tracks) {\n var trackFragments = [],\n i = tracks.length; // build traf boxes for each track fragment\n\n while (i--) {\n trackFragments[i] = traf(tracks[i]);\n }\n\n return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));\n };\n /**\n * Returns a movie box.\n * @param tracks {array} the tracks associated with this movie\n * @see ISO/IEC 14496-12:2012(E), section 8.2.1\n */\n\n\n moov = function moov(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = trak(tracks[i]);\n }\n\n return box.apply(null, [types.moov, mvhd(0xffffffff)].concat(boxes).concat(mvex(tracks)));\n };\n\n mvex = function mvex(tracks) {\n var i = tracks.length,\n boxes = [];\n\n while (i--) {\n boxes[i] = trex(tracks[i]);\n }\n\n return box.apply(null, [types.mvex].concat(boxes));\n };\n\n mvhd = function mvhd(duration) {\n var bytes = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01, // creation_time\n 0x00, 0x00, 0x00, 0x02, // modification_time\n 0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 \"ticks\" per second\n (duration & 0xFF000000) >> 24, (duration & 0xFF0000) >> 16, (duration & 0xFF00) >> 8, duration & 0xFF, // duration\n 0x00, 0x01, 0x00, 0x00, // 1.0 rate\n 0x01, 0x00, // 1.0 volume\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n 0xff, 0xff, 0xff, 0xff // next_track_ID\n ]);\n return box(types.mvhd, bytes);\n };\n\n sdtp = function sdtp(track) {\n var samples = track.samples || [],\n bytes = new Uint8Array(4 + samples.length),\n flags,\n i; // leave the full box header (4 bytes) all zero\n // write the sample table\n\n for (i = 0; i < samples.length; i++) {\n flags = samples[i].flags;\n bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;\n }\n\n return box(types.sdtp, bytes);\n };\n\n stbl = function stbl(track) {\n return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));\n };\n\n (function () {\n var videoSample, audioSample;\n\n stsd = function stsd(track) {\n return box(types.stsd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n 0x00, 0x00, 0x00, 0x01]), track.type === 'video' ? videoSample(track) : audioSample(track));\n };\n\n videoSample = function videoSample(track) {\n var sps = track.sps || [],\n pps = track.pps || [],\n sequenceParameterSets = [],\n pictureParameterSets = [],\n i,\n avc1Box; // assemble the SPSs\n\n for (i = 0; i < sps.length; i++) {\n sequenceParameterSets.push((sps[i].byteLength & 0xFF00) >>> 8);\n sequenceParameterSets.push(sps[i].byteLength & 0xFF); // sequenceParameterSetLength\n\n sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); // SPS\n } // assemble the PPSs\n\n\n for (i = 0; i < pps.length; i++) {\n pictureParameterSets.push((pps[i].byteLength & 0xFF00) >>> 8);\n pictureParameterSets.push(pps[i].byteLength & 0xFF);\n pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));\n }\n\n avc1Box = [types.avc1, new Uint8Array([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // pre_defined\n (track.width & 0xff00) >> 8, track.width & 0xff, // width\n (track.height & 0xff00) >> 8, track.height & 0xff, // height\n 0x00, 0x48, 0x00, 0x00, // horizresolution\n 0x00, 0x48, 0x00, 0x00, // vertresolution\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // frame_count\n 0x13, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x6a, 0x73, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x2d, 0x68, 0x6c, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // compressorname\n 0x00, 0x18, // depth = 24\n 0x11, 0x11 // pre_defined = -1\n ]), box(types.avcC, new Uint8Array([0x01, // configurationVersion\n track.profileIdc, // AVCProfileIndication\n track.profileCompatibility, // profile_compatibility\n track.levelIdc, // AVCLevelIndication\n 0xff // lengthSizeMinusOne, hard-coded to 4 bytes\n ].concat([sps.length], // numOfSequenceParameterSets\n sequenceParameterSets, // \"SPS\"\n [pps.length], // numOfPictureParameterSets\n pictureParameterSets // \"PPS\"\n ))), box(types.btrt, new Uint8Array([0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB\n 0x00, 0x2d, 0xc6, 0xc0, // maxBitrate\n 0x00, 0x2d, 0xc6, 0xc0 // avgBitrate\n ]))];\n\n if (track.sarRatio) {\n var hSpacing = track.sarRatio[0],\n vSpacing = track.sarRatio[1];\n avc1Box.push(box(types.pasp, new Uint8Array([(hSpacing & 0xFF000000) >> 24, (hSpacing & 0xFF0000) >> 16, (hSpacing & 0xFF00) >> 8, hSpacing & 0xFF, (vSpacing & 0xFF000000) >> 24, (vSpacing & 0xFF0000) >> 16, (vSpacing & 0xFF00) >> 8, vSpacing & 0xFF])));\n }\n\n return box.apply(null, avc1Box);\n };\n\n audioSample = function audioSample(track) {\n return box(types.mp4a, new Uint8Array([// SampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x01, // data_reference_index\n // AudioSampleEntry, ISO/IEC 14496-12\n 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.channelcount & 0xff00) >> 8, track.channelcount & 0xff, // channelcount\n (track.samplesize & 0xff00) >> 8, track.samplesize & 0xff, // samplesize\n 0x00, 0x00, // pre_defined\n 0x00, 0x00, // reserved\n (track.samplerate & 0xff00) >> 8, track.samplerate & 0xff, 0x00, 0x00 // samplerate, 16.16\n // MP4AudioSampleEntry, ISO/IEC 14496-14\n ]), esds(track));\n };\n })();\n\n tkhd = function tkhd(track) {\n var result = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x07, // flags\n 0x00, 0x00, 0x00, 0x00, // creation_time\n 0x00, 0x00, 0x00, 0x00, // modification_time\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x00, // reserved\n (track.duration & 0xFF000000) >> 24, (track.duration & 0xFF0000) >> 16, (track.duration & 0xFF00) >> 8, track.duration & 0xFF, // duration\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // reserved\n 0x00, 0x00, // layer\n 0x00, 0x00, // alternate_group\n 0x01, 0x00, // non-audio track volume\n 0x00, 0x00, // reserved\n 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, // transformation: unity matrix\n (track.width & 0xFF00) >> 8, track.width & 0xFF, 0x00, 0x00, // width\n (track.height & 0xFF00) >> 8, track.height & 0xFF, 0x00, 0x00 // height\n ]);\n return box(types.tkhd, result);\n };\n /**\n * Generate a track fragment (traf) box. A traf box collects metadata\n * about tracks in a movie fragment (moof) box.\n */\n\n\n traf = function traf(track) {\n var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;\n trackFragmentHeader = box(types.tfhd, new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x3a, // flags\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x00, 0x00, 0x00 // default_sample_flags\n ]));\n upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / (UINT32_MAX + 1));\n lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % (UINT32_MAX + 1));\n trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([0x01, // version 1\n 0x00, 0x00, 0x00, // flags\n // baseMediaDecodeTime\n upperWordBaseMediaDecodeTime >>> 24 & 0xFF, upperWordBaseMediaDecodeTime >>> 16 & 0xFF, upperWordBaseMediaDecodeTime >>> 8 & 0xFF, upperWordBaseMediaDecodeTime & 0xFF, lowerWordBaseMediaDecodeTime >>> 24 & 0xFF, lowerWordBaseMediaDecodeTime >>> 16 & 0xFF, lowerWordBaseMediaDecodeTime >>> 8 & 0xFF, lowerWordBaseMediaDecodeTime & 0xFF])); // the data offset specifies the number of bytes from the start of\n // the containing moof to the first payload byte of the associated\n // mdat\n\n dataOffset = 32 + // tfhd\n 20 + // tfdt\n 8 + // traf header\n 16 + // mfhd\n 8 + // moof header\n 8; // mdat header\n // audio tracks require less metadata\n\n if (track.type === 'audio') {\n trackFragmentRun = trun$1(track, dataOffset);\n return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);\n } // video tracks should contain an independent and disposable samples\n // box (sdtp)\n // generate one and adjust offsets to match\n\n\n sampleDependencyTable = sdtp(track);\n trackFragmentRun = trun$1(track, sampleDependencyTable.length + dataOffset);\n return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);\n };\n /**\n * Generate a track box.\n * @param track {object} a track definition\n * @return {Uint8Array} the track box\n */\n\n\n trak = function trak(track) {\n track.duration = track.duration || 0xffffffff;\n return box(types.trak, tkhd(track), mdia(track));\n };\n\n trex = function trex(track) {\n var result = new Uint8Array([0x00, // version 0\n 0x00, 0x00, 0x00, // flags\n (track.id & 0xFF000000) >> 24, (track.id & 0xFF0000) >> 16, (track.id & 0xFF00) >> 8, track.id & 0xFF, // track_ID\n 0x00, 0x00, 0x00, 0x01, // default_sample_description_index\n 0x00, 0x00, 0x00, 0x00, // default_sample_duration\n 0x00, 0x00, 0x00, 0x00, // default_sample_size\n 0x00, 0x01, 0x00, 0x01 // default_sample_flags\n ]); // the last two bytes of default_sample_flags is the sample\n // degradation priority, a hint about the importance of this sample\n // relative to others. Lower the degradation priority for all sample\n // types other than video.\n\n if (track.type !== 'video') {\n result[result.length - 1] = 0x00;\n }\n\n return box(types.trex, result);\n };\n\n (function () {\n var audioTrun, videoTrun, trunHeader; // This method assumes all samples are uniform. That is, if a\n // duration is present for the first sample, it will be present for\n // all subsequent samples.\n // see ISO/IEC 14496-12:2012, Section 8.8.8.1\n\n trunHeader = function trunHeader(samples, offset) {\n var durationPresent = 0,\n sizePresent = 0,\n flagsPresent = 0,\n compositionTimeOffset = 0; // trun flag constants\n\n if (samples.length) {\n if (samples[0].duration !== undefined) {\n durationPresent = 0x1;\n }\n\n if (samples[0].size !== undefined) {\n sizePresent = 0x2;\n }\n\n if (samples[0].flags !== undefined) {\n flagsPresent = 0x4;\n }\n\n if (samples[0].compositionTimeOffset !== undefined) {\n compositionTimeOffset = 0x8;\n }\n }\n\n return [0x00, // version 0\n 0x00, durationPresent | sizePresent | flagsPresent | compositionTimeOffset, 0x01, // flags\n (samples.length & 0xFF000000) >>> 24, (samples.length & 0xFF0000) >>> 16, (samples.length & 0xFF00) >>> 8, samples.length & 0xFF, // sample_count\n (offset & 0xFF000000) >>> 24, (offset & 0xFF0000) >>> 16, (offset & 0xFF00) >>> 8, offset & 0xFF // data_offset\n ];\n };\n\n videoTrun = function videoTrun(track, offset) {\n var bytesOffest, bytes, header, samples, sample, i;\n samples = track.samples || [];\n offset += 8 + 12 + 16 * samples.length;\n header = trunHeader(samples, offset);\n bytes = new Uint8Array(header.length + samples.length * 16);\n bytes.set(header);\n bytesOffest = header.length;\n\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes[bytesOffest++] = (sample.duration & 0xFF000000) >>> 24;\n bytes[bytesOffest++] = (sample.duration & 0xFF0000) >>> 16;\n bytes[bytesOffest++] = (sample.duration & 0xFF00) >>> 8;\n bytes[bytesOffest++] = sample.duration & 0xFF; // sample_duration\n\n bytes[bytesOffest++] = (sample.size & 0xFF000000) >>> 24;\n bytes[bytesOffest++] = (sample.size & 0xFF0000) >>> 16;\n bytes[bytesOffest++] = (sample.size & 0xFF00) >>> 8;\n bytes[bytesOffest++] = sample.size & 0xFF; // sample_size\n\n bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn;\n bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample;\n bytes[bytesOffest++] = sample.flags.degradationPriority & 0xF0 << 8;\n bytes[bytesOffest++] = sample.flags.degradationPriority & 0x0F; // sample_flags\n\n bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF000000) >>> 24;\n bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF0000) >>> 16;\n bytes[bytesOffest++] = (sample.compositionTimeOffset & 0xFF00) >>> 8;\n bytes[bytesOffest++] = sample.compositionTimeOffset & 0xFF; // sample_composition_time_offset\n }\n\n return box(types.trun, bytes);\n };\n\n audioTrun = function audioTrun(track, offset) {\n var bytes, bytesOffest, header, samples, sample, i;\n samples = track.samples || [];\n offset += 8 + 12 + 8 * samples.length;\n header = trunHeader(samples, offset);\n bytes = new Uint8Array(header.length + samples.length * 8);\n bytes.set(header);\n bytesOffest = header.length;\n\n for (i = 0; i < samples.length; i++) {\n sample = samples[i];\n bytes[bytesOffest++] = (sample.duration & 0xFF000000) >>> 24;\n bytes[bytesOffest++] = (sample.duration & 0xFF0000) >>> 16;\n bytes[bytesOffest++] = (sample.duration & 0xFF00) >>> 8;\n bytes[bytesOffest++] = sample.duration & 0xFF; // sample_duration\n\n bytes[bytesOffest++] = (sample.size & 0xFF000000) >>> 24;\n bytes[bytesOffest++] = (sample.size & 0xFF0000) >>> 16;\n bytes[bytesOffest++] = (sample.size & 0xFF00) >>> 8;\n bytes[bytesOffest++] = sample.size & 0xFF; // sample_size\n }\n\n return box(types.trun, bytes);\n };\n\n trun$1 = function trun(track, offset) {\n if (track.type === 'audio') {\n return audioTrun(track, offset);\n }\n\n return videoTrun(track, offset);\n };\n })();\n\n var mp4Generator = {\n ftyp: ftyp,\n mdat: mdat,\n moof: moof,\n moov: moov,\n initSegment: function initSegment(tracks) {\n var fileType = ftyp(),\n movie = moov(tracks),\n result;\n result = new Uint8Array(fileType.byteLength + movie.byteLength);\n result.set(fileType);\n result.set(movie, fileType.byteLength);\n return result;\n }\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n // Convert an array of nal units into an array of frames with each frame being\n // composed of the nal units that make up that frame\n // Also keep track of cummulative data about the frame from the nal units such\n // as the frame duration, starting pts, etc.\n\n var groupNalsIntoFrames = function groupNalsIntoFrames(nalUnits) {\n var i,\n currentNal,\n currentFrame = [],\n frames = []; // TODO added for LHLS, make sure this is OK\n\n frames.byteLength = 0;\n frames.nalCount = 0;\n frames.duration = 0;\n currentFrame.byteLength = 0;\n\n for (i = 0; i < nalUnits.length; i++) {\n currentNal = nalUnits[i]; // Split on 'aud'-type nal units\n\n if (currentNal.nalUnitType === 'access_unit_delimiter_rbsp') {\n // Since the very first nal unit is expected to be an AUD\n // only push to the frames array when currentFrame is not empty\n if (currentFrame.length) {\n currentFrame.duration = currentNal.dts - currentFrame.dts; // TODO added for LHLS, make sure this is OK\n\n frames.byteLength += currentFrame.byteLength;\n frames.nalCount += currentFrame.length;\n frames.duration += currentFrame.duration;\n frames.push(currentFrame);\n }\n\n currentFrame = [currentNal];\n currentFrame.byteLength = currentNal.data.byteLength;\n currentFrame.pts = currentNal.pts;\n currentFrame.dts = currentNal.dts;\n } else {\n // Specifically flag key frames for ease of use later\n if (currentNal.nalUnitType === 'slice_layer_without_partitioning_rbsp_idr') {\n currentFrame.keyFrame = true;\n }\n\n currentFrame.duration = currentNal.dts - currentFrame.dts;\n currentFrame.byteLength += currentNal.data.byteLength;\n currentFrame.push(currentNal);\n }\n } // For the last frame, use the duration of the previous frame if we\n // have nothing better to go on\n\n\n if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {\n currentFrame.duration = frames[frames.length - 1].duration;\n } // Push the final frame\n // TODO added for LHLS, make sure this is OK\n\n\n frames.byteLength += currentFrame.byteLength;\n frames.nalCount += currentFrame.length;\n frames.duration += currentFrame.duration;\n frames.push(currentFrame);\n return frames;\n }; // Convert an array of frames into an array of Gop with each Gop being composed\n // of the frames that make up that Gop\n // Also keep track of cummulative data about the Gop from the frames such as the\n // Gop duration, starting pts, etc.\n\n\n var groupFramesIntoGops = function groupFramesIntoGops(frames) {\n var i,\n currentFrame,\n currentGop = [],\n gops = []; // We must pre-set some of the values on the Gop since we\n // keep running totals of these values\n\n currentGop.byteLength = 0;\n currentGop.nalCount = 0;\n currentGop.duration = 0;\n currentGop.pts = frames[0].pts;\n currentGop.dts = frames[0].dts; // store some metadata about all the Gops\n\n gops.byteLength = 0;\n gops.nalCount = 0;\n gops.duration = 0;\n gops.pts = frames[0].pts;\n gops.dts = frames[0].dts;\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n\n if (currentFrame.keyFrame) {\n // Since the very first frame is expected to be an keyframe\n // only push to the gops array when currentGop is not empty\n if (currentGop.length) {\n gops.push(currentGop);\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration;\n }\n\n currentGop = [currentFrame];\n currentGop.nalCount = currentFrame.length;\n currentGop.byteLength = currentFrame.byteLength;\n currentGop.pts = currentFrame.pts;\n currentGop.dts = currentFrame.dts;\n currentGop.duration = currentFrame.duration;\n } else {\n currentGop.duration += currentFrame.duration;\n currentGop.nalCount += currentFrame.length;\n currentGop.byteLength += currentFrame.byteLength;\n currentGop.push(currentFrame);\n }\n }\n\n if (gops.length && currentGop.duration <= 0) {\n currentGop.duration = gops[gops.length - 1].duration;\n }\n\n gops.byteLength += currentGop.byteLength;\n gops.nalCount += currentGop.nalCount;\n gops.duration += currentGop.duration; // push the final Gop\n\n gops.push(currentGop);\n return gops;\n };\n /*\n * Search for the first keyframe in the GOPs and throw away all frames\n * until that keyframe. Then extend the duration of the pulled keyframe\n * and pull the PTS and DTS of the keyframe so that it covers the time\n * range of the frames that were disposed.\n *\n * @param {Array} gops video GOPs\n * @returns {Array} modified video GOPs\n */\n\n\n var extendFirstKeyFrame = function extendFirstKeyFrame(gops) {\n var currentGop;\n\n if (!gops[0][0].keyFrame && gops.length > 1) {\n // Remove the first GOP\n currentGop = gops.shift();\n gops.byteLength -= currentGop.byteLength;\n gops.nalCount -= currentGop.nalCount; // Extend the first frame of what is now the\n // first gop to cover the time period of the\n // frames we just removed\n\n gops[0][0].dts = currentGop.dts;\n gops[0][0].pts = currentGop.pts;\n gops[0][0].duration += currentGop.duration;\n }\n\n return gops;\n };\n /**\n * Default sample object\n * see ISO/IEC 14496-12:2012, section 8.6.4.3\n */\n\n\n var createDefaultSample = function createDefaultSample() {\n return {\n size: 0,\n flags: {\n isLeading: 0,\n dependsOn: 1,\n isDependedOn: 0,\n hasRedundancy: 0,\n degradationPriority: 0,\n isNonSyncSample: 1\n }\n };\n };\n /*\n * Collates information from a video frame into an object for eventual\n * entry into an MP4 sample table.\n *\n * @param {Object} frame the video frame\n * @param {Number} dataOffset the byte offset to position the sample\n * @return {Object} object containing sample table info for a frame\n */\n\n\n var sampleForFrame = function sampleForFrame(frame, dataOffset) {\n var sample = createDefaultSample();\n sample.dataOffset = dataOffset;\n sample.compositionTimeOffset = frame.pts - frame.dts;\n sample.duration = frame.duration;\n sample.size = 4 * frame.length; // Space for nal unit size\n\n sample.size += frame.byteLength;\n\n if (frame.keyFrame) {\n sample.flags.dependsOn = 2;\n sample.flags.isNonSyncSample = 0;\n }\n\n return sample;\n }; // generate the track's sample table from an array of gops\n\n\n var generateSampleTable$1 = function generateSampleTable(gops, baseDataOffset) {\n var h,\n i,\n sample,\n currentGop,\n currentFrame,\n dataOffset = baseDataOffset || 0,\n samples = [];\n\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h];\n\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i];\n sample = sampleForFrame(currentFrame, dataOffset);\n dataOffset += sample.size;\n samples.push(sample);\n }\n }\n\n return samples;\n }; // generate the track's raw mdat data from an array of gops\n\n\n var concatenateNalData = function concatenateNalData(gops) {\n var h,\n i,\n j,\n currentGop,\n currentFrame,\n currentNal,\n dataOffset = 0,\n nalsByteLength = gops.byteLength,\n numberOfNals = gops.nalCount,\n totalByteLength = nalsByteLength + 4 * numberOfNals,\n data = new Uint8Array(totalByteLength),\n view = new DataView(data.buffer); // For each Gop..\n\n for (h = 0; h < gops.length; h++) {\n currentGop = gops[h]; // For each Frame..\n\n for (i = 0; i < currentGop.length; i++) {\n currentFrame = currentGop[i]; // For each NAL..\n\n for (j = 0; j < currentFrame.length; j++) {\n currentNal = currentFrame[j];\n view.setUint32(dataOffset, currentNal.data.byteLength);\n dataOffset += 4;\n data.set(currentNal.data, dataOffset);\n dataOffset += currentNal.data.byteLength;\n }\n }\n }\n\n return data;\n }; // generate the track's sample table from a frame\n\n\n var generateSampleTableForFrame = function generateSampleTableForFrame(frame, baseDataOffset) {\n var sample,\n dataOffset = baseDataOffset || 0,\n samples = [];\n sample = sampleForFrame(frame, dataOffset);\n samples.push(sample);\n return samples;\n }; // generate the track's raw mdat data from a frame\n\n\n var concatenateNalDataForFrame = function concatenateNalDataForFrame(frame) {\n var i,\n currentNal,\n dataOffset = 0,\n nalsByteLength = frame.byteLength,\n numberOfNals = frame.length,\n totalByteLength = nalsByteLength + 4 * numberOfNals,\n data = new Uint8Array(totalByteLength),\n view = new DataView(data.buffer); // For each NAL..\n\n for (i = 0; i < frame.length; i++) {\n currentNal = frame[i];\n view.setUint32(dataOffset, currentNal.data.byteLength);\n dataOffset += 4;\n data.set(currentNal.data, dataOffset);\n dataOffset += currentNal.data.byteLength;\n }\n\n return data;\n };\n\n var frameUtils = {\n groupNalsIntoFrames: groupNalsIntoFrames,\n groupFramesIntoGops: groupFramesIntoGops,\n extendFirstKeyFrame: extendFirstKeyFrame,\n generateSampleTable: generateSampleTable$1,\n concatenateNalData: concatenateNalData,\n generateSampleTableForFrame: generateSampleTableForFrame,\n concatenateNalDataForFrame: concatenateNalDataForFrame\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var highPrefix = [33, 16, 5, 32, 164, 27];\n var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];\n\n var zeroFill = function zeroFill(count) {\n var a = [];\n\n while (count--) {\n a.push(0);\n }\n\n return a;\n };\n\n var makeTable = function makeTable(metaTable) {\n return Object.keys(metaTable).reduce(function (obj, key) {\n obj[key] = new Uint8Array(metaTable[key].reduce(function (arr, part) {\n return arr.concat(part);\n }, []));\n return obj;\n }, {});\n };\n\n var silence;\n\n var silence_1 = function silence_1() {\n if (!silence) {\n // Frames-of-silence to use for filling in missing AAC frames\n var coneOfSilence = {\n 96000: [highPrefix, [227, 64], zeroFill(154), [56]],\n 88200: [highPrefix, [231], zeroFill(170), [56]],\n 64000: [highPrefix, [248, 192], zeroFill(240), [56]],\n 48000: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],\n 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],\n 32000: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],\n 24000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],\n 16000: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],\n 12000: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],\n 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],\n 8000: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]\n };\n silence = makeTable(coneOfSilence);\n }\n\n return silence;\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n\n var ONE_SECOND_IN_TS$4 = 90000,\n // 90kHz clock\n secondsToVideoTs,\n secondsToAudioTs,\n videoTsToSeconds,\n audioTsToSeconds,\n audioTsToVideoTs,\n videoTsToAudioTs,\n metadataTsToSeconds;\n\n secondsToVideoTs = function secondsToVideoTs(seconds) {\n return seconds * ONE_SECOND_IN_TS$4;\n };\n\n secondsToAudioTs = function secondsToAudioTs(seconds, sampleRate) {\n return seconds * sampleRate;\n };\n\n videoTsToSeconds = function videoTsToSeconds(timestamp) {\n return timestamp / ONE_SECOND_IN_TS$4;\n };\n\n audioTsToSeconds = function audioTsToSeconds(timestamp, sampleRate) {\n return timestamp / sampleRate;\n };\n\n audioTsToVideoTs = function audioTsToVideoTs(timestamp, sampleRate) {\n return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n };\n\n videoTsToAudioTs = function videoTsToAudioTs(timestamp, sampleRate) {\n return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n };\n /**\n * Adjust ID3 tag or caption timing information by the timeline pts values\n * (if keepOriginalTimestamps is false) and convert to seconds\n */\n\n\n metadataTsToSeconds = function metadataTsToSeconds(timestamp, timelineStartPts, keepOriginalTimestamps) {\n return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);\n };\n\n var clock = {\n ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$4,\n secondsToVideoTs: secondsToVideoTs,\n secondsToAudioTs: secondsToAudioTs,\n videoTsToSeconds: videoTsToSeconds,\n audioTsToSeconds: audioTsToSeconds,\n audioTsToVideoTs: audioTsToVideoTs,\n videoTsToAudioTs: videoTsToAudioTs,\n metadataTsToSeconds: metadataTsToSeconds\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n /**\n * Sum the `byteLength` properties of the data in each AAC frame\n */\n\n var sumFrameByteLengths = function sumFrameByteLengths(array) {\n var i,\n currentObj,\n sum = 0; // sum the byteLength's all each nal unit in the frame\n\n for (i = 0; i < array.length; i++) {\n currentObj = array[i];\n sum += currentObj.data.byteLength;\n }\n\n return sum;\n }; // Possibly pad (prefix) the audio track with silence if appending this track\n // would lead to the introduction of a gap in the audio buffer\n\n\n var prefixWithSilence = function prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {\n var baseMediaDecodeTimeTs,\n frameDuration = 0,\n audioGapDuration = 0,\n audioFillFrameCount = 0,\n audioFillDuration = 0,\n silentFrame,\n i,\n firstFrame;\n\n if (!frames.length) {\n return;\n }\n\n baseMediaDecodeTimeTs = clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate); // determine frame clock duration based on sample rate, round up to avoid overfills\n\n frameDuration = Math.ceil(clock.ONE_SECOND_IN_TS / (track.samplerate / 1024));\n\n if (audioAppendStartTs && videoBaseMediaDecodeTime) {\n // insert the shortest possible amount (audio gap or audio to video gap)\n audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime); // number of full frames in the audio gap\n\n audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);\n audioFillDuration = audioFillFrameCount * frameDuration;\n } // don't attempt to fill gaps smaller than a single frame or larger\n // than a half second\n\n\n if (audioFillFrameCount < 1 || audioFillDuration > clock.ONE_SECOND_IN_TS / 2) {\n return;\n }\n\n silentFrame = silence_1()[track.samplerate];\n\n if (!silentFrame) {\n // we don't have a silent frame pregenerated for the sample rate, so use a frame\n // from the content instead\n silentFrame = frames[0].data;\n }\n\n for (i = 0; i < audioFillFrameCount; i++) {\n firstFrame = frames[0];\n frames.splice(0, 0, {\n data: silentFrame,\n dts: firstFrame.dts - frameDuration,\n pts: firstFrame.pts - frameDuration\n });\n }\n\n track.baseMediaDecodeTime -= Math.floor(clock.videoTsToAudioTs(audioFillDuration, track.samplerate));\n return audioFillDuration;\n }; // If the audio segment extends before the earliest allowed dts\n // value, remove AAC frames until starts at or after the earliest\n // allowed DTS so that we don't end up with a negative baseMedia-\n // DecodeTime for the audio track\n\n\n var trimAdtsFramesByEarliestDts = function trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts) {\n if (track.minSegmentDts >= earliestAllowedDts) {\n return adtsFrames;\n } // We will need to recalculate the earliest segment Dts\n\n\n track.minSegmentDts = Infinity;\n return adtsFrames.filter(function (currentFrame) {\n // If this is an allowed frame, keep it and record it's Dts\n if (currentFrame.dts >= earliestAllowedDts) {\n track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);\n track.minSegmentPts = track.minSegmentDts;\n return true;\n } // Otherwise, discard it\n\n\n return false;\n });\n }; // generate the track's raw mdat data from an array of frames\n\n\n var generateSampleTable = function generateSampleTable(frames) {\n var i,\n currentFrame,\n samples = [];\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n samples.push({\n size: currentFrame.data.byteLength,\n duration: 1024 // For AAC audio, all samples contain 1024 samples\n\n });\n }\n\n return samples;\n }; // generate the track's sample table from an array of frames\n\n\n var concatenateFrameData = function concatenateFrameData(frames) {\n var i,\n currentFrame,\n dataOffset = 0,\n data = new Uint8Array(sumFrameByteLengths(frames));\n\n for (i = 0; i < frames.length; i++) {\n currentFrame = frames[i];\n data.set(currentFrame.data, dataOffset);\n dataOffset += currentFrame.data.byteLength;\n }\n\n return data;\n };\n\n var audioFrameUtils = {\n prefixWithSilence: prefixWithSilence,\n trimAdtsFramesByEarliestDts: trimAdtsFramesByEarliestDts,\n generateSampleTable: generateSampleTable,\n concatenateFrameData: concatenateFrameData\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var ONE_SECOND_IN_TS$3 = clock.ONE_SECOND_IN_TS;\n /**\n * Store information about the start and end of the track and the\n * duration for each frame/sample we process in order to calculate\n * the baseMediaDecodeTime\n */\n\n var collectDtsInfo = function collectDtsInfo(track, data) {\n if (typeof data.pts === 'number') {\n if (track.timelineStartInfo.pts === undefined) {\n track.timelineStartInfo.pts = data.pts;\n }\n\n if (track.minSegmentPts === undefined) {\n track.minSegmentPts = data.pts;\n } else {\n track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);\n }\n\n if (track.maxSegmentPts === undefined) {\n track.maxSegmentPts = data.pts;\n } else {\n track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);\n }\n }\n\n if (typeof data.dts === 'number') {\n if (track.timelineStartInfo.dts === undefined) {\n track.timelineStartInfo.dts = data.dts;\n }\n\n if (track.minSegmentDts === undefined) {\n track.minSegmentDts = data.dts;\n } else {\n track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);\n }\n\n if (track.maxSegmentDts === undefined) {\n track.maxSegmentDts = data.dts;\n } else {\n track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);\n }\n }\n };\n /**\n * Clear values used to calculate the baseMediaDecodeTime between\n * tracks\n */\n\n\n var clearDtsInfo = function clearDtsInfo(track) {\n delete track.minSegmentDts;\n delete track.maxSegmentDts;\n delete track.minSegmentPts;\n delete track.maxSegmentPts;\n };\n /**\n * Calculate the track's baseMediaDecodeTime based on the earliest\n * DTS the transmuxer has ever seen and the minimum DTS for the\n * current track\n * @param track {object} track metadata configuration\n * @param keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n\n var calculateTrackBaseMediaDecodeTime = function calculateTrackBaseMediaDecodeTime(track, keepOriginalTimestamps) {\n var baseMediaDecodeTime,\n scale,\n minSegmentDts = track.minSegmentDts; // Optionally adjust the time so the first segment starts at zero.\n\n if (!keepOriginalTimestamps) {\n minSegmentDts -= track.timelineStartInfo.dts;\n } // track.timelineStartInfo.baseMediaDecodeTime is the location, in time, where\n // we want the start of the first segment to be placed\n\n\n baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime; // Add to that the distance this segment is from the very first\n\n baseMediaDecodeTime += minSegmentDts; // baseMediaDecodeTime must not become negative\n\n baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);\n\n if (track.type === 'audio') {\n // Audio has a different clock equal to the sampling_rate so we need to\n // scale the PTS values into the clock rate of the track\n scale = track.samplerate / ONE_SECOND_IN_TS$3;\n baseMediaDecodeTime *= scale;\n baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);\n }\n\n return baseMediaDecodeTime;\n };\n\n var trackDecodeInfo = {\n clearDtsInfo: clearDtsInfo,\n calculateTrackBaseMediaDecodeTime: calculateTrackBaseMediaDecodeTime,\n collectDtsInfo: collectDtsInfo\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Reads in-band caption information from a video elementary\n * stream. Captions must follow the CEA-708 standard for injection\n * into an MPEG-2 transport streams.\n * @see https://en.wikipedia.org/wiki/CEA-708\n * @see https://www.gpo.gov/fdsys/pkg/CFR-2007-title47-vol1/pdf/CFR-2007-title47-vol1-sec15-119.pdf\n */\n // payload type field to indicate how they are to be\n // interpreted. CEAS-708 caption content is always transmitted with\n // payload type 0x04.\n\n var USER_DATA_REGISTERED_ITU_T_T35 = 4,\n RBSP_TRAILING_BITS = 128;\n /**\n * Parse a supplemental enhancement information (SEI) NAL unit.\n * Stops parsing once a message of type ITU T T35 has been found.\n *\n * @param bytes {Uint8Array} the bytes of a SEI NAL unit\n * @return {object} the parsed SEI payload\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n */\n\n var parseSei = function parseSei(bytes) {\n var i = 0,\n result = {\n payloadType: -1,\n payloadSize: 0\n },\n payloadType = 0,\n payloadSize = 0; // go through the sei_rbsp parsing each each individual sei_message\n\n while (i < bytes.byteLength) {\n // stop once we have hit the end of the sei_rbsp\n if (bytes[i] === RBSP_TRAILING_BITS) {\n break;\n } // Parse payload type\n\n\n while (bytes[i] === 0xFF) {\n payloadType += 255;\n i++;\n }\n\n payloadType += bytes[i++]; // Parse payload size\n\n while (bytes[i] === 0xFF) {\n payloadSize += 255;\n i++;\n }\n\n payloadSize += bytes[i++]; // this sei_message is a 608/708 caption so save it and break\n // there can only ever be one caption message in a frame's sei\n\n if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {\n var userIdentifier = String.fromCharCode(bytes[i + 3], bytes[i + 4], bytes[i + 5], bytes[i + 6]);\n\n if (userIdentifier === 'GA94') {\n result.payloadType = payloadType;\n result.payloadSize = payloadSize;\n result.payload = bytes.subarray(i, i + payloadSize);\n break;\n } else {\n result.payload = void 0;\n }\n } // skip the payload and parse the next message\n\n\n i += payloadSize;\n payloadType = 0;\n payloadSize = 0;\n }\n\n return result;\n }; // see ANSI/SCTE 128-1 (2013), section 8.1\n\n\n var parseUserData = function parseUserData(sei) {\n // itu_t_t35_contry_code must be 181 (United States) for\n // captions\n if (sei.payload[0] !== 181) {\n return null;\n } // itu_t_t35_provider_code should be 49 (ATSC) for captions\n\n\n if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {\n return null;\n } // the user_identifier should be \"GA94\" to indicate ATSC1 data\n\n\n if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== 'GA94') {\n return null;\n } // finally, user_data_type_code should be 0x03 for caption data\n\n\n if (sei.payload[7] !== 0x03) {\n return null;\n } // return the user_data_type_structure and strip the trailing\n // marker bits\n\n\n return sei.payload.subarray(8, sei.payload.length - 1);\n }; // see CEA-708-D, section 4.4\n\n\n var parseCaptionPackets = function parseCaptionPackets(pts, userData) {\n var results = [],\n i,\n count,\n offset,\n data; // if this is just filler, return immediately\n\n if (!(userData[0] & 0x40)) {\n return results;\n } // parse out the cc_data_1 and cc_data_2 fields\n\n\n count = userData[0] & 0x1f;\n\n for (i = 0; i < count; i++) {\n offset = i * 3;\n data = {\n type: userData[offset + 2] & 0x03,\n pts: pts\n }; // capture cc data when cc_valid is 1\n\n if (userData[offset + 2] & 0x04) {\n data.ccData = userData[offset + 3] << 8 | userData[offset + 4];\n results.push(data);\n }\n }\n\n return results;\n };\n\n var discardEmulationPreventionBytes$1 = function discardEmulationPreventionBytes(data) {\n var length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength,\n newData; // Find all `Emulation Prevention Bytes`\n\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n } // If no Emulation Prevention Bytes were found just return the original\n // array\n\n\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n } // Create a new array to hold the NAL unit data\n\n\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++; // Remove this position index\n\n emulationPreventionBytesPositions.shift();\n }\n\n newData[i] = data[sourceIndex];\n }\n\n return newData;\n }; // exports\n\n\n var captionPacketParser = {\n parseSei: parseSei,\n parseUserData: parseUserData,\n parseCaptionPackets: parseCaptionPackets,\n discardEmulationPreventionBytes: discardEmulationPreventionBytes$1,\n USER_DATA_REGISTERED_ITU_T_T35: USER_DATA_REGISTERED_ITU_T_T35\n }; // Link To Transport\n // -----------------\n\n var CaptionStream$1 = function CaptionStream(options) {\n options = options || {};\n CaptionStream.prototype.init.call(this); // parse708captions flag, default to true\n\n this.parse708captions_ = typeof options.parse708captions === 'boolean' ? options.parse708captions : true;\n this.captionPackets_ = [];\n this.ccStreams_ = [new Cea608Stream(0, 0), // eslint-disable-line no-use-before-define\n new Cea608Stream(0, 1), // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 0), // eslint-disable-line no-use-before-define\n new Cea608Stream(1, 1) // eslint-disable-line no-use-before-define\n ];\n\n if (this.parse708captions_) {\n this.cc708Stream_ = new Cea708Stream(); // eslint-disable-line no-use-before-define\n }\n\n this.reset(); // forward data and done events from CCs to this CaptionStream\n\n this.ccStreams_.forEach(function (cc) {\n cc.on('data', this.trigger.bind(this, 'data'));\n cc.on('partialdone', this.trigger.bind(this, 'partialdone'));\n cc.on('done', this.trigger.bind(this, 'done'));\n }, this);\n\n if (this.parse708captions_) {\n this.cc708Stream_.on('data', this.trigger.bind(this, 'data'));\n this.cc708Stream_.on('partialdone', this.trigger.bind(this, 'partialdone'));\n this.cc708Stream_.on('done', this.trigger.bind(this, 'done'));\n }\n };\n\n CaptionStream$1.prototype = new stream();\n\n CaptionStream$1.prototype.push = function (event) {\n var sei, userData, newCaptionPackets; // only examine SEI NALs\n\n if (event.nalUnitType !== 'sei_rbsp') {\n return;\n } // parse the sei\n\n\n sei = captionPacketParser.parseSei(event.escapedRBSP); // no payload data, skip\n\n if (!sei.payload) {\n return;\n } // ignore everything but user_data_registered_itu_t_t35\n\n\n if (sei.payloadType !== captionPacketParser.USER_DATA_REGISTERED_ITU_T_T35) {\n return;\n } // parse out the user data payload\n\n\n userData = captionPacketParser.parseUserData(sei); // ignore unrecognized userData\n\n if (!userData) {\n return;\n } // Sometimes, the same segment # will be downloaded twice. To stop the\n // caption data from being processed twice, we track the latest dts we've\n // received and ignore everything with a dts before that. However, since\n // data for a specific dts can be split across packets on either side of\n // a segment boundary, we need to make sure we *don't* ignore the packets\n // from the *next* segment that have dts === this.latestDts_. By constantly\n // tracking the number of packets received with dts === this.latestDts_, we\n // know how many should be ignored once we start receiving duplicates.\n\n\n if (event.dts < this.latestDts_) {\n // We've started getting older data, so set the flag.\n this.ignoreNextEqualDts_ = true;\n return;\n } else if (event.dts === this.latestDts_ && this.ignoreNextEqualDts_) {\n this.numSameDts_--;\n\n if (!this.numSameDts_) {\n // We've received the last duplicate packet, time to start processing again\n this.ignoreNextEqualDts_ = false;\n }\n\n return;\n } // parse out CC data packets and save them for later\n\n\n newCaptionPackets = captionPacketParser.parseCaptionPackets(event.pts, userData);\n this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);\n\n if (this.latestDts_ !== event.dts) {\n this.numSameDts_ = 0;\n }\n\n this.numSameDts_++;\n this.latestDts_ = event.dts;\n };\n\n CaptionStream$1.prototype.flushCCStreams = function (flushType) {\n this.ccStreams_.forEach(function (cc) {\n return flushType === 'flush' ? cc.flush() : cc.partialFlush();\n }, this);\n };\n\n CaptionStream$1.prototype.flushStream = function (flushType) {\n // make sure we actually parsed captions before proceeding\n if (!this.captionPackets_.length) {\n this.flushCCStreams(flushType);\n return;\n } // In Chrome, the Array#sort function is not stable so add a\n // presortIndex that we can use to ensure we get a stable-sort\n\n\n this.captionPackets_.forEach(function (elem, idx) {\n elem.presortIndex = idx;\n }); // sort caption byte-pairs based on their PTS values\n\n this.captionPackets_.sort(function (a, b) {\n if (a.pts === b.pts) {\n return a.presortIndex - b.presortIndex;\n }\n\n return a.pts - b.pts;\n });\n this.captionPackets_.forEach(function (packet) {\n if (packet.type < 2) {\n // Dispatch packet to the right Cea608Stream\n this.dispatchCea608Packet(packet);\n } else {\n // Dispatch packet to the Cea708Stream\n this.dispatchCea708Packet(packet);\n }\n }, this);\n this.captionPackets_.length = 0;\n this.flushCCStreams(flushType);\n };\n\n CaptionStream$1.prototype.flush = function () {\n return this.flushStream('flush');\n }; // Only called if handling partial data\n\n\n CaptionStream$1.prototype.partialFlush = function () {\n return this.flushStream('partialFlush');\n };\n\n CaptionStream$1.prototype.reset = function () {\n this.latestDts_ = null;\n this.ignoreNextEqualDts_ = false;\n this.numSameDts_ = 0;\n this.activeCea608Channel_ = [null, null];\n this.ccStreams_.forEach(function (ccStream) {\n ccStream.reset();\n });\n }; // From the CEA-608 spec:\n\n /*\n * When XDS sub-packets are interleaved with other services, the end of each sub-packet shall be followed\n * by a control pair to change to a different service. When any of the control codes from 0x10 to 0x1F is\n * used to begin a control code pair, it indicates the return to captioning or Text data. The control code pair\n * and subsequent data should then be processed according to the FCC rules. It may be necessary for the\n * line 21 data encoder to automatically insert a control code pair (i.e. RCL, RU2, RU3, RU4, RDC, or RTD)\n * to switch to captioning or Text.\n */\n // With that in mind, we ignore any data between an XDS control code and a\n // subsequent closed-captioning control code.\n\n\n CaptionStream$1.prototype.dispatchCea608Packet = function (packet) {\n // NOTE: packet.type is the CEA608 field\n if (this.setsTextOrXDSActive(packet)) {\n this.activeCea608Channel_[packet.type] = null;\n } else if (this.setsChannel1Active(packet)) {\n this.activeCea608Channel_[packet.type] = 0;\n } else if (this.setsChannel2Active(packet)) {\n this.activeCea608Channel_[packet.type] = 1;\n }\n\n if (this.activeCea608Channel_[packet.type] === null) {\n // If we haven't received anything to set the active channel, or the\n // packets are Text/XDS data, discard the data; we don't want jumbled\n // captions\n return;\n }\n\n this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);\n };\n\n CaptionStream$1.prototype.setsChannel1Active = function (packet) {\n return (packet.ccData & 0x7800) === 0x1000;\n };\n\n CaptionStream$1.prototype.setsChannel2Active = function (packet) {\n return (packet.ccData & 0x7800) === 0x1800;\n };\n\n CaptionStream$1.prototype.setsTextOrXDSActive = function (packet) {\n return (packet.ccData & 0x7100) === 0x0100 || (packet.ccData & 0x78fe) === 0x102a || (packet.ccData & 0x78fe) === 0x182a;\n };\n\n CaptionStream$1.prototype.dispatchCea708Packet = function (packet) {\n if (this.parse708captions_) {\n this.cc708Stream_.push(packet);\n }\n }; // ----------------------\n // Session to Application\n // ----------------------\n // This hash maps special and extended character codes to their\n // proper Unicode equivalent. The first one-byte key is just a\n // non-standard character code. The two-byte keys that follow are\n // the extended CEA708 character codes, along with the preceding\n // 0x10 extended character byte to distinguish these codes from\n // non-extended character codes. Every CEA708 character code that\n // is not in this object maps directly to a standard unicode\n // character code.\n // The transparent space and non-breaking transparent space are\n // technically not fully supported since there is no code to\n // make them transparent, so they have normal non-transparent\n // stand-ins.\n // The special closed caption (CC) character isn't a standard\n // unicode character, so a fairly similar unicode character was\n // chosen in it's place.\n\n\n var CHARACTER_TRANSLATION_708 = {\n 0x7f: 0x266a,\n // ♪\n 0x1020: 0x20,\n // Transparent Space\n 0x1021: 0xa0,\n // Nob-breaking Transparent Space\n 0x1025: 0x2026,\n // …\n 0x102a: 0x0160,\n // Å \n 0x102c: 0x0152,\n // Å’\n 0x1030: 0x2588,\n // â–ˆ\n 0x1031: 0x2018,\n // ‘\n 0x1032: 0x2019,\n // ’\n 0x1033: 0x201c,\n // “\n 0x1034: 0x201d,\n // â€\n 0x1035: 0x2022,\n // •\n 0x1039: 0x2122,\n // â„¢\n 0x103a: 0x0161,\n // Å¡\n 0x103c: 0x0153,\n // Å“\n 0x103d: 0x2120,\n // â„ \n 0x103f: 0x0178,\n // Ÿ\n 0x1076: 0x215b,\n // â…›\n 0x1077: 0x215c,\n // â…œ\n 0x1078: 0x215d,\n // â…\n 0x1079: 0x215e,\n // â…ž\n 0x107a: 0x23d0,\n // â\n 0x107b: 0x23a4,\n // ⎤\n 0x107c: 0x23a3,\n // ⎣\n 0x107d: 0x23af,\n // ⎯\n 0x107e: 0x23a6,\n // ⎦\n 0x107f: 0x23a1,\n // ⎡\n 0x10a0: 0x3138 // ㄸ (CC char)\n\n };\n\n var get708CharFromCode = function get708CharFromCode(code) {\n var newCode = CHARACTER_TRANSLATION_708[code] || code;\n\n if (code & 0x1000 && code === newCode) {\n // Invalid extended code\n return '';\n }\n\n return String.fromCharCode(newCode);\n };\n\n var within708TextBlock = function within708TextBlock(b) {\n return 0x20 <= b && b <= 0x7f || 0xa0 <= b && b <= 0xff;\n };\n\n var Cea708Window = function Cea708Window(windowNum) {\n this.windowNum = windowNum;\n this.reset();\n };\n\n Cea708Window.prototype.reset = function () {\n this.clearText();\n this.pendingNewLine = false;\n this.winAttr = {};\n this.penAttr = {};\n this.penLoc = {};\n this.penColor = {}; // These default values are arbitrary,\n // defineWindow will usually override them\n\n this.visible = 0;\n this.rowLock = 0;\n this.columnLock = 0;\n this.priority = 0;\n this.relativePositioning = 0;\n this.anchorVertical = 0;\n this.anchorHorizontal = 0;\n this.anchorPoint = 0;\n this.rowCount = 1;\n this.virtualRowCount = this.rowCount + 1;\n this.columnCount = 41;\n this.windowStyle = 0;\n this.penStyle = 0;\n };\n\n Cea708Window.prototype.getText = function () {\n return this.rows.join('\\n');\n };\n\n Cea708Window.prototype.clearText = function () {\n this.rows = [''];\n this.rowIdx = 0;\n };\n\n Cea708Window.prototype.newLine = function (pts) {\n if (this.rows.length >= this.virtualRowCount && typeof this.beforeRowOverflow === 'function') {\n this.beforeRowOverflow(pts);\n }\n\n if (this.rows.length > 0) {\n this.rows.push('');\n this.rowIdx++;\n } // Show all virtual rows since there's no visible scrolling\n\n\n while (this.rows.length > this.virtualRowCount) {\n this.rows.shift();\n this.rowIdx--;\n }\n };\n\n Cea708Window.prototype.isEmpty = function () {\n if (this.rows.length === 0) {\n return true;\n } else if (this.rows.length === 1) {\n return this.rows[0] === '';\n }\n\n return false;\n };\n\n Cea708Window.prototype.addText = function (text) {\n this.rows[this.rowIdx] += text;\n };\n\n Cea708Window.prototype.backspace = function () {\n if (!this.isEmpty()) {\n var row = this.rows[this.rowIdx];\n this.rows[this.rowIdx] = row.substr(0, row.length - 1);\n }\n };\n\n var Cea708Service = function Cea708Service(serviceNum) {\n this.serviceNum = serviceNum;\n this.text = '';\n this.currentWindow = new Cea708Window(-1);\n this.windows = [];\n };\n /**\n * Initialize service windows\n * Must be run before service use\n *\n * @param {Integer} pts PTS value\n * @param {Function} beforeRowOverflow Function to execute before row overflow of a window\n */\n\n\n Cea708Service.prototype.init = function (pts, beforeRowOverflow) {\n this.startPts = pts;\n\n for (var win = 0; win < 8; win++) {\n this.windows[win] = new Cea708Window(win);\n\n if (typeof beforeRowOverflow === 'function') {\n this.windows[win].beforeRowOverflow = beforeRowOverflow;\n }\n }\n };\n /**\n * Set current window of service to be affected by commands\n *\n * @param {Integer} windowNum Window number\n */\n\n\n Cea708Service.prototype.setCurrentWindow = function (windowNum) {\n this.currentWindow = this.windows[windowNum];\n };\n\n var Cea708Stream = function Cea708Stream() {\n Cea708Stream.prototype.init.call(this);\n var self = this;\n this.current708Packet = null;\n this.services = {};\n\n this.push = function (packet) {\n if (packet.type === 3) {\n // 708 packet start\n self.new708Packet();\n self.add708Bytes(packet);\n } else {\n if (self.current708Packet === null) {\n // This should only happen at the start of a file if there's no packet start.\n self.new708Packet();\n }\n\n self.add708Bytes(packet);\n }\n };\n };\n\n Cea708Stream.prototype = new stream();\n /**\n * Push current 708 packet, create new 708 packet.\n */\n\n Cea708Stream.prototype.new708Packet = function () {\n if (this.current708Packet !== null) {\n this.push708Packet();\n }\n\n this.current708Packet = {\n data: [],\n ptsVals: []\n };\n };\n /**\n * Add pts and both bytes from packet into current 708 packet.\n */\n\n\n Cea708Stream.prototype.add708Bytes = function (packet) {\n var data = packet.ccData;\n var byte0 = data >>> 8;\n var byte1 = data & 0xff; // I would just keep a list of packets instead of bytes, but it isn't clear in the spec\n // that service blocks will always line up with byte pairs.\n\n this.current708Packet.ptsVals.push(packet.pts);\n this.current708Packet.data.push(byte0);\n this.current708Packet.data.push(byte1);\n };\n /**\n * Parse completed 708 packet into service blocks and push each service block.\n */\n\n\n Cea708Stream.prototype.push708Packet = function () {\n var packet708 = this.current708Packet;\n var packetData = packet708.data;\n var serviceNum = null;\n var blockSize = null;\n var i = 0;\n var b = packetData[i++];\n packet708.seq = b >> 6;\n packet708.sizeCode = b & 0x3f; // 0b00111111;\n\n for (; i < packetData.length; i++) {\n b = packetData[i++];\n serviceNum = b >> 5;\n blockSize = b & 0x1f; // 0b00011111\n\n if (serviceNum === 7 && blockSize > 0) {\n // Extended service num\n b = packetData[i++];\n serviceNum = b;\n }\n\n this.pushServiceBlock(serviceNum, i, blockSize);\n\n if (blockSize > 0) {\n i += blockSize - 1;\n }\n }\n };\n /**\n * Parse service block, execute commands, read text.\n *\n * Note: While many of these commands serve important purposes,\n * many others just parse out the parameters or attributes, but\n * nothing is done with them because this is not a full and complete\n * implementation of the entire 708 spec.\n *\n * @param {Integer} serviceNum Service number\n * @param {Integer} start Start index of the 708 packet data\n * @param {Integer} size Block size\n */\n\n\n Cea708Stream.prototype.pushServiceBlock = function (serviceNum, start, size) {\n var b;\n var i = start;\n var packetData = this.current708Packet.data;\n var service = this.services[serviceNum];\n\n if (!service) {\n service = this.initService(serviceNum, i);\n }\n\n for (; i < start + size && i < packetData.length; i++) {\n b = packetData[i];\n\n if (within708TextBlock(b)) {\n i = this.handleText(i, service);\n } else if (b === 0x10) {\n i = this.extendedCommands(i, service);\n } else if (0x80 <= b && b <= 0x87) {\n i = this.setCurrentWindow(i, service);\n } else if (0x98 <= b && b <= 0x9f) {\n i = this.defineWindow(i, service);\n } else if (b === 0x88) {\n i = this.clearWindows(i, service);\n } else if (b === 0x8c) {\n i = this.deleteWindows(i, service);\n } else if (b === 0x89) {\n i = this.displayWindows(i, service);\n } else if (b === 0x8a) {\n i = this.hideWindows(i, service);\n } else if (b === 0x8b) {\n i = this.toggleWindows(i, service);\n } else if (b === 0x97) {\n i = this.setWindowAttributes(i, service);\n } else if (b === 0x90) {\n i = this.setPenAttributes(i, service);\n } else if (b === 0x91) {\n i = this.setPenColor(i, service);\n } else if (b === 0x92) {\n i = this.setPenLocation(i, service);\n } else if (b === 0x8f) {\n service = this.reset(i, service);\n } else if (b === 0x08) {\n // BS: Backspace\n service.currentWindow.backspace();\n } else if (b === 0x0c) {\n // FF: Form feed\n service.currentWindow.clearText();\n } else if (b === 0x0d) {\n // CR: Carriage return\n service.currentWindow.pendingNewLine = true;\n } else if (b === 0x0e) {\n // HCR: Horizontal carriage return\n service.currentWindow.clearText();\n } else if (b === 0x8d) {\n // DLY: Delay, nothing to do\n i++;\n } else ;\n }\n };\n /**\n * Execute an extended command\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.extendedCommands = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n\n if (within708TextBlock(b)) {\n i = this.handleText(i, service, true);\n }\n\n return i;\n };\n /**\n * Get PTS value of a given byte index\n *\n * @param {Integer} byteIndex Index of the byte\n * @return {Integer} PTS\n */\n\n\n Cea708Stream.prototype.getPts = function (byteIndex) {\n // There's 1 pts value per 2 bytes\n return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)];\n };\n /**\n * Initializes a service\n *\n * @param {Integer} serviceNum Service number\n * @return {Service} Initialized service object\n */\n\n\n Cea708Stream.prototype.initService = function (serviceNum, i) {\n var self = this;\n this.services[serviceNum] = new Cea708Service(serviceNum);\n this.services[serviceNum].init(this.getPts(i), function (pts) {\n self.flushDisplayed(pts, self.services[serviceNum]);\n });\n return this.services[serviceNum];\n };\n /**\n * Execute text writing to current window\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.handleText = function (i, service, isExtended) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var extended = isExtended ? 0x1000 : 0x0000;\n\n var _char = get708CharFromCode(extended | b);\n\n var win = service.currentWindow;\n\n if (win.pendingNewLine && !win.isEmpty()) {\n win.newLine(this.getPts(i));\n }\n\n win.pendingNewLine = false;\n win.addText(_char);\n return i;\n };\n /**\n * Parse and execute the CW# command.\n *\n * Set the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.setCurrentWindow = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var windowNum = b & 0x07;\n service.setCurrentWindow(windowNum);\n return i;\n };\n /**\n * Parse and execute the DF# command.\n *\n * Define a window and set it as the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.defineWindow = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var windowNum = b & 0x07;\n service.setCurrentWindow(windowNum);\n var win = service.currentWindow;\n b = packetData[++i];\n win.visible = (b & 0x20) >> 5; // v\n\n win.rowLock = (b & 0x10) >> 4; // rl\n\n win.columnLock = (b & 0x08) >> 3; // cl\n\n win.priority = b & 0x07; // p\n\n b = packetData[++i];\n win.relativePositioning = (b & 0x80) >> 7; // rp\n\n win.anchorVertical = b & 0x7f; // av\n\n b = packetData[++i];\n win.anchorHorizontal = b; // ah\n\n b = packetData[++i];\n win.anchorPoint = (b & 0xf0) >> 4; // ap\n\n win.rowCount = b & 0x0f; // rc\n\n b = packetData[++i];\n win.columnCount = b & 0x3f; // cc\n\n b = packetData[++i];\n win.windowStyle = (b & 0x38) >> 3; // ws\n\n win.penStyle = b & 0x07; // ps\n // The spec says there are (rowCount+1) \"virtual rows\"\n\n win.virtualRowCount = win.rowCount + 1;\n return i;\n };\n /**\n * Parse and execute the SWA command.\n *\n * Set attributes of the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.setWindowAttributes = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var winAttr = service.currentWindow.winAttr;\n b = packetData[++i];\n winAttr.fillOpacity = (b & 0xc0) >> 6; // fo\n\n winAttr.fillRed = (b & 0x30) >> 4; // fr\n\n winAttr.fillGreen = (b & 0x0c) >> 2; // fg\n\n winAttr.fillBlue = b & 0x03; // fb\n\n b = packetData[++i];\n winAttr.borderType = (b & 0xc0) >> 6; // bt\n\n winAttr.borderRed = (b & 0x30) >> 4; // br\n\n winAttr.borderGreen = (b & 0x0c) >> 2; // bg\n\n winAttr.borderBlue = b & 0x03; // bb\n\n b = packetData[++i];\n winAttr.borderType += (b & 0x80) >> 5; // bt\n\n winAttr.wordWrap = (b & 0x40) >> 6; // ww\n\n winAttr.printDirection = (b & 0x30) >> 4; // pd\n\n winAttr.scrollDirection = (b & 0x0c) >> 2; // sd\n\n winAttr.justify = b & 0x03; // j\n\n b = packetData[++i];\n winAttr.effectSpeed = (b & 0xf0) >> 4; // es\n\n winAttr.effectDirection = (b & 0x0c) >> 2; // ed\n\n winAttr.displayEffect = b & 0x03; // de\n\n return i;\n };\n /**\n * Gather text from all displayed windows and push a caption to output.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n */\n\n\n Cea708Stream.prototype.flushDisplayed = function (pts, service) {\n var displayedText = []; // TODO: Positioning not supported, displaying multiple windows will not necessarily\n // display text in the correct order, but sample files so far have not shown any issue.\n\n for (var winId = 0; winId < 8; winId++) {\n if (service.windows[winId].visible && !service.windows[winId].isEmpty()) {\n displayedText.push(service.windows[winId].getText());\n }\n }\n\n service.endPts = pts;\n service.text = displayedText.join('\\n\\n');\n this.pushCaption(service);\n service.startPts = pts;\n };\n /**\n * Push a caption to output if the caption contains text.\n *\n * @param {Service} service The service object to be affected\n */\n\n\n Cea708Stream.prototype.pushCaption = function (service) {\n if (service.text !== '') {\n this.trigger('data', {\n startPts: service.startPts,\n endPts: service.endPts,\n text: service.text,\n stream: 'cc708_' + service.serviceNum\n });\n service.text = '';\n service.startPts = service.endPts;\n }\n };\n /**\n * Parse and execute the DSW command.\n *\n * Set visible property of windows based on the parsed bitmask.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.displayWindows = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n\n for (var winId = 0; winId < 8; winId++) {\n if (b & 0x01 << winId) {\n service.windows[winId].visible = 1;\n }\n }\n\n return i;\n };\n /**\n * Parse and execute the HDW command.\n *\n * Set visible property of windows based on the parsed bitmask.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.hideWindows = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n\n for (var winId = 0; winId < 8; winId++) {\n if (b & 0x01 << winId) {\n service.windows[winId].visible = 0;\n }\n }\n\n return i;\n };\n /**\n * Parse and execute the TGW command.\n *\n * Set visible property of windows based on the parsed bitmask.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.toggleWindows = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n\n for (var winId = 0; winId < 8; winId++) {\n if (b & 0x01 << winId) {\n service.windows[winId].visible ^= 1;\n }\n }\n\n return i;\n };\n /**\n * Parse and execute the CLW command.\n *\n * Clear text of windows based on the parsed bitmask.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.clearWindows = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n\n for (var winId = 0; winId < 8; winId++) {\n if (b & 0x01 << winId) {\n service.windows[winId].clearText();\n }\n }\n\n return i;\n };\n /**\n * Parse and execute the DLW command.\n *\n * Re-initialize windows based on the parsed bitmask.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.deleteWindows = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[++i];\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n\n for (var winId = 0; winId < 8; winId++) {\n if (b & 0x01 << winId) {\n service.windows[winId].reset();\n }\n }\n\n return i;\n };\n /**\n * Parse and execute the SPA command.\n *\n * Set pen attributes of the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.setPenAttributes = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var penAttr = service.currentWindow.penAttr;\n b = packetData[++i];\n penAttr.textTag = (b & 0xf0) >> 4; // tt\n\n penAttr.offset = (b & 0x0c) >> 2; // o\n\n penAttr.penSize = b & 0x03; // s\n\n b = packetData[++i];\n penAttr.italics = (b & 0x80) >> 7; // i\n\n penAttr.underline = (b & 0x40) >> 6; // u\n\n penAttr.edgeType = (b & 0x38) >> 3; // et\n\n penAttr.fontStyle = b & 0x07; // fs\n\n return i;\n };\n /**\n * Parse and execute the SPC command.\n *\n * Set pen color of the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.setPenColor = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var penColor = service.currentWindow.penColor;\n b = packetData[++i];\n penColor.fgOpacity = (b & 0xc0) >> 6; // fo\n\n penColor.fgRed = (b & 0x30) >> 4; // fr\n\n penColor.fgGreen = (b & 0x0c) >> 2; // fg\n\n penColor.fgBlue = b & 0x03; // fb\n\n b = packetData[++i];\n penColor.bgOpacity = (b & 0xc0) >> 6; // bo\n\n penColor.bgRed = (b & 0x30) >> 4; // br\n\n penColor.bgGreen = (b & 0x0c) >> 2; // bg\n\n penColor.bgBlue = b & 0x03; // bb\n\n b = packetData[++i];\n penColor.edgeRed = (b & 0x30) >> 4; // er\n\n penColor.edgeGreen = (b & 0x0c) >> 2; // eg\n\n penColor.edgeBlue = b & 0x03; // eb\n\n return i;\n };\n /**\n * Parse and execute the SPL command.\n *\n * Set pen location of the current window.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Integer} New index after parsing\n */\n\n\n Cea708Stream.prototype.setPenLocation = function (i, service) {\n var packetData = this.current708Packet.data;\n var b = packetData[i];\n var penLoc = service.currentWindow.penLoc; // Positioning isn't really supported at the moment, so this essentially just inserts a linebreak\n\n service.currentWindow.pendingNewLine = true;\n b = packetData[++i];\n penLoc.row = b & 0x0f; // r\n\n b = packetData[++i];\n penLoc.column = b & 0x3f; // c\n\n return i;\n };\n /**\n * Execute the RST command.\n *\n * Reset service to a clean slate. Re-initialize.\n *\n * @param {Integer} i Current index in the 708 packet\n * @param {Service} service The service object to be affected\n * @return {Service} Re-initialized service\n */\n\n\n Cea708Stream.prototype.reset = function (i, service) {\n var pts = this.getPts(i);\n this.flushDisplayed(pts, service);\n return this.initService(service.serviceNum, i);\n }; // This hash maps non-ASCII, special, and extended character codes to their\n // proper Unicode equivalent. The first keys that are only a single byte\n // are the non-standard ASCII characters, which simply map the CEA608 byte\n // to the standard ASCII/Unicode. The two-byte keys that follow are the CEA608\n // character codes, but have their MSB bitmasked with 0x03 so that a lookup\n // can be performed regardless of the field and data channel on which the\n // character code was received.\n\n\n var CHARACTER_TRANSLATION = {\n 0x2a: 0xe1,\n // á\n 0x5c: 0xe9,\n // é\n 0x5e: 0xed,\n // Ã\n 0x5f: 0xf3,\n // ó\n 0x60: 0xfa,\n // ú\n 0x7b: 0xe7,\n // ç\n 0x7c: 0xf7,\n // ÷\n 0x7d: 0xd1,\n // Ñ\n 0x7e: 0xf1,\n // ñ\n 0x7f: 0x2588,\n // â–ˆ\n 0x0130: 0xae,\n // ®\n 0x0131: 0xb0,\n // °\n 0x0132: 0xbd,\n // ½\n 0x0133: 0xbf,\n // ¿\n 0x0134: 0x2122,\n // â„¢\n 0x0135: 0xa2,\n // ¢\n 0x0136: 0xa3,\n // £\n 0x0137: 0x266a,\n // ♪\n 0x0138: 0xe0,\n // à \n 0x0139: 0xa0,\n //\n 0x013a: 0xe8,\n // è\n 0x013b: 0xe2,\n // â\n 0x013c: 0xea,\n // ê\n 0x013d: 0xee,\n // î\n 0x013e: 0xf4,\n // ô\n 0x013f: 0xfb,\n // û\n 0x0220: 0xc1,\n // Ã\n 0x0221: 0xc9,\n // É\n 0x0222: 0xd3,\n // Ó\n 0x0223: 0xda,\n // Ú\n 0x0224: 0xdc,\n // Ãœ\n 0x0225: 0xfc,\n // ü\n 0x0226: 0x2018,\n // ‘\n 0x0227: 0xa1,\n // ¡\n 0x0228: 0x2a,\n // *\n 0x0229: 0x27,\n // '\n 0x022a: 0x2014,\n // —\n 0x022b: 0xa9,\n // ©\n 0x022c: 0x2120,\n // â„ \n 0x022d: 0x2022,\n // •\n 0x022e: 0x201c,\n // “\n 0x022f: 0x201d,\n // â€\n 0x0230: 0xc0,\n // À\n 0x0231: 0xc2,\n // Â\n 0x0232: 0xc7,\n // Ç\n 0x0233: 0xc8,\n // È\n 0x0234: 0xca,\n // Ê\n 0x0235: 0xcb,\n // Ë\n 0x0236: 0xeb,\n // ë\n 0x0237: 0xce,\n // ÃŽ\n 0x0238: 0xcf,\n // Ã\n 0x0239: 0xef,\n // ï\n 0x023a: 0xd4,\n // Ô\n 0x023b: 0xd9,\n // Ù\n 0x023c: 0xf9,\n // ù\n 0x023d: 0xdb,\n // Û\n 0x023e: 0xab,\n // «\n 0x023f: 0xbb,\n // »\n 0x0320: 0xc3,\n // Ã\n 0x0321: 0xe3,\n // ã\n 0x0322: 0xcd,\n // Ã\n 0x0323: 0xcc,\n // ÃŒ\n 0x0324: 0xec,\n // ì\n 0x0325: 0xd2,\n // Ã’\n 0x0326: 0xf2,\n // ò\n 0x0327: 0xd5,\n // Õ\n 0x0328: 0xf5,\n // õ\n 0x0329: 0x7b,\n // {\n 0x032a: 0x7d,\n // }\n 0x032b: 0x5c,\n // \\\n 0x032c: 0x5e,\n // ^\n 0x032d: 0x5f,\n // _\n 0x032e: 0x7c,\n // |\n 0x032f: 0x7e,\n // ~\n 0x0330: 0xc4,\n // Ä\n 0x0331: 0xe4,\n // ä\n 0x0332: 0xd6,\n // Ö\n 0x0333: 0xf6,\n // ö\n 0x0334: 0xdf,\n // ß\n 0x0335: 0xa5,\n // Â¥\n 0x0336: 0xa4,\n // ¤\n 0x0337: 0x2502,\n // │\n 0x0338: 0xc5,\n // Ã…\n 0x0339: 0xe5,\n // Ã¥\n 0x033a: 0xd8,\n // Ø\n 0x033b: 0xf8,\n // ø\n 0x033c: 0x250c,\n // ┌\n 0x033d: 0x2510,\n // â”\n 0x033e: 0x2514,\n // â””\n 0x033f: 0x2518 // ┘\n\n };\n\n var getCharFromCode = function getCharFromCode(code) {\n if (code === null) {\n return '';\n }\n\n code = CHARACTER_TRANSLATION[code] || code;\n return String.fromCharCode(code);\n }; // the index of the last row in a CEA-608 display buffer\n\n\n var BOTTOM_ROW = 14; // This array is used for mapping PACs -> row #, since there's no way of\n // getting it through bit logic.\n\n var ROWS = [0x1100, 0x1120, 0x1200, 0x1220, 0x1500, 0x1520, 0x1600, 0x1620, 0x1700, 0x1720, 0x1000, 0x1300, 0x1320, 0x1400, 0x1420]; // CEA-608 captions are rendered onto a 34x15 matrix of character\n // cells. The \"bottom\" row is the last element in the outer array.\n\n var createDisplayBuffer = function createDisplayBuffer() {\n var result = [],\n i = BOTTOM_ROW + 1;\n\n while (i--) {\n result.push('');\n }\n\n return result;\n };\n\n var Cea608Stream = function Cea608Stream(field, dataChannel) {\n Cea608Stream.prototype.init.call(this);\n this.field_ = field || 0;\n this.dataChannel_ = dataChannel || 0;\n this.name_ = 'CC' + ((this.field_ << 1 | this.dataChannel_) + 1);\n this.setConstants();\n this.reset();\n\n this.push = function (packet) {\n var data, swap, char0, char1, text; // remove the parity bits\n\n data = packet.ccData & 0x7f7f; // ignore duplicate control codes; the spec demands they're sent twice\n\n if (data === this.lastControlCode_) {\n this.lastControlCode_ = null;\n return;\n } // Store control codes\n\n\n if ((data & 0xf000) === 0x1000) {\n this.lastControlCode_ = data;\n } else if (data !== this.PADDING_) {\n this.lastControlCode_ = null;\n }\n\n char0 = data >>> 8;\n char1 = data & 0xff;\n\n if (data === this.PADDING_) {\n return;\n } else if (data === this.RESUME_CAPTION_LOADING_) {\n this.mode_ = 'popOn';\n } else if (data === this.END_OF_CAPTION_) {\n // If an EOC is received while in paint-on mode, the displayed caption\n // text should be swapped to non-displayed memory as if it was a pop-on\n // caption. Because of that, we should explicitly switch back to pop-on\n // mode\n this.mode_ = 'popOn';\n this.clearFormatting(packet.pts); // if a caption was being displayed, it's gone now\n\n this.flushDisplayed(packet.pts); // flip memory\n\n swap = this.displayed_;\n this.displayed_ = this.nonDisplayed_;\n this.nonDisplayed_ = swap; // start measuring the time to display the caption\n\n this.startPts_ = packet.pts;\n } else if (data === this.ROLL_UP_2_ROWS_) {\n this.rollUpRows_ = 2;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_3_ROWS_) {\n this.rollUpRows_ = 3;\n this.setRollUp(packet.pts);\n } else if (data === this.ROLL_UP_4_ROWS_) {\n this.rollUpRows_ = 4;\n this.setRollUp(packet.pts);\n } else if (data === this.CARRIAGE_RETURN_) {\n this.clearFormatting(packet.pts);\n this.flushDisplayed(packet.pts);\n this.shiftRowsUp_();\n this.startPts_ = packet.pts;\n } else if (data === this.BACKSPACE_) {\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n } else {\n this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n }\n } else if (data === this.ERASE_DISPLAYED_MEMORY_) {\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {\n this.nonDisplayed_ = createDisplayBuffer();\n } else if (data === this.RESUME_DIRECT_CAPTIONING_) {\n if (this.mode_ !== 'paintOn') {\n // NOTE: This should be removed when proper caption positioning is\n // implemented\n this.flushDisplayed(packet.pts);\n this.displayed_ = createDisplayBuffer();\n }\n\n this.mode_ = 'paintOn';\n this.startPts_ = packet.pts; // Append special characters to caption text\n } else if (this.isSpecialCharacter(char0, char1)) {\n // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++; // Append extended characters to caption text\n } else if (this.isExtCharacter(char0, char1)) {\n // Extended characters always follow their \"non-extended\" equivalents.\n // IE if a \"è\" is desired, you'll always receive \"eè\"; non-compliant\n // decoders are supposed to drop the \"è\", while compliant decoders\n // backspace the \"e\" and insert \"è\".\n // Delete the previous character\n if (this.mode_ === 'popOn') {\n this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);\n } else {\n this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);\n } // Bitmask char0 so that we can apply character transformations\n // regardless of field and data channel.\n // Then byte-shift to the left and OR with char1 so we can pass the\n // entire character code to `getCharFromCode`.\n\n\n char0 = (char0 & 0x03) << 8;\n text = getCharFromCode(char0 | char1);\n this[this.mode_](packet.pts, text);\n this.column_++; // Process mid-row codes\n } else if (this.isMidRowCode(char0, char1)) {\n // Attributes are not additive, so clear all formatting\n this.clearFormatting(packet.pts); // According to the standard, mid-row codes\n // should be replaced with spaces, so add one now\n\n this[this.mode_](packet.pts, ' ');\n this.column_++;\n\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n\n if ((char1 & 0x1) === 0x1) {\n this.addFormatting(packet.pts, ['u']);\n } // Detect offset control codes and adjust cursor\n\n } else if (this.isOffsetControlCode(char0, char1)) {\n // Cursor position is set by indent PAC (see below) in 4-column\n // increments, with an additional offset code of 1-3 to reach any\n // of the 32 columns specified by CEA-608. So all we need to do\n // here is increment the column cursor by the given offset.\n this.column_ += char1 & 0x03; // Detect PACs (Preamble Address Codes)\n } else if (this.isPAC(char0, char1)) {\n // There's no logic for PAC -> row mapping, so we have to just\n // find the row code in an array and use its index :(\n var row = ROWS.indexOf(data & 0x1f20); // Configure the caption window if we're in roll-up mode\n\n if (this.mode_ === 'rollUp') {\n // This implies that the base row is incorrectly set.\n // As per the recommendation in CEA-608(Base Row Implementation), defer to the number\n // of roll-up rows set.\n if (row - this.rollUpRows_ + 1 < 0) {\n row = this.rollUpRows_ - 1;\n }\n\n this.setRollUp(packet.pts, row);\n }\n\n if (row !== this.row_) {\n // formatting is only persistent for current row\n this.clearFormatting(packet.pts);\n this.row_ = row;\n } // All PACs can apply underline, so detect and apply\n // (All odd-numbered second bytes set underline)\n\n\n if (char1 & 0x1 && this.formatting_.indexOf('u') === -1) {\n this.addFormatting(packet.pts, ['u']);\n }\n\n if ((data & 0x10) === 0x10) {\n // We've got an indent level code. Each successive even number\n // increments the column cursor by 4, so we can get the desired\n // column position by bit-shifting to the right (to get n/2)\n // and multiplying by 4.\n this.column_ = ((data & 0xe) >> 1) * 4;\n }\n\n if (this.isColorPAC(char1)) {\n // it's a color code, though we only support white, which\n // can be either normal or italicized. white italics can be\n // either 0x4e or 0x6e depending on the row, so we just\n // bitwise-and with 0xe to see if italics should be turned on\n if ((char1 & 0xe) === 0xe) {\n this.addFormatting(packet.pts, ['i']);\n }\n } // We have a normal character in char0, and possibly one in char1\n\n } else if (this.isNormalChar(char0)) {\n if (char1 === 0x00) {\n char1 = null;\n }\n\n text = getCharFromCode(char0);\n text += getCharFromCode(char1);\n this[this.mode_](packet.pts, text);\n this.column_ += text.length;\n } // finish data processing\n\n };\n };\n\n Cea608Stream.prototype = new stream(); // Trigger a cue point that captures the current state of the\n // display buffer\n\n Cea608Stream.prototype.flushDisplayed = function (pts) {\n var content = this.displayed_ // remove spaces from the start and end of the string\n .map(function (row, index) {\n try {\n return row.trim();\n } catch (e) {\n // Ordinarily, this shouldn't happen. However, caption\n // parsing errors should not throw exceptions and\n // break playback.\n this.trigger('log', {\n level: 'warn',\n message: 'Skipping a malformed 608 caption at index ' + index + '.'\n });\n return '';\n }\n }, this) // combine all text rows to display in one cue\n .join('\\n') // and remove blank rows from the start and end, but not the middle\n .replace(/^\\n+|\\n+$/g, '');\n\n if (content.length) {\n this.trigger('data', {\n startPts: this.startPts_,\n endPts: pts,\n text: content,\n stream: this.name_\n });\n }\n };\n /**\n * Zero out the data, used for startup and on seek\n */\n\n\n Cea608Stream.prototype.reset = function () {\n this.mode_ = 'popOn'; // When in roll-up mode, the index of the last row that will\n // actually display captions. If a caption is shifted to a row\n // with a lower index than this, it is cleared from the display\n // buffer\n\n this.topRow_ = 0;\n this.startPts_ = 0;\n this.displayed_ = createDisplayBuffer();\n this.nonDisplayed_ = createDisplayBuffer();\n this.lastControlCode_ = null; // Track row and column for proper line-breaking and spacing\n\n this.column_ = 0;\n this.row_ = BOTTOM_ROW;\n this.rollUpRows_ = 2; // This variable holds currently-applied formatting\n\n this.formatting_ = [];\n };\n /**\n * Sets up control code and related constants for this instance\n */\n\n\n Cea608Stream.prototype.setConstants = function () {\n // The following attributes have these uses:\n // ext_ : char0 for mid-row codes, and the base for extended\n // chars (ext_+0, ext_+1, and ext_+2 are char0s for\n // extended codes)\n // control_: char0 for control codes, except byte-shifted to the\n // left so that we can do this.control_ | CONTROL_CODE\n // offset_: char0 for tab offset codes\n //\n // It's also worth noting that control codes, and _only_ control codes,\n // differ between field 1 and field2. Field 2 control codes are always\n // their field 1 value plus 1. That's why there's the \"| field\" on the\n // control value.\n if (this.dataChannel_ === 0) {\n this.BASE_ = 0x10;\n this.EXT_ = 0x11;\n this.CONTROL_ = (0x14 | this.field_) << 8;\n this.OFFSET_ = 0x17;\n } else if (this.dataChannel_ === 1) {\n this.BASE_ = 0x18;\n this.EXT_ = 0x19;\n this.CONTROL_ = (0x1c | this.field_) << 8;\n this.OFFSET_ = 0x1f;\n } // Constants for the LSByte command codes recognized by Cea608Stream. This\n // list is not exhaustive. For a more comprehensive listing and semantics see\n // http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/pdf/CFR-2010-title47-vol1-sec15-119.pdf\n // Padding\n\n\n this.PADDING_ = 0x0000; // Pop-on Mode\n\n this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 0x20;\n this.END_OF_CAPTION_ = this.CONTROL_ | 0x2f; // Roll-up Mode\n\n this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 0x25;\n this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 0x26;\n this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 0x27;\n this.CARRIAGE_RETURN_ = this.CONTROL_ | 0x2d; // paint-on mode\n\n this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 0x29; // Erasure\n\n this.BACKSPACE_ = this.CONTROL_ | 0x21;\n this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2c;\n this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 0x2e;\n };\n /**\n * Detects if the 2-byte packet data is a special character\n *\n * Special characters have a second byte in the range 0x30 to 0x3f,\n * with the first byte being 0x11 (for data channel 1) or 0x19 (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an special character\n */\n\n\n Cea608Stream.prototype.isSpecialCharacter = function (char0, char1) {\n return char0 === this.EXT_ && char1 >= 0x30 && char1 <= 0x3f;\n };\n /**\n * Detects if the 2-byte packet data is an extended character\n *\n * Extended characters have a second byte in the range 0x20 to 0x3f,\n * with the first byte being 0x12 or 0x13 (for data channel 1) or\n * 0x1a or 0x1b (for data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an extended character\n */\n\n\n Cea608Stream.prototype.isExtCharacter = function (char0, char1) {\n return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 0x20 && char1 <= 0x3f;\n };\n /**\n * Detects if the 2-byte packet is a mid-row code\n *\n * Mid-row codes have a second byte in the range 0x20 to 0x2f, with\n * the first byte being 0x11 (for data channel 1) or 0x19 (for data\n * channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a mid-row code\n */\n\n\n Cea608Stream.prototype.isMidRowCode = function (char0, char1) {\n return char0 === this.EXT_ && char1 >= 0x20 && char1 <= 0x2f;\n };\n /**\n * Detects if the 2-byte packet is an offset control code\n *\n * Offset control codes have a second byte in the range 0x21 to 0x23,\n * with the first byte being 0x17 (for data channel 1) or 0x1f (for\n * data channel 2).\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are an offset control code\n */\n\n\n Cea608Stream.prototype.isOffsetControlCode = function (char0, char1) {\n return char0 === this.OFFSET_ && char1 >= 0x21 && char1 <= 0x23;\n };\n /**\n * Detects if the 2-byte packet is a Preamble Address Code\n *\n * PACs have a first byte in the range 0x10 to 0x17 (for data channel 1)\n * or 0x18 to 0x1f (for data channel 2), with the second byte in the\n * range 0x40 to 0x7f.\n *\n * @param {Integer} char0 The first byte\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the 2 bytes are a PAC\n */\n\n\n Cea608Stream.prototype.isPAC = function (char0, char1) {\n return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 0x40 && char1 <= 0x7f;\n };\n /**\n * Detects if a packet's second byte is in the range of a PAC color code\n *\n * PAC color codes have the second byte be in the range 0x40 to 0x4f, or\n * 0x60 to 0x6f.\n *\n * @param {Integer} char1 The second byte\n * @return {Boolean} Whether the byte is a color PAC\n */\n\n\n Cea608Stream.prototype.isColorPAC = function (char1) {\n return char1 >= 0x40 && char1 <= 0x4f || char1 >= 0x60 && char1 <= 0x7f;\n };\n /**\n * Detects if a single byte is in the range of a normal character\n *\n * Normal text bytes are in the range 0x20 to 0x7f.\n *\n * @param {Integer} char The byte\n * @return {Boolean} Whether the byte is a normal character\n */\n\n\n Cea608Stream.prototype.isNormalChar = function (_char2) {\n return _char2 >= 0x20 && _char2 <= 0x7f;\n };\n /**\n * Configures roll-up\n *\n * @param {Integer} pts Current PTS\n * @param {Integer} newBaseRow Used by PACs to slide the current window to\n * a new position\n */\n\n\n Cea608Stream.prototype.setRollUp = function (pts, newBaseRow) {\n // Reset the base row to the bottom row when switching modes\n if (this.mode_ !== 'rollUp') {\n this.row_ = BOTTOM_ROW;\n this.mode_ = 'rollUp'; // Spec says to wipe memories when switching to roll-up\n\n this.flushDisplayed(pts);\n this.nonDisplayed_ = createDisplayBuffer();\n this.displayed_ = createDisplayBuffer();\n }\n\n if (newBaseRow !== undefined && newBaseRow !== this.row_) {\n // move currently displayed captions (up or down) to the new base row\n for (var i = 0; i < this.rollUpRows_; i++) {\n this.displayed_[newBaseRow - i] = this.displayed_[this.row_ - i];\n this.displayed_[this.row_ - i] = '';\n }\n }\n\n if (newBaseRow === undefined) {\n newBaseRow = this.row_;\n }\n\n this.topRow_ = newBaseRow - this.rollUpRows_ + 1;\n }; // Adds the opening HTML tag for the passed character to the caption text,\n // and keeps track of it for later closing\n\n\n Cea608Stream.prototype.addFormatting = function (pts, format) {\n this.formatting_ = this.formatting_.concat(format);\n var text = format.reduce(function (text, format) {\n return text + '<' + format + '>';\n }, '');\n this[this.mode_](pts, text);\n }; // Adds HTML closing tags for current formatting to caption text and\n // clears remembered formatting\n\n\n Cea608Stream.prototype.clearFormatting = function (pts) {\n if (!this.formatting_.length) {\n return;\n }\n\n var text = this.formatting_.reverse().reduce(function (text, format) {\n return text + '</' + format + '>';\n }, '');\n this.formatting_ = [];\n this[this.mode_](pts, text);\n }; // Mode Implementations\n\n\n Cea608Stream.prototype.popOn = function (pts, text) {\n var baseRow = this.nonDisplayed_[this.row_]; // buffer characters\n\n baseRow += text;\n this.nonDisplayed_[this.row_] = baseRow;\n };\n\n Cea608Stream.prototype.rollUp = function (pts, text) {\n var baseRow = this.displayed_[this.row_];\n baseRow += text;\n this.displayed_[this.row_] = baseRow;\n };\n\n Cea608Stream.prototype.shiftRowsUp_ = function () {\n var i; // clear out inactive rows\n\n for (i = 0; i < this.topRow_; i++) {\n this.displayed_[i] = '';\n }\n\n for (i = this.row_ + 1; i < BOTTOM_ROW + 1; i++) {\n this.displayed_[i] = '';\n } // shift displayed rows up\n\n\n for (i = this.topRow_; i < this.row_; i++) {\n this.displayed_[i] = this.displayed_[i + 1];\n } // clear out the bottom row\n\n\n this.displayed_[this.row_] = '';\n };\n\n Cea608Stream.prototype.paintOn = function (pts, text) {\n var baseRow = this.displayed_[this.row_];\n baseRow += text;\n this.displayed_[this.row_] = baseRow;\n }; // exports\n\n\n var captionStream = {\n CaptionStream: CaptionStream$1,\n Cea608Stream: Cea608Stream,\n Cea708Stream: Cea708Stream\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var streamTypes = {\n H264_STREAM_TYPE: 0x1B,\n ADTS_STREAM_TYPE: 0x0F,\n METADATA_STREAM_TYPE: 0x15\n };\n var MAX_TS = 8589934592;\n var RO_THRESH = 4294967296;\n var TYPE_SHARED = 'shared';\n\n var handleRollover$1 = function handleRollover(value, reference) {\n var direction = 1;\n\n if (value > reference) {\n // If the current timestamp value is greater than our reference timestamp and we detect a\n // timestamp rollover, this means the roll over is happening in the opposite direction.\n // Example scenario: Enter a long stream/video just after a rollover occurred. The reference\n // point will be set to a small number, e.g. 1. The user then seeks backwards over the\n // rollover point. In loading this segment, the timestamp values will be very large,\n // e.g. 2^33 - 1. Since this comes before the data we loaded previously, we want to adjust\n // the time stamp to be `value - 2^33`.\n direction = -1;\n } // Note: A seek forwards or back that is greater than the RO_THRESH (2^32, ~13 hours) will\n // cause an incorrect adjustment.\n\n\n while (Math.abs(reference - value) > RO_THRESH) {\n value += direction * MAX_TS;\n }\n\n return value;\n };\n\n var TimestampRolloverStream$1 = function TimestampRolloverStream(type) {\n var lastDTS, referenceDTS;\n TimestampRolloverStream.prototype.init.call(this); // The \"shared\" type is used in cases where a stream will contain muxed\n // video and audio. We could use `undefined` here, but having a string\n // makes debugging a little clearer.\n\n this.type_ = type || TYPE_SHARED;\n\n this.push = function (data) {\n // Any \"shared\" rollover streams will accept _all_ data. Otherwise,\n // streams will only accept data that matches their type.\n if (this.type_ !== TYPE_SHARED && data.type !== this.type_) {\n return;\n }\n\n if (referenceDTS === undefined) {\n referenceDTS = data.dts;\n }\n\n data.dts = handleRollover$1(data.dts, referenceDTS);\n data.pts = handleRollover$1(data.pts, referenceDTS);\n lastDTS = data.dts;\n this.trigger('data', data);\n };\n\n this.flush = function () {\n referenceDTS = lastDTS;\n this.trigger('done');\n };\n\n this.endTimeline = function () {\n this.flush();\n this.trigger('endedtimeline');\n };\n\n this.discontinuity = function () {\n referenceDTS = void 0;\n lastDTS = void 0;\n };\n\n this.reset = function () {\n this.discontinuity();\n this.trigger('reset');\n };\n };\n\n TimestampRolloverStream$1.prototype = new stream();\n var timestampRolloverStream = {\n TimestampRolloverStream: TimestampRolloverStream$1,\n handleRollover: handleRollover$1\n };\n\n var percentEncode$1 = function percentEncode(bytes, start, end) {\n var i,\n result = '';\n\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n\n return result;\n },\n // return the string representation of the specified byte range,\n // interpreted as UTf-8.\n parseUtf8 = function parseUtf8(bytes, start, end) {\n return decodeURIComponent(percentEncode$1(bytes, start, end));\n },\n // return the string representation of the specified byte range,\n // interpreted as ISO-8859-1.\n parseIso88591$1 = function parseIso88591(bytes, start, end) {\n return unescape(percentEncode$1(bytes, start, end)); // jshint ignore:line\n },\n parseSyncSafeInteger$1 = function parseSyncSafeInteger(data) {\n return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n },\n tagParsers = {\n TXXX: function TXXX(tag) {\n var i;\n\n if (tag.data[0] !== 3) {\n // ignore frames with unrecognized character encodings\n return;\n }\n\n for (i = 1; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the text fields\n tag.description = parseUtf8(tag.data, 1, i); // do not include the null terminator in the tag value\n\n tag.value = parseUtf8(tag.data, i + 1, tag.data.length).replace(/\\0*$/, '');\n break;\n }\n }\n\n tag.data = tag.value;\n },\n WXXX: function WXXX(tag) {\n var i;\n\n if (tag.data[0] !== 3) {\n // ignore frames with unrecognized character encodings\n return;\n }\n\n for (i = 1; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the description and URL fields\n tag.description = parseUtf8(tag.data, 1, i);\n tag.url = parseUtf8(tag.data, i + 1, tag.data.length);\n break;\n }\n }\n },\n PRIV: function PRIV(tag) {\n var i;\n\n for (i = 0; i < tag.data.length; i++) {\n if (tag.data[i] === 0) {\n // parse the description and URL fields\n tag.owner = parseIso88591$1(tag.data, 0, i);\n break;\n }\n }\n\n tag.privateData = tag.data.subarray(i + 1);\n tag.data = tag.privateData;\n }\n },\n _MetadataStream;\n\n _MetadataStream = function MetadataStream(options) {\n var settings = {\n // the bytes of the program-level descriptor field in MP2T\n // see ISO/IEC 13818-1:2013 (E), section 2.6 \"Program and\n // program element descriptors\"\n descriptor: options && options.descriptor\n },\n // the total size in bytes of the ID3 tag being parsed\n tagSize = 0,\n // tag data that is not complete enough to be parsed\n buffer = [],\n // the total number of bytes currently in the buffer\n bufferSize = 0,\n i;\n\n _MetadataStream.prototype.init.call(this); // calculate the text track in-band metadata track dispatch type\n // https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track\n\n\n this.dispatchType = streamTypes.METADATA_STREAM_TYPE.toString(16);\n\n if (settings.descriptor) {\n for (i = 0; i < settings.descriptor.length; i++) {\n this.dispatchType += ('00' + settings.descriptor[i].toString(16)).slice(-2);\n }\n }\n\n this.push = function (chunk) {\n var tag, frameStart, frameSize, frame, i, frameHeader;\n\n if (chunk.type !== 'timed-metadata') {\n return;\n } // if data_alignment_indicator is set in the PES header,\n // we must have the start of a new ID3 tag. Assume anything\n // remaining in the buffer was malformed and throw it out\n\n\n if (chunk.dataAlignmentIndicator) {\n bufferSize = 0;\n buffer.length = 0;\n } // ignore events that don't look like ID3 data\n\n\n if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== 'I'.charCodeAt(0) || chunk.data[1] !== 'D'.charCodeAt(0) || chunk.data[2] !== '3'.charCodeAt(0))) {\n this.trigger('log', {\n level: 'warn',\n message: 'Skipping unrecognized metadata packet'\n });\n return;\n } // add this chunk to the data we've collected so far\n\n\n buffer.push(chunk);\n bufferSize += chunk.data.byteLength; // grab the size of the entire frame from the ID3 header\n\n if (buffer.length === 1) {\n // the frame size is transmitted as a 28-bit integer in the\n // last four bytes of the ID3 header.\n // The most significant bit of each byte is dropped and the\n // results concatenated to recover the actual value.\n tagSize = parseSyncSafeInteger$1(chunk.data.subarray(6, 10)); // ID3 reports the tag size excluding the header but it's more\n // convenient for our comparisons to include it\n\n tagSize += 10;\n } // if the entire frame has not arrived, wait for more data\n\n\n if (bufferSize < tagSize) {\n return;\n } // collect the entire frame so it can be parsed\n\n\n tag = {\n data: new Uint8Array(tagSize),\n frames: [],\n pts: buffer[0].pts,\n dts: buffer[0].dts\n };\n\n for (i = 0; i < tagSize;) {\n tag.data.set(buffer[0].data.subarray(0, tagSize - i), i);\n i += buffer[0].data.byteLength;\n bufferSize -= buffer[0].data.byteLength;\n buffer.shift();\n } // find the start of the first frame and the end of the tag\n\n\n frameStart = 10;\n\n if (tag.data[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n\n frameStart += parseSyncSafeInteger$1(tag.data.subarray(10, 14)); // clip any padding off the end\n\n tagSize -= parseSyncSafeInteger$1(tag.data.subarray(16, 20));\n } // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger$1(tag.data.subarray(frameStart + 4, frameStart + 8));\n\n if (frameSize < 1) {\n this.trigger('log', {\n level: 'warn',\n message: 'Malformed ID3 frame encountered. Skipping metadata parsing.'\n });\n return;\n }\n\n frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);\n frame = {\n id: frameHeader,\n data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)\n };\n frame.key = frame.id;\n\n if (tagParsers[frame.id]) {\n tagParsers[frame.id](frame); // handle the special PRIV frame used to indicate the start\n // time for raw AAC data\n\n if (frame.owner === 'com.apple.streaming.transportStreamTimestamp') {\n var d = frame.data,\n size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n size *= 4;\n size += d[7] & 0x03;\n frame.timeStamp = size; // in raw AAC, all subsequent data will be timestamped based\n // on the value of this frame\n // we couldn't have known the appropriate pts and dts before\n // parsing this ID3 tag so set those values now\n\n if (tag.pts === undefined && tag.dts === undefined) {\n tag.pts = frame.timeStamp;\n tag.dts = frame.timeStamp;\n }\n\n this.trigger('timestamp', frame);\n }\n }\n\n tag.frames.push(frame);\n frameStart += 10; // advance past the frame header\n\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < tagSize);\n\n this.trigger('data', tag);\n };\n };\n\n _MetadataStream.prototype = new stream();\n var metadataStream = _MetadataStream;\n var TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream; // object types\n\n var _TransportPacketStream, _TransportParseStream, _ElementaryStream; // constants\n\n\n var MP2T_PACKET_LENGTH$1 = 188,\n // bytes\n SYNC_BYTE$1 = 0x47;\n /**\n * Splits an incoming stream of binary data into MPEG-2 Transport\n * Stream packets.\n */\n\n _TransportPacketStream = function TransportPacketStream() {\n var buffer = new Uint8Array(MP2T_PACKET_LENGTH$1),\n bytesInBuffer = 0;\n\n _TransportPacketStream.prototype.init.call(this); // Deliver new bytes to the stream.\n\n /**\n * Split a stream of data into M2TS packets\n **/\n\n\n this.push = function (bytes) {\n var startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH$1,\n everything; // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n\n if (bytesInBuffer) {\n everything = new Uint8Array(bytes.byteLength + bytesInBuffer);\n everything.set(buffer.subarray(0, bytesInBuffer));\n everything.set(bytes, bytesInBuffer);\n bytesInBuffer = 0;\n } else {\n everything = bytes;\n } // While we have enough data for a packet\n\n\n while (endIndex < everything.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (everything[startIndex] === SYNC_BYTE$1 && everything[endIndex] === SYNC_BYTE$1) {\n // We found a packet so emit it and jump one whole packet forward in\n // the stream\n this.trigger('data', everything.subarray(startIndex, endIndex));\n startIndex += MP2T_PACKET_LENGTH$1;\n endIndex += MP2T_PACKET_LENGTH$1;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n\n startIndex++;\n endIndex++;\n } // If there was some data left over at the end of the segment that couldn't\n // possibly be a whole packet, keep it because it might be the start of a packet\n // that continues in the next segment\n\n\n if (startIndex < everything.byteLength) {\n buffer.set(everything.subarray(startIndex), 0);\n bytesInBuffer = everything.byteLength - startIndex;\n }\n };\n /**\n * Passes identified M2TS packets to the TransportParseStream to be parsed\n **/\n\n\n this.flush = function () {\n // If the buffer contains a whole packet when we are being flushed, emit it\n // and empty the buffer. Otherwise hold onto the data because it may be\n // important for decoding the next segment\n if (bytesInBuffer === MP2T_PACKET_LENGTH$1 && buffer[0] === SYNC_BYTE$1) {\n this.trigger('data', buffer);\n bytesInBuffer = 0;\n }\n\n this.trigger('done');\n };\n\n this.endTimeline = function () {\n this.flush();\n this.trigger('endedtimeline');\n };\n\n this.reset = function () {\n bytesInBuffer = 0;\n this.trigger('reset');\n };\n };\n\n _TransportPacketStream.prototype = new stream();\n /**\n * Accepts an MP2T TransportPacketStream and emits data events with parsed\n * forms of the individual transport stream packets.\n */\n\n _TransportParseStream = function TransportParseStream() {\n var parsePsi, parsePat, parsePmt, self;\n\n _TransportParseStream.prototype.init.call(this);\n\n self = this;\n this.packetsWaitingForPmt = [];\n this.programMapTable = undefined;\n\n parsePsi = function parsePsi(payload, psi) {\n var offset = 0; // PSI packets may be split into multiple sections and those\n // sections may be split into multiple packets. If a PSI\n // section starts in this packet, the payload_unit_start_indicator\n // will be true and the first byte of the payload will indicate\n // the offset from the current position to the start of the\n // section.\n\n if (psi.payloadUnitStartIndicator) {\n offset += payload[offset] + 1;\n }\n\n if (psi.type === 'pat') {\n parsePat(payload.subarray(offset), psi);\n } else {\n parsePmt(payload.subarray(offset), psi);\n }\n };\n\n parsePat = function parsePat(payload, pat) {\n pat.section_number = payload[7]; // eslint-disable-line camelcase\n\n pat.last_section_number = payload[8]; // eslint-disable-line camelcase\n // skip the PSI header and parse the first PMT entry\n\n self.pmtPid = (payload[10] & 0x1F) << 8 | payload[11];\n pat.pmtPid = self.pmtPid;\n };\n /**\n * Parse out the relevant fields of a Program Map Table (PMT).\n * @param payload {Uint8Array} the PMT-specific portion of an MP2T\n * packet. The first byte in this array should be the table_id\n * field.\n * @param pmt {object} the object that should be decorated with\n * fields parsed from the PMT.\n */\n\n\n parsePmt = function parsePmt(payload, pmt) {\n var sectionLength, tableEnd, programInfoLength, offset; // PMTs can be sent ahead of the time when they should actually\n // take effect. We don't believe this should ever be the case\n // for HLS but we'll ignore \"forward\" PMT declarations if we see\n // them. Future PMT declarations have the current_next_indicator\n // set to zero.\n\n if (!(payload[5] & 0x01)) {\n return;\n } // overwrite any existing program map table\n\n\n self.programMapTable = {\n video: null,\n audio: null,\n 'timed-metadata': {}\n }; // the mapping table ends at the end of the current section\n\n sectionLength = (payload[1] & 0x0f) << 8 | payload[2];\n tableEnd = 3 + sectionLength - 4; // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n\n programInfoLength = (payload[10] & 0x0f) << 8 | payload[11]; // advance the offset to the first entry in the mapping table\n\n offset = 12 + programInfoLength;\n\n while (offset < tableEnd) {\n var streamType = payload[offset];\n var pid = (payload[offset + 1] & 0x1F) << 8 | payload[offset + 2]; // only map a single elementary_pid for audio and video stream types\n // TODO: should this be done for metadata too? for now maintain behavior of\n // multiple metadata streams\n\n if (streamType === streamTypes.H264_STREAM_TYPE && self.programMapTable.video === null) {\n self.programMapTable.video = pid;\n } else if (streamType === streamTypes.ADTS_STREAM_TYPE && self.programMapTable.audio === null) {\n self.programMapTable.audio = pid;\n } else if (streamType === streamTypes.METADATA_STREAM_TYPE) {\n // map pid to stream type for metadata streams\n self.programMapTable['timed-metadata'][pid] = streamType;\n } // move to the next table entry\n // skip past the elementary stream descriptors, if present\n\n\n offset += ((payload[offset + 3] & 0x0F) << 8 | payload[offset + 4]) + 5;\n } // record the map on the packet as well\n\n\n pmt.programMapTable = self.programMapTable;\n };\n /**\n * Deliver a new MP2T packet to the next stream in the pipeline.\n */\n\n\n this.push = function (packet) {\n var result = {},\n offset = 4;\n result.payloadUnitStartIndicator = !!(packet[1] & 0x40); // pid is a 13-bit field starting at the last bit of packet[1]\n\n result.pid = packet[1] & 0x1f;\n result.pid <<= 8;\n result.pid |= packet[2]; // if an adaption field is present, its length is specified by the\n // fifth byte of the TS packet header. The adaptation field is\n // used to add stuffing to PES packets that don't fill a complete\n // TS packet, and to specify some forms of timing and control data\n // that we do not currently use.\n\n if ((packet[3] & 0x30) >>> 4 > 0x01) {\n offset += packet[offset] + 1;\n } // parse the rest of the packet based on the type\n\n\n if (result.pid === 0) {\n result.type = 'pat';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result);\n } else if (result.pid === this.pmtPid) {\n result.type = 'pmt';\n parsePsi(packet.subarray(offset), result);\n this.trigger('data', result); // if there are any packets waiting for a PMT to be found, process them now\n\n while (this.packetsWaitingForPmt.length) {\n this.processPes_.apply(this, this.packetsWaitingForPmt.shift());\n }\n } else if (this.programMapTable === undefined) {\n // When we have not seen a PMT yet, defer further processing of\n // PES packets until one has been parsed\n this.packetsWaitingForPmt.push([packet, offset, result]);\n } else {\n this.processPes_(packet, offset, result);\n }\n };\n\n this.processPes_ = function (packet, offset, result) {\n // set the appropriate stream type\n if (result.pid === this.programMapTable.video) {\n result.streamType = streamTypes.H264_STREAM_TYPE;\n } else if (result.pid === this.programMapTable.audio) {\n result.streamType = streamTypes.ADTS_STREAM_TYPE;\n } else {\n // if not video or audio, it is timed-metadata or unknown\n // if unknown, streamType will be undefined\n result.streamType = this.programMapTable['timed-metadata'][result.pid];\n }\n\n result.type = 'pes';\n result.data = packet.subarray(offset);\n this.trigger('data', result);\n };\n };\n\n _TransportParseStream.prototype = new stream();\n _TransportParseStream.STREAM_TYPES = {\n h264: 0x1b,\n adts: 0x0f\n };\n /**\n * Reconsistutes program elementary stream (PES) packets from parsed\n * transport stream packets. That is, if you pipe an\n * mp2t.TransportParseStream into a mp2t.ElementaryStream, the output\n * events will be events which capture the bytes for individual PES\n * packets plus relevant metadata that has been extracted from the\n * container.\n */\n\n _ElementaryStream = function ElementaryStream() {\n var self = this,\n segmentHadPmt = false,\n // PES packet fragments\n video = {\n data: [],\n size: 0\n },\n audio = {\n data: [],\n size: 0\n },\n timedMetadata = {\n data: [],\n size: 0\n },\n programMapTable,\n parsePes = function parsePes(payload, pes) {\n var ptsDtsFlags;\n var startPrefix = payload[0] << 16 | payload[1] << 8 | payload[2]; // default to an empty array\n\n pes.data = new Uint8Array(); // In certain live streams, the start of a TS fragment has ts packets\n // that are frame data that is continuing from the previous fragment. This\n // is to check that the pes data is the start of a new pes payload\n\n if (startPrefix !== 1) {\n return;\n } // get the packet length, this will be 0 for video\n\n\n pes.packetLength = 6 + (payload[4] << 8 | payload[5]); // find out if this packets starts a new keyframe\n\n pes.dataAlignmentIndicator = (payload[6] & 0x04) !== 0; // PES packets may be annotated with a PTS value, or a PTS value\n // and a DTS value. Determine what combination of values is\n // available to work with.\n\n ptsDtsFlags = payload[7]; // PTS and DTS are normally stored as a 33-bit number. Javascript\n // performs all bitwise operations on 32-bit integers but javascript\n // supports a much greater range (52-bits) of integer using standard\n // mathematical operations.\n // We construct a 31-bit value using bitwise operators over the 31\n // most significant bits and then multiply by 4 (equal to a left-shift\n // of 2) before we add the final 2 least significant bits of the\n // timestamp (equal to an OR.)\n\n if (ptsDtsFlags & 0xC0) {\n // the PTS and DTS are not written out directly. For information\n // on how they are encoded, see\n // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n pes.pts = (payload[9] & 0x0E) << 27 | (payload[10] & 0xFF) << 20 | (payload[11] & 0xFE) << 12 | (payload[12] & 0xFF) << 5 | (payload[13] & 0xFE) >>> 3;\n pes.pts *= 4; // Left shift by 2\n\n pes.pts += (payload[13] & 0x06) >>> 1; // OR by the two LSBs\n\n pes.dts = pes.pts;\n\n if (ptsDtsFlags & 0x40) {\n pes.dts = (payload[14] & 0x0E) << 27 | (payload[15] & 0xFF) << 20 | (payload[16] & 0xFE) << 12 | (payload[17] & 0xFF) << 5 | (payload[18] & 0xFE) >>> 3;\n pes.dts *= 4; // Left shift by 2\n\n pes.dts += (payload[18] & 0x06) >>> 1; // OR by the two LSBs\n }\n } // the data section starts immediately after the PES header.\n // pes_header_data_length specifies the number of header bytes\n // that follow the last byte of the field.\n\n\n pes.data = payload.subarray(9 + payload[8]);\n },\n\n /**\n * Pass completely parsed PES packets to the next stream in the pipeline\n **/\n flushStream = function flushStream(stream, type, forceFlush) {\n var packetData = new Uint8Array(stream.size),\n event = {\n type: type\n },\n i = 0,\n offset = 0,\n packetFlushable = false,\n fragment; // do nothing if there is not enough buffered data for a complete\n // PES header\n\n if (!stream.data.length || stream.size < 9) {\n return;\n }\n\n event.trackId = stream.data[0].pid; // reassemble the packet\n\n for (i = 0; i < stream.data.length; i++) {\n fragment = stream.data[i];\n packetData.set(fragment.data, offset);\n offset += fragment.data.byteLength;\n } // parse assembled packet's PES header\n\n\n parsePes(packetData, event); // non-video PES packets MUST have a non-zero PES_packet_length\n // check that there is enough stream data to fill the packet\n\n packetFlushable = type === 'video' || event.packetLength <= stream.size; // flush pending packets if the conditions are right\n\n if (forceFlush || packetFlushable) {\n stream.size = 0;\n stream.data.length = 0;\n } // only emit packets that are complete. this is to avoid assembling\n // incomplete PES packets due to poor segmentation\n\n\n if (packetFlushable) {\n self.trigger('data', event);\n }\n };\n\n _ElementaryStream.prototype.init.call(this);\n /**\n * Identifies M2TS packet types and parses PES packets using metadata\n * parsed from the PMT\n **/\n\n\n this.push = function (data) {\n ({\n pat: function pat() {// we have to wait for the PMT to arrive as well before we\n // have any meaningful metadata\n },\n pes: function pes() {\n var stream, streamType;\n\n switch (data.streamType) {\n case streamTypes.H264_STREAM_TYPE:\n stream = video;\n streamType = 'video';\n break;\n\n case streamTypes.ADTS_STREAM_TYPE:\n stream = audio;\n streamType = 'audio';\n break;\n\n case streamTypes.METADATA_STREAM_TYPE:\n stream = timedMetadata;\n streamType = 'timed-metadata';\n break;\n\n default:\n // ignore unknown stream types\n return;\n } // if a new packet is starting, we can flush the completed\n // packet\n\n\n if (data.payloadUnitStartIndicator) {\n flushStream(stream, streamType, true);\n } // buffer this fragment until we are sure we've received the\n // complete payload\n\n\n stream.data.push(data);\n stream.size += data.data.byteLength;\n },\n pmt: function pmt() {\n var event = {\n type: 'metadata',\n tracks: []\n };\n programMapTable = data.programMapTable; // translate audio and video streams to tracks\n\n if (programMapTable.video !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.video,\n codec: 'avc',\n type: 'video'\n });\n }\n\n if (programMapTable.audio !== null) {\n event.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.audio,\n codec: 'adts',\n type: 'audio'\n });\n }\n\n segmentHadPmt = true;\n self.trigger('data', event);\n }\n })[data.type]();\n };\n\n this.reset = function () {\n video.size = 0;\n video.data.length = 0;\n audio.size = 0;\n audio.data.length = 0;\n this.trigger('reset');\n };\n /**\n * Flush any remaining input. Video PES packets may be of variable\n * length. Normally, the start of a new video packet can trigger the\n * finalization of the previous packet. That is not possible if no\n * more video is forthcoming, however. In that case, some other\n * mechanism (like the end of the file) has to be employed. When it is\n * clear that no additional data is forthcoming, calling this method\n * will flush the buffered packets.\n */\n\n\n this.flushStreams_ = function () {\n // !!THIS ORDER IS IMPORTANT!!\n // video first then audio\n flushStream(video, 'video');\n flushStream(audio, 'audio');\n flushStream(timedMetadata, 'timed-metadata');\n };\n\n this.flush = function () {\n // if on flush we haven't had a pmt emitted\n // and we have a pmt to emit. emit the pmt\n // so that we trigger a trackinfo downstream.\n if (!segmentHadPmt && programMapTable) {\n var pmt = {\n type: 'metadata',\n tracks: []\n }; // translate audio and video streams to tracks\n\n if (programMapTable.video !== null) {\n pmt.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.video,\n codec: 'avc',\n type: 'video'\n });\n }\n\n if (programMapTable.audio !== null) {\n pmt.tracks.push({\n timelineStartInfo: {\n baseMediaDecodeTime: 0\n },\n id: +programMapTable.audio,\n codec: 'adts',\n type: 'audio'\n });\n }\n\n self.trigger('data', pmt);\n }\n\n segmentHadPmt = false;\n this.flushStreams_();\n this.trigger('done');\n };\n };\n\n _ElementaryStream.prototype = new stream();\n var m2ts = {\n PAT_PID: 0x0000,\n MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH$1,\n TransportPacketStream: _TransportPacketStream,\n TransportParseStream: _TransportParseStream,\n ElementaryStream: _ElementaryStream,\n TimestampRolloverStream: TimestampRolloverStream,\n CaptionStream: captionStream.CaptionStream,\n Cea608Stream: captionStream.Cea608Stream,\n Cea708Stream: captionStream.Cea708Stream,\n MetadataStream: metadataStream\n };\n\n for (var type in streamTypes) {\n if (streamTypes.hasOwnProperty(type)) {\n m2ts[type] = streamTypes[type];\n }\n }\n\n var m2ts_1 = m2ts;\n var ONE_SECOND_IN_TS$2 = clock.ONE_SECOND_IN_TS;\n\n var _AdtsStream;\n\n var ADTS_SAMPLING_FREQUENCIES$1 = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n /*\n * Accepts a ElementaryStream and emits data events with parsed\n * AAC Audio Frames of the individual packets. Input audio in ADTS\n * format is unpacked and re-emitted as AAC frames.\n *\n * @see http://wiki.multimedia.cx/index.php?title=ADTS\n * @see http://wiki.multimedia.cx/?title=Understanding_AAC\n */\n\n _AdtsStream = function AdtsStream(handlePartialSegments) {\n var buffer,\n frameNum = 0;\n\n _AdtsStream.prototype.init.call(this);\n\n this.skipWarn_ = function (start, end) {\n this.trigger('log', {\n level: 'warn',\n message: \"adts skiping bytes \" + start + \" to \" + end + \" in frame \" + frameNum + \" outside syncword\"\n });\n };\n\n this.push = function (packet) {\n var i = 0,\n frameLength,\n protectionSkipBytes,\n oldBuffer,\n sampleCount,\n adtsFrameDuration;\n\n if (!handlePartialSegments) {\n frameNum = 0;\n }\n\n if (packet.type !== 'audio') {\n // ignore non-audio data\n return;\n } // Prepend any data in the buffer to the input data so that we can parse\n // aac frames the cross a PES packet boundary\n\n\n if (buffer && buffer.length) {\n oldBuffer = buffer;\n buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);\n buffer.set(oldBuffer);\n buffer.set(packet.data, oldBuffer.byteLength);\n } else {\n buffer = packet.data;\n } // unpack any ADTS frames which have been fully received\n // for details on the ADTS header, see http://wiki.multimedia.cx/index.php?title=ADTS\n\n\n var skip; // We use i + 7 here because we want to be able to parse the entire header.\n // If we don't have enough bytes to do that, then we definitely won't have a full frame.\n\n while (i + 7 < buffer.length) {\n // Look for the start of an ADTS header..\n if (buffer[i] !== 0xFF || (buffer[i + 1] & 0xF6) !== 0xF0) {\n if (typeof skip !== 'number') {\n skip = i;\n } // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n\n\n i++;\n continue;\n }\n\n if (typeof skip === 'number') {\n this.skipWarn_(skip, i);\n skip = null;\n } // The protection skip bit tells us if we have 2 bytes of CRC data at the\n // end of the ADTS header\n\n\n protectionSkipBytes = (~buffer[i + 1] & 0x01) * 2; // Frame length is a 13 bit integer starting 16 bits from the\n // end of the sync sequence\n // NOTE: frame length includes the size of the header\n\n frameLength = (buffer[i + 3] & 0x03) << 11 | buffer[i + 4] << 3 | (buffer[i + 5] & 0xe0) >> 5;\n sampleCount = ((buffer[i + 6] & 0x03) + 1) * 1024;\n adtsFrameDuration = sampleCount * ONE_SECOND_IN_TS$2 / ADTS_SAMPLING_FREQUENCIES$1[(buffer[i + 2] & 0x3c) >>> 2]; // If we don't have enough data to actually finish this ADTS frame,\n // then we have to wait for more data\n\n if (buffer.byteLength - i < frameLength) {\n break;\n } // Otherwise, deliver the complete AAC frame\n\n\n this.trigger('data', {\n pts: packet.pts + frameNum * adtsFrameDuration,\n dts: packet.dts + frameNum * adtsFrameDuration,\n sampleCount: sampleCount,\n audioobjecttype: (buffer[i + 2] >>> 6 & 0x03) + 1,\n channelcount: (buffer[i + 2] & 1) << 2 | (buffer[i + 3] & 0xc0) >>> 6,\n samplerate: ADTS_SAMPLING_FREQUENCIES$1[(buffer[i + 2] & 0x3c) >>> 2],\n samplingfrequencyindex: (buffer[i + 2] & 0x3c) >>> 2,\n // assume ISO/IEC 14496-12 AudioSampleEntry default of 16\n samplesize: 16,\n // data is the frame without it's header\n data: buffer.subarray(i + 7 + protectionSkipBytes, i + frameLength)\n });\n frameNum++;\n i += frameLength;\n }\n\n if (typeof skip === 'number') {\n this.skipWarn_(skip, i);\n skip = null;\n } // remove processed bytes from the buffer.\n\n\n buffer = buffer.subarray(i);\n };\n\n this.flush = function () {\n frameNum = 0;\n this.trigger('done');\n };\n\n this.reset = function () {\n buffer = void 0;\n this.trigger('reset');\n };\n\n this.endTimeline = function () {\n buffer = void 0;\n this.trigger('endedtimeline');\n };\n };\n\n _AdtsStream.prototype = new stream();\n var adts = _AdtsStream;\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var ExpGolomb;\n /**\n * Parser for exponential Golomb codes, a variable-bitwidth number encoding\n * scheme used by h264.\n */\n\n ExpGolomb = function ExpGolomb(workingData) {\n var // the number of bytes left to examine in workingData\n workingBytesAvailable = workingData.byteLength,\n // the current word being examined\n workingWord = 0,\n // :uint\n // the number of bits left to examine in the current word\n workingBitsAvailable = 0; // :uint;\n // ():uint\n\n this.length = function () {\n return 8 * workingBytesAvailable;\n }; // ():uint\n\n\n this.bitsAvailable = function () {\n return 8 * workingBytesAvailable + workingBitsAvailable;\n }; // ():void\n\n\n this.loadWord = function () {\n var position = workingData.byteLength - workingBytesAvailable,\n workingBytes = new Uint8Array(4),\n availableBytes = Math.min(4, workingBytesAvailable);\n\n if (availableBytes === 0) {\n throw new Error('no bytes available');\n }\n\n workingBytes.set(workingData.subarray(position, position + availableBytes));\n workingWord = new DataView(workingBytes.buffer).getUint32(0); // track the amount of workingData that has been processed\n\n workingBitsAvailable = availableBytes * 8;\n workingBytesAvailable -= availableBytes;\n }; // (count:int):void\n\n\n this.skipBits = function (count) {\n var skipBytes; // :int\n\n if (workingBitsAvailable > count) {\n workingWord <<= count;\n workingBitsAvailable -= count;\n } else {\n count -= workingBitsAvailable;\n skipBytes = Math.floor(count / 8);\n count -= skipBytes * 8;\n workingBytesAvailable -= skipBytes;\n this.loadWord();\n workingWord <<= count;\n workingBitsAvailable -= count;\n }\n }; // (size:int):uint\n\n\n this.readBits = function (size) {\n var bits = Math.min(workingBitsAvailable, size),\n // :uint\n valu = workingWord >>> 32 - bits; // :uint\n // if size > 31, handle error\n\n workingBitsAvailable -= bits;\n\n if (workingBitsAvailable > 0) {\n workingWord <<= bits;\n } else if (workingBytesAvailable > 0) {\n this.loadWord();\n }\n\n bits = size - bits;\n\n if (bits > 0) {\n return valu << bits | this.readBits(bits);\n }\n\n return valu;\n }; // ():uint\n\n\n this.skipLeadingZeros = function () {\n var leadingZeroCount; // :uint\n\n for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {\n if ((workingWord & 0x80000000 >>> leadingZeroCount) !== 0) {\n // the first bit of working word is 1\n workingWord <<= leadingZeroCount;\n workingBitsAvailable -= leadingZeroCount;\n return leadingZeroCount;\n }\n } // we exhausted workingWord and still have not found a 1\n\n\n this.loadWord();\n return leadingZeroCount + this.skipLeadingZeros();\n }; // ():void\n\n\n this.skipUnsignedExpGolomb = function () {\n this.skipBits(1 + this.skipLeadingZeros());\n }; // ():void\n\n\n this.skipExpGolomb = function () {\n this.skipBits(1 + this.skipLeadingZeros());\n }; // ():uint\n\n\n this.readUnsignedExpGolomb = function () {\n var clz = this.skipLeadingZeros(); // :uint\n\n return this.readBits(clz + 1) - 1;\n }; // ():int\n\n\n this.readExpGolomb = function () {\n var valu = this.readUnsignedExpGolomb(); // :int\n\n if (0x01 & valu) {\n // the number is odd if the low order bit is set\n return 1 + valu >>> 1; // add 1 to make it even, and divide by 2\n }\n\n return -1 * (valu >>> 1); // divide by two then make it negative\n }; // Some convenience functions\n // :Boolean\n\n\n this.readBoolean = function () {\n return this.readBits(1) === 1;\n }; // ():int\n\n\n this.readUnsignedByte = function () {\n return this.readBits(8);\n };\n\n this.loadWord();\n };\n\n var expGolomb = ExpGolomb;\n\n var _H264Stream, _NalByteStream;\n\n var PROFILES_WITH_OPTIONAL_SPS_DATA;\n /**\n * Accepts a NAL unit byte stream and unpacks the embedded NAL units.\n */\n\n _NalByteStream = function NalByteStream() {\n var syncPoint = 0,\n i,\n buffer;\n\n _NalByteStream.prototype.init.call(this);\n /*\n * Scans a byte stream and triggers a data event with the NAL units found.\n * @param {Object} data Event received from H264Stream\n * @param {Uint8Array} data.data The h264 byte stream to be scanned\n *\n * @see H264Stream.push\n */\n\n\n this.push = function (data) {\n var swapBuffer;\n\n if (!buffer) {\n buffer = data.data;\n } else {\n swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);\n swapBuffer.set(buffer);\n swapBuffer.set(data.data, buffer.byteLength);\n buffer = swapBuffer;\n }\n\n var len = buffer.byteLength; // Rec. ITU-T H.264, Annex B\n // scan for NAL unit boundaries\n // a match looks like this:\n // 0 0 1 .. NAL .. 0 0 1\n // ^ sync point ^ i\n // or this:\n // 0 0 1 .. NAL .. 0 0 0\n // ^ sync point ^ i\n // advance the sync point to a NAL start, if necessary\n\n for (; syncPoint < len - 3; syncPoint++) {\n if (buffer[syncPoint + 2] === 1) {\n // the sync point is properly aligned\n i = syncPoint + 5;\n break;\n }\n }\n\n while (i < len) {\n // look at the current byte to determine if we've hit the end of\n // a NAL unit boundary\n switch (buffer[i]) {\n case 0:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0) {\n i += 2;\n break;\n } else if (buffer[i - 2] !== 0) {\n i++;\n break;\n } // deliver the NAL unit if it isn't empty\n\n\n if (syncPoint + 3 !== i - 2) {\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n } // drop trailing zeroes\n\n\n do {\n i++;\n } while (buffer[i] !== 1 && i < len);\n\n syncPoint = i - 2;\n i += 3;\n break;\n\n case 1:\n // skip past non-sync sequences\n if (buffer[i - 1] !== 0 || buffer[i - 2] !== 0) {\n i += 3;\n break;\n } // deliver the NAL unit\n\n\n this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));\n syncPoint = i - 2;\n i += 3;\n break;\n\n default:\n // the current byte isn't a one or zero, so it cannot be part\n // of a sync sequence\n i += 3;\n break;\n }\n } // filter out the NAL units that were delivered\n\n\n buffer = buffer.subarray(syncPoint);\n i -= syncPoint;\n syncPoint = 0;\n };\n\n this.reset = function () {\n buffer = null;\n syncPoint = 0;\n this.trigger('reset');\n };\n\n this.flush = function () {\n // deliver the last buffered NAL unit\n if (buffer && buffer.byteLength > 3) {\n this.trigger('data', buffer.subarray(syncPoint + 3));\n } // reset the stream state\n\n\n buffer = null;\n syncPoint = 0;\n this.trigger('done');\n };\n\n this.endTimeline = function () {\n this.flush();\n this.trigger('endedtimeline');\n };\n };\n\n _NalByteStream.prototype = new stream(); // values of profile_idc that indicate additional fields are included in the SPS\n // see Recommendation ITU-T H.264 (4/2013),\n // 7.3.2.1.1 Sequence parameter set data syntax\n\n PROFILES_WITH_OPTIONAL_SPS_DATA = {\n 100: true,\n 110: true,\n 122: true,\n 244: true,\n 44: true,\n 83: true,\n 86: true,\n 118: true,\n 128: true,\n // TODO: the three profiles below don't\n // appear to have sps data in the specificiation anymore?\n 138: true,\n 139: true,\n 134: true\n };\n /**\n * Accepts input from a ElementaryStream and produces H.264 NAL unit data\n * events.\n */\n\n _H264Stream = function H264Stream() {\n var nalByteStream = new _NalByteStream(),\n self,\n trackId,\n currentPts,\n currentDts,\n discardEmulationPreventionBytes,\n readSequenceParameterSet,\n skipScalingList;\n\n _H264Stream.prototype.init.call(this);\n\n self = this;\n /*\n * Pushes a packet from a stream onto the NalByteStream\n *\n * @param {Object} packet - A packet received from a stream\n * @param {Uint8Array} packet.data - The raw bytes of the packet\n * @param {Number} packet.dts - Decode timestamp of the packet\n * @param {Number} packet.pts - Presentation timestamp of the packet\n * @param {Number} packet.trackId - The id of the h264 track this packet came from\n * @param {('video'|'audio')} packet.type - The type of packet\n *\n */\n\n this.push = function (packet) {\n if (packet.type !== 'video') {\n return;\n }\n\n trackId = packet.trackId;\n currentPts = packet.pts;\n currentDts = packet.dts;\n nalByteStream.push(packet);\n };\n /*\n * Identify NAL unit types and pass on the NALU, trackId, presentation and decode timestamps\n * for the NALUs to the next stream component.\n * Also, preprocess caption and sequence parameter NALUs.\n *\n * @param {Uint8Array} data - A NAL unit identified by `NalByteStream.push`\n * @see NalByteStream.push\n */\n\n\n nalByteStream.on('data', function (data) {\n var event = {\n trackId: trackId,\n pts: currentPts,\n dts: currentDts,\n data: data,\n nalUnitTypeCode: data[0] & 0x1f\n };\n\n switch (event.nalUnitTypeCode) {\n case 0x05:\n event.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr';\n break;\n\n case 0x06:\n event.nalUnitType = 'sei_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n break;\n\n case 0x07:\n event.nalUnitType = 'seq_parameter_set_rbsp';\n event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));\n event.config = readSequenceParameterSet(event.escapedRBSP);\n break;\n\n case 0x08:\n event.nalUnitType = 'pic_parameter_set_rbsp';\n break;\n\n case 0x09:\n event.nalUnitType = 'access_unit_delimiter_rbsp';\n break;\n } // This triggers data on the H264Stream\n\n\n self.trigger('data', event);\n });\n nalByteStream.on('done', function () {\n self.trigger('done');\n });\n nalByteStream.on('partialdone', function () {\n self.trigger('partialdone');\n });\n nalByteStream.on('reset', function () {\n self.trigger('reset');\n });\n nalByteStream.on('endedtimeline', function () {\n self.trigger('endedtimeline');\n });\n\n this.flush = function () {\n nalByteStream.flush();\n };\n\n this.partialFlush = function () {\n nalByteStream.partialFlush();\n };\n\n this.reset = function () {\n nalByteStream.reset();\n };\n\n this.endTimeline = function () {\n nalByteStream.endTimeline();\n };\n /**\n * Advance the ExpGolomb decoder past a scaling list. The scaling\n * list is optionally transmitted as part of a sequence parameter\n * set and is not relevant to transmuxing.\n * @param count {number} the number of entries in this scaling list\n * @param expGolombDecoder {object} an ExpGolomb pointed to the\n * start of a scaling list\n * @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1\n */\n\n\n skipScalingList = function skipScalingList(count, expGolombDecoder) {\n var lastScale = 8,\n nextScale = 8,\n j,\n deltaScale;\n\n for (j = 0; j < count; j++) {\n if (nextScale !== 0) {\n deltaScale = expGolombDecoder.readExpGolomb();\n nextScale = (lastScale + deltaScale + 256) % 256;\n }\n\n lastScale = nextScale === 0 ? lastScale : nextScale;\n }\n };\n /**\n * Expunge any \"Emulation Prevention\" bytes from a \"Raw Byte\n * Sequence Payload\"\n * @param data {Uint8Array} the bytes of a RBSP from a NAL\n * unit\n * @return {Uint8Array} the RBSP without any Emulation\n * Prevention Bytes\n */\n\n\n discardEmulationPreventionBytes = function discardEmulationPreventionBytes(data) {\n var length = data.byteLength,\n emulationPreventionBytesPositions = [],\n i = 1,\n newLength,\n newData; // Find all `Emulation Prevention Bytes`\n\n while (i < length - 2) {\n if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {\n emulationPreventionBytesPositions.push(i + 2);\n i += 2;\n } else {\n i++;\n }\n } // If no Emulation Prevention Bytes were found just return the original\n // array\n\n\n if (emulationPreventionBytesPositions.length === 0) {\n return data;\n } // Create a new array to hold the NAL unit data\n\n\n newLength = length - emulationPreventionBytesPositions.length;\n newData = new Uint8Array(newLength);\n var sourceIndex = 0;\n\n for (i = 0; i < newLength; sourceIndex++, i++) {\n if (sourceIndex === emulationPreventionBytesPositions[0]) {\n // Skip this byte\n sourceIndex++; // Remove this position index\n\n emulationPreventionBytesPositions.shift();\n }\n\n newData[i] = data[sourceIndex];\n }\n\n return newData;\n };\n /**\n * Read a sequence parameter set and return some interesting video\n * properties. A sequence parameter set is the H264 metadata that\n * describes the properties of upcoming video frames.\n * @param data {Uint8Array} the bytes of a sequence parameter set\n * @return {object} an object with configuration parsed from the\n * sequence parameter set, including the dimensions of the\n * associated video frames.\n */\n\n\n readSequenceParameterSet = function readSequenceParameterSet(data) {\n var frameCropLeftOffset = 0,\n frameCropRightOffset = 0,\n frameCropTopOffset = 0,\n frameCropBottomOffset = 0,\n expGolombDecoder,\n profileIdc,\n levelIdc,\n profileCompatibility,\n chromaFormatIdc,\n picOrderCntType,\n numRefFramesInPicOrderCntCycle,\n picWidthInMbsMinus1,\n picHeightInMapUnitsMinus1,\n frameMbsOnlyFlag,\n scalingListCount,\n sarRatio = [1, 1],\n aspectRatioIdc,\n i;\n expGolombDecoder = new expGolomb(data);\n profileIdc = expGolombDecoder.readUnsignedByte(); // profile_idc\n\n profileCompatibility = expGolombDecoder.readUnsignedByte(); // constraint_set[0-5]_flag\n\n levelIdc = expGolombDecoder.readUnsignedByte(); // level_idc u(8)\n\n expGolombDecoder.skipUnsignedExpGolomb(); // seq_parameter_set_id\n // some profiles have more optional data we don't need\n\n if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {\n chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();\n\n if (chromaFormatIdc === 3) {\n expGolombDecoder.skipBits(1); // separate_colour_plane_flag\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_luma_minus8\n\n expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_chroma_minus8\n\n expGolombDecoder.skipBits(1); // qpprime_y_zero_transform_bypass_flag\n\n if (expGolombDecoder.readBoolean()) {\n // seq_scaling_matrix_present_flag\n scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;\n\n for (i = 0; i < scalingListCount; i++) {\n if (expGolombDecoder.readBoolean()) {\n // seq_scaling_list_present_flag[ i ]\n if (i < 6) {\n skipScalingList(16, expGolombDecoder);\n } else {\n skipScalingList(64, expGolombDecoder);\n }\n }\n }\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // log2_max_frame_num_minus4\n\n picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();\n\n if (picOrderCntType === 0) {\n expGolombDecoder.readUnsignedExpGolomb(); // log2_max_pic_order_cnt_lsb_minus4\n } else if (picOrderCntType === 1) {\n expGolombDecoder.skipBits(1); // delta_pic_order_always_zero_flag\n\n expGolombDecoder.skipExpGolomb(); // offset_for_non_ref_pic\n\n expGolombDecoder.skipExpGolomb(); // offset_for_top_to_bottom_field\n\n numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();\n\n for (i = 0; i < numRefFramesInPicOrderCntCycle; i++) {\n expGolombDecoder.skipExpGolomb(); // offset_for_ref_frame[ i ]\n }\n }\n\n expGolombDecoder.skipUnsignedExpGolomb(); // max_num_ref_frames\n\n expGolombDecoder.skipBits(1); // gaps_in_frame_num_value_allowed_flag\n\n picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();\n frameMbsOnlyFlag = expGolombDecoder.readBits(1);\n\n if (frameMbsOnlyFlag === 0) {\n expGolombDecoder.skipBits(1); // mb_adaptive_frame_field_flag\n }\n\n expGolombDecoder.skipBits(1); // direct_8x8_inference_flag\n\n if (expGolombDecoder.readBoolean()) {\n // frame_cropping_flag\n frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();\n frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();\n }\n\n if (expGolombDecoder.readBoolean()) {\n // vui_parameters_present_flag\n if (expGolombDecoder.readBoolean()) {\n // aspect_ratio_info_present_flag\n aspectRatioIdc = expGolombDecoder.readUnsignedByte();\n\n switch (aspectRatioIdc) {\n case 1:\n sarRatio = [1, 1];\n break;\n\n case 2:\n sarRatio = [12, 11];\n break;\n\n case 3:\n sarRatio = [10, 11];\n break;\n\n case 4:\n sarRatio = [16, 11];\n break;\n\n case 5:\n sarRatio = [40, 33];\n break;\n\n case 6:\n sarRatio = [24, 11];\n break;\n\n case 7:\n sarRatio = [20, 11];\n break;\n\n case 8:\n sarRatio = [32, 11];\n break;\n\n case 9:\n sarRatio = [80, 33];\n break;\n\n case 10:\n sarRatio = [18, 11];\n break;\n\n case 11:\n sarRatio = [15, 11];\n break;\n\n case 12:\n sarRatio = [64, 33];\n break;\n\n case 13:\n sarRatio = [160, 99];\n break;\n\n case 14:\n sarRatio = [4, 3];\n break;\n\n case 15:\n sarRatio = [3, 2];\n break;\n\n case 16:\n sarRatio = [2, 1];\n break;\n\n case 255:\n {\n sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];\n break;\n }\n }\n\n if (sarRatio) {\n sarRatio[0] / sarRatio[1];\n }\n }\n }\n\n return {\n profileIdc: profileIdc,\n levelIdc: levelIdc,\n profileCompatibility: profileCompatibility,\n width: (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2,\n height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2,\n // sar is sample aspect ratio\n sarRatio: sarRatio\n };\n };\n };\n\n _H264Stream.prototype = new stream();\n var h264 = {\n H264Stream: _H264Stream,\n NalByteStream: _NalByteStream\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n *\n * Utilities to detect basic properties and metadata about Aac data.\n */\n\n var ADTS_SAMPLING_FREQUENCIES = [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350];\n\n var parseId3TagSize = function parseId3TagSize(header, byteIndex) {\n var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9],\n flags = header[byteIndex + 5],\n footerPresent = (flags & 16) >> 4; // if we get a negative returnSize clamp it to 0\n\n returnSize = returnSize >= 0 ? returnSize : 0;\n\n if (footerPresent) {\n return returnSize + 20;\n }\n\n return returnSize + 10;\n };\n\n var getId3Offset = function getId3Offset(data, offset) {\n if (data.length - offset < 10 || data[offset] !== 'I'.charCodeAt(0) || data[offset + 1] !== 'D'.charCodeAt(0) || data[offset + 2] !== '3'.charCodeAt(0)) {\n return offset;\n }\n\n offset += parseId3TagSize(data, offset);\n return getId3Offset(data, offset);\n }; // TODO: use vhs-utils\n\n\n var isLikelyAacData$1 = function isLikelyAacData(data) {\n var offset = getId3Offset(data, 0);\n return data.length >= offset + 2 && (data[offset] & 0xFF) === 0xFF && (data[offset + 1] & 0xF0) === 0xF0 && // verify that the 2 layer bits are 0, aka this\n // is not mp3 data but aac data.\n (data[offset + 1] & 0x16) === 0x10;\n };\n\n var parseSyncSafeInteger = function parseSyncSafeInteger(data) {\n return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];\n }; // return a percent-encoded representation of the specified byte range\n // @see http://en.wikipedia.org/wiki/Percent-encoding\n\n\n var percentEncode = function percentEncode(bytes, start, end) {\n var i,\n result = '';\n\n for (i = start; i < end; i++) {\n result += '%' + ('00' + bytes[i].toString(16)).slice(-2);\n }\n\n return result;\n }; // return the string representation of the specified byte range,\n // interpreted as ISO-8859-1.\n\n\n var parseIso88591 = function parseIso88591(bytes, start, end) {\n return unescape(percentEncode(bytes, start, end)); // jshint ignore:line\n };\n\n var parseAdtsSize = function parseAdtsSize(header, byteIndex) {\n var lowThree = (header[byteIndex + 5] & 0xE0) >> 5,\n middle = header[byteIndex + 4] << 3,\n highTwo = header[byteIndex + 3] & 0x3 << 11;\n return highTwo | middle | lowThree;\n };\n\n var parseType$2 = function parseType(header, byteIndex) {\n if (header[byteIndex] === 'I'.charCodeAt(0) && header[byteIndex + 1] === 'D'.charCodeAt(0) && header[byteIndex + 2] === '3'.charCodeAt(0)) {\n return 'timed-metadata';\n } else if (header[byteIndex] & 0xff === 0xff && (header[byteIndex + 1] & 0xf0) === 0xf0) {\n return 'audio';\n }\n\n return null;\n };\n\n var parseSampleRate = function parseSampleRate(packet) {\n var i = 0;\n\n while (i + 5 < packet.length) {\n if (packet[i] !== 0xFF || (packet[i + 1] & 0xF6) !== 0xF0) {\n // If a valid header was not found, jump one forward and attempt to\n // find a valid ADTS header starting at the next byte\n i++;\n continue;\n }\n\n return ADTS_SAMPLING_FREQUENCIES[(packet[i + 2] & 0x3c) >>> 2];\n }\n\n return null;\n };\n\n var parseAacTimestamp = function parseAacTimestamp(packet) {\n var frameStart, frameSize, frame, frameHeader; // find the start of the first frame and the end of the tag\n\n frameStart = 10;\n\n if (packet[5] & 0x40) {\n // advance the frame start past the extended header\n frameStart += 4; // header size field\n\n frameStart += parseSyncSafeInteger(packet.subarray(10, 14));\n } // parse one or more ID3 frames\n // http://id3.org/id3v2.3.0#ID3v2_frame_overview\n\n\n do {\n // determine the number of bytes in this frame\n frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));\n\n if (frameSize < 1) {\n return null;\n }\n\n frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);\n\n if (frameHeader === 'PRIV') {\n frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);\n\n for (var i = 0; i < frame.byteLength; i++) {\n if (frame[i] === 0) {\n var owner = parseIso88591(frame, 0, i);\n\n if (owner === 'com.apple.streaming.transportStreamTimestamp') {\n var d = frame.subarray(i + 1);\n var size = (d[3] & 0x01) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2;\n size *= 4;\n size += d[7] & 0x03;\n return size;\n }\n\n break;\n }\n }\n }\n\n frameStart += 10; // advance past the frame header\n\n frameStart += frameSize; // advance past the frame body\n } while (frameStart < packet.byteLength);\n\n return null;\n };\n\n var utils = {\n isLikelyAacData: isLikelyAacData$1,\n parseId3TagSize: parseId3TagSize,\n parseAdtsSize: parseAdtsSize,\n parseType: parseType$2,\n parseSampleRate: parseSampleRate,\n parseAacTimestamp: parseAacTimestamp\n };\n\n var _AacStream;\n /**\n * Splits an incoming stream of binary data into ADTS and ID3 Frames.\n */\n\n\n _AacStream = function AacStream() {\n var everything = new Uint8Array(),\n timeStamp = 0;\n\n _AacStream.prototype.init.call(this);\n\n this.setTimestamp = function (timestamp) {\n timeStamp = timestamp;\n };\n\n this.push = function (bytes) {\n var frameSize = 0,\n byteIndex = 0,\n bytesLeft,\n chunk,\n packet,\n tempLength; // If there are bytes remaining from the last segment, prepend them to the\n // bytes that were pushed in\n\n if (everything.length) {\n tempLength = everything.length;\n everything = new Uint8Array(bytes.byteLength + tempLength);\n everything.set(everything.subarray(0, tempLength));\n everything.set(bytes, tempLength);\n } else {\n everything = bytes;\n }\n\n while (everything.length - byteIndex >= 3) {\n if (everything[byteIndex] === 'I'.charCodeAt(0) && everything[byteIndex + 1] === 'D'.charCodeAt(0) && everything[byteIndex + 2] === '3'.charCodeAt(0)) {\n // Exit early because we don't have enough to parse\n // the ID3 tag header\n if (everything.length - byteIndex < 10) {\n break;\n } // check framesize\n\n\n frameSize = utils.parseId3TagSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n // Add to byteIndex to support multiple ID3 tags in sequence\n\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n\n chunk = {\n type: 'timed-metadata',\n data: everything.subarray(byteIndex, byteIndex + frameSize)\n };\n this.trigger('data', chunk);\n byteIndex += frameSize;\n continue;\n } else if ((everything[byteIndex] & 0xff) === 0xff && (everything[byteIndex + 1] & 0xf0) === 0xf0) {\n // Exit early because we don't have enough to parse\n // the ADTS frame header\n if (everything.length - byteIndex < 7) {\n break;\n }\n\n frameSize = utils.parseAdtsSize(everything, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n\n if (byteIndex + frameSize > everything.length) {\n break;\n }\n\n packet = {\n type: 'audio',\n data: everything.subarray(byteIndex, byteIndex + frameSize),\n pts: timeStamp,\n dts: timeStamp\n };\n this.trigger('data', packet);\n byteIndex += frameSize;\n continue;\n }\n\n byteIndex++;\n }\n\n bytesLeft = everything.length - byteIndex;\n\n if (bytesLeft > 0) {\n everything = everything.subarray(byteIndex);\n } else {\n everything = new Uint8Array();\n }\n };\n\n this.reset = function () {\n everything = new Uint8Array();\n this.trigger('reset');\n };\n\n this.endTimeline = function () {\n everything = new Uint8Array();\n this.trigger('endedtimeline');\n };\n };\n\n _AacStream.prototype = new stream();\n var aac = _AacStream; // constants\n\n var AUDIO_PROPERTIES = ['audioobjecttype', 'channelcount', 'samplerate', 'samplingfrequencyindex', 'samplesize'];\n var audioProperties = AUDIO_PROPERTIES;\n var VIDEO_PROPERTIES = ['width', 'height', 'profileIdc', 'levelIdc', 'profileCompatibility', 'sarRatio'];\n var videoProperties = VIDEO_PROPERTIES;\n var H264Stream = h264.H264Stream;\n var isLikelyAacData = utils.isLikelyAacData;\n var ONE_SECOND_IN_TS$1 = clock.ONE_SECOND_IN_TS; // object types\n\n var _VideoSegmentStream, _AudioSegmentStream, _Transmuxer, _CoalesceStream;\n /**\n * Compare two arrays (even typed) for same-ness\n */\n\n\n var arrayEquals = function arrayEquals(a, b) {\n var i;\n\n if (a.length !== b.length) {\n return false;\n } // compare the value of each element in the array\n\n\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n };\n\n var generateSegmentTimingInfo = function generateSegmentTimingInfo(baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) {\n var ptsOffsetFromDts = startPts - startDts,\n decodeDuration = endDts - startDts,\n presentationDuration = endPts - startPts; // The PTS and DTS values are based on the actual stream times from the segment,\n // however, the player time values will reflect a start from the baseMediaDecodeTime.\n // In order to provide relevant values for the player times, base timing info on the\n // baseMediaDecodeTime and the DTS and PTS durations of the segment.\n\n return {\n start: {\n dts: baseMediaDecodeTime,\n pts: baseMediaDecodeTime + ptsOffsetFromDts\n },\n end: {\n dts: baseMediaDecodeTime + decodeDuration,\n pts: baseMediaDecodeTime + presentationDuration\n },\n prependedContentDuration: prependedContentDuration,\n baseMediaDecodeTime: baseMediaDecodeTime\n };\n };\n /**\n * Constructs a single-track, ISO BMFF media segment from AAC data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n\n _AudioSegmentStream = function AudioSegmentStream(track, options) {\n var adtsFrames = [],\n sequenceNumber,\n earliestAllowedDts = 0,\n audioAppendStartTs = 0,\n videoBaseMediaDecodeTime = Infinity;\n options = options || {};\n sequenceNumber = options.firstSequenceNumber || 0;\n\n _AudioSegmentStream.prototype.init.call(this);\n\n this.push = function (data) {\n trackDecodeInfo.collectDtsInfo(track, data);\n\n if (track) {\n audioProperties.forEach(function (prop) {\n track[prop] = data[prop];\n });\n } // buffer audio data until end() is called\n\n\n adtsFrames.push(data);\n };\n\n this.setEarliestDts = function (earliestDts) {\n earliestAllowedDts = earliestDts;\n };\n\n this.setVideoBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n videoBaseMediaDecodeTime = baseMediaDecodeTime;\n };\n\n this.setAudioAppendStart = function (timestamp) {\n audioAppendStartTs = timestamp;\n };\n\n this.flush = function () {\n var frames, moof, mdat, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed; // return early if no audio data has been observed\n\n if (adtsFrames.length === 0) {\n this.trigger('done', 'AudioSegmentStream');\n return;\n }\n\n frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps); // amount of audio filled but the value is in video clock rather than audio clock\n\n videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime); // we have to build the index from byte locations to\n // samples (that is, adts frames) in the audio data\n\n track.samples = audioFrameUtils.generateSampleTable(frames); // concatenate the audio data to constuct the mdat\n\n mdat = mp4Generator.mdat(audioFrameUtils.concatenateFrameData(frames));\n adtsFrames = [];\n moof = mp4Generator.moof(sequenceNumber, [track]);\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // bump the sequence number for next time\n\n sequenceNumber++;\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n trackDecodeInfo.clearDtsInfo(track);\n frameDuration = Math.ceil(ONE_SECOND_IN_TS$1 * 1024 / track.samplerate); // TODO this check was added to maintain backwards compatibility (particularly with\n // tests) on adding the timingInfo event. However, it seems unlikely that there's a\n // valid use-case where an init segment/data should be triggered without associated\n // frames. Leaving for now, but should be looked into.\n\n if (frames.length) {\n segmentDuration = frames.length * frameDuration;\n this.trigger('segmentTimingInfo', generateSegmentTimingInfo( // The audio track's baseMediaDecodeTime is in audio clock cycles, but the\n // frame info is in video clock cycles. Convert to match expectation of\n // listeners (that all timestamps will be based on video clock cycles).\n clock.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate), // frame times are already in video clock, as is segment duration\n frames[0].dts, frames[0].pts, frames[0].dts + segmentDuration, frames[0].pts + segmentDuration, videoClockCyclesOfSilencePrefixed || 0));\n this.trigger('timingInfo', {\n start: frames[0].pts,\n end: frames[0].pts + segmentDuration\n });\n }\n\n this.trigger('data', {\n track: track,\n boxes: boxes\n });\n this.trigger('done', 'AudioSegmentStream');\n };\n\n this.reset = function () {\n trackDecodeInfo.clearDtsInfo(track);\n adtsFrames = [];\n this.trigger('reset');\n };\n };\n\n _AudioSegmentStream.prototype = new stream();\n /**\n * Constructs a single-track, ISO BMFF media segment from H264 data\n * events. The output of this stream can be fed to a SourceBuffer\n * configured with a suitable initialization segment.\n * @param track {object} track metadata configuration\n * @param options {object} transmuxer options object\n * @param options.alignGopsAtEnd {boolean} If true, start from the end of the\n * gopsToAlignWith list when attempting to align gop pts\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at 0.\n */\n\n _VideoSegmentStream = function VideoSegmentStream(track, options) {\n var sequenceNumber,\n nalUnits = [],\n gopsToAlignWith = [],\n config,\n pps;\n options = options || {};\n sequenceNumber = options.firstSequenceNumber || 0;\n\n _VideoSegmentStream.prototype.init.call(this);\n\n delete track.minPTS;\n this.gopCache_ = [];\n /**\n * Constructs a ISO BMFF segment given H264 nalUnits\n * @param {Object} nalUnit A data event representing a nalUnit\n * @param {String} nalUnit.nalUnitType\n * @param {Object} nalUnit.config Properties for a mp4 track\n * @param {Uint8Array} nalUnit.data The nalUnit bytes\n * @see lib/codecs/h264.js\n **/\n\n this.push = function (nalUnit) {\n trackDecodeInfo.collectDtsInfo(track, nalUnit); // record the track config\n\n if (nalUnit.nalUnitType === 'seq_parameter_set_rbsp' && !config) {\n config = nalUnit.config;\n track.sps = [nalUnit.data];\n videoProperties.forEach(function (prop) {\n track[prop] = config[prop];\n }, this);\n }\n\n if (nalUnit.nalUnitType === 'pic_parameter_set_rbsp' && !pps) {\n pps = nalUnit.data;\n track.pps = [nalUnit.data];\n } // buffer video until flush() is called\n\n\n nalUnits.push(nalUnit);\n };\n /**\n * Pass constructed ISO BMFF track and boxes on to the\n * next stream in the pipeline\n **/\n\n\n this.flush = function () {\n var frames,\n gopForFusion,\n gops,\n moof,\n mdat,\n boxes,\n prependedContentDuration = 0,\n firstGop,\n lastGop; // Throw away nalUnits at the start of the byte stream until\n // we find the first AUD\n\n while (nalUnits.length) {\n if (nalUnits[0].nalUnitType === 'access_unit_delimiter_rbsp') {\n break;\n }\n\n nalUnits.shift();\n } // Return early if no video data has been observed\n\n\n if (nalUnits.length === 0) {\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n } // Organize the raw nal-units into arrays that represent\n // higher-level constructs such as frames and gops\n // (group-of-pictures)\n\n\n frames = frameUtils.groupNalsIntoFrames(nalUnits);\n gops = frameUtils.groupFramesIntoGops(frames); // If the first frame of this fragment is not a keyframe we have\n // a problem since MSE (on Chrome) requires a leading keyframe.\n //\n // We have two approaches to repairing this situation:\n // 1) GOP-FUSION:\n // This is where we keep track of the GOPS (group-of-pictures)\n // from previous fragments and attempt to find one that we can\n // prepend to the current fragment in order to create a valid\n // fragment.\n // 2) KEYFRAME-PULLING:\n // Here we search for the first keyframe in the fragment and\n // throw away all the frames between the start of the fragment\n // and that keyframe. We then extend the duration and pull the\n // PTS of the keyframe forward so that it covers the time range\n // of the frames that were disposed of.\n //\n // #1 is far prefereable over #2 which can cause \"stuttering\" but\n // requires more things to be just right.\n\n if (!gops[0][0].keyFrame) {\n // Search for a gop for fusion from our gopCache\n gopForFusion = this.getGopForFusion_(nalUnits[0], track);\n\n if (gopForFusion) {\n // in order to provide more accurate timing information about the segment, save\n // the number of seconds prepended to the original segment due to GOP fusion\n prependedContentDuration = gopForFusion.duration;\n gops.unshift(gopForFusion); // Adjust Gops' metadata to account for the inclusion of the\n // new gop at the beginning\n\n gops.byteLength += gopForFusion.byteLength;\n gops.nalCount += gopForFusion.nalCount;\n gops.pts = gopForFusion.pts;\n gops.dts = gopForFusion.dts;\n gops.duration += gopForFusion.duration;\n } else {\n // If we didn't find a candidate gop fall back to keyframe-pulling\n gops = frameUtils.extendFirstKeyFrame(gops);\n }\n } // Trim gops to align with gopsToAlignWith\n\n\n if (gopsToAlignWith.length) {\n var alignedGops;\n\n if (options.alignGopsAtEnd) {\n alignedGops = this.alignGopsAtEnd_(gops);\n } else {\n alignedGops = this.alignGopsAtStart_(gops);\n }\n\n if (!alignedGops) {\n // save all the nals in the last GOP into the gop cache\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n }); // Keep a maximum of 6 GOPs in the cache\n\n this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n nalUnits = []; // return early no gops can be aligned with desired gopsToAlignWith\n\n this.resetStream_();\n this.trigger('done', 'VideoSegmentStream');\n return;\n } // Some gops were trimmed. clear dts info so minSegmentDts and pts are correct\n // when recalculated before sending off to CoalesceStream\n\n\n trackDecodeInfo.clearDtsInfo(track);\n gops = alignedGops;\n }\n\n trackDecodeInfo.collectDtsInfo(track, gops); // First, we have to build the index from byte locations to\n // samples (that is, frames) in the video data\n\n track.samples = frameUtils.generateSampleTable(gops); // Concatenate the video data and construct the mdat\n\n mdat = mp4Generator.mdat(frameUtils.concatenateNalData(gops));\n track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options.keepOriginalTimestamps);\n this.trigger('processedGopsInfo', gops.map(function (gop) {\n return {\n pts: gop.pts,\n dts: gop.dts,\n byteLength: gop.byteLength\n };\n }));\n firstGop = gops[0];\n lastGop = gops[gops.length - 1];\n this.trigger('segmentTimingInfo', generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration));\n this.trigger('timingInfo', {\n start: gops[0].pts,\n end: gops[gops.length - 1].pts + gops[gops.length - 1].duration\n }); // save all the nals in the last GOP into the gop cache\n\n this.gopCache_.unshift({\n gop: gops.pop(),\n pps: track.pps,\n sps: track.sps\n }); // Keep a maximum of 6 GOPs in the cache\n\n this.gopCache_.length = Math.min(6, this.gopCache_.length); // Clear nalUnits\n\n nalUnits = [];\n this.trigger('baseMediaDecodeTime', track.baseMediaDecodeTime);\n this.trigger('timelineStartInfo', track.timelineStartInfo);\n moof = mp4Generator.moof(sequenceNumber, [track]); // it would be great to allocate this array up front instead of\n // throwing away hundreds of media segment fragments\n\n boxes = new Uint8Array(moof.byteLength + mdat.byteLength); // Bump the sequence number for next time\n\n sequenceNumber++;\n boxes.set(moof);\n boxes.set(mdat, moof.byteLength);\n this.trigger('data', {\n track: track,\n boxes: boxes\n });\n this.resetStream_(); // Continue with the flush process now\n\n this.trigger('done', 'VideoSegmentStream');\n };\n\n this.reset = function () {\n this.resetStream_();\n nalUnits = [];\n this.gopCache_.length = 0;\n gopsToAlignWith.length = 0;\n this.trigger('reset');\n };\n\n this.resetStream_ = function () {\n trackDecodeInfo.clearDtsInfo(track); // reset config and pps because they may differ across segments\n // for instance, when we are rendition switching\n\n config = undefined;\n pps = undefined;\n }; // Search for a candidate Gop for gop-fusion from the gop cache and\n // return it or return null if no good candidate was found\n\n\n this.getGopForFusion_ = function (nalUnit) {\n var halfSecond = 45000,\n // Half-a-second in a 90khz clock\n allowableOverlap = 10000,\n // About 3 frames @ 30fps\n nearestDistance = Infinity,\n dtsDistance,\n nearestGopObj,\n currentGop,\n currentGopObj,\n i; // Search for the GOP nearest to the beginning of this nal unit\n\n for (i = 0; i < this.gopCache_.length; i++) {\n currentGopObj = this.gopCache_[i];\n currentGop = currentGopObj.gop; // Reject Gops with different SPS or PPS\n\n if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {\n continue;\n } // Reject Gops that would require a negative baseMediaDecodeTime\n\n\n if (currentGop.dts < track.timelineStartInfo.dts) {\n continue;\n } // The distance between the end of the gop and the start of the nalUnit\n\n\n dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration; // Only consider GOPS that start before the nal unit and end within\n // a half-second of the nal unit\n\n if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {\n // Always use the closest GOP we found if there is more than\n // one candidate\n if (!nearestGopObj || nearestDistance > dtsDistance) {\n nearestGopObj = currentGopObj;\n nearestDistance = dtsDistance;\n }\n }\n }\n\n if (nearestGopObj) {\n return nearestGopObj.gop;\n }\n\n return null;\n }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the START of the list\n\n\n this.alignGopsAtStart_ = function (gops) {\n var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration, alignedGops;\n byteLength = gops.byteLength;\n nalCount = gops.nalCount;\n duration = gops.duration;\n alignIndex = gopIndex = 0;\n\n while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n\n if (align.pts === gop.pts) {\n break;\n }\n\n if (gop.pts > align.pts) {\n // this current gop starts after the current gop we want to align on, so increment\n // align index\n alignIndex++;\n continue;\n } // current gop starts before the current gop we want to align on. so increment gop\n // index\n\n\n gopIndex++;\n byteLength -= gop.byteLength;\n nalCount -= gop.nalCount;\n duration -= gop.duration;\n }\n\n if (gopIndex === 0) {\n // no gops to trim\n return gops;\n }\n\n if (gopIndex === gops.length) {\n // all gops trimmed, skip appending all gops\n return null;\n }\n\n alignedGops = gops.slice(gopIndex);\n alignedGops.byteLength = byteLength;\n alignedGops.duration = duration;\n alignedGops.nalCount = nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n return alignedGops;\n }; // trim gop list to the first gop found that has a matching pts with a gop in the list\n // of gopsToAlignWith starting from the END of the list\n\n\n this.alignGopsAtEnd_ = function (gops) {\n var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;\n alignIndex = gopsToAlignWith.length - 1;\n gopIndex = gops.length - 1;\n alignEndIndex = null;\n matchFound = false;\n\n while (alignIndex >= 0 && gopIndex >= 0) {\n align = gopsToAlignWith[alignIndex];\n gop = gops[gopIndex];\n\n if (align.pts === gop.pts) {\n matchFound = true;\n break;\n }\n\n if (align.pts > gop.pts) {\n alignIndex--;\n continue;\n }\n\n if (alignIndex === gopsToAlignWith.length - 1) {\n // gop.pts is greater than the last alignment candidate. If no match is found\n // by the end of this loop, we still want to append gops that come after this\n // point\n alignEndIndex = gopIndex;\n }\n\n gopIndex--;\n }\n\n if (!matchFound && alignEndIndex === null) {\n return null;\n }\n\n var trimIndex;\n\n if (matchFound) {\n trimIndex = gopIndex;\n } else {\n trimIndex = alignEndIndex;\n }\n\n if (trimIndex === 0) {\n return gops;\n }\n\n var alignedGops = gops.slice(trimIndex);\n var metadata = alignedGops.reduce(function (total, gop) {\n total.byteLength += gop.byteLength;\n total.duration += gop.duration;\n total.nalCount += gop.nalCount;\n return total;\n }, {\n byteLength: 0,\n duration: 0,\n nalCount: 0\n });\n alignedGops.byteLength = metadata.byteLength;\n alignedGops.duration = metadata.duration;\n alignedGops.nalCount = metadata.nalCount;\n alignedGops.pts = alignedGops[0].pts;\n alignedGops.dts = alignedGops[0].dts;\n return alignedGops;\n };\n\n this.alignGopsWith = function (newGopsToAlignWith) {\n gopsToAlignWith = newGopsToAlignWith;\n };\n };\n\n _VideoSegmentStream.prototype = new stream();\n /**\n * A Stream that can combine multiple streams (ie. audio & video)\n * into a single output segment for MSE. Also supports audio-only\n * and video-only streams.\n * @param options {object} transmuxer options object\n * @param options.keepOriginalTimestamps {boolean} If true, keep the timestamps\n * in the source; false to adjust the first segment to start at media timeline start.\n */\n\n _CoalesceStream = function CoalesceStream(options, metadataStream) {\n // Number of Tracks per output segment\n // If greater than 1, we combine multiple\n // tracks into a single segment\n this.numberOfTracks = 0;\n this.metadataStream = metadataStream;\n options = options || {};\n\n if (typeof options.remux !== 'undefined') {\n this.remuxTracks = !!options.remux;\n } else {\n this.remuxTracks = true;\n }\n\n if (typeof options.keepOriginalTimestamps === 'boolean') {\n this.keepOriginalTimestamps = options.keepOriginalTimestamps;\n } else {\n this.keepOriginalTimestamps = false;\n }\n\n this.pendingTracks = [];\n this.videoTrack = null;\n this.pendingBoxes = [];\n this.pendingCaptions = [];\n this.pendingMetadata = [];\n this.pendingBytes = 0;\n this.emittedTracks = 0;\n\n _CoalesceStream.prototype.init.call(this); // Take output from multiple\n\n\n this.push = function (output) {\n // buffer incoming captions until the associated video segment\n // finishes\n if (output.text) {\n return this.pendingCaptions.push(output);\n } // buffer incoming id3 tags until the final flush\n\n\n if (output.frames) {\n return this.pendingMetadata.push(output);\n } // Add this track to the list of pending tracks and store\n // important information required for the construction of\n // the final segment\n\n\n this.pendingTracks.push(output.track);\n this.pendingBytes += output.boxes.byteLength; // TODO: is there an issue for this against chrome?\n // We unshift audio and push video because\n // as of Chrome 75 when switching from\n // one init segment to another if the video\n // mdat does not appear after the audio mdat\n // only audio will play for the duration of our transmux.\n\n if (output.track.type === 'video') {\n this.videoTrack = output.track;\n this.pendingBoxes.push(output.boxes);\n }\n\n if (output.track.type === 'audio') {\n this.audioTrack = output.track;\n this.pendingBoxes.unshift(output.boxes);\n }\n };\n };\n\n _CoalesceStream.prototype = new stream();\n\n _CoalesceStream.prototype.flush = function (flushSource) {\n var offset = 0,\n event = {\n captions: [],\n captionStreams: {},\n metadata: [],\n info: {}\n },\n caption,\n id3,\n initSegment,\n timelineStartPts = 0,\n i;\n\n if (this.pendingTracks.length < this.numberOfTracks) {\n if (flushSource !== 'VideoSegmentStream' && flushSource !== 'AudioSegmentStream') {\n // Return because we haven't received a flush from a data-generating\n // portion of the segment (meaning that we have only recieved meta-data\n // or captions.)\n return;\n } else if (this.remuxTracks) {\n // Return until we have enough tracks from the pipeline to remux (if we\n // are remuxing audio and video into a single MP4)\n return;\n } else if (this.pendingTracks.length === 0) {\n // In the case where we receive a flush without any data having been\n // received we consider it an emitted track for the purposes of coalescing\n // `done` events.\n // We do this for the case where there is an audio and video track in the\n // segment but no audio data. (seen in several playlists with alternate\n // audio tracks and no audio present in the main TS segments.)\n this.emittedTracks++;\n\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n\n return;\n }\n }\n\n if (this.videoTrack) {\n timelineStartPts = this.videoTrack.timelineStartInfo.pts;\n videoProperties.forEach(function (prop) {\n event.info[prop] = this.videoTrack[prop];\n }, this);\n } else if (this.audioTrack) {\n timelineStartPts = this.audioTrack.timelineStartInfo.pts;\n audioProperties.forEach(function (prop) {\n event.info[prop] = this.audioTrack[prop];\n }, this);\n }\n\n if (this.videoTrack || this.audioTrack) {\n if (this.pendingTracks.length === 1) {\n event.type = this.pendingTracks[0].type;\n } else {\n event.type = 'combined';\n }\n\n this.emittedTracks += this.pendingTracks.length;\n initSegment = mp4Generator.initSegment(this.pendingTracks); // Create a new typed array to hold the init segment\n\n event.initSegment = new Uint8Array(initSegment.byteLength); // Create an init segment containing a moov\n // and track definitions\n\n event.initSegment.set(initSegment); // Create a new typed array to hold the moof+mdats\n\n event.data = new Uint8Array(this.pendingBytes); // Append each moof+mdat (one per track) together\n\n for (i = 0; i < this.pendingBoxes.length; i++) {\n event.data.set(this.pendingBoxes[i], offset);\n offset += this.pendingBoxes[i].byteLength;\n } // Translate caption PTS times into second offsets to match the\n // video timeline for the segment, and add track info\n\n\n for (i = 0; i < this.pendingCaptions.length; i++) {\n caption = this.pendingCaptions[i];\n caption.startTime = clock.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps);\n caption.endTime = clock.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps);\n event.captionStreams[caption.stream] = true;\n event.captions.push(caption);\n } // Translate ID3 frame PTS times into second offsets to match the\n // video timeline for the segment\n\n\n for (i = 0; i < this.pendingMetadata.length; i++) {\n id3 = this.pendingMetadata[i];\n id3.cueTime = clock.metadataTsToSeconds(id3.pts, timelineStartPts, this.keepOriginalTimestamps);\n event.metadata.push(id3);\n } // We add this to every single emitted segment even though we only need\n // it for the first\n\n\n event.metadata.dispatchType = this.metadataStream.dispatchType; // Reset stream state\n\n this.pendingTracks.length = 0;\n this.videoTrack = null;\n this.pendingBoxes.length = 0;\n this.pendingCaptions.length = 0;\n this.pendingBytes = 0;\n this.pendingMetadata.length = 0; // Emit the built segment\n // We include captions and ID3 tags for backwards compatibility,\n // ideally we should send only video and audio in the data event\n\n this.trigger('data', event); // Emit each caption to the outside world\n // Ideally, this would happen immediately on parsing captions,\n // but we need to ensure that video data is sent back first\n // so that caption timing can be adjusted to match video timing\n\n for (i = 0; i < event.captions.length; i++) {\n caption = event.captions[i];\n this.trigger('caption', caption);\n } // Emit each id3 tag to the outside world\n // Ideally, this would happen immediately on parsing the tag,\n // but we need to ensure that video data is sent back first\n // so that ID3 frame timing can be adjusted to match video timing\n\n\n for (i = 0; i < event.metadata.length; i++) {\n id3 = event.metadata[i];\n this.trigger('id3Frame', id3);\n }\n } // Only emit `done` if all tracks have been flushed and emitted\n\n\n if (this.emittedTracks >= this.numberOfTracks) {\n this.trigger('done');\n this.emittedTracks = 0;\n }\n };\n\n _CoalesceStream.prototype.setRemux = function (val) {\n this.remuxTracks = val;\n };\n /**\n * A Stream that expects MP2T binary data as input and produces\n * corresponding media segments, suitable for use with Media Source\n * Extension (MSE) implementations that support the ISO BMFF byte\n * stream format, like Chrome.\n */\n\n\n _Transmuxer = function Transmuxer(options) {\n var self = this,\n hasFlushed = true,\n videoTrack,\n audioTrack;\n\n _Transmuxer.prototype.init.call(this);\n\n options = options || {};\n this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0;\n this.transmuxPipeline_ = {};\n\n this.setupAacPipeline = function () {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n pipeline.type = 'aac';\n pipeline.metadataStream = new m2ts_1.MetadataStream(); // set up the parsing pipeline\n\n pipeline.aacStream = new aac();\n pipeline.audioTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('audio');\n pipeline.timedMetadataTimestampRolloverStream = new m2ts_1.TimestampRolloverStream('timed-metadata');\n pipeline.adtsStream = new adts();\n pipeline.coalesceStream = new _CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.aacStream;\n pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);\n pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);\n pipeline.metadataStream.on('timestamp', function (frame) {\n pipeline.aacStream.setTimestamp(frame.timeStamp);\n });\n pipeline.aacStream.on('data', function (data) {\n if (data.type !== 'timed-metadata' && data.type !== 'audio' || pipeline.audioSegmentStream) {\n return;\n }\n\n audioTrack = audioTrack || {\n timelineStartInfo: {\n baseMediaDecodeTime: self.baseMediaDecodeTime\n },\n codec: 'adts',\n type: 'audio'\n }; // hook up the audio segment stream to the first track with aac data\n\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options);\n pipeline.audioSegmentStream.on('log', self.getLogTrigger_('audioSegmentStream'));\n pipeline.audioSegmentStream.on('timingInfo', self.trigger.bind(self, 'audioTimingInfo')); // Set up the final part of the audio pipeline\n\n pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream); // emit pmt info\n\n self.trigger('trackinfo', {\n hasAudio: !!audioTrack,\n hasVideo: !!videoTrack\n });\n }); // Re-emit any data coming from the coalesce stream to the outside world\n\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data')); // Let the consumer know we have finished flushing the entire pipeline\n\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n };\n\n this.setupTsPipeline = function () {\n var pipeline = {};\n this.transmuxPipeline_ = pipeline;\n pipeline.type = 'ts';\n pipeline.metadataStream = new m2ts_1.MetadataStream(); // set up the parsing pipeline\n\n pipeline.packetStream = new m2ts_1.TransportPacketStream();\n pipeline.parseStream = new m2ts_1.TransportParseStream();\n pipeline.elementaryStream = new m2ts_1.ElementaryStream();\n pipeline.timestampRolloverStream = new m2ts_1.TimestampRolloverStream();\n pipeline.adtsStream = new adts();\n pipeline.h264Stream = new H264Stream();\n pipeline.captionStream = new m2ts_1.CaptionStream(options);\n pipeline.coalesceStream = new _CoalesceStream(options, pipeline.metadataStream);\n pipeline.headOfPipeline = pipeline.packetStream; // disassemble MPEG2-TS packets into elementary streams\n\n pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream); // !!THIS ORDER IS IMPORTANT!!\n // demux the streams\n\n pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);\n pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);\n pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream); // Hook up CEA-608/708 caption stream\n\n pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);\n pipeline.elementaryStream.on('data', function (data) {\n var i;\n\n if (data.type === 'metadata') {\n i = data.tracks.length; // scan the tracks listed in the metadata\n\n while (i--) {\n if (!videoTrack && data.tracks[i].type === 'video') {\n videoTrack = data.tracks[i];\n videoTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n } else if (!audioTrack && data.tracks[i].type === 'audio') {\n audioTrack = data.tracks[i];\n audioTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;\n }\n } // hook up the video segment stream to the first track with h264 data\n\n\n if (videoTrack && !pipeline.videoSegmentStream) {\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.videoSegmentStream = new _VideoSegmentStream(videoTrack, options);\n pipeline.videoSegmentStream.on('log', self.getLogTrigger_('videoSegmentStream'));\n pipeline.videoSegmentStream.on('timelineStartInfo', function (timelineStartInfo) {\n // When video emits timelineStartInfo data after a flush, we forward that\n // info to the AudioSegmentStream, if it exists, because video timeline\n // data takes precedence. Do not do this if keepOriginalTimestamps is set,\n // because this is a particularly subtle form of timestamp alteration.\n if (audioTrack && !options.keepOriginalTimestamps) {\n audioTrack.timelineStartInfo = timelineStartInfo; // On the first segment we trim AAC frames that exist before the\n // very earliest DTS we have seen in video because Chrome will\n // interpret any video track with a baseMediaDecodeTime that is\n // non-zero as a gap.\n\n pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self.baseMediaDecodeTime);\n }\n });\n pipeline.videoSegmentStream.on('processedGopsInfo', self.trigger.bind(self, 'gopInfo'));\n pipeline.videoSegmentStream.on('segmentTimingInfo', self.trigger.bind(self, 'videoSegmentTimingInfo'));\n pipeline.videoSegmentStream.on('baseMediaDecodeTime', function (baseMediaDecodeTime) {\n if (audioTrack) {\n pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);\n }\n });\n pipeline.videoSegmentStream.on('timingInfo', self.trigger.bind(self, 'videoTimingInfo')); // Set up the final part of the video pipeline\n\n pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);\n }\n\n if (audioTrack && !pipeline.audioSegmentStream) {\n // hook up the audio segment stream to the first track with aac data\n pipeline.coalesceStream.numberOfTracks++;\n pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options);\n pipeline.audioSegmentStream.on('log', self.getLogTrigger_('audioSegmentStream'));\n pipeline.audioSegmentStream.on('timingInfo', self.trigger.bind(self, 'audioTimingInfo'));\n pipeline.audioSegmentStream.on('segmentTimingInfo', self.trigger.bind(self, 'audioSegmentTimingInfo')); // Set up the final part of the audio pipeline\n\n pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);\n } // emit pmt info\n\n\n self.trigger('trackinfo', {\n hasAudio: !!audioTrack,\n hasVideo: !!videoTrack\n });\n }\n }); // Re-emit any data coming from the coalesce stream to the outside world\n\n pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data'));\n pipeline.coalesceStream.on('id3Frame', function (id3Frame) {\n id3Frame.dispatchType = pipeline.metadataStream.dispatchType;\n self.trigger('id3Frame', id3Frame);\n });\n pipeline.coalesceStream.on('caption', this.trigger.bind(this, 'caption')); // Let the consumer know we have finished flushing the entire pipeline\n\n pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));\n }; // hook up the segment streams once track metadata is delivered\n\n\n this.setBaseMediaDecodeTime = function (baseMediaDecodeTime) {\n var pipeline = this.transmuxPipeline_;\n\n if (!options.keepOriginalTimestamps) {\n this.baseMediaDecodeTime = baseMediaDecodeTime;\n }\n\n if (audioTrack) {\n audioTrack.timelineStartInfo.dts = undefined;\n audioTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(audioTrack);\n\n if (pipeline.audioTimestampRolloverStream) {\n pipeline.audioTimestampRolloverStream.discontinuity();\n }\n }\n\n if (videoTrack) {\n if (pipeline.videoSegmentStream) {\n pipeline.videoSegmentStream.gopCache_ = [];\n }\n\n videoTrack.timelineStartInfo.dts = undefined;\n videoTrack.timelineStartInfo.pts = undefined;\n trackDecodeInfo.clearDtsInfo(videoTrack);\n pipeline.captionStream.reset();\n }\n\n if (pipeline.timestampRolloverStream) {\n pipeline.timestampRolloverStream.discontinuity();\n }\n };\n\n this.setAudioAppendStart = function (timestamp) {\n if (audioTrack) {\n this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);\n }\n };\n\n this.setRemux = function (val) {\n var pipeline = this.transmuxPipeline_;\n options.remux = val;\n\n if (pipeline && pipeline.coalesceStream) {\n pipeline.coalesceStream.setRemux(val);\n }\n };\n\n this.alignGopsWith = function (gopsToAlignWith) {\n if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {\n this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);\n }\n };\n\n this.getLogTrigger_ = function (key) {\n var self = this;\n return function (event) {\n event.stream = key;\n self.trigger('log', event);\n };\n }; // feed incoming data to the front of the parsing pipeline\n\n\n this.push = function (data) {\n if (hasFlushed) {\n var isAac = isLikelyAacData(data);\n\n if (isAac && this.transmuxPipeline_.type !== 'aac') {\n this.setupAacPipeline();\n } else if (!isAac && this.transmuxPipeline_.type !== 'ts') {\n this.setupTsPipeline();\n }\n\n if (this.transmuxPipeline_) {\n var keys = Object.keys(this.transmuxPipeline_);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i]; // skip non-stream keys and headOfPipeline\n // which is just a duplicate\n\n if (key === 'headOfPipeline' || !this.transmuxPipeline_[key].on) {\n continue;\n }\n\n this.transmuxPipeline_[key].on('log', this.getLogTrigger_(key));\n }\n }\n\n hasFlushed = false;\n }\n\n this.transmuxPipeline_.headOfPipeline.push(data);\n }; // flush any buffered data\n\n\n this.flush = function () {\n hasFlushed = true; // Start at the top of the pipeline and flush all pending work\n\n this.transmuxPipeline_.headOfPipeline.flush();\n };\n\n this.endTimeline = function () {\n this.transmuxPipeline_.headOfPipeline.endTimeline();\n };\n\n this.reset = function () {\n if (this.transmuxPipeline_.headOfPipeline) {\n this.transmuxPipeline_.headOfPipeline.reset();\n }\n }; // Caption data has to be reset when seeking outside buffered range\n\n\n this.resetCaptions = function () {\n if (this.transmuxPipeline_.captionStream) {\n this.transmuxPipeline_.captionStream.reset();\n }\n };\n };\n\n _Transmuxer.prototype = new stream();\n var transmuxer = {\n Transmuxer: _Transmuxer,\n VideoSegmentStream: _VideoSegmentStream,\n AudioSegmentStream: _AudioSegmentStream,\n AUDIO_PROPERTIES: audioProperties,\n VIDEO_PROPERTIES: videoProperties,\n // exported for testing\n generateSegmentTimingInfo: generateSegmentTimingInfo\n };\n /**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\n\n var toUnsigned$3 = function toUnsigned(value) {\n return value >>> 0;\n };\n\n var toHexString$1 = function toHexString(value) {\n return ('00' + value.toString(16)).slice(-2);\n };\n\n var bin = {\n toUnsigned: toUnsigned$3,\n toHexString: toHexString$1\n };\n\n var parseType$1 = function parseType(buffer) {\n var result = '';\n result += String.fromCharCode(buffer[0]);\n result += String.fromCharCode(buffer[1]);\n result += String.fromCharCode(buffer[2]);\n result += String.fromCharCode(buffer[3]);\n return result;\n };\n\n var parseType_1 = parseType$1;\n var toUnsigned$2 = bin.toUnsigned;\n\n var findBox = function findBox(data, path) {\n var results = [],\n i,\n size,\n type,\n end,\n subresults;\n\n if (!path.length) {\n // short-circuit the search for empty paths\n return null;\n }\n\n for (i = 0; i < data.byteLength;) {\n size = toUnsigned$2(data[i] << 24 | data[i + 1] << 16 | data[i + 2] << 8 | data[i + 3]);\n type = parseType_1(data.subarray(i + 4, i + 8));\n end = size > 1 ? i + size : data.byteLength;\n\n if (type === path[0]) {\n if (path.length === 1) {\n // this is the end of the path and we've found the box we were\n // looking for\n results.push(data.subarray(i + 8, end));\n } else {\n // recursively search for the next box along the path\n subresults = findBox(data.subarray(i + 8, end), path.slice(1));\n\n if (subresults.length) {\n results = results.concat(subresults);\n }\n }\n }\n\n i = end;\n } // we've finished searching all of data\n\n\n return results;\n };\n\n var findBox_1 = findBox;\n var toUnsigned$1 = bin.toUnsigned;\n\n var tfdt = function tfdt(data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n baseMediaDecodeTime: toUnsigned$1(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7])\n };\n\n if (result.version === 1) {\n result.baseMediaDecodeTime *= Math.pow(2, 32);\n result.baseMediaDecodeTime += toUnsigned$1(data[8] << 24 | data[9] << 16 | data[10] << 8 | data[11]);\n }\n\n return result;\n };\n\n var parseTfdt = tfdt;\n\n var parseSampleFlags = function parseSampleFlags(flags) {\n return {\n isLeading: (flags[0] & 0x0c) >>> 2,\n dependsOn: flags[0] & 0x03,\n isDependedOn: (flags[1] & 0xc0) >>> 6,\n hasRedundancy: (flags[1] & 0x30) >>> 4,\n paddingValue: (flags[1] & 0x0e) >>> 1,\n isNonSyncSample: flags[1] & 0x01,\n degradationPriority: flags[2] << 8 | flags[3]\n };\n };\n\n var parseSampleFlags_1 = parseSampleFlags;\n\n var trun = function trun(data) {\n var result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n samples: []\n },\n view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n // Flag interpretation\n dataOffsetPresent = result.flags[2] & 0x01,\n // compare with 2nd byte of 0x1\n firstSampleFlagsPresent = result.flags[2] & 0x04,\n // compare with 2nd byte of 0x4\n sampleDurationPresent = result.flags[1] & 0x01,\n // compare with 2nd byte of 0x100\n sampleSizePresent = result.flags[1] & 0x02,\n // compare with 2nd byte of 0x200\n sampleFlagsPresent = result.flags[1] & 0x04,\n // compare with 2nd byte of 0x400\n sampleCompositionTimeOffsetPresent = result.flags[1] & 0x08,\n // compare with 2nd byte of 0x800\n sampleCount = view.getUint32(4),\n offset = 8,\n sample;\n\n if (dataOffsetPresent) {\n // 32 bit signed integer\n result.dataOffset = view.getInt32(offset);\n offset += 4;\n } // Overrides the flags for the first sample only. The order of\n // optional values will be: duration, size, compositionTimeOffset\n\n\n if (firstSampleFlagsPresent && sampleCount) {\n sample = {\n flags: parseSampleFlags_1(data.subarray(offset, offset + 4))\n };\n offset += 4;\n\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleCompositionTimeOffsetPresent) {\n if (result.version === 1) {\n sample.compositionTimeOffset = view.getInt32(offset);\n } else {\n sample.compositionTimeOffset = view.getUint32(offset);\n }\n\n offset += 4;\n }\n\n result.samples.push(sample);\n sampleCount--;\n }\n\n while (sampleCount--) {\n sample = {};\n\n if (sampleDurationPresent) {\n sample.duration = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleSizePresent) {\n sample.size = view.getUint32(offset);\n offset += 4;\n }\n\n if (sampleFlagsPresent) {\n sample.flags = parseSampleFlags_1(data.subarray(offset, offset + 4));\n offset += 4;\n }\n\n if (sampleCompositionTimeOffsetPresent) {\n if (result.version === 1) {\n sample.compositionTimeOffset = view.getInt32(offset);\n } else {\n sample.compositionTimeOffset = view.getUint32(offset);\n }\n\n offset += 4;\n }\n\n result.samples.push(sample);\n }\n\n return result;\n };\n\n var parseTrun = trun;\n\n var tfhd = function tfhd(data) {\n var view = new DataView(data.buffer, data.byteOffset, data.byteLength),\n result = {\n version: data[0],\n flags: new Uint8Array(data.subarray(1, 4)),\n trackId: view.getUint32(4)\n },\n baseDataOffsetPresent = result.flags[2] & 0x01,\n sampleDescriptionIndexPresent = result.flags[2] & 0x02,\n defaultSampleDurationPresent = result.flags[2] & 0x08,\n defaultSampleSizePresent = result.flags[2] & 0x10,\n defaultSampleFlagsPresent = result.flags[2] & 0x20,\n durationIsEmpty = result.flags[0] & 0x010000,\n defaultBaseIsMoof = result.flags[0] & 0x020000,\n i;\n i = 8;\n\n if (baseDataOffsetPresent) {\n i += 4; // truncate top 4 bytes\n // FIXME: should we read the full 64 bits?\n\n result.baseDataOffset = view.getUint32(12);\n i += 4;\n }\n\n if (sampleDescriptionIndexPresent) {\n result.sampleDescriptionIndex = view.getUint32(i);\n i += 4;\n }\n\n if (defaultSampleDurationPresent) {\n result.defaultSampleDuration = view.getUint32(i);\n i += 4;\n }\n\n if (defaultSampleSizePresent) {\n result.defaultSampleSize = view.getUint32(i);\n i += 4;\n }\n\n if (defaultSampleFlagsPresent) {\n result.defaultSampleFlags = view.getUint32(i);\n }\n\n if (durationIsEmpty) {\n result.durationIsEmpty = true;\n }\n\n if (!baseDataOffsetPresent && defaultBaseIsMoof) {\n result.baseDataOffsetIsMoof = true;\n }\n\n return result;\n };\n\n var parseTfhd = tfhd;\n var discardEmulationPreventionBytes = captionPacketParser.discardEmulationPreventionBytes;\n var CaptionStream = captionStream.CaptionStream;\n /**\n * Maps an offset in the mdat to a sample based on the the size of the samples.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Number} offset - The offset into the mdat\n * @param {Object[]} samples - An array of samples, parsed using `parseSamples`\n * @return {?Object} The matching sample, or null if no match was found.\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\n\n var mapToSample = function mapToSample(offset, samples) {\n var approximateOffset = offset;\n\n for (var i = 0; i < samples.length; i++) {\n var sample = samples[i];\n\n if (approximateOffset < sample.size) {\n return sample;\n }\n\n approximateOffset -= sample.size;\n }\n\n return null;\n };\n /**\n * Finds SEI nal units contained in a Media Data Box.\n * Assumes that `parseSamples` has been called first.\n *\n * @param {Uint8Array} avcStream - The bytes of the mdat\n * @param {Object[]} samples - The samples parsed out by `parseSamples`\n * @param {Number} trackId - The trackId of this video track\n * @return {Object[]} seiNals - the parsed SEI NALUs found.\n * The contents of the seiNal should match what is expected by\n * CaptionStream.push (nalUnitType, size, data, escapedRBSP, pts, dts)\n *\n * @see ISO-BMFF-12/2015, Section 8.1.1\n * @see Rec. ITU-T H.264, 7.3.2.3.1\n **/\n\n\n var findSeiNals = function findSeiNals(avcStream, samples, trackId) {\n var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength),\n result = {\n logs: [],\n seiNals: []\n },\n seiNal,\n i,\n length,\n lastMatchedSample;\n\n for (i = 0; i + 4 < avcStream.length; i += length) {\n length = avcView.getUint32(i);\n i += 4; // Bail if this doesn't appear to be an H264 stream\n\n if (length <= 0) {\n continue;\n }\n\n switch (avcStream[i] & 0x1F) {\n case 0x06:\n var data = avcStream.subarray(i + 1, i + 1 + length);\n var matchingSample = mapToSample(i, samples);\n seiNal = {\n nalUnitType: 'sei_rbsp',\n size: length,\n data: data,\n escapedRBSP: discardEmulationPreventionBytes(data),\n trackId: trackId\n };\n\n if (matchingSample) {\n seiNal.pts = matchingSample.pts;\n seiNal.dts = matchingSample.dts;\n lastMatchedSample = matchingSample;\n } else if (lastMatchedSample) {\n // If a matching sample cannot be found, use the last\n // sample's values as they should be as close as possible\n seiNal.pts = lastMatchedSample.pts;\n seiNal.dts = lastMatchedSample.dts;\n } else {\n result.logs.push({\n level: 'warn',\n message: 'We\\'ve encountered a nal unit without data at ' + i + ' for trackId ' + trackId + '. See mux.js#223.'\n });\n break;\n }\n\n result.seiNals.push(seiNal);\n break;\n }\n }\n\n return result;\n };\n /**\n * Parses sample information out of Track Run Boxes and calculates\n * the absolute presentation and decode timestamps of each sample.\n *\n * @param {Array<Uint8Array>} truns - The Trun Run boxes to be parsed\n * @param {Number} baseMediaDecodeTime - base media decode time from tfdt\n @see ISO-BMFF-12/2015, Section 8.8.12\n * @param {Object} tfhd - The parsed Track Fragment Header\n * @see inspect.parseTfhd\n * @return {Object[]} the parsed samples\n *\n * @see ISO-BMFF-12/2015, Section 8.8.8\n **/\n\n\n var parseSamples = function parseSamples(truns, baseMediaDecodeTime, tfhd) {\n var currentDts = baseMediaDecodeTime;\n var defaultSampleDuration = tfhd.defaultSampleDuration || 0;\n var defaultSampleSize = tfhd.defaultSampleSize || 0;\n var trackId = tfhd.trackId;\n var allSamples = [];\n truns.forEach(function (trun) {\n // Note: We currently do not parse the sample table as well\n // as the trun. It's possible some sources will require this.\n // moov > trak > mdia > minf > stbl\n var trackRun = parseTrun(trun);\n var samples = trackRun.samples;\n samples.forEach(function (sample) {\n if (sample.duration === undefined) {\n sample.duration = defaultSampleDuration;\n }\n\n if (sample.size === undefined) {\n sample.size = defaultSampleSize;\n }\n\n sample.trackId = trackId;\n sample.dts = currentDts;\n\n if (sample.compositionTimeOffset === undefined) {\n sample.compositionTimeOffset = 0;\n }\n\n sample.pts = currentDts + sample.compositionTimeOffset;\n currentDts += sample.duration;\n });\n allSamples = allSamples.concat(samples);\n });\n return allSamples;\n };\n /**\n * Parses out caption nals from an FMP4 segment's video tracks.\n *\n * @param {Uint8Array} segment - The bytes of a single segment\n * @param {Number} videoTrackId - The trackId of a video track in the segment\n * @return {Object.<Number, Object[]>} A mapping of video trackId to\n * a list of seiNals found in that track\n **/\n\n\n var parseCaptionNals = function parseCaptionNals(segment, videoTrackId) {\n // To get the samples\n var trafs = findBox_1(segment, ['moof', 'traf']); // To get SEI NAL units\n\n var mdats = findBox_1(segment, ['mdat']);\n var captionNals = {};\n var mdatTrafPairs = []; // Pair up each traf with a mdat as moofs and mdats are in pairs\n\n mdats.forEach(function (mdat, index) {\n var matchingTraf = trafs[index];\n mdatTrafPairs.push({\n mdat: mdat,\n traf: matchingTraf\n });\n });\n mdatTrafPairs.forEach(function (pair) {\n var mdat = pair.mdat;\n var traf = pair.traf;\n var tfhd = findBox_1(traf, ['tfhd']); // Exactly 1 tfhd per traf\n\n var headerInfo = parseTfhd(tfhd[0]);\n var trackId = headerInfo.trackId;\n var tfdt = findBox_1(traf, ['tfdt']); // Either 0 or 1 tfdt per traf\n\n var baseMediaDecodeTime = tfdt.length > 0 ? parseTfdt(tfdt[0]).baseMediaDecodeTime : 0;\n var truns = findBox_1(traf, ['trun']);\n var samples;\n var result; // Only parse video data for the chosen video track\n\n if (videoTrackId === trackId && truns.length > 0) {\n samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);\n result = findSeiNals(mdat, samples, trackId);\n\n if (!captionNals[trackId]) {\n captionNals[trackId] = {\n seiNals: [],\n logs: []\n };\n }\n\n captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals);\n captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs);\n }\n });\n return captionNals;\n };\n /**\n * Parses out inband captions from an MP4 container and returns\n * caption objects that can be used by WebVTT and the TextTrack API.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/VTTCue\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TextTrack\n * Assumes that `probe.getVideoTrackIds` and `probe.timescale` have been called first\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number} trackId - The id of the video track to parse\n * @param {Number} timescale - The timescale for the video track from the init segment\n *\n * @return {?Object[]} parsedCaptions - A list of captions or null if no video tracks\n * @return {Number} parsedCaptions[].startTime - The time to show the caption in seconds\n * @return {Number} parsedCaptions[].endTime - The time to stop showing the caption in seconds\n * @return {String} parsedCaptions[].text - The visible content of the caption\n **/\n\n\n var parseEmbeddedCaptions = function parseEmbeddedCaptions(segment, trackId, timescale) {\n var captionNals; // the ISO-BMFF spec says that trackId can't be zero, but there's some broken content out there\n\n if (trackId === null) {\n return null;\n }\n\n captionNals = parseCaptionNals(segment, trackId);\n var trackNals = captionNals[trackId] || {};\n return {\n seiNals: trackNals.seiNals,\n logs: trackNals.logs,\n timescale: timescale\n };\n };\n /**\n * Converts SEI NALUs into captions that can be used by video.js\n **/\n\n\n var CaptionParser = function CaptionParser() {\n var isInitialized = false;\n var captionStream; // Stores segments seen before trackId and timescale are set\n\n var segmentCache; // Stores video track ID of the track being parsed\n\n var trackId; // Stores the timescale of the track being parsed\n\n var timescale; // Stores captions parsed so far\n\n var parsedCaptions; // Stores whether we are receiving partial data or not\n\n var parsingPartial;\n /**\n * A method to indicate whether a CaptionParser has been initalized\n * @returns {Boolean}\n **/\n\n this.isInitialized = function () {\n return isInitialized;\n };\n /**\n * Initializes the underlying CaptionStream, SEI NAL parsing\n * and management, and caption collection\n **/\n\n\n this.init = function (options) {\n captionStream = new CaptionStream();\n isInitialized = true;\n parsingPartial = options ? options.isPartial : false; // Collect dispatched captions\n\n captionStream.on('data', function (event) {\n // Convert to seconds in the source's timescale\n event.startTime = event.startPts / timescale;\n event.endTime = event.endPts / timescale;\n parsedCaptions.captions.push(event);\n parsedCaptions.captionStreams[event.stream] = true;\n });\n captionStream.on('log', function (log) {\n parsedCaptions.logs.push(log);\n });\n };\n /**\n * Determines if a new video track will be selected\n * or if the timescale changed\n * @return {Boolean}\n **/\n\n\n this.isNewInit = function (videoTrackIds, timescales) {\n if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === 'object' && Object.keys(timescales).length === 0) {\n return false;\n }\n\n return trackId !== videoTrackIds[0] || timescale !== timescales[trackId];\n };\n /**\n * Parses out SEI captions and interacts with underlying\n * CaptionStream to return dispatched captions\n *\n * @param {Uint8Array} segment - The fmp4 segment containing embedded captions\n * @param {Number[]} videoTrackIds - A list of video tracks found in the init segment\n * @param {Object.<Number, Number>} timescales - The timescales found in the init segment\n * @see parseEmbeddedCaptions\n * @see m2ts/caption-stream.js\n **/\n\n\n this.parse = function (segment, videoTrackIds, timescales) {\n var parsedData;\n\n if (!this.isInitialized()) {\n return null; // This is not likely to be a video segment\n } else if (!videoTrackIds || !timescales) {\n return null;\n } else if (this.isNewInit(videoTrackIds, timescales)) {\n // Use the first video track only as there is no\n // mechanism to switch to other video tracks\n trackId = videoTrackIds[0];\n timescale = timescales[trackId]; // If an init segment has not been seen yet, hold onto segment\n // data until we have one.\n // the ISO-BMFF spec says that trackId can't be zero, but there's some broken content out there\n } else if (trackId === null || !timescale) {\n segmentCache.push(segment);\n return null;\n } // Now that a timescale and trackId is set, parse cached segments\n\n\n while (segmentCache.length > 0) {\n var cachedSegment = segmentCache.shift();\n this.parse(cachedSegment, videoTrackIds, timescales);\n }\n\n parsedData = parseEmbeddedCaptions(segment, trackId, timescale);\n\n if (parsedData && parsedData.logs) {\n parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs);\n }\n\n if (parsedData === null || !parsedData.seiNals) {\n if (parsedCaptions.logs.length) {\n return {\n logs: parsedCaptions.logs,\n captions: [],\n captionStreams: []\n };\n }\n\n return null;\n }\n\n this.pushNals(parsedData.seiNals); // Force the parsed captions to be dispatched\n\n this.flushStream();\n return parsedCaptions;\n };\n /**\n * Pushes SEI NALUs onto CaptionStream\n * @param {Object[]} nals - A list of SEI nals parsed using `parseCaptionNals`\n * Assumes that `parseCaptionNals` has been called first\n * @see m2ts/caption-stream.js\n **/\n\n\n this.pushNals = function (nals) {\n if (!this.isInitialized() || !nals || nals.length === 0) {\n return null;\n }\n\n nals.forEach(function (nal) {\n captionStream.push(nal);\n });\n };\n /**\n * Flushes underlying CaptionStream to dispatch processed, displayable captions\n * @see m2ts/caption-stream.js\n **/\n\n\n this.flushStream = function () {\n if (!this.isInitialized()) {\n return null;\n }\n\n if (!parsingPartial) {\n captionStream.flush();\n } else {\n captionStream.partialFlush();\n }\n };\n /**\n * Reset caption buckets for new data\n **/\n\n\n this.clearParsedCaptions = function () {\n parsedCaptions.captions = [];\n parsedCaptions.captionStreams = {};\n parsedCaptions.logs = [];\n };\n /**\n * Resets underlying CaptionStream\n * @see m2ts/caption-stream.js\n **/\n\n\n this.resetCaptionStream = function () {\n if (!this.isInitialized()) {\n return null;\n }\n\n captionStream.reset();\n };\n /**\n * Convenience method to clear all captions flushed from the\n * CaptionStream and still being parsed\n * @see m2ts/caption-stream.js\n **/\n\n\n this.clearAllCaptions = function () {\n this.clearParsedCaptions();\n this.resetCaptionStream();\n };\n /**\n * Reset caption parser\n **/\n\n\n this.reset = function () {\n segmentCache = [];\n trackId = null;\n timescale = null;\n\n if (!parsedCaptions) {\n parsedCaptions = {\n captions: [],\n // CC1, CC2, CC3, CC4\n captionStreams: {},\n logs: []\n };\n } else {\n this.clearParsedCaptions();\n }\n\n this.resetCaptionStream();\n };\n\n this.reset();\n };\n\n var captionParser = CaptionParser;\n var toUnsigned = bin.toUnsigned;\n var toHexString = bin.toHexString;\n var timescale, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader;\n /**\n * Parses an MP4 initialization segment and extracts the timescale\n * values for any declared tracks. Timescale values indicate the\n * number of clock ticks per second to assume for time-based values\n * elsewhere in the MP4.\n *\n * To determine the start time of an MP4, you need two pieces of\n * information: the timescale unit and the earliest base media decode\n * time. Multiple timescales can be specified within an MP4 but the\n * base media decode time is always expressed in the timescale from\n * the media header box for the track:\n * ```\n * moov > trak > mdia > mdhd.timescale\n * ```\n * @param init {Uint8Array} the bytes of the init segment\n * @return {object} a hash of track ids to timescale values or null if\n * the init segment is malformed.\n */\n\n timescale = function timescale(init) {\n var result = {},\n traks = findBox_1(init, ['moov', 'trak']); // mdhd timescale\n\n return traks.reduce(function (result, trak) {\n var tkhd, version, index, id, mdhd;\n tkhd = findBox_1(trak, ['tkhd'])[0];\n\n if (!tkhd) {\n return null;\n }\n\n version = tkhd[0];\n index = version === 0 ? 12 : 20;\n id = toUnsigned(tkhd[index] << 24 | tkhd[index + 1] << 16 | tkhd[index + 2] << 8 | tkhd[index + 3]);\n mdhd = findBox_1(trak, ['mdia', 'mdhd'])[0];\n\n if (!mdhd) {\n return null;\n }\n\n version = mdhd[0];\n index = version === 0 ? 12 : 20;\n result[id] = toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]);\n return result;\n }, result);\n };\n /**\n * Determine the base media decode start time, in seconds, for an MP4\n * fragment. If multiple fragments are specified, the earliest time is\n * returned.\n *\n * The base media decode time can be parsed from track fragment\n * metadata:\n * ```\n * moof > traf > tfdt.baseMediaDecodeTime\n * ```\n * It requires the timescale value from the mdhd to interpret.\n *\n * @param timescale {object} a hash of track ids to timescale values.\n * @return {number} the earliest base media decode start time for the\n * fragment, in seconds\n */\n\n\n startTime = function startTime(timescale, fragment) {\n var trafs, baseTimes, result; // we need info from two childrend of each track fragment box\n\n trafs = findBox_1(fragment, ['moof', 'traf']); // determine the start times for each track\n\n baseTimes = [].concat.apply([], trafs.map(function (traf) {\n return findBox_1(traf, ['tfhd']).map(function (tfhd) {\n var id, scale, baseTime; // get the track id from the tfhd\n\n id = toUnsigned(tfhd[4] << 24 | tfhd[5] << 16 | tfhd[6] << 8 | tfhd[7]); // assume a 90kHz clock if no timescale was specified\n\n scale = timescale[id] || 90e3; // get the base media decode time from the tfdt\n\n baseTime = findBox_1(traf, ['tfdt']).map(function (tfdt) {\n var version, result;\n version = tfdt[0];\n result = toUnsigned(tfdt[4] << 24 | tfdt[5] << 16 | tfdt[6] << 8 | tfdt[7]);\n\n if (version === 1) {\n result *= Math.pow(2, 32);\n result += toUnsigned(tfdt[8] << 24 | tfdt[9] << 16 | tfdt[10] << 8 | tfdt[11]);\n }\n\n return result;\n })[0];\n baseTime = typeof baseTime === 'number' && !isNaN(baseTime) ? baseTime : Infinity; // convert base time to seconds\n\n return baseTime / scale;\n });\n })); // return the minimum\n\n result = Math.min.apply(null, baseTimes);\n return isFinite(result) ? result : 0;\n };\n /**\n * Determine the composition start, in seconds, for an MP4\n * fragment.\n *\n * The composition start time of a fragment can be calculated using the base\n * media decode time, composition time offset, and timescale, as follows:\n *\n * compositionStartTime = (baseMediaDecodeTime + compositionTimeOffset) / timescale\n *\n * All of the aforementioned information is contained within a media fragment's\n * `traf` box, except for timescale info, which comes from the initialization\n * segment, so a track id (also contained within a `traf`) is also necessary to\n * associate it with a timescale\n *\n *\n * @param timescales {object} - a hash of track ids to timescale values.\n * @param fragment {Unit8Array} - the bytes of a media segment\n * @return {number} the composition start time for the fragment, in seconds\n **/\n\n\n compositionStartTime = function compositionStartTime(timescales, fragment) {\n var trafBoxes = findBox_1(fragment, ['moof', 'traf']);\n var baseMediaDecodeTime = 0;\n var compositionTimeOffset = 0;\n var trackId;\n\n if (trafBoxes && trafBoxes.length) {\n // The spec states that track run samples contained within a `traf` box are contiguous, but\n // it does not explicitly state whether the `traf` boxes themselves are contiguous.\n // We will assume that they are, so we only need the first to calculate start time.\n var tfhd = findBox_1(trafBoxes[0], ['tfhd'])[0];\n var trun = findBox_1(trafBoxes[0], ['trun'])[0];\n var tfdt = findBox_1(trafBoxes[0], ['tfdt'])[0];\n\n if (tfhd) {\n var parsedTfhd = parseTfhd(tfhd);\n trackId = parsedTfhd.trackId;\n }\n\n if (tfdt) {\n var parsedTfdt = parseTfdt(tfdt);\n baseMediaDecodeTime = parsedTfdt.baseMediaDecodeTime;\n }\n\n if (trun) {\n var parsedTrun = parseTrun(trun);\n\n if (parsedTrun.samples && parsedTrun.samples.length) {\n compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0;\n }\n }\n } // Get timescale for this specific track. Assume a 90kHz clock if no timescale was\n // specified.\n\n\n var timescale = timescales[trackId] || 90e3; // return the composition start time, in seconds\n\n return (baseMediaDecodeTime + compositionTimeOffset) / timescale;\n };\n /**\n * Find the trackIds of the video tracks in this source.\n * Found by parsing the Handler Reference and Track Header Boxes:\n * moov > trak > mdia > hdlr\n * moov > trak > tkhd\n *\n * @param {Uint8Array} init - The bytes of the init segment for this source\n * @return {Number[]} A list of trackIds\n *\n * @see ISO-BMFF-12/2015, Section 8.4.3\n **/\n\n\n getVideoTrackIds = function getVideoTrackIds(init) {\n var traks = findBox_1(init, ['moov', 'trak']);\n var videoTrackIds = [];\n traks.forEach(function (trak) {\n var hdlrs = findBox_1(trak, ['mdia', 'hdlr']);\n var tkhds = findBox_1(trak, ['tkhd']);\n hdlrs.forEach(function (hdlr, index) {\n var handlerType = parseType_1(hdlr.subarray(8, 12));\n var tkhd = tkhds[index];\n var view;\n var version;\n var trackId;\n\n if (handlerType === 'vide') {\n view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n version = view.getUint8(0);\n trackId = version === 0 ? view.getUint32(12) : view.getUint32(20);\n videoTrackIds.push(trackId);\n }\n });\n });\n return videoTrackIds;\n };\n\n getTimescaleFromMediaHeader = function getTimescaleFromMediaHeader(mdhd) {\n // mdhd is a FullBox, meaning it will have its own version as the first byte\n var version = mdhd[0];\n var index = version === 0 ? 12 : 20;\n return toUnsigned(mdhd[index] << 24 | mdhd[index + 1] << 16 | mdhd[index + 2] << 8 | mdhd[index + 3]);\n };\n /**\n * Get all the video, audio, and hint tracks from a non fragmented\n * mp4 segment\n */\n\n\n getTracks = function getTracks(init) {\n var traks = findBox_1(init, ['moov', 'trak']);\n var tracks = [];\n traks.forEach(function (trak) {\n var track = {};\n var tkhd = findBox_1(trak, ['tkhd'])[0];\n var view, tkhdVersion; // id\n\n if (tkhd) {\n view = new DataView(tkhd.buffer, tkhd.byteOffset, tkhd.byteLength);\n tkhdVersion = view.getUint8(0);\n track.id = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);\n }\n\n var hdlr = findBox_1(trak, ['mdia', 'hdlr'])[0]; // type\n\n if (hdlr) {\n var type = parseType_1(hdlr.subarray(8, 12));\n\n if (type === 'vide') {\n track.type = 'video';\n } else if (type === 'soun') {\n track.type = 'audio';\n } else {\n track.type = type;\n }\n } // codec\n\n\n var stsd = findBox_1(trak, ['mdia', 'minf', 'stbl', 'stsd'])[0];\n\n if (stsd) {\n var sampleDescriptions = stsd.subarray(8); // gives the codec type string\n\n track.codec = parseType_1(sampleDescriptions.subarray(4, 8));\n var codecBox = findBox_1(sampleDescriptions, [track.codec])[0];\n var codecConfig, codecConfigType;\n\n if (codecBox) {\n // https://tools.ietf.org/html/rfc6381#section-3.3\n if (/^[a-z]vc[1-9]$/i.test(track.codec)) {\n // we don't need anything but the \"config\" parameter of the\n // avc1 codecBox\n codecConfig = codecBox.subarray(78);\n codecConfigType = parseType_1(codecConfig.subarray(4, 8));\n\n if (codecConfigType === 'avcC' && codecConfig.length > 11) {\n track.codec += '.'; // left padded with zeroes for single digit hex\n // profile idc\n\n track.codec += toHexString(codecConfig[9]); // the byte containing the constraint_set flags\n\n track.codec += toHexString(codecConfig[10]); // level idc\n\n track.codec += toHexString(codecConfig[11]);\n } else {\n // TODO: show a warning that we couldn't parse the codec\n // and are using the default\n track.codec = 'avc1.4d400d';\n }\n } else if (/^mp4[a,v]$/i.test(track.codec)) {\n // we do not need anything but the streamDescriptor of the mp4a codecBox\n codecConfig = codecBox.subarray(28);\n codecConfigType = parseType_1(codecConfig.subarray(4, 8));\n\n if (codecConfigType === 'esds' && codecConfig.length > 20 && codecConfig[19] !== 0) {\n track.codec += '.' + toHexString(codecConfig[19]); // this value is only a single digit\n\n track.codec += '.' + toHexString(codecConfig[20] >>> 2 & 0x3f).replace(/^0/, '');\n } else {\n // TODO: show a warning that we couldn't parse the codec\n // and are using the default\n track.codec = 'mp4a.40.2';\n }\n } else {\n // flac, opus, etc\n track.codec = track.codec.toLowerCase();\n }\n }\n }\n\n var mdhd = findBox_1(trak, ['mdia', 'mdhd'])[0];\n\n if (mdhd) {\n track.timescale = getTimescaleFromMediaHeader(mdhd);\n }\n\n tracks.push(track);\n });\n return tracks;\n };\n\n var probe$2 = {\n // export mp4 inspector's findBox and parseType for backwards compatibility\n findBox: findBox_1,\n parseType: parseType_1,\n timescale: timescale,\n startTime: startTime,\n compositionStartTime: compositionStartTime,\n videoTrackIds: getVideoTrackIds,\n tracks: getTracks,\n getTimescaleFromMediaHeader: getTimescaleFromMediaHeader\n };\n\n var parsePid = function parsePid(packet) {\n var pid = packet[1] & 0x1f;\n pid <<= 8;\n pid |= packet[2];\n return pid;\n };\n\n var parsePayloadUnitStartIndicator = function parsePayloadUnitStartIndicator(packet) {\n return !!(packet[1] & 0x40);\n };\n\n var parseAdaptionField = function parseAdaptionField(packet) {\n var offset = 0; // if an adaption field is present, its length is specified by the\n // fifth byte of the TS packet header. The adaptation field is\n // used to add stuffing to PES packets that don't fill a complete\n // TS packet, and to specify some forms of timing and control data\n // that we do not currently use.\n\n if ((packet[3] & 0x30) >>> 4 > 0x01) {\n offset += packet[4] + 1;\n }\n\n return offset;\n };\n\n var parseType = function parseType(packet, pmtPid) {\n var pid = parsePid(packet);\n\n if (pid === 0) {\n return 'pat';\n } else if (pid === pmtPid) {\n return 'pmt';\n } else if (pmtPid) {\n return 'pes';\n }\n\n return null;\n };\n\n var parsePat = function parsePat(packet) {\n var pusi = parsePayloadUnitStartIndicator(packet);\n var offset = 4 + parseAdaptionField(packet);\n\n if (pusi) {\n offset += packet[offset] + 1;\n }\n\n return (packet[offset + 10] & 0x1f) << 8 | packet[offset + 11];\n };\n\n var parsePmt = function parsePmt(packet) {\n var programMapTable = {};\n var pusi = parsePayloadUnitStartIndicator(packet);\n var payloadOffset = 4 + parseAdaptionField(packet);\n\n if (pusi) {\n payloadOffset += packet[payloadOffset] + 1;\n } // PMTs can be sent ahead of the time when they should actually\n // take effect. We don't believe this should ever be the case\n // for HLS but we'll ignore \"forward\" PMT declarations if we see\n // them. Future PMT declarations have the current_next_indicator\n // set to zero.\n\n\n if (!(packet[payloadOffset + 5] & 0x01)) {\n return;\n }\n\n var sectionLength, tableEnd, programInfoLength; // the mapping table ends at the end of the current section\n\n sectionLength = (packet[payloadOffset + 1] & 0x0f) << 8 | packet[payloadOffset + 2];\n tableEnd = 3 + sectionLength - 4; // to determine where the table is, we have to figure out how\n // long the program info descriptors are\n\n programInfoLength = (packet[payloadOffset + 10] & 0x0f) << 8 | packet[payloadOffset + 11]; // advance the offset to the first entry in the mapping table\n\n var offset = 12 + programInfoLength;\n\n while (offset < tableEnd) {\n var i = payloadOffset + offset; // add an entry that maps the elementary_pid to the stream_type\n\n programMapTable[(packet[i + 1] & 0x1F) << 8 | packet[i + 2]] = packet[i]; // move to the next table entry\n // skip past the elementary stream descriptors, if present\n\n offset += ((packet[i + 3] & 0x0F) << 8 | packet[i + 4]) + 5;\n }\n\n return programMapTable;\n };\n\n var parsePesType = function parsePesType(packet, programMapTable) {\n var pid = parsePid(packet);\n var type = programMapTable[pid];\n\n switch (type) {\n case streamTypes.H264_STREAM_TYPE:\n return 'video';\n\n case streamTypes.ADTS_STREAM_TYPE:\n return 'audio';\n\n case streamTypes.METADATA_STREAM_TYPE:\n return 'timed-metadata';\n\n default:\n return null;\n }\n };\n\n var parsePesTime = function parsePesTime(packet) {\n var pusi = parsePayloadUnitStartIndicator(packet);\n\n if (!pusi) {\n return null;\n }\n\n var offset = 4 + parseAdaptionField(packet);\n\n if (offset >= packet.byteLength) {\n // From the H 222.0 MPEG-TS spec\n // \"For transport stream packets carrying PES packets, stuffing is needed when there\n // is insufficient PES packet data to completely fill the transport stream packet\n // payload bytes. Stuffing is accomplished by defining an adaptation field longer than\n // the sum of the lengths of the data elements in it, so that the payload bytes\n // remaining after the adaptation field exactly accommodates the available PES packet\n // data.\"\n //\n // If the offset is >= the length of the packet, then the packet contains no data\n // and instead is just adaption field stuffing bytes\n return null;\n }\n\n var pes = null;\n var ptsDtsFlags; // PES packets may be annotated with a PTS value, or a PTS value\n // and a DTS value. Determine what combination of values is\n // available to work with.\n\n ptsDtsFlags = packet[offset + 7]; // PTS and DTS are normally stored as a 33-bit number. Javascript\n // performs all bitwise operations on 32-bit integers but javascript\n // supports a much greater range (52-bits) of integer using standard\n // mathematical operations.\n // We construct a 31-bit value using bitwise operators over the 31\n // most significant bits and then multiply by 4 (equal to a left-shift\n // of 2) before we add the final 2 least significant bits of the\n // timestamp (equal to an OR.)\n\n if (ptsDtsFlags & 0xC0) {\n pes = {}; // the PTS and DTS are not written out directly. For information\n // on how they are encoded, see\n // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html\n\n pes.pts = (packet[offset + 9] & 0x0E) << 27 | (packet[offset + 10] & 0xFF) << 20 | (packet[offset + 11] & 0xFE) << 12 | (packet[offset + 12] & 0xFF) << 5 | (packet[offset + 13] & 0xFE) >>> 3;\n pes.pts *= 4; // Left shift by 2\n\n pes.pts += (packet[offset + 13] & 0x06) >>> 1; // OR by the two LSBs\n\n pes.dts = pes.pts;\n\n if (ptsDtsFlags & 0x40) {\n pes.dts = (packet[offset + 14] & 0x0E) << 27 | (packet[offset + 15] & 0xFF) << 20 | (packet[offset + 16] & 0xFE) << 12 | (packet[offset + 17] & 0xFF) << 5 | (packet[offset + 18] & 0xFE) >>> 3;\n pes.dts *= 4; // Left shift by 2\n\n pes.dts += (packet[offset + 18] & 0x06) >>> 1; // OR by the two LSBs\n }\n }\n\n return pes;\n };\n\n var parseNalUnitType = function parseNalUnitType(type) {\n switch (type) {\n case 0x05:\n return 'slice_layer_without_partitioning_rbsp_idr';\n\n case 0x06:\n return 'sei_rbsp';\n\n case 0x07:\n return 'seq_parameter_set_rbsp';\n\n case 0x08:\n return 'pic_parameter_set_rbsp';\n\n case 0x09:\n return 'access_unit_delimiter_rbsp';\n\n default:\n return null;\n }\n };\n\n var videoPacketContainsKeyFrame = function videoPacketContainsKeyFrame(packet) {\n var offset = 4 + parseAdaptionField(packet);\n var frameBuffer = packet.subarray(offset);\n var frameI = 0;\n var frameSyncPoint = 0;\n var foundKeyFrame = false;\n var nalType; // advance the sync point to a NAL start, if necessary\n\n for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {\n if (frameBuffer[frameSyncPoint + 2] === 1) {\n // the sync point is properly aligned\n frameI = frameSyncPoint + 5;\n break;\n }\n }\n\n while (frameI < frameBuffer.byteLength) {\n // look at the current byte to determine if we've hit the end of\n // a NAL unit boundary\n switch (frameBuffer[frameI]) {\n case 0:\n // skip past non-sync sequences\n if (frameBuffer[frameI - 1] !== 0) {\n frameI += 2;\n break;\n } else if (frameBuffer[frameI - 2] !== 0) {\n frameI++;\n break;\n }\n\n if (frameSyncPoint + 3 !== frameI - 2) {\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n } // drop trailing zeroes\n\n\n do {\n frameI++;\n } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);\n\n frameSyncPoint = frameI - 2;\n frameI += 3;\n break;\n\n case 1:\n // skip past non-sync sequences\n if (frameBuffer[frameI - 1] !== 0 || frameBuffer[frameI - 2] !== 0) {\n frameI += 3;\n break;\n }\n\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n\n frameSyncPoint = frameI - 2;\n frameI += 3;\n break;\n\n default:\n // the current byte isn't a one or zero, so it cannot be part\n // of a sync sequence\n frameI += 3;\n break;\n }\n }\n\n frameBuffer = frameBuffer.subarray(frameSyncPoint);\n frameI -= frameSyncPoint;\n frameSyncPoint = 0; // parse the final nal\n\n if (frameBuffer && frameBuffer.byteLength > 3) {\n nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 0x1f);\n\n if (nalType === 'slice_layer_without_partitioning_rbsp_idr') {\n foundKeyFrame = true;\n }\n }\n\n return foundKeyFrame;\n };\n\n var probe$1 = {\n parseType: parseType,\n parsePat: parsePat,\n parsePmt: parsePmt,\n parsePayloadUnitStartIndicator: parsePayloadUnitStartIndicator,\n parsePesType: parsePesType,\n parsePesTime: parsePesTime,\n videoPacketContainsKeyFrame: videoPacketContainsKeyFrame\n };\n var handleRollover = timestampRolloverStream.handleRollover;\n var probe = {};\n probe.ts = probe$1;\n probe.aac = utils;\n var ONE_SECOND_IN_TS = clock.ONE_SECOND_IN_TS;\n var MP2T_PACKET_LENGTH = 188,\n // bytes\n SYNC_BYTE = 0x47;\n /**\n * walks through segment data looking for pat and pmt packets to parse out\n * program map table information\n */\n\n var parsePsi_ = function parsePsi_(bytes, pmt) {\n var startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet,\n type;\n\n while (endIndex < bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pat':\n pmt.pid = probe.ts.parsePat(packet);\n break;\n\n case 'pmt':\n var table = probe.ts.parsePmt(packet);\n pmt.table = pmt.table || {};\n Object.keys(table).forEach(function (key) {\n pmt.table[key] = table[key];\n });\n break;\n }\n\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n\n startIndex++;\n endIndex++;\n }\n };\n /**\n * walks through the segment data from the start and end to get timing information\n * for the first and last audio pes packets\n */\n\n\n var parseAudioPes_ = function parseAudioPes_(bytes, pmt, result) {\n var startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet,\n type,\n pesType,\n pusi,\n parsed;\n var endLoop = false; // Start walking from start of segment to get first audio packet\n\n while (endIndex <= bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n if (pesType === 'audio' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n\n if (parsed) {\n parsed.type = 'audio';\n result.audio.push(parsed);\n endLoop = true;\n }\n }\n\n break;\n }\n\n if (endLoop) {\n break;\n }\n\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n\n startIndex++;\n endIndex++;\n } // Start walking from end of segment to get last audio packet\n\n\n endIndex = bytes.byteLength;\n startIndex = endIndex - MP2T_PACKET_LENGTH;\n endLoop = false;\n\n while (startIndex >= 0) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n if (pesType === 'audio' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n\n if (parsed) {\n parsed.type = 'audio';\n result.audio.push(parsed);\n endLoop = true;\n }\n }\n\n break;\n }\n\n if (endLoop) {\n break;\n }\n\n startIndex -= MP2T_PACKET_LENGTH;\n endIndex -= MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n\n startIndex--;\n endIndex--;\n }\n };\n /**\n * walks through the segment data from the start and end to get timing information\n * for the first and last video pes packets as well as timing information for the first\n * key frame.\n */\n\n\n var parseVideoPes_ = function parseVideoPes_(bytes, pmt, result) {\n var startIndex = 0,\n endIndex = MP2T_PACKET_LENGTH,\n packet,\n type,\n pesType,\n pusi,\n parsed,\n frame,\n i,\n pes;\n var endLoop = false;\n var currentFrame = {\n data: [],\n size: 0\n }; // Start walking from start of segment to get first video packet\n\n while (endIndex < bytes.byteLength) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n if (pesType === 'video') {\n if (pusi && !endLoop) {\n parsed = probe.ts.parsePesTime(packet);\n\n if (parsed) {\n parsed.type = 'video';\n result.video.push(parsed);\n endLoop = true;\n }\n }\n\n if (!result.firstKeyFrame) {\n if (pusi) {\n if (currentFrame.size !== 0) {\n frame = new Uint8Array(currentFrame.size);\n i = 0;\n\n while (currentFrame.data.length) {\n pes = currentFrame.data.shift();\n frame.set(pes, i);\n i += pes.byteLength;\n }\n\n if (probe.ts.videoPacketContainsKeyFrame(frame)) {\n var firstKeyFrame = probe.ts.parsePesTime(frame); // PTS/DTS may not be available. Simply *not* setting\n // the keyframe seems to work fine with HLS playback\n // and definitely preferable to a crash with TypeError...\n\n if (firstKeyFrame) {\n result.firstKeyFrame = firstKeyFrame;\n result.firstKeyFrame.type = 'video';\n } else {\n // eslint-disable-next-line\n console.warn('Failed to extract PTS/DTS from PES at first keyframe. ' + 'This could be an unusual TS segment, or else mux.js did not ' + 'parse your TS segment correctly. If you know your TS ' + 'segments do contain PTS/DTS on keyframes please file a bug ' + 'report! You can try ffprobe to double check for yourself.');\n }\n }\n\n currentFrame.size = 0;\n }\n }\n\n currentFrame.data.push(packet);\n currentFrame.size += packet.byteLength;\n }\n }\n\n break;\n }\n\n if (endLoop && result.firstKeyFrame) {\n break;\n }\n\n startIndex += MP2T_PACKET_LENGTH;\n endIndex += MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n\n startIndex++;\n endIndex++;\n } // Start walking from end of segment to get last video packet\n\n\n endIndex = bytes.byteLength;\n startIndex = endIndex - MP2T_PACKET_LENGTH;\n endLoop = false;\n\n while (startIndex >= 0) {\n // Look for a pair of start and end sync bytes in the data..\n if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {\n // We found a packet\n packet = bytes.subarray(startIndex, endIndex);\n type = probe.ts.parseType(packet, pmt.pid);\n\n switch (type) {\n case 'pes':\n pesType = probe.ts.parsePesType(packet, pmt.table);\n pusi = probe.ts.parsePayloadUnitStartIndicator(packet);\n\n if (pesType === 'video' && pusi) {\n parsed = probe.ts.parsePesTime(packet);\n\n if (parsed) {\n parsed.type = 'video';\n result.video.push(parsed);\n endLoop = true;\n }\n }\n\n break;\n }\n\n if (endLoop) {\n break;\n }\n\n startIndex -= MP2T_PACKET_LENGTH;\n endIndex -= MP2T_PACKET_LENGTH;\n continue;\n } // If we get here, we have somehow become de-synchronized and we need to step\n // forward one byte at a time until we find a pair of sync bytes that denote\n // a packet\n\n\n startIndex--;\n endIndex--;\n }\n };\n /**\n * Adjusts the timestamp information for the segment to account for\n * rollover and convert to seconds based on pes packet timescale (90khz clock)\n */\n\n\n var adjustTimestamp_ = function adjustTimestamp_(segmentInfo, baseTimestamp) {\n if (segmentInfo.audio && segmentInfo.audio.length) {\n var audioBaseTimestamp = baseTimestamp;\n\n if (typeof audioBaseTimestamp === 'undefined' || isNaN(audioBaseTimestamp)) {\n audioBaseTimestamp = segmentInfo.audio[0].dts;\n }\n\n segmentInfo.audio.forEach(function (info) {\n info.dts = handleRollover(info.dts, audioBaseTimestamp);\n info.pts = handleRollover(info.pts, audioBaseTimestamp); // time in seconds\n\n info.dtsTime = info.dts / ONE_SECOND_IN_TS;\n info.ptsTime = info.pts / ONE_SECOND_IN_TS;\n });\n }\n\n if (segmentInfo.video && segmentInfo.video.length) {\n var videoBaseTimestamp = baseTimestamp;\n\n if (typeof videoBaseTimestamp === 'undefined' || isNaN(videoBaseTimestamp)) {\n videoBaseTimestamp = segmentInfo.video[0].dts;\n }\n\n segmentInfo.video.forEach(function (info) {\n info.dts = handleRollover(info.dts, videoBaseTimestamp);\n info.pts = handleRollover(info.pts, videoBaseTimestamp); // time in seconds\n\n info.dtsTime = info.dts / ONE_SECOND_IN_TS;\n info.ptsTime = info.pts / ONE_SECOND_IN_TS;\n });\n\n if (segmentInfo.firstKeyFrame) {\n var frame = segmentInfo.firstKeyFrame;\n frame.dts = handleRollover(frame.dts, videoBaseTimestamp);\n frame.pts = handleRollover(frame.pts, videoBaseTimestamp); // time in seconds\n\n frame.dtsTime = frame.dts / ONE_SECOND_IN_TS;\n frame.ptsTime = frame.pts / ONE_SECOND_IN_TS;\n }\n }\n };\n /**\n * inspects the aac data stream for start and end time information\n */\n\n\n var inspectAac_ = function inspectAac_(bytes) {\n var endLoop = false,\n audioCount = 0,\n sampleRate = null,\n timestamp = null,\n frameSize = 0,\n byteIndex = 0,\n packet;\n\n while (bytes.length - byteIndex >= 3) {\n var type = probe.aac.parseType(bytes, byteIndex);\n\n switch (type) {\n case 'timed-metadata':\n // Exit early because we don't have enough to parse\n // the ID3 tag header\n if (bytes.length - byteIndex < 10) {\n endLoop = true;\n break;\n }\n\n frameSize = probe.aac.parseId3TagSize(bytes, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n\n if (frameSize > bytes.length) {\n endLoop = true;\n break;\n }\n\n if (timestamp === null) {\n packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n timestamp = probe.aac.parseAacTimestamp(packet);\n }\n\n byteIndex += frameSize;\n break;\n\n case 'audio':\n // Exit early because we don't have enough to parse\n // the ADTS frame header\n if (bytes.length - byteIndex < 7) {\n endLoop = true;\n break;\n }\n\n frameSize = probe.aac.parseAdtsSize(bytes, byteIndex); // Exit early if we don't have enough in the buffer\n // to emit a full packet\n\n if (frameSize > bytes.length) {\n endLoop = true;\n break;\n }\n\n if (sampleRate === null) {\n packet = bytes.subarray(byteIndex, byteIndex + frameSize);\n sampleRate = probe.aac.parseSampleRate(packet);\n }\n\n audioCount++;\n byteIndex += frameSize;\n break;\n\n default:\n byteIndex++;\n break;\n }\n\n if (endLoop) {\n return null;\n }\n }\n\n if (sampleRate === null || timestamp === null) {\n return null;\n }\n\n var audioTimescale = ONE_SECOND_IN_TS / sampleRate;\n var result = {\n audio: [{\n type: 'audio',\n dts: timestamp,\n pts: timestamp\n }, {\n type: 'audio',\n dts: timestamp + audioCount * 1024 * audioTimescale,\n pts: timestamp + audioCount * 1024 * audioTimescale\n }]\n };\n return result;\n };\n /**\n * inspects the transport stream segment data for start and end time information\n * of the audio and video tracks (when present) as well as the first key frame's\n * start time.\n */\n\n\n var inspectTs_ = function inspectTs_(bytes) {\n var pmt = {\n pid: null,\n table: null\n };\n var result = {};\n parsePsi_(bytes, pmt);\n\n for (var pid in pmt.table) {\n if (pmt.table.hasOwnProperty(pid)) {\n var type = pmt.table[pid];\n\n switch (type) {\n case streamTypes.H264_STREAM_TYPE:\n result.video = [];\n parseVideoPes_(bytes, pmt, result);\n\n if (result.video.length === 0) {\n delete result.video;\n }\n\n break;\n\n case streamTypes.ADTS_STREAM_TYPE:\n result.audio = [];\n parseAudioPes_(bytes, pmt, result);\n\n if (result.audio.length === 0) {\n delete result.audio;\n }\n\n break;\n }\n }\n }\n\n return result;\n };\n /**\n * Inspects segment byte data and returns an object with start and end timing information\n *\n * @param {Uint8Array} bytes The segment byte data\n * @param {Number} baseTimestamp Relative reference timestamp used when adjusting frame\n * timestamps for rollover. This value must be in 90khz clock.\n * @return {Object} Object containing start and end frame timing info of segment.\n */\n\n\n var inspect = function inspect(bytes, baseTimestamp) {\n var isAacData = probe.aac.isLikelyAacData(bytes);\n var result;\n\n if (isAacData) {\n result = inspectAac_(bytes);\n } else {\n result = inspectTs_(bytes);\n }\n\n if (!result || !result.audio && !result.video) {\n return null;\n }\n\n adjustTimestamp_(result, baseTimestamp);\n return result;\n };\n\n var tsInspector = {\n inspect: inspect,\n parseAudioPes_: parseAudioPes_\n };\n /* global self */\n\n /**\n * Re-emits transmuxer events by converting them into messages to the\n * world outside the worker.\n *\n * @param {Object} transmuxer the transmuxer to wire events on\n * @private\n */\n\n var wireTransmuxerEvents = function wireTransmuxerEvents(self, transmuxer) {\n transmuxer.on('data', function (segment) {\n // transfer ownership of the underlying ArrayBuffer\n // instead of doing a copy to save memory\n // ArrayBuffers are transferable but generic TypedArrays are not\n // @link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Passing_data_by_transferring_ownership_(transferable_objects)\n var initArray = segment.initSegment;\n segment.initSegment = {\n data: initArray.buffer,\n byteOffset: initArray.byteOffset,\n byteLength: initArray.byteLength\n };\n var typedArray = segment.data;\n segment.data = typedArray.buffer;\n self.postMessage({\n action: 'data',\n segment: segment,\n byteOffset: typedArray.byteOffset,\n byteLength: typedArray.byteLength\n }, [segment.data]);\n });\n transmuxer.on('done', function (data) {\n self.postMessage({\n action: 'done'\n });\n });\n transmuxer.on('gopInfo', function (gopInfo) {\n self.postMessage({\n action: 'gopInfo',\n gopInfo: gopInfo\n });\n });\n transmuxer.on('videoSegmentTimingInfo', function (timingInfo) {\n var videoSegmentTimingInfo = {\n start: {\n decode: clock.videoTsToSeconds(timingInfo.start.dts),\n presentation: clock.videoTsToSeconds(timingInfo.start.pts)\n },\n end: {\n decode: clock.videoTsToSeconds(timingInfo.end.dts),\n presentation: clock.videoTsToSeconds(timingInfo.end.pts)\n },\n baseMediaDecodeTime: clock.videoTsToSeconds(timingInfo.baseMediaDecodeTime)\n };\n\n if (timingInfo.prependedContentDuration) {\n videoSegmentTimingInfo.prependedContentDuration = clock.videoTsToSeconds(timingInfo.prependedContentDuration);\n }\n\n self.postMessage({\n action: 'videoSegmentTimingInfo',\n videoSegmentTimingInfo: videoSegmentTimingInfo\n });\n });\n transmuxer.on('audioSegmentTimingInfo', function (timingInfo) {\n // Note that all times for [audio/video]SegmentTimingInfo events are in video clock\n var audioSegmentTimingInfo = {\n start: {\n decode: clock.videoTsToSeconds(timingInfo.start.dts),\n presentation: clock.videoTsToSeconds(timingInfo.start.pts)\n },\n end: {\n decode: clock.videoTsToSeconds(timingInfo.end.dts),\n presentation: clock.videoTsToSeconds(timingInfo.end.pts)\n },\n baseMediaDecodeTime: clock.videoTsToSeconds(timingInfo.baseMediaDecodeTime)\n };\n\n if (timingInfo.prependedContentDuration) {\n audioSegmentTimingInfo.prependedContentDuration = clock.videoTsToSeconds(timingInfo.prependedContentDuration);\n }\n\n self.postMessage({\n action: 'audioSegmentTimingInfo',\n audioSegmentTimingInfo: audioSegmentTimingInfo\n });\n });\n transmuxer.on('id3Frame', function (id3Frame) {\n self.postMessage({\n action: 'id3Frame',\n id3Frame: id3Frame\n });\n });\n transmuxer.on('caption', function (caption) {\n self.postMessage({\n action: 'caption',\n caption: caption\n });\n });\n transmuxer.on('trackinfo', function (trackInfo) {\n self.postMessage({\n action: 'trackinfo',\n trackInfo: trackInfo\n });\n });\n transmuxer.on('audioTimingInfo', function (audioTimingInfo) {\n // convert to video TS since we prioritize video time over audio\n self.postMessage({\n action: 'audioTimingInfo',\n audioTimingInfo: {\n start: clock.videoTsToSeconds(audioTimingInfo.start),\n end: clock.videoTsToSeconds(audioTimingInfo.end)\n }\n });\n });\n transmuxer.on('videoTimingInfo', function (videoTimingInfo) {\n self.postMessage({\n action: 'videoTimingInfo',\n videoTimingInfo: {\n start: clock.videoTsToSeconds(videoTimingInfo.start),\n end: clock.videoTsToSeconds(videoTimingInfo.end)\n }\n });\n });\n transmuxer.on('log', function (log) {\n self.postMessage({\n action: 'log',\n log: log\n });\n });\n };\n /**\n * All incoming messages route through this hash. If no function exists\n * to handle an incoming message, then we ignore the message.\n *\n * @class MessageHandlers\n * @param {Object} options the options to initialize with\n */\n\n\n var MessageHandlers = /*#__PURE__*/function () {\n function MessageHandlers(self, options) {\n this.options = options || {};\n this.self = self;\n this.init();\n }\n /**\n * initialize our web worker and wire all the events.\n */\n\n\n var _proto = MessageHandlers.prototype;\n\n _proto.init = function init() {\n if (this.transmuxer) {\n this.transmuxer.dispose();\n }\n\n this.transmuxer = new transmuxer.Transmuxer(this.options);\n wireTransmuxerEvents(this.self, this.transmuxer);\n };\n\n _proto.pushMp4Captions = function pushMp4Captions(data) {\n if (!this.captionParser) {\n this.captionParser = new captionParser();\n this.captionParser.init();\n }\n\n var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);\n var parsed = this.captionParser.parse(segment, data.trackIds, data.timescales);\n this.self.postMessage({\n action: 'mp4Captions',\n captions: parsed && parsed.captions || [],\n logs: parsed && parsed.logs || [],\n data: segment.buffer\n }, [segment.buffer]);\n };\n\n _proto.probeMp4StartTime = function probeMp4StartTime(_ref) {\n var timescales = _ref.timescales,\n data = _ref.data;\n var startTime = probe$2.startTime(timescales, data);\n this.self.postMessage({\n action: 'probeMp4StartTime',\n startTime: startTime,\n data: data\n }, [data.buffer]);\n };\n\n _proto.probeMp4Tracks = function probeMp4Tracks(_ref2) {\n var data = _ref2.data;\n var tracks = probe$2.tracks(data);\n this.self.postMessage({\n action: 'probeMp4Tracks',\n tracks: tracks,\n data: data\n }, [data.buffer]);\n }\n /**\n * Probe an mpeg2-ts segment to determine the start time of the segment in it's\n * internal \"media time,\" as well as whether it contains video and/or audio.\n *\n * @private\n * @param {Uint8Array} bytes - segment bytes\n * @param {number} baseStartTime\n * Relative reference timestamp used when adjusting frame timestamps for rollover.\n * This value should be in seconds, as it's converted to a 90khz clock within the\n * function body.\n * @return {Object} The start time of the current segment in \"media time\" as well as\n * whether it contains video and/or audio\n */\n ;\n\n _proto.probeTs = function probeTs(_ref3) {\n var data = _ref3.data,\n baseStartTime = _ref3.baseStartTime;\n var tsStartTime = typeof baseStartTime === 'number' && !isNaN(baseStartTime) ? baseStartTime * clock.ONE_SECOND_IN_TS : void 0;\n var timeInfo = tsInspector.inspect(data, tsStartTime);\n var result = null;\n\n if (timeInfo) {\n result = {\n // each type's time info comes back as an array of 2 times, start and end\n hasVideo: timeInfo.video && timeInfo.video.length === 2 || false,\n hasAudio: timeInfo.audio && timeInfo.audio.length === 2 || false\n };\n\n if (result.hasVideo) {\n result.videoStart = timeInfo.video[0].ptsTime;\n }\n\n if (result.hasAudio) {\n result.audioStart = timeInfo.audio[0].ptsTime;\n }\n }\n\n this.self.postMessage({\n action: 'probeTs',\n result: result,\n data: data\n }, [data.buffer]);\n };\n\n _proto.clearAllMp4Captions = function clearAllMp4Captions() {\n if (this.captionParser) {\n this.captionParser.clearAllCaptions();\n }\n };\n\n _proto.clearParsedMp4Captions = function clearParsedMp4Captions() {\n if (this.captionParser) {\n this.captionParser.clearParsedCaptions();\n }\n }\n /**\n * Adds data (a ts segment) to the start of the transmuxer pipeline for\n * processing.\n *\n * @param {ArrayBuffer} data data to push into the muxer\n */\n ;\n\n _proto.push = function push(data) {\n // Cast array buffer to correct type for transmuxer\n var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);\n this.transmuxer.push(segment);\n }\n /**\n * Recreate the transmuxer so that the next segment added via `push`\n * start with a fresh transmuxer.\n */\n ;\n\n _proto.reset = function reset() {\n this.transmuxer.reset();\n }\n /**\n * Set the value that will be used as the `baseMediaDecodeTime` time for the\n * next segment pushed in. Subsequent segments will have their `baseMediaDecodeTime`\n * set relative to the first based on the PTS values.\n *\n * @param {Object} data used to set the timestamp offset in the muxer\n */\n ;\n\n _proto.setTimestampOffset = function setTimestampOffset(data) {\n var timestampOffset = data.timestampOffset || 0;\n this.transmuxer.setBaseMediaDecodeTime(Math.round(clock.secondsToVideoTs(timestampOffset)));\n };\n\n _proto.setAudioAppendStart = function setAudioAppendStart(data) {\n this.transmuxer.setAudioAppendStart(Math.ceil(clock.secondsToVideoTs(data.appendStart)));\n };\n\n _proto.setRemux = function setRemux(data) {\n this.transmuxer.setRemux(data.remux);\n }\n /**\n * Forces the pipeline to finish processing the last segment and emit it's\n * results.\n *\n * @param {Object} data event data, not really used\n */\n ;\n\n _proto.flush = function flush(data) {\n this.transmuxer.flush(); // transmuxed done action is fired after both audio/video pipelines are flushed\n\n self.postMessage({\n action: 'done',\n type: 'transmuxed'\n });\n };\n\n _proto.endTimeline = function endTimeline() {\n this.transmuxer.endTimeline(); // transmuxed endedtimeline action is fired after both audio/video pipelines end their\n // timelines\n\n self.postMessage({\n action: 'endedtimeline',\n type: 'transmuxed'\n });\n };\n\n _proto.alignGopsWith = function alignGopsWith(data) {\n this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());\n };\n\n return MessageHandlers;\n }();\n /**\n * Our web worker interface so that things can talk to mux.js\n * that will be running in a web worker. the scope is passed to this by\n * webworkify.\n *\n * @param {Object} self the scope for the web worker\n */\n\n\n self.onmessage = function (event) {\n if (event.data.action === 'init' && event.data.options) {\n this.messageHandlers = new MessageHandlers(self, event.data.options);\n return;\n }\n\n if (!this.messageHandlers) {\n this.messageHandlers = new MessageHandlers(self);\n }\n\n if (event.data && event.data.action && event.data.action !== 'init') {\n if (this.messageHandlers[event.data.action]) {\n this.messageHandlers[event.data.action](event.data);\n }\n }\n };\n}));\nvar TransmuxWorker = factory(workerCode$1);\n/* rollup-plugin-worker-factory end for worker!/Users/bcasey/Projects/videojs-http-streaming/src/transmuxer-worker.js */\n\nvar handleData_ = function handleData_(event, transmuxedData, callback) {\n var _event$data$segment = event.data.segment,\n type = _event$data$segment.type,\n initSegment = _event$data$segment.initSegment,\n captions = _event$data$segment.captions,\n captionStreams = _event$data$segment.captionStreams,\n metadata = _event$data$segment.metadata,\n videoFrameDtsTime = _event$data$segment.videoFrameDtsTime,\n videoFramePtsTime = _event$data$segment.videoFramePtsTime;\n transmuxedData.buffer.push({\n captions: captions,\n captionStreams: captionStreams,\n metadata: metadata\n });\n var boxes = event.data.segment.boxes || {\n data: event.data.segment.data\n };\n var result = {\n type: type,\n // cast ArrayBuffer to TypedArray\n data: new Uint8Array(boxes.data, boxes.data.byteOffset, boxes.data.byteLength),\n initSegment: new Uint8Array(initSegment.data, initSegment.byteOffset, initSegment.byteLength)\n };\n\n if (typeof videoFrameDtsTime !== 'undefined') {\n result.videoFrameDtsTime = videoFrameDtsTime;\n }\n\n if (typeof videoFramePtsTime !== 'undefined') {\n result.videoFramePtsTime = videoFramePtsTime;\n }\n\n callback(result);\n};\n\nvar handleDone_ = function handleDone_(_ref) {\n var transmuxedData = _ref.transmuxedData,\n callback = _ref.callback; // Previously we only returned data on data events,\n // not on done events. Clear out the buffer to keep that consistent.\n\n transmuxedData.buffer = []; // all buffers should have been flushed from the muxer, so start processing anything we\n // have received\n\n callback(transmuxedData);\n};\n\nvar handleGopInfo_ = function handleGopInfo_(event, transmuxedData) {\n transmuxedData.gopInfo = event.data.gopInfo;\n};\n\nvar processTransmux = function processTransmux(options) {\n var transmuxer = options.transmuxer,\n bytes = options.bytes,\n audioAppendStart = options.audioAppendStart,\n gopsToAlignWith = options.gopsToAlignWith,\n remux = options.remux,\n onData = options.onData,\n onTrackInfo = options.onTrackInfo,\n onAudioTimingInfo = options.onAudioTimingInfo,\n onVideoTimingInfo = options.onVideoTimingInfo,\n onVideoSegmentTimingInfo = options.onVideoSegmentTimingInfo,\n onAudioSegmentTimingInfo = options.onAudioSegmentTimingInfo,\n onId3 = options.onId3,\n onCaptions = options.onCaptions,\n onDone = options.onDone,\n onEndedTimeline = options.onEndedTimeline,\n onTransmuxerLog = options.onTransmuxerLog,\n isEndOfTimeline = options.isEndOfTimeline;\n var transmuxedData = {\n buffer: []\n };\n var waitForEndedTimelineEvent = isEndOfTimeline;\n\n var handleMessage = function handleMessage(event) {\n if (transmuxer.currentTransmux !== options) {\n // disposed\n return;\n }\n\n if (event.data.action === 'data') {\n handleData_(event, transmuxedData, onData);\n }\n\n if (event.data.action === 'trackinfo') {\n onTrackInfo(event.data.trackInfo);\n }\n\n if (event.data.action === 'gopInfo') {\n handleGopInfo_(event, transmuxedData);\n }\n\n if (event.data.action === 'audioTimingInfo') {\n onAudioTimingInfo(event.data.audioTimingInfo);\n }\n\n if (event.data.action === 'videoTimingInfo') {\n onVideoTimingInfo(event.data.videoTimingInfo);\n }\n\n if (event.data.action === 'videoSegmentTimingInfo') {\n onVideoSegmentTimingInfo(event.data.videoSegmentTimingInfo);\n }\n\n if (event.data.action === 'audioSegmentTimingInfo') {\n onAudioSegmentTimingInfo(event.data.audioSegmentTimingInfo);\n }\n\n if (event.data.action === 'id3Frame') {\n onId3([event.data.id3Frame], event.data.id3Frame.dispatchType);\n }\n\n if (event.data.action === 'caption') {\n onCaptions(event.data.caption);\n }\n\n if (event.data.action === 'endedtimeline') {\n waitForEndedTimelineEvent = false;\n onEndedTimeline();\n }\n\n if (event.data.action === 'log') {\n onTransmuxerLog(event.data.log);\n } // wait for the transmuxed event since we may have audio and video\n\n\n if (event.data.type !== 'transmuxed') {\n return;\n } // If the \"endedtimeline\" event has not yet fired, and this segment represents the end\n // of a timeline, that means there may still be data events before the segment\n // processing can be considerred complete. In that case, the final event should be\n // an \"endedtimeline\" event with the type \"transmuxed.\"\n\n\n if (waitForEndedTimelineEvent) {\n return;\n }\n\n transmuxer.onmessage = null;\n handleDone_({\n transmuxedData: transmuxedData,\n callback: onDone\n });\n /* eslint-disable no-use-before-define */\n\n dequeue(transmuxer);\n /* eslint-enable */\n };\n\n transmuxer.onmessage = handleMessage;\n\n if (audioAppendStart) {\n transmuxer.postMessage({\n action: 'setAudioAppendStart',\n appendStart: audioAppendStart\n });\n } // allow empty arrays to be passed to clear out GOPs\n\n\n if (Array.isArray(gopsToAlignWith)) {\n transmuxer.postMessage({\n action: 'alignGopsWith',\n gopsToAlignWith: gopsToAlignWith\n });\n }\n\n if (typeof remux !== 'undefined') {\n transmuxer.postMessage({\n action: 'setRemux',\n remux: remux\n });\n }\n\n if (bytes.byteLength) {\n var buffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer;\n var byteOffset = bytes instanceof ArrayBuffer ? 0 : bytes.byteOffset;\n transmuxer.postMessage({\n action: 'push',\n // Send the typed-array of data as an ArrayBuffer so that\n // it can be sent as a \"Transferable\" and avoid the costly\n // memory copy\n data: buffer,\n // To recreate the original typed-array, we need information\n // about what portion of the ArrayBuffer it was a view into\n byteOffset: byteOffset,\n byteLength: bytes.byteLength\n }, [buffer]);\n }\n\n if (isEndOfTimeline) {\n transmuxer.postMessage({\n action: 'endTimeline'\n });\n } // even if we didn't push any bytes, we have to make sure we flush in case we reached\n // the end of the segment\n\n\n transmuxer.postMessage({\n action: 'flush'\n });\n};\n\nvar dequeue = function dequeue(transmuxer) {\n transmuxer.currentTransmux = null;\n\n if (transmuxer.transmuxQueue.length) {\n transmuxer.currentTransmux = transmuxer.transmuxQueue.shift();\n\n if (typeof transmuxer.currentTransmux === 'function') {\n transmuxer.currentTransmux();\n } else {\n processTransmux(transmuxer.currentTransmux);\n }\n }\n};\n\nvar processAction = function processAction(transmuxer, action) {\n transmuxer.postMessage({\n action: action\n });\n dequeue(transmuxer);\n};\n\nvar enqueueAction = function enqueueAction(action, transmuxer) {\n if (!transmuxer.currentTransmux) {\n transmuxer.currentTransmux = action;\n processAction(transmuxer, action);\n return;\n }\n\n transmuxer.transmuxQueue.push(processAction.bind(null, transmuxer, action));\n};\n\nvar video_es_reset = function reset(transmuxer) {\n enqueueAction('reset', transmuxer);\n};\n\nvar endTimeline = function endTimeline(transmuxer) {\n enqueueAction('endTimeline', transmuxer);\n};\n\nvar transmux = function transmux(options) {\n if (!options.transmuxer.currentTransmux) {\n options.transmuxer.currentTransmux = options;\n processTransmux(options);\n return;\n }\n\n options.transmuxer.transmuxQueue.push(options);\n};\n\nvar createTransmuxer = function createTransmuxer(options) {\n var transmuxer = new TransmuxWorker();\n transmuxer.currentTransmux = null;\n transmuxer.transmuxQueue = [];\n var term = transmuxer.terminate;\n\n transmuxer.terminate = function () {\n transmuxer.currentTransmux = null;\n transmuxer.transmuxQueue.length = 0;\n return term.call(transmuxer);\n };\n\n transmuxer.postMessage({\n action: 'init',\n options: options\n });\n return transmuxer;\n};\n\nvar segmentTransmuxer = {\n reset: video_es_reset,\n endTimeline: endTimeline,\n transmux: transmux,\n createTransmuxer: createTransmuxer\n};\n\nvar video_es_workerCallback = function workerCallback(options) {\n var transmuxer = options.transmuxer;\n var endAction = options.endAction || options.action;\n var callback = options.callback;\n\n var message = extends_default()({}, options, {\n endAction: null,\n transmuxer: null,\n callback: null\n });\n\n var listenForEndEvent = function listenForEndEvent(event) {\n if (event.data.action !== endAction) {\n return;\n }\n\n transmuxer.removeEventListener('message', listenForEndEvent); // transfer ownership of bytes back to us.\n\n if (event.data.data) {\n event.data.data = new Uint8Array(event.data.data, options.byteOffset || 0, options.byteLength || event.data.data.byteLength);\n\n if (options.data) {\n options.data = event.data.data;\n }\n }\n\n callback(event.data);\n };\n\n transmuxer.addEventListener('message', listenForEndEvent);\n\n if (options.data) {\n var isArrayBuffer = options.data instanceof ArrayBuffer;\n message.byteOffset = isArrayBuffer ? 0 : options.data.byteOffset;\n message.byteLength = options.data.byteLength;\n var transfers = [isArrayBuffer ? options.data : options.data.buffer];\n transmuxer.postMessage(message, transfers);\n } else {\n transmuxer.postMessage(message);\n }\n};\n\nvar REQUEST_ERRORS = {\n FAILURE: 2,\n TIMEOUT: -101,\n ABORTED: -102\n};\n/**\n * Abort all requests\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n */\n\nvar abortAll = function abortAll(activeXhrs) {\n activeXhrs.forEach(function (xhr) {\n xhr.abort();\n });\n};\n/**\n * Gather important bandwidth stats once a request has completed\n *\n * @param {Object} request - the XHR request from which to gather stats\n */\n\n\nvar getRequestStats = function getRequestStats(request) {\n return {\n bandwidth: request.bandwidth,\n bytesReceived: request.bytesReceived || 0,\n roundTripTime: request.roundTripTime || 0\n };\n};\n/**\n * If possible gather bandwidth stats as a request is in\n * progress\n *\n * @param {Event} progressEvent - an event object from an XHR's progress event\n */\n\n\nvar getProgressStats = function getProgressStats(progressEvent) {\n var request = progressEvent.target;\n var roundTripTime = Date.now() - request.requestTime;\n var stats = {\n bandwidth: Infinity,\n bytesReceived: 0,\n roundTripTime: roundTripTime || 0\n };\n stats.bytesReceived = progressEvent.loaded; // This can result in Infinity if stats.roundTripTime is 0 but that is ok\n // because we should only use bandwidth stats on progress to determine when\n // abort a request early due to insufficient bandwidth\n\n stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1000);\n return stats;\n};\n/**\n * Handle all error conditions in one place and return an object\n * with all the information\n *\n * @param {Error|null} error - if non-null signals an error occured with the XHR\n * @param {Object} request - the XHR request that possibly generated the error\n */\n\n\nvar handleErrors = function handleErrors(error, request) {\n if (request.timedout) {\n return {\n status: request.status,\n message: 'HLS request timed-out at URL: ' + request.uri,\n code: REQUEST_ERRORS.TIMEOUT,\n xhr: request\n };\n }\n\n if (request.aborted) {\n return {\n status: request.status,\n message: 'HLS request aborted at URL: ' + request.uri,\n code: REQUEST_ERRORS.ABORTED,\n xhr: request\n };\n }\n\n if (error) {\n return {\n status: request.status,\n message: 'HLS request errored at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n };\n }\n\n if (request.responseType === 'arraybuffer' && request.response.byteLength === 0) {\n return {\n status: request.status,\n message: 'Empty HLS response at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n };\n }\n\n return null;\n};\n/**\n * Handle responses for key data and convert the key data to the correct format\n * for the decryption step later\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Array} objects - objects to add the key bytes to.\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\n\nvar handleKeyResponse = function handleKeyResponse(segment, objects, finishProcessingFn) {\n return function (error, request) {\n var response = request.response;\n var errorObj = handleErrors(error, request);\n\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n }\n\n if (response.byteLength !== 16) {\n return finishProcessingFn({\n status: request.status,\n message: 'Invalid HLS key at URL: ' + request.uri,\n code: REQUEST_ERRORS.FAILURE,\n xhr: request\n }, segment);\n }\n\n var view = new DataView(response);\n var bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);\n\n for (var i = 0; i < objects.length; i++) {\n objects[i].bytes = bytes;\n }\n\n return finishProcessingFn(null, segment);\n };\n};\n\nvar video_es_parseInitSegment = function parseInitSegment(segment, _callback) {\n var type = containers_detectContainerForBytes(segment.map.bytes); // TODO: We should also handle ts init segments here, but we\n // only know how to parse mp4 init segments at the moment\n\n if (type !== 'mp4') {\n var uri = segment.map.resolvedUri || segment.map.uri;\n return _callback({\n internal: true,\n message: \"Found unsupported \" + (type || 'unknown') + \" container for initialization segment at URL: \" + uri,\n code: REQUEST_ERRORS.FAILURE\n });\n }\n\n video_es_workerCallback({\n action: 'probeMp4Tracks',\n data: segment.map.bytes,\n transmuxer: segment.transmuxer,\n callback: function callback(_ref) {\n var tracks = _ref.tracks,\n data = _ref.data; // transfer bytes back to us\n\n segment.map.bytes = data;\n tracks.forEach(function (track) {\n segment.map.tracks = segment.map.tracks || {}; // only support one track of each type for now\n\n if (segment.map.tracks[track.type]) {\n return;\n }\n\n segment.map.tracks[track.type] = track;\n\n if (typeof track.id === 'number' && track.timescale) {\n segment.map.timescales = segment.map.timescales || {};\n segment.map.timescales[track.id] = track.timescale;\n }\n });\n return _callback(null);\n }\n });\n};\n/**\n * Handle init-segment responses\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\n\nvar handleInitSegmentResponse = function handleInitSegmentResponse(_ref2) {\n var segment = _ref2.segment,\n finishProcessingFn = _ref2.finishProcessingFn;\n return function (error, request) {\n var errorObj = handleErrors(error, request);\n\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n }\n\n var bytes = new Uint8Array(request.response); // init segment is encypted, we will have to wait\n // until the key request is done to decrypt.\n\n if (segment.map.key) {\n segment.map.encryptedBytes = bytes;\n return finishProcessingFn(null, segment);\n }\n\n segment.map.bytes = bytes;\n video_es_parseInitSegment(segment, function (parseError) {\n if (parseError) {\n parseError.xhr = request;\n parseError.status = request.status;\n return finishProcessingFn(parseError, segment);\n }\n\n finishProcessingFn(null, segment);\n });\n };\n};\n/**\n * Response handler for segment-requests being sure to set the correct\n * property depending on whether the segment is encryped or not\n * Also records and keeps track of stats that are used for ABR purposes\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} finishProcessingFn - a callback to execute to continue processing\n * this request\n */\n\n\nvar handleSegmentResponse = function handleSegmentResponse(_ref3) {\n var segment = _ref3.segment,\n finishProcessingFn = _ref3.finishProcessingFn,\n responseType = _ref3.responseType;\n return function (error, request) {\n var errorObj = handleErrors(error, request);\n\n if (errorObj) {\n return finishProcessingFn(errorObj, segment);\n }\n\n var newBytes = // although responseText \"should\" exist, this guard serves to prevent an error being\n // thrown for two primary cases:\n // 1. the mime type override stops working, or is not implemented for a specific\n // browser\n // 2. when using mock XHR libraries like sinon that do not allow the override behavior\n responseType === 'arraybuffer' || !request.responseText ? request.response : stringToArrayBuffer(request.responseText.substring(segment.lastReachedChar || 0));\n segment.stats = getRequestStats(request);\n\n if (segment.key) {\n segment.encryptedBytes = new Uint8Array(newBytes);\n } else {\n segment.bytes = new Uint8Array(newBytes);\n }\n\n return finishProcessingFn(null, segment);\n };\n};\n\nvar transmuxAndNotify = function transmuxAndNotify(_ref4) {\n var segment = _ref4.segment,\n bytes = _ref4.bytes,\n trackInfoFn = _ref4.trackInfoFn,\n timingInfoFn = _ref4.timingInfoFn,\n videoSegmentTimingInfoFn = _ref4.videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn = _ref4.audioSegmentTimingInfoFn,\n id3Fn = _ref4.id3Fn,\n captionsFn = _ref4.captionsFn,\n isEndOfTimeline = _ref4.isEndOfTimeline,\n endedTimelineFn = _ref4.endedTimelineFn,\n dataFn = _ref4.dataFn,\n doneFn = _ref4.doneFn,\n onTransmuxerLog = _ref4.onTransmuxerLog;\n var fmp4Tracks = segment.map && segment.map.tracks || {};\n var isMuxed = Boolean(fmp4Tracks.audio && fmp4Tracks.video); // Keep references to each function so we can null them out after we're done with them.\n // One reason for this is that in the case of full segments, we want to trust start\n // times from the probe, rather than the transmuxer.\n\n var audioStartFn = timingInfoFn.bind(null, segment, 'audio', 'start');\n var audioEndFn = timingInfoFn.bind(null, segment, 'audio', 'end');\n var videoStartFn = timingInfoFn.bind(null, segment, 'video', 'start');\n var videoEndFn = timingInfoFn.bind(null, segment, 'video', 'end');\n\n var finish = function finish() {\n return transmux({\n bytes: bytes,\n transmuxer: segment.transmuxer,\n audioAppendStart: segment.audioAppendStart,\n gopsToAlignWith: segment.gopsToAlignWith,\n remux: isMuxed,\n onData: function onData(result) {\n result.type = result.type === 'combined' ? 'video' : result.type;\n dataFn(segment, result);\n },\n onTrackInfo: function onTrackInfo(trackInfo) {\n if (trackInfoFn) {\n if (isMuxed) {\n trackInfo.isMuxed = true;\n }\n\n trackInfoFn(segment, trackInfo);\n }\n },\n onAudioTimingInfo: function onAudioTimingInfo(audioTimingInfo) {\n // we only want the first start value we encounter\n if (audioStartFn && typeof audioTimingInfo.start !== 'undefined') {\n audioStartFn(audioTimingInfo.start);\n audioStartFn = null;\n } // we want to continually update the end time\n\n\n if (audioEndFn && typeof audioTimingInfo.end !== 'undefined') {\n audioEndFn(audioTimingInfo.end);\n }\n },\n onVideoTimingInfo: function onVideoTimingInfo(videoTimingInfo) {\n // we only want the first start value we encounter\n if (videoStartFn && typeof videoTimingInfo.start !== 'undefined') {\n videoStartFn(videoTimingInfo.start);\n videoStartFn = null;\n } // we want to continually update the end time\n\n\n if (videoEndFn && typeof videoTimingInfo.end !== 'undefined') {\n videoEndFn(videoTimingInfo.end);\n }\n },\n onVideoSegmentTimingInfo: function onVideoSegmentTimingInfo(videoSegmentTimingInfo) {\n videoSegmentTimingInfoFn(videoSegmentTimingInfo);\n },\n onAudioSegmentTimingInfo: function onAudioSegmentTimingInfo(audioSegmentTimingInfo) {\n audioSegmentTimingInfoFn(audioSegmentTimingInfo);\n },\n onId3: function onId3(id3Frames, dispatchType) {\n id3Fn(segment, id3Frames, dispatchType);\n },\n onCaptions: function onCaptions(captions) {\n captionsFn(segment, [captions]);\n },\n isEndOfTimeline: isEndOfTimeline,\n onEndedTimeline: function onEndedTimeline() {\n endedTimelineFn();\n },\n onTransmuxerLog: onTransmuxerLog,\n onDone: function onDone(result) {\n if (!doneFn) {\n return;\n }\n\n result.type = result.type === 'combined' ? 'video' : result.type;\n doneFn(null, segment, result);\n }\n });\n }; // In the transmuxer, we don't yet have the ability to extract a \"proper\" start time.\n // Meaning cached frame data may corrupt our notion of where this segment\n // really starts. To get around this, probe for the info needed.\n\n\n video_es_workerCallback({\n action: 'probeTs',\n transmuxer: segment.transmuxer,\n data: bytes,\n baseStartTime: segment.baseStartTime,\n callback: function callback(data) {\n segment.bytes = bytes = data.data;\n var probeResult = data.result;\n\n if (probeResult) {\n trackInfoFn(segment, {\n hasAudio: probeResult.hasAudio,\n hasVideo: probeResult.hasVideo,\n isMuxed: isMuxed\n });\n trackInfoFn = null;\n\n if (probeResult.hasAudio && !isMuxed) {\n audioStartFn(probeResult.audioStart);\n }\n\n if (probeResult.hasVideo) {\n videoStartFn(probeResult.videoStart);\n }\n\n audioStartFn = null;\n videoStartFn = null;\n }\n\n finish();\n }\n });\n};\n\nvar video_es_handleSegmentBytes = function handleSegmentBytes(_ref5) {\n var segment = _ref5.segment,\n bytes = _ref5.bytes,\n trackInfoFn = _ref5.trackInfoFn,\n timingInfoFn = _ref5.timingInfoFn,\n videoSegmentTimingInfoFn = _ref5.videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn = _ref5.audioSegmentTimingInfoFn,\n id3Fn = _ref5.id3Fn,\n captionsFn = _ref5.captionsFn,\n isEndOfTimeline = _ref5.isEndOfTimeline,\n endedTimelineFn = _ref5.endedTimelineFn,\n dataFn = _ref5.dataFn,\n doneFn = _ref5.doneFn,\n onTransmuxerLog = _ref5.onTransmuxerLog;\n var bytesAsUint8Array = new Uint8Array(bytes); // TODO:\n // We should have a handler that fetches the number of bytes required\n // to check if something is fmp4. This will allow us to save bandwidth\n // because we can only blacklist a playlist and abort requests\n // by codec after trackinfo triggers.\n\n if (containers_isLikelyFmp4MediaSegment(bytesAsUint8Array)) {\n segment.isFmp4 = true;\n var tracks = segment.map.tracks;\n var trackInfo = {\n isFmp4: true,\n hasVideo: !!tracks.video,\n hasAudio: !!tracks.audio\n }; // if we have a audio track, with a codec that is not set to\n // encrypted audio\n\n if (tracks.audio && tracks.audio.codec && tracks.audio.codec !== 'enca') {\n trackInfo.audioCodec = tracks.audio.codec;\n } // if we have a video track, with a codec that is not set to\n // encrypted video\n\n\n if (tracks.video && tracks.video.codec && tracks.video.codec !== 'encv') {\n trackInfo.videoCodec = tracks.video.codec;\n }\n\n if (tracks.video && tracks.audio) {\n trackInfo.isMuxed = true;\n } // since we don't support appending fmp4 data on progress, we know we have the full\n // segment here\n\n\n trackInfoFn(segment, trackInfo); // The probe doesn't provide the segment end time, so only callback with the start\n // time. The end time can be roughly calculated by the receiver using the duration.\n //\n // Note that the start time returned by the probe reflects the baseMediaDecodeTime, as\n // that is the true start of the segment (where the playback engine should begin\n // decoding).\n\n var finishLoading = function finishLoading(captions) {\n // if the track still has audio at this point it is only possible\n // for it to be audio only. See `tracks.video && tracks.audio` if statement\n // above.\n // we make sure to use segment.bytes here as that\n dataFn(segment, {\n data: bytesAsUint8Array,\n type: trackInfo.hasAudio && !trackInfo.isMuxed ? 'audio' : 'video'\n });\n\n if (captions && captions.length) {\n captionsFn(segment, captions);\n }\n\n doneFn(null, segment, {});\n };\n\n video_es_workerCallback({\n action: 'probeMp4StartTime',\n timescales: segment.map.timescales,\n data: bytesAsUint8Array,\n transmuxer: segment.transmuxer,\n callback: function callback(_ref6) {\n var data = _ref6.data,\n startTime = _ref6.startTime; // transfer bytes back to us\n\n bytes = data.buffer;\n segment.bytes = bytesAsUint8Array = data;\n\n if (trackInfo.hasAudio && !trackInfo.isMuxed) {\n timingInfoFn(segment, 'audio', 'start', startTime);\n }\n\n if (trackInfo.hasVideo) {\n timingInfoFn(segment, 'video', 'start', startTime);\n } // Run through the CaptionParser in case there are captions.\n // Initialize CaptionParser if it hasn't been yet\n\n\n if (!tracks.video || !data.byteLength || !segment.transmuxer) {\n finishLoading();\n return;\n }\n\n video_es_workerCallback({\n action: 'pushMp4Captions',\n endAction: 'mp4Captions',\n transmuxer: segment.transmuxer,\n data: bytesAsUint8Array,\n timescales: segment.map.timescales,\n trackIds: [tracks.video.id],\n callback: function callback(message) {\n // transfer bytes back to us\n bytes = message.data.buffer;\n segment.bytes = bytesAsUint8Array = message.data;\n message.logs.forEach(function (log) {\n onTransmuxerLog(videojs.mergeOptions(log, {\n stream: 'mp4CaptionParser'\n }));\n });\n finishLoading(message.captions);\n }\n });\n }\n });\n return;\n } // VTT or other segments that don't need processing\n\n\n if (!segment.transmuxer) {\n doneFn(null, segment, {});\n return;\n }\n\n if (typeof segment.container === 'undefined') {\n segment.container = containers_detectContainerForBytes(bytesAsUint8Array);\n }\n\n if (segment.container !== 'ts' && segment.container !== 'aac') {\n trackInfoFn(segment, {\n hasAudio: false,\n hasVideo: false\n });\n doneFn(null, segment, {});\n return;\n } // ts or aac\n\n\n transmuxAndNotify({\n segment: segment,\n bytes: bytes,\n trackInfoFn: trackInfoFn,\n timingInfoFn: timingInfoFn,\n videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n id3Fn: id3Fn,\n captionsFn: captionsFn,\n isEndOfTimeline: isEndOfTimeline,\n endedTimelineFn: endedTimelineFn,\n dataFn: dataFn,\n doneFn: doneFn,\n onTransmuxerLog: onTransmuxerLog\n });\n};\n\nvar decrypt = function decrypt(_ref7, callback) {\n var id = _ref7.id,\n key = _ref7.key,\n encryptedBytes = _ref7.encryptedBytes,\n decryptionWorker = _ref7.decryptionWorker;\n\n var decryptionHandler = function decryptionHandler(event) {\n if (event.data.source === id) {\n decryptionWorker.removeEventListener('message', decryptionHandler);\n var decrypted = event.data.decrypted;\n callback(new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength));\n }\n };\n\n decryptionWorker.addEventListener('message', decryptionHandler);\n var keyBytes;\n\n if (key.bytes.slice) {\n keyBytes = key.bytes.slice();\n } else {\n keyBytes = new Uint32Array(Array.prototype.slice.call(key.bytes));\n } // incrementally decrypt the bytes\n\n\n decryptionWorker.postMessage(createTransferableMessage({\n source: id,\n encrypted: encryptedBytes,\n key: keyBytes,\n iv: key.iv\n }), [encryptedBytes.buffer, keyBytes.buffer]);\n};\n/**\n * Decrypt the segment via the decryption web worker\n *\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128 decryption\n * routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n * a callback that receives video timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n * a callback that receives audio timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {boolean} isEndOfTimeline\n * true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n * a callback made when a timeline is ended, will only be called if\n * isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n * and ready to use\n * @param {Function} doneFn - a callback that is executed after decryption has completed\n */\n\n\nvar decryptSegment = function decryptSegment(_ref8) {\n var decryptionWorker = _ref8.decryptionWorker,\n segment = _ref8.segment,\n trackInfoFn = _ref8.trackInfoFn,\n timingInfoFn = _ref8.timingInfoFn,\n videoSegmentTimingInfoFn = _ref8.videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn = _ref8.audioSegmentTimingInfoFn,\n id3Fn = _ref8.id3Fn,\n captionsFn = _ref8.captionsFn,\n isEndOfTimeline = _ref8.isEndOfTimeline,\n endedTimelineFn = _ref8.endedTimelineFn,\n dataFn = _ref8.dataFn,\n doneFn = _ref8.doneFn,\n onTransmuxerLog = _ref8.onTransmuxerLog;\n decrypt({\n id: segment.requestId,\n key: segment.key,\n encryptedBytes: segment.encryptedBytes,\n decryptionWorker: decryptionWorker\n }, function (decryptedBytes) {\n segment.bytes = decryptedBytes;\n video_es_handleSegmentBytes({\n segment: segment,\n bytes: segment.bytes,\n trackInfoFn: trackInfoFn,\n timingInfoFn: timingInfoFn,\n videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n id3Fn: id3Fn,\n captionsFn: captionsFn,\n isEndOfTimeline: isEndOfTimeline,\n endedTimelineFn: endedTimelineFn,\n dataFn: dataFn,\n doneFn: doneFn,\n onTransmuxerLog: onTransmuxerLog\n });\n });\n};\n/**\n * This function waits for all XHRs to finish (with either success or failure)\n * before continueing processing via it's callback. The function gathers errors\n * from each request into a single errors array so that the error status for\n * each request can be examined later.\n *\n * @param {Object} activeXhrs - an object that tracks all XHR requests\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128 decryption\n * routines\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n * a callback that receives video timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n * a callback that receives audio timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} id3Fn - a callback that receives ID3 metadata\n * @param {Function} captionsFn - a callback that receives captions\n * @param {boolean} isEndOfTimeline\n * true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n * a callback made when a timeline is ended, will only be called if\n * isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n * and ready to use\n * @param {Function} doneFn - a callback that is executed after all resources have been\n * downloaded and any decryption completed\n */\n\n\nvar waitForCompletion = function waitForCompletion(_ref9) {\n var activeXhrs = _ref9.activeXhrs,\n decryptionWorker = _ref9.decryptionWorker,\n trackInfoFn = _ref9.trackInfoFn,\n timingInfoFn = _ref9.timingInfoFn,\n videoSegmentTimingInfoFn = _ref9.videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn = _ref9.audioSegmentTimingInfoFn,\n id3Fn = _ref9.id3Fn,\n captionsFn = _ref9.captionsFn,\n isEndOfTimeline = _ref9.isEndOfTimeline,\n endedTimelineFn = _ref9.endedTimelineFn,\n dataFn = _ref9.dataFn,\n doneFn = _ref9.doneFn,\n onTransmuxerLog = _ref9.onTransmuxerLog;\n var count = 0;\n var didError = false;\n return function (error, segment) {\n if (didError) {\n return;\n }\n\n if (error) {\n didError = true; // If there are errors, we have to abort any outstanding requests\n\n abortAll(activeXhrs); // Even though the requests above are aborted, and in theory we could wait until we\n // handle the aborted events from those requests, there are some cases where we may\n // never get an aborted event. For instance, if the network connection is lost and\n // there were two requests, the first may have triggered an error immediately, while\n // the second request remains unsent. In that case, the aborted algorithm will not\n // trigger an abort: see https://xhr.spec.whatwg.org/#the-abort()-method\n //\n // We also can't rely on the ready state of the XHR, since the request that\n // triggered the connection error may also show as a ready state of 0 (unsent).\n // Therefore, we have to finish this group of requests immediately after the first\n // seen error.\n\n return doneFn(error, segment);\n }\n\n count += 1;\n\n if (count === activeXhrs.length) {\n var segmentFinish = function segmentFinish() {\n if (segment.encryptedBytes) {\n return decryptSegment({\n decryptionWorker: decryptionWorker,\n segment: segment,\n trackInfoFn: trackInfoFn,\n timingInfoFn: timingInfoFn,\n videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n id3Fn: id3Fn,\n captionsFn: captionsFn,\n isEndOfTimeline: isEndOfTimeline,\n endedTimelineFn: endedTimelineFn,\n dataFn: dataFn,\n doneFn: doneFn,\n onTransmuxerLog: onTransmuxerLog\n });\n } // Otherwise, everything is ready just continue\n\n\n video_es_handleSegmentBytes({\n segment: segment,\n bytes: segment.bytes,\n trackInfoFn: trackInfoFn,\n timingInfoFn: timingInfoFn,\n videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n id3Fn: id3Fn,\n captionsFn: captionsFn,\n isEndOfTimeline: isEndOfTimeline,\n endedTimelineFn: endedTimelineFn,\n dataFn: dataFn,\n doneFn: doneFn,\n onTransmuxerLog: onTransmuxerLog\n });\n }; // Keep track of when *all* of the requests have completed\n\n\n segment.endOfAllRequests = Date.now();\n\n if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {\n return decrypt({\n decryptionWorker: decryptionWorker,\n // add -init to the \"id\" to differentiate between segment\n // and init segment decryption, just in case they happen\n // at the same time at some point in the future.\n id: segment.requestId + '-init',\n encryptedBytes: segment.map.encryptedBytes,\n key: segment.map.key\n }, function (decryptedBytes) {\n segment.map.bytes = decryptedBytes;\n video_es_parseInitSegment(segment, function (parseError) {\n if (parseError) {\n abortAll(activeXhrs);\n return doneFn(parseError, segment);\n }\n\n segmentFinish();\n });\n });\n }\n\n segmentFinish();\n }\n };\n};\n/**\n * Calls the abort callback if any request within the batch was aborted. Will only call\n * the callback once per batch of requests, even if multiple were aborted.\n *\n * @param {Object} loadendState - state to check to see if the abort function was called\n * @param {Function} abortFn - callback to call for abort\n */\n\n\nvar handleLoadEnd = function handleLoadEnd(_ref10) {\n var loadendState = _ref10.loadendState,\n abortFn = _ref10.abortFn;\n return function (event) {\n var request = event.target;\n\n if (request.aborted && abortFn && !loadendState.calledAbortFn) {\n abortFn();\n loadendState.calledAbortFn = true;\n }\n };\n};\n/**\n * Simple progress event callback handler that gathers some stats before\n * executing a provided callback with the `segment` object\n *\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} progressFn - a callback that is executed each time a progress event\n * is received\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n * a callback that receives video timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n * a callback that receives audio timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {boolean} isEndOfTimeline\n * true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n * a callback made when a timeline is ended, will only be called if\n * isEndOfTimeline is true\n * @param {Function} dataFn - a callback that is executed when segment bytes are available\n * and ready to use\n * @param {Event} event - the progress event object from XMLHttpRequest\n */\n\n\nvar handleProgress = function handleProgress(_ref11) {\n var segment = _ref11.segment,\n progressFn = _ref11.progressFn;\n _ref11.trackInfoFn;\n _ref11.timingInfoFn;\n _ref11.videoSegmentTimingInfoFn;\n _ref11.audioSegmentTimingInfoFn;\n _ref11.id3Fn;\n _ref11.captionsFn;\n _ref11.isEndOfTimeline;\n _ref11.endedTimelineFn;\n _ref11.dataFn;\n return function (event) {\n var request = event.target;\n\n if (request.aborted) {\n return;\n }\n\n segment.stats = videojs.mergeOptions(segment.stats, getProgressStats(event)); // record the time that we receive the first byte of data\n\n if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {\n segment.stats.firstBytesReceivedAt = Date.now();\n }\n\n return progressFn(event, segment);\n };\n};\n/**\n * Load all resources and does any processing necessary for a media-segment\n *\n * Features:\n * decrypts the media-segment if it has a key uri and an iv\n * aborts *all* requests if *any* one request fails\n *\n * The segment object, at minimum, has the following format:\n * {\n * resolvedUri: String,\n * [transmuxer]: Object,\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * [key]: {\n * resolvedUri: String\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * iv: {\n * bytes: Uint32Array\n * }\n * },\n * [map]: {\n * resolvedUri: String,\n * [byterange]: {\n * offset: Number,\n * length: Number\n * },\n * [bytes]: Uint8Array\n * }\n * }\n * ...where [name] denotes optional properties\n *\n * @param {Function} xhr - an instance of the xhr wrapper in xhr.js\n * @param {Object} xhrOptions - the base options to provide to all xhr requests\n * @param {WebWorker} decryptionWorker - a WebWorker interface to AES-128\n * decryption routines\n * @param {Object} segment - a simplified copy of the segmentInfo object\n * from SegmentLoader\n * @param {Function} abortFn - a callback called (only once) if any piece of a request was\n * aborted\n * @param {Function} progressFn - a callback that receives progress events from the main\n * segment's xhr request\n * @param {Function} trackInfoFn - a callback that receives track info\n * @param {Function} timingInfoFn - a callback that receives timing info\n * @param {Function} videoSegmentTimingInfoFn\n * a callback that receives video timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} audioSegmentTimingInfoFn\n * a callback that receives audio timing info based on media times and\n * any adjustments made by the transmuxer\n * @param {Function} id3Fn - a callback that receives ID3 metadata\n * @param {Function} captionsFn - a callback that receives captions\n * @param {boolean} isEndOfTimeline\n * true if this segment represents the last segment in a timeline\n * @param {Function} endedTimelineFn\n * a callback made when a timeline is ended, will only be called if\n * isEndOfTimeline is true\n * @param {Function} dataFn - a callback that receives data from the main segment's xhr\n * request, transmuxed if needed\n * @param {Function} doneFn - a callback that is executed only once all requests have\n * succeeded or failed\n * @return {Function} a function that, when invoked, immediately aborts all\n * outstanding requests\n */\n\n\nvar mediaSegmentRequest = function mediaSegmentRequest(_ref12) {\n var xhr = _ref12.xhr,\n xhrOptions = _ref12.xhrOptions,\n decryptionWorker = _ref12.decryptionWorker,\n segment = _ref12.segment,\n abortFn = _ref12.abortFn,\n progressFn = _ref12.progressFn,\n trackInfoFn = _ref12.trackInfoFn,\n timingInfoFn = _ref12.timingInfoFn,\n videoSegmentTimingInfoFn = _ref12.videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn = _ref12.audioSegmentTimingInfoFn,\n id3Fn = _ref12.id3Fn,\n captionsFn = _ref12.captionsFn,\n isEndOfTimeline = _ref12.isEndOfTimeline,\n endedTimelineFn = _ref12.endedTimelineFn,\n dataFn = _ref12.dataFn,\n doneFn = _ref12.doneFn,\n onTransmuxerLog = _ref12.onTransmuxerLog;\n var activeXhrs = [];\n var finishProcessingFn = waitForCompletion({\n activeXhrs: activeXhrs,\n decryptionWorker: decryptionWorker,\n trackInfoFn: trackInfoFn,\n timingInfoFn: timingInfoFn,\n videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n id3Fn: id3Fn,\n captionsFn: captionsFn,\n isEndOfTimeline: isEndOfTimeline,\n endedTimelineFn: endedTimelineFn,\n dataFn: dataFn,\n doneFn: doneFn,\n onTransmuxerLog: onTransmuxerLog\n }); // optionally, request the decryption key\n\n if (segment.key && !segment.key.bytes) {\n var objects = [segment.key];\n\n if (segment.map && !segment.map.bytes && segment.map.key && segment.map.key.resolvedUri === segment.key.resolvedUri) {\n objects.push(segment.map.key);\n }\n\n var keyRequestOptions = videojs.mergeOptions(xhrOptions, {\n uri: segment.key.resolvedUri,\n responseType: 'arraybuffer'\n });\n var keyRequestCallback = handleKeyResponse(segment, objects, finishProcessingFn);\n var keyXhr = xhr(keyRequestOptions, keyRequestCallback);\n activeXhrs.push(keyXhr);\n } // optionally, request the associated media init segment\n\n\n if (segment.map && !segment.map.bytes) {\n var differentMapKey = segment.map.key && (!segment.key || segment.key.resolvedUri !== segment.map.key.resolvedUri);\n\n if (differentMapKey) {\n var mapKeyRequestOptions = videojs.mergeOptions(xhrOptions, {\n uri: segment.map.key.resolvedUri,\n responseType: 'arraybuffer'\n });\n var mapKeyRequestCallback = handleKeyResponse(segment, [segment.map.key], finishProcessingFn);\n var mapKeyXhr = xhr(mapKeyRequestOptions, mapKeyRequestCallback);\n activeXhrs.push(mapKeyXhr);\n }\n\n var initSegmentOptions = videojs.mergeOptions(xhrOptions, {\n uri: segment.map.resolvedUri,\n responseType: 'arraybuffer',\n headers: segmentXhrHeaders(segment.map)\n });\n var initSegmentRequestCallback = handleInitSegmentResponse({\n segment: segment,\n finishProcessingFn: finishProcessingFn\n });\n var initSegmentXhr = xhr(initSegmentOptions, initSegmentRequestCallback);\n activeXhrs.push(initSegmentXhr);\n }\n\n var segmentRequestOptions = videojs.mergeOptions(xhrOptions, {\n uri: segment.part && segment.part.resolvedUri || segment.resolvedUri,\n responseType: 'arraybuffer',\n headers: segmentXhrHeaders(segment)\n });\n var segmentRequestCallback = handleSegmentResponse({\n segment: segment,\n finishProcessingFn: finishProcessingFn,\n responseType: segmentRequestOptions.responseType\n });\n var segmentXhr = xhr(segmentRequestOptions, segmentRequestCallback);\n segmentXhr.addEventListener('progress', handleProgress({\n segment: segment,\n progressFn: progressFn,\n trackInfoFn: trackInfoFn,\n timingInfoFn: timingInfoFn,\n videoSegmentTimingInfoFn: videoSegmentTimingInfoFn,\n audioSegmentTimingInfoFn: audioSegmentTimingInfoFn,\n id3Fn: id3Fn,\n captionsFn: captionsFn,\n isEndOfTimeline: isEndOfTimeline,\n endedTimelineFn: endedTimelineFn,\n dataFn: dataFn\n }));\n activeXhrs.push(segmentXhr); // since all parts of the request must be considered, but should not make callbacks\n // multiple times, provide a shared state object\n\n var loadendState = {};\n activeXhrs.forEach(function (activeXhr) {\n activeXhr.addEventListener('loadend', handleLoadEnd({\n loadendState: loadendState,\n abortFn: abortFn\n }));\n });\n return function () {\n return abortAll(activeXhrs);\n };\n};\n/**\n * @file - codecs.js - Handles tasks regarding codec strings such as translating them to\n * codec strings, or translating codec strings into objects that can be examined.\n */\n\n\nvar logFn$1 = logger('CodecUtils');\n/**\n * Returns a set of codec strings parsed from the playlist or the default\n * codec strings if no codecs were specified in the playlist\n *\n * @param {Playlist} media the current media playlist\n * @return {Object} an object with the video and audio codecs\n */\n\nvar video_es_getCodecs = function getCodecs(media) {\n // if the codecs were explicitly specified, use them instead of the\n // defaults\n var mediaAttributes = media.attributes || {};\n\n if (mediaAttributes.CODECS) {\n return parseCodecs(mediaAttributes.CODECS);\n }\n};\n\nvar isMaat = function isMaat(master, media) {\n var mediaAttributes = media.attributes || {};\n return master && master.mediaGroups && master.mediaGroups.AUDIO && mediaAttributes.AUDIO && master.mediaGroups.AUDIO[mediaAttributes.AUDIO];\n};\n\nvar isMuxed = function isMuxed(master, media) {\n if (!isMaat(master, media)) {\n return true;\n }\n\n var mediaAttributes = media.attributes || {};\n var audioGroup = master.mediaGroups.AUDIO[mediaAttributes.AUDIO];\n\n for (var groupId in audioGroup) {\n // If an audio group has a URI (the case for HLS, as HLS will use external playlists),\n // or there are listed playlists (the case for DASH, as the manifest will have already\n // provided all of the details necessary to generate the audio playlist, as opposed to\n // HLS' externally requested playlists), then the content is demuxed.\n if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {\n return true;\n }\n }\n\n return false;\n};\n\nvar video_es_unwrapCodecList = function unwrapCodecList(codecList) {\n var codecs = {};\n codecList.forEach(function (_ref) {\n var mediaType = _ref.mediaType,\n type = _ref.type,\n details = _ref.details;\n codecs[mediaType] = codecs[mediaType] || [];\n codecs[mediaType].push(translateLegacyCodec(\"\" + type + details));\n });\n Object.keys(codecs).forEach(function (mediaType) {\n if (codecs[mediaType].length > 1) {\n logFn$1(\"multiple \" + mediaType + \" codecs found as attributes: \" + codecs[mediaType].join(', ') + \". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.\");\n codecs[mediaType] = null;\n return;\n }\n\n codecs[mediaType] = codecs[mediaType][0];\n });\n return codecs;\n};\n\nvar codecCount = function codecCount(codecObj) {\n var count = 0;\n\n if (codecObj.audio) {\n count++;\n }\n\n if (codecObj.video) {\n count++;\n }\n\n return count;\n};\n/**\n * Calculates the codec strings for a working configuration of\n * SourceBuffers to play variant streams in a master playlist. If\n * there is no possible working configuration, an empty object will be\n * returned.\n *\n * @param master {Object} the m3u8 object for the master playlist\n * @param media {Object} the m3u8 object for the variant playlist\n * @return {Object} the codec strings.\n *\n * @private\n */\n\n\nvar video_es_codecsForPlaylist = function codecsForPlaylist(master, media) {\n var mediaAttributes = media.attributes || {};\n var codecInfo = video_es_unwrapCodecList(video_es_getCodecs(media) || []); // HLS with multiple-audio tracks must always get an audio codec.\n // Put another way, there is no way to have a video-only multiple-audio HLS!\n\n if (isMaat(master, media) && !codecInfo.audio) {\n if (!isMuxed(master, media)) {\n // It is possible for codecs to be specified on the audio media group playlist but\n // not on the rendition playlist. This is mostly the case for DASH, where audio and\n // video are always separate (and separately specified).\n var defaultCodecs = video_es_unwrapCodecList(codecsFromDefault(master, mediaAttributes.AUDIO) || []);\n\n if (defaultCodecs.audio) {\n codecInfo.audio = defaultCodecs.audio;\n }\n }\n }\n\n return codecInfo;\n};\n\nvar logFn = logger('PlaylistSelector');\n\nvar representationToString = function representationToString(representation) {\n if (!representation || !representation.playlist) {\n return;\n }\n\n var playlist = representation.playlist;\n return JSON.stringify({\n id: playlist.id,\n bandwidth: representation.bandwidth,\n width: representation.width,\n height: representation.height,\n codecs: playlist.attributes && playlist.attributes.CODECS || ''\n });\n}; // Utilities\n\n/**\n * Returns the CSS value for the specified property on an element\n * using `getComputedStyle`. Firefox has a long-standing issue where\n * getComputedStyle() may return null when running in an iframe with\n * `display: none`.\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n * @param {HTMLElement} el the htmlelement to work on\n * @param {string} the proprety to get the style for\n */\n\n\nvar video_es_safeGetComputedStyle = function safeGetComputedStyle(el, property) {\n if (!el) {\n return '';\n }\n\n var result = window_default.a.getComputedStyle(el);\n\n if (!result) {\n return '';\n }\n\n return result[property];\n};\n/**\n * Resuable stable sort function\n *\n * @param {Playlists} array\n * @param {Function} sortFn Different comparators\n * @function stableSort\n */\n\n\nvar stableSort = function stableSort(array, sortFn) {\n var newArray = array.slice();\n array.sort(function (left, right) {\n var cmp = sortFn(left, right);\n\n if (cmp === 0) {\n return newArray.indexOf(left) - newArray.indexOf(right);\n }\n\n return cmp;\n });\n};\n/**\n * A comparator function to sort two playlist object by bandwidth.\n *\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {number} Greater than zero if the bandwidth attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the bandwidth of right is greater than left and\n * exactly zero if the two are equal.\n */\n\n\nvar video_es_comparePlaylistBandwidth = function comparePlaylistBandwidth(left, right) {\n var leftBandwidth;\n var rightBandwidth;\n\n if (left.attributes.BANDWIDTH) {\n leftBandwidth = left.attributes.BANDWIDTH;\n }\n\n leftBandwidth = leftBandwidth || window_default.a.Number.MAX_VALUE;\n\n if (right.attributes.BANDWIDTH) {\n rightBandwidth = right.attributes.BANDWIDTH;\n }\n\n rightBandwidth = rightBandwidth || window_default.a.Number.MAX_VALUE;\n return leftBandwidth - rightBandwidth;\n};\n/**\n * A comparator function to sort two playlist object by resolution (width).\n *\n * @param {Object} left a media playlist object\n * @param {Object} right a media playlist object\n * @return {number} Greater than zero if the resolution.width attribute of\n * left is greater than the corresponding attribute of right. Less\n * than zero if the resolution.width of right is greater than left and\n * exactly zero if the two are equal.\n */\n\n\nvar video_es_comparePlaylistResolution = function comparePlaylistResolution(left, right) {\n var leftWidth;\n var rightWidth;\n\n if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {\n leftWidth = left.attributes.RESOLUTION.width;\n }\n\n leftWidth = leftWidth || window_default.a.Number.MAX_VALUE;\n\n if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {\n rightWidth = right.attributes.RESOLUTION.width;\n }\n\n rightWidth = rightWidth || window_default.a.Number.MAX_VALUE; // NOTE - Fallback to bandwidth sort as appropriate in cases where multiple renditions\n // have the same media dimensions/ resolution\n\n if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {\n return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;\n }\n\n return leftWidth - rightWidth;\n};\n/**\n * Chooses the appropriate media playlist based on bandwidth and player size\n *\n * @param {Object} master\n * Object representation of the master manifest\n * @param {number} playerBandwidth\n * Current calculated bandwidth of the player\n * @param {number} playerWidth\n * Current width of the player element (should account for the device pixel ratio)\n * @param {number} playerHeight\n * Current height of the player element (should account for the device pixel ratio)\n * @param {boolean} limitRenditionByPlayerDimensions\n * True if the player width and height should be used during the selection, false otherwise\n * @param {Object} masterPlaylistController\n * the current masterPlaylistController object\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\n\nvar video_es_simpleSelector = function simpleSelector(master, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions, masterPlaylistController) {\n // If we end up getting called before `master` is available, exit early\n if (!master) {\n return;\n }\n\n var options = {\n bandwidth: playerBandwidth,\n width: playerWidth,\n height: playerHeight,\n limitRenditionByPlayerDimensions: limitRenditionByPlayerDimensions\n };\n var playlists = master.playlists; // if playlist is audio only, select between currently active audio group playlists.\n\n if (Playlist.isAudioOnly(master)) {\n playlists = masterPlaylistController.getAudioTrackPlaylists_(); // add audioOnly to options so that we log audioOnly: true\n // at the buttom of this function for debugging.\n\n options.audioOnly = true;\n } // convert the playlists to an intermediary representation to make comparisons easier\n\n\n var sortedPlaylistReps = playlists.map(function (playlist) {\n var bandwidth;\n var width = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;\n var height = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;\n bandwidth = playlist.attributes && playlist.attributes.BANDWIDTH;\n bandwidth = bandwidth || window_default.a.Number.MAX_VALUE;\n return {\n bandwidth: bandwidth,\n width: width,\n height: height,\n playlist: playlist\n };\n });\n stableSort(sortedPlaylistReps, function (left, right) {\n return left.bandwidth - right.bandwidth;\n }); // filter out any playlists that have been excluded due to\n // incompatible configurations\n\n sortedPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n return !Playlist.isIncompatible(rep.playlist);\n }); // filter out any playlists that have been disabled manually through the representations\n // api or blacklisted temporarily due to playback errors.\n\n var enabledPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n return Playlist.isEnabled(rep.playlist);\n });\n\n if (!enabledPlaylistReps.length) {\n // if there are no enabled playlists, then they have all been blacklisted or disabled\n // by the user through the representations api. In this case, ignore blacklisting and\n // fallback to what the user wants by using playlists the user has not disabled.\n enabledPlaylistReps = sortedPlaylistReps.filter(function (rep) {\n return !Playlist.isDisabled(rep.playlist);\n });\n } // filter out any variant that has greater effective bitrate\n // than the current estimated bandwidth\n\n\n var bandwidthPlaylistReps = enabledPlaylistReps.filter(function (rep) {\n return rep.bandwidth * Config.BANDWIDTH_VARIANCE < playerBandwidth;\n });\n var highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1]; // get all of the renditions with the same (highest) bandwidth\n // and then taking the very first element\n\n var bandwidthBestRep = bandwidthPlaylistReps.filter(function (rep) {\n return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n })[0]; // if we're not going to limit renditions by player size, make an early decision.\n\n if (limitRenditionByPlayerDimensions === false) {\n var _chosenRep = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n\n if (_chosenRep && _chosenRep.playlist) {\n var type = 'sortedPlaylistReps';\n\n if (bandwidthBestRep) {\n type = 'bandwidthBestRep';\n }\n\n if (enabledPlaylistReps[0]) {\n type = 'enabledPlaylistReps';\n }\n\n logFn(\"choosing \" + representationToString(_chosenRep) + \" using \" + type + \" with options\", options);\n return _chosenRep.playlist;\n }\n\n logFn('could not choose a playlist with options', options);\n return null;\n } // filter out playlists without resolution information\n\n\n var haveResolution = bandwidthPlaylistReps.filter(function (rep) {\n return rep.width && rep.height;\n }); // sort variants by resolution\n\n stableSort(haveResolution, function (left, right) {\n return left.width - right.width;\n }); // if we have the exact resolution as the player use it\n\n var resolutionBestRepList = haveResolution.filter(function (rep) {\n return rep.width === playerWidth && rep.height === playerHeight;\n });\n highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1]; // ensure that we pick the highest bandwidth variant that have exact resolution\n\n var resolutionBestRep = resolutionBestRepList.filter(function (rep) {\n return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n })[0];\n var resolutionPlusOneList;\n var resolutionPlusOneSmallest;\n var resolutionPlusOneRep; // find the smallest variant that is larger than the player\n // if there is no match of exact resolution\n\n if (!resolutionBestRep) {\n resolutionPlusOneList = haveResolution.filter(function (rep) {\n return rep.width > playerWidth || rep.height > playerHeight;\n }); // find all the variants have the same smallest resolution\n\n resolutionPlusOneSmallest = resolutionPlusOneList.filter(function (rep) {\n return rep.width === resolutionPlusOneList[0].width && rep.height === resolutionPlusOneList[0].height;\n }); // ensure that we also pick the highest bandwidth variant that\n // is just-larger-than the video player\n\n highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];\n resolutionPlusOneRep = resolutionPlusOneSmallest.filter(function (rep) {\n return rep.bandwidth === highestRemainingBandwidthRep.bandwidth;\n })[0];\n }\n\n var leastPixelDiffRep; // If this selector proves to be better than others,\n // resolutionPlusOneRep and resolutionBestRep and all\n // the code involving them should be removed.\n\n if (masterPlaylistController.experimentalLeastPixelDiffSelector) {\n // find the variant that is closest to the player's pixel size\n var leastPixelDiffList = haveResolution.map(function (rep) {\n rep.pixelDiff = Math.abs(rep.width - playerWidth) + Math.abs(rep.height - playerHeight);\n return rep;\n }); // get the highest bandwidth, closest resolution playlist\n\n stableSort(leastPixelDiffList, function (left, right) {\n // sort by highest bandwidth if pixelDiff is the same\n if (left.pixelDiff === right.pixelDiff) {\n return right.bandwidth - left.bandwidth;\n }\n\n return left.pixelDiff - right.pixelDiff;\n });\n leastPixelDiffRep = leastPixelDiffList[0];\n } // fallback chain of variants\n\n\n var chosenRep = leastPixelDiffRep || resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];\n\n if (chosenRep && chosenRep.playlist) {\n var _type = 'sortedPlaylistReps';\n\n if (leastPixelDiffRep) {\n _type = 'leastPixelDiffRep';\n } else if (resolutionPlusOneRep) {\n _type = 'resolutionPlusOneRep';\n } else if (resolutionBestRep) {\n _type = 'resolutionBestRep';\n } else if (bandwidthBestRep) {\n _type = 'bandwidthBestRep';\n } else if (enabledPlaylistReps[0]) {\n _type = 'enabledPlaylistReps';\n }\n\n logFn(\"choosing \" + representationToString(chosenRep) + \" using \" + _type + \" with options\", options);\n return chosenRep.playlist;\n }\n\n logFn('could not choose a playlist with options', options);\n return null;\n};\n/**\n * Chooses the appropriate media playlist based on the most recent\n * bandwidth estimate and the player size.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @return {Playlist} the highest bitrate playlist less than the\n * currently detected bandwidth, accounting for some amount of\n * bandwidth variance\n */\n\n\nvar video_es_lastBandwidthSelector = function lastBandwidthSelector() {\n var pixelRatio = this.useDevicePixelRatio ? window_default.a.devicePixelRatio || 1 : 1;\n return video_es_simpleSelector(this.playlists.master, this.systemBandwidth, parseInt(video_es_safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(video_es_safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.masterPlaylistController_);\n};\n/**\n * Chooses the appropriate media playlist based on an\n * exponential-weighted moving average of the bandwidth after\n * filtering for player size.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @param {number} decay - a number between 0 and 1. Higher values of\n * this parameter will cause previous bandwidth estimates to lose\n * significance more quickly.\n * @return {Function} a function which can be invoked to create a new\n * playlist selector function.\n * @see https://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average\n */\n\n\nvar video_es_movingAverageBandwidthSelector = function movingAverageBandwidthSelector(decay) {\n var average = -1;\n var lastSystemBandwidth = -1;\n\n if (decay < 0 || decay > 1) {\n throw new Error('Moving average bandwidth decay must be between 0 and 1.');\n }\n\n return function () {\n var pixelRatio = this.useDevicePixelRatio ? window_default.a.devicePixelRatio || 1 : 1;\n\n if (average < 0) {\n average = this.systemBandwidth;\n lastSystemBandwidth = this.systemBandwidth;\n } // stop the average value from decaying for every 250ms\n // when the systemBandwidth is constant\n // and\n // stop average from setting to a very low value when the\n // systemBandwidth becomes 0 in case of chunk cancellation\n\n\n if (this.systemBandwidth > 0 && this.systemBandwidth !== lastSystemBandwidth) {\n average = decay * this.systemBandwidth + (1 - decay) * average;\n lastSystemBandwidth = this.systemBandwidth;\n }\n\n return video_es_simpleSelector(this.playlists.master, average, parseInt(video_es_safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(video_es_safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.masterPlaylistController_);\n };\n};\n/**\n * Chooses the appropriate media playlist based on the potential to rebuffer\n *\n * @param {Object} settings\n * Object of information required to use this selector\n * @param {Object} settings.master\n * Object representation of the master manifest\n * @param {number} settings.currentTime\n * The current time of the player\n * @param {number} settings.bandwidth\n * Current measured bandwidth\n * @param {number} settings.duration\n * Duration of the media\n * @param {number} settings.segmentDuration\n * Segment duration to be used in round trip time calculations\n * @param {number} settings.timeUntilRebuffer\n * Time left in seconds until the player has to rebuffer\n * @param {number} settings.currentTimeline\n * The current timeline segments are being loaded from\n * @param {SyncController} settings.syncController\n * SyncController for determining if we have a sync point for a given playlist\n * @return {Object|null}\n * {Object} return.playlist\n * The highest bandwidth playlist with the least amount of rebuffering\n * {Number} return.rebufferingImpact\n * The amount of time in seconds switching to this playlist will rebuffer. A\n * negative value means that switching will cause zero rebuffering.\n */\n\n\nvar minRebufferMaxBandwidthSelector = function minRebufferMaxBandwidthSelector(settings) {\n var master = settings.master,\n currentTime = settings.currentTime,\n bandwidth = settings.bandwidth,\n duration = settings.duration,\n segmentDuration = settings.segmentDuration,\n timeUntilRebuffer = settings.timeUntilRebuffer,\n currentTimeline = settings.currentTimeline,\n syncController = settings.syncController; // filter out any playlists that have been excluded due to\n // incompatible configurations\n\n var compatiblePlaylists = master.playlists.filter(function (playlist) {\n return !Playlist.isIncompatible(playlist);\n }); // filter out any playlists that have been disabled manually through the representations\n // api or blacklisted temporarily due to playback errors.\n\n var enabledPlaylists = compatiblePlaylists.filter(Playlist.isEnabled);\n\n if (!enabledPlaylists.length) {\n // if there are no enabled playlists, then they have all been blacklisted or disabled\n // by the user through the representations api. In this case, ignore blacklisting and\n // fallback to what the user wants by using playlists the user has not disabled.\n enabledPlaylists = compatiblePlaylists.filter(function (playlist) {\n return !Playlist.isDisabled(playlist);\n });\n }\n\n var bandwidthPlaylists = enabledPlaylists.filter(Playlist.hasAttribute.bind(null, 'BANDWIDTH'));\n var rebufferingEstimates = bandwidthPlaylists.map(function (playlist) {\n var syncPoint = syncController.getSyncPoint(playlist, duration, currentTimeline, currentTime); // If there is no sync point for this playlist, switching to it will require a\n // sync request first. This will double the request time\n\n var numRequests = syncPoint ? 1 : 2;\n var requestTimeEstimate = Playlist.estimateSegmentRequestTime(segmentDuration, bandwidth, playlist);\n var rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer;\n return {\n playlist: playlist,\n rebufferingImpact: rebufferingImpact\n };\n });\n var noRebufferingPlaylists = rebufferingEstimates.filter(function (estimate) {\n return estimate.rebufferingImpact <= 0;\n }); // Sort by bandwidth DESC\n\n stableSort(noRebufferingPlaylists, function (a, b) {\n return video_es_comparePlaylistBandwidth(b.playlist, a.playlist);\n });\n\n if (noRebufferingPlaylists.length) {\n return noRebufferingPlaylists[0];\n }\n\n stableSort(rebufferingEstimates, function (a, b) {\n return a.rebufferingImpact - b.rebufferingImpact;\n });\n return rebufferingEstimates[0] || null;\n};\n/**\n * Chooses the appropriate media playlist, which in this case is the lowest bitrate\n * one with video. If no renditions with video exist, return the lowest audio rendition.\n *\n * Expects to be called within the context of an instance of VhsHandler\n *\n * @return {Object|null}\n * {Object} return.playlist\n * The lowest bitrate playlist that contains a video codec. If no such rendition\n * exists pick the lowest audio rendition.\n */\n\n\nvar lowestBitrateCompatibleVariantSelector = function lowestBitrateCompatibleVariantSelector() {\n var _this = this; // filter out any playlists that have been excluded due to\n // incompatible configurations or playback errors\n\n\n var playlists = this.playlists.master.playlists.filter(Playlist.isEnabled); // Sort ascending by bitrate\n\n stableSort(playlists, function (a, b) {\n return video_es_comparePlaylistBandwidth(a, b);\n }); // Parse and assume that playlists with no video codec have no video\n // (this is not necessarily true, although it is generally true).\n //\n // If an entire manifest has no valid videos everything will get filtered\n // out.\n\n var playlistsWithVideo = playlists.filter(function (playlist) {\n return !!video_es_codecsForPlaylist(_this.playlists.master, playlist).video;\n });\n return playlistsWithVideo[0] || null;\n};\n/**\n * Combine all segments into a single Uint8Array\n *\n * @param {Object} segmentObj\n * @return {Uint8Array} concatenated bytes\n * @private\n */\n\n\nvar concatSegments = function concatSegments(segmentObj) {\n var offset = 0;\n var tempBuffer;\n\n if (segmentObj.bytes) {\n tempBuffer = new Uint8Array(segmentObj.bytes); // combine the individual segments into one large typed-array\n\n segmentObj.segments.forEach(function (segment) {\n tempBuffer.set(segment, offset);\n offset += segment.byteLength;\n });\n }\n\n return tempBuffer;\n};\n/**\n * @file text-tracks.js\n */\n\n/**\n * Create captions text tracks on video.js if they do not exist\n *\n * @param {Object} inbandTextTracks a reference to current inbandTextTracks\n * @param {Object} tech the video.js tech\n * @param {Object} captionStream the caption stream to create\n * @private\n */\n\n\nvar createCaptionsTrackIfNotExists = function createCaptionsTrackIfNotExists(inbandTextTracks, tech, captionStream) {\n if (!inbandTextTracks[captionStream]) {\n tech.trigger({\n type: 'usage',\n name: 'vhs-608'\n });\n tech.trigger({\n type: 'usage',\n name: 'hls-608'\n });\n var instreamId = captionStream; // we need to translate SERVICEn for 708 to how mux.js currently labels them\n\n if (/^cc708_/.test(captionStream)) {\n instreamId = 'SERVICE' + captionStream.split('_')[1];\n }\n\n var track = tech.textTracks().getTrackById(instreamId);\n\n if (track) {\n // Resuse an existing track with a CC# id because this was\n // very likely created by videojs-contrib-hls from information\n // in the m3u8 for us to use\n inbandTextTracks[captionStream] = track;\n } else {\n // This section gets called when we have caption services that aren't specified in the manifest.\n // Manifest level caption services are handled in media-groups.js under CLOSED-CAPTIONS.\n var captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};\n var label = captionStream;\n var language = captionStream;\n var def = false;\n var captionService = captionServices[instreamId];\n\n if (captionService) {\n label = captionService.label;\n language = captionService.language;\n def = captionService[\"default\"];\n } // Otherwise, create a track with the default `CC#` label and\n // without a language\n\n\n inbandTextTracks[captionStream] = tech.addRemoteTextTrack({\n kind: 'captions',\n id: instreamId,\n // TODO: investigate why this doesn't seem to turn the caption on by default\n \"default\": def,\n label: label,\n language: language\n }, false).track;\n }\n }\n};\n/**\n * Add caption text track data to a source handler given an array of captions\n *\n * @param {Object}\n * @param {Object} inbandTextTracks the inband text tracks\n * @param {number} timestampOffset the timestamp offset of the source buffer\n * @param {Array} captionArray an array of caption data\n * @private\n */\n\n\nvar video_es_addCaptionData = function addCaptionData(_ref) {\n var inbandTextTracks = _ref.inbandTextTracks,\n captionArray = _ref.captionArray,\n timestampOffset = _ref.timestampOffset;\n\n if (!captionArray) {\n return;\n }\n\n var Cue = window_default.a.WebKitDataCue || window_default.a.VTTCue;\n captionArray.forEach(function (caption) {\n var track = caption.stream;\n inbandTextTracks[track].addCue(new Cue(caption.startTime + timestampOffset, caption.endTime + timestampOffset, caption.text));\n });\n};\n/**\n * Define properties on a cue for backwards compatability,\n * but warn the user that the way that they are using it\n * is depricated and will be removed at a later date.\n *\n * @param {Cue} cue the cue to add the properties on\n * @private\n */\n\n\nvar deprecateOldCue = function deprecateOldCue(cue) {\n Object.defineProperties(cue.frame, {\n id: {\n get: function get() {\n videojs.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.');\n return cue.value.key;\n }\n },\n value: {\n get: function get() {\n videojs.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.');\n return cue.value.data;\n }\n },\n privateData: {\n get: function get() {\n videojs.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.');\n return cue.value.data;\n }\n }\n });\n};\n/**\n * Add metadata text track data to a source handler given an array of metadata\n *\n * @param {Object}\n * @param {Object} inbandTextTracks the inband text tracks\n * @param {Array} metadataArray an array of meta data\n * @param {number} timestampOffset the timestamp offset of the source buffer\n * @param {number} videoDuration the duration of the video\n * @private\n */\n\n\nvar video_es_addMetadata = function addMetadata(_ref2) {\n var inbandTextTracks = _ref2.inbandTextTracks,\n metadataArray = _ref2.metadataArray,\n timestampOffset = _ref2.timestampOffset,\n videoDuration = _ref2.videoDuration;\n\n if (!metadataArray) {\n return;\n }\n\n var Cue = window_default.a.WebKitDataCue || window_default.a.VTTCue;\n var metadataTrack = inbandTextTracks.metadataTrack_;\n\n if (!metadataTrack) {\n return;\n }\n\n metadataArray.forEach(function (metadata) {\n var time = metadata.cueTime + timestampOffset; // if time isn't a finite number between 0 and Infinity, like NaN,\n // ignore this bit of metadata.\n // This likely occurs when you have an non-timed ID3 tag like TIT2,\n // which is the \"Title/Songname/Content description\" frame\n\n if (typeof time !== 'number' || window_default.a.isNaN(time) || time < 0 || !(time < Infinity)) {\n return;\n }\n\n metadata.frames.forEach(function (frame) {\n var cue = new Cue(time, time, frame.value || frame.url || frame.data || '');\n cue.frame = frame;\n cue.value = frame;\n deprecateOldCue(cue);\n metadataTrack.addCue(cue);\n });\n });\n\n if (!metadataTrack.cues || !metadataTrack.cues.length) {\n return;\n } // Updating the metadeta cues so that\n // the endTime of each cue is the startTime of the next cue\n // the endTime of last cue is the duration of the video\n\n\n var cues = metadataTrack.cues;\n var cuesArray = []; // Create a copy of the TextTrackCueList...\n // ...disregarding cues with a falsey value\n\n for (var i = 0; i < cues.length; i++) {\n if (cues[i]) {\n cuesArray.push(cues[i]);\n }\n } // Group cues by their startTime value\n\n\n var cuesGroupedByStartTime = cuesArray.reduce(function (obj, cue) {\n var timeSlot = obj[cue.startTime] || [];\n timeSlot.push(cue);\n obj[cue.startTime] = timeSlot;\n return obj;\n }, {}); // Sort startTimes by ascending order\n\n var sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort(function (a, b) {\n return Number(a) - Number(b);\n }); // Map each cue group's endTime to the next group's startTime\n\n sortedStartTimes.forEach(function (startTime, idx) {\n var cueGroup = cuesGroupedByStartTime[startTime];\n var nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration; // Map each cue's endTime the next group's startTime\n\n cueGroup.forEach(function (cue) {\n cue.endTime = nextTime;\n });\n });\n};\n/**\n * Create metadata text track on video.js if it does not exist\n *\n * @param {Object} inbandTextTracks a reference to current inbandTextTracks\n * @param {string} dispatchType the inband metadata track dispatch type\n * @param {Object} tech the video.js tech\n * @private\n */\n\n\nvar createMetadataTrackIfNotExists = function createMetadataTrackIfNotExists(inbandTextTracks, dispatchType, tech) {\n if (inbandTextTracks.metadataTrack_) {\n return;\n }\n\n inbandTextTracks.metadataTrack_ = tech.addRemoteTextTrack({\n kind: 'metadata',\n label: 'Timed Metadata'\n }, false).track;\n inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType = dispatchType;\n};\n/**\n * Remove cues from a track on video.js.\n *\n * @param {Double} start start of where we should remove the cue\n * @param {Double} end end of where the we should remove the cue\n * @param {Object} track the text track to remove the cues from\n * @private\n */\n\n\nvar removeCuesFromTrack = function removeCuesFromTrack(start, end, track) {\n var i;\n var cue;\n\n if (!track) {\n return;\n }\n\n if (!track.cues) {\n return;\n }\n\n i = track.cues.length;\n\n while (i--) {\n cue = track.cues[i]; // Remove any cue within the provided start and end time\n\n if (cue.startTime >= start && cue.endTime <= end) {\n track.removeCue(cue);\n }\n }\n};\n/**\n * Remove duplicate cues from a track on video.js (a cue is considered a\n * duplicate if it has the same time interval and text as another)\n *\n * @param {Object} track the text track to remove the duplicate cues from\n * @private\n */\n\n\nvar removeDuplicateCuesFromTrack = function removeDuplicateCuesFromTrack(track) {\n var cues = track.cues;\n\n if (!cues) {\n return;\n }\n\n for (var i = 0; i < cues.length; i++) {\n var duplicates = [];\n var occurrences = 0;\n\n for (var j = 0; j < cues.length; j++) {\n if (cues[i].startTime === cues[j].startTime && cues[i].endTime === cues[j].endTime && cues[i].text === cues[j].text) {\n occurrences++;\n\n if (occurrences > 1) {\n duplicates.push(cues[j]);\n }\n }\n }\n\n if (duplicates.length) {\n duplicates.forEach(function (dupe) {\n return track.removeCue(dupe);\n });\n }\n }\n};\n/**\n * Returns a list of gops in the buffer that have a pts value of 3 seconds or more in\n * front of current time.\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {number} currentTime\n * The current time\n * @param {Double} mapping\n * Offset to map display time to stream presentation time\n * @return {Array}\n * List of gops considered safe to append over\n */\n\n\nvar video_es_gopsSafeToAlignWith = function gopsSafeToAlignWith(buffer, currentTime, mapping) {\n if (typeof currentTime === 'undefined' || currentTime === null || !buffer.length) {\n return [];\n } // pts value for current time + 3 seconds to give a bit more wiggle room\n\n\n var currentTimePts = Math.ceil((currentTime - mapping + 3) * clock_[\"ONE_SECOND_IN_TS\"]);\n var i;\n\n for (i = 0; i < buffer.length; i++) {\n if (buffer[i].pts > currentTimePts) {\n break;\n }\n }\n\n return buffer.slice(i);\n};\n/**\n * Appends gop information (timing and byteLength) received by the transmuxer for the\n * gops appended in the last call to appendBuffer\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {Array} gops\n * List of new gop information\n * @param {boolean} replace\n * If true, replace the buffer with the new gop information. If false, append the\n * new gop information to the buffer in the right location of time.\n * @return {Array}\n * Updated list of gop information\n */\n\n\nvar updateGopBuffer = function updateGopBuffer(buffer, gops, replace) {\n if (!gops.length) {\n return buffer;\n }\n\n if (replace) {\n // If we are in safe append mode, then completely overwrite the gop buffer\n // with the most recent appeneded data. This will make sure that when appending\n // future segments, we only try to align with gops that are both ahead of current\n // time and in the last segment appended.\n return gops.slice();\n }\n\n var start = gops[0].pts;\n var i = 0;\n\n for (i; i < buffer.length; i++) {\n if (buffer[i].pts >= start) {\n break;\n }\n }\n\n return buffer.slice(0, i).concat(gops);\n};\n/**\n * Removes gop information in buffer that overlaps with provided start and end\n *\n * @param {Array} buffer\n * The current buffer of gop information\n * @param {Double} start\n * position to start the remove at\n * @param {Double} end\n * position to end the remove at\n * @param {Double} mapping\n * Offset to map display time to stream presentation time\n */\n\n\nvar video_es_removeGopBuffer = function removeGopBuffer(buffer, start, end, mapping) {\n var startPts = Math.ceil((start - mapping) * clock_[\"ONE_SECOND_IN_TS\"]);\n var endPts = Math.ceil((end - mapping) * clock_[\"ONE_SECOND_IN_TS\"]);\n var updatedBuffer = buffer.slice();\n var i = buffer.length;\n\n while (i--) {\n if (buffer[i].pts <= endPts) {\n break;\n }\n }\n\n if (i === -1) {\n // no removal because end of remove range is before start of buffer\n return updatedBuffer;\n }\n\n var j = i + 1;\n\n while (j--) {\n if (buffer[j].pts <= startPts) {\n break;\n }\n } // clamp remove range start to 0 index\n\n\n j = Math.max(j, 0);\n updatedBuffer.splice(j, i - j + 1);\n return updatedBuffer;\n};\n\nvar shallowEqual = function shallowEqual(a, b) {\n // if both are undefined\n // or one or the other is undefined\n // they are not equal\n if (!a && !b || !a && b || a && !b) {\n return false;\n } // they are the same object and thus, equal\n\n\n if (a === b) {\n return true;\n } // sort keys so we can make sure they have\n // all the same keys later.\n\n\n var akeys = Object.keys(a).sort();\n var bkeys = Object.keys(b).sort(); // different number of keys, not equal\n\n if (akeys.length !== bkeys.length) {\n return false;\n }\n\n for (var i = 0; i < akeys.length; i++) {\n var key = akeys[i]; // different sorted keys, not equal\n\n if (key !== bkeys[i]) {\n return false;\n } // different values, not equal\n\n\n if (a[key] !== b[key]) {\n return false;\n }\n }\n\n return true;\n}; // https://www.w3.org/TR/WebIDL-1/#quotaexceedederror\n\n\nvar QUOTA_EXCEEDED_ERR = 22;\n/**\n * The segment loader has no recourse except to fetch a segment in the\n * current playlist and use the internal timestamps in that segment to\n * generate a syncPoint. This function returns a good candidate index\n * for that process.\n *\n * @param {Array} segments - the segments array from a playlist.\n * @return {number} An index of a segment from the playlist to load\n */\n\nvar getSyncSegmentCandidate = function getSyncSegmentCandidate(currentTimeline, segments, targetTime) {\n segments = segments || [];\n var timelineSegments = [];\n var time = 0;\n\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n\n if (currentTimeline === segment.timeline) {\n timelineSegments.push(i);\n time += segment.duration;\n\n if (time > targetTime) {\n return i;\n }\n }\n }\n\n if (timelineSegments.length === 0) {\n return 0;\n } // default to the last timeline segment\n\n\n return timelineSegments[timelineSegments.length - 1];\n}; // In the event of a quota exceeded error, keep at least one second of back buffer. This\n// number was arbitrarily chosen and may be updated in the future, but seemed reasonable\n// as a start to prevent any potential issues with removing content too close to the\n// playhead.\n\n\nvar MIN_BACK_BUFFER = 1; // in ms\n\nvar CHECK_BUFFER_DELAY = 500;\n\nvar finite = function finite(num) {\n return typeof num === 'number' && isFinite(num);\n}; // With most content hovering around 30fps, if a segment has a duration less than a half\n// frame at 30fps or one frame at 60fps, the bandwidth and throughput calculations will\n// not accurately reflect the rest of the content.\n\n\nvar MIN_SEGMENT_DURATION_TO_SAVE_STATS = 1 / 60;\n\nvar illegalMediaSwitch = function illegalMediaSwitch(loaderType, startingMedia, trackInfo) {\n // Although these checks should most likely cover non 'main' types, for now it narrows\n // the scope of our checks.\n if (loaderType !== 'main' || !startingMedia || !trackInfo) {\n return null;\n }\n\n if (!trackInfo.hasAudio && !trackInfo.hasVideo) {\n return 'Neither audio nor video found in segment.';\n }\n\n if (startingMedia.hasVideo && !trackInfo.hasVideo) {\n return '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.';\n }\n\n if (!startingMedia.hasVideo && trackInfo.hasVideo) {\n return '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.';\n }\n\n return null;\n};\n/**\n * Calculates a time value that is safe to remove from the back buffer without interrupting\n * playback.\n *\n * @param {TimeRange} seekable\n * The current seekable range\n * @param {number} currentTime\n * The current time of the player\n * @param {number} targetDuration\n * The target duration of the current playlist\n * @return {number}\n * Time that is safe to remove from the back buffer without interrupting playback\n */\n\n\nvar safeBackBufferTrimTime = function safeBackBufferTrimTime(seekable, currentTime, targetDuration) {\n // 30 seconds before the playhead provides a safe default for trimming.\n //\n // Choosing a reasonable default is particularly important for high bitrate content and\n // VOD videos/live streams with large windows, as the buffer may end up overfilled and\n // throw an APPEND_BUFFER_ERR.\n var trimTime = currentTime - Config.BACK_BUFFER_LENGTH;\n\n if (seekable.length) {\n // Some live playlists may have a shorter window of content than the full allowed back\n // buffer. For these playlists, don't save content that's no longer within the window.\n trimTime = Math.max(trimTime, seekable.start(0));\n } // Don't remove within target duration of the current time to avoid the possibility of\n // removing the GOP currently being played, as removing it can cause playback stalls.\n\n\n var maxTrimTime = currentTime - targetDuration;\n return Math.min(maxTrimTime, trimTime);\n};\n\nvar segmentInfoString = function segmentInfoString(segmentInfo) {\n var startOfSegment = segmentInfo.startOfSegment,\n duration = segmentInfo.duration,\n segment = segmentInfo.segment,\n part = segmentInfo.part,\n _segmentInfo$playlist = segmentInfo.playlist,\n seq = _segmentInfo$playlist.mediaSequence,\n id = _segmentInfo$playlist.id,\n _segmentInfo$playlist2 = _segmentInfo$playlist.segments,\n segments = _segmentInfo$playlist2 === void 0 ? [] : _segmentInfo$playlist2,\n index = segmentInfo.mediaIndex,\n partIndex = segmentInfo.partIndex,\n timeline = segmentInfo.timeline;\n var segmentLen = segments.length - 1;\n var selection = 'mediaIndex/partIndex increment';\n\n if (segmentInfo.getMediaInfoForTime) {\n selection = \"getMediaInfoForTime (\" + segmentInfo.getMediaInfoForTime + \")\";\n } else if (segmentInfo.isSyncRequest) {\n selection = 'getSyncSegmentCandidate (isSyncRequest)';\n }\n\n var hasPartIndex = typeof partIndex === 'number';\n var name = segmentInfo.segment.uri ? 'segment' : 'pre-segment';\n var zeroBasedPartCount = hasPartIndex ? getKnownPartCount({\n preloadSegment: segment\n }) - 1 : 0;\n return name + \" [\" + (seq + index) + \"/\" + (seq + segmentLen) + \"]\" + (hasPartIndex ? \" part [\" + partIndex + \"/\" + zeroBasedPartCount + \"]\" : '') + (\" segment start/end [\" + segment.start + \" => \" + segment.end + \"]\") + (hasPartIndex ? \" part start/end [\" + part.start + \" => \" + part.end + \"]\" : '') + (\" startOfSegment [\" + startOfSegment + \"]\") + (\" duration [\" + duration + \"]\") + (\" timeline [\" + timeline + \"]\") + (\" selected by [\" + selection + \"]\") + (\" playlist [\" + id + \"]\");\n};\n\nvar timingInfoPropertyForMedia = function timingInfoPropertyForMedia(mediaType) {\n return mediaType + \"TimingInfo\";\n};\n/**\n * Returns the timestamp offset to use for the segment.\n *\n * @param {number} segmentTimeline\n * The timeline of the segment\n * @param {number} currentTimeline\n * The timeline currently being followed by the loader\n * @param {number} startOfSegment\n * The estimated segment start\n * @param {TimeRange[]} buffered\n * The loader's buffer\n * @param {boolean} overrideCheck\n * If true, no checks are made to see if the timestamp offset value should be set,\n * but sets it directly to a value.\n *\n * @return {number|null}\n * Either a number representing a new timestamp offset, or null if the segment is\n * part of the same timeline\n */\n\n\nvar timestampOffsetForSegment = function timestampOffsetForSegment(_ref) {\n var segmentTimeline = _ref.segmentTimeline,\n currentTimeline = _ref.currentTimeline,\n startOfSegment = _ref.startOfSegment,\n buffered = _ref.buffered,\n overrideCheck = _ref.overrideCheck; // Check to see if we are crossing a discontinuity to see if we need to set the\n // timestamp offset on the transmuxer and source buffer.\n //\n // Previously, we changed the timestampOffset if the start of this segment was less than\n // the currently set timestampOffset, but this isn't desirable as it can produce bad\n // behavior, especially around long running live streams.\n\n if (!overrideCheck && segmentTimeline === currentTimeline) {\n return null;\n } // When changing renditions, it's possible to request a segment on an older timeline. For\n // instance, given two renditions with the following:\n //\n // #EXTINF:10\n // segment1\n // #EXT-X-DISCONTINUITY\n // #EXTINF:10\n // segment2\n // #EXTINF:10\n // segment3\n //\n // And the current player state:\n //\n // current time: 8\n // buffer: 0 => 20\n //\n // The next segment on the current rendition would be segment3, filling the buffer from\n // 20s onwards. However, if a rendition switch happens after segment2 was requested,\n // then the next segment to be requested will be segment1 from the new rendition in\n // order to fill time 8 and onwards. Using the buffered end would result in repeated\n // content (since it would position segment1 of the new rendition starting at 20s). This\n // case can be identified when the new segment's timeline is a prior value. Instead of\n // using the buffered end, the startOfSegment can be used, which, hopefully, will be\n // more accurate to the actual start time of the segment.\n\n\n if (segmentTimeline < currentTimeline) {\n return startOfSegment;\n } // segmentInfo.startOfSegment used to be used as the timestamp offset, however, that\n // value uses the end of the last segment if it is available. While this value\n // should often be correct, it's better to rely on the buffered end, as the new\n // content post discontinuity should line up with the buffered end as if it were\n // time 0 for the new content.\n\n\n return buffered.length ? buffered.end(buffered.length - 1) : startOfSegment;\n};\n/**\n * Returns whether or not the loader should wait for a timeline change from the timeline\n * change controller before processing the segment.\n *\n * Primary timing in VHS goes by video. This is different from most media players, as\n * audio is more often used as the primary timing source. For the foreseeable future, VHS\n * will continue to use video as the primary timing source, due to the current logic and\n * expectations built around it.\n\n * Since the timing follows video, in order to maintain sync, the video loader is\n * responsible for setting both audio and video source buffer timestamp offsets.\n *\n * Setting different values for audio and video source buffers could lead to\n * desyncing. The following examples demonstrate some of the situations where this\n * distinction is important. Note that all of these cases involve demuxed content. When\n * content is muxed, the audio and video are packaged together, therefore syncing\n * separate media playlists is not an issue.\n *\n * CASE 1: Audio prepares to load a new timeline before video:\n *\n * Timeline: 0 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader: ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader ^\n *\n * In the above example, the audio loader is preparing to load the 6th segment, the first\n * after a discontinuity, while the video loader is still loading the 5th segment, before\n * the discontinuity.\n *\n * If the audio loader goes ahead and loads and appends the 6th segment before the video\n * loader crosses the discontinuity, then when appended, the 6th audio segment will use\n * the timestamp offset from timeline 0. This will likely lead to desyncing. In addition,\n * the audio loader must provide the audioAppendStart value to trim the content in the\n * transmuxer, and that value relies on the audio timestamp offset. Since the audio\n * timestamp offset is set by the video (main) loader, the audio loader shouldn't load the\n * segment until that value is provided.\n *\n * CASE 2: Video prepares to load a new timeline before audio:\n *\n * Timeline: 0 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader: ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader ^\n *\n * In the above example, the video loader is preparing to load the 6th segment, the first\n * after a discontinuity, while the audio loader is still loading the 5th segment, before\n * the discontinuity.\n *\n * If the video loader goes ahead and loads and appends the 6th segment, then once the\n * segment is loaded and processed, both the video and audio timestamp offsets will be\n * set, since video is used as the primary timing source. This is to ensure content lines\n * up appropriately, as any modifications to the video timing are reflected by audio when\n * the video loader sets the audio and video timestamp offsets to the same value. However,\n * setting the timestamp offset for audio before audio has had a chance to change\n * timelines will likely lead to desyncing, as the audio loader will append segment 5 with\n * a timestamp intended to apply to segments from timeline 1 rather than timeline 0.\n *\n * CASE 3: When seeking, audio prepares to load a new timeline before video\n *\n * Timeline: 0 1\n * Audio Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Audio Loader: ^\n * Video Segments: 0 1 2 3 4 5 DISCO 6 7 8 9\n * Video Loader ^\n *\n * In the above example, both audio and video loaders are loading segments from timeline\n * 0, but imagine that the seek originated from timeline 1.\n *\n * When seeking to a new timeline, the timestamp offset will be set based on the expected\n * segment start of the loaded video segment. In order to maintain sync, the audio loader\n * must wait for the video loader to load its segment and update both the audio and video\n * timestamp offsets before it may load and append its own segment. This is the case\n * whether the seek results in a mismatched segment request (e.g., the audio loader\n * chooses to load segment 3 and the video loader chooses to load segment 4) or the\n * loaders choose to load the same segment index from each playlist, as the segments may\n * not be aligned perfectly, even for matching segment indexes.\n *\n * @param {Object} timelinechangeController\n * @param {number} currentTimeline\n * The timeline currently being followed by the loader\n * @param {number} segmentTimeline\n * The timeline of the segment being loaded\n * @param {('main'|'audio')} loaderType\n * The loader type\n * @param {boolean} audioDisabled\n * Whether the audio is disabled for the loader. This should only be true when the\n * loader may have muxed audio in its segment, but should not append it, e.g., for\n * the main loader when an alternate audio playlist is active.\n *\n * @return {boolean}\n * Whether the loader should wait for a timeline change from the timeline change\n * controller before processing the segment\n */\n\n\nvar shouldWaitForTimelineChange = function shouldWaitForTimelineChange(_ref2) {\n var timelineChangeController = _ref2.timelineChangeController,\n currentTimeline = _ref2.currentTimeline,\n segmentTimeline = _ref2.segmentTimeline,\n loaderType = _ref2.loaderType,\n audioDisabled = _ref2.audioDisabled;\n\n if (currentTimeline === segmentTimeline) {\n return false;\n }\n\n if (loaderType === 'audio') {\n var lastMainTimelineChange = timelineChangeController.lastTimelineChange({\n type: 'main'\n }); // Audio loader should wait if:\n //\n // * main hasn't had a timeline change yet (thus has not loaded its first segment)\n // * main hasn't yet changed to the timeline audio is looking to load\n\n return !lastMainTimelineChange || lastMainTimelineChange.to !== segmentTimeline;\n } // The main loader only needs to wait for timeline changes if there's demuxed audio.\n // Otherwise, there's nothing to wait for, since audio would be muxed into the main\n // loader's segments (or the content is audio/video only and handled by the main\n // loader).\n\n\n if (loaderType === 'main' && audioDisabled) {\n var pendingAudioTimelineChange = timelineChangeController.pendingTimelineChange({\n type: 'audio'\n }); // Main loader should wait for the audio loader if audio is not pending a timeline\n // change to the current timeline.\n //\n // Since the main loader is responsible for setting the timestamp offset for both\n // audio and video, the main loader must wait for audio to be about to change to its\n // timeline before setting the offset, otherwise, if audio is behind in loading,\n // segments from the previous timeline would be adjusted by the new timestamp offset.\n //\n // This requirement means that video will not cross a timeline until the audio is\n // about to cross to it, so that way audio and video will always cross the timeline\n // together.\n //\n // In addition to normal timeline changes, these rules also apply to the start of a\n // stream (going from a non-existent timeline, -1, to timeline 0). It's important\n // that these rules apply to the first timeline change because if they did not, it's\n // possible that the main loader will cross two timelines before the audio loader has\n // crossed one. Logic may be implemented to handle the startup as a special case, but\n // it's easier to simply treat all timeline changes the same.\n\n if (pendingAudioTimelineChange && pendingAudioTimelineChange.to === segmentTimeline) {\n return false;\n }\n\n return true;\n }\n\n return false;\n};\n\nvar mediaDuration = function mediaDuration(audioTimingInfo, videoTimingInfo) {\n var audioDuration = audioTimingInfo && typeof audioTimingInfo.start === 'number' && typeof audioTimingInfo.end === 'number' ? audioTimingInfo.end - audioTimingInfo.start : 0;\n var videoDuration = videoTimingInfo && typeof videoTimingInfo.start === 'number' && typeof videoTimingInfo.end === 'number' ? videoTimingInfo.end - videoTimingInfo.start : 0;\n return Math.max(audioDuration, videoDuration);\n};\n\nvar segmentTooLong = function segmentTooLong(_ref3) {\n var segmentDuration = _ref3.segmentDuration,\n maxDuration = _ref3.maxDuration; // 0 duration segments are most likely due to metadata only segments or a lack of\n // information.\n\n if (!segmentDuration) {\n return false;\n } // For HLS:\n //\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1\n // The EXTINF duration of each Media Segment in the Playlist\n // file, when rounded to the nearest integer, MUST be less than or equal\n // to the target duration; longer segments can trigger playback stalls\n // or other errors.\n //\n // For DASH, the mpd-parser uses the largest reported segment duration as the target\n // duration. Although that reported duration is occasionally approximate (i.e., not\n // exact), a strict check may report that a segment is too long more often in DASH.\n\n\n return Math.round(segmentDuration) > maxDuration + TIME_FUDGE_FACTOR;\n};\n\nvar getTroublesomeSegmentDurationMessage = function getTroublesomeSegmentDurationMessage(segmentInfo, sourceType) {\n // Right now we aren't following DASH's timing model exactly, so only perform\n // this check for HLS content.\n if (sourceType !== 'hls') {\n return null;\n }\n\n var segmentDuration = mediaDuration(segmentInfo.audioTimingInfo, segmentInfo.videoTimingInfo); // Don't report if we lack information.\n //\n // If the segment has a duration of 0 it is either a lack of information or a\n // metadata only segment and shouldn't be reported here.\n\n if (!segmentDuration) {\n return null;\n }\n\n var targetDuration = segmentInfo.playlist.targetDuration;\n var isSegmentWayTooLong = segmentTooLong({\n segmentDuration: segmentDuration,\n maxDuration: targetDuration * 2\n });\n var isSegmentSlightlyTooLong = segmentTooLong({\n segmentDuration: segmentDuration,\n maxDuration: targetDuration\n });\n var segmentTooLongMessage = \"Segment with index \" + segmentInfo.mediaIndex + \" \" + (\"from playlist \" + segmentInfo.playlist.id + \" \") + (\"has a duration of \" + segmentDuration + \" \") + (\"when the reported duration is \" + segmentInfo.duration + \" \") + (\"and the target duration is \" + targetDuration + \". \") + 'For HLS content, a duration in excess of the target duration may result in ' + 'playback issues. See the HLS specification section on EXT-X-TARGETDURATION for ' + 'more details: ' + 'https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1';\n\n if (isSegmentWayTooLong || isSegmentSlightlyTooLong) {\n return {\n severity: isSegmentWayTooLong ? 'warn' : 'info',\n message: segmentTooLongMessage\n };\n }\n\n return null;\n};\n/**\n * An object that manages segment loading and appending.\n *\n * @class SegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\n\nvar video_es_SegmentLoader = /*#__PURE__*/function (_videojs$EventTarget) {\n inheritsLoose_default()(SegmentLoader, _videojs$EventTarget);\n\n function SegmentLoader(settings, options) {\n var _this;\n\n _this = _videojs$EventTarget.call(this) || this; // check pre-conditions\n\n if (!settings) {\n throw new TypeError('Initialization settings are required');\n }\n\n if (typeof settings.currentTime !== 'function') {\n throw new TypeError('No currentTime getter specified');\n }\n\n if (!settings.mediaSource) {\n throw new TypeError('No MediaSource specified');\n } // public properties\n\n\n _this.bandwidth = settings.bandwidth;\n _this.throughput = {\n rate: 0,\n count: 0\n };\n _this.roundTrip = NaN;\n\n _this.resetStats_();\n\n _this.mediaIndex = null;\n _this.partIndex = null; // private settings\n\n _this.hasPlayed_ = settings.hasPlayed;\n _this.currentTime_ = settings.currentTime;\n _this.seekable_ = settings.seekable;\n _this.seeking_ = settings.seeking;\n _this.duration_ = settings.duration;\n _this.mediaSource_ = settings.mediaSource;\n _this.vhs_ = settings.vhs;\n _this.loaderType_ = settings.loaderType;\n _this.currentMediaInfo_ = void 0;\n _this.startingMediaInfo_ = void 0;\n _this.segmentMetadataTrack_ = settings.segmentMetadataTrack;\n _this.goalBufferLength_ = settings.goalBufferLength;\n _this.sourceType_ = settings.sourceType;\n _this.sourceUpdater_ = settings.sourceUpdater;\n _this.inbandTextTracks_ = settings.inbandTextTracks;\n _this.state_ = 'INIT';\n _this.timelineChangeController_ = settings.timelineChangeController;\n _this.shouldSaveSegmentTimingInfo_ = true;\n _this.parse708captions_ = settings.parse708captions;\n _this.experimentalExactManifestTimings = settings.experimentalExactManifestTimings; // private instance variables\n\n _this.checkBufferTimeout_ = null;\n _this.error_ = void 0;\n _this.currentTimeline_ = -1;\n _this.pendingSegment_ = null;\n _this.xhrOptions_ = null;\n _this.pendingSegments_ = [];\n _this.audioDisabled_ = false;\n _this.isPendingTimestampOffset_ = false; // TODO possibly move gopBuffer and timeMapping info to a separate controller\n\n _this.gopBuffer_ = [];\n _this.timeMapping_ = 0;\n _this.safeAppend_ = videojs.browser.IE_VERSION >= 11;\n _this.appendInitSegment_ = {\n audio: true,\n video: true\n };\n _this.playlistOfLastInitSegment_ = {\n audio: null,\n video: null\n };\n _this.callQueue_ = []; // If the segment loader prepares to load a segment, but does not have enough\n // information yet to start the loading process (e.g., if the audio loader wants to\n // load a segment from the next timeline but the main loader hasn't yet crossed that\n // timeline), then the load call will be added to the queue until it is ready to be\n // processed.\n\n _this.loadQueue_ = [];\n _this.metadataQueue_ = {\n id3: [],\n caption: []\n };\n _this.waitingOnRemove_ = false;\n _this.quotaExceededErrorRetryTimeout_ = null; // Fragmented mp4 playback\n\n _this.activeInitSegmentId_ = null;\n _this.initSegments_ = {}; // HLSe playback\n\n _this.cacheEncryptionKeys_ = settings.cacheEncryptionKeys;\n _this.keyCache_ = {};\n _this.decrypter_ = settings.decrypter; // Manages the tracking and generation of sync-points, mappings\n // between a time in the display time and a segment index within\n // a playlist\n\n _this.syncController_ = settings.syncController;\n _this.syncPoint_ = {\n segmentIndex: 0,\n time: 0\n };\n _this.transmuxer_ = _this.createTransmuxer_();\n\n _this.triggerSyncInfoUpdate_ = function () {\n return _this.trigger('syncinfoupdate');\n };\n\n _this.syncController_.on('syncinfoupdate', _this.triggerSyncInfoUpdate_);\n\n _this.mediaSource_.addEventListener('sourceopen', function () {\n if (!_this.isEndOfStream_()) {\n _this.ended_ = false;\n }\n }); // ...for determining the fetch location\n\n\n _this.fetchAtBuffer_ = false;\n _this.logger_ = logger(\"SegmentLoader[\" + _this.loaderType_ + \"]\");\n Object.defineProperty(assertThisInitialized_default()(_this), 'state', {\n get: function get() {\n return this.state_;\n },\n set: function set(newState) {\n if (newState !== this.state_) {\n this.logger_(this.state_ + \" -> \" + newState);\n this.state_ = newState;\n this.trigger('statechange');\n }\n }\n });\n\n _this.sourceUpdater_.on('ready', function () {\n if (_this.hasEnoughInfoToAppend_()) {\n _this.processCallQueue_();\n }\n }); // Only the main loader needs to listen for pending timeline changes, as the main\n // loader should wait for audio to be ready to change its timeline so that both main\n // and audio timelines change together. For more details, see the\n // shouldWaitForTimelineChange function.\n\n\n if (_this.loaderType_ === 'main') {\n _this.timelineChangeController_.on('pendingtimelinechange', function () {\n if (_this.hasEnoughInfoToAppend_()) {\n _this.processCallQueue_();\n }\n });\n } // The main loader only listens on pending timeline changes, but the audio loader,\n // since its loads follow main, needs to listen on timeline changes. For more details,\n // see the shouldWaitForTimelineChange function.\n\n\n if (_this.loaderType_ === 'audio') {\n _this.timelineChangeController_.on('timelinechange', function () {\n if (_this.hasEnoughInfoToLoad_()) {\n _this.processLoadQueue_();\n }\n\n if (_this.hasEnoughInfoToAppend_()) {\n _this.processCallQueue_();\n }\n });\n }\n\n return _this;\n }\n\n var _proto = SegmentLoader.prototype;\n\n _proto.createTransmuxer_ = function createTransmuxer_() {\n return segmentTransmuxer.createTransmuxer({\n remux: false,\n alignGopsAtEnd: this.safeAppend_,\n keepOriginalTimestamps: true,\n parse708captions: this.parse708captions_\n });\n }\n /**\n * reset all of our media stats\n *\n * @private\n */\n ;\n\n _proto.resetStats_ = function resetStats_() {\n this.mediaBytesTransferred = 0;\n this.mediaRequests = 0;\n this.mediaRequestsAborted = 0;\n this.mediaRequestsTimedout = 0;\n this.mediaRequestsErrored = 0;\n this.mediaTransferDuration = 0;\n this.mediaSecondsLoaded = 0;\n this.mediaAppends = 0;\n }\n /**\n * dispose of the SegmentLoader and reset to the default state\n */\n ;\n\n _proto.dispose = function dispose() {\n this.trigger('dispose');\n this.state = 'DISPOSED';\n this.pause();\n this.abort_();\n\n if (this.transmuxer_) {\n this.transmuxer_.terminate();\n }\n\n this.resetStats_();\n\n if (this.checkBufferTimeout_) {\n window_default.a.clearTimeout(this.checkBufferTimeout_);\n }\n\n if (this.syncController_ && this.triggerSyncInfoUpdate_) {\n this.syncController_.off('syncinfoupdate', this.triggerSyncInfoUpdate_);\n }\n\n this.off();\n };\n\n _proto.setAudio = function setAudio(enable) {\n this.audioDisabled_ = !enable;\n\n if (enable) {\n this.appendInitSegment_.audio = true;\n } else {\n // remove current track audio if it gets disabled\n this.sourceUpdater_.removeAudio(0, this.duration_());\n }\n }\n /**\n * abort anything that is currently doing on with the SegmentLoader\n * and reset to a default state\n */\n ;\n\n _proto.abort = function abort() {\n if (this.state !== 'WAITING') {\n if (this.pendingSegment_) {\n this.pendingSegment_ = null;\n }\n\n return;\n }\n\n this.abort_(); // We aborted the requests we were waiting on, so reset the loader's state to READY\n // since we are no longer \"waiting\" on any requests. XHR callback is not always run\n // when the request is aborted. This will prevent the loader from being stuck in the\n // WAITING state indefinitely.\n\n this.state = 'READY'; // don't wait for buffer check timeouts to begin fetching the\n // next segment\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n }\n /**\n * abort all pending xhr requests and null any pending segements\n *\n * @private\n */\n ;\n\n _proto.abort_ = function abort_() {\n if (this.pendingSegment_ && this.pendingSegment_.abortRequests) {\n this.pendingSegment_.abortRequests();\n } // clear out the segment being processed\n\n\n this.pendingSegment_ = null;\n this.callQueue_ = [];\n this.loadQueue_ = [];\n this.metadataQueue_.id3 = [];\n this.metadataQueue_.caption = [];\n this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);\n this.waitingOnRemove_ = false;\n window_default.a.clearTimeout(this.quotaExceededErrorRetryTimeout_);\n this.quotaExceededErrorRetryTimeout_ = null;\n };\n\n _proto.checkForAbort_ = function checkForAbort_(requestId) {\n // If the state is APPENDING, then aborts will not modify the state, meaning the first\n // callback that happens should reset the state to READY so that loading can continue.\n if (this.state === 'APPENDING' && !this.pendingSegment_) {\n this.state = 'READY';\n return true;\n }\n\n if (!this.pendingSegment_ || this.pendingSegment_.requestId !== requestId) {\n return true;\n }\n\n return false;\n }\n /**\n * set an error on the segment loader and null out any pending segements\n *\n * @param {Error} error the error to set on the SegmentLoader\n * @return {Error} the error that was set or that is currently set\n */\n ;\n\n _proto.error = function error(_error) {\n if (typeof _error !== 'undefined') {\n this.logger_('error occurred:', _error);\n this.error_ = _error;\n }\n\n this.pendingSegment_ = null;\n return this.error_;\n };\n\n _proto.endOfStream = function endOfStream() {\n this.ended_ = true;\n\n if (this.transmuxer_) {\n // need to clear out any cached data to prepare for the new segment\n segmentTransmuxer.reset(this.transmuxer_);\n }\n\n this.gopBuffer_.length = 0;\n this.pause();\n this.trigger('ended');\n }\n /**\n * Indicates which time ranges are buffered\n *\n * @return {TimeRange}\n * TimeRange object representing the current buffered ranges\n */\n ;\n\n _proto.buffered_ = function buffered_() {\n var trackInfo = this.getMediaInfo_();\n\n if (!this.sourceUpdater_ || !trackInfo) {\n return videojs.createTimeRanges();\n }\n\n if (this.loaderType_ === 'main') {\n var hasAudio = trackInfo.hasAudio,\n hasVideo = trackInfo.hasVideo,\n isMuxed = trackInfo.isMuxed;\n\n if (hasVideo && hasAudio && !this.audioDisabled_ && !isMuxed) {\n return this.sourceUpdater_.buffered();\n }\n\n if (hasVideo) {\n return this.sourceUpdater_.videoBuffered();\n }\n } // One case that can be ignored for now is audio only with alt audio,\n // as we don't yet have proper support for that.\n\n\n return this.sourceUpdater_.audioBuffered();\n }\n /**\n * Gets and sets init segment for the provided map\n *\n * @param {Object} map\n * The map object representing the init segment to get or set\n * @param {boolean=} set\n * If true, the init segment for the provided map should be saved\n * @return {Object}\n * map object for desired init segment\n */\n ;\n\n _proto.initSegmentForMap = function initSegmentForMap(map, set) {\n if (set === void 0) {\n set = false;\n }\n\n if (!map) {\n return null;\n }\n\n var id = initSegmentId(map);\n var storedMap = this.initSegments_[id];\n\n if (set && !storedMap && map.bytes) {\n this.initSegments_[id] = storedMap = {\n resolvedUri: map.resolvedUri,\n byterange: map.byterange,\n bytes: map.bytes,\n tracks: map.tracks,\n timescales: map.timescales\n };\n }\n\n return storedMap || map;\n }\n /**\n * Gets and sets key for the provided key\n *\n * @param {Object} key\n * The key object representing the key to get or set\n * @param {boolean=} set\n * If true, the key for the provided key should be saved\n * @return {Object}\n * Key object for desired key\n */\n ;\n\n _proto.segmentKey = function segmentKey(key, set) {\n if (set === void 0) {\n set = false;\n }\n\n if (!key) {\n return null;\n }\n\n var id = segmentKeyId(key);\n var storedKey = this.keyCache_[id]; // TODO: We should use the HTTP Expires header to invalidate our cache per\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-6.2.3\n\n if (this.cacheEncryptionKeys_ && set && !storedKey && key.bytes) {\n this.keyCache_[id] = storedKey = {\n resolvedUri: key.resolvedUri,\n bytes: key.bytes\n };\n }\n\n var result = {\n resolvedUri: (storedKey || key).resolvedUri\n };\n\n if (storedKey) {\n result.bytes = storedKey.bytes;\n }\n\n return result;\n }\n /**\n * Returns true if all configuration required for loading is present, otherwise false.\n *\n * @return {boolean} True if the all configuration is ready for loading\n * @private\n */\n ;\n\n _proto.couldBeginLoading_ = function couldBeginLoading_() {\n return this.playlist_ && !this.paused();\n }\n /**\n * load a playlist and start to fill the buffer\n */\n ;\n\n _proto.load = function load() {\n // un-pause\n this.monitorBuffer_(); // if we don't have a playlist yet, keep waiting for one to be\n // specified\n\n if (!this.playlist_) {\n return;\n } // if all the configuration is ready, initialize and begin loading\n\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n return this.init_();\n } // if we're in the middle of processing a segment already, don't\n // kick off an additional segment request\n\n\n if (!this.couldBeginLoading_() || this.state !== 'READY' && this.state !== 'INIT') {\n return;\n }\n\n this.state = 'READY';\n }\n /**\n * Once all the starting parameters have been specified, begin\n * operation. This method should only be invoked from the INIT\n * state.\n *\n * @private\n */\n ;\n\n _proto.init_ = function init_() {\n this.state = 'READY'; // if this is the audio segment loader, and it hasn't been inited before, then any old\n // audio data from the muxed content should be removed\n\n this.resetEverything();\n return this.monitorBuffer_();\n }\n /**\n * set a playlist on the segment loader\n *\n * @param {PlaylistLoader} media the playlist to set on the segment loader\n */\n ;\n\n _proto.playlist = function playlist(newPlaylist, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (!newPlaylist) {\n return;\n }\n\n var oldPlaylist = this.playlist_;\n var segmentInfo = this.pendingSegment_;\n this.playlist_ = newPlaylist;\n this.xhrOptions_ = options; // when we haven't started playing yet, the start of a live playlist\n // is always our zero-time so force a sync update each time the playlist\n // is refreshed from the server\n //\n // Use the INIT state to determine if playback has started, as the playlist sync info\n // should be fixed once requests begin (as sync points are generated based on sync\n // info), but not before then.\n\n if (this.state === 'INIT') {\n newPlaylist.syncInfo = {\n mediaSequence: newPlaylist.mediaSequence,\n time: 0\n }; // Setting the date time mapping means mapping the program date time (if available)\n // to time 0 on the player's timeline. The playlist's syncInfo serves a similar\n // purpose, mapping the initial mediaSequence to time zero. Since the syncInfo can\n // be updated as the playlist is refreshed before the loader starts loading, the\n // program date time mapping needs to be updated as well.\n //\n // This mapping is only done for the main loader because a program date time should\n // map equivalently between playlists.\n\n if (this.loaderType_ === 'main') {\n this.syncController_.setDateTimeMappingForStart(newPlaylist);\n }\n }\n\n var oldId = null;\n\n if (oldPlaylist) {\n if (oldPlaylist.id) {\n oldId = oldPlaylist.id;\n } else if (oldPlaylist.uri) {\n oldId = oldPlaylist.uri;\n }\n }\n\n this.logger_(\"playlist update [\" + oldId + \" => \" + (newPlaylist.id || newPlaylist.uri) + \"]\"); // in VOD, this is always a rendition switch (or we updated our syncInfo above)\n // in LIVE, we always want to update with new playlists (including refreshes)\n\n this.trigger('syncinfoupdate'); // if we were unpaused but waiting for a playlist, start\n // buffering now\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n return this.init_();\n }\n\n if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {\n if (this.mediaIndex !== null) {\n // we must \"resync\" the segment loader when we switch renditions and\n // the segment loader is already synced to the previous rendition\n this.resyncLoader();\n }\n\n this.currentMediaInfo_ = void 0;\n this.trigger('playlistupdate'); // the rest of this function depends on `oldPlaylist` being defined\n\n return;\n } // we reloaded the same playlist so we are in a live scenario\n // and we will likely need to adjust the mediaIndex\n\n\n var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;\n this.logger_(\"live window shift [\" + mediaSequenceDiff + \"]\"); // update the mediaIndex on the SegmentLoader\n // this is important because we can abort a request and this value must be\n // equal to the last appended mediaIndex\n\n if (this.mediaIndex !== null) {\n this.mediaIndex -= mediaSequenceDiff; // this can happen if we are going to load the first segment, but get a playlist\n // update during that. mediaIndex would go from 0 to -1 if mediaSequence in the\n // new playlist was incremented by 1.\n\n if (this.mediaIndex < 0) {\n this.mediaIndex = null;\n this.partIndex = null;\n } else {\n var segment = this.playlist_.segments[this.mediaIndex]; // partIndex should remain the same for the same segment\n // unless parts fell off of the playlist for this segment.\n // In that case we need to reset partIndex and resync\n\n if (this.partIndex && (!segment.parts || !segment.parts.length || !segment.parts[this.partIndex])) {\n var mediaIndex = this.mediaIndex;\n this.logger_(\"currently processing part (index \" + this.partIndex + \") no longer exists.\");\n this.resetLoader(); // We want to throw away the partIndex and the data associated with it,\n // as the part was dropped from our current playlists segment.\n // The mediaIndex will still be valid so keep that around.\n\n this.mediaIndex = mediaIndex;\n }\n }\n } // update the mediaIndex on the SegmentInfo object\n // this is important because we will update this.mediaIndex with this value\n // in `handleAppendsDone_` after the segment has been successfully appended\n\n\n if (segmentInfo) {\n segmentInfo.mediaIndex -= mediaSequenceDiff;\n\n if (segmentInfo.mediaIndex < 0) {\n segmentInfo.mediaIndex = null;\n segmentInfo.partIndex = null;\n } else {\n // we need to update the referenced segment so that timing information is\n // saved for the new playlist's segment, however, if the segment fell off the\n // playlist, we can leave the old reference and just lose the timing info\n if (segmentInfo.mediaIndex >= 0) {\n segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];\n }\n\n if (segmentInfo.partIndex >= 0 && segmentInfo.segment.parts) {\n segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex];\n }\n }\n }\n\n this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);\n }\n /**\n * Prevent the loader from fetching additional segments. If there\n * is a segment request outstanding, it will finish processing\n * before the loader halts. A segment loader can be unpaused by\n * calling load().\n */\n ;\n\n _proto.pause = function pause() {\n if (this.checkBufferTimeout_) {\n window_default.a.clearTimeout(this.checkBufferTimeout_);\n this.checkBufferTimeout_ = null;\n }\n }\n /**\n * Returns whether the segment loader is fetching additional\n * segments when given the opportunity. This property can be\n * modified through calls to pause() and load().\n */\n ;\n\n _proto.paused = function paused() {\n return this.checkBufferTimeout_ === null;\n }\n /**\n * Delete all the buffered data and reset the SegmentLoader\n *\n * @param {Function} [done] an optional callback to be executed when the remove\n * operation is complete\n */\n ;\n\n _proto.resetEverything = function resetEverything(done) {\n this.ended_ = false;\n this.appendInitSegment_ = {\n audio: true,\n video: true\n };\n this.resetLoader(); // remove from 0, the earliest point, to Infinity, to signify removal of everything.\n // VTT Segment Loader doesn't need to do anything but in the regular SegmentLoader,\n // we then clamp the value to duration if necessary.\n\n this.remove(0, Infinity, done); // clears fmp4 captions\n\n if (this.transmuxer_) {\n this.transmuxer_.postMessage({\n action: 'clearAllMp4Captions'\n });\n }\n }\n /**\n * Force the SegmentLoader to resync and start loading around the currentTime instead\n * of starting at the end of the buffer\n *\n * Useful for fast quality changes\n */\n ;\n\n _proto.resetLoader = function resetLoader() {\n this.fetchAtBuffer_ = false;\n this.resyncLoader();\n }\n /**\n * Force the SegmentLoader to restart synchronization and make a conservative guess\n * before returning to the simple walk-forward method\n */\n ;\n\n _proto.resyncLoader = function resyncLoader() {\n if (this.transmuxer_) {\n // need to clear out any cached data to prepare for the new segment\n segmentTransmuxer.reset(this.transmuxer_);\n }\n\n this.mediaIndex = null;\n this.partIndex = null;\n this.syncPoint_ = null;\n this.isPendingTimestampOffset_ = false;\n this.callQueue_ = [];\n this.loadQueue_ = [];\n this.metadataQueue_.id3 = [];\n this.metadataQueue_.caption = [];\n this.abort();\n\n if (this.transmuxer_) {\n this.transmuxer_.postMessage({\n action: 'clearParsedMp4Captions'\n });\n }\n }\n /**\n * Remove any data in the source buffer between start and end times\n *\n * @param {number} start - the start time of the region to remove from the buffer\n * @param {number} end - the end time of the region to remove from the buffer\n * @param {Function} [done] - an optional callback to be executed when the remove\n * @param {boolean} force - force all remove operations to happen\n * operation is complete\n */\n ;\n\n _proto.remove = function remove(start, end, done, force) {\n if (done === void 0) {\n done = function done() {};\n }\n\n if (force === void 0) {\n force = false;\n } // clamp end to duration if we need to remove everything.\n // This is due to a browser bug that causes issues if we remove to Infinity.\n // videojs/videojs-contrib-hls#1225\n\n\n if (end === Infinity) {\n end = this.duration_();\n } // skip removes that would throw an error\n // commonly happens during a rendition switch at the start of a video\n // from start 0 to end 0\n\n\n if (end <= start) {\n this.logger_('skipping remove because end ${end} is <= start ${start}');\n return;\n }\n\n if (!this.sourceUpdater_ || !this.getMediaInfo_()) {\n this.logger_('skipping remove because no source updater or starting media info'); // nothing to remove if we haven't processed any media\n\n return;\n } // set it to one to complete this function's removes\n\n\n var removesRemaining = 1;\n\n var removeFinished = function removeFinished() {\n removesRemaining--;\n\n if (removesRemaining === 0) {\n done();\n }\n };\n\n if (force || !this.audioDisabled_) {\n removesRemaining++;\n this.sourceUpdater_.removeAudio(start, end, removeFinished);\n } // While it would be better to only remove video if the main loader has video, this\n // should be safe with audio only as removeVideo will call back even if there's no\n // video buffer.\n //\n // In theory we can check to see if there's video before calling the remove, but in\n // the event that we're switching between renditions and from video to audio only\n // (when we add support for that), we may need to clear the video contents despite\n // what the new media will contain.\n\n\n if (force || this.loaderType_ === 'main') {\n this.gopBuffer_ = video_es_removeGopBuffer(this.gopBuffer_, start, end, this.timeMapping_);\n removesRemaining++;\n this.sourceUpdater_.removeVideo(start, end, removeFinished);\n } // remove any captions and ID3 tags\n\n\n for (var track in this.inbandTextTracks_) {\n removeCuesFromTrack(start, end, this.inbandTextTracks_[track]);\n }\n\n removeCuesFromTrack(start, end, this.segmentMetadataTrack_); // finished this function's removes\n\n removeFinished();\n }\n /**\n * (re-)schedule monitorBufferTick_ to run as soon as possible\n *\n * @private\n */\n ;\n\n _proto.monitorBuffer_ = function monitorBuffer_() {\n if (this.checkBufferTimeout_) {\n window_default.a.clearTimeout(this.checkBufferTimeout_);\n }\n\n this.checkBufferTimeout_ = window_default.a.setTimeout(this.monitorBufferTick_.bind(this), 1);\n }\n /**\n * As long as the SegmentLoader is in the READY state, periodically\n * invoke fillBuffer_().\n *\n * @private\n */\n ;\n\n _proto.monitorBufferTick_ = function monitorBufferTick_() {\n if (this.state === 'READY') {\n this.fillBuffer_();\n }\n\n if (this.checkBufferTimeout_) {\n window_default.a.clearTimeout(this.checkBufferTimeout_);\n }\n\n this.checkBufferTimeout_ = window_default.a.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY);\n }\n /**\n * fill the buffer with segements unless the sourceBuffers are\n * currently updating\n *\n * Note: this function should only ever be called by monitorBuffer_\n * and never directly\n *\n * @private\n */\n ;\n\n _proto.fillBuffer_ = function fillBuffer_() {\n // TODO since the source buffer maintains a queue, and we shouldn't call this function\n // except when we're ready for the next segment, this check can most likely be removed\n if (this.sourceUpdater_.updating()) {\n return;\n } // see if we need to begin loading immediately\n\n\n var segmentInfo = this.chooseNextRequest_();\n\n if (!segmentInfo) {\n return;\n }\n\n if (typeof segmentInfo.timestampOffset === 'number') {\n this.isPendingTimestampOffset_ = false;\n this.timelineChangeController_.pendingTimelineChange({\n type: this.loaderType_,\n from: this.currentTimeline_,\n to: segmentInfo.timeline\n });\n }\n\n this.loadSegment_(segmentInfo);\n }\n /**\n * Determines if we should call endOfStream on the media source based\n * on the state of the buffer or if appened segment was the final\n * segment in the playlist.\n *\n * @param {number} [mediaIndex] the media index of segment we last appended\n * @param {Object} [playlist] a media playlist object\n * @return {boolean} do we need to call endOfStream on the MediaSource\n */\n ;\n\n _proto.isEndOfStream_ = function isEndOfStream_(mediaIndex, playlist, partIndex) {\n if (mediaIndex === void 0) {\n mediaIndex = this.mediaIndex;\n }\n\n if (playlist === void 0) {\n playlist = this.playlist_;\n }\n\n if (partIndex === void 0) {\n partIndex = this.partIndex;\n }\n\n if (!playlist || !this.mediaSource_) {\n return false;\n }\n\n var segment = typeof mediaIndex === 'number' && playlist.segments[mediaIndex]; // mediaIndex is zero based but length is 1 based\n\n var appendedLastSegment = mediaIndex + 1 === playlist.segments.length; // true if there are no parts, or this is the last part.\n\n var appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length; // if we've buffered to the end of the video, we need to call endOfStream\n // so that MediaSources can trigger the `ended` event when it runs out of\n // buffered data instead of waiting for me\n\n return playlist.endList && this.mediaSource_.readyState === 'open' && appendedLastSegment && appendedLastPart;\n }\n /**\n * Determines what request should be made given current segment loader state.\n *\n * @return {Object} a request object that describes the segment/part to load\n */\n ;\n\n _proto.chooseNextRequest_ = function chooseNextRequest_() {\n var bufferedEnd = lastBufferedEnd(this.buffered_()) || 0;\n var bufferedTime = Math.max(0, bufferedEnd - this.currentTime_());\n var preloaded = !this.hasPlayed_() && bufferedTime >= 1;\n var haveEnoughBuffer = bufferedTime >= this.goalBufferLength_();\n var segments = this.playlist_.segments; // return no segment if:\n // 1. we don't have segments\n // 2. The video has not yet played and we already downloaded a segment\n // 3. we already have enough buffered time\n\n if (!segments.length || preloaded || haveEnoughBuffer) {\n return null;\n }\n\n this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());\n var next = {\n partIndex: null,\n mediaIndex: null,\n startOfSegment: null,\n playlist: this.playlist_,\n isSyncRequest: Boolean(!this.syncPoint_)\n };\n\n if (next.isSyncRequest) {\n next.mediaIndex = getSyncSegmentCandidate(this.currentTimeline_, segments, bufferedEnd);\n } else if (this.mediaIndex !== null) {\n var segment = segments[this.mediaIndex];\n var partIndex = typeof this.partIndex === 'number' ? this.partIndex : -1;\n next.startOfSegment = segment.end ? segment.end : bufferedEnd;\n\n if (segment.parts && segment.parts[partIndex + 1]) {\n next.mediaIndex = this.mediaIndex;\n next.partIndex = partIndex + 1;\n } else {\n next.mediaIndex = this.mediaIndex + 1;\n }\n } else {\n // Find the segment containing the end of the buffer or current time.\n var _Playlist$getMediaInf = Playlist.getMediaInfoForTime({\n experimentalExactManifestTimings: this.experimentalExactManifestTimings,\n playlist: this.playlist_,\n currentTime: this.fetchAtBuffer_ ? bufferedEnd : this.currentTime_(),\n startingPartIndex: this.syncPoint_.partIndex,\n startingSegmentIndex: this.syncPoint_.segmentIndex,\n startTime: this.syncPoint_.time\n }),\n segmentIndex = _Playlist$getMediaInf.segmentIndex,\n startTime = _Playlist$getMediaInf.startTime,\n _partIndex = _Playlist$getMediaInf.partIndex;\n\n next.getMediaInfoForTime = this.fetchAtBuffer_ ? 'bufferedEnd' : 'currentTime';\n next.mediaIndex = segmentIndex;\n next.startOfSegment = startTime;\n next.partIndex = _partIndex;\n }\n\n var nextSegment = segments[next.mediaIndex];\n var nextPart = nextSegment && typeof next.partIndex === 'number' && nextSegment.parts && nextSegment.parts[next.partIndex]; // if the next segment index is invalid or\n // the next partIndex is invalid do not choose a next segment.\n\n if (!nextSegment || typeof next.partIndex === 'number' && !nextPart) {\n return null;\n } // if the next segment has parts, and we don't have a partIndex.\n // Set partIndex to 0\n\n\n if (typeof next.partIndex !== 'number' && nextSegment.parts) {\n next.partIndex = 0;\n }\n\n var ended = this.mediaSource_ && this.mediaSource_.readyState === 'ended'; // do not choose a next segment if all of the following:\n // 1. this is the last segment in the playlist\n // 2. end of stream has been called on the media source already\n // 3. the player is not seeking\n\n if (next.mediaIndex >= segments.length - 1 && ended && !this.seeking_()) {\n return null;\n }\n\n return this.generateSegmentInfo_(next);\n };\n\n _proto.generateSegmentInfo_ = function generateSegmentInfo_(options) {\n var playlist = options.playlist,\n mediaIndex = options.mediaIndex,\n startOfSegment = options.startOfSegment,\n isSyncRequest = options.isSyncRequest,\n partIndex = options.partIndex,\n forceTimestampOffset = options.forceTimestampOffset,\n getMediaInfoForTime = options.getMediaInfoForTime;\n var segment = playlist.segments[mediaIndex];\n var part = typeof partIndex === 'number' && segment.parts[partIndex];\n var segmentInfo = {\n requestId: 'segment-loader-' + Math.random(),\n // resolve the segment URL relative to the playlist\n uri: part && part.resolvedUri || segment.resolvedUri,\n // the segment's mediaIndex at the time it was requested\n mediaIndex: mediaIndex,\n partIndex: part ? partIndex : null,\n // whether or not to update the SegmentLoader's state with this\n // segment's mediaIndex\n isSyncRequest: isSyncRequest,\n startOfSegment: startOfSegment,\n // the segment's playlist\n playlist: playlist,\n // unencrypted bytes of the segment\n bytes: null,\n // when a key is defined for this segment, the encrypted bytes\n encryptedBytes: null,\n // The target timestampOffset for this segment when we append it\n // to the source buffer\n timestampOffset: null,\n // The timeline that the segment is in\n timeline: segment.timeline,\n // The expected duration of the segment in seconds\n duration: part && part.duration || segment.duration,\n // retain the segment in case the playlist updates while doing an async process\n segment: segment,\n part: part,\n byteLength: 0,\n transmuxer: this.transmuxer_,\n // type of getMediaInfoForTime that was used to get this segment\n getMediaInfoForTime: getMediaInfoForTime\n };\n var overrideCheck = typeof forceTimestampOffset !== 'undefined' ? forceTimestampOffset : this.isPendingTimestampOffset_;\n segmentInfo.timestampOffset = this.timestampOffsetForSegment_({\n segmentTimeline: segment.timeline,\n currentTimeline: this.currentTimeline_,\n startOfSegment: startOfSegment,\n buffered: this.buffered_(),\n overrideCheck: overrideCheck\n });\n var audioBufferedEnd = lastBufferedEnd(this.sourceUpdater_.audioBuffered());\n\n if (typeof audioBufferedEnd === 'number') {\n // since the transmuxer is using the actual timing values, but the buffer is\n // adjusted by the timestamp offset, we must adjust the value here\n segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset();\n }\n\n if (this.sourceUpdater_.videoBuffered().length) {\n segmentInfo.gopsToAlignWith = video_es_gopsSafeToAlignWith(this.gopBuffer_, // since the transmuxer is using the actual timing values, but the time is\n // adjusted by the timestmap offset, we must adjust the value here\n this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(), this.timeMapping_);\n }\n\n return segmentInfo;\n } // get the timestampoffset for a segment,\n // added so that vtt segment loader can override and prevent\n // adding timestamp offsets.\n ;\n\n _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_(options) {\n return timestampOffsetForSegment(options);\n }\n /**\n * Determines if the network has enough bandwidth to complete the current segment\n * request in a timely manner. If not, the request will be aborted early and bandwidth\n * updated to trigger a playlist switch.\n *\n * @param {Object} stats\n * Object containing stats about the request timing and size\n * @private\n */\n ;\n\n _proto.earlyAbortWhenNeeded_ = function earlyAbortWhenNeeded_(stats) {\n if (this.vhs_.tech_.paused() || // Don't abort if the current playlist is on the lowestEnabledRendition\n // TODO: Replace using timeout with a boolean indicating whether this playlist is\n // the lowestEnabledRendition.\n !this.xhrOptions_.timeout || // Don't abort if we have no bandwidth information to estimate segment sizes\n !this.playlist_.attributes.BANDWIDTH) {\n return;\n } // Wait at least 1 second since the first byte of data has been received before\n // using the calculated bandwidth from the progress event to allow the bitrate\n // to stabilize\n\n\n if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1000) {\n return;\n }\n\n var currentTime = this.currentTime_();\n var measuredBandwidth = stats.bandwidth;\n var segmentDuration = this.pendingSegment_.duration;\n var requestTimeRemaining = Playlist.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived); // Subtract 1 from the timeUntilRebuffer so we still consider an early abort\n // if we are only left with less than 1 second when the request completes.\n // A negative timeUntilRebuffering indicates we are already rebuffering\n\n var timeUntilRebuffer$1 = timeUntilRebuffer(this.buffered_(), currentTime, this.vhs_.tech_.playbackRate()) - 1; // Only consider aborting early if the estimated time to finish the download\n // is larger than the estimated time until the player runs out of forward buffer\n\n if (requestTimeRemaining <= timeUntilRebuffer$1) {\n return;\n }\n\n var switchCandidate = minRebufferMaxBandwidthSelector({\n master: this.vhs_.playlists.master,\n currentTime: currentTime,\n bandwidth: measuredBandwidth,\n duration: this.duration_(),\n segmentDuration: segmentDuration,\n timeUntilRebuffer: timeUntilRebuffer$1,\n currentTimeline: this.currentTimeline_,\n syncController: this.syncController_\n });\n\n if (!switchCandidate) {\n return;\n }\n\n var rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$1;\n var timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;\n var minimumTimeSaving = 0.5; // If we are already rebuffering, increase the amount of variance we add to the\n // potential round trip time of the new request so that we are not too aggressive\n // with switching to a playlist that might save us a fraction of a second.\n\n if (timeUntilRebuffer$1 <= TIME_FUDGE_FACTOR) {\n minimumTimeSaving = 1;\n }\n\n if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {\n return;\n } // set the bandwidth to that of the desired playlist being sure to scale by\n // BANDWIDTH_VARIANCE and add one so the playlist selector does not exclude it\n // don't trigger a bandwidthupdate as the bandwidth is artifial\n\n\n this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config.BANDWIDTH_VARIANCE + 1;\n this.trigger('earlyabort');\n };\n\n _proto.handleAbort_ = function handleAbort_(segmentInfo) {\n this.logger_(\"Aborting \" + segmentInfoString(segmentInfo));\n this.mediaRequestsAborted += 1;\n }\n /**\n * XHR `progress` event handler\n *\n * @param {Event}\n * The XHR `progress` event\n * @param {Object} simpleSegment\n * A simplified segment object copy\n * @private\n */\n ;\n\n _proto.handleProgress_ = function handleProgress_(event, simpleSegment) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n }\n\n this.trigger('progress');\n };\n\n _proto.handleTrackInfo_ = function handleTrackInfo_(simpleSegment, trackInfo) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n }\n\n if (this.checkForIllegalMediaSwitch(trackInfo)) {\n return;\n }\n\n trackInfo = trackInfo || {}; // When we have track info, determine what media types this loader is dealing with.\n // Guard against cases where we're not getting track info at all until we are\n // certain that all streams will provide it.\n\n if (!shallowEqual(this.currentMediaInfo_, trackInfo)) {\n this.appendInitSegment_ = {\n audio: true,\n video: true\n };\n this.startingMediaInfo_ = trackInfo;\n this.currentMediaInfo_ = trackInfo;\n this.logger_('trackinfo update', trackInfo);\n this.trigger('trackinfo');\n } // trackinfo may cause an abort if the trackinfo\n // causes a codec change to an unsupported codec.\n\n\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n } // set trackinfo on the pending segment so that\n // it can append.\n\n\n this.pendingSegment_.trackInfo = trackInfo; // check if any calls were waiting on the track info\n\n if (this.hasEnoughInfoToAppend_()) {\n this.processCallQueue_();\n }\n };\n\n _proto.handleTimingInfo_ = function handleTimingInfo_(simpleSegment, mediaType, timeType, time) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n }\n\n var segmentInfo = this.pendingSegment_;\n var timingInfoProperty = timingInfoPropertyForMedia(mediaType);\n segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {};\n segmentInfo[timingInfoProperty][timeType] = time;\n this.logger_(\"timinginfo: \" + mediaType + \" - \" + timeType + \" - \" + time); // check if any calls were waiting on the timing info\n\n if (this.hasEnoughInfoToAppend_()) {\n this.processCallQueue_();\n }\n };\n\n _proto.handleCaptions_ = function handleCaptions_(simpleSegment, captionData) {\n var _this2 = this;\n\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n } // This could only happen with fmp4 segments, but\n // should still not happen in general\n\n\n if (captionData.length === 0) {\n this.logger_('SegmentLoader received no captions from a caption event');\n return;\n }\n\n var segmentInfo = this.pendingSegment_; // Wait until we have some video data so that caption timing\n // can be adjusted by the timestamp offset\n\n if (!segmentInfo.hasAppendedData_) {\n this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, simpleSegment, captionData));\n return;\n }\n\n var timestampOffset = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();\n var captionTracks = {}; // get total start/end and captions for each track/stream\n\n captionData.forEach(function (caption) {\n // caption.stream is actually a track name...\n // set to the existing values in tracks or default values\n captionTracks[caption.stream] = captionTracks[caption.stream] || {\n // Infinity, as any other value will be less than this\n startTime: Infinity,\n captions: [],\n // 0 as an other value will be more than this\n endTime: 0\n };\n var captionTrack = captionTracks[caption.stream];\n captionTrack.startTime = Math.min(captionTrack.startTime, caption.startTime + timestampOffset);\n captionTrack.endTime = Math.max(captionTrack.endTime, caption.endTime + timestampOffset);\n captionTrack.captions.push(caption);\n });\n Object.keys(captionTracks).forEach(function (trackName) {\n var _captionTracks$trackN = captionTracks[trackName],\n startTime = _captionTracks$trackN.startTime,\n endTime = _captionTracks$trackN.endTime,\n captions = _captionTracks$trackN.captions;\n var inbandTextTracks = _this2.inbandTextTracks_;\n\n _this2.logger_(\"adding cues from \" + startTime + \" -> \" + endTime + \" for \" + trackName);\n\n createCaptionsTrackIfNotExists(inbandTextTracks, _this2.vhs_.tech_, trackName); // clear out any cues that start and end at the same time period for the same track.\n // We do this because a rendition change that also changes the timescale for captions\n // will result in captions being re-parsed for certain segments. If we add them again\n // without clearing we will have two of the same captions visible.\n\n removeCuesFromTrack(startTime, endTime, inbandTextTracks[trackName]);\n video_es_addCaptionData({\n captionArray: captions,\n inbandTextTracks: inbandTextTracks,\n timestampOffset: timestampOffset\n });\n }); // Reset stored captions since we added parsed\n // captions to a text track at this point\n\n if (this.transmuxer_) {\n this.transmuxer_.postMessage({\n action: 'clearParsedMp4Captions'\n });\n }\n };\n\n _proto.handleId3_ = function handleId3_(simpleSegment, id3Frames, dispatchType) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n }\n\n var segmentInfo = this.pendingSegment_; // we need to have appended data in order for the timestamp offset to be set\n\n if (!segmentInfo.hasAppendedData_) {\n this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType));\n return;\n }\n\n var timestampOffset = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset(); // There's potentially an issue where we could double add metadata if there's a muxed\n // audio/video source with a metadata track, and an alt audio with a metadata track.\n // However, this probably won't happen, and if it does it can be handled then.\n\n createMetadataTrackIfNotExists(this.inbandTextTracks_, dispatchType, this.vhs_.tech_);\n video_es_addMetadata({\n inbandTextTracks: this.inbandTextTracks_,\n metadataArray: id3Frames,\n timestampOffset: timestampOffset,\n videoDuration: this.duration_()\n });\n };\n\n _proto.processMetadataQueue_ = function processMetadataQueue_() {\n this.metadataQueue_.id3.forEach(function (fn) {\n return fn();\n });\n this.metadataQueue_.caption.forEach(function (fn) {\n return fn();\n });\n this.metadataQueue_.id3 = [];\n this.metadataQueue_.caption = [];\n };\n\n _proto.processCallQueue_ = function processCallQueue_() {\n var callQueue = this.callQueue_; // Clear out the queue before the queued functions are run, since some of the\n // functions may check the length of the load queue and default to pushing themselves\n // back onto the queue.\n\n this.callQueue_ = [];\n callQueue.forEach(function (fun) {\n return fun();\n });\n };\n\n _proto.processLoadQueue_ = function processLoadQueue_() {\n var loadQueue = this.loadQueue_; // Clear out the queue before the queued functions are run, since some of the\n // functions may check the length of the load queue and default to pushing themselves\n // back onto the queue.\n\n this.loadQueue_ = [];\n loadQueue.forEach(function (fun) {\n return fun();\n });\n }\n /**\n * Determines whether the loader has enough info to load the next segment.\n *\n * @return {boolean}\n * Whether or not the loader has enough info to load the next segment\n */\n ;\n\n _proto.hasEnoughInfoToLoad_ = function hasEnoughInfoToLoad_() {\n // Since primary timing goes by video, only the audio loader potentially needs to wait\n // to load.\n if (this.loaderType_ !== 'audio') {\n return true;\n }\n\n var segmentInfo = this.pendingSegment_; // A fill buffer must have already run to establish a pending segment before there's\n // enough info to load.\n\n if (!segmentInfo) {\n return false;\n } // The first segment can and should be loaded immediately so that source buffers are\n // created together (before appending). Source buffer creation uses the presence of\n // audio and video data to determine whether to create audio/video source buffers, and\n // uses processed (transmuxed or parsed) media to determine the types required.\n\n\n if (!this.getCurrentMediaInfo_()) {\n return true;\n }\n\n if ( // Technically, instead of waiting to load a segment on timeline changes, a segment\n // can be requested and downloaded and only wait before it is transmuxed or parsed.\n // But in practice, there are a few reasons why it is better to wait until a loader\n // is ready to append that segment before requesting and downloading:\n //\n // 1. Because audio and main loaders cross discontinuities together, if this loader\n // is waiting for the other to catch up, then instead of requesting another\n // segment and using up more bandwidth, by not yet loading, more bandwidth is\n // allotted to the loader currently behind.\n // 2. media-segment-request doesn't have to have logic to consider whether a segment\n // is ready to be processed or not, isolating the queueing behavior to the loader.\n // 3. The audio loader bases some of its segment properties on timing information\n // provided by the main loader, meaning that, if the logic for waiting on\n // processing was in media-segment-request, then it would also need to know how\n // to re-generate the segment information after the main loader caught up.\n shouldWaitForTimelineChange({\n timelineChangeController: this.timelineChangeController_,\n currentTimeline: this.currentTimeline_,\n segmentTimeline: segmentInfo.timeline,\n loaderType: this.loaderType_,\n audioDisabled: this.audioDisabled_\n })) {\n return false;\n }\n\n return true;\n };\n\n _proto.getCurrentMediaInfo_ = function getCurrentMediaInfo_(segmentInfo) {\n if (segmentInfo === void 0) {\n segmentInfo = this.pendingSegment_;\n }\n\n return segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_;\n };\n\n _proto.getMediaInfo_ = function getMediaInfo_(segmentInfo) {\n if (segmentInfo === void 0) {\n segmentInfo = this.pendingSegment_;\n }\n\n return this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_;\n };\n\n _proto.hasEnoughInfoToAppend_ = function hasEnoughInfoToAppend_() {\n if (!this.sourceUpdater_.ready()) {\n return false;\n } // If content needs to be removed or the loader is waiting on an append reattempt,\n // then no additional content should be appended until the prior append is resolved.\n\n\n if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) {\n return false;\n }\n\n var segmentInfo = this.pendingSegment_;\n var trackInfo = this.getCurrentMediaInfo_(); // no segment to append any data for or\n // we do not have information on this specific\n // segment yet\n\n if (!segmentInfo || !trackInfo) {\n return false;\n }\n\n var hasAudio = trackInfo.hasAudio,\n hasVideo = trackInfo.hasVideo,\n isMuxed = trackInfo.isMuxed;\n\n if (hasVideo && !segmentInfo.videoTimingInfo) {\n return false;\n } // muxed content only relies on video timing information for now.\n\n\n if (hasAudio && !this.audioDisabled_ && !isMuxed && !segmentInfo.audioTimingInfo) {\n return false;\n }\n\n if (shouldWaitForTimelineChange({\n timelineChangeController: this.timelineChangeController_,\n currentTimeline: this.currentTimeline_,\n segmentTimeline: segmentInfo.timeline,\n loaderType: this.loaderType_,\n audioDisabled: this.audioDisabled_\n })) {\n return false;\n }\n\n return true;\n };\n\n _proto.handleData_ = function handleData_(simpleSegment, result) {\n this.earlyAbortWhenNeeded_(simpleSegment.stats);\n\n if (this.checkForAbort_(simpleSegment.requestId)) {\n return;\n } // If there's anything in the call queue, then this data came later and should be\n // executed after the calls currently queued.\n\n\n if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) {\n this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result));\n return;\n }\n\n var segmentInfo = this.pendingSegment_; // update the time mapping so we can translate from display time to media time\n\n this.setTimeMapping_(segmentInfo.timeline); // for tracking overall stats\n\n this.updateMediaSecondsLoaded_(segmentInfo.segment); // Note that the state isn't changed from loading to appending. This is because abort\n // logic may change behavior depending on the state, and changing state too early may\n // inflate our estimates of bandwidth. In the future this should be re-examined to\n // note more granular states.\n // don't process and append data if the mediaSource is closed\n\n if (this.mediaSource_.readyState === 'closed') {\n return;\n } // if this request included an initialization segment, save that data\n // to the initSegment cache\n\n\n if (simpleSegment.map) {\n simpleSegment.map = this.initSegmentForMap(simpleSegment.map, true); // move over init segment properties to media request\n\n segmentInfo.segment.map = simpleSegment.map;\n } // if this request included a segment key, save that data in the cache\n\n\n if (simpleSegment.key) {\n this.segmentKey(simpleSegment.key, true);\n }\n\n segmentInfo.isFmp4 = simpleSegment.isFmp4;\n segmentInfo.timingInfo = segmentInfo.timingInfo || {};\n\n if (segmentInfo.isFmp4) {\n this.trigger('fmp4');\n segmentInfo.timingInfo.start = segmentInfo[timingInfoPropertyForMedia(result.type)].start;\n } else {\n var trackInfo = this.getCurrentMediaInfo_();\n var useVideoTimingInfo = this.loaderType_ === 'main' && trackInfo && trackInfo.hasVideo;\n var firstVideoFrameTimeForData;\n\n if (useVideoTimingInfo) {\n firstVideoFrameTimeForData = segmentInfo.videoTimingInfo.start;\n } // Segment loader knows more about segment timing than the transmuxer (in certain\n // aspects), so make any changes required for a more accurate start time.\n // Don't set the end time yet, as the segment may not be finished processing.\n\n\n segmentInfo.timingInfo.start = this.trueSegmentStart_({\n currentStart: segmentInfo.timingInfo.start,\n playlist: segmentInfo.playlist,\n mediaIndex: segmentInfo.mediaIndex,\n currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),\n useVideoTimingInfo: useVideoTimingInfo,\n firstVideoFrameTimeForData: firstVideoFrameTimeForData,\n videoTimingInfo: segmentInfo.videoTimingInfo,\n audioTimingInfo: segmentInfo.audioTimingInfo\n });\n } // Init segments for audio and video only need to be appended in certain cases. Now\n // that data is about to be appended, we can check the final cases to determine\n // whether we should append an init segment.\n\n\n this.updateAppendInitSegmentStatus(segmentInfo, result.type); // Timestamp offset should be updated once we get new data and have its timing info,\n // as we use the start of the segment to offset the best guess (playlist provided)\n // timestamp offset.\n\n this.updateSourceBufferTimestampOffset_(segmentInfo); // if this is a sync request we need to determine whether it should\n // be appended or not.\n\n if (segmentInfo.isSyncRequest) {\n // first save/update our timing info for this segment.\n // this is what allows us to choose an accurate segment\n // and the main reason we make a sync request.\n this.updateTimingInfoEnd_(segmentInfo);\n this.syncController_.saveSegmentTimingInfo({\n segmentInfo: segmentInfo,\n shouldSaveTimelineMapping: this.loaderType_ === 'main'\n });\n var next = this.chooseNextRequest_(); // If the sync request isn't the segment that would be requested next\n // after taking into account its timing info, do not append it.\n\n if (next.mediaIndex !== segmentInfo.mediaIndex || next.partIndex !== segmentInfo.partIndex) {\n this.logger_('sync segment was incorrect, not appending');\n return;\n } // otherwise append it like any other segment as our guess was correct.\n\n\n this.logger_('sync segment was correct, appending');\n } // Save some state so that in the future anything waiting on first append (and/or\n // timestamp offset(s)) can process immediately. While the extra state isn't optimal,\n // we need some notion of whether the timestamp offset or other relevant information\n // has had a chance to be set.\n\n\n segmentInfo.hasAppendedData_ = true; // Now that the timestamp offset should be set, we can append any waiting ID3 tags.\n\n this.processMetadataQueue_();\n this.appendData_(segmentInfo, result);\n };\n\n _proto.updateAppendInitSegmentStatus = function updateAppendInitSegmentStatus(segmentInfo, type) {\n // alt audio doesn't manage timestamp offset\n if (this.loaderType_ === 'main' && typeof segmentInfo.timestampOffset === 'number' && // in the case that we're handling partial data, we don't want to append an init\n // segment for each chunk\n !segmentInfo.changedTimestampOffset) {\n // if the timestamp offset changed, the timeline may have changed, so we have to re-\n // append init segments\n this.appendInitSegment_ = {\n audio: true,\n video: true\n };\n }\n\n if (this.playlistOfLastInitSegment_[type] !== segmentInfo.playlist) {\n // make sure we append init segment on playlist changes, in case the media config\n // changed\n this.appendInitSegment_[type] = true;\n }\n };\n\n _proto.getInitSegmentAndUpdateState_ = function getInitSegmentAndUpdateState_(_ref4) {\n var type = _ref4.type,\n initSegment = _ref4.initSegment,\n map = _ref4.map,\n playlist = _ref4.playlist; // \"The EXT-X-MAP tag specifies how to obtain the Media Initialization Section\n // (Section 3) required to parse the applicable Media Segments. It applies to every\n // Media Segment that appears after it in the Playlist until the next EXT-X-MAP tag\n // or until the end of the playlist.\"\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.2.5\n\n if (map) {\n var id = initSegmentId(map);\n\n if (this.activeInitSegmentId_ === id) {\n // don't need to re-append the init segment if the ID matches\n return null;\n } // a map-specified init segment takes priority over any transmuxed (or otherwise\n // obtained) init segment\n //\n // this also caches the init segment for later use\n\n\n initSegment = this.initSegmentForMap(map, true).bytes;\n this.activeInitSegmentId_ = id;\n } // We used to always prepend init segments for video, however, that shouldn't be\n // necessary. Instead, we should only append on changes, similar to what we've always\n // done for audio. This is more important (though may not be that important) for\n // frame-by-frame appending for LHLS, simply because of the increased quantity of\n // appends.\n\n\n if (initSegment && this.appendInitSegment_[type]) {\n // Make sure we track the playlist that we last used for the init segment, so that\n // we can re-append the init segment in the event that we get data from a new\n // playlist. Discontinuities and track changes are handled in other sections.\n this.playlistOfLastInitSegment_[type] = playlist; // Disable future init segment appends for this type. Until a change is necessary.\n\n this.appendInitSegment_[type] = false; // we need to clear out the fmp4 active init segment id, since\n // we are appending the muxer init segment\n\n this.activeInitSegmentId_ = null;\n return initSegment;\n }\n\n return null;\n };\n\n _proto.handleQuotaExceededError_ = function handleQuotaExceededError_(_ref5, error) {\n var _this3 = this;\n\n var segmentInfo = _ref5.segmentInfo,\n type = _ref5.type,\n bytes = _ref5.bytes;\n var audioBuffered = this.sourceUpdater_.audioBuffered();\n var videoBuffered = this.sourceUpdater_.videoBuffered(); // For now we're ignoring any notion of gaps in the buffer, but they, in theory,\n // should be cleared out during the buffer removals. However, log in case it helps\n // debug.\n\n if (audioBuffered.length > 1) {\n this.logger_('On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: ' + timeRangesToArray(audioBuffered).join(', '));\n }\n\n if (videoBuffered.length > 1) {\n this.logger_('On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: ' + timeRangesToArray(videoBuffered).join(', '));\n }\n\n var audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0;\n var audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0;\n var videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0;\n var videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0;\n\n if (audioBufferEnd - audioBufferStart <= MIN_BACK_BUFFER && videoBufferEnd - videoBufferStart <= MIN_BACK_BUFFER) {\n // Can't remove enough buffer to make room for new segment (or the browser doesn't\n // allow for appends of segments this size). In the future, it may be possible to\n // split up the segment and append in pieces, but for now, error out this playlist\n // in an attempt to switch to a more manageable rendition.\n this.logger_('On QUOTA_EXCEEDED_ERR, single segment too large to append to ' + 'buffer, triggering an error. ' + (\"Appended byte length: \" + bytes.byteLength + \", \") + (\"audio buffer: \" + timeRangesToArray(audioBuffered).join(', ') + \", \") + (\"video buffer: \" + timeRangesToArray(videoBuffered).join(', ') + \", \"));\n this.error({\n message: 'Quota exceeded error with append of a single segment of content',\n excludeUntil: Infinity\n });\n this.trigger('error');\n return;\n } // To try to resolve the quota exceeded error, clear back buffer and retry. This means\n // that the segment-loader should block on future events until this one is handled, so\n // that it doesn't keep moving onto further segments. Adding the call to the call\n // queue will prevent further appends until waitingOnRemove_ and\n // quotaExceededErrorRetryTimeout_ are cleared.\n //\n // Note that this will only block the current loader. In the case of demuxed content,\n // the other load may keep filling as fast as possible. In practice, this should be\n // OK, as it is a rare case when either audio has a high enough bitrate to fill up a\n // source buffer, or video fills without enough room for audio to append (and without\n // the availability of clearing out seconds of back buffer to make room for audio).\n // But it might still be good to handle this case in the future as a TODO.\n\n\n this.waitingOnRemove_ = true;\n this.callQueue_.push(this.appendToSourceBuffer_.bind(this, {\n segmentInfo: segmentInfo,\n type: type,\n bytes: bytes\n }));\n var currentTime = this.currentTime_(); // Try to remove as much audio and video as possible to make room for new content\n // before retrying.\n\n var timeToRemoveUntil = currentTime - MIN_BACK_BUFFER;\n this.logger_(\"On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to \" + timeToRemoveUntil);\n this.remove(0, timeToRemoveUntil, function () {\n _this3.logger_(\"On QUOTA_EXCEEDED_ERR, retrying append in \" + MIN_BACK_BUFFER + \"s\");\n\n _this3.waitingOnRemove_ = false; // wait the length of time alotted in the back buffer to prevent wasted\n // attempts (since we can't clear less than the minimum)\n\n _this3.quotaExceededErrorRetryTimeout_ = window_default.a.setTimeout(function () {\n _this3.logger_('On QUOTA_EXCEEDED_ERR, re-processing call queue');\n\n _this3.quotaExceededErrorRetryTimeout_ = null;\n\n _this3.processCallQueue_();\n }, MIN_BACK_BUFFER * 1000);\n }, true);\n };\n\n _proto.handleAppendError_ = function handleAppendError_(_ref6, error) {\n var segmentInfo = _ref6.segmentInfo,\n type = _ref6.type,\n bytes = _ref6.bytes; // if there's no error, nothing to do\n\n if (!error) {\n return;\n }\n\n if (error.code === QUOTA_EXCEEDED_ERR) {\n this.handleQuotaExceededError_({\n segmentInfo: segmentInfo,\n type: type,\n bytes: bytes\n }); // A quota exceeded error should be recoverable with a future re-append, so no need\n // to trigger an append error.\n\n return;\n }\n\n this.logger_('Received non QUOTA_EXCEEDED_ERR on append', error);\n this.error(type + \" append of \" + bytes.length + \"b failed for segment \" + (\"#\" + segmentInfo.mediaIndex + \" in playlist \" + segmentInfo.playlist.id)); // If an append errors, we often can't recover.\n // (see https://w3c.github.io/media-source/#sourcebuffer-append-error).\n //\n // Trigger a special error so that it can be handled separately from normal,\n // recoverable errors.\n\n this.trigger('appenderror');\n };\n\n _proto.appendToSourceBuffer_ = function appendToSourceBuffer_(_ref7) {\n var segmentInfo = _ref7.segmentInfo,\n type = _ref7.type,\n initSegment = _ref7.initSegment,\n data = _ref7.data,\n bytes = _ref7.bytes; // If this is a re-append, bytes were already created and don't need to be recreated\n\n if (!bytes) {\n var segments = [data];\n var byteLength = data.byteLength;\n\n if (initSegment) {\n // if the media initialization segment is changing, append it before the content\n // segment\n segments.unshift(initSegment);\n byteLength += initSegment.byteLength;\n } // Technically we should be OK appending the init segment separately, however, we\n // haven't yet tested that, and prepending is how we have always done things.\n\n\n bytes = concatSegments({\n bytes: byteLength,\n segments: segments\n });\n }\n\n this.sourceUpdater_.appendBuffer({\n segmentInfo: segmentInfo,\n type: type,\n bytes: bytes\n }, this.handleAppendError_.bind(this, {\n segmentInfo: segmentInfo,\n type: type,\n bytes: bytes\n }));\n };\n\n _proto.handleSegmentTimingInfo_ = function handleSegmentTimingInfo_(type, requestId, segmentTimingInfo) {\n if (!this.pendingSegment_ || requestId !== this.pendingSegment_.requestId) {\n return;\n }\n\n var segment = this.pendingSegment_.segment;\n var timingInfoProperty = type + \"TimingInfo\";\n\n if (!segment[timingInfoProperty]) {\n segment[timingInfoProperty] = {};\n }\n\n segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0;\n segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation;\n segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode;\n segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation;\n segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode; // mainly used as a reference for debugging\n\n segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime;\n };\n\n _proto.appendData_ = function appendData_(segmentInfo, result) {\n var type = result.type,\n data = result.data;\n\n if (!data || !data.byteLength) {\n return;\n }\n\n if (type === 'audio' && this.audioDisabled_) {\n return;\n }\n\n var initSegment = this.getInitSegmentAndUpdateState_({\n type: type,\n initSegment: result.initSegment,\n playlist: segmentInfo.playlist,\n map: segmentInfo.isFmp4 ? segmentInfo.segment.map : null\n });\n this.appendToSourceBuffer_({\n segmentInfo: segmentInfo,\n type: type,\n initSegment: initSegment,\n data: data\n });\n }\n /**\n * load a specific segment from a request into the buffer\n *\n * @private\n */\n ;\n\n _proto.loadSegment_ = function loadSegment_(segmentInfo) {\n var _this4 = this;\n\n this.state = 'WAITING';\n this.pendingSegment_ = segmentInfo;\n this.trimBackBuffer_(segmentInfo);\n\n if (typeof segmentInfo.timestampOffset === 'number') {\n if (this.transmuxer_) {\n this.transmuxer_.postMessage({\n action: 'clearAllMp4Captions'\n });\n }\n }\n\n if (!this.hasEnoughInfoToLoad_()) {\n this.loadQueue_.push(function () {\n // regenerate the audioAppendStart, timestampOffset, etc as they\n // may have changed since this function was added to the queue.\n var options = extends_default()({}, segmentInfo, {\n forceTimestampOffset: true\n });\n\n extends_default()(segmentInfo, _this4.generateSegmentInfo_(options));\n\n _this4.isPendingTimestampOffset_ = false;\n\n _this4.updateTransmuxerAndRequestSegment_(segmentInfo);\n });\n return;\n }\n\n this.updateTransmuxerAndRequestSegment_(segmentInfo);\n };\n\n _proto.updateTransmuxerAndRequestSegment_ = function updateTransmuxerAndRequestSegment_(segmentInfo) {\n var _this5 = this; // We'll update the source buffer's timestamp offset once we have transmuxed data, but\n // the transmuxer still needs to be updated before then.\n //\n // Even though keepOriginalTimestamps is set to true for the transmuxer, timestamp\n // offset must be passed to the transmuxer for stream correcting adjustments.\n\n\n if (this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)) {\n this.gopBuffer_.length = 0; // gopsToAlignWith was set before the GOP buffer was cleared\n\n segmentInfo.gopsToAlignWith = [];\n this.timeMapping_ = 0; // reset values in the transmuxer since a discontinuity should start fresh\n\n this.transmuxer_.postMessage({\n action: 'reset'\n });\n this.transmuxer_.postMessage({\n action: 'setTimestampOffset',\n timestampOffset: segmentInfo.timestampOffset\n });\n }\n\n var simpleSegment = this.createSimplifiedSegmentObj_(segmentInfo);\n var isEndOfStream = this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex);\n var isWalkingForward = this.mediaIndex !== null;\n var isDiscontinuity = segmentInfo.timeline !== this.currentTimeline_ && // currentTimeline starts at -1, so we shouldn't end the timeline switching to 0,\n // the first timeline\n segmentInfo.timeline > 0;\n var isEndOfTimeline = isEndOfStream || isWalkingForward && isDiscontinuity;\n this.logger_(\"Requesting \" + segmentInfoString(segmentInfo)); // If there's an init segment associated with this segment, but it is not cached (identified by a lack of bytes),\n // then this init segment has never been seen before and should be appended.\n //\n // At this point the content type (audio/video or both) is not yet known, but it should be safe to set\n // both to true and leave the decision of whether to append the init segment to append time.\n\n if (simpleSegment.map && !simpleSegment.map.bytes) {\n this.logger_('going to request init segment.');\n this.appendInitSegment_ = {\n video: true,\n audio: true\n };\n }\n\n segmentInfo.abortRequests = mediaSegmentRequest({\n xhr: this.vhs_.xhr,\n xhrOptions: this.xhrOptions_,\n decryptionWorker: this.decrypter_,\n segment: simpleSegment,\n abortFn: this.handleAbort_.bind(this, segmentInfo),\n progressFn: this.handleProgress_.bind(this),\n trackInfoFn: this.handleTrackInfo_.bind(this),\n timingInfoFn: this.handleTimingInfo_.bind(this),\n videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'video', segmentInfo.requestId),\n audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'audio', segmentInfo.requestId),\n captionsFn: this.handleCaptions_.bind(this),\n isEndOfTimeline: isEndOfTimeline,\n endedTimelineFn: function endedTimelineFn() {\n _this5.logger_('received endedtimeline callback');\n },\n id3Fn: this.handleId3_.bind(this),\n dataFn: this.handleData_.bind(this),\n doneFn: this.segmentRequestFinished_.bind(this),\n onTransmuxerLog: function onTransmuxerLog(_ref8) {\n var message = _ref8.message,\n level = _ref8.level,\n stream = _ref8.stream;\n\n _this5.logger_(segmentInfoString(segmentInfo) + \" logged from transmuxer stream \" + stream + \" as a \" + level + \": \" + message);\n }\n });\n }\n /**\n * trim the back buffer so that we don't have too much data\n * in the source buffer\n *\n * @private\n *\n * @param {Object} segmentInfo - the current segment\n */\n ;\n\n _proto.trimBackBuffer_ = function trimBackBuffer_(segmentInfo) {\n var removeToTime = safeBackBufferTrimTime(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10); // Chrome has a hard limit of 150MB of\n // buffer and a very conservative \"garbage collector\"\n // We manually clear out the old buffer to ensure\n // we don't trigger the QuotaExceeded error\n // on the source buffer during subsequent appends\n\n if (removeToTime > 0) {\n this.remove(0, removeToTime);\n }\n }\n /**\n * created a simplified copy of the segment object with just the\n * information necessary to perform the XHR and decryption\n *\n * @private\n *\n * @param {Object} segmentInfo - the current segment\n * @return {Object} a simplified segment object copy\n */\n ;\n\n _proto.createSimplifiedSegmentObj_ = function createSimplifiedSegmentObj_(segmentInfo) {\n var segment = segmentInfo.segment;\n var part = segmentInfo.part;\n var simpleSegment = {\n resolvedUri: part ? part.resolvedUri : segment.resolvedUri,\n byterange: part ? part.byterange : segment.byterange,\n requestId: segmentInfo.requestId,\n transmuxer: segmentInfo.transmuxer,\n audioAppendStart: segmentInfo.audioAppendStart,\n gopsToAlignWith: segmentInfo.gopsToAlignWith,\n part: segmentInfo.part\n };\n var previousSegment = segmentInfo.playlist.segments[segmentInfo.mediaIndex - 1];\n\n if (previousSegment && previousSegment.timeline === segment.timeline) {\n // The baseStartTime of a segment is used to handle rollover when probing the TS\n // segment to retrieve timing information. Since the probe only looks at the media's\n // times (e.g., PTS and DTS values of the segment), and doesn't consider the\n // player's time (e.g., player.currentTime()), baseStartTime should reflect the\n // media time as well. transmuxedDecodeEnd represents the end time of a segment, in\n // seconds of media time, so should be used here. The previous segment is used since\n // the end of the previous segment should represent the beginning of the current\n // segment, so long as they are on the same timeline.\n if (previousSegment.videoTimingInfo) {\n simpleSegment.baseStartTime = previousSegment.videoTimingInfo.transmuxedDecodeEnd;\n } else if (previousSegment.audioTimingInfo) {\n simpleSegment.baseStartTime = previousSegment.audioTimingInfo.transmuxedDecodeEnd;\n }\n }\n\n if (segment.key) {\n // if the media sequence is greater than 2^32, the IV will be incorrect\n // assuming 10s segments, that would be about 1300 years\n var iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);\n simpleSegment.key = this.segmentKey(segment.key);\n simpleSegment.key.iv = iv;\n }\n\n if (segment.map) {\n simpleSegment.map = this.initSegmentForMap(segment.map);\n }\n\n return simpleSegment;\n };\n\n _proto.saveTransferStats_ = function saveTransferStats_(stats) {\n // every request counts as a media request even if it has been aborted\n // or canceled due to a timeout\n this.mediaRequests += 1;\n\n if (stats) {\n this.mediaBytesTransferred += stats.bytesReceived;\n this.mediaTransferDuration += stats.roundTripTime;\n }\n };\n\n _proto.saveBandwidthRelatedStats_ = function saveBandwidthRelatedStats_(duration, stats) {\n // byteLength will be used for throughput, and should be based on bytes receieved,\n // which we only know at the end of the request and should reflect total bytes\n // downloaded rather than just bytes processed from components of the segment\n this.pendingSegment_.byteLength = stats.bytesReceived;\n\n if (duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {\n this.logger_(\"Ignoring segment's bandwidth because its duration of \" + duration + (\" is less than the min to record \" + MIN_SEGMENT_DURATION_TO_SAVE_STATS));\n return;\n }\n\n this.bandwidth = stats.bandwidth;\n this.roundTrip = stats.roundTripTime;\n };\n\n _proto.handleTimeout_ = function handleTimeout_() {\n // although the VTT segment loader bandwidth isn't really used, it's good to\n // maintain functinality between segment loaders\n this.mediaRequestsTimedout += 1;\n this.bandwidth = 1;\n this.roundTrip = NaN;\n this.trigger('bandwidthupdate');\n }\n /**\n * Handle the callback from the segmentRequest function and set the\n * associated SegmentLoader state and errors if necessary\n *\n * @private\n */\n ;\n\n _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) {\n // TODO handle special cases, e.g., muxed audio/video but only audio in the segment\n // check the call queue directly since this function doesn't need to deal with any\n // data, and can continue even if the source buffers are not set up and we didn't get\n // any data from the segment\n if (this.callQueue_.length) {\n this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result));\n return;\n }\n\n this.saveTransferStats_(simpleSegment.stats); // The request was aborted and the SegmentLoader has already been reset\n\n if (!this.pendingSegment_) {\n return;\n } // the request was aborted and the SegmentLoader has already started\n // another request. this can happen when the timeout for an aborted\n // request triggers due to a limitation in the XHR library\n // do not count this as any sort of request or we risk double-counting\n\n\n if (simpleSegment.requestId !== this.pendingSegment_.requestId) {\n return;\n } // an error occurred from the active pendingSegment_ so reset everything\n\n\n if (error) {\n this.pendingSegment_ = null;\n this.state = 'READY'; // aborts are not a true error condition and nothing corrective needs to be done\n\n if (error.code === REQUEST_ERRORS.ABORTED) {\n return;\n }\n\n this.pause(); // the error is really just that at least one of the requests timed-out\n // set the bandwidth to a very low value and trigger an ABR switch to\n // take emergency action\n\n if (error.code === REQUEST_ERRORS.TIMEOUT) {\n this.handleTimeout_();\n return;\n } // if control-flow has arrived here, then the error is real\n // emit an error event to blacklist the current playlist\n\n\n this.mediaRequestsErrored += 1;\n this.error(error);\n this.trigger('error');\n return;\n }\n\n var segmentInfo = this.pendingSegment_; // the response was a success so set any bandwidth stats the request\n // generated for ABR purposes\n\n this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);\n segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests;\n\n if (result.gopInfo) {\n this.gopBuffer_ = updateGopBuffer(this.gopBuffer_, result.gopInfo, this.safeAppend_);\n } // Although we may have already started appending on progress, we shouldn't switch the\n // state away from loading until we are officially done loading the segment data.\n\n\n this.state = 'APPENDING'; // used for testing\n\n this.trigger('appending');\n this.waitForAppendsToComplete_(segmentInfo);\n };\n\n _proto.setTimeMapping_ = function setTimeMapping_(timeline) {\n var timelineMapping = this.syncController_.mappingForTimeline(timeline);\n\n if (timelineMapping !== null) {\n this.timeMapping_ = timelineMapping;\n }\n };\n\n _proto.updateMediaSecondsLoaded_ = function updateMediaSecondsLoaded_(segment) {\n if (typeof segment.start === 'number' && typeof segment.end === 'number') {\n this.mediaSecondsLoaded += segment.end - segment.start;\n } else {\n this.mediaSecondsLoaded += segment.duration;\n }\n };\n\n _proto.shouldUpdateTransmuxerTimestampOffset_ = function shouldUpdateTransmuxerTimestampOffset_(timestampOffset) {\n if (timestampOffset === null) {\n return false;\n } // note that we're potentially using the same timestamp offset for both video and\n // audio\n\n\n if (this.loaderType_ === 'main' && timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {\n return true;\n }\n\n if (!this.audioDisabled_ && timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {\n return true;\n }\n\n return false;\n };\n\n _proto.trueSegmentStart_ = function trueSegmentStart_(_ref9) {\n var currentStart = _ref9.currentStart,\n playlist = _ref9.playlist,\n mediaIndex = _ref9.mediaIndex,\n firstVideoFrameTimeForData = _ref9.firstVideoFrameTimeForData,\n currentVideoTimestampOffset = _ref9.currentVideoTimestampOffset,\n useVideoTimingInfo = _ref9.useVideoTimingInfo,\n videoTimingInfo = _ref9.videoTimingInfo,\n audioTimingInfo = _ref9.audioTimingInfo;\n\n if (typeof currentStart !== 'undefined') {\n // if start was set once, keep using it\n return currentStart;\n }\n\n if (!useVideoTimingInfo) {\n return audioTimingInfo.start;\n }\n\n var previousSegment = playlist.segments[mediaIndex - 1]; // The start of a segment should be the start of the first full frame contained\n // within that segment. Since the transmuxer maintains a cache of incomplete data\n // from and/or the last frame seen, the start time may reflect a frame that starts\n // in the previous segment. Check for that case and ensure the start time is\n // accurate for the segment.\n\n if (mediaIndex === 0 || !previousSegment || typeof previousSegment.start === 'undefined' || previousSegment.end !== firstVideoFrameTimeForData + currentVideoTimestampOffset) {\n return firstVideoFrameTimeForData;\n }\n\n return videoTimingInfo.start;\n };\n\n _proto.waitForAppendsToComplete_ = function waitForAppendsToComplete_(segmentInfo) {\n var trackInfo = this.getCurrentMediaInfo_(segmentInfo);\n\n if (!trackInfo) {\n this.error({\n message: 'No starting media returned, likely due to an unsupported media format.',\n blacklistDuration: Infinity\n });\n this.trigger('error');\n return;\n } // Although transmuxing is done, appends may not yet be finished. Throw a marker\n // on each queue this loader is responsible for to ensure that the appends are\n // complete.\n\n\n var hasAudio = trackInfo.hasAudio,\n hasVideo = trackInfo.hasVideo,\n isMuxed = trackInfo.isMuxed;\n var waitForVideo = this.loaderType_ === 'main' && hasVideo;\n var waitForAudio = !this.audioDisabled_ && hasAudio && !isMuxed;\n segmentInfo.waitingOnAppends = 0; // segments with no data\n\n if (!segmentInfo.hasAppendedData_) {\n if (!segmentInfo.timingInfo && typeof segmentInfo.timestampOffset === 'number') {\n // When there's no audio or video data in the segment, there's no audio or video\n // timing information.\n //\n // If there's no audio or video timing information, then the timestamp offset\n // can't be adjusted to the appropriate value for the transmuxer and source\n // buffers.\n //\n // Therefore, the next segment should be used to set the timestamp offset.\n this.isPendingTimestampOffset_ = true;\n } // override settings for metadata only segments\n\n\n segmentInfo.timingInfo = {\n start: 0\n };\n segmentInfo.waitingOnAppends++;\n\n if (!this.isPendingTimestampOffset_) {\n // update the timestampoffset\n this.updateSourceBufferTimestampOffset_(segmentInfo); // make sure the metadata queue is processed even though we have\n // no video/audio data.\n\n this.processMetadataQueue_();\n } // append is \"done\" instantly with no data.\n\n\n this.checkAppendsDone_(segmentInfo);\n return;\n } // Since source updater could call back synchronously, do the increments first.\n\n\n if (waitForVideo) {\n segmentInfo.waitingOnAppends++;\n }\n\n if (waitForAudio) {\n segmentInfo.waitingOnAppends++;\n }\n\n if (waitForVideo) {\n this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));\n }\n\n if (waitForAudio) {\n this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));\n }\n };\n\n _proto.checkAppendsDone_ = function checkAppendsDone_(segmentInfo) {\n if (this.checkForAbort_(segmentInfo.requestId)) {\n return;\n }\n\n segmentInfo.waitingOnAppends--;\n\n if (segmentInfo.waitingOnAppends === 0) {\n this.handleAppendsDone_();\n }\n };\n\n _proto.checkForIllegalMediaSwitch = function checkForIllegalMediaSwitch(trackInfo) {\n var illegalMediaSwitchError = illegalMediaSwitch(this.loaderType_, this.getCurrentMediaInfo_(), trackInfo);\n\n if (illegalMediaSwitchError) {\n this.error({\n message: illegalMediaSwitchError,\n blacklistDuration: Infinity\n });\n this.trigger('error');\n return true;\n }\n\n return false;\n };\n\n _proto.updateSourceBufferTimestampOffset_ = function updateSourceBufferTimestampOffset_(segmentInfo) {\n if (segmentInfo.timestampOffset === null || // we don't yet have the start for whatever media type (video or audio) has\n // priority, timing-wise, so we must wait\n typeof segmentInfo.timingInfo.start !== 'number' || // already updated the timestamp offset for this segment\n segmentInfo.changedTimestampOffset || // the alt audio loader should not be responsible for setting the timestamp offset\n this.loaderType_ !== 'main') {\n return;\n }\n\n var didChange = false; // Primary timing goes by video, and audio is trimmed in the transmuxer, meaning that\n // the timing info here comes from video. In the event that the audio is longer than\n // the video, this will trim the start of the audio.\n // This also trims any offset from 0 at the beginning of the media\n\n segmentInfo.timestampOffset -= segmentInfo.timingInfo.start; // In the event that there are part segment downloads, each will try to update the\n // timestamp offset. Retaining this bit of state prevents us from updating in the\n // future (within the same segment), however, there may be a better way to handle it.\n\n segmentInfo.changedTimestampOffset = true;\n\n if (segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {\n this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset);\n didChange = true;\n }\n\n if (segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {\n this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset);\n didChange = true;\n }\n\n if (didChange) {\n this.trigger('timestampoffset');\n }\n };\n\n _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_(segmentInfo) {\n segmentInfo.timingInfo = segmentInfo.timingInfo || {};\n var trackInfo = this.getMediaInfo_();\n var useVideoTimingInfo = this.loaderType_ === 'main' && trackInfo && trackInfo.hasVideo;\n var prioritizedTimingInfo = useVideoTimingInfo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo;\n\n if (!prioritizedTimingInfo) {\n return;\n }\n\n segmentInfo.timingInfo.end = typeof prioritizedTimingInfo.end === 'number' ? // End time may not exist in a case where we aren't parsing the full segment (one\n // current example is the case of fmp4), so use the rough duration to calculate an\n // end time.\n prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration;\n }\n /**\n * callback to run when appendBuffer is finished. detects if we are\n * in a good state to do things with the data we got, or if we need\n * to wait for more\n *\n * @private\n */\n ;\n\n _proto.handleAppendsDone_ = function handleAppendsDone_() {\n // appendsdone can cause an abort\n if (this.pendingSegment_) {\n this.trigger('appendsdone');\n }\n\n if (!this.pendingSegment_) {\n this.state = 'READY'; // TODO should this move into this.checkForAbort to speed up requests post abort in\n // all appending cases?\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n\n return;\n }\n\n var segmentInfo = this.pendingSegment_; // Now that the end of the segment has been reached, we can set the end time. It's\n // best to wait until all appends are done so we're sure that the primary media is\n // finished (and we have its end time).\n\n this.updateTimingInfoEnd_(segmentInfo);\n\n if (this.shouldSaveSegmentTimingInfo_) {\n // Timeline mappings should only be saved for the main loader. This is for multiple\n // reasons:\n //\n // 1) Only one mapping is saved per timeline, meaning that if both the audio loader\n // and the main loader try to save the timeline mapping, whichever comes later\n // will overwrite the first. In theory this is OK, as the mappings should be the\n // same, however, it breaks for (2)\n // 2) In the event of a live stream, the initial live point will make for a somewhat\n // arbitrary mapping. If audio and video streams are not perfectly in-sync, then\n // the mapping will be off for one of the streams, dependent on which one was\n // first saved (see (1)).\n // 3) Primary timing goes by video in VHS, so the mapping should be video.\n //\n // Since the audio loader will wait for the main loader to load the first segment,\n // the main loader will save the first timeline mapping, and ensure that there won't\n // be a case where audio loads two segments without saving a mapping (thus leading\n // to missing segment timing info).\n this.syncController_.saveSegmentTimingInfo({\n segmentInfo: segmentInfo,\n shouldSaveTimelineMapping: this.loaderType_ === 'main'\n });\n }\n\n var segmentDurationMessage = getTroublesomeSegmentDurationMessage(segmentInfo, this.sourceType_);\n\n if (segmentDurationMessage) {\n if (segmentDurationMessage.severity === 'warn') {\n videojs.log.warn(segmentDurationMessage.message);\n } else {\n this.logger_(segmentDurationMessage.message);\n }\n }\n\n this.recordThroughput_(segmentInfo);\n this.pendingSegment_ = null;\n this.state = 'READY';\n\n if (segmentInfo.isSyncRequest) {\n this.trigger('syncinfoupdate'); // if the sync request was not appended\n // then it was not the correct segment.\n // throw it away and use the data it gave us\n // to get the correct one.\n\n if (!segmentInfo.hasAppendedData_) {\n this.logger_(\"Throwing away un-appended sync request \" + segmentInfoString(segmentInfo));\n return;\n }\n }\n\n this.logger_(\"Appended \" + segmentInfoString(segmentInfo));\n this.addSegmentMetadataCue_(segmentInfo);\n this.fetchAtBuffer_ = true;\n\n if (this.currentTimeline_ !== segmentInfo.timeline) {\n this.timelineChangeController_.lastTimelineChange({\n type: this.loaderType_,\n from: this.currentTimeline_,\n to: segmentInfo.timeline\n }); // If audio is not disabled, the main segment loader is responsible for updating\n // the audio timeline as well. If the content is video only, this won't have any\n // impact.\n\n if (this.loaderType_ === 'main' && !this.audioDisabled_) {\n this.timelineChangeController_.lastTimelineChange({\n type: 'audio',\n from: this.currentTimeline_,\n to: segmentInfo.timeline\n });\n }\n }\n\n this.currentTimeline_ = segmentInfo.timeline; // We must update the syncinfo to recalculate the seekable range before\n // the following conditional otherwise it may consider this a bad \"guess\"\n // and attempt to resync when the post-update seekable window and live\n // point would mean that this was the perfect segment to fetch\n\n this.trigger('syncinfoupdate');\n var segment = segmentInfo.segment; // If we previously appended a segment that ends more than 3 targetDurations before\n // the currentTime_ that means that our conservative guess was too conservative.\n // In that case, reset the loader state so that we try to use any information gained\n // from the previous request to create a new, more accurate, sync-point.\n\n if (segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3) {\n this.resetEverything();\n return;\n }\n\n var isWalkingForward = this.mediaIndex !== null; // Don't do a rendition switch unless we have enough time to get a sync segment\n // and conservatively guess\n\n if (isWalkingForward) {\n this.trigger('bandwidthupdate');\n }\n\n this.trigger('progress');\n this.mediaIndex = segmentInfo.mediaIndex;\n this.partIndex = segmentInfo.partIndex; // any time an update finishes and the last segment is in the\n // buffer, end the stream. this ensures the \"ended\" event will\n // fire if playback reaches that point.\n\n if (this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex)) {\n this.endOfStream();\n } // used for testing\n\n\n this.trigger('appended');\n\n if (segmentInfo.hasAppendedData_) {\n this.mediaAppends++;\n }\n\n if (!this.paused()) {\n this.monitorBuffer_();\n }\n }\n /**\n * Records the current throughput of the decrypt, transmux, and append\n * portion of the semgment pipeline. `throughput.rate` is a the cumulative\n * moving average of the throughput. `throughput.count` is the number of\n * data points in the average.\n *\n * @private\n * @param {Object} segmentInfo the object returned by loadSegment\n */\n ;\n\n _proto.recordThroughput_ = function recordThroughput_(segmentInfo) {\n if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {\n 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));\n return;\n }\n\n var rate = this.throughput.rate; // Add one to the time to ensure that we don't accidentally attempt to divide\n // by zero in the case where the throughput is ridiculously high\n\n var segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1; // Multiply by 8000 to convert from bytes/millisecond to bits/second\n\n var segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1000); // This is just a cumulative moving average calculation:\n // newAvg = oldAvg + (sample - oldAvg) / (sampleCount + 1)\n\n this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;\n }\n /**\n * Adds a cue to the segment-metadata track with some metadata information about the\n * segment\n *\n * @private\n * @param {Object} segmentInfo\n * the object returned by loadSegment\n * @method addSegmentMetadataCue_\n */\n ;\n\n _proto.addSegmentMetadataCue_ = function addSegmentMetadataCue_(segmentInfo) {\n if (!this.segmentMetadataTrack_) {\n return;\n }\n\n var segment = segmentInfo.segment;\n var start = segment.start;\n var end = segment.end; // Do not try adding the cue if the start and end times are invalid.\n\n if (!finite(start) || !finite(end)) {\n return;\n }\n\n removeCuesFromTrack(start, end, this.segmentMetadataTrack_);\n var Cue = window_default.a.WebKitDataCue || window_default.a.VTTCue;\n var value = {\n custom: segment.custom,\n dateTimeObject: segment.dateTimeObject,\n dateTimeString: segment.dateTimeString,\n bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,\n resolution: segmentInfo.playlist.attributes.RESOLUTION,\n codecs: segmentInfo.playlist.attributes.CODECS,\n byteLength: segmentInfo.byteLength,\n uri: segmentInfo.uri,\n timeline: segmentInfo.timeline,\n playlist: segmentInfo.playlist.id,\n start: start,\n end: end\n };\n var data = JSON.stringify(value);\n var cue = new Cue(start, end, data); // Attach the metadata to the value property of the cue to keep consistency between\n // the differences of WebKitDataCue in safari and VTTCue in other browsers\n\n cue.value = value;\n this.segmentMetadataTrack_.addCue(cue);\n };\n\n return SegmentLoader;\n}(videojs.EventTarget);\n\nfunction video_es_noop() {}\n\nvar toTitleCase = function toTitleCase(string) {\n if (typeof string !== 'string') {\n return string;\n }\n\n return string.replace(/./, function (w) {\n return w.toUpperCase();\n });\n};\n\nvar bufferTypes = ['video', 'audio'];\n\nvar _updating = function updating(type, sourceUpdater) {\n var sourceBuffer = sourceUpdater[type + \"Buffer\"];\n return sourceBuffer && sourceBuffer.updating || sourceUpdater.queuePending[type];\n};\n\nvar nextQueueIndexOfType = function nextQueueIndexOfType(type, queue) {\n for (var i = 0; i < queue.length; i++) {\n var queueEntry = queue[i];\n\n if (queueEntry.type === 'mediaSource') {\n // If the next entry is a media source entry (uses multiple source buffers), block\n // processing to allow it to go through first.\n return null;\n }\n\n if (queueEntry.type === type) {\n return i;\n }\n }\n\n return null;\n};\n\nvar shiftQueue = function shiftQueue(type, sourceUpdater) {\n if (sourceUpdater.queue.length === 0) {\n return;\n }\n\n var queueIndex = 0;\n var queueEntry = sourceUpdater.queue[queueIndex];\n\n if (queueEntry.type === 'mediaSource') {\n if (!sourceUpdater.updating() && sourceUpdater.mediaSource.readyState !== 'closed') {\n sourceUpdater.queue.shift();\n queueEntry.action(sourceUpdater);\n\n if (queueEntry.doneFn) {\n queueEntry.doneFn();\n } // Only specific source buffer actions must wait for async updateend events. Media\n // Source actions process synchronously. Therefore, both audio and video source\n // buffers are now clear to process the next queue entries.\n\n\n shiftQueue('audio', sourceUpdater);\n shiftQueue('video', sourceUpdater);\n } // Media Source actions require both source buffers, so if the media source action\n // couldn't process yet (because one or both source buffers are busy), block other\n // queue actions until both are available and the media source action can process.\n\n\n return;\n }\n\n if (type === 'mediaSource') {\n // If the queue was shifted by a media source action (this happens when pushing a\n // media source action onto the queue), then it wasn't from an updateend event from an\n // audio or video source buffer, so there's no change from previous state, and no\n // processing should be done.\n return;\n } // Media source queue entries don't need to consider whether the source updater is\n // started (i.e., source buffers are created) as they don't need the source buffers, but\n // source buffer queue entries do.\n\n\n if (!sourceUpdater.ready() || sourceUpdater.mediaSource.readyState === 'closed' || _updating(type, sourceUpdater)) {\n return;\n }\n\n if (queueEntry.type !== type) {\n queueIndex = nextQueueIndexOfType(type, sourceUpdater.queue);\n\n if (queueIndex === null) {\n // Either there's no queue entry that uses this source buffer type in the queue, or\n // there's a media source queue entry before the next entry of this type, in which\n // case wait for that action to process first.\n return;\n }\n\n queueEntry = sourceUpdater.queue[queueIndex];\n }\n\n sourceUpdater.queue.splice(queueIndex, 1); // Keep a record that this source buffer type is in use.\n //\n // The queue pending operation must be set before the action is performed in the event\n // that the action results in a synchronous event that is acted upon. For instance, if\n // an exception is thrown that can be handled, it's possible that new actions will be\n // appended to an empty queue and immediately executed, but would not have the correct\n // pending information if this property was set after the action was performed.\n\n sourceUpdater.queuePending[type] = queueEntry;\n queueEntry.action(type, sourceUpdater);\n\n if (!queueEntry.doneFn) {\n // synchronous operation, process next entry\n sourceUpdater.queuePending[type] = null;\n shiftQueue(type, sourceUpdater);\n return;\n }\n};\n\nvar cleanupBuffer = function cleanupBuffer(type, sourceUpdater) {\n var buffer = sourceUpdater[type + \"Buffer\"];\n var titleType = toTitleCase(type);\n\n if (!buffer) {\n return;\n }\n\n buffer.removeEventListener('updateend', sourceUpdater[\"on\" + titleType + \"UpdateEnd_\"]);\n buffer.removeEventListener('error', sourceUpdater[\"on\" + titleType + \"Error_\"]);\n sourceUpdater.codecs[type] = null;\n sourceUpdater[type + \"Buffer\"] = null;\n};\n\nvar inSourceBuffers = function inSourceBuffers(mediaSource, sourceBuffer) {\n return mediaSource && sourceBuffer && Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer) !== -1;\n};\n\nvar actions = {\n appendBuffer: function appendBuffer(bytes, segmentInfo, onError) {\n return function (type, sourceUpdater) {\n var sourceBuffer = sourceUpdater[type + \"Buffer\"]; // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n }\n\n sourceUpdater.logger_(\"Appending segment \" + segmentInfo.mediaIndex + \"'s \" + bytes.length + \" bytes to \" + type + \"Buffer\");\n\n try {\n sourceBuffer.appendBuffer(bytes);\n } catch (e) {\n sourceUpdater.logger_(\"Error with code \" + e.code + \" \" + (e.code === QUOTA_EXCEEDED_ERR ? '(QUOTA_EXCEEDED_ERR) ' : '') + (\"when appending segment \" + segmentInfo.mediaIndex + \" to \" + type + \"Buffer\"));\n sourceUpdater.queuePending[type] = null;\n onError(e);\n }\n };\n },\n remove: function remove(start, end) {\n return function (type, sourceUpdater) {\n var sourceBuffer = sourceUpdater[type + \"Buffer\"]; // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n }\n\n sourceUpdater.logger_(\"Removing \" + start + \" to \" + end + \" from \" + type + \"Buffer\");\n\n try {\n sourceBuffer.remove(start, end);\n } catch (e) {\n sourceUpdater.logger_(\"Remove \" + start + \" to \" + end + \" from \" + type + \"Buffer failed\");\n }\n };\n },\n timestampOffset: function timestampOffset(offset) {\n return function (type, sourceUpdater) {\n var sourceBuffer = sourceUpdater[type + \"Buffer\"]; // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n }\n\n sourceUpdater.logger_(\"Setting \" + type + \"timestampOffset to \" + offset);\n sourceBuffer.timestampOffset = offset;\n };\n },\n callback: function callback(_callback) {\n return function (type, sourceUpdater) {\n _callback();\n };\n },\n endOfStream: function endOfStream(error) {\n return function (sourceUpdater) {\n if (sourceUpdater.mediaSource.readyState !== 'open') {\n return;\n }\n\n sourceUpdater.logger_(\"Calling mediaSource endOfStream(\" + (error || '') + \")\");\n\n try {\n sourceUpdater.mediaSource.endOfStream(error);\n } catch (e) {\n videojs.log.warn('Failed to call media source endOfStream', e);\n }\n };\n },\n duration: function duration(_duration) {\n return function (sourceUpdater) {\n sourceUpdater.logger_(\"Setting mediaSource duration to \" + _duration);\n\n try {\n sourceUpdater.mediaSource.duration = _duration;\n } catch (e) {\n videojs.log.warn('Failed to set media source duration', e);\n }\n };\n },\n abort: function abort() {\n return function (type, sourceUpdater) {\n if (sourceUpdater.mediaSource.readyState !== 'open') {\n return;\n }\n\n var sourceBuffer = sourceUpdater[type + \"Buffer\"]; // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n }\n\n sourceUpdater.logger_(\"calling abort on \" + type + \"Buffer\");\n\n try {\n sourceBuffer.abort();\n } catch (e) {\n videojs.log.warn(\"Failed to abort on \" + type + \"Buffer\", e);\n }\n };\n },\n addSourceBuffer: function addSourceBuffer(type, codec) {\n return function (sourceUpdater) {\n var titleType = toTitleCase(type);\n var mime = getMimeForCodec(codec);\n sourceUpdater.logger_(\"Adding \" + type + \"Buffer with codec \" + codec + \" to mediaSource\");\n var sourceBuffer = sourceUpdater.mediaSource.addSourceBuffer(mime);\n sourceBuffer.addEventListener('updateend', sourceUpdater[\"on\" + titleType + \"UpdateEnd_\"]);\n sourceBuffer.addEventListener('error', sourceUpdater[\"on\" + titleType + \"Error_\"]);\n sourceUpdater.codecs[type] = codec;\n sourceUpdater[type + \"Buffer\"] = sourceBuffer;\n };\n },\n removeSourceBuffer: function removeSourceBuffer(type) {\n return function (sourceUpdater) {\n var sourceBuffer = sourceUpdater[type + \"Buffer\"];\n cleanupBuffer(type, sourceUpdater); // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n }\n\n sourceUpdater.logger_(\"Removing \" + type + \"Buffer with codec \" + sourceUpdater.codecs[type] + \" from mediaSource\");\n\n try {\n sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer);\n } catch (e) {\n videojs.log.warn(\"Failed to removeSourceBuffer \" + type + \"Buffer\", e);\n }\n };\n },\n changeType: function changeType(codec) {\n return function (type, sourceUpdater) {\n var sourceBuffer = sourceUpdater[type + \"Buffer\"];\n var mime = getMimeForCodec(codec); // can't do anything if the media source / source buffer is null\n // or the media source does not contain this source buffer.\n\n if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {\n return;\n } // do not update codec if we don't need to.\n\n\n if (sourceUpdater.codecs[type] === codec) {\n return;\n }\n\n sourceUpdater.logger_(\"changing \" + type + \"Buffer codec from \" + sourceUpdater.codecs[type] + \" to \" + codec);\n sourceBuffer.changeType(mime);\n sourceUpdater.codecs[type] = codec;\n };\n }\n};\n\nvar pushQueue = function pushQueue(_ref) {\n var type = _ref.type,\n sourceUpdater = _ref.sourceUpdater,\n action = _ref.action,\n doneFn = _ref.doneFn,\n name = _ref.name;\n sourceUpdater.queue.push({\n type: type,\n action: action,\n doneFn: doneFn,\n name: name\n });\n shiftQueue(type, sourceUpdater);\n};\n\nvar onUpdateend = function onUpdateend(type, sourceUpdater) {\n return function (e) {\n // Although there should, in theory, be a pending action for any updateend receieved,\n // there are some actions that may trigger updateend events without set definitions in\n // the w3c spec. For instance, setting the duration on the media source may trigger\n // updateend events on source buffers. This does not appear to be in the spec. As such,\n // if we encounter an updateend without a corresponding pending action from our queue\n // for that source buffer type, process the next action.\n if (sourceUpdater.queuePending[type]) {\n var doneFn = sourceUpdater.queuePending[type].doneFn;\n sourceUpdater.queuePending[type] = null;\n\n if (doneFn) {\n // if there's an error, report it\n doneFn(sourceUpdater[type + \"Error_\"]);\n }\n }\n\n shiftQueue(type, sourceUpdater);\n };\n};\n/**\n * A queue of callbacks to be serialized and applied when a\n * MediaSource and its associated SourceBuffers are not in the\n * updating state. It is used by the segment loader to update the\n * underlying SourceBuffers when new data is loaded, for instance.\n *\n * @class SourceUpdater\n * @param {MediaSource} mediaSource the MediaSource to create the SourceBuffer from\n * @param {string} mimeType the desired MIME type of the underlying SourceBuffer\n */\n\n\nvar video_es_SourceUpdater = /*#__PURE__*/function (_videojs$EventTarget) {\n inheritsLoose_default()(SourceUpdater, _videojs$EventTarget);\n\n function SourceUpdater(mediaSource) {\n var _this;\n\n _this = _videojs$EventTarget.call(this) || this;\n _this.mediaSource = mediaSource;\n\n _this.sourceopenListener_ = function () {\n return shiftQueue('mediaSource', assertThisInitialized_default()(_this));\n };\n\n _this.mediaSource.addEventListener('sourceopen', _this.sourceopenListener_);\n\n _this.logger_ = logger('SourceUpdater'); // initial timestamp offset is 0\n\n _this.audioTimestampOffset_ = 0;\n _this.videoTimestampOffset_ = 0;\n _this.queue = [];\n _this.queuePending = {\n audio: null,\n video: null\n };\n _this.delayedAudioAppendQueue_ = [];\n _this.videoAppendQueued_ = false;\n _this.codecs = {};\n _this.onVideoUpdateEnd_ = onUpdateend('video', assertThisInitialized_default()(_this));\n _this.onAudioUpdateEnd_ = onUpdateend('audio', assertThisInitialized_default()(_this));\n\n _this.onVideoError_ = function (e) {\n // used for debugging\n _this.videoError_ = e;\n };\n\n _this.onAudioError_ = function (e) {\n // used for debugging\n _this.audioError_ = e;\n };\n\n _this.createdSourceBuffers_ = false;\n _this.initializedEme_ = false;\n _this.triggeredReady_ = false;\n return _this;\n }\n\n var _proto = SourceUpdater.prototype;\n\n _proto.initializedEme = function initializedEme() {\n this.initializedEme_ = true;\n this.triggerReady();\n };\n\n _proto.hasCreatedSourceBuffers = function hasCreatedSourceBuffers() {\n // if false, likely waiting on one of the segment loaders to get enough data to create\n // source buffers\n return this.createdSourceBuffers_;\n };\n\n _proto.hasInitializedAnyEme = function hasInitializedAnyEme() {\n return this.initializedEme_;\n };\n\n _proto.ready = function ready() {\n return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme();\n };\n\n _proto.createSourceBuffers = function createSourceBuffers(codecs) {\n if (this.hasCreatedSourceBuffers()) {\n // already created them before\n return;\n } // the intial addOrChangeSourceBuffers will always be\n // two add buffers.\n\n\n this.addOrChangeSourceBuffers(codecs);\n this.createdSourceBuffers_ = true;\n this.trigger('createdsourcebuffers');\n this.triggerReady();\n };\n\n _proto.triggerReady = function triggerReady() {\n // only allow ready to be triggered once, this prevents the case\n // where:\n // 1. we trigger createdsourcebuffers\n // 2. ie 11 synchronously initializates eme\n // 3. the synchronous initialization causes us to trigger ready\n // 4. We go back to the ready check in createSourceBuffers and ready is triggered again.\n if (this.ready() && !this.triggeredReady_) {\n this.triggeredReady_ = true;\n this.trigger('ready');\n }\n }\n /**\n * Add a type of source buffer to the media source.\n *\n * @param {string} type\n * The type of source buffer to add.\n *\n * @param {string} codec\n * The codec to add the source buffer with.\n */\n ;\n\n _proto.addSourceBuffer = function addSourceBuffer(type, codec) {\n pushQueue({\n type: 'mediaSource',\n sourceUpdater: this,\n action: actions.addSourceBuffer(type, codec),\n name: 'addSourceBuffer'\n });\n }\n /**\n * call abort on a source buffer.\n *\n * @param {string} type\n * The type of source buffer to call abort on.\n */\n ;\n\n _proto.abort = function abort(type) {\n pushQueue({\n type: type,\n sourceUpdater: this,\n action: actions.abort(type),\n name: 'abort'\n });\n }\n /**\n * Call removeSourceBuffer and remove a specific type\n * of source buffer on the mediaSource.\n *\n * @param {string} type\n * The type of source buffer to remove.\n */\n ;\n\n _proto.removeSourceBuffer = function removeSourceBuffer(type) {\n if (!this.canRemoveSourceBuffer()) {\n videojs.log.error('removeSourceBuffer is not supported!');\n return;\n }\n\n pushQueue({\n type: 'mediaSource',\n sourceUpdater: this,\n action: actions.removeSourceBuffer(type),\n name: 'removeSourceBuffer'\n });\n }\n /**\n * Whether or not the removeSourceBuffer function is supported\n * on the mediaSource.\n *\n * @return {boolean}\n * if removeSourceBuffer can be called.\n */\n ;\n\n _proto.canRemoveSourceBuffer = function canRemoveSourceBuffer() {\n // IE reports that it supports removeSourceBuffer, but often throws\n // errors when attempting to use the function. So we report that it\n // does not support removeSourceBuffer. As of Firefox 83 removeSourceBuffer\n // throws errors, so we report that it does not support this as well.\n return !videojs.browser.IE_VERSION && !videojs.browser.IS_FIREFOX && window_default.a.MediaSource && window_default.a.MediaSource.prototype && typeof window_default.a.MediaSource.prototype.removeSourceBuffer === 'function';\n }\n /**\n * Whether or not the changeType function is supported\n * on our SourceBuffers.\n *\n * @return {boolean}\n * if changeType can be called.\n */\n ;\n\n SourceUpdater.canChangeType = function canChangeType() {\n return window_default.a.SourceBuffer && window_default.a.SourceBuffer.prototype && typeof window_default.a.SourceBuffer.prototype.changeType === 'function';\n }\n /**\n * Whether or not the changeType function is supported\n * on our SourceBuffers.\n *\n * @return {boolean}\n * if changeType can be called.\n */\n ;\n\n _proto.canChangeType = function canChangeType() {\n return this.constructor.canChangeType();\n }\n /**\n * Call the changeType function on a source buffer, given the code and type.\n *\n * @param {string} type\n * The type of source buffer to call changeType on.\n *\n * @param {string} codec\n * The codec string to change type with on the source buffer.\n */\n ;\n\n _proto.changeType = function changeType(type, codec) {\n if (!this.canChangeType()) {\n videojs.log.error('changeType is not supported!');\n return;\n }\n\n pushQueue({\n type: type,\n sourceUpdater: this,\n action: actions.changeType(codec),\n name: 'changeType'\n });\n }\n /**\n * Add source buffers with a codec or, if they are already created,\n * call changeType on source buffers using changeType.\n *\n * @param {Object} codecs\n * Codecs to switch to\n */\n ;\n\n _proto.addOrChangeSourceBuffers = function addOrChangeSourceBuffers(codecs) {\n var _this2 = this;\n\n if (!codecs || typeof codecs !== 'object' || Object.keys(codecs).length === 0) {\n throw new Error('Cannot addOrChangeSourceBuffers to undefined codecs');\n }\n\n Object.keys(codecs).forEach(function (type) {\n var codec = codecs[type];\n\n if (!_this2.hasCreatedSourceBuffers()) {\n return _this2.addSourceBuffer(type, codec);\n }\n\n if (_this2.canChangeType()) {\n _this2.changeType(type, codec);\n }\n });\n }\n /**\n * Queue an update to append an ArrayBuffer.\n *\n * @param {MediaObject} object containing audioBytes and/or videoBytes\n * @param {Function} done the function to call when done\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data\n */\n ;\n\n _proto.appendBuffer = function appendBuffer(options, doneFn) {\n var _this3 = this;\n\n var segmentInfo = options.segmentInfo,\n type = options.type,\n bytes = options.bytes;\n this.processedAppend_ = true;\n\n if (type === 'audio' && this.videoBuffer && !this.videoAppendQueued_) {\n this.delayedAudioAppendQueue_.push([options, doneFn]);\n this.logger_(\"delayed audio append of \" + bytes.length + \" until video append\");\n return;\n } // In the case of certain errors, for instance, QUOTA_EXCEEDED_ERR, updateend will\n // not be fired. This means that the queue will be blocked until the next action\n // taken by the segment-loader. Provide a mechanism for segment-loader to handle\n // these errors by calling the doneFn with the specific error.\n\n\n var onError = doneFn;\n pushQueue({\n type: type,\n sourceUpdater: this,\n action: actions.appendBuffer(bytes, segmentInfo || {\n mediaIndex: -1\n }, onError),\n doneFn: doneFn,\n name: 'appendBuffer'\n });\n\n if (type === 'video') {\n this.videoAppendQueued_ = true;\n\n if (!this.delayedAudioAppendQueue_.length) {\n return;\n }\n\n var queue = this.delayedAudioAppendQueue_.slice();\n this.logger_(\"queuing delayed audio \" + queue.length + \" appendBuffers\");\n this.delayedAudioAppendQueue_.length = 0;\n queue.forEach(function (que) {\n _this3.appendBuffer.apply(_this3, que);\n });\n }\n }\n /**\n * Get the audio buffer's buffered timerange.\n *\n * @return {TimeRange}\n * The audio buffer's buffered time range\n */\n ;\n\n _proto.audioBuffered = function audioBuffered() {\n // no media source/source buffer or it isn't in the media sources\n // source buffer list\n if (!inSourceBuffers(this.mediaSource, this.audioBuffer)) {\n return videojs.createTimeRange();\n }\n\n return this.audioBuffer.buffered ? this.audioBuffer.buffered : videojs.createTimeRange();\n }\n /**\n * Get the video buffer's buffered timerange.\n *\n * @return {TimeRange}\n * The video buffer's buffered time range\n */\n ;\n\n _proto.videoBuffered = function videoBuffered() {\n // no media source/source buffer or it isn't in the media sources\n // source buffer list\n if (!inSourceBuffers(this.mediaSource, this.videoBuffer)) {\n return videojs.createTimeRange();\n }\n\n return this.videoBuffer.buffered ? this.videoBuffer.buffered : videojs.createTimeRange();\n }\n /**\n * Get a combined video/audio buffer's buffered timerange.\n *\n * @return {TimeRange}\n * the combined time range\n */\n ;\n\n _proto.buffered = function buffered() {\n var video = inSourceBuffers(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null;\n var audio = inSourceBuffers(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null;\n\n if (audio && !video) {\n return this.audioBuffered();\n }\n\n if (video && !audio) {\n return this.videoBuffered();\n }\n\n return bufferIntersection(this.audioBuffered(), this.videoBuffered());\n }\n /**\n * Add a callback to the queue that will set duration on the mediaSource.\n *\n * @param {number} duration\n * The duration to set\n *\n * @param {Function} [doneFn]\n * function to run after duration has been set.\n */\n ;\n\n _proto.setDuration = function setDuration(duration, doneFn) {\n if (doneFn === void 0) {\n doneFn = video_es_noop;\n } // In order to set the duration on the media source, it's necessary to wait for all\n // source buffers to no longer be updating. \"If the updating attribute equals true on\n // any SourceBuffer in sourceBuffers, then throw an InvalidStateError exception and\n // abort these steps.\" (source: https://www.w3.org/TR/media-source/#attributes).\n\n\n pushQueue({\n type: 'mediaSource',\n sourceUpdater: this,\n action: actions.duration(duration),\n name: 'duration',\n doneFn: doneFn\n });\n }\n /**\n * Add a mediaSource endOfStream call to the queue\n *\n * @param {Error} [error]\n * Call endOfStream with an error\n *\n * @param {Function} [doneFn]\n * A function that should be called when the\n * endOfStream call has finished.\n */\n ;\n\n _proto.endOfStream = function endOfStream(error, doneFn) {\n if (error === void 0) {\n error = null;\n }\n\n if (doneFn === void 0) {\n doneFn = video_es_noop;\n }\n\n if (typeof error !== 'string') {\n error = undefined;\n } // In order to set the duration on the media source, it's necessary to wait for all\n // source buffers to no longer be updating. \"If the updating attribute equals true on\n // any SourceBuffer in sourceBuffers, then throw an InvalidStateError exception and\n // abort these steps.\" (source: https://www.w3.org/TR/media-source/#attributes).\n\n\n pushQueue({\n type: 'mediaSource',\n sourceUpdater: this,\n action: actions.endOfStream(error),\n name: 'endOfStream',\n doneFn: doneFn\n });\n }\n /**\n * Queue an update to remove a time range from the buffer.\n *\n * @param {number} start where to start the removal\n * @param {number} end where to end the removal\n * @param {Function} [done=noop] optional callback to be executed when the remove\n * operation is complete\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end\n */\n ;\n\n _proto.removeAudio = function removeAudio(start, end, done) {\n if (done === void 0) {\n done = video_es_noop;\n }\n\n if (!this.audioBuffered().length || this.audioBuffered().end(0) === 0) {\n done();\n return;\n }\n\n pushQueue({\n type: 'audio',\n sourceUpdater: this,\n action: actions.remove(start, end),\n doneFn: done,\n name: 'remove'\n });\n }\n /**\n * Queue an update to remove a time range from the buffer.\n *\n * @param {number} start where to start the removal\n * @param {number} end where to end the removal\n * @param {Function} [done=noop] optional callback to be executed when the remove\n * operation is complete\n * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end\n */\n ;\n\n _proto.removeVideo = function removeVideo(start, end, done) {\n if (done === void 0) {\n done = video_es_noop;\n }\n\n if (!this.videoBuffered().length || this.videoBuffered().end(0) === 0) {\n done();\n return;\n }\n\n pushQueue({\n type: 'video',\n sourceUpdater: this,\n action: actions.remove(start, end),\n doneFn: done,\n name: 'remove'\n });\n }\n /**\n * Whether the underlying sourceBuffer is updating or not\n *\n * @return {boolean} the updating status of the SourceBuffer\n */\n ;\n\n _proto.updating = function updating() {\n // the audio/video source buffer is updating\n if (_updating('audio', this) || _updating('video', this)) {\n return true;\n }\n\n return false;\n }\n /**\n * Set/get the timestampoffset on the audio SourceBuffer\n *\n * @return {number} the timestamp offset\n */\n ;\n\n _proto.audioTimestampOffset = function audioTimestampOffset(offset) {\n if (typeof offset !== 'undefined' && this.audioBuffer && // no point in updating if it's the same\n this.audioTimestampOffset_ !== offset) {\n pushQueue({\n type: 'audio',\n sourceUpdater: this,\n action: actions.timestampOffset(offset),\n name: 'timestampOffset'\n });\n this.audioTimestampOffset_ = offset;\n }\n\n return this.audioTimestampOffset_;\n }\n /**\n * Set/get the timestampoffset on the video SourceBuffer\n *\n * @return {number} the timestamp offset\n */\n ;\n\n _proto.videoTimestampOffset = function videoTimestampOffset(offset) {\n if (typeof offset !== 'undefined' && this.videoBuffer && // no point in updating if it's the same\n this.videoTimestampOffset !== offset) {\n pushQueue({\n type: 'video',\n sourceUpdater: this,\n action: actions.timestampOffset(offset),\n name: 'timestampOffset'\n });\n this.videoTimestampOffset_ = offset;\n }\n\n return this.videoTimestampOffset_;\n }\n /**\n * Add a function to the queue that will be called\n * when it is its turn to run in the audio queue.\n *\n * @param {Function} callback\n * The callback to queue.\n */\n ;\n\n _proto.audioQueueCallback = function audioQueueCallback(callback) {\n if (!this.audioBuffer) {\n return;\n }\n\n pushQueue({\n type: 'audio',\n sourceUpdater: this,\n action: actions.callback(callback),\n name: 'callback'\n });\n }\n /**\n * Add a function to the queue that will be called\n * when it is its turn to run in the video queue.\n *\n * @param {Function} callback\n * The callback to queue.\n */\n ;\n\n _proto.videoQueueCallback = function videoQueueCallback(callback) {\n if (!this.videoBuffer) {\n return;\n }\n\n pushQueue({\n type: 'video',\n sourceUpdater: this,\n action: actions.callback(callback),\n name: 'callback'\n });\n }\n /**\n * dispose of the source updater and the underlying sourceBuffer\n */\n ;\n\n _proto.dispose = function dispose() {\n var _this4 = this;\n\n this.trigger('dispose');\n bufferTypes.forEach(function (type) {\n _this4.abort(type);\n\n if (_this4.canRemoveSourceBuffer()) {\n _this4.removeSourceBuffer(type);\n } else {\n _this4[type + \"QueueCallback\"](function () {\n return cleanupBuffer(type, _this4);\n });\n }\n });\n this.videoAppendQueued_ = false;\n this.delayedAudioAppendQueue_.length = 0;\n\n if (this.sourceopenListener_) {\n this.mediaSource.removeEventListener('sourceopen', this.sourceopenListener_);\n }\n\n this.off();\n };\n\n return SourceUpdater;\n}(videojs.EventTarget);\n\nvar uint8ToUtf8 = function uint8ToUtf8(uintArray) {\n return decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));\n};\n\nvar VTT_LINE_TERMINATORS = new Uint8Array('\\n\\n'.split('').map(function (_char3) {\n return _char3.charCodeAt(0);\n}));\n/**\n * An object that manages segment loading and appending.\n *\n * @class VTTSegmentLoader\n * @param {Object} options required and optional options\n * @extends videojs.EventTarget\n */\n\nvar video_es_VTTSegmentLoader = /*#__PURE__*/function (_SegmentLoader) {\n inheritsLoose_default()(VTTSegmentLoader, _SegmentLoader);\n\n function VTTSegmentLoader(settings, options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _SegmentLoader.call(this, settings, options) || this; // SegmentLoader requires a MediaSource be specified or it will throw an error;\n // however, VTTSegmentLoader has no need of a media source, so delete the reference\n\n _this.mediaSource_ = null;\n _this.subtitlesTrack_ = null;\n _this.loaderType_ = 'subtitle';\n _this.featuresNativeTextTracks_ = settings.featuresNativeTextTracks; // The VTT segment will have its own time mappings. Saving VTT segment timing info in\n // the sync controller leads to improper behavior.\n\n _this.shouldSaveSegmentTimingInfo_ = false;\n return _this;\n }\n\n var _proto = VTTSegmentLoader.prototype;\n\n _proto.createTransmuxer_ = function createTransmuxer_() {\n // don't need to transmux any subtitles\n return null;\n }\n /**\n * Indicates which time ranges are buffered\n *\n * @return {TimeRange}\n * TimeRange object representing the current buffered ranges\n */\n ;\n\n _proto.buffered_ = function buffered_() {\n if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) {\n return videojs.createTimeRanges();\n }\n\n var cues = this.subtitlesTrack_.cues;\n var start = cues[0].startTime;\n var end = cues[cues.length - 1].startTime;\n return videojs.createTimeRanges([[start, end]]);\n }\n /**\n * Gets and sets init segment for the provided map\n *\n * @param {Object} map\n * The map object representing the init segment to get or set\n * @param {boolean=} set\n * If true, the init segment for the provided map should be saved\n * @return {Object}\n * map object for desired init segment\n */\n ;\n\n _proto.initSegmentForMap = function initSegmentForMap(map, set) {\n if (set === void 0) {\n set = false;\n }\n\n if (!map) {\n return null;\n }\n\n var id = initSegmentId(map);\n var storedMap = this.initSegments_[id];\n\n if (set && !storedMap && map.bytes) {\n // append WebVTT line terminators to the media initialization segment if it exists\n // to follow the WebVTT spec (https://w3c.github.io/webvtt/#file-structure) that\n // requires two or more WebVTT line terminators between the WebVTT header and the\n // rest of the file\n var combinedByteLength = VTT_LINE_TERMINATORS.byteLength + map.bytes.byteLength;\n var combinedSegment = new Uint8Array(combinedByteLength);\n combinedSegment.set(map.bytes);\n combinedSegment.set(VTT_LINE_TERMINATORS, map.bytes.byteLength);\n this.initSegments_[id] = storedMap = {\n resolvedUri: map.resolvedUri,\n byterange: map.byterange,\n bytes: combinedSegment\n };\n }\n\n return storedMap || map;\n }\n /**\n * Returns true if all configuration required for loading is present, otherwise false.\n *\n * @return {boolean} True if the all configuration is ready for loading\n * @private\n */\n ;\n\n _proto.couldBeginLoading_ = function couldBeginLoading_() {\n return this.playlist_ && this.subtitlesTrack_ && !this.paused();\n }\n /**\n * Once all the starting parameters have been specified, begin\n * operation. This method should only be invoked from the INIT\n * state.\n *\n * @private\n */\n ;\n\n _proto.init_ = function init_() {\n this.state = 'READY';\n this.resetEverything();\n return this.monitorBuffer_();\n }\n /**\n * Set a subtitle track on the segment loader to add subtitles to\n *\n * @param {TextTrack=} track\n * The text track to add loaded subtitles to\n * @return {TextTrack}\n * Returns the subtitles track\n */\n ;\n\n _proto.track = function track(_track) {\n if (typeof _track === 'undefined') {\n return this.subtitlesTrack_;\n }\n\n this.subtitlesTrack_ = _track; // if we were unpaused but waiting for a sourceUpdater, start\n // buffering now\n\n if (this.state === 'INIT' && this.couldBeginLoading_()) {\n this.init_();\n }\n\n return this.subtitlesTrack_;\n }\n /**\n * Remove any data in the source buffer between start and end times\n *\n * @param {number} start - the start time of the region to remove from the buffer\n * @param {number} end - the end time of the region to remove from the buffer\n */\n ;\n\n _proto.remove = function remove(start, end) {\n removeCuesFromTrack(start, end, this.subtitlesTrack_);\n }\n /**\n * fill the buffer with segements unless the sourceBuffers are\n * currently updating\n *\n * Note: this function should only ever be called by monitorBuffer_\n * and never directly\n *\n * @private\n */\n ;\n\n _proto.fillBuffer_ = function fillBuffer_() {\n var _this2 = this; // see if we need to begin loading immediately\n\n\n var segmentInfo = this.chooseNextRequest_();\n\n if (!segmentInfo) {\n return;\n }\n\n if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {\n // We don't have the timestamp offset that we need to sync subtitles.\n // Rerun on a timestamp offset or user interaction.\n var checkTimestampOffset = function checkTimestampOffset() {\n _this2.state = 'READY';\n\n if (!_this2.paused()) {\n // if not paused, queue a buffer check as soon as possible\n _this2.monitorBuffer_();\n }\n };\n\n this.syncController_.one('timestampoffset', checkTimestampOffset);\n this.state = 'WAITING_ON_TIMELINE';\n return;\n }\n\n this.loadSegment_(segmentInfo);\n } // never set a timestamp offset for vtt segments.\n ;\n\n _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_() {\n return null;\n };\n\n _proto.chooseNextRequest_ = function chooseNextRequest_() {\n return this.skipEmptySegments_(_SegmentLoader.prototype.chooseNextRequest_.call(this));\n }\n /**\n * Prevents the segment loader from requesting segments we know contain no subtitles\n * by walking forward until we find the next segment that we don't know whether it is\n * empty or not.\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @return {Object}\n * a segment info object that describes the current segment\n */\n ;\n\n _proto.skipEmptySegments_ = function skipEmptySegments_(segmentInfo) {\n while (segmentInfo && segmentInfo.segment.empty) {\n // stop at the last possible segmentInfo\n if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) {\n segmentInfo = null;\n break;\n }\n\n segmentInfo = this.generateSegmentInfo_({\n playlist: segmentInfo.playlist,\n mediaIndex: segmentInfo.mediaIndex + 1,\n startOfSegment: segmentInfo.startOfSegment + segmentInfo.duration,\n isSyncRequest: segmentInfo.isSyncRequest\n });\n }\n\n return segmentInfo;\n };\n\n _proto.stopForError = function stopForError(error) {\n this.error(error);\n this.state = 'READY';\n this.pause();\n this.trigger('error');\n }\n /**\n * append a decrypted segement to the SourceBuffer through a SourceUpdater\n *\n * @private\n */\n ;\n\n _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) {\n var _this3 = this;\n\n if (!this.subtitlesTrack_) {\n this.state = 'READY';\n return;\n }\n\n this.saveTransferStats_(simpleSegment.stats); // the request was aborted\n\n if (!this.pendingSegment_) {\n this.state = 'READY';\n this.mediaRequestsAborted += 1;\n return;\n }\n\n if (error) {\n if (error.code === REQUEST_ERRORS.TIMEOUT) {\n this.handleTimeout_();\n }\n\n if (error.code === REQUEST_ERRORS.ABORTED) {\n this.mediaRequestsAborted += 1;\n } else {\n this.mediaRequestsErrored += 1;\n }\n\n this.stopForError(error);\n return;\n }\n\n var segmentInfo = this.pendingSegment_; // although the VTT segment loader bandwidth isn't really used, it's good to\n // maintain functionality between segment loaders\n\n this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);\n this.state = 'APPENDING'; // used for tests\n\n this.trigger('appending');\n var segment = segmentInfo.segment;\n\n if (segment.map) {\n segment.map.bytes = simpleSegment.map.bytes;\n }\n\n segmentInfo.bytes = simpleSegment.bytes; // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n\n if (typeof window_default.a.WebVTT !== 'function' && this.subtitlesTrack_ && this.subtitlesTrack_.tech_) {\n var loadHandler;\n\n var errorHandler = function errorHandler() {\n _this3.subtitlesTrack_.tech_.off('vttjsloaded', loadHandler);\n\n _this3.stopForError({\n message: 'Error loading vtt.js'\n });\n\n return;\n };\n\n loadHandler = function loadHandler() {\n _this3.subtitlesTrack_.tech_.off('vttjserror', errorHandler);\n\n _this3.segmentRequestFinished_(error, simpleSegment, result);\n };\n\n this.state = 'WAITING_ON_VTTJS';\n this.subtitlesTrack_.tech_.one('vttjsloaded', loadHandler);\n this.subtitlesTrack_.tech_.one('vttjserror', errorHandler);\n return;\n }\n\n segment.requested = true;\n\n try {\n this.parseVTTCues_(segmentInfo);\n } catch (e) {\n this.stopForError({\n message: e.message\n });\n return;\n }\n\n this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);\n\n if (segmentInfo.cues.length) {\n segmentInfo.timingInfo = {\n start: segmentInfo.cues[0].startTime,\n end: segmentInfo.cues[segmentInfo.cues.length - 1].endTime\n };\n } else {\n segmentInfo.timingInfo = {\n start: segmentInfo.startOfSegment,\n end: segmentInfo.startOfSegment + segmentInfo.duration\n };\n }\n\n if (segmentInfo.isSyncRequest) {\n this.trigger('syncinfoupdate');\n this.pendingSegment_ = null;\n this.state = 'READY';\n return;\n }\n\n segmentInfo.byteLength = segmentInfo.bytes.byteLength;\n this.mediaSecondsLoaded += segment.duration; // Create VTTCue instances for each cue in the new segment and add them to\n // the subtitle track\n\n segmentInfo.cues.forEach(function (cue) {\n _this3.subtitlesTrack_.addCue(_this3.featuresNativeTextTracks_ ? new window_default.a.VTTCue(cue.startTime, cue.endTime, cue.text) : cue);\n }); // Remove any duplicate cues from the subtitle track. The WebVTT spec allows\n // cues to have identical time-intervals, but if the text is also identical\n // we can safely assume it is a duplicate that can be removed (ex. when a cue\n // \"overlaps\" VTT segments)\n\n removeDuplicateCuesFromTrack(this.subtitlesTrack_);\n this.handleAppendsDone_();\n };\n\n _proto.handleData_ = function handleData_() {// noop as we shouldn't be getting video/audio data captions\n // that we do not support here.\n };\n\n _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_() {// noop\n }\n /**\n * Uses the WebVTT parser to parse the segment response\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @private\n */\n ;\n\n _proto.parseVTTCues_ = function parseVTTCues_(segmentInfo) {\n var decoder;\n var decodeBytesToString = false;\n\n if (typeof window_default.a.TextDecoder === 'function') {\n decoder = new window_default.a.TextDecoder('utf8');\n } else {\n decoder = window_default.a.WebVTT.StringDecoder();\n decodeBytesToString = true;\n }\n\n var parser = new window_default.a.WebVTT.Parser(window_default.a, window_default.a.vttjs, decoder);\n segmentInfo.cues = [];\n segmentInfo.timestampmap = {\n MPEGTS: 0,\n LOCAL: 0\n };\n parser.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);\n\n parser.ontimestampmap = function (map) {\n segmentInfo.timestampmap = map;\n };\n\n parser.onparsingerror = function (error) {\n videojs.log.warn('Error encountered when parsing cues: ' + error.message);\n };\n\n if (segmentInfo.segment.map) {\n var mapData = segmentInfo.segment.map.bytes;\n\n if (decodeBytesToString) {\n mapData = uint8ToUtf8(mapData);\n }\n\n parser.parse(mapData);\n }\n\n var segmentData = segmentInfo.bytes;\n\n if (decodeBytesToString) {\n segmentData = uint8ToUtf8(segmentData);\n }\n\n parser.parse(segmentData);\n parser.flush();\n }\n /**\n * Updates the start and end times of any cues parsed by the WebVTT parser using\n * the information parsed from the X-TIMESTAMP-MAP header and a TS to media time mapping\n * from the SyncController\n *\n * @param {Object} segmentInfo\n * a segment info object that describes the current segment\n * @param {Object} mappingObj\n * object containing a mapping from TS to media time\n * @param {Object} playlist\n * the playlist object containing the segment\n * @private\n */\n ;\n\n _proto.updateTimeMapping_ = function updateTimeMapping_(segmentInfo, mappingObj, playlist) {\n var segment = segmentInfo.segment;\n\n if (!mappingObj) {\n // If the sync controller does not have a mapping of TS to Media Time for the\n // timeline, then we don't have enough information to update the cue\n // start/end times\n return;\n }\n\n if (!segmentInfo.cues.length) {\n // If there are no cues, we also do not have enough information to figure out\n // segment timing. Mark that the segment contains no cues so we don't re-request\n // an empty segment.\n segment.empty = true;\n return;\n }\n\n var timestampmap = segmentInfo.timestampmap;\n var diff = timestampmap.MPEGTS / clock_[\"ONE_SECOND_IN_TS\"] - timestampmap.LOCAL + mappingObj.mapping;\n segmentInfo.cues.forEach(function (cue) {\n // First convert cue time to TS time using the timestamp-map provided within the vtt\n cue.startTime += diff;\n cue.endTime += diff;\n });\n\n if (!playlist.syncInfo) {\n var firstStart = segmentInfo.cues[0].startTime;\n var lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;\n playlist.syncInfo = {\n mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,\n time: Math.min(firstStart, lastStart - segment.duration)\n };\n }\n };\n\n return VTTSegmentLoader;\n}(video_es_SegmentLoader);\n/**\n * @file ad-cue-tags.js\n */\n\n/**\n * Searches for an ad cue that overlaps with the given mediaTime\n *\n * @param {Object} track\n * the track to find the cue for\n *\n * @param {number} mediaTime\n * the time to find the cue at\n *\n * @return {Object|null}\n * the found cue or null\n */\n\n\nvar findAdCue = function findAdCue(track, mediaTime) {\n var cues = track.cues;\n\n for (var i = 0; i < cues.length; i++) {\n var cue = cues[i];\n\n if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {\n return cue;\n }\n }\n\n return null;\n};\n\nvar video_es_updateAdCues = function updateAdCues(media, track, offset) {\n if (offset === void 0) {\n offset = 0;\n }\n\n if (!media.segments) {\n return;\n }\n\n var mediaTime = offset;\n var cue;\n\n for (var i = 0; i < media.segments.length; i++) {\n var segment = media.segments[i];\n\n if (!cue) {\n // Since the cues will span for at least the segment duration, adding a fudge\n // factor of half segment duration will prevent duplicate cues from being\n // created when timing info is not exact (e.g. cue start time initialized\n // at 10.006677, but next call mediaTime is 10.003332 )\n cue = findAdCue(track, mediaTime + segment.duration / 2);\n }\n\n if (cue) {\n if ('cueIn' in segment) {\n // Found a CUE-IN so end the cue\n cue.endTime = mediaTime;\n cue.adEndTime = mediaTime;\n mediaTime += segment.duration;\n cue = null;\n continue;\n }\n\n if (mediaTime < cue.endTime) {\n // Already processed this mediaTime for this cue\n mediaTime += segment.duration;\n continue;\n } // otherwise extend cue until a CUE-IN is found\n\n\n cue.endTime += segment.duration;\n } else {\n if ('cueOut' in segment) {\n cue = new window_default.a.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);\n cue.adStartTime = mediaTime; // Assumes tag format to be\n // #EXT-X-CUE-OUT:30\n\n cue.adEndTime = mediaTime + parseFloat(segment.cueOut);\n track.addCue(cue);\n }\n\n if ('cueOutCont' in segment) {\n // Entered into the middle of an ad cue\n // Assumes tag formate to be\n // #EXT-X-CUE-OUT-CONT:10/30\n var _segment$cueOutCont$s = segment.cueOutCont.split('/').map(parseFloat),\n adOffset = _segment$cueOutCont$s[0],\n adTotal = _segment$cueOutCont$s[1];\n\n cue = new window_default.a.VTTCue(mediaTime, mediaTime + segment.duration, '');\n cue.adStartTime = mediaTime - adOffset;\n cue.adEndTime = cue.adStartTime + adTotal;\n track.addCue(cue);\n }\n }\n\n mediaTime += segment.duration;\n }\n};\n\nvar syncPointStrategies = [// Stategy \"VOD\": Handle the VOD-case where the sync-point is *always*\n// the equivalence display-time 0 === segment-index 0\n{\n name: 'VOD',\n run: function run(syncController, playlist, duration, currentTimeline, currentTime) {\n if (duration !== Infinity) {\n var syncPoint = {\n time: 0,\n segmentIndex: 0,\n partIndex: null\n };\n return syncPoint;\n }\n\n return null;\n }\n}, // Stategy \"ProgramDateTime\": We have a program-date-time tag in this playlist\n{\n name: 'ProgramDateTime',\n run: function run(syncController, playlist, duration, currentTimeline, currentTime) {\n if (!Object.keys(syncController.timelineToDatetimeMappings).length) {\n return null;\n }\n\n var syncPoint = null;\n var lastDistance = null;\n var partsAndSegments = getPartsAndSegments(playlist);\n currentTime = currentTime || 0;\n\n for (var i = 0; i < partsAndSegments.length; i++) {\n // start from the end and loop backwards for live\n // or start from the front and loop forwards for non-live\n var index = playlist.endList || currentTime === 0 ? i : partsAndSegments.length - (i + 1);\n var partAndSegment = partsAndSegments[index];\n var segment = partAndSegment.segment;\n var datetimeMapping = syncController.timelineToDatetimeMappings[segment.timeline];\n\n if (!datetimeMapping) {\n continue;\n }\n\n if (segment.dateTimeObject) {\n var segmentTime = segment.dateTimeObject.getTime() / 1000;\n var start = segmentTime + datetimeMapping; // take part duration into account.\n\n if (segment.parts && typeof partAndSegment.partIndex === 'number') {\n for (var z = 0; z < partAndSegment.partIndex; z++) {\n start += segment.parts[z].duration;\n }\n }\n\n var distance = Math.abs(currentTime - start); // Once the distance begins to increase, or if distance is 0, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && (distance === 0 || lastDistance < distance)) {\n break;\n }\n\n lastDistance = distance;\n syncPoint = {\n time: start,\n segmentIndex: partAndSegment.segmentIndex,\n partIndex: partAndSegment.partIndex\n };\n }\n }\n\n return syncPoint;\n }\n}, // Stategy \"Segment\": We have a known time mapping for a timeline and a\n// segment in the current timeline with timing data\n{\n name: 'Segment',\n run: function run(syncController, playlist, duration, currentTimeline, currentTime) {\n var syncPoint = null;\n var lastDistance = null;\n currentTime = currentTime || 0;\n var partsAndSegments = getPartsAndSegments(playlist);\n\n for (var i = 0; i < partsAndSegments.length; i++) {\n // start from the end and loop backwards for live\n // or start from the front and loop forwards for non-live\n var index = playlist.endList || currentTime === 0 ? i : partsAndSegments.length - (i + 1);\n var partAndSegment = partsAndSegments[index];\n var segment = partAndSegment.segment;\n var start = partAndSegment.part && partAndSegment.part.start || segment && segment.start;\n\n if (segment.timeline === currentTimeline && typeof start !== 'undefined') {\n var distance = Math.abs(currentTime - start); // Once the distance begins to increase, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && lastDistance < distance) {\n break;\n }\n\n if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n lastDistance = distance;\n syncPoint = {\n time: start,\n segmentIndex: partAndSegment.segmentIndex,\n partIndex: partAndSegment.partIndex\n };\n }\n }\n }\n\n return syncPoint;\n }\n}, // Stategy \"Discontinuity\": We have a discontinuity with a known\n// display-time\n{\n name: 'Discontinuity',\n run: function run(syncController, playlist, duration, currentTimeline, currentTime) {\n var syncPoint = null;\n currentTime = currentTime || 0;\n\n if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n var lastDistance = null;\n\n for (var i = 0; i < playlist.discontinuityStarts.length; i++) {\n var segmentIndex = playlist.discontinuityStarts[i];\n var discontinuity = playlist.discontinuitySequence + i + 1;\n var discontinuitySync = syncController.discontinuities[discontinuity];\n\n if (discontinuitySync) {\n var distance = Math.abs(currentTime - discontinuitySync.time); // Once the distance begins to increase, we have passed\n // currentTime and can stop looking for better candidates\n\n if (lastDistance !== null && lastDistance < distance) {\n break;\n }\n\n if (!syncPoint || lastDistance === null || lastDistance >= distance) {\n lastDistance = distance;\n syncPoint = {\n time: discontinuitySync.time,\n segmentIndex: segmentIndex,\n partIndex: null\n };\n }\n }\n }\n }\n\n return syncPoint;\n }\n}, // Stategy \"Playlist\": We have a playlist with a known mapping of\n// segment index to display time\n{\n name: 'Playlist',\n run: function run(syncController, playlist, duration, currentTimeline, currentTime) {\n if (playlist.syncInfo) {\n var syncPoint = {\n time: playlist.syncInfo.time,\n segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence,\n partIndex: null\n };\n return syncPoint;\n }\n\n return null;\n }\n}];\n\nvar video_es_SyncController = /*#__PURE__*/function (_videojs$EventTarget) {\n inheritsLoose_default()(SyncController, _videojs$EventTarget);\n\n function SyncController(options) {\n var _this;\n\n _this = _videojs$EventTarget.call(this) || this; // ...for synching across variants\n\n _this.timelines = [];\n _this.discontinuities = [];\n _this.timelineToDatetimeMappings = {};\n _this.logger_ = logger('SyncController');\n return _this;\n }\n /**\n * Find a sync-point for the playlist specified\n *\n * A sync-point is defined as a known mapping from display-time to\n * a segment-index in the current playlist.\n *\n * @param {Playlist} playlist\n * The playlist that needs a sync-point\n * @param {number} duration\n * Duration of the MediaSource (Infinite if playing a live source)\n * @param {number} currentTimeline\n * The last timeline from which a segment was loaded\n * @return {Object}\n * A sync-point object\n */\n\n\n var _proto = SyncController.prototype;\n\n _proto.getSyncPoint = function getSyncPoint(playlist, duration, currentTimeline, currentTime) {\n var syncPoints = this.runStrategies_(playlist, duration, currentTimeline, currentTime);\n\n if (!syncPoints.length) {\n // Signal that we need to attempt to get a sync-point manually\n // by fetching a segment in the playlist and constructing\n // a sync-point from that information\n return null;\n } // Now find the sync-point that is closest to the currentTime because\n // that should result in the most accurate guess about which segment\n // to fetch\n\n\n return this.selectSyncPoint_(syncPoints, {\n key: 'time',\n value: currentTime\n });\n }\n /**\n * Calculate the amount of time that has expired off the playlist during playback\n *\n * @param {Playlist} playlist\n * Playlist object to calculate expired from\n * @param {number} duration\n * Duration of the MediaSource (Infinity if playling a live source)\n * @return {number|null}\n * The amount of time that has expired off the playlist during playback. Null\n * if no sync-points for the playlist can be found.\n */\n ;\n\n _proto.getExpiredTime = function getExpiredTime(playlist, duration) {\n if (!playlist || !playlist.segments) {\n return null;\n }\n\n var syncPoints = this.runStrategies_(playlist, duration, playlist.discontinuitySequence, 0); // Without sync-points, there is not enough information to determine the expired time\n\n if (!syncPoints.length) {\n return null;\n }\n\n var syncPoint = this.selectSyncPoint_(syncPoints, {\n key: 'segmentIndex',\n value: 0\n }); // If the sync-point is beyond the start of the playlist, we want to subtract the\n // duration from index 0 to syncPoint.segmentIndex instead of adding.\n\n if (syncPoint.segmentIndex > 0) {\n syncPoint.time *= -1;\n }\n\n return Math.abs(syncPoint.time + sumDurations({\n defaultDuration: playlist.targetDuration,\n durationList: playlist.segments,\n startIndex: syncPoint.segmentIndex,\n endIndex: 0\n }));\n }\n /**\n * Runs each sync-point strategy and returns a list of sync-points returned by the\n * strategies\n *\n * @private\n * @param {Playlist} playlist\n * The playlist that needs a sync-point\n * @param {number} duration\n * Duration of the MediaSource (Infinity if playing a live source)\n * @param {number} currentTimeline\n * The last timeline from which a segment was loaded\n * @return {Array}\n * A list of sync-point objects\n */\n ;\n\n _proto.runStrategies_ = function runStrategies_(playlist, duration, currentTimeline, currentTime) {\n var syncPoints = []; // Try to find a sync-point in by utilizing various strategies...\n\n for (var i = 0; i < syncPointStrategies.length; i++) {\n var strategy = syncPointStrategies[i];\n var syncPoint = strategy.run(this, playlist, duration, currentTimeline, currentTime);\n\n if (syncPoint) {\n syncPoint.strategy = strategy.name;\n syncPoints.push({\n strategy: strategy.name,\n syncPoint: syncPoint\n });\n }\n }\n\n return syncPoints;\n }\n /**\n * Selects the sync-point nearest the specified target\n *\n * @private\n * @param {Array} syncPoints\n * List of sync-points to select from\n * @param {Object} target\n * Object specifying the property and value we are targeting\n * @param {string} target.key\n * Specifies the property to target. Must be either 'time' or 'segmentIndex'\n * @param {number} target.value\n * The value to target for the specified key.\n * @return {Object}\n * The sync-point nearest the target\n */\n ;\n\n _proto.selectSyncPoint_ = function selectSyncPoint_(syncPoints, target) {\n var bestSyncPoint = syncPoints[0].syncPoint;\n var bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);\n var bestStrategy = syncPoints[0].strategy;\n\n for (var i = 1; i < syncPoints.length; i++) {\n var newDistance = Math.abs(syncPoints[i].syncPoint[target.key] - target.value);\n\n if (newDistance < bestDistance) {\n bestDistance = newDistance;\n bestSyncPoint = syncPoints[i].syncPoint;\n bestStrategy = syncPoints[i].strategy;\n }\n }\n\n this.logger_(\"syncPoint for [\" + target.key + \": \" + target.value + \"] chosen with strategy\" + (\" [\" + bestStrategy + \"]: [time:\" + bestSyncPoint.time + \",\") + (\" segmentIndex:\" + bestSyncPoint.segmentIndex) + (typeof bestSyncPoint.partIndex === 'number' ? \",partIndex:\" + bestSyncPoint.partIndex : '') + ']');\n return bestSyncPoint;\n }\n /**\n * Save any meta-data present on the segments when segments leave\n * the live window to the playlist to allow for synchronization at the\n * playlist level later.\n *\n * @param {Playlist} oldPlaylist - The previous active playlist\n * @param {Playlist} newPlaylist - The updated and most current playlist\n */\n ;\n\n _proto.saveExpiredSegmentInfo = function saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {\n var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence; // When a segment expires from the playlist and it has a start time\n // save that information as a possible sync-point reference in future\n\n for (var i = mediaSequenceDiff - 1; i >= 0; i--) {\n var lastRemovedSegment = oldPlaylist.segments[i];\n\n if (lastRemovedSegment && typeof lastRemovedSegment.start !== 'undefined') {\n newPlaylist.syncInfo = {\n mediaSequence: oldPlaylist.mediaSequence + i,\n time: lastRemovedSegment.start\n };\n this.logger_(\"playlist refresh sync: [time:\" + newPlaylist.syncInfo.time + \",\" + (\" mediaSequence: \" + newPlaylist.syncInfo.mediaSequence + \"]\"));\n this.trigger('syncinfoupdate');\n break;\n }\n }\n }\n /**\n * Save the mapping from playlist's ProgramDateTime to display. This should only happen\n * before segments start to load.\n *\n * @param {Playlist} playlist - The currently active playlist\n */\n ;\n\n _proto.setDateTimeMappingForStart = function setDateTimeMappingForStart(playlist) {\n // It's possible for the playlist to be updated before playback starts, meaning time\n // zero is not yet set. If, during these playlist refreshes, a discontinuity is\n // crossed, then the old time zero mapping (for the prior timeline) would be retained\n // unless the mappings are cleared.\n this.timelineToDatetimeMappings = {};\n\n if (playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {\n var firstSegment = playlist.segments[0];\n var playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1000;\n this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp;\n }\n }\n /**\n * Calculates and saves timeline mappings, playlist sync info, and segment timing values\n * based on the latest timing information.\n *\n * @param {Object} options\n * Options object\n * @param {SegmentInfo} options.segmentInfo\n * The current active request information\n * @param {boolean} options.shouldSaveTimelineMapping\n * If there's a timeline change, determines if the timeline mapping should be\n * saved for timeline mapping and program date time mappings.\n */\n ;\n\n _proto.saveSegmentTimingInfo = function saveSegmentTimingInfo(_ref) {\n var segmentInfo = _ref.segmentInfo,\n shouldSaveTimelineMapping = _ref.shouldSaveTimelineMapping;\n var didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping);\n var segment = segmentInfo.segment;\n\n if (didCalculateSegmentTimeMapping) {\n this.saveDiscontinuitySyncInfo_(segmentInfo); // If the playlist does not have sync information yet, record that information\n // now with segment timing information\n\n if (!segmentInfo.playlist.syncInfo) {\n segmentInfo.playlist.syncInfo = {\n mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex,\n time: segment.start\n };\n }\n }\n\n var dateTime = segment.dateTimeObject;\n\n if (segment.discontinuity && shouldSaveTimelineMapping && dateTime) {\n this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1000);\n }\n };\n\n _proto.timestampOffsetForTimeline = function timestampOffsetForTimeline(timeline) {\n if (typeof this.timelines[timeline] === 'undefined') {\n return null;\n }\n\n return this.timelines[timeline].time;\n };\n\n _proto.mappingForTimeline = function mappingForTimeline(timeline) {\n if (typeof this.timelines[timeline] === 'undefined') {\n return null;\n }\n\n return this.timelines[timeline].mapping;\n }\n /**\n * Use the \"media time\" for a segment to generate a mapping to \"display time\" and\n * save that display time to the segment.\n *\n * @private\n * @param {SegmentInfo} segmentInfo\n * The current active request information\n * @param {Object} timingInfo\n * The start and end time of the current segment in \"media time\"\n * @param {boolean} shouldSaveTimelineMapping\n * If there's a timeline change, determines if the timeline mapping should be\n * saved in timelines.\n * @return {boolean}\n * Returns false if segment time mapping could not be calculated\n */\n ;\n\n _proto.calculateSegmentTimeMapping_ = function calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) {\n // TODO: remove side effects\n var segment = segmentInfo.segment;\n var part = segmentInfo.part;\n var mappingObj = this.timelines[segmentInfo.timeline];\n var start;\n var end;\n\n if (typeof segmentInfo.timestampOffset === 'number') {\n mappingObj = {\n time: segmentInfo.startOfSegment,\n mapping: segmentInfo.startOfSegment - timingInfo.start\n };\n\n if (shouldSaveTimelineMapping) {\n this.timelines[segmentInfo.timeline] = mappingObj;\n this.trigger('timestampoffset');\n this.logger_(\"time mapping for timeline \" + segmentInfo.timeline + \": \" + (\"[time: \" + mappingObj.time + \"] [mapping: \" + mappingObj.mapping + \"]\"));\n }\n\n start = segmentInfo.startOfSegment;\n end = timingInfo.end + mappingObj.mapping;\n } else if (mappingObj) {\n start = timingInfo.start + mappingObj.mapping;\n end = timingInfo.end + mappingObj.mapping;\n } else {\n return false;\n }\n\n if (part) {\n part.start = start;\n part.end = end;\n } // If we don't have a segment start yet or the start value we got\n // is less than our current segment.start value, save a new start value.\n // We have to do this because parts will have segment timing info saved\n // multiple times and we want segment start to be the earliest part start\n // value for that segment.\n\n\n if (!segment.start || start < segment.start) {\n segment.start = start;\n }\n\n segment.end = end;\n return true;\n }\n /**\n * Each time we have discontinuity in the playlist, attempt to calculate the location\n * in display of the start of the discontinuity and save that. We also save an accuracy\n * value so that we save values with the most accuracy (closest to 0.)\n *\n * @private\n * @param {SegmentInfo} segmentInfo - The current active request information\n */\n ;\n\n _proto.saveDiscontinuitySyncInfo_ = function saveDiscontinuitySyncInfo_(segmentInfo) {\n var playlist = segmentInfo.playlist;\n var segment = segmentInfo.segment; // If the current segment is a discontinuity then we know exactly where\n // the start of the range and it's accuracy is 0 (greater accuracy values\n // mean more approximation)\n\n if (segment.discontinuity) {\n this.discontinuities[segment.timeline] = {\n time: segment.start,\n accuracy: 0\n };\n } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {\n // Search for future discontinuities that we can provide better timing\n // information for and save that information for sync purposes\n for (var i = 0; i < playlist.discontinuityStarts.length; i++) {\n var segmentIndex = playlist.discontinuityStarts[i];\n var discontinuity = playlist.discontinuitySequence + i + 1;\n var mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;\n var accuracy = Math.abs(mediaIndexDiff);\n\n if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {\n var time = void 0;\n\n if (mediaIndexDiff < 0) {\n time = segment.start - sumDurations({\n defaultDuration: playlist.targetDuration,\n durationList: playlist.segments,\n startIndex: segmentInfo.mediaIndex,\n endIndex: segmentIndex\n });\n } else {\n time = segment.end + sumDurations({\n defaultDuration: playlist.targetDuration,\n durationList: playlist.segments,\n startIndex: segmentInfo.mediaIndex + 1,\n endIndex: segmentIndex\n });\n }\n\n this.discontinuities[discontinuity] = {\n time: time,\n accuracy: accuracy\n };\n }\n }\n }\n };\n\n _proto.dispose = function dispose() {\n this.trigger('dispose');\n this.off();\n };\n\n return SyncController;\n}(videojs.EventTarget);\n/**\n * The TimelineChangeController acts as a source for segment loaders to listen for and\n * keep track of latest and pending timeline changes. This is useful to ensure proper\n * sync, as each loader may need to make a consideration for what timeline the other\n * loader is on before making changes which could impact the other loader's media.\n *\n * @class TimelineChangeController\n * @extends videojs.EventTarget\n */\n\n\nvar video_es_TimelineChangeController = /*#__PURE__*/function (_videojs$EventTarget) {\n inheritsLoose_default()(TimelineChangeController, _videojs$EventTarget);\n\n function TimelineChangeController() {\n var _this;\n\n _this = _videojs$EventTarget.call(this) || this;\n _this.pendingTimelineChanges_ = {};\n _this.lastTimelineChanges_ = {};\n return _this;\n }\n\n var _proto = TimelineChangeController.prototype;\n\n _proto.clearPendingTimelineChange = function clearPendingTimelineChange(type) {\n this.pendingTimelineChanges_[type] = null;\n this.trigger('pendingtimelinechange');\n };\n\n _proto.pendingTimelineChange = function pendingTimelineChange(_ref) {\n var type = _ref.type,\n from = _ref.from,\n to = _ref.to;\n\n if (typeof from === 'number' && typeof to === 'number') {\n this.pendingTimelineChanges_[type] = {\n type: type,\n from: from,\n to: to\n };\n this.trigger('pendingtimelinechange');\n }\n\n return this.pendingTimelineChanges_[type];\n };\n\n _proto.lastTimelineChange = function lastTimelineChange(_ref2) {\n var type = _ref2.type,\n from = _ref2.from,\n to = _ref2.to;\n\n if (typeof from === 'number' && typeof to === 'number') {\n this.lastTimelineChanges_[type] = {\n type: type,\n from: from,\n to: to\n };\n delete this.pendingTimelineChanges_[type];\n this.trigger('timelinechange');\n }\n\n return this.lastTimelineChanges_[type];\n };\n\n _proto.dispose = function dispose() {\n this.trigger('dispose');\n this.pendingTimelineChanges_ = {};\n this.lastTimelineChanges_ = {};\n this.off();\n };\n\n return TimelineChangeController;\n}(videojs.EventTarget);\n/* rollup-plugin-worker-factory start for worker!/Users/bcasey/Projects/videojs-http-streaming/src/decrypter-worker.js */\n\n\nvar workerCode = transform(getWorkerString(function () {\n function createCommonjsModule(fn, basedir, module) {\n return module = {\n path: basedir,\n exports: {},\n require: function require(path, base) {\n return commonjsRequire(path, base === undefined || base === null ? module.path : base);\n }\n }, fn(module, module.exports), module.exports;\n }\n\n function commonjsRequire() {\n throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');\n }\n\n var createClass = createCommonjsModule(function (module) {\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n module.exports = _createClass;\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n });\n var setPrototypeOf = createCommonjsModule(function (module) {\n function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _setPrototypeOf(o, p);\n }\n\n module.exports = _setPrototypeOf;\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n });\n var inheritsLoose = createCommonjsModule(function (module) {\n function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n }\n\n module.exports = _inheritsLoose;\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n });\n /**\n * @file stream.js\n */\n\n /**\n * A lightweight readable stream implemention that handles event dispatching.\n *\n * @class Stream\n */\n\n var Stream = /*#__PURE__*/function () {\n function Stream() {\n this.listeners = {};\n }\n /**\n * Add a listener for a specified event type.\n *\n * @param {string} type the event name\n * @param {Function} listener the callback to be invoked when an event of\n * the specified type occurs\n */\n\n\n var _proto = Stream.prototype;\n\n _proto.on = function on(type, listener) {\n if (!this.listeners[type]) {\n this.listeners[type] = [];\n }\n\n this.listeners[type].push(listener);\n }\n /**\n * Remove a listener for a specified event type.\n *\n * @param {string} type the event name\n * @param {Function} listener a function previously registered for this\n * type of event through `on`\n * @return {boolean} if we could turn it off or not\n */\n ;\n\n _proto.off = function off(type, listener) {\n if (!this.listeners[type]) {\n return false;\n }\n\n var index = this.listeners[type].indexOf(listener); // TODO: which is better?\n // In Video.js we slice listener functions\n // on trigger so that it does not mess up the order\n // while we loop through.\n //\n // Here we slice on off so that the loop in trigger\n // can continue using it's old reference to loop without\n // messing up the order.\n\n this.listeners[type] = this.listeners[type].slice(0);\n this.listeners[type].splice(index, 1);\n return index > -1;\n }\n /**\n * Trigger an event of the specified type on this stream. Any additional\n * arguments to this function are passed as parameters to event listeners.\n *\n * @param {string} type the event name\n */\n ;\n\n _proto.trigger = function trigger(type) {\n var callbacks = this.listeners[type];\n\n if (!callbacks) {\n return;\n } // Slicing the arguments on every invocation of this method\n // can add a significant amount of overhead. Avoid the\n // intermediate object creation for the common case of a\n // single callback argument\n\n\n if (arguments.length === 2) {\n var length = callbacks.length;\n\n for (var i = 0; i < length; ++i) {\n callbacks[i].call(this, arguments[1]);\n }\n } else {\n var args = Array.prototype.slice.call(arguments, 1);\n var _length = callbacks.length;\n\n for (var _i = 0; _i < _length; ++_i) {\n callbacks[_i].apply(this, args);\n }\n }\n }\n /**\n * Destroys the stream and cleans up.\n */\n ;\n\n _proto.dispose = function dispose() {\n this.listeners = {};\n }\n /**\n * Forwards all `data` events on this stream to the destination stream. The\n * destination stream should provide a method `push` to receive the data\n * events as they arrive.\n *\n * @param {Stream} destination the stream that will receive all `data` events\n * @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n */\n ;\n\n _proto.pipe = function pipe(destination) {\n this.on('data', function (data) {\n destination.push(data);\n });\n };\n\n return Stream;\n }();\n /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */\n\n /**\n * Returns the subarray of a Uint8Array without PKCS#7 padding.\n *\n * @param padded {Uint8Array} unencrypted bytes that have been padded\n * @return {Uint8Array} the unpadded bytes\n * @see http://tools.ietf.org/html/rfc5652\n */\n\n\n function unpad(padded) {\n return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);\n }\n /*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */\n\n /**\n * @file aes.js\n *\n * This file contains an adaptation of the AES decryption algorithm\n * from the Standford Javascript Cryptography Library. That work is\n * covered by the following copyright and permissions notice:\n *\n * Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation\n * are those of the authors and should not be interpreted as representing\n * official policies, either expressed or implied, of the authors.\n */\n\n /**\n * Expand the S-box tables.\n *\n * @private\n */\n\n\n var precompute = function precompute() {\n var tables = [[[], [], [], [], []], [[], [], [], [], []]];\n var encTable = tables[0];\n var decTable = tables[1];\n var sbox = encTable[4];\n var sboxInv = decTable[4];\n var i;\n var x;\n var xInv;\n var d = [];\n var th = [];\n var x2;\n var x4;\n var x8;\n var s;\n var tEnc;\n var tDec; // Compute double and third tables\n\n for (i = 0; i < 256; i++) {\n th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n }\n\n for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n // Compute sbox\n s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n sbox[x] = s;\n sboxInv[s] = x; // Compute MixColumns\n\n x8 = d[x4 = d[x2 = d[x]]];\n tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n tEnc = d[s] * 0x101 ^ s * 0x1010100;\n\n for (i = 0; i < 4; i++) {\n encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n }\n } // Compactify. Considerable speedup on Firefox.\n\n\n for (i = 0; i < 5; i++) {\n encTable[i] = encTable[i].slice(0);\n decTable[i] = decTable[i].slice(0);\n }\n\n return tables;\n };\n\n var aesTables = null;\n /**\n * Schedule out an AES key for both encryption and decryption. This\n * is a low-level class. Use a cipher mode to do bulk encryption.\n *\n * @class AES\n * @param key {Array} The key as an array of 4, 6 or 8 words.\n */\n\n var AES = /*#__PURE__*/function () {\n function AES(key) {\n /**\n * The expanded S-box and inverse S-box tables. These will be computed\n * on the client so that we don't have to send them down the wire.\n *\n * There are two tables, _tables[0] is for encryption and\n * _tables[1] is for decryption.\n *\n * The first 4 sub-tables are the expanded S-box with MixColumns. The\n * last (_tables[01][4]) is the S-box itself.\n *\n * @private\n */\n // if we have yet to precompute the S-box tables\n // do so now\n if (!aesTables) {\n aesTables = precompute();\n } // then make a copy of that object for use\n\n\n this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];\n var i;\n var j;\n var tmp;\n var sbox = this._tables[0][4];\n var decTable = this._tables[1];\n var keyLen = key.length;\n var rcon = 1;\n\n if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {\n throw new Error('Invalid aes key size');\n }\n\n var encKey = key.slice(0);\n var decKey = [];\n this._key = [encKey, decKey]; // schedule encryption keys\n\n for (i = keyLen; i < 4 * keyLen + 28; i++) {\n tmp = encKey[i - 1]; // apply sbox\n\n if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {\n tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255]; // shift rows and add rcon\n\n if (i % keyLen === 0) {\n tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;\n rcon = rcon << 1 ^ (rcon >> 7) * 283;\n }\n }\n\n encKey[i] = encKey[i - keyLen] ^ tmp;\n } // schedule decryption keys\n\n\n for (j = 0; i; j++, i--) {\n tmp = encKey[j & 3 ? i : i - 4];\n\n if (i <= 4 || j < 4) {\n decKey[j] = tmp;\n } else {\n decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];\n }\n }\n }\n /**\n * Decrypt 16 bytes, specified as four 32-bit words.\n *\n * @param {number} encrypted0 the first word to decrypt\n * @param {number} encrypted1 the second word to decrypt\n * @param {number} encrypted2 the third word to decrypt\n * @param {number} encrypted3 the fourth word to decrypt\n * @param {Int32Array} out the array to write the decrypted words\n * into\n * @param {number} offset the offset into the output array to start\n * writing results\n * @return {Array} The plaintext.\n */\n\n\n var _proto = AES.prototype;\n\n _proto.decrypt = function decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {\n var key = this._key[1]; // state variables a,b,c,d are loaded with pre-whitened data\n\n var a = encrypted0 ^ key[0];\n var b = encrypted3 ^ key[1];\n var c = encrypted2 ^ key[2];\n var d = encrypted1 ^ key[3];\n var a2;\n var b2;\n var c2; // key.length === 2 ?\n\n var nInnerRounds = key.length / 4 - 2;\n var i;\n var kIndex = 4;\n var table = this._tables[1]; // load up the tables\n\n var table0 = table[0];\n var table1 = table[1];\n var table2 = table[2];\n var table3 = table[3];\n var sbox = table[4]; // Inner rounds. Cribbed from OpenSSL.\n\n for (i = 0; i < nInnerRounds; i++) {\n a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];\n b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];\n c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];\n d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];\n kIndex += 4;\n a = a2;\n b = b2;\n c = c2;\n } // Last round.\n\n\n for (i = 0; i < 4; i++) {\n out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];\n a2 = a;\n a = b;\n b = c;\n c = d;\n d = a2;\n }\n };\n\n return AES;\n }();\n /**\n * A wrapper around the Stream class to use setTimeout\n * and run stream \"jobs\" Asynchronously\n *\n * @class AsyncStream\n * @extends Stream\n */\n\n\n var AsyncStream = /*#__PURE__*/function (_Stream) {\n inheritsLoose(AsyncStream, _Stream);\n\n function AsyncStream() {\n var _this;\n\n _this = _Stream.call(this, Stream) || this;\n _this.jobs = [];\n _this.delay = 1;\n _this.timeout_ = null;\n return _this;\n }\n /**\n * process an async job\n *\n * @private\n */\n\n\n var _proto = AsyncStream.prototype;\n\n _proto.processJob_ = function processJob_() {\n this.jobs.shift()();\n\n if (this.jobs.length) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n } else {\n this.timeout_ = null;\n }\n }\n /**\n * push a job into the stream\n *\n * @param {Function} job the job to push into the stream\n */\n ;\n\n _proto.push = function push(job) {\n this.jobs.push(job);\n\n if (!this.timeout_) {\n this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);\n }\n };\n\n return AsyncStream;\n }(Stream);\n /**\n * Convert network-order (big-endian) bytes into their little-endian\n * representation.\n */\n\n\n var ntoh = function ntoh(word) {\n return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;\n };\n /**\n * Decrypt bytes using AES-128 with CBC and PKCS#7 padding.\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * use for the first round of CBC.\n * @return {Uint8Array} the decrypted bytes\n *\n * @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard\n * @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29\n * @see https://tools.ietf.org/html/rfc2315\n */\n\n\n var decrypt = function decrypt(encrypted, key, initVector) {\n // word-level access to the encrypted bytes\n var encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);\n var decipher = new AES(Array.prototype.slice.call(key)); // byte and word-level access for the decrypted output\n\n var decrypted = new Uint8Array(encrypted.byteLength);\n var decrypted32 = new Int32Array(decrypted.buffer); // temporary variables for working with the IV, encrypted, and\n // decrypted data\n\n var init0;\n var init1;\n var init2;\n var init3;\n var encrypted0;\n var encrypted1;\n var encrypted2;\n var encrypted3; // iteration variable\n\n var wordIx; // pull out the words of the IV to ensure we don't modify the\n // passed-in reference and easier access\n\n init0 = initVector[0];\n init1 = initVector[1];\n init2 = initVector[2];\n init3 = initVector[3]; // decrypt four word sequences, applying cipher-block chaining (CBC)\n // to each decrypted block\n\n for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {\n // convert big-endian (network order) words into little-endian\n // (javascript order)\n encrypted0 = ntoh(encrypted32[wordIx]);\n encrypted1 = ntoh(encrypted32[wordIx + 1]);\n encrypted2 = ntoh(encrypted32[wordIx + 2]);\n encrypted3 = ntoh(encrypted32[wordIx + 3]); // decrypt the block\n\n decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx); // XOR with the IV, and restore network byte-order to obtain the\n // plaintext\n\n decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);\n decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);\n decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);\n decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3); // setup the IV for the next round\n\n init0 = encrypted0;\n init1 = encrypted1;\n init2 = encrypted2;\n init3 = encrypted3;\n }\n\n return decrypted;\n };\n /**\n * The `Decrypter` class that manages decryption of AES\n * data through `AsyncStream` objects and the `decrypt`\n * function\n *\n * @param {Uint8Array} encrypted the encrypted bytes\n * @param {Uint32Array} key the bytes of the decryption key\n * @param {Uint32Array} initVector the initialization vector (IV) to\n * @param {Function} done the function to run when done\n * @class Decrypter\n */\n\n\n var Decrypter = /*#__PURE__*/function () {\n function Decrypter(encrypted, key, initVector, done) {\n var step = Decrypter.STEP;\n var encrypted32 = new Int32Array(encrypted.buffer);\n var decrypted = new Uint8Array(encrypted.byteLength);\n var i = 0;\n this.asyncStream_ = new AsyncStream(); // split up the encryption job and do the individual chunks asynchronously\n\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n\n for (i = step; i < encrypted32.length; i += step) {\n initVector = new Uint32Array([ntoh(encrypted32[i - 4]), ntoh(encrypted32[i - 3]), ntoh(encrypted32[i - 2]), ntoh(encrypted32[i - 1])]);\n this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));\n } // invoke the done() callback when everything is finished\n\n\n this.asyncStream_.push(function () {\n // remove pkcs#7 padding from the decrypted bytes\n done(null, unpad(decrypted));\n });\n }\n /**\n * a getter for step the maximum number of bytes to process at one time\n *\n * @return {number} the value of step 32000\n */\n\n\n var _proto = Decrypter.prototype;\n /**\n * @private\n */\n\n _proto.decryptChunk_ = function decryptChunk_(encrypted, key, initVector, decrypted) {\n return function () {\n var bytes = decrypt(encrypted, key, initVector);\n decrypted.set(bytes, encrypted.byteOffset);\n };\n };\n\n createClass(Decrypter, null, [{\n key: \"STEP\",\n get: function get() {\n // 4 * 8000;\n return 32000;\n }\n }]);\n return Decrypter;\n }();\n /**\n * @file bin-utils.js\n */\n\n /**\n * Creates an object for sending to a web worker modifying properties that are TypedArrays\n * into a new object with seperated properties for the buffer, byteOffset, and byteLength.\n *\n * @param {Object} message\n * Object of properties and values to send to the web worker\n * @return {Object}\n * Modified message with TypedArray values expanded\n * @function createTransferableMessage\n */\n\n\n var createTransferableMessage = function createTransferableMessage(message) {\n var transferable = {};\n Object.keys(message).forEach(function (key) {\n var value = message[key];\n\n if (ArrayBuffer.isView(value)) {\n transferable[key] = {\n bytes: value.buffer,\n byteOffset: value.byteOffset,\n byteLength: value.byteLength\n };\n } else {\n transferable[key] = value;\n }\n });\n return transferable;\n };\n /* global self */\n\n /**\n * Our web worker interface so that things can talk to aes-decrypter\n * that will be running in a web worker. the scope is passed to this by\n * webworkify.\n */\n\n\n self.onmessage = function (event) {\n var data = event.data;\n var encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);\n var key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);\n var iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);\n /* eslint-disable no-new, handle-callback-err */\n\n new Decrypter(encrypted, key, iv, function (err, bytes) {\n self.postMessage(createTransferableMessage({\n source: data.source,\n decrypted: bytes\n }), [bytes.buffer]);\n });\n /* eslint-enable */\n };\n}));\nvar Decrypter = factory(workerCode);\n/* rollup-plugin-worker-factory end for worker!/Users/bcasey/Projects/videojs-http-streaming/src/decrypter-worker.js */\n\n/**\n * Convert the properties of an HLS track into an audioTrackKind.\n *\n * @private\n */\n\nvar audioTrackKind_ = function audioTrackKind_(properties) {\n var kind = properties[\"default\"] ? 'main' : 'alternative';\n\n if (properties.characteristics && properties.characteristics.indexOf('public.accessibility.describes-video') >= 0) {\n kind = 'main-desc';\n }\n\n return kind;\n};\n/**\n * Pause provided segment loader and playlist loader if active\n *\n * @param {SegmentLoader} segmentLoader\n * SegmentLoader to pause\n * @param {Object} mediaType\n * Active media type\n * @function stopLoaders\n */\n\n\nvar stopLoaders = function stopLoaders(segmentLoader, mediaType) {\n segmentLoader.abort();\n segmentLoader.pause();\n\n if (mediaType && mediaType.activePlaylistLoader) {\n mediaType.activePlaylistLoader.pause();\n mediaType.activePlaylistLoader = null;\n }\n};\n/**\n * Start loading provided segment loader and playlist loader\n *\n * @param {PlaylistLoader} playlistLoader\n * PlaylistLoader to start loading\n * @param {Object} mediaType\n * Active media type\n * @function startLoaders\n */\n\n\nvar startLoaders = function startLoaders(playlistLoader, mediaType) {\n // Segment loader will be started after `loadedmetadata` or `loadedplaylist` from the\n // playlist loader\n mediaType.activePlaylistLoader = playlistLoader;\n playlistLoader.load();\n};\n/**\n * Returns a function to be called when the media group changes. It performs a\n * non-destructive (preserve the buffer) resync of the SegmentLoader. This is because a\n * change of group is merely a rendition switch of the same content at another encoding,\n * rather than a change of content, such as switching audio from English to Spanish.\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Handler for a non-destructive resync of SegmentLoader when the active media\n * group changes.\n * @function onGroupChanged\n */\n\n\nvar onGroupChanged = function onGroupChanged(type, settings) {\n return function () {\n var _settings$segmentLoad = settings.segmentLoaders,\n segmentLoader = _settings$segmentLoad[type],\n mainSegmentLoader = _settings$segmentLoad.main,\n mediaType = settings.mediaTypes[type];\n var activeTrack = mediaType.activeTrack();\n var activeGroup = mediaType.getActiveGroup();\n var previousActiveLoader = mediaType.activePlaylistLoader;\n var lastGroup = mediaType.lastGroup_; // the group did not change do nothing\n\n if (activeGroup && lastGroup && activeGroup.id === lastGroup.id) {\n return;\n }\n\n mediaType.lastGroup_ = activeGroup;\n mediaType.lastTrack_ = activeTrack;\n stopLoaders(segmentLoader, mediaType);\n\n if (!activeGroup || activeGroup.isMasterPlaylist) {\n // there is no group active or active group is a main playlist and won't change\n return;\n }\n\n if (!activeGroup.playlistLoader) {\n if (previousActiveLoader) {\n // The previous group had a playlist loader but the new active group does not\n // this means we are switching from demuxed to muxed audio. In this case we want to\n // do a destructive reset of the main segment loader and not restart the audio\n // loaders.\n mainSegmentLoader.resetEverything();\n }\n\n return;\n } // Non-destructive resync\n\n\n segmentLoader.resyncLoader();\n startLoaders(activeGroup.playlistLoader, mediaType);\n };\n};\n\nvar onGroupChanging = function onGroupChanging(type, settings) {\n return function () {\n var segmentLoader = settings.segmentLoaders[type],\n mediaType = settings.mediaTypes[type];\n mediaType.lastGroup_ = null;\n segmentLoader.abort();\n segmentLoader.pause();\n };\n};\n/**\n * Returns a function to be called when the media track changes. It performs a\n * destructive reset of the SegmentLoader to ensure we start loading as close to\n * currentTime as possible.\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Handler for a destructive reset of SegmentLoader when the active media\n * track changes.\n * @function onTrackChanged\n */\n\n\nvar onTrackChanged = function onTrackChanged(type, settings) {\n return function () {\n var masterPlaylistLoader = settings.masterPlaylistLoader,\n _settings$segmentLoad2 = settings.segmentLoaders,\n segmentLoader = _settings$segmentLoad2[type],\n mainSegmentLoader = _settings$segmentLoad2.main,\n mediaType = settings.mediaTypes[type];\n var activeTrack = mediaType.activeTrack();\n var activeGroup = mediaType.getActiveGroup();\n var previousActiveLoader = mediaType.activePlaylistLoader;\n var lastTrack = mediaType.lastTrack_; // track did not change, do nothing\n\n if (lastTrack && activeTrack && lastTrack.id === activeTrack.id) {\n return;\n }\n\n mediaType.lastGroup_ = activeGroup;\n mediaType.lastTrack_ = activeTrack;\n stopLoaders(segmentLoader, mediaType);\n\n if (!activeGroup) {\n // there is no group active so we do not want to restart loaders\n return;\n }\n\n if (activeGroup.isMasterPlaylist) {\n // track did not change, do nothing\n if (!activeTrack || !lastTrack || activeTrack.id === lastTrack.id) {\n return;\n }\n\n var mpc = settings.vhs.masterPlaylistController_;\n var newPlaylist = mpc.selectPlaylist(); // media will not change do nothing\n\n if (mpc.media() === newPlaylist) {\n return;\n }\n\n mediaType.logger_(\"track change. Switching master audio from \" + lastTrack.id + \" to \" + activeTrack.id);\n masterPlaylistLoader.pause();\n mainSegmentLoader.resetEverything();\n mpc.fastQualityChange_(newPlaylist);\n return;\n }\n\n if (type === 'AUDIO') {\n if (!activeGroup.playlistLoader) {\n // when switching from demuxed audio/video to muxed audio/video (noted by no\n // playlist loader for the audio group), we want to do a destructive reset of the\n // main segment loader and not restart the audio loaders\n mainSegmentLoader.setAudio(true); // don't have to worry about disabling the audio of the audio segment loader since\n // it should be stopped\n\n mainSegmentLoader.resetEverything();\n return;\n } // although the segment loader is an audio segment loader, call the setAudio\n // function to ensure it is prepared to re-append the init segment (or handle other\n // config changes)\n\n\n segmentLoader.setAudio(true);\n mainSegmentLoader.setAudio(false);\n }\n\n if (previousActiveLoader === activeGroup.playlistLoader) {\n // Nothing has actually changed. This can happen because track change events can fire\n // multiple times for a \"single\" change. One for enabling the new active track, and\n // one for disabling the track that was active\n startLoaders(activeGroup.playlistLoader, mediaType);\n return;\n }\n\n if (segmentLoader.track) {\n // For WebVTT, set the new text track in the segmentloader\n segmentLoader.track(activeTrack);\n } // destructive reset\n\n\n segmentLoader.resetEverything();\n startLoaders(activeGroup.playlistLoader, mediaType);\n };\n};\n\nvar onError = {\n /**\n * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n * an error.\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Error handler. Logs warning (or error if the playlist is blacklisted) to\n * console and switches back to default audio track.\n * @function onError.AUDIO\n */\n AUDIO: function AUDIO(type, settings) {\n return function () {\n var segmentLoader = settings.segmentLoaders[type],\n mediaType = settings.mediaTypes[type],\n blacklistCurrentPlaylist = settings.blacklistCurrentPlaylist;\n stopLoaders(segmentLoader, mediaType); // switch back to default audio track\n\n var activeTrack = mediaType.activeTrack();\n var activeGroup = mediaType.activeGroup();\n var id = (activeGroup.filter(function (group) {\n return group[\"default\"];\n })[0] || activeGroup[0]).id;\n var defaultTrack = mediaType.tracks[id];\n\n if (activeTrack === defaultTrack) {\n // Default track encountered an error. All we can do now is blacklist the current\n // rendition and hope another will switch audio groups\n blacklistCurrentPlaylist({\n message: 'Problem encountered loading the default audio track.'\n });\n return;\n }\n\n videojs.log.warn('Problem encountered loading the alternate audio track.' + 'Switching back to default.');\n\n for (var trackId in mediaType.tracks) {\n mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;\n }\n\n mediaType.onTrackChanged();\n };\n },\n\n /**\n * Returns a function to be called when a SegmentLoader or PlaylistLoader encounters\n * an error.\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Error handler. Logs warning to console and disables the active subtitle track\n * @function onError.SUBTITLES\n */\n SUBTITLES: function SUBTITLES(type, settings) {\n return function () {\n var segmentLoader = settings.segmentLoaders[type],\n mediaType = settings.mediaTypes[type];\n videojs.log.warn('Problem encountered loading the subtitle track.' + 'Disabling subtitle track.');\n stopLoaders(segmentLoader, mediaType);\n var track = mediaType.activeTrack();\n\n if (track) {\n track.mode = 'disabled';\n }\n\n mediaType.onTrackChanged();\n };\n }\n};\nvar setupListeners = {\n /**\n * Setup event listeners for audio playlist loader\n *\n * @param {string} type\n * MediaGroup type\n * @param {PlaylistLoader|null} playlistLoader\n * PlaylistLoader to register listeners on\n * @param {Object} settings\n * Object containing required information for media groups\n * @function setupListeners.AUDIO\n */\n AUDIO: function AUDIO(type, playlistLoader, settings) {\n if (!playlistLoader) {\n // no playlist loader means audio will be muxed with the video\n return;\n }\n\n var tech = settings.tech,\n requestOptions = settings.requestOptions,\n segmentLoader = settings.segmentLoaders[type];\n playlistLoader.on('loadedmetadata', function () {\n var media = playlistLoader.media();\n segmentLoader.playlist(media, requestOptions); // if the video is already playing, or if this isn't a live video and preload\n // permits, start downloading segments\n\n if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n segmentLoader.load();\n }\n });\n playlistLoader.on('loadedplaylist', function () {\n segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n if (!tech.paused()) {\n segmentLoader.load();\n }\n });\n playlistLoader.on('error', onError[type](type, settings));\n },\n\n /**\n * Setup event listeners for subtitle playlist loader\n *\n * @param {string} type\n * MediaGroup type\n * @param {PlaylistLoader|null} playlistLoader\n * PlaylistLoader to register listeners on\n * @param {Object} settings\n * Object containing required information for media groups\n * @function setupListeners.SUBTITLES\n */\n SUBTITLES: function SUBTITLES(type, playlistLoader, settings) {\n var tech = settings.tech,\n requestOptions = settings.requestOptions,\n segmentLoader = settings.segmentLoaders[type],\n mediaType = settings.mediaTypes[type];\n playlistLoader.on('loadedmetadata', function () {\n var media = playlistLoader.media();\n segmentLoader.playlist(media, requestOptions);\n segmentLoader.track(mediaType.activeTrack()); // if the video is already playing, or if this isn't a live video and preload\n // permits, start downloading segments\n\n if (!tech.paused() || media.endList && tech.preload() !== 'none') {\n segmentLoader.load();\n }\n });\n playlistLoader.on('loadedplaylist', function () {\n segmentLoader.playlist(playlistLoader.media(), requestOptions); // If the player isn't paused, ensure that the segment loader is running\n\n if (!tech.paused()) {\n segmentLoader.load();\n }\n });\n playlistLoader.on('error', onError[type](type, settings));\n }\n};\nvar initialize = {\n /**\n * Setup PlaylistLoaders and AudioTracks for the audio groups\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize.AUDIO\n */\n 'AUDIO': function AUDIO(type, settings) {\n var vhs = settings.vhs,\n sourceType = settings.sourceType,\n segmentLoader = settings.segmentLoaders[type],\n requestOptions = settings.requestOptions,\n mediaGroups = settings.master.mediaGroups,\n _settings$mediaTypes$ = settings.mediaTypes[type],\n groups = _settings$mediaTypes$.groups,\n tracks = _settings$mediaTypes$.tracks,\n logger_ = _settings$mediaTypes$.logger_,\n masterPlaylistLoader = settings.masterPlaylistLoader;\n var audioOnlyMaster = video_es_isAudioOnly(masterPlaylistLoader.master); // force a default if we have none\n\n if (!mediaGroups[type] || Object.keys(mediaGroups[type]).length === 0) {\n mediaGroups[type] = {\n main: {\n \"default\": {\n \"default\": true\n }\n }\n };\n\n if (audioOnlyMaster) {\n mediaGroups[type].main[\"default\"].playlists = masterPlaylistLoader.master.playlists;\n }\n }\n\n for (var groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n }\n\n for (var variantLabel in mediaGroups[type][groupId]) {\n var properties = mediaGroups[type][groupId][variantLabel];\n var playlistLoader = void 0;\n\n if (audioOnlyMaster) {\n logger_(\"AUDIO group '\" + groupId + \"' label '\" + variantLabel + \"' is a master playlist\");\n properties.isMasterPlaylist = true;\n playlistLoader = null; // if vhs-json was provided as the source, and the media playlist was resolved,\n // use the resolved media playlist object\n } else if (sourceType === 'vhs-json' && properties.playlists) {\n playlistLoader = new video_es_PlaylistLoader(properties.playlists[0], vhs, requestOptions);\n } else if (properties.resolvedUri) {\n playlistLoader = new video_es_PlaylistLoader(properties.resolvedUri, vhs, requestOptions); // TODO: dash isn't the only type with properties.playlists\n // should we even have properties.playlists in this check.\n } else if (properties.playlists && sourceType === 'dash') {\n playlistLoader = new video_es_DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, masterPlaylistLoader);\n } else {\n // no resolvedUri means the audio is muxed with the video when using this\n // audio track\n playlistLoader = null;\n }\n\n properties = videojs.mergeOptions({\n id: variantLabel,\n playlistLoader: playlistLoader\n }, properties);\n setupListeners[type](type, properties.playlistLoader, settings);\n groups[groupId].push(properties);\n\n if (typeof tracks[variantLabel] === 'undefined') {\n var track = new videojs.AudioTrack({\n id: variantLabel,\n kind: audioTrackKind_(properties),\n enabled: false,\n language: properties.language,\n \"default\": properties[\"default\"],\n label: variantLabel\n });\n tracks[variantLabel] = track;\n }\n }\n } // setup single error event handler for the segment loader\n\n\n segmentLoader.on('error', onError[type](type, settings));\n },\n\n /**\n * Setup PlaylistLoaders and TextTracks for the subtitle groups\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize.SUBTITLES\n */\n 'SUBTITLES': function SUBTITLES(type, settings) {\n var tech = settings.tech,\n vhs = settings.vhs,\n sourceType = settings.sourceType,\n segmentLoader = settings.segmentLoaders[type],\n requestOptions = settings.requestOptions,\n mediaGroups = settings.master.mediaGroups,\n _settings$mediaTypes$2 = settings.mediaTypes[type],\n groups = _settings$mediaTypes$2.groups,\n tracks = _settings$mediaTypes$2.tracks,\n masterPlaylistLoader = settings.masterPlaylistLoader;\n\n for (var groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n }\n\n for (var variantLabel in mediaGroups[type][groupId]) {\n if (mediaGroups[type][groupId][variantLabel].forced) {\n // Subtitle playlists with the forced attribute are not selectable in Safari.\n // According to Apple's HLS Authoring Specification:\n // If content has forced subtitles and regular subtitles in a given language,\n // the regular subtitles track in that language MUST contain both the forced\n // subtitles and the regular subtitles for that language.\n // Because of this requirement and that Safari does not add forced subtitles,\n // forced subtitles are skipped here to maintain consistent experience across\n // all platforms\n continue;\n }\n\n var properties = mediaGroups[type][groupId][variantLabel];\n var playlistLoader = void 0;\n\n if (sourceType === 'hls') {\n playlistLoader = new video_es_PlaylistLoader(properties.resolvedUri, vhs, requestOptions);\n } else if (sourceType === 'dash') {\n var playlists = properties.playlists.filter(function (p) {\n return p.excludeUntil !== Infinity;\n });\n\n if (!playlists.length) {\n return;\n }\n\n playlistLoader = new video_es_DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, masterPlaylistLoader);\n } else if (sourceType === 'vhs-json') {\n playlistLoader = new video_es_PlaylistLoader( // if the vhs-json object included the media playlist, use the media playlist\n // as provided, otherwise use the resolved URI to load the playlist\n properties.playlists ? properties.playlists[0] : properties.resolvedUri, vhs, requestOptions);\n }\n\n properties = videojs.mergeOptions({\n id: variantLabel,\n playlistLoader: playlistLoader\n }, properties);\n setupListeners[type](type, properties.playlistLoader, settings);\n groups[groupId].push(properties);\n\n if (typeof tracks[variantLabel] === 'undefined') {\n var track = tech.addRemoteTextTrack({\n id: variantLabel,\n kind: 'subtitles',\n \"default\": properties[\"default\"] && properties.autoselect,\n language: properties.language,\n label: variantLabel\n }, false).track;\n tracks[variantLabel] = track;\n }\n }\n } // setup single error event handler for the segment loader\n\n\n segmentLoader.on('error', onError[type](type, settings));\n },\n\n /**\n * Setup TextTracks for the closed-caption groups\n *\n * @param {String} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @function initialize['CLOSED-CAPTIONS']\n */\n 'CLOSED-CAPTIONS': function CLOSEDCAPTIONS(type, settings) {\n var tech = settings.tech,\n mediaGroups = settings.master.mediaGroups,\n _settings$mediaTypes$3 = settings.mediaTypes[type],\n groups = _settings$mediaTypes$3.groups,\n tracks = _settings$mediaTypes$3.tracks;\n\n for (var groupId in mediaGroups[type]) {\n if (!groups[groupId]) {\n groups[groupId] = [];\n }\n\n for (var variantLabel in mediaGroups[type][groupId]) {\n var properties = mediaGroups[type][groupId][variantLabel]; // Look for either 608 (CCn) or 708 (SERVICEn) caption services\n\n if (!/^(?:CC|SERVICE)/.test(properties.instreamId)) {\n continue;\n }\n\n var captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};\n var newProps = {\n label: variantLabel,\n language: properties.language,\n instreamId: properties.instreamId,\n \"default\": properties[\"default\"] && properties.autoselect\n };\n\n if (captionServices[newProps.instreamId]) {\n newProps = videojs.mergeOptions(newProps, captionServices[newProps.instreamId]);\n }\n\n if (newProps[\"default\"] === undefined) {\n delete newProps[\"default\"];\n } // No PlaylistLoader is required for Closed-Captions because the captions are\n // embedded within the video stream\n\n\n groups[groupId].push(videojs.mergeOptions({\n id: variantLabel\n }, properties));\n\n if (typeof tracks[variantLabel] === 'undefined') {\n var track = tech.addRemoteTextTrack({\n id: newProps.instreamId,\n kind: 'captions',\n \"default\": newProps[\"default\"],\n language: newProps.language,\n label: newProps.label\n }, false).track;\n tracks[variantLabel] = track;\n }\n }\n }\n }\n};\n\nvar groupMatch = function groupMatch(list, media) {\n for (var i = 0; i < list.length; i++) {\n if (playlistMatch(media, list[i])) {\n return true;\n }\n\n if (list[i].playlists && groupMatch(list[i].playlists, media)) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * Returns a function used to get the active group of the provided type\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media group for the provided type. Takes an\n * optional parameter {TextTrack} track. If no track is provided, a list of all\n * variants in the group, otherwise the variant corresponding to the provided\n * track is returned.\n * @function activeGroup\n */\n\n\nvar activeGroup = function activeGroup(type, settings) {\n return function (track) {\n var masterPlaylistLoader = settings.masterPlaylistLoader,\n groups = settings.mediaTypes[type].groups;\n var media = masterPlaylistLoader.media();\n\n if (!media) {\n return null;\n }\n\n var variants = null; // set to variants to main media active group\n\n if (media.attributes[type]) {\n variants = groups[media.attributes[type]];\n }\n\n var groupKeys = Object.keys(groups);\n\n if (!variants) {\n // find the masterPlaylistLoader media\n // that is in a media group if we are dealing\n // with audio only\n if (type === 'AUDIO' && groupKeys.length > 1 && video_es_isAudioOnly(settings.master)) {\n for (var i = 0; i < groupKeys.length; i++) {\n var groupPropertyList = groups[groupKeys[i]];\n\n if (groupMatch(groupPropertyList, media)) {\n variants = groupPropertyList;\n break;\n }\n } // use the main group if it exists\n\n } else if (groups.main) {\n variants = groups.main; // only one group, use that one\n } else if (groupKeys.length === 1) {\n variants = groups[groupKeys[0]];\n }\n }\n\n if (typeof track === 'undefined') {\n return variants;\n }\n\n if (track === null || !variants) {\n // An active track was specified so a corresponding group is expected. track === null\n // means no track is currently active so there is no corresponding group\n return null;\n }\n\n return variants.filter(function (props) {\n return props.id === track.id;\n })[0] || null;\n };\n};\n\nvar activeTrack = {\n /**\n * Returns a function used to get the active track of type provided\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media track for the provided type. Returns\n * null if no track is active\n * @function activeTrack.AUDIO\n */\n AUDIO: function AUDIO(type, settings) {\n return function () {\n var tracks = settings.mediaTypes[type].tracks;\n\n for (var id in tracks) {\n if (tracks[id].enabled) {\n return tracks[id];\n }\n }\n\n return null;\n };\n },\n\n /**\n * Returns a function used to get the active track of type provided\n *\n * @param {string} type\n * MediaGroup type\n * @param {Object} settings\n * Object containing required information for media groups\n * @return {Function}\n * Function that returns the active media track for the provided type. Returns\n * null if no track is active\n * @function activeTrack.SUBTITLES\n */\n SUBTITLES: function SUBTITLES(type, settings) {\n return function () {\n var tracks = settings.mediaTypes[type].tracks;\n\n for (var id in tracks) {\n if (tracks[id].mode === 'showing' || tracks[id].mode === 'hidden') {\n return tracks[id];\n }\n }\n\n return null;\n };\n }\n};\n\nvar getActiveGroup = function getActiveGroup(type, _ref) {\n var mediaTypes = _ref.mediaTypes;\n return function () {\n var activeTrack_ = mediaTypes[type].activeTrack();\n\n if (!activeTrack_) {\n return null;\n }\n\n return mediaTypes[type].activeGroup(activeTrack_);\n };\n};\n/**\n * Setup PlaylistLoaders and Tracks for media groups (Audio, Subtitles,\n * Closed-Captions) specified in the master manifest.\n *\n * @param {Object} settings\n * Object containing required information for setting up the media groups\n * @param {Tech} settings.tech\n * The tech of the player\n * @param {Object} settings.requestOptions\n * XHR request options used by the segment loaders\n * @param {PlaylistLoader} settings.masterPlaylistLoader\n * PlaylistLoader for the master source\n * @param {VhsHandler} settings.vhs\n * VHS SourceHandler\n * @param {Object} settings.master\n * The parsed master manifest\n * @param {Object} settings.mediaTypes\n * Object to store the loaders, tracks, and utility methods for each media type\n * @param {Function} settings.blacklistCurrentPlaylist\n * Blacklists the current rendition and forces a rendition switch.\n * @function setupMediaGroups\n */\n\n\nvar setupMediaGroups = function setupMediaGroups(settings) {\n ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(function (type) {\n initialize[type](type, settings);\n });\n var mediaTypes = settings.mediaTypes,\n masterPlaylistLoader = settings.masterPlaylistLoader,\n tech = settings.tech,\n vhs = settings.vhs,\n _settings$segmentLoad3 = settings.segmentLoaders,\n audioSegmentLoader = _settings$segmentLoad3['AUDIO'],\n mainSegmentLoader = _settings$segmentLoad3.main; // setup active group and track getters and change event handlers\n\n ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n mediaTypes[type].activeGroup = activeGroup(type, settings);\n mediaTypes[type].activeTrack = activeTrack[type](type, settings);\n mediaTypes[type].onGroupChanged = onGroupChanged(type, settings);\n mediaTypes[type].onGroupChanging = onGroupChanging(type, settings);\n mediaTypes[type].onTrackChanged = onTrackChanged(type, settings);\n mediaTypes[type].getActiveGroup = getActiveGroup(type, settings);\n }); // DO NOT enable the default subtitle or caption track.\n // DO enable the default audio track\n\n var audioGroup = mediaTypes.AUDIO.activeGroup();\n\n if (audioGroup) {\n var groupId = (audioGroup.filter(function (group) {\n return group[\"default\"];\n })[0] || audioGroup[0]).id;\n mediaTypes.AUDIO.tracks[groupId].enabled = true;\n mediaTypes.AUDIO.onGroupChanged();\n mediaTypes.AUDIO.onTrackChanged();\n var activeAudioGroup = mediaTypes.AUDIO.getActiveGroup(); // a similar check for handling setAudio on each loader is run again each time the\n // track is changed, but needs to be handled here since the track may not be considered\n // changed on the first call to onTrackChanged\n\n if (!activeAudioGroup.playlistLoader) {\n // either audio is muxed with video or the stream is audio only\n mainSegmentLoader.setAudio(true);\n } else {\n // audio is demuxed\n mainSegmentLoader.setAudio(false);\n audioSegmentLoader.setAudio(true);\n }\n }\n\n masterPlaylistLoader.on('mediachange', function () {\n ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n return mediaTypes[type].onGroupChanged();\n });\n });\n masterPlaylistLoader.on('mediachanging', function () {\n ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n return mediaTypes[type].onGroupChanging();\n });\n }); // custom audio track change event handler for usage event\n\n var onAudioTrackChanged = function onAudioTrackChanged() {\n mediaTypes.AUDIO.onTrackChanged();\n tech.trigger({\n type: 'usage',\n name: 'vhs-audio-change'\n });\n tech.trigger({\n type: 'usage',\n name: 'hls-audio-change'\n });\n };\n\n tech.audioTracks().addEventListener('change', onAudioTrackChanged);\n tech.remoteTextTracks().addEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n vhs.on('dispose', function () {\n tech.audioTracks().removeEventListener('change', onAudioTrackChanged);\n tech.remoteTextTracks().removeEventListener('change', mediaTypes.SUBTITLES.onTrackChanged);\n }); // clear existing audio tracks and add the ones we just created\n\n tech.clearTracks('audio');\n\n for (var id in mediaTypes.AUDIO.tracks) {\n tech.audioTracks().addTrack(mediaTypes.AUDIO.tracks[id]);\n }\n};\n/**\n * Creates skeleton object used to store the loaders, tracks, and utility methods for each\n * media type\n *\n * @return {Object}\n * Object to store the loaders, tracks, and utility methods for each media type\n * @function createMediaTypes\n */\n\n\nvar createMediaTypes = function createMediaTypes() {\n var mediaTypes = {};\n ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(function (type) {\n mediaTypes[type] = {\n groups: {},\n tracks: {},\n activePlaylistLoader: null,\n activeGroup: video_es_noop,\n activeTrack: video_es_noop,\n getActiveGroup: video_es_noop,\n onGroupChanged: video_es_noop,\n onTrackChanged: video_es_noop,\n lastTrack_: null,\n logger_: logger(\"MediaGroups[\" + type + \"]\")\n };\n });\n return mediaTypes;\n};\n\nvar ABORT_EARLY_BLACKLIST_SECONDS = 60 * 2;\nvar Vhs$1; // SegmentLoader stats that need to have each loader's\n// values summed to calculate the final value\n\nvar loaderStats = ['mediaRequests', 'mediaRequestsAborted', 'mediaRequestsTimedout', 'mediaRequestsErrored', 'mediaTransferDuration', 'mediaBytesTransferred', 'mediaAppends'];\n\nvar sumLoaderStat = function sumLoaderStat(stat) {\n return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];\n};\n\nvar shouldSwitchToMedia = function shouldSwitchToMedia(_ref) {\n var currentPlaylist = _ref.currentPlaylist,\n nextPlaylist = _ref.nextPlaylist,\n forwardBuffer = _ref.forwardBuffer,\n bufferLowWaterLine = _ref.bufferLowWaterLine,\n bufferHighWaterLine = _ref.bufferHighWaterLine,\n duration = _ref.duration,\n experimentalBufferBasedABR = _ref.experimentalBufferBasedABR,\n log = _ref.log; // we have no other playlist to switch to\n\n if (!nextPlaylist) {\n videojs.log.warn('We received no playlist to switch to. Please check your stream.');\n return false;\n }\n\n var sharedLogLine = \"allowing switch \" + (currentPlaylist && currentPlaylist.id || 'null') + \" -> \" + nextPlaylist.id;\n\n if (!currentPlaylist) {\n log(sharedLogLine + \" as current playlist is not set\");\n return true;\n } // no need to switch if playlist is the same\n\n\n if (nextPlaylist.id === currentPlaylist.id) {\n return false;\n } // If the playlist is live, then we want to not take low water line into account.\n // This is because in LIVE, the player plays 3 segments from the end of the\n // playlist, and if `BUFFER_LOW_WATER_LINE` is greater than the duration availble\n // in those segments, a viewer will never experience a rendition upswitch.\n\n\n if (!currentPlaylist.endList) {\n log(sharedLogLine + \" as current playlist is live\");\n return true;\n }\n\n var maxBufferLowWaterLine = experimentalBufferBasedABR ? Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : Config.MAX_BUFFER_LOW_WATER_LINE; // For the same reason as LIVE, we ignore the low water line when the VOD\n // duration is below the max potential low water line\n\n if (duration < maxBufferLowWaterLine) {\n log(sharedLogLine + \" as duration < max low water line (\" + duration + \" < \" + maxBufferLowWaterLine + \")\");\n return true;\n }\n\n var nextBandwidth = nextPlaylist.attributes.BANDWIDTH;\n var currBandwidth = currentPlaylist.attributes.BANDWIDTH; // when switching down, if our buffer is lower than the high water line,\n // we can switch down\n\n if (nextBandwidth < currBandwidth && (!experimentalBufferBasedABR || forwardBuffer < bufferHighWaterLine)) {\n var logLine = sharedLogLine + \" as next bandwidth < current bandwidth (\" + nextBandwidth + \" < \" + currBandwidth + \")\";\n\n if (experimentalBufferBasedABR) {\n logLine += \" and forwardBuffer < bufferHighWaterLine (\" + forwardBuffer + \" < \" + bufferHighWaterLine + \")\";\n }\n\n log(logLine);\n return true;\n } // and if our buffer is higher than the low water line,\n // we can switch up\n\n\n if ((!experimentalBufferBasedABR || nextBandwidth > currBandwidth) && forwardBuffer >= bufferLowWaterLine) {\n var _logLine = sharedLogLine + \" as forwardBuffer >= bufferLowWaterLine (\" + forwardBuffer + \" >= \" + bufferLowWaterLine + \")\";\n\n if (experimentalBufferBasedABR) {\n _logLine += \" and next bandwidth > current bandwidth (\" + nextBandwidth + \" > \" + currBandwidth + \")\";\n }\n\n log(_logLine);\n return true;\n }\n\n log(\"not \" + sharedLogLine + \" as no switching criteria met\");\n return false;\n};\n/**\n * the master playlist controller controller all interactons\n * between playlists and segmentloaders. At this time this mainly\n * involves a master playlist and a series of audio playlists\n * if they are available\n *\n * @class MasterPlaylistController\n * @extends videojs.EventTarget\n */\n\n\nvar video_es_MasterPlaylistController = /*#__PURE__*/function (_videojs$EventTarget) {\n inheritsLoose_default()(MasterPlaylistController, _videojs$EventTarget);\n\n function MasterPlaylistController(options) {\n var _this;\n\n _this = _videojs$EventTarget.call(this) || this;\n var src = options.src,\n handleManifestRedirects = options.handleManifestRedirects,\n withCredentials = options.withCredentials,\n tech = options.tech,\n bandwidth = options.bandwidth,\n externVhs = options.externVhs,\n useCueTags = options.useCueTags,\n blacklistDuration = options.blacklistDuration,\n enableLowInitialPlaylist = options.enableLowInitialPlaylist,\n sourceType = options.sourceType,\n cacheEncryptionKeys = options.cacheEncryptionKeys,\n experimentalBufferBasedABR = options.experimentalBufferBasedABR,\n experimentalLeastPixelDiffSelector = options.experimentalLeastPixelDiffSelector;\n\n if (!src) {\n throw new Error('A non-empty playlist URL or JSON manifest string is required');\n }\n\n var maxPlaylistRetries = options.maxPlaylistRetries;\n\n if (maxPlaylistRetries === null || typeof maxPlaylistRetries === 'undefined') {\n maxPlaylistRetries = Infinity;\n }\n\n Vhs$1 = externVhs;\n _this.experimentalBufferBasedABR = Boolean(experimentalBufferBasedABR);\n _this.experimentalLeastPixelDiffSelector = Boolean(experimentalLeastPixelDiffSelector);\n _this.withCredentials = withCredentials;\n _this.tech_ = tech;\n _this.vhs_ = tech.vhs;\n _this.sourceType_ = sourceType;\n _this.useCueTags_ = useCueTags;\n _this.blacklistDuration = blacklistDuration;\n _this.maxPlaylistRetries = maxPlaylistRetries;\n _this.enableLowInitialPlaylist = enableLowInitialPlaylist;\n\n if (_this.useCueTags_) {\n _this.cueTagsTrack_ = _this.tech_.addTextTrack('metadata', 'ad-cues');\n _this.cueTagsTrack_.inBandMetadataTrackDispatchType = '';\n }\n\n _this.requestOptions_ = {\n withCredentials: withCredentials,\n handleManifestRedirects: handleManifestRedirects,\n maxPlaylistRetries: maxPlaylistRetries,\n timeout: null\n };\n\n _this.on('error', _this.pauseLoading);\n\n _this.mediaTypes_ = createMediaTypes();\n _this.mediaSource = new window_default.a.MediaSource();\n _this.handleDurationChange_ = _this.handleDurationChange_.bind(assertThisInitialized_default()(_this));\n _this.handleSourceOpen_ = _this.handleSourceOpen_.bind(assertThisInitialized_default()(_this));\n _this.handleSourceEnded_ = _this.handleSourceEnded_.bind(assertThisInitialized_default()(_this));\n\n _this.mediaSource.addEventListener('durationchange', _this.handleDurationChange_); // load the media source into the player\n\n\n _this.mediaSource.addEventListener('sourceopen', _this.handleSourceOpen_);\n\n _this.mediaSource.addEventListener('sourceended', _this.handleSourceEnded_); // we don't have to handle sourceclose since dispose will handle termination of\n // everything, and the MediaSource should not be detached without a proper disposal\n\n\n _this.seekable_ = videojs.createTimeRanges();\n _this.hasPlayed_ = false;\n _this.syncController_ = new video_es_SyncController(options);\n _this.segmentMetadataTrack_ = tech.addRemoteTextTrack({\n kind: 'metadata',\n label: 'segment-metadata'\n }, false).track;\n _this.decrypter_ = new Decrypter();\n _this.sourceUpdater_ = new video_es_SourceUpdater(_this.mediaSource);\n _this.inbandTextTracks_ = {};\n _this.timelineChangeController_ = new video_es_TimelineChangeController();\n var segmentLoaderSettings = {\n vhs: _this.vhs_,\n parse708captions: options.parse708captions,\n mediaSource: _this.mediaSource,\n currentTime: _this.tech_.currentTime.bind(_this.tech_),\n seekable: function seekable() {\n return _this.seekable();\n },\n seeking: function seeking() {\n return _this.tech_.seeking();\n },\n duration: function duration() {\n return _this.duration();\n },\n hasPlayed: function hasPlayed() {\n return _this.hasPlayed_;\n },\n goalBufferLength: function goalBufferLength() {\n return _this.goalBufferLength();\n },\n bandwidth: bandwidth,\n syncController: _this.syncController_,\n decrypter: _this.decrypter_,\n sourceType: _this.sourceType_,\n inbandTextTracks: _this.inbandTextTracks_,\n cacheEncryptionKeys: cacheEncryptionKeys,\n sourceUpdater: _this.sourceUpdater_,\n timelineChangeController: _this.timelineChangeController_,\n experimentalExactManifestTimings: options.experimentalExactManifestTimings\n }; // The source type check not only determines whether a special DASH playlist loader\n // should be used, but also covers the case where the provided src is a vhs-json\n // manifest object (instead of a URL). In the case of vhs-json, the default\n // PlaylistLoader should be used.\n\n _this.masterPlaylistLoader_ = _this.sourceType_ === 'dash' ? new video_es_DashPlaylistLoader(src, _this.vhs_, _this.requestOptions_) : new video_es_PlaylistLoader(src, _this.vhs_, _this.requestOptions_);\n\n _this.setupMasterPlaylistLoaderListeners_(); // setup segment loaders\n // combined audio/video or just video when alternate audio track is selected\n\n\n _this.mainSegmentLoader_ = new video_es_SegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {\n segmentMetadataTrack: _this.segmentMetadataTrack_,\n loaderType: 'main'\n }), options); // alternate audio track\n\n _this.audioSegmentLoader_ = new video_es_SegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {\n loaderType: 'audio'\n }), options);\n _this.subtitleSegmentLoader_ = new video_es_VTTSegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {\n loaderType: 'vtt',\n featuresNativeTextTracks: _this.tech_.featuresNativeTextTracks\n }), options);\n\n _this.setupSegmentLoaderListeners_();\n\n if (_this.experimentalBufferBasedABR) {\n _this.masterPlaylistLoader_.one('loadedplaylist', function () {\n return _this.startABRTimer_();\n });\n\n _this.tech_.on('pause', function () {\n return _this.stopABRTimer_();\n });\n\n _this.tech_.on('play', function () {\n return _this.startABRTimer_();\n });\n } // Create SegmentLoader stat-getters\n // mediaRequests_\n // mediaRequestsAborted_\n // mediaRequestsTimedout_\n // mediaRequestsErrored_\n // mediaTransferDuration_\n // mediaBytesTransferred_\n // mediaAppends_\n\n\n loaderStats.forEach(function (stat) {\n _this[stat + '_'] = sumLoaderStat.bind(assertThisInitialized_default()(_this), stat);\n });\n _this.logger_ = logger('MPC');\n _this.triggeredFmp4Usage = false;\n\n if (_this.tech_.preload() === 'none') {\n _this.loadOnPlay_ = function () {\n _this.loadOnPlay_ = null;\n\n _this.masterPlaylistLoader_.load();\n };\n\n _this.tech_.one('play', _this.loadOnPlay_);\n } else {\n _this.masterPlaylistLoader_.load();\n }\n\n _this.timeToLoadedData__ = -1;\n _this.mainAppendsToLoadedData__ = -1;\n _this.audioAppendsToLoadedData__ = -1;\n var event = _this.tech_.preload() === 'none' ? 'play' : 'loadstart'; // start the first frame timer on loadstart or play (for preload none)\n\n _this.tech_.one(event, function () {\n var timeToLoadedDataStart = Date.now();\n\n _this.tech_.one('loadeddata', function () {\n _this.timeToLoadedData__ = Date.now() - timeToLoadedDataStart;\n _this.mainAppendsToLoadedData__ = _this.mainSegmentLoader_.mediaAppends;\n _this.audioAppendsToLoadedData__ = _this.audioSegmentLoader_.mediaAppends;\n });\n });\n\n return _this;\n }\n\n var _proto = MasterPlaylistController.prototype;\n\n _proto.mainAppendsToLoadedData_ = function mainAppendsToLoadedData_() {\n return this.mainAppendsToLoadedData__;\n };\n\n _proto.audioAppendsToLoadedData_ = function audioAppendsToLoadedData_() {\n return this.audioAppendsToLoadedData__;\n };\n\n _proto.appendsToLoadedData_ = function appendsToLoadedData_() {\n var main = this.mainAppendsToLoadedData_();\n var audio = this.audioAppendsToLoadedData_();\n\n if (main === -1 || audio === -1) {\n return -1;\n }\n\n return main + audio;\n };\n\n _proto.timeToLoadedData_ = function timeToLoadedData_() {\n return this.timeToLoadedData__;\n }\n /**\n * Run selectPlaylist and switch to the new playlist if we should\n *\n * @private\n *\n */\n ;\n\n _proto.checkABR_ = function checkABR_() {\n var nextPlaylist = this.selectPlaylist();\n\n if (nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist)) {\n this.switchMedia_(nextPlaylist, 'abr');\n }\n };\n\n _proto.switchMedia_ = function switchMedia_(playlist, cause, delay) {\n var oldMedia = this.media();\n var oldId = oldMedia && (oldMedia.id || oldMedia.uri);\n var newId = playlist.id || playlist.uri;\n\n if (oldId && oldId !== newId) {\n this.logger_(\"switch media \" + oldId + \" -> \" + newId + \" from \" + cause);\n this.tech_.trigger({\n type: 'usage',\n name: \"vhs-rendition-change-\" + cause\n });\n }\n\n this.masterPlaylistLoader_.media(playlist, delay);\n }\n /**\n * Start a timer that periodically calls checkABR_\n *\n * @private\n */\n ;\n\n _proto.startABRTimer_ = function startABRTimer_() {\n var _this2 = this;\n\n this.stopABRTimer_();\n this.abrTimer_ = window_default.a.setInterval(function () {\n return _this2.checkABR_();\n }, 250);\n }\n /**\n * Stop the timer that periodically calls checkABR_\n *\n * @private\n */\n ;\n\n _proto.stopABRTimer_ = function stopABRTimer_() {\n // if we're scrubbing, we don't need to pause.\n // This getter will be added to Video.js in version 7.11.\n if (this.tech_.scrubbing && this.tech_.scrubbing()) {\n return;\n }\n\n window_default.a.clearInterval(this.abrTimer_);\n this.abrTimer_ = null;\n }\n /**\n * Get a list of playlists for the currently selected audio playlist\n *\n * @return {Array} the array of audio playlists\n */\n ;\n\n _proto.getAudioTrackPlaylists_ = function getAudioTrackPlaylists_() {\n var master = this.master();\n var defaultPlaylists = master && master.playlists || []; // if we don't have any audio groups then we can only\n // assume that the audio tracks are contained in masters\n // playlist array, use that or an empty array.\n\n if (!master || !master.mediaGroups || !master.mediaGroups.AUDIO) {\n return defaultPlaylists;\n }\n\n var AUDIO = master.mediaGroups.AUDIO;\n var groupKeys = Object.keys(AUDIO);\n var track; // get the current active track\n\n if (Object.keys(this.mediaTypes_.AUDIO.groups).length) {\n track = this.mediaTypes_.AUDIO.activeTrack(); // or get the default track from master if mediaTypes_ isn't setup yet\n } else {\n // default group is `main` or just the first group.\n var defaultGroup = AUDIO.main || groupKeys.length && AUDIO[groupKeys[0]];\n\n for (var label in defaultGroup) {\n if (defaultGroup[label][\"default\"]) {\n track = {\n label: label\n };\n break;\n }\n }\n } // no active track no playlists.\n\n\n if (!track) {\n return defaultPlaylists;\n }\n\n var playlists = []; // get all of the playlists that are possible for the\n // active track.\n\n for (var group in AUDIO) {\n if (AUDIO[group][track.label]) {\n var properties = AUDIO[group][track.label];\n\n if (properties.playlists && properties.playlists.length) {\n playlists.push.apply(playlists, properties.playlists);\n } else if (properties.uri) {\n playlists.push(properties);\n } else if (master.playlists.length) {\n // if an audio group does not have a uri\n // see if we have main playlists that use it as a group.\n // if we do then add those to the playlists list.\n for (var i = 0; i < master.playlists.length; i++) {\n var playlist = master.playlists[i];\n\n if (playlist.attributes && playlist.attributes.AUDIO && playlist.attributes.AUDIO === group) {\n playlists.push(playlist);\n }\n }\n }\n }\n }\n\n if (!playlists.length) {\n return defaultPlaylists;\n }\n\n return playlists;\n }\n /**\n * Register event handlers on the master playlist loader. A helper\n * function for construction time.\n *\n * @private\n */\n ;\n\n _proto.setupMasterPlaylistLoaderListeners_ = function setupMasterPlaylistLoaderListeners_() {\n var _this3 = this;\n\n this.masterPlaylistLoader_.on('loadedmetadata', function () {\n var media = _this3.masterPlaylistLoader_.media();\n\n var requestTimeout = media.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n // timeout the request.\n\n if (isLowestEnabledRendition(_this3.masterPlaylistLoader_.master, _this3.masterPlaylistLoader_.media())) {\n _this3.requestOptions_.timeout = 0;\n } else {\n _this3.requestOptions_.timeout = requestTimeout;\n } // if this isn't a live video and preload permits, start\n // downloading segments\n\n\n if (media.endList && _this3.tech_.preload() !== 'none') {\n _this3.mainSegmentLoader_.playlist(media, _this3.requestOptions_);\n\n _this3.mainSegmentLoader_.load();\n }\n\n setupMediaGroups({\n sourceType: _this3.sourceType_,\n segmentLoaders: {\n AUDIO: _this3.audioSegmentLoader_,\n SUBTITLES: _this3.subtitleSegmentLoader_,\n main: _this3.mainSegmentLoader_\n },\n tech: _this3.tech_,\n requestOptions: _this3.requestOptions_,\n masterPlaylistLoader: _this3.masterPlaylistLoader_,\n vhs: _this3.vhs_,\n master: _this3.master(),\n mediaTypes: _this3.mediaTypes_,\n blacklistCurrentPlaylist: _this3.blacklistCurrentPlaylist.bind(_this3)\n });\n\n _this3.triggerPresenceUsage_(_this3.master(), media);\n\n _this3.setupFirstPlay();\n\n if (!_this3.mediaTypes_.AUDIO.activePlaylistLoader || _this3.mediaTypes_.AUDIO.activePlaylistLoader.media()) {\n _this3.trigger('selectedinitialmedia');\n } else {\n // We must wait for the active audio playlist loader to\n // finish setting up before triggering this event so the\n // representations API and EME setup is correct\n _this3.mediaTypes_.AUDIO.activePlaylistLoader.one('loadedmetadata', function () {\n _this3.trigger('selectedinitialmedia');\n });\n }\n });\n this.masterPlaylistLoader_.on('loadedplaylist', function () {\n if (_this3.loadOnPlay_) {\n _this3.tech_.off('play', _this3.loadOnPlay_);\n }\n\n var updatedPlaylist = _this3.masterPlaylistLoader_.media();\n\n if (!updatedPlaylist) {\n // exclude any variants that are not supported by the browser before selecting\n // an initial media as the playlist selectors do not consider browser support\n _this3.excludeUnsupportedVariants_();\n\n var selectedMedia;\n\n if (_this3.enableLowInitialPlaylist) {\n selectedMedia = _this3.selectInitialPlaylist();\n }\n\n if (!selectedMedia) {\n selectedMedia = _this3.selectPlaylist();\n }\n\n if (!selectedMedia || !_this3.shouldSwitchToMedia_(selectedMedia)) {\n return;\n }\n\n _this3.initialMedia_ = selectedMedia;\n\n _this3.switchMedia_(_this3.initialMedia_, 'initial'); // Under the standard case where a source URL is provided, loadedplaylist will\n // fire again since the playlist will be requested. In the case of vhs-json\n // (where the manifest object is provided as the source), when the media\n // playlist's `segments` list is already available, a media playlist won't be\n // requested, and loadedplaylist won't fire again, so the playlist handler must be\n // called on its own here.\n\n\n var haveJsonSource = _this3.sourceType_ === 'vhs-json' && _this3.initialMedia_.segments;\n\n if (!haveJsonSource) {\n return;\n }\n\n updatedPlaylist = _this3.initialMedia_;\n }\n\n _this3.handleUpdatedMediaPlaylist(updatedPlaylist);\n });\n this.masterPlaylistLoader_.on('error', function () {\n _this3.blacklistCurrentPlaylist(_this3.masterPlaylistLoader_.error);\n });\n this.masterPlaylistLoader_.on('mediachanging', function () {\n _this3.mainSegmentLoader_.abort();\n\n _this3.mainSegmentLoader_.pause();\n });\n this.masterPlaylistLoader_.on('mediachange', function () {\n var media = _this3.masterPlaylistLoader_.media();\n\n var requestTimeout = media.targetDuration * 1.5 * 1000; // If we don't have any more available playlists, we don't want to\n // timeout the request.\n\n if (isLowestEnabledRendition(_this3.masterPlaylistLoader_.master, _this3.masterPlaylistLoader_.media())) {\n _this3.requestOptions_.timeout = 0;\n } else {\n _this3.requestOptions_.timeout = requestTimeout;\n } // TODO: Create a new event on the PlaylistLoader that signals\n // that the segments have changed in some way and use that to\n // update the SegmentLoader instead of doing it twice here and\n // on `loadedplaylist`\n\n\n _this3.mainSegmentLoader_.playlist(media, _this3.requestOptions_);\n\n _this3.mainSegmentLoader_.load();\n\n _this3.tech_.trigger({\n type: 'mediachange',\n bubbles: true\n });\n });\n this.masterPlaylistLoader_.on('playlistunchanged', function () {\n var updatedPlaylist = _this3.masterPlaylistLoader_.media(); // ignore unchanged playlists that have already been\n // excluded for not-changing. We likely just have a really slowly updating\n // playlist.\n\n\n if (updatedPlaylist.lastExcludeReason_ === 'playlist-unchanged') {\n return;\n }\n\n var playlistOutdated = _this3.stuckAtPlaylistEnd_(updatedPlaylist);\n\n if (playlistOutdated) {\n // Playlist has stopped updating and we're stuck at its end. Try to\n // blacklist it and switch to another playlist in the hope that that\n // one is updating (and give the player a chance to re-adjust to the\n // safe live point).\n _this3.blacklistCurrentPlaylist({\n message: 'Playlist no longer updating.',\n reason: 'playlist-unchanged'\n }); // useful for monitoring QoS\n\n\n _this3.tech_.trigger('playliststuck');\n }\n });\n this.masterPlaylistLoader_.on('renditiondisabled', function () {\n _this3.tech_.trigger({\n type: 'usage',\n name: 'vhs-rendition-disabled'\n });\n\n _this3.tech_.trigger({\n type: 'usage',\n name: 'hls-rendition-disabled'\n });\n });\n this.masterPlaylistLoader_.on('renditionenabled', function () {\n _this3.tech_.trigger({\n type: 'usage',\n name: 'vhs-rendition-enabled'\n });\n\n _this3.tech_.trigger({\n type: 'usage',\n name: 'hls-rendition-enabled'\n });\n });\n }\n /**\n * Given an updated media playlist (whether it was loaded for the first time, or\n * refreshed for live playlists), update any relevant properties and state to reflect\n * changes in the media that should be accounted for (e.g., cues and duration).\n *\n * @param {Object} updatedPlaylist the updated media playlist object\n *\n * @private\n */\n ;\n\n _proto.handleUpdatedMediaPlaylist = function handleUpdatedMediaPlaylist(updatedPlaylist) {\n if (this.useCueTags_) {\n this.updateAdCues_(updatedPlaylist);\n } // TODO: Create a new event on the PlaylistLoader that signals\n // that the segments have changed in some way and use that to\n // update the SegmentLoader instead of doing it twice here and\n // on `mediachange`\n\n\n this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_);\n this.updateDuration(!updatedPlaylist.endList); // If the player isn't paused, ensure that the segment loader is running,\n // as it is possible that it was temporarily stopped while waiting for\n // a playlist (e.g., in case the playlist errored and we re-requested it).\n\n if (!this.tech_.paused()) {\n this.mainSegmentLoader_.load();\n\n if (this.audioSegmentLoader_) {\n this.audioSegmentLoader_.load();\n }\n }\n }\n /**\n * A helper function for triggerring presence usage events once per source\n *\n * @private\n */\n ;\n\n _proto.triggerPresenceUsage_ = function triggerPresenceUsage_(master, media) {\n var mediaGroups = master.mediaGroups || {};\n var defaultDemuxed = true;\n var audioGroupKeys = Object.keys(mediaGroups.AUDIO);\n\n for (var mediaGroup in mediaGroups.AUDIO) {\n for (var label in mediaGroups.AUDIO[mediaGroup]) {\n var properties = mediaGroups.AUDIO[mediaGroup][label];\n\n if (!properties.uri) {\n defaultDemuxed = false;\n }\n }\n }\n\n if (defaultDemuxed) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-demuxed'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-demuxed'\n });\n }\n\n if (Object.keys(mediaGroups.SUBTITLES).length) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-webvtt'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-webvtt'\n });\n }\n\n if (Vhs$1.Playlist.isAes(media)) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-aes'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-aes'\n });\n }\n\n if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-alternate-audio'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-alternate-audio'\n });\n }\n\n if (this.useCueTags_) {\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-playlist-cue-tags'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-playlist-cue-tags'\n });\n }\n };\n\n _proto.shouldSwitchToMedia_ = function shouldSwitchToMedia_(nextPlaylist) {\n var currentPlaylist = this.masterPlaylistLoader_.media();\n var buffered = this.tech_.buffered();\n var forwardBuffer = buffered.length ? buffered.end(buffered.length - 1) - this.tech_.currentTime() : 0;\n var bufferLowWaterLine = this.bufferLowWaterLine();\n var bufferHighWaterLine = this.bufferHighWaterLine();\n return shouldSwitchToMedia({\n currentPlaylist: currentPlaylist,\n nextPlaylist: nextPlaylist,\n forwardBuffer: forwardBuffer,\n bufferLowWaterLine: bufferLowWaterLine,\n bufferHighWaterLine: bufferHighWaterLine,\n duration: this.duration(),\n experimentalBufferBasedABR: this.experimentalBufferBasedABR,\n log: this.logger_\n });\n }\n /**\n * Register event handlers on the segment loaders. A helper function\n * for construction time.\n *\n * @private\n */\n ;\n\n _proto.setupSegmentLoaderListeners_ = function setupSegmentLoaderListeners_() {\n var _this4 = this;\n\n if (!this.experimentalBufferBasedABR) {\n this.mainSegmentLoader_.on('bandwidthupdate', function () {\n var nextPlaylist = _this4.selectPlaylist();\n\n if (_this4.shouldSwitchToMedia_(nextPlaylist)) {\n _this4.switchMedia_(nextPlaylist, 'bandwidthupdate');\n }\n\n _this4.tech_.trigger('bandwidthupdate');\n });\n this.mainSegmentLoader_.on('progress', function () {\n _this4.trigger('progress');\n });\n }\n\n this.mainSegmentLoader_.on('error', function () {\n _this4.blacklistCurrentPlaylist(_this4.mainSegmentLoader_.error());\n });\n this.mainSegmentLoader_.on('appenderror', function () {\n _this4.error = _this4.mainSegmentLoader_.error_;\n\n _this4.trigger('error');\n });\n this.mainSegmentLoader_.on('syncinfoupdate', function () {\n _this4.onSyncInfoUpdate_();\n });\n this.mainSegmentLoader_.on('timestampoffset', function () {\n _this4.tech_.trigger({\n type: 'usage',\n name: 'vhs-timestamp-offset'\n });\n\n _this4.tech_.trigger({\n type: 'usage',\n name: 'hls-timestamp-offset'\n });\n });\n this.audioSegmentLoader_.on('syncinfoupdate', function () {\n _this4.onSyncInfoUpdate_();\n });\n this.audioSegmentLoader_.on('appenderror', function () {\n _this4.error = _this4.audioSegmentLoader_.error_;\n\n _this4.trigger('error');\n });\n this.mainSegmentLoader_.on('ended', function () {\n _this4.logger_('main segment loader ended');\n\n _this4.onEndOfStream();\n });\n this.mainSegmentLoader_.on('earlyabort', function (event) {\n // never try to early abort with the new ABR algorithm\n if (_this4.experimentalBufferBasedABR) {\n return;\n }\n\n _this4.delegateLoaders_('all', ['abort']);\n\n _this4.blacklistCurrentPlaylist({\n message: 'Aborted early because there isn\\'t enough bandwidth to complete the ' + 'request without rebuffering.'\n }, ABORT_EARLY_BLACKLIST_SECONDS);\n });\n\n var updateCodecs = function updateCodecs() {\n if (!_this4.sourceUpdater_.hasCreatedSourceBuffers()) {\n return _this4.tryToCreateSourceBuffers_();\n }\n\n var codecs = _this4.getCodecsOrExclude_(); // no codecs means that the playlist was excluded\n\n\n if (!codecs) {\n return;\n }\n\n _this4.sourceUpdater_.addOrChangeSourceBuffers(codecs);\n };\n\n this.mainSegmentLoader_.on('trackinfo', updateCodecs);\n this.audioSegmentLoader_.on('trackinfo', updateCodecs);\n this.mainSegmentLoader_.on('fmp4', function () {\n if (!_this4.triggeredFmp4Usage) {\n _this4.tech_.trigger({\n type: 'usage',\n name: 'vhs-fmp4'\n });\n\n _this4.tech_.trigger({\n type: 'usage',\n name: 'hls-fmp4'\n });\n\n _this4.triggeredFmp4Usage = true;\n }\n });\n this.audioSegmentLoader_.on('fmp4', function () {\n if (!_this4.triggeredFmp4Usage) {\n _this4.tech_.trigger({\n type: 'usage',\n name: 'vhs-fmp4'\n });\n\n _this4.tech_.trigger({\n type: 'usage',\n name: 'hls-fmp4'\n });\n\n _this4.triggeredFmp4Usage = true;\n }\n });\n this.audioSegmentLoader_.on('ended', function () {\n _this4.logger_('audioSegmentLoader ended');\n\n _this4.onEndOfStream();\n });\n };\n\n _proto.mediaSecondsLoaded_ = function mediaSecondsLoaded_() {\n return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);\n }\n /**\n * Call load on our SegmentLoaders\n */\n ;\n\n _proto.load = function load() {\n this.mainSegmentLoader_.load();\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.load();\n }\n\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.load();\n }\n }\n /**\n * Re-tune playback quality level for the current player\n * conditions without performing destructive actions, like\n * removing already buffered content\n *\n * @private\n * @deprecated\n */\n ;\n\n _proto.smoothQualityChange_ = function smoothQualityChange_(media) {\n if (media === void 0) {\n media = this.selectPlaylist();\n }\n\n this.fastQualityChange_(media);\n }\n /**\n * Re-tune playback quality level for the current player\n * conditions. This method will perform destructive actions like removing\n * already buffered content in order to readjust the currently active\n * playlist quickly. This is good for manual quality changes\n *\n * @private\n */\n ;\n\n _proto.fastQualityChange_ = function fastQualityChange_(media) {\n var _this5 = this;\n\n if (media === void 0) {\n media = this.selectPlaylist();\n }\n\n if (media === this.masterPlaylistLoader_.media()) {\n this.logger_('skipping fastQualityChange because new media is same as old');\n return;\n }\n\n this.switchMedia_(media, 'fast-quality'); // Delete all buffered data to allow an immediate quality switch, then seek to give\n // the browser a kick to remove any cached frames from the previous rendtion (.04 seconds\n // ahead is roughly the minimum that will accomplish this across a variety of content\n // in IE and Edge, but seeking in place is sufficient on all other browsers)\n // Edge/IE bug: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14600375/\n // Chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=651904\n\n this.mainSegmentLoader_.resetEverything(function () {\n // Since this is not a typical seek, we avoid the seekTo method which can cause segments\n // from the previously enabled rendition to load before the new playlist has finished loading\n if (videojs.browser.IE_VERSION || videojs.browser.IS_EDGE) {\n _this5.tech_.setCurrentTime(_this5.tech_.currentTime() + 0.04);\n } else {\n _this5.tech_.setCurrentTime(_this5.tech_.currentTime());\n }\n }); // don't need to reset audio as it is reset when media changes\n }\n /**\n * Begin playback.\n */\n ;\n\n _proto.play = function play() {\n if (this.setupFirstPlay()) {\n return;\n }\n\n if (this.tech_.ended()) {\n this.tech_.setCurrentTime(0);\n }\n\n if (this.hasPlayed_) {\n this.load();\n }\n\n var seekable = this.tech_.seekable(); // if the viewer has paused and we fell out of the live window,\n // seek forward to the live point\n\n if (this.tech_.duration() === Infinity) {\n if (this.tech_.currentTime() < seekable.start(0)) {\n return this.tech_.setCurrentTime(seekable.end(seekable.length - 1));\n }\n }\n }\n /**\n * Seek to the latest media position if this is a live video and the\n * player and video are loaded and initialized.\n */\n ;\n\n _proto.setupFirstPlay = function setupFirstPlay() {\n var _this6 = this;\n\n var media = this.masterPlaylistLoader_.media(); // Check that everything is ready to begin buffering for the first call to play\n // If 1) there is no active media\n // 2) the player is paused\n // 3) the first play has already been setup\n // then exit early\n\n if (!media || this.tech_.paused() || this.hasPlayed_) {\n return false;\n } // when the video is a live stream\n\n\n if (!media.endList) {\n var seekable = this.seekable();\n\n if (!seekable.length) {\n // without a seekable range, the player cannot seek to begin buffering at the live\n // point\n return false;\n }\n\n if (videojs.browser.IE_VERSION && this.tech_.readyState() === 0) {\n // IE11 throws an InvalidStateError if you try to set currentTime while the\n // readyState is 0, so it must be delayed until the tech fires loadedmetadata.\n this.tech_.one('loadedmetadata', function () {\n _this6.trigger('firstplay');\n\n _this6.tech_.setCurrentTime(seekable.end(0));\n\n _this6.hasPlayed_ = true;\n });\n return false;\n } // trigger firstplay to inform the source handler to ignore the next seek event\n\n\n this.trigger('firstplay'); // seek to the live point\n\n this.tech_.setCurrentTime(seekable.end(0));\n }\n\n this.hasPlayed_ = true; // we can begin loading now that everything is ready\n\n this.load();\n return true;\n }\n /**\n * handle the sourceopen event on the MediaSource\n *\n * @private\n */\n ;\n\n _proto.handleSourceOpen_ = function handleSourceOpen_() {\n // Only attempt to create the source buffer if none already exist.\n // handleSourceOpen is also called when we are \"re-opening\" a source buffer\n // after `endOfStream` has been called (in response to a seek for instance)\n this.tryToCreateSourceBuffers_(); // if autoplay is enabled, begin playback. This is duplicative of\n // code in video.js but is required because play() must be invoked\n // *after* the media source has opened.\n\n if (this.tech_.autoplay()) {\n var playPromise = this.tech_.play(); // Catch/silence error when a pause interrupts a play request\n // on browsers which return a promise\n\n if (typeof playPromise !== 'undefined' && typeof playPromise.then === 'function') {\n playPromise.then(null, function (e) {});\n }\n }\n\n this.trigger('sourceopen');\n }\n /**\n * handle the sourceended event on the MediaSource\n *\n * @private\n */\n ;\n\n _proto.handleSourceEnded_ = function handleSourceEnded_() {\n if (!this.inbandTextTracks_.metadataTrack_) {\n return;\n }\n\n var cues = this.inbandTextTracks_.metadataTrack_.cues;\n\n if (!cues || !cues.length) {\n return;\n }\n\n var duration = this.duration();\n cues[cues.length - 1].endTime = isNaN(duration) || Math.abs(duration) === Infinity ? Number.MAX_VALUE : duration;\n }\n /**\n * handle the durationchange event on the MediaSource\n *\n * @private\n */\n ;\n\n _proto.handleDurationChange_ = function handleDurationChange_() {\n this.tech_.trigger('durationchange');\n }\n /**\n * Calls endOfStream on the media source when all active stream types have called\n * endOfStream\n *\n * @param {string} streamType\n * Stream type of the segment loader that called endOfStream\n * @private\n */\n ;\n\n _proto.onEndOfStream = function onEndOfStream() {\n var isEndOfStream = this.mainSegmentLoader_.ended_;\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n var mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_(); // if the audio playlist loader exists, then alternate audio is active\n\n if (!mainMediaInfo || mainMediaInfo.hasVideo) {\n // if we do not know if the main segment loader contains video yet or if we\n // definitively know the main segment loader contains video, then we need to wait\n // for both main and audio segment loaders to call endOfStream\n isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;\n } else {\n // otherwise just rely on the audio loader\n isEndOfStream = this.audioSegmentLoader_.ended_;\n }\n }\n\n if (!isEndOfStream) {\n return;\n }\n\n this.stopABRTimer_();\n this.sourceUpdater_.endOfStream();\n }\n /**\n * Check if a playlist has stopped being updated\n *\n * @param {Object} playlist the media playlist object\n * @return {boolean} whether the playlist has stopped being updated or not\n */\n ;\n\n _proto.stuckAtPlaylistEnd_ = function stuckAtPlaylistEnd_(playlist) {\n var seekable = this.seekable();\n\n if (!seekable.length) {\n // playlist doesn't have enough information to determine whether we are stuck\n return false;\n }\n\n var expired = this.syncController_.getExpiredTime(playlist, this.duration());\n\n if (expired === null) {\n return false;\n } // does not use the safe live end to calculate playlist end, since we\n // don't want to say we are stuck while there is still content\n\n\n var absolutePlaylistEnd = Vhs$1.Playlist.playlistEnd(playlist, expired);\n var currentTime = this.tech_.currentTime();\n var buffered = this.tech_.buffered();\n\n if (!buffered.length) {\n // return true if the playhead reached the absolute end of the playlist\n return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA;\n }\n\n var bufferedEnd = buffered.end(buffered.length - 1); // return true if there is too little buffer left and buffer has reached absolute\n // end of playlist\n\n return bufferedEnd - currentTime <= SAFE_TIME_DELTA && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA;\n }\n /**\n * Blacklists a playlist when an error occurs for a set amount of time\n * making it unavailable for selection by the rendition selection algorithm\n * and then forces a new playlist (rendition) selection.\n *\n * @param {Object=} error an optional error that may include the playlist\n * to blacklist\n * @param {number=} blacklistDuration an optional number of seconds to blacklist the\n * playlist\n */\n ;\n\n _proto.blacklistCurrentPlaylist = function blacklistCurrentPlaylist(error, blacklistDuration) {\n if (error === void 0) {\n error = {};\n } // If the `error` was generated by the playlist loader, it will contain\n // the playlist we were trying to load (but failed) and that should be\n // blacklisted instead of the currently selected playlist which is likely\n // out-of-date in this scenario\n\n\n var currentPlaylist = error.playlist || this.masterPlaylistLoader_.media();\n blacklistDuration = blacklistDuration || error.blacklistDuration || this.blacklistDuration; // If there is no current playlist, then an error occurred while we were\n // trying to load the master OR while we were disposing of the tech\n\n if (!currentPlaylist) {\n this.error = error;\n\n if (this.mediaSource.readyState !== 'open') {\n this.trigger('error');\n } else {\n this.sourceUpdater_.endOfStream('network');\n }\n\n return;\n }\n\n currentPlaylist.playlistErrors_++;\n var playlists = this.masterPlaylistLoader_.master.playlists;\n var enabledPlaylists = playlists.filter(isEnabled);\n var isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === currentPlaylist; // Don't blacklist the only playlist unless it was blacklisted\n // forever\n\n if (playlists.length === 1 && blacklistDuration !== Infinity) {\n videojs.log.warn(\"Problem encountered with playlist \" + currentPlaylist.id + \". \" + 'Trying again since it is the only playlist.');\n this.tech_.trigger('retryplaylist'); // if this is a final rendition, we should delay\n\n return this.masterPlaylistLoader_.load(isFinalRendition);\n }\n\n if (isFinalRendition) {\n // Since we're on the final non-blacklisted playlist, and we're about to blacklist\n // it, instead of erring the player or retrying this playlist, clear out the current\n // blacklist. This allows other playlists to be attempted in case any have been\n // fixed.\n var reincluded = false;\n playlists.forEach(function (playlist) {\n // skip current playlist which is about to be blacklisted\n if (playlist === currentPlaylist) {\n return;\n }\n\n var excludeUntil = playlist.excludeUntil; // a playlist cannot be reincluded if it wasn't excluded to begin with.\n\n if (typeof excludeUntil !== 'undefined' && excludeUntil !== Infinity) {\n reincluded = true;\n delete playlist.excludeUntil;\n }\n });\n\n if (reincluded) {\n videojs.log.warn('Removing other playlists from the exclusion list because the last ' + 'rendition is about to be excluded.'); // Technically we are retrying a playlist, in that we are simply retrying a previous\n // playlist. This is needed for users relying on the retryplaylist event to catch a\n // case where the player might be stuck and looping through \"dead\" playlists.\n\n this.tech_.trigger('retryplaylist');\n }\n } // Blacklist this playlist\n\n\n var excludeUntil;\n\n if (currentPlaylist.playlistErrors_ > this.maxPlaylistRetries) {\n excludeUntil = Infinity;\n } else {\n excludeUntil = Date.now() + blacklistDuration * 1000;\n }\n\n currentPlaylist.excludeUntil = excludeUntil;\n\n if (error.reason) {\n currentPlaylist.lastExcludeReason_ = error.reason;\n }\n\n this.tech_.trigger('blacklistplaylist');\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-rendition-blacklisted'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-rendition-blacklisted'\n }); // TODO: should we select a new playlist if this blacklist wasn't for the currentPlaylist?\n // Would be something like media().id !=== currentPlaylist.id and we would need something\n // like `pendingMedia` in playlist loaders to check against that too. This will prevent us\n // from loading a new playlist on any blacklist.\n // Select a new playlist\n\n var nextPlaylist = this.selectPlaylist();\n\n if (!nextPlaylist) {\n this.error = 'Playback cannot continue. No available working or supported playlists.';\n this.trigger('error');\n return;\n }\n\n var logFn = error.internal ? this.logger_ : videojs.log.warn;\n var errorMessage = error.message ? ' ' + error.message : '';\n logFn((error.internal ? 'Internal problem' : 'Problem') + \" encountered with playlist \" + currentPlaylist.id + \".\" + (errorMessage + \" Switching to playlist \" + nextPlaylist.id + \".\")); // if audio group changed reset audio loaders\n\n if (nextPlaylist.attributes.AUDIO !== currentPlaylist.attributes.AUDIO) {\n this.delegateLoaders_('audio', ['abort', 'pause']);\n } // if subtitle group changed reset subtitle loaders\n\n\n if (nextPlaylist.attributes.SUBTITLES !== currentPlaylist.attributes.SUBTITLES) {\n this.delegateLoaders_('subtitle', ['abort', 'pause']);\n }\n\n this.delegateLoaders_('main', ['abort', 'pause']);\n var delayDuration = nextPlaylist.targetDuration / 2 * 1000 || 5 * 1000;\n var shouldDelay = typeof nextPlaylist.lastRequest === 'number' && Date.now() - nextPlaylist.lastRequest <= delayDuration; // delay if it's a final rendition or if the last refresh is sooner than half targetDuration\n\n return this.switchMedia_(nextPlaylist, 'exclude', isFinalRendition || shouldDelay);\n }\n /**\n * Pause all segment/playlist loaders\n */\n ;\n\n _proto.pauseLoading = function pauseLoading() {\n this.delegateLoaders_('all', ['abort', 'pause']);\n this.stopABRTimer_();\n }\n /**\n * Call a set of functions in order on playlist loaders, segment loaders,\n * or both types of loaders.\n *\n * @param {string} filter\n * Filter loaders that should call fnNames using a string. Can be:\n * * all - run on all loaders\n * * audio - run on all audio loaders\n * * subtitle - run on all subtitle loaders\n * * main - run on the main/master loaders\n *\n * @param {Array|string} fnNames\n * A string or array of function names to call.\n */\n ;\n\n _proto.delegateLoaders_ = function delegateLoaders_(filter, fnNames) {\n var _this7 = this;\n\n var loaders = [];\n var dontFilterPlaylist = filter === 'all';\n\n if (dontFilterPlaylist || filter === 'main') {\n loaders.push(this.masterPlaylistLoader_);\n }\n\n var mediaTypes = [];\n\n if (dontFilterPlaylist || filter === 'audio') {\n mediaTypes.push('AUDIO');\n }\n\n if (dontFilterPlaylist || filter === 'subtitle') {\n mediaTypes.push('CLOSED-CAPTIONS');\n mediaTypes.push('SUBTITLES');\n }\n\n mediaTypes.forEach(function (mediaType) {\n var loader = _this7.mediaTypes_[mediaType] && _this7.mediaTypes_[mediaType].activePlaylistLoader;\n\n if (loader) {\n loaders.push(loader);\n }\n });\n ['main', 'audio', 'subtitle'].forEach(function (name) {\n var loader = _this7[name + \"SegmentLoader_\"];\n\n if (loader && (filter === name || filter === 'all')) {\n loaders.push(loader);\n }\n });\n loaders.forEach(function (loader) {\n return fnNames.forEach(function (fnName) {\n if (typeof loader[fnName] === 'function') {\n loader[fnName]();\n }\n });\n });\n }\n /**\n * set the current time on all segment loaders\n *\n * @param {TimeRange} currentTime the current time to set\n * @return {TimeRange} the current time\n */\n ;\n\n _proto.setCurrentTime = function setCurrentTime(currentTime) {\n var buffered = findRange(this.tech_.buffered(), currentTime);\n\n if (!(this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media())) {\n // return immediately if the metadata is not ready yet\n return 0;\n } // it's clearly an edge-case but don't thrown an error if asked to\n // seek within an empty playlist\n\n\n if (!this.masterPlaylistLoader_.media().segments) {\n return 0;\n } // if the seek location is already buffered, continue buffering as usual\n\n\n if (buffered && buffered.length) {\n return currentTime;\n } // cancel outstanding requests so we begin buffering at the new\n // location\n\n\n this.mainSegmentLoader_.resetEverything();\n this.mainSegmentLoader_.abort();\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n this.audioSegmentLoader_.resetEverything();\n this.audioSegmentLoader_.abort();\n }\n\n if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {\n this.subtitleSegmentLoader_.resetEverything();\n this.subtitleSegmentLoader_.abort();\n } // start segment loader loading in case they are paused\n\n\n this.load();\n }\n /**\n * get the current duration\n *\n * @return {TimeRange} the duration\n */\n ;\n\n _proto.duration = function duration() {\n if (!this.masterPlaylistLoader_) {\n return 0;\n }\n\n var media = this.masterPlaylistLoader_.media();\n\n if (!media) {\n // no playlists loaded yet, so can't determine a duration\n return 0;\n } // Don't rely on the media source for duration in the case of a live playlist since\n // setting the native MediaSource's duration to infinity ends up with consequences to\n // seekable behavior. See https://github.com/w3c/media-source/issues/5 for details.\n //\n // This is resolved in the spec by https://github.com/w3c/media-source/pull/92,\n // however, few browsers have support for setLiveSeekableRange()\n // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange\n //\n // Until a time when the duration of the media source can be set to infinity, and a\n // seekable range specified across browsers, just return Infinity.\n\n\n if (!media.endList) {\n return Infinity;\n } // Since this is a VOD video, it is safe to rely on the media source's duration (if\n // available). If it's not available, fall back to a playlist-calculated estimate.\n\n\n if (this.mediaSource) {\n return this.mediaSource.duration;\n }\n\n return Vhs$1.Playlist.duration(media);\n }\n /**\n * check the seekable range\n *\n * @return {TimeRange} the seekable range\n */\n ;\n\n _proto.seekable = function seekable() {\n return this.seekable_;\n };\n\n _proto.onSyncInfoUpdate_ = function onSyncInfoUpdate_() {\n var audioSeekable;\n\n if (!this.masterPlaylistLoader_) {\n return;\n }\n\n var media = this.masterPlaylistLoader_.media();\n\n if (!media) {\n return;\n }\n\n var expired = this.syncController_.getExpiredTime(media, this.duration());\n\n if (expired === null) {\n // not enough information to update seekable\n return;\n }\n\n var master = this.masterPlaylistLoader_.master;\n var mainSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(master, media));\n\n if (mainSeekable.length === 0) {\n return;\n }\n\n if (this.mediaTypes_.AUDIO.activePlaylistLoader) {\n media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();\n expired = this.syncController_.getExpiredTime(media, this.duration());\n\n if (expired === null) {\n return;\n }\n\n audioSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(master, media));\n\n if (audioSeekable.length === 0) {\n return;\n }\n }\n\n var oldEnd;\n var oldStart;\n\n if (this.seekable_ && this.seekable_.length) {\n oldEnd = this.seekable_.end(0);\n oldStart = this.seekable_.start(0);\n }\n\n if (!audioSeekable) {\n // seekable has been calculated based on buffering video data so it\n // can be returned directly\n this.seekable_ = mainSeekable;\n } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {\n // seekables are pretty far off, rely on main\n this.seekable_ = mainSeekable;\n } else {\n this.seekable_ = videojs.createTimeRanges([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);\n } // seekable is the same as last time\n\n\n if (this.seekable_ && this.seekable_.length) {\n if (this.seekable_.end(0) === oldEnd && this.seekable_.start(0) === oldStart) {\n return;\n }\n }\n\n this.logger_(\"seekable updated [\" + printableRange(this.seekable_) + \"]\");\n this.tech_.trigger('seekablechanged');\n }\n /**\n * Update the player duration\n */\n ;\n\n _proto.updateDuration = function updateDuration(isLive) {\n if (this.updateDuration_) {\n this.mediaSource.removeEventListener('sourceopen', this.updateDuration_);\n this.updateDuration_ = null;\n }\n\n if (this.mediaSource.readyState !== 'open') {\n this.updateDuration_ = this.updateDuration.bind(this, isLive);\n this.mediaSource.addEventListener('sourceopen', this.updateDuration_);\n return;\n }\n\n if (isLive) {\n var seekable = this.seekable();\n\n if (!seekable.length) {\n return;\n } // Even in the case of a live playlist, the native MediaSource's duration should not\n // be set to Infinity (even though this would be expected for a live playlist), since\n // setting the native MediaSource's duration to infinity ends up with consequences to\n // seekable behavior. See https://github.com/w3c/media-source/issues/5 for details.\n //\n // This is resolved in the spec by https://github.com/w3c/media-source/pull/92,\n // however, few browsers have support for setLiveSeekableRange()\n // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange\n //\n // Until a time when the duration of the media source can be set to infinity, and a\n // seekable range specified across browsers, the duration should be greater than or\n // equal to the last possible seekable value.\n // MediaSource duration starts as NaN\n // It is possible (and probable) that this case will never be reached for many\n // sources, since the MediaSource reports duration as the highest value without\n // accounting for timestamp offset. For example, if the timestamp offset is -100 and\n // we buffered times 0 to 100 with real times of 100 to 200, even though current\n // time will be between 0 and 100, the native media source may report the duration\n // as 200. However, since we report duration separate from the media source (as\n // Infinity), and as long as the native media source duration value is greater than\n // our reported seekable range, seeks will work as expected. The large number as\n // duration for live is actually a strategy used by some players to work around the\n // issue of live seekable ranges cited above.\n\n\n if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable.end(seekable.length - 1)) {\n this.sourceUpdater_.setDuration(seekable.end(seekable.length - 1));\n }\n\n return;\n }\n\n var buffered = this.tech_.buffered();\n var duration = Vhs$1.Playlist.duration(this.masterPlaylistLoader_.media());\n\n if (buffered.length > 0) {\n duration = Math.max(duration, buffered.end(buffered.length - 1));\n }\n\n if (this.mediaSource.duration !== duration) {\n this.sourceUpdater_.setDuration(duration);\n }\n }\n /**\n * dispose of the MasterPlaylistController and everything\n * that it controls\n */\n ;\n\n _proto.dispose = function dispose() {\n var _this8 = this;\n\n this.trigger('dispose');\n this.decrypter_.terminate();\n this.masterPlaylistLoader_.dispose();\n this.mainSegmentLoader_.dispose();\n\n if (this.loadOnPlay_) {\n this.tech_.off('play', this.loadOnPlay_);\n }\n\n ['AUDIO', 'SUBTITLES'].forEach(function (type) {\n var groups = _this8.mediaTypes_[type].groups;\n\n for (var id in groups) {\n groups[id].forEach(function (group) {\n if (group.playlistLoader) {\n group.playlistLoader.dispose();\n }\n });\n }\n });\n this.audioSegmentLoader_.dispose();\n this.subtitleSegmentLoader_.dispose();\n this.sourceUpdater_.dispose();\n this.timelineChangeController_.dispose();\n this.stopABRTimer_();\n\n if (this.updateDuration_) {\n this.mediaSource.removeEventListener('sourceopen', this.updateDuration_);\n }\n\n this.mediaSource.removeEventListener('durationchange', this.handleDurationChange_); // load the media source into the player\n\n this.mediaSource.removeEventListener('sourceopen', this.handleSourceOpen_);\n this.mediaSource.removeEventListener('sourceended', this.handleSourceEnded_);\n this.off();\n }\n /**\n * return the master playlist object if we have one\n *\n * @return {Object} the master playlist object that we parsed\n */\n ;\n\n _proto.master = function master() {\n return this.masterPlaylistLoader_.master;\n }\n /**\n * return the currently selected playlist\n *\n * @return {Object} the currently selected playlist object that we parsed\n */\n ;\n\n _proto.media = function media() {\n // playlist loader will not return media if it has not been fully loaded\n return this.masterPlaylistLoader_.media() || this.initialMedia_;\n };\n\n _proto.areMediaTypesKnown_ = function areMediaTypesKnown_() {\n var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;\n var hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_(); // if we are not using an audio loader, then we have audio media info\n // otherwise check on the segment loader.\n\n var hasAudioMediaInfo = !usingAudioLoader ? true : !!this.audioSegmentLoader_.getCurrentMediaInfo_(); // one or both loaders has not loaded sufficently to get codecs\n\n if (!hasMainMediaInfo || !hasAudioMediaInfo) {\n return false;\n }\n\n return true;\n };\n\n _proto.getCodecsOrExclude_ = function getCodecsOrExclude_() {\n var _this9 = this;\n\n var media = {\n main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {},\n audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {}\n }; // set \"main\" media equal to video\n\n media.video = media.main;\n var playlistCodecs = video_es_codecsForPlaylist(this.master(), this.media());\n var codecs = {};\n var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;\n\n if (media.main.hasVideo) {\n codecs.video = playlistCodecs.video || media.main.videoCodec || DEFAULT_VIDEO_CODEC;\n }\n\n if (media.main.isMuxed) {\n codecs.video += \",\" + (playlistCodecs.audio || media.main.audioCodec || DEFAULT_AUDIO_CODEC);\n }\n\n if (media.main.hasAudio && !media.main.isMuxed || media.audio.hasAudio || usingAudioLoader) {\n codecs.audio = playlistCodecs.audio || media.main.audioCodec || media.audio.audioCodec || DEFAULT_AUDIO_CODEC; // set audio isFmp4 so we use the correct \"supports\" function below\n\n media.audio.isFmp4 = media.main.hasAudio && !media.main.isMuxed ? media.main.isFmp4 : media.audio.isFmp4;\n } // no codecs, no playback.\n\n\n if (!codecs.audio && !codecs.video) {\n this.blacklistCurrentPlaylist({\n playlist: this.media(),\n message: 'Could not determine codecs for playlist.',\n blacklistDuration: Infinity\n });\n return;\n } // fmp4 relies on browser support, while ts relies on muxer support\n\n\n var supportFunction = function supportFunction(isFmp4, codec) {\n return isFmp4 ? codecs_browserSupportsCodec(codec) : muxerSupportsCodec(codec);\n };\n\n var unsupportedCodecs = {};\n var unsupportedAudio;\n ['video', 'audio'].forEach(function (type) {\n if (codecs.hasOwnProperty(type) && !supportFunction(media[type].isFmp4, codecs[type])) {\n var supporter = media[type].isFmp4 ? 'browser' : 'muxer';\n unsupportedCodecs[supporter] = unsupportedCodecs[supporter] || [];\n unsupportedCodecs[supporter].push(codecs[type]);\n\n if (type === 'audio') {\n unsupportedAudio = supporter;\n }\n }\n });\n\n if (usingAudioLoader && unsupportedAudio && this.media().attributes.AUDIO) {\n var audioGroup = this.media().attributes.AUDIO;\n this.master().playlists.forEach(function (variant) {\n var variantAudioGroup = variant.attributes && variant.attributes.AUDIO;\n\n if (variantAudioGroup === audioGroup && variant !== _this9.media()) {\n variant.excludeUntil = Infinity;\n }\n });\n this.logger_(\"excluding audio group \" + audioGroup + \" as \" + unsupportedAudio + \" does not support codec(s): \\\"\" + codecs.audio + \"\\\"\");\n } // if we have any unsupported codecs blacklist this playlist.\n\n\n if (Object.keys(unsupportedCodecs).length) {\n var message = Object.keys(unsupportedCodecs).reduce(function (acc, supporter) {\n if (acc) {\n acc += ', ';\n }\n\n acc += supporter + \" does not support codec(s): \\\"\" + unsupportedCodecs[supporter].join(',') + \"\\\"\";\n return acc;\n }, '') + '.';\n this.blacklistCurrentPlaylist({\n playlist: this.media(),\n internal: true,\n message: message,\n blacklistDuration: Infinity\n });\n return;\n } // check if codec switching is happening\n\n\n if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {\n var switchMessages = [];\n ['video', 'audio'].forEach(function (type) {\n var newCodec = (parseCodecs(_this9.sourceUpdater_.codecs[type] || '')[0] || {}).type;\n var oldCodec = (parseCodecs(codecs[type] || '')[0] || {}).type;\n\n if (newCodec && oldCodec && newCodec.toLowerCase() !== oldCodec.toLowerCase()) {\n switchMessages.push(\"\\\"\" + _this9.sourceUpdater_.codecs[type] + \"\\\" -> \\\"\" + codecs[type] + \"\\\"\");\n }\n });\n\n if (switchMessages.length) {\n this.blacklistCurrentPlaylist({\n playlist: this.media(),\n message: \"Codec switching not supported: \" + switchMessages.join(', ') + \".\",\n blacklistDuration: Infinity,\n internal: true\n });\n return;\n }\n } // TODO: when using the muxer shouldn't we just return\n // the codecs that the muxer outputs?\n\n\n return codecs;\n }\n /**\n * Create source buffers and exlude any incompatible renditions.\n *\n * @private\n */\n ;\n\n _proto.tryToCreateSourceBuffers_ = function tryToCreateSourceBuffers_() {\n // media source is not ready yet or sourceBuffers are already\n // created.\n if (this.mediaSource.readyState !== 'open' || this.sourceUpdater_.hasCreatedSourceBuffers()) {\n return;\n }\n\n if (!this.areMediaTypesKnown_()) {\n return;\n }\n\n var codecs = this.getCodecsOrExclude_(); // no codecs means that the playlist was excluded\n\n if (!codecs) {\n return;\n }\n\n this.sourceUpdater_.createSourceBuffers(codecs);\n var codecString = [codecs.video, codecs.audio].filter(Boolean).join(',');\n this.excludeIncompatibleVariants_(codecString);\n }\n /**\n * Excludes playlists with codecs that are unsupported by the muxer and browser.\n */\n ;\n\n _proto.excludeUnsupportedVariants_ = function excludeUnsupportedVariants_() {\n var _this10 = this;\n\n var playlists = this.master().playlists;\n var ids = []; // TODO: why don't we have a property to loop through all\n // playlist? Why did we ever mix indexes and keys?\n\n Object.keys(playlists).forEach(function (key) {\n var variant = playlists[key]; // check if we already processed this playlist.\n\n if (ids.indexOf(variant.id) !== -1) {\n return;\n }\n\n ids.push(variant.id);\n var codecs = video_es_codecsForPlaylist(_this10.master, variant);\n var unsupported = [];\n\n if (codecs.audio && !muxerSupportsCodec(codecs.audio) && !codecs_browserSupportsCodec(codecs.audio)) {\n unsupported.push(\"audio codec \" + codecs.audio);\n }\n\n if (codecs.video && !muxerSupportsCodec(codecs.video) && !codecs_browserSupportsCodec(codecs.video)) {\n unsupported.push(\"video codec \" + codecs.video);\n }\n\n if (codecs.text && codecs.text === 'stpp.ttml.im1t') {\n unsupported.push(\"text codec \" + codecs.text);\n }\n\n if (unsupported.length) {\n variant.excludeUntil = Infinity;\n\n _this10.logger_(\"excluding \" + variant.id + \" for unsupported: \" + unsupported.join(', '));\n }\n });\n }\n /**\n * Blacklist playlists that are known to be codec or\n * stream-incompatible with the SourceBuffer configuration. For\n * instance, Media Source Extensions would cause the video element to\n * stall waiting for video data if you switched from a variant with\n * video and audio to an audio-only one.\n *\n * @param {Object} media a media playlist compatible with the current\n * set of SourceBuffers. Variants in the current master playlist that\n * do not appear to have compatible codec or stream configurations\n * will be excluded from the default playlist selection algorithm\n * indefinitely.\n * @private\n */\n ;\n\n _proto.excludeIncompatibleVariants_ = function excludeIncompatibleVariants_(codecString) {\n var _this11 = this;\n\n var ids = [];\n var playlists = this.master().playlists;\n var codecs = video_es_unwrapCodecList(parseCodecs(codecString));\n var codecCount_ = codecCount(codecs);\n var videoDetails = codecs.video && parseCodecs(codecs.video)[0] || null;\n var audioDetails = codecs.audio && parseCodecs(codecs.audio)[0] || null;\n Object.keys(playlists).forEach(function (key) {\n var variant = playlists[key]; // check if we already processed this playlist.\n // or it if it is already excluded forever.\n\n if (ids.indexOf(variant.id) !== -1 || variant.excludeUntil === Infinity) {\n return;\n }\n\n ids.push(variant.id);\n var blacklistReasons = []; // get codecs from the playlist for this variant\n\n var variantCodecs = video_es_codecsForPlaylist(_this11.masterPlaylistLoader_.master, variant);\n var variantCodecCount = codecCount(variantCodecs); // if no codecs are listed, we cannot determine that this\n // variant is incompatible. Wait for mux.js to probe\n\n if (!variantCodecs.audio && !variantCodecs.video) {\n return;\n } // TODO: we can support this by removing the\n // old media source and creating a new one, but it will take some work.\n // The number of streams cannot change\n\n\n if (variantCodecCount !== codecCount_) {\n blacklistReasons.push(\"codec count \\\"\" + variantCodecCount + \"\\\" !== \\\"\" + codecCount_ + \"\\\"\");\n } // only exclude playlists by codec change, if codecs cannot switch\n // during playback.\n\n\n if (!_this11.sourceUpdater_.canChangeType()) {\n var variantVideoDetails = variantCodecs.video && parseCodecs(variantCodecs.video)[0] || null;\n var variantAudioDetails = variantCodecs.audio && parseCodecs(variantCodecs.audio)[0] || null; // the video codec cannot change\n\n if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) {\n blacklistReasons.push(\"video codec \\\"\" + variantVideoDetails.type + \"\\\" !== \\\"\" + videoDetails.type + \"\\\"\");\n } // the audio codec cannot change\n\n\n if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) {\n blacklistReasons.push(\"audio codec \\\"\" + variantAudioDetails.type + \"\\\" !== \\\"\" + audioDetails.type + \"\\\"\");\n }\n }\n\n if (blacklistReasons.length) {\n variant.excludeUntil = Infinity;\n\n _this11.logger_(\"blacklisting \" + variant.id + \": \" + blacklistReasons.join(' && '));\n }\n });\n };\n\n _proto.updateAdCues_ = function updateAdCues_(media) {\n var offset = 0;\n var seekable = this.seekable();\n\n if (seekable.length) {\n offset = seekable.start(0);\n }\n\n video_es_updateAdCues(media, this.cueTagsTrack_, offset);\n }\n /**\n * Calculates the desired forward buffer length based on current time\n *\n * @return {number} Desired forward buffer length in seconds\n */\n ;\n\n _proto.goalBufferLength = function goalBufferLength() {\n var currentTime = this.tech_.currentTime();\n var initial = Config.GOAL_BUFFER_LENGTH;\n var rate = Config.GOAL_BUFFER_LENGTH_RATE;\n var max = Math.max(initial, Config.MAX_GOAL_BUFFER_LENGTH);\n return Math.min(initial + currentTime * rate, max);\n }\n /**\n * Calculates the desired buffer low water line based on current time\n *\n * @return {number} Desired buffer low water line in seconds\n */\n ;\n\n _proto.bufferLowWaterLine = function bufferLowWaterLine() {\n var currentTime = this.tech_.currentTime();\n var initial = Config.BUFFER_LOW_WATER_LINE;\n var rate = Config.BUFFER_LOW_WATER_LINE_RATE;\n var max = Math.max(initial, Config.MAX_BUFFER_LOW_WATER_LINE);\n var newMax = Math.max(initial, Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);\n return Math.min(initial + currentTime * rate, this.experimentalBufferBasedABR ? newMax : max);\n };\n\n _proto.bufferHighWaterLine = function bufferHighWaterLine() {\n return Config.BUFFER_HIGH_WATER_LINE;\n };\n\n return MasterPlaylistController;\n}(videojs.EventTarget);\n/**\n * Returns a function that acts as the Enable/disable playlist function.\n *\n * @param {PlaylistLoader} loader - The master playlist loader\n * @param {string} playlistID - id of the playlist\n * @param {Function} changePlaylistFn - A function to be called after a\n * playlist's enabled-state has been changed. Will NOT be called if a\n * playlist's enabled-state is unchanged\n * @param {boolean=} enable - Value to set the playlist enabled-state to\n * or if undefined returns the current enabled-state for the playlist\n * @return {Function} Function for setting/getting enabled\n */\n\n\nvar enableFunction = function enableFunction(loader, playlistID, changePlaylistFn) {\n return function (enable) {\n var playlist = loader.master.playlists[playlistID];\n var incompatible = isIncompatible(playlist);\n var currentlyEnabled = isEnabled(playlist);\n\n if (typeof enable === 'undefined') {\n return currentlyEnabled;\n }\n\n if (enable) {\n delete playlist.disabled;\n } else {\n playlist.disabled = true;\n }\n\n if (enable !== currentlyEnabled && !incompatible) {\n // Ensure the outside world knows about our changes\n changePlaylistFn();\n\n if (enable) {\n loader.trigger('renditionenabled');\n } else {\n loader.trigger('renditiondisabled');\n }\n }\n\n return enable;\n };\n};\n/**\n * The representation object encapsulates the publicly visible information\n * in a media playlist along with a setter/getter-type function (enabled)\n * for changing the enabled-state of a particular playlist entry\n *\n * @class Representation\n */\n\n\nvar Representation = function Representation(vhsHandler, playlist, id) {\n var mpc = vhsHandler.masterPlaylistController_,\n smoothQualityChange = vhsHandler.options_.smoothQualityChange; // Get a reference to a bound version of the quality change function\n\n var changeType = smoothQualityChange ? 'smooth' : 'fast';\n var qualityChangeFunction = mpc[changeType + \"QualityChange_\"].bind(mpc); // some playlist attributes are optional\n\n if (playlist.attributes) {\n var resolution = playlist.attributes.RESOLUTION;\n this.width = resolution && resolution.width;\n this.height = resolution && resolution.height;\n this.bandwidth = playlist.attributes.BANDWIDTH;\n }\n\n this.codecs = video_es_codecsForPlaylist(mpc.master(), playlist);\n this.playlist = playlist; // The id is simply the ordinality of the media playlist\n // within the master playlist\n\n this.id = id; // Partially-apply the enableFunction to create a playlist-\n // specific variant\n\n this.enabled = enableFunction(vhsHandler.playlists, playlist.id, qualityChangeFunction);\n};\n/**\n * A mixin function that adds the `representations` api to an instance\n * of the VhsHandler class\n *\n * @param {VhsHandler} vhsHandler - An instance of VhsHandler to add the\n * representation API into\n */\n\n\nvar renditionSelectionMixin = function renditionSelectionMixin(vhsHandler) {\n // Add a single API-specific function to the VhsHandler instance\n vhsHandler.representations = function () {\n var master = vhsHandler.masterPlaylistController_.master();\n var playlists = video_es_isAudioOnly(master) ? vhsHandler.masterPlaylistController_.getAudioTrackPlaylists_() : master.playlists;\n\n if (!playlists) {\n return [];\n }\n\n return playlists.filter(function (media) {\n return !isIncompatible(media);\n }).map(function (e, i) {\n return new Representation(vhsHandler, e, e.id);\n });\n };\n};\n/**\n * @file playback-watcher.js\n *\n * Playback starts, and now my watch begins. It shall not end until my death. I shall\n * take no wait, hold no uncleared timeouts, father no bad seeks. I shall wear no crowns\n * and win no glory. I shall live and die at my post. I am the corrector of the underflow.\n * I am the watcher of gaps. I am the shield that guards the realms of seekable. I pledge\n * my life and honor to the Playback Watch, for this Player and all the Players to come.\n */\n\n\nvar timerCancelEvents = ['seeking', 'seeked', 'pause', 'playing', 'error'];\n/**\n * Returns whether or not the current time should be considered close to buffered content,\n * taking into consideration whether there's enough buffered content for proper playback.\n *\n * @param {Object} options\n * Options object\n * @param {TimeRange} options.buffered\n * Current buffer\n * @param {number} options.targetDuration\n * The active playlist's target duration\n * @param {number} options.currentTime\n * The current time of the player\n * @return {boolean}\n * Whether the current time should be considered close to the buffer\n */\n\nvar closeToBufferedContent = function closeToBufferedContent(_ref) {\n var buffered = _ref.buffered,\n targetDuration = _ref.targetDuration,\n currentTime = _ref.currentTime;\n\n if (!buffered.length) {\n return false;\n } // At least two to three segments worth of content should be buffered before there's a\n // full enough buffer to consider taking any actions.\n\n\n if (buffered.end(0) - buffered.start(0) < targetDuration * 2) {\n return false;\n } // It's possible that, on seek, a remove hasn't completed and the buffered range is\n // somewhere past the current time. In that event, don't consider the buffered content\n // close.\n\n\n if (currentTime > buffered.start(0)) {\n return false;\n } // Since target duration generally represents the max (or close to max) duration of a\n // segment, if the buffer is within a segment of the current time, the gap probably\n // won't be closed, and current time should be considered close to buffered content.\n\n\n return buffered.start(0) - currentTime < targetDuration;\n};\n/**\n * @class PlaybackWatcher\n */\n\n\nvar video_es_PlaybackWatcher = /*#__PURE__*/function () {\n /**\n * Represents an PlaybackWatcher object.\n *\n * @class\n * @param {Object} options an object that includes the tech and settings\n */\n function PlaybackWatcher(options) {\n var _this = this;\n\n this.masterPlaylistController_ = options.masterPlaylistController;\n this.tech_ = options.tech;\n this.seekable = options.seekable;\n this.allowSeeksWithinUnsafeLiveWindow = options.allowSeeksWithinUnsafeLiveWindow;\n this.liveRangeSafeTimeDelta = options.liveRangeSafeTimeDelta;\n this.media = options.media;\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = null;\n this.timer_ = null;\n this.checkCurrentTimeTimeout_ = null;\n this.logger_ = logger('PlaybackWatcher');\n this.logger_('initialize');\n\n var playHandler = function playHandler() {\n return _this.monitorCurrentTime_();\n };\n\n var canPlayHandler = function canPlayHandler() {\n return _this.monitorCurrentTime_();\n };\n\n var waitingHandler = function waitingHandler() {\n return _this.techWaiting_();\n };\n\n var cancelTimerHandler = function cancelTimerHandler() {\n return _this.cancelTimer_();\n };\n\n var fixesBadSeeksHandler = function fixesBadSeeksHandler() {\n return _this.fixesBadSeeks_();\n };\n\n var mpc = this.masterPlaylistController_;\n var loaderTypes = ['main', 'subtitle', 'audio'];\n var loaderChecks = {};\n loaderTypes.forEach(function (type) {\n loaderChecks[type] = {\n reset: function reset() {\n return _this.resetSegmentDownloads_(type);\n },\n updateend: function updateend() {\n return _this.checkSegmentDownloads_(type);\n }\n };\n mpc[type + \"SegmentLoader_\"].on('appendsdone', loaderChecks[type].updateend); // If a rendition switch happens during a playback stall where the buffer\n // isn't changing we want to reset. We cannot assume that the new rendition\n // will also be stalled, until after new appends.\n\n mpc[type + \"SegmentLoader_\"].on('playlistupdate', loaderChecks[type].reset); // Playback stalls should not be detected right after seeking.\n // This prevents one segment playlists (single vtt or single segment content)\n // from being detected as stalling. As the buffer will not change in those cases, since\n // the buffer is the entire video duration.\n\n _this.tech_.on(['seeked', 'seeking'], loaderChecks[type].reset);\n });\n this.tech_.on('seekablechanged', fixesBadSeeksHandler);\n this.tech_.on('waiting', waitingHandler);\n this.tech_.on(timerCancelEvents, cancelTimerHandler);\n this.tech_.on('canplay', canPlayHandler);\n /*\n An edge case exists that results in gaps not being skipped when they exist at the beginning of a stream. This case\n is surfaced in one of two ways:\n 1) The `waiting` event is fired before the player has buffered content, making it impossible\n to find or skip the gap. The `waiting` event is followed by a `play` event. On first play\n we can check if playback is stalled due to a gap, and skip the gap if necessary.\n 2) A source with a gap at the beginning of the stream is loaded programatically while the player\n is in a playing state. To catch this case, it's important that our one-time play listener is setup\n even if the player is in a playing state\n */\n\n this.tech_.one('play', playHandler); // Define the dispose function to clean up our events\n\n this.dispose = function () {\n _this.logger_('dispose');\n\n _this.tech_.off('seekablechanged', fixesBadSeeksHandler);\n\n _this.tech_.off('waiting', waitingHandler);\n\n _this.tech_.off(timerCancelEvents, cancelTimerHandler);\n\n _this.tech_.off('canplay', canPlayHandler);\n\n _this.tech_.off('play', playHandler);\n\n loaderTypes.forEach(function (type) {\n mpc[type + \"SegmentLoader_\"].off('appendsdone', loaderChecks[type].updateend);\n mpc[type + \"SegmentLoader_\"].off('playlistupdate', loaderChecks[type].reset);\n\n _this.tech_.off(['seeked', 'seeking'], loaderChecks[type].reset);\n });\n\n if (_this.checkCurrentTimeTimeout_) {\n window_default.a.clearTimeout(_this.checkCurrentTimeTimeout_);\n }\n\n _this.cancelTimer_();\n };\n }\n /**\n * Periodically check current time to see if playback stopped\n *\n * @private\n */\n\n\n var _proto = PlaybackWatcher.prototype;\n\n _proto.monitorCurrentTime_ = function monitorCurrentTime_() {\n this.checkCurrentTime_();\n\n if (this.checkCurrentTimeTimeout_) {\n window_default.a.clearTimeout(this.checkCurrentTimeTimeout_);\n } // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n\n\n this.checkCurrentTimeTimeout_ = window_default.a.setTimeout(this.monitorCurrentTime_.bind(this), 250);\n }\n /**\n * Reset stalled download stats for a specific type of loader\n *\n * @param {string} type\n * The segment loader type to check.\n *\n * @listens SegmentLoader#playlistupdate\n * @listens Tech#seeking\n * @listens Tech#seeked\n */\n ;\n\n _proto.resetSegmentDownloads_ = function resetSegmentDownloads_(type) {\n var loader = this.masterPlaylistController_[type + \"SegmentLoader_\"];\n\n if (this[type + \"StalledDownloads_\"] > 0) {\n this.logger_(\"resetting possible stalled download count for \" + type + \" loader\");\n }\n\n this[type + \"StalledDownloads_\"] = 0;\n this[type + \"Buffered_\"] = loader.buffered_();\n }\n /**\n * Checks on every segment `appendsdone` to see\n * if segment appends are making progress. If they are not\n * and we are still downloading bytes. We blacklist the playlist.\n *\n * @param {string} type\n * The segment loader type to check.\n *\n * @listens SegmentLoader#appendsdone\n */\n ;\n\n _proto.checkSegmentDownloads_ = function checkSegmentDownloads_(type) {\n var mpc = this.masterPlaylistController_;\n var loader = mpc[type + \"SegmentLoader_\"];\n var buffered = loader.buffered_();\n var isBufferedDifferent = isRangeDifferent(this[type + \"Buffered_\"], buffered);\n this[type + \"Buffered_\"] = buffered; // if another watcher is going to fix the issue or\n // the buffered value for this loader changed\n // appends are working\n\n if (isBufferedDifferent) {\n this.resetSegmentDownloads_(type);\n return;\n }\n\n this[type + \"StalledDownloads_\"]++;\n this.logger_(\"found #\" + this[type + \"StalledDownloads_\"] + \" \" + type + \" appends that did not increase buffer (possible stalled download)\", {\n playlistId: loader.playlist_ && loader.playlist_.id,\n buffered: timeRangesToArray(buffered)\n }); // after 10 possibly stalled appends with no reset, exclude\n\n if (this[type + \"StalledDownloads_\"] < 10) {\n return;\n }\n\n this.logger_(type + \" loader stalled download exclusion\");\n this.resetSegmentDownloads_(type);\n this.tech_.trigger({\n type: 'usage',\n name: \"vhs-\" + type + \"-download-exclusion\"\n });\n\n if (type === 'subtitle') {\n return;\n } // TODO: should we exclude audio tracks rather than main tracks\n // when type is audio?\n\n\n mpc.blacklistCurrentPlaylist({\n message: \"Excessive \" + type + \" segment downloading detected.\"\n }, Infinity);\n }\n /**\n * The purpose of this function is to emulate the \"waiting\" event on\n * browsers that do not emit it when they are waiting for more\n * data to continue playback\n *\n * @private\n */\n ;\n\n _proto.checkCurrentTime_ = function checkCurrentTime_() {\n if (this.tech_.seeking() && this.fixesBadSeeks_()) {\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = this.tech_.currentTime();\n return;\n }\n\n if (this.tech_.paused() || this.tech_.seeking()) {\n return;\n }\n\n var currentTime = this.tech_.currentTime();\n var buffered = this.tech_.buffered();\n\n if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA >= buffered.end(buffered.length - 1))) {\n // If current time is at the end of the final buffered region, then any playback\n // stall is most likely caused by buffering in a low bandwidth environment. The tech\n // should fire a `waiting` event in this scenario, but due to browser and tech\n // inconsistencies. Calling `techWaiting_` here allows us to simulate\n // responding to a native `waiting` event when the tech fails to emit one.\n return this.techWaiting_();\n }\n\n if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {\n this.consecutiveUpdates++;\n this.waiting_();\n } else if (currentTime === this.lastRecordedTime) {\n this.consecutiveUpdates++;\n } else {\n this.consecutiveUpdates = 0;\n this.lastRecordedTime = currentTime;\n }\n }\n /**\n * Cancels any pending timers and resets the 'timeupdate' mechanism\n * designed to detect that we are stalled\n *\n * @private\n */\n ;\n\n _proto.cancelTimer_ = function cancelTimer_() {\n this.consecutiveUpdates = 0;\n\n if (this.timer_) {\n this.logger_('cancelTimer_');\n clearTimeout(this.timer_);\n }\n\n this.timer_ = null;\n }\n /**\n * Fixes situations where there's a bad seek\n *\n * @return {boolean} whether an action was taken to fix the seek\n * @private\n */\n ;\n\n _proto.fixesBadSeeks_ = function fixesBadSeeks_() {\n var seeking = this.tech_.seeking();\n\n if (!seeking) {\n return false;\n }\n\n var seekable = this.seekable();\n var currentTime = this.tech_.currentTime();\n var isAfterSeekableRange = this.afterSeekableWindow_(seekable, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow);\n var seekTo;\n\n if (isAfterSeekableRange) {\n var seekableEnd = seekable.end(seekable.length - 1); // sync to live point (if VOD, our seekable was updated and we're simply adjusting)\n\n seekTo = seekableEnd;\n }\n\n if (this.beforeSeekableWindow_(seekable, currentTime)) {\n var seekableStart = seekable.start(0); // sync to the beginning of the live window\n // provide a buffer of .1 seconds to handle rounding/imprecise numbers\n\n seekTo = seekableStart + ( // if the playlist is too short and the seekable range is an exact time (can\n // happen in live with a 3 segment playlist), then don't use a time delta\n seekableStart === seekable.end(0) ? 0 : SAFE_TIME_DELTA);\n }\n\n if (typeof seekTo !== 'undefined') {\n this.logger_(\"Trying to seek outside of seekable at time \" + currentTime + \" with \" + (\"seekable range \" + printableRange(seekable) + \". Seeking to \") + (seekTo + \".\"));\n this.tech_.setCurrentTime(seekTo);\n return true;\n }\n\n var buffered = this.tech_.buffered();\n\n if (closeToBufferedContent({\n buffered: buffered,\n targetDuration: this.media().targetDuration,\n currentTime: currentTime\n })) {\n seekTo = buffered.start(0) + SAFE_TIME_DELTA;\n this.logger_(\"Buffered region starts (\" + buffered.start(0) + \") \" + (\" just beyond seek point (\" + currentTime + \"). Seeking to \" + seekTo + \".\"));\n this.tech_.setCurrentTime(seekTo);\n return true;\n }\n\n return false;\n }\n /**\n * Handler for situations when we determine the player is waiting.\n *\n * @private\n */\n ;\n\n _proto.waiting_ = function waiting_() {\n if (this.techWaiting_()) {\n return;\n } // All tech waiting checks failed. Use last resort correction\n\n\n var currentTime = this.tech_.currentTime();\n var buffered = this.tech_.buffered();\n var currentRange = findRange(buffered, currentTime); // Sometimes the player can stall for unknown reasons within a contiguous buffered\n // region with no indication that anything is amiss (seen in Firefox). Seeking to\n // currentTime is usually enough to kickstart the player. This checks that the player\n // is currently within a buffered region before attempting a corrective seek.\n // Chrome does not appear to continue `timeupdate` events after a `waiting` event\n // until there is ~ 3 seconds of forward buffer available. PlaybackWatcher should also\n // make sure there is ~3 seconds of forward buffer before taking any corrective action\n // to avoid triggering an `unknownwaiting` event when the network is slow.\n\n if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {\n this.cancelTimer_();\n this.tech_.setCurrentTime(currentTime);\n this.logger_(\"Stopped at \" + currentTime + \" while inside a buffered region \" + (\"[\" + currentRange.start(0) + \" -> \" + currentRange.end(0) + \"]. Attempting to resume \") + 'playback by seeking to the current time.'); // unknown waiting corrections may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-unknown-waiting'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-unknown-waiting'\n });\n return;\n }\n }\n /**\n * Handler for situations when the tech fires a `waiting` event\n *\n * @return {boolean}\n * True if an action (or none) was needed to correct the waiting. False if no\n * checks passed\n * @private\n */\n ;\n\n _proto.techWaiting_ = function techWaiting_() {\n var seekable = this.seekable();\n var currentTime = this.tech_.currentTime();\n\n if (this.tech_.seeking() && this.fixesBadSeeks_()) {\n // Tech is seeking or bad seek fixed, no action needed\n return true;\n }\n\n if (this.tech_.seeking() || this.timer_ !== null) {\n // Tech is seeking or already waiting on another action, no action needed\n return true;\n }\n\n if (this.beforeSeekableWindow_(seekable, currentTime)) {\n var livePoint = seekable.end(seekable.length - 1);\n this.logger_(\"Fell out of live window at time \" + currentTime + \". Seeking to \" + (\"live point (seekable end) \" + livePoint));\n this.cancelTimer_();\n this.tech_.setCurrentTime(livePoint); // live window resyncs may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-live-resync'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-live-resync'\n });\n return true;\n }\n\n var sourceUpdater = this.tech_.vhs.masterPlaylistController_.sourceUpdater_;\n var buffered = this.tech_.buffered();\n var videoUnderflow = this.videoUnderflow_({\n audioBuffered: sourceUpdater.audioBuffered(),\n videoBuffered: sourceUpdater.videoBuffered(),\n currentTime: currentTime\n });\n\n if (videoUnderflow) {\n // Even though the video underflowed and was stuck in a gap, the audio overplayed\n // the gap, leading currentTime into a buffered range. Seeking to currentTime\n // allows the video to catch up to the audio position without losing any audio\n // (only suffering ~3 seconds of frozen video and a pause in audio playback).\n this.cancelTimer_();\n this.tech_.setCurrentTime(currentTime); // video underflow may be useful for monitoring QoS\n\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-video-underflow'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-video-underflow'\n });\n return true;\n }\n\n var nextRange = findNextRange(buffered, currentTime); // check for gap\n\n if (nextRange.length > 0) {\n var difference = nextRange.start(0) - currentTime;\n this.logger_(\"Stopped at \" + currentTime + \", setting timer for \" + difference + \", seeking \" + (\"to \" + nextRange.start(0)));\n this.cancelTimer_();\n this.timer_ = setTimeout(this.skipTheGap_.bind(this), difference * 1000, currentTime);\n return true;\n } // All checks failed. Returning false to indicate failure to correct waiting\n\n\n return false;\n };\n\n _proto.afterSeekableWindow_ = function afterSeekableWindow_(seekable, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow) {\n if (allowSeeksWithinUnsafeLiveWindow === void 0) {\n allowSeeksWithinUnsafeLiveWindow = false;\n }\n\n if (!seekable.length) {\n // we can't make a solid case if there's no seekable, default to false\n return false;\n }\n\n var allowedEnd = seekable.end(seekable.length - 1) + SAFE_TIME_DELTA;\n var isLive = !playlist.endList;\n\n if (isLive && allowSeeksWithinUnsafeLiveWindow) {\n allowedEnd = seekable.end(seekable.length - 1) + playlist.targetDuration * 3;\n }\n\n if (currentTime > allowedEnd) {\n return true;\n }\n\n return false;\n };\n\n _proto.beforeSeekableWindow_ = function beforeSeekableWindow_(seekable, currentTime) {\n if (seekable.length && // can't fall before 0 and 0 seekable start identifies VOD stream\n seekable.start(0) > 0 && currentTime < seekable.start(0) - this.liveRangeSafeTimeDelta) {\n return true;\n }\n\n return false;\n };\n\n _proto.videoUnderflow_ = function videoUnderflow_(_ref2) {\n var videoBuffered = _ref2.videoBuffered,\n audioBuffered = _ref2.audioBuffered,\n currentTime = _ref2.currentTime; // audio only content will not have video underflow :)\n\n if (!videoBuffered) {\n return;\n }\n\n var gap; // find a gap in demuxed content.\n\n if (videoBuffered.length && audioBuffered.length) {\n // in Chrome audio will continue to play for ~3s when we run out of video\n // so we have to check that the video buffer did have some buffer in the\n // past.\n var lastVideoRange = findRange(videoBuffered, currentTime - 3);\n var videoRange = findRange(videoBuffered, currentTime);\n var audioRange = findRange(audioBuffered, currentTime);\n\n if (audioRange.length && !videoRange.length && lastVideoRange.length) {\n gap = {\n start: lastVideoRange.end(0),\n end: audioRange.end(0)\n };\n } // find a gap in muxed content.\n\n } else {\n var nextRange = findNextRange(videoBuffered, currentTime); // Even if there is no available next range, there is still a possibility we are\n // stuck in a gap due to video underflow.\n\n if (!nextRange.length) {\n gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime);\n }\n }\n\n if (gap) {\n this.logger_(\"Encountered a gap in video from \" + gap.start + \" to \" + gap.end + \". \" + (\"Seeking to current time \" + currentTime));\n return true;\n }\n\n return false;\n }\n /**\n * Timer callback. If playback still has not proceeded, then we seek\n * to the start of the next buffered region.\n *\n * @private\n */\n ;\n\n _proto.skipTheGap_ = function skipTheGap_(scheduledCurrentTime) {\n var buffered = this.tech_.buffered();\n var currentTime = this.tech_.currentTime();\n var nextRange = findNextRange(buffered, currentTime);\n this.cancelTimer_();\n\n if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {\n return;\n }\n\n this.logger_('skipTheGap_:', 'currentTime:', currentTime, 'scheduled currentTime:', scheduledCurrentTime, 'nextRange start:', nextRange.start(0)); // only seek if we still have not played\n\n this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR);\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-gap-skip'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-gap-skip'\n });\n };\n\n _proto.gapFromVideoUnderflow_ = function gapFromVideoUnderflow_(buffered, currentTime) {\n // At least in Chrome, if there is a gap in the video buffer, the audio will continue\n // playing for ~3 seconds after the video gap starts. This is done to account for\n // video buffer underflow/underrun (note that this is not done when there is audio\n // buffer underflow/underrun -- in that case the video will stop as soon as it\n // encounters the gap, as audio stalls are more noticeable/jarring to a user than\n // video stalls). The player's time will reflect the playthrough of audio, so the\n // time will appear as if we are in a buffered region, even if we are stuck in a\n // \"gap.\"\n //\n // Example:\n // video buffer: 0 => 10.1, 10.2 => 20\n // audio buffer: 0 => 20\n // overall buffer: 0 => 10.1, 10.2 => 20\n // current time: 13\n //\n // Chrome's video froze at 10 seconds, where the video buffer encountered the gap,\n // however, the audio continued playing until it reached ~3 seconds past the gap\n // (13 seconds), at which point it stops as well. Since current time is past the\n // gap, findNextRange will return no ranges.\n //\n // To check for this issue, we see if there is a gap that starts somewhere within\n // a 3 second range (3 seconds +/- 1 second) back from our current time.\n var gaps = findGaps(buffered);\n\n for (var i = 0; i < gaps.length; i++) {\n var start = gaps.start(i);\n var end = gaps.end(i); // gap is starts no more than 4 seconds back\n\n if (currentTime - start < 4 && currentTime - start > 2) {\n return {\n start: start,\n end: end\n };\n }\n }\n\n return null;\n };\n\n return PlaybackWatcher;\n}();\n\nvar defaultOptions = {\n errorInterval: 30,\n getSource: function getSource(next) {\n var tech = this.tech({\n IWillNotUseThisInPlugins: true\n });\n var sourceObj = tech.currentSource_ || this.currentSource();\n return next(sourceObj);\n }\n};\n/**\n * Main entry point for the plugin\n *\n * @param {Player} player a reference to a videojs Player instance\n * @param {Object} [options] an object with plugin options\n * @private\n */\n\nvar initPlugin = function initPlugin(player, options) {\n var lastCalled = 0;\n var seekTo = 0;\n var localOptions = videojs.mergeOptions(defaultOptions, options);\n player.ready(function () {\n player.trigger({\n type: 'usage',\n name: 'vhs-error-reload-initialized'\n });\n player.trigger({\n type: 'usage',\n name: 'hls-error-reload-initialized'\n });\n });\n /**\n * Player modifications to perform that must wait until `loadedmetadata`\n * has been triggered\n *\n * @private\n */\n\n var loadedMetadataHandler = function loadedMetadataHandler() {\n if (seekTo) {\n player.currentTime(seekTo);\n }\n };\n /**\n * Set the source on the player element, play, and seek if necessary\n *\n * @param {Object} sourceObj An object specifying the source url and mime-type to play\n * @private\n */\n\n\n var setSource = function setSource(sourceObj) {\n if (sourceObj === null || sourceObj === undefined) {\n return;\n }\n\n seekTo = player.duration() !== Infinity && player.currentTime() || 0;\n player.one('loadedmetadata', loadedMetadataHandler);\n player.src(sourceObj);\n player.trigger({\n type: 'usage',\n name: 'vhs-error-reload'\n });\n player.trigger({\n type: 'usage',\n name: 'hls-error-reload'\n });\n player.play();\n };\n /**\n * Attempt to get a source from either the built-in getSource function\n * or a custom function provided via the options\n *\n * @private\n */\n\n\n var errorHandler = function errorHandler() {\n // Do not attempt to reload the source if a source-reload occurred before\n // 'errorInterval' time has elapsed since the last source-reload\n if (Date.now() - lastCalled < localOptions.errorInterval * 1000) {\n player.trigger({\n type: 'usage',\n name: 'vhs-error-reload-canceled'\n });\n player.trigger({\n type: 'usage',\n name: 'hls-error-reload-canceled'\n });\n return;\n }\n\n if (!localOptions.getSource || typeof localOptions.getSource !== 'function') {\n videojs.log.error('ERROR: reloadSourceOnError - The option getSource must be a function!');\n return;\n }\n\n lastCalled = Date.now();\n return localOptions.getSource.call(player, setSource);\n };\n /**\n * Unbind any event handlers that were bound by the plugin\n *\n * @private\n */\n\n\n var cleanupEvents = function cleanupEvents() {\n player.off('loadedmetadata', loadedMetadataHandler);\n player.off('error', errorHandler);\n player.off('dispose', cleanupEvents);\n };\n /**\n * Cleanup before re-initializing the plugin\n *\n * @param {Object} [newOptions] an object with plugin options\n * @private\n */\n\n\n var reinitPlugin = function reinitPlugin(newOptions) {\n cleanupEvents();\n initPlugin(player, newOptions);\n };\n\n player.on('error', errorHandler);\n player.on('dispose', cleanupEvents); // Overwrite the plugin function so that we can correctly cleanup before\n // initializing the plugin\n\n player.reloadSourceOnError = reinitPlugin;\n};\n/**\n * Reload the source when an error is detected as long as there\n * wasn't an error previously within the last 30 seconds\n *\n * @param {Object} [options] an object with plugin options\n */\n\n\nvar reloadSourceOnError = function reloadSourceOnError(options) {\n initPlugin(this, options);\n};\n\nvar version$4 = \"2.10.2\";\nvar version$3 = \"5.13.0\";\nvar version$2 = \"0.19.0\";\nvar version$1 = \"4.7.0\";\nvar video_es_version = \"3.1.2\";\nvar Vhs = {\n PlaylistLoader: video_es_PlaylistLoader,\n Playlist: Playlist,\n utils: utils,\n STANDARD_PLAYLIST_SELECTOR: video_es_lastBandwidthSelector,\n INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector,\n lastBandwidthSelector: video_es_lastBandwidthSelector,\n movingAverageBandwidthSelector: video_es_movingAverageBandwidthSelector,\n comparePlaylistBandwidth: video_es_comparePlaylistBandwidth,\n comparePlaylistResolution: video_es_comparePlaylistResolution,\n xhr: xhrFactory()\n}; // Define getter/setters for config properties\n\nObject.keys(Config).forEach(function (prop) {\n Object.defineProperty(Vhs, prop, {\n get: function get() {\n videojs.log.warn(\"using Vhs.\" + prop + \" is UNSAFE be sure you know what you are doing\");\n return Config[prop];\n },\n set: function set(value) {\n videojs.log.warn(\"using Vhs.\" + prop + \" is UNSAFE be sure you know what you are doing\");\n\n if (typeof value !== 'number' || value < 0) {\n videojs.log.warn(\"value of Vhs.\" + prop + \" must be greater than or equal to 0\");\n return;\n }\n\n Config[prop] = value;\n }\n });\n});\nvar LOCAL_STORAGE_KEY = 'videojs-vhs';\n/**\n * Updates the selectedIndex of the QualityLevelList when a mediachange happens in vhs.\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to update.\n * @param {PlaylistLoader} playlistLoader PlaylistLoader containing the new media info.\n * @function handleVhsMediaChange\n */\n\nvar handleVhsMediaChange = function handleVhsMediaChange(qualityLevels, playlistLoader) {\n var newPlaylist = playlistLoader.media();\n var selectedIndex = -1;\n\n for (var i = 0; i < qualityLevels.length; i++) {\n if (qualityLevels[i].id === newPlaylist.id) {\n selectedIndex = i;\n break;\n }\n }\n\n qualityLevels.selectedIndex_ = selectedIndex;\n qualityLevels.trigger({\n selectedIndex: selectedIndex,\n type: 'change'\n });\n};\n/**\n * Adds quality levels to list once playlist metadata is available\n *\n * @param {QualityLevelList} qualityLevels The QualityLevelList to attach events to.\n * @param {Object} vhs Vhs object to listen to for media events.\n * @function handleVhsLoadedMetadata\n */\n\n\nvar handleVhsLoadedMetadata = function handleVhsLoadedMetadata(qualityLevels, vhs) {\n vhs.representations().forEach(function (rep) {\n qualityLevels.addQualityLevel(rep);\n });\n handleVhsMediaChange(qualityLevels, vhs.playlists);\n}; // HLS is a source handler, not a tech. Make sure attempts to use it\n// as one do not cause exceptions.\n\n\nVhs.canPlaySource = function () {\n return videojs.log.warn('HLS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n\nvar video_es_emeKeySystems = function emeKeySystems(keySystemOptions, mainPlaylist, audioPlaylist) {\n if (!keySystemOptions) {\n return keySystemOptions;\n }\n\n var codecs = {};\n\n if (mainPlaylist && mainPlaylist.attributes && mainPlaylist.attributes.CODECS) {\n codecs = video_es_unwrapCodecList(parseCodecs(mainPlaylist.attributes.CODECS));\n }\n\n if (audioPlaylist && audioPlaylist.attributes && audioPlaylist.attributes.CODECS) {\n codecs.audio = audioPlaylist.attributes.CODECS;\n }\n\n var videoContentType = getMimeForCodec(codecs.video);\n var audioContentType = getMimeForCodec(codecs.audio); // upsert the content types based on the selected playlist\n\n var keySystemContentTypes = {};\n\n for (var keySystem in keySystemOptions) {\n keySystemContentTypes[keySystem] = {};\n\n if (audioContentType) {\n keySystemContentTypes[keySystem].audioContentType = audioContentType;\n }\n\n if (videoContentType) {\n keySystemContentTypes[keySystem].videoContentType = videoContentType;\n } // Default to using the video playlist's PSSH even though they may be different, as\n // videojs-contrib-eme will only accept one in the options.\n //\n // This shouldn't be an issue for most cases as early intialization will handle all\n // unique PSSH values, and if they aren't, then encrypted events should have the\n // specific information needed for the unique license.\n\n\n if (mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh) {\n keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh;\n } // videojs-contrib-eme accepts the option of specifying: 'com.some.cdm': 'url'\n // so we need to prevent overwriting the URL entirely\n\n\n if (typeof keySystemOptions[keySystem] === 'string') {\n keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];\n }\n }\n\n return videojs.mergeOptions(keySystemOptions, keySystemContentTypes);\n};\n/**\n * @typedef {Object} KeySystems\n *\n * keySystems configuration for https://github.com/videojs/videojs-contrib-eme\n * Note: not all options are listed here.\n *\n * @property {Uint8Array} [pssh]\n * Protection System Specific Header\n */\n\n/**\n * Goes through all the playlists and collects an array of KeySystems options objects\n * containing each playlist's keySystems and their pssh values, if available.\n *\n * @param {Object[]} playlists\n * The playlists to look through\n * @param {string[]} keySystems\n * The keySystems to collect pssh values for\n *\n * @return {KeySystems[]}\n * An array of KeySystems objects containing available key systems and their\n * pssh values\n */\n\n\nvar getAllPsshKeySystemsOptions = function getAllPsshKeySystemsOptions(playlists, keySystems) {\n return playlists.reduce(function (keySystemsArr, playlist) {\n if (!playlist.contentProtection) {\n return keySystemsArr;\n }\n\n var keySystemsOptions = keySystems.reduce(function (keySystemsObj, keySystem) {\n var keySystemOptions = playlist.contentProtection[keySystem];\n\n if (keySystemOptions && keySystemOptions.pssh) {\n keySystemsObj[keySystem] = {\n pssh: keySystemOptions.pssh\n };\n }\n\n return keySystemsObj;\n }, {});\n\n if (Object.keys(keySystemsOptions).length) {\n keySystemsArr.push(keySystemsOptions);\n }\n\n return keySystemsArr;\n }, []);\n};\n/**\n * Returns a promise that waits for the\n * [eme plugin](https://github.com/videojs/videojs-contrib-eme) to create a key session.\n *\n * Works around https://bugs.chromium.org/p/chromium/issues/detail?id=895449 in non-IE11\n * browsers.\n *\n * As per the above ticket, this is particularly important for Chrome, where, if\n * unencrypted content is appended before encrypted content and the key session has not\n * been created, a MEDIA_ERR_DECODE will be thrown once the encrypted content is reached\n * during playback.\n *\n * @param {Object} player\n * The player instance\n * @param {Object[]} sourceKeySystems\n * The key systems options from the player source\n * @param {Object} [audioMedia]\n * The active audio media playlist (optional)\n * @param {Object[]} mainPlaylists\n * The playlists found on the master playlist object\n *\n * @return {Object}\n * Promise that resolves when the key session has been created\n */\n\n\nvar waitForKeySessionCreation = function waitForKeySessionCreation(_ref) {\n var player = _ref.player,\n sourceKeySystems = _ref.sourceKeySystems,\n audioMedia = _ref.audioMedia,\n mainPlaylists = _ref.mainPlaylists;\n\n if (!player.eme.initializeMediaKeys) {\n return Promise.resolve();\n } // TODO should all audio PSSH values be initialized for DRM?\n //\n // All unique video rendition pssh values are initialized for DRM, but here only\n // the initial audio playlist license is initialized. In theory, an encrypted\n // event should be fired if the user switches to an alternative audio playlist\n // where a license is required, but this case hasn't yet been tested. In addition, there\n // may be many alternate audio playlists unlikely to be used (e.g., multiple different\n // languages).\n\n\n var playlists = audioMedia ? mainPlaylists.concat([audioMedia]) : mainPlaylists;\n var keySystemsOptionsArr = getAllPsshKeySystemsOptions(playlists, Object.keys(sourceKeySystems));\n var initializationFinishedPromises = [];\n var keySessionCreatedPromises = []; // Since PSSH values are interpreted as initData, EME will dedupe any duplicates. The\n // only place where it should not be deduped is for ms-prefixed APIs, but the early\n // return for IE11 above, and the existence of modern EME APIs in addition to\n // ms-prefixed APIs on Edge should prevent this from being a concern.\n // initializeMediaKeys also won't use the webkit-prefixed APIs.\n\n keySystemsOptionsArr.forEach(function (keySystemsOptions) {\n keySessionCreatedPromises.push(new Promise(function (resolve, reject) {\n player.tech_.one('keysessioncreated', resolve);\n }));\n initializationFinishedPromises.push(new Promise(function (resolve, reject) {\n player.eme.initializeMediaKeys({\n keySystems: keySystemsOptions\n }, function (err) {\n if (err) {\n reject(err);\n return;\n }\n\n resolve();\n });\n }));\n }); // The reasons Promise.race is chosen over Promise.any:\n //\n // * Promise.any is only available in Safari 14+.\n // * None of these promises are expected to reject. If they do reject, it might be\n // better here for the race to surface the rejection, rather than mask it by using\n // Promise.any.\n\n return Promise.race([// If a session was previously created, these will all finish resolving without\n // creating a new session, otherwise it will take until the end of all license\n // requests, which is why the key session check is used (to make setup much faster).\n Promise.all(initializationFinishedPromises), // Once a single session is created, the browser knows DRM will be used.\n Promise.race(keySessionCreatedPromises)]);\n};\n/**\n * If the [eme](https://github.com/videojs/videojs-contrib-eme) plugin is available, and\n * there are keySystems on the source, sets up source options to prepare the source for\n * eme.\n *\n * @param {Object} player\n * The player instance\n * @param {Object[]} sourceKeySystems\n * The key systems options from the player source\n * @param {Object} media\n * The active media playlist\n * @param {Object} [audioMedia]\n * The active audio media playlist (optional)\n *\n * @return {boolean}\n * Whether or not options were configured and EME is available\n */\n\n\nvar setupEmeOptions = function setupEmeOptions(_ref2) {\n var player = _ref2.player,\n sourceKeySystems = _ref2.sourceKeySystems,\n media = _ref2.media,\n audioMedia = _ref2.audioMedia;\n var sourceOptions = video_es_emeKeySystems(sourceKeySystems, media, audioMedia);\n\n if (!sourceOptions) {\n return false;\n }\n\n player.currentSource().keySystems = sourceOptions; // eme handles the rest of the setup, so if it is missing\n // do nothing.\n\n if (sourceOptions && !player.eme) {\n videojs.log.warn('DRM encrypted source cannot be decrypted without a DRM plugin');\n return false;\n }\n\n return true;\n};\n\nvar video_es_getVhsLocalStorage = function getVhsLocalStorage() {\n if (!window_default.a.localStorage) {\n return null;\n }\n\n var storedObject = window_default.a.localStorage.getItem(LOCAL_STORAGE_KEY);\n\n if (!storedObject) {\n return null;\n }\n\n try {\n return JSON.parse(storedObject);\n } catch (e) {\n // someone may have tampered with the value\n return null;\n }\n};\n\nvar video_es_updateVhsLocalStorage = function updateVhsLocalStorage(options) {\n if (!window_default.a.localStorage) {\n return false;\n }\n\n var objectToStore = video_es_getVhsLocalStorage();\n objectToStore = objectToStore ? videojs.mergeOptions(objectToStore, options) : options;\n\n try {\n window_default.a.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(objectToStore));\n } catch (e) {\n // Throws if storage is full (e.g., always on iOS 5+ Safari private mode, where\n // storage is set to 0).\n // https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem#Exceptions\n // No need to perform any operation.\n return false;\n }\n\n return objectToStore;\n};\n/**\n * Parses VHS-supported media types from data URIs. See\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n * for information on data URIs.\n *\n * @param {string} dataUri\n * The data URI\n *\n * @return {string|Object}\n * The parsed object/string, or the original string if no supported media type\n * was found\n */\n\n\nvar expandDataUri = function expandDataUri(dataUri) {\n if (dataUri.toLowerCase().indexOf('data:application/vnd.videojs.vhs+json,') === 0) {\n return JSON.parse(dataUri.substring(dataUri.indexOf(',') + 1));\n } // no known case for this data URI, return the string as-is\n\n\n return dataUri;\n};\n/**\n * Whether the browser has built-in HLS support.\n */\n\n\nVhs.supportsNativeHls = function () {\n if (!document_default.a || !document_default.a.createElement) {\n return false;\n }\n\n var video = document_default.a.createElement('video'); // native HLS is definitely not supported if HTML5 video isn't\n\n if (!videojs.getTech('Html5').isSupported()) {\n return false;\n } // HLS manifests can go by many mime-types\n\n\n var canPlay = [// Apple santioned\n 'application/vnd.apple.mpegurl', // Apple sanctioned for backwards compatibility\n 'audio/mpegurl', // Very common\n 'audio/x-mpegurl', // Very common\n 'application/x-mpegurl', // Included for completeness\n 'video/x-mpegurl', 'video/mpegurl', 'application/mpegurl'];\n return canPlay.some(function (canItPlay) {\n return /maybe|probably/i.test(video.canPlayType(canItPlay));\n });\n}();\n\nVhs.supportsNativeDash = function () {\n if (!document_default.a || !document_default.a.createElement || !videojs.getTech('Html5').isSupported()) {\n return false;\n }\n\n return /maybe|probably/i.test(document_default.a.createElement('video').canPlayType('application/dash+xml'));\n}();\n\nVhs.supportsTypeNatively = function (type) {\n if (type === 'hls') {\n return Vhs.supportsNativeHls;\n }\n\n if (type === 'dash') {\n return Vhs.supportsNativeDash;\n }\n\n return false;\n};\n/**\n * HLS is a source handler, not a tech. Make sure attempts to use it\n * as one do not cause exceptions.\n */\n\n\nVhs.isSupported = function () {\n return videojs.log.warn('HLS is no longer a tech. Please remove it from ' + 'your player\\'s techOrder.');\n};\n\nvar video_es_Component = videojs.getComponent('Component');\n/**\n * The Vhs Handler object, where we orchestrate all of the parts\n * of HLS to interact with video.js\n *\n * @class VhsHandler\n * @extends videojs.Component\n * @param {Object} source the soruce object\n * @param {Tech} tech the parent tech object\n * @param {Object} options optional and required options\n */\n\nvar video_es_VhsHandler = /*#__PURE__*/function (_Component) {\n inheritsLoose_default()(VhsHandler, _Component);\n\n function VhsHandler(source, tech, options) {\n var _this;\n\n _this = _Component.call(this, tech, videojs.mergeOptions(options.hls, options.vhs)) || this;\n\n if (options.hls && Object.keys(options.hls).length) {\n videojs.log.warn('Using hls options is deprecated. Use vhs instead.');\n } // if a tech level `initialBandwidth` option was passed\n // use that over the VHS level `bandwidth` option\n\n\n if (typeof options.initialBandwidth === 'number') {\n _this.options_.bandwidth = options.initialBandwidth;\n }\n\n _this.logger_ = logger('VhsHandler'); // tech.player() is deprecated but setup a reference to HLS for\n // backwards-compatibility\n\n if (tech.options_ && tech.options_.playerId) {\n var _player = videojs(tech.options_.playerId);\n\n if (!_player.hasOwnProperty('hls')) {\n Object.defineProperty(_player, 'hls', {\n get: function get() {\n videojs.log.warn('player.hls is deprecated. Use player.tech().vhs instead.');\n tech.trigger({\n type: 'usage',\n name: 'hls-player-access'\n });\n return assertThisInitialized_default()(_this);\n },\n configurable: true\n });\n }\n\n if (!_player.hasOwnProperty('vhs')) {\n Object.defineProperty(_player, 'vhs', {\n get: function get() {\n videojs.log.warn('player.vhs is deprecated. Use player.tech().vhs instead.');\n tech.trigger({\n type: 'usage',\n name: 'vhs-player-access'\n });\n return assertThisInitialized_default()(_this);\n },\n configurable: true\n });\n }\n\n if (!_player.hasOwnProperty('dash')) {\n Object.defineProperty(_player, 'dash', {\n get: function get() {\n videojs.log.warn('player.dash is deprecated. Use player.tech().vhs instead.');\n return assertThisInitialized_default()(_this);\n },\n configurable: true\n });\n }\n\n _this.player_ = _player;\n }\n\n _this.tech_ = tech;\n _this.source_ = source;\n _this.stats = {};\n _this.ignoreNextSeekingEvent_ = false;\n\n _this.setOptions_();\n\n if (_this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {\n tech.overrideNativeAudioTracks(true);\n tech.overrideNativeVideoTracks(true);\n } else if (_this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {\n // overriding native HLS only works if audio tracks have been emulated\n // error early if we're misconfigured\n throw new Error('Overriding native HLS requires emulated tracks. ' + 'See https://git.io/vMpjB');\n } // listen for fullscreenchange events for this player so that we\n // can adjust our quality selection quickly\n\n\n _this.on(document_default.a, ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'], function (event) {\n var fullscreenElement = document_default.a.fullscreenElement || document_default.a.webkitFullscreenElement || document_default.a.mozFullScreenElement || document_default.a.msFullscreenElement;\n\n if (fullscreenElement && fullscreenElement.contains(_this.tech_.el())) {\n _this.masterPlaylistController_.fastQualityChange_();\n } else {\n // When leaving fullscreen, since the in page pixel dimensions should be smaller\n // than full screen, see if there should be a rendition switch down to preserve\n // bandwidth.\n _this.masterPlaylistController_.checkABR_();\n }\n });\n\n _this.on(_this.tech_, 'seeking', function () {\n if (this.ignoreNextSeekingEvent_) {\n this.ignoreNextSeekingEvent_ = false;\n return;\n }\n\n this.setCurrentTime(this.tech_.currentTime());\n });\n\n _this.on(_this.tech_, 'error', function () {\n // verify that the error was real and we are loaded\n // enough to have mpc loaded.\n if (this.tech_.error() && this.masterPlaylistController_) {\n this.masterPlaylistController_.pauseLoading();\n }\n });\n\n _this.on(_this.tech_, 'play', _this.play);\n\n return _this;\n }\n\n var _proto = VhsHandler.prototype;\n\n _proto.setOptions_ = function setOptions_() {\n var _this2 = this; // defaults\n\n\n this.options_.withCredentials = this.options_.withCredentials || false;\n this.options_.handleManifestRedirects = this.options_.handleManifestRedirects === false ? false : true;\n this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;\n this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || false;\n this.options_.smoothQualityChange = this.options_.smoothQualityChange || false;\n this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== 'undefined' ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;\n this.options_.customTagParsers = this.options_.customTagParsers || [];\n this.options_.customTagMappers = this.options_.customTagMappers || [];\n this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;\n\n if (typeof this.options_.blacklistDuration !== 'number') {\n this.options_.blacklistDuration = 5 * 60;\n }\n\n if (typeof this.options_.bandwidth !== 'number') {\n if (this.options_.useBandwidthFromLocalStorage) {\n var storedObject = video_es_getVhsLocalStorage();\n\n if (storedObject && storedObject.bandwidth) {\n this.options_.bandwidth = storedObject.bandwidth;\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-bandwidth-from-local-storage'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-bandwidth-from-local-storage'\n });\n }\n\n if (storedObject && storedObject.throughput) {\n this.options_.throughput = storedObject.throughput;\n this.tech_.trigger({\n type: 'usage',\n name: 'vhs-throughput-from-local-storage'\n });\n this.tech_.trigger({\n type: 'usage',\n name: 'hls-throughput-from-local-storage'\n });\n }\n }\n } // if bandwidth was not set by options or pulled from local storage, start playlist\n // selection at a reasonable bandwidth\n\n\n if (typeof this.options_.bandwidth !== 'number') {\n this.options_.bandwidth = Config.INITIAL_BANDWIDTH;\n } // If the bandwidth number is unchanged from the initial setting\n // then this takes precedence over the enableLowInitialPlaylist option\n\n\n this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config.INITIAL_BANDWIDTH; // grab options passed to player.src\n\n ['withCredentials', 'useDevicePixelRatio', 'limitRenditionByPlayerDimensions', 'bandwidth', 'smoothQualityChange', 'customTagParsers', 'customTagMappers', 'handleManifestRedirects', 'cacheEncryptionKeys', 'playlistSelector', 'initialPlaylistSelector', 'experimentalBufferBasedABR', 'liveRangeSafeTimeDelta', 'experimentalLLHLS', 'experimentalExactManifestTimings', 'experimentalLeastPixelDiffSelector'].forEach(function (option) {\n if (typeof _this2.source_[option] !== 'undefined') {\n _this2.options_[option] = _this2.source_[option];\n }\n });\n this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;\n this.useDevicePixelRatio = this.options_.useDevicePixelRatio;\n }\n /**\n * called when player.src gets called, handle a new source\n *\n * @param {Object} src the source object to handle\n */\n ;\n\n _proto.src = function src(_src, type) {\n var _this3 = this; // do nothing if the src is falsey\n\n\n if (!_src) {\n return;\n }\n\n this.setOptions_(); // add master playlist controller options\n\n this.options_.src = expandDataUri(this.source_.src);\n this.options_.tech = this.tech_;\n this.options_.externVhs = Vhs;\n this.options_.sourceType = simpleTypeFromSourceType(type); // Whenever we seek internally, we should update the tech\n\n this.options_.seekTo = function (time) {\n _this3.tech_.setCurrentTime(time);\n };\n\n if (this.options_.smoothQualityChange) {\n videojs.log.warn('smoothQualityChange is deprecated and will be removed in the next major version');\n }\n\n this.masterPlaylistController_ = new video_es_MasterPlaylistController(this.options_);\n var playbackWatcherOptions = videojs.mergeOptions({\n liveRangeSafeTimeDelta: SAFE_TIME_DELTA\n }, this.options_, {\n seekable: function seekable() {\n return _this3.seekable();\n },\n media: function media() {\n return _this3.masterPlaylistController_.media();\n },\n masterPlaylistController: this.masterPlaylistController_\n });\n this.playbackWatcher_ = new video_es_PlaybackWatcher(playbackWatcherOptions);\n this.masterPlaylistController_.on('error', function () {\n var player = videojs.players[_this3.tech_.options_.playerId];\n var error = _this3.masterPlaylistController_.error;\n\n if (typeof error === 'object' && !error.code) {\n error.code = 3;\n } else if (typeof error === 'string') {\n error = {\n message: error,\n code: 3\n };\n }\n\n player.error(error);\n });\n var defaultSelector = this.options_.experimentalBufferBasedABR ? Vhs.movingAverageBandwidthSelector(0.55) : Vhs.STANDARD_PLAYLIST_SELECTOR; // `this` in selectPlaylist should be the VhsHandler for backwards\n // compatibility with < v2\n\n this.masterPlaylistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this);\n this.masterPlaylistController_.selectInitialPlaylist = Vhs.INITIAL_PLAYLIST_SELECTOR.bind(this); // re-expose some internal objects for backwards compatibility with < v2\n\n this.playlists = this.masterPlaylistController_.masterPlaylistLoader_;\n this.mediaSource = this.masterPlaylistController_.mediaSource; // Proxy assignment of some properties to the master playlist\n // controller. Using a custom property for backwards compatibility\n // with < v2\n\n Object.defineProperties(this, {\n selectPlaylist: {\n get: function get() {\n return this.masterPlaylistController_.selectPlaylist;\n },\n set: function set(selectPlaylist) {\n this.masterPlaylistController_.selectPlaylist = selectPlaylist.bind(this);\n }\n },\n throughput: {\n get: function get() {\n return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate;\n },\n set: function set(throughput) {\n this.masterPlaylistController_.mainSegmentLoader_.throughput.rate = throughput; // By setting `count` to 1 the throughput value becomes the starting value\n // for the cumulative average\n\n this.masterPlaylistController_.mainSegmentLoader_.throughput.count = 1;\n }\n },\n bandwidth: {\n get: function get() {\n return this.masterPlaylistController_.mainSegmentLoader_.bandwidth;\n },\n set: function set(bandwidth) {\n this.masterPlaylistController_.mainSegmentLoader_.bandwidth = bandwidth; // setting the bandwidth manually resets the throughput counter\n // `count` is set to zero that current value of `rate` isn't included\n // in the cumulative average\n\n this.masterPlaylistController_.mainSegmentLoader_.throughput = {\n rate: 0,\n count: 0\n };\n }\n },\n\n /**\n * `systemBandwidth` is a combination of two serial processes bit-rates. The first\n * is the network bitrate provided by `bandwidth` and the second is the bitrate of\n * the entire process after that - decryption, transmuxing, and appending - provided\n * by `throughput`.\n *\n * Since the two process are serial, the overall system bandwidth is given by:\n * sysBandwidth = 1 / (1 / bandwidth + 1 / throughput)\n */\n systemBandwidth: {\n get: function get() {\n var invBandwidth = 1 / (this.bandwidth || 1);\n var invThroughput;\n\n if (this.throughput > 0) {\n invThroughput = 1 / this.throughput;\n } else {\n invThroughput = 0;\n }\n\n var systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));\n return systemBitrate;\n },\n set: function set() {\n videojs.log.error('The \"systemBandwidth\" property is read-only');\n }\n }\n });\n\n if (this.options_.bandwidth) {\n this.bandwidth = this.options_.bandwidth;\n }\n\n if (this.options_.throughput) {\n this.throughput = this.options_.throughput;\n }\n\n Object.defineProperties(this.stats, {\n bandwidth: {\n get: function get() {\n return _this3.bandwidth || 0;\n },\n enumerable: true\n },\n mediaRequests: {\n get: function get() {\n return _this3.masterPlaylistController_.mediaRequests_() || 0;\n },\n enumerable: true\n },\n mediaRequestsAborted: {\n get: function get() {\n return _this3.masterPlaylistController_.mediaRequestsAborted_() || 0;\n },\n enumerable: true\n },\n mediaRequestsTimedout: {\n get: function get() {\n return _this3.masterPlaylistController_.mediaRequestsTimedout_() || 0;\n },\n enumerable: true\n },\n mediaRequestsErrored: {\n get: function get() {\n return _this3.masterPlaylistController_.mediaRequestsErrored_() || 0;\n },\n enumerable: true\n },\n mediaTransferDuration: {\n get: function get() {\n return _this3.masterPlaylistController_.mediaTransferDuration_() || 0;\n },\n enumerable: true\n },\n mediaBytesTransferred: {\n get: function get() {\n return _this3.masterPlaylistController_.mediaBytesTransferred_() || 0;\n },\n enumerable: true\n },\n mediaSecondsLoaded: {\n get: function get() {\n return _this3.masterPlaylistController_.mediaSecondsLoaded_() || 0;\n },\n enumerable: true\n },\n mediaAppends: {\n get: function get() {\n return _this3.masterPlaylistController_.mediaAppends_() || 0;\n },\n enumerable: true\n },\n mainAppendsToLoadedData: {\n get: function get() {\n return _this3.masterPlaylistController_.mainAppendsToLoadedData_() || 0;\n },\n enumerable: true\n },\n audioAppendsToLoadedData: {\n get: function get() {\n return _this3.masterPlaylistController_.audioAppendsToLoadedData_() || 0;\n },\n enumerable: true\n },\n appendsToLoadedData: {\n get: function get() {\n return _this3.masterPlaylistController_.appendsToLoadedData_() || 0;\n },\n enumerable: true\n },\n timeToLoadedData: {\n get: function get() {\n return _this3.masterPlaylistController_.timeToLoadedData_() || 0;\n },\n enumerable: true\n },\n buffered: {\n get: function get() {\n return timeRangesToArray(_this3.tech_.buffered());\n },\n enumerable: true\n },\n currentTime: {\n get: function get() {\n return _this3.tech_.currentTime();\n },\n enumerable: true\n },\n currentSource: {\n get: function get() {\n return _this3.tech_.currentSource_;\n },\n enumerable: true\n },\n currentTech: {\n get: function get() {\n return _this3.tech_.name_;\n },\n enumerable: true\n },\n duration: {\n get: function get() {\n return _this3.tech_.duration();\n },\n enumerable: true\n },\n master: {\n get: function get() {\n return _this3.playlists.master;\n },\n enumerable: true\n },\n playerDimensions: {\n get: function get() {\n return _this3.tech_.currentDimensions();\n },\n enumerable: true\n },\n seekable: {\n get: function get() {\n return timeRangesToArray(_this3.tech_.seekable());\n },\n enumerable: true\n },\n timestamp: {\n get: function get() {\n return Date.now();\n },\n enumerable: true\n },\n videoPlaybackQuality: {\n get: function get() {\n return _this3.tech_.getVideoPlaybackQuality();\n },\n enumerable: true\n }\n });\n this.tech_.one('canplay', this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));\n this.tech_.on('bandwidthupdate', function () {\n if (_this3.options_.useBandwidthFromLocalStorage) {\n video_es_updateVhsLocalStorage({\n bandwidth: _this3.bandwidth,\n throughput: Math.round(_this3.throughput)\n });\n }\n });\n this.masterPlaylistController_.on('selectedinitialmedia', function () {\n // Add the manual rendition mix-in to VhsHandler\n renditionSelectionMixin(_this3);\n });\n this.masterPlaylistController_.sourceUpdater_.on('createdsourcebuffers', function () {\n _this3.setupEme_();\n }); // the bandwidth of the primary segment loader is our best\n // estimate of overall bandwidth\n\n this.on(this.masterPlaylistController_, 'progress', function () {\n this.tech_.trigger('progress');\n }); // In the live case, we need to ignore the very first `seeking` event since\n // that will be the result of the seek-to-live behavior\n\n this.on(this.masterPlaylistController_, 'firstplay', function () {\n this.ignoreNextSeekingEvent_ = true;\n });\n this.setupQualityLevels_(); // do nothing if the tech has been disposed already\n // this can occur if someone sets the src in player.ready(), for instance\n\n if (!this.tech_.el()) {\n return;\n }\n\n this.mediaSourceUrl_ = window_default.a.URL.createObjectURL(this.masterPlaylistController_.mediaSource);\n this.tech_.src(this.mediaSourceUrl_);\n }\n /**\n * If necessary and EME is available, sets up EME options and waits for key session\n * creation.\n *\n * This function also updates the source updater so taht it can be used, as for some\n * browsers, EME must be configured before content is appended (if appending unencrypted\n * content before encrypted content).\n */\n ;\n\n _proto.setupEme_ = function setupEme_() {\n var _this4 = this;\n\n var audioPlaylistLoader = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;\n var didSetupEmeOptions = setupEmeOptions({\n player: this.player_,\n sourceKeySystems: this.source_.keySystems,\n media: this.playlists.media(),\n audioMedia: audioPlaylistLoader && audioPlaylistLoader.media()\n });\n this.player_.tech_.on('keystatuschange', function (e) {\n if (e.status === 'output-restricted') {\n _this4.masterPlaylistController_.blacklistCurrentPlaylist({\n playlist: _this4.masterPlaylistController_.media(),\n message: \"DRM keystatus changed to \" + e.status + \". Playlist will fail to play. Check for HDCP content.\",\n blacklistDuration: Infinity\n });\n }\n }); // In IE11 this is too early to initialize media keys, and IE11 does not support\n // promises.\n\n if (videojs.browser.IE_VERSION === 11 || !didSetupEmeOptions) {\n // If EME options were not set up, we've done all we could to initialize EME.\n this.masterPlaylistController_.sourceUpdater_.initializedEme();\n return;\n }\n\n this.logger_('waiting for EME key session creation');\n waitForKeySessionCreation({\n player: this.player_,\n sourceKeySystems: this.source_.keySystems,\n audioMedia: audioPlaylistLoader && audioPlaylistLoader.media(),\n mainPlaylists: this.playlists.master.playlists\n }).then(function () {\n _this4.logger_('created EME key session');\n\n _this4.masterPlaylistController_.sourceUpdater_.initializedEme();\n })[\"catch\"](function (err) {\n _this4.logger_('error while creating EME key session', err);\n\n _this4.player_.error({\n message: 'Failed to initialize media keys for EME',\n code: 3\n });\n });\n }\n /**\n * Initializes the quality levels and sets listeners to update them.\n *\n * @method setupQualityLevels_\n * @private\n */\n ;\n\n _proto.setupQualityLevels_ = function setupQualityLevels_() {\n var _this5 = this;\n\n var player = videojs.players[this.tech_.options_.playerId]; // if there isn't a player or there isn't a qualityLevels plugin\n // or qualityLevels_ listeners have already been setup, do nothing.\n\n if (!player || !player.qualityLevels || this.qualityLevels_) {\n return;\n }\n\n this.qualityLevels_ = player.qualityLevels();\n this.masterPlaylistController_.on('selectedinitialmedia', function () {\n handleVhsLoadedMetadata(_this5.qualityLevels_, _this5);\n });\n this.playlists.on('mediachange', function () {\n handleVhsMediaChange(_this5.qualityLevels_, _this5.playlists);\n });\n }\n /**\n * return the version\n */\n ;\n\n VhsHandler.version = function version$5() {\n return {\n '@videojs/http-streaming': version$4,\n 'mux.js': version$3,\n 'mpd-parser': version$2,\n 'm3u8-parser': version$1,\n 'aes-decrypter': video_es_version\n };\n }\n /**\n * return the version\n */\n ;\n\n _proto.version = function version() {\n return this.constructor.version();\n };\n\n _proto.canChangeType = function canChangeType() {\n return video_es_SourceUpdater.canChangeType();\n }\n /**\n * Begin playing the video.\n */\n ;\n\n _proto.play = function play() {\n this.masterPlaylistController_.play();\n }\n /**\n * a wrapper around the function in MasterPlaylistController\n */\n ;\n\n _proto.setCurrentTime = function setCurrentTime(currentTime) {\n this.masterPlaylistController_.setCurrentTime(currentTime);\n }\n /**\n * a wrapper around the function in MasterPlaylistController\n */\n ;\n\n _proto.duration = function duration() {\n return this.masterPlaylistController_.duration();\n }\n /**\n * a wrapper around the function in MasterPlaylistController\n */\n ;\n\n _proto.seekable = function seekable() {\n return this.masterPlaylistController_.seekable();\n }\n /**\n * Abort all outstanding work and cleanup.\n */\n ;\n\n _proto.dispose = function dispose() {\n if (this.playbackWatcher_) {\n this.playbackWatcher_.dispose();\n }\n\n if (this.masterPlaylistController_) {\n this.masterPlaylistController_.dispose();\n }\n\n if (this.qualityLevels_) {\n this.qualityLevels_.dispose();\n }\n\n if (this.player_) {\n delete this.player_.vhs;\n delete this.player_.dash;\n delete this.player_.hls;\n }\n\n if (this.tech_ && this.tech_.vhs) {\n delete this.tech_.vhs;\n } // don't check this.tech_.hls as it will log a deprecated warning\n\n\n if (this.tech_) {\n delete this.tech_.hls;\n }\n\n if (this.mediaSourceUrl_ && window_default.a.URL.revokeObjectURL) {\n window_default.a.URL.revokeObjectURL(this.mediaSourceUrl_);\n this.mediaSourceUrl_ = null;\n }\n\n _Component.prototype.dispose.call(this);\n };\n\n _proto.convertToProgramTime = function convertToProgramTime(time, callback) {\n return getProgramTime({\n playlist: this.masterPlaylistController_.media(),\n time: time,\n callback: callback\n });\n } // the player must be playing before calling this\n ;\n\n _proto.seekToProgramTime = function seekToProgramTime$1(programTime, callback, pauseAfterSeek, retryCount) {\n if (pauseAfterSeek === void 0) {\n pauseAfterSeek = true;\n }\n\n if (retryCount === void 0) {\n retryCount = 2;\n }\n\n return seekToProgramTime({\n programTime: programTime,\n playlist: this.masterPlaylistController_.media(),\n retryCount: retryCount,\n pauseAfterSeek: pauseAfterSeek,\n seekTo: this.options_.seekTo,\n tech: this.options_.tech,\n callback: callback\n });\n };\n\n return VhsHandler;\n}(video_es_Component);\n/**\n * The Source Handler object, which informs video.js what additional\n * MIME types are supported and sets up playback. It is registered\n * automatically to the appropriate tech based on the capabilities of\n * the browser it is running in. It is not necessary to use or modify\n * this object in normal usage.\n */\n\n\nvar VhsSourceHandler = {\n name: 'videojs-http-streaming',\n VERSION: version$4,\n canHandleSource: function canHandleSource(srcObj, options) {\n if (options === void 0) {\n options = {};\n }\n\n var localOptions = videojs.mergeOptions(videojs.options, options);\n return VhsSourceHandler.canPlayType(srcObj.type, localOptions);\n },\n handleSource: function handleSource(source, tech, options) {\n if (options === void 0) {\n options = {};\n }\n\n var localOptions = videojs.mergeOptions(videojs.options, options);\n tech.vhs = new video_es_VhsHandler(source, tech, localOptions);\n\n if (!videojs.hasOwnProperty('hls')) {\n Object.defineProperty(tech, 'hls', {\n get: function get() {\n videojs.log.warn('player.tech().hls is deprecated. Use player.tech().vhs instead.');\n return tech.vhs;\n },\n configurable: true\n });\n }\n\n tech.vhs.xhr = xhrFactory();\n tech.vhs.src(source.src, source.type);\n return tech.vhs;\n },\n canPlayType: function canPlayType(type, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _videojs$mergeOptions = videojs.mergeOptions(videojs.options, options),\n _videojs$mergeOptions2 = _videojs$mergeOptions.vhs.overrideNative,\n overrideNative = _videojs$mergeOptions2 === void 0 ? !videojs.browser.IS_ANY_SAFARI : _videojs$mergeOptions2;\n\n var supportedType = simpleTypeFromSourceType(type);\n var canUseMsePlayback = supportedType && (!Vhs.supportsTypeNatively(supportedType) || overrideNative);\n return canUseMsePlayback ? 'maybe' : '';\n }\n};\n/**\n * Check to see if the native MediaSource object exists and supports\n * an MP4 container with both H.264 video and AAC-LC audio.\n *\n * @return {boolean} if native media sources are supported\n */\n\nvar video_es_supportsNativeMediaSources = function supportsNativeMediaSources() {\n return codecs_browserSupportsCodec('avc1.4d400d,mp4a.40.2');\n}; // register source handlers with the appropriate techs\n\n\nif (video_es_supportsNativeMediaSources()) {\n videojs.getTech('Html5').registerSourceHandler(VhsSourceHandler, 0);\n}\n\nvideojs.VhsHandler = video_es_VhsHandler;\nObject.defineProperty(videojs, 'HlsHandler', {\n get: function get() {\n videojs.log.warn('videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead.');\n return video_es_VhsHandler;\n },\n configurable: true\n});\nvideojs.VhsSourceHandler = VhsSourceHandler;\nObject.defineProperty(videojs, 'HlsSourceHandler', {\n get: function get() {\n videojs.log.warn('videojs.HlsSourceHandler is deprecated. ' + 'Use videojs.VhsSourceHandler instead.');\n return VhsSourceHandler;\n },\n configurable: true\n});\nvideojs.Vhs = Vhs;\nObject.defineProperty(videojs, 'Hls', {\n get: function get() {\n videojs.log.warn('videojs.Hls is deprecated. Use videojs.Vhs instead.');\n return Vhs;\n },\n configurable: true\n});\n\nif (!videojs.use) {\n videojs.registerComponent('Hls', Vhs);\n videojs.registerComponent('Vhs', Vhs);\n}\n\nvideojs.options.vhs = videojs.options.vhs || {};\nvideojs.options.hls = videojs.options.hls || {};\n\nif (videojs.registerPlugin) {\n videojs.registerPlugin('reloadSourceOnError', reloadSourceOnError);\n} else {\n videojs.plugin('reloadSourceOnError', reloadSourceOnError);\n}\n\n/* harmony default export */ var video_es = __webpack_exports__[\"default\"] = (videojs);\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar store = __webpack_require__(48)('wks');\nvar uid = __webpack_require__(24);\nvar Symbol = __webpack_require__(9).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\nfunction _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(23)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\nvar hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports) {\n\nvar g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(16);\nvar createDesc = __webpack_require__(31);\nmodule.exports = __webpack_require__(12) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar anObject = __webpack_require__(17);\nvar IE8_DOM_DEFINE = __webpack_require__(42);\nvar toPrimitive = __webpack_require__(44);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(12) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(10);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(9);\nvar hide = __webpack_require__(15);\nvar has = __webpack_require__(13);\nvar SRC = __webpack_require__(24)('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\n__webpack_require__(19).inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\nvar core = module.exports = { version: '2.5.1' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\nmodule.exports = {};\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"mux.js/lib/utils/clock\");\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(9);\nvar core = __webpack_require__(19);\nvar hide = __webpack_require__(15);\nvar redefine = __webpack_require__(18);\nvar ctx = __webpack_require__(25);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports) {\n\nvar id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// optional / simple context binding\nvar aFunction = __webpack_require__(80);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(90);\nvar defined = __webpack_require__(33);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * \"Shallow freezes\" an object to render it immutable.\n * Uses `Object.freeze` if available,\n * otherwise the immutability is only in the type.\n *\n * Is used to create \"enum like\" objects.\n *\n * @template T\n * @param {T} object the object to freeze\n * @param {Pick<ObjectConstructor, 'freeze'> = Object} oc `Object` by default,\n * \t\t\t\tallows to inject custom object constructor for tests\n * @returns {Readonly<T>}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n */\nfunction freeze(object, oc) {\n\tif (oc === undefined) {\n\t\toc = Object\n\t}\n\treturn oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object\n}\n\n/**\n * All mime types that are allowed as input to `DOMParser.parseFromString`\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec\n * @see DOMParser.prototype.parseFromString\n */\nvar MIME_TYPE = freeze({\n\t/**\n\t * `text/html`, the only mime type that triggers treating an XML document as HTML.\n\t *\n\t * @see DOMParser.SupportedType.isHTML\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec\n\t */\n\tHTML: 'text/html',\n\n\t/**\n\t * Helper method to check a mime type if it indicates an HTML document\n\t *\n\t * @param {string} [value]\n\t * @returns {boolean}\n\t *\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring \t */\n\tisHTML: function (value) {\n\t\treturn value === MIME_TYPE.HTML\n\t},\n\n\t/**\n\t * `application/xml`, the standard mime type for XML documents.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_APPLICATION: 'application/xml',\n\n\t/**\n\t * `text/html`, an alias for `application/xml`.\n\t *\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303\n\t * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_TEXT: 'text/xml',\n\n\t/**\n\t * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,\n\t * but is parsed as an XML document.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec\n\t * @see https://en.wikipedia.org/wiki/XHTML Wikipedia\n\t */\n\tXML_XHTML_APPLICATION: 'application/xhtml+xml',\n\n\t/**\n\t * `image/svg+xml`,\n\t *\n\t * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration\n\t * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1\n\t * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia\n\t */\n\tXML_SVG_IMAGE: 'image/svg+xml',\n})\n\n/**\n * Namespaces that are used in this code base.\n *\n * @see http://www.w3.org/TR/REC-xml-names\n */\nvar NAMESPACE = freeze({\n\t/**\n\t * The XHTML namespace.\n\t *\n\t * @see http://www.w3.org/1999/xhtml\n\t */\n\tHTML: 'http://www.w3.org/1999/xhtml',\n\n\t/**\n\t * Checks if `uri` equals `NAMESPACE.HTML`.\n\t *\n\t * @param {string} [uri]\n\t *\n\t * @see NAMESPACE.HTML\n\t */\n\tisHTML: function (uri) {\n\t\treturn uri === NAMESPACE.HTML\n\t},\n\n\t/**\n\t * The SVG namespace.\n\t *\n\t * @see http://www.w3.org/2000/svg\n\t */\n\tSVG: 'http://www.w3.org/2000/svg',\n\n\t/**\n\t * The `xml:` namespace.\n\t *\n\t * @see http://www.w3.org/XML/1998/namespace\n\t */\n\tXML: 'http://www.w3.org/XML/1998/namespace',\n\n\t/**\n\t * The `xmlns:` namespace\n\t *\n\t * @see https://www.w3.org/2000/xmlns/\n\t */\n\tXMLNS: 'http://www.w3.org/2000/xmlns/',\n})\n\nexports.freeze = freeze;\nexports.MIME_TYPE = MIME_TYPE;\nexports.NAMESPACE = NAMESPACE;\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Default exports for Node. Export the extended versions of VTTCue and\n// VTTRegion in Node since we likely want the capability to convert back and\n// forth between JSON. If we don't then it's not that big of a deal since we're\n// off browser.\n\nvar window = __webpack_require__(0);\n\nvar vttjs = module.exports = {\n WebVTT: __webpack_require__(119),\n VTTCue: __webpack_require__(120),\n VTTRegion: __webpack_require__(121)\n};\n\nwindow.vttjs = vttjs;\nwindow.WebVTT = vttjs.WebVTT;\n\nvar cueShim = vttjs.VTTCue;\nvar regionShim = vttjs.VTTRegion;\nvar nativeVTTCue = window.VTTCue;\nvar nativeVTTRegion = window.VTTRegion;\n\nvttjs.shim = function() {\n window.VTTCue = cueShim;\n window.VTTRegion = regionShim;\n};\n\nvttjs.restore = function() {\n window.VTTCue = nativeVTTCue;\n window.VTTRegion = nativeVTTRegion;\n};\n\nif (!window.VTTCue) {\n vttjs.shim();\n}\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return decodeB64ToUint8Array; });\n/* harmony import */ var global_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n/* harmony import */ var global_window__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(global_window__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar atob = function atob(s) {\n return global_window__WEBPACK_IMPORTED_MODULE_0___default.a.atob ? global_window__WEBPACK_IMPORTED_MODULE_0___default.a.atob(s) : Buffer.from(s, 'base64').toString('binary');\n};\n\nfunction decodeB64ToUint8Array(b64Text) {\n var decodedString = atob(b64Text);\n var array = new Uint8Array(decodedString.length);\n\n for (var i = 0; i < decodedString.length; i++) {\n array[i] = decodedString.charCodeAt(i);\n }\n\n return array;\n}\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(124).Buffer))\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar setPrototypeOf = __webpack_require__(123);\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inheritsLoose;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports) {\n\n// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports) {\n\n// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar LIBRARY = __webpack_require__(86);\nvar $export = __webpack_require__(22);\nvar redefine = __webpack_require__(18);\nvar hide = __webpack_require__(15);\nvar has = __webpack_require__(13);\nvar Iterators = __webpack_require__(20);\nvar $iterCreate = __webpack_require__(87);\nvar setToStringTag = __webpack_require__(36);\nvar getPrototypeOf = __webpack_require__(94);\nvar ITERATOR = __webpack_require__(8)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar shared = __webpack_require__(48)('keys');\nvar uid = __webpack_require__(24);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar def = __webpack_require__(16).f;\nvar has = __webpack_require__(13);\nvar TAG = __webpack_require__(8)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports) {\n\nfunction _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar window = __webpack_require__(0);\n\nvar _extends = __webpack_require__(116);\n\nvar isFunction = __webpack_require__(117);\n\ncreateXHR.httpHandler = __webpack_require__(118);\n/**\n * @license\n * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>\n * Copyright (c) 2014 David Björklund\n * Available under the MIT license\n * <https://github.com/kesla/parse-headers/blob/master/LICENCE>\n */\n\nvar parseHeaders = function parseHeaders(headers) {\n var result = {};\n\n if (!headers) {\n return result;\n }\n\n headers.trim().split('\\n').forEach(function (row) {\n var index = row.indexOf(':');\n var key = row.slice(0, index).trim().toLowerCase();\n var value = row.slice(index + 1).trim();\n\n if (typeof result[key] === 'undefined') {\n result[key] = value;\n } else if (Array.isArray(result[key])) {\n result[key].push(value);\n } else {\n result[key] = [result[key], value];\n }\n });\n return result;\n};\n\nmodule.exports = createXHR; // Allow use of default import syntax in TypeScript\n\nmodule.exports.default = createXHR;\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop;\ncreateXHR.XDomainRequest = \"withCredentials\" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window.XDomainRequest;\nforEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function (method) {\n createXHR[method === \"delete\" ? \"del\" : method] = function (uri, options, callback) {\n options = initParams(uri, options, callback);\n options.method = method.toUpperCase();\n return _createXHR(options);\n };\n});\n\nfunction forEachArray(array, iterator) {\n for (var i = 0; i < array.length; i++) {\n iterator(array[i]);\n }\n}\n\nfunction isEmpty(obj) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) return false;\n }\n\n return true;\n}\n\nfunction initParams(uri, options, callback) {\n var params = uri;\n\n if (isFunction(options)) {\n callback = options;\n\n if (typeof uri === \"string\") {\n params = {\n uri: uri\n };\n }\n } else {\n params = _extends({}, options, {\n uri: uri\n });\n }\n\n params.callback = callback;\n return params;\n}\n\nfunction createXHR(uri, options, callback) {\n options = initParams(uri, options, callback);\n return _createXHR(options);\n}\n\nfunction _createXHR(options) {\n if (typeof options.callback === \"undefined\") {\n throw new Error(\"callback argument missing\");\n }\n\n var called = false;\n\n var callback = function cbOnce(err, response, body) {\n if (!called) {\n called = true;\n options.callback(err, response, body);\n }\n };\n\n function readystatechange() {\n if (xhr.readyState === 4) {\n setTimeout(loadFunc, 0);\n }\n }\n\n function getBody() {\n // Chrome with requestType=blob throws errors arround when even testing access to responseText\n var body = undefined;\n\n if (xhr.response) {\n body = xhr.response;\n } else {\n body = xhr.responseText || getXml(xhr);\n }\n\n if (isJson) {\n try {\n body = JSON.parse(body);\n } catch (e) {}\n }\n\n return body;\n }\n\n function errorFunc(evt) {\n clearTimeout(timeoutTimer);\n\n if (!(evt instanceof Error)) {\n evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\"));\n }\n\n evt.statusCode = 0;\n return callback(evt, failureResponse);\n } // will load the data & process the response in a special response object\n\n\n function loadFunc() {\n if (aborted) return;\n var status;\n clearTimeout(timeoutTimer);\n\n if (options.useXDR && xhr.status === undefined) {\n //IE8 CORS GET successful response doesn't have a status field, but body is fine\n status = 200;\n } else {\n status = xhr.status === 1223 ? 204 : xhr.status;\n }\n\n var response = failureResponse;\n var err = null;\n\n if (status !== 0) {\n response = {\n body: getBody(),\n statusCode: status,\n method: method,\n headers: {},\n url: uri,\n rawRequest: xhr\n };\n\n if (xhr.getAllResponseHeaders) {\n //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders());\n }\n } else {\n err = new Error(\"Internal XMLHttpRequest Error\");\n }\n\n return callback(err, response, response.body);\n }\n\n var xhr = options.xhr || null;\n\n if (!xhr) {\n if (options.cors || options.useXDR) {\n xhr = new createXHR.XDomainRequest();\n } else {\n xhr = new createXHR.XMLHttpRequest();\n }\n }\n\n var key;\n var aborted;\n var uri = xhr.url = options.uri || options.url;\n var method = xhr.method = options.method || \"GET\";\n var body = options.body || options.data;\n var headers = xhr.headers = options.headers || {};\n var sync = !!options.sync;\n var isJson = false;\n var timeoutTimer;\n var failureResponse = {\n body: undefined,\n headers: {},\n statusCode: 0,\n method: method,\n url: uri,\n rawRequest: xhr\n };\n\n if (\"json\" in options && options.json !== false) {\n isJson = true;\n headers[\"accept\"] || headers[\"Accept\"] || (headers[\"Accept\"] = \"application/json\"); //Don't override existing accept header declared by user\n\n if (method !== \"GET\" && method !== \"HEAD\") {\n headers[\"content-type\"] || headers[\"Content-Type\"] || (headers[\"Content-Type\"] = \"application/json\"); //Don't override existing accept header declared by user\n\n body = JSON.stringify(options.json === true ? body : options.json);\n }\n }\n\n xhr.onreadystatechange = readystatechange;\n xhr.onload = loadFunc;\n xhr.onerror = errorFunc; // IE9 must have onprogress be set to a unique function.\n\n xhr.onprogress = function () {// IE must die\n };\n\n xhr.onabort = function () {\n aborted = true;\n };\n\n xhr.ontimeout = errorFunc;\n xhr.open(method, uri, !sync, options.username, options.password); //has to be after open\n\n if (!sync) {\n xhr.withCredentials = !!options.withCredentials;\n } // Cannot set timeout with sync request\n // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\n // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent\n\n\n if (!sync && options.timeout > 0) {\n timeoutTimer = setTimeout(function () {\n if (aborted) return;\n aborted = true; //IE9 may still call readystatechange\n\n xhr.abort(\"timeout\");\n var e = new Error(\"XMLHttpRequest timeout\");\n e.code = \"ETIMEDOUT\";\n errorFunc(e);\n }, options.timeout);\n }\n\n if (xhr.setRequestHeader) {\n for (key in headers) {\n if (headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n } else if (options.headers && !isEmpty(options.headers)) {\n throw new Error(\"Headers cannot be set on an XDomainRequest object\");\n }\n\n if (\"responseType\" in options) {\n xhr.responseType = options.responseType;\n }\n\n if (\"beforeSend\" in options && typeof options.beforeSend === \"function\") {\n options.beforeSend(xhr);\n } // Microsoft Edge browser sends \"undefined\" when send is called with undefined value.\n // XMLHttpRequest spec says to pass null as body to indicate no body\n // See https://github.com/naugtur/xhr/issues/100.\n\n\n xhr.send(body || null);\n return xhr;\n}\n\nfunction getXml(xhr) {\n // xhr.responseXML will throw Exception \"InvalidStateError\" or \"DOMException\"\n // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML.\n try {\n if (xhr.responseType === \"document\") {\n return xhr.responseXML;\n }\n\n var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === \"parsererror\";\n\n if (xhr.responseType === \"\" && !firefoxBugTakenEffect) {\n return xhr.responseXML;\n }\n } catch (e) {}\n\n return null;\n}\n\nfunction noop() {}\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// see https://tools.ietf.org/html/rfc1808\n\n(function (root) {\n var URL_REGEX =\n /^((?:[a-zA-Z0-9+\\-.]+:)?)(\\/\\/[^\\/?#]*)?((?:[^\\/?#]*\\/)*[^;?#]*)?(;[^?#]*)?(\\?[^#]*)?(#[^]*)?$/;\n var FIRST_SEGMENT_REGEX = /^([^\\/?#]*)([^]*)$/;\n var SLASH_DOT_REGEX = /(?:\\/|^)\\.(?=\\/)/g;\n var SLASH_DOT_DOT_REGEX = /(?:\\/|^)\\.\\.\\/(?!\\.\\.\\/)[^\\/]*(?=\\/)/g;\n\n var URLToolkit = {\n // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or //\n // E.g\n // With opts.alwaysNormalize = false (default, spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/f/../g\n // With opts.alwaysNormalize = true (not spec compliant)\n // http://a.com/b/cd + /e/f/../g => http://a.com/e/g\n buildAbsoluteURL: function (baseURL, relativeURL, opts) {\n opts = opts || {};\n // remove any remaining space and CRLF\n baseURL = baseURL.trim();\n relativeURL = relativeURL.trim();\n if (!relativeURL) {\n // 2a) If the embedded URL is entirely empty, it inherits the\n // entire base URL (i.e., is set equal to the base URL)\n // and we are done.\n if (!opts.alwaysNormalize) {\n return baseURL;\n }\n var basePartsForNormalise = URLToolkit.parseURL(baseURL);\n if (!basePartsForNormalise) {\n throw new Error('Error trying to parse base URL.');\n }\n basePartsForNormalise.path = URLToolkit.normalizePath(\n basePartsForNormalise.path\n );\n return URLToolkit.buildURLFromParts(basePartsForNormalise);\n }\n var relativeParts = URLToolkit.parseURL(relativeURL);\n if (!relativeParts) {\n throw new Error('Error trying to parse relative URL.');\n }\n if (relativeParts.scheme) {\n // 2b) If the embedded URL starts with a scheme name, it is\n // interpreted as an absolute URL and we are done.\n if (!opts.alwaysNormalize) {\n return relativeURL;\n }\n relativeParts.path = URLToolkit.normalizePath(relativeParts.path);\n return URLToolkit.buildURLFromParts(relativeParts);\n }\n var baseParts = URLToolkit.parseURL(baseURL);\n if (!baseParts) {\n throw new Error('Error trying to parse base URL.');\n }\n if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== '/') {\n // If netLoc missing and path doesn't start with '/', assume everthing before the first '/' is the netLoc\n // This causes 'example.com/a' to be handled as '//example.com/a' instead of '/example.com/a'\n var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);\n baseParts.netLoc = pathParts[1];\n baseParts.path = pathParts[2];\n }\n if (baseParts.netLoc && !baseParts.path) {\n baseParts.path = '/';\n }\n var builtParts = {\n // 2c) Otherwise, the embedded URL inherits the scheme of\n // the base URL.\n scheme: baseParts.scheme,\n netLoc: relativeParts.netLoc,\n path: null,\n params: relativeParts.params,\n query: relativeParts.query,\n fragment: relativeParts.fragment,\n };\n if (!relativeParts.netLoc) {\n // 3) If the embedded URL's <net_loc> is non-empty, we skip to\n // Step 7. Otherwise, the embedded URL inherits the <net_loc>\n // (if any) of the base URL.\n builtParts.netLoc = baseParts.netLoc;\n // 4) If the embedded URL path is preceded by a slash \"/\", the\n // path is not relative and we skip to Step 7.\n if (relativeParts.path[0] !== '/') {\n if (!relativeParts.path) {\n // 5) If the embedded URL path is empty (and not preceded by a\n // slash), then the embedded URL inherits the base URL path\n builtParts.path = baseParts.path;\n // 5a) if the embedded URL's <params> is non-empty, we skip to\n // step 7; otherwise, it inherits the <params> of the base\n // URL (if any) and\n if (!relativeParts.params) {\n builtParts.params = baseParts.params;\n // 5b) if the embedded URL's <query> is non-empty, we skip to\n // step 7; otherwise, it inherits the <query> of the base\n // URL (if any) and we skip to step 7.\n if (!relativeParts.query) {\n builtParts.query = baseParts.query;\n }\n }\n } else {\n // 6) The last segment of the base URL's path (anything\n // following the rightmost slash \"/\", or the entire path if no\n // slash is present) is removed and the embedded URL's path is\n // appended in its place.\n var baseURLPath = baseParts.path;\n var newPath =\n baseURLPath.substring(0, baseURLPath.lastIndexOf('/') + 1) +\n relativeParts.path;\n builtParts.path = URLToolkit.normalizePath(newPath);\n }\n }\n }\n if (builtParts.path === null) {\n builtParts.path = opts.alwaysNormalize\n ? URLToolkit.normalizePath(relativeParts.path)\n : relativeParts.path;\n }\n return URLToolkit.buildURLFromParts(builtParts);\n },\n parseURL: function (url) {\n var parts = URL_REGEX.exec(url);\n if (!parts) {\n return null;\n }\n return {\n scheme: parts[1] || '',\n netLoc: parts[2] || '',\n path: parts[3] || '',\n params: parts[4] || '',\n query: parts[5] || '',\n fragment: parts[6] || '',\n };\n },\n normalizePath: function (path) {\n // The following operations are\n // then applied, in order, to the new path:\n // 6a) All occurrences of \"./\", where \".\" is a complete path\n // segment, are removed.\n // 6b) If the path ends with \".\" as a complete path segment,\n // that \".\" is removed.\n path = path.split('').reverse().join('').replace(SLASH_DOT_REGEX, '');\n // 6c) All occurrences of \"<segment>/../\", where <segment> is a\n // complete path segment not equal to \"..\", are removed.\n // Removal of these path segments is performed iteratively,\n // removing the leftmost matching pattern on each iteration,\n // until no matching pattern remains.\n // 6d) If the path ends with \"<segment>/..\", where <segment> is a\n // complete path segment not equal to \"..\", that\n // \"<segment>/..\" is removed.\n while (\n path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, '')).length\n ) {}\n return path.split('').reverse().join('');\n },\n buildURLFromParts: function (parts) {\n return (\n parts.scheme +\n parts.netLoc +\n parts.path +\n parts.params +\n parts.query +\n parts.fragment\n );\n },\n };\n\n if (true)\n module.exports = URLToolkit;\n else {}\n})(this);\n\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports) {\n\nfunction _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {var topLevel = typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window : {}\nvar minDoc = __webpack_require__(132);\n\nvar doccy;\n\nif (typeof document !== 'undefined') {\n doccy = document;\n} else {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];\n\n if (!doccy) {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;\n }\n}\n\nmodule.exports = doccy;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(14)))\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = !__webpack_require__(12) && !__webpack_require__(23)(function () {\n return Object.defineProperty(__webpack_require__(43)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(10);\nvar document = __webpack_require__(9).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(10);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (regExp, replace) {\n var replacer = replace === Object(replace) ? function (part) {\n return replace[part];\n } : replace;\n return function (it) {\n return String(it).replace(regExp, replacer);\n };\n};\n\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(47);\nvar TAG = __webpack_require__(8)('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports) {\n\nvar toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar global = __webpack_require__(9);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(17);\nvar dPs = __webpack_require__(88);\nvar enumBugKeys = __webpack_require__(52);\nvar IE_PROTO = __webpack_require__(35)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(43)('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(93).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(89);\nvar enumBugKeys = __webpack_require__(52);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.15 ToLength\nvar toInteger = __webpack_require__(32);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports) {\n\n// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar redefine = __webpack_require__(18);\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ctx = __webpack_require__(25);\nvar call = __webpack_require__(101);\nvar isArrayIter = __webpack_require__(102);\nvar anObject = __webpack_require__(17);\nvar toLength = __webpack_require__(51);\nvar getIterFn = __webpack_require__(103);\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar META = __webpack_require__(24)('meta');\nvar isObject = __webpack_require__(10);\nvar has = __webpack_require__(13);\nvar setDesc = __webpack_require__(16).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !__webpack_require__(23)(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(10);\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar conventions = __webpack_require__(27);\n\nvar NAMESPACE = conventions.NAMESPACE;\n\n/**\n * A prerequisite for `[].filter`, to drop elements that are empty\n * @param {string} input\n * @returns {boolean}\n */\nfunction notEmptyString (input) {\n\treturn input !== ''\n}\n/**\n * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * @param {string} input\n * @returns {string[]} (can be empty)\n */\nfunction splitOnASCIIWhitespace(input) {\n\t// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE\n\treturn input ? input.split(/[\\t\\n\\f\\r ]+/).filter(notEmptyString) : []\n}\n\n/**\n * Adds element as a key to current if it is not already present.\n *\n * @param {Record<string, boolean | undefined>} current\n * @param {string} element\n * @returns {Record<string, boolean | undefined>}\n */\nfunction orderedSetReducer (current, element) {\n\tif (!current.hasOwnProperty(element)) {\n\t\tcurrent[element] = true;\n\t}\n\treturn current;\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ordered-set\n * @param {string} input\n * @returns {string[]}\n */\nfunction toOrderedSet(input) {\n\tif (!input) return [];\n\tvar list = splitOnASCIIWhitespace(input);\n\treturn Object.keys(list.reduce(orderedSetReducer, {}))\n}\n\n/**\n * Uses `list.indexOf` to implement something like `Array.prototype.includes`,\n * which we can not rely on being available.\n *\n * @param {any[]} list\n * @returns {function(any): boolean}\n */\nfunction arrayIncludes (list) {\n\treturn function(element) {\n\t\treturn list && list.indexOf(element) !== -1;\n\t}\n}\n\nfunction copy(src,dest){\n\tfor(var p in src){\n\t\tdest[p] = src[p];\n\t}\n}\n\n/**\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*((?:.*\\{\\s*?[\\r\\n][\\s\\S]*?^})|\\S.*?(?=[;\\r\\n]));?\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*(\\S.*?(?=[;\\r\\n]));?\n */\nfunction _extends(Class,Super){\n\tvar pt = Class.prototype;\n\tif(!(pt instanceof Super)){\n\t\tfunction t(){};\n\t\tt.prototype = Super.prototype;\n\t\tt = new t();\n\t\tcopy(pt,t);\n\t\tClass.prototype = pt = t;\n\t}\n\tif(pt.constructor != Class){\n\t\tif(typeof Class != 'function'){\n\t\t\tconsole.error(\"unknown Class:\"+Class)\n\t\t}\n\t\tpt.constructor = Class\n\t}\n}\n\n// Node Types\nvar NodeType = {}\nvar ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;\nvar ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;\nvar TEXT_NODE = NodeType.TEXT_NODE = 3;\nvar CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;\nvar ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;\nvar ENTITY_NODE = NodeType.ENTITY_NODE = 6;\nvar PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;\nvar COMMENT_NODE = NodeType.COMMENT_NODE = 8;\nvar DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;\nvar DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;\nvar DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;\nvar NOTATION_NODE = NodeType.NOTATION_NODE = 12;\n\n// ExceptionCode\nvar ExceptionCode = {}\nvar ExceptionMessage = {};\nvar INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]=\"Index size error\"),1);\nvar DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]=\"DOMString size error\"),2);\nvar HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]=\"Hierarchy request error\"),3);\nvar WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]=\"Wrong document\"),4);\nvar INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]=\"Invalid character\"),5);\nvar NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]=\"No data allowed\"),6);\nvar NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]=\"No modification allowed\"),7);\nvar NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]=\"Not found\"),8);\nvar NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]=\"Not supported\"),9);\nvar INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]=\"Attribute in use\"),10);\n//level2\nvar INVALID_STATE_ERR \t= ExceptionCode.INVALID_STATE_ERR \t= ((ExceptionMessage[11]=\"Invalid state\"),11);\nvar SYNTAX_ERR \t= ExceptionCode.SYNTAX_ERR \t= ((ExceptionMessage[12]=\"Syntax error\"),12);\nvar INVALID_MODIFICATION_ERR \t= ExceptionCode.INVALID_MODIFICATION_ERR \t= ((ExceptionMessage[13]=\"Invalid modification\"),13);\nvar NAMESPACE_ERR \t= ExceptionCode.NAMESPACE_ERR \t= ((ExceptionMessage[14]=\"Invalid namespace\"),14);\nvar INVALID_ACCESS_ERR \t= ExceptionCode.INVALID_ACCESS_ERR \t= ((ExceptionMessage[15]=\"Invalid access\"),15);\n\n/**\n * DOM Level 2\n * Object DOMException\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html\n */\nfunction DOMException(code, message) {\n\tif(message instanceof Error){\n\t\tvar error = message;\n\t}else{\n\t\terror = this;\n\t\tError.call(this, ExceptionMessage[code]);\n\t\tthis.message = ExceptionMessage[code];\n\t\tif(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);\n\t}\n\terror.code = code;\n\tif(message) this.message = this.message + \": \" + message;\n\treturn error;\n};\nDOMException.prototype = Error.prototype;\ncopy(ExceptionCode,DOMException)\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177\n * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.\n * The items in the NodeList are accessible via an integral index, starting from 0.\n */\nfunction NodeList() {\n};\nNodeList.prototype = {\n\t/**\n\t * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.\n\t * @standard level1\n\t */\n\tlength:0, \n\t/**\n\t * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.\n\t * @standard level1\n\t * @param index unsigned long \n\t * Index into the collection.\n\t * @return Node\n\t * \tThe node at the indexth position in the NodeList, or null if that is not a valid index. \n\t */\n\titem: function(index) {\n\t\treturn this[index] || null;\n\t},\n\ttoString:function(isHTML,nodeFilter){\n\t\tfor(var buf = [], i = 0;i<this.length;i++){\n\t\t\tserializeToString(this[i],buf,isHTML,nodeFilter);\n\t\t}\n\t\treturn buf.join('');\n\t}\n};\n\nfunction LiveNodeList(node,refresh){\n\tthis._node = node;\n\tthis._refresh = refresh\n\t_updateLiveList(this);\n}\nfunction _updateLiveList(list){\n\tvar inc = list._node._inc || list._node.ownerDocument._inc;\n\tif(list._inc != inc){\n\t\tvar ls = list._refresh(list._node);\n\t\t//console.log(ls.length)\n\t\t__set__(list,'length',ls.length);\n\t\tcopy(ls,list);\n\t\tlist._inc = inc;\n\t}\n}\nLiveNodeList.prototype.item = function(i){\n\t_updateLiveList(this);\n\treturn this[i];\n}\n\n_extends(LiveNodeList,NodeList);\n\n/**\n * Objects implementing the NamedNodeMap interface are used\n * to represent collections of nodes that can be accessed by name.\n * Note that NamedNodeMap does not inherit from NodeList;\n * NamedNodeMaps are not maintained in any particular order.\n * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index,\n * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap,\n * and does not imply that the DOM specifies an order to these Nodes.\n * NamedNodeMap objects in the DOM are live.\n * used for attributes or DocumentType entities \n */\nfunction NamedNodeMap() {\n};\n\nfunction _findNodeIndex(list,node){\n\tvar i = list.length;\n\twhile(i--){\n\t\tif(list[i] === node){return i}\n\t}\n}\n\nfunction _addNamedNode(el,list,newAttr,oldAttr){\n\tif(oldAttr){\n\t\tlist[_findNodeIndex(list,oldAttr)] = newAttr;\n\t}else{\n\t\tlist[list.length++] = newAttr;\n\t}\n\tif(el){\n\t\tnewAttr.ownerElement = el;\n\t\tvar doc = el.ownerDocument;\n\t\tif(doc){\n\t\t\toldAttr && _onRemoveAttribute(doc,el,oldAttr);\n\t\t\t_onAddAttribute(doc,el,newAttr);\n\t\t}\n\t}\n}\nfunction _removeNamedNode(el,list,attr){\n\t//console.log('remove attr:'+attr)\n\tvar i = _findNodeIndex(list,attr);\n\tif(i>=0){\n\t\tvar lastIndex = list.length-1\n\t\twhile(i<lastIndex){\n\t\t\tlist[i] = list[++i]\n\t\t}\n\t\tlist.length = lastIndex;\n\t\tif(el){\n\t\t\tvar doc = el.ownerDocument;\n\t\t\tif(doc){\n\t\t\t\t_onRemoveAttribute(doc,el,attr);\n\t\t\t\tattr.ownerElement = null;\n\t\t\t}\n\t\t}\n\t}else{\n\t\tthrow DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))\n\t}\n}\nNamedNodeMap.prototype = {\n\tlength:0,\n\titem:NodeList.prototype.item,\n\tgetNamedItem: function(key) {\n//\t\tif(key.indexOf(':')>0 || key == 'xmlns'){\n//\t\t\treturn null;\n//\t\t}\n\t\t//console.log()\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar attr = this[i];\n\t\t\t//console.log(attr.nodeName,key)\n\t\t\tif(attr.nodeName == key){\n\t\t\t\treturn attr;\n\t\t\t}\n\t\t}\n\t},\n\tsetNamedItem: function(attr) {\n\t\tvar el = attr.ownerElement;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\tvar oldAttr = this.getNamedItem(attr.nodeName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\t/* returns Node */\n\tsetNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR\n\t\tvar el = attr.ownerElement, oldAttr;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\toldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\n\t/* returns Node */\n\tremoveNamedItem: function(key) {\n\t\tvar attr = this.getNamedItem(key);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\t\t\n\t\t\n\t},// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR\n\t\n\t//for level2\n\tremoveNamedItemNS:function(namespaceURI,localName){\n\t\tvar attr = this.getNamedItemNS(namespaceURI,localName);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\t},\n\tgetNamedItemNS: function(namespaceURI, localName) {\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar node = this[i];\n\t\t\tif(node.localName == localName && node.namespaceURI == namespaceURI){\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n};\n\n/**\n * The DOMImplementation interface represents an object providing methods\n * which are not dependent on any particular document.\n * Such an object is returned by the `Document.implementation` property.\n *\n * __The individual methods describe the differences compared to the specs.__\n *\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN\n * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)\n * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core\n * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core\n * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard\n */\nfunction DOMImplementation() {\n}\n\nDOMImplementation.prototype = {\n\t/**\n\t * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.\n\t * The different implementations fairly diverged in what kind of features were reported.\n\t * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.\n\t *\n\t * @deprecated It is deprecated and modern browsers return true in all cases.\n\t *\n\t * @param {string} feature\n\t * @param {string} [version]\n\t * @returns {boolean} always true\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN\n\t * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard\n\t */\n\thasFeature: function(feature, version) {\n\t\t\treturn true;\n\t},\n\t/**\n\t * Creates an XML Document object of the specified type with its document element.\n\t *\n\t * __It behaves slightly different from the description in the living standard__:\n\t * - There is no interface/class `XMLDocument`, it returns a `Document` instance.\n\t * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.\n\t * - this implementation is not validating names or qualified names\n\t * (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string|null} namespaceURI\n\t * @param {string} qualifiedName\n\t * @param {DocumentType=null} doctype\n\t * @returns {Document}\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocument: function(namespaceURI, qualifiedName, doctype){\n\t\tvar doc = new Document();\n\t\tdoc.implementation = this;\n\t\tdoc.childNodes = new NodeList();\n\t\tdoc.doctype = doctype || null;\n\t\tif (doctype){\n\t\t\tdoc.appendChild(doctype);\n\t\t}\n\t\tif (qualifiedName){\n\t\t\tvar root = doc.createElementNS(namespaceURI, qualifiedName);\n\t\t\tdoc.appendChild(root);\n\t\t}\n\t\treturn doc;\n\t},\n\t/**\n\t * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.\n\t *\n\t * __This behavior is slightly different from the in the specs__:\n\t * - this implementation is not validating names or qualified names\n\t * (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string} qualifiedName\n\t * @param {string} [publicId]\n\t * @param {string} [systemId]\n\t * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation\n\t * \t\t\t\t or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocumentType: function(qualifiedName, publicId, systemId){\n\t\tvar node = new DocumentType();\n\t\tnode.name = qualifiedName;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.publicId = publicId || '';\n\t\tnode.systemId = systemId || '';\n\n\t\treturn node;\n\t}\n};\n\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247\n */\n\nfunction Node() {\n};\n\nNode.prototype = {\n\tfirstChild : null,\n\tlastChild : null,\n\tpreviousSibling : null,\n\tnextSibling : null,\n\tattributes : null,\n\tparentNode : null,\n\tchildNodes : null,\n\townerDocument : null,\n\tnodeValue : null,\n\tnamespaceURI : null,\n\tprefix : null,\n\tlocalName : null,\n\t// Modified in DOM Level 2:\n\tinsertBefore:function(newChild, refChild){//raises \n\t\treturn _insertBefore(this,newChild,refChild);\n\t},\n\treplaceChild:function(newChild, oldChild){//raises \n\t\tthis.insertBefore(newChild,oldChild);\n\t\tif(oldChild){\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t},\n\tremoveChild:function(oldChild){\n\t\treturn _removeChild(this,oldChild);\n\t},\n\tappendChild:function(newChild){\n\t\treturn this.insertBefore(newChild,null);\n\t},\n\thasChildNodes:function(){\n\t\treturn this.firstChild != null;\n\t},\n\tcloneNode:function(deep){\n\t\treturn cloneNode(this.ownerDocument||this,this,deep);\n\t},\n\t// Modified in DOM Level 2:\n\tnormalize:function(){\n\t\tvar child = this.firstChild;\n\t\twhile(child){\n\t\t\tvar next = child.nextSibling;\n\t\t\tif(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){\n\t\t\t\tthis.removeChild(next);\n\t\t\t\tchild.appendData(next.data);\n\t\t\t}else{\n\t\t\t\tchild.normalize();\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t}\n\t},\n \t// Introduced in DOM Level 2:\n\tisSupported:function(feature, version){\n\t\treturn this.ownerDocument.implementation.hasFeature(feature,version);\n\t},\n // Introduced in DOM Level 2:\n hasAttributes:function(){\n \treturn this.attributes.length>0;\n },\n\t/**\n\t * Look up the prefix associated to the given namespace URI, starting from this node.\n\t * **The default namespace declarations are ignored by this method.**\n\t * See Namespace Prefix Lookup for details on the algorithm used by this method.\n\t *\n\t * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._\n\t *\n\t * @param {string | null} namespaceURI\n\t * @returns {string | null}\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo\n\t * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix\n\t * @see https://github.com/xmldom/xmldom/issues/322\n\t */\n lookupPrefix:function(namespaceURI){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tfor(var n in map){\n \t\t\t\tif(map[n] == namespaceURI){\n \t\t\t\t\treturn n;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n lookupNamespaceURI:function(prefix){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tif(prefix in map){\n \t\t\t\treturn map[prefix] ;\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n isDefaultNamespace:function(namespaceURI){\n \tvar prefix = this.lookupPrefix(namespaceURI);\n \treturn prefix == null;\n }\n};\n\n\nfunction _xmlEncoder(c){\n\treturn c == '<' && '<' ||\n c == '>' && '>' ||\n c == '&' && '&' ||\n c == '\"' && '"' ||\n '&#'+c.charCodeAt()+';'\n}\n\n\ncopy(NodeType,Node);\ncopy(NodeType,Node.prototype);\n\n/**\n * @param callback return true for continue,false for break\n * @return boolean true: break visit;\n */\nfunction _visitNode(node,callback){\n\tif(callback(node)){\n\t\treturn true;\n\t}\n\tif(node = node.firstChild){\n\t\tdo{\n\t\t\tif(_visitNode(node,callback)){return true}\n }while(node=node.nextSibling)\n }\n}\n\n\n\nfunction Document(){\n}\n\nfunction _onAddAttribute(doc,el,newAttr){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tel._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value\n\t}\n}\n\nfunction _onRemoveAttribute(doc,el,newAttr,remove){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tdelete el._nsMap[newAttr.prefix?newAttr.localName:'']\n\t}\n}\n\nfunction _onUpdateChild(doc,el,newChild){\n\tif(doc && doc._inc){\n\t\tdoc._inc++;\n\t\t//update childNodes\n\t\tvar cs = el.childNodes;\n\t\tif(newChild){\n\t\t\tcs[cs.length++] = newChild;\n\t\t}else{\n\t\t\t//console.log(1)\n\t\t\tvar child = el.firstChild;\n\t\t\tvar i = 0;\n\t\t\twhile(child){\n\t\t\t\tcs[i++] = child;\n\t\t\t\tchild =child.nextSibling;\n\t\t\t}\n\t\t\tcs.length = i;\n\t\t}\n\t}\n}\n\n/**\n * attributes;\n * children;\n * \n * writeable properties:\n * nodeValue,Attr:value,CharacterData:data\n * prefix\n */\nfunction _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}\n/**\n * preformance key(refChild == null)\n */\nfunction _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}\nfunction _appendSingleChild(parentNode,newChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tvar pre = parentNode.lastChild;\n\t\tcp.removeChild(newChild);//remove and update\n\t\tvar pre = parentNode.lastChild;\n\t}\n\tvar pre = parentNode.lastChild;\n\tnewChild.parentNode = parentNode;\n\tnewChild.previousSibling = pre;\n\tnewChild.nextSibling = null;\n\tif(pre){\n\t\tpre.nextSibling = newChild;\n\t}else{\n\t\tparentNode.firstChild = newChild;\n\t}\n\tparentNode.lastChild = newChild;\n\t_onUpdateChild(parentNode.ownerDocument,parentNode,newChild);\n\treturn newChild;\n\t//console.log(\"__aa\",parentNode.lastChild.nextSibling == null)\n}\nDocument.prototype = {\n\t//implementation : null,\n\tnodeName : '#document',\n\tnodeType : DOCUMENT_NODE,\n\t/**\n\t * The DocumentType node of the document.\n\t *\n\t * @readonly\n\t * @type DocumentType\n\t */\n\tdoctype : null,\n\tdocumentElement : null,\n\t_inc : 1,\n\n\tinsertBefore : function(newChild, refChild){//raises\n\t\tif(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){\n\t\t\tvar child = newChild.firstChild;\n\t\t\twhile(child){\n\t\t\t\tvar next = child.nextSibling;\n\t\t\t\tthis.insertBefore(child,refChild);\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t\treturn newChild;\n\t\t}\n\t\tif(this.documentElement == null && newChild.nodeType == ELEMENT_NODE){\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\n\t\treturn _insertBefore(this,newChild,refChild),(newChild.ownerDocument = this),newChild;\n\t},\n\tremoveChild : function(oldChild){\n\t\tif(this.documentElement == oldChild){\n\t\t\tthis.documentElement = null;\n\t\t}\n\t\treturn _removeChild(this,oldChild);\n\t},\n\t// Introduced in DOM Level 2:\n\timportNode : function(importedNode,deep){\n\t\treturn importNode(this,importedNode,deep);\n\t},\n\t// Introduced in DOM Level 2:\n\tgetElementById :\tfunction(id){\n\t\tvar rtv = null;\n\t\t_visitNode(this.documentElement,function(node){\n\t\t\tif(node.nodeType == ELEMENT_NODE){\n\t\t\t\tif(node.getAttribute('id') == id){\n\t\t\t\t\trtv = node;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\treturn rtv;\n\t},\n\n\t/**\n\t * The `getElementsByClassName` method of `Document` interface returns an array-like object\n\t * of all child elements which have **all** of the given class name(s).\n\t *\n\t * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.\n\t *\n\t *\n\t * Warning: This is a live LiveNodeList.\n\t * Changes in the DOM will reflect in the array as the changes occur.\n\t * If an element selected by this array no longer qualifies for the selector,\n\t * it will automatically be removed. Be aware of this for iteration purposes.\n\t *\n\t * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName\n\t * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname\n\t */\n\tgetElementsByClassName: function(classNames) {\n\t\tvar classNamesSet = toOrderedSet(classNames)\n\t\treturn new LiveNodeList(this, function(base) {\n\t\t\tvar ls = [];\n\t\t\tif (classNamesSet.length > 0) {\n\t\t\t\t_visitNode(base.documentElement, function(node) {\n\t\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE) {\n\t\t\t\t\t\tvar nodeClassNames = node.getAttribute('class')\n\t\t\t\t\t\t// can be null if the attribute does not exist\n\t\t\t\t\t\tif (nodeClassNames) {\n\t\t\t\t\t\t\t// before splitting and iterating just compare them for the most common case\n\t\t\t\t\t\t\tvar matches = classNames === nodeClassNames;\n\t\t\t\t\t\t\tif (!matches) {\n\t\t\t\t\t\t\t\tvar nodeClassNamesSet = toOrderedSet(nodeClassNames)\n\t\t\t\t\t\t\t\tmatches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(matches) {\n\t\t\t\t\t\t\t\tls.push(node);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn ls;\n\t\t});\n\t},\n\n\t//document factory method:\n\tcreateElement :\tfunction(tagName){\n\t\tvar node = new Element();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = tagName;\n\t\tnode.tagName = tagName;\n\t\tnode.localName = tagName;\n\t\tnode.childNodes = new NodeList();\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\tcreateDocumentFragment :\tfunction(){\n\t\tvar node = new DocumentFragment();\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\treturn node;\n\t},\n\tcreateTextNode :\tfunction(data){\n\t\tvar node = new Text();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateComment :\tfunction(data){\n\t\tvar node = new Comment();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateCDATASection :\tfunction(data){\n\t\tvar node = new CDATASection();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateProcessingInstruction :\tfunction(target,data){\n\t\tvar node = new ProcessingInstruction();\n\t\tnode.ownerDocument = this;\n\t\tnode.tagName = node.target = target;\n\t\tnode.nodeValue= node.data = data;\n\t\treturn node;\n\t},\n\tcreateAttribute :\tfunction(name){\n\t\tvar node = new Attr();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.name = name;\n\t\tnode.nodeName\t= name;\n\t\tnode.localName = name;\n\t\tnode.specified = true;\n\t\treturn node;\n\t},\n\tcreateEntityReference :\tfunction(name){\n\t\tvar node = new EntityReference();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.nodeName\t= name;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateElementNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Element();\n\t\tvar pl = qualifiedName.split(':');\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tnode.childNodes = new NodeList();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.tagName = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateAttributeNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Attr();\n\t\tvar pl = qualifiedName.split(':');\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.name = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tnode.specified = true;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\treturn node;\n\t}\n};\n_extends(Document,Node);\n\n\nfunction Element() {\n\tthis._nsMap = {};\n};\nElement.prototype = {\n\tnodeType : ELEMENT_NODE,\n\thasAttribute : function(name){\n\t\treturn this.getAttributeNode(name)!=null;\n\t},\n\tgetAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name);\n\t\treturn attr && attr.value || '';\n\t},\n\tgetAttributeNode : function(name){\n\t\treturn this.attributes.getNamedItem(name);\n\t},\n\tsetAttribute : function(name, value){\n\t\tvar attr = this.ownerDocument.createAttribute(name);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tremoveAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name)\n\t\tattr && this.removeAttributeNode(attr);\n\t},\n\t\n\t//four real opeartion method\n\tappendChild:function(newChild){\n\t\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\t\treturn this.insertBefore(newChild,null);\n\t\t}else{\n\t\t\treturn _appendSingleChild(this,newChild);\n\t\t}\n\t},\n\tsetAttributeNode : function(newAttr){\n\t\treturn this.attributes.setNamedItem(newAttr);\n\t},\n\tsetAttributeNodeNS : function(newAttr){\n\t\treturn this.attributes.setNamedItemNS(newAttr);\n\t},\n\tremoveAttributeNode : function(oldAttr){\n\t\t//console.log(this == oldAttr.ownerElement)\n\t\treturn this.attributes.removeNamedItem(oldAttr.nodeName);\n\t},\n\t//get real attribute name,and remove it by removeAttributeNode\n\tremoveAttributeNS : function(namespaceURI, localName){\n\t\tvar old = this.getAttributeNodeNS(namespaceURI, localName);\n\t\told && this.removeAttributeNode(old);\n\t},\n\t\n\thasAttributeNS : function(namespaceURI, localName){\n\t\treturn this.getAttributeNodeNS(namespaceURI, localName)!=null;\n\t},\n\tgetAttributeNS : function(namespaceURI, localName){\n\t\tvar attr = this.getAttributeNodeNS(namespaceURI, localName);\n\t\treturn attr && attr.value || '';\n\t},\n\tsetAttributeNS : function(namespaceURI, qualifiedName, value){\n\t\tvar attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tgetAttributeNodeNS : function(namespaceURI, localName){\n\t\treturn this.attributes.getNamedItemNS(namespaceURI, localName);\n\t},\n\t\n\tgetElementsByTagName : function(tagName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t});\n\t},\n\tgetElementsByTagNameNS : function(namespaceURI, localName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t\t\n\t\t});\n\t}\n};\nDocument.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;\nDocument.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;\n\n\n_extends(Element,Node);\nfunction Attr() {\n};\nAttr.prototype.nodeType = ATTRIBUTE_NODE;\n_extends(Attr,Node);\n\n\nfunction CharacterData() {\n};\nCharacterData.prototype = {\n\tdata : '',\n\tsubstringData : function(offset, count) {\n\t\treturn this.data.substring(offset, offset+count);\n\t},\n\tappendData: function(text) {\n\t\ttext = this.data+text;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t},\n\tinsertData: function(offset,text) {\n\t\tthis.replaceData(offset,0,text);\n\t\n\t},\n\tappendChild:function(newChild){\n\t\tthrow new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])\n\t},\n\tdeleteData: function(offset, count) {\n\t\tthis.replaceData(offset,count,\"\");\n\t},\n\treplaceData: function(offset, count, text) {\n\t\tvar start = this.data.substring(0,offset);\n\t\tvar end = this.data.substring(offset+count);\n\t\ttext = start + text + end;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t}\n}\n_extends(CharacterData,Node);\nfunction Text() {\n};\nText.prototype = {\n\tnodeName : \"#text\",\n\tnodeType : TEXT_NODE,\n\tsplitText : function(offset) {\n\t\tvar text = this.data;\n\t\tvar newText = text.substring(offset);\n\t\ttext = text.substring(0, offset);\n\t\tthis.data = this.nodeValue = text;\n\t\tthis.length = text.length;\n\t\tvar newNode = this.ownerDocument.createTextNode(newText);\n\t\tif(this.parentNode){\n\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);\n\t\t}\n\t\treturn newNode;\n\t}\n}\n_extends(Text,CharacterData);\nfunction Comment() {\n};\nComment.prototype = {\n\tnodeName : \"#comment\",\n\tnodeType : COMMENT_NODE\n}\n_extends(Comment,CharacterData);\n\nfunction CDATASection() {\n};\nCDATASection.prototype = {\n\tnodeName : \"#cdata-section\",\n\tnodeType : CDATA_SECTION_NODE\n}\n_extends(CDATASection,CharacterData);\n\n\nfunction DocumentType() {\n};\nDocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;\n_extends(DocumentType,Node);\n\nfunction Notation() {\n};\nNotation.prototype.nodeType = NOTATION_NODE;\n_extends(Notation,Node);\n\nfunction Entity() {\n};\nEntity.prototype.nodeType = ENTITY_NODE;\n_extends(Entity,Node);\n\nfunction EntityReference() {\n};\nEntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;\n_extends(EntityReference,Node);\n\nfunction DocumentFragment() {\n};\nDocumentFragment.prototype.nodeName =\t\"#document-fragment\";\nDocumentFragment.prototype.nodeType =\tDOCUMENT_FRAGMENT_NODE;\n_extends(DocumentFragment,Node);\n\n\nfunction ProcessingInstruction() {\n}\nProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;\n_extends(ProcessingInstruction,Node);\nfunction XMLSerializer(){}\nXMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){\n\treturn nodeSerializeToString.call(node,isHtml,nodeFilter);\n}\nNode.prototype.toString = nodeSerializeToString;\nfunction nodeSerializeToString(isHtml,nodeFilter){\n\tvar buf = [];\n\tvar refNode = this.nodeType == 9 && this.documentElement || this;\n\tvar prefix = refNode.prefix;\n\tvar uri = refNode.namespaceURI;\n\t\n\tif(uri && prefix == null){\n\t\t//console.log(prefix)\n\t\tvar prefix = refNode.lookupPrefix(uri);\n\t\tif(prefix == null){\n\t\t\t//isHTML = true;\n\t\t\tvar visibleNamespaces=[\n\t\t\t{namespace:uri,prefix:null}\n\t\t\t//{namespace:uri,prefix:''}\n\t\t\t]\n\t\t}\n\t}\n\tserializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);\n\t//console.log('###',this.nodeType,uri,prefix,buf.join(''))\n\treturn buf.join('');\n}\n\nfunction needNamespaceDefine(node, isHTML, visibleNamespaces) {\n\tvar prefix = node.prefix || '';\n\tvar uri = node.namespaceURI;\n\t// According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,\n\t// and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :\n\t// > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.\n\t// in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)\n\t// and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :\n\t// > [...] Furthermore, the attribute value [...] must not be an empty string.\n\t// so serializing empty namespace value like xmlns:ds=\"\" would produce an invalid XML document.\n\tif (!uri) {\n\t\treturn false;\n\t}\n\tif (prefix === \"xml\" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {\n\t\treturn false;\n\t}\n\t\n\tvar i = visibleNamespaces.length \n\twhile (i--) {\n\t\tvar ns = visibleNamespaces[i];\n\t\t// get namespace prefix\n\t\tif (ns.prefix === prefix) {\n\t\t\treturn ns.namespace !== uri;\n\t\t}\n\t}\n\treturn true;\n}\n/**\n * Well-formed constraint: No < in Attribute Values\n * The replacement text of any entity referred to directly or indirectly in an attribute value must not contain a <.\n * @see https://www.w3.org/TR/xml/#CleanAttrVals\n * @see https://www.w3.org/TR/xml/#NT-AttValue\n */\nfunction addSerializedAttribute(buf, qualifiedName, value) {\n\tbuf.push(' ', qualifiedName, '=\"', value.replace(/[<&\"]/g,_xmlEncoder), '\"')\n}\n\nfunction serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){\n\tif (!visibleNamespaces) {\n\t\tvisibleNamespaces = [];\n\t}\n\n\tif(nodeFilter){\n\t\tnode = nodeFilter(node);\n\t\tif(node){\n\t\t\tif(typeof node == 'string'){\n\t\t\t\tbuf.push(node);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t//buf.sort.apply(attrs, attributeSorter);\n\t}\n\n\tswitch(node.nodeType){\n\tcase ELEMENT_NODE:\n\t\tvar attrs = node.attributes;\n\t\tvar len = attrs.length;\n\t\tvar child = node.firstChild;\n\t\tvar nodeName = node.tagName;\n\t\t\n\t\tisHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML\n\n\t\tvar prefixedNodeName = nodeName\n\t\tif (!isHTML && !node.prefix && node.namespaceURI) {\n\t\t\tvar defaultNS\n\t\t\t// lookup current default ns from `xmlns` attribute\n\t\t\tfor (var ai = 0; ai < attrs.length; ai++) {\n\t\t\t\tif (attrs.item(ai).name === 'xmlns') {\n\t\t\t\t\tdefaultNS = attrs.item(ai).value\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!defaultNS) {\n\t\t\t\t// lookup current default ns in visibleNamespaces\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tdefaultNS = namespace.namespace\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (defaultNS !== node.namespaceURI) {\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tif (namespace.prefix) {\n\t\t\t\t\t\t\tprefixedNodeName = namespace.prefix + ':' + nodeName\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuf.push('<', prefixedNodeName);\n\n\t\tfor(var i=0;i<len;i++){\n\t\t\t// add namespaces for attributes\n\t\t\tvar attr = attrs.item(i);\n\t\t\tif (attr.prefix == 'xmlns') {\n\t\t\t\tvisibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });\n\t\t\t}else if(attr.nodeName == 'xmlns'){\n\t\t\t\tvisibleNamespaces.push({ prefix: '', namespace: attr.value });\n\t\t\t}\n\t\t}\n\n\t\tfor(var i=0;i<len;i++){\n\t\t\tvar attr = attrs.item(i);\n\t\t\tif (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {\n\t\t\t\tvar prefix = attr.prefix||'';\n\t\t\t\tvar uri = attr.namespaceURI;\n\t\t\t\taddSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : \"xmlns\", uri);\n\t\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace:uri });\n\t\t\t}\n\t\t\tserializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);\n\t\t}\n\n\t\t// add namespace for current node\t\t\n\t\tif (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {\n\t\t\tvar prefix = node.prefix||'';\n\t\t\tvar uri = node.namespaceURI;\n\t\t\taddSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : \"xmlns\", uri);\n\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace:uri });\n\t\t}\n\t\t\n\t\tif(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){\n\t\t\tbuf.push('>');\n\t\t\t//if is cdata child node\n\t\t\tif(isHTML && /^script$/i.test(nodeName)){\n\t\t\t\twhile(child){\n\t\t\t\t\tif(child.data){\n\t\t\t\t\t\tbuf.push(child.data);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\t}\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\twhile(child){\n\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuf.push('</',prefixedNodeName,'>');\n\t\t}else{\n\t\t\tbuf.push('/>');\n\t\t}\n\t\t// remove added visible namespaces\n\t\t//visibleNamespaces.length = startVisibleNamespaces;\n\t\treturn;\n\tcase DOCUMENT_NODE:\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t\treturn;\n\tcase ATTRIBUTE_NODE:\n\t\treturn addSerializedAttribute(buf, node.name, node.value);\n\tcase TEXT_NODE:\n\t\t/**\n\t\t * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,\n\t\t * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.\n\t\t * If they are needed elsewhere, they must be escaped using either numeric character references or the strings\n\t\t * `&` and `<` respectively.\n\t\t * The right angle bracket (>) may be represented using the string \" > \", and must, for compatibility,\n\t\t * be escaped using either `>` or a character reference when it appears in the string `]]>` in content,\n\t\t * when that string is not marking the end of a CDATA section.\n\t\t *\n\t\t * In the content of elements, character data is any string of characters\n\t\t * which does not contain the start-delimiter of any markup\n\t\t * and does not include the CDATA-section-close delimiter, `]]>`.\n\t\t *\n\t\t * @see https://www.w3.org/TR/xml/#NT-CharData\n\t\t */\n\t\treturn buf.push(node.data\n\t\t\t.replace(/[<&]/g,_xmlEncoder)\n\t\t\t.replace(/]]>/g, ']]>')\n\t\t);\n\tcase CDATA_SECTION_NODE:\n\t\treturn buf.push( '<![CDATA[',node.data,']]>');\n\tcase COMMENT_NODE:\n\t\treturn buf.push( \"<!--\",node.data,\"-->\");\n\tcase DOCUMENT_TYPE_NODE:\n\t\tvar pubid = node.publicId;\n\t\tvar sysid = node.systemId;\n\t\tbuf.push('<!DOCTYPE ',node.name);\n\t\tif(pubid){\n\t\t\tbuf.push(' PUBLIC ', pubid);\n\t\t\tif (sysid && sysid!='.') {\n\t\t\t\tbuf.push(' ', sysid);\n\t\t\t}\n\t\t\tbuf.push('>');\n\t\t}else if(sysid && sysid!='.'){\n\t\t\tbuf.push(' SYSTEM ', sysid, '>');\n\t\t}else{\n\t\t\tvar sub = node.internalSubset;\n\t\t\tif(sub){\n\t\t\t\tbuf.push(\" [\",sub,\"]\");\n\t\t\t}\n\t\t\tbuf.push(\">\");\n\t\t}\n\t\treturn;\n\tcase PROCESSING_INSTRUCTION_NODE:\n\t\treturn buf.push( \"<?\",node.target,\" \",node.data,\"?>\");\n\tcase ENTITY_REFERENCE_NODE:\n\t\treturn buf.push( '&',node.nodeName,';');\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\tdefault:\n\t\tbuf.push('??',node.nodeName);\n\t}\n}\nfunction importNode(doc,node,deep){\n\tvar node2;\n\tswitch (node.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tnode2 = node.cloneNode(false);\n\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i<len;i++){\n\t\t\t//node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));\n\t\t//}\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tbreak;\n\tcase ATTRIBUTE_NODE:\n\t\tdeep = true;\n\t\tbreak;\n\t//case ENTITY_REFERENCE_NODE:\n\t//case PROCESSING_INSTRUCTION_NODE:\n\t////case TEXT_NODE:\n\t//case CDATA_SECTION_NODE:\n\t//case COMMENT_NODE:\n\t//\tdeep = false;\n\t//\tbreak;\n\t//case DOCUMENT_NODE:\n\t//case DOCUMENT_TYPE_NODE:\n\t//cannot be imported.\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\t//can not hit in level3\n\t//default:throw e;\n\t}\n\tif(!node2){\n\t\tnode2 = node.cloneNode(false);//false\n\t}\n\tnode2.ownerDocument = doc;\n\tnode2.parentNode = null;\n\tif(deep){\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tnode2.appendChild(importNode(doc,child,deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n//\n//var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,\n//\t\t\t\t\tattributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};\nfunction cloneNode(doc,node,deep){\n\tvar node2 = new node.constructor();\n\tfor(var n in node){\n\t\tvar v = node[n];\n\t\tif(typeof v != 'object' ){\n\t\t\tif(v != node2[n]){\n\t\t\t\tnode2[n] = v;\n\t\t\t}\n\t\t}\n\t}\n\tif(node.childNodes){\n\t\tnode2.childNodes = new NodeList();\n\t}\n\tnode2.ownerDocument = doc;\n\tswitch (node2.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tvar attrs\t= node.attributes;\n\t\tvar attrs2\t= node2.attributes = new NamedNodeMap();\n\t\tvar len = attrs.length\n\t\tattrs2._ownerElement = node2;\n\t\tfor(var i=0;i<len;i++){\n\t\t\tnode2.setAttributeNode(cloneNode(doc,attrs.item(i),true));\n\t\t}\n\t\tbreak;;\n\tcase ATTRIBUTE_NODE:\n\t\tdeep = true;\n\t}\n\tif(deep){\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tnode2.appendChild(cloneNode(doc,child,deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n\nfunction __set__(object,key,value){\n\tobject[key] = value\n}\n//do dynamic\ntry{\n\tif(Object.defineProperty){\n\t\tObject.defineProperty(LiveNodeList.prototype,'length',{\n\t\t\tget:function(){\n\t\t\t\t_updateLiveList(this);\n\t\t\t\treturn this.$$length;\n\t\t\t}\n\t\t});\n\n\t\tObject.defineProperty(Node.prototype,'textContent',{\n\t\t\tget:function(){\n\t\t\t\treturn getTextContent(this);\n\t\t\t},\n\n\t\t\tset:function(data){\n\t\t\t\tswitch(this.nodeType){\n\t\t\t\tcase ELEMENT_NODE:\n\t\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\t\twhile(this.firstChild){\n\t\t\t\t\t\tthis.removeChild(this.firstChild);\n\t\t\t\t\t}\n\t\t\t\t\tif(data || String(data)){\n\t\t\t\t\t\tthis.appendChild(this.ownerDocument.createTextNode(data));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.data = data;\n\t\t\t\t\tthis.value = data;\n\t\t\t\t\tthis.nodeValue = data;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t\n\t\tfunction getTextContent(node){\n\t\t\tswitch(node.nodeType){\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\tvar buf = [];\n\t\t\t\tnode = node.firstChild;\n\t\t\t\twhile(node){\n\t\t\t\t\tif(node.nodeType!==7 && node.nodeType !==8){\n\t\t\t\t\t\tbuf.push(getTextContent(node));\n\t\t\t\t\t}\n\t\t\t\t\tnode = node.nextSibling;\n\t\t\t\t}\n\t\t\t\treturn buf.join('');\n\t\t\tdefault:\n\t\t\t\treturn node.nodeValue;\n\t\t\t}\n\t\t}\n\n\t\t__set__ = function(object,key,value){\n\t\t\t//console.log(value)\n\t\t\tobject['$$'+key] = value\n\t\t}\n\t}\n}catch(e){//ie8\n}\n\n//if(typeof require == 'function'){\n\texports.DocumentType = DocumentType;\n\texports.DOMException = DOMException;\n\texports.DOMImplementation = DOMImplementation;\n\texports.Element = Element;\n\texports.Node = Node;\n\texports.NodeList = NodeList;\n\texports.XMLSerializer = XMLSerializer;\n//}\n\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar Class = __webpack_require__(61),\n hasConnected = false, // See the `isChromecastConnected` function.\n ChromecastSessionManager;\n\nfunction getCastContext() {\n return cast.framework.CastContext.getInstance();\n}\n\nChromecastSessionManager = Class.extend(/** @lends ChromecastSessionManager.prototype **/ {\n\n /**\n * Stores the state of the current Chromecast session and its associated objects such\n * as the\n * [RemotePlayerController](https://developers.google.com/cast/docs/reference/chrome/cast.framework.RemotePlayerController),\n * and the\n * [RemotePlayer](https://developers.google.com/cast/docs/reference/chrome/cast.framework.RemotePlayer).\n *\n * WARNING: Do not instantiate this class until the\n * [CastContext](https://developers.google.com/cast/docs/reference/chrome/cast.framework.CastContext)\n * has been configured.\n *\n * For an undocumented (and thus unknown) reason, RemotePlayer and\n * RemotePlayerController instances created before the cast context has been configured\n * or after requesting a session or loading media will not stay in sync with media\n * items that are loaded later.\n *\n * For example, the first item that you cast will work as expected: events on\n * RemotePlayerController will fire and the state (currentTime, duration, etc) of the\n * RemotePlayer instance will update as the media item plays. However, if a new media\n * item is loaded via a `loadMedia` request, the media item will play, but the\n * remotePlayer will be in a \"media unloaded\" state where the duration is 0, the\n * currentTime does not update, and no change events are fired (except, strangely,\n * displayStatus updates).\n *\n * @param player {object} Video.js Player\n * @constructs ChromecastSessionManager\n */\n init: function(player) {\n this.player = player;\n\n this._sessionListener = this._onSessionStateChange.bind(this);\n this._castListener = this._onCastStateChange.bind(this);\n\n this._addCastContextEventListeners();\n\n // Remove global event listeners when this player instance is destroyed to prevent\n // memory leaks.\n this.player.on('dispose', this._removeCastContextEventListeners.bind(this));\n\n this._notifyPlayerOfDevicesAvailabilityChange(this.getCastContext().getCastState());\n\n this.remotePlayer = new cast.framework.RemotePlayer();\n this.remotePlayerController = new cast.framework.RemotePlayerController(this.remotePlayer);\n },\n\n /**\n * Add event listeners for events triggered on the current CastContext.\n *\n * @private\n */\n _addCastContextEventListeners: function() {\n var sessionStateChangedEvt = cast.framework.CastContextEventType.SESSION_STATE_CHANGED,\n castStateChangedEvt = cast.framework.CastContextEventType.CAST_STATE_CHANGED;\n\n this.getCastContext().addEventListener(sessionStateChangedEvt, this._sessionListener);\n this.getCastContext().addEventListener(castStateChangedEvt, this._castListener);\n },\n\n /**\n * Remove event listeners that were added in {@link\n * ChromecastSessionManager#_addCastContextEventListeners}.\n *\n * @private\n */\n _removeCastContextEventListeners: function() {\n var sessionStateChangedEvt = cast.framework.CastContextEventType.SESSION_STATE_CHANGED,\n castStateChangedEvt = cast.framework.CastContextEventType.CAST_STATE_CHANGED;\n\n this.getCastContext().removeEventListener(sessionStateChangedEvt, this._sessionListener);\n this.getCastContext().removeEventListener(castStateChangedEvt, this._castListener);\n },\n\n /**\n * Handle the CastContext's SessionState change event.\n *\n * @private\n */\n _onSessionStateChange: function(event) {\n if (event.sessionState === cast.framework.SessionState.SESSION_ENDED) {\n this.player.trigger('chromecastDisconnected');\n this._reloadTech();\n }\n },\n\n /**\n * Handle the CastContext's CastState change event.\n *\n * @private\n */\n _onCastStateChange: function(event) {\n this._notifyPlayerOfDevicesAvailabilityChange(event.castState);\n },\n\n /**\n * Triggers player events that notifies listeners that Chromecast devices are\n * either available or unavailable.\n *\n * @private\n */\n _notifyPlayerOfDevicesAvailabilityChange: function(castState) {\n if (this.hasAvailableDevices(castState)) {\n this.player.trigger('chromecastDevicesAvailable');\n } else {\n this.player.trigger('chromecastDevicesUnavailable');\n }\n },\n\n /**\n * Returns whether or not there are Chromecast devices available to cast to.\n *\n * @see https://developers.google.com/cast/docs/reference/chrome/cast.framework#.CastState\n * @param {String} castState\n * @return {boolean} true if there are Chromecast devices available to cast to.\n */\n hasAvailableDevices: function(castState) {\n castState = castState || this.getCastContext().getCastState();\n\n return castState === cast.framework.CastState.NOT_CONNECTED ||\n castState === cast.framework.CastState.CONNECTING ||\n castState === cast.framework.CastState.CONNECTED;\n },\n\n /**\n * Opens the Chromecast casting menu by requesting a CastSession. Does nothing if the\n * Video.js player does not have a source.\n */\n openCastMenu: function() {\n var onSessionSuccess;\n\n if (!this.player.currentSource()) {\n // Do not cast if there is no media item loaded in the player\n return;\n }\n onSessionSuccess = function() {\n hasConnected = true;\n this.player.trigger('chromecastConnected');\n this._reloadTech();\n }.bind(this);\n\n // It is the `requestSession` function call that actually causes the cast menu to\n // open.\n // The second parameter to `.then` is an error handler. We use a noop function here\n // because we handle errors in the ChromecastTech class and we do not want an\n // error to bubble up to the console. This error handler is also triggered when\n // the user closes out of the chromecast selector pop-up without choosing a\n // casting destination.\n this.getCastContext().requestSession()\n .then(onSessionSuccess, function() { /* noop */ });\n },\n\n /**\n * Reloads the Video.js player's Tech. This causes the player to re-evaluate which\n * Tech should be used for the current source by iterating over available Tech and\n * calling `Tech.isSupported` and `Tech.canPlaySource`. Video.js uses the first\n * Tech that returns true from both of those functions. This is what allows us to\n * switch back and forth between the Chromecast Tech and other available Tech when a\n * CastSession is connected or disconnected.\n *\n * @private\n */\n _reloadTech: function() {\n var player = this.player,\n currentTime = player.currentTime(),\n wasPaused = player.paused(),\n sources = player.currentSources();\n\n // Reload the current source(s) to re-lookup and use the currently available Tech.\n // The chromecast Tech gets used if `ChromecastSessionManager.isChromecastConnected`\n // is true (effectively, if a chromecast session is currently in progress),\n // otherwise Video.js continues to search through the Tech list for other eligible\n // Tech to use, such as the HTML5 player.\n player.src(sources);\n\n player.ready(function() {\n if (wasPaused) {\n player.pause();\n } else {\n player.play();\n }\n player.currentTime(currentTime || 0);\n });\n },\n\n /**\n * @see https://developers.google.com/cast/docs/reference/chrome/cast.framework.CastContext\n * @returns {object} the current CastContext, if one exists\n */\n getCastContext: getCastContext,\n\n /**\n * @see https://developers.google.com/cast/docs/reference/chrome/cast.framework.RemotePlayer\n * @returns {object} the current RemotePlayer, if one exists\n */\n getRemotePlayer: function() {\n return this.remotePlayer;\n },\n\n /**\n * @see https://developers.google.com/cast/docs/reference/chrome/cast.framework.RemotePlayerController\n * @returns {object} the current RemotePlayerController, if one exists\n */\n getRemotePlayerController: function() {\n return this.remotePlayerController;\n },\n});\n\n\n/**\n * Returns whether or not the current Chromecast API is available (that is,\n * `window.chrome`, `window.chrome.cast`, and `window.cast` exist).\n *\n * @static\n * @returns {boolean} true if the Chromecast API is available\n */\nChromecastSessionManager.isChromecastAPIAvailable = function() {\n return window.chrome && window.chrome.cast && window.cast;\n};\n\n/**\n * Returns whether or not there is a current CastSession and it is connected.\n *\n * @static\n * @returns {boolean} true if the current CastSession exists and is connected\n */\nChromecastSessionManager.isChromecastConnected = function() {\n // We must also check the `hasConnected` flag because\n // `getCastContext().getCastState()` returns `CONNECTED` even when the current casting\n // session was initiated by another tab in the browser or by another process.\n return ChromecastSessionManager.isChromecastAPIAvailable() &&\n (getCastContext().getCastState() === cast.framework.CastState.CONNECTED) &&\n hasConnected;\n};\n\nmodule.exports = ChromecastSessionManager;\n\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports) {\n\n(function(){\n var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\\b_super\\b/ : /.*/;\n \n // The base Class implementation (does nothing)\n this.Class = function(){};\n \n // Create a new Class that inherits from this class\n Class.extend = function(prop) {\n var _super = this.prototype;\n \n // Instantiate a base class (but only create the instance,\n // don't run the init constructor)\n initializing = true;\n var prototype = new this();\n initializing = false;\n \n // Copy the properties over onto the new prototype\n for (var name in prop) {\n // Check if we're overwriting an existing function\n prototype[name] = typeof prop[name] == \"function\" &&\n typeof _super[name] == \"function\" && fnTest.test(prop[name]) ?\n (function(name, fn){\n return function() {\n var tmp = this._super;\n \n // Add a new ._super() method that is the same method\n // but on the super-class\n this._super = _super[name];\n \n // The method only need to be bound temporarily, so we\n // remove it when we're done executing\n var ret = fn.apply(this, arguments); \n this._super = tmp;\n \n return ret;\n };\n })(name, prop[name]) :\n prop[name];\n }\n \n // The dummy class constructor\n function Class() {\n // All construction is actually done in the init method\n if ( !initializing && this.init )\n this.init.apply(this, arguments);\n }\n \n // Populate our constructed prototype object\n Class.prototype = prototype;\n \n // Enforce the constructor to be what we expect\n Class.prototype.constructor = Class;\n \n // And make this class extendable\n Class.extend = arguments.callee;\n \n return Class;\n };\n\n //I only added this line\n module.exports = Class;\n})();\n\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * @module hasAirPlayAPISupport\n */\n\n/**\n * Returns whether or not the current browser environment supports AirPlay.\n *\n * @private\n * @returns {boolean} true if AirPlay support is available\n */\nmodule.exports = function() {\n return !!window.WebKitPlaybackTargetAvailabilityEvent;\n};\n\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar rng = __webpack_require__(75);\nvar bytesToUuid = __webpack_require__(76);\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options == 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * Lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors <https://js.foundation/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(14), __webpack_require__(77)(module)))\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports) {\n\nmodule.exports = SafeParseTuple\n\nfunction SafeParseTuple(obj, reviver) {\n var json\n var error = null\n\n try {\n json = JSON.parse(obj, reviver)\n } catch (err) {\n error = err\n }\n\n return [error, json]\n}\n\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar setPrototypeOf = __webpack_require__(37);\n\nvar isNativeReflectConstruct = __webpack_require__(122);\n\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct;\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _construct.apply(null, arguments);\n}\n\nmodule.exports = _construct;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar setPrototypeOf = __webpack_require__(37);\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports) {\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dom = __webpack_require__(59)\nexports.DOMImplementation = dom.DOMImplementation\nexports.XMLSerializer = dom.XMLSerializer\nexports.DOMParser = __webpack_require__(128).DOMParser\n\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"mux.js/lib/tools/parse-sidx\");\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar emptyFunction = __webpack_require__(72);\nvar invariant = __webpack_require__(73);\nvar ReactPropTypesSecret = __webpack_require__(74);\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (false) {}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\nvar rng;\n\nvar crypto = global.crypto || global.msCrypto; // for IE 11\nif (crypto && crypto.getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n rng = function whatwgRNG() {\n crypto.getRandomValues(rnds8);\n return rnds8;\n };\n}\n\nif (!rng) {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n rng = function() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n\nmodule.exports = rng;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(14)))\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports) {\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n}\n\nmodule.exports = bytesToUuid;\n\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports) {\n\nmodule.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(79);\n__webpack_require__(81);\nmodule.exports = __webpack_require__(19).String;\n\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(22);\nvar $re = __webpack_require__(45)(/[&<>\"']/g, {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n});\n\n$export($export.P + $export.F, 'String', { escapeHTML: function escapeHTML() { return $re(this); } });\n\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports) {\n\nmodule.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $export = __webpack_require__(22);\nvar $re = __webpack_require__(45)(/&(?:amp|lt|gt|quot|apos);/g, {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n});\n\n$export($export.P + $export.F, 'String', { unescapeHTML: function unescapeHTML() { return $re(this); } });\n\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(83);\n__webpack_require__(84);\n__webpack_require__(96);\n__webpack_require__(99);\nmodule.exports = __webpack_require__(19).Map;\n\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n// 19.1.3.6 Object.prototype.toString()\nvar classof = __webpack_require__(46);\nvar test = {};\ntest[__webpack_require__(8)('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n __webpack_require__(18)(Object.prototype, 'toString', function toString() {\n return '[object ' + classof(this) + ']';\n }, true);\n}\n\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar $at = __webpack_require__(85)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(34)(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(32);\nvar defined = __webpack_require__(33);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports) {\n\nmodule.exports = false;\n\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar create = __webpack_require__(49);\nvar descriptor = __webpack_require__(31);\nvar setToStringTag = __webpack_require__(36);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(15)(IteratorPrototype, __webpack_require__(8)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar dP = __webpack_require__(16);\nvar anObject = __webpack_require__(17);\nvar getKeys = __webpack_require__(50);\n\nmodule.exports = __webpack_require__(12) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n\n\n/***/ }),\n/* 89 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar has = __webpack_require__(13);\nvar toIObject = __webpack_require__(26);\nvar arrayIndexOf = __webpack_require__(91)(false);\nvar IE_PROTO = __webpack_require__(35)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n\n\n/***/ }),\n/* 90 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(47);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n/***/ }),\n/* 91 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(26);\nvar toLength = __webpack_require__(51);\nvar toAbsoluteIndex = __webpack_require__(92);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\n\n/***/ }),\n/* 92 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar toInteger = __webpack_require__(32);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n\n/***/ }),\n/* 93 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar document = __webpack_require__(9).document;\nmodule.exports = document && document.documentElement;\n\n\n/***/ }),\n/* 94 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(13);\nvar toObject = __webpack_require__(95);\nvar IE_PROTO = __webpack_require__(35)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(33);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar $iterators = __webpack_require__(97);\nvar getKeys = __webpack_require__(50);\nvar redefine = __webpack_require__(18);\nvar global = __webpack_require__(9);\nvar hide = __webpack_require__(15);\nvar Iterators = __webpack_require__(20);\nvar wks = __webpack_require__(8);\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar addToUnscopables = __webpack_require__(98);\nvar step = __webpack_require__(53);\nvar Iterators = __webpack_require__(20);\nvar toIObject = __webpack_require__(26);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(34)(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = __webpack_require__(8)('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(15)(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar strong = __webpack_require__(100);\nvar validate = __webpack_require__(58);\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = __webpack_require__(105)(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar dP = __webpack_require__(16).f;\nvar create = __webpack_require__(49);\nvar redefineAll = __webpack_require__(54);\nvar ctx = __webpack_require__(25);\nvar anInstance = __webpack_require__(55);\nvar forOf = __webpack_require__(56);\nvar $iterDefine = __webpack_require__(34);\nvar step = __webpack_require__(53);\nvar setSpecies = __webpack_require__(104);\nvar DESCRIPTORS = __webpack_require__(12);\nvar fastKey = __webpack_require__(57).fastKey;\nvar validate = __webpack_require__(58);\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(17);\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// check on default Array iterator\nvar Iterators = __webpack_require__(20);\nvar ITERATOR = __webpack_require__(8)('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar classof = __webpack_require__(46);\nvar ITERATOR = __webpack_require__(8)('iterator');\nvar Iterators = __webpack_require__(20);\nmodule.exports = __webpack_require__(19).getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n\n\n/***/ }),\n/* 104 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(9);\nvar dP = __webpack_require__(16);\nvar DESCRIPTORS = __webpack_require__(12);\nvar SPECIES = __webpack_require__(8)('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n\n\n/***/ }),\n/* 105 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar global = __webpack_require__(9);\nvar $export = __webpack_require__(22);\nvar redefine = __webpack_require__(18);\nvar redefineAll = __webpack_require__(54);\nvar meta = __webpack_require__(57);\nvar forOf = __webpack_require__(56);\nvar anInstance = __webpack_require__(55);\nvar isObject = __webpack_require__(10);\nvar fails = __webpack_require__(23);\nvar $iterDetect = __webpack_require__(106);\nvar setToStringTag = __webpack_require__(36);\nvar inheritIfRequired = __webpack_require__(107);\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n\n\n/***/ }),\n/* 106 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar ITERATOR = __webpack_require__(8)('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n\n\n/***/ }),\n/* 107 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar isObject = __webpack_require__(10);\nvar setPrototypeOf = __webpack_require__(108).set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n\n\n/***/ }),\n/* 108 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(10);\nvar anObject = __webpack_require__(17);\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = __webpack_require__(25)(Function.call, __webpack_require__(109).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n\n\n/***/ }),\n/* 109 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar pIE = __webpack_require__(110);\nvar createDesc = __webpack_require__(31);\nvar toIObject = __webpack_require__(26);\nvar toPrimitive = __webpack_require__(44);\nvar has = __webpack_require__(13);\nvar IE8_DOM_DEFINE = __webpack_require__(42);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(12) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n\n/***/ }),\n/* 110 */\n/***/ (function(module, exports) {\n\nexports.f = {}.propertyIsEnumerable;\n\n\n/***/ }),\n/* 111 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// extracted by mini-css-extract-plugin\n\n/***/ }),\n/* 112 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// extracted by mini-css-extract-plugin\n\n/***/ }),\n/* 113 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// extracted by mini-css-extract-plugin\n\n/***/ }),\n/* 114 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var video_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"videojs\", function() { return video_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* eslint-disable no-undef */\n\n/* eslint-disable import/newline-after-import */\n\nwindow.videojs = video_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n\n__webpack_require__(131);\n\n__webpack_require__(133);\n\n__webpack_require__(28);\n\n__webpack_require__(134);\n\n__webpack_require__(135)(video_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n preloadWebComponents: true\n});\n\n__webpack_require__(142)(video_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n preloadWebComponents: true\n});\n\n\n\n/***/ }),\n/* 115 */\n/***/ (function(module, exports) {\n\n/* (ignored) */\n\n/***/ }),\n/* 116 */\n/***/ (function(module, exports) {\n\nfunction _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;\n\n/***/ }),\n/* 117 */\n/***/ (function(module, exports) {\n\nmodule.exports = isFunction\n\nvar toString = Object.prototype.toString\n\nfunction isFunction (fn) {\n if (!fn) {\n return false\n }\n var string = toString.call(fn)\n return string === '[object Function]' ||\n (typeof fn === 'function' && string !== '[object RegExp]') ||\n (typeof window !== 'undefined' &&\n // IE8 and below\n (fn === window.setTimeout ||\n fn === window.alert ||\n fn === window.confirm ||\n fn === window.prompt))\n};\n\n\n/***/ }),\n/* 118 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar window = __webpack_require__(0);\n\nvar httpResponseHandler = function httpResponseHandler(callback, decodeResponseBody) {\n if (decodeResponseBody === void 0) {\n decodeResponseBody = false;\n }\n\n return function (err, response, responseBody) {\n // if the XHR failed, return that error\n if (err) {\n callback(err);\n return;\n } // if the HTTP status code is 4xx or 5xx, the request also failed\n\n\n if (response.statusCode >= 400 && response.statusCode <= 599) {\n var cause = responseBody;\n\n if (decodeResponseBody) {\n if (window.TextDecoder) {\n var charset = getCharset(response.headers && response.headers['content-type']);\n\n try {\n cause = new TextDecoder(charset).decode(responseBody);\n } catch (e) {}\n } else {\n cause = String.fromCharCode.apply(null, new Uint8Array(responseBody));\n }\n }\n\n callback({\n cause: cause\n });\n return;\n } // otherwise, request succeeded\n\n\n callback(null, responseBody);\n };\n};\n\nfunction getCharset(contentTypeHeader) {\n if (contentTypeHeader === void 0) {\n contentTypeHeader = '';\n }\n\n return contentTypeHeader.toLowerCase().split(';').reduce(function (charset, contentType) {\n var _contentType$split = contentType.split('='),\n type = _contentType$split[0],\n value = _contentType$split[1];\n\n if (type.trim() === 'charset') {\n return value.trim();\n }\n\n return charset;\n }, 'utf-8');\n}\n\nmodule.exports = httpResponseHandler;\n\n/***/ }),\n/* 119 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */\nvar document = __webpack_require__(1);\n\nvar _objCreate = Object.create || (function() {\n function F() {}\n return function(o) {\n if (arguments.length !== 1) {\n throw new Error('Object.create shim only accepts one parameter.');\n }\n F.prototype = o;\n return new F();\n };\n})();\n\n// Creates a new ParserError object from an errorData object. The errorData\n// object should have default code and message properties. The default message\n// property can be overriden by passing in a message parameter.\n// See ParsingError.Errors below for acceptable errors.\nfunction ParsingError(errorData, message) {\n this.name = \"ParsingError\";\n this.code = errorData.code;\n this.message = message || errorData.message;\n}\nParsingError.prototype = _objCreate(Error.prototype);\nParsingError.prototype.constructor = ParsingError;\n\n// ParsingError metadata for acceptable ParsingErrors.\nParsingError.Errors = {\n BadSignature: {\n code: 0,\n message: \"Malformed WebVTT signature.\"\n },\n BadTimeStamp: {\n code: 1,\n message: \"Malformed time stamp.\"\n }\n};\n\n// Try to parse input as a time stamp.\nfunction parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{1,2})(:\\d{1,2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}\n\n// A settings object holds key/value pairs and will ignore anything but the first\n// assignment to a specific key.\nfunction Settings() {\n this.values = _objCreate(null);\n}\n\nSettings.prototype = {\n // Only accept the first assignment to any key.\n set: function(k, v) {\n if (!this.get(k) && v !== \"\") {\n this.values[k] = v;\n }\n },\n // Return the value for a key, or a default value.\n // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n // a number of possible default values as properties where 'defaultKey' is\n // the key of the property that will be chosen; otherwise it's assumed to be\n // a single value.\n get: function(k, dflt, defaultKey) {\n if (defaultKey) {\n return this.has(k) ? this.values[k] : dflt[defaultKey];\n }\n return this.has(k) ? this.values[k] : dflt;\n },\n // Check whether we have a value for a key.\n has: function(k) {\n return k in this.values;\n },\n // Accept a setting if its one of the given alternatives.\n alt: function(k, v, a) {\n for (var n = 0; n < a.length; ++n) {\n if (v === a[n]) {\n this.set(k, v);\n break;\n }\n }\n },\n // Accept a setting if its a valid (signed) integer.\n integer: function(k, v) {\n if (/^-?\\d+$/.test(v)) { // integer\n this.set(k, parseInt(v, 10));\n }\n },\n // Accept a setting if its a valid percentage.\n percent: function(k, v) {\n var m;\n if ((m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/))) {\n v = parseFloat(v);\n if (v >= 0 && v <= 100) {\n this.set(k, v);\n return true;\n }\n }\n return false;\n }\n};\n\n// Helper function to parse input into groups separated by 'groupDelim', and\n// interprete each group as a key/value pair separated by 'keyValueDelim'.\nfunction parseOptions(input, callback, keyValueDelim, groupDelim) {\n var groups = groupDelim ? input.split(groupDelim) : [input];\n for (var i in groups) {\n if (typeof groups[i] !== \"string\") {\n continue;\n }\n var kv = groups[i].split(keyValueDelim);\n if (kv.length !== 2) {\n continue;\n }\n var k = kv[0];\n var v = kv[1];\n callback(k, v);\n }\n}\n\nfunction parseCue(input, cue, regionList) {\n // Remember the original input if we need to throw an error.\n var oInput = input;\n // 4.1 WebVTT timestamp\n function consumeTimeStamp() {\n var ts = parseTimeStamp(input);\n if (ts === null) {\n throw new ParsingError(ParsingError.Errors.BadTimeStamp,\n \"Malformed timestamp: \" + oInput);\n }\n // Remove time stamp from input.\n input = input.replace(/^[^\\sa-zA-Z-]+/, \"\");\n return ts;\n }\n\n // 4.4.2 WebVTT cue settings\n function consumeCueSettings(input, cue) {\n var settings = new Settings();\n\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"region\":\n // Find the last region we parsed with the same region id.\n for (var i = regionList.length - 1; i >= 0; i--) {\n if (regionList[i].id === v) {\n settings.set(k, regionList[i].region);\n break;\n }\n }\n break;\n case \"vertical\":\n settings.alt(k, v, [\"rl\", \"lr\"]);\n break;\n case \"line\":\n var vals = v.split(\",\"),\n vals0 = vals[0];\n settings.integer(k, vals0);\n settings.percent(k, vals0) ? settings.set(\"snapToLines\", false) : null;\n settings.alt(k, vals0, [\"auto\"]);\n if (vals.length === 2) {\n settings.alt(\"lineAlign\", vals[1], [\"start\", \"center\", \"end\"]);\n }\n break;\n case \"position\":\n vals = v.split(\",\");\n settings.percent(k, vals[0]);\n if (vals.length === 2) {\n settings.alt(\"positionAlign\", vals[1], [\"start\", \"center\", \"end\"]);\n }\n break;\n case \"size\":\n settings.percent(k, v);\n break;\n case \"align\":\n settings.alt(k, v, [\"start\", \"center\", \"end\", \"left\", \"right\"]);\n break;\n }\n }, /:/, /\\s/);\n\n // Apply default values for any missing fields.\n cue.region = settings.get(\"region\", null);\n cue.vertical = settings.get(\"vertical\", \"\");\n try {\n cue.line = settings.get(\"line\", \"auto\");\n } catch (e) {}\n cue.lineAlign = settings.get(\"lineAlign\", \"start\");\n cue.snapToLines = settings.get(\"snapToLines\", true);\n cue.size = settings.get(\"size\", 100);\n // Safari still uses the old middle value and won't accept center\n try {\n cue.align = settings.get(\"align\", \"center\");\n } catch (e) {\n cue.align = settings.get(\"align\", \"middle\");\n }\n try {\n cue.position = settings.get(\"position\", \"auto\");\n } catch (e) {\n cue.position = settings.get(\"position\", {\n start: 0,\n left: 0,\n center: 50,\n middle: 50,\n end: 100,\n right: 100\n }, cue.align);\n }\n\n\n cue.positionAlign = settings.get(\"positionAlign\", {\n start: \"start\",\n left: \"start\",\n center: \"center\",\n middle: \"center\",\n end: \"end\",\n right: \"end\"\n }, cue.align);\n }\n\n function skipWhitespace() {\n input = input.replace(/^\\s+/, \"\");\n }\n\n // 4.1 WebVTT cue timings.\n skipWhitespace();\n cue.startTime = consumeTimeStamp(); // (1) collect cue start time\n skipWhitespace();\n if (input.substr(0, 3) !== \"-->\") { // (3) next characters must match \"-->\"\n throw new ParsingError(ParsingError.Errors.BadTimeStamp,\n \"Malformed time stamp (time stamps must be separated by '-->'): \" +\n oInput);\n }\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n\n // 4.1 WebVTT cue settings list.\n skipWhitespace();\n consumeCueSettings(input, cue);\n}\n\n// When evaluating this file as part of a Webpack bundle for server\n// side rendering, `document` is an empty object.\nvar TEXTAREA_ELEMENT = document.createElement && document.createElement(\"textarea\");\n\nvar TAG_NAME = {\n c: \"span\",\n i: \"i\",\n b: \"b\",\n u: \"u\",\n ruby: \"ruby\",\n rt: \"rt\",\n v: \"span\",\n lang: \"span\"\n};\n\n// 5.1 default text color\n// 5.2 default text background color is equivalent to text color with bg_ prefix\nvar DEFAULT_COLOR_CLASS = {\n white: 'rgba(255,255,255,1)',\n lime: 'rgba(0,255,0,1)',\n cyan: 'rgba(0,255,255,1)',\n red: 'rgba(255,0,0,1)',\n yellow: 'rgba(255,255,0,1)',\n magenta: 'rgba(255,0,255,1)',\n blue: 'rgba(0,0,255,1)',\n black: 'rgba(0,0,0,1)'\n};\n\nvar TAG_ANNOTATION = {\n v: \"title\",\n lang: \"lang\"\n};\n\nvar NEEDS_PARENT = {\n rt: \"ruby\"\n};\n\n// Parse content into a document fragment.\nfunction parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n }\n\n // Consume 'n' characters from the input.\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]*>?)?/);\n // If there is some text before the next tag, return it, otherwise return\n // the tag.\n return consume(m[1] ? m[1] : m[2]);\n }\n\n function unescape(s) {\n TEXTAREA_ELEMENT.innerHTML = s;\n s = TEXTAREA_ELEMENT.textContent;\n TEXTAREA_ELEMENT.textContent = \"\";\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] ||\n NEEDS_PARENT[element.localName] === current.localName;\n }\n\n // Create an element for this tag.\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n if (!tagName) {\n return null;\n }\n var element = window.document.createElement(tagName);\n var name = TAG_ANNOTATION[type];\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length &&\n tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n }\n // Otherwise just ignore the end tag.\n continue;\n }\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/);\n // If we can't parse the tag, skip to the next tag.\n if (!m) {\n continue;\n }\n // Try to construct an element, and ignore the tag if we couldn't.\n node = createElement(m[1], m[3]);\n if (!node) {\n continue;\n }\n // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n if (!shouldAdd(current, node)) {\n continue;\n }\n // Set the class list (as a list of classes, separated by space).\n if (m[2]) {\n var classes = m[2].split('.');\n\n classes.forEach(function(cl) {\n var bgColor = /^bg_/.test(cl);\n // slice out `bg_` if it's a background color\n var colorName = bgColor ? cl.slice(3) : cl;\n\n if (DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)) {\n var propName = bgColor ? 'background-color' : 'color';\n var propValue = DEFAULT_COLOR_CLASS[colorName];\n\n node.style[propName] = propValue;\n }\n });\n\n node.className = classes.join(' ');\n }\n // Append the node to the current node, and enter the scope of the new\n // node.\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n }\n\n // Text nodes are leaf nodes.\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n}\n\n// This is a list of all the Unicode characters that have a strong\n// right-to-left category. What this means is that these characters are\n// written right-to-left for sure. It was generated by pulling all the strong\n// right-to-left characters out of the Unicode data table. That table can\n// found at: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt\nvar strongRTLRanges = [[0x5be, 0x5be], [0x5c0, 0x5c0], [0x5c3, 0x5c3], [0x5c6, 0x5c6],\n [0x5d0, 0x5ea], [0x5f0, 0x5f4], [0x608, 0x608], [0x60b, 0x60b], [0x60d, 0x60d],\n [0x61b, 0x61b], [0x61e, 0x64a], [0x66d, 0x66f], [0x671, 0x6d5], [0x6e5, 0x6e6],\n [0x6ee, 0x6ef], [0x6fa, 0x70d], [0x70f, 0x710], [0x712, 0x72f], [0x74d, 0x7a5],\n [0x7b1, 0x7b1], [0x7c0, 0x7ea], [0x7f4, 0x7f5], [0x7fa, 0x7fa], [0x800, 0x815],\n [0x81a, 0x81a], [0x824, 0x824], [0x828, 0x828], [0x830, 0x83e], [0x840, 0x858],\n [0x85e, 0x85e], [0x8a0, 0x8a0], [0x8a2, 0x8ac], [0x200f, 0x200f],\n [0xfb1d, 0xfb1d], [0xfb1f, 0xfb28], [0xfb2a, 0xfb36], [0xfb38, 0xfb3c],\n [0xfb3e, 0xfb3e], [0xfb40, 0xfb41], [0xfb43, 0xfb44], [0xfb46, 0xfbc1],\n [0xfbd3, 0xfd3d], [0xfd50, 0xfd8f], [0xfd92, 0xfdc7], [0xfdf0, 0xfdfc],\n [0xfe70, 0xfe74], [0xfe76, 0xfefc], [0x10800, 0x10805], [0x10808, 0x10808],\n [0x1080a, 0x10835], [0x10837, 0x10838], [0x1083c, 0x1083c], [0x1083f, 0x10855],\n [0x10857, 0x1085f], [0x10900, 0x1091b], [0x10920, 0x10939], [0x1093f, 0x1093f],\n [0x10980, 0x109b7], [0x109be, 0x109bf], [0x10a00, 0x10a00], [0x10a10, 0x10a13],\n [0x10a15, 0x10a17], [0x10a19, 0x10a33], [0x10a40, 0x10a47], [0x10a50, 0x10a58],\n [0x10a60, 0x10a7f], [0x10b00, 0x10b35], [0x10b40, 0x10b55], [0x10b58, 0x10b72],\n [0x10b78, 0x10b7f], [0x10c00, 0x10c48], [0x1ee00, 0x1ee03], [0x1ee05, 0x1ee1f],\n [0x1ee21, 0x1ee22], [0x1ee24, 0x1ee24], [0x1ee27, 0x1ee27], [0x1ee29, 0x1ee32],\n [0x1ee34, 0x1ee37], [0x1ee39, 0x1ee39], [0x1ee3b, 0x1ee3b], [0x1ee42, 0x1ee42],\n [0x1ee47, 0x1ee47], [0x1ee49, 0x1ee49], [0x1ee4b, 0x1ee4b], [0x1ee4d, 0x1ee4f],\n [0x1ee51, 0x1ee52], [0x1ee54, 0x1ee54], [0x1ee57, 0x1ee57], [0x1ee59, 0x1ee59],\n [0x1ee5b, 0x1ee5b], [0x1ee5d, 0x1ee5d], [0x1ee5f, 0x1ee5f], [0x1ee61, 0x1ee62],\n [0x1ee64, 0x1ee64], [0x1ee67, 0x1ee6a], [0x1ee6c, 0x1ee72], [0x1ee74, 0x1ee77],\n [0x1ee79, 0x1ee7c], [0x1ee7e, 0x1ee7e], [0x1ee80, 0x1ee89], [0x1ee8b, 0x1ee9b],\n [0x1eea1, 0x1eea3], [0x1eea5, 0x1eea9], [0x1eeab, 0x1eebb], [0x10fffd, 0x10fffd]];\n\nfunction isStrongRTLChar(charCode) {\n for (var i = 0; i < strongRTLRanges.length; i++) {\n var currentRange = strongRTLRanges[i];\n if (charCode >= currentRange[0] && charCode <= currentRange[1]) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction determineBidi(cueDiv) {\n var nodeStack = [],\n text = \"\",\n charCode;\n\n if (!cueDiv || !cueDiv.childNodes) {\n return \"ltr\";\n }\n\n function pushNodes(nodeStack, node) {\n for (var i = node.childNodes.length - 1; i >= 0; i--) {\n nodeStack.push(node.childNodes[i]);\n }\n }\n\n function nextTextNode(nodeStack) {\n if (!nodeStack || !nodeStack.length) {\n return null;\n }\n\n var node = nodeStack.pop(),\n text = node.textContent || node.innerText;\n if (text) {\n // TODO: This should match all unicode type B characters (paragraph\n // separator characters). See issue #115.\n var m = text.match(/^.*(\\n|\\r)/);\n if (m) {\n nodeStack.length = 0;\n return m[0];\n }\n return text;\n }\n if (node.tagName === \"ruby\") {\n return nextTextNode(nodeStack);\n }\n if (node.childNodes) {\n pushNodes(nodeStack, node);\n return nextTextNode(nodeStack);\n }\n }\n\n pushNodes(nodeStack, cueDiv);\n while ((text = nextTextNode(nodeStack))) {\n for (var i = 0; i < text.length; i++) {\n charCode = text.charCodeAt(i);\n if (isStrongRTLChar(charCode)) {\n return \"rtl\";\n }\n }\n }\n return \"ltr\";\n}\n\nfunction computeLinePos(cue) {\n if (typeof cue.line === \"number\" &&\n (cue.snapToLines || (cue.line >= 0 && cue.line <= 100))) {\n return cue.line;\n }\n if (!cue.track || !cue.track.textTrackList ||\n !cue.track.textTrackList.mediaElement) {\n return -1;\n }\n var track = cue.track,\n trackList = track.textTrackList,\n count = 0;\n for (var i = 0; i < trackList.length && trackList[i] !== track; i++) {\n if (trackList[i].mode === \"showing\") {\n count++;\n }\n }\n return ++count * -1;\n}\n\nfunction StyleBox() {\n}\n\n// Apply styles to a div. If there is no div passed then it defaults to the\n// div on 'this'.\nStyleBox.prototype.applyStyles = function(styles, div) {\n div = div || this.div;\n for (var prop in styles) {\n if (styles.hasOwnProperty(prop)) {\n div.style[prop] = styles[prop];\n }\n }\n};\n\nStyleBox.prototype.formatStyle = function(val, unit) {\n return val === 0 ? 0 : val + unit;\n};\n\n// Constructs the computed display state of the cue (a div). Places the div\n// into the overlay which should be a block level element (usually a div).\nfunction CueStyleBox(window, cue, styleOptions) {\n StyleBox.call(this);\n this.cue = cue;\n\n // Parse our cue's text into a DOM tree rooted at 'cueDiv'. This div will\n // have inline positioning and will function as the cue background box.\n this.cueDiv = parseContent(window, cue.text);\n var styles = {\n color: \"rgba(255, 255, 255, 1)\",\n backgroundColor: \"rgba(0, 0, 0, 0.8)\",\n position: \"relative\",\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n display: \"inline\",\n writingMode: cue.vertical === \"\" ? \"horizontal-tb\"\n : cue.vertical === \"lr\" ? \"vertical-lr\"\n : \"vertical-rl\",\n unicodeBidi: \"plaintext\"\n };\n\n this.applyStyles(styles, this.cueDiv);\n\n // Create an absolutely positioned div that will be used to position the cue\n // div. Note, all WebVTT cue-setting alignments are equivalent to the CSS\n // mirrors of them except middle instead of center on Safari.\n this.div = window.document.createElement(\"div\");\n styles = {\n direction: determineBidi(this.cueDiv),\n writingMode: cue.vertical === \"\" ? \"horizontal-tb\"\n : cue.vertical === \"lr\" ? \"vertical-lr\"\n : \"vertical-rl\",\n unicodeBidi: \"plaintext\",\n textAlign: cue.align === \"middle\" ? \"center\" : cue.align,\n font: styleOptions.font,\n whiteSpace: \"pre-line\",\n position: \"absolute\"\n };\n\n this.applyStyles(styles);\n this.div.appendChild(this.cueDiv);\n\n // Calculate the distance from the reference edge of the viewport to the text\n // position of the cue box. The reference edge will be resolved later when\n // the box orientation styles are applied.\n var textPos = 0;\n switch (cue.positionAlign) {\n case \"start\":\n textPos = cue.position;\n break;\n case \"center\":\n textPos = cue.position - (cue.size / 2);\n break;\n case \"end\":\n textPos = cue.position - cue.size;\n break;\n }\n\n // Horizontal box orientation; textPos is the distance from the left edge of the\n // area to the left edge of the box and cue.size is the distance extending to\n // the right from there.\n if (cue.vertical === \"\") {\n this.applyStyles({\n left: this.formatStyle(textPos, \"%\"),\n width: this.formatStyle(cue.size, \"%\")\n });\n // Vertical box orientation; textPos is the distance from the top edge of the\n // area to the top edge of the box and cue.size is the height extending\n // downwards from there.\n } else {\n this.applyStyles({\n top: this.formatStyle(textPos, \"%\"),\n height: this.formatStyle(cue.size, \"%\")\n });\n }\n\n this.move = function(box) {\n this.applyStyles({\n top: this.formatStyle(box.top, \"px\"),\n bottom: this.formatStyle(box.bottom, \"px\"),\n left: this.formatStyle(box.left, \"px\"),\n right: this.formatStyle(box.right, \"px\"),\n height: this.formatStyle(box.height, \"px\"),\n width: this.formatStyle(box.width, \"px\")\n });\n };\n}\nCueStyleBox.prototype = _objCreate(StyleBox.prototype);\nCueStyleBox.prototype.constructor = CueStyleBox;\n\n// Represents the co-ordinates of an Element in a way that we can easily\n// compute things with such as if it overlaps or intersects with another Element.\n// Can initialize it with either a StyleBox or another BoxPosition.\nfunction BoxPosition(obj) {\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) &&\n rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect();\n // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n lh = rects ? Math.max((rects[0] && rects[0].height) || 0, obj.height / rects.length)\n : 0;\n\n }\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || (top + (obj.height || height));\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n}\n\n// Move the box along a particular axis. Optionally pass in an amount to move\n// the box. If no amount is passed then the default is the line height of the\n// box.\nBoxPosition.prototype.move = function(axis, toMove) {\n toMove = toMove !== undefined ? toMove : this.lineHeight;\n switch (axis) {\n case \"+x\":\n this.left += toMove;\n this.right += toMove;\n break;\n case \"-x\":\n this.left -= toMove;\n this.right -= toMove;\n break;\n case \"+y\":\n this.top += toMove;\n this.bottom += toMove;\n break;\n case \"-y\":\n this.top -= toMove;\n this.bottom -= toMove;\n break;\n }\n};\n\n// Check if this box overlaps another box, b2.\nBoxPosition.prototype.overlaps = function(b2) {\n return this.left < b2.right &&\n this.right > b2.left &&\n this.top < b2.bottom &&\n this.bottom > b2.top;\n};\n\n// Check if this box overlaps any other boxes in boxes.\nBoxPosition.prototype.overlapsAny = function(boxes) {\n for (var i = 0; i < boxes.length; i++) {\n if (this.overlaps(boxes[i])) {\n return true;\n }\n }\n return false;\n};\n\n// Check if this box is within another box.\nBoxPosition.prototype.within = function(container) {\n return this.top >= container.top &&\n this.bottom <= container.bottom &&\n this.left >= container.left &&\n this.right <= container.right;\n};\n\n// Check if this box is entirely within the container or it is overlapping\n// on the edge opposite of the axis direction passed. For example, if \"+x\" is\n// passed and the box is overlapping on the left edge of the container, then\n// return true.\nBoxPosition.prototype.overlapsOppositeAxis = function(container, axis) {\n switch (axis) {\n case \"+x\":\n return this.left < container.left;\n case \"-x\":\n return this.right > container.right;\n case \"+y\":\n return this.top < container.top;\n case \"-y\":\n return this.bottom > container.bottom;\n }\n};\n\n// Find the percentage of the area that this box is overlapping with another\n// box.\nBoxPosition.prototype.intersectPercentage = function(b2) {\n var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)),\n y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)),\n intersectArea = x * y;\n return intersectArea / (this.height * this.width);\n};\n\n// Convert the positions from this box to CSS compatible positions using\n// the reference container's positions. This has to be done because this\n// box's positions are in reference to the viewport origin, whereas, CSS\n// values are in referecne to their respective edges.\nBoxPosition.prototype.toCSSCompatValues = function(reference) {\n return {\n top: this.top - reference.top,\n bottom: reference.bottom - this.bottom,\n left: this.left - reference.left,\n right: reference.right - this.right,\n height: this.height,\n width: this.width\n };\n};\n\n// Get an object that represents the box's position without anything extra.\n// Can pass a StyleBox, HTMLElement, or another BoxPositon.\nBoxPosition.getSimpleBoxPosition = function(obj) {\n var height = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0;\n var width = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0;\n var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0;\n\n obj = obj.div ? obj.div.getBoundingClientRect() :\n obj.tagName ? obj.getBoundingClientRect() : obj;\n var ret = {\n left: obj.left,\n right: obj.right,\n top: obj.top || top,\n height: obj.height || height,\n bottom: obj.bottom || (top + (obj.height || height)),\n width: obj.width || width\n };\n return ret;\n};\n\n// Move a StyleBox to its specified, or next best, position. The containerBox\n// is the box that contains the StyleBox, such as a div. boxPositions are\n// a list of other boxes that the styleBox can't overlap with.\nfunction moveBoxToLinePosition(window, styleBox, containerBox, boxPositions) {\n\n // Find the best position for a cue box, b, on the video. The axis parameter\n // is a list of axis, the order of which, it will move the box along. For example:\n // Passing [\"+x\", \"-x\"] will move the box first along the x axis in the positive\n // direction. If it doesn't find a good position for it there it will then move\n // it along the x axis in the negative direction.\n function findBestPosition(b, axis) {\n var bestPosition,\n specifiedPosition = new BoxPosition(b),\n percentage = 1; // Highest possible so the first thing we get is better.\n\n for (var i = 0; i < axis.length; i++) {\n while (b.overlapsOppositeAxis(containerBox, axis[i]) ||\n (b.within(containerBox) && b.overlapsAny(boxPositions))) {\n b.move(axis[i]);\n }\n // We found a spot where we aren't overlapping anything. This is our\n // best position.\n if (b.within(containerBox)) {\n return b;\n }\n var p = b.intersectPercentage(containerBox);\n // If we're outside the container box less then we were on our last try\n // then remember this position as the best position.\n if (percentage > p) {\n bestPosition = new BoxPosition(b);\n percentage = p;\n }\n // Reset the box position to the specified position.\n b = new BoxPosition(specifiedPosition);\n }\n return bestPosition || specifiedPosition;\n }\n\n var boxPosition = new BoxPosition(styleBox),\n cue = styleBox.cue,\n linePos = computeLinePos(cue),\n axis = [];\n\n // If we have a line number to align the cue to.\n if (cue.snapToLines) {\n var size;\n switch (cue.vertical) {\n case \"\":\n axis = [ \"+y\", \"-y\" ];\n size = \"height\";\n break;\n case \"rl\":\n axis = [ \"+x\", \"-x\" ];\n size = \"width\";\n break;\n case \"lr\":\n axis = [ \"-x\", \"+x\" ];\n size = \"width\";\n break;\n }\n\n var step = boxPosition.lineHeight,\n position = step * Math.round(linePos),\n maxPosition = containerBox[size] + step,\n initialAxis = axis[0];\n\n // If the specified intial position is greater then the max position then\n // clamp the box to the amount of steps it would take for the box to\n // reach the max position.\n if (Math.abs(position) > maxPosition) {\n position = position < 0 ? -1 : 1;\n position *= Math.ceil(maxPosition / step) * step;\n }\n\n // If computed line position returns negative then line numbers are\n // relative to the bottom of the video instead of the top. Therefore, we\n // need to increase our initial position by the length or width of the\n // video, depending on the writing direction, and reverse our axis directions.\n if (linePos < 0) {\n position += cue.vertical === \"\" ? containerBox.height : containerBox.width;\n axis = axis.reverse();\n }\n\n // Move the box to the specified position. This may not be its best\n // position.\n boxPosition.move(initialAxis, position);\n\n } else {\n // If we have a percentage line value for the cue.\n var calculatedPercentage = (boxPosition.lineHeight / containerBox.height) * 100;\n\n switch (cue.lineAlign) {\n case \"center\":\n linePos -= (calculatedPercentage / 2);\n break;\n case \"end\":\n linePos -= calculatedPercentage;\n break;\n }\n\n // Apply initial line position to the cue box.\n switch (cue.vertical) {\n case \"\":\n styleBox.applyStyles({\n top: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n case \"rl\":\n styleBox.applyStyles({\n left: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n case \"lr\":\n styleBox.applyStyles({\n right: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n }\n\n axis = [ \"+y\", \"-x\", \"+x\", \"-y\" ];\n\n // Get the box position again after we've applied the specified positioning\n // to it.\n boxPosition = new BoxPosition(styleBox);\n }\n\n var bestPosition = findBestPosition(boxPosition, axis);\n styleBox.move(bestPosition.toCSSCompatValues(containerBox));\n}\n\nfunction WebVTT() {\n // Nothing\n}\n\n// Helper to allow strings to be decoded instead of the default binary utf8 data.\nWebVTT.StringDecoder = function() {\n return {\n decode: function(data) {\n if (!data) {\n return \"\";\n }\n if (typeof data !== \"string\") {\n throw new Error(\"Error - expected string data.\");\n }\n return decodeURIComponent(encodeURIComponent(data));\n }\n };\n};\n\nWebVTT.convertCueToDOMTree = function(window, cuetext) {\n if (!window || !cuetext) {\n return null;\n }\n return parseContent(window, cuetext);\n};\n\nvar FONT_SIZE_PERCENT = 0.05;\nvar FONT_STYLE = \"sans-serif\";\nvar CUE_BACKGROUND_PADDING = \"1.5%\";\n\n// Runs the processing model over the cues and regions passed to it.\n// @param overlay A block level element (usually a div) that the computed cues\n// and regions will be placed into.\nWebVTT.processCues = function(window, cues, overlay) {\n if (!window || !cues || !overlay) {\n return null;\n }\n\n // Remove all previous children.\n while (overlay.firstChild) {\n overlay.removeChild(overlay.firstChild);\n }\n\n var paddedOverlay = window.document.createElement(\"div\");\n paddedOverlay.style.position = \"absolute\";\n paddedOverlay.style.left = \"0\";\n paddedOverlay.style.right = \"0\";\n paddedOverlay.style.top = \"0\";\n paddedOverlay.style.bottom = \"0\";\n paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;\n overlay.appendChild(paddedOverlay);\n\n // Determine if we need to compute the display states of the cues. This could\n // be the case if a cue's state has been changed since the last computation or\n // if it has not been computed yet.\n function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }\n\n // We don't need to recompute the cues' display states. Just reuse them.\n if (!shouldCompute(cues)) {\n for (var i = 0; i < cues.length; i++) {\n paddedOverlay.appendChild(cues[i].displayState);\n }\n return;\n }\n\n var boxPositions = [],\n containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay),\n fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;\n var styleOptions = {\n font: fontSize + \"px \" + FONT_STYLE\n };\n\n (function() {\n var styleBox, cue;\n\n for (var i = 0; i < cues.length; i++) {\n cue = cues[i];\n\n // Compute the intial position and styles of the cue div.\n styleBox = new CueStyleBox(window, cue, styleOptions);\n paddedOverlay.appendChild(styleBox.div);\n\n // Move the cue div to it's correct line position.\n moveBoxToLinePosition(window, styleBox, containerBox, boxPositions);\n\n // Remember the computed div so that we don't have to recompute it later\n // if we don't have too.\n cue.displayState = styleBox.div;\n\n boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));\n }\n })();\n};\n\nWebVTT.Parser = function(window, vttjs, decoder) {\n if (!decoder) {\n decoder = vttjs;\n vttjs = {};\n }\n if (!vttjs) {\n vttjs = {};\n }\n\n this.window = window;\n this.vttjs = vttjs;\n this.state = \"INITIAL\";\n this.buffer = \"\";\n this.decoder = decoder || new TextDecoder(\"utf8\");\n this.regionList = [];\n};\n\nWebVTT.Parser.prototype = {\n // If the error is a ParsingError then report it to the consumer if\n // possible. If it's not a ParsingError then throw it like normal.\n reportOrThrowError: function(e) {\n if (e instanceof ParsingError) {\n this.onparsingerror && this.onparsingerror(e);\n } else {\n throw e;\n }\n },\n parse: function (data) {\n var self = this;\n\n // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, {stream: true});\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n var line = buffer.substr(0, pos);\n // Advance the buffer early in case we fail below.\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n self.buffer = buffer.substr(pos);\n return line;\n }\n\n // 3.4 WebVTT region and WebVTT region settings syntax\n function parseRegion(input) {\n var settings = new Settings();\n\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"id\":\n settings.set(k, v);\n break;\n case \"width\":\n settings.percent(k, v);\n break;\n case \"lines\":\n settings.integer(k, v);\n break;\n case \"regionanchor\":\n case \"viewportanchor\":\n var xy = v.split(',');\n if (xy.length !== 2) {\n break;\n }\n // We have to make sure both x and y parse, so use a temporary\n // settings object here.\n var anchor = new Settings();\n anchor.percent(\"x\", xy[0]);\n anchor.percent(\"y\", xy[1]);\n if (!anchor.has(\"x\") || !anchor.has(\"y\")) {\n break;\n }\n settings.set(k + \"X\", anchor.get(\"x\"));\n settings.set(k + \"Y\", anchor.get(\"y\"));\n break;\n case \"scroll\":\n settings.alt(k, v, [\"up\"]);\n break;\n }\n }, /=/, /\\s/);\n\n // Create the region, using default values for any values that were not\n // specified.\n if (settings.has(\"id\")) {\n var region = new (self.vttjs.VTTRegion || self.window.VTTRegion)();\n region.width = settings.get(\"width\", 100);\n region.lines = settings.get(\"lines\", 3);\n region.regionAnchorX = settings.get(\"regionanchorX\", 0);\n region.regionAnchorY = settings.get(\"regionanchorY\", 100);\n region.viewportAnchorX = settings.get(\"viewportanchorX\", 0);\n region.viewportAnchorY = settings.get(\"viewportanchorY\", 100);\n region.scroll = settings.get(\"scroll\", \"\");\n // Register the region.\n self.onregion && self.onregion(region);\n // Remember the VTTRegion for later in case we parse any VTTCues that\n // reference it.\n self.regionList.push({\n id: settings.get(\"id\"),\n region: region\n });\n }\n }\n\n // draft-pantos-http-live-streaming-20\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5\n // 3.5 WebVTT\n function parseTimestampMap(input) {\n var settings = new Settings();\n\n parseOptions(input, function(k, v) {\n switch(k) {\n case \"MPEGT\":\n settings.integer(k + 'S', v);\n break;\n case \"LOCA\":\n settings.set(k + 'L', parseTimeStamp(v));\n break;\n }\n }, /[^\\d]:/, /,/);\n\n self.ontimestampmap && self.ontimestampmap({\n \"MPEGTS\": settings.get(\"MPEGTS\"),\n \"LOCAL\": settings.get(\"LOCAL\")\n });\n }\n\n // 3.2 WebVTT metadata header syntax\n function parseHeader(input) {\n if (input.match(/X-TIMESTAMP-MAP/)) {\n // This line contains HLS X-TIMESTAMP-MAP metadata\n parseOptions(input, function(k, v) {\n switch(k) {\n case \"X-TIMESTAMP-MAP\":\n parseTimestampMap(v);\n break;\n }\n }, /=/);\n } else {\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"Region\":\n // 3.3 WebVTT region metadata header syntax\n parseRegion(v);\n break;\n }\n }, /:/);\n }\n\n }\n\n // 5.1 WebVTT file parsing.\n try {\n var line;\n if (self.state === \"INITIAL\") {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n if (!m || !m[0]) {\n throw new ParsingError(ParsingError.Errors.BadSignature);\n }\n\n self.state = \"HEADER\";\n }\n\n var alreadyCollectedLine = false;\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case \"HEADER\":\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = \"ID\";\n }\n continue;\n case \"NOTE\":\n // Ignore NOTE blocks.\n if (!line) {\n self.state = \"ID\";\n }\n continue;\n case \"ID\":\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = \"NOTE\";\n break;\n }\n // 19-29 - Allow any number of line terminators, then initialize new cue values.\n if (!line) {\n continue;\n }\n self.cue = new (self.vttjs.VTTCue || self.window.VTTCue)(0, 0, \"\");\n // Safari still uses the old middle value and won't accept center\n try {\n self.cue.align = \"center\";\n } catch (e) {\n self.cue.align = \"middle\";\n }\n self.state = \"CUE\";\n // 30-39 - Check if self line contains an optional identifier or timing data.\n if (line.indexOf(\"-->\") === -1) {\n self.cue.id = line;\n continue;\n }\n // Process line as start of a cue.\n /*falls through*/\n case \"CUE\":\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n self.reportOrThrowError(e);\n // In case of an error ignore rest of the cue.\n self.cue = null;\n self.state = \"BADCUE\";\n continue;\n }\n self.state = \"CUETEXT\";\n continue;\n case \"CUETEXT\":\n var hasSubstring = line.indexOf(\"-->\") !== -1;\n // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n self.oncue && self.oncue(self.cue);\n self.cue = null;\n self.state = \"ID\";\n continue;\n }\n if (self.cue.text) {\n self.cue.text += \"\\n\";\n }\n self.cue.text += line.replace(/\\u2028/g, '\\n').replace(/u2029/g, '\\n');\n continue;\n case \"BADCUE\": // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = \"ID\";\n }\n continue;\n }\n }\n } catch (e) {\n self.reportOrThrowError(e);\n\n // If we are currently parsing a cue, report what we have.\n if (self.state === \"CUETEXT\" && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n self.cue = null;\n // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n self.state = self.state === \"INITIAL\" ? \"BADWEBVTT\" : \"BADCUE\";\n }\n return this;\n },\n flush: function () {\n var self = this;\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode();\n // Synthesize the end of the current cue or region.\n if (self.cue || self.state === \"HEADER\") {\n self.buffer += \"\\n\\n\";\n self.parse();\n }\n // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n if (self.state === \"INITIAL\") {\n throw new ParsingError(ParsingError.Errors.BadSignature);\n }\n } catch(e) {\n self.reportOrThrowError(e);\n }\n self.onflush && self.onflush();\n return this;\n }\n};\n\nmodule.exports = WebVTT;\n\n\n/***/ }),\n/* 120 */\n/***/ (function(module, exports) {\n\n/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar autoKeyword = \"auto\";\nvar directionSetting = {\n \"\": 1,\n \"lr\": 1,\n \"rl\": 1\n};\nvar alignSetting = {\n \"start\": 1,\n \"center\": 1,\n \"end\": 1,\n \"left\": 1,\n \"right\": 1,\n \"auto\": 1,\n \"line-left\": 1,\n \"line-right\": 1\n};\n\nfunction findDirectionSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n}\n\nfunction findAlignSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n}\n\nfunction VTTCue(startTime, endTime, text) {\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n this.hasBeenReset = false;\n\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = \"\";\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = \"\";\n var _snapToLines = true;\n var _line = \"auto\";\n var _lineAlign = \"start\";\n var _position = \"auto\";\n var _positionAlign = \"auto\";\n var _size = 100;\n var _align = \"center\";\n\n Object.defineProperties(this, {\n \"id\": {\n enumerable: true,\n get: function() {\n return _id;\n },\n set: function(value) {\n _id = \"\" + value;\n }\n },\n\n \"pauseOnExit\": {\n enumerable: true,\n get: function() {\n return _pauseOnExit;\n },\n set: function(value) {\n _pauseOnExit = !!value;\n }\n },\n\n \"startTime\": {\n enumerable: true,\n get: function() {\n return _startTime;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"Start time must be set to a number.\");\n }\n _startTime = value;\n this.hasBeenReset = true;\n }\n },\n\n \"endTime\": {\n enumerable: true,\n get: function() {\n return _endTime;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"End time must be set to a number.\");\n }\n _endTime = value;\n this.hasBeenReset = true;\n }\n },\n\n \"text\": {\n enumerable: true,\n get: function() {\n return _text;\n },\n set: function(value) {\n _text = \"\" + value;\n this.hasBeenReset = true;\n }\n },\n\n \"region\": {\n enumerable: true,\n get: function() {\n return _region;\n },\n set: function(value) {\n _region = value;\n this.hasBeenReset = true;\n }\n },\n\n \"vertical\": {\n enumerable: true,\n get: function() {\n return _vertical;\n },\n set: function(value) {\n var setting = findDirectionSetting(value);\n // Have to check for false because the setting an be an empty string.\n if (setting === false) {\n throw new SyntaxError(\"Vertical: an invalid or illegal direction string was specified.\");\n }\n _vertical = setting;\n this.hasBeenReset = true;\n }\n },\n\n \"snapToLines\": {\n enumerable: true,\n get: function() {\n return _snapToLines;\n },\n set: function(value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n },\n\n \"line\": {\n enumerable: true,\n get: function() {\n return _line;\n },\n set: function(value) {\n if (typeof value !== \"number\" && value !== autoKeyword) {\n throw new SyntaxError(\"Line: an invalid number or illegal string was specified.\");\n }\n _line = value;\n this.hasBeenReset = true;\n }\n },\n\n \"lineAlign\": {\n enumerable: true,\n get: function() {\n return _lineAlign;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n console.warn(\"lineAlign: an invalid or illegal string was specified.\");\n } else {\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n }\n },\n\n \"position\": {\n enumerable: true,\n get: function() {\n return _position;\n },\n set: function(value) {\n if (value < 0 || value > 100) {\n throw new Error(\"Position must be between 0 and 100.\");\n }\n _position = value;\n this.hasBeenReset = true;\n }\n },\n\n \"positionAlign\": {\n enumerable: true,\n get: function() {\n return _positionAlign;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n console.warn(\"positionAlign: an invalid or illegal string was specified.\");\n } else {\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n }\n },\n\n \"size\": {\n enumerable: true,\n get: function() {\n return _size;\n },\n set: function(value) {\n if (value < 0 || value > 100) {\n throw new Error(\"Size must be between 0 and 100.\");\n }\n _size = value;\n this.hasBeenReset = true;\n }\n },\n\n \"align\": {\n enumerable: true,\n get: function() {\n return _align;\n },\n set: function(value) {\n var setting = findAlignSetting(value);\n if (!setting) {\n throw new SyntaxError(\"align: an invalid or illegal alignment string was specified.\");\n }\n _align = setting;\n this.hasBeenReset = true;\n }\n }\n });\n\n /**\n * Other <track> spec defined properties\n */\n\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n this.displayState = undefined;\n}\n\n/**\n * VTTCue methods\n */\n\nVTTCue.prototype.getCueAsHTML = function() {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n return WebVTT.convertCueToDOMTree(window, this.text);\n};\n\nmodule.exports = VTTCue;\n\n\n/***/ }),\n/* 121 */\n/***/ (function(module, exports) {\n\n/**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar scrollSetting = {\n \"\": true,\n \"up\": true\n};\n\nfunction findScrollSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n var scroll = scrollSetting[value.toLowerCase()];\n return scroll ? value.toLowerCase() : false;\n}\n\nfunction isValidPercentValue(value) {\n return typeof value === \"number\" && (value >= 0 && value <= 100);\n}\n\n// VTTRegion shim http://dev.w3.org/html5/webvtt/#vttregion-interface\nfunction VTTRegion() {\n var _width = 100;\n var _lines = 3;\n var _regionAnchorX = 0;\n var _regionAnchorY = 100;\n var _viewportAnchorX = 0;\n var _viewportAnchorY = 100;\n var _scroll = \"\";\n\n Object.defineProperties(this, {\n \"width\": {\n enumerable: true,\n get: function() {\n return _width;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"Width must be between 0 and 100.\");\n }\n _width = value;\n }\n },\n \"lines\": {\n enumerable: true,\n get: function() {\n return _lines;\n },\n set: function(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"Lines must be set to a number.\");\n }\n _lines = value;\n }\n },\n \"regionAnchorY\": {\n enumerable: true,\n get: function() {\n return _regionAnchorY;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"RegionAnchorX must be between 0 and 100.\");\n }\n _regionAnchorY = value;\n }\n },\n \"regionAnchorX\": {\n enumerable: true,\n get: function() {\n return _regionAnchorX;\n },\n set: function(value) {\n if(!isValidPercentValue(value)) {\n throw new Error(\"RegionAnchorY must be between 0 and 100.\");\n }\n _regionAnchorX = value;\n }\n },\n \"viewportAnchorY\": {\n enumerable: true,\n get: function() {\n return _viewportAnchorY;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"ViewportAnchorY must be between 0 and 100.\");\n }\n _viewportAnchorY = value;\n }\n },\n \"viewportAnchorX\": {\n enumerable: true,\n get: function() {\n return _viewportAnchorX;\n },\n set: function(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"ViewportAnchorX must be between 0 and 100.\");\n }\n _viewportAnchorX = value;\n }\n },\n \"scroll\": {\n enumerable: true,\n get: function() {\n return _scroll;\n },\n set: function(value) {\n var setting = findScrollSetting(value);\n // Have to check for false as an empty string is a legal value.\n if (setting === false) {\n console.warn(\"Scroll: an invalid or illegal string was specified.\");\n } else {\n _scroll = setting;\n }\n }\n }\n });\n}\n\nmodule.exports = VTTRegion;\n\n\n/***/ }),\n/* 122 */\n/***/ (function(module, exports) {\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nmodule.exports = _isNativeReflectConstruct;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 123 */\n/***/ (function(module, exports) {\n\nfunction _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n\n/***/ }),\n/* 124 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(125)\nvar ieee754 = __webpack_require__(126)\nvar isArray = __webpack_require__(127)\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(14)))\n\n/***/ }),\n/* 125 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n\n\n/***/ }),\n/* 126 */\n/***/ (function(module, exports) {\n\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n/***/ }),\n/* 127 */\n/***/ (function(module, exports) {\n\nvar toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n/***/ }),\n/* 128 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar conventions = __webpack_require__(27);\nvar dom = __webpack_require__(59)\nvar entities = __webpack_require__(129);\nvar sax = __webpack_require__(130);\n\nvar DOMImplementation = dom.DOMImplementation;\n\nvar NAMESPACE = conventions.NAMESPACE;\n\nvar ParseError = sax.ParseError;\nvar XMLReader = sax.XMLReader;\n\nfunction DOMParser(options){\n\tthis.options = options ||{locator:{}};\n}\n\nDOMParser.prototype.parseFromString = function(source,mimeType){\n\tvar options = this.options;\n\tvar sax = new XMLReader();\n\tvar domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler\n\tvar errorHandler = options.errorHandler;\n\tvar locator = options.locator;\n\tvar defaultNSMap = options.xmlns||{};\n\tvar isHTML = /\\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1;\n \tvar entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;\n\tif(locator){\n\t\tdomBuilder.setDocumentLocator(locator)\n\t}\n\n\tsax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);\n\tsax.domBuilder = options.domBuilder || domBuilder;\n\tif(isHTML){\n\t\tdefaultNSMap[''] = NAMESPACE.HTML;\n\t}\n\tdefaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;\n\tif(source && typeof source === 'string'){\n\t\tsax.parse(source,defaultNSMap,entityMap);\n\t}else{\n\t\tsax.errorHandler.error(\"invalid doc source\");\n\t}\n\treturn domBuilder.doc;\n}\nfunction buildErrorHandler(errorImpl,domBuilder,locator){\n\tif(!errorImpl){\n\t\tif(domBuilder instanceof DOMHandler){\n\t\t\treturn domBuilder;\n\t\t}\n\t\terrorImpl = domBuilder ;\n\t}\n\tvar errorHandler = {}\n\tvar isCallback = errorImpl instanceof Function;\n\tlocator = locator||{}\n\tfunction build(key){\n\t\tvar fn = errorImpl[key];\n\t\tif(!fn && isCallback){\n\t\t\tfn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;\n\t\t}\n\t\terrorHandler[key] = fn && function(msg){\n\t\t\tfn('[xmldom '+key+']\\t'+msg+_locator(locator));\n\t\t}||function(){};\n\t}\n\tbuild('warning');\n\tbuild('error');\n\tbuild('fatalError');\n\treturn errorHandler;\n}\n\n//console.log('#\\n\\n\\n\\n\\n\\n\\n####')\n/**\n * +ContentHandler+ErrorHandler\n * +LexicalHandler+EntityResolver2\n * -DeclHandler-DTDHandler\n *\n * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler\n * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2\n * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html\n */\nfunction DOMHandler() {\n this.cdata = false;\n}\nfunction position(locator,node){\n\tnode.lineNumber = locator.lineNumber;\n\tnode.columnNumber = locator.columnNumber;\n}\n/**\n * @see org.xml.sax.ContentHandler#startDocument\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html\n */\nDOMHandler.prototype = {\n\tstartDocument : function() {\n \tthis.doc = new DOMImplementation().createDocument(null, null, null);\n \tif (this.locator) {\n \tthis.doc.documentURI = this.locator.systemId;\n \t}\n\t},\n\tstartElement:function(namespaceURI, localName, qName, attrs) {\n\t\tvar doc = this.doc;\n\t var el = doc.createElementNS(namespaceURI, qName||localName);\n\t var len = attrs.length;\n\t appendElement(this, el);\n\t this.currentElement = el;\n\n\t\tthis.locator && position(this.locator,el)\n\t for (var i = 0 ; i < len; i++) {\n\t var namespaceURI = attrs.getURI(i);\n\t var value = attrs.getValue(i);\n\t var qName = attrs.getQName(i);\n\t\t\tvar attr = doc.createAttributeNS(namespaceURI, qName);\n\t\t\tthis.locator &&position(attrs.getLocator(i),attr);\n\t\t\tattr.value = attr.nodeValue = value;\n\t\t\tel.setAttributeNode(attr)\n\t }\n\t},\n\tendElement:function(namespaceURI, localName, qName) {\n\t\tvar current = this.currentElement\n\t\tvar tagName = current.tagName;\n\t\tthis.currentElement = current.parentNode;\n\t},\n\tstartPrefixMapping:function(prefix, uri) {\n\t},\n\tendPrefixMapping:function(prefix) {\n\t},\n\tprocessingInstruction:function(target, data) {\n\t var ins = this.doc.createProcessingInstruction(target, data);\n\t this.locator && position(this.locator,ins)\n\t appendElement(this, ins);\n\t},\n\tignorableWhitespace:function(ch, start, length) {\n\t},\n\tcharacters:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t\t//console.log(chars)\n\t\tif(chars){\n\t\t\tif (this.cdata) {\n\t\t\t\tvar charNode = this.doc.createCDATASection(chars);\n\t\t\t} else {\n\t\t\t\tvar charNode = this.doc.createTextNode(chars);\n\t\t\t}\n\t\t\tif(this.currentElement){\n\t\t\t\tthis.currentElement.appendChild(charNode);\n\t\t\t}else if(/^\\s*$/.test(chars)){\n\t\t\t\tthis.doc.appendChild(charNode);\n\t\t\t\t//process xml\n\t\t\t}\n\t\t\tthis.locator && position(this.locator,charNode)\n\t\t}\n\t},\n\tskippedEntity:function(name) {\n\t},\n\tendDocument:function() {\n\t\tthis.doc.normalize();\n\t},\n\tsetDocumentLocator:function (locator) {\n\t if(this.locator = locator){// && !('lineNumber' in locator)){\n\t \tlocator.lineNumber = 0;\n\t }\n\t},\n\t//LexicalHandler\n\tcomment:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t var comm = this.doc.createComment(chars);\n\t this.locator && position(this.locator,comm)\n\t appendElement(this, comm);\n\t},\n\n\tstartCDATA:function() {\n\t //used in characters() methods\n\t this.cdata = true;\n\t},\n\tendCDATA:function() {\n\t this.cdata = false;\n\t},\n\n\tstartDTD:function(name, publicId, systemId) {\n\t\tvar impl = this.doc.implementation;\n\t if (impl && impl.createDocumentType) {\n\t var dt = impl.createDocumentType(name, publicId, systemId);\n\t this.locator && position(this.locator,dt)\n\t appendElement(this, dt);\n\t\t\t\t\tthis.doc.doctype = dt;\n\t }\n\t},\n\t/**\n\t * @see org.xml.sax.ErrorHandler\n\t * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html\n\t */\n\twarning:function(error) {\n\t\tconsole.warn('[xmldom warning]\\t'+error,_locator(this.locator));\n\t},\n\terror:function(error) {\n\t\tconsole.error('[xmldom error]\\t'+error,_locator(this.locator));\n\t},\n\tfatalError:function(error) {\n\t\tthrow new ParseError(error, this.locator);\n\t}\n}\nfunction _locator(l){\n\tif(l){\n\t\treturn '\\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'\n\t}\n}\nfunction _toString(chars,start,length){\n\tif(typeof chars == 'string'){\n\t\treturn chars.substr(start,length)\n\t}else{//java sax connect width xmldom on rhino(what about: \"? && !(chars instanceof String)\")\n\t\tif(chars.length >= start+length || start){\n\t\t\treturn new java.lang.String(chars,start,length)+'';\n\t\t}\n\t\treturn chars;\n\t}\n}\n\n/*\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html\n * used method of org.xml.sax.ext.LexicalHandler:\n * #comment(chars, start, length)\n * #startCDATA()\n * #endCDATA()\n * #startDTD(name, publicId, systemId)\n *\n *\n * IGNORED method of org.xml.sax.ext.LexicalHandler:\n * #endDTD()\n * #startEntity(name)\n * #endEntity(name)\n *\n *\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html\n * IGNORED method of org.xml.sax.ext.DeclHandler\n * \t#attributeDecl(eName, aName, type, mode, value)\n * #elementDecl(name, model)\n * #externalEntityDecl(name, publicId, systemId)\n * #internalEntityDecl(name, value)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html\n * IGNORED method of org.xml.sax.EntityResolver2\n * #resolveEntity(String name,String publicId,String baseURI,String systemId)\n * #resolveEntity(publicId, systemId)\n * #getExternalSubset(name, baseURI)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html\n * IGNORED method of org.xml.sax.DTDHandler\n * #notationDecl(name, publicId, systemId) {};\n * #unparsedEntityDecl(name, publicId, systemId, notationName) {};\n */\n\"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl\".replace(/\\w+/g,function(key){\n\tDOMHandler.prototype[key] = function(){return null}\n})\n\n/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */\nfunction appendElement (hander,node) {\n if (!hander.currentElement) {\n hander.doc.appendChild(node);\n } else {\n hander.currentElement.appendChild(node);\n }\n}//appendChild and setAttributeNS are preformance key\n\nexports.__DOMHandler = DOMHandler;\nexports.DOMParser = DOMParser;\n\n/**\n * @deprecated Import/require from main entry point instead\n */\nexports.DOMImplementation = dom.DOMImplementation;\n\n/**\n * @deprecated Import/require from main entry point instead\n */\nexports.XMLSerializer = dom.XMLSerializer;\n\n\n/***/ }),\n/* 129 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar freeze = __webpack_require__(27).freeze;\n\n/**\n * The entities that are predefined in every XML document.\n *\n * @see https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-predefined-ent W3C XML 1.1\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia\n */\nexports.XML_ENTITIES = freeze({amp:'&', apos:\"'\", gt:'>', lt:'<', quot:'\"'})\n\n/**\n * A map of currently 241 entities that are detected in an HTML document.\n * They contain all entries from `XML_ENTITIES`.\n *\n * @see XML_ENTITIES\n * @see DOMParser.parseFromString\n * @see DOMImplementation.prototype.createHTMLDocument\n * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec\n * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names\n * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)\n */\nexports.HTML_ENTITIES = freeze({\n lt: '<',\n gt: '>',\n amp: '&',\n quot: '\"',\n apos: \"'\",\n Agrave: \"À\",\n Aacute: \"Ã\",\n Acirc: \"Â\",\n Atilde: \"Ã\",\n Auml: \"Ä\",\n Aring: \"Ã…\",\n AElig: \"Æ\",\n Ccedil: \"Ç\",\n Egrave: \"È\",\n Eacute: \"É\",\n Ecirc: \"Ê\",\n Euml: \"Ë\",\n Igrave: \"ÃŒ\",\n Iacute: \"Ã\",\n Icirc: \"ÃŽ\",\n Iuml: \"Ã\",\n ETH: \"Ã\",\n Ntilde: \"Ñ\",\n Ograve: \"Ã’\",\n Oacute: \"Ó\",\n Ocirc: \"Ô\",\n Otilde: \"Õ\",\n Ouml: \"Ö\",\n Oslash: \"Ø\",\n Ugrave: \"Ù\",\n Uacute: \"Ú\",\n Ucirc: \"Û\",\n Uuml: \"Ãœ\",\n Yacute: \"Ã\",\n THORN: \"Þ\",\n szlig: \"ß\",\n agrave: \"à \",\n aacute: \"á\",\n acirc: \"â\",\n atilde: \"ã\",\n auml: \"ä\",\n aring: \"Ã¥\",\n aelig: \"æ\",\n ccedil: \"ç\",\n egrave: \"è\",\n eacute: \"é\",\n ecirc: \"ê\",\n euml: \"ë\",\n igrave: \"ì\",\n iacute: \"Ã\",\n icirc: \"î\",\n iuml: \"ï\",\n eth: \"ð\",\n ntilde: \"ñ\",\n ograve: \"ò\",\n oacute: \"ó\",\n ocirc: \"ô\",\n otilde: \"õ\",\n ouml: \"ö\",\n oslash: \"ø\",\n ugrave: \"ù\",\n uacute: \"ú\",\n ucirc: \"û\",\n uuml: \"ü\",\n yacute: \"ý\",\n thorn: \"þ\",\n yuml: \"ÿ\",\n nbsp: \"\\u00a0\",\n iexcl: \"¡\",\n cent: \"¢\",\n pound: \"£\",\n curren: \"¤\",\n yen: \"Â¥\",\n brvbar: \"¦\",\n sect: \"§\",\n uml: \"¨\",\n copy: \"©\",\n ordf: \"ª\",\n laquo: \"«\",\n not: \"¬\",\n shy: \"ÂÂ\",\n reg: \"®\",\n macr: \"¯\",\n deg: \"°\",\n plusmn: \"±\",\n sup2: \"²\",\n sup3: \"³\",\n acute: \"´\",\n micro: \"µ\",\n para: \"¶\",\n middot: \"·\",\n cedil: \"¸\",\n sup1: \"¹\",\n ordm: \"º\",\n raquo: \"»\",\n frac14: \"¼\",\n frac12: \"½\",\n frac34: \"¾\",\n iquest: \"¿\",\n times: \"×\",\n divide: \"÷\",\n forall: \"∀\",\n part: \"∂\",\n exist: \"∃\",\n empty: \"∅\",\n nabla: \"∇\",\n isin: \"∈\",\n notin: \"∉\",\n ni: \"∋\",\n prod: \"âˆ\",\n sum: \"∑\",\n minus: \"−\",\n lowast: \"∗\",\n radic: \"√\",\n prop: \"âˆ\",\n infin: \"∞\",\n ang: \"∠\",\n and: \"∧\",\n or: \"∨\",\n cap: \"∩\",\n cup: \"∪\",\n 'int': \"∫\",\n there4: \"∴\",\n sim: \"∼\",\n cong: \"≅\",\n asymp: \"≈\",\n ne: \"≠\",\n equiv: \"≡\",\n le: \"≤\",\n ge: \"≥\",\n sub: \"⊂\",\n sup: \"⊃\",\n nsub: \"⊄\",\n sube: \"⊆\",\n supe: \"⊇\",\n oplus: \"⊕\",\n otimes: \"⊗\",\n perp: \"⊥\",\n sdot: \"â‹…\",\n Alpha: \"Α\",\n Beta: \"Î’\",\n Gamma: \"Γ\",\n Delta: \"Δ\",\n Epsilon: \"Ε\",\n Zeta: \"Ζ\",\n Eta: \"Η\",\n Theta: \"Θ\",\n Iota: \"Ι\",\n Kappa: \"Κ\",\n Lambda: \"Λ\",\n Mu: \"Îœ\",\n Nu: \"Î\",\n Xi: \"Ξ\",\n Omicron: \"Ο\",\n Pi: \"Î \",\n Rho: \"Ρ\",\n Sigma: \"Σ\",\n Tau: \"Τ\",\n Upsilon: \"Î¥\",\n Phi: \"Φ\",\n Chi: \"Χ\",\n Psi: \"Ψ\",\n Omega: \"Ω\",\n alpha: \"α\",\n beta: \"β\",\n gamma: \"γ\",\n delta: \"δ\",\n epsilon: \"ε\",\n zeta: \"ζ\",\n eta: \"η\",\n theta: \"θ\",\n iota: \"ι\",\n kappa: \"κ\",\n lambda: \"λ\",\n mu: \"μ\",\n nu: \"ν\",\n xi: \"ξ\",\n omicron: \"ο\",\n pi: \"Ï€\",\n rho: \"Ï\",\n sigmaf: \"Ï‚\",\n sigma: \"σ\",\n tau: \"Ï„\",\n upsilon: \"Ï…\",\n phi: \"φ\",\n chi: \"χ\",\n psi: \"ψ\",\n omega: \"ω\",\n thetasym: \"Ï‘\",\n upsih: \"Ï’\",\n piv: \"Ï–\",\n OElig: \"Å’\",\n oelig: \"Å“\",\n Scaron: \"Å \",\n scaron: \"Å¡\",\n Yuml: \"Ÿ\",\n fnof: \"Æ’\",\n circ: \"ˆ\",\n tilde: \"Ëœ\",\n ensp: \" \",\n emsp: \" \",\n thinsp: \" \",\n zwnj: \"‌\",\n zwj: \"â€\",\n lrm: \"‎\",\n rlm: \"â€\",\n ndash: \"–\",\n mdash: \"—\",\n lsquo: \"‘\",\n rsquo: \"’\",\n sbquo: \"‚\",\n ldquo: \"“\",\n rdquo: \"â€\",\n bdquo: \"„\",\n dagger: \"†\",\n Dagger: \"‡\",\n bull: \"•\",\n hellip: \"…\",\n permil: \"‰\",\n prime: \"′\",\n Prime: \"″\",\n lsaquo: \"‹\",\n rsaquo: \"›\",\n oline: \"‾\",\n euro: \"€\",\n trade: \"â„¢\",\n larr: \"â†\",\n uarr: \"↑\",\n rarr: \"→\",\n darr: \"↓\",\n harr: \"↔\",\n crarr: \"↵\",\n lceil: \"⌈\",\n rceil: \"⌉\",\n lfloor: \"⌊\",\n rfloor: \"⌋\",\n loz: \"â—Š\",\n spades: \"â™ \",\n clubs: \"♣\",\n hearts: \"♥\",\n diams: \"♦\"\n});\n\n/**\n * @deprecated use `HTML_ENTITIES` instead\n * @see HTML_ENTITIES\n */\nexports.entityMap = exports.HTML_ENTITIES\n\n\n/***/ }),\n/* 130 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar NAMESPACE = __webpack_require__(27).NAMESPACE;\n\n//[4] \tNameStartChar\t ::= \t\":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n//[4a] \tNameChar\t ::= \tNameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]\n//[5] \tName\t ::= \tNameStartChar (NameChar)*\nvar nameStartChar = /[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]///\\u10000-\\uEFFFF\nvar nameChar = new RegExp(\"[\\\\-\\\\.0-9\"+nameStartChar.source.slice(1,-1)+\"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]\");\nvar tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\\:'+nameStartChar.source+nameChar.source+'*)?$');\n//var tagNamePattern = /^[a-zA-Z_][\\w\\-\\.]*(?:\\:[a-zA-Z_][\\w\\-\\.]*)?$/\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\n\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\nvar S_TAG = 0;//tag name offerring\nvar S_ATTR = 1;//attr name offerring \nvar S_ATTR_SPACE=2;//attr name end and space offer\nvar S_EQ = 3;//=space?\nvar S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)\nvar S_ATTR_END = 5;//attr value end and no space(quot end)\nvar S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)\nvar S_TAG_CLOSE = 7;//closed el<el />\n\n/**\n * Creates an error that will not be caught by XMLReader aka the SAX parser.\n *\n * @param {string} message\n * @param {any?} locator Optional, can provide details about the location in the source\n * @constructor\n */\nfunction ParseError(message, locator) {\n\tthis.message = message\n\tthis.locator = locator\n\tif(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);\n}\nParseError.prototype = new Error();\nParseError.prototype.name = ParseError.name\n\nfunction XMLReader(){\n\t\n}\n\nXMLReader.prototype = {\n\tparse:function(source,defaultNSMap,entityMap){\n\t\tvar domBuilder = this.domBuilder;\n\t\tdomBuilder.startDocument();\n\t\t_copy(defaultNSMap ,defaultNSMap = {})\n\t\tparse(source,defaultNSMap,entityMap,\n\t\t\t\tdomBuilder,this.errorHandler);\n\t\tdomBuilder.endDocument();\n\t}\n}\nfunction parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){\n\tfunction fixedFromCharCode(code) {\n\t\t// String.prototype.fromCharCode does not supports\n\t\t// > 2 bytes unicode chars directly\n\t\tif (code > 0xffff) {\n\t\t\tcode -= 0x10000;\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10)\n\t\t\t\t, surrogate2 = 0xdc00 + (code & 0x3ff);\n\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\n\t\t} else {\n\t\t\treturn String.fromCharCode(code);\n\t\t}\n\t}\n\tfunction entityReplacer(a){\n\t\tvar k = a.slice(1,-1);\n\t\tif(k in entityMap){\n\t\t\treturn entityMap[k]; \n\t\t}else if(k.charAt(0) === '#'){\n\t\t\treturn fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))\n\t\t}else{\n\t\t\terrorHandler.error('entity not found:'+a);\n\t\t\treturn a;\n\t\t}\n\t}\n\tfunction appendText(end){//has some bugs\n\t\tif(end>start){\n\t\t\tvar xt = source.substring(start,end).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\tlocator&&position(start);\n\t\t\tdomBuilder.characters(xt,0,end-start);\n\t\t\tstart = end\n\t\t}\n\t}\n\tfunction position(p,m){\n\t\twhile(p>=lineEnd && (m = linePattern.exec(source))){\n\t\t\tlineStart = m.index;\n\t\t\tlineEnd = lineStart + m[0].length;\n\t\t\tlocator.lineNumber++;\n\t\t\t//console.log('line++:',locator,startPos,endPos)\n\t\t}\n\t\tlocator.columnNumber = p-lineStart+1;\n\t}\n\tvar lineStart = 0;\n\tvar lineEnd = 0;\n\tvar linePattern = /.*(?:\\r\\n?|\\n)|.*$/g\n\tvar locator = domBuilder.locator;\n\t\n\tvar parseStack = [{currentNSMap:defaultNSMapCopy}]\n\tvar closeMap = {};\n\tvar start = 0;\n\twhile(true){\n\t\ttry{\n\t\t\tvar tagStart = source.indexOf('<',start);\n\t\t\tif(tagStart<0){\n\t\t\t\tif(!source.substr(start).match(/^\\s*$/)){\n\t\t\t\t\tvar doc = domBuilder.doc;\n\t \t\t\tvar text = doc.createTextNode(source.substr(start));\n\t \t\t\tdoc.appendChild(text);\n\t \t\t\tdomBuilder.currentElement = text;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tagStart>start){\n\t\t\t\tappendText(tagStart);\n\t\t\t}\n\t\t\tswitch(source.charAt(tagStart+1)){\n\t\t\tcase '/':\n\t\t\t\tvar end = source.indexOf('>',tagStart+3);\n\t\t\t\tvar tagName = source.substring(tagStart + 2, end).replace(/[ \\t\\n\\r]+$/g, '');\n\t\t\t\tvar config = parseStack.pop();\n\t\t\t\tif(end<0){\n\t\t\t\t\t\n\t \t\ttagName = source.substring(tagStart+2).replace(/[\\s<].*/,'');\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' is not complete:'+config.tagName);\n\t \t\tend = tagStart+1+tagName.length;\n\t \t}else if(tagName.match(/\\s</)){\n\t \t\ttagName = tagName.replace(/[\\s<].*/,'');\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' maybe not complete');\n\t \t\tend = tagStart+1+tagName.length;\n\t\t\t\t}\n\t\t\t\tvar localNSMap = config.localNSMap;\n\t\t\t\tvar endMatch = config.tagName == tagName;\n\t\t\t\tvar endIgnoreCaseMach = endMatch || config.tagName&&config.tagName.toLowerCase() == tagName.toLowerCase()\n\t\t if(endIgnoreCaseMach){\n\t\t \tdomBuilder.endElement(config.uri,config.localName,tagName);\n\t\t\t\t\tif(localNSMap){\n\t\t\t\t\t\tfor(var prefix in localNSMap){\n\t\t\t\t\t\t\tdomBuilder.endPrefixMapping(prefix) ;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!endMatch){\n\t\t \terrorHandler.fatalError(\"end tag name: \"+tagName+' is not match the current start tagName:'+config.tagName ); // No known test case\n\t\t\t\t\t}\n\t\t }else{\n\t\t \tparseStack.push(config)\n\t\t }\n\t\t\t\t\n\t\t\t\tend++;\n\t\t\t\tbreak;\n\t\t\t\t// end elment\n\t\t\tcase '?':// <?...?>\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseInstruction(source,tagStart,domBuilder);\n\t\t\t\tbreak;\n\t\t\tcase '!':// <!doctype,<![CDATA,<!--\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseDCC(source,tagStart,domBuilder,errorHandler);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tvar el = new ElementAttributes();\n\t\t\t\tvar currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\t\t\t\t//elStartEnd\n\t\t\t\tvar end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);\n\t\t\t\tvar len = el.length;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){\n\t\t\t\t\tel.closed = true;\n\t\t\t\t\tif(!entityMap.nbsp){\n\t\t\t\t\t\terrorHandler.warning('unclosed xml attribute');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(locator && len){\n\t\t\t\t\tvar locator2 = copyLocator(locator,{});\n\t\t\t\t\t//try{//attribute position fixed\n\t\t\t\t\tfor(var i = 0;i<len;i++){\n\t\t\t\t\t\tvar a = el[i];\n\t\t\t\t\t\tposition(a.offset);\n\t\t\t\t\t\ta.locator = copyLocator(locator,{});\n\t\t\t\t\t}\n\t\t\t\t\tdomBuilder.locator = locator2\n\t\t\t\t\tif(appendElement(el,domBuilder,currentNSMap)){\n\t\t\t\t\t\tparseStack.push(el)\n\t\t\t\t\t}\n\t\t\t\t\tdomBuilder.locator = locator;\n\t\t\t\t}else{\n\t\t\t\t\tif(appendElement(el,domBuilder,currentNSMap)){\n\t\t\t\t\t\tparseStack.push(el)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (NAMESPACE.isHTML(el.uri) && !el.closed) {\n\t\t\t\t\tend = parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder)\n\t\t\t\t} else {\n\t\t\t\t\tend++;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(e){\n\t\t\tif (e instanceof ParseError) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\terrorHandler.error('element parse error: '+e)\n\t\t\tend = -1;\n\t\t}\n\t\tif(end>start){\n\t\t\tstart = end;\n\t\t}else{\n\t\t\t//TODO: 这里有å¯èƒ½sax回退,有ä½ç½®é”™è¯¯é£Žé™©\n\t\t\tappendText(Math.max(tagStart,start)+1);\n\t\t}\n\t}\n}\nfunction copyLocator(f,t){\n\tt.lineNumber = f.lineNumber;\n\tt.columnNumber = f.columnNumber;\n\treturn t;\n}\n\n/**\n * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);\n * @return end of the elementStartPart(end of elementEndPart for selfClosed el)\n */\nfunction parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){\n\n\t/**\n\t * @param {string} qname\n\t * @param {string} value\n\t * @param {number} startIndex\n\t */\n\tfunction addAttribute(qname, value, startIndex) {\n\t\tif (el.attributeNames.hasOwnProperty(qname)) {\n\t\t\terrorHandler.fatalError('Attribute ' + qname + ' redefined')\n\t\t}\n\t\tel.addValue(qname, value, startIndex)\n\t}\n\tvar attrName;\n\tvar value;\n\tvar p = ++start;\n\tvar s = S_TAG;//status\n\twhile(true){\n\t\tvar c = source.charAt(p);\n\t\tswitch(c){\n\t\tcase '=':\n\t\t\tif(s === S_ATTR){//attrName\n\t\t\t\tattrName = source.slice(start,p);\n\t\t\t\ts = S_EQ;\n\t\t\t}else if(s === S_ATTR_SPACE){\n\t\t\t\ts = S_EQ;\n\t\t\t}else{\n\t\t\t\t//fatalError: equal must after attrName or space after attrName\n\t\t\t\tthrow new Error('attribute equal must after attrName'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '\\'':\n\t\tcase '\"':\n\t\t\tif(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE\n\t\t\t\t){//equal\n\t\t\t\tif(s === S_ATTR){\n\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"')\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t}\n\t\t\t\tstart = p+1;\n\t\t\t\tp = source.indexOf(c,start)\n\t\t\t\tif(p>0){\n\t\t\t\t\tvalue = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\t\taddAttribute(attrName, value, start-1);\n\t\t\t\t\ts = S_ATTR_END;\n\t\t\t\t}else{\n\t\t\t\t\t//fatalError: no end quot match\n\t\t\t\t\tthrow new Error('attribute value no end \\''+c+'\\' match');\n\t\t\t\t}\n\t\t\t}else if(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\tvalue = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\t//console.log(attrName,value,start,p)\n\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\t//console.dir(el)\n\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed start quot('+c+')!!');\n\t\t\t\tstart = p+1;\n\t\t\t\ts = S_ATTR_END\n\t\t\t}else{\n\t\t\t\t//fatalError: no equal before\n\t\t\t\tthrow new Error('attribute value must after \"=\"'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\ts =S_TAG_CLOSE;\n\t\t\t\tel.closed = true;\n\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\tcase S_ATTR:\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tbreak;\n\t\t\t//case S_EQ:\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"attribute invalid close char('/')\") // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ''://end document\n\t\t\terrorHandler.error('unexpected end of input');\n\t\t\tif(s == S_TAG){\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\t}\n\t\t\treturn p;\n\t\tcase '>':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\tbreak;//normal\n\t\t\tcase S_ATTR_NOQUOT_VALUE://Compatible state\n\t\t\tcase S_ATTR:\n\t\t\t\tvalue = source.slice(start,p);\n\t\t\t\tif(value.slice(-1) === '/'){\n\t\t\t\t\tel.closed = true;\n\t\t\t\t\tvalue = value.slice(0,-1)\n\t\t\t\t}\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tif(s === S_ATTR_SPACE){\n\t\t\t\t\tvalue = attrName;\n\t\t\t\t}\n\t\t\t\tif(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!');\n\t\t\t\t\taddAttribute(attrName, value.replace(/&#?\\w+;/g,entityReplacer), start)\n\t\t\t\t}else{\n\t\t\t\t\tif(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(value, value, start)\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase S_EQ:\n\t\t\t\tthrow new Error('attribute value missed!!');\n\t\t\t}\n//\t\t\tconsole.log(tagName,tagNamePattern,tagNamePattern.test(tagName))\n\t\t\treturn p;\n\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\n\t\tcase '\\u0080':\n\t\t\tc = ' ';\n\t\tdefault:\n\t\t\tif(c<= ' '){//space\n\t\t\t\tswitch(s){\n\t\t\t\tcase S_TAG:\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR:\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t\ts = S_ATTR_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\t\t\tvar value = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\t//case S_TAG_SPACE:\n\t\t\t\t//case S_EQ:\n\t\t\t\t//case S_ATTR_SPACE:\n\t\t\t\t//\tvoid();break;\n\t\t\t\t//case S_TAG_CLOSE:\n\t\t\t\t\t//ignore warning\n\t\t\t\t}\n\t\t\t}else{//not space\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\n\t\t\t\tswitch(s){\n\t\t\t\t//case S_TAG:void();break;\n\t\t\t\t//case S_ATTR:void();break;\n\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tvar tagName = el.tagName;\n\t\t\t\t\tif (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed value!! \"'+attrName+'\" instead2!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(attrName, attrName, start);\n\t\t\t\t\tstart = p;\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\terrorHandler.warning('attribute space is required\"'+attrName+'\"!!')\n\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_EQ:\n\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\n\t\t\t\t}\n\t\t\t}\n\t\t}//end outer switch\n\t\t//console.log('p++',p)\n\t\tp++;\n\t}\n}\n/**\n * @return true if has new namespace define\n */\nfunction appendElement(el,domBuilder,currentNSMap){\n\tvar tagName = el.tagName;\n\tvar localNSMap = null;\n\t//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\tvar i = el.length;\n\twhile(i--){\n\t\tvar a = el[i];\n\t\tvar qName = a.qName;\n\t\tvar value = a.value;\n\t\tvar nsp = qName.indexOf(':');\n\t\tif(nsp>0){\n\t\t\tvar prefix = a.prefix = qName.slice(0,nsp);\n\t\t\tvar localName = qName.slice(nsp+1);\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName\n\t\t}else{\n\t\t\tlocalName = qName;\n\t\t\tprefix = null\n\t\t\tnsPrefix = qName === 'xmlns' && ''\n\t\t}\n\t\t//can not set prefix,because prefix !== ''\n\t\ta.localName = localName ;\n\t\t//prefix == null for no ns prefix attribute \n\t\tif(nsPrefix !== false){//hack!!\n\t\t\tif(localNSMap == null){\n\t\t\t\tlocalNSMap = {}\n\t\t\t\t//console.log(currentNSMap,0)\n\t\t\t\t_copy(currentNSMap,currentNSMap={})\n\t\t\t\t//console.log(currentNSMap,1)\n\t\t\t}\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\n\t\t\ta.uri = NAMESPACE.XMLNS\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value) \n\t\t}\n\t}\n\tvar i = el.length;\n\twhile(i--){\n\t\ta = el[i];\n\t\tvar prefix = a.prefix;\n\t\tif(prefix){//no prefix attribute has no namespace\n\t\t\tif(prefix === 'xml'){\n\t\t\t\ta.uri = NAMESPACE.XML;\n\t\t\t}if(prefix !== 'xmlns'){\n\t\t\t\ta.uri = currentNSMap[prefix || '']\n\t\t\t\t\n\t\t\t\t//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}\n\t\t\t}\n\t\t}\n\t}\n\tvar nsp = tagName.indexOf(':');\n\tif(nsp>0){\n\t\tprefix = el.prefix = tagName.slice(0,nsp);\n\t\tlocalName = el.localName = tagName.slice(nsp+1);\n\t}else{\n\t\tprefix = null;//important!!\n\t\tlocalName = el.localName = tagName;\n\t}\n\t//no prefix element has default namespace\n\tvar ns = el.uri = currentNSMap[prefix || ''];\n\tdomBuilder.startElement(ns,localName,tagName,el);\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\n\t//localNSMap = null\n\tif(el.closed){\n\t\tdomBuilder.endElement(ns,localName,tagName);\n\t\tif(localNSMap){\n\t\t\tfor(prefix in localNSMap){\n\t\t\t\tdomBuilder.endPrefixMapping(prefix) \n\t\t\t}\n\t\t}\n\t}else{\n\t\tel.currentNSMap = currentNSMap;\n\t\tel.localNSMap = localNSMap;\n\t\t//parseStack.push(el);\n\t\treturn true;\n\t}\n}\nfunction parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){\n\tif(/^(?:script|textarea)$/i.test(tagName)){\n\t\tvar elEndStart = source.indexOf('</'+tagName+'>',elStartEnd);\n\t\tvar text = source.substring(elStartEnd+1,elEndStart);\n\t\tif(/[&<]/.test(text)){\n\t\t\tif(/^script$/i.test(tagName)){\n\t\t\t\t//if(!/\\]\\]>/.test(text)){\n\t\t\t\t\t//lexHandler.startCDATA();\n\t\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\t\t//lexHandler.endCDATA();\n\t\t\t\t\treturn elEndStart;\n\t\t\t\t//}\n\t\t\t}//}else{//text area\n\t\t\t\ttext = text.replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\treturn elEndStart;\n\t\t\t//}\n\t\t\t\n\t\t}\n\t}\n\treturn elStartEnd+1;\n}\nfunction fixSelfClosed(source,elStartEnd,tagName,closeMap){\n\t//if(tagName in closeMap){\n\tvar pos = closeMap[tagName];\n\tif(pos == null){\n\t\t//console.log(tagName)\n\t\tpos = source.lastIndexOf('</'+tagName+'>')\n\t\tif(pos<elStartEnd){//忘记é—åˆ\n\t\t\tpos = source.lastIndexOf('</'+tagName)\n\t\t}\n\t\tcloseMap[tagName] =pos\n\t}\n\treturn pos<elStartEnd;\n\t//} \n}\nfunction _copy(source,target){\n\tfor(var n in source){target[n] = source[n]}\n}\nfunction parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'\n\tvar next= source.charAt(start+2)\n\tswitch(next){\n\tcase '-':\n\t\tif(source.charAt(start + 3) === '-'){\n\t\t\tvar end = source.indexOf('-->',start+4);\n\t\t\t//append comment source.substring(4,end)//<!--\n\t\t\tif(end>start){\n\t\t\t\tdomBuilder.comment(source,start+4,end-start-4);\n\t\t\t\treturn end+3;\n\t\t\t}else{\n\t\t\t\terrorHandler.error(\"Unclosed comment\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}else{\n\t\t\t//error\n\t\t\treturn -1;\n\t\t}\n\tdefault:\n\t\tif(source.substr(start+3,6) == 'CDATA['){\n\t\t\tvar end = source.indexOf(']]>',start+9);\n\t\t\tdomBuilder.startCDATA();\n\t\t\tdomBuilder.characters(source,start+9,end-start-9);\n\t\t\tdomBuilder.endCDATA() \n\t\t\treturn end+3;\n\t\t}\n\t\t//<!DOCTYPE\n\t\t//startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) \n\t\tvar matchs = split(source,start);\n\t\tvar len = matchs.length;\n\t\tif(len>1 && /!doctype/i.test(matchs[0][0])){\n\t\t\tvar name = matchs[1][0];\n\t\t\tvar pubid = false;\n\t\t\tvar sysid = false;\n\t\t\tif(len>3){\n\t\t\t\tif(/^public$/i.test(matchs[2][0])){\n\t\t\t\t\tpubid = matchs[3][0];\n\t\t\t\t\tsysid = len>4 && matchs[4][0];\n\t\t\t\t}else if(/^system$/i.test(matchs[2][0])){\n\t\t\t\t\tsysid = matchs[3][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar lastMatch = matchs[len-1]\n\t\t\tdomBuilder.startDTD(name, pubid, sysid);\n\t\t\tdomBuilder.endDTD();\n\t\t\t\n\t\t\treturn lastMatch.index+lastMatch[0].length\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n\nfunction parseInstruction(source,start,domBuilder){\n\tvar end = source.indexOf('?>',start);\n\tif(end){\n\t\tvar match = source.substring(start,end).match(/^<\\?(\\S*)\\s*([\\s\\S]*?)\\s*$/);\n\t\tif(match){\n\t\t\tvar len = match[0].length;\n\t\t\tdomBuilder.processingInstruction(match[1], match[2]) ;\n\t\t\treturn end+2;\n\t\t}else{//error\n\t\t\treturn -1;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction ElementAttributes(){\n\tthis.attributeNames = {}\n}\nElementAttributes.prototype = {\n\tsetTagName:function(tagName){\n\t\tif(!tagNamePattern.test(tagName)){\n\t\t\tthrow new Error('invalid tagName:'+tagName)\n\t\t}\n\t\tthis.tagName = tagName\n\t},\n\taddValue:function(qName, value, offset) {\n\t\tif(!tagNamePattern.test(qName)){\n\t\t\tthrow new Error('invalid attribute:'+qName)\n\t\t}\n\t\tthis.attributeNames[qName] = this.length;\n\t\tthis[this.length++] = {qName:qName,value:value,offset:offset}\n\t},\n\tlength:0,\n\tgetLocalName:function(i){return this[i].localName},\n\tgetLocator:function(i){return this[i].locator},\n\tgetQName:function(i){return this[i].qName},\n\tgetURI:function(i){return this[i].uri},\n\tgetValue:function(i){return this[i].value}\n//\t,getIndex:function(uri, localName)){\n//\t\tif(localName){\n//\t\t\t\n//\t\t}else{\n//\t\t\tvar qName = uri\n//\t\t}\n//\t},\n//\tgetValue:function(){return this.getValue(this.getIndex.apply(this,arguments))},\n//\tgetType:function(uri,localName){}\n//\tgetType:function(i){},\n}\n\n\n\nfunction split(source,start){\n\tvar match;\n\tvar buf = [];\n\tvar reg = /'[^']+'|\"[^\"]+\"|[^\\s<>\\/=]+=?|(\\/?\\s*>|<)/g;\n\treg.lastIndex = start;\n\treg.exec(source);//skip <\n\twhile(match = reg.exec(source)){\n\t\tbuf.push(match);\n\t\tif(match[1])return buf;\n\t}\n}\n\nexports.XMLReader = XMLReader;\nexports.ParseError = ParseError;\n\n\n/***/ }),\n/* 131 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var video_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);\n/* harmony import */ var global_document__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);\n/* harmony import */ var global_document__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(global_document__WEBPACK_IMPORTED_MODULE_1__);\n/*! @name videojs-contrib-quality-levels @version 2.1.0 @license Apache-2.0 */\n\n\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\n/**\n * A single QualityLevel.\n *\n * interface QualityLevel {\n * readonly attribute DOMString id;\n * attribute DOMString label;\n * readonly attribute long width;\n * readonly attribute long height;\n * readonly attribute long bitrate;\n * attribute boolean enabled;\n * };\n *\n * @class QualityLevel\n */\n\nvar QualityLevel =\n/**\n * Creates a QualityLevel\n *\n * @param {Representation|Object} representation The representation of the quality level\n * @param {string} representation.id Unique id of the QualityLevel\n * @param {number=} representation.width Resolution width of the QualityLevel\n * @param {number=} representation.height Resolution height of the QualityLevel\n * @param {number} representation.bandwidth Bitrate of the QualityLevel\n * @param {Function} representation.enabled Callback to enable/disable QualityLevel\n */\nfunction QualityLevel(representation) {\n var level = this; // eslint-disable-line\n\n if (video_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].browser.IS_IE8) {\n level = global_document__WEBPACK_IMPORTED_MODULE_1___default.a.createElement('custom');\n\n for (var prop in QualityLevel.prototype) {\n if (prop !== 'constructor') {\n level[prop] = QualityLevel.prototype[prop];\n }\n }\n }\n\n level.id = representation.id;\n level.label = level.id;\n level.width = representation.width;\n level.height = representation.height;\n level.bitrate = representation.bandwidth;\n level.enabled_ = representation.enabled;\n Object.defineProperty(level, 'enabled', {\n /**\n * Get whether the QualityLevel is enabled.\n *\n * @return {boolean} True if the QualityLevel is enabled.\n */\n get: function get() {\n return level.enabled_();\n },\n\n /**\n * Enable or disable the QualityLevel.\n *\n * @param {boolean} enable true to enable QualityLevel, false to disable.\n */\n set: function set(enable) {\n level.enabled_(enable);\n }\n });\n return level;\n};\n\n/**\n * A list of QualityLevels.\n *\n * interface QualityLevelList : EventTarget {\n * getter QualityLevel (unsigned long index);\n * readonly attribute unsigned long length;\n * readonly attribute long selectedIndex;\n *\n * void addQualityLevel(QualityLevel qualityLevel)\n * void removeQualityLevel(QualityLevel remove)\n * QualityLevel? getQualityLevelById(DOMString id);\n *\n * attribute EventHandler onchange;\n * attribute EventHandler onaddqualitylevel;\n * attribute EventHandler onremovequalitylevel;\n * };\n *\n * @extends videojs.EventTarget\n * @class QualityLevelList\n */\n\nvar QualityLevelList =\n/*#__PURE__*/\nfunction (_videojs$EventTarget) {\n _inheritsLoose(QualityLevelList, _videojs$EventTarget);\n\n function QualityLevelList() {\n var _this;\n\n _this = _videojs$EventTarget.call(this) || this;\n\n var list = _assertThisInitialized(_assertThisInitialized(_this)); // eslint-disable-line\n\n\n if (video_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].browser.IS_IE8) {\n list = global_document__WEBPACK_IMPORTED_MODULE_1___default.a.createElement('custom');\n\n for (var prop in QualityLevelList.prototype) {\n if (prop !== 'constructor') {\n list[prop] = QualityLevelList.prototype[prop];\n }\n }\n }\n\n list.levels_ = [];\n list.selectedIndex_ = -1;\n /**\n * Get the index of the currently selected QualityLevel.\n *\n * @returns {number} The index of the selected QualityLevel. -1 if none selected.\n * @readonly\n */\n\n Object.defineProperty(list, 'selectedIndex', {\n get: function get() {\n return list.selectedIndex_;\n }\n });\n /**\n * Get the length of the list of QualityLevels.\n *\n * @returns {number} The length of the list.\n * @readonly\n */\n\n Object.defineProperty(list, 'length', {\n get: function get() {\n return list.levels_.length;\n }\n });\n return list || _assertThisInitialized(_this);\n }\n /**\n * Adds a quality level to the list.\n *\n * @param {Representation|Object} representation The representation of the quality level\n * @param {string} representation.id Unique id of the QualityLevel\n * @param {number=} representation.width Resolution width of the QualityLevel\n * @param {number=} representation.height Resolution height of the QualityLevel\n * @param {number} representation.bandwidth Bitrate of the QualityLevel\n * @param {Function} representation.enabled Callback to enable/disable QualityLevel\n * @return {QualityLevel} the QualityLevel added to the list\n * @method addQualityLevel\n */\n\n\n var _proto = QualityLevelList.prototype;\n\n _proto.addQualityLevel = function addQualityLevel(representation) {\n var qualityLevel = this.getQualityLevelById(representation.id); // Do not add duplicate quality levels\n\n if (qualityLevel) {\n return qualityLevel;\n }\n\n var index = this.levels_.length;\n qualityLevel = new QualityLevel(representation);\n\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get: function get() {\n return this.levels_[index];\n }\n });\n }\n\n this.levels_.push(qualityLevel);\n this.trigger({\n qualityLevel: qualityLevel,\n type: 'addqualitylevel'\n });\n return qualityLevel;\n };\n /**\n * Removes a quality level from the list.\n *\n * @param {QualityLevel} remove QualityLevel to remove to the list.\n * @return {QualityLevel|null} the QualityLevel removed or null if nothing removed\n * @method removeQualityLevel\n */\n\n\n _proto.removeQualityLevel = function removeQualityLevel(qualityLevel) {\n var removed = null;\n\n for (var i = 0, l = this.length; i < l; i++) {\n if (this[i] === qualityLevel) {\n removed = this.levels_.splice(i, 1)[0];\n\n if (this.selectedIndex_ === i) {\n this.selectedIndex_ = -1;\n } else if (this.selectedIndex_ > i) {\n this.selectedIndex_--;\n }\n\n break;\n }\n }\n\n if (removed) {\n this.trigger({\n qualityLevel: qualityLevel,\n type: 'removequalitylevel'\n });\n }\n\n return removed;\n };\n /**\n * Searches for a QualityLevel with the given id.\n *\n * @param {string} id The id of the QualityLevel to find.\n * @return {QualityLevel|null} The QualityLevel with id, or null if not found.\n * @method getQualityLevelById\n */\n\n\n _proto.getQualityLevelById = function getQualityLevelById(id) {\n for (var i = 0, l = this.length; i < l; i++) {\n var level = this[i];\n\n if (level.id === id) {\n return level;\n }\n }\n\n return null;\n };\n /**\n * Resets the list of QualityLevels to empty\n *\n * @method dispose\n */\n\n\n _proto.dispose = function dispose() {\n this.selectedIndex_ = -1;\n this.levels_.length = 0;\n };\n\n return QualityLevelList;\n}(video_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].EventTarget);\n/**\n * change - The selected QualityLevel has changed.\n * addqualitylevel - A QualityLevel has been added to the QualityLevelList.\n * removequalitylevel - A QualityLevel has been removed from the QualityLevelList.\n */\n\n\nQualityLevelList.prototype.allowedEvents_ = {\n change: 'change',\n addqualitylevel: 'addqualitylevel',\n removequalitylevel: 'removequalitylevel'\n}; // emulate attribute EventHandler support to allow for feature detection\n\nfor (var event in QualityLevelList.prototype.allowedEvents_) {\n QualityLevelList.prototype['on' + event] = null;\n}\n\nvar version = \"2.1.0\";\n\nvar registerPlugin = video_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerPlugin || video_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].plugin;\n/**\n * Initialization function for the qualityLevels plugin. Sets up the QualityLevelList and\n * event handlers.\n *\n * @param {Player} player Player object.\n * @param {Object} options Plugin options object.\n * @function initPlugin\n */\n\nvar initPlugin = function initPlugin(player, options) {\n var originalPluginFn = player.qualityLevels;\n var qualityLevelList = new QualityLevelList();\n\n var disposeHandler = function disposeHandler() {\n qualityLevelList.dispose();\n player.qualityLevels = originalPluginFn;\n player.off('dispose', disposeHandler);\n };\n\n player.on('dispose', disposeHandler);\n\n player.qualityLevels = function () {\n return qualityLevelList;\n };\n\n player.qualityLevels.VERSION = version;\n return qualityLevelList;\n};\n/**\n * A video.js plugin.\n *\n * In the plugin function, the value of `this` is a video.js `Player`\n * instance. You cannot rely on the player being in a \"ready\" state here,\n * depending on how the plugin is invoked. This may or may not be important\n * to you; if not, remove the wait for \"ready\"!\n *\n * @param {Object} options Plugin options object\n * @function qualityLevels\n */\n\n\nvar qualityLevels = function qualityLevels(options) {\n return initPlugin(this, video_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].mergeOptions({}, options));\n}; // Register the plugin with video.js.\n\n\nregisterPlugin('qualityLevels', qualityLevels); // Include the version number.\n\nqualityLevels.VERSION = version;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (qualityLevels);\n\n\n/***/ }),\n/* 132 */\n/***/ (function(module, exports) {\n\n/* (ignored) */\n\n/***/ }),\n/* 133 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n * Video.js Hotkeys\n * https://github.com/ctd1500/videojs-hotkeys\n *\n * Copyright (c) 2015 Chris Dougherty\n * Licensed under the Apache-2.0 license.\n */\n\n;(function(root, factory) {\n if (typeof window !== 'undefined' && window.videojs) {\n factory(window.videojs);\n } else if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(7)], __WEBPACK_AMD_DEFINE_RESULT__ = (function (module) {\n return factory(module.default || module);\n }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function (videojs) {\n \"use strict\";\n if (typeof window !== 'undefined') {\n window['videojs_hotkeys'] = { version: \"0.2.27\" };\n }\n\n var hotkeys = function(options) {\n var player = this;\n var pEl = player.el();\n var doc = document;\n var def_options = {\n volumeStep: 0.1,\n seekStep: 5,\n enableMute: true,\n enableVolumeScroll: true,\n enableHoverScroll: false,\n enableFullscreen: true,\n enableNumbers: true,\n enableJogStyle: false,\n alwaysCaptureHotkeys: false,\n captureDocumentHotkeys: false,\n documentHotkeysFocusElementFilter: function () { return false },\n enableModifiersForNumbers: true,\n enableInactiveFocus: true,\n skipInitialFocus: false,\n playPauseKey: playPauseKey,\n rewindKey: rewindKey,\n forwardKey: forwardKey,\n volumeUpKey: volumeUpKey,\n volumeDownKey: volumeDownKey,\n muteKey: muteKey,\n fullscreenKey: fullscreenKey,\n customKeys: {}\n };\n\n var cPlay = 1,\n cRewind = 2,\n cForward = 3,\n cVolumeUp = 4,\n cVolumeDown = 5,\n cMute = 6,\n cFullscreen = 7;\n\n // Use built-in merge function from Video.js v5.0+ or v4.4.0+\n var mergeOptions = videojs.mergeOptions || videojs.util.mergeOptions;\n options = mergeOptions(def_options, options || {});\n\n var volumeStep = options.volumeStep,\n seekStep = options.seekStep,\n enableMute = options.enableMute,\n enableVolumeScroll = options.enableVolumeScroll,\n enableHoverScroll = options.enableHoverScroll,\n enableFull = options.enableFullscreen,\n enableNumbers = options.enableNumbers,\n enableJogStyle = options.enableJogStyle,\n alwaysCaptureHotkeys = options.alwaysCaptureHotkeys,\n captureDocumentHotkeys = options.captureDocumentHotkeys,\n documentHotkeysFocusElementFilter = options.documentHotkeysFocusElementFilter,\n enableModifiersForNumbers = options.enableModifiersForNumbers,\n enableInactiveFocus = options.enableInactiveFocus,\n skipInitialFocus = options.skipInitialFocus;\n\n var videojsVer = videojs.VERSION;\n\n // Set default player tabindex to handle keydown and doubleclick events\n if (!pEl.hasAttribute('tabIndex')) {\n pEl.setAttribute('tabIndex', '-1');\n }\n\n // Remove player outline to fix video performance issue\n pEl.style.outline = \"none\";\n\n if (alwaysCaptureHotkeys || !player.autoplay()) {\n if (!skipInitialFocus) {\n player.one('play', function() {\n pEl.focus(); // Fixes the .vjs-big-play-button handing focus back to body instead of the player\n });\n }\n }\n\n if (enableInactiveFocus) {\n player.on('userinactive', function() {\n // When the control bar fades, re-apply focus to the player if last focus was a control button\n var cancelFocusingPlayer = function() {\n clearTimeout(focusingPlayerTimeout);\n };\n var focusingPlayerTimeout = setTimeout(function() {\n player.off('useractive', cancelFocusingPlayer);\n var activeElement = doc.activeElement;\n var controlBar = pEl.querySelector('.vjs-control-bar');\n if (activeElement && activeElement.parentElement == controlBar) {\n pEl.focus();\n }\n }, 10);\n\n player.one('useractive', cancelFocusingPlayer);\n });\n }\n\n player.on('play', function() {\n // Fix allowing the YouTube plugin to have hotkey support.\n var ifblocker = pEl.querySelector('.iframeblocker');\n if (ifblocker && ifblocker.style.display === '') {\n ifblocker.style.display = \"block\";\n ifblocker.style.bottom = \"39px\";\n }\n });\n\n var keyDown = function keyDown(event) {\n var ewhich = event.which, wasPlaying, seekTime;\n var ePreventDefault = event.preventDefault.bind(event);\n var duration = player.duration();\n // When controls are disabled, hotkeys will be disabled as well\n if (player.controls()) {\n\n // Don't catch keys if any control buttons are focused, unless alwaysCaptureHotkeys is true\n var activeEl = doc.activeElement;\n if (\n alwaysCaptureHotkeys ||\n (captureDocumentHotkeys && documentHotkeysFocusElementFilter(activeEl)) ||\n\n activeEl == pEl ||\n activeEl == pEl.querySelector('.vjs-tech') ||\n activeEl == pEl.querySelector('.vjs-control-bar') ||\n activeEl == pEl.querySelector('.iframeblocker')\n ) {\n\n switch (checkKeys(event, player)) {\n // Spacebar toggles play/pause\n case cPlay:\n ePreventDefault();\n if (alwaysCaptureHotkeys || captureDocumentHotkeys) {\n // Prevent control activation with space\n event.stopPropagation();\n }\n\n if (player.paused()) {\n silencePromise(player.play());\n } else {\n player.pause();\n }\n break;\n\n // Seeking with the left/right arrow keys\n case cRewind: // Seek Backward\n wasPlaying = !player.paused();\n ePreventDefault();\n if (wasPlaying) {\n player.pause();\n }\n seekTime = player.currentTime() - seekStepD(event);\n // The flash player tech will allow you to seek into negative\n // numbers and break the seekbar, so try to prevent that.\n if (seekTime <= 0) {\n seekTime = 0;\n }\n player.currentTime(seekTime);\n if (wasPlaying) {\n silencePromise(player.play());\n }\n break;\n case cForward: // Seek Forward\n wasPlaying = !player.paused();\n ePreventDefault();\n if (wasPlaying) {\n player.pause();\n }\n seekTime = player.currentTime() + seekStepD(event);\n // Fixes the player not sending the end event if you\n // try to seek past the duration on the seekbar.\n if (seekTime >= duration) {\n seekTime = wasPlaying ? duration - .001 : duration;\n }\n player.currentTime(seekTime);\n if (wasPlaying) {\n silencePromise(player.play());\n }\n break;\n\n // Volume control with the up/down arrow keys\n case cVolumeDown:\n ePreventDefault();\n if (!enableJogStyle) {\n player.volume(player.volume() - volumeStep);\n } else {\n seekTime = player.currentTime() - 1;\n if (player.currentTime() <= 1) {\n seekTime = 0;\n }\n player.currentTime(seekTime);\n }\n break;\n case cVolumeUp:\n ePreventDefault();\n if (!enableJogStyle) {\n player.volume(player.volume() + volumeStep);\n } else {\n seekTime = player.currentTime() + 1;\n if (seekTime >= duration) {\n seekTime = duration;\n }\n player.currentTime(seekTime);\n }\n break;\n\n // Toggle Mute with the M key\n case cMute:\n if (enableMute) {\n player.muted(!player.muted());\n }\n break;\n\n // Toggle Fullscreen with the F key\n case cFullscreen:\n if (enableFull) {\n if (player.isFullscreen()) {\n player.exitFullscreen();\n } else {\n player.requestFullscreen();\n }\n }\n break;\n\n default:\n // Number keys from 0-9 skip to a percentage of the video. 0 is 0% and 9 is 90%\n if ((ewhich > 47 && ewhich < 59) || (ewhich > 95 && ewhich < 106)) {\n // Do not handle if enableModifiersForNumbers set to false and keys are Ctrl, Cmd or Alt\n if (enableModifiersForNumbers || !(event.metaKey || event.ctrlKey || event.altKey)) {\n if (enableNumbers) {\n var sub = 48;\n if (ewhich > 95) {\n sub = 96;\n }\n var number = ewhich - sub;\n ePreventDefault();\n player.currentTime(player.duration() * number * 0.1);\n }\n }\n }\n\n // Handle any custom hotkeys\n for (var customKey in options.customKeys) {\n var customHotkey = options.customKeys[customKey];\n // Check for well formed custom keys\n if (customHotkey && customHotkey.key && customHotkey.handler) {\n // Check if the custom key's condition matches\n if (customHotkey.key(event)) {\n ePreventDefault();\n customHotkey.handler(player, options, event);\n }\n }\n }\n }\n }\n }\n };\n\n var doubleClick = function doubleClick(event) {\n // Video.js added double-click fullscreen in 7.1.0\n if (videojsVer != null && videojsVer <= \"7.1.0\") {\n // When controls are disabled, hotkeys will be disabled as well\n if (player.controls()) {\n\n // Don't catch clicks if any control buttons are focused\n var activeEl = event.relatedTarget || event.toElement || doc.activeElement;\n if (activeEl == pEl ||\n activeEl == pEl.querySelector('.vjs-tech') ||\n activeEl == pEl.querySelector('.iframeblocker')) {\n\n if (enableFull) {\n if (player.isFullscreen()) {\n player.exitFullscreen();\n } else {\n player.requestFullscreen();\n }\n }\n }\n }\n }\n };\n\n var volumeHover = false;\n var volumeSelector = pEl.querySelector('.vjs-volume-menu-button') || pEl.querySelector('.vjs-volume-panel');\n if (volumeSelector != null) {\n volumeSelector.onmouseover = function() { volumeHover = true; };\n volumeSelector.onmouseout = function() { volumeHover = false; };\n }\n\n var mouseScroll = function mouseScroll(event) {\n if (enableHoverScroll) {\n // If we leave this undefined then it can match non-existent elements below\n var activeEl = 0;\n } else {\n var activeEl = doc.activeElement;\n }\n\n // When controls are disabled, hotkeys will be disabled as well\n if (player.controls()) {\n if (alwaysCaptureHotkeys ||\n activeEl == pEl ||\n activeEl == pEl.querySelector('.vjs-tech') ||\n activeEl == pEl.querySelector('.iframeblocker') ||\n activeEl == pEl.querySelector('.vjs-control-bar') ||\n volumeHover) {\n\n if (enableVolumeScroll) {\n event = window.event || event;\n var delta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));\n event.preventDefault();\n\n if (delta == 1) {\n player.volume(player.volume() + volumeStep);\n } else if (delta == -1) {\n player.volume(player.volume() - volumeStep);\n }\n }\n }\n }\n };\n\n var checkKeys = function checkKeys(e, player) {\n // Allow some modularity in defining custom hotkeys\n\n // Play/Pause check\n if (options.playPauseKey(e, player)) {\n return cPlay;\n }\n\n // Seek Backward check\n if (options.rewindKey(e, player)) {\n return cRewind;\n }\n\n // Seek Forward check\n if (options.forwardKey(e, player)) {\n return cForward;\n }\n\n // Volume Up check\n if (options.volumeUpKey(e, player)) {\n return cVolumeUp;\n }\n\n // Volume Down check\n if (options.volumeDownKey(e, player)) {\n return cVolumeDown;\n }\n\n // Mute check\n if (options.muteKey(e, player)) {\n return cMute;\n }\n\n // Fullscreen check\n if (options.fullscreenKey(e, player)) {\n return cFullscreen;\n }\n };\n\n function playPauseKey(e) {\n // Space bar or MediaPlayPause\n return (e.which === 32 || e.which === 179);\n }\n\n function rewindKey(e) {\n // Left Arrow or MediaRewind\n return (e.which === 37 || e.which === 177);\n }\n\n function forwardKey(e) {\n // Right Arrow or MediaForward\n return (e.which === 39 || e.which === 176);\n }\n\n function volumeUpKey(e) {\n // Up Arrow\n return (e.which === 38);\n }\n\n function volumeDownKey(e) {\n // Down Arrow\n return (e.which === 40);\n }\n\n function muteKey(e) {\n // M key\n return (e.which === 77);\n }\n\n function fullscreenKey(e) {\n // F key\n return (e.which === 70);\n }\n\n function seekStepD(e) {\n // SeekStep caller, returns an int, or a function returning an int\n return (typeof seekStep === \"function\" ? seekStep(e) : seekStep);\n }\n\n function silencePromise(value) {\n if (value != null && typeof value.then === 'function') {\n value.then(null, function(e) {});\n }\n }\n\n player.on('keydown', keyDown);\n player.on('dblclick', doubleClick);\n player.on('mousewheel', mouseScroll);\n player.on(\"DOMMouseScroll\", mouseScroll);\n\n if (captureDocumentHotkeys) {\n document.addEventListener('keydown', function (event) { keyDown(event) });\n }\n\n return this;\n };\n\n var registerPlugin = videojs.registerPlugin || videojs.plugin;\n registerPlugin('hotkeys', hotkeys);\n}));\n\n\n/***/ }),\n/* 134 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n(function (factory) {\n /*!\n * Custom Universal Module Definition (UMD)\n *\n * Video.js will never be a non-browser lib so we can simplify UMD a bunch and\n * still support requirejs and browserify. This also needs to be closure\n * compiler compatible, so string keys are used.\n */\n // if (typeof define === 'function' && define['amd']) {\n // define(['video.js'], function(vjs){ factory(window, document, vjs) });\n // // checking that module is an object too because of umdjs/umd#35\n // } else if (typeof exports === 'object' && typeof module === 'object') {\n // factory(window, document, require('video.js'));\n // } else {\n // factory(window, document, videojs);\n // }\n factory(window, document, window.videojs);\n})(function (window, document, vjs) {\n //cookie functions from https://developer.mozilla.org/en-US/docs/DOM/document.cookie\n var getCookieItem = function getCookieItem(sKey) {\n if (!sKey || !hasCookieItem(sKey)) {\n return null;\n }\n\n var reg_ex = new RegExp('(?:^|.*;\\\\s*)' + window.escape(sKey).replace(/[\\-\\.\\+\\*]/g, '\\\\$&') + '\\\\s*\\\\=\\\\s*((?:[^;](?!;))*[^;]?).*');\n return window.unescape(document.cookie.replace(reg_ex, '$1'));\n },\n setCookieItem = function setCookieItem(sKey, sValue, vEnd, sPath, sDomain, bSecure) {\n if (!sKey || /^(?:expires|max\\-age|path|domain|secure)$/i.test(sKey)) {\n return;\n }\n\n var sExpires = '';\n\n if (vEnd) {\n switch (vEnd.constructor) {\n case Number:\n sExpires = vEnd === Infinity ? '; expires=Tue, 19 Jan 2038 03:14:07 GMT' : '; max-age=' + vEnd;\n break;\n\n case String:\n sExpires = '; expires=' + vEnd;\n break;\n\n case Date:\n sExpires = '; expires=' + vEnd.toGMTString();\n break;\n }\n }\n\n document.cookie = window.escape(sKey) + '=' + window.escape(sValue) + sExpires + (sDomain ? '; domain=' + sDomain : '') + (sPath ? '; path=' + sPath : '') + (bSecure ? '; secure' : '');\n },\n hasCookieItem = function hasCookieItem(sKey) {\n return new RegExp('(?:^|;\\\\s*)' + window.escape(sKey).replace(/[\\-\\.\\+\\*]/g, '\\\\$&') + '\\\\s*\\\\=').test(document.cookie);\n },\n hasLocalStorage = function hasLocalStorage() {\n try {\n window.localStorage.setItem('persistVolume', 'persistVolume');\n window.localStorage.removeItem('persistVolume');\n return true;\n } catch (e) {\n return false;\n }\n },\n getStorageItem = function getStorageItem(key) {\n return hasLocalStorage() ? window.localStorage.getItem(key) : getCookieItem(key);\n },\n setStorageItem = function setStorageItem(key, value) {\n return hasLocalStorage() ? window.localStorage.setItem(key, value) : setCookieItem(key, value, Infinity, '/');\n },\n extend = function extend(obj) {\n var arg, i, k;\n\n for (i = 1; i < arguments.length; i++) {\n arg = arguments[i];\n\n for (k in arg) {\n if (arg.hasOwnProperty(k)) {\n obj[k] = arg[k];\n }\n }\n }\n\n return obj;\n },\n defaults = {\n namespace: ''\n },\n volumePersister = function volumePersister(options) {\n var player = this;\n var settings = extend({}, defaults, options || {});\n var key = settings.namespace + '-' + 'volume';\n var muteKey = settings.namespace + '-' + 'mute';\n player.on('volumechange', function () {\n setStorageItem(key, player.volume());\n setStorageItem(muteKey, player.muted());\n });\n player.ready(function () {\n var persistedVolume = getStorageItem(key);\n\n if (persistedVolume !== null) {\n player.volume(persistedVolume);\n }\n\n var persistedMute = getStorageItem(muteKey);\n\n if (persistedMute !== null) {\n player.muted('true' === persistedMute);\n }\n });\n };\n\n var registerFn = 'plugin';\n\n if ('function' === typeof vjs.registerPlugin) {\n registerFn = 'registerPlugin';\n }\n\n vjs[registerFn]('persistvolume', volumePersister);\n});\n\n/***/ }),\n/* 135 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* eslint-disable global-require */\n\n\nvar preloadWebComponents = __webpack_require__(136),\n createChromecastButton = __webpack_require__(138),\n createChromecastTech = __webpack_require__(139),\n enableChromecast = __webpack_require__(141);\n\n/**\n * @module index\n */\n\n/**\n * Registers the Chromecast plugin and ChromecastButton Component with Video.js. See\n * {@link module:ChromecastButton} and {@link module:enableChromecast} for more details\n * about how the plugin and button are registered and configured.\n *\n * @param videojs {object} the videojs library. If `undefined`, this plugin\n * will look to `window.videojs`.\n * @param userOpts {object} the options to use for configuration\n * @see module:enableChromecast\n * @see module:ChromecastButton\n */\nmodule.exports = function(videojs, userOpts) {\n var options = Object.assign({ preloadWebComponents: false }, userOpts);\n\n if (options.preloadWebComponents) {\n preloadWebComponents();\n }\n\n videojs = videojs || window.videojs;\n createChromecastButton(videojs);\n createChromecastTech(videojs);\n enableChromecast(videojs);\n};\n\n\n/***/ }),\n/* 136 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction doesUserAgentContainString(str) {\n return typeof window.navigator.userAgent === 'string' && window.navigator.userAgent.indexOf(str) >= 0;\n}\n\n// For information as to why this is needed, please see:\n// https://github.com/silvermine/videojs-chromecast/issues/17\n// https://github.com/silvermine/videojs-chromecast/issues/22\n\nmodule.exports = function() {\n var needsWebComponents = !document.registerElement,\n iosChrome = doesUserAgentContainString('CriOS'),\n androidChrome;\n\n androidChrome = doesUserAgentContainString('Android')\n && doesUserAgentContainString('Chrome/')\n && window.navigator.presentation;\n\n // These checks are based on the checks found in `cast_sender.js` which\n // determine if `cast_framework.js` needs to be loaded\n if ((androidChrome || iosChrome) && needsWebComponents) {\n // This is requiring webcomponents.js@0.7.24 because that's what was used\n // by the Chromecast framework at the time this was added.\n // We are using webcomponents-lite.js because it doesn't interfere with jQuery as\n // badly (e.g. it doesn't interfere with jQuery's fix for consistently bubbling\n // events, see #21). While the \"lite\" version does not include the shadow DOM\n // polyfills that the Chromecast framework may need for the <google-cast-button>\n // component to work properly, this plugin does not use the <google-cast-button>\n // component.\n __webpack_require__(137); // eslint-disable-line global-require\n }\n};\n\n\n/***/ }),\n/* 137 */\n/***/ (function(module, exports) {\n\n/**\n * @license\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n// @version 0.7.24\n(function() {\n window.WebComponents = window.WebComponents || {\n flags: {}\n };\n var file = \"webcomponents-lite.js\";\n var script = document.querySelector('script[src*=\"' + file + '\"]');\n var flags = {};\n if (!flags.noOpts) {\n location.search.slice(1).split(\"&\").forEach(function(option) {\n var parts = option.split(\"=\");\n var match;\n if (parts[0] && (match = parts[0].match(/wc-(.+)/))) {\n flags[match[1]] = parts[1] || true;\n }\n });\n if (script) {\n for (var i = 0, a; a = script.attributes[i]; i++) {\n if (a.name !== \"src\") {\n flags[a.name] = a.value || true;\n }\n }\n }\n if (flags.log && flags.log.split) {\n var parts = flags.log.split(\",\");\n flags.log = {};\n parts.forEach(function(f) {\n flags.log[f] = true;\n });\n } else {\n flags.log = {};\n }\n }\n if (flags.register) {\n window.CustomElements = window.CustomElements || {\n flags: {}\n };\n window.CustomElements.flags.register = flags.register;\n }\n WebComponents.flags = flags;\n})();\n\n(function(scope) {\n \"use strict\";\n var hasWorkingUrl = false;\n if (!scope.forceJURL) {\n try {\n var u = new URL(\"b\", \"http://a\");\n u.pathname = \"c%20d\";\n hasWorkingUrl = u.href === \"http://a/c%20d\";\n } catch (e) {}\n }\n if (hasWorkingUrl) return;\n var relative = Object.create(null);\n relative[\"ftp\"] = 21;\n relative[\"file\"] = 0;\n relative[\"gopher\"] = 70;\n relative[\"http\"] = 80;\n relative[\"https\"] = 443;\n relative[\"ws\"] = 80;\n relative[\"wss\"] = 443;\n var relativePathDotMapping = Object.create(null);\n relativePathDotMapping[\"%2e\"] = \".\";\n relativePathDotMapping[\".%2e\"] = \"..\";\n relativePathDotMapping[\"%2e.\"] = \"..\";\n relativePathDotMapping[\"%2e%2e\"] = \"..\";\n function isRelativeScheme(scheme) {\n return relative[scheme] !== undefined;\n }\n function invalid() {\n clear.call(this);\n this._isInvalid = true;\n }\n function IDNAToASCII(h) {\n if (\"\" == h) {\n invalid.call(this);\n }\n return h.toLowerCase();\n }\n function percentEscape(c) {\n var unicode = c.charCodeAt(0);\n if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 63, 96 ].indexOf(unicode) == -1) {\n return c;\n }\n return encodeURIComponent(c);\n }\n function percentEscapeQuery(c) {\n var unicode = c.charCodeAt(0);\n if (unicode > 32 && unicode < 127 && [ 34, 35, 60, 62, 96 ].indexOf(unicode) == -1) {\n return c;\n }\n return encodeURIComponent(c);\n }\n var EOF = undefined, ALPHA = /[a-zA-Z]/, ALPHANUMERIC = /[a-zA-Z0-9\\+\\-\\.]/;\n function parse(input, stateOverride, base) {\n function err(message) {\n errors.push(message);\n }\n var state = stateOverride || \"scheme start\", cursor = 0, buffer = \"\", seenAt = false, seenBracket = false, errors = [];\n loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) {\n var c = input[cursor];\n switch (state) {\n case \"scheme start\":\n if (c && ALPHA.test(c)) {\n buffer += c.toLowerCase();\n state = \"scheme\";\n } else if (!stateOverride) {\n buffer = \"\";\n state = \"no scheme\";\n continue;\n } else {\n err(\"Invalid scheme.\");\n break loop;\n }\n break;\n\n case \"scheme\":\n if (c && ALPHANUMERIC.test(c)) {\n buffer += c.toLowerCase();\n } else if (\":\" == c) {\n this._scheme = buffer;\n buffer = \"\";\n if (stateOverride) {\n break loop;\n }\n if (isRelativeScheme(this._scheme)) {\n this._isRelative = true;\n }\n if (\"file\" == this._scheme) {\n state = \"relative\";\n } else if (this._isRelative && base && base._scheme == this._scheme) {\n state = \"relative or authority\";\n } else if (this._isRelative) {\n state = \"authority first slash\";\n } else {\n state = \"scheme data\";\n }\n } else if (!stateOverride) {\n buffer = \"\";\n cursor = 0;\n state = \"no scheme\";\n continue;\n } else if (EOF == c) {\n break loop;\n } else {\n err(\"Code point not allowed in scheme: \" + c);\n break loop;\n }\n break;\n\n case \"scheme data\":\n if (\"?\" == c) {\n this._query = \"?\";\n state = \"query\";\n } else if (\"#\" == c) {\n this._fragment = \"#\";\n state = \"fragment\";\n } else {\n if (EOF != c && \"\\t\" != c && \"\\n\" != c && \"\\r\" != c) {\n this._schemeData += percentEscape(c);\n }\n }\n break;\n\n case \"no scheme\":\n if (!base || !isRelativeScheme(base._scheme)) {\n err(\"Missing scheme.\");\n invalid.call(this);\n } else {\n state = \"relative\";\n continue;\n }\n break;\n\n case \"relative or authority\":\n if (\"/\" == c && \"/\" == input[cursor + 1]) {\n state = \"authority ignore slashes\";\n } else {\n err(\"Expected /, got: \" + c);\n state = \"relative\";\n continue;\n }\n break;\n\n case \"relative\":\n this._isRelative = true;\n if (\"file\" != this._scheme) this._scheme = base._scheme;\n if (EOF == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = base._query;\n this._username = base._username;\n this._password = base._password;\n break loop;\n } else if (\"/\" == c || \"\\\\\" == c) {\n if (\"\\\\\" == c) err(\"\\\\ is an invalid code point.\");\n state = \"relative slash\";\n } else if (\"?\" == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = \"?\";\n this._username = base._username;\n this._password = base._password;\n state = \"query\";\n } else if (\"#\" == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = base._query;\n this._fragment = \"#\";\n this._username = base._username;\n this._password = base._password;\n state = \"fragment\";\n } else {\n var nextC = input[cursor + 1];\n var nextNextC = input[cursor + 2];\n if (\"file\" != this._scheme || !ALPHA.test(c) || nextC != \":\" && nextC != \"|\" || EOF != nextNextC && \"/\" != nextNextC && \"\\\\\" != nextNextC && \"?\" != nextNextC && \"#\" != nextNextC) {\n this._host = base._host;\n this._port = base._port;\n this._username = base._username;\n this._password = base._password;\n this._path = base._path.slice();\n this._path.pop();\n }\n state = \"relative path\";\n continue;\n }\n break;\n\n case \"relative slash\":\n if (\"/\" == c || \"\\\\\" == c) {\n if (\"\\\\\" == c) {\n err(\"\\\\ is an invalid code point.\");\n }\n if (\"file\" == this._scheme) {\n state = \"file host\";\n } else {\n state = \"authority ignore slashes\";\n }\n } else {\n if (\"file\" != this._scheme) {\n this._host = base._host;\n this._port = base._port;\n this._username = base._username;\n this._password = base._password;\n }\n state = \"relative path\";\n continue;\n }\n break;\n\n case \"authority first slash\":\n if (\"/\" == c) {\n state = \"authority second slash\";\n } else {\n err(\"Expected '/', got: \" + c);\n state = \"authority ignore slashes\";\n continue;\n }\n break;\n\n case \"authority second slash\":\n state = \"authority ignore slashes\";\n if (\"/\" != c) {\n err(\"Expected '/', got: \" + c);\n continue;\n }\n break;\n\n case \"authority ignore slashes\":\n if (\"/\" != c && \"\\\\\" != c) {\n state = \"authority\";\n continue;\n } else {\n err(\"Expected authority, got: \" + c);\n }\n break;\n\n case \"authority\":\n if (\"@\" == c) {\n if (seenAt) {\n err(\"@ already seen.\");\n buffer += \"%40\";\n }\n seenAt = true;\n for (var i = 0; i < buffer.length; i++) {\n var cp = buffer[i];\n if (\"\\t\" == cp || \"\\n\" == cp || \"\\r\" == cp) {\n err(\"Invalid whitespace in authority.\");\n continue;\n }\n if (\":\" == cp && null === this._password) {\n this._password = \"\";\n continue;\n }\n var tempC = percentEscape(cp);\n null !== this._password ? this._password += tempC : this._username += tempC;\n }\n buffer = \"\";\n } else if (EOF == c || \"/\" == c || \"\\\\\" == c || \"?\" == c || \"#\" == c) {\n cursor -= buffer.length;\n buffer = \"\";\n state = \"host\";\n continue;\n } else {\n buffer += c;\n }\n break;\n\n case \"file host\":\n if (EOF == c || \"/\" == c || \"\\\\\" == c || \"?\" == c || \"#\" == c) {\n if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == \":\" || buffer[1] == \"|\")) {\n state = \"relative path\";\n } else if (buffer.length == 0) {\n state = \"relative path start\";\n } else {\n this._host = IDNAToASCII.call(this, buffer);\n buffer = \"\";\n state = \"relative path start\";\n }\n continue;\n } else if (\"\\t\" == c || \"\\n\" == c || \"\\r\" == c) {\n err(\"Invalid whitespace in file host.\");\n } else {\n buffer += c;\n }\n break;\n\n case \"host\":\n case \"hostname\":\n if (\":\" == c && !seenBracket) {\n this._host = IDNAToASCII.call(this, buffer);\n buffer = \"\";\n state = \"port\";\n if (\"hostname\" == stateOverride) {\n break loop;\n }\n } else if (EOF == c || \"/\" == c || \"\\\\\" == c || \"?\" == c || \"#\" == c) {\n this._host = IDNAToASCII.call(this, buffer);\n buffer = \"\";\n state = \"relative path start\";\n if (stateOverride) {\n break loop;\n }\n continue;\n } else if (\"\\t\" != c && \"\\n\" != c && \"\\r\" != c) {\n if (\"[\" == c) {\n seenBracket = true;\n } else if (\"]\" == c) {\n seenBracket = false;\n }\n buffer += c;\n } else {\n err(\"Invalid code point in host/hostname: \" + c);\n }\n break;\n\n case \"port\":\n if (/[0-9]/.test(c)) {\n buffer += c;\n } else if (EOF == c || \"/\" == c || \"\\\\\" == c || \"?\" == c || \"#\" == c || stateOverride) {\n if (\"\" != buffer) {\n var temp = parseInt(buffer, 10);\n if (temp != relative[this._scheme]) {\n this._port = temp + \"\";\n }\n buffer = \"\";\n }\n if (stateOverride) {\n break loop;\n }\n state = \"relative path start\";\n continue;\n } else if (\"\\t\" == c || \"\\n\" == c || \"\\r\" == c) {\n err(\"Invalid code point in port: \" + c);\n } else {\n invalid.call(this);\n }\n break;\n\n case \"relative path start\":\n if (\"\\\\\" == c) err(\"'\\\\' not allowed in path.\");\n state = \"relative path\";\n if (\"/\" != c && \"\\\\\" != c) {\n continue;\n }\n break;\n\n case \"relative path\":\n if (EOF == c || \"/\" == c || \"\\\\\" == c || !stateOverride && (\"?\" == c || \"#\" == c)) {\n if (\"\\\\\" == c) {\n err(\"\\\\ not allowed in relative path.\");\n }\n var tmp;\n if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {\n buffer = tmp;\n }\n if (\"..\" == buffer) {\n this._path.pop();\n if (\"/\" != c && \"\\\\\" != c) {\n this._path.push(\"\");\n }\n } else if (\".\" == buffer && \"/\" != c && \"\\\\\" != c) {\n this._path.push(\"\");\n } else if (\".\" != buffer) {\n if (\"file\" == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == \"|\") {\n buffer = buffer[0] + \":\";\n }\n this._path.push(buffer);\n }\n buffer = \"\";\n if (\"?\" == c) {\n this._query = \"?\";\n state = \"query\";\n } else if (\"#\" == c) {\n this._fragment = \"#\";\n state = \"fragment\";\n }\n } else if (\"\\t\" != c && \"\\n\" != c && \"\\r\" != c) {\n buffer += percentEscape(c);\n }\n break;\n\n case \"query\":\n if (!stateOverride && \"#\" == c) {\n this._fragment = \"#\";\n state = \"fragment\";\n } else if (EOF != c && \"\\t\" != c && \"\\n\" != c && \"\\r\" != c) {\n this._query += percentEscapeQuery(c);\n }\n break;\n\n case \"fragment\":\n if (EOF != c && \"\\t\" != c && \"\\n\" != c && \"\\r\" != c) {\n this._fragment += c;\n }\n break;\n }\n cursor++;\n }\n }\n function clear() {\n this._scheme = \"\";\n this._schemeData = \"\";\n this._username = \"\";\n this._password = null;\n this._host = \"\";\n this._port = \"\";\n this._path = [];\n this._query = \"\";\n this._fragment = \"\";\n this._isInvalid = false;\n this._isRelative = false;\n }\n function jURL(url, base) {\n if (base !== undefined && !(base instanceof jURL)) base = new jURL(String(base));\n this._url = url;\n clear.call(this);\n var input = url.replace(/^[ \\t\\r\\n\\f]+|[ \\t\\r\\n\\f]+$/g, \"\");\n parse.call(this, input, null, base);\n }\n jURL.prototype = {\n toString: function() {\n return this.href;\n },\n get href() {\n if (this._isInvalid) return this._url;\n var authority = \"\";\n if (\"\" != this._username || null != this._password) {\n authority = this._username + (null != this._password ? \":\" + this._password : \"\") + \"@\";\n }\n return this.protocol + (this._isRelative ? \"//\" + authority + this.host : \"\") + this.pathname + this._query + this._fragment;\n },\n set href(href) {\n clear.call(this);\n parse.call(this, href);\n },\n get protocol() {\n return this._scheme + \":\";\n },\n set protocol(protocol) {\n if (this._isInvalid) return;\n parse.call(this, protocol + \":\", \"scheme start\");\n },\n get host() {\n return this._isInvalid ? \"\" : this._port ? this._host + \":\" + this._port : this._host;\n },\n set host(host) {\n if (this._isInvalid || !this._isRelative) return;\n parse.call(this, host, \"host\");\n },\n get hostname() {\n return this._host;\n },\n set hostname(hostname) {\n if (this._isInvalid || !this._isRelative) return;\n parse.call(this, hostname, \"hostname\");\n },\n get port() {\n return this._port;\n },\n set port(port) {\n if (this._isInvalid || !this._isRelative) return;\n parse.call(this, port, \"port\");\n },\n get pathname() {\n return this._isInvalid ? \"\" : this._isRelative ? \"/\" + this._path.join(\"/\") : this._schemeData;\n },\n set pathname(pathname) {\n if (this._isInvalid || !this._isRelative) return;\n this._path = [];\n parse.call(this, pathname, \"relative path start\");\n },\n get search() {\n return this._isInvalid || !this._query || \"?\" == this._query ? \"\" : this._query;\n },\n set search(search) {\n if (this._isInvalid || !this._isRelative) return;\n this._query = \"?\";\n if (\"?\" == search[0]) search = search.slice(1);\n parse.call(this, search, \"query\");\n },\n get hash() {\n return this._isInvalid || !this._fragment || \"#\" == this._fragment ? \"\" : this._fragment;\n },\n set hash(hash) {\n if (this._isInvalid) return;\n this._fragment = \"#\";\n if (\"#\" == hash[0]) hash = hash.slice(1);\n parse.call(this, hash, \"fragment\");\n },\n get origin() {\n var host;\n if (this._isInvalid || !this._scheme) {\n return \"\";\n }\n switch (this._scheme) {\n case \"data\":\n case \"file\":\n case \"javascript\":\n case \"mailto\":\n return \"null\";\n }\n host = this.host;\n if (!host) {\n return \"\";\n }\n return this._scheme + \"://\" + host;\n }\n };\n var OriginalURL = scope.URL;\n if (OriginalURL) {\n jURL.createObjectURL = function(blob) {\n return OriginalURL.createObjectURL.apply(OriginalURL, arguments);\n };\n jURL.revokeObjectURL = function(url) {\n OriginalURL.revokeObjectURL(url);\n };\n }\n scope.URL = jURL;\n})(self);\n\nif (typeof WeakMap === \"undefined\") {\n (function() {\n var defineProperty = Object.defineProperty;\n var counter = Date.now() % 1e9;\n var WeakMap = function() {\n this.name = \"__st\" + (Math.random() * 1e9 >>> 0) + (counter++ + \"__\");\n };\n WeakMap.prototype = {\n set: function(key, value) {\n var entry = key[this.name];\n if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {\n value: [ key, value ],\n writable: true\n });\n return this;\n },\n get: function(key) {\n var entry;\n return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;\n },\n \"delete\": function(key) {\n var entry = key[this.name];\n if (!entry || entry[0] !== key) return false;\n entry[0] = entry[1] = undefined;\n return true;\n },\n has: function(key) {\n var entry = key[this.name];\n if (!entry) return false;\n return entry[0] === key;\n }\n };\n window.WeakMap = WeakMap;\n })();\n}\n\n(function(global) {\n if (global.JsMutationObserver) {\n return;\n }\n var registrationsTable = new WeakMap();\n var setImmediate;\n if (/Trident|Edge/.test(navigator.userAgent)) {\n setImmediate = setTimeout;\n } else if (window.setImmediate) {\n setImmediate = window.setImmediate;\n } else {\n var setImmediateQueue = [];\n var sentinel = String(Math.random());\n window.addEventListener(\"message\", function(e) {\n if (e.data === sentinel) {\n var queue = setImmediateQueue;\n setImmediateQueue = [];\n queue.forEach(function(func) {\n func();\n });\n }\n });\n setImmediate = function(func) {\n setImmediateQueue.push(func);\n window.postMessage(sentinel, \"*\");\n };\n }\n var isScheduled = false;\n var scheduledObservers = [];\n function scheduleCallback(observer) {\n scheduledObservers.push(observer);\n if (!isScheduled) {\n isScheduled = true;\n setImmediate(dispatchCallbacks);\n }\n }\n function wrapIfNeeded(node) {\n return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;\n }\n function dispatchCallbacks() {\n isScheduled = false;\n var observers = scheduledObservers;\n scheduledObservers = [];\n observers.sort(function(o1, o2) {\n return o1.uid_ - o2.uid_;\n });\n var anyNonEmpty = false;\n observers.forEach(function(observer) {\n var queue = observer.takeRecords();\n removeTransientObserversFor(observer);\n if (queue.length) {\n observer.callback_(queue, observer);\n anyNonEmpty = true;\n }\n });\n if (anyNonEmpty) dispatchCallbacks();\n }\n function removeTransientObserversFor(observer) {\n observer.nodes_.forEach(function(node) {\n var registrations = registrationsTable.get(node);\n if (!registrations) return;\n registrations.forEach(function(registration) {\n if (registration.observer === observer) registration.removeTransientObservers();\n });\n });\n }\n function forEachAncestorAndObserverEnqueueRecord(target, callback) {\n for (var node = target; node; node = node.parentNode) {\n var registrations = registrationsTable.get(node);\n if (registrations) {\n for (var j = 0; j < registrations.length; j++) {\n var registration = registrations[j];\n var options = registration.options;\n if (node !== target && !options.subtree) continue;\n var record = callback(options);\n if (record) registration.enqueue(record);\n }\n }\n }\n }\n var uidCounter = 0;\n function JsMutationObserver(callback) {\n this.callback_ = callback;\n this.nodes_ = [];\n this.records_ = [];\n this.uid_ = ++uidCounter;\n }\n JsMutationObserver.prototype = {\n observe: function(target, options) {\n target = wrapIfNeeded(target);\n if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {\n throw new SyntaxError();\n }\n var registrations = registrationsTable.get(target);\n if (!registrations) registrationsTable.set(target, registrations = []);\n var registration;\n for (var i = 0; i < registrations.length; i++) {\n if (registrations[i].observer === this) {\n registration = registrations[i];\n registration.removeListeners();\n registration.options = options;\n break;\n }\n }\n if (!registration) {\n registration = new Registration(this, target, options);\n registrations.push(registration);\n this.nodes_.push(target);\n }\n registration.addListeners();\n },\n disconnect: function() {\n this.nodes_.forEach(function(node) {\n var registrations = registrationsTable.get(node);\n for (var i = 0; i < registrations.length; i++) {\n var registration = registrations[i];\n if (registration.observer === this) {\n registration.removeListeners();\n registrations.splice(i, 1);\n break;\n }\n }\n }, this);\n this.records_ = [];\n },\n takeRecords: function() {\n var copyOfRecords = this.records_;\n this.records_ = [];\n return copyOfRecords;\n }\n };\n function MutationRecord(type, target) {\n this.type = type;\n this.target = target;\n this.addedNodes = [];\n this.removedNodes = [];\n this.previousSibling = null;\n this.nextSibling = null;\n this.attributeName = null;\n this.attributeNamespace = null;\n this.oldValue = null;\n }\n function copyMutationRecord(original) {\n var record = new MutationRecord(original.type, original.target);\n record.addedNodes = original.addedNodes.slice();\n record.removedNodes = original.removedNodes.slice();\n record.previousSibling = original.previousSibling;\n record.nextSibling = original.nextSibling;\n record.attributeName = original.attributeName;\n record.attributeNamespace = original.attributeNamespace;\n record.oldValue = original.oldValue;\n return record;\n }\n var currentRecord, recordWithOldValue;\n function getRecord(type, target) {\n return currentRecord = new MutationRecord(type, target);\n }\n function getRecordWithOldValue(oldValue) {\n if (recordWithOldValue) return recordWithOldValue;\n recordWithOldValue = copyMutationRecord(currentRecord);\n recordWithOldValue.oldValue = oldValue;\n return recordWithOldValue;\n }\n function clearRecords() {\n currentRecord = recordWithOldValue = undefined;\n }\n function recordRepresentsCurrentMutation(record) {\n return record === recordWithOldValue || record === currentRecord;\n }\n function selectRecord(lastRecord, newRecord) {\n if (lastRecord === newRecord) return lastRecord;\n if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;\n return null;\n }\n function Registration(observer, target, options) {\n this.observer = observer;\n this.target = target;\n this.options = options;\n this.transientObservedNodes = [];\n }\n Registration.prototype = {\n enqueue: function(record) {\n var records = this.observer.records_;\n var length = records.length;\n if (records.length > 0) {\n var lastRecord = records[length - 1];\n var recordToReplaceLast = selectRecord(lastRecord, record);\n if (recordToReplaceLast) {\n records[length - 1] = recordToReplaceLast;\n return;\n }\n } else {\n scheduleCallback(this.observer);\n }\n records[length] = record;\n },\n addListeners: function() {\n this.addListeners_(this.target);\n },\n addListeners_: function(node) {\n var options = this.options;\n if (options.attributes) node.addEventListener(\"DOMAttrModified\", this, true);\n if (options.characterData) node.addEventListener(\"DOMCharacterDataModified\", this, true);\n if (options.childList) node.addEventListener(\"DOMNodeInserted\", this, true);\n if (options.childList || options.subtree) node.addEventListener(\"DOMNodeRemoved\", this, true);\n },\n removeListeners: function() {\n this.removeListeners_(this.target);\n },\n removeListeners_: function(node) {\n var options = this.options;\n if (options.attributes) node.removeEventListener(\"DOMAttrModified\", this, true);\n if (options.characterData) node.removeEventListener(\"DOMCharacterDataModified\", this, true);\n if (options.childList) node.removeEventListener(\"DOMNodeInserted\", this, true);\n if (options.childList || options.subtree) node.removeEventListener(\"DOMNodeRemoved\", this, true);\n },\n addTransientObserver: function(node) {\n if (node === this.target) return;\n this.addListeners_(node);\n this.transientObservedNodes.push(node);\n var registrations = registrationsTable.get(node);\n if (!registrations) registrationsTable.set(node, registrations = []);\n registrations.push(this);\n },\n removeTransientObservers: function() {\n var transientObservedNodes = this.transientObservedNodes;\n this.transientObservedNodes = [];\n transientObservedNodes.forEach(function(node) {\n this.removeListeners_(node);\n var registrations = registrationsTable.get(node);\n for (var i = 0; i < registrations.length; i++) {\n if (registrations[i] === this) {\n registrations.splice(i, 1);\n break;\n }\n }\n }, this);\n },\n handleEvent: function(e) {\n e.stopImmediatePropagation();\n switch (e.type) {\n case \"DOMAttrModified\":\n var name = e.attrName;\n var namespace = e.relatedNode.namespaceURI;\n var target = e.target;\n var record = new getRecord(\"attributes\", target);\n record.attributeName = name;\n record.attributeNamespace = namespace;\n var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;\n forEachAncestorAndObserverEnqueueRecord(target, function(options) {\n if (!options.attributes) return;\n if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {\n return;\n }\n if (options.attributeOldValue) return getRecordWithOldValue(oldValue);\n return record;\n });\n break;\n\n case \"DOMCharacterDataModified\":\n var target = e.target;\n var record = getRecord(\"characterData\", target);\n var oldValue = e.prevValue;\n forEachAncestorAndObserverEnqueueRecord(target, function(options) {\n if (!options.characterData) return;\n if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);\n return record;\n });\n break;\n\n case \"DOMNodeRemoved\":\n this.addTransientObserver(e.target);\n\n case \"DOMNodeInserted\":\n var changedNode = e.target;\n var addedNodes, removedNodes;\n if (e.type === \"DOMNodeInserted\") {\n addedNodes = [ changedNode ];\n removedNodes = [];\n } else {\n addedNodes = [];\n removedNodes = [ changedNode ];\n }\n var previousSibling = changedNode.previousSibling;\n var nextSibling = changedNode.nextSibling;\n var record = getRecord(\"childList\", e.target.parentNode);\n record.addedNodes = addedNodes;\n record.removedNodes = removedNodes;\n record.previousSibling = previousSibling;\n record.nextSibling = nextSibling;\n forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {\n if (!options.childList) return;\n return record;\n });\n }\n clearRecords();\n }\n };\n global.JsMutationObserver = JsMutationObserver;\n if (!global.MutationObserver) {\n global.MutationObserver = JsMutationObserver;\n JsMutationObserver._isPolyfilled = true;\n }\n})(self);\n\n(function() {\n var needsTemplate = typeof HTMLTemplateElement === \"undefined\";\n if (/Trident/.test(navigator.userAgent)) {\n (function() {\n var importNode = document.importNode;\n document.importNode = function() {\n var n = importNode.apply(document, arguments);\n if (n.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n var f = document.createDocumentFragment();\n f.appendChild(n);\n return f;\n } else {\n return n;\n }\n };\n })();\n }\n var needsCloning = function() {\n if (!needsTemplate) {\n var t = document.createElement(\"template\");\n var t2 = document.createElement(\"template\");\n t2.content.appendChild(document.createElement(\"div\"));\n t.content.appendChild(t2);\n var clone = t.cloneNode(true);\n return clone.content.childNodes.length === 0 || clone.content.firstChild.content.childNodes.length === 0;\n }\n }();\n var TEMPLATE_TAG = \"template\";\n var TemplateImpl = function() {};\n if (needsTemplate) {\n var contentDoc = document.implementation.createHTMLDocument(\"template\");\n var canDecorate = true;\n var templateStyle = document.createElement(\"style\");\n templateStyle.textContent = TEMPLATE_TAG + \"{display:none;}\";\n var head = document.head;\n head.insertBefore(templateStyle, head.firstElementChild);\n TemplateImpl.prototype = Object.create(HTMLElement.prototype);\n TemplateImpl.decorate = function(template) {\n if (template.content) {\n return;\n }\n template.content = contentDoc.createDocumentFragment();\n var child;\n while (child = template.firstChild) {\n template.content.appendChild(child);\n }\n template.cloneNode = function(deep) {\n return TemplateImpl.cloneNode(this, deep);\n };\n if (canDecorate) {\n try {\n Object.defineProperty(template, \"innerHTML\", {\n get: function() {\n var o = \"\";\n for (var e = this.content.firstChild; e; e = e.nextSibling) {\n o += e.outerHTML || escapeData(e.data);\n }\n return o;\n },\n set: function(text) {\n contentDoc.body.innerHTML = text;\n TemplateImpl.bootstrap(contentDoc);\n while (this.content.firstChild) {\n this.content.removeChild(this.content.firstChild);\n }\n while (contentDoc.body.firstChild) {\n this.content.appendChild(contentDoc.body.firstChild);\n }\n },\n configurable: true\n });\n } catch (err) {\n canDecorate = false;\n }\n }\n TemplateImpl.bootstrap(template.content);\n };\n TemplateImpl.bootstrap = function(doc) {\n var templates = doc.querySelectorAll(TEMPLATE_TAG);\n for (var i = 0, l = templates.length, t; i < l && (t = templates[i]); i++) {\n TemplateImpl.decorate(t);\n }\n };\n document.addEventListener(\"DOMContentLoaded\", function() {\n TemplateImpl.bootstrap(document);\n });\n var createElement = document.createElement;\n document.createElement = function() {\n \"use strict\";\n var el = createElement.apply(document, arguments);\n if (el.localName === \"template\") {\n TemplateImpl.decorate(el);\n }\n return el;\n };\n var escapeDataRegExp = /[&\\u00A0<>]/g;\n function escapeReplace(c) {\n switch (c) {\n case \"&\":\n return \"&\";\n\n case \"<\":\n return \"<\";\n\n case \">\":\n return \">\";\n\n case \" \":\n return \" \";\n }\n }\n function escapeData(s) {\n return s.replace(escapeDataRegExp, escapeReplace);\n }\n }\n if (needsTemplate || needsCloning) {\n var nativeCloneNode = Node.prototype.cloneNode;\n TemplateImpl.cloneNode = function(template, deep) {\n var clone = nativeCloneNode.call(template, false);\n if (this.decorate) {\n this.decorate(clone);\n }\n if (deep) {\n clone.content.appendChild(nativeCloneNode.call(template.content, true));\n this.fixClonedDom(clone.content, template.content);\n }\n return clone;\n };\n TemplateImpl.fixClonedDom = function(clone, source) {\n if (!source.querySelectorAll) return;\n var s$ = source.querySelectorAll(TEMPLATE_TAG);\n var t$ = clone.querySelectorAll(TEMPLATE_TAG);\n for (var i = 0, l = t$.length, t, s; i < l; i++) {\n s = s$[i];\n t = t$[i];\n if (this.decorate) {\n this.decorate(s);\n }\n t.parentNode.replaceChild(s.cloneNode(true), t);\n }\n };\n var originalImportNode = document.importNode;\n Node.prototype.cloneNode = function(deep) {\n var dom = nativeCloneNode.call(this, deep);\n if (deep) {\n TemplateImpl.fixClonedDom(dom, this);\n }\n return dom;\n };\n document.importNode = function(element, deep) {\n if (element.localName === TEMPLATE_TAG) {\n return TemplateImpl.cloneNode(element, deep);\n } else {\n var dom = originalImportNode.call(document, element, deep);\n if (deep) {\n TemplateImpl.fixClonedDom(dom, element);\n }\n return dom;\n }\n };\n if (needsCloning) {\n HTMLTemplateElement.prototype.cloneNode = function(deep) {\n return TemplateImpl.cloneNode(this, deep);\n };\n }\n }\n if (needsTemplate) {\n window.HTMLTemplateElement = TemplateImpl;\n }\n})();\n\n(function(scope) {\n \"use strict\";\n if (!(window.performance && window.performance.now)) {\n var start = Date.now();\n window.performance = {\n now: function() {\n return Date.now() - start;\n }\n };\n }\n if (!window.requestAnimationFrame) {\n window.requestAnimationFrame = function() {\n var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;\n return nativeRaf ? function(callback) {\n return nativeRaf(function() {\n callback(performance.now());\n });\n } : function(callback) {\n return window.setTimeout(callback, 1e3 / 60);\n };\n }();\n }\n if (!window.cancelAnimationFrame) {\n window.cancelAnimationFrame = function() {\n return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) {\n clearTimeout(id);\n };\n }();\n }\n var workingDefaultPrevented = function() {\n var e = document.createEvent(\"Event\");\n e.initEvent(\"foo\", true, true);\n e.preventDefault();\n return e.defaultPrevented;\n }();\n if (!workingDefaultPrevented) {\n var origPreventDefault = Event.prototype.preventDefault;\n Event.prototype.preventDefault = function() {\n if (!this.cancelable) {\n return;\n }\n origPreventDefault.call(this);\n Object.defineProperty(this, \"defaultPrevented\", {\n get: function() {\n return true;\n },\n configurable: true\n });\n };\n }\n var isIE = /Trident/.test(navigator.userAgent);\n if (!window.CustomEvent || isIE && typeof window.CustomEvent !== \"function\") {\n window.CustomEvent = function(inType, params) {\n params = params || {};\n var e = document.createEvent(\"CustomEvent\");\n e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);\n return e;\n };\n window.CustomEvent.prototype = window.Event.prototype;\n }\n if (!window.Event || isIE && typeof window.Event !== \"function\") {\n var origEvent = window.Event;\n window.Event = function(inType, params) {\n params = params || {};\n var e = document.createEvent(\"Event\");\n e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));\n return e;\n };\n window.Event.prototype = origEvent.prototype;\n }\n})(window.WebComponents);\n\nwindow.HTMLImports = window.HTMLImports || {\n flags: {}\n};\n\n(function(scope) {\n var IMPORT_LINK_TYPE = \"import\";\n var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement(\"link\"));\n var hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill);\n var wrap = function(node) {\n return hasShadowDOMPolyfill ? window.ShadowDOMPolyfill.wrapIfNeeded(node) : node;\n };\n var rootDocument = wrap(document);\n var currentScriptDescriptor = {\n get: function() {\n var script = window.HTMLImports.currentScript || document.currentScript || (document.readyState !== \"complete\" ? document.scripts[document.scripts.length - 1] : null);\n return wrap(script);\n },\n configurable: true\n };\n Object.defineProperty(document, \"_currentScript\", currentScriptDescriptor);\n Object.defineProperty(rootDocument, \"_currentScript\", currentScriptDescriptor);\n var isIE = /Trident/.test(navigator.userAgent);\n function whenReady(callback, doc) {\n doc = doc || rootDocument;\n whenDocumentReady(function() {\n watchImportsLoad(callback, doc);\n }, doc);\n }\n var requiredReadyState = isIE ? \"complete\" : \"interactive\";\n var READY_EVENT = \"readystatechange\";\n function isDocumentReady(doc) {\n return doc.readyState === \"complete\" || doc.readyState === requiredReadyState;\n }\n function whenDocumentReady(callback, doc) {\n if (!isDocumentReady(doc)) {\n var checkReady = function() {\n if (doc.readyState === \"complete\" || doc.readyState === requiredReadyState) {\n doc.removeEventListener(READY_EVENT, checkReady);\n whenDocumentReady(callback, doc);\n }\n };\n doc.addEventListener(READY_EVENT, checkReady);\n } else if (callback) {\n callback();\n }\n }\n function markTargetLoaded(event) {\n event.target.__loaded = true;\n }\n function watchImportsLoad(callback, doc) {\n var imports = doc.querySelectorAll(\"link[rel=import]\");\n var parsedCount = 0, importCount = imports.length, newImports = [], errorImports = [];\n function checkDone() {\n if (parsedCount == importCount && callback) {\n callback({\n allImports: imports,\n loadedImports: newImports,\n errorImports: errorImports\n });\n }\n }\n function loadedImport(e) {\n markTargetLoaded(e);\n newImports.push(this);\n parsedCount++;\n checkDone();\n }\n function errorLoadingImport(e) {\n errorImports.push(this);\n parsedCount++;\n checkDone();\n }\n if (importCount) {\n for (var i = 0, imp; i < importCount && (imp = imports[i]); i++) {\n if (isImportLoaded(imp)) {\n newImports.push(this);\n parsedCount++;\n checkDone();\n } else {\n imp.addEventListener(\"load\", loadedImport);\n imp.addEventListener(\"error\", errorLoadingImport);\n }\n }\n } else {\n checkDone();\n }\n }\n function isImportLoaded(link) {\n return useNative ? link.__loaded || link.import && link.import.readyState !== \"loading\" : link.__importParsed;\n }\n if (useNative) {\n new MutationObserver(function(mxns) {\n for (var i = 0, l = mxns.length, m; i < l && (m = mxns[i]); i++) {\n if (m.addedNodes) {\n handleImports(m.addedNodes);\n }\n }\n }).observe(document.head, {\n childList: true\n });\n function handleImports(nodes) {\n for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {\n if (isImport(n)) {\n handleImport(n);\n }\n }\n }\n function isImport(element) {\n return element.localName === \"link\" && element.rel === \"import\";\n }\n function handleImport(element) {\n var loaded = element.import;\n if (loaded) {\n markTargetLoaded({\n target: element\n });\n } else {\n element.addEventListener(\"load\", markTargetLoaded);\n element.addEventListener(\"error\", markTargetLoaded);\n }\n }\n (function() {\n if (document.readyState === \"loading\") {\n var imports = document.querySelectorAll(\"link[rel=import]\");\n for (var i = 0, l = imports.length, imp; i < l && (imp = imports[i]); i++) {\n handleImport(imp);\n }\n }\n })();\n }\n whenReady(function(detail) {\n window.HTMLImports.ready = true;\n window.HTMLImports.readyTime = new Date().getTime();\n var evt = rootDocument.createEvent(\"CustomEvent\");\n evt.initCustomEvent(\"HTMLImportsLoaded\", true, true, detail);\n rootDocument.dispatchEvent(evt);\n });\n scope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE;\n scope.useNative = useNative;\n scope.rootDocument = rootDocument;\n scope.whenReady = whenReady;\n scope.isIE = isIE;\n})(window.HTMLImports);\n\n(function(scope) {\n var modules = [];\n var addModule = function(module) {\n modules.push(module);\n };\n var initializeModules = function() {\n modules.forEach(function(module) {\n module(scope);\n });\n };\n scope.addModule = addModule;\n scope.initializeModules = initializeModules;\n})(window.HTMLImports);\n\nwindow.HTMLImports.addModule(function(scope) {\n var CSS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\n var CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n var path = {\n resolveUrlsInStyle: function(style, linkUrl) {\n var doc = style.ownerDocument;\n var resolver = doc.createElement(\"a\");\n style.textContent = this.resolveUrlsInCssText(style.textContent, linkUrl, resolver);\n return style;\n },\n resolveUrlsInCssText: function(cssText, linkUrl, urlObj) {\n var r = this.replaceUrls(cssText, urlObj, linkUrl, CSS_URL_REGEXP);\n r = this.replaceUrls(r, urlObj, linkUrl, CSS_IMPORT_REGEXP);\n return r;\n },\n replaceUrls: function(text, urlObj, linkUrl, regexp) {\n return text.replace(regexp, function(m, pre, url, post) {\n var urlPath = url.replace(/[\"']/g, \"\");\n if (linkUrl) {\n urlPath = new URL(urlPath, linkUrl).href;\n }\n urlObj.href = urlPath;\n urlPath = urlObj.href;\n return pre + \"'\" + urlPath + \"'\" + post;\n });\n }\n };\n scope.path = path;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n var xhr = {\n async: true,\n ok: function(request) {\n return request.status >= 200 && request.status < 300 || request.status === 304 || request.status === 0;\n },\n load: function(url, next, nextContext) {\n var request = new XMLHttpRequest();\n if (scope.flags.debug || scope.flags.bust) {\n url += \"?\" + Math.random();\n }\n request.open(\"GET\", url, xhr.async);\n request.addEventListener(\"readystatechange\", function(e) {\n if (request.readyState === 4) {\n var redirectedUrl = null;\n try {\n var locationHeader = request.getResponseHeader(\"Location\");\n if (locationHeader) {\n redirectedUrl = locationHeader.substr(0, 1) === \"/\" ? location.origin + locationHeader : locationHeader;\n }\n } catch (e) {\n console.error(e.message);\n }\n next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl);\n }\n });\n request.send();\n return request;\n },\n loadDocument: function(url, next, nextContext) {\n this.load(url, next, nextContext).responseType = \"document\";\n }\n };\n scope.xhr = xhr;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n var xhr = scope.xhr;\n var flags = scope.flags;\n var Loader = function(onLoad, onComplete) {\n this.cache = {};\n this.onload = onLoad;\n this.oncomplete = onComplete;\n this.inflight = 0;\n this.pending = {};\n };\n Loader.prototype = {\n addNodes: function(nodes) {\n this.inflight += nodes.length;\n for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {\n this.require(n);\n }\n this.checkDone();\n },\n addNode: function(node) {\n this.inflight++;\n this.require(node);\n this.checkDone();\n },\n require: function(elt) {\n var url = elt.src || elt.href;\n elt.__nodeUrl = url;\n if (!this.dedupe(url, elt)) {\n this.fetch(url, elt);\n }\n },\n dedupe: function(url, elt) {\n if (this.pending[url]) {\n this.pending[url].push(elt);\n return true;\n }\n var resource;\n if (this.cache[url]) {\n this.onload(url, elt, this.cache[url]);\n this.tail();\n return true;\n }\n this.pending[url] = [ elt ];\n return false;\n },\n fetch: function(url, elt) {\n flags.load && console.log(\"fetch\", url, elt);\n if (!url) {\n setTimeout(function() {\n this.receive(url, elt, {\n error: \"href must be specified\"\n }, null);\n }.bind(this), 0);\n } else if (url.match(/^data:/)) {\n var pieces = url.split(\",\");\n var header = pieces[0];\n var body = pieces[1];\n if (header.indexOf(\";base64\") > -1) {\n body = atob(body);\n } else {\n body = decodeURIComponent(body);\n }\n setTimeout(function() {\n this.receive(url, elt, null, body);\n }.bind(this), 0);\n } else {\n var receiveXhr = function(err, resource, redirectedUrl) {\n this.receive(url, elt, err, resource, redirectedUrl);\n }.bind(this);\n xhr.load(url, receiveXhr);\n }\n },\n receive: function(url, elt, err, resource, redirectedUrl) {\n this.cache[url] = resource;\n var $p = this.pending[url];\n for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {\n this.onload(url, p, resource, err, redirectedUrl);\n this.tail();\n }\n this.pending[url] = null;\n },\n tail: function() {\n --this.inflight;\n this.checkDone();\n },\n checkDone: function() {\n if (!this.inflight) {\n this.oncomplete();\n }\n }\n };\n scope.Loader = Loader;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n var Observer = function(addCallback) {\n this.addCallback = addCallback;\n this.mo = new MutationObserver(this.handler.bind(this));\n };\n Observer.prototype = {\n handler: function(mutations) {\n for (var i = 0, l = mutations.length, m; i < l && (m = mutations[i]); i++) {\n if (m.type === \"childList\" && m.addedNodes.length) {\n this.addedNodes(m.addedNodes);\n }\n }\n },\n addedNodes: function(nodes) {\n if (this.addCallback) {\n this.addCallback(nodes);\n }\n for (var i = 0, l = nodes.length, n, loading; i < l && (n = nodes[i]); i++) {\n if (n.children && n.children.length) {\n this.addedNodes(n.children);\n }\n }\n },\n observe: function(root) {\n this.mo.observe(root, {\n childList: true,\n subtree: true\n });\n }\n };\n scope.Observer = Observer;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n var path = scope.path;\n var rootDocument = scope.rootDocument;\n var flags = scope.flags;\n var isIE = scope.isIE;\n var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;\n var IMPORT_SELECTOR = \"link[rel=\" + IMPORT_LINK_TYPE + \"]\";\n var importParser = {\n documentSelectors: IMPORT_SELECTOR,\n importsSelectors: [ IMPORT_SELECTOR, \"link[rel=stylesheet]:not([type])\", \"style:not([type])\", \"script:not([type])\", 'script[type=\"application/javascript\"]', 'script[type=\"text/javascript\"]' ].join(\",\"),\n map: {\n link: \"parseLink\",\n script: \"parseScript\",\n style: \"parseStyle\"\n },\n dynamicElements: [],\n parseNext: function() {\n var next = this.nextToParse();\n if (next) {\n this.parse(next);\n }\n },\n parse: function(elt) {\n if (this.isParsed(elt)) {\n flags.parse && console.log(\"[%s] is already parsed\", elt.localName);\n return;\n }\n var fn = this[this.map[elt.localName]];\n if (fn) {\n this.markParsing(elt);\n fn.call(this, elt);\n }\n },\n parseDynamic: function(elt, quiet) {\n this.dynamicElements.push(elt);\n if (!quiet) {\n this.parseNext();\n }\n },\n markParsing: function(elt) {\n flags.parse && console.log(\"parsing\", elt);\n this.parsingElement = elt;\n },\n markParsingComplete: function(elt) {\n elt.__importParsed = true;\n this.markDynamicParsingComplete(elt);\n if (elt.__importElement) {\n elt.__importElement.__importParsed = true;\n this.markDynamicParsingComplete(elt.__importElement);\n }\n this.parsingElement = null;\n flags.parse && console.log(\"completed\", elt);\n },\n markDynamicParsingComplete: function(elt) {\n var i = this.dynamicElements.indexOf(elt);\n if (i >= 0) {\n this.dynamicElements.splice(i, 1);\n }\n },\n parseImport: function(elt) {\n elt.import = elt.__doc;\n if (window.HTMLImports.__importsParsingHook) {\n window.HTMLImports.__importsParsingHook(elt);\n }\n if (elt.import) {\n elt.import.__importParsed = true;\n }\n this.markParsingComplete(elt);\n if (elt.__resource && !elt.__error) {\n elt.dispatchEvent(new CustomEvent(\"load\", {\n bubbles: false\n }));\n } else {\n elt.dispatchEvent(new CustomEvent(\"error\", {\n bubbles: false\n }));\n }\n if (elt.__pending) {\n var fn;\n while (elt.__pending.length) {\n fn = elt.__pending.shift();\n if (fn) {\n fn({\n target: elt\n });\n }\n }\n }\n this.parseNext();\n },\n parseLink: function(linkElt) {\n if (nodeIsImport(linkElt)) {\n this.parseImport(linkElt);\n } else {\n linkElt.href = linkElt.href;\n this.parseGeneric(linkElt);\n }\n },\n parseStyle: function(elt) {\n var src = elt;\n elt = cloneStyle(elt);\n src.__appliedElement = elt;\n elt.__importElement = src;\n this.parseGeneric(elt);\n },\n parseGeneric: function(elt) {\n this.trackElement(elt);\n this.addElementToDocument(elt);\n },\n rootImportForElement: function(elt) {\n var n = elt;\n while (n.ownerDocument.__importLink) {\n n = n.ownerDocument.__importLink;\n }\n return n;\n },\n addElementToDocument: function(elt) {\n var port = this.rootImportForElement(elt.__importElement || elt);\n port.parentNode.insertBefore(elt, port);\n },\n trackElement: function(elt, callback) {\n var self = this;\n var done = function(e) {\n elt.removeEventListener(\"load\", done);\n elt.removeEventListener(\"error\", done);\n if (callback) {\n callback(e);\n }\n self.markParsingComplete(elt);\n self.parseNext();\n };\n elt.addEventListener(\"load\", done);\n elt.addEventListener(\"error\", done);\n if (isIE && elt.localName === \"style\") {\n var fakeLoad = false;\n if (elt.textContent.indexOf(\"@import\") == -1) {\n fakeLoad = true;\n } else if (elt.sheet) {\n fakeLoad = true;\n var csr = elt.sheet.cssRules;\n var len = csr ? csr.length : 0;\n for (var i = 0, r; i < len && (r = csr[i]); i++) {\n if (r.type === CSSRule.IMPORT_RULE) {\n fakeLoad = fakeLoad && Boolean(r.styleSheet);\n }\n }\n }\n if (fakeLoad) {\n setTimeout(function() {\n elt.dispatchEvent(new CustomEvent(\"load\", {\n bubbles: false\n }));\n });\n }\n }\n },\n parseScript: function(scriptElt) {\n var script = document.createElement(\"script\");\n script.__importElement = scriptElt;\n script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt);\n scope.currentScript = scriptElt;\n this.trackElement(script, function(e) {\n if (script.parentNode) {\n script.parentNode.removeChild(script);\n }\n scope.currentScript = null;\n });\n this.addElementToDocument(script);\n },\n nextToParse: function() {\n this._mayParse = [];\n return !this.parsingElement && (this.nextToParseInDoc(rootDocument) || this.nextToParseDynamic());\n },\n nextToParseInDoc: function(doc, link) {\n if (doc && this._mayParse.indexOf(doc) < 0) {\n this._mayParse.push(doc);\n var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc));\n for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {\n if (!this.isParsed(n)) {\n if (this.hasResource(n)) {\n return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n;\n } else {\n return;\n }\n }\n }\n }\n return link;\n },\n nextToParseDynamic: function() {\n return this.dynamicElements[0];\n },\n parseSelectorsForNode: function(node) {\n var doc = node.ownerDocument || node;\n return doc === rootDocument ? this.documentSelectors : this.importsSelectors;\n },\n isParsed: function(node) {\n return node.__importParsed;\n },\n needsDynamicParsing: function(elt) {\n return this.dynamicElements.indexOf(elt) >= 0;\n },\n hasResource: function(node) {\n if (nodeIsImport(node) && node.__doc === undefined) {\n return false;\n }\n return true;\n }\n };\n function nodeIsImport(elt) {\n return elt.localName === \"link\" && elt.rel === IMPORT_LINK_TYPE;\n }\n function generateScriptDataUrl(script) {\n var scriptContent = generateScriptContent(script);\n return \"data:text/javascript;charset=utf-8,\" + encodeURIComponent(scriptContent);\n }\n function generateScriptContent(script) {\n return script.textContent + generateSourceMapHint(script);\n }\n function generateSourceMapHint(script) {\n var owner = script.ownerDocument;\n owner.__importedScripts = owner.__importedScripts || 0;\n var moniker = script.ownerDocument.baseURI;\n var num = owner.__importedScripts ? \"-\" + owner.__importedScripts : \"\";\n owner.__importedScripts++;\n return \"\\n//# sourceURL=\" + moniker + num + \".js\\n\";\n }\n function cloneStyle(style) {\n var clone = style.ownerDocument.createElement(\"style\");\n clone.textContent = style.textContent;\n path.resolveUrlsInStyle(clone);\n return clone;\n }\n scope.parser = importParser;\n scope.IMPORT_SELECTOR = IMPORT_SELECTOR;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n var flags = scope.flags;\n var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE;\n var IMPORT_SELECTOR = scope.IMPORT_SELECTOR;\n var rootDocument = scope.rootDocument;\n var Loader = scope.Loader;\n var Observer = scope.Observer;\n var parser = scope.parser;\n var importer = {\n documents: {},\n documentPreloadSelectors: IMPORT_SELECTOR,\n importsPreloadSelectors: [ IMPORT_SELECTOR ].join(\",\"),\n loadNode: function(node) {\n importLoader.addNode(node);\n },\n loadSubtree: function(parent) {\n var nodes = this.marshalNodes(parent);\n importLoader.addNodes(nodes);\n },\n marshalNodes: function(parent) {\n return parent.querySelectorAll(this.loadSelectorsForNode(parent));\n },\n loadSelectorsForNode: function(node) {\n var doc = node.ownerDocument || node;\n return doc === rootDocument ? this.documentPreloadSelectors : this.importsPreloadSelectors;\n },\n loaded: function(url, elt, resource, err, redirectedUrl) {\n flags.load && console.log(\"loaded\", url, elt);\n elt.__resource = resource;\n elt.__error = err;\n if (isImportLink(elt)) {\n var doc = this.documents[url];\n if (doc === undefined) {\n doc = err ? null : makeDocument(resource, redirectedUrl || url);\n if (doc) {\n doc.__importLink = elt;\n this.bootDocument(doc);\n }\n this.documents[url] = doc;\n }\n elt.__doc = doc;\n }\n parser.parseNext();\n },\n bootDocument: function(doc) {\n this.loadSubtree(doc);\n this.observer.observe(doc);\n parser.parseNext();\n },\n loadedAll: function() {\n parser.parseNext();\n }\n };\n var importLoader = new Loader(importer.loaded.bind(importer), importer.loadedAll.bind(importer));\n importer.observer = new Observer();\n function isImportLink(elt) {\n return isLinkRel(elt, IMPORT_LINK_TYPE);\n }\n function isLinkRel(elt, rel) {\n return elt.localName === \"link\" && elt.getAttribute(\"rel\") === rel;\n }\n function hasBaseURIAccessor(doc) {\n return !!Object.getOwnPropertyDescriptor(doc, \"baseURI\");\n }\n function makeDocument(resource, url) {\n var doc = document.implementation.createHTMLDocument(IMPORT_LINK_TYPE);\n doc._URL = url;\n var base = doc.createElement(\"base\");\n base.setAttribute(\"href\", url);\n if (!doc.baseURI && !hasBaseURIAccessor(doc)) {\n Object.defineProperty(doc, \"baseURI\", {\n value: url\n });\n }\n var meta = doc.createElement(\"meta\");\n meta.setAttribute(\"charset\", \"utf-8\");\n doc.head.appendChild(meta);\n doc.head.appendChild(base);\n doc.body.innerHTML = resource;\n if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) {\n HTMLTemplateElement.bootstrap(doc);\n }\n return doc;\n }\n if (!document.baseURI) {\n var baseURIDescriptor = {\n get: function() {\n var base = document.querySelector(\"base\");\n return base ? base.href : window.location.href;\n },\n configurable: true\n };\n Object.defineProperty(document, \"baseURI\", baseURIDescriptor);\n Object.defineProperty(rootDocument, \"baseURI\", baseURIDescriptor);\n }\n scope.importer = importer;\n scope.importLoader = importLoader;\n});\n\nwindow.HTMLImports.addModule(function(scope) {\n var parser = scope.parser;\n var importer = scope.importer;\n var dynamic = {\n added: function(nodes) {\n var owner, parsed, loading;\n for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) {\n if (!owner) {\n owner = n.ownerDocument;\n parsed = parser.isParsed(owner);\n }\n loading = this.shouldLoadNode(n);\n if (loading) {\n importer.loadNode(n);\n }\n if (this.shouldParseNode(n) && parsed) {\n parser.parseDynamic(n, loading);\n }\n }\n },\n shouldLoadNode: function(node) {\n return node.nodeType === 1 && matches.call(node, importer.loadSelectorsForNode(node));\n },\n shouldParseNode: function(node) {\n return node.nodeType === 1 && matches.call(node, parser.parseSelectorsForNode(node));\n }\n };\n importer.observer.addCallback = dynamic.added.bind(dynamic);\n var matches = HTMLElement.prototype.matches || HTMLElement.prototype.matchesSelector || HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.msMatchesSelector;\n});\n\n(function(scope) {\n var initializeModules = scope.initializeModules;\n var isIE = scope.isIE;\n if (scope.useNative) {\n return;\n }\n initializeModules();\n var rootDocument = scope.rootDocument;\n function bootstrap() {\n window.HTMLImports.importer.bootDocument(rootDocument);\n }\n if (document.readyState === \"complete\" || document.readyState === \"interactive\" && !window.attachEvent) {\n bootstrap();\n } else {\n document.addEventListener(\"DOMContentLoaded\", bootstrap);\n }\n})(window.HTMLImports);\n\nwindow.CustomElements = window.CustomElements || {\n flags: {}\n};\n\n(function(scope) {\n var flags = scope.flags;\n var modules = [];\n var addModule = function(module) {\n modules.push(module);\n };\n var initializeModules = function() {\n modules.forEach(function(module) {\n module(scope);\n });\n };\n scope.addModule = addModule;\n scope.initializeModules = initializeModules;\n scope.hasNative = Boolean(document.registerElement);\n scope.isIE = /Trident/.test(navigator.userAgent);\n scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);\n})(window.CustomElements);\n\nwindow.CustomElements.addModule(function(scope) {\n var IMPORT_LINK_TYPE = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : \"none\";\n function forSubtree(node, cb) {\n findAllElements(node, function(e) {\n if (cb(e)) {\n return true;\n }\n forRoots(e, cb);\n });\n forRoots(node, cb);\n }\n function findAllElements(node, find, data) {\n var e = node.firstElementChild;\n if (!e) {\n e = node.firstChild;\n while (e && e.nodeType !== Node.ELEMENT_NODE) {\n e = e.nextSibling;\n }\n }\n while (e) {\n if (find(e, data) !== true) {\n findAllElements(e, find, data);\n }\n e = e.nextElementSibling;\n }\n return null;\n }\n function forRoots(node, cb) {\n var root = node.shadowRoot;\n while (root) {\n forSubtree(root, cb);\n root = root.olderShadowRoot;\n }\n }\n function forDocumentTree(doc, cb) {\n _forDocumentTree(doc, cb, []);\n }\n function _forDocumentTree(doc, cb, processingDocuments) {\n doc = window.wrap(doc);\n if (processingDocuments.indexOf(doc) >= 0) {\n return;\n }\n processingDocuments.push(doc);\n var imports = doc.querySelectorAll(\"link[rel=\" + IMPORT_LINK_TYPE + \"]\");\n for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) {\n if (n.import) {\n _forDocumentTree(n.import, cb, processingDocuments);\n }\n }\n cb(doc);\n }\n scope.forDocumentTree = forDocumentTree;\n scope.forSubtree = forSubtree;\n});\n\nwindow.CustomElements.addModule(function(scope) {\n var flags = scope.flags;\n var forSubtree = scope.forSubtree;\n var forDocumentTree = scope.forDocumentTree;\n function addedNode(node, isAttached) {\n return added(node, isAttached) || addedSubtree(node, isAttached);\n }\n function added(node, isAttached) {\n if (scope.upgrade(node, isAttached)) {\n return true;\n }\n if (isAttached) {\n attached(node);\n }\n }\n function addedSubtree(node, isAttached) {\n forSubtree(node, function(e) {\n if (added(e, isAttached)) {\n return true;\n }\n });\n }\n var hasThrottledAttached = window.MutationObserver._isPolyfilled && flags[\"throttle-attached\"];\n scope.hasPolyfillMutations = hasThrottledAttached;\n scope.hasThrottledAttached = hasThrottledAttached;\n var isPendingMutations = false;\n var pendingMutations = [];\n function deferMutation(fn) {\n pendingMutations.push(fn);\n if (!isPendingMutations) {\n isPendingMutations = true;\n setTimeout(takeMutations);\n }\n }\n function takeMutations() {\n isPendingMutations = false;\n var $p = pendingMutations;\n for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {\n p();\n }\n pendingMutations = [];\n }\n function attached(element) {\n if (hasThrottledAttached) {\n deferMutation(function() {\n _attached(element);\n });\n } else {\n _attached(element);\n }\n }\n function _attached(element) {\n if (element.__upgraded__ && !element.__attached) {\n element.__attached = true;\n if (element.attachedCallback) {\n element.attachedCallback();\n }\n }\n }\n function detachedNode(node) {\n detached(node);\n forSubtree(node, function(e) {\n detached(e);\n });\n }\n function detached(element) {\n if (hasThrottledAttached) {\n deferMutation(function() {\n _detached(element);\n });\n } else {\n _detached(element);\n }\n }\n function _detached(element) {\n if (element.__upgraded__ && element.__attached) {\n element.__attached = false;\n if (element.detachedCallback) {\n element.detachedCallback();\n }\n }\n }\n function inDocument(element) {\n var p = element;\n var doc = window.wrap(document);\n while (p) {\n if (p == doc) {\n return true;\n }\n p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host;\n }\n }\n function watchShadow(node) {\n if (node.shadowRoot && !node.shadowRoot.__watched) {\n flags.dom && console.log(\"watching shadow-root for: \", node.localName);\n var root = node.shadowRoot;\n while (root) {\n observe(root);\n root = root.olderShadowRoot;\n }\n }\n }\n function handler(root, mutations) {\n if (flags.dom) {\n var mx = mutations[0];\n if (mx && mx.type === \"childList\" && mx.addedNodes) {\n if (mx.addedNodes) {\n var d = mx.addedNodes[0];\n while (d && d !== document && !d.host) {\n d = d.parentNode;\n }\n var u = d && (d.URL || d._URL || d.host && d.host.localName) || \"\";\n u = u.split(\"/?\").shift().split(\"/\").pop();\n }\n }\n console.group(\"mutations (%d) [%s]\", mutations.length, u || \"\");\n }\n var isAttached = inDocument(root);\n mutations.forEach(function(mx) {\n if (mx.type === \"childList\") {\n forEach(mx.addedNodes, function(n) {\n if (!n.localName) {\n return;\n }\n addedNode(n, isAttached);\n });\n forEach(mx.removedNodes, function(n) {\n if (!n.localName) {\n return;\n }\n detachedNode(n);\n });\n }\n });\n flags.dom && console.groupEnd();\n }\n function takeRecords(node) {\n node = window.wrap(node);\n if (!node) {\n node = window.wrap(document);\n }\n while (node.parentNode) {\n node = node.parentNode;\n }\n var observer = node.__observer;\n if (observer) {\n handler(node, observer.takeRecords());\n takeMutations();\n }\n }\n var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);\n function observe(inRoot) {\n if (inRoot.__observer) {\n return;\n }\n var observer = new MutationObserver(handler.bind(this, inRoot));\n observer.observe(inRoot, {\n childList: true,\n subtree: true\n });\n inRoot.__observer = observer;\n }\n function upgradeDocument(doc) {\n doc = window.wrap(doc);\n flags.dom && console.group(\"upgradeDocument: \", doc.baseURI.split(\"/\").pop());\n var isMainDocument = doc === window.wrap(document);\n addedNode(doc, isMainDocument);\n observe(doc);\n flags.dom && console.groupEnd();\n }\n function upgradeDocumentTree(doc) {\n forDocumentTree(doc, upgradeDocument);\n }\n var originalCreateShadowRoot = Element.prototype.createShadowRoot;\n if (originalCreateShadowRoot) {\n Element.prototype.createShadowRoot = function() {\n var root = originalCreateShadowRoot.call(this);\n window.CustomElements.watchShadow(this);\n return root;\n };\n }\n scope.watchShadow = watchShadow;\n scope.upgradeDocumentTree = upgradeDocumentTree;\n scope.upgradeDocument = upgradeDocument;\n scope.upgradeSubtree = addedSubtree;\n scope.upgradeAll = addedNode;\n scope.attached = attached;\n scope.takeRecords = takeRecords;\n});\n\nwindow.CustomElements.addModule(function(scope) {\n var flags = scope.flags;\n function upgrade(node, isAttached) {\n if (node.localName === \"template\") {\n if (window.HTMLTemplateElement && HTMLTemplateElement.decorate) {\n HTMLTemplateElement.decorate(node);\n }\n }\n if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {\n var is = node.getAttribute(\"is\");\n var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is);\n if (definition) {\n if (is && definition.tag == node.localName || !is && !definition.extends) {\n return upgradeWithDefinition(node, definition, isAttached);\n }\n }\n }\n }\n function upgradeWithDefinition(element, definition, isAttached) {\n flags.upgrade && console.group(\"upgrade:\", element.localName);\n if (definition.is) {\n element.setAttribute(\"is\", definition.is);\n }\n implementPrototype(element, definition);\n element.__upgraded__ = true;\n created(element);\n if (isAttached) {\n scope.attached(element);\n }\n scope.upgradeSubtree(element, isAttached);\n flags.upgrade && console.groupEnd();\n return element;\n }\n function implementPrototype(element, definition) {\n if (Object.__proto__) {\n element.__proto__ = definition.prototype;\n } else {\n customMixin(element, definition.prototype, definition.native);\n element.__proto__ = definition.prototype;\n }\n }\n function customMixin(inTarget, inSrc, inNative) {\n var used = {};\n var p = inSrc;\n while (p !== inNative && p !== HTMLElement.prototype) {\n var keys = Object.getOwnPropertyNames(p);\n for (var i = 0, k; k = keys[i]; i++) {\n if (!used[k]) {\n Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k));\n used[k] = 1;\n }\n }\n p = Object.getPrototypeOf(p);\n }\n }\n function created(element) {\n if (element.createdCallback) {\n element.createdCallback();\n }\n }\n scope.upgrade = upgrade;\n scope.upgradeWithDefinition = upgradeWithDefinition;\n scope.implementPrototype = implementPrototype;\n});\n\nwindow.CustomElements.addModule(function(scope) {\n var isIE = scope.isIE;\n var upgradeDocumentTree = scope.upgradeDocumentTree;\n var upgradeAll = scope.upgradeAll;\n var upgradeWithDefinition = scope.upgradeWithDefinition;\n var implementPrototype = scope.implementPrototype;\n var useNative = scope.useNative;\n function register(name, options) {\n var definition = options || {};\n if (!name) {\n throw new Error(\"document.registerElement: first argument `name` must not be empty\");\n }\n if (name.indexOf(\"-\") < 0) {\n throw new Error(\"document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '\" + String(name) + \"'.\");\n }\n if (isReservedTag(name)) {\n throw new Error(\"Failed to execute 'registerElement' on 'Document': Registration failed for type '\" + String(name) + \"'. The type name is invalid.\");\n }\n if (getRegisteredDefinition(name)) {\n throw new Error(\"DuplicateDefinitionError: a type with name '\" + String(name) + \"' is already registered\");\n }\n if (!definition.prototype) {\n definition.prototype = Object.create(HTMLElement.prototype);\n }\n definition.__name = name.toLowerCase();\n if (definition.extends) {\n definition.extends = definition.extends.toLowerCase();\n }\n definition.lifecycle = definition.lifecycle || {};\n definition.ancestry = ancestry(definition.extends);\n resolveTagName(definition);\n resolvePrototypeChain(definition);\n overrideAttributeApi(definition.prototype);\n registerDefinition(definition.__name, definition);\n definition.ctor = generateConstructor(definition);\n definition.ctor.prototype = definition.prototype;\n definition.prototype.constructor = definition.ctor;\n if (scope.ready) {\n upgradeDocumentTree(document);\n }\n return definition.ctor;\n }\n function overrideAttributeApi(prototype) {\n if (prototype.setAttribute._polyfilled) {\n return;\n }\n var setAttribute = prototype.setAttribute;\n prototype.setAttribute = function(name, value) {\n changeAttribute.call(this, name, value, setAttribute);\n };\n var removeAttribute = prototype.removeAttribute;\n prototype.removeAttribute = function(name) {\n changeAttribute.call(this, name, null, removeAttribute);\n };\n prototype.setAttribute._polyfilled = true;\n }\n function changeAttribute(name, value, operation) {\n name = name.toLowerCase();\n var oldValue = this.getAttribute(name);\n operation.apply(this, arguments);\n var newValue = this.getAttribute(name);\n if (this.attributeChangedCallback && newValue !== oldValue) {\n this.attributeChangedCallback(name, oldValue, newValue);\n }\n }\n function isReservedTag(name) {\n for (var i = 0; i < reservedTagList.length; i++) {\n if (name === reservedTagList[i]) {\n return true;\n }\n }\n }\n var reservedTagList = [ \"annotation-xml\", \"color-profile\", \"font-face\", \"font-face-src\", \"font-face-uri\", \"font-face-format\", \"font-face-name\", \"missing-glyph\" ];\n function ancestry(extnds) {\n var extendee = getRegisteredDefinition(extnds);\n if (extendee) {\n return ancestry(extendee.extends).concat([ extendee ]);\n }\n return [];\n }\n function resolveTagName(definition) {\n var baseTag = definition.extends;\n for (var i = 0, a; a = definition.ancestry[i]; i++) {\n baseTag = a.is && a.tag;\n }\n definition.tag = baseTag || definition.__name;\n if (baseTag) {\n definition.is = definition.__name;\n }\n }\n function resolvePrototypeChain(definition) {\n if (!Object.__proto__) {\n var nativePrototype = HTMLElement.prototype;\n if (definition.is) {\n var inst = document.createElement(definition.tag);\n nativePrototype = Object.getPrototypeOf(inst);\n }\n var proto = definition.prototype, ancestor;\n var foundPrototype = false;\n while (proto) {\n if (proto == nativePrototype) {\n foundPrototype = true;\n }\n ancestor = Object.getPrototypeOf(proto);\n if (ancestor) {\n proto.__proto__ = ancestor;\n }\n proto = ancestor;\n }\n if (!foundPrototype) {\n console.warn(definition.tag + \" prototype not found in prototype chain for \" + definition.is);\n }\n definition.native = nativePrototype;\n }\n }\n function instantiate(definition) {\n return upgradeWithDefinition(domCreateElement(definition.tag), definition);\n }\n var registry = {};\n function getRegisteredDefinition(name) {\n if (name) {\n return registry[name.toLowerCase()];\n }\n }\n function registerDefinition(name, definition) {\n registry[name] = definition;\n }\n function generateConstructor(definition) {\n return function() {\n return instantiate(definition);\n };\n }\n var HTML_NAMESPACE = \"http://www.w3.org/1999/xhtml\";\n function createElementNS(namespace, tag, typeExtension) {\n if (namespace === HTML_NAMESPACE) {\n return createElement(tag, typeExtension);\n } else {\n return domCreateElementNS(namespace, tag);\n }\n }\n function createElement(tag, typeExtension) {\n if (tag) {\n tag = tag.toLowerCase();\n }\n if (typeExtension) {\n typeExtension = typeExtension.toLowerCase();\n }\n var definition = getRegisteredDefinition(typeExtension || tag);\n if (definition) {\n if (tag == definition.tag && typeExtension == definition.is) {\n return new definition.ctor();\n }\n if (!typeExtension && !definition.is) {\n return new definition.ctor();\n }\n }\n var element;\n if (typeExtension) {\n element = createElement(tag);\n element.setAttribute(\"is\", typeExtension);\n return element;\n }\n element = domCreateElement(tag);\n if (tag.indexOf(\"-\") >= 0) {\n implementPrototype(element, HTMLElement);\n }\n return element;\n }\n var domCreateElement = document.createElement.bind(document);\n var domCreateElementNS = document.createElementNS.bind(document);\n var isInstance;\n if (!Object.__proto__ && !useNative) {\n isInstance = function(obj, ctor) {\n if (obj instanceof ctor) {\n return true;\n }\n var p = obj;\n while (p) {\n if (p === ctor.prototype) {\n return true;\n }\n p = p.__proto__;\n }\n return false;\n };\n } else {\n isInstance = function(obj, base) {\n return obj instanceof base;\n };\n }\n function wrapDomMethodToForceUpgrade(obj, methodName) {\n var orig = obj[methodName];\n obj[methodName] = function() {\n var n = orig.apply(this, arguments);\n upgradeAll(n);\n return n;\n };\n }\n wrapDomMethodToForceUpgrade(Node.prototype, \"cloneNode\");\n wrapDomMethodToForceUpgrade(document, \"importNode\");\n document.registerElement = register;\n document.createElement = createElement;\n document.createElementNS = createElementNS;\n scope.registry = registry;\n scope.instanceof = isInstance;\n scope.reservedTagList = reservedTagList;\n scope.getRegisteredDefinition = getRegisteredDefinition;\n document.register = document.registerElement;\n});\n\n(function(scope) {\n var useNative = scope.useNative;\n var initializeModules = scope.initializeModules;\n var isIE = scope.isIE;\n if (useNative) {\n var nop = function() {};\n scope.watchShadow = nop;\n scope.upgrade = nop;\n scope.upgradeAll = nop;\n scope.upgradeDocumentTree = nop;\n scope.upgradeSubtree = nop;\n scope.takeRecords = nop;\n scope.instanceof = function(obj, base) {\n return obj instanceof base;\n };\n } else {\n initializeModules();\n }\n var upgradeDocumentTree = scope.upgradeDocumentTree;\n var upgradeDocument = scope.upgradeDocument;\n if (!window.wrap) {\n if (window.ShadowDOMPolyfill) {\n window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded;\n window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded;\n } else {\n window.wrap = window.unwrap = function(node) {\n return node;\n };\n }\n }\n if (window.HTMLImports) {\n window.HTMLImports.__importsParsingHook = function(elt) {\n if (elt.import) {\n upgradeDocument(wrap(elt.import));\n }\n };\n }\n function bootstrap() {\n upgradeDocumentTree(window.wrap(document));\n window.CustomElements.ready = true;\n var requestAnimationFrame = window.requestAnimationFrame || function(f) {\n setTimeout(f, 16);\n };\n requestAnimationFrame(function() {\n setTimeout(function() {\n window.CustomElements.readyTime = Date.now();\n if (window.HTMLImports) {\n window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime;\n }\n document.dispatchEvent(new CustomEvent(\"WebComponentsReady\", {\n bubbles: true\n }));\n });\n });\n }\n if (document.readyState === \"complete\" || scope.flags.eager) {\n bootstrap();\n } else if (document.readyState === \"interactive\" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {\n bootstrap();\n } else {\n var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? \"HTMLImportsLoaded\" : \"DOMContentLoaded\";\n window.addEventListener(loadEvent, bootstrap);\n }\n})(window.CustomElements);\n\n(function(scope) {\n var style = document.createElement(\"style\");\n style.textContent = \"\" + \"body {\" + \"transition: opacity ease-in 0.2s;\" + \" } \\n\" + \"body[unresolved] {\" + \"opacity: 0; display: block; overflow: hidden; position: relative;\" + \" } \\n\";\n var head = document.querySelector(\"head\");\n head.insertBefore(style, head.firstChild);\n})(window.WebComponents);\n\n/***/ }),\n/* 138 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * The ChromecastButton module contains both the ChromecastButton class definition and\n * the function used to register the button as a Video.js Component.\n *\n * @module ChromecastButton\n */\n\nvar ChromecastButton;\n\n/**\n* The Video.js Button class is the base class for UI button components.\n*\n* @external Button\n* @see {@link http://docs.videojs.com/Button.html|Button}\n*/\n\n/** @lends ChromecastButton.prototype */\nChromecastButton = {\n\n /**\n * This class is a button component designed to be displayed in the player UI's control\n * bar. It opens the Chromecast menu when clicked.\n *\n * @constructs\n * @extends external:Button\n * @param player {Player} the video.js player instance\n */\n constructor: function(player) {\n this.constructor.super_.apply(this, arguments);\n\n player.on('chromecastConnected', this._onChromecastConnected.bind(this));\n player.on('chromecastDisconnected', this._onChromecastDisconnected.bind(this));\n player.on('chromecastDevicesAvailable', this._onChromecastDevicesAvailable.bind(this));\n player.on('chromecastDevicesUnavailable', this._onChromecastDevicesUnavailable.bind(this));\n\n this.controlText('Open Chromecast menu');\n\n // Use the initial state of `hasAvailableDevices` to call the corresponding event\n // handlers because the corresponding events may have already been emitted before\n // binding the listeners above.\n if (player.chromecastSessionManager && player.chromecastSessionManager.hasAvailableDevices()) {\n this._onChromecastDevicesAvailable();\n } else {\n this._onChromecastDevicesUnavailable();\n }\n },\n\n /**\n * Overrides Button#buildCSSClass to return the classes used on the button element.\n *\n * @param el {DOMElement}\n * @see {@link http://docs.videojs.com/Button.html#buildCSSClass|Button#buildCSSClass}\n */\n buildCSSClass: function() {\n return 'vjs-chromecast-button ' + (this._isChromecastConnected ? 'vjs-chromecast-casting-state ' : '') +\n this.constructor.super_.prototype.buildCSSClass();\n },\n\n /**\n * Overrides Button#handleClick to handle button click events. Chromecast functionality\n * is handled outside of this class, which should be limited to UI related logic. This\n * function simply triggers an event on the player.\n *\n * @fires ChromecastButton#chromecastRequested\n * @param el {DOMElement}\n * @see {@link http://docs.videojs.com/Button.html#handleClick|Button#handleClick}\n */\n handleClick: function() {\n this.player().trigger('chromecastRequested');\n },\n\n /**\n * Handles `chromecastConnected` player events.\n *\n * @private\n */\n _onChromecastConnected: function() {\n this._isChromecastConnected = true;\n this._reloadCSSClasses();\n },\n\n /**\n * Handles `chromecastDisconnected` player events.\n *\n * @private\n */\n _onChromecastDisconnected: function() {\n this._isChromecastConnected = false;\n this._reloadCSSClasses();\n },\n\n /**\n * Handles `chromecastDevicesAvailable` player events.\n *\n * @private\n */\n _onChromecastDevicesAvailable: function() {\n this.show();\n },\n\n /**\n * Handles `chromecastDevicesUnavailable` player events.\n *\n * @private\n */\n _onChromecastDevicesUnavailable: function() {\n this.hide();\n },\n\n /**\n * Re-calculates which CSS classes the button needs and sets them on the buttons'\n * DOMElement.\n *\n * @private\n */\n _reloadCSSClasses: function() {\n if (!this.el_) {\n return;\n }\n this.el_.className = this.buildCSSClass();\n },\n};\n\n/**\n * Registers the ChromecastButton Component with Video.js. Calls\n * {@link http://docs.videojs.com/Component.html#.registerComponent}, which will add a\n * component called `chromecastButton` to the list of globally registered Video.js\n * components. The `chromecastButton` is added to the player's control bar UI\n * automatically once {@link module:enableChromecast} has been called. If you would like\n * to specify the order of the buttons that appear in the control bar, including this\n * button, you can do so in the options that you pass to the `videojs` function when\n * creating a player:\n *\n * ```\n * videojs('playerID', {\n * controlBar: {\n * children: [\n * 'playToggle',\n * 'progressControl',\n * 'volumePanel',\n * 'fullscreenToggle',\n * 'chromecastButton',\n * ],\n * }\n * });\n * ```\n *\n * @param videojs {object} A reference to {@link http://docs.videojs.com/module-videojs.html|Video.js}\n * @see http://docs.videojs.com/module-videojs.html#~registerPlugin\n */\nmodule.exports = function(videojs) {\n var ChromecastButtonImpl;\n\n ChromecastButtonImpl = videojs.extend(videojs.getComponent('Button'), ChromecastButton);\n videojs.registerComponent('chromecastButton', ChromecastButtonImpl);\n};\n\n\n/***/ }),\n/* 139 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar ChromecastSessionManager = __webpack_require__(60),\n ChromecastTechUI = __webpack_require__(140),\n SESSION_TIMEOUT = 10 * 1000, // milliseconds\n ChromecastTech;\n\n/**\n * @module ChomecastTech\n */\n\n/**\n * The Video.js Tech class is the base class for classes that provide media playback\n * technology implementations to Video.js such as HTML5, Flash and HLS.\n *\n * @external Tech\n * @see {@link http://docs.videojs.com/Tech.html|Tech}\n */\n\n/** @lends ChromecastTech.prototype */\nChromecastTech = {\n\n /**\n * Implements Video.js playback {@link http://docs.videojs.com/tutorial-tech_.html|Tech}\n * for {@link https://developers.google.com/cast/|Google's Chromecast}.\n *\n * @constructs ChromecastTech\n * @extends external:Tech\n * @param options {object} The options to use for configuration\n * @see {@link https://developers.google.com/cast/|Google Cast}\n */\n constructor: function(options) {\n var subclass;\n\n this._eventListeners = [];\n\n this.videojsPlayer = this.videojs(options.playerId);\n this._chromecastSessionManager = this.videojsPlayer.chromecastSessionManager;\n\n // We have to initialize the UI here, before calling super.constructor\n // because the constructor calls `createEl`, which references `this._ui`.\n this._ui = new ChromecastTechUI();\n this._ui.updatePoster(this.videojsPlayer.poster());\n\n // Call the super class' constructor function\n subclass = this.constructor.super_.apply(this, arguments);\n\n this._remotePlayer = this._chromecastSessionManager.getRemotePlayer();\n this._remotePlayerController = this._chromecastSessionManager.getRemotePlayerController();\n this._listenToPlayerControllerEvents();\n this.on('dispose', this._removeAllEventListeners.bind(this));\n\n this._hasPlayedAnyItem = false;\n this._requestTitle = options.requestTitleFn || function() { /* noop */ };\n this._requestSubtitle = options.requestSubtitleFn || function() { /* noop */ };\n this._requestCustomData = options.requestCustomDataFn || function() { /* noop */ };\n // See `currentTime` function\n this._initialStartTime = options.startTime || 0;\n\n this._playSource(options.source, this._initialStartTime);\n this.ready(function() {\n this.setMuted(options.muted);\n }.bind(this));\n\n return subclass;\n },\n\n /**\n * Creates a DOMElement that Video.js displays in its player UI while this Tech is\n * active.\n *\n * @returns {DOMElement}\n * @see {@link http://docs.videojs.com/Tech.html#createEl}\n */\n createEl: function() {\n return this._ui.getDOMElement();\n },\n\n /**\n * Resumes playback if a media item is paused or restarts an item from its beginning if\n * the item has played and ended.\n *\n * @see {@link http://docs.videojs.com/Player.html#play}\n */\n play: function() {\n if (!this.paused()) {\n return;\n }\n if (this.ended() && !this._isMediaLoading) {\n // Restart the current item from the beginning\n this._playSource({ src: this.videojsPlayer.src() }, 0);\n } else {\n this._remotePlayerController.playOrPause();\n }\n },\n\n /**\n * Pauses playback if the player is not already paused and if the current media item\n * has not ended yet.\n *\n * @see {@link http://docs.videojs.com/Player.html#pause}\n */\n pause: function() {\n if (!this.paused() && this._remotePlayer.canPause) {\n this._remotePlayerController.playOrPause();\n }\n },\n\n /**\n * Returns whether or not the player is \"paused\". Video.js' definition of \"paused\" is\n * \"playback paused\" OR \"not playing\".\n *\n * @returns {boolean} true if playback is paused\n * @see {@link http://docs.videojs.com/Player.html#paused}\n */\n paused: function() {\n return this._remotePlayer.isPaused || this.ended() || this._remotePlayer.playerState === null;\n },\n\n /**\n * Stores the given source and begins playback, starting at the beginning\n * of the media item.\n *\n * @param source {object} the source to store and play\n * @see {@link http://docs.videojs.com/Player.html#src}\n */\n setSource: function(source) {\n if (this._currentSource && this._currentSource.src === source.src && this._currentSource.type === source.type) {\n // Skip setting the source if the `source` argument is the same as what's already\n // been set. This `setSource` function calls `this._playSource` which sends a\n // \"load media\" request to the Chromecast PlayerController. Because this function\n // may be called multiple times in rapid succession with the same `source`\n // argument, we need to de-duplicate calls with the same `source` argument to\n // prevent overwhelming the Chromecast PlayerController with expensive \"load\n // media\" requests, which it itself does not de-duplicate.\n return;\n }\n // We cannot use `this.videojsPlayer.currentSource()` because the value returned by\n // that function is not the same as what's returned by the Video.js Player's\n // middleware after they are run. Also, simply using `this.videojsPlayer.src()`\n // does not include mimetype information which we pass to the Chromecast player.\n this._currentSource = source;\n this._playSource(source, 0);\n },\n\n /**\n * Plays the given source, beginning at an optional starting time.\n *\n * @private\n * @param source {object} the source to play\n * @param [startTime] The time to start playback at, in seconds\n * @see {@link http://docs.videojs.com/Player.html#src}\n */\n _playSource: function(source, startTime) {\n var castSession = this._getCastSession(),\n mediaInfo = new chrome.cast.media.MediaInfo(source.src, source.type),\n title = this._requestTitle(source),\n subtitle = this._requestSubtitle(source),\n customData = this._requestCustomData(source),\n request;\n\n this.trigger('waiting');\n this._clearSessionTimeout();\n\n mediaInfo.metadata = new chrome.cast.media.GenericMediaMetadata();\n mediaInfo.metadata.metadataType = chrome.cast.media.MetadataType.GENERIC;\n mediaInfo.metadata.title = title;\n mediaInfo.metadata.subtitle = subtitle;\n mediaInfo.streamType = this.videojsPlayer.liveTracker && this.videojsPlayer.liveTracker.isLive()\n ? chrome.cast.media.StreamType.LIVE\n : chrome.cast.media.StreamType.BUFFERED;\n\n if (customData) {\n mediaInfo.customData = customData;\n }\n\n this._ui.updateTitle(title);\n this._ui.updateSubtitle(subtitle);\n\n request = new chrome.cast.media.LoadRequest(mediaInfo);\n request.autoplay = true;\n request.currentTime = startTime;\n\n this._isMediaLoading = true;\n this._hasPlayedCurrentItem = false;\n castSession.loadMedia(request)\n .then(function() {\n if (!this._hasPlayedAnyItem) {\n // `triggerReady` is required here to notify the Video.js player that the\n // Tech has been initialized and is ready.\n this.triggerReady();\n }\n this.trigger('loadstart');\n this.trigger('loadeddata');\n this.trigger('play');\n this.trigger('playing');\n this._hasPlayedAnyItem = true;\n this._isMediaLoading = false;\n this._getMediaSession().addUpdateListener(this._onMediaSessionStatusChanged.bind(this));\n }.bind(this), this._triggerErrorEvent.bind(this));\n },\n\n /**\n * Manually updates the current time. The playback position will jump to the given time\n * and continue playing if the item was playing when `setCurrentTime` was called, or\n * remain paused if the item was paused.\n *\n * @param time {number} the playback time position to jump to\n * @see {@link http://docs.videojs.com/Tech.html#setCurrentTime}\n */\n setCurrentTime: function(time) {\n var duration = this.duration();\n\n if (time > duration || !this._remotePlayer.canSeek) {\n return;\n }\n // Seeking to any place within (approximately) 1 second of the end of the item\n // causes the Video.js player to get stuck in a BUFFERING state. To work around\n // this, we only allow seeking to within 1 second of the end of an item.\n this._remotePlayer.currentTime = Math.min(duration - 1, time);\n this._remotePlayerController.seek();\n this._triggerTimeUpdateEvent();\n },\n\n /**\n * Returns the current playback time position.\n *\n * @returns {number} the current playback time position\n * @see {@link http://docs.videojs.com/Player.html#currentTime}\n */\n currentTime: function() {\n // There is a brief period of time when Video.js has switched to the chromecast\n // Tech, but chromecast has not yet loaded its first media item. During that time,\n // Video.js calls this `currentTime` function to update its player UI. In that\n // period, `this._remotePlayer.currentTime` will be 0 because the media has not\n // loaded yet. To prevent the UI from using a 0 second currentTime, we use the\n // currentTime passed in to the first media item that was provided to the Tech until\n // chromecast plays its first item.\n if (!this._hasPlayedAnyItem) {\n return this._initialStartTime;\n }\n return this._remotePlayer.currentTime;\n },\n\n /**\n * Returns the duration of the current media item, or `0` if the source is not set or\n * if the duration of the item is not available from the Chromecast API yet.\n *\n * @returns {number} the duration of the current media item\n * @see {@link http://docs.videojs.com/Player.html#duration}\n */\n duration: function() {\n // There is a brief period of time when Video.js has switched to the chromecast\n // Tech, but chromecast has not yet loaded its first media item. During that time,\n // Video.js calls this `duration` function to update its player UI. In that period,\n // `this._remotePlayer.duration` will be 0 because the media has not loaded yet. To\n // prevent the UI from using a 0 second duration, we use the duration passed in to\n // the first media item that was provided to the Tech until chromecast plays its\n // first item.\n if (!this._hasPlayedAnyItem) {\n return this.videojsPlayer.duration();\n }\n return this._remotePlayer.duration;\n },\n\n /**\n * Returns whether or not the current media item has finished playing. Returns `false`\n * if a media item has not been loaded, has not been played, or has not yet finished\n * playing.\n *\n * @returns {boolean} true if the current media item has finished playing\n * @see {@link http://docs.videojs.com/Player.html#ended}\n */\n ended: function() {\n var mediaSession = this._getMediaSession();\n\n if (!mediaSession && this._hasMediaSessionEnded) {\n return true;\n }\n\n return mediaSession ? (mediaSession.idleReason === chrome.cast.media.IdleReason.FINISHED) : false;\n },\n\n /**\n * Returns the current volume level setting as a decimal number between `0` and `1`.\n *\n * @returns {number} the current volume level\n * @see {@link http://docs.videojs.com/Player.html#volume}\n */\n volume: function() {\n return this._remotePlayer.volumeLevel;\n },\n\n /**\n * Sets the current volume level. Volume level is a decimal number between `0` and `1`,\n * where `0` is muted and `1` is the loudest volume level.\n *\n * @param volumeLevel {number}\n * @returns {number} the current volume level\n * @see {@link http://docs.videojs.com/Player.html#volume}\n */\n setVolume: function(volumeLevel) {\n this._remotePlayer.volumeLevel = volumeLevel;\n this._remotePlayerController.setVolumeLevel();\n // This event is triggered by the listener on\n // `RemotePlayerEventType.VOLUME_LEVEL_CHANGED`, but waiting for that event to fire\n // in response to calls to `setVolume` introduces noticeable lag in the updating of\n // the player UI's volume slider bar, which makes user interaction with the volume\n // slider choppy.\n this._triggerVolumeChangeEvent();\n },\n\n /**\n * Returns whether or not the player is currently muted.\n *\n * @returns {boolean} true if the player is currently muted\n * @see {@link http://docs.videojs.com/Player.html#muted}\n */\n muted: function() {\n return this._remotePlayer.isMuted;\n },\n\n /**\n * Mutes or un-mutes the player. Does nothing if the player is currently muted and the\n * `isMuted` parameter is true or if the player is not muted and `isMuted` is false.\n *\n * @param isMuted {boolean} whether or not the player should be muted\n * @see {@link http://docs.videojs.com/Html5.html#setMuted} for an example\n */\n setMuted: function(isMuted) {\n if ((this._remotePlayer.isMuted && !isMuted) || (!this._remotePlayer.isMuted && isMuted)) {\n this._remotePlayerController.muteOrUnmute();\n }\n },\n\n /**\n * Gets the URL to the current poster image.\n *\n * @returns {string} URL to the current poster image or `undefined` if none exists\n * @see {@link http://docs.videojs.com/Player.html#poster}\n */\n poster: function() {\n return this._ui.getPoster();\n },\n\n /**\n * Sets the URL to the current poster image. The poster image shown in the Chromecast\n * Tech UI view is updated with this new URL.\n *\n * @param poster {string} the URL to the new poster image\n * @see {@link http://docs.videojs.com/Tech.html#setPoster}\n */\n setPoster: function(poster) {\n this._ui.updatePoster(poster);\n },\n\n /**\n * This function is \"required\" when implementing {@link external:Tech} and is supposed\n * to return a mock\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|TimeRanges}\n * object that represents the portions of the current media item that have been\n * buffered. However, the Chromecast API does not currently provide a way to determine\n * how much the media item has buffered, so we always return `undefined`.\n *\n * Returning `undefined` is safe: the player will simply not display the buffer amount\n * indicator in the scrubber UI.\n *\n * @returns {undefined} always returns `undefined`\n * @see {@link http://docs.videojs.com/Player.html#buffered}\n */\n buffered: function() {\n return undefined;\n },\n\n /**\n * This function is \"required\" when implementing {@link external:Tech} and is supposed\n * to return a mock\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|TimeRanges}\n * object that represents the portions of the current media item that has playable\n * content. However, the Chromecast API does not currently provide a way to determine\n * how much the media item has playable content, so we'll just assume the entire video\n * is an available seek target.\n *\n * The risk here lies with live streaming, where there may exist a sliding window of\n * playable content and seeking is only possible within the last X number of minutes,\n * rather than for the entire video.\n *\n * Unfortunately we have no way of detecting when this is the case. Returning anything\n * other than the full range of the video means that we lose the ability to seek during\n * VOD.\n *\n * @returns {TimeRanges} always returns a `TimeRanges` object with one `TimeRange` that\n * starts at `0` and ends at the `duration` of the current media item\n * @see {@link http://docs.videojs.com/Player.html#seekable}\n */\n seekable: function() {\n // TODO Investigate if there's a way to detect if the source is live, so that we can\n // possibly adjust the seekable `TimeRanges` accordingly.\n return this.videojs.createTimeRange(0, this.duration());\n },\n\n /**\n * Returns whether the native media controls should be shown (`true`) or hidden\n * (`false`). Not applicable to this Tech.\n *\n * @returns {boolean} always returns `false`\n * @see {@link http://docs.videojs.com/Html5.html#controls} for an example\n */\n controls: function() {\n return false;\n },\n\n /**\n * Returns whether or not the browser should show the player \"inline\" (non-fullscreen)\n * by default. This function always returns true to tell the browser that non-\n * fullscreen playback is preferred.\n *\n * @returns {boolean} always returns `true`\n * @see {@link http://docs.videojs.com/Html5.html#playsinline} for an example\n */\n playsinline: function() {\n return true;\n },\n\n /**\n * Returns whether or not fullscreen is supported by this Tech. Always returns `true`\n * because fullscreen is always supported.\n *\n * @returns {boolean} always returns `true`\n * @see {@link http://docs.videojs.com/Html5.html#supportsFullScreen} for an example\n */\n supportsFullScreen: function() {\n return true;\n },\n\n /**\n * Sets a flag that determines whether or not the media should automatically begin\n * playing on page load. This is not supported because a Chromecast session must be\n * initiated by casting via the casting menu and cannot autoplay.\n *\n * @see {@link http://docs.videojs.com/Html5.html#setAutoplay} for an example\n */\n setAutoplay: function() {\n // Not supported\n },\n\n /**\n * @returns {number} the chromecast player's playback rate, if available. Otherwise,\n * the return value defaults to `1`.\n */\n playbackRate: function() {\n var mediaSession = this._getMediaSession();\n\n return mediaSession ? mediaSession.playbackRate : 1;\n },\n\n /**\n * Does nothing. Changing the playback rate is not supported.\n */\n setPlaybackRate: function() {\n // Not supported\n },\n\n /**\n * Does nothing. Satisfies calls to the missing preload method.\n */\n preload: function() {\n // Not supported\n },\n\n /**\n * Causes the Tech to begin loading the current source. `load` is not supported in this\n * ChromecastTech because setting the source on the `Chromecast` automatically causes\n * it to begin loading.\n */\n load: function() {\n // Not supported\n },\n\n /**\n * Gets the Chromecast equivalent of HTML5 Media Element's `readyState`.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState\n */\n readyState: function() {\n if (this._remotePlayer.playerState === 'IDLE' || this._remotePlayer.playerState === 'BUFFERING') {\n return 0; // HAVE_NOTHING\n }\n return 4;\n },\n\n /**\n * Wires up event listeners for\n * [RemotePlayerController](https://developers.google.com/cast/docs/reference/chrome/cast.framework.RemotePlayerController)\n * events.\n *\n * @private\n */\n _listenToPlayerControllerEvents: function() {\n var eventTypes = cast.framework.RemotePlayerEventType;\n\n this._addEventListener(this._remotePlayerController, eventTypes.PLAYER_STATE_CHANGED, this._onPlayerStateChanged, this);\n this._addEventListener(this._remotePlayerController, eventTypes.VOLUME_LEVEL_CHANGED, this._triggerVolumeChangeEvent, this);\n this._addEventListener(this._remotePlayerController, eventTypes.IS_MUTED_CHANGED, this._triggerVolumeChangeEvent, this);\n this._addEventListener(this._remotePlayerController, eventTypes.CURRENT_TIME_CHANGED, this._triggerTimeUpdateEvent, this);\n this._addEventListener(this._remotePlayerController, eventTypes.DURATION_CHANGED, this._triggerDurationChangeEvent, this);\n },\n\n /**\n * Registers an event listener on the given target object. Because many objects in the\n * Chromecast API are either singletons or must be shared between instances of\n * `ChromecastTech` for the lifetime of the player, we must unbind the listeners when\n * this Tech instance is destroyed to prevent memory leaks. To do that, we need to keep\n * a reference to listeners that are added to global objects so that we can use those\n * references to remove the listener when this Tech is destroyed.\n *\n * @param target {object} the object to register the event listener on\n * @param type {string} the name of the event\n * @param callback {Function} the listener's callback function that executes when the\n * event is emitted\n * @param context {object} the `this` context to use when executing the `callback`\n * @private\n */\n _addEventListener: function(target, type, callback, context) {\n var listener;\n\n listener = {\n target: target,\n type: type,\n callback: callback,\n context: context,\n listener: callback.bind(context),\n };\n target.addEventListener(type, listener.listener);\n this._eventListeners.push(listener);\n },\n\n /**\n * Removes all event listeners that were registered with global objects during the\n * lifetime of this Tech. See {@link _addEventListener} for more information about why\n * this is necessary.\n *\n * @private\n */\n _removeAllEventListeners: function() {\n while (this._eventListeners.length > 0) {\n this._removeEventListener(this._eventListeners[0]);\n }\n this._eventListeners = [];\n },\n\n /**\n * Removes a single event listener that was registered with global objects during the\n * lifetime of this Tech. See {@link _addEventListener} for more information about why\n * this is necessary.\n *\n * @private\n */\n _removeEventListener: function(listener) {\n var index = -1,\n pass = false,\n i;\n\n listener.target.removeEventListener(listener.type, listener.listener);\n\n for (i = 0; i < this._eventListeners.length; i++) {\n pass = this._eventListeners[i].target === listener.target &&\n this._eventListeners[i].type === listener.type &&\n this._eventListeners[i].callback === listener.callback &&\n this._eventListeners[i].context === listener.context;\n\n if (pass) {\n index = i;\n break;\n }\n }\n\n if (index !== -1) {\n this._eventListeners.splice(index, 1);\n }\n },\n\n /**\n * Handles Chromecast player state change events. The player may \"change state\" when\n * paused, played, buffering, etc.\n *\n * @private\n */\n _onPlayerStateChanged: function() {\n var states = chrome.cast.media.PlayerState,\n playerState = this._remotePlayer.playerState;\n\n if (playerState === states.PLAYING) {\n this._hasPlayedCurrentItem = true;\n this.trigger('play');\n this.trigger('playing');\n } else if (playerState === states.PAUSED) {\n this.trigger('pause');\n } else if ((playerState === states.IDLE && this.ended()) || (playerState === null && this._hasPlayedCurrentItem)) {\n this._hasPlayedCurrentItem = false;\n this._closeSessionOnTimeout();\n this.trigger('ended');\n this._triggerTimeUpdateEvent();\n } else if (playerState === states.BUFFERING) {\n this.trigger('waiting');\n }\n },\n\n /**\n * Handles Chromecast MediaSession state change events. The only property sent to this\n * event is whether the session is alive. This is useful for determining if an item has\n * ended as the MediaSession will fire this event with `false` then be immediately\n * destroyed. This means that we cannot trust `idleReason` to show whether an item has\n * ended since we may no longer have access to the MediaSession.\n *\n * @private\n */\n _onMediaSessionStatusChanged: function(isAlive) {\n this._hasMediaSessionEnded = !!isAlive;\n },\n\n /**\n * Ends the session after a certain number of seconds of inactivity.\n *\n * If the Chromecast player is in the \"IDLE\" state after an item has ended, and no\n * further items are queued up to play, the session is considered inactive. Once a\n * period of time (currently 10 seconds) has elapsed with no activity, we manually end\n * the session to prevent long periods of a blank Chromecast screen that is shown at\n * the end of item playback.\n *\n * @private\n */\n _closeSessionOnTimeout: function() {\n // Ensure that there's never more than one session timeout active\n this._clearSessionTimeout();\n this._sessionTimeoutID = setTimeout(function() {\n var castSession = this._getCastSession();\n\n if (castSession) {\n castSession.endSession(true);\n }\n this._clearSessionTimeout();\n }.bind(this), SESSION_TIMEOUT);\n },\n\n /**\n * Stops the timeout that is waiting during a period of inactivity in order to close\n * the session.\n *\n * @private\n * @see _closeSessionOnTimeout\n */\n _clearSessionTimeout: function() {\n if (this._sessionTimeoutID) {\n clearTimeout(this._sessionTimeoutID);\n this._sessionTimeoutID = false;\n }\n },\n\n /**\n * @private\n * @return {object} the current CastContext, if one exists\n */\n _getCastContext: function() {\n return this._chromecastSessionManager.getCastContext();\n },\n\n /**\n * @private\n * @return {object} the current CastSession, if one exists\n */\n _getCastSession: function() {\n return this._getCastContext().getCurrentSession();\n },\n\n /**\n * @private\n * @return {object} the current MediaSession, if one exists\n * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Media\n */\n _getMediaSession: function() {\n var castSession = this._getCastSession();\n\n return castSession ? castSession.getMediaSession() : null;\n },\n\n /**\n * Triggers a 'volumechange' event\n * @private\n * @see http://docs.videojs.com/Player.html#event:volumechange\n */\n _triggerVolumeChangeEvent: function() {\n this.trigger('volumechange');\n },\n\n /**\n * Triggers a 'timeupdate' event\n * @private\n * @see http://docs.videojs.com/Player.html#event:timeupdate\n */\n _triggerTimeUpdateEvent: function() {\n this.trigger('timeupdate');\n },\n\n /**\n * Triggers a 'durationchange' event\n * @private\n * @see http://docs.videojs.com/Player.html#event:durationchange\n */\n _triggerDurationChangeEvent: function() {\n this.trigger('durationchange');\n },\n\n /**\n * Triggers an 'error' event\n * @private\n * @see http://docs.videojs.com/Player.html#event:error\n */\n _triggerErrorEvent: function() {\n this.trigger('error');\n },\n};\n\n/**\n * Registers the ChromecastTech Tech with Video.js. Calls {@link\n * http://docs.videojs.com/Tech.html#.registerTech}, which will add a Tech called\n * `chromecast` to the list of globally registered Video.js Tech implementations.\n *\n * [Video.js Tech](http://docs.videojs.com/Tech.html) are initialized and used\n * automatically by Video.js Player instances. Whenever a new source is set on the player,\n * the player iterates through the list of available Tech to determine which to use to\n * play the source.\n *\n * @param videojs {object} A reference to\n * {@link http://docs.videojs.com/module-videojs.html|Video.js}\n * @see http://docs.videojs.com/Tech.html#.registerTech\n */\nmodule.exports = function(videojs) {\n var Tech = videojs.getComponent('Tech'),\n ChromecastTechImpl;\n\n ChromecastTechImpl = videojs.extend(Tech, ChromecastTech);\n\n // Required for Video.js Tech implementations.\n // TODO Consider a more comprehensive check based on mimetype.\n ChromecastTechImpl.canPlaySource = ChromecastSessionManager.isChromecastConnected.bind(ChromecastSessionManager);\n ChromecastTechImpl.isSupported = ChromecastSessionManager.isChromecastConnected.bind(ChromecastSessionManager);\n\n ChromecastTechImpl.prototype.featuresVolumeControl = true;\n ChromecastTechImpl.prototype.featuresPlaybackRate = false;\n ChromecastTechImpl.prototype.movingMediaElementInDOM = false;\n ChromecastTechImpl.prototype.featuresFullscreenResize = true;\n ChromecastTechImpl.prototype.featuresTimeupdateEvents = true;\n ChromecastTechImpl.prototype.featuresProgressEvents = false;\n // Text tracks are not supported in this version\n ChromecastTechImpl.prototype.featuresNativeTextTracks = false;\n ChromecastTechImpl.prototype.featuresNativeAudioTracks = false;\n ChromecastTechImpl.prototype.featuresNativeVideoTracks = false;\n\n // Give ChromecastTech class instances a reference to videojs\n ChromecastTechImpl.prototype.videojs = videojs;\n\n videojs.registerTech('chromecast', ChromecastTechImpl);\n};\n\n\n/***/ }),\n/* 140 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar Class = __webpack_require__(61),\n ChromecastTechUI;\n\n/**\n * This class represents the UI that is shown in the player while the Chromecast Tech is\n * active. The UI has a single root DOM element that displays the poster image of the\n * current item and title and subtitle. This class receives updates to the poster, title\n * and subtitle when the media item that the player is playing changes.\n *\n * @class ChromecastTechUI\n */\nChromecastTechUI = Class.extend(/** @lends ChromecastTechUI.prototype */ {\n init: function() {\n this._el = this._createDOMElement();\n },\n\n /**\n * Creates and returns a single DOMElement that contains the UI. This implementation\n * of the Chromecast Tech's UI displays a poster image, a title and a subtitle.\n *\n * @private\n * @returns {DOMElement}\n */\n _createDOMElement: function() {\n var el = this._createElement('div', 'vjs-tech vjs-tech-chromecast'),\n posterContainerEl = this._createElement('div', 'vjs-tech-chromecast-poster'),\n posterImageEl = this._createElement('img', 'vjs-tech-chromecast-poster-img'),\n titleEl = this._createElement('div', 'vjs-tech-chromecast-title'),\n subtitleEl = this._createElement('div', 'vjs-tech-chromecast-subtitle'),\n titleContainer = this._createElement('div', 'vjs-tech-chromecast-title-container');\n\n posterContainerEl.appendChild(posterImageEl);\n titleContainer.appendChild(titleEl);\n titleContainer.appendChild(subtitleEl);\n\n el.appendChild(titleContainer);\n el.appendChild(posterContainerEl);\n\n return el;\n },\n\n /**\n * A helper method for creating DOMElements of the given type and with the given class\n * name(s).\n *\n * @param type {string} the kind of DOMElement to create (ex: 'div')\n * @param className {string} the class name(s) to give to the DOMElement. May also be\n * a space-delimited list of class names.\n * @returns {DOMElement}\n */\n _createElement: function(type, className) {\n var el = document.createElement(type);\n\n el.className = className;\n return el;\n },\n\n /**\n * Gets the root DOMElement to be shown in the player's UI.\n *\n * @returns {DOMElement}\n */\n getDOMElement: function() {\n return this._el;\n },\n\n /**\n * Finds the poster's DOMElement in the root UI element.\n *\n * @private\n * @returns {DOMElement}\n */\n _findPosterEl: function() {\n return this._el.querySelector('.vjs-tech-chromecast-poster');\n },\n\n /**\n * Finds the poster's <img> DOMElement in the root UI element.\n *\n * @private\n * @returns {DOMElement}\n */\n _findPosterImageEl: function() {\n return this._el.querySelector('.vjs-tech-chromecast-poster-img');\n },\n\n /**\n * Finds the title's DOMElement in the root UI element.\n *\n * @private\n * @returns {DOMElement}\n */\n _findTitleEl: function() {\n return this._el.querySelector('.vjs-tech-chromecast-title');\n },\n\n /**\n * Finds the subtitle's DOMElement in the root UI element.\n *\n * @private\n * @returns {DOMElement}\n */\n _findSubtitleEl: function() {\n return this._el.querySelector('.vjs-tech-chromecast-subtitle');\n },\n\n /**\n * Sets the current poster image URL and updates the poster image DOMElement with the\n * new poster image URL.\n *\n * @param poster {string} a URL for a poster image\n */\n updatePoster: function(poster) {\n var posterImageEl = this._findPosterImageEl();\n\n this._poster = poster ? poster : null;\n if (poster) {\n posterImageEl.setAttribute('src', poster);\n posterImageEl.classList.remove('vjs-tech-chromecast-poster-img-empty');\n } else {\n posterImageEl.removeAttribute('src');\n posterImageEl.classList.add('vjs-tech-chromecast-poster-img-empty');\n }\n },\n\n /**\n * Gets the current poster image URL.\n *\n * @returns {string} the URL for th current poster image\n */\n getPoster: function() {\n return this._poster;\n },\n\n /**\n * Sets the current title and updates the title's DOMElement with the new text.\n *\n * @param title {string} a title to show\n */\n updateTitle: function(title) {\n var titleEl = this._findTitleEl();\n\n this._title = title;\n if (title) {\n titleEl.innerHTML = title;\n titleEl.classList.remove('vjs-tech-chromecast-title-empty');\n } else {\n titleEl.classList.add('vjs-tech-chromecast-title-empty');\n }\n },\n\n /**\n * Sets the current subtitle and updates the subtitle's DOMElement with the new text.\n *\n * @param subtitle {string} a subtitle to show\n */\n updateSubtitle: function(subtitle) {\n var subtitleEl = this._findSubtitleEl();\n\n this._subtitle = subtitle;\n if (subtitle) {\n subtitleEl.innerHTML = subtitle;\n subtitleEl.classList.remove('vjs-tech-chromecast-subtitle-empty');\n } else {\n subtitleEl.classList.add('vjs-tech-chromecast-subtitle-empty');\n }\n },\n});\n\nmodule.exports = ChromecastTechUI;\n\n\n/***/ }),\n/* 141 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * @module enableChromecast\n */\n\nvar ChromecastSessionManager = __webpack_require__(60),\n CHECK_AVAILABILITY_INTERVAL = 1000, // milliseconds\n CHECK_AVAILABILITY_TIMEOUT = 30 * 1000; // milliseconds\n\n\n/**\n * Configures the Chromecast\n * [casting context](https://developers.google.com/cast/docs/reference/chrome/cast.framework.CastContext),\n * which is required before casting.\n *\n * @private\n * @param options {object} the plugin options\n */\nfunction configureCastContext(options) {\n var context = cast.framework.CastContext.getInstance();\n\n context.setOptions({\n receiverApplicationId: options.receiverAppID || chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,\n // Setting autoJoinPolicy to ORIGIN_SCOPED prevents this plugin from automatically\n // trying to connect to a preexisting Chromecast session, if one exists. The user\n // must end any existing session before trying to cast from this player instance.\n autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,\n });\n}\n\n/**\n * Handles the `chromecastRequested` event. Delegates to a `chromecastSessionManager`\n * instance.\n *\n * @private\n * @param player {object} a Video.js player instance\n */\nfunction onChromecastRequested(player) {\n player.chromecastSessionManager.openCastMenu();\n}\n\n/**\n * Adds the Chromecast button to the player's control bar, if one does not already exist,\n * then starts listening for the `chromecastRequested` event.\n *\n * @private\n * @param player {object} a Video.js player instance\n * @param options {object} the plugin options\n */\nfunction setUpChromecastButton(player, options) {\n var indexOpt;\n\n // Ensure Chromecast button exists\n if (options.addButtonToControlBar && !player.controlBar.getChild('chromecastButton')) {\n // Figure out Chromecast button's index\n indexOpt = player.controlBar.children().length;\n if (typeof options.buttonPositionIndex !== 'undefined') {\n indexOpt = options.buttonPositionIndex >= 0\n ? options.buttonPositionIndex\n : player.controlBar.children().length + options.buttonPositionIndex;\n }\n player.controlBar.addChild('chromecastButton', options, indexOpt);\n }\n // Respond to requests for casting. The ChromecastButton component triggers this event\n // when the user clicks the Chromecast button.\n player.on('chromecastRequested', onChromecastRequested.bind(null, player));\n}\n\n/**\n * Creates a {@link ChromecastSessionManager} and assigns it to the player.\n *\n * @private\n * @param player {object} a Video.js player instance\n */\nfunction createSessionManager(player) {\n if (!player.chromecastSessionManager) {\n player.chromecastSessionManager = new ChromecastSessionManager(player);\n }\n}\n\n/**\n * Sets up and configures the casting context and Chromecast button.\n *\n * @private\n * @param options {object} the plugin options\n */\nfunction enableChromecast(player, options) {\n configureCastContext(options);\n createSessionManager(player);\n setUpChromecastButton(player, options);\n}\n\n/**\n * Waits for the Chromecast APIs to become available, then configures the casting context\n * and configures the Chromecast button. The Chromecast APIs are loaded asynchronously,\n * so we must wait until they are available before initializing the casting context and\n * Chromecast button.\n *\n * @private\n * @param player {object} a Video.js player instance\n * @param options {object} the plugin options\n */\nfunction waitUntilChromecastAPIsAreAvailable(player, options) {\n var maxTries = CHECK_AVAILABILITY_TIMEOUT / CHECK_AVAILABILITY_INTERVAL,\n tries = 1,\n intervalID;\n\n // The Chromecast APIs are loaded asynchronously, so they may not be loaded and\n // initialized at this point. The Chromecast APIs do provide a callback function that\n // is called after the framework has loaded, but it requires you to define the callback\n // function **before** loading the APIs. That would require us to expose some callback\n // function to `window` here, and would require users of this plugin to define a\n // Chromecast API callback on `window` that calls our callback function in their HTML\n // file. To avoid all of this, we simply check to see if the Chromecast API is\n // available periodically, and stop after a timeout threshold has passed.\n //\n // See https://developers.google.com/cast/docs/chrome_sender_integrate#initialization\n intervalID = setInterval(function() {\n if (tries > maxTries) {\n clearInterval(intervalID);\n return;\n }\n if (ChromecastSessionManager.isChromecastAPIAvailable()) {\n clearInterval(intervalID);\n enableChromecast(player, options);\n }\n tries = tries + 1;\n }, CHECK_AVAILABILITY_INTERVAL);\n\n}\n\n/**\n * Registers the Chromecast plugin with Video.js. Calls\n * [videojs#registerPlugin](http://docs.videojs.com/module-videojs.html#~registerPlugin),\n * which will add a plugin function called `chromecast` to any instance of a Video.js\n * player that is created after calling this function. Call `player.chromecast(options)`,\n * passing in configuration options, to enable the Chromecast plugin on your Player\n * instance.\n *\n * Currently, there are only two configuration options:\n *\n * * **`receiverAppID`** - the string ID of a [Chromecast receiver\n * app](https://developers.google.com/cast/docs/receiver_apps) to use. Defaults to\n * the [default Media Receiver\n * ID](https://developers.google.com/cast/docs/receiver_apps#default).\n * * **`addButtonToControlBar`** - flag that tells the plugin\n * whether or not it should automatically add the Chromecast button the the Video.js\n * player's control bar component. Defaults to `true`.\n *\n * Other configuration options are set through the player's Chromecast Tech configuration:\n *\n * ```\n * var playerOptions, player, pluginOptions;\n *\n * playerOptions = {\n * chromecast: {\n * requestTitleFn: function(source) {\n * return titles[source.url];\n * },\n * requestSubtitleFn: function(source) {\n * return subtitles[source.url];\n * },\n * requestCustomDataFn: function(source) {\n * return customData[source.url];\n * }\n * }\n * };\n *\n * pluginOptions = {\n * receiverAppID: '1234',\n * addButtonToControlBar: false,\n * };\n *\n * player = videojs(document.getElementById('myVideoElement'), playerOptions);\n * player.chromecast(pluginOptions); // initializes the Chromecast plugin\n * ```\n *\n * @param {object} videojs\n * @see http://docs.videojs.com/module-videojs.html#~registerPlugin\n */\nmodule.exports = function(videojs) {\n videojs.registerPlugin('chromecast', function(options) {\n var pluginOptions = Object.assign({ addButtonToControlBar: true }, options || {});\n\n // `this` is an instance of a Video.js Player.\n // Wait until the player is \"ready\" so that the player's control bar component has\n // been created.\n this.ready(function() {\n if (!this.controlBar) {\n return;\n }\n if (ChromecastSessionManager.isChromecastAPIAvailable()) {\n enableChromecast(this, pluginOptions);\n } else {\n waitUntilChromecastAPIsAreAvailable(this, pluginOptions);\n }\n }.bind(this));\n });\n};\n\n\n/***/ }),\n/* 142 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar createAirPlayButton = __webpack_require__(143),\n createAirPlayPlugin = __webpack_require__(144);\n\n/**\n * @module index\n */\n\n/**\n * Registers the AirPlay plugin and AirPlayButton Component with Video.js. See\n * {@link module:AirPlayButton} and {@link module:enableAirPlay} for more details about\n * how the plugin and button are registered and configured.\n *\n * @param {object} videojs\n * @see module:enableAirPlay\n * @see module:AirPlayButton\n */\nmodule.exports = function(videojs) {\n videojs = videojs || window.videojs;\n createAirPlayButton(videojs);\n createAirPlayPlugin(videojs);\n};\n\n\n/***/ }),\n/* 143 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * The AirPlayButton module contains both the AirPlayButton class definition and the\n * function used to register the button as a Video.js Component.\n *\n * @module AirPlayButton\n */\n\nvar hasAirPlayAPISupport = __webpack_require__(62),\n AirPlayButton;\n\n/**\n* The Video.js Button class is the base class for UI button components.\n*\n* @external Button\n* @see {@link http://docs.videojs.com/Button.html|Button}\n*/\n\n/** @lends AirPlayButton.prototype */\nAirPlayButton = {\n\n /**\n * This class is a button component designed to be displayed in the player UI's control\n * bar. It displays an Apple AirPlay selection list when clicked.\n *\n * @constructs\n * @extends external:Button\n */\n constructor: function() {\n this.constructor.super_.apply(this, arguments);\n\n if (!hasAirPlayAPISupport()) {\n this.hide();\n }\n\n this.controlText('Start AirPlay');\n this._reactToAirPlayAvailableEvents();\n },\n\n /**\n * Overrides Button#buildCSSClass to return the classes used on the button element.\n *\n * @param {DOMElement} el\n * @see {@link http://docs.videojs.com/Button.html#buildCSSClass|Button#buildCSSClass}\n */\n buildCSSClass: function() {\n return 'vjs-airplay-button ' + this.constructor.super_.prototype.buildCSSClass();\n },\n\n /**\n * Overrides Button#handleClick to handle button click events. AirPlay functionality is\n * handled outside of this class, which should be limited to UI related logic. This\n * function simply triggers an event on the player.\n *\n * @fires AirPlayButton#airPlayRequested\n * @param {DOMElement} el\n * @see {@link http://docs.videojs.com/Button.html#handleClick|Button#handleClick}\n */\n handleClick: function() {\n this.player().trigger('airPlayRequested');\n },\n\n /**\n * Gets the underlying DOMElement used by the player.\n *\n * @private\n * @returns {DOMElement} either an <audio> or <video> tag, depending on the type of\n * player\n */\n _getMediaEl: function() {\n var playerEl = this.player().el();\n\n return playerEl.querySelector('video, audio');\n },\n\n /**\n * Binds a listener to the `webkitplaybacktargetavailabilitychanged` event, if it is\n * supported, that will show or hide this button Component based on the availability\n * of the AirPlay function.\n *\n * @private\n */\n _reactToAirPlayAvailableEvents: function() {\n var mediaEl = this._getMediaEl(),\n self = this;\n\n if (!mediaEl || !hasAirPlayAPISupport()) {\n return;\n }\n\n mediaEl.addEventListener('webkitplaybacktargetavailabilitychanged', function(event) {\n if (event.availability === 'available') {\n self.show();\n } else {\n self.hide();\n }\n });\n },\n};\n\n/**\n * Registers the AirPlayButton Component with Video.js. Calls\n * {@link http://docs.videojs.com/Component.html#.registerComponent}, which will add a\n * component called `airPlayButton` to the list of globally registered Video.js\n * components. The `airPlayButton` is added to the player's control bar UI automatically\n * once {@link module:enableAirPlay} has been called. If you would like to specify the\n * order of the buttons that appear in the control bar, including this button, you can do\n * so in the options that you pass to the `videojs` function when creating a player:\n *\n * ```\n * videojs('playerID', {\n * controlBar: {\n * children: [\n * 'playToggle',\n * 'progressControl',\n * 'volumePanel',\n * 'fullscreenToggle',\n * 'airPlayButton',\n * ],\n * }\n * });\n * ```\n *\n * @param videojs {object} A reference to {@link http://docs.videojs.com/module-videojs.html|Video.js}\n * @see http://docs.videojs.com/module-videojs.html#~registerPlugin\n */\nmodule.exports = function(videojs) {\n var AirPlayButtonImpl;\n\n AirPlayButtonImpl = videojs.extend(videojs.getComponent('Button'), AirPlayButton);\n videojs.registerComponent('airPlayButton', AirPlayButtonImpl);\n};\n\n\n/***/ }),\n/* 144 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * @module enableAirPlay\n */\n\nvar hasAirPlayAPISupport = __webpack_require__(62);\n\n/**\n * @private\n * @param {object} the Video.js Player instance\n * @returns {AirPlayButton} or `undefined` if it does not exist\n */\nfunction getExistingAirPlayButton(player) {\n return player.controlBar.getChild('airPlayButton');\n}\n\n/**\n * Adds the AirPlayButton Component to the player's ControlBar component, if the\n * AirPlayButton does not already exist in the ControlBar.\n * @private\n * @param player {object} the Video.js Player instance\n * @param options {object}\n */\nfunction ensureAirPlayButtonExists(player, options) {\n var existingAirPlayButton = getExistingAirPlayButton(player),\n indexOpt;\n\n if (options.addButtonToControlBar && !existingAirPlayButton) {\n // Figure out AirPlay button's index\n indexOpt = player.controlBar.children().length;\n if (typeof options.buttonPositionIndex !== 'undefined') {\n indexOpt = options.buttonPositionIndex >= 0\n ? options.buttonPositionIndex\n : player.controlBar.children().length + options.buttonPositionIndex;\n }\n\n player.controlBar.addChild('airPlayButton', options, indexOpt);\n }\n}\n\n/**\n * Handles requests for AirPlay triggered by the AirPlayButton Component.\n *\n * @private\n * @param player {object} the Video.js Player instance\n */\nfunction onAirPlayRequested(player) {\n var mediaEl = player.el().querySelector('video, audio');\n\n if (mediaEl && mediaEl.webkitShowPlaybackTargetPicker) {\n mediaEl.webkitShowPlaybackTargetPicker();\n }\n}\n\n/**\n * Adds an event listener for the `airPlayRequested` event triggered by the AirPlayButton\n * Component.\n *\n * @private\n * @param player {object} the Video.js Player instance\n */\nfunction listenForAirPlayEvents(player) {\n // Respond to requests for AirPlay. The AirPlayButton component triggers this event\n // when the user clicks the AirPlay button.\n player.on('airPlayRequested', onAirPlayRequested.bind(null, player));\n}\n\n/**\n * Sets up the AirPlay plugin.\n *\n * @private\n * @param player {object} the Video.js player\n * @param options {object} the plugin options\n */\nfunction enableAirPlay(player, options) {\n if (!player.controlBar) {\n return;\n }\n\n if (hasAirPlayAPISupport()) {\n listenForAirPlayEvents(player);\n ensureAirPlayButtonExists(player, options);\n }\n}\n\n/**\n * Registers the AirPlay plugin with Video.js. Calls\n * {@link http://docs.videojs.com/module-videojs.html#~registerPlugin|videojs#registerPlugin},\n * which will add a plugin function called `airPlay` to any instance of a Video.js player\n * that is created after calling this function. Call `player.airPlay(options)`, passing in\n * configuration options, to enable the AirPlay plugin on your Player instance.\n *\n * Currently, the only configuration option is:\n *\n * * **buttonText** - the text to display inside of the button component. By default,\n * this text is hidden and is used for accessibility purposes.\n *\n * @param {object} videojs\n * @see http://docs.videojs.com/module-videojs.html#~registerPlugin\n */\nmodule.exports = function(videojs) {\n videojs.registerPlugin('airPlay', function(options) {\n var pluginOptions = Object.assign({ addButtonToControlBar: true }, options || {});\n\n // `this` is an instance of a Video.js Player.\n // Wait until the player is \"ready\" so that the player's control bar component has\n // been created.\n this.ready(enableAirPlay.bind(this, this, pluginOptions));\n });\n};\n\n\n/***/ }),\n/* 145 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, \"VideoPlayer\", function() { return /* binding */ VideoPlayer; });\n\n// EXTERNAL MODULE: external \"react\"\nvar external_react_ = __webpack_require__(6);\nvar external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/prop-types/index.js\nvar prop_types = __webpack_require__(3);\nvar prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/uuid/v4.js\nvar v4 = __webpack_require__(63);\nvar v4_default = /*#__PURE__*/__webpack_require__.n(v4);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/lodash.isequal/index.js\nvar lodash_isequal = __webpack_require__(64);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/core-js/core/string.js\nvar string = __webpack_require__(78);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/core-js/es6/map.js\nvar map = __webpack_require__(82);\n\n// CONCATENATED MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/can-autoplay/build/can-autoplay.es.js\n/* global Blob */\n// This file is generated. Do not edit this file directly.\n// Command: 'npm run generate' should be used to update the content.\n\n/**\n * @type {Blob}\n */\nvar AUDIO = typeof window !== 'undefined' ? new Blob([new Uint8Array([255, 227, 24, 196, 0, 0, 0, 3, 72, 1, 64, 0, 0, 4, 132, 16, 31, 227, 192, 225, 76, 255, 67, 12, 255, 221, 27, 255, 228, 97, 73, 63, 255, 195, 131, 69, 192, 232, 223, 255, 255, 207, 102, 239, 255, 255, 255, 101, 158, 206, 70, 20, 59, 255, 254, 95, 70, 149, 66, 4, 16, 128, 0, 2, 2, 32, 240, 138, 255, 36, 106, 183, 255, 227, 24, 196, 59, 11, 34, 62, 80, 49, 135, 40, 0, 253, 29, 191, 209, 200, 141, 71, 7, 255, 252, 152, 74, 15, 130, 33, 185, 6, 63, 255, 252, 195, 70, 203, 86, 53, 15, 255, 255, 247, 103, 76, 121, 64, 32, 47, 255, 34, 227, 194, 209, 138, 76, 65, 77, 69, 51, 46, 57, 55, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 255, 227, 24, 196, 73, 13, 153, 210, 100, 81, 135, 56, 0, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170])], { type: 'audio/mpeg' }) : undefined;\n\n/**\n * @type {Blob}\n */\nvar VIDEO = typeof window !== 'undefined' ? new Blob([new Uint8Array([0, 0, 0, 28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, 0, 0, 47, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 100, 109, 100, 105, 97, 0, 0, 0, 32, 109, 100, 104, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 68, 0, 0, 8, 0, 85, 196, 0, 0, 0, 0, 0, 45, 104, 100, 108, 114, 0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110, 100, 108, 101, 114, 0, 0, 0, 1, 15, 109, 105, 110, 102, 0, 0, 0, 16, 115, 109, 104, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 100, 105, 110, 102, 0, 0, 0, 28, 100, 114, 101, 102, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0, 0, 0, 1, 0, 0, 0, 211, 115, 116, 98, 108, 0, 0, 0, 103, 115, 116, 115, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 87, 109, 112, 52, 97, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 16, 0, 0, 0, 0, 172, 68, 0, 0, 0, 0, 0, 51, 101, 115, 100, 115, 0, 0, 0, 0, 3, 128, 128, 128, 34, 0, 2, 0, 4, 128, 128, 128, 20, 64, 21, 0, 0, 0, 0, 1, 244, 0, 0, 1, 243, 249, 5, 128, 128, 128, 2, 18, 16, 6, 128, 128, 128, 1, 2, 0, 0, 0, 24, 115, 116, 116, 115, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 4, 0, 0, 0, 0, 28, 115, 116, 115, 99, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 28, 115, 116, 115, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 1, 115, 0, 0, 1, 116, 0, 0, 0, 20, 115, 116, 99, 111, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 44, 0, 0, 0, 98, 117, 100, 116, 97, 0, 0, 0, 90, 109, 101, 116, 97, 0, 0, 0, 0, 0, 0, 0, 33, 104, 100, 108, 114, 0, 0, 0, 0, 0, 0, 0, 0, 109, 100, 105, 114, 97, 112, 112, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 105, 108, 115, 116, 0, 0, 0, 37, 169, 116, 111, 111, 0, 0, 0, 29, 100, 97, 116, 97, 0, 0, 0, 1, 0, 0, 0, 0, 76, 97, 118, 102, 53, 54, 46, 52, 48, 46, 49, 48, 49])], { type: 'video/mp4' }) : undefined;\n\n/* global URL */\nfunction setupDefaultValues(options) {\n return Object.assign({\n muted: false,\n timeout: 250,\n inline: false\n }, options);\n}\n\nfunction startPlayback(_ref, elementCallback) {\n var muted = _ref.muted,\n timeout = _ref.timeout,\n inline = _ref.inline;\n\n var _elementCallback = elementCallback(),\n element = _elementCallback.element,\n source = _elementCallback.source;\n\n var playResult = void 0;\n var timeoutId = void 0;\n var sendOutput = void 0;\n\n element.muted = muted;\n if (muted === true) {\n element.setAttribute('muted', 'muted');\n }\n // indicates that the video is to be played \"inline\",\n // that is within the element's playback area.\n if (inline === true) {\n element.setAttribute('playsinline', 'playsinline');\n }\n\n element.src = source;\n\n return new Promise(function (resolve) {\n playResult = element.play();\n timeoutId = setTimeout(function () {\n sendOutput(false, new Error('Timeout ' + timeout + ' ms has been reached'));\n }, timeout);\n sendOutput = function sendOutput(result) {\n var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n clearTimeout(timeoutId);\n resolve({ result: result, error: error });\n };\n\n if (playResult !== undefined) {\n playResult.then(function () {\n return sendOutput(true);\n }).catch(function (playError) {\n return sendOutput(false, playError);\n });\n } else {\n sendOutput(true);\n }\n });\n}\n\n//\n// API\n//\n\nfunction video(options) {\n if (typeof window === 'undefined') {\n return Promise.resolve({ result: false, error: new Error('Playback is impossible during SSR') });\n }\n options = setupDefaultValues(options);\n return startPlayback(options, function () {\n return {\n element: document.createElement('video'),\n source: URL.createObjectURL(VIDEO)\n };\n });\n}\n\nfunction audio(options) {\n if (typeof window === 'undefined') {\n return Promise.resolve({ result: false, error: new Error('Playback is impossible during SSR') });\n }\n options = setupDefaultValues(options);\n return startPlayback(options, function () {\n return {\n element: document.createElement('audio'),\n source: URL.createObjectURL(AUDIO)\n };\n });\n}\n\nvar index = { audio: audio, video: video };\n\n/* harmony default export */ var can_autoplay_es = (index);\n\n// CONCATENATED MODULE: ./src/debug-overlay.jsx\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar debug_overlay_DebugOverlay =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(DebugOverlay, _Component);\n\n function DebugOverlay() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, DebugOverlay);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(DebugOverlay)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"dismiss\", function (e) {\n if (_this.props.onDismiss) {\n _this.props.onDismiss(e);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n e.preventDefault();\n e.stopPropagation();\n });\n\n return _this;\n }\n\n _createClass(DebugOverlay, [{\n key: \"render\",\n value: function render() {\n if (!this.props.debugInfo) {\n return null;\n }\n\n var _this$props$debugInfo = this.props.debugInfo,\n currentSource = _this$props$debugInfo.currentSource,\n qualityLevels = _this$props$debugInfo.qualityLevels,\n stats = _this$props$debugInfo.stats;\n var selectedQualityLevel = qualityLevels.selectedIndex !== -1 && qualityLevels.levels[qualityLevels.selectedIndex];\n var textLines = [\"Source: \".concat(currentSource && currentSource.src), 'QualityLevels:'].concat(_toConsumableArray(qualityLevels.levels.sort(sortQualityLevels).map(function (x) {\n return \"\".concat(x.id === selectedQualityLevel ? '*' : ' ', \" \").concat(x.width, \"x\").concat(x.height, \" \").concat(x.bitrate, \" \").concat(x.label);\n })), ['Stats:'], _toConsumableArray(Object.entries(stats).map(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n val = _ref2[1];\n\n return \" \".concat(key, \": \").concat(val);\n })));\n return external_react_default.a.createElement(\"pre\", {\n style: {\n position: 'absolute',\n resize: 'none',\n boxSizing: 'border-box',\n width: '100%',\n height: '100%',\n padding: '10px',\n margin: 0,\n backgroundColor: 'rgba(0, 0, 0, .4)',\n color: 'rgb(255, 255, 255)',\n fontSize: '15px',\n fontFamily: 'Arial',\n overflow: 'auto',\n zIndex: 1,\n lineHeight: '120%'\n }\n }, textLines.join('\\n'), external_react_default.a.createElement(\"div\", {\n style: {\n position: 'relative',\n top: '10px',\n right: '10px',\n cursor: 'pointer'\n },\n onClick: this.dismiss\n }, \"X\"));\n }\n }]);\n\n return DebugOverlay;\n}(external_react_[\"Component\"]);\n/* eslint-disable no-underscore-dangle */\n\n_defineProperty(debug_overlay_DebugOverlay, \"propTypes\", {\n debugInfo: prop_types_default.a.shape({\n currentSource: prop_types_default.a.shape({\n src: prop_types_default.a.string.isRequired\n }).isRequired,\n qualityLevels: prop_types_default.a.shape({\n levels: prop_types_default.a.arrayOf(prop_types_default.a.shape({\n bitrate: prop_types_default.a.number.isRequired,\n height: prop_types_default.a.number.isRequired,\n width: prop_types_default.a.number.isRequired,\n label: prop_types_default.a.string.isRequired,\n id: prop_types_default.a.string.isRequired\n })).isRequired,\n selectedIndex: prop_types_default.a.number.isRequired\n }),\n stats: prop_types_default.a.object\n }),\n onDismiss: prop_types_default.a.func\n});\n\nfunction getDebugInfo(player) {\n var qualityLevels = typeof player.qualityLevels === 'function' ? player.qualityLevels() : undefined;\n var el = player.tech_ && player.tech_.el_;\n\n var stats = player.tech_ && player.tech_.vhs && player.tech_.vhs.stats && _objectSpread({}, player.tech_.vhs.stats);\n\n if (el) {\n stats = _objectSpread({}, stats, {\n audioDecodedByteCount: el.webkitAudioDecodedByteCount,\n videoDecodedByteCount: el.webkitVideoDecodedByteCount,\n decodedFrameCount: el.webkitDecodedFrameCount,\n droppedFrameCount: el.webkitDroppedFrameCount\n });\n }\n\n return {\n currentSource: player.currentSource(),\n qualityLevels: qualityLevels ? {\n levels: Array.from(qualityLevels).map(function (x) {\n return _objectSpread({}, x);\n }),\n selectedIndex: qualityLevels.selectedIndex\n } : undefined,\n stats: stats\n };\n}\n/* eslint-enable no-underscore-dangle */\n\nfunction sortQualityLevels(a, b) {\n return a - b;\n}\n// CONCATENATED MODULE: ./src/live-stream-viewer-count.jsx\nfunction live_stream_viewer_count_typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { live_stream_viewer_count_typeof = function _typeof(obj) { return typeof obj; }; } else { live_stream_viewer_count_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return live_stream_viewer_count_typeof(obj); }\n\nfunction live_stream_viewer_count_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction live_stream_viewer_count_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction live_stream_viewer_count_createClass(Constructor, protoProps, staticProps) { if (protoProps) live_stream_viewer_count_defineProperties(Constructor.prototype, protoProps); if (staticProps) live_stream_viewer_count_defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction live_stream_viewer_count_possibleConstructorReturn(self, call) { if (call && (live_stream_viewer_count_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return live_stream_viewer_count_assertThisInitialized(self); }\n\nfunction live_stream_viewer_count_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction live_stream_viewer_count_getPrototypeOf(o) { live_stream_viewer_count_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return live_stream_viewer_count_getPrototypeOf(o); }\n\nfunction live_stream_viewer_count_inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) live_stream_viewer_count_setPrototypeOf(subClass, superClass); }\n\nfunction live_stream_viewer_count_setPrototypeOf(o, p) { live_stream_viewer_count_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return live_stream_viewer_count_setPrototypeOf(o, p); }\n\nfunction live_stream_viewer_count_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\n\nvar live_stream_viewer_count_LiveStreamViewerCount =\n/*#__PURE__*/\nfunction (_Component) {\n live_stream_viewer_count_inherits(LiveStreamViewerCount, _Component);\n\n function LiveStreamViewerCount() {\n live_stream_viewer_count_classCallCheck(this, LiveStreamViewerCount);\n\n return live_stream_viewer_count_possibleConstructorReturn(this, live_stream_viewer_count_getPrototypeOf(LiveStreamViewerCount).apply(this, arguments));\n }\n\n live_stream_viewer_count_createClass(LiveStreamViewerCount, [{\n key: \"render\",\n value: function render() {\n var className = \"vjs-live-viewer-count \".concat(this.props.userActive ? 'show-viewer-count' : 'hide-viewer-count');\n return external_react_default.a.createElement(\"div\", {\n className: className\n }, external_react_default.a.createElement(\"img\", {\n alt: \"viewers-icon\",\n className: \"live-viewer-show-icon\",\n src: \"/public/images/show.svg\"\n }), this.props.liveStreamActiveViewerCount || 0);\n }\n }]);\n\n return LiveStreamViewerCount;\n}(external_react_[\"Component\"]);\n\nlive_stream_viewer_count_defineProperty(live_stream_viewer_count_LiveStreamViewerCount, \"propTypes\", {\n liveStreamActiveViewerCount: prop_types_default.a.number,\n userActive: prop_types_default.a.bool\n});\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/video.js/dist/alt/video-js-cdn.css\nvar video_js_cdn = __webpack_require__(111);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@silvermine/videojs-chromecast/dist/silvermine-videojs-chromecast.css\nvar silvermine_videojs_chromecast = __webpack_require__(112);\n\n// EXTERNAL MODULE: /Users/tyler.zubke/FaithlifeTV.com/node_modules/@silvermine/videojs-airplay/dist/silvermine-videojs-airplay.css\nvar silvermine_videojs_airplay = __webpack_require__(113);\n\n// CONCATENATED MODULE: ./src/video.jsx\nfunction video_typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { video_typeof = function _typeof(obj) { return typeof obj; }; } else { video_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return video_typeof(obj); }\n\nfunction video_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { video_defineProperty(target, key, source[key]); }); } return target; }\n\nfunction video_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction video_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction video_createClass(Constructor, protoProps, staticProps) { if (protoProps) video_defineProperties(Constructor.prototype, protoProps); if (staticProps) video_defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction video_possibleConstructorReturn(self, call) { if (call && (video_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return video_assertThisInitialized(self); }\n\nfunction video_getPrototypeOf(o) { video_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return video_getPrototypeOf(o); }\n\nfunction video_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction video_inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) video_setPrototypeOf(subClass, superClass); }\n\nfunction video_setPrototypeOf(o, p) { video_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return video_setPrototypeOf(o, p); }\n\nfunction video_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/* eslint-disable mozilla/balanced-listeners */\n\n/* global ga, rg4js, amplitude */\n\n\n\n\n\n\n\n\n\n\n\n\nvar nextPlayerId = 0;\nvar percentages = new Map().set(5, '5% Watched').set(25, '25% Watched').set(50, '50% Watched').set(75, '75% Watched').set(95, '95% Watched').set(100, '100% Watched');\nvar video_Video =\n/*#__PURE__*/\nfunction (_Component) {\n video_inherits(Video, _Component);\n\n function Video() {\n var _getPrototypeOf2;\n\n var _this;\n\n video_classCallCheck(this, Video);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = video_possibleConstructorReturn(this, (_getPrototypeOf2 = video_getPrototypeOf(Video)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n video_defineProperty(video_assertThisInitialized(_this), \"state\", {\n showDebugInfo: false\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"container\", null);\n\n video_defineProperty(video_assertThisInitialized(_this), \"playerElement\", null);\n\n video_defineProperty(video_assertThisInitialized(_this), \"disposePlayer\", function () {\n var player = _this.playerId ? window.videojs(_this.playerId) : null;\n\n if (player) {\n player.dispose();\n _this.playerId = null;\n _this.videoPlayer = null;\n }\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"doCountdown\", function () {\n _this.setState(function (prevState) {\n return {\n countdownSeconds: prevState.countdownSeconds - 1\n };\n });\n\n if (_this.state.countdownSeconds <= 0) {\n clearInterval(_this.countdownInterval);\n\n _this.playNextVideo();\n }\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"initializePlayer\", function (props) {\n if (!props) {\n return;\n }\n\n _this.playId = v4_default()();\n _this.trackedPercentages = [];\n var startTime = props.startTime,\n isLiveStream = props.isLiveStream,\n posterUrl = props.posterUrl,\n windowLocation = props.windowLocation,\n upNext = props.upNext,\n showBrandingBug = props.showBrandingBug,\n brandingBugCampaign = props.brandingBugCampaign,\n embeddedPlayerCampaign = props.embeddedPlayerCampaign,\n brandButtonImageUri = props.brandButtonImageUri,\n title = props.title,\n onBack = props.onBack,\n registerApiCallback = props.registerApiCallback,\n disableFullscreen = props.disableFullscreen,\n autoPlay = props.autoPlay,\n onError = props.onError;\n\n var _require = __webpack_require__(114),\n videojs = _require.videojs; // eslint-disable-line\n\n\n var component = video_assertThisInitialized(_this);\n\n var hasNextVideo = !!upNext;\n\n if (_this.playerElement) {\n _this.latestTrackedTime = startTime;\n var playbackRates = isLiveStream ? null : [0.5, 1, 1.5, 2];\n var update = false;\n\n if (!_this.videoPlayer) {\n _this.videoPlayer = videojs(_this.playerElement, {\n playerId: _this.playerId,\n controlBar: {\n volumePanel: {\n inline: false\n },\n fullscreenToggle: !disableFullscreen\n },\n playbackRates: playbackRates,\n techOrder: ['chromecast', 'html5']\n });\n } else {\n update = true;\n }\n\n _this.videoPlayer.on('error', function () {\n var player = this;\n var error = player.error();\n\n if (!isError(error)) {\n try {\n throw new Error(error);\n } catch (err) {\n error = err;\n }\n }\n\n component.logError(error, video_objectSpread({\n time: component.latestTrackedTime\n }, getDebugInfo(player)));\n\n if (onError) {\n onError(error);\n }\n });\n\n _this.videoPlayer.ready(function initializePlayer() {\n var player = this;\n component.player = player;\n component.trackVideoPlay();\n var timeUpdatesSinceTracking = 0;\n\n if (!update) {\n // initialize hotkeys\n player.hotkeys({\n enableNumbers: false,\n enableVolumeScroll: false\n }); // initialize persistvolume\n\n try {\n if (player.persistvolume) {\n player.persistvolume({\n namespace: 'faithlifetv'\n });\n }\n } catch (err) {\n component.logError(err, video_objectSpread({}, getDebugInfo(player)));\n } // initialize chromecast\n\n\n player.chromecast();\n player.airPlay();\n player.on('playing', function () {\n component.segmentStartTime = player.currentTime();\n });\n player.on('waiting', function () {\n if (player.tech({\n IWillNotUseThisInPlugins: true\n }).name() === 'Html5') {\n var readyState = player.readyState();\n var isSeeking = player.seeking();\n\n if (!isSeeking && readyState === 2\n /* HAVE_CURRENT_DATA */\n ) {\n component.trackVideoWaiting(getDebugInfo(player));\n }\n }\n }); // during playback this is fired every 15-250 milliseconds\n\n player.on('timeupdate', function () {\n timeUpdatesSinceTracking++;\n\n if (timeUpdatesSinceTracking > 20) {\n component.trackProgress(player);\n timeUpdatesSinceTracking = 0;\n }\n });\n\n if (isLiveStream) {\n player.tech({\n IWillNotUseThisInPlugins: true\n }).on('usage', function (event) {\n if (event.name === 'hls-rendition-blacklisted') {\n player.addClass('vjs-waiting');\n }\n });\n player.tech({\n IWillNotUseThisInPlugins: true\n }).on('retryplaylist', function () {\n component.handleVideoEnded();\n });\n }\n\n player.on('ended', function () {\n component.handleVideoEnded();\n });\n player.on('contentended', function () {\n component.trackProgress();\n });\n }\n\n player.on('loadedmetadata', function () {\n if (startTime) {\n player.currentTime(startTime);\n } else {\n player.currentTime(0);\n }\n });\n\n if (autoPlay) {\n can_autoplay_es.video().then(function (_ref) {\n var result = _ref.result,\n error = _ref.error;\n\n if (result) {\n // check for tech to avoid a video.js bug when the source fails to load\n if (player.tech_) {\n player.play();\n }\n } else {\n console.warn('Autoplay video failed', error);\n }\n });\n }\n\n if (posterUrl) {\n player.poster(posterUrl);\n }\n\n var VjsButton = videojs.getComponent('Button');\n var VjsComponent = videojs.getComponent('Component');\n var FullscreenToggle = videojs.getComponent('FullscreenToggle');\n var PlaybackRateMenuButton = videojs.getComponent('PlaybackRateMenuButton');\n\n var BrandButton =\n /*#__PURE__*/\n function (_VjsButton) {\n video_inherits(BrandButton, _VjsButton);\n\n function BrandButton() {\n video_classCallCheck(this, BrandButton);\n\n return video_possibleConstructorReturn(this, video_getPrototypeOf(BrandButton).apply(this, arguments));\n }\n\n return BrandButton;\n }(VjsButton);\n\n var createBrandButton = function createBrandButton() {\n var brandLink = \"\".concat(windowLocation).concat(embeddedPlayerCampaign);\n var buttonProps = {\n className: 'vjs-brand-button vjs-menu-button vjs-button',\n innerHTML: \"<a href=\\\"\".concat(encodeURI(brandLink), \"\\\" target=\\\"_top\\\"><img src=\\\"\").concat(brandButtonImageUri, \"\\\" style=\\\"width: 100%; padding: 2px;\\\" /></a>\"),\n tabIndex: 0\n };\n var attr = {\n role: 'button'\n };\n return videojs.dom.createEl('div', buttonProps, attr);\n };\n\n var VideoTitle =\n /*#__PURE__*/\n function (_VjsComponent) {\n video_inherits(VideoTitle, _VjsComponent);\n\n function VideoTitle() {\n video_classCallCheck(this, VideoTitle);\n\n return video_possibleConstructorReturn(this, video_getPrototypeOf(VideoTitle).apply(this, arguments));\n }\n\n return VideoTitle;\n }(VjsComponent);\n\n var createTitle = function createTitle() {\n var titleProps = {\n className: 'vjs-video-title vjs-menu-button vjs-button',\n innerHTML: \"<div><span>\".concat(title.escapeHTML(), \"</span></div>\")\n };\n return videojs.dom.createEl('div', titleProps, {});\n };\n\n var NextButton =\n /*#__PURE__*/\n function (_VjsButton2) {\n video_inherits(NextButton, _VjsButton2);\n\n function NextButton(vjsPlayer, options) {\n var _this2;\n\n video_classCallCheck(this, NextButton);\n\n _this2 = video_possibleConstructorReturn(this, video_getPrototypeOf(NextButton).call(this, vjsPlayer, options));\n\n _this2.on('click', function () {\n component.playNextVideo();\n });\n\n return _this2;\n }\n\n return NextButton;\n }(VjsButton);\n\n var createNextButton = function createNextButton() {\n var buttonProps = {\n className: 'vjs-next-episode-button vjs-menu-button vjs-button',\n innerHTML: '<div><img src=\"/public/images/nextepisode-button@2x.png\" width=\"90%\"/></div>'\n };\n var attr = {\n role: 'button'\n };\n return videojs.dom.createEl('div', buttonProps, attr);\n };\n\n var BackButton =\n /*#__PURE__*/\n function (_VjsComponent2) {\n video_inherits(BackButton, _VjsComponent2);\n\n function BackButton(vjsPlayer, options) {\n var _this3;\n\n video_classCallCheck(this, BackButton);\n\n _this3 = video_possibleConstructorReturn(this, video_getPrototypeOf(BackButton).call(this, vjsPlayer, options));\n\n _this3.on('click', function () {\n if (onBack) {\n onBack();\n }\n });\n\n return _this3;\n }\n\n return BackButton;\n }(VjsComponent);\n\n var createBackButton = function createBackButton() {\n var buttonProps = {\n className: 'vjs-back-button vjs-button',\n innerHTML: '<img src=\"/public/images/backbutton@2x.png\" />'\n };\n return videojs.dom.createEl('div', buttonProps, {});\n };\n\n var ShareButton =\n /*#__PURE__*/\n function (_VjsComponent3) {\n video_inherits(ShareButton, _VjsComponent3);\n\n function ShareButton(vjsPlayer, options) {\n var _this4;\n\n video_classCallCheck(this, ShareButton);\n\n _this4 = video_possibleConstructorReturn(this, video_getPrototypeOf(ShareButton).call(this, vjsPlayer, options));\n\n _this4.on('click', function () {\n if (vjsPlayer.isFullscreen()) {\n vjsPlayer.exitFullscreen();\n }\n\n component.showShareOverlay();\n });\n\n return _this4;\n }\n\n return ShareButton;\n }(VjsComponent);\n\n var createShareButton = function createShareButton() {\n var buttonProps = {\n className: 'vjs-share-button vjs-button',\n innerHTML: '<img src=\"/public/images/share.svg\" />'\n };\n return videojs.dom.createEl('div', buttonProps, {});\n };\n\n var BrandingBug =\n /*#__PURE__*/\n function (_VjsComponent4) {\n video_inherits(BrandingBug, _VjsComponent4);\n\n function BrandingBug(vjsPlayer, options) {\n var _this5;\n\n video_classCallCheck(this, BrandingBug);\n\n _this5 = video_possibleConstructorReturn(this, video_getPrototypeOf(BrandingBug).call(this, vjsPlayer, options));\n\n _this5.on('click', function (e) {\n if (e.target.className === 'close-button') {\n _this5.el_.style.display = 'none';\n } else {\n window.open(\"https://faithlifetv.com/\".concat(options.campaign), '_top');\n }\n });\n\n return _this5;\n }\n\n return BrandingBug;\n }(VjsComponent);\n\n var createBrandingBug = function createBrandingBug() {\n var bugProps = {\n className: 'vjs-branding-bug',\n innerHTML: '<div class=\"close-button\">⨉</div><div class=\"description\">Watch the Bible Come Alive</div><img class=\"logo\" src=\"/public/images/logo@2x.png\"/><div class=\"cta\">Explore the library</div>'\n };\n return videojs.dom.createEl('div', bugProps, {});\n };\n\n var existingNextButtons = document.getElementsByClassName('vjs-next-episode-button vjs-menu-button vjs-button');\n var hasNextButton = existingNextButtons && existingNextButtons.length;\n\n if (hasNextVideo && !hasNextButton) {\n var nextOptions = {\n el: createNextButton(),\n name: 'nextButton'\n };\n var lastControlBarChild = this.controlBar.fullscreenToggle || this.controlBar.children()[this.controlBar.children().length - 1];\n this.controlBar.el().insertBefore(new NextButton(this, nextOptions).el(), lastControlBarChild.el().previousSibling);\n } else if (!hasNextVideo && hasNextButton) {\n this.controlBar.el().removeChild(existingNextButtons[0]);\n }\n\n var existingTitleElements = document.getElementsByClassName('vjs-video-title vjs-menu-button vjs-button');\n var hasTitleElement = existingTitleElements && existingTitleElements.length;\n\n if (title && !hasTitleElement) {\n var titleOptions = {\n el: createTitle(),\n name: 'titleText'\n };\n this.controlBar.el().insertBefore(new VideoTitle(this, titleOptions).el(), this.controlBar.customControlSpacer.el().nextSibling);\n } else if (title && hasTitleElement) {\n // TODO: Fix this the next time the file is edited.\n // eslint-disable-next-line no-unsanitized/property\n existingTitleElements[0].innerHTML = \"<div><span>\".concat(title.escapeHTML(), \"</span></div>\");\n }\n\n var existingRatesElements = document.getElementsByClassName('vjs-playback-rate vjs-menu-button vjs-menu-button-popup vjs-control vjs-button');\n var hasRateElement = existingRatesElements && existingRatesElements.length;\n\n if (playbackRates && !hasRateElement) {\n var rButton = new PlaybackRateMenuButton(this, {\n playbackRates: [0.5, 1, 1.5, 2]\n });\n this.controlBar.addChild(rButton);\n this.controlBar.playbackRateMenuButton = rButton;\n } else if (!playbackRates && hasRateElement) {\n this.controlBar.el().removeChild(existingRatesElements[0]);\n }\n\n var paintCurrentFrameOnCanvas = function paintCurrentFrameOnCanvas(canvas) {\n if (!canvas || canvas.tagName !== 'CANVAS' || !player || !player.tech_) {\n return false;\n }\n\n var imgContext = canvas.getContext('2d');\n var width = canvas.width = player.videoWidth(); // eslint-disable-line no-param-reassign\n\n var height = canvas.height = player.videoHeight(); // eslint-disable-line no-param-reassign\n\n imgContext.drawImage(player.tech_.el(), 0, 0, width, height);\n return true;\n };\n\n if (registerApiCallback) {\n registerApiCallback({\n paintCurrentFrameOnCanvas: paintCurrentFrameOnCanvas,\n getCurrentTime: function getCurrentTime() {\n return player.tech_ ? player.currentTime() : 0;\n },\n getDuration: function getDuration() {\n return player.tech_ ? player.duration() : 0;\n }\n });\n }\n\n var existingBrandButtons = document.getElementsByClassName('vjs-brand-button vjs-menu-button vjs-button');\n var hasBrandButton = existingBrandButtons && existingBrandButtons.length;\n\n if (windowLocation && !hasBrandButton) {\n var brandOptions = {\n el: createBrandButton(),\n name: 'brandButton'\n };\n\n var _lastControlBarChild = this.controlBar.fullscreenToggle || this.controlBar.children()[this.controlBar.children().length - 1];\n\n this.controlBar.el().insertBefore(new BrandButton(this, brandOptions).el(), _lastControlBarChild.el().nextSibling);\n var shareOptions = {\n el: createShareButton(),\n name: 'shareButton'\n };\n var shareButton = new ShareButton(this, shareOptions);\n player.addChild(shareButton);\n player.on('useractive', function () {\n shareButton.removeClass('vjs-share-button-hide');\n });\n player.on('userinactive', function () {\n shareButton.addClass('vjs-share-button-hide');\n });\n } else if (!windowLocation && hasBrandButton) {\n var shareButtons = document.getElementsByClassName('vjs-share-button vjs-button vjs-share-button-hide');\n\n if (shareButtons && shareButtons.length) {\n player.el().removeChild(shareButtons[0]);\n }\n\n this.controlBar.el().removeChild(existingBrandButtons[0]);\n }\n\n var existingBrandingBugs = document.getElementsByClassName('vjs-branding-bug');\n var hasBrandingBug = existingBrandingBugs && existingBrandingBugs.length;\n\n if (showBrandingBug && !hasBrandingBug) {\n var brandingBugOptions = {\n el: createBrandingBug(),\n name: 'brandingBug',\n campaign: brandingBugCampaign\n };\n var brandingBug = new BrandingBug(this, brandingBugOptions);\n player.addChild(brandingBug); // move the bug below the control bar\n\n var bugEl = brandingBug.el();\n var controlBarEl = this.controlBar.el();\n controlBarEl.parentNode.insertBefore(bugEl.parentNode.removeChild(bugEl), controlBarEl);\n } else if (!showBrandingBug && hasBrandingBug) {\n player.el().removeChild(existingBrandingBugs[0]);\n }\n\n var existingBackButtons = document.getElementsByClassName('vjs-back-button vjs-button');\n var hasBackButton = existingNextButtons && existingBackButtons.length;\n\n if (!windowLocation && onBack && !hasBackButton) {\n var backOptions = {\n el: createBackButton(),\n name: 'backButton'\n };\n var backButton = new BackButton(this, backOptions);\n player.addChild(backButton);\n player.on('useractive', function () {\n backButton.removeClass('vjs-back-button-hide');\n });\n player.on('userinactive', function () {\n backButton.addClass('vjs-back-button-hide');\n });\n } else if (!onBack && hasBackButton) {\n player.el().removeChild(existingBackButtons[0]);\n }\n\n if (!disableFullscreen && !this.controlBar.fullscreenToggle) {\n var fsToggle = new FullscreenToggle(this);\n this.controlBar.addChild(fsToggle);\n this.controlBar.fullscreenToggle = fsToggle;\n } else if (disableFullscreen && this.controlBar.fullscreenToggle) {\n this.controlBar.removeChild(this.controlBar.fullscreenToggle);\n }\n\n if (this.controlBar.fullscreenToggle) {\n this.controlBar.fullscreenToggle.el().style.marginLeft = 'auto';\n } else {\n var nextButtons = document.getElementsByClassName('vjs-next-episode-button vjs-menu-button vjs-button');\n var nextButton = nextButtons && nextButtons.length ? nextButtons[0] : null;\n\n if (nextButton) {\n nextButton.style.marginRight = 'auto';\n }\n }\n\n player.on('useractive', function () {\n component.setState({\n userActive: true\n });\n });\n player.on('userinactive', function () {\n component.setState({\n userActive: false\n });\n });\n component.setState({\n userActive: player.userActive()\n });\n component.updateDebugState();\n });\n }\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"updateDebugState\", function () {\n if (_this.playerId) {\n _this.setState({\n debugInfo: getDebugInfo(_this.player)\n });\n\n setTimeout(_this.updateDebugState, 1000);\n }\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"playNextVideo\", function () {\n var _this$props = _this.props,\n onPlayNextVideo = _this$props.onPlayNextVideo,\n upNext = _this$props.upNext,\n playlistId = _this$props.playlistId;\n\n if (onPlayNextVideo && upNext && upNext.nextItemId) {\n onPlayNextVideo(upNext.nextItemId, playlistId);\n }\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"logError\", function (error, data) {\n console.warn(error);\n\n if (typeof rg4js === 'function') {\n rg4js('send', {\n error: error,\n customData: [video_objectSpread({\n mediaId: _this.props.videoId\n }, data)]\n });\n }\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"setPlayerRef\", function (ref) {\n _this.playerElement = ref;\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"trackVideoPlay\", function () {\n var _this$props2 = _this.props,\n useGoogleAnalytics = _this$props2.useGoogleAnalytics,\n useAmplitude = _this$props2.useAmplitude,\n videoId = _this$props2.videoId,\n title = _this$props2.title;\n\n if (useGoogleAnalytics && typeof ga !== 'undefined' && typeof ga === 'function') {\n ga('send', {\n hitType: 'event',\n eventCategory: 'Video',\n eventAction: 'Played',\n eventLabel: \"\".concat(videoId),\n nonInteraction: true\n });\n }\n\n if (useAmplitude && typeof amplitude !== 'undefined' && typeof amplitude.getInstance === 'function') {\n amplitude.getInstance().logEvent('Video - Played', {\n 'Item Id': videoId,\n Title: title || 'Not Set'\n });\n }\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"trackProgress\", function () {\n var _this$props3 = _this.props,\n onVideoSegmentPlayed = _this$props3.onVideoSegmentPlayed,\n useGoogleAnalytics = _this$props3.useGoogleAnalytics,\n useAmplitude = _this$props3.useAmplitude,\n isLiveStream = _this$props3.isLiveStream,\n videoId = _this$props3.videoId,\n title = _this$props3.title;\n _this.latestTrackedTime = _this.player.currentTime();\n var startTime = _this.segmentStartTime > _this.latestTrackedTime ? Math.round(_this.latestTrackedTime) : _this.segmentStartTime;\n var currentTime = Math.round(_this.latestTrackedTime);\n\n if (!isLiveStream) {\n var trackedPercentages = _this.trackedPercentages;\n var progress = Math.round(currentTime / _this.player.duration() * 100);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = percentages.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var percent = _step.value;\n\n if (progress >= percent && !trackedPercentages.includes(percent)) {\n if (useGoogleAnalytics && typeof ga !== 'undefined' && typeof ga === 'function') {\n ga('send', {\n hitType: 'event',\n eventCategory: 'Video',\n eventAction: \"\".concat(percentages.get(percent)),\n eventLabel: \"\".concat(videoId),\n eventValue: Math.floor(currentTime),\n nonInteraction: true\n });\n }\n\n if (useAmplitude && typeof amplitude !== 'undefined' && typeof amplitude.getInstance === 'function') {\n amplitude.getInstance().logEvent('Video - Progress', {\n 'Item Id': videoId,\n 'Percent Watched': percent,\n Title: title || 'Not Set'\n });\n }\n\n trackedPercentages.push(percent);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n\n if (onVideoSegmentPlayed && currentTime > 0 && startTime !== undefined && videoId) {\n var qualityLevels = _this.player.qualityLevels();\n\n var bitrate;\n\n if (qualityLevels && qualityLevels.selectedIndex !== -1) {\n var selectedQualityLevel = qualityLevels[qualityLevels.selectedIndex];\n bitrate = selectedQualityLevel && selectedQualityLevel.bitrate;\n }\n\n onVideoSegmentPlayed({\n playId: _this.playId,\n endTime: currentTime,\n startTime: startTime,\n bitrate: bitrate\n });\n _this.segmentStartTime = currentTime;\n }\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"trackVideoWaiting\", function (data) {\n var _this$props4 = _this.props,\n useAmplitude = _this$props4.useAmplitude,\n videoId = _this$props4.videoId,\n title = _this$props4.title;\n\n if (useAmplitude && typeof amplitude !== 'undefined' && typeof amplitude.getInstance === 'function') {\n var eventProps = {\n 'Item Id': videoId,\n Title: title || 'Not Set'\n };\n\n if (data && data.currentSource && data.currentSource.src) {\n eventProps['Video Source'] = data.currentSource.src;\n }\n\n if (data && data.qualityLevels && Array.isArray(data.qualityLevels.levels) && data.qualityLevels.levels.length && Number.isInteger(data.qualityLevels.selectedIndex)) {\n var qualityLevel = data.qualityLevels.levels[data.qualityLevels.selectedIndex];\n\n if (qualityLevel && qualityLevel.width) {\n eventProps['Video Width'] = qualityLevel.width;\n }\n\n if (qualityLevel && qualityLevel.height) {\n eventProps['Video Height'] = qualityLevel.height;\n }\n\n if (qualityLevel && qualityLevel.bitrate) {\n eventProps['Video Bitrate'] = qualityLevel.bitrate;\n }\n }\n\n if (data && data.stats) {\n eventProps['Video Stats'] = data.stats;\n }\n\n amplitude.getInstance().logEvent('Video - Waiting', eventProps);\n }\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"hideDebugOverlay\", function () {\n _this.setState({\n showDebugInfo: false\n });\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"showShareOverlay\", function () {\n _this.setState({\n showShareOverlay: true\n });\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"hideShareOverlay\", function () {\n _this.setState({\n showShareOverlay: false\n });\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"hideRatingOverlay\", function () {\n _this.setState({\n showRatingOverlay: false\n });\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"handleKeyPress\", function (e) {\n if (e.code === 'KeyD' && e.ctrlKey && e.altKey && e.shiftKey) {\n _this.setState(function (prevState) {\n return {\n showDebugInfo: !prevState.showDebugInfo\n };\n });\n }\n });\n\n video_defineProperty(video_assertThisInitialized(_this), \"handleVideoEnded\", function () {\n if (_this.state.ended) {\n return;\n }\n\n _this.setState({\n ended: true,\n showRatingOverlay: true\n });\n\n var _this$props5 = _this.props,\n upNext = _this$props5.upNext,\n onVideoEnd = _this$props5.onVideoEnd;\n\n if (upNext) {\n if (upNext.startDelay) {\n _this.setState({\n countdownSeconds: upNext.startDelay\n });\n\n _this.countdownInterval = setInterval(_this.doCountdown, 1000);\n } else {\n _this.playNextVideo();\n }\n } else {\n var player = _this.playerId ? window.videojs(_this.playerId) : null;\n\n if (player && player.isFullscreen()) {\n player.exitFullscreen();\n }\n }\n\n if (onVideoEnd) {\n onVideoEnd();\n }\n });\n\n return _this;\n }\n\n video_createClass(Video, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {\n this.playerId = \"video_\".concat(nextPlayerId++);\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.initializePlayer(this.props);\n document.body.addEventListener('keypress', this.handleKeyPress);\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n var prevProps = this.props;\n\n if (!nextProps.sources || typeof window === 'undefined') {\n return;\n }\n\n var player = this.playerId ? window.videojs(this.playerId) : null;\n\n if (this.props.startTime !== nextProps.startTime) {\n if (player) {\n this.initializePlayer(nextProps);\n }\n }\n\n if (!lodash_isequal(nextProps.sources, prevProps.sources) || nextProps.videoId !== prevProps.videoId) {\n if (player && player.tech_) {\n var sources = nextProps.sources.filter(function (source) {\n return source.url;\n }).map(function (source) {\n var s = {\n src: encodeURI(source.url),\n type: source.mediaType\n };\n return s;\n });\n\n if (sources && sources.length) {\n var rate = player.playbackRate();\n player.src(sources);\n this.setState({\n ended: false\n });\n this.initializePlayer(nextProps);\n\n if (!nextProps.isLiveStream) {\n player.playbackRate(rate);\n }\n }\n }\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.disposePlayer();\n\n if (this.props.remountPlayer) {\n this.props.remountPlayer(false);\n }\n\n clearInterval(this.countdownInterval);\n document.body.removeEventListener('keypress', this.handleKeyPress);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props6 = this.props,\n videoId = _this$props6.videoId,\n sources = _this$props6.sources,\n className = _this$props6.className,\n upNext = _this$props6.upNext,\n suggestedVideoEndcap = _this$props6.suggestedVideoEndcap,\n ratingInfo = _this$props6.ratingInfo,\n playlistId = _this$props6.playlistId,\n isEmbedded = _this$props6.isEmbedded,\n EndCapComponent = _this$props6.EndCapComponent,\n UpNextComponent = _this$props6.UpNextComponent,\n RatingOverlayComponent = _this$props6.RatingOverlayComponent,\n ShareOverlayComponent = _this$props6.ShareOverlayComponent,\n isLiveStream = _this$props6.isLiveStream,\n liveStreamActiveViewerCount = _this$props6.liveStreamActiveViewerCount;\n var _this$state = this.state,\n showDebugInfo = _this$state.showDebugInfo,\n debugInfo = _this$state.debugInfo,\n ended = _this$state.ended,\n countdownSeconds = _this$state.countdownSeconds,\n showShareOverlay = _this$state.showShareOverlay,\n showRatingOverlay = _this$state.showRatingOverlay,\n userActive = _this$state.userActive;\n var canDisplayUpNext = !!UpNextComponent && ended && !!upNext && countdownSeconds;\n var canDisplayEndCap = !!EndCapComponent && ended && !!suggestedVideoEndcap && !canDisplayUpNext;\n var canDisplayRating = !!RatingOverlayComponent && ended && ratingInfo.canRate && showRatingOverlay; // deliberately using != instead of !== here to handle undefined and null values\n\n var canDisplayLiveStreamViewerCount = isLiveStream && liveStreamActiveViewerCount != null;\n return external_react_default.a.createElement(\"div\", null, !sources || !sources.length ? null : external_react_default.a.createElement(\"div\", null, external_react_default.a.createElement(\"video\", {\n id: this.playerId,\n ref: this.setPlayerRef,\n className: \"video-js \".concat(className),\n preload: \"auto\",\n controls: true,\n style: {\n width: '100%',\n height: '100%',\n position: 'absolute',\n top: 0\n }\n }, sources.map(function (source) {\n return external_react_default.a.createElement(\"source\", {\n key: source.url,\n src: encodeURI(source.url),\n type: source.mediaType\n });\n }))), !canDisplayEndCap ? null : external_react_default.a.createElement(EndCapComponent, {\n suggestedVideoEndcap: suggestedVideoEndcap,\n adParams: {\n itemId: videoId\n }\n }), !canDisplayUpNext ? null : external_react_default.a.createElement(UpNextComponent, {\n cover: upNext.nextCover,\n countdown: countdownSeconds,\n nextVideoId: upNext.nextItemId,\n browseId: upNext.parentItemId,\n playlistId: playlistId,\n playerId: this.playerId,\n title: upNext.title\n }), !canDisplayRating ? null : external_react_default.a.createElement(RatingOverlayComponent, {\n ratingItemId: ratingInfo.ratingItemId,\n ratingItemTitle: ratingInfo.ratingItemTitle,\n returnUrl: ratingInfo.returnUrl,\n isEmbedded: isEmbedded,\n hideRating: this.hideRatingOverlay\n }), !showDebugInfo ? null : external_react_default.a.createElement(debug_overlay_DebugOverlay, {\n debugInfo: debugInfo,\n onDismiss: this.hideDebugOverlay\n }), !canDisplayLiveStreamViewerCount ? null : external_react_default.a.createElement(live_stream_viewer_count_LiveStreamViewerCount, {\n userActive: userActive,\n liveStreamActiveViewerCount: liveStreamActiveViewerCount\n }), videoId ? ShareOverlayComponent && external_react_default.a.createElement(ShareOverlayComponent, {\n active: showShareOverlay,\n hideShare: this.hideShareOverlay,\n itemId: videoId\n }) : false);\n }\n }]);\n\n return Video;\n}(external_react_[\"Component\"]);\n\nvideo_defineProperty(video_Video, \"propTypes\", {\n videoId: prop_types_default.a.string,\n className: prop_types_default.a.string,\n playlistId: prop_types_default.a.string,\n posterUrl: prop_types_default.a.string,\n isLiveStream: prop_types_default.a.bool,\n liveStreamActiveViewerCount: prop_types_default.a.number,\n autoPlay: prop_types_default.a.bool,\n isEmbedded: prop_types_default.a.bool,\n disableFullscreen: prop_types_default.a.bool,\n showBrandingBug: prop_types_default.a.bool,\n brandingBugCampaign: prop_types_default.a.string,\n embeddedPlayerCampaign: prop_types_default.a.string,\n brandButtonImageUri: prop_types_default.a.string,\n startTime: prop_types_default.a.number,\n title: prop_types_default.a.string,\n suggestedVideoEndcap: prop_types_default.a.object,\n ratingInfo: prop_types_default.a.shape({\n canRate: prop_types_default.a.bool.isRequired,\n ratingItemId: prop_types_default.a.any.isRequired,\n ratingItemTitle: prop_types_default.a.string,\n returnUrl: prop_types_default.a.string\n }),\n sources: prop_types_default.a.arrayOf(prop_types_default.a.shape({\n url: prop_types_default.a.string,\n mediaType: prop_types_default.a.string\n }).isRequired).isRequired,\n onVideoSegmentPlayed: prop_types_default.a.func,\n onVideoEnd: prop_types_default.a.func,\n onBack: prop_types_default.a.func,\n onPlayNextVideo: prop_types_default.a.func,\n useGoogleAnalytics: prop_types_default.a.bool,\n useAmplitude: prop_types_default.a.bool,\n windowLocation: prop_types_default.a.string,\n upNext: prop_types_default.a.shape({\n startDelay: prop_types_default.a.number,\n parentItemId: prop_types_default.a.string,\n nextItemId: prop_types_default.a.string,\n nextCover: prop_types_default.a.string\n }),\n registerApiCallback: prop_types_default.a.func,\n EndCapComponent: prop_types_default.a.any,\n UpNextComponent: prop_types_default.a.any,\n RatingOverlayComponent: prop_types_default.a.any,\n ShareOverlayComponent: prop_types_default.a.any,\n remountPlayer: prop_types_default.a.func,\n onError: prop_types_default.a.func\n});\n\nfunction isError(err) {\n return video_typeof(err) === 'object' && err.message !== undefined;\n}\n// CONCATENATED MODULE: ./src/index.js\n\nvar VideoPlayer = video_Video;\n\n/***/ })\n/******/ ]);\n//# sourceMappingURL=video-player.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fromPairs = require(\"lodash.frompairs\");\nvar ngcomponent_1 = require(\"ngcomponent\");\nvar React = require(\"react\");\nvar react_dom_1 = require(\"react-dom\");\n/**\n * Wraps a React component in Angular. Returns a new Angular component.\n *\n * Usage:\n *\n * ```ts\n * type Props = { foo: number }\n * class ReactComponent extends React.Component<Props, S> {}\n * const AngularComponent = react2angular(ReactComponent, ['foo'])\n * ```\n */\nfunction react2angular(Class, bindingNames, injectNames) {\n if (bindingNames === void 0) { bindingNames = null; }\n if (injectNames === void 0) { injectNames = []; }\n var names = bindingNames\n || (Class.propTypes && Object.keys(Class.propTypes))\n || [];\n return {\n bindings: fromPairs(names.map(function (_) { return [_, '<']; })),\n controller: ['$element'].concat(injectNames, [/** @class */ (function (_super) {\n __extends(class_1, _super);\n function class_1($element) {\n var injectedProps = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n injectedProps[_i - 1] = arguments[_i];\n }\n var _this = _super.call(this) || this;\n _this.$element = $element;\n _this.isDestroyed = false;\n _this.injectedProps = {};\n injectNames.forEach(function (name, i) {\n _this.injectedProps[name] = injectedProps[i];\n });\n return _this;\n }\n Object.defineProperty(class_1, \"$$ngIsClass\", {\n get: function () {\n return true;\n },\n enumerable: true,\n configurable: true\n });\n class_1.prototype.render = function () {\n if (!this.isDestroyed) {\n react_dom_1.render(React.createElement(Class, __assign({}, this.props, this.injectedProps)), this.$element[0]);\n }\n };\n class_1.prototype.componentWillUnmount = function () {\n this.isDestroyed = true;\n react_dom_1.unmountComponentAtNode(this.$element[0]);\n };\n return class_1;\n }(ngcomponent_1.default))])\n };\n}\nexports.react2angular = react2angular;\n//# sourceMappingURL=index.js.map","/**\n * mux.js\n *\n * Copyright (c) Brightcove\n * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE\n */\nvar\n ONE_SECOND_IN_TS = 90000, // 90kHz clock\n secondsToVideoTs,\n secondsToAudioTs,\n videoTsToSeconds,\n audioTsToSeconds,\n audioTsToVideoTs,\n videoTsToAudioTs,\n metadataTsToSeconds;\n\nsecondsToVideoTs = function(seconds) {\n return seconds * ONE_SECOND_IN_TS;\n};\n\nsecondsToAudioTs = function(seconds, sampleRate) {\n return seconds * sampleRate;\n};\n\nvideoTsToSeconds = function(timestamp) {\n return timestamp / ONE_SECOND_IN_TS;\n};\n\naudioTsToSeconds = function(timestamp, sampleRate) {\n return timestamp / sampleRate;\n};\n\naudioTsToVideoTs = function(timestamp, sampleRate) {\n return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));\n};\n\nvideoTsToAudioTs = function(timestamp, sampleRate) {\n return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);\n};\n\n/**\n * Adjust ID3 tag or caption timing information by the timeline pts values\n * (if keepOriginalTimestamps is false) and convert to seconds\n */\nmetadataTsToSeconds = function(timestamp, timelineStartPts, keepOriginalTimestamps) {\n return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);\n};\n\nmodule.exports = {\n ONE_SECOND_IN_TS: ONE_SECOND_IN_TS,\n secondsToVideoTs: secondsToVideoTs,\n secondsToAudioTs: secondsToAudioTs,\n videoTsToSeconds: videoTsToSeconds,\n audioTsToSeconds: audioTsToSeconds,\n audioTsToVideoTs: audioTsToVideoTs,\n videoTsToAudioTs: videoTsToAudioTs,\n metadataTsToSeconds: metadataTsToSeconds\n};\n"],"sourceRoot":""}