WebInterface: Add experimental browser based stream player. Test it on your local...
[enigma2-plugins.git] / webinterface / src / stream / js / vendor / plyr.min.js.map
1 {"version":3,"sources":["types.js","defaults.js","support.js","../../node_modules/loadjs/dist/loadjs.umd.js","utils.js","console.js","fullscreen.js","i18n.js","captions.js","ui.js","html5.js","controls.js","listeners.js","storage.js","plugins/ads.js","plugins/youtube.js","plugins/vimeo.js","media.js","source.js","plyr.js"],"names":["providers","types","defaults","navigator","language","userLanguage","split","range","factory","devnull","bundleIdCache","bundleResultCache","bundleCallbackQueue","publish","bundleId","pathsNotFound","q","length","splice","executeCallbacks","args","depsNotFound","call","success","error","loadFile","path","callbackFn","numTries","isCss","e","doc","document","async","maxTries","numRetries","beforeCallbackFn","before","pathStripped","replace","test","createElement","rel","href","src","undefined","onload","onerror","onbeforeload","ev","result","type","sheet","cssText","x","defaultPrevented","head","appendChild","loadjs","paths","arg1","arg2","trim","fn","i","numWaiting","push","loadFiles","ready","deps","bundleIds","r","subscribe","done","reset","isDefined","module","exports","utils","input","this","instanceof","window","Plyr","getConstructor","Object","Number","isNaN","String","Boolean","Function","nullOrUndefined","Array","isArray","WeakMap","NodeList","Element","Text","Event","TextTrackCue","VTTCue","TextTrack","string","kind","array","nodeList","object","keys","constructor","documentMode","documentElement","style","userAgent","platform","url","responseType","arguments","Promise","resolve","reject","request","XMLHttpRequest","addEventListener","JSON","parse","responseText","response","Error","statusText","open","send","id","is","hasId","exists","querySelectorAll","container","toggleHidden","setAttribute","support","storage","cached","localStorage","getItem","data","content","fetch","then","empty","setItem","stringify","catch","injectSprite","innerHTML","body","insertBefore","childNodes","prefix","Math","floor","random","elements","wrapper","targets","from","reverse","forEach","element","index","child","cloneNode","parent","parentNode","sibling","nextSibling","attributes","text","setAttributes","textContent","target","removeElement","removeChild","lastChild","newChild","oldChild","replaceChild","entries","_ref","key","_ref2","value","sel","existingAttributes","existing","s","selector","className","parts","charAt","class","toggle","contains","classList","removeAttribute","prototype","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","includes","querySelector","controls","getElement","config","selectors","buttons","getElements","play","pause","restart","rewind","fastForward","mute","pip","airplay","settings","captions","fullscreen","progress","inputs","seek","volume","display","buffer","duration","currentTime","seekTooltip","classNames","tooltip","debug","warn","toggleNativeControls","focused","activeElement","focusable","first","last","trap","event","keyCode","getFocusElement","shiftKey","focus","preventDefault","on","off","callback","passive","capture","function","Node","toggleListener","events","options","passiveListeners","bubbles","detail","CustomEvent","assign","plyr","dispatchEvent","toggleState","pressed","getAttribute","state","boolean","current","max","toFixed","parseInt","time","displayHours","inverted","number","formatTime","format","slice","hours","getHours","mins","getMinutes","secs","getSeconds","find","RegExp","toString","toUpperCase","substr","toLowerCase","replaceAll","toTitleCase","toPascalCase","sources","_len","_key","source","shift","defineProperty","extend","apply","concat","toConsumableArray","filter","item","indexOf","reduce","prev","curr","abs","youtube","vimeo","match","$2","parser","search","startsWith","parseUrl","params","hash","_hash$split2","val","decodeURIComponent","map","encodeURIComponent","join","fragment","createDocumentFragment","firstChild","innerText","width","height","ratio","getRatio","w","h","offsetHeight","provider","playsinline","api","ui","browser","getBrowser","canPlayInline","isIPhone","video","rangeInput","audio","webkitSetPresentationMode","WebKitPlaybackTargetAvailabilityEvent","media","isHTML5","canPlayType","isVideo","isAudio","supported","transitionEndEvent","matchMedia","noop","Console","enabled","console","log","bind","onChange","button","player","active","isIos","trapFocus","toggleFallback","scrollPosition","scrollX","scrollY","scrollTo","y","overflow","toggleClass","fallback","Fullscreen","name","_this","update","native","iosNative","playing","webkitEnterFullscreen","requestFullscreen","webkitExitFullscreen","action","cancelFullScreen","exitFullscreen","exit","enter","fullscreenElement","hasClass","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled","some","pre","i18n","seekTime","title","stored","get","isYouTube","textTracks","setCaptionsMenu","getAttributesFromSelector","insertAfter","getTracks","tracks","isIE","URL","track","hostname","location","protocol","blob","createObjectURL","setLanguage","show","setCue","mode","currentTrack","getCurrentTrack","activeCues","isVimeo","embed","enableTextTrack","_this2","label","cue","setText","getCueAsHTML","emptyElement","caption","uiSupported","listeners","inject","setup","muted","speed","loop","quality","updateVolume","timeUpdate","checkPlaying","setTitle","isEmbed","iframe","stopped","paused","toggleControls","loading","timers","setTimeout","failed","networkState","_this3","setRange","updateRangeFill","getElementsByTagName","nodeValue","getPercentage","setProgress","buffered","invert","invertTime","updateTimeDisplay","seeking","updateProgress","hasDuration","displayDuration","updateSeekTooltip","html5","getSources","sizes","dedupe","mime","load","blankVideo","isWebkit","setProperty","iconUrl","svg4everybody","getIconUrl","iconPath","absolute","iconPrefix","icon","createElementNS","use","setAttributeNS","attr","hidden","badge","menu","buttonType","toCamelCase","labelPressed","iconPressed","control","createIcon","createLabel","suffix","list","checked","radio","faux","aria-hidden","insertAdjacentHTML","tooltips","percent","clientRect","getBoundingClientRect","visible","_toggle","touch","pageX","left","parseFloat","setting","tab","tabs","pane","panes","toggleTab","checkMenu","sort","a","b","sorting","getLabel","createMenuItem","createBadge","getBadge","updateSetting","lang","default","unshift","_this4","values","form","isMenuItem","isButton","stopPropagation","clone","position","opacity","scrollWidth","scrollHeight","getElementById","transitions","reducedMotion","size","getTabSize","restore","propertyName","createButton","createRange","createProgress","createTime","inner","home","_this5","back","setQualityMenu","getQualityOptions","setSpeedMenu","loadSprite","create","findElements","repaint","labels","_this6","Listeners","lastKey","handleKey","toggleMenu","firstTouch","code","which","repeat","altKey","ctrlKey","metaKey","editable","togglePlay","increaseVolume","decreaseVolume","forward","toggleCaptions","isTouch","keyboard","global","tabFocus","hideControls","durationUpdate","hasAudio","showPosterOnEnd","checkLoading","ads","initialized","managerPromise","clickToPlay","ended","disableContextMenu","set","inputEvent","proxy","defaultHandler","customHandlerKey","customHandler","returned","hasCustomHandler","showTab","toggleInvert","hover","webkitDirectionInvertedFromDevice","direction","deltaY","deltaX","Storage","store","json","removeItem","Ads","publisherId","manager","loader","cuePoints","safetyTimer","countdownTimer","google","ima","loadScript","urls","googleIMA","trigger","startSafetyTimer","clearSafetyTimer","setupIMA","setVpaidMode","ImaSdkSettings","VpaidMode","ENABLED","setLocale","displayContainer","AdDisplayContainer","requestAds","AdsLoader","AdsManagerLoadedEvent","Type","ADS_MANAGER_LOADED","onAdsManagerLoaded","AdErrorEvent","AD_ERROR","onAdError","AdsRequest","adTagUrl","tagUrl","linearAdSlotWidth","offsetWidth","linearAdSlotHeight","nonLinearAdSlotWidth","nonLinearAdSlotHeight","forceNonLinearFullSlot","setInterval","getRemainingTime","AdsRenderingSettings","restoreCustomPlaybackStateOnAdBreakComplete","enablePreloading","getAdsManager","getCuePoints","cuePoint","seekElement","cuePercentage","cues","setVolume","AdEvent","onAdEvent","ad","getAd","_this7","LOADED","pollCountdown","isLinear","ALL_ADS_COMPLETED","loadAds","CONTENT_PAUSE_REQUESTED","pauseContent","CONTENT_RESUME_REQUESTED","resumeContent","STARTED","MIDPOINT","COMPLETE","IMPRESSION","CLICK","cancel","contentComplete","_this8","seekedTime","discardAdBreak","resize","ViewMode","NORMAL","initialize","_this9","init","start","adError","zIndex","_this10","destroy","handlers","handler","_this11","Date","now","base","buildUrlParams","mapQualityUnit","setAspectRatio","YT","Player","onYouTubeReadyCallbacks","onYouTubeIframeAPIReady","videoId","getVideoData","items","snippet","paddingBottom","currentId","parseYouTubeId","generateId","replaceElement","autoplay","message","instance","playbackRate","getPlaybackRate","getTitle","playVideo","pauseVideo","stop","stopVideo","getDuration","getCurrentTime","seekTo","setPlaybackRate","getPlaybackQuality","setPlaybackQuality","getVideoUrl","getAvailablePlaybackRates","buffering","getVideoLoadedFraction","lastBuffered","build","levels","getAvailableQualityLevels","level","Vimeo","padding","offset","transform","parseVimeoId","disableTextTrack","setCurrentTime","selected","setLoop","currentSrc","all","getVideoWidth","getVideoHeight","dimensions","getAspectRatio","setAutopause","autopause","getVideoTitle","getTextTracks","stripHTML","seconds","wrap","insertElement","attribute","cancelRequests","check","crossorigin","poster","addStyleHook","insertElements","jQuery","original","tagName","getProviderByUrl","getUrlParams","truthy","hasAttribute","step","webkitShowPlaybackTargetPicker","delay","isEnterFullscreen","noTransition","soft","clear","unload","readyState","targetTime","end","fauxDuration","realDuration","mozHasAudio","webkitAudioDecodedByteCount","audioTracks","closest","change","states","webkitPresentationMode","inline"],"mappings":"uLAIA,IAAaA,SACF,gBACE,gBACF,SAGEC,SACF,cACA,SCRLC,YAEO,QAGF,UAGA,YAGG,aAGC,WAGD,UAGF,SACD,WAGG,sBAIO,cAGL,gBAGE,QAGP,oBAGM,gBAGC,mBAGG,sBAGG,cAGR,aACA,eACH,gDAGG,wDAIC,aAEL,KACA,KACA,KACA,KACA,KACA,IACA,IACA,IACA,IACA,IACA,0BAMI,mBAOE,WAEN,GACA,IACA,EACA,KACA,IACA,KACA,uBAMK,UACD,uBAKE,QACJ,qBAKE,YACGC,UAAUC,UAAYD,UAAUE,cAAcC,MAAM,KAAK,yBAK3D,YACC,aACC,qBAKF,MACJ,kBAKL,+BAMA,eACA,OACA,SACA,WACA,WACA,MACA,UACA,wBAGA,WACA,UACA,uBAKS,iBACD,8BACF,aACC,oBACM,+BACP,cACE,kBACE,uBACG,wBACH,kBACF,cACF,cACE,wBACQ,kCACC,mCACA,kCACD,6BACJ,8BACF,oBACA,iBACH,eACC,iBACC,eACH,aACC,YACF,UACA,YACE,iBACG,mBACD,wBACM,uBAMN,uDAGA,qDAGA,uEAMH,UACA,WACC,aACE,YACD,iBACK,UACP,YACE,cACE,gBACE,SACP,aACI,WACF,aACE,UACH,cACI,sBAQV,WACA,UACA,UACA,UACA,UACA,iBACA,YACA,aACA,iBACA,aACA,eACA,OACA,QACA,QACA,UACA,SACA,UACA,aACA,8BAIA,iBACA,kBACA,mBACA,iBACA,iBACA,gBACA,sBAIA,gBACA,+BAIA,kBACA,mBACA,YACA,cACA,cACA,iBACA,gBACA,gCAMU,uDACC,4BAEI,aACF,0BAEL,4BAEE,2BACC,8BACE,+BACD,mCACK,kCACP,8BACI,oCACE,+BACP,4BACI,iCACC,8BACJ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0R,QAIA1R,KAAAuR,MAAAtF,aAAA,UAHA,oCAUAlM,OACAyH,EAAA1H,EAAAsD,GAAA+I,QAAApM,GAAAA,EAAAC,KAAAqI,OAAAuhB,cACAvhB,OAAAuhB,SAAApiB,yBAOA/G,QAAAT,KAAAqI,OAAAuhB,yCAsCA7pB,MAEAD,EAAAsD,GAAA9B,OAAAvB,MAKAD,EAAAsD,GAAAgB,MAAArE,QACA4gB,gBAAA,YAKAvlB,EAAA2E,EAAA2N,cAGA1N,KAAAuL,QAAArC,SAAAjB,SAAA7M,SAMAulB,gBAAA,GAGA,YAAAvlB,GAKA4E,KAAA5E,WAAAA,SAKA8N,SAAA9N,SAAAA,IAGAwb,QAAAta,KAAA0D,KAAA,QAGA+V,YAAAzZ,KAAA0D,QAGA8L,cAAAxP,KAAA0D,KAAAA,KAAAuR,MAAA,yBA3BAxH,MAAAC,KAAA,gCAAA5O,2BAkCA4E,KAAAkJ,SAAA9N,mCAQA2E,OACA6uB,EACA,qBADAA,EAEA,YAIAjrB,EAAAoF,SAKAvB,EAAA1H,EAAAsD,GAAA+I,QAAApM,GAAAA,EAAAC,KAAA+I,MAAA6lB,OAGArd,MAAAF,0BAAA7J,EAAAonB,EAAAA,2BAOAjrB,EAAAoF,IAIA/I,KAAAuR,MAAAsd,uBAHA,yCAyRA1wB,EAAAuS,EAAAoe,UACAnrB,EAAAmpB,MAAA3uB,EAAAuS,EAAAoe,sCAQA5sB,EAAAiB,UACArD,EAAAuf,WAAAnd,EAAAiB,SArsCAhD","file":"plyr.min.js","sourcesContent":["// ==========================================================================\n// Plyr supported types and providers\n// ==========================================================================\n\nexport const providers = {\n    html5: 'html5',\n    youtube: 'youtube',\n    vimeo: 'vimeo',\n};\n\nexport const types = {\n    audio: 'audio',\n    video: 'video',\n};\n\nexport default { providers, types };\n","// ==========================================================================\n// Plyr default config\n// ==========================================================================\n\nconst defaults = {\n    // Disable\n    enabled: true,\n\n    // Custom media title\n    title: '',\n\n    // Logging to console\n    debug: false,\n\n    // Auto play (if supported)\n    autoplay: false,\n\n    // Only allow one media playing at once (vimeo only)\n    autopause: true,\n\n    // Default time to skip when rewind/fast forward\n    seekTime: 10,\n\n    // Default volume\n    volume: 1,\n    muted: false,\n\n    // Pass a custom duration\n    duration: null,\n\n    // Display the media duration on load in the current time position\n    // If you have opted to display both duration and currentTime, this is ignored\n    displayDuration: true,\n\n    // Invert the current time to be a countdown\n    invertTime: true,\n\n    // Clicking the currentTime inverts it's value to show time left rather than elapsed\n    toggleInvert: true,\n\n    // Aspect ratio (for embeds)\n    ratio: '16:9',\n\n    // Click video container to play/pause\n    clickToPlay: true,\n\n    // Auto hide the controls\n    hideControls: true,\n\n    // Revert to poster on finish (HTML5 - will cause reload)\n    showPosterOnEnd: false,\n\n    // Disable the standard context menu\n    disableContextMenu: true,\n\n    // Sprite (for icons)\n    loadSprite: true,\n    iconPrefix: 'plyr',\n    iconUrl: 'https://cdn.plyr.io/3.1.0/plyr.svg',\n\n    // Blank video (used to prevent errors on source change)\n    blankVideo: 'https://cdn.plyr.io/static/blank.mp4',\n\n    // Quality default\n    quality: {\n        default: 576,\n        options: [\n            4320,\n            2880,\n            2160,\n            1440,\n            1080,\n            720,\n            576,\n            480,\n            360,\n            240,\n            'default', // YouTube's \"auto\"\n        ],\n    },\n\n    // Set loops\n    loop: {\n        active: false,\n        // start: null,\n        // end: null,\n    },\n\n    // Speed default and options to display\n    speed: {\n        selected: 1,\n        options: [\n            0.5,\n            0.75,\n            1,\n            1.25,\n            1.5,\n            1.75,\n            2,\n        ],\n    },\n\n    // Keyboard shortcut settings\n    keyboard: {\n        focused: true,\n        global: false,\n    },\n\n    // Display tooltips\n    tooltips: {\n        controls: false,\n        seek: true,\n    },\n\n    // Captions settings\n    captions: {\n        active: false,\n        language: (navigator.language || navigator.userLanguage).split('-')[0],\n    },\n\n    // Fullscreen settings\n    fullscreen: {\n        enabled: true, // Allow fullscreen?\n        fallback: true, // Fallback for vintage browsers\n        iosNative: false, // Use the native fullscreen in iOS (disables custom controls)\n    },\n\n    // Local storage\n    storage: {\n        enabled: true,\n        key: 'plyr',\n    },\n\n    // Default controls\n    controls: [\n        'play-large',\n        // 'restart',\n        // 'rewind',\n        'play',\n        // 'fast-forward',\n        'progress',\n        'current-time',\n        'mute',\n        'volume',\n        'captions',\n        'settings',\n        'pip',\n        'airplay',\n        'fullscreen',\n    ],\n    settings: [\n        'captions',\n        'quality',\n        'speed',\n    ],\n\n    // Localisation\n    i18n: {\n        restart: 'Restart',\n        rewind: 'Rewind {seektime} secs',\n        play: 'Play',\n        pause: 'Pause',\n        fastForward: 'Forward {seektime} secs',\n        seek: 'Seek',\n        played: 'Played',\n        buffered: 'Buffered',\n        currentTime: 'Current time',\n        duration: 'Duration',\n        volume: 'Volume',\n        mute: 'Mute',\n        unmute: 'Unmute',\n        enableCaptions: 'Enable captions',\n        disableCaptions: 'Disable captions',\n        enterFullscreen: 'Enter fullscreen',\n        exitFullscreen: 'Exit fullscreen',\n        frameTitle: 'Player for {title}',\n        captions: 'Captions',\n        settings: 'Settings',\n        speed: 'Speed',\n        normal: 'Normal',\n        quality: 'Quality',\n        loop: 'Loop',\n        start: 'Start',\n        end: 'End',\n        all: 'All',\n        reset: 'Reset',\n        disabled: 'Disabled',\n        enabled: 'Enabled',\n        advertisement: 'Ad',\n    },\n\n    // URLs\n    urls: {\n        vimeo: {\n            api: 'https://player.vimeo.com/api/player.js',\n        },\n        youtube: {\n            api: 'https://www.youtube.com/iframe_api',\n        },\n        googleIMA: {\n            api: 'https://imasdk.googleapis.com/js/sdkloader/ima3.js',\n        },\n    },\n\n    // Custom control listeners\n    listeners: {\n        seek: null,\n        play: null,\n        pause: null,\n        restart: null,\n        rewind: null,\n        fastForward: null,\n        mute: null,\n        volume: null,\n        captions: null,\n        fullscreen: null,\n        pip: null,\n        airplay: null,\n        speed: null,\n        quality: null,\n        loop: null,\n        language: null,\n    },\n\n    // Events to watch and bubble\n    events: [\n        // Events to watch on HTML5 media elements and bubble\n        // https://developer.mozilla.org/en/docs/Web/Guide/Events/Media_events\n        'ended',\n        'progress',\n        'stalled',\n        'playing',\n        'waiting',\n        'canplay',\n        'canplaythrough',\n        'loadstart',\n        'loadeddata',\n        'loadedmetadata',\n        'timeupdate',\n        'volumechange',\n        'play',\n        'pause',\n        'error',\n        'seeking',\n        'seeked',\n        'emptied',\n        'ratechange',\n        'cuechange',\n\n        // Custom events\n        'enterfullscreen',\n        'exitfullscreen',\n        'captionsenabled',\n        'captionsdisabled',\n        'languagechange',\n        'controlshidden',\n        'controlsshown',\n        'ready',\n\n        // YouTube\n        'statechange',\n        'qualitychange',\n        'qualityrequested',\n\n        // Ads\n        'adsloaded',\n        'adscontentpause',\n        'adscontentresume',\n        'adstarted',\n        'adsmidpoint',\n        'adscomplete',\n        'adsallcomplete',\n        'adsimpression',\n        'adsclick',\n    ],\n\n    // Selectors\n    // Change these to match your template if using custom HTML\n    selectors: {\n        editable: 'input, textarea, select, [contenteditable]',\n        container: '.plyr',\n        controls: {\n            container: null,\n            wrapper: '.plyr__controls',\n        },\n        labels: '[data-plyr]',\n        buttons: {\n            play: '[data-plyr=\"play\"]',\n            pause: '[data-plyr=\"pause\"]',\n            restart: '[data-plyr=\"restart\"]',\n            rewind: '[data-plyr=\"rewind\"]',\n            fastForward: '[data-plyr=\"fast-forward\"]',\n            mute: '[data-plyr=\"mute\"]',\n            captions: '[data-plyr=\"captions\"]',\n            fullscreen: '[data-plyr=\"fullscreen\"]',\n            pip: '[data-plyr=\"pip\"]',\n            airplay: '[data-plyr=\"airplay\"]',\n            settings: '[data-plyr=\"settings\"]',\n            loop: '[data-plyr=\"loop\"]',\n        },\n        inputs: {\n            seek: '[data-plyr=\"seek\"]',\n            volume: '[data-plyr=\"volume\"]',\n            speed: '[data-plyr=\"speed\"]',\n            language: '[data-plyr=\"language\"]',\n            quality: '[data-plyr=\"quality\"]',\n        },\n        display: {\n            currentTime: '.plyr__time--current',\n            duration: '.plyr__time--duration',\n            buffer: '.plyr__progress--buffer',\n            played: '.plyr__progress--played',\n            loop: '.plyr__progress--loop',\n            volume: '.plyr__volume--display',\n        },\n        progress: '.plyr__progress',\n        captions: '.plyr__captions',\n        menu: {\n            quality: '.js-plyr__menu__list--quality',\n        },\n    },\n\n    // Class hooks added to the player in different states\n    classNames: {\n        video: 'plyr__video-wrapper',\n        embed: 'plyr__video-embed',\n        ads: 'plyr__ads',\n        control: 'plyr__control',\n        type: 'plyr--{0}',\n        provider: 'plyr--{0}',\n        stopped: 'plyr--stopped',\n        playing: 'plyr--playing',\n        loading: 'plyr--loading',\n        error: 'plyr--has-error',\n        hover: 'plyr--hover',\n        tooltip: 'plyr__tooltip',\n        cues: 'plyr__cues',\n        hidden: 'plyr__sr-only',\n        hideControls: 'plyr--hide-controls',\n        isIos: 'plyr--is-ios',\n        isTouch: 'plyr--is-touch',\n        uiSupported: 'plyr--full-ui',\n        noTransition: 'plyr--no-transition',\n        menu: {\n            value: 'plyr__menu__value',\n            badge: 'plyr__badge',\n            open: 'plyr--menu-open',\n        },\n        captions: {\n            enabled: 'plyr--captions-enabled',\n            active: 'plyr--captions-active',\n        },\n        fullscreen: {\n            enabled: 'plyr--fullscreen-enabled',\n            fallback: 'plyr--fullscreen-fallback',\n        },\n        pip: {\n            supported: 'plyr--pip-supported',\n            active: 'plyr--pip-active',\n        },\n        airplay: {\n            supported: 'plyr--airplay-supported',\n            active: 'plyr--airplay-active',\n        },\n        tabFocus: 'plyr__tab-focus',\n    },\n\n    // Embed attributes\n    attributes: {\n        embed: {\n            provider: 'data-plyr-provider',\n            id: 'data-plyr-embed-id',\n        },\n    },\n\n    // API keys\n    keys: {\n        google: null,\n    },\n\n    // Advertisements plugin\n    // Register for an account here: http://vi.ai/publisher-video-monetization/?aid=plyrio\n    ads: {\n        enabled: false,\n        publisherId: '',\n    },\n};\n\nexport default defaults;\n","// ==========================================================================\n// Plyr support checks\n// ==========================================================================\n\nimport utils from './utils';\n\n// Check for feature support\nconst support = {\n    // Basic support\n    audio: 'canPlayType' in document.createElement('audio'),\n    video: 'canPlayType' in document.createElement('video'),\n\n    // Check for support\n    // Basic functionality vs full UI\n    check(type, provider, playsinline) {\n        let api = false;\n        let ui = false;\n        const browser = utils.getBrowser();\n        const canPlayInline = browser.isIPhone && playsinline && support.playsinline;\n\n        switch (`${provider}:${type}`) {\n            case 'html5:video':\n                api = support.video;\n                ui = api && support.rangeInput && (!browser.isIPhone || canPlayInline);\n                break;\n\n            case 'html5:audio':\n                api = support.audio;\n                ui = api && support.rangeInput;\n                break;\n\n            case 'youtube:video':\n            case 'vimeo:video':\n                api = true;\n                ui = support.rangeInput && (!browser.isIPhone || canPlayInline);\n                break;\n\n            default:\n                api = support.audio && support.video;\n                ui = api && support.rangeInput;\n        }\n\n        return {\n            api,\n            ui,\n        };\n    },\n\n    // Picture-in-picture support\n    // Safari only currently\n    pip: (() => {\n        const browser = utils.getBrowser();\n        return !browser.isIPhone && utils.is.function(utils.createElement('video').webkitSetPresentationMode);\n    })(),\n\n    // Airplay support\n    // Safari only currently\n    airplay: utils.is.function(window.WebKitPlaybackTargetAvailabilityEvent),\n\n    // Inline playback support\n    // https://webkit.org/blog/6784/new-video-policies-for-ios/\n    playsinline: 'playsInline' in document.createElement('video'),\n\n    // Check for mime type support against a player instance\n    // Credits: http://diveintohtml5.info/everything.html\n    // Related: http://www.leanbackplayer.com/test/h5mt.html\n    mime(type) {\n        const { media } = this;\n\n        try {\n            // Bail if no checking function\n            if (!this.isHTML5 || !utils.is.function(media.canPlayType)) {\n                return false;\n            }\n\n            // Check directly if codecs specified\n            if (type.includes('codecs=')) {\n                return media.canPlayType(type).replace(/no/, '');\n            }\n\n            // Type specific checks\n            if (this.isVideo) {\n                switch (type) {\n                    case 'video/webm':\n                        return media.canPlayType('video/webm; codecs=\"vp8, vorbis\"').replace(/no/, '');\n\n                    case 'video/mp4':\n                        return media.canPlayType('video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"').replace(/no/, '');\n\n                    case 'video/ogg':\n                        return media.canPlayType('video/ogg; codecs=\"theora\"').replace(/no/, '');\n\n                    default:\n                        return false;\n                }\n            } else if (this.isAudio) {\n                switch (type) {\n                    case 'audio/mpeg':\n                        return media.canPlayType('audio/mpeg;').replace(/no/, '');\n\n                    case 'audio/ogg':\n                        return media.canPlayType('audio/ogg; codecs=\"vorbis\"').replace(/no/, '');\n\n                    case 'audio/wav':\n                        return media.canPlayType('audio/wav; codecs=\"1\"').replace(/no/, '');\n\n                    default:\n                        return false;\n                }\n            }\n        } catch (e) {\n            return false;\n        }\n\n        // If we got this far, we're stuffed\n        return false;\n    },\n\n    // Check for textTracks support\n    textTracks: 'textTracks' in document.createElement('video'),\n\n    // Check for passive event listener support\n    // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n    // https://www.youtube.com/watch?v=NPM6172J22g\n    passiveListeners: (() => {\n        // Test via a getter in the options object to see if the passive property is accessed\n        let supported = false;\n        try {\n            const options = Object.defineProperty({}, 'passive', {\n                get() {\n                    supported = true;\n                    return null;\n                },\n            });\n            window.addEventListener('test', null, options);\n        } catch (e) {\n            // Do nothing\n        }\n\n        return supported;\n    })(),\n\n    // <input type=\"range\"> Sliders\n    rangeInput: (() => {\n        const range = document.createElement('input');\n        range.type = 'range';\n        return range.type === 'range';\n    })(),\n\n    // Touch\n    // NOTE: Remember a device can be mouse + touch enabled so we check on first touch event\n    touch: 'ontouchstart' in document.documentElement,\n\n    // Detect transitions support\n    transitions: utils.transitionEndEvent !== false,\n\n    // Reduced motion iOS & MacOS setting\n    // https://webkit.org/blog/7551/responsive-design-for-motion/\n    reducedMotion: 'matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches,\n};\n\nexport default support;\n","(function(root, factory) {\n  if (typeof define === 'function' && define.amd) {\n    define([], factory);\n  } else if (typeof exports === 'object') {\n    module.exports = factory();\n  } else {\n    root.loadjs = factory();\n  }\n}(this, function() {\n/**\n * Global dependencies.\n * @global {Object} document - DOM\n */\n\nvar devnull = function() {},\n    bundleIdCache = {},\n    bundleResultCache = {},\n    bundleCallbackQueue = {};\n\n\n/**\n * Subscribe to bundle load event.\n * @param {string[]} bundleIds - Bundle ids\n * @param {Function} callbackFn - The callback function\n */\nfunction subscribe(bundleIds, callbackFn) {\n  // listify\n  bundleIds = bundleIds.push ? bundleIds : [bundleIds];\n\n  var depsNotFound = [],\n      i = bundleIds.length,\n      numWaiting = i,\n      fn,\n      bundleId,\n      r,\n      q;\n\n  // define callback function\n  fn = function (bundleId, pathsNotFound) {\n    if (pathsNotFound.length) depsNotFound.push(bundleId);\n\n    numWaiting--;\n    if (!numWaiting) callbackFn(depsNotFound);\n  };\n\n  // register callback\n  while (i--) {\n    bundleId = bundleIds[i];\n\n    // execute callback if in result cache\n    r = bundleResultCache[bundleId];\n    if (r) {\n      fn(bundleId, r);\n      continue;\n    }\n\n    // add to callback queue\n    q = bundleCallbackQueue[bundleId] = bundleCallbackQueue[bundleId] || [];\n    q.push(fn);\n  }\n}\n\n\n/**\n * Publish bundle load event.\n * @param {string} bundleId - Bundle id\n * @param {string[]} pathsNotFound - List of files not found\n */\nfunction publish(bundleId, pathsNotFound) {\n  // exit if id isn't defined\n  if (!bundleId) return;\n\n  var q = bundleCallbackQueue[bundleId];\n\n  // cache result\n  bundleResultCache[bundleId] = pathsNotFound;\n\n  // exit if queue is empty\n  if (!q) return;\n\n  // empty callback queue\n  while (q.length) {\n    q[0](bundleId, pathsNotFound);\n    q.splice(0, 1);\n  }\n}\n\n\n/**\n * Execute callbacks.\n * @param {Object or Function} args - The callback args\n * @param {string[]} depsNotFound - List of dependencies not found\n */\nfunction executeCallbacks(args, depsNotFound) {\n  // accept function as argument\n  if (args.call) args = {success: args};\n\n  // success and error callbacks\n  if (depsNotFound.length) (args.error || devnull)(depsNotFound);\n  else (args.success || devnull)(args);\n}\n\n\n/**\n * Load individual file.\n * @param {string} path - The file path\n * @param {Function} callbackFn - The callback function\n */\nfunction loadFile(path, callbackFn, args, numTries) {\n  var doc = document,\n      async = args.async,\n      maxTries = (args.numRetries || 0) + 1,\n      beforeCallbackFn = args.before || devnull,\n      pathStripped = path.replace(/^(css|img)!/, ''),\n      isCss,\n      e;\n\n  numTries = numTries || 0;\n\n  if (/(^css!|\\.css$)/.test(path)) {\n    isCss = true;\n\n    // css\n    e = doc.createElement('link');\n    e.rel = 'stylesheet';\n    e.href = pathStripped; //.replace(/^css!/, '');  // remove \"css!\" prefix\n  } else if (/(^img!|\\.(png|gif|jpg|svg)$)/.test(path)) {\n    // image\n    e = doc.createElement('img');\n    e.src = pathStripped;    \n  } else {\n    // javascript\n    e = doc.createElement('script');\n    e.src = path;\n    e.async = async === undefined ? true : async;\n  }\n\n  e.onload = e.onerror = e.onbeforeload = function (ev) {\n    var result = ev.type[0];\n\n    // Note: The following code isolates IE using `hideFocus` and treats empty\n    // stylesheets as failures to get around lack of onerror support\n    if (isCss && 'hideFocus' in e) {\n      try {\n        if (!e.sheet.cssText.length) result = 'e';\n      } catch (x) {\n        // sheets objects created from load errors don't allow access to\n        // `cssText`\n        result = 'e';\n      }\n    }\n\n    // handle retries in case of load failure\n    if (result == 'e') {\n      // increment counter\n      numTries += 1;\n\n      // exit function and try again\n      if (numTries < maxTries) {\n        return loadFile(path, callbackFn, args, numTries);\n      }\n    }\n\n    // execute callback\n    callbackFn(path, result, ev.defaultPrevented);\n  };\n\n  // add to document (unless callback returns `false`)\n  if (beforeCallbackFn(path, e) !== false) doc.head.appendChild(e);\n}\n\n\n/**\n * Load multiple files.\n * @param {string[]} paths - The file paths\n * @param {Function} callbackFn - The callback function\n */\nfunction loadFiles(paths, callbackFn, args) {\n  // listify paths\n  paths = paths.push ? paths : [paths];\n\n  var numWaiting = paths.length,\n      x = numWaiting,\n      pathsNotFound = [],\n      fn,\n      i;\n\n  // define callback function\n  fn = function(path, result, defaultPrevented) {\n    // handle error\n    if (result == 'e') pathsNotFound.push(path);\n\n    // handle beforeload event. If defaultPrevented then that means the load\n    // will be blocked (ex. Ghostery/ABP on Safari)\n    if (result == 'b') {\n      if (defaultPrevented) pathsNotFound.push(path);\n      else return;\n    }\n\n    numWaiting--;\n    if (!numWaiting) callbackFn(pathsNotFound);\n  };\n\n  // load scripts\n  for (i=0; i < x; i++) loadFile(paths[i], fn, args);\n}\n\n\n/**\n * Initiate script load and register bundle.\n * @param {(string|string[])} paths - The file paths\n * @param {(string|Function)} [arg1] - The bundleId or success callback\n * @param {Function} [arg2] - The success or error callback\n * @param {Function} [arg3] - The error callback\n */\nfunction loadjs(paths, arg1, arg2) {\n  var bundleId,\n      args;\n\n  // bundleId (if string)\n  if (arg1 && arg1.trim) bundleId = arg1;\n\n  // args (default is {})\n  args = (bundleId ? arg2 : arg1) || {};\n\n  // throw error if bundle is already defined\n  if (bundleId) {\n    if (bundleId in bundleIdCache) {\n      throw \"LoadJS\";\n    } else {\n      bundleIdCache[bundleId] = true;\n    }\n  }\n\n  // load scripts\n  loadFiles(paths, function (pathsNotFound) {\n    // execute callbacks\n    executeCallbacks(args, pathsNotFound);\n\n    // publish bundle load event\n    publish(bundleId, pathsNotFound);\n  }, args);\n}\n\n\n/**\n * Execute callbacks when dependencies have been satisfied.\n * @param {(string|string[])} deps - List of bundle ids\n * @param {Object} args - success/error arguments\n */\nloadjs.ready = function ready(deps, args) {\n  // subscribe to bundle load event\n  subscribe(deps, function (depsNotFound) {\n    // execute callbacks\n    executeCallbacks(args, depsNotFound);\n  });\n\n  return loadjs;\n};\n\n\n/**\n * Manually satisfy bundle dependencies.\n * @param {string} bundleId - The bundle id\n */\nloadjs.done = function done(bundleId) {\n  publish(bundleId, []);\n};\n\n\n/**\n * Reset loadjs dependencies statuses\n */\nloadjs.reset = function reset() {\n  bundleIdCache = {};\n  bundleResultCache = {};\n  bundleCallbackQueue = {};\n};\n\n\n/**\n * Determine if bundle has already been defined\n * @param String} bundleId - The bundle id\n */\nloadjs.isDefined = function isDefined(bundleId) {\n  return bundleId in bundleIdCache;\n};\n\n\n// export\nreturn loadjs;\n\n}));\n","// ==========================================================================\n// Plyr utils\n// ==========================================================================\n\nimport loadjs from 'loadjs';\n\nimport support from './support';\nimport { providers } from './types';\n\nconst utils = {\n    // Check variable types\n    is: {\n        plyr(input) {\n            return this.instanceof(input, window.Plyr);\n        },\n        object(input) {\n            return this.getConstructor(input) === Object;\n        },\n        number(input) {\n            return this.getConstructor(input) === Number && !Number.isNaN(input);\n        },\n        string(input) {\n            return this.getConstructor(input) === String;\n        },\n        boolean(input) {\n            return this.getConstructor(input) === Boolean;\n        },\n        function(input) {\n            return this.getConstructor(input) === Function;\n        },\n        array(input) {\n            return !this.nullOrUndefined(input) && Array.isArray(input);\n        },\n        weakMap(input) {\n            return this.instanceof(input, window.WeakMap);\n        },\n        nodeList(input) {\n            return this.instanceof(input, window.NodeList);\n        },\n        element(input) {\n            return this.instanceof(input, window.Element);\n        },\n        textNode(input) {\n            return this.getConstructor(input) === Text;\n        },\n        event(input) {\n            return this.instanceof(input, window.Event);\n        },\n        cue(input) {\n            return this.instanceof(input, window.TextTrackCue) || this.instanceof(input, window.VTTCue);\n        },\n        track(input) {\n            return this.instanceof(input, TextTrack) || (!this.nullOrUndefined(input) && this.string(input.kind));\n        },\n        url(input) {\n            return !this.nullOrUndefined(input) && /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-/]))?/.test(input);\n        },\n        nullOrUndefined(input) {\n            return input === null || typeof input === 'undefined';\n        },\n        empty(input) {\n            return (\n                this.nullOrUndefined(input) ||\n                ((this.string(input) || this.array(input) || this.nodeList(input)) && !input.length) ||\n                (this.object(input) && !Object.keys(input).length)\n            );\n        },\n        instanceof(input, constructor) {\n            return Boolean(input && constructor && input instanceof constructor);\n        },\n        getConstructor(input) {\n            return !this.nullOrUndefined(input) ? input.constructor : null;\n        },\n    },\n\n    // Unfortunately, due to mixed support, UA sniffing is required\n    getBrowser() {\n        return {\n            isIE: /* @cc_on!@ */ false || !!document.documentMode,\n            isWebkit: 'WebkitAppearance' in document.documentElement.style && !/Edge/.test(navigator.userAgent),\n            isIPhone: /(iPhone|iPod)/gi.test(navigator.platform),\n            isIos: /(iPad|iPhone|iPod)/gi.test(navigator.platform),\n        };\n    },\n\n    // Fetch wrapper\n    // Using XHR to avoid issues with older browsers\n    fetch(url, responseType = 'text') {\n        return new Promise((resolve, reject) => {\n            try {\n                const request = new XMLHttpRequest();\n\n                // Check for CORS support\n                if (!('withCredentials' in request)) {\n                    return;\n                }\n\n                request.addEventListener('load', () => {\n                    if (responseType === 'text') {\n                        try {\n                            resolve(JSON.parse(request.responseText));\n                        } catch (e) {\n                            resolve(request.responseText);\n                        }\n                    } else {\n                        resolve(request.response);\n                    }\n                });\n\n                request.addEventListener('error', () => {\n                    throw new Error(request.statusText);\n                });\n\n                request.open('GET', url, true);\n\n                // Set the required response type\n                request.responseType = responseType;\n\n                request.send();\n            } catch (e) {\n                reject(e);\n            }\n        });\n    },\n\n    // Load an external script\n    loadScript(url) {\n        return new Promise((resolve, reject) => {\n            loadjs(url, {\n                success: resolve,\n                error: reject,\n            });\n        });\n    },\n\n    // Load an external SVG sprite\n    loadSprite(url, id) {\n        if (!utils.is.string(url)) {\n            return;\n        }\n\n        const prefix = 'cache-';\n        const hasId = utils.is.string(id);\n        let isCached = false;\n\n        const exists = () => document.querySelectorAll(`#${id}`).length;\n\n        function injectSprite(data) {\n            // Check again incase of race condition\n            if (hasId && exists()) {\n                return;\n            }\n\n            // Inject content\n            this.innerHTML = data;\n\n            // Inject the SVG to the body\n            document.body.insertBefore(this, document.body.childNodes[0]);\n        }\n\n        // Only load once if ID set\n        if (!hasId || !exists()) {\n            // Create container\n            const container = document.createElement('div');\n            utils.toggleHidden(container, true);\n\n            if (hasId) {\n                container.setAttribute('id', id);\n            }\n\n            // Check in cache\n            if (support.storage) {\n                const cached = window.localStorage.getItem(prefix + id);\n                isCached = cached !== null;\n\n                if (isCached) {\n                    const data = JSON.parse(cached);\n                    injectSprite.call(container, data.content);\n                    return;\n                }\n            }\n\n            // Get the sprite\n            utils\n                .fetch(url)\n                .then(result => {\n                    if (utils.is.empty(result)) {\n                        return;\n                    }\n\n                    if (support.storage) {\n                        window.localStorage.setItem(\n                            prefix + id,\n                            JSON.stringify({\n                                content: result,\n                            }),\n                        );\n                    }\n\n                    injectSprite.call(container, result);\n                })\n                .catch(() => {});\n        }\n    },\n\n    // Generate a random ID\n    generateId(prefix) {\n        return `${prefix}-${Math.floor(Math.random() * 10000)}`;\n    },\n\n    // Wrap an element\n    wrap(elements, wrapper) {\n        // Convert `elements` to an array, if necessary.\n        const targets = elements.length ? elements : [elements];\n\n        // Loops backwards to prevent having to clone the wrapper on the\n        // first element (see `child` below).\n        Array.from(targets)\n            .reverse()\n            .forEach((element, index) => {\n                const child = index > 0 ? wrapper.cloneNode(true) : wrapper;\n\n                // Cache the current parent and sibling.\n                const parent = element.parentNode;\n                const sibling = element.nextSibling;\n\n                // Wrap the element (is automatically removed from its current\n                // parent).\n                child.appendChild(element);\n\n                // If the element had a sibling, insert the wrapper before\n                // the sibling to maintain the HTML structure; otherwise, just\n                // append it to the parent.\n                if (sibling) {\n                    parent.insertBefore(child, sibling);\n                } else {\n                    parent.appendChild(child);\n                }\n            });\n    },\n\n    // Create a DocumentFragment\n    createElement(type, attributes, text) {\n        // Create a new <element>\n        const element = document.createElement(type);\n\n        // Set all passed attributes\n        if (utils.is.object(attributes)) {\n            utils.setAttributes(element, attributes);\n        }\n\n        // Add text node\n        if (utils.is.string(text)) {\n            element.textContent = text;\n        }\n\n        // Return built element\n        return element;\n    },\n\n    // Inaert an element after another\n    insertAfter(element, target) {\n        target.parentNode.insertBefore(element, target.nextSibling);\n    },\n\n    // Insert a DocumentFragment\n    insertElement(type, parent, attributes, text) {\n        // Inject the new <element>\n        parent.appendChild(utils.createElement(type, attributes, text));\n    },\n\n    // Remove an element\n    removeElement(element) {\n        if (!utils.is.element(element) || !utils.is.element(element.parentNode)) {\n            return;\n        }\n\n        if (utils.is.nodeList(element) || utils.is.array(element)) {\n            Array.from(element).forEach(utils.removeElement);\n            return;\n        }\n\n        element.parentNode.removeChild(element);\n    },\n\n    // Remove all child elements\n    emptyElement(element) {\n        let { length } = element.childNodes;\n\n        while (length > 0) {\n            element.removeChild(element.lastChild);\n            length -= 1;\n        }\n    },\n\n    // Replace element\n    replaceElement(newChild, oldChild) {\n        if (!utils.is.element(oldChild) || !utils.is.element(oldChild.parentNode) || !utils.is.element(newChild)) {\n            return null;\n        }\n\n        oldChild.parentNode.replaceChild(newChild, oldChild);\n\n        return newChild;\n    },\n\n    // Set attributes\n    setAttributes(element, attributes) {\n        if (!utils.is.element(element) || utils.is.empty(attributes)) {\n            return;\n        }\n\n        Object.entries(attributes).forEach(([\n            key,\n            value,\n        ]) => {\n            element.setAttribute(key, value);\n        });\n    },\n\n    // Get an attribute object from a string selector\n    getAttributesFromSelector(sel, existingAttributes) {\n        // For example:\n        // '.test' to { class: 'test' }\n        // '#test' to { id: 'test' }\n        // '[data-test=\"test\"]' to { 'data-test': 'test' }\n\n        if (!utils.is.string(sel) || utils.is.empty(sel)) {\n            return {};\n        }\n\n        const attributes = {};\n        const existing = existingAttributes;\n\n        sel.split(',').forEach(s => {\n            // Remove whitespace\n            const selector = s.trim();\n            const className = selector.replace('.', '');\n            const stripped = selector.replace(/[[\\]]/g, '');\n\n            // Get the parts and value\n            const parts = stripped.split('=');\n            const key = parts[0];\n            const value = parts.length > 1 ? parts[1].replace(/[\"']/g, '') : '';\n\n            // Get the first character\n            const start = selector.charAt(0);\n\n            switch (start) {\n                case '.':\n                    // Add to existing classname\n                    if (utils.is.object(existing) && utils.is.string(existing.class)) {\n                        existing.class += ` ${className}`;\n                    }\n\n                    attributes.class = className;\n                    break;\n\n                case '#':\n                    // ID selector\n                    attributes.id = selector.replace('#', '');\n                    break;\n\n                case '[':\n                    // Attribute selector\n                    attributes[key] = value;\n\n                    break;\n\n                default:\n                    break;\n            }\n        });\n\n        return attributes;\n    },\n\n    // Toggle class on an element\n    toggleClass(element, className, toggle) {\n        if (utils.is.element(element)) {\n            const contains = element.classList.contains(className);\n\n            element.classList[toggle ? 'add' : 'remove'](className);\n\n            return (toggle && !contains) || (!toggle && contains);\n        }\n\n        return null;\n    },\n\n    // Has class name\n    hasClass(element, className) {\n        return utils.is.element(element) && element.classList.contains(className);\n    },\n\n    // Toggle hidden attribute on an element\n    toggleHidden(element, toggle) {\n        if (!utils.is.element(element)) {\n            return;\n        }\n\n        if (toggle) {\n            element.setAttribute('hidden', '');\n        } else {\n            element.removeAttribute('hidden');\n        }\n    },\n\n    // Element matches selector\n    matches(element, selector) {\n        const prototype = { Element };\n\n        function match() {\n            return Array.from(document.querySelectorAll(selector)).includes(this);\n        }\n\n        const matches = prototype.matches || prototype.webkitMatchesSelector || prototype.mozMatchesSelector || prototype.msMatchesSelector || match;\n\n        return matches.call(element, selector);\n    },\n\n    // Find all elements\n    getElements(selector) {\n        return this.elements.container.querySelectorAll(selector);\n    },\n\n    // Find a single element\n    getElement(selector) {\n        return this.elements.container.querySelector(selector);\n    },\n\n    // Find the UI controls and store references in custom controls\n    // TODO: Allow settings menus with custom controls\n    findElements() {\n        try {\n            this.elements.controls = utils.getElement.call(this, this.config.selectors.controls.wrapper);\n\n            // Buttons\n            this.elements.buttons = {\n                play: utils.getElements.call(this, this.config.selectors.buttons.play),\n                pause: utils.getElement.call(this, this.config.selectors.buttons.pause),\n                restart: utils.getElement.call(this, this.config.selectors.buttons.restart),\n                rewind: utils.getElement.call(this, this.config.selectors.buttons.rewind),\n                fastForward: utils.getElement.call(this, this.config.selectors.buttons.fastForward),\n                mute: utils.getElement.call(this, this.config.selectors.buttons.mute),\n                pip: utils.getElement.call(this, this.config.selectors.buttons.pip),\n                airplay: utils.getElement.call(this, this.config.selectors.buttons.airplay),\n                settings: utils.getElement.call(this, this.config.selectors.buttons.settings),\n                captions: utils.getElement.call(this, this.config.selectors.buttons.captions),\n                fullscreen: utils.getElement.call(this, this.config.selectors.buttons.fullscreen),\n            };\n\n            // Progress\n            this.elements.progress = utils.getElement.call(this, this.config.selectors.progress);\n\n            // Inputs\n            this.elements.inputs = {\n                seek: utils.getElement.call(this, this.config.selectors.inputs.seek),\n                volume: utils.getElement.call(this, this.config.selectors.inputs.volume),\n            };\n\n            // Display\n            this.elements.display = {\n                buffer: utils.getElement.call(this, this.config.selectors.display.buffer),\n                duration: utils.getElement.call(this, this.config.selectors.display.duration),\n                currentTime: utils.getElement.call(this, this.config.selectors.display.currentTime),\n            };\n\n            // Seek tooltip\n            if (utils.is.element(this.elements.progress)) {\n                this.elements.display.seekTooltip = this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`);\n            }\n\n            return true;\n        } catch (error) {\n            // Log it\n            this.debug.warn('It looks like there is a problem with your custom controls HTML', error);\n\n            // Restore native video controls\n            this.toggleNativeControls(true);\n\n            return false;\n        }\n    },\n\n    // Get the focused element\n    getFocusElement() {\n        let focused = document.activeElement;\n\n        if (!focused || focused === document.body) {\n            focused = null;\n        } else {\n            focused = document.querySelector(':focus');\n        }\n\n        return focused;\n    },\n\n    // Trap focus inside container\n    trapFocus(element = null, toggle = false) {\n        if (!utils.is.element(element)) {\n            return;\n        }\n\n        const focusable = utils.getElements.call(this, 'button:not(:disabled), input:not(:disabled), [tabindex]');\n        const first = focusable[0];\n        const last = focusable[focusable.length - 1];\n\n        const trap = event => {\n            // Bail if not tab key or not fullscreen\n            if (event.key !== 'Tab' || event.keyCode !== 9) {\n                return;\n            }\n\n            // Get the current focused element\n            const focused = utils.getFocusElement();\n\n            if (focused === last && !event.shiftKey) {\n                // Move focus to first element that can be tabbed if Shift isn't used\n                first.focus();\n                event.preventDefault();\n            } else if (focused === first && event.shiftKey) {\n                // Move focus to last element that can be tabbed if Shift is used\n                last.focus();\n                event.preventDefault();\n            }\n        };\n\n        if (toggle) {\n            utils.on(this.elements.container, 'keydown', trap, false);\n        } else {\n            utils.off(this.elements.container, 'keydown', trap, false);\n        }\n    },\n\n    // Toggle event listener\n    toggleListener(elements, event, callback, toggle = false, passive = true, capture = false) {\n        // Bail if no elemetns, event, or callback\n        if (utils.is.empty(elements) || utils.is.empty(event) || !utils.is.function(callback)) {\n            return;\n        }\n\n        // If a nodelist is passed, call itself on each node\n        if (utils.is.nodeList(elements) || utils.is.array(elements)) {\n            // Create listener for each node\n            Array.from(elements).forEach(element => {\n                if (element instanceof Node) {\n                    utils.toggleListener.call(null, element, event, callback, toggle, passive, capture);\n                }\n            });\n\n            return;\n        }\n\n        // Allow multiple events\n        const events = event.split(' ');\n\n        // Build options\n        // Default to just the capture boolean for browsers with no passive listener support\n        let options = capture;\n\n        // If passive events listeners are supported\n        if (support.passiveListeners) {\n            options = {\n                // Whether the listener can be passive (i.e. default never prevented)\n                passive,\n                // Whether the listener is a capturing listener or not\n                capture,\n            };\n        }\n\n        // If a single node is passed, bind the event listener\n        events.forEach(type => {\n            elements[toggle ? 'addEventListener' : 'removeEventListener'](type, callback, options);\n        });\n    },\n\n    // Bind event handler\n    on(element, events = '', callback, passive = true, capture = false) {\n        utils.toggleListener(element, events, callback, true, passive, capture);\n    },\n\n    // Unbind event handler\n    off(element, events = '', callback, passive = true, capture = false) {\n        utils.toggleListener(element, events, callback, false, passive, capture);\n    },\n\n    // Trigger event\n    dispatchEvent(element, type = '', bubbles = false, detail = {}) {\n        // Bail if no element\n        if (!utils.is.element(element) || utils.is.empty(type)) {\n            return;\n        }\n\n        // Create and dispatch the event\n        const event = new CustomEvent(type, {\n            bubbles,\n            detail: Object.assign({}, detail, {\n                plyr: utils.is.plyr(this) ? this : null,\n            }),\n        });\n\n        // Dispatch the event\n        element.dispatchEvent(event);\n    },\n\n    // Toggle aria-pressed state on a toggle button\n    // http://www.ssbbartgroup.com/blog/how-not-to-misuse-aria-states-properties-and-roles\n    toggleState(element, input) {\n        // If multiple elements passed\n        if (utils.is.array(element) || utils.is.nodeList(element)) {\n            Array.from(element).forEach(target => utils.toggleState(target, input));\n            return;\n        }\n\n        // Bail if no target\n        if (!utils.is.element(element)) {\n            return;\n        }\n\n        // Get state\n        const pressed = element.getAttribute('aria-pressed') === 'true';\n        const state = utils.is.boolean(input) ? input : !pressed;\n\n        // Set the attribute on target\n        element.setAttribute('aria-pressed', state);\n    },\n\n    // Get percentage\n    getPercentage(current, max) {\n        if (current === 0 || max === 0 || Number.isNaN(current) || Number.isNaN(max)) {\n            return 0;\n        }\n\n        return (current / max * 100).toFixed(2);\n    },\n\n    // Time helpers\n    getHours(value) {\n        return parseInt((value / 60 / 60) % 60, 10);\n    },\n    getMinutes(value) {\n        return parseInt((value / 60) % 60, 10);\n    },\n    getSeconds(value) {\n        return parseInt(value % 60, 10);\n    },\n\n    // Format time to UI friendly string\n    formatTime(time = 0, displayHours = false, inverted = false) {\n        // Bail if the value isn't a number\n        if (!utils.is.number(time)) {\n            return this.formatTime(null, displayHours, inverted);\n        }\n\n        // Format time component to add leading zero\n        const format = value => `0${value}`.slice(-2);\n\n        // Breakdown to hours, mins, secs\n        let hours = this.getHours(time);\n        const mins = this.getMinutes(time);\n        const secs = this.getSeconds(time);\n\n        // Do we need to display hours?\n        if (displayHours || hours > 0) {\n            hours = `${hours}:`;\n        } else {\n            hours = '';\n        }\n\n        // Render\n        return `${inverted ? '-' : ''}${hours}${format(mins)}:${format(secs)}`;\n    },\n\n    // Replace all occurances of a string in a string\n    replaceAll(input = '', find = '', replace = '') {\n        return input.replace(new RegExp(find.toString().replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, '\\\\$1'), 'g'), replace.toString());\n    },\n\n    // Convert to title case\n    toTitleCase(input = '') {\n        return input.toString().replace(/\\w\\S*/g, text => text.charAt(0).toUpperCase() + text.substr(1).toLowerCase());\n    },\n\n    // Convert string to pascalCase\n    toPascalCase(input = '') {\n        let string = input.toString();\n\n        // Convert kebab case\n        string = utils.replaceAll(string, '-', ' ');\n\n        // Convert snake case\n        string = utils.replaceAll(string, '_', ' ');\n\n        // Convert to title case\n        string = utils.toTitleCase(string);\n\n        // Convert to pascal case\n        return utils.replaceAll(string, ' ', '');\n    },\n\n    // Convert string to pascalCase\n    toCamelCase(input = '') {\n        let string = input.toString();\n\n        // Convert to pascal case\n        string = utils.toPascalCase(string);\n\n        // Convert first character to lowercase\n        return string.charAt(0).toLowerCase() + string.slice(1);\n    },\n\n    // Deep extend destination object with N more objects\n    extend(target = {}, ...sources) {\n        if (!sources.length) {\n            return target;\n        }\n\n        const source = sources.shift();\n\n        if (!utils.is.object(source)) {\n            return target;\n        }\n\n        Object.keys(source).forEach(key => {\n            if (utils.is.object(source[key])) {\n                if (!Object.keys(target).includes(key)) {\n                    Object.assign(target, { [key]: {} });\n                }\n\n                utils.extend(target[key], source[key]);\n            } else {\n                Object.assign(target, { [key]: source[key] });\n            }\n        });\n\n        return utils.extend(target, ...sources);\n    },\n\n    // Remove duplicates in an array\n    dedupe(array) {\n        if (!utils.is.array(array)) {\n            return array;\n        }\n\n        return array.filter((item, index) => array.indexOf(item) === index);\n    },\n\n    // Get the closest value in an array\n    closest(array, value) {\n        if (!utils.is.array(array) || !array.length) {\n            return null;\n        }\n\n        return array.reduce((prev, curr) => Math.abs(curr - value) < Math.abs(prev - value) ? curr : prev);\n    },\n\n    // Get the provider for a given URL\n    getProviderByUrl(url) {\n        // YouTube\n        if (/^(https?:\\/\\/)?(www\\.)?(youtube\\.com|youtu\\.?be)\\/.+$/.test(url)) {\n            return providers.youtube;\n        }\n\n        // Vimeo\n        if (/^https?:\\/\\/player.vimeo.com\\/video\\/\\d{8,}(?=\\b|\\/)/.test(url)) {\n            return providers.vimeo;\n        }\n\n        return null;\n    },\n\n    // Parse YouTube ID from URL\n    parseYouTubeId(url) {\n        if (utils.is.empty(url)) {\n            return null;\n        }\n\n        const regex = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;\n        return url.match(regex) ? RegExp.$2 : url;\n    },\n\n    // Parse Vimeo ID from URL\n    parseVimeoId(url) {\n        if (utils.is.empty(url)) {\n            return null;\n        }\n\n        if (utils.is.number(Number(url))) {\n            return url;\n        }\n\n        const regex = /^.*(vimeo.com\\/|video\\/)(\\d+).*/;\n        return url.match(regex) ? RegExp.$2 : url;\n    },\n\n    // Convert a URL to a location object\n    parseUrl(url) {\n        const parser = document.createElement('a');\n        parser.href = url;\n        return parser;\n    },\n\n    // Get URL query parameters\n    getUrlParams(input) {\n        let search = input;\n\n        // Parse URL if needed\n        if (input.startsWith('http://') || input.startsWith('https://')) {\n            ({ search } = this.parseUrl(input));\n        }\n\n        if (this.is.empty(search)) {\n            return null;\n        }\n\n        const hashes = search.slice(search.indexOf('?') + 1).split('&');\n\n        return hashes.reduce((params, hash) => {\n            const [\n                key,\n                val,\n            ] = hash.split('=');\n\n            return Object.assign(params, { [key]: decodeURIComponent(val) });\n        }, {});\n    },\n\n    // Convert object to URL parameters\n    buildUrlParams(input) {\n        if (!utils.is.object(input)) {\n            return '';\n        }\n\n        return Object.keys(input)\n            .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(input[key])}`)\n            .join('&');\n    },\n\n    // Remove HTML from a string\n    stripHTML(source) {\n        const fragment = document.createDocumentFragment();\n        const element = document.createElement('div');\n        fragment.appendChild(element);\n        element.innerHTML = source;\n        return fragment.firstChild.innerText;\n    },\n\n    // Get aspect ratio for dimensions\n    getAspectRatio(width, height) {\n        const getRatio = (w, h) => (h === 0 ? w : getRatio(h, w % h));\n        const ratio = getRatio(width, height);\n        return `${width / ratio}:${height / ratio}`;\n    },\n\n    // Get the transition end event\n    get transitionEndEvent() {\n        const element = document.createElement('span');\n\n        const events = {\n            WebkitTransition: 'webkitTransitionEnd',\n            MozTransition: 'transitionend',\n            OTransition: 'oTransitionEnd otransitionend',\n            transition: 'transitionend',\n        };\n\n        const type = Object.keys(events).find(event => element.style[event] !== undefined);\n\n        return utils.is.string(type) ? events[type] : false;\n    },\n\n    // Force repaint of element\n    repaint(element) {\n        setTimeout(() => {\n            utils.toggleHidden(element, true);\n            element.offsetHeight; // eslint-disable-line\n            utils.toggleHidden(element, false);\n        }, 0);\n    },\n};\n\nexport default utils;\n","// ==========================================================================\n// Console wrapper\n// ==========================================================================\n\nconst noop = () => {};\n\nexport default class Console {\n    constructor(enabled = false) {\n        this.enabled = window.console && enabled;\n\n        if (this.enabled) {\n            this.log('Debugging enabled');\n        }\n    }\n\n    get log() {\n        // eslint-disable-next-line no-console\n        return this.enabled ? Function.prototype.bind.call(console.log, console) : noop;\n    }\n    get warn() {\n        // eslint-disable-next-line no-console\n        return this.enabled ? Function.prototype.bind.call(console.warn, console) : noop;\n    }\n    get error() {\n        // eslint-disable-next-line no-console\n        return this.enabled ? Function.prototype.bind.call(console.error, console) : noop;\n    }\n}\n","// ==========================================================================\n// Fullscreen wrapper\n// https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API#prefixing\n// ==========================================================================\n\nimport utils from './utils';\n\nconst browser = utils.getBrowser();\n\nfunction onChange() {\n    if (!this.enabled) {\n        return;\n    }\n\n    // Update toggle button\n    const button = this.player.elements.buttons.fullscreen;\n    if (utils.is.element(button)) {\n        utils.toggleState(button, this.active);\n    }\n\n    // Trigger an event\n    utils.dispatchEvent(this.target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);\n\n    // Trap focus in container\n    if (!browser.isIos) {\n        utils.trapFocus.call(this.player, this.target, this.active);\n    }\n}\n\nfunction toggleFallback(toggle = false) {\n    // Store or restore scroll position\n    if (toggle) {\n        this.scrollPosition = {\n            x: window.scrollX || 0,\n            y: window.scrollY || 0,\n        };\n    } else {\n        window.scrollTo(this.scrollPosition.x, this.scrollPosition.y);\n    }\n\n    // Toggle scroll\n    document.body.style.overflow = toggle ? 'hidden' : '';\n\n    // Toggle class hook\n    utils.toggleClass(this.target, this.player.config.classNames.fullscreen.fallback, toggle);\n\n    // Toggle button and fire events\n    onChange.call(this);\n}\n\nclass Fullscreen {\n    constructor(player) {\n        // Keep reference to parent\n        this.player = player;\n\n        // Get prefix\n        this.prefix = Fullscreen.prefix;\n        this.name = Fullscreen.name;\n\n        // Scroll position\n        this.scrollPosition = { x: 0, y: 0 };\n\n        // Register event listeners\n        // Handle event (incase user presses escape etc)\n        utils.on(document, this.prefix === 'ms' ? 'MSFullscreenChange' : `${this.prefix}fullscreenchange`, () => {\n            // TODO: Filter for target??\n            onChange.call(this);\n        });\n\n        // Fullscreen toggle on double click\n        utils.on(this.player.elements.container, 'dblclick', event => {\n            // Ignore double click in controls\n            if (this.player.elements.controls.contains(event.target)) {\n                return;\n            }\n\n            this.toggle();\n        });\n\n        // Update the UI\n        this.update();\n    }\n\n    // Determine if native supported\n    static get native() {\n        return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);\n    }\n\n    // Get the prefix for handlers\n    static get prefix() {\n        // No prefix\n        if (utils.is.function(document.exitFullscreen)) {\n            return false;\n        }\n\n        // Check for fullscreen support by vendor prefix\n        let value = '';\n        const prefixes = [\n            'webkit',\n            'moz',\n            'ms',\n        ];\n\n        prefixes.some(pre => {\n            if (utils.is.function(document[`${pre}ExitFullscreen`]) || utils.is.function(document[`${pre}CancelFullScreen`])) {\n                value = pre;\n                return true;\n            }\n\n            return false;\n        });\n\n        return value;\n    }\n\n    static get name() {\n        return this.prefix === 'moz' ? 'FullScreen' : 'Fullscreen';\n    }\n\n    // Determine if fullscreen is enabled\n    get enabled() {\n        return (\n            (Fullscreen.native || this.player.config.fullscreen.fallback) &&\n            this.player.config.fullscreen.enabled &&\n            this.player.supported.ui &&\n            this.player.isVideo\n        );\n    }\n\n    // Get active state\n    get active() {\n        if (!this.enabled) {\n            return false;\n        }\n\n        // Fallback using classname\n        if (!Fullscreen.native) {\n            return utils.hasClass(this.target, this.player.config.classNames.fullscreen.fallback);\n        }\n\n        const element = !this.prefix ? document.fullscreenElement : document[`${this.prefix}${this.name}Element`];\n\n        return element === this.target;\n    }\n\n    // Get target element\n    get target() {\n        return browser.isIos && this.player.config.fullscreen.iosNative ? this.player.media : this.player.elements.container;\n    }\n\n    // Update UI\n    update() {\n        if (this.enabled) {\n            this.player.debug.log(`${Fullscreen.native ? 'Native' : 'Fallback'} fullscreen enabled`);\n        } else {\n            this.player.debug.log('Fullscreen not supported and fallback disabled');\n        }\n\n        // Add styling hook to show button\n        utils.toggleClass(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.enabled);\n    }\n\n    // Make an element fullscreen\n    enter() {\n        if (!this.enabled) {\n            return;\n        }\n\n        // iOS native fullscreen doesn't need the request step\n        if (browser.isIos && this.player.config.fullscreen.iosNative) {\n            if (this.player.playing) {\n                this.target.webkitEnterFullscreen();\n            }\n        } else if (!Fullscreen.native) {\n            toggleFallback.call(this, true);\n        } else if (!this.prefix) {\n            this.target.requestFullscreen();\n        } else if (!utils.is.empty(this.prefix)) {\n            this.target[`${this.prefix}Request${this.name}`]();\n        }\n    }\n\n    // Bail from fullscreen\n    exit() {\n        if (!this.enabled) {\n            return;\n        }\n\n        // iOS native fullscreen\n        if (browser.isIos && this.player.config.fullscreen.iosNative) {\n            this.target.webkitExitFullscreen();\n            this.player.play();\n        } else if (!Fullscreen.native) {\n            toggleFallback.call(this, false);\n        } else if (!this.prefix) {\n            (document.cancelFullScreen || document.exitFullscreen).call(document);\n        } else if (!utils.is.empty(this.prefix)) {\n            const action = this.prefix === 'moz' ? 'Cancel' : 'Exit';\n            document[`${this.prefix}${action}${this.name}`]();\n        }\n    }\n\n    // Toggle state\n    toggle() {\n        if (!this.active) {\n            this.enter();\n        } else {\n            this.exit();\n        }\n    }\n}\n\nexport default Fullscreen;\n","// ==========================================================================\n// Plyr internationalization\n// ==========================================================================\n\nimport utils from './utils';\n\nconst i18n = {\n    get(key = '', config = {}) {\n        if (utils.is.empty(key) || utils.is.empty(config) || !Object.keys(config.i18n).includes(key)) {\n            return '';\n        }\n\n        let string = config.i18n[key];\n\n        const replace = {\n            '{seektime}': config.seekTime,\n            '{title}': config.title,\n        };\n\n        Object.entries(replace).forEach(([\n            key,\n            value,\n        ]) => {\n            string = utils.replaceAll(string, key, value);\n        });\n\n        return string;\n    },\n};\n\nexport default i18n;\n","// ==========================================================================\n// Plyr Captions\n// TODO: Create as class\n// ==========================================================================\n\nimport support from './support';\nimport utils from './utils';\nimport controls from './controls';\nimport i18n from './i18n';\n\nconst captions = {\n    // Setup captions\n    setup() {\n        // Requires UI support\n        if (!this.supported.ui) {\n            return;\n        }\n\n        // Set default language if not set\n        const stored = this.storage.get('language');\n\n        if (!utils.is.empty(stored)) {\n            this.captions.language = stored;\n        }\n\n        if (utils.is.empty(this.captions.language)) {\n            this.captions.language = this.config.captions.language.toLowerCase();\n        }\n\n        // Set captions enabled state if not set\n        if (!utils.is.boolean(this.captions.active)) {\n            const active = this.storage.get('captions');\n\n            if (utils.is.boolean(active)) {\n                this.captions.active = active;\n            } else {\n                this.captions.active = this.config.captions.active;\n            }\n        }\n\n        // Only Vimeo and HTML5 video supported at this point\n        if (!this.isVideo || this.isYouTube || (this.isHTML5 && !support.textTracks)) {\n            // Clear menu and hide\n            if (utils.is.array(this.config.controls) && this.config.controls.includes('settings') && this.config.settings.includes('captions')) {\n                controls.setCaptionsMenu.call(this);\n            }\n\n            return;\n        }\n\n        // Inject the container\n        if (!utils.is.element(this.elements.captions)) {\n            this.elements.captions = utils.createElement('div', utils.getAttributesFromSelector(this.config.selectors.captions));\n\n            utils.insertAfter(this.elements.captions, this.elements.wrapper);\n        }\n\n        // Set the class hook\n        utils.toggleClass(this.elements.container, this.config.classNames.captions.enabled, !utils.is.empty(captions.getTracks.call(this)));\n\n        // Get tracks\n        const tracks = captions.getTracks.call(this);\n\n        // If no caption file exists, hide container for caption text\n        if (utils.is.empty(tracks)) {\n            return;\n        }\n\n        // Get browser info\n        const browser = utils.getBrowser();\n\n        // Fix IE captions if CORS is used\n        // Fetch captions and inject as blobs instead (data URIs not supported!)\n        if (browser.isIE && window.URL) {\n            const elements = this.media.querySelectorAll('track');\n\n            Array.from(elements).forEach(track => {\n                const src = track.getAttribute('src');\n                const href = utils.parseUrl(src);\n\n                if (href.hostname !== window.location.href.hostname && [\n                    'http:',\n                    'https:',\n                ].includes(href.protocol)) {\n                    utils\n                        .fetch(src, 'blob')\n                        .then(blob => {\n                            track.setAttribute('src', window.URL.createObjectURL(blob));\n                        })\n                        .catch(() => {\n                            utils.removeElement(track);\n                        });\n                }\n            });\n        }\n\n        // Set language\n        captions.setLanguage.call(this);\n\n        // Enable UI\n        captions.show.call(this);\n\n        // Set available languages in list\n        if (utils.is.array(this.config.controls) && this.config.controls.includes('settings') && this.config.settings.includes('captions')) {\n            controls.setCaptionsMenu.call(this);\n        }\n    },\n\n    // Set the captions language\n    setLanguage() {\n        // Setup HTML5 track rendering\n        if (this.isHTML5 && this.isVideo) {\n            captions.getTracks.call(this).forEach(track => {\n                // Show track\n                utils.on(track, 'cuechange', event => captions.setCue.call(this, event));\n\n                // Turn off native caption rendering to avoid double captions\n                // eslint-disable-next-line\n                track.mode = 'hidden';\n            });\n\n            // Get current track\n            const currentTrack = captions.getCurrentTrack.call(this);\n\n            // Check if suported kind\n            if (utils.is.track(currentTrack)) {\n                // If we change the active track while a cue is already displayed we need to update it\n                if (Array.from(currentTrack.activeCues || []).length) {\n                    captions.setCue.call(this, currentTrack);\n                }\n            }\n        } else if (this.isVimeo && this.captions.active) {\n            this.embed.enableTextTrack(this.language);\n        }\n    },\n\n    // Get the tracks\n    getTracks() {\n        // Return empty array at least\n        if (utils.is.nullOrUndefined(this.media)) {\n            return [];\n        }\n\n        // Only get accepted kinds\n        return Array.from(this.media.textTracks || []).filter(track => [\n            'captions',\n            'subtitles',\n        ].includes(track.kind));\n    },\n\n    // Get the current track for the current language\n    getCurrentTrack() {\n        const tracks = captions.getTracks.call(this);\n\n        if (!tracks.length) {\n            return null;\n        }\n\n        // Get track based on current language\n        let track = tracks.find(track => track.language.toLowerCase() === this.language);\n\n        // Get the <track> with default attribute\n        if (!track) {\n            track = utils.getElement.call(this, 'track[default]');\n        }\n\n        // Get the first track\n        if (!track) {\n            [track] = tracks;\n        }\n\n        return track;\n    },\n\n    // Get UI label for track\n    getLabel(track) {\n        let currentTrack = track;\n\n        if (!utils.is.track(currentTrack) && support.textTracks && this.captions.active) {\n            currentTrack = captions.getCurrentTrack.call(this);\n        }\n\n        if (utils.is.track(currentTrack)) {\n            if (!utils.is.empty(currentTrack.label)) {\n                return currentTrack.label;\n            }\n\n            if (!utils.is.empty(currentTrack.language)) {\n                return track.language.toUpperCase();\n            }\n\n            return i18n.get('enabled', this.config);\n        }\n\n        return i18n.get('disabled', this.config);\n    },\n\n    // Display active caption if it contains text\n    setCue(input) {\n        // Get the track from the event if needed\n        const track = utils.is.event(input) ? input.target : input;\n        const { activeCues } = track;\n        const active = activeCues.length && activeCues[0];\n        const currentTrack = captions.getCurrentTrack.call(this);\n\n        // Only display current track\n        if (track !== currentTrack) {\n            return;\n        }\n\n        // Display a cue, if there is one\n        if (utils.is.cue(active)) {\n            captions.setText.call(this, active.getCueAsHTML());\n        } else {\n            captions.setText.call(this, null);\n        }\n\n        utils.dispatchEvent.call(this, this.media, 'cuechange');\n    },\n\n    // Set the current caption\n    setText(input) {\n        // Requires UI\n        if (!this.supported.ui) {\n            return;\n        }\n\n        if (utils.is.element(this.elements.captions)) {\n            const content = utils.createElement('span');\n\n            // Empty the container\n            utils.emptyElement(this.elements.captions);\n\n            // Default to empty\n            const caption = !utils.is.nullOrUndefined(input) ? input : '';\n\n            // Set the span content\n            if (utils.is.string(caption)) {\n                content.textContent = caption.trim();\n            } else {\n                content.appendChild(caption);\n            }\n\n            // Set new caption text\n            this.elements.captions.appendChild(content);\n        } else {\n            this.debug.warn('No captions element to render to');\n        }\n    },\n\n    // Display captions container and button (for initialization)\n    show() {\n        // If there's no caption toggle, bail\n        if (!utils.is.element(this.elements.buttons.captions)) {\n            return;\n        }\n\n        // Try to load the value from storage\n        let active = this.storage.get('captions');\n\n        // Otherwise fall back to the default config\n        if (!utils.is.boolean(active)) {\n            ({ active } = this.config.captions);\n        } else {\n            this.captions.active = active;\n        }\n\n        if (active) {\n            utils.toggleClass(this.elements.container, this.config.classNames.captions.active, true);\n            utils.toggleState(this.elements.buttons.captions, true);\n        }\n    },\n};\n\nexport default captions;\n","// ==========================================================================\n// Plyr UI\n// ==========================================================================\n\nimport utils from './utils';\nimport captions from './captions';\nimport controls from './controls';\nimport i18n from './i18n';\n\nconst ui = {\n    addStyleHook() {\n        utils.toggleClass(this.elements.container, this.config.selectors.container.replace('.', ''), true);\n        utils.toggleClass(this.elements.container, this.config.classNames.uiSupported, this.supported.ui);\n    },\n\n    // Toggle native HTML5 media controls\n    toggleNativeControls(toggle = false) {\n        if (toggle && this.isHTML5) {\n            this.media.setAttribute('controls', '');\n        } else {\n            this.media.removeAttribute('controls');\n        }\n    },\n\n    // Setup the UI\n    build() {\n        // Re-attach media element listeners\n        // TODO: Use event bubbling?\n        this.listeners.media();\n\n        // Don't setup interface if no support\n        if (!this.supported.ui) {\n            this.debug.warn(`Basic support only for ${this.provider} ${this.type}`);\n\n            // Restore native controls\n            ui.toggleNativeControls.call(this, true);\n\n            // Bail\n            return;\n        }\n\n        // Inject custom controls if not present\n        if (!utils.is.element(this.elements.controls)) {\n            // Inject custom controls\n            controls.inject.call(this);\n\n            // Re-attach control listeners\n            this.listeners.controls();\n        }\n\n        // If there's no controls, bail\n        if (!utils.is.element(this.elements.controls)) {\n            return;\n        }\n\n        // Remove native controls\n        ui.toggleNativeControls.call(this);\n\n        // Captions\n        captions.setup.call(this);\n\n        // Reset volume\n        this.volume = null;\n\n        // Reset mute state\n        this.muted = null;\n\n        // Reset speed\n        this.speed = null;\n\n        // Reset loop state\n        this.loop = null;\n\n        // Reset quality setting\n        this.quality = null;\n\n        // Reset volume display\n        ui.updateVolume.call(this);\n\n        // Reset time display\n        ui.timeUpdate.call(this);\n\n        // Update the UI\n        ui.checkPlaying.call(this);\n\n        // Ready for API calls\n        this.ready = true;\n\n        // Ready event at end of execution stack\n        setTimeout(() => {\n            utils.dispatchEvent.call(this, this.media, 'ready');\n        }, 0);\n\n        // Set the title\n        ui.setTitle.call(this);\n    },\n\n    // Setup aria attribute for play and iframe title\n    setTitle() {\n        // Find the current text\n        let label = i18n.get('play', this.config);\n\n        // If there's a media title set, use that for the label\n        if (utils.is.string(this.config.title) && !utils.is.empty(this.config.title)) {\n            label += `, ${this.config.title}`;\n\n            // Set container label\n            this.elements.container.setAttribute('aria-label', this.config.title);\n        }\n\n        // If there's a play button, set label\n        if (utils.is.nodeList(this.elements.buttons.play)) {\n            Array.from(this.elements.buttons.play).forEach(button => {\n                button.setAttribute('aria-label', label);\n            });\n        }\n\n        // Set iframe title\n        // https://github.com/sampotts/plyr/issues/124\n        if (this.isEmbed) {\n            const iframe = utils.getElement.call(this, 'iframe');\n\n            if (!utils.is.element(iframe)) {\n                return;\n            }\n\n            // Default to media type\n            const title = !utils.is.empty(this.config.title) ? this.config.title : 'video';\n\n            iframe.setAttribute('title', i18n.get('frameTitle', this.config));\n        }\n    },\n\n    // Check playing state\n    checkPlaying() {\n        // Class hooks\n        utils.toggleClass(this.elements.container, this.config.classNames.playing, this.playing);\n        utils.toggleClass(this.elements.container, this.config.classNames.stopped, this.paused);\n\n        // Set ARIA state\n        utils.toggleState(this.elements.buttons.play, this.playing);\n\n        // Toggle controls\n        this.toggleControls(!this.playing);\n    },\n\n    // Check if media is loading\n    checkLoading(event) {\n        this.loading = [\n            'stalled',\n            'waiting',\n        ].includes(event.type);\n\n        // Clear timer\n        clearTimeout(this.timers.loading);\n\n        // Timer to prevent flicker when seeking\n        this.timers.loading = setTimeout(() => {\n            // Toggle container class hook\n            utils.toggleClass(this.elements.container, this.config.classNames.loading, this.loading);\n\n            // Show controls if loading, hide if done\n            this.toggleControls(this.loading);\n        }, this.loading ? 250 : 0);\n    },\n\n    // Check if media failed to load\n    checkFailed() {\n        // https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/networkState\n        this.failed = this.media.networkState === 3;\n\n        if (this.failed) {\n            utils.toggleClass(this.elements.container, this.config.classNames.loading, false);\n            utils.toggleClass(this.elements.container, this.config.classNames.error, true);\n        }\n\n        // Clear timer\n        clearTimeout(this.timers.failed);\n\n        // Timer to prevent flicker when seeking\n        this.timers.loading = setTimeout(() => {\n            // Toggle container class hook\n            utils.toggleClass(this.elements.container, this.config.classNames.loading, this.loading);\n\n            // Show controls if loading, hide if done\n            this.toggleControls(this.loading);\n        }, this.loading ? 250 : 0);\n    },\n\n    // Update volume UI and storage\n    updateVolume() {\n        if (!this.supported.ui) {\n            return;\n        }\n\n        // Update range\n        if (utils.is.element(this.elements.inputs.volume)) {\n            ui.setRange.call(this, this.elements.inputs.volume, this.muted ? 0 : this.volume);\n        }\n\n        // Update mute state\n        if (utils.is.element(this.elements.buttons.mute)) {\n            utils.toggleState(this.elements.buttons.mute, this.muted || this.volume === 0);\n        }\n    },\n\n    // Update seek value and lower fill\n    setRange(target, value = 0) {\n        if (!utils.is.element(target)) {\n            return;\n        }\n\n        // eslint-disable-next-line\n        target.value = value;\n\n        // Webkit range fill\n        controls.updateRangeFill.call(this, target);\n    },\n\n    // Set <progress> value\n    setProgress(target, input) {\n        const value = utils.is.number(input) ? input : 0;\n        const progress = utils.is.element(target) ? target : this.elements.display.buffer;\n\n        // Update value and label\n        if (utils.is.element(progress)) {\n            progress.value = value;\n\n            // Update text label inside\n            const label = progress.getElementsByTagName('span')[0];\n            if (utils.is.element(label)) {\n                label.childNodes[0].nodeValue = value;\n            }\n        }\n    },\n\n    // Update <progress> elements\n    updateProgress(event) {\n        if (!this.supported.ui || !utils.is.event(event)) {\n            return;\n        }\n\n        let value = 0;\n\n        if (event) {\n            switch (event.type) {\n                // Video playing\n                case 'timeupdate':\n                case 'seeking':\n                    value = utils.getPercentage(this.currentTime, this.duration);\n\n                    // Set seek range value only if it's a 'natural' time event\n                    if (event.type === 'timeupdate') {\n                        ui.setRange.call(this, this.elements.inputs.seek, value);\n                    }\n\n                    break;\n\n                // Check buffer status\n                case 'playing':\n                case 'progress':\n                    ui.setProgress.call(this, this.elements.display.buffer, this.buffered * 100);\n\n                    break;\n\n                default:\n                    break;\n            }\n        }\n    },\n\n    // Update the displayed time\n    updateTimeDisplay(target = null, time = 0, inverted = false) {\n        // Bail if there's no element to display or the value isn't a number\n        if (!utils.is.element(target) || !utils.is.number(time)) {\n            return;\n        }\n\n        // Always display hours if duration is over an hour\n        const displayHours = utils.getHours(this.duration) > 0;\n\n        // eslint-disable-next-line no-param-reassign\n        target.textContent = utils.formatTime(time, displayHours, inverted);\n    },\n\n    // Handle time change event\n    timeUpdate(event) {\n        // Only invert if only one time element is displayed and used for both duration and currentTime\n        const invert = !utils.is.element(this.elements.display.duration) && this.config.invertTime;\n\n        // Duration\n        ui.updateTimeDisplay.call(this, this.elements.display.currentTime, invert ? this.duration - this.currentTime : this.currentTime, invert);\n\n        // Ignore updates while seeking\n        if (event && event.type === 'timeupdate' && this.media.seeking) {\n            return;\n        }\n\n        // Playing progress\n        ui.updateProgress.call(this, event);\n    },\n\n    // Show the duration on metadataloaded\n    durationUpdate() {\n        if (!this.supported.ui) {\n            return;\n        }\n\n        // If there's a spot to display duration\n        const hasDuration = utils.is.element(this.elements.display.duration);\n\n        // If there's only one time display, display duration there\n        if (!hasDuration && this.config.displayDuration && this.paused) {\n            ui.updateTimeDisplay.call(this, this.elements.display.currentTime, this.duration);\n        }\n\n        // If there's a duration element, update content\n        if (hasDuration) {\n            ui.updateTimeDisplay.call(this, this.elements.display.duration, this.duration);\n        }\n\n        // Update the tooltip (if visible)\n        controls.updateSeekTooltip.call(this);\n    },\n};\n\nexport default ui;\n","// ==========================================================================\n// Plyr HTML5 helpers\n// ==========================================================================\n\nimport support from './support';\nimport utils from './utils';\n\nconst html5 = {\n    getSources() {\n        if (!this.isHTML5) {\n            return null;\n        }\n\n        return this.media.querySelectorAll('source');\n    },\n\n    // Get quality levels\n    getQualityOptions() {\n        if (!this.isHTML5) {\n            return null;\n        }\n\n        // Get sources\n        const sources = html5.getSources.call(this);\n\n        if (utils.is.empty(sources)) {\n            return null;\n        }\n\n        // Get <source> with size attribute\n        const sizes = Array.from(sources).filter(source => !utils.is.empty(source.getAttribute('size')));\n\n        // If none, bail\n        if (utils.is.empty(sizes)) {\n            return null;\n        }\n\n        // Reduce to unique list\n        return utils.dedupe(sizes.map(source => Number(source.getAttribute('size'))));\n    },\n\n    extend() {\n        if (!this.isHTML5) {\n            return;\n        }\n\n        const player = this;\n\n        // Quality\n        Object.defineProperty(player.media, 'quality', {\n            get() {\n                // Get sources\n                const sources = html5.getSources.call(player);\n\n                if (utils.is.empty(sources)) {\n                    return null;\n                }\n\n                const matches = Array.from(sources).filter(source => source.getAttribute('src') === player.source);\n\n                if (utils.is.empty(matches)) {\n                    return null;\n                }\n\n                return Number(matches[0].getAttribute('size'));\n            },\n            set(input) {\n                // Get sources\n                const sources = html5.getSources.call(player);\n\n                if (utils.is.empty(sources)) {\n                    return;\n                }\n\n                // Get matches for requested size\n                const matches = Array.from(sources).filter(source => Number(source.getAttribute('size')) === input);\n\n                // No matches for requested size\n                if (utils.is.empty(matches)) {\n                    return;\n                }\n\n                // Get supported sources\n                const supported = matches.filter(source => support.mime.call(player, source.getAttribute('type')));\n\n                // No supported sources\n                if (utils.is.empty(supported)) {\n                    return;\n                }\n\n                // Trigger change event\n                utils.dispatchEvent.call(player, player.media, 'qualityrequested', false, {\n                    quality: input,\n                });\n\n                // Get current state\n                const { currentTime, playing } = player;\n\n                // Set new source\n                player.media.src = supported[0].getAttribute('src');\n\n                // Load new source\n                player.media.load();\n\n                // Resume playing\n                if (playing) {\n                    player.play();\n                }\n\n                // Restore time\n                player.currentTime = currentTime;\n\n                // Trigger change event\n                utils.dispatchEvent.call(player, player.media, 'qualitychange', false, {\n                    quality: input,\n                });\n            },\n        });\n    },\n\n    // Cancel current network requests\n    // See https://github.com/sampotts/plyr/issues/174\n    cancelRequests() {\n        if (!this.isHTML5) {\n            return;\n        }\n\n        // Remove child sources\n        utils.removeElement(html5.getSources());\n\n        // Set blank video src attribute\n        // This is to prevent a MEDIA_ERR_SRC_NOT_SUPPORTED error\n        // Info: http://stackoverflow.com/questions/32231579/how-to-properly-dispose-of-an-html5-video-and-close-socket-or-connection\n        this.media.setAttribute('src', this.config.blankVideo);\n\n        // Load the new empty source\n        // This will cancel existing requests\n        // See https://github.com/sampotts/plyr/issues/174\n        this.media.load();\n\n        // Debugging\n        this.debug.log('Cancelled network requests');\n    },\n};\n\nexport default html5;\n","// ==========================================================================\n// Plyr controls\n// ==========================================================================\n\nimport support from './support';\nimport utils from './utils';\nimport ui from './ui';\nimport i18n from './i18n';\nimport captions from './captions';\nimport html5 from './html5';\n\n// Sniff out the browser\nconst browser = utils.getBrowser();\n\nconst controls = {\n    // Webkit polyfill for lower fill range\n    updateRangeFill(target) {\n        // WebKit only\n        if (!browser.isWebkit) {\n            return;\n        }\n\n        // Get range from event if event passed\n        const range = utils.is.event(target) ? target.target : target;\n\n        // Needs to be a valid <input type='range'>\n        if (!utils.is.element(range) || range.getAttribute('type') !== 'range') {\n            return;\n        }\n\n        // Set CSS custom property\n        range.style.setProperty('--value', `${range.value / range.max * 100}%`);\n    },\n\n    // Get icon URL\n    getIconUrl() {\n        return {\n            url: this.config.iconUrl,\n            absolute: this.config.iconUrl.indexOf('http') === 0 || (browser.isIE && !window.svg4everybody),\n        };\n    },\n\n    // Create <svg> icon\n    createIcon(type, attributes) {\n        const namespace = 'http://www.w3.org/2000/svg';\n        const iconUrl = controls.getIconUrl.call(this);\n        const iconPath = `${!iconUrl.absolute ? iconUrl.url : ''}#${this.config.iconPrefix}`;\n\n        // Create <svg>\n        const icon = document.createElementNS(namespace, 'svg');\n        utils.setAttributes(\n            icon,\n            utils.extend(attributes, {\n                role: 'presentation',\n            }),\n        );\n\n        // Create the <use> to reference sprite\n        const use = document.createElementNS(namespace, 'use');\n        const path = `${iconPath}-${type}`;\n\n        // Set `href` attributes\n        // https://github.com/sampotts/plyr/issues/460\n        // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href\n        if ('href' in use) {\n            use.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);\n        } else {\n            use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);\n        }\n\n        // Add <use> to <svg>\n        icon.appendChild(use);\n\n        return icon;\n    },\n\n    // Create hidden text label\n    createLabel(type, attr) {\n        let text = i18n.get(type, this.config);\n        const attributes = Object.assign({}, attr);\n\n        switch (type) {\n            case 'pip':\n                text = 'PIP';\n                break;\n\n            case 'airplay':\n                text = 'AirPlay';\n                break;\n\n            default:\n                break;\n        }\n\n        if ('class' in attributes) {\n            attributes.class += ` ${this.config.classNames.hidden}`;\n        } else {\n            attributes.class = this.config.classNames.hidden;\n        }\n\n        return utils.createElement('span', attributes, text);\n    },\n\n    // Create a badge\n    createBadge(text) {\n        if (utils.is.empty(text)) {\n            return null;\n        }\n\n        const badge = utils.createElement('span', {\n            class: this.config.classNames.menu.value,\n        });\n\n        badge.appendChild(\n            utils.createElement(\n                'span',\n                {\n                    class: this.config.classNames.menu.badge,\n                },\n                text,\n            ),\n        );\n\n        return badge;\n    },\n\n    // Create a <button>\n    createButton(buttonType, attr) {\n        const button = utils.createElement('button');\n        const attributes = Object.assign({}, attr);\n        let type = utils.toCamelCase(buttonType);\n\n        let toggle = false;\n        let label;\n        let icon;\n        let labelPressed;\n        let iconPressed;\n\n        if (!('type' in attributes)) {\n            attributes.type = 'button';\n        }\n\n        if ('class' in attributes) {\n            if (attributes.class.includes(this.config.classNames.control)) {\n                attributes.class += ` ${this.config.classNames.control}`;\n            }\n        } else {\n            attributes.class = this.config.classNames.control;\n        }\n\n        // Large play button\n        switch (buttonType) {\n            case 'play':\n                toggle = true;\n                label = 'play';\n                labelPressed = 'pause';\n                icon = 'play';\n                iconPressed = 'pause';\n                break;\n\n            case 'mute':\n                toggle = true;\n                label = 'mute';\n                labelPressed = 'unmute';\n                icon = 'volume';\n                iconPressed = 'muted';\n                break;\n\n            case 'captions':\n                toggle = true;\n                label = 'enableCaptions';\n                labelPressed = 'disableCaptions';\n                icon = 'captions-off';\n                iconPressed = 'captions-on';\n                break;\n\n            case 'fullscreen':\n                toggle = true;\n                label = 'enterFullscreen';\n                labelPressed = 'exitFullscreen';\n                icon = 'enter-fullscreen';\n                iconPressed = 'exit-fullscreen';\n                break;\n\n            case 'play-large':\n                attributes.class += ` ${this.config.classNames.control}--overlaid`;\n                type = 'play';\n                label = 'play';\n                icon = 'play';\n                break;\n\n            default:\n                label = type;\n                icon = buttonType;\n        }\n\n        // Setup toggle icon and labels\n        if (toggle) {\n            // Icon\n            button.appendChild(controls.createIcon.call(this, iconPressed, { class: 'icon--pressed' }));\n            button.appendChild(controls.createIcon.call(this, icon, { class: 'icon--not-pressed' }));\n\n            // Label/Tooltip\n            button.appendChild(controls.createLabel.call(this, labelPressed, { class: 'label--pressed' }));\n            button.appendChild(controls.createLabel.call(this, label, { class: 'label--not-pressed' }));\n\n            // Add aria attributes\n            attributes['aria-pressed'] = false;\n            attributes['aria-label'] = i18n.get(label, this.config);\n        } else {\n            button.appendChild(controls.createIcon.call(this, icon));\n            button.appendChild(controls.createLabel.call(this, label));\n        }\n\n        // Merge attributes\n        utils.extend(attributes, utils.getAttributesFromSelector(this.config.selectors.buttons[type], attributes));\n\n        utils.setAttributes(button, attributes);\n\n        // We have multiple play buttons\n        if (type === 'play') {\n            if (!utils.is.array(this.elements.buttons[type])) {\n                this.elements.buttons[type] = [];\n            }\n\n            this.elements.buttons[type].push(button);\n        } else {\n            this.elements.buttons[type] = button;\n        }\n\n        return button;\n    },\n\n    // Create an <input type='range'>\n    createRange(type, attributes) {\n        // Seek label\n        const label = utils.createElement(\n            'label',\n            {\n                for: attributes.id,\n                class: this.config.classNames.hidden,\n            },\n            i18n.get(type, this.config),\n        );\n\n        // Seek input\n        const input = utils.createElement(\n            'input',\n            utils.extend(\n                utils.getAttributesFromSelector(this.config.selectors.inputs[type]),\n                {\n                    type: 'range',\n                    min: 0,\n                    max: 100,\n                    step: 0.01,\n                    value: 0,\n                    autocomplete: 'off',\n                },\n                attributes,\n            ),\n        );\n\n        this.elements.inputs[type] = input;\n\n        // Set the fill for webkit now\n        controls.updateRangeFill.call(this, input);\n\n        return {\n            label,\n            input,\n        };\n    },\n\n    // Create a <progress>\n    createProgress(type, attributes) {\n        const progress = utils.createElement(\n            'progress',\n            utils.extend(\n                utils.getAttributesFromSelector(this.config.selectors.display[type]),\n                {\n                    min: 0,\n                    max: 100,\n                    value: 0,\n                },\n                attributes,\n            ),\n        );\n\n        // Create the label inside\n        if (type !== 'volume') {\n            progress.appendChild(utils.createElement('span', null, '0'));\n\n            let suffix = '';\n            switch (type) {\n                case 'played':\n                    suffix = i18n.get('played', this.config);\n                    break;\n\n                case 'buffer':\n                    suffix = i18n.get('buffered', this.config);\n                    break;\n\n                default:\n                    break;\n            }\n\n            progress.textContent = `% ${suffix.toLowerCase()}`;\n        }\n\n        this.elements.display[type] = progress;\n\n        return progress;\n    },\n\n    // Create time display\n    createTime(type) {\n        const container = utils.createElement('div', {\n            class: 'plyr__time',\n        });\n\n        container.appendChild(\n            utils.createElement(\n                'span',\n                {\n                    class: this.config.classNames.hidden,\n                },\n                i18n.get(type, this.config),\n            ),\n        );\n\n        container.appendChild(utils.createElement('span', utils.getAttributesFromSelector(this.config.selectors.display[type]), '00:00'));\n\n        this.elements.display[type] = container;\n\n        return container;\n    },\n\n    // Create a settings menu item\n    createMenuItem(value, list, type, title, badge = null, checked = false) {\n        const item = utils.createElement('li');\n\n        const label = utils.createElement('label', {\n            class: this.config.classNames.control,\n        });\n\n        const radio = utils.createElement(\n            'input',\n            utils.extend(utils.getAttributesFromSelector(this.config.selectors.inputs[type]), {\n                type: 'radio',\n                name: `plyr-${type}`,\n                value,\n                checked,\n                class: 'plyr__sr-only',\n            }),\n        );\n\n        const faux = utils.createElement('span', { 'aria-hidden': true });\n\n        label.appendChild(radio);\n        label.appendChild(faux);\n        label.insertAdjacentHTML('beforeend', title);\n\n        if (utils.is.element(badge)) {\n            label.appendChild(badge);\n        }\n\n        item.appendChild(label);\n        list.appendChild(item);\n    },\n\n    // Update hover tooltip for seeking\n    updateSeekTooltip(event) {\n        // Bail if setting not true\n        if (\n            !this.config.tooltips.seek ||\n            !utils.is.element(this.elements.inputs.seek) ||\n            !utils.is.element(this.elements.display.seekTooltip) ||\n            this.duration === 0\n        ) {\n            return;\n        }\n\n        // Calculate percentage\n        let percent = 0;\n        const clientRect = this.elements.inputs.seek.getBoundingClientRect();\n        const visible = `${this.config.classNames.tooltip}--visible`;\n\n        const toggle = toggle => {\n            utils.toggleClass(this.elements.display.seekTooltip, visible, toggle);\n        };\n\n        // Hide on touch\n        if (this.touch) {\n            toggle(false);\n            return;\n        }\n\n        // Determine percentage, if already visible\n        if (utils.is.event(event)) {\n            percent = 100 / clientRect.width * (event.pageX - clientRect.left);\n        } else if (utils.hasClass(this.elements.display.seekTooltip, visible)) {\n            percent = parseFloat(this.elements.display.seekTooltip.style.left, 10);\n        } else {\n            return;\n        }\n\n        // Set bounds\n        if (percent < 0) {\n            percent = 0;\n        } else if (percent > 100) {\n            percent = 100;\n        }\n\n        // Display the time a click would seek to\n        ui.updateTimeDisplay.call(this, this.elements.display.seekTooltip, this.duration / 100 * percent);\n\n        // Set position\n        this.elements.display.seekTooltip.style.left = `${percent}%`;\n\n        // Show/hide the tooltip\n        // If the event is a moues in/out and percentage is inside bounds\n        if (utils.is.event(event) && [\n            'mouseenter',\n            'mouseleave',\n        ].includes(event.type)) {\n            toggle(event.type === 'mouseenter');\n        }\n    },\n\n    // Hide/show a tab\n    toggleTab(setting, toggle) {\n        const tab = this.elements.settings.tabs[setting];\n        const pane = this.elements.settings.panes[setting];\n\n        utils.toggleHidden(tab, !toggle);\n        utils.toggleHidden(pane, !toggle);\n    },\n\n    // Set the quality menu\n    // TODO: Vimeo support\n    setQualityMenu(options) {\n        // Menu required\n        if (!utils.is.element(this.elements.settings.panes.quality)) {\n            return;\n        }\n\n        const type = 'quality';\n        const list = this.elements.settings.panes.quality.querySelector('ul');\n\n        // Set options if passed and filter based on config\n        if (utils.is.array(options)) {\n            this.options.quality = options.filter(quality => this.config.quality.options.includes(quality));\n        }\n\n        // Toggle the pane and tab\n        const toggle = !utils.is.empty(this.options.quality) && this.options.quality.length > 1;\n        controls.toggleTab.call(this, type, toggle);\n\n        // Check if we need to toggle the parent\n        controls.checkMenu.call(this);\n\n        // If we're hiding, nothing more to do\n        if (!toggle) {\n            return;\n        }\n\n        // Empty the menu\n        utils.emptyElement(list);\n\n        // Get the badge HTML for HD, 4K etc\n        const getBadge = quality => {\n            let label = '';\n\n            switch (quality) {\n                case 2160:\n                    label = '4K';\n                    break;\n\n                case 1440:\n                case 1080:\n                case 720:\n                    label = 'HD';\n                    break;\n\n                case 576:\n                    label = 'SD';\n                    break;\n\n                default:\n                    break;\n            }\n\n            if (!label.length) {\n                return null;\n            }\n\n            return controls.createBadge.call(this, label);\n        };\n\n        // Sort options by the config and then render options\n        this.options.quality\n            .sort((a, b) => {\n                const sorting = this.config.quality.options;\n                return sorting.indexOf(a) > sorting.indexOf(b) ? 1 : -1;\n            })\n            .forEach(quality => {\n                const label = controls.getLabel.call(this, 'quality', quality);\n                controls.createMenuItem.call(this, quality, list, type, label, getBadge(quality));\n            });\n\n        controls.updateSetting.call(this, type, list);\n    },\n\n    // Translate a value into a nice label\n    // TODO: Localisation\n    getLabel(setting, value) {\n        switch (setting) {\n            case 'speed':\n                return value === 1 ? i18n.get('normal', this.config) : `${value}&times;`;\n\n            case 'quality':\n                if (utils.is.number(value)) {\n                    return `${value}p`;\n                }\n\n                return utils.toTitleCase(value);\n\n            case 'captions':\n                return captions.getLabel.call(this);\n\n            default:\n                return null;\n        }\n    },\n\n    // Update the selected setting\n    updateSetting(setting, container, input) {\n        const pane = this.elements.settings.panes[setting];\n        let value = null;\n        let list = container;\n\n        switch (setting) {\n            case 'captions':\n                if (this.captions.active) {\n                    if (this.options.captions.length > 2 || !this.options.captions.some(lang => lang === 'enabled')) {\n                        value = this.captions.language;\n                    } else {\n                        value = 'enabled';\n                    }\n                } else {\n                    value = '';\n                }\n\n                break;\n\n            default:\n                value = !utils.is.empty(input) ? input : this[setting];\n\n                // Get default\n                if (utils.is.empty(value)) {\n                    value = this.config[setting].default;\n                }\n\n                // Unsupported value\n                if (!utils.is.empty(this.options[setting]) && !this.options[setting].includes(value)) {\n                    this.debug.warn(`Unsupported value of '${value}' for ${setting}`);\n                    return;\n                }\n\n                // Disabled value\n                if (!this.config[setting].options.includes(value)) {\n                    this.debug.warn(`Disabled value of '${value}' for ${setting}`);\n                    return;\n                }\n\n                break;\n        }\n\n        // Get the list if we need to\n        if (!utils.is.element(list)) {\n            list = pane && pane.querySelector('ul');\n        }\n\n        // If there's no list it means it's not been rendered...\n        if (!utils.is.element(list)) {\n            return;\n        }\n\n        // Update the label\n        const label = this.elements.settings.tabs[setting].querySelector(`.${this.config.classNames.menu.value}`);\n        label.innerHTML = controls.getLabel.call(this, setting, value);\n\n        // Find the radio option and check it\n        const target = list && list.querySelector(`input[value=\"${value}\"]`);\n\n        if (utils.is.element(target)) {\n            target.checked = true;\n        }\n    },\n\n    // Set the looping options\n    /* setLoopMenu() {\n        // Menu required\n        if (!utils.is.element(this.elements.settings.panes.loop)) {\n            return;\n        }\n\n        const options = ['start', 'end', 'all', 'reset'];\n        const list = this.elements.settings.panes.loop.querySelector('ul');\n\n        // Show the pane and tab\n        utils.toggleHidden(this.elements.settings.tabs.loop, false);\n        utils.toggleHidden(this.elements.settings.panes.loop, false);\n\n        // Toggle the pane and tab\n        const toggle = !utils.is.empty(this.loop.options);\n        controls.toggleTab.call(this, 'loop', toggle);\n\n        // Empty the menu\n        utils.emptyElement(list);\n\n        options.forEach(option => {\n            const item = utils.createElement('li');\n\n            const button = utils.createElement(\n                'button',\n                utils.extend(utils.getAttributesFromSelector(this.config.selectors.buttons.loop), {\n                    type: 'button',\n                    class: this.config.classNames.control,\n                    'data-plyr-loop-action': option,\n                }),\n                i18n.get(option, this.config)\n            );\n\n            if (['start', 'end'].includes(option)) {\n                const badge = controls.createBadge.call(this, '00:00');\n                button.appendChild(badge);\n            }\n\n            item.appendChild(button);\n            list.appendChild(item);\n        });\n    }, */\n\n    // Get current selected caption language\n    // TODO: rework this to user the getter in the API?\n\n\n    // Set a list of available captions languages\n    setCaptionsMenu() {\n        // TODO: Captions or language? Currently it's mixed\n        const type = 'captions';\n        const list = this.elements.settings.panes.captions.querySelector('ul');\n\n        // Toggle the pane and tab\n        const toggle = captions.getTracks.call(this).length;\n        controls.toggleTab.call(this, type, toggle);\n\n        // Empty the menu\n        utils.emptyElement(list);\n\n        // Check if we need to toggle the parent\n        controls.checkMenu.call(this);\n\n        // If there's no captions, bail\n        if (!toggle) {\n            return;\n        }\n\n        // Re-map the tracks into just the data we need\n        const tracks = captions.getTracks.call(this).map(track => ({\n            language: !utils.is.empty(track.language) ? track.language : 'enabled',\n            label: captions.getLabel.call(this, track),\n        }));\n\n        // Add the \"Disabled\" option to turn off captions\n        tracks.unshift({\n            language: '',\n            label: i18n.get('disabled', this.config),\n        });\n\n        // Generate options\n        tracks.forEach(track => {\n            controls.createMenuItem.call(\n                this,\n                track.language,\n                list,\n                'language',\n                track.label,\n                track.language !== 'enabled' ? controls.createBadge.call(this, track.language.toUpperCase()) : null,\n                track.language.toLowerCase() === this.captions.language.toLowerCase(),\n            );\n        });\n\n        // Store reference\n        this.options.captions = tracks.map(track => track.language);\n\n        controls.updateSetting.call(this, type, list);\n    },\n\n    // Set a list of available captions languages\n    setSpeedMenu(options) {\n        // Do nothing if not selected\n        if (!this.config.controls.includes('settings') || !this.config.settings.includes('speed')) {\n            return;\n        }\n\n        // Menu required\n        if (!utils.is.element(this.elements.settings.panes.speed)) {\n            return;\n        }\n\n        const type = 'speed';\n\n        // Set the speed options\n        if (utils.is.array(options)) {\n            this.options.speed = options;\n        } else if (this.isHTML5 || this.isVimeo) {\n            this.options.speed = [\n                0.5,\n                0.75,\n                1,\n                1.25,\n                1.5,\n                1.75,\n                2,\n            ];\n        }\n\n        // Set options if passed and filter based on config\n        this.options.speed = this.options.speed.filter(speed => this.config.speed.options.includes(speed));\n\n        // Toggle the pane and tab\n        const toggle = !utils.is.empty(this.options.speed) && this.options.speed.length > 1;\n        controls.toggleTab.call(this, type, toggle);\n\n        // Check if we need to toggle the parent\n        controls.checkMenu.call(this);\n\n        // If we're hiding, nothing more to do\n        if (!toggle) {\n            return;\n        }\n\n        // Get the list to populate\n        const list = this.elements.settings.panes.speed.querySelector('ul');\n\n        // Show the pane and tab\n        utils.toggleHidden(this.elements.settings.tabs.speed, false);\n        utils.toggleHidden(this.elements.settings.panes.speed, false);\n\n        // Empty the menu\n        utils.emptyElement(list);\n\n        // Create items\n        this.options.speed.forEach(speed => {\n            const label = controls.getLabel.call(this, 'speed', speed);\n            controls.createMenuItem.call(this, speed, list, type, label);\n        });\n\n        controls.updateSetting.call(this, type, list);\n    },\n\n    // Check if we need to hide/show the settings menu\n    checkMenu() {\n        const { tabs } = this.elements.settings;\n        const visible = !utils.is.empty(tabs) && Object.values(tabs).some(tab => !tab.hidden);\n\n        utils.toggleHidden(this.elements.settings.menu, !visible);\n    },\n\n    // Show/hide menu\n    toggleMenu(event) {\n        const { form } = this.elements.settings;\n        const button = this.elements.buttons.settings;\n\n        // Menu and button are required\n        if (!utils.is.element(form) || !utils.is.element(button)) {\n            return;\n        }\n\n        const show = utils.is.boolean(event) ? event : utils.is.element(form) && form.getAttribute('aria-hidden') === 'true';\n\n        if (utils.is.event(event)) {\n            const isMenuItem = utils.is.element(form) && form.contains(event.target);\n            const isButton = event.target === this.elements.buttons.settings;\n\n            // If the click was inside the form or if the click\n            // wasn't the button or menu item and we're trying to\n            // show the menu (a doc click shouldn't show the menu)\n            if (isMenuItem || (!isMenuItem && !isButton && show)) {\n                return;\n            }\n\n            // Prevent the toggle being caught by the doc listener\n            if (isButton) {\n                event.stopPropagation();\n            }\n        }\n\n        // Set form and button attributes\n        if (utils.is.element(button)) {\n            button.setAttribute('aria-expanded', show);\n        }\n\n        if (utils.is.element(form)) {\n            form.setAttribute('aria-hidden', !show);\n            utils.toggleClass(this.elements.container, this.config.classNames.menu.open, show);\n\n            if (show) {\n                form.removeAttribute('tabindex');\n            } else {\n                form.setAttribute('tabindex', -1);\n            }\n        }\n    },\n\n    // Get the natural size of a tab\n    getTabSize(tab) {\n        const clone = tab.cloneNode(true);\n        clone.style.position = 'absolute';\n        clone.style.opacity = 0;\n        clone.setAttribute('aria-hidden', false);\n\n        // Prevent input's being unchecked due to the name being identical\n        Array.from(clone.querySelectorAll('input[name]')).forEach(input => {\n            const name = input.getAttribute('name');\n            input.setAttribute('name', `${name}-clone`);\n        });\n\n        // Append to parent so we get the \"real\" size\n        tab.parentNode.appendChild(clone);\n\n        // Get the sizes before we remove\n        const width = clone.scrollWidth;\n        const height = clone.scrollHeight;\n\n        // Remove from the DOM\n        utils.removeElement(clone);\n\n        return {\n            width,\n            height,\n        };\n    },\n\n    // Toggle Menu\n    showTab(event) {\n        const { menu } = this.elements.settings;\n        const tab = event.target;\n        const show = tab.getAttribute('aria-expanded') === 'false';\n        const pane = document.getElementById(tab.getAttribute('aria-controls'));\n\n        // Nothing to show, bail\n        if (!utils.is.element(pane)) {\n            return;\n        }\n\n        // Are we targetting a tab? If not, bail\n        const isTab = pane.getAttribute('role') === 'tabpanel';\n        if (!isTab) {\n            return;\n        }\n\n        // Hide all other tabs\n        // Get other tabs\n        const current = menu.querySelector('[role=\"tabpanel\"][aria-hidden=\"false\"]');\n        const container = current.parentNode;\n\n        // Set other toggles to be expanded false\n        Array.from(menu.querySelectorAll(`[aria-controls=\"${current.getAttribute('id')}\"]`)).forEach(toggle => {\n            toggle.setAttribute('aria-expanded', false);\n        });\n\n        // If we can do fancy animations, we'll animate the height/width\n        if (support.transitions && !support.reducedMotion) {\n            // Set the current width as a base\n            container.style.width = `${current.scrollWidth}px`;\n            container.style.height = `${current.scrollHeight}px`;\n\n            // Get potential sizes\n            const size = controls.getTabSize.call(this, pane);\n\n            // Restore auto height/width\n            const restore = e => {\n                // We're only bothered about height and width on the container\n                if (e.target !== container || ![\n                    'width',\n                    'height',\n                ].includes(e.propertyName)) {\n                    return;\n                }\n\n                // Revert back to auto\n                container.style.width = '';\n                container.style.height = '';\n\n                // Only listen once\n                utils.off(container, utils.transitionEndEvent, restore);\n            };\n\n            // Listen for the transition finishing and restore auto height/width\n            utils.on(container, utils.transitionEndEvent, restore);\n\n            // Set dimensions to target\n            container.style.width = `${size.width}px`;\n            container.style.height = `${size.height}px`;\n        }\n\n        // Set attributes on current tab\n        current.setAttribute('aria-hidden', true);\n        current.setAttribute('tabindex', -1);\n\n        // Set attributes on target\n        pane.setAttribute('aria-hidden', !show);\n        tab.setAttribute('aria-expanded', show);\n        pane.removeAttribute('tabindex');\n\n        // Focus the first item\n        pane.querySelectorAll('button:not(:disabled), input:not(:disabled), [tabindex]')[0].focus();\n    },\n\n    // Build the default HTML\n    // TODO: Set order based on order in the config.controls array?\n    create(data) {\n        // Do nothing if we want no controls\n        if (utils.is.empty(this.config.controls)) {\n            return null;\n        }\n\n        // Create the container\n        const container = utils.createElement('div', utils.getAttributesFromSelector(this.config.selectors.controls.wrapper));\n\n        // Restart button\n        if (this.config.controls.includes('restart')) {\n            container.appendChild(controls.createButton.call(this, 'restart'));\n        }\n\n        // Rewind button\n        if (this.config.controls.includes('rewind')) {\n            container.appendChild(controls.createButton.call(this, 'rewind'));\n        }\n\n        // Play/Pause button\n        if (this.config.controls.includes('play')) {\n            container.appendChild(controls.createButton.call(this, 'play'));\n        }\n\n        // Fast forward button\n        if (this.config.controls.includes('fast-forward')) {\n            container.appendChild(controls.createButton.call(this, 'fast-forward'));\n        }\n\n        // Progress\n        if (this.config.controls.includes('progress')) {\n            const progress = utils.createElement('div', utils.getAttributesFromSelector(this.config.selectors.progress));\n\n            // Seek range slider\n            const seek = controls.createRange.call(this, 'seek', {\n                id: `plyr-seek-${data.id}`,\n            });\n            progress.appendChild(seek.label);\n            progress.appendChild(seek.input);\n\n            // Buffer progress\n            progress.appendChild(controls.createProgress.call(this, 'buffer'));\n\n            // TODO: Add loop display indicator\n\n            // Seek tooltip\n            if (this.config.tooltips.seek) {\n                const tooltip = utils.createElement(\n                    'span',\n                    {\n                        role: 'tooltip',\n                        class: this.config.classNames.tooltip,\n                    },\n                    '00:00',\n                );\n\n                progress.appendChild(tooltip);\n                this.elements.display.seekTooltip = tooltip;\n            }\n\n            this.elements.progress = progress;\n            container.appendChild(this.elements.progress);\n        }\n\n        // Media current time display\n        if (this.config.controls.includes('current-time')) {\n            container.appendChild(controls.createTime.call(this, 'currentTime'));\n        }\n\n        // Media duration display\n        if (this.config.controls.includes('duration')) {\n            container.appendChild(controls.createTime.call(this, 'duration'));\n        }\n\n        // Toggle mute button\n        if (this.config.controls.includes('mute')) {\n            container.appendChild(controls.createButton.call(this, 'mute'));\n        }\n\n        // Volume range control\n        if (this.config.controls.includes('volume')) {\n            const volume = utils.createElement('div', {\n                class: 'plyr__volume',\n            });\n\n            // Set the attributes\n            const attributes = {\n                max: 1,\n                step: 0.05,\n                value: this.config.volume,\n            };\n\n            // Create the volume range slider\n            const range = controls.createRange.call(\n                this,\n                'volume',\n                utils.extend(attributes, {\n                    id: `plyr-volume-${data.id}`,\n                }),\n            );\n            volume.appendChild(range.label);\n            volume.appendChild(range.input);\n\n            this.elements.volume = volume;\n\n            container.appendChild(volume);\n        }\n\n        // Toggle captions button\n        if (this.config.controls.includes('captions')) {\n            container.appendChild(controls.createButton.call(this, 'captions'));\n        }\n\n        // Settings button / menu\n        if (this.config.controls.includes('settings') && !utils.is.empty(this.config.settings)) {\n            const menu = utils.createElement('div', {\n                class: 'plyr__menu',\n                hidden: '',\n            });\n\n            menu.appendChild(\n                controls.createButton.call(this, 'settings', {\n                    id: `plyr-settings-toggle-${data.id}`,\n                    'aria-haspopup': true,\n                    'aria-controls': `plyr-settings-${data.id}`,\n                    'aria-expanded': false,\n                }),\n            );\n\n            const form = utils.createElement('form', {\n                class: 'plyr__menu__container',\n                id: `plyr-settings-${data.id}`,\n                'aria-hidden': true,\n                'aria-labelled-by': `plyr-settings-toggle-${data.id}`,\n                role: 'tablist',\n                tabindex: -1,\n            });\n\n            const inner = utils.createElement('div');\n\n            const home = utils.createElement('div', {\n                id: `plyr-settings-${data.id}-home`,\n                'aria-hidden': false,\n                'aria-labelled-by': `plyr-settings-toggle-${data.id}`,\n                role: 'tabpanel',\n            });\n\n            // Create the tab list\n            const tabs = utils.createElement('ul', {\n                role: 'tablist',\n            });\n\n            // Build the tabs\n            this.config.settings.forEach(type => {\n                const tab = utils.createElement('li', {\n                    role: 'tab',\n                    hidden: '',\n                });\n\n                const button = utils.createElement(\n                    'button',\n                    utils.extend(utils.getAttributesFromSelector(this.config.selectors.buttons.settings), {\n                        type: 'button',\n                        class: `${this.config.classNames.control} ${this.config.classNames.control}--forward`,\n                        id: `plyr-settings-${data.id}-${type}-tab`,\n                        'aria-haspopup': true,\n                        'aria-controls': `plyr-settings-${data.id}-${type}`,\n                        'aria-expanded': false,\n                    }),\n                    i18n.get(type, this.config),\n                );\n\n                const value = utils.createElement('span', {\n                    class: this.config.classNames.menu.value,\n                });\n\n                // Speed contains HTML entities\n                value.innerHTML = data[type];\n\n                button.appendChild(value);\n                tab.appendChild(button);\n                tabs.appendChild(tab);\n\n                this.elements.settings.tabs[type] = tab;\n            });\n\n            home.appendChild(tabs);\n            inner.appendChild(home);\n\n            // Build the panes\n            this.config.settings.forEach(type => {\n                const pane = utils.createElement('div', {\n                    id: `plyr-settings-${data.id}-${type}`,\n                    'aria-hidden': true,\n                    'aria-labelled-by': `plyr-settings-${data.id}-${type}-tab`,\n                    role: 'tabpanel',\n                    tabindex: -1,\n                    hidden: '',\n                });\n\n                const back = utils.createElement(\n                    'button',\n                    {\n                        type: 'button',\n                        class: `${this.config.classNames.control} ${this.config.classNames.control}--back`,\n                        'aria-haspopup': true,\n                        'aria-controls': `plyr-settings-${data.id}-home`,\n                        'aria-expanded': false,\n                    },\n                    i18n.get(type, this.config),\n                );\n\n                pane.appendChild(back);\n\n                const options = utils.createElement('ul');\n\n                pane.appendChild(options);\n                inner.appendChild(pane);\n\n                this.elements.settings.panes[type] = pane;\n            });\n\n            form.appendChild(inner);\n            menu.appendChild(form);\n            container.appendChild(menu);\n\n            this.elements.settings.form = form;\n            this.elements.settings.menu = menu;\n        }\n\n        // Picture in picture button\n        if (this.config.controls.includes('pip') && support.pip) {\n            container.appendChild(controls.createButton.call(this, 'pip'));\n        }\n\n        // Airplay button\n        if (this.config.controls.includes('airplay') && support.airplay) {\n            container.appendChild(controls.createButton.call(this, 'airplay'));\n        }\n\n        // Toggle fullscreen button\n        if (this.config.controls.includes('fullscreen')) {\n            container.appendChild(controls.createButton.call(this, 'fullscreen'));\n        }\n\n        // Larger overlaid play button\n        if (this.config.controls.includes('play-large')) {\n            this.elements.container.appendChild(controls.createButton.call(this, 'play-large'));\n        }\n\n        this.elements.controls = container;\n\n        if (this.isHTML5) {\n            controls.setQualityMenu.call(this, html5.getQualityOptions.call(this));\n        }\n\n        controls.setSpeedMenu.call(this);\n\n        return container;\n    },\n\n    // Insert controls\n    inject() {\n        // Sprite\n        if (this.config.loadSprite) {\n            const icon = controls.getIconUrl.call(this);\n\n            // Only load external sprite using AJAX\n            if (icon.absolute) {\n                utils.loadSprite(icon.url, 'sprite-plyr');\n            }\n        }\n\n        // Create a unique ID\n        this.id = Math.floor(Math.random() * 10000);\n\n        // Null by default\n        let container = null;\n        this.elements.controls = null;\n\n        // HTML or Element passed as the option\n        if (utils.is.string(this.config.controls) || utils.is.element(this.config.controls)) {\n            container = this.config.controls;\n        } else if (utils.is.function(this.config.controls)) {\n            // A custom function to build controls\n            // The function can return a HTMLElement or String\n            container = this.config.controls({\n                id: this.id,\n                seektime: this.config.seekTime,\n                title: this.config.title,\n            });\n        } else {\n            // Create controls\n            container = controls.create.call(this, {\n                id: this.id,\n                seektime: this.config.seekTime,\n                speed: this.speed,\n                quality: this.quality,\n                captions: captions.getLabel.call(this),\n                // TODO: Looping\n                // loop: 'None',\n            });\n        }\n\n        // Controls container\n        let target;\n\n        // Inject to custom location\n        if (utils.is.string(this.config.selectors.controls.container)) {\n            target = document.querySelector(this.config.selectors.controls.container);\n        }\n\n        // Inject into the container by default\n        if (!utils.is.element(target)) {\n            target = this.elements.container;\n        }\n\n        // Inject controls HTML\n        if (utils.is.element(container)) {\n            target.appendChild(container);\n        } else if (container) {\n            target.insertAdjacentHTML('beforeend', container);\n        }\n\n        // Find the elements if need be\n        if (!utils.is.element(this.elements.controls)) {\n            utils.findElements.call(this);\n        }\n\n        // Edge sometimes doesn't finish the paint so force a redraw\n        if (window.navigator.userAgent.includes('Edge')) {\n            utils.repaint(target);\n        }\n\n        // Setup tooltips\n        if (this.config.tooltips.controls) {\n            const labels = utils.getElements.call(\n                this,\n                [\n                    this.config.selectors.controls.wrapper,\n                    ' ',\n                    this.config.selectors.labels,\n                    ' .',\n                    this.config.classNames.hidden,\n                ].join(''),\n            );\n\n            Array.from(labels).forEach(label => {\n                utils.toggleClass(label, this.config.classNames.hidden, false);\n                utils.toggleClass(label, this.config.classNames.tooltip, true);\n                label.setAttribute('role', 'tooltip');\n            });\n        }\n    },\n};\n\nexport default controls;\n","// ==========================================================================\n// Plyr Event Listeners\n// ==========================================================================\n\nimport utils from './utils';\nimport controls from './controls';\nimport ui from './ui';\n\n// Sniff out the browser\nconst browser = utils.getBrowser();\n\nclass Listeners {\n    constructor(player) {\n        this.player = player;\n        this.lastKey = null;\n\n        this.handleKey = this.handleKey.bind(this);\n        this.toggleMenu = this.toggleMenu.bind(this);\n        this.firstTouch = this.firstTouch.bind(this);\n    }\n\n    // Handle key presses\n    handleKey(event) {\n        const code = event.keyCode ? event.keyCode : event.which;\n        const pressed = event.type === 'keydown';\n        const repeat = pressed && code === this.lastKey;\n\n        // Bail if a modifier key is set\n        if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {\n            return;\n        }\n\n        // If the event is bubbled from the media element\n        // Firefox doesn't get the keycode for whatever reason\n        if (!utils.is.number(code)) {\n            return;\n        }\n\n        // Seek by the number keys\n        const seekByKey = () => {\n            // Divide the max duration into 10th's and times by the number value\n            this.player.currentTime = this.player.duration / 10 * (code - 48);\n        };\n\n        // Handle the key on keydown\n        // Reset on keyup\n        if (pressed) {\n            // Which keycodes should we prevent default\n            const preventDefault = [\n                48,\n                49,\n                50,\n                51,\n                52,\n                53,\n                54,\n                56,\n                57,\n                32,\n                75,\n                38,\n                40,\n                77,\n                39,\n                37,\n                70,\n                67,\n                73,\n                76,\n                79,\n            ];\n\n            // Check focused element\n            // and if the focused element is not editable (e.g. text input)\n            // and any that accept key input http://webaim.org/techniques/keyboard/\n            const focused = utils.getFocusElement();\n            if (utils.is.element(focused) && utils.matches(focused, this.player.config.selectors.editable)) {\n                return;\n            }\n\n            // If the code is found prevent default (e.g. prevent scrolling for arrows)\n            if (preventDefault.includes(code)) {\n                event.preventDefault();\n                event.stopPropagation();\n            }\n\n            switch (code) {\n                case 48:\n                case 49:\n                case 50:\n                case 51:\n                case 52:\n                case 53:\n                case 54:\n                case 55:\n                case 56:\n                case 57:\n                    // 0-9\n                    if (!repeat) {\n                        seekByKey();\n                    }\n                    break;\n\n                case 32:\n                case 75:\n                    // Space and K key\n                    if (!repeat) {\n                        this.player.togglePlay();\n                    }\n                    break;\n\n                case 38:\n                    // Arrow up\n                    this.player.increaseVolume(0.1);\n                    break;\n\n                case 40:\n                    // Arrow down\n                    this.player.decreaseVolume(0.1);\n                    break;\n\n                case 77:\n                    // M key\n                    if (!repeat) {\n                        this.player.muted = !this.player.muted;\n                    }\n                    break;\n\n                case 39:\n                    // Arrow forward\n                    this.player.forward();\n                    break;\n\n                case 37:\n                    // Arrow back\n                    this.player.rewind();\n                    break;\n\n                case 70:\n                    // F key\n                    this.player.fullscreen.toggle();\n                    break;\n\n                case 67:\n                    // C key\n                    if (!repeat) {\n                        this.player.toggleCaptions();\n                    }\n                    break;\n\n                case 76:\n                    // L key\n                    this.player.loop = !this.player.loop;\n                    break;\n\n                /* case 73:\n                    this.setLoop('start');\n                    break;\n\n                case 76:\n                    this.setLoop();\n                    break;\n\n                case 79:\n                    this.setLoop('end');\n                    break; */\n\n                default:\n                    break;\n            }\n\n            // Escape is handle natively when in full screen\n            // So we only need to worry about non native\n            if (!this.player.fullscreen.enabled && this.player.fullscreen.active && code === 27) {\n                this.player.fullscreen.toggle();\n            }\n\n            // Store last code for next cycle\n            this.lastKey = code;\n        } else {\n            this.lastKey = null;\n        }\n    }\n\n    // Toggle menu\n    toggleMenu(event) {\n        controls.toggleMenu.call(this.player, event);\n    }\n\n    // Device is touch enabled\n    firstTouch() {\n        this.player.touch = true;\n\n        // Add touch class\n        utils.toggleClass(this.player.elements.container, this.player.config.classNames.isTouch, true);\n\n        // Clean up\n        utils.off(document.body, 'touchstart', this.firstTouch);\n    }\n\n    // Global window & document listeners\n    global(toggle = true) {\n        // Keyboard shortcuts\n        if (this.player.config.keyboard.global) {\n            utils.toggleListener(window, 'keydown keyup', this.handleKey, toggle, false);\n        }\n\n        // Click anywhere closes menu\n        utils.toggleListener(document.body, 'click', this.toggleMenu, toggle);\n\n        // Detect touch by events\n        utils.on(document.body, 'touchstart', this.firstTouch);\n    }\n\n    // Container listeners\n    container() {\n        // Keyboard shortcuts\n        if (!this.player.config.keyboard.global && this.player.config.keyboard.focused) {\n            utils.on(this.player.elements.container, 'keydown keyup', this.handleKey, false);\n        }\n\n        // Detect tab focus\n        // Remove class on blur/focusout\n        utils.on(this.player.elements.container, 'focusout', event => {\n            utils.toggleClass(event.target, this.player.config.classNames.tabFocus, false);\n        });\n\n        // Add classname to tabbed elements\n        utils.on(this.player.elements.container, 'keydown', event => {\n            if (event.keyCode !== 9) {\n                return;\n            }\n\n            // Delay the adding of classname until the focus has changed\n            // This event fires before the focusin event\n            setTimeout(() => {\n                utils.toggleClass(utils.getFocusElement(), this.player.config.classNames.tabFocus, true);\n            }, 0);\n        });\n\n        // Toggle controls visibility based on mouse movement\n        if (this.player.config.hideControls) {\n            // Toggle controls on mouse events and entering fullscreen\n            utils.on(this.player.elements.container, 'mouseenter mouseleave mousemove touchstart touchend touchmove enterfullscreen exitfullscreen', event => {\n                this.player.toggleControls(event);\n            });\n        }\n    }\n\n    // Listen for media events\n    media() {\n        // Time change on media\n        utils.on(this.player.media, 'timeupdate seeking', event => ui.timeUpdate.call(this.player, event));\n\n        // Display duration\n        utils.on(this.player.media, 'durationchange loadedmetadata', event => ui.durationUpdate.call(this.player, event));\n\n        // Check for audio tracks on load\n        // We can't use `loadedmetadata` as it doesn't seem to have audio tracks at that point\n        utils.on(this.player.media, 'loadeddata', () => {\n            utils.toggleHidden(this.player.elements.volume, !this.player.hasAudio);\n            utils.toggleHidden(this.player.elements.buttons.mute, !this.player.hasAudio);\n        });\n\n        // Handle the media finishing\n        utils.on(this.player.media, 'ended', () => {\n            // Show poster on end\n            if (this.player.isHTML5 && this.player.isVideo && this.player.config.showPosterOnEnd) {\n                // Restart\n                this.player.restart();\n\n                // Re-load media\n                this.player.media.load();\n            }\n        });\n\n        // Check for buffer progress\n        utils.on(this.player.media, 'progress playing', event => ui.updateProgress.call(this.player, event));\n\n        // Handle volume changes\n        utils.on(this.player.media, 'volumechange', event => ui.updateVolume.call(this.player, event));\n\n        // Handle play/pause\n        utils.on(this.player.media, 'playing play pause ended emptied', event => ui.checkPlaying.call(this.player, event));\n\n        // Loading state\n        utils.on(this.player.media, 'waiting canplay seeked playing', event => ui.checkLoading.call(this.player, event));\n\n        // Check if media failed to load\n        // utils.on(this.player.media, 'play', event => ui.checkFailed.call(this.player, event));\n\n        // If autoplay, then load advertisement if required\n        // TODO: Show some sort of loading state while the ad manager loads else there's a delay before ad shows\n        utils.on(this.player.media, 'playing', () => {\n            if (!this.player.ads) {\n                return;\n            }\n\n            // If ads are enabled, wait for them first\n            if (this.player.ads.enabled && !this.player.ads.initialized) {\n                // Wait for manager response\n                this.player.ads.managerPromise.then(() => this.player.ads.play()).catch(() => this.player.play());\n            }\n        });\n\n        // Click video\n        if (this.player.supported.ui && this.player.config.clickToPlay && !this.player.isAudio) {\n            // Re-fetch the wrapper\n            const wrapper = utils.getElement.call(this.player, `.${this.player.config.classNames.video}`);\n\n            // Bail if there's no wrapper (this should never happen)\n            if (!utils.is.element(wrapper)) {\n                return;\n            }\n\n            // On click play, pause ore restart\n            utils.on(wrapper, 'click', () => {\n                // Touch devices will just show controls (if we're hiding controls)\n                if (this.player.config.hideControls && this.player.touch && !this.player.paused) {\n                    return;\n                }\n\n                if (this.player.paused) {\n                    this.player.play();\n                } else if (this.player.ended) {\n                    this.player.restart();\n                    this.player.play();\n                } else {\n                    this.player.pause();\n                }\n            });\n        }\n\n        // Disable right click\n        if (this.player.supported.ui && this.player.config.disableContextMenu) {\n            utils.on(\n                this.player.media,\n                'contextmenu',\n                event => {\n                    event.preventDefault();\n                },\n                false,\n            );\n        }\n\n        // Volume change\n        utils.on(this.player.media, 'volumechange', () => {\n            // Save to storage\n            this.player.storage.set({ volume: this.player.volume, muted: this.player.muted });\n        });\n\n        // Speed change\n        utils.on(this.player.media, 'ratechange', () => {\n            // Update UI\n            controls.updateSetting.call(this.player, 'speed');\n\n            // Save to storage\n            this.player.storage.set({ speed: this.player.speed });\n        });\n\n        // Quality request\n        utils.on(this.player.media, 'qualityrequested', event => {\n            // Save to storage\n            this.player.storage.set({ quality: event.detail.quality });\n        });\n\n        // Quality change\n        utils.on(this.player.media, 'qualitychange', event => {\n            // Update UI\n            controls.updateSetting.call(this.player, 'quality', null, event.detail.quality);\n        });\n\n        // Caption language change\n        utils.on(this.player.media, 'languagechange', () => {\n            // Update UI\n            controls.updateSetting.call(this.player, 'captions');\n\n            // Save to storage\n            this.player.storage.set({ language: this.player.language });\n        });\n\n        // Captions toggle\n        utils.on(this.player.media, 'captionsenabled captionsdisabled', () => {\n            // Update UI\n            controls.updateSetting.call(this.player, 'captions');\n\n            // Save to storage\n            this.player.storage.set({ captions: this.player.captions.active });\n        });\n\n        // Proxy events to container\n        // Bubble up key events for Edge\n        utils.on(this.player.media, this.player.config.events.concat([\n            'keyup',\n            'keydown',\n        ]).join(' '), event => {\n            let detail = {};\n\n            // Get error details from media\n            if (event.type === 'error') {\n                detail = this.player.media.error;\n            }\n\n            utils.dispatchEvent.call(this.player, this.player.elements.container, event.type, true, detail);\n        });\n    }\n\n    // Listen for control events\n    controls() {\n        // IE doesn't support input event, so we fallback to change\n        const inputEvent = browser.isIE ? 'change' : 'input';\n\n        // Run default and custom handlers\n        const proxy = (event, defaultHandler, customHandlerKey) => {\n            const customHandler = this.player.config.listeners[customHandlerKey];\n            const hasCustomHandler = utils.is.function(customHandler);\n            let returned = true;\n\n            // Execute custom handler\n            if (hasCustomHandler) {\n                returned = customHandler.call(this.player, event);\n            }\n\n            // Only call default handler if not prevented in custom handler\n            if (returned && utils.is.function(defaultHandler)) {\n                defaultHandler.call(this.player, event);\n            }\n        };\n\n        // Trigger custom and default handlers\n        const on = (element, type, defaultHandler, customHandlerKey, passive = true) => {\n            const customHandler = this.player.config.listeners[customHandlerKey];\n            const hasCustomHandler = utils.is.function(customHandler);\n\n            utils.on(element, type, event => proxy(event, defaultHandler, customHandlerKey), passive && !hasCustomHandler);\n        };\n\n        // Play/pause toggle\n        on(this.player.elements.buttons.play, 'click', this.player.togglePlay, 'play');\n\n        // Pause\n        on(this.player.elements.buttons.restart, 'click', this.player.restart, 'restart');\n\n        // Rewind\n        on(this.player.elements.buttons.rewind, 'click', this.player.rewind, 'rewind');\n\n        // Rewind\n        on(this.player.elements.buttons.fastForward, 'click', this.player.forward, 'fastForward');\n\n        // Mute toggle\n        on(\n            this.player.elements.buttons.mute,\n            'click',\n            () => {\n                this.player.muted = !this.player.muted;\n            },\n            'mute',\n        );\n\n        // Captions toggle\n        on(this.player.elements.buttons.captions, 'click', this.player.toggleCaptions);\n\n        // Fullscreen toggle\n        on(\n            this.player.elements.buttons.fullscreen,\n            'click',\n            () => {\n                this.player.fullscreen.toggle();\n            },\n            'fullscreen',\n        );\n\n        // Picture-in-Picture\n        on(\n            this.player.elements.buttons.pip,\n            'click',\n            () => {\n                this.player.pip = 'toggle';\n            },\n            'pip',\n        );\n\n        // Airplay\n        on(this.player.elements.buttons.airplay, 'click', this.player.airplay, 'airplay');\n\n        // Settings menu\n        on(this.player.elements.buttons.settings, 'click', event => {\n            controls.toggleMenu.call(this.player, event);\n        });\n\n        // Settings menu\n        on(this.player.elements.settings.form, 'click', event => {\n            event.stopPropagation();\n\n            // Settings menu items - use event delegation as items are added/removed\n            if (utils.matches(event.target, this.player.config.selectors.inputs.language)) {\n                proxy(\n                    event,\n                    () => {\n                        this.player.language = event.target.value;\n                    },\n                    'language',\n                );\n            } else if (utils.matches(event.target, this.player.config.selectors.inputs.quality)) {\n                proxy(\n                    event,\n                    () => {\n                        this.player.quality = event.target.value;\n                    },\n                    'quality',\n                );\n            } else if (utils.matches(event.target, this.player.config.selectors.inputs.speed)) {\n                proxy(\n                    event,\n                    () => {\n                        this.player.speed = parseFloat(event.target.value);\n                    },\n                    'speed',\n                );\n            } else {\n                controls.showTab.call(this.player, event);\n            }\n        });\n\n        // Seek\n        on(\n            this.player.elements.inputs.seek,\n            inputEvent,\n            event => {\n                this.player.currentTime = event.target.value / event.target.max * this.player.duration;\n            },\n            'seek',\n        );\n\n        // Current time invert\n        // Only if one time element is used for both currentTime and duration\n        if (this.player.config.toggleInvert && !utils.is.element(this.player.elements.display.duration)) {\n            on(this.player.elements.display.currentTime, 'click', () => {\n                // Do nothing if we're at the start\n                if (this.player.currentTime === 0) {\n                    return;\n                }\n\n                this.player.config.invertTime = !this.player.config.invertTime;\n                ui.timeUpdate.call(this.player);\n            });\n        }\n\n        // Volume\n        on(\n            this.player.elements.inputs.volume,\n            inputEvent,\n            event => {\n                this.player.volume = event.target.value;\n            },\n            'volume',\n        );\n\n        // Polyfill for lower fill in <input type=\"range\"> for webkit\n        if (browser.isWebkit) {\n            on(utils.getElements.call(this.player, 'input[type=\"range\"]'), 'input', event => {\n                controls.updateRangeFill.call(this.player, event.target);\n            });\n        }\n\n        // Seek tooltip\n        on(this.player.elements.progress, 'mouseenter mouseleave mousemove', event => controls.updateSeekTooltip.call(this.player, event));\n\n        // Toggle controls visibility based on mouse movement\n        if (this.player.config.hideControls) {\n            // Watch for cursor over controls so they don't hide when trying to interact\n            on(this.player.elements.controls, 'mouseenter mouseleave', event => {\n                this.player.elements.controls.hover = !this.player.touch && event.type === 'mouseenter';\n            });\n\n            // Watch for cursor over controls so they don't hide when trying to interact\n            on(this.player.elements.controls, 'mousedown mouseup touchstart touchend touchcancel', event => {\n                this.player.elements.controls.pressed = [\n                    'mousedown',\n                    'touchstart',\n                ].includes(event.type);\n            });\n\n            // Focus in/out on controls\n            on(this.player.elements.controls, 'focusin focusout', event => {\n                this.player.toggleControls(event);\n            });\n        }\n\n        // Mouse wheel for volume\n        on(\n            this.player.elements.inputs.volume,\n            'wheel',\n            event => {\n                // Detect \"natural\" scroll - suppored on OS X Safari only\n                // Other browsers on OS X will be inverted until support improves\n                const inverted = event.webkitDirectionInvertedFromDevice;\n                const step = 1 / 50;\n                let direction = 0;\n\n                // Scroll down (or up on natural) to decrease\n                if (event.deltaY < 0 || event.deltaX > 0) {\n                    if (inverted) {\n                        this.player.decreaseVolume(step);\n                        direction = -1;\n                    } else {\n                        this.player.increaseVolume(step);\n                        direction = 1;\n                    }\n                }\n\n                // Scroll up (or down on natural) to increase\n                if (event.deltaY > 0 || event.deltaX < 0) {\n                    if (inverted) {\n                        this.player.increaseVolume(step);\n                        direction = 1;\n                    } else {\n                        this.player.decreaseVolume(step);\n                        direction = -1;\n                    }\n                }\n\n                // Don't break page scrolling at max and min\n                if ((direction === 1 && this.player.media.volume < 1) || (direction === -1 && this.player.media.volume > 0)) {\n                    event.preventDefault();\n                }\n            },\n            'volume',\n            false,\n        );\n    }\n\n    // Reset on destroy\n    clear() {\n        this.global(false);\n    }\n}\n\nexport default Listeners;\n","// ==========================================================================\n// Plyr storage\n// ==========================================================================\n\nimport utils from './utils';\n\nclass Storage {\n    constructor(player) {\n        this.enabled = player.config.storage.enabled;\n        this.key = player.config.storage.key;\n    }\n\n    // Check for actual support (see if we can use it)\n    static get supported() {\n        try {\n            if (!('localStorage' in window)) {\n                return false;\n            }\n\n            const test = '___test';\n\n            // Try to use it (it might be disabled, e.g. user is in private mode)\n            // see: https://github.com/sampotts/plyr/issues/131\n            window.localStorage.setItem(test, test);\n            window.localStorage.removeItem(test);\n\n            return true;\n        } catch (e) {\n            return false;\n        }\n    }\n\n    get(key) {\n        if (!Storage.supported) {\n            return null;\n        }\n\n        const store = window.localStorage.getItem(this.key);\n\n        if (utils.is.empty(store)) {\n            return null;\n        }\n\n        const json = JSON.parse(store);\n\n        return utils.is.string(key) && key.length ? json[key] : json;\n    }\n\n    set(object) {\n        // Bail if we don't have localStorage support or it's disabled\n        if (!Storage.supported || !this.enabled) {\n            return;\n        }\n\n        // Can only store objectst\n        if (!utils.is.object(object)) {\n            return;\n        }\n\n        // Get current storage\n        let storage = this.get();\n\n        // Default to empty object\n        if (utils.is.empty(storage)) {\n            storage = {};\n        }\n\n        // Update the working copy of the values\n        utils.extend(storage, object);\n\n        // Update storage\n        window.localStorage.setItem(this.key, JSON.stringify(storage));\n    }\n}\n\nexport default Storage;\n","// ==========================================================================\n// Advertisement plugin using Google IMA HTML5 SDK\n// Create an account with our ad partner, vi here:\n// https://www.vi.ai/publisher-video-monetization/\n// ==========================================================================\n\n/* global google */\n\nimport utils from '../utils';\nimport i18n from '../i18n';\n\nclass Ads {\n    /**\n     * Ads constructor.\n     * @param {object} player\n     * @return {Ads}\n     */\n    constructor(player) {\n        this.player = player;\n        this.publisherId = player.config.ads.publisherId;\n        this.enabled = player.isHTML5 && player.isVideo && player.config.ads.enabled && utils.is.string(this.publisherId) && this.publisherId.length;\n        this.playing = false;\n        this.initialized = false;\n        this.elements = {\n            container: null,\n            displayContainer: null,\n        };\n        this.manager = null;\n        this.loader = null;\n        this.cuePoints = null;\n        this.events = {};\n        this.safetyTimer = null;\n        this.countdownTimer = null;\n\n        // Setup a promise to resolve when the IMA manager is ready\n        this.managerPromise = new Promise((resolve, reject) => {\n            // The ad is loaded and ready\n            this.on('loaded', resolve);\n\n            // Ads failed\n            this.on('error', reject);\n        });\n\n        this.load();\n    }\n\n    /**\n     * Load the IMA SDK\n     */\n    load() {\n        if (this.enabled) {\n            // Check if the Google IMA3 SDK is loaded or load it ourselves\n            if (!utils.is.object(window.google) || !utils.is.object(window.google.ima)) {\n                utils\n                    .loadScript(this.player.config.urls.googleIMA.api)\n                    .then(() => {\n                        this.ready();\n                    })\n                    .catch(() => {\n                        // Script failed to load or is blocked\n                        this.trigger('error', new Error('Google IMA SDK failed to load'));\n                    });\n            } else {\n                this.ready();\n            }\n        }\n    }\n\n    /**\n     * Get the ads instance ready\n     */\n    ready() {\n        // Start ticking our safety timer. If the whole advertisement\n        // thing doesn't resolve within our set time; we bail\n        this.startSafetyTimer(12000, 'ready()');\n\n        // Clear the safety timer\n        this.managerPromise.then(() => {\n            this.clearSafetyTimer('onAdsManagerLoaded()');\n        });\n\n        // Set listeners on the Plyr instance\n        this.listeners();\n\n        // Setup the IMA SDK\n        this.setupIMA();\n    }\n\n    // Build the default tag URL\n    get tagUrl() {\n        const params = {\n            AV_PUBLISHERID: '58c25bb0073ef448b1087ad6',\n            AV_CHANNELID: '5a0458dc28a06145e4519d21',\n            AV_URL: location.hostname,\n            cb: Date.now(),\n            AV_WIDTH: 640,\n            AV_HEIGHT: 480,\n            AV_CDIM2: this.publisherId,\n        };\n\n        const base = 'https://go.aniview.com/api/adserver6/vast/';\n\n        return `${base}?${utils.buildUrlParams(params)}`;\n    }\n\n    /**\n     * In order for the SDK to display ads for our video, we need to tell it where to put them,\n     * so here we define our ad container. This div is set up to render on top of the video player.\n     * Using the code below, we tell the SDK to render ads within that div. We also provide a\n     * handle to the content video player - the SDK will poll the current time of our player to\n     * properly place mid-rolls. After we create the ad display container, we initialize it. On\n     * mobile devices, this initialization is done as the result of a user action.\n     */\n    setupIMA() {\n        // Create the container for our advertisements\n        this.elements.container = utils.createElement('div', {\n            class: this.player.config.classNames.ads,\n        });\n        this.player.elements.container.appendChild(this.elements.container);\n\n        // So we can run VPAID2\n        google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED);\n\n        // Set language\n        google.ima.settings.setLocale(this.player.config.ads.language);\n\n        // We assume the adContainer is the video container of the plyr element\n        // that will house the ads\n        this.elements.displayContainer = new google.ima.AdDisplayContainer(this.elements.container);\n\n        // Request video ads to be pre-loaded\n        this.requestAds();\n    }\n\n    /**\n     * Request advertisements\n     */\n    requestAds() {\n        const { container } = this.player.elements;\n\n        try {\n            // Create ads loader\n            this.loader = new google.ima.AdsLoader(this.elements.displayContainer);\n\n            // Listen and respond to ads loaded and error events\n            this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, event => this.onAdsManagerLoaded(event), false);\n            this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, error => this.onAdError(error), false);\n\n            // Request video ads\n            const request = new google.ima.AdsRequest();\n            request.adTagUrl = this.tagUrl;\n\n            // Specify the linear and nonlinear slot sizes. This helps the SDK\n            // to select the correct creative if multiple are returned\n            request.linearAdSlotWidth = container.offsetWidth;\n            request.linearAdSlotHeight = container.offsetHeight;\n            request.nonLinearAdSlotWidth = container.offsetWidth;\n            request.nonLinearAdSlotHeight = container.offsetHeight;\n\n            // We only overlay ads as we only support video.\n            request.forceNonLinearFullSlot = false;\n\n            this.loader.requestAds(request);\n        } catch (e) {\n            this.onAdError(e);\n        }\n    }\n\n    /**\n     * Update the ad countdown\n     * @param {boolean} start\n     */\n    pollCountdown(start = false) {\n        if (!start) {\n            clearInterval(this.countdownTimer);\n            this.elements.container.removeAttribute('data-badge-text');\n            return;\n        }\n\n        const update = () => {\n            const time = utils.formatTime(Math.max(this.manager.getRemainingTime(), 0));\n            const label = `${i18n.get('advertisement', this.player.config)} - ${time}`;\n            this.elements.container.setAttribute('data-badge-text', label);\n        };\n\n        this.countdownTimer = setInterval(update, 100);\n    }\n\n    /**\n     * This method is called whenever the ads are ready inside the AdDisplayContainer\n     * @param {Event} adsManagerLoadedEvent\n     */\n    onAdsManagerLoaded(event) {\n        // Get the ads manager\n        const settings = new google.ima.AdsRenderingSettings();\n\n        // Tell the SDK to save and restore content video state on our behalf\n        settings.restoreCustomPlaybackStateOnAdBreakComplete = true;\n        settings.enablePreloading = true;\n\n        // The SDK is polling currentTime on the contentPlayback. And needs a duration\n        // so it can determine when to start the mid- and post-roll\n        this.manager = event.getAdsManager(this.player, settings);\n\n        // Get the cue points for any mid-rolls by filtering out the pre- and post-roll\n        this.cuePoints = this.manager.getCuePoints();\n\n        // Add advertisement cue's within the time line if available\n        if (!utils.is.empty(this.cuePoints)) {\n            this.cuePoints.forEach(cuePoint => {\n                if (cuePoint !== 0 && cuePoint !== -1 && cuePoint < this.player.duration) {\n                    const seekElement = this.player.elements.progress;\n\n                    if (utils.is.element(seekElement)) {\n                        const cuePercentage = 100 / this.player.duration * cuePoint;\n                        const cue = utils.createElement('span', {\n                            class: this.player.config.classNames.cues,\n                        });\n\n                        cue.style.left = `${cuePercentage.toString()}%`;\n                        seekElement.appendChild(cue);\n                    }\n                }\n            });\n        }\n\n        // Get skippable state\n        // TODO: Skip button\n        // this.manager.getAdSkippableState();\n\n        // Set volume to match player\n        this.manager.setVolume(this.player.volume);\n\n        // Add listeners to the required events\n        // Advertisement error events\n        this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, error => this.onAdError(error));\n\n        // Advertisement regular events\n        Object.keys(google.ima.AdEvent.Type).forEach(type => {\n            this.manager.addEventListener(google.ima.AdEvent.Type[type], event => this.onAdEvent(event));\n        });\n\n        // Resolve our adsManager\n        this.trigger('loaded');\n    }\n\n    /**\n     * This is where all the event handling takes place. Retrieve the ad from the event. Some\n     * events (e.g. ALL_ADS_COMPLETED) don't have the ad object associated\n     * https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdEvent.Type\n     * @param {Event} event\n     */\n    onAdEvent(event) {\n        const { container } = this.player.elements;\n\n        // Retrieve the ad from the event. Some events (e.g. ALL_ADS_COMPLETED)\n        // don't have ad object associated\n        const ad = event.getAd();\n\n        // Proxy event\n        const dispatchEvent = type => {\n            const event = `ads${type.replace(/_/g, '').toLowerCase()}`;\n            utils.dispatchEvent.call(this.player, this.player.media, event);\n        };\n\n        switch (event.type) {\n            case google.ima.AdEvent.Type.LOADED:\n                // This is the first event sent for an ad - it is possible to determine whether the\n                // ad is a video ad or an overlay\n                this.trigger('loaded');\n\n                // Bubble event\n                dispatchEvent(event.type);\n\n                // Start countdown\n                this.pollCountdown(true);\n\n                if (!ad.isLinear()) {\n                    // Position AdDisplayContainer correctly for overlay\n                    ad.width = container.offsetWidth;\n                    ad.height = container.offsetHeight;\n                }\n\n                // console.info('Ad type: ' + event.getAd().getAdPodInfo().getPodIndex());\n                // console.info('Ad time: ' + event.getAd().getAdPodInfo().getTimeOffset());\n                break;\n\n            case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:\n                // All ads for the current videos are done. We can now request new advertisements\n                // in case the video is re-played\n\n                // Fire event\n                dispatchEvent(event.type);\n\n                // TODO: Example for what happens when a next video in a playlist would be loaded.\n                // So here we load a new video when all ads are done.\n                // Then we load new ads within a new adsManager. When the video\n                // Is started - after - the ads are loaded, then we get ads.\n                // You can also easily test cancelling and reloading by running\n                // player.ads.cancel() and player.ads.play from the console I guess.\n                // this.player.source = {\n                //     type: 'video',\n                //     title: 'View From A Blue Moon',\n                //     sources: [{\n                //         src:\n                // 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4', type:\n                // 'video/mp4', }], poster:\n                // 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg', tracks:\n                // [ { kind: 'captions', label: 'English', srclang: 'en', src:\n                // 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt',\n                // default: true, }, { kind: 'captions', label: 'French', srclang: 'fr', src:\n                // 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.fr.vtt', }, ],\n                // };\n\n                // TODO: So there is still this thing where a video should only be allowed to start\n                // playing when the IMA SDK is ready or has failed\n\n                this.loadAds();\n                break;\n\n            case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:\n                // This event indicates the ad has started - the video player can adjust the UI,\n                // for example display a pause button and remaining time. Fired when content should\n                // be paused. This usually happens right before an ad is about to cover the content\n\n                dispatchEvent(event.type);\n\n                this.pauseContent();\n\n                break;\n\n            case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:\n                // This event indicates the ad has finished - the video player can perform\n                // appropriate UI actions, such as removing the timer for remaining time detection.\n                // Fired when content should be resumed. This usually happens when an ad finishes\n                // or collapses\n\n                dispatchEvent(event.type);\n\n                this.pollCountdown();\n\n                this.resumeContent();\n\n                break;\n\n            case google.ima.AdEvent.Type.STARTED:\n            case google.ima.AdEvent.Type.MIDPOINT:\n            case google.ima.AdEvent.Type.COMPLETE:\n            case google.ima.AdEvent.Type.IMPRESSION:\n            case google.ima.AdEvent.Type.CLICK:\n                dispatchEvent(event.type);\n                break;\n\n            default:\n                break;\n        }\n    }\n\n    /**\n     * Any ad error handling comes through here\n     * @param {Event} event\n     */\n    onAdError(event) {\n        this.cancel();\n        this.player.debug.warn('Ads error', event);\n    }\n\n    /**\n     * Setup hooks for Plyr and window events. This ensures\n     * the mid- and post-roll launch at the correct time. And\n     * resize the advertisement when the player resizes\n     */\n    listeners() {\n        const { container } = this.player.elements;\n        let time;\n\n        // Add listeners to the required events\n        this.player.on('ended', () => {\n            this.loader.contentComplete();\n        });\n\n        this.player.on('seeking', () => {\n            time = this.player.currentTime;\n            return time;\n        });\n\n        this.player.on('seeked', () => {\n            const seekedTime = this.player.currentTime;\n\n            if (utils.is.empty(this.cuePoints)) {\n                return;\n            }\n\n            this.cuePoints.forEach((cuePoint, index) => {\n                if (time < cuePoint && cuePoint < seekedTime) {\n                    this.manager.discardAdBreak();\n                    this.cuePoints.splice(index, 1);\n                }\n            });\n        });\n\n        // Listen to the resizing of the window. And resize ad accordingly\n        // TODO: eventually implement ResizeObserver\n        window.addEventListener('resize', () => {\n            if (this.manager) {\n                this.manager.resize(container.offsetWidth, container.offsetHeight, google.ima.ViewMode.NORMAL);\n            }\n        });\n    }\n\n    /**\n     * Initialize the adsManager and start playing advertisements\n     */\n    play() {\n        const { container } = this.player.elements;\n\n        if (!this.managerPromise) {\n            this.resumeContent();\n        }\n\n        // Play the requested advertisement whenever the adsManager is ready\n        this.managerPromise\n            .then(() => {\n                // Initialize the container. Must be done via a user action on mobile devices\n                this.elements.displayContainer.initialize();\n\n                try {\n                    if (!this.initialized) {\n                        // Initialize the ads manager. Ad rules playlist will start at this time\n                        this.manager.init(container.offsetWidth, container.offsetHeight, google.ima.ViewMode.NORMAL);\n\n                        // Call play to start showing the ad. Single video and overlay ads will\n                        // start at this time; the call will be ignored for ad rules\n                        this.manager.start();\n                    }\n\n                    this.initialized = true;\n                } catch (adError) {\n                    // An error may be thrown if there was a problem with the\n                    // VAST response\n                    this.onAdError(adError);\n                }\n            })\n            .catch(() => {});\n    }\n\n    /**\n     * Resume our video\n     */\n    resumeContent() {\n        // Hide the advertisement container\n        this.elements.container.style.zIndex = '';\n\n        // Ad is stopped\n        this.playing = false;\n\n        // Play our video\n        if (this.player.currentTime < this.player.duration) {\n            this.player.play();\n        }\n    }\n\n    /**\n     * Pause our video\n     */\n    pauseContent() {\n        // Show the advertisement container\n        this.elements.container.style.zIndex = 3;\n\n        // Ad is playing.\n        this.playing = true;\n\n        // Pause our video.\n        this.player.pause();\n    }\n\n    /**\n     * Destroy the adsManager so we can grab new ads after this. If we don't then we're not\n     * allowed to call new ads based on google policies, as they interpret this as an accidental\n     * video requests. https://developers.google.com/interactive-\n     * media-ads/docs/sdks/android/faq#8\n     */\n    cancel() {\n        // Pause our video\n        if (this.initialized) {\n            this.resumeContent();\n        }\n\n        // Tell our instance that we're done for now\n        this.trigger('error');\n\n        // Re-create our adsManager\n        this.loadAds();\n    }\n\n    /**\n     * Re-create our adsManager\n     */\n    loadAds() {\n        // Tell our adsManager to go bye bye\n        this.managerPromise\n            .then(() => {\n                // Destroy our adsManager\n                if (this.manager) {\n                    this.manager.destroy();\n                }\n\n                // Re-set our adsManager promises\n                this.managerPromise = new Promise(resolve => {\n                    this.on('loaded', resolve);\n                    this.player.debug.log(this.manager);\n                });\n\n                // Now request some new advertisements\n                this.requestAds();\n            })\n            .catch(() => {});\n    }\n\n    /**\n     * Handles callbacks after an ad event was invoked\n     * @param {string} event - Event type\n     */\n    trigger(event, ...args) {\n        const handlers = this.events[event];\n\n        if (utils.is.array(handlers)) {\n            handlers.forEach(handler => {\n                if (utils.is.function(handler)) {\n                    handler.apply(this, args);\n                }\n            });\n        }\n    }\n\n    /**\n     * Add event listeners\n     * @param {string} event - Event type\n     * @param {function} callback - Callback for when event occurs\n     * @return {Ads}\n     */\n    on(event, callback) {\n        if (!utils.is.array(this.events[event])) {\n            this.events[event] = [];\n        }\n\n        this.events[event].push(callback);\n\n        return this;\n    }\n\n    /**\n     * Setup a safety timer for when the ad network doesn't respond for whatever reason.\n     * The advertisement has 12 seconds to get its things together. We stop this timer when the\n     * advertisement is playing, or when a user action is required to start, then we clear the\n     * timer on ad ready\n     * @param {number} time\n     * @param {string} from\n     */\n    startSafetyTimer(time, from) {\n        this.player.debug.log(`Safety timer invoked from: ${from}`);\n\n        this.safetyTimer = setTimeout(() => {\n            this.cancel();\n            this.clearSafetyTimer('startSafetyTimer()');\n        }, time);\n    }\n\n    /**\n     * Clear our safety timer(s)\n     * @param {string} from\n     */\n    clearSafetyTimer(from) {\n        if (!utils.is.nullOrUndefined(this.safetyTimer)) {\n            this.player.debug.log(`Safety timer cleared from: ${from}`);\n\n            clearTimeout(this.safetyTimer);\n            this.safetyTimer = null;\n        }\n    }\n}\n\nexport default Ads;\n","// ==========================================================================\n// YouTube plugin\n// ==========================================================================\n\nimport utils from './../utils';\nimport controls from './../controls';\nimport ui from './../ui';\n\n// Standardise YouTube quality unit\nfunction mapQualityUnit(input) {\n    switch (input) {\n        case 'hd2160':\n            return 2160;\n\n        case 2160:\n            return 'hd2160';\n\n        case 'hd1440':\n            return 1440;\n\n        case 1440:\n            return 'hd1440';\n\n        case 'hd1080':\n            return 1080;\n\n        case 1080:\n            return 'hd1080';\n\n        case 'hd720':\n            return 720;\n\n        case 720:\n            return 'hd720';\n\n        case 'large':\n            return 480;\n\n        case 480:\n            return 'large';\n\n        case 'medium':\n            return 360;\n\n        case 360:\n            return 'medium';\n\n        case 'small':\n            return 240;\n\n        case 240:\n            return 'small';\n\n        default:\n            return 'default';\n    }\n}\n\nfunction mapQualityUnits(levels) {\n    if (utils.is.empty(levels)) {\n        return levels;\n    }\n\n    return utils.dedupe(levels.map(level => mapQualityUnit(level)));\n}\n\nconst youtube = {\n    setup() {\n        // Add embed class for responsive\n        utils.toggleClass(this.elements.wrapper, this.config.classNames.embed, true);\n\n        // Set aspect ratio\n        youtube.setAspectRatio.call(this);\n\n        // Setup API\n        if (utils.is.object(window.YT) && utils.is.function(window.YT.Player)) {\n            youtube.ready.call(this);\n        } else {\n            // Load the API\n            utils.loadScript(this.config.urls.youtube.api).catch(error => {\n                this.debug.warn('YouTube API failed to load', error);\n            });\n\n            // Setup callback for the API\n            // YouTube has it's own system of course...\n            window.onYouTubeReadyCallbacks = window.onYouTubeReadyCallbacks || [];\n\n            // Add to queue\n            window.onYouTubeReadyCallbacks.push(() => {\n                youtube.ready.call(this);\n            });\n\n            // Set callback to process queue\n            window.onYouTubeIframeAPIReady = () => {\n                window.onYouTubeReadyCallbacks.forEach(callback => {\n                    callback();\n                });\n            };\n        }\n    },\n\n    // Get the media title\n    getTitle(videoId) {\n        // Try via undocumented API method first\n        // This method disappears now and then though...\n        // https://github.com/sampotts/plyr/issues/709\n        if (utils.is.function(this.embed.getVideoData)) {\n            const { title } = this.embed.getVideoData();\n\n            if (utils.is.empty(title)) {\n                this.config.title = title;\n                ui.setTitle.call(this);\n                return;\n            }\n        }\n\n        // Or via Google API\n        const key = this.config.keys.google;\n        if (utils.is.string(key) && !utils.is.empty(key)) {\n            const url = `https://www.googleapis.com/youtube/v3/videos?id=${videoId}&key=${key}&fields=items(snippet(title))&part=snippet`;\n\n            utils\n                .fetch(url)\n                .then(result => {\n                    if (utils.is.object(result)) {\n                        this.config.title = result.items[0].snippet.title;\n                        ui.setTitle.call(this);\n                    }\n                })\n                .catch(() => {});\n        }\n    },\n\n    // Set aspect ratio\n    setAspectRatio() {\n        const ratio = this.config.ratio.split(':');\n        this.elements.wrapper.style.paddingBottom = `${100 / ratio[0] * ratio[1]}%`;\n    },\n\n    // API ready\n    ready() {\n        const player = this;\n\n        // Ignore already setup (race condition)\n        const currentId = player.media.getAttribute('id');\n        if (!utils.is.empty(currentId) && currentId.startsWith('youtube-')) {\n            return;\n        }\n\n        // Get the source URL or ID\n        let source = player.media.getAttribute('src');\n\n        // Get from <div> if needed\n        if (utils.is.empty(source)) {\n            source = player.media.getAttribute(this.config.attributes.embed.id);\n        }\n\n        // Replace the <iframe> with a <div> due to YouTube API issues\n        const videoId = utils.parseYouTubeId(source);\n        const id = utils.generateId(player.provider);\n        const container = utils.createElement('div', { id });\n        player.media = utils.replaceElement(container, player.media);\n\n        // Setup instance\n        // https://developers.google.com/youtube/iframe_api_reference\n        player.embed = new window.YT.Player(id, {\n            videoId,\n            playerVars: {\n                autoplay: player.config.autoplay ? 1 : 0, // Autoplay\n                controls: player.supported.ui ? 0 : 1, // Only show controls if not fully supported\n                rel: 0, // No related vids\n                showinfo: 0, // Hide info\n                iv_load_policy: 3, // Hide annotations\n                modestbranding: 1, // Hide logos as much as possible (they still show one in the corner when paused)\n                disablekb: 1, // Disable keyboard as we handle it\n                playsinline: 1, // Allow iOS inline playback\n\n                // Tracking for stats\n                // origin: window ? `${window.location.protocol}//${window.location.host}` : null,\n                widget_referrer: window ? window.location.href : null,\n\n                // Captions are flaky on YouTube\n                cc_load_policy: player.captions.active ? 1 : 0,\n                cc_lang_pref: player.config.captions.language,\n            },\n            events: {\n                onError(event) {\n                    // If we've already fired an error, don't do it again\n                    // YouTube fires onError twice\n                    if (utils.is.object(player.media.error)) {\n                        return;\n                    }\n\n                    const detail = {\n                        code: event.data,\n                    };\n\n                    // Messages copied from https://developers.google.com/youtube/iframe_api_reference#onError\n                    switch (event.data) {\n                        case 2:\n                            detail.message =\n                                'The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.';\n                            break;\n\n                        case 5:\n                            detail.message =\n                                'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.';\n                            break;\n\n                        case 100:\n                            detail.message =\n                                'The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.';\n                            break;\n\n                        case 101:\n                        case 150:\n                            detail.message = 'The owner of the requested video does not allow it to be played in embedded players.';\n                            break;\n\n                        default:\n                            detail.message = 'An unknown error occured';\n                            break;\n                    }\n\n                    player.media.error = detail;\n\n                    utils.dispatchEvent.call(player, player.media, 'error');\n                },\n                onPlaybackQualityChange() {\n                    utils.dispatchEvent.call(player, player.media, 'qualitychange', false, {\n                        quality: player.media.quality,\n                    });\n                },\n                onPlaybackRateChange(event) {\n                    // Get the instance\n                    const instance = event.target;\n\n                    // Get current speed\n                    player.media.playbackRate = instance.getPlaybackRate();\n\n                    utils.dispatchEvent.call(player, player.media, 'ratechange');\n                },\n                onReady(event) {\n                    // Get the instance\n                    const instance = event.target;\n\n                    // Get the title\n                    youtube.getTitle.call(player, videoId);\n\n                    // Create a faux HTML5 API using the YouTube API\n                    player.media.play = () => {\n                        instance.playVideo();\n                    };\n\n                    player.media.pause = () => {\n                        instance.pauseVideo();\n                    };\n\n                    player.media.stop = () => {\n                        instance.stopVideo();\n                    };\n\n                    player.media.duration = instance.getDuration();\n                    player.media.paused = true;\n\n                    // Seeking\n                    player.media.currentTime = 0;\n                    Object.defineProperty(player.media, 'currentTime', {\n                        get() {\n                            return Number(instance.getCurrentTime());\n                        },\n                        set(time) {\n                            // Vimeo will automatically play on seek\n                            const { paused } = player.media;\n\n                            // Set seeking flag\n                            player.media.seeking = true;\n\n                            // Trigger seeking\n                            utils.dispatchEvent.call(player, player.media, 'seeking');\n\n                            // Seek after events sent\n                            instance.seekTo(time);\n\n                            // Restore pause state\n                            if (paused) {\n                                player.pause();\n                            }\n                        },\n                    });\n\n                    // Playback speed\n                    Object.defineProperty(player.media, 'playbackRate', {\n                        get() {\n                            return instance.getPlaybackRate();\n                        },\n                        set(input) {\n                            instance.setPlaybackRate(input);\n                        },\n                    });\n\n                    // Quality\n                    Object.defineProperty(player.media, 'quality', {\n                        get() {\n                            return mapQualityUnit(instance.getPlaybackQuality());\n                        },\n                        set(input) {\n                            const quality = input;\n\n                            // Set via API\n                            instance.setPlaybackQuality(mapQualityUnit(quality));\n\n                            // Trigger request event\n                            utils.dispatchEvent.call(player, player.media, 'qualityrequested', false, {\n                                quality,\n                            });\n                        },\n                    });\n\n                    // Volume\n                    let { volume } = player.config;\n                    Object.defineProperty(player.media, 'volume', {\n                        get() {\n                            return volume;\n                        },\n                        set(input) {\n                            volume = input;\n                            instance.setVolume(volume * 100);\n                            utils.dispatchEvent.call(player, player.media, 'volumechange');\n                        },\n                    });\n\n                    // Muted\n                    let { muted } = player.config;\n                    Object.defineProperty(player.media, 'muted', {\n                        get() {\n                            return muted;\n                        },\n                        set(input) {\n                            const toggle = utils.is.boolean(input) ? input : muted;\n                            muted = toggle;\n                            instance[toggle ? 'mute' : 'unMute']();\n                            utils.dispatchEvent.call(player, player.media, 'volumechange');\n                        },\n                    });\n\n                    // Source\n                    Object.defineProperty(player.media, 'currentSrc', {\n                        get() {\n                            return instance.getVideoUrl();\n                        },\n                    });\n\n                    // Ended\n                    Object.defineProperty(player.media, 'ended', {\n                        get() {\n                            return player.currentTime === player.duration;\n                        },\n                    });\n\n                    // Get available speeds\n                    player.options.speed = instance.getAvailablePlaybackRates();\n\n                    // Set the tabindex to avoid focus entering iframe\n                    if (player.supported.ui) {\n                        player.media.setAttribute('tabindex', -1);\n                    }\n\n                    utils.dispatchEvent.call(player, player.media, 'timeupdate');\n                    utils.dispatchEvent.call(player, player.media, 'durationchange');\n\n                    // Reset timer\n                    clearInterval(player.timers.buffering);\n\n                    // Setup buffering\n                    player.timers.buffering = setInterval(() => {\n                        // Get loaded % from YouTube\n                        player.media.buffered = instance.getVideoLoadedFraction();\n\n                        // Trigger progress only when we actually buffer something\n                        if (player.media.lastBuffered === null || player.media.lastBuffered < player.media.buffered) {\n                            utils.dispatchEvent.call(player, player.media, 'progress');\n                        }\n\n                        // Set last buffer point\n                        player.media.lastBuffered = player.media.buffered;\n\n                        // Bail if we're at 100%\n                        if (player.media.buffered === 1) {\n                            clearInterval(player.timers.buffering);\n\n                            // Trigger event\n                            utils.dispatchEvent.call(player, player.media, 'canplaythrough');\n                        }\n                    }, 200);\n\n                    // Rebuild UI\n                    setTimeout(() => ui.build.call(player), 50);\n                },\n                onStateChange(event) {\n                    // Get the instance\n                    const instance = event.target;\n\n                    // Reset timer\n                    clearInterval(player.timers.playing);\n\n                    // Handle events\n                    // -1   Unstarted\n                    // 0    Ended\n                    // 1    Playing\n                    // 2    Paused\n                    // 3    Buffering\n                    // 5    Video cued\n                    switch (event.data) {\n                        case -1:\n                            // Update scrubber\n                            utils.dispatchEvent.call(player, player.media, 'timeupdate');\n\n                            // Get loaded % from YouTube\n                            player.media.buffered = instance.getVideoLoadedFraction();\n                            utils.dispatchEvent.call(player, player.media, 'progress');\n\n                            break;\n\n                        case 0:\n                            player.media.paused = true;\n\n                            // YouTube doesn't support loop for a single video, so mimick it.\n                            if (player.media.loop) {\n                                // YouTube needs a call to `stopVideo` before playing again\n                                instance.stopVideo();\n                                instance.playVideo();\n                            } else {\n                                utils.dispatchEvent.call(player, player.media, 'ended');\n                            }\n\n                            break;\n\n                        case 1:\n                            // If we were seeking, fire seeked event\n                            if (player.media.seeking) {\n                                utils.dispatchEvent.call(player, player.media, 'seeked');\n                            }\n                            player.media.seeking = false;\n\n                            // Only fire play if paused before\n                            if (player.media.paused) {\n                                utils.dispatchEvent.call(player, player.media, 'play');\n                            }\n                            player.media.paused = false;\n\n                            utils.dispatchEvent.call(player, player.media, 'playing');\n\n                            // Poll to get playback progress\n                            player.timers.playing = setInterval(() => {\n                                utils.dispatchEvent.call(player, player.media, 'timeupdate');\n                            }, 50);\n\n                            // Check duration again due to YouTube bug\n                            // https://github.com/sampotts/plyr/issues/374\n                            // https://code.google.com/p/gdata-issues/issues/detail?id=8690\n                            if (player.media.duration !== instance.getDuration()) {\n                                player.media.duration = instance.getDuration();\n                                utils.dispatchEvent.call(player, player.media, 'durationchange');\n                            }\n\n                            // Get quality\n                            controls.setQualityMenu.call(player, mapQualityUnits(instance.getAvailableQualityLevels()));\n\n                            break;\n\n                        case 2:\n                            player.media.paused = true;\n\n                            utils.dispatchEvent.call(player, player.media, 'pause');\n\n                            break;\n\n                        default:\n                            break;\n                    }\n\n                    utils.dispatchEvent.call(player, player.elements.container, 'statechange', false, {\n                        code: event.data,\n                    });\n                },\n            },\n        });\n    },\n};\n\nexport default youtube;\n","// ==========================================================================\n// Vimeo plugin\n// ==========================================================================\n\nimport utils from './../utils';\nimport captions from './../captions';\nimport controls from './../controls';\nimport ui from './../ui';\n\nconst vimeo = {\n    setup() {\n        // Add embed class for responsive\n        utils.toggleClass(this.elements.wrapper, this.config.classNames.embed, true);\n\n        // Set intial ratio\n        vimeo.setAspectRatio.call(this);\n\n        // Load the API if not already\n        if (!utils.is.object(window.Vimeo)) {\n            utils\n                .loadScript(this.config.urls.vimeo.api)\n                .then(() => {\n                    vimeo.ready.call(this);\n                })\n                .catch(error => {\n                    this.debug.warn('Vimeo API failed to load', error);\n                });\n        } else {\n            vimeo.ready.call(this);\n        }\n    },\n\n    // Set aspect ratio\n    // For Vimeo we have an extra 300% height <div> to hide the standard controls and UI\n    setAspectRatio(input) {\n        const ratio = utils.is.string(input) ? input.split(':') : this.config.ratio.split(':');\n        const padding = 100 / ratio[0] * ratio[1];\n        this.elements.wrapper.style.paddingBottom = `${padding}%`;\n\n        if (this.supported.ui) {\n            const height = 240;\n            const offset = (height - padding) / (height / 50);\n\n            this.media.style.transform = `translateY(-${offset}%)`;\n        }\n    },\n\n    // API Ready\n    ready() {\n        const player = this;\n\n        // Get Vimeo params for the iframe\n        const options = {\n            loop: player.config.loop.active,\n            autoplay: player.autoplay,\n            byline: false,\n            portrait: false,\n            title: false,\n            speed: true,\n            transparent: 0,\n            gesture: 'media',\n            playsinline: !this.config.fullscreen.iosNative,\n        };\n        const params = utils.buildUrlParams(options);\n\n        // Get the source URL or ID\n        let source = player.media.getAttribute('src');\n\n        // Get from <div> if needed\n        if (utils.is.empty(source)) {\n            source = player.media.getAttribute(this.config.attributes.embed.id);\n        }\n\n        const id = utils.parseVimeoId(source);\n\n        // Build an iframe\n        const iframe = utils.createElement('iframe');\n        const src = `https://player.vimeo.com/video/${id}?${params}`;\n        iframe.setAttribute('src', src);\n        iframe.setAttribute('allowfullscreen', '');\n        iframe.setAttribute('allowtransparency', '');\n        iframe.setAttribute('allow', 'autoplay');\n\n        // Inject the package\n        const wrapper = utils.createElement('div');\n        wrapper.appendChild(iframe);\n        player.media = utils.replaceElement(wrapper, player.media);\n\n        // Setup instance\n        // https://github.com/vimeo/player.js\n        player.embed = new window.Vimeo.Player(iframe);\n\n        player.media.paused = true;\n        player.media.currentTime = 0;\n\n        // Disable native text track rendering\n        if (player.supported.ui) {\n            player.embed.disableTextTrack();\n        }\n\n        // Create a faux HTML5 API using the Vimeo API\n        player.media.play = () => {\n            player.embed.play().then(() => {\n                player.media.paused = false;\n            });\n        };\n\n        player.media.pause = () => {\n            player.embed.pause().then(() => {\n                player.media.paused = true;\n            });\n        };\n\n        player.media.stop = () => {\n            player.pause();\n            player.currentTime = 0;\n        };\n\n        // Seeking\n        let { currentTime } = player.media;\n        Object.defineProperty(player.media, 'currentTime', {\n            get() {\n                return currentTime;\n            },\n            set(time) {\n                // Get current paused state\n                // Vimeo will automatically play on seek\n                const { paused } = player.media;\n\n                // Set seeking flag\n                player.media.seeking = true;\n\n                // Trigger seeking\n                utils.dispatchEvent.call(player, player.media, 'seeking');\n\n                // Seek after events\n                player.embed.setCurrentTime(time);\n\n                // Restore pause state\n                if (paused) {\n                    player.pause();\n                }\n            },\n        });\n\n        // Playback speed\n        let speed = player.config.speed.selected;\n        Object.defineProperty(player.media, 'playbackRate', {\n            get() {\n                return speed;\n            },\n            set(input) {\n                player.embed\n                    .setPlaybackRate(input)\n                    .then(() => {\n                        speed = input;\n                        utils.dispatchEvent.call(player, player.media, 'ratechange');\n                    })\n                    .catch(error => {\n                        // Hide menu item (and menu if empty)\n                        if (error.name === 'Error') {\n                            controls.setSpeedMenu.call(player, []);\n                        }\n                    });\n            },\n        });\n\n        // Volume\n        let { volume } = player.config;\n        Object.defineProperty(player.media, 'volume', {\n            get() {\n                return volume;\n            },\n            set(input) {\n                player.embed.setVolume(input).then(() => {\n                    volume = input;\n                    utils.dispatchEvent.call(player, player.media, 'volumechange');\n                });\n            },\n        });\n\n        // Muted\n        let { muted } = player.config;\n        Object.defineProperty(player.media, 'muted', {\n            get() {\n                return muted;\n            },\n            set(input) {\n                const toggle = utils.is.boolean(input) ? input : false;\n\n                player.embed.setVolume(toggle ? 0 : player.config.volume).then(() => {\n                    muted = toggle;\n                    utils.dispatchEvent.call(player, player.media, 'volumechange');\n                });\n            },\n        });\n\n        // Loop\n        let { loop } = player.config;\n        Object.defineProperty(player.media, 'loop', {\n            get() {\n                return loop;\n            },\n            set(input) {\n                const toggle = utils.is.boolean(input) ? input : player.config.loop.active;\n\n                player.embed.setLoop(toggle).then(() => {\n                    loop = toggle;\n                });\n            },\n        });\n\n        // Source\n        let currentSrc;\n        player.embed\n            .getVideoUrl()\n            .then(value => {\n                currentSrc = value;\n            })\n            .catch(error => {\n                this.debug.warn(error);\n            });\n\n        Object.defineProperty(player.media, 'currentSrc', {\n            get() {\n                return currentSrc;\n            },\n        });\n\n        // Ended\n        Object.defineProperty(player.media, 'ended', {\n            get() {\n                return player.currentTime === player.duration;\n            },\n        });\n\n        // Set aspect ratio based on video size\n        Promise.all([\n            player.embed.getVideoWidth(),\n            player.embed.getVideoHeight(),\n        ]).then(dimensions => {\n            const ratio = utils.getAspectRatio(dimensions[0], dimensions[1]);\n            vimeo.setAspectRatio.call(this, ratio);\n        });\n\n        // Set autopause\n        player.embed.setAutopause(player.config.autopause).then(state => {\n            player.config.autopause = state;\n        });\n\n        // Get title\n        player.embed.getVideoTitle().then(title => {\n            player.config.title = title;\n            ui.setTitle.call(this);\n        });\n\n        // Get current time\n        player.embed.getCurrentTime().then(value => {\n            currentTime = value;\n            utils.dispatchEvent.call(player, player.media, 'timeupdate');\n        });\n\n        // Get duration\n        player.embed.getDuration().then(value => {\n            player.media.duration = value;\n            utils.dispatchEvent.call(player, player.media, 'durationchange');\n        });\n\n        // Get captions\n        player.embed.getTextTracks().then(tracks => {\n            player.media.textTracks = tracks;\n            captions.setup.call(player);\n        });\n\n        player.embed.on('cuechange', data => {\n            let cue = null;\n\n            if (data.cues.length) {\n                cue = utils.stripHTML(data.cues[0].text);\n            }\n\n            captions.setText.call(player, cue);\n        });\n\n        player.embed.on('loaded', () => {\n            if (utils.is.element(player.embed.element) && player.supported.ui) {\n                const frame = player.embed.element;\n\n                // Fix keyboard focus issues\n                // https://github.com/sampotts/plyr/issues/317\n                frame.setAttribute('tabindex', -1);\n            }\n        });\n\n        player.embed.on('play', () => {\n            // Only fire play if paused before\n            if (player.media.paused) {\n                utils.dispatchEvent.call(player, player.media, 'play');\n            }\n            player.media.paused = false;\n            utils.dispatchEvent.call(player, player.media, 'playing');\n        });\n\n        player.embed.on('pause', () => {\n            player.media.paused = true;\n            utils.dispatchEvent.call(player, player.media, 'pause');\n        });\n\n        player.embed.on('timeupdate', data => {\n            player.media.seeking = false;\n            currentTime = data.seconds;\n            utils.dispatchEvent.call(player, player.media, 'timeupdate');\n        });\n\n        player.embed.on('progress', data => {\n            player.media.buffered = data.percent;\n            utils.dispatchEvent.call(player, player.media, 'progress');\n\n            // Check all loaded\n            if (parseInt(data.percent, 10) === 1) {\n                utils.dispatchEvent.call(player, player.media, 'canplaythrough');\n            }\n        });\n\n        player.embed.on('seeked', () => {\n            player.media.seeking = false;\n            utils.dispatchEvent.call(player, player.media, 'seeked');\n            utils.dispatchEvent.call(player, player.media, 'play');\n        });\n\n        player.embed.on('ended', () => {\n            player.media.paused = true;\n            utils.dispatchEvent.call(player, player.media, 'ended');\n        });\n\n        player.embed.on('error', detail => {\n            player.media.error = detail;\n            utils.dispatchEvent.call(player, player.media, 'error');\n        });\n\n        // Rebuild UI\n        setTimeout(() => ui.build.call(player), 0);\n    },\n};\n\nexport default vimeo;\n","// ==========================================================================\n// Plyr Media\n// ==========================================================================\n\nimport support from './support';\nimport utils from './utils';\nimport youtube from './plugins/youtube';\nimport vimeo from './plugins/vimeo';\nimport html5 from './html5';\nimport ui from './ui';\n\n// Sniff out the browser\nconst browser = utils.getBrowser();\n\nconst media = {\n    // Setup media\n    setup() {\n        // If there's no media, bail\n        if (!this.media) {\n            this.debug.warn('No media element found!');\n            return;\n        }\n\n        // Add type class\n        utils.toggleClass(this.elements.container, this.config.classNames.type.replace('{0}', this.type), true);\n\n        // Add provider class\n        utils.toggleClass(this.elements.container, this.config.classNames.provider.replace('{0}', this.provider), true);\n\n        // Add video class for embeds\n        // This will require changes if audio embeds are added\n        if (this.isEmbed) {\n            utils.toggleClass(this.elements.container, this.config.classNames.type.replace('{0}', 'video'), true);\n        }\n\n        if (this.supported.ui) {\n            // Check for picture-in-picture support\n            utils.toggleClass(this.elements.container, this.config.classNames.pip.supported, support.pip && this.isHTML5 && this.isVideo);\n\n            // Check for airplay support\n            utils.toggleClass(this.elements.container, this.config.classNames.airplay.supported, support.airplay && this.isHTML5);\n\n            // If there's no autoplay attribute, assume the video is stopped and add state class\n            utils.toggleClass(this.elements.container, this.config.classNames.stopped, this.config.autoplay);\n\n            // Add iOS class\n            utils.toggleClass(this.elements.container, this.config.classNames.isIos, browser.isIos);\n\n            // Add touch class\n            utils.toggleClass(this.elements.container, this.config.classNames.isTouch, this.touch);\n        }\n\n        // Inject the player wrapper\n        if (this.isVideo) {\n            // Create the wrapper div\n            this.elements.wrapper = utils.createElement('div', {\n                class: this.config.classNames.video,\n            });\n\n            // Wrap the video in a container\n            utils.wrap(this.media, this.elements.wrapper);\n        }\n\n        if (this.isEmbed) {\n            switch (this.provider) {\n                case 'youtube':\n                    youtube.setup.call(this);\n                    break;\n\n                case 'vimeo':\n                    vimeo.setup.call(this);\n                    break;\n\n                default:\n                    break;\n            }\n        } else if (this.isHTML5) {\n            ui.setTitle.call(this);\n\n            html5.extend.call(this);\n        }\n    },\n};\n\nexport default media;\n","// ==========================================================================\n// Plyr source update\n// ==========================================================================\n\nimport { providers } from './types';\nimport utils from './utils';\nimport html5 from './html5';\nimport media from './media';\nimport ui from './ui';\nimport support from './support';\n\nconst source = {\n    // Add elements to HTML5 media (source, tracks, etc)\n    insertElements(type, attributes) {\n        if (utils.is.string(attributes)) {\n            utils.insertElement(type, this.media, {\n                src: attributes,\n            });\n        } else if (utils.is.array(attributes)) {\n            attributes.forEach(attribute => {\n                utils.insertElement(type, this.media, attribute);\n            });\n        }\n    },\n\n    // Update source\n    // Sources are not checked for support so be careful\n    change(input) {\n        if (!utils.is.object(input) || !('sources' in input) || !input.sources.length) {\n            this.debug.warn('Invalid source format');\n            return;\n        }\n\n        // Cancel current network requests\n        html5.cancelRequests.call(this);\n\n        // Destroy instance and re-setup\n        this.destroy.call(\n            this,\n            () => {\n                // Reset quality options\n                this.options.quality = [];\n\n                // Remove elements\n                utils.removeElement(this.media);\n                this.media = null;\n\n                // Reset class name\n                if (utils.is.element(this.elements.container)) {\n                    this.elements.container.removeAttribute('class');\n                }\n\n                // Set the type and provider\n                this.type = input.type;\n                this.provider = !utils.is.empty(input.sources[0].provider) ? input.sources[0].provider : providers.html5;\n\n                // Check for support\n                this.supported = support.check(this.type, this.provider, this.config.playsinline);\n\n                // Create new markup\n                switch (`${this.provider}:${this.type}`) {\n                    case 'html5:video':\n                        this.media = utils.createElement('video');\n                        break;\n\n                    case 'html5:audio':\n                        this.media = utils.createElement('audio');\n                        break;\n\n                    case 'youtube:video':\n                    case 'vimeo:video':\n                        this.media = utils.createElement('div', {\n                            src: input.sources[0].src,\n                        });\n                        break;\n\n                    default:\n                        break;\n                }\n\n                // Inject the new element\n                this.elements.container.appendChild(this.media);\n\n                // Autoplay the new source?\n                if (utils.is.boolean(input.autoplay)) {\n                    this.config.autoplay = input.autoplay;\n                }\n\n                // Set attributes for audio and video\n                if (this.isHTML5) {\n                    if (this.config.crossorigin) {\n                        this.media.setAttribute('crossorigin', '');\n                    }\n                    if (this.config.autoplay) {\n                        this.media.setAttribute('autoplay', '');\n                    }\n                    if ('poster' in input) {\n                        this.media.setAttribute('poster', input.poster);\n                    }\n                    if (this.config.loop.active) {\n                        this.media.setAttribute('loop', '');\n                    }\n                    if (this.config.muted) {\n                        this.media.setAttribute('muted', '');\n                    }\n                    if (this.config.playsinline) {\n                        this.media.setAttribute('playsinline', '');\n                    }\n                }\n\n                // Restore class hook\n                ui.addStyleHook.call(this);\n\n                // Set new sources for html5\n                if (this.isHTML5) {\n                    source.insertElements.call(this, 'source', input.sources);\n                }\n\n                // Set video title\n                this.config.title = input.title;\n\n                // Set up from scratch\n                media.setup.call(this);\n\n                // HTML5 stuff\n                if (this.isHTML5) {\n                    // Setup captions\n                    if ('tracks' in input) {\n                        source.insertElements.call(this, 'track', input.tracks);\n                    }\n\n                    // Load HTML5 sources\n                    this.media.load();\n                }\n\n                // If HTML5 or embed but not fully supported, setupInterface and call ready now\n                if (this.isHTML5 || (this.isEmbed && !this.supported.ui)) {\n                    // Setup interface\n                    ui.build.call(this);\n                }\n\n                // Update the fullscreen support\n                this.fullscreen.update();\n            },\n            true,\n        );\n    },\n};\n\nexport default source;\n","// ==========================================================================\n// Plyr\n// plyr.js v3.1.0\n// https://github.com/sampotts/plyr\n// License: The MIT License (MIT)\n// ==========================================================================\n\nimport { providers, types } from './types';\nimport defaults from './defaults';\nimport support from './support';\nimport utils from './utils';\n\nimport Console from './console';\nimport Fullscreen from './fullscreen';\nimport Listeners from './listeners';\nimport Storage from './storage';\nimport Ads from './plugins/ads';\n\nimport captions from './captions';\nimport controls from './controls';\nimport media from './media';\nimport source from './source';\nimport ui from './ui';\n\n// Private properties\n// TODO: Use a WeakMap for private globals\n// const globals = new WeakMap();\n\n// Plyr instance\nclass Plyr {\n    constructor(target, options) {\n        this.timers = {};\n\n        // State\n        this.ready = false;\n        this.loading = false;\n        this.failed = false;\n\n        // Touch device\n        this.touch = support.touch;\n\n        // Set the media element\n        this.media = target;\n\n        // String selector passed\n        if (utils.is.string(this.media)) {\n            this.media = document.querySelectorAll(this.media);\n        }\n\n        // jQuery, NodeList or Array passed, use first element\n        if ((window.jQuery && this.media instanceof jQuery) || utils.is.nodeList(this.media) || utils.is.array(this.media)) {\n            // eslint-disable-next-line\n            this.media = this.media[0];\n        }\n\n        // Set config\n        this.config = utils.extend(\n            {},\n            defaults,\n            options || {},\n            (() => {\n                try {\n                    return JSON.parse(this.media.getAttribute('data-plyr-config'));\n                } catch (e) {\n                    return {};\n                }\n            })(),\n        );\n\n        // Elements cache\n        this.elements = {\n            container: null,\n            buttons: {},\n            display: {},\n            progress: {},\n            inputs: {},\n            settings: {\n                menu: null,\n                panes: {},\n                tabs: {},\n            },\n            captions: null,\n        };\n\n        // Captions\n        this.captions = {\n            active: null,\n            currentTrack: null,\n        };\n\n        // Fullscreen\n        this.fullscreen = {\n            active: false,\n        };\n\n        // Options\n        this.options = {\n            speed: [],\n            quality: [],\n            captions: [],\n        };\n\n        // Debugging\n        // TODO: move to globals\n        this.debug = new Console(this.config.debug);\n\n        // Log config options and support\n        this.debug.log('Config', this.config);\n        this.debug.log('Support', support);\n\n        // We need an element to setup\n        if (utils.is.nullOrUndefined(this.media) || !utils.is.element(this.media)) {\n            this.debug.error('Setup failed: no suitable element passed');\n            return;\n        }\n\n        // Bail if the element is initialized\n        if (this.media.plyr) {\n            this.debug.warn('Target already setup');\n            return;\n        }\n\n        // Bail if not enabled\n        if (!this.config.enabled) {\n            this.debug.error('Setup failed: disabled by config');\n            return;\n        }\n\n        // Bail if disabled or no basic support\n        // You may want to disable certain UAs etc\n        if (!support.check().api) {\n            this.debug.error('Setup failed: no support');\n            return;\n        }\n\n        // Cache original element state for .destroy()\n        // TODO: Investigate a better solution as I suspect this causes reported double load issues?\n        setTimeout(() => {\n            const clone = this.media.cloneNode(true);\n\n            // Prevent the clone autoplaying\n            if (clone.getAttribute('autoplay')) {\n                clone.pause();\n            }\n\n            this.elements.original = clone;\n        }, 0);\n\n        // Set media type based on tag or data attribute\n        // Supported: video, audio, vimeo, youtube\n        const type = this.media.tagName.toLowerCase();\n\n        // Embed properties\n        let iframe = null;\n        let url = null;\n        let params = null;\n\n        // Different setup based on type\n        switch (type) {\n            case 'div':\n                // Find the frame\n                iframe = this.media.querySelector('iframe');\n\n                // <iframe> type\n                if (utils.is.element(iframe)) {\n                    // Detect provider\n                    url = iframe.getAttribute('src');\n                    this.provider = utils.getProviderByUrl(url);\n\n                    // Rework elements\n                    this.elements.container = this.media;\n                    this.media = iframe;\n\n                    // Reset classname\n                    this.elements.container.className = '';\n\n                    // Get attributes from URL and set config\n                    params = utils.getUrlParams(url);\n                    if (!utils.is.empty(params)) {\n                        const truthy = [\n                            '1',\n                            'true',\n                        ];\n\n                        if (truthy.includes(params.autoplay)) {\n                            this.config.autoplay = true;\n                        }\n                        if (truthy.includes(params.loop)) {\n                            this.config.loop.active = true;\n                        }\n\n                        // TODO: replace fullscreen.iosNative with this playsinline config option\n                        // YouTube requires the playsinline in the URL\n                        if (this.isYouTube) {\n                            this.config.playsinline = truthy.includes(params.playsinline);\n                        } else {\n                            this.config.playsinline = true;\n                        }\n                    }\n                } else {\n                    // <div> with attributes\n                    this.provider = this.media.getAttribute(this.config.attributes.embed.provider);\n\n                    // Remove attribute\n                    this.media.removeAttribute(this.config.attributes.embed.provider);\n                }\n\n                // Unsupported or missing provider\n                if (utils.is.empty(this.provider) || !Object.keys(providers).includes(this.provider)) {\n                    this.debug.error('Setup failed: Invalid provider');\n                    return;\n                }\n\n                // Audio will come later for external providers\n                this.type = types.video;\n\n                break;\n\n            case 'video':\n            case 'audio':\n                this.type = type;\n                this.provider = providers.html5;\n\n                // Get config from attributes\n                if (this.media.hasAttribute('crossorigin')) {\n                    this.config.crossorigin = true;\n                }\n                if (this.media.hasAttribute('autoplay')) {\n                    this.config.autoplay = true;\n                }\n                if (this.media.hasAttribute('playsinline')) {\n                    this.config.playsinline = true;\n                }\n                if (this.media.hasAttribute('muted')) {\n                    this.config.muted = true;\n                }\n                if (this.media.hasAttribute('loop')) {\n                    this.config.loop.active = true;\n                }\n\n                break;\n\n            default:\n                this.debug.error('Setup failed: unsupported type');\n                return;\n        }\n\n        // Check for support again but with type\n        this.supported = support.check(this.type, this.provider, this.config.playsinline);\n\n        // If no support for even API, bail\n        if (!this.supported.api) {\n            this.debug.error('Setup failed: no support');\n            return;\n        }\n\n        // Create listeners\n        this.listeners = new Listeners(this);\n\n        // Setup local storage for user settings\n        this.storage = new Storage(this);\n\n        // Store reference\n        this.media.plyr = this;\n\n        // Wrap media\n        if (!utils.is.element(this.elements.container)) {\n            this.elements.container = utils.createElement('div');\n            utils.wrap(this.media, this.elements.container);\n        }\n\n        // Allow focus to be captured\n        this.elements.container.setAttribute('tabindex', 0);\n\n        // Add style hook\n        ui.addStyleHook.call(this);\n\n        // Setup media\n        media.setup.call(this);\n\n        // Listen for events if debugging\n        if (this.config.debug) {\n            utils.on(this.elements.container, this.config.events.join(' '), event => {\n                this.debug.log(`event: ${event.type}`);\n            });\n        }\n\n        // Setup interface\n        // If embed but not fully supported, build interface now to avoid flash of controls\n        if (this.isHTML5 || (this.isEmbed && !this.supported.ui)) {\n            ui.build.call(this);\n        }\n\n        // Container listeners\n        this.listeners.container();\n\n        // Global listeners\n        this.listeners.global();\n\n        // Setup fullscreen\n        this.fullscreen = new Fullscreen(this);\n\n        // Setup ads if provided\n        this.ads = new Ads(this);\n\n        // Autoplay if required\n        if (this.config.autoplay) {\n            this.play();\n        }\n    }\n\n    // ---------------------------------------\n    // API\n    // ---------------------------------------\n\n    /**\n     * Types and provider helpers\n     */\n    get isHTML5() {\n        return Boolean(this.provider === providers.html5);\n    }\n    get isEmbed() {\n        return Boolean(this.isYouTube || this.isVimeo);\n    }\n    get isYouTube() {\n        return Boolean(this.provider === providers.youtube);\n    }\n    get isVimeo() {\n        return Boolean(this.provider === providers.vimeo);\n    }\n    get isVideo() {\n        return Boolean(this.type === types.video);\n    }\n    get isAudio() {\n        return Boolean(this.type === types.audio);\n    }\n\n    /**\n     * Play the media, or play the advertisement (if they are not blocked)\n     */\n    play() {\n        if (!utils.is.function(this.media.play)) {\n            return null;\n        }\n\n        // If ads are enabled, wait for them first\n        /* if (this.ads.enabled && !this.ads.initialized) {\n            return this.ads.managerPromise.then(() => this.ads.play()).catch(() => this.media.play());\n        } */\n\n        // Return the promise (for HTML5)\n        return this.media.play();\n    }\n\n    /**\n     * Pause the media\n     */\n    pause() {\n        if (!this.playing || !utils.is.function(this.media.pause)) {\n            return;\n        }\n\n        this.media.pause();\n    }\n\n    /**\n     * Get paused state\n     */\n    get paused() {\n        return Boolean(this.media.paused);\n    }\n\n    /**\n     * Get playing state\n     */\n    get playing() {\n        return Boolean(this.ready && !this.paused && !this.ended && (this.isHTML5 ? this.media.readyState > 2 : true));\n    }\n\n    /**\n     * Get ended state\n     */\n    get ended() {\n        return Boolean(this.media.ended);\n    }\n\n    /**\n     * Toggle playback based on current status\n     * @param {boolean} input\n     */\n    togglePlay(input) {\n        // Toggle based on current state if nothing passed\n        const toggle = utils.is.boolean(input) ? input : !this.playing;\n\n        if (toggle) {\n            this.play();\n        } else {\n            this.pause();\n        }\n    }\n\n    /**\n     * Stop playback\n     */\n    stop() {\n        if (this.isHTML5) {\n            this.media.load();\n        } else if (utils.is.function(this.media.stop)) {\n            this.media.stop();\n        }\n    }\n\n    /**\n     * Restart playback\n     */\n    restart() {\n        this.currentTime = 0;\n    }\n\n    /**\n     * Rewind\n     * @param {number} seekTime - how far to rewind in seconds. Defaults to the config.seekTime\n     */\n    rewind(seekTime) {\n        this.currentTime = this.currentTime - (utils.is.number(seekTime) ? seekTime : this.config.seekTime);\n    }\n\n    /**\n     * Fast forward\n     * @param {number} seekTime - how far to fast forward in seconds. Defaults to the config.seekTime\n     */\n    forward(seekTime) {\n        this.currentTime = this.currentTime + (utils.is.number(seekTime) ? seekTime : this.config.seekTime);\n    }\n\n    /**\n     * Seek to a time\n     * @param {number} input - where to seek to in seconds. Defaults to 0 (the start)\n     */\n    set currentTime(input) {\n        let targetTime = 0;\n\n        if (utils.is.number(input)) {\n            targetTime = input;\n        }\n\n        // Normalise targetTime\n        if (targetTime < 0) {\n            targetTime = 0;\n        } else if (targetTime > this.duration) {\n            targetTime = this.duration;\n        }\n\n        // Set\n        this.media.currentTime = parseFloat(targetTime.toFixed(4));\n\n        // Logging\n        this.debug.log(`Seeking to ${this.currentTime} seconds`);\n    }\n\n    /**\n     * Get current time\n     */\n    get currentTime() {\n        return Number(this.media.currentTime);\n    }\n\n    /**\n     * Get buffered\n     */\n    get buffered() {\n        const { buffered } = this.media;\n\n        // YouTube / Vimeo return a float between 0-1\n        if (utils.is.number(buffered)) {\n            return buffered;\n        }\n\n        // HTML5\n        // TODO: Handle buffered chunks of the media\n        // (i.e. seek to another section buffers only that section)\n        if (buffered && buffered.length && this.duration > 0) {\n            return buffered.end(0) / this.duration;\n        }\n\n        return 0;\n    }\n\n    /**\n     * Get seeking status\n     */\n    get seeking() {\n        return Boolean(this.media.seeking);\n    }\n\n    /**\n     * Get the duration of the current media\n     */\n    get duration() {\n        // Faux duration set via config\n        const fauxDuration = parseInt(this.config.duration, 10);\n\n        // True duration\n        const realDuration = this.media ? Number(this.media.duration) : 0;\n\n        // If custom duration is funky, use regular duration\n        return !Number.isNaN(fauxDuration) ? fauxDuration : realDuration;\n    }\n\n    /**\n     * Set the player volume\n     * @param {number} value - must be between 0 and 1. Defaults to the value from local storage and config.volume if not set in storage\n     */\n    set volume(value) {\n        let volume = value;\n        const max = 1;\n        const min = 0;\n\n        if (utils.is.string(volume)) {\n            volume = Number(volume);\n        }\n\n        // Load volume from storage if no value specified\n        if (!utils.is.number(volume)) {\n            volume = this.storage.get('volume');\n        }\n\n        // Use config if all else fails\n        if (!utils.is.number(volume)) {\n            ({ volume } = this.config);\n        }\n\n        // Maximum is volumeMax\n        if (volume > max) {\n            volume = max;\n        }\n        // Minimum is volumeMin\n        if (volume < min) {\n            volume = min;\n        }\n\n        // Update config\n        this.config.volume = volume;\n\n        // Set the player volume\n        this.media.volume = volume;\n\n        // If muted, and we're increasing volume manually, reset muted state\n        if (!utils.is.empty(value) && this.muted && volume > 0) {\n            this.muted = false;\n        }\n    }\n\n    /**\n     * Get the current player volume\n     */\n    get volume() {\n        return Number(this.media.volume);\n    }\n\n    /**\n     * Increase volume\n     * @param {boolean} step - How much to decrease by (between 0 and 1)\n     */\n    increaseVolume(step) {\n        const volume = this.media.muted ? 0 : this.volume;\n        this.volume = volume + (utils.is.number(step) ? step : 1);\n    }\n\n    /**\n     * Decrease volume\n     * @param {boolean} step - How much to decrease by (between 0 and 1)\n     */\n    decreaseVolume(step) {\n        const volume = this.media.muted ? 0 : this.volume;\n        this.volume = volume - (utils.is.number(step) ? step : 1);\n    }\n\n    /**\n     * Set muted state\n     * @param {boolean} mute\n     */\n    set muted(mute) {\n        let toggle = mute;\n\n        // Load muted state from storage\n        if (!utils.is.boolean(toggle)) {\n            toggle = this.storage.get('muted');\n        }\n\n        // Use config if all else fails\n        if (!utils.is.boolean(toggle)) {\n            toggle = this.config.muted;\n        }\n\n        // Update config\n        this.config.muted = toggle;\n\n        // Set mute on the player\n        this.media.muted = toggle;\n    }\n\n    /**\n     * Get current muted state\n     */\n    get muted() {\n        return Boolean(this.media.muted);\n    }\n\n    /**\n     * Check if the media has audio\n     */\n    get hasAudio() {\n        // Assume yes for all non HTML5 (as we can't tell...)\n        if (!this.isHTML5) {\n            return true;\n        }\n\n        if (this.isAudio) {\n            return true;\n        }\n\n        // Get audio tracks\n        return (\n            Boolean(this.media.mozHasAudio) ||\n            Boolean(this.media.webkitAudioDecodedByteCount) ||\n            Boolean(this.media.audioTracks && this.media.audioTracks.length)\n        );\n    }\n\n    /**\n     * Set playback speed\n     * @param {number} speed - the speed of playback (0.5-2.0)\n     */\n    set speed(input) {\n        let speed = null;\n\n        if (utils.is.number(input)) {\n            speed = input;\n        }\n\n        if (!utils.is.number(speed)) {\n            speed = this.storage.get('speed');\n        }\n\n        if (!utils.is.number(speed)) {\n            speed = this.config.speed.selected;\n        }\n\n        // Set min/max\n        if (speed < 0.1) {\n            speed = 0.1;\n        }\n        if (speed > 2.0) {\n            speed = 2.0;\n        }\n\n        if (!this.config.speed.options.includes(speed)) {\n            this.debug.warn(`Unsupported speed (${speed})`);\n            return;\n        }\n\n        // Update config\n        this.config.speed.selected = speed;\n\n        // Set media speed\n        this.media.playbackRate = speed;\n    }\n\n    /**\n     * Get current playback speed\n     */\n    get speed() {\n        return Number(this.media.playbackRate);\n    }\n\n    /**\n     * Set playback quality\n     * Currently HTML5 & YouTube only\n     * @param {number} input - Quality level\n     */\n    set quality(input) {\n        let quality = null;\n\n        if (!utils.is.empty(input)) {\n            quality = Number(input);\n        }\n\n        if (!utils.is.number(quality) || quality === 0) {\n            quality = this.storage.get('quality');\n        }\n\n        if (!utils.is.number(quality)) {\n            quality = this.config.quality.selected;\n        }\n\n        if (!utils.is.number(quality)) {\n            quality = this.config.quality.default;\n        }\n\n        if (!this.options.quality.length) {\n            return;\n        }\n\n        if (!this.options.quality.includes(quality)) {\n            const closest = utils.closest(this.options.quality, quality);\n            this.debug.warn(`Unsupported quality option: ${quality}, using ${closest} instead`);\n            quality = closest;\n        }\n\n        // Update config\n        this.config.quality.selected = quality;\n\n        // Set quality\n        this.media.quality = quality;\n    }\n\n    /**\n     * Get current quality level\n     */\n    get quality() {\n        return this.media.quality;\n    }\n\n    /**\n     * Toggle loop\n     * TODO: Finish fancy new logic. Set the indicator on load as user may pass loop as config\n     * @param {boolean} input - Whether to loop or not\n     */\n    set loop(input) {\n        const toggle = utils.is.boolean(input) ? input : this.config.loop.active;\n        this.config.loop.active = toggle;\n        this.media.loop = toggle;\n\n        // Set default to be a true toggle\n        /* const type = ['start', 'end', 'all', 'none', 'toggle'].includes(input) ? input : 'toggle';\n\n        switch (type) {\n            case 'start':\n                if (this.config.loop.end && this.config.loop.end <= this.currentTime) {\n                    this.config.loop.end = null;\n                }\n                this.config.loop.start = this.currentTime;\n                // this.config.loop.indicator.start = this.elements.display.played.value;\n                break;\n\n            case 'end':\n                if (this.config.loop.start >= this.currentTime) {\n                    return this;\n                }\n                this.config.loop.end = this.currentTime;\n                // this.config.loop.indicator.end = this.elements.display.played.value;\n                break;\n\n            case 'all':\n                this.config.loop.start = 0;\n                this.config.loop.end = this.duration - 2;\n                this.config.loop.indicator.start = 0;\n                this.config.loop.indicator.end = 100;\n                break;\n\n            case 'toggle':\n                if (this.config.loop.active) {\n                    this.config.loop.start = 0;\n                    this.config.loop.end = null;\n                } else {\n                    this.config.loop.start = 0;\n                    this.config.loop.end = this.duration - 2;\n                }\n                break;\n\n            default:\n                this.config.loop.start = 0;\n                this.config.loop.end = null;\n                break;\n        } */\n    }\n\n    /**\n     * Get current loop state\n     */\n    get loop() {\n        return Boolean(this.media.loop);\n    }\n\n    /**\n     * Set new media source\n     * @param {object} input - The new source object (see docs)\n     */\n    set source(input) {\n        source.change.call(this, input);\n    }\n\n    /**\n     * Get current source\n     */\n    get source() {\n        return this.media.currentSrc;\n    }\n\n    /**\n     * Set the poster image for a HTML5 video\n     * @param {input} - the URL for the new poster image\n     */\n    set poster(input) {\n        if (!this.isHTML5 || !this.isVideo) {\n            this.debug.warn('Poster can only be set on HTML5 video');\n            return;\n        }\n\n        if (utils.is.string(input)) {\n            this.media.setAttribute('poster', input);\n        }\n    }\n\n    /**\n     * Get the current poster image\n     */\n    get poster() {\n        if (!this.isHTML5 || !this.isVideo) {\n            return null;\n        }\n\n        return this.media.getAttribute('poster');\n    }\n\n    /**\n     * Set the autoplay state\n     * @param {boolean} input - Whether to autoplay or not\n     */\n    set autoplay(input) {\n        const toggle = utils.is.boolean(input) ? input : this.config.autoplay;\n        this.config.autoplay = toggle;\n    }\n\n    /**\n     * Get the current autoplay state\n     */\n    get autoplay() {\n        return Boolean(this.config.autoplay);\n    }\n\n    /**\n     * Toggle captions\n     * @param {boolean} input - Whether to enable captions\n     */\n    toggleCaptions(input) {\n        // If there's no full support, or there's no caption toggle\n        if (!this.supported.ui || !utils.is.element(this.elements.buttons.captions)) {\n            return;\n        }\n\n        // If the method is called without parameter, toggle based on current value\n        const show = utils.is.boolean(input) ? input : !this.elements.container.classList.contains(this.config.classNames.captions.active);\n\n        // Nothing to change...\n        if (this.captions.active === show) {\n            return;\n        }\n\n        // Set global\n        this.captions.active = show;\n\n        // Toggle state\n        utils.toggleState(this.elements.buttons.captions, this.captions.active);\n\n        // Add class hook\n        utils.toggleClass(this.elements.container, this.config.classNames.captions.active, this.captions.active);\n\n        // Trigger an event\n        utils.dispatchEvent.call(this, this.media, this.captions.active ? 'captionsenabled' : 'captionsdisabled');\n    }\n\n    /**\n     * Set the captions language\n     * @param {string} - Two character ISO language code (e.g. EN, FR, PT, etc)\n     */\n    set language(input) {\n        // Nothing specified\n        if (!utils.is.string(input)) {\n            return;\n        }\n\n        // If empty string is passed, assume disable captions\n        if (utils.is.empty(input)) {\n            this.toggleCaptions(false);\n            return;\n        }\n\n        // Normalize\n        const language = input.toLowerCase();\n\n        // Check for support\n        if (!this.options.captions.includes(language)) {\n            this.debug.warn(`Unsupported language option: ${language}`);\n            return;\n        }\n\n        // Ensure captions are enabled\n        this.toggleCaptions(true);\n\n        // Enabled only\n        if (language === 'enabled') {\n            return;\n        }\n\n        // If nothing to change, bail\n        if (this.language === language) {\n            return;\n        }\n\n        // Update config\n        this.captions.language = language;\n\n        // Clear caption\n        captions.setText.call(this, null);\n\n        // Update captions\n        captions.setLanguage.call(this);\n\n        // Trigger an event\n        utils.dispatchEvent.call(this, this.media, 'languagechange');\n    }\n\n    /**\n     * Get the current captions language\n     */\n    get language() {\n        return this.captions.language;\n    }\n\n    /**\n     * Toggle picture-in-picture playback on WebKit/MacOS\n     * TODO: update player with state, support, enabled\n     * TODO: detect outside changes\n     */\n    set pip(input) {\n        const states = {\n            pip: 'picture-in-picture',\n            inline: 'inline',\n        };\n\n        // Bail if no support\n        if (!support.pip) {\n            return;\n        }\n\n        // Toggle based on current state if not passed\n        const toggle = utils.is.boolean(input) ? input : this.pip === states.inline;\n\n        // Toggle based on current state\n        this.media.webkitSetPresentationMode(toggle ? states.pip : states.inline);\n    }\n\n    /**\n     * Get the current picture-in-picture state\n     */\n    get pip() {\n        if (!support.pip) {\n            return null;\n        }\n\n        return this.media.webkitPresentationMode;\n    }\n\n    /**\n     * Trigger the airplay dialog\n     * TODO: update player with state, support, enabled\n     */\n    airplay() {\n        // Show dialog if supported\n        if (support.airplay) {\n            this.media.webkitShowPlaybackTargetPicker();\n        }\n    }\n\n    /**\n     * Toggle the player controls\n     * @param {boolean} toggle - Whether to show the controls\n     */\n    toggleControls(toggle) {\n        // We need controls of course...\n        if (!utils.is.element(this.elements.controls)) {\n            return;\n        }\n\n        // Don't hide if no UI support or it's audio\n        if (!this.supported.ui || this.isAudio) {\n            return;\n        }\n\n        let delay = 0;\n        let show = toggle;\n        let isEnterFullscreen = false;\n\n        // Get toggle state if not set\n        if (!utils.is.boolean(toggle)) {\n            if (utils.is.event(toggle)) {\n                // Is the enter fullscreen event\n                isEnterFullscreen = toggle.type === 'enterfullscreen';\n\n                // Events that show the controls\n                const showEvents = [\n                    'touchstart',\n                    'touchmove',\n                    'mouseenter',\n                    'mousemove',\n                    'focusin',\n                ];\n\n                // Events that delay hiding\n                const delayEvents = [\n                    'touchmove',\n                    'touchend',\n                    'mousemove',\n                ];\n\n                // Whether to show controls\n                show = showEvents.includes(toggle.type);\n\n                // Delay hiding on move events\n                if (delayEvents.includes(toggle.type)) {\n                    delay = 2000;\n                }\n\n                // Delay a little more for keyboard users\n                if (!this.touch && toggle.type === 'focusin') {\n                    delay = 3000;\n                    utils.toggleClass(this.elements.controls, this.config.classNames.noTransition, true);\n                }\n            } else {\n                show = utils.hasClass(this.elements.container, this.config.classNames.hideControls);\n            }\n        }\n\n        // Clear timer on every call\n        clearTimeout(this.timers.controls);\n\n        // If the mouse is not over the controls, set a timeout to hide them\n        if (show || this.paused || this.loading) {\n            // Check if controls toggled\n            const toggled = utils.toggleClass(this.elements.container, this.config.classNames.hideControls, false);\n\n            // Trigger event\n            if (toggled) {\n                utils.dispatchEvent.call(this, this.media, 'controlsshown');\n            }\n\n            // Always show controls when paused or if touch\n            if (this.paused || this.loading) {\n                return;\n            }\n\n            // Delay for hiding on touch\n            if (this.touch) {\n                delay = 3000;\n            }\n        }\n\n        // If toggle is false or if we're playing (regardless of toggle),\n        // then set the timer to hide the controls\n        if (!show || this.playing) {\n            this.timers.controls = setTimeout(() => {\n                // We need controls of course...\n                if (!utils.is.element(this.elements.controls)) {\n                    return;\n                }\n\n                // If the mouse is over the controls (and not entering fullscreen), bail\n                if ((this.elements.controls.pressed || this.elements.controls.hover) && !isEnterFullscreen) {\n                    return;\n                }\n\n                // Restore transition behaviour\n                if (!utils.hasClass(this.elements.container, this.config.classNames.hideControls)) {\n                    utils.toggleClass(this.elements.controls, this.config.classNames.noTransition, false);\n                }\n\n                // Check if controls toggled\n                const toggled = utils.toggleClass(this.elements.container, this.config.classNames.hideControls, true);\n\n                // Trigger event and close menu\n                if (toggled) {\n                    utils.dispatchEvent.call(this, this.media, 'controlshidden');\n\n                    if (this.config.controls.includes('settings') && !utils.is.empty(this.config.settings)) {\n                        controls.toggleMenu.call(this, false);\n                    }\n                }\n            }, delay);\n        }\n    }\n\n    /**\n     * Add event listeners\n     * @param {string} event - Event type\n     * @param {function} callback - Callback for when event occurs\n     */\n    on(event, callback) {\n        utils.on(this.elements.container, event, callback);\n    }\n\n    /**\n     * Remove event listeners\n     * @param {string} event - Event type\n     * @param {function} callback - Callback for when event occurs\n     */\n    off(event, callback) {\n        utils.off(this.elements.container, event, callback);\n    }\n\n    /**\n     * Destroy an instance\n     * Event listeners are removed when elements are removed\n     * http://stackoverflow.com/questions/12528049/if-a-dom-element-is-removed-are-its-listeners-also-removed-from-memory\n     * @param {function} callback - Callback for when destroy is complete\n     * @param {boolean} soft - Whether it's a soft destroy (for source changes etc)\n     */\n    destroy(callback, soft = false) {\n        if (!this.ready) {\n            return;\n        }\n\n        const done = () => {\n            // Reset overflow (incase destroyed while in fullscreen)\n            document.body.style.overflow = '';\n\n            // GC for embed\n            this.embed = null;\n\n            // If it's a soft destroy, make minimal changes\n            if (soft) {\n                if (Object.keys(this.elements).length) {\n                    // Remove elements\n                    utils.removeElement(this.elements.buttons.play);\n                    utils.removeElement(this.elements.captions);\n                    utils.removeElement(this.elements.controls);\n                    utils.removeElement(this.elements.wrapper);\n\n                    // Clear for GC\n                    this.elements.buttons.play = null;\n                    this.elements.captions = null;\n                    this.elements.controls = null;\n                    this.elements.wrapper = null;\n                }\n\n                // Callback\n                if (utils.is.function(callback)) {\n                    callback();\n                }\n            } else {\n                // Unbind listeners\n                this.listeners.clear();\n\n                // Replace the container with the original element provided\n                utils.replaceElement(this.elements.original, this.elements.container);\n\n                // Event\n                utils.dispatchEvent.call(this, this.elements.original, 'destroyed', true);\n\n                // Callback\n                if (utils.is.function(callback)) {\n                    callback.call(this.elements.original);\n                }\n\n                // Reset state\n                this.ready = false;\n\n                // Clear for garbage collection\n                setTimeout(() => {\n                    this.elements = null;\n                    this.media = null;\n                }, 200);\n            }\n        };\n\n        // Stop playback\n        this.stop();\n\n        // Type specific stuff\n        switch (`${this.provider}:${this.type}`) {\n            case 'html5:video':\n            case 'html5:audio':\n                // Clear timeout\n                clearTimeout(this.timers.loading);\n\n                // Restore native video controls\n                ui.toggleNativeControls.call(this, true);\n\n                // Clean up\n                done();\n\n                break;\n\n            case 'youtube:video':\n                // Clear timers\n                clearInterval(this.timers.buffering);\n                clearInterval(this.timers.playing);\n\n                // Destroy YouTube API\n                if (this.embed !== null && utils.is.function(this.embed.destroy)) {\n                    this.embed.destroy();\n                }\n\n                // Clean up\n                done();\n\n                break;\n\n            case 'vimeo:video':\n                // Destroy Vimeo API\n                // then clean up (wait, to prevent postmessage errors)\n                if (this.embed !== null) {\n                    this.embed.unload().then(done);\n                }\n\n                // Vimeo does not always return\n                setTimeout(done, 200);\n\n                break;\n\n            default:\n                break;\n        }\n    }\n\n    /**\n     * Check for support for a mime type (HTML5 only)\n     * @param {string} type - Mime type\n     */\n    supports(type) {\n        return support.mime.call(this, type);\n    }\n\n    /**\n     * Check for support\n     * @param {string} type - Player type (audio/video)\n     * @param {string} provider - Provider (html5/youtube/vimeo)\n     * @param {bool} inline - Where player has `playsinline` sttribute\n     */\n    static supported(type, provider, inline) {\n        return support.check(type, provider, inline);\n    }\n\n    /**\n     * Load an SVG sprite into the page\n     * @param {string} url - URL for the SVG sprite\n     * @param {string} [id] - Unique ID\n     */\n    static loadSprite(url, id) {\n        return utils.loadSprite(url, id);\n    }\n}\n\nexport default Plyr;\n"]}