diff --git a/js/main.js b/js/main.js index 889ecac..a4a1a1c 100644 --- a/js/main.js +++ b/js/main.js @@ -1,4 +1,4 @@ -!function(e){function n(n){for(var i,o,l=n[0],r=n[1],a=0,s=[];a * @@ -19,5 +19,5 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -i.nc=btoa(OC.requestToken),i.p=OC.filePath("files_videoplayer","","js/");var t=null,o={UI:{show:function(){var e=document.createElement("source");e.src=escapeHTML(o.location).replace("&","&"),o.mime&&(e.type=escapeHTML(o.mime));var n=document.createElement("video");if(n.id="my_video_1",n.classList.add("video-js"),n.classList.add("vjs-fill"),n.classList.add("vjs-big-play-centered"),n.controls=!0,n.preload="auto",n.width="100%",n.height="100%",n.poster=OC.filePath("files_videoplayer","","img")+"/poster.png",n.setAttribute("data-setup",'{"techOrder": ["html5"]}'),n.appendChild(e),null===o.inline){var i=document.createElement("div");i.id="videoplayer_overlay";var l=document.createElement("div");l.id="videoplayer_outer_container";var r=document.createElement("div");r.id="videoplayer_container";var a=document.createElement("div");a.id="videoplayer",r.appendChild(a),l.appendChild(r),i.appendChild(l),a.appendChild(n),document.body.appendChild(i),i.addEventListener("click",function(e){e.target===this&&o.hidePlayer()}),setTimeout(function(){i.className="show"},0)}else{var d=document.createElement("div");d.id="videoplayer_view",d.appendChild(n),o.inline.appendChild(d)}t("my_video_1",{fill:!0}).ready(function(){if(o.player=this,null===o.inline){var e=document.createElement("a");e.className="icon-view-close",e.id="box-close",e.href="#",e.addEventListener("click",function(){o.hidePlayer()}),document.getElementById("my_video_1").appendChild(e)}null===document.getElementById("body-public")&&o.player.play()})},hide:function(){var e=document.getElementById("videoplayer_overlay");e.className="",setTimeout(function(){e.parentElement.removeChild(e)},500)}},mime:null,file:null,location:null,player:null,inline:null,mimeTypes:["video/mp4","video/x-m4v","video/webm","video/x-flv","video/ogg","video/quicktime","video/x-matroska"],mimeTypeAliasses:{"video/x-matroska":"video/webm"},onView:function(e,n){o.file=e,o.dir=n.dir,o.location=n.fileList.getDownloadUrl(e,o.dir),o.mime=n.$file.attr("data-mime"),o.mimeTypeAliasses.hasOwnProperty(o.mime)&&(o.mime=o.mimeTypeAliasses[o.mime]),o.showPlayer()},onViewInline:function(e,n,i){o.location=n,o.mime=i,o.mimeTypeAliasses.hasOwnProperty(o.mime)&&(o.mime=o.mimeTypeAliasses[o.mime]),o.inline=e,o.showPlayer()},showPlayer:function(){Promise.all([i.e(1),i.e(2)]).then(i.bind(null,3)).then(function(e){t=e.default,Promise.all([Promise.all([i.e(1),i.e(2)]).then(i.t.bind(null,1,7)),Promise.all([i.e(1),i.e(2)]).then(i.t.bind(null,2,7))]).then(function(){o.UI.show()})})},hidePlayer:function(){null!==o.player&&!1!==o.player&&null===o.inline&&(o.player.dispose(),o.player=!1,o.UI.hide())},log:function(e){console.log(e)}};document.addEventListener("DOMContentLoaded",function(){if(document.addEventListener("keyup",function(e){(void 0!==e.key&&"Escape"===e.key||void 0!==e.keyCode&&27===e.keyCode)&&o.hidePlayer()}),"undefined"!=typeof FileActions&&!OCA.Viewer)for(var e=0;e\n *\n * @author 2018 Christoph Wurst \n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n__webpack_nonce__ = btoa(OC.requestToken)\n__webpack_public_path__ = OC.filePath('files_videoplayer', '', 'js/')\n\nvar videojs = null;\n\nvar videoViewer = {\n\tUI: {\n\t\tshow: function () {\n\n\t\t\tvar source = document.createElement('source');\n\t\t\tsource.src = escapeHTML(videoViewer.location).replace('&', '&');\n\n\t\t\tif (videoViewer.mime) {\n\t\t\t\tsource.type = escapeHTML(videoViewer.mime);\n\t\t\t}\n\n\t\t\tvar playerView = document.createElement('video');\n\t\t\tplayerView.id = 'my_video_1';\n\t\t\tplayerView.classList.add('video-js');\n\t\t\tplayerView.classList.add('vjs-fill');\n\t\t\tplayerView.classList.add('vjs-big-play-centered');\n\t\t\tplayerView.controls = true;\n\t\t\tplayerView.preload = \"auto\";\n\t\t\tplayerView.width = \"100%\";\n\t\t\tplayerView.height = \"100%\";\n\t\t\tplayerView.poster = OC.filePath('files_videoplayer', '', 'img') + '/poster.png';\n\t\t\tplayerView.setAttribute('data-setup', '{\"techOrder\": [\"html5\"]}');\n\t\t\tplayerView.appendChild(source);\n\n\t\t\tif (videoViewer.inline === null) {\n\t\t\t\tvar overlay = document.createElement('div');\n\t\t\t\toverlay.id = 'videoplayer_overlay';\n\n\t\t\t\tvar outer_container = document.createElement('div');\n\t\t\t\touter_container.id = 'videoplayer_outer_container';\n\n\t\t\t\tvar container = document.createElement('div');\n\t\t\t\tcontainer.id = 'videoplayer_container';\n\n\t\t\t\tvar player = document.createElement('div');\n\t\t\t\tplayer.id = 'videoplayer';\n\n\t\t\t\tcontainer.appendChild(player);\n\t\t\t\touter_container.appendChild(container);\n\t\t\t\toverlay.appendChild(outer_container);\n\n\t\t\t\tplayer.appendChild(playerView);\n\t\t\t\tdocument.body.appendChild(overlay);\n\n\t\t\t\t// close when clicking on the overlay\n\t\t\t\toverlay.addEventListener('click', function(e) {\n\t\t\t\t\tif (e.target === this) {\n\t\t\t\t\t\tvideoViewer.hidePlayer();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(() => { overlay.className = 'show'; }, 0);\n\t\t\t} else {\n\t\t\t\tvar wrapper = document.createElement('div');\n\t\t\t\twrapper.id = 'videoplayer_view';\n\t\t\t\twrapper.appendChild(playerView);\n\t\t\t\tvideoViewer.inline.appendChild(wrapper);\n\t\t\t}\n\t\t\t// initialize player\n\t\t\tvideojs(\"my_video_1\", {\n\t\t\t\tfill: true,\n\t\t\t}).ready(function () {\n\t\t\t\tvideoViewer.player = this;\n\t\t\t\tif (videoViewer.inline === null) {\n\t\t\t\t\t// append close button to video element\n\t\t\t\t\tvar closeButton = document.createElement('a');\n\t\t\t\t\tcloseButton.className = 'icon-view-close';\n\t\t\t\t\tcloseButton.id = 'box-close';\n\t\t\t\t\tcloseButton.href = '#';\n\t\t\t\t\tcloseButton.addEventListener('click', function () {\n\t\t\t\t\t\tvideoViewer.hidePlayer();\n\t\t\t\t\t});\n\t\t\t\t\tdocument.getElementById('my_video_1').appendChild(closeButton);\n\t\t\t\t}\n\t\t\t\t// autoplay\n\t\t\t\tif (document.getElementById('body-public') === null) {\n\t\t\t\t\tvideoViewer.player.play();\n\t\t\t\t}\n\t\t\t});\n\n\t\t},\n\t\thide: function () {\n\t\t\tvar overlay = document.getElementById('videoplayer_overlay');\n\t\t\toverlay.className = '';\n\t\t\tsetTimeout(() => {\n\t\t\t\toverlay.parentElement.removeChild(overlay);\n\t\t\t}, 500);\n\t\t}\n\t},\n\tmime: null,\n\tfile: null,\n\tlocation: null,\n\tplayer: null,\n\tinline: null,\n\tmimeTypes: [\n\t\t'video/mp4',\n\t\t'video/x-m4v',\n\t\t'video/webm',\n\t\t'video/x-flv',\n\t\t'video/ogg',\n\t\t'video/quicktime',\n\t\t'video/x-matroska'\n\t],\n\tmimeTypeAliasses: {\n\t\t'video/x-matroska': 'video/webm' // mkv support for Chrome. webm uses the same container format\n\t},\n\tonView: function (file, data) {\n\t\tvideoViewer.file = file;\n\t\tvideoViewer.dir = data.dir;\n\t\tvideoViewer.location = data.fileList.getDownloadUrl(file, videoViewer.dir);\n\t\tvideoViewer.mime = data.$file.attr('data-mime');\n\t\tif (videoViewer.mimeTypeAliasses.hasOwnProperty(videoViewer.mime)) {\n\t\t\tvideoViewer.mime = videoViewer.mimeTypeAliasses[videoViewer.mime];\n\t\t}\n\t\tvideoViewer.showPlayer();\n\t},\n\tonViewInline: function (element, file, mime) {\n\t\tvideoViewer.location = file;\n\t\tvideoViewer.mime = mime;\n\t\tif (videoViewer.mimeTypeAliasses.hasOwnProperty(videoViewer.mime)) {\n\t\t\tvideoViewer.mime = videoViewer.mimeTypeAliasses[videoViewer.mime];\n\t\t}\n\t\tvideoViewer.inline = element;\n\t\tvideoViewer.showPlayer();\n\t},\n\tshowPlayer: function () {\n\t\timport(/* webpackChunkName: \"videojs\" */ 'video.js').then((_videojs) => {\n\t\t\tvideojs = _videojs.default;\n\t\t\tPromise.all([\n\t\t\t\timport(/* webpackChunkName: \"videojs\" */ '../css/style.css'),\n\t\t\t\timport(/* webpackChunkName: \"videojs\" */'!style-loader!css-loader!video.js/dist/video-js.css')\n\t\t\t]).then(() => {\n\t\t\t\tvideoViewer.UI.show();\n\t\t\t});\n\t\t});\n\t},\n\thidePlayer: function () {\n\t\tif (videoViewer.player !== null && videoViewer.player !== false && videoViewer.inline === null) {\n\t\t\tvideoViewer.player.dispose();\n\t\t\tvideoViewer.player = false;\n\t\t\tvideoViewer.UI.hide();\n\t\t}\n\t},\n\tlog: function (message) {\n\t\tconsole.log(message);\n\t}\n};\n\ndocument.addEventListener('DOMContentLoaded', function () {\n\n\t// add event to ESC key\n\tdocument.addEventListener('keyup', function(e) {\n\t\tif ((e.key !== undefined && e.key === 'Escape') ||\n\t\t\t(e.keyCode !== undefined && e.keyCode === 27)) {\n\t\t\tvideoViewer.hidePlayer();\n\t\t}\n\t});\n\n\tif (typeof FileActions !== 'undefined' && !OCA.Viewer) {\n\t\tfor (var i = 0; i < videoViewer.mimeTypes.length; ++i) {\n\t\t\tvar mime = videoViewer.mimeTypes[i];\n\t\t\tOCA.Files.fileActions.register(mime, 'View', OC.PERMISSION_READ, '', videoViewer.onView);\n\t\t\tOCA.Files.fileActions.setDefault(mime, 'View');\n\t\t\tif (mime === mimetype) {\n\t\t\t\tisSupportedMimetype = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Public page magic\n\tif (document.getElementById('body-public') && document.getElementById('imgframe')) {\n\t\tvar mimetype = document.getElementById('mimetype').value;\n\t\tfor (var i = 0; i < videoViewer.mimeTypes.length; ++i) {\n\t\t\tif (videoViewer.mimeTypes[i] === mimetype) {\n\t\t\t\tvar videoUrl = window.location + '/download';\n\t\t\t\tvideoViewer.onViewInline(document.getElementById('imgframe'), videoUrl, mimetype);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/viewer.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","parentJsonpFunction","shift","installedModules","1","__webpack_require__","exports","module","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","p","0","2","3","4","jsonpScriptSrc","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","error","Error","request","undefined","setTimeout","head","appendChild","all","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","window","oldJsonpFunction","slice","s","__webpack_nonce__","btoa","OC","requestToken","__webpack_public_path__","filePath","videojs","videoViewer","UI","show","source","escapeHTML","location","replace","mime","playerView","id","classList","add","controls","preload","width","height","poster","inline","overlay","outer_container","container","player","body","addEventListener","this","hidePlayer","className","wrapper","fill","ready","closeButton","href","getElementById","play","hotkeys","volumeStep","seekStep","enableModifiersForNumbers","hide","parentElement","removeChild","file","mimeTypes","mimeTypeAliasses","video/x-matroska","onView","dir","fileList","getDownloadUrl","$file","attr","showPlayer","onViewInline","element","then","_videojs","default","dispose","log","message","keyCode","FileActions","OCA","Viewer","Files","fileActions","register","PERMISSION_READ","setDefault","mimetype","isSupportedMimetype","videoUrl"],"mappings":"aACA,SAAAA,EAAAC,GAQA,IAPA,IAMAC,EAAAC,EANAC,EAAAH,EAAA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WACgB,OAAvBzB,EAAYqB,SAA0C,IAAvBrB,EAAYqB,QAA2C,OAAvBrB,EAAYiB,SAC9EjB,EAAYqB,OAAOoC,UACnBzD,EAAYqB,QAAS,EACrBrB,EAAYC,GAAGqC,SAGjBoB,IAAK,SAAUC,GACdxE,QAAQuE,IAAIC,KAId/H,SAAS2F,iBAAiB,mBAAoB,WAU7C,GAPA3F,SAAS2F,iBAAiB,QAAS,SAASpG,SAC3BkC,IAAXlC,EAAEyD,KAAgC,WAAVzD,EAAEyD,UACfvB,IAAdlC,EAAEyI,SAAuC,KAAdzI,EAAEyI,UAC9B5D,EAAYyB,eAIa,oBAAhBoC,cAAgCC,IAAIC,OAC9C,IAAK,IAAI9J,EAAI,EAAGA,EAAI+F,EAAY0C,UAAUvI,SAAUF,EAAG,CACtD,IAAIsG,EAAOP,EAAY0C,UAAUzI,GACjC6J,IAAIE,MAAMC,YAAYC,SAAS3D,EAAM,OAAQZ,GAAGwE,gBAAiB,GAAInE,EAAY6C,QACjFiB,IAAIE,MAAMC,YAAYG,WAAW7D,EAAM,QACnCA,IAAS8D,IACZC,qBAAsB,GAMzB,GAAI1I,SAASoG,eAAe,gBAAkBpG,SAASoG,eAAe,YACrE,KAAIqC,EAAWzI,SAASoG,eAAe,YAAY1D,MACnD,IAASrE,EAAI,EAAGA,EAAI+F,EAAY0C,UAAUvI,SAAUF,EACnD,GAAI+F,EAAY0C,UAAUzI,KAAOoK,EAAU,CAC1C,IAAIE,EAAWlF,OAAOgB,SAAW,YACjCL,EAAYoD,aAAaxH,SAASoG,eAAe,YAAauC,EAAUF,GACxE","file":"main.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"\" + ({\"0\":\"vendors~videojs~videojs-hotkeys\",\"2\":\"vendors~videojs\",\"3\":\"videojs\",\"4\":\"videojs-hotkeys\"}[chunkId]||chunkId) + \".js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\tvar error = new Error('Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')');\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/js/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/*\n * @copyright 2018 Christoph Wurst \n *\n * @author 2018 Christoph Wurst \n *\n * @license GNU AGPL version 3 or any later version\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n__webpack_nonce__ = btoa(OC.requestToken)\n__webpack_public_path__ = OC.filePath('files_videoplayer', '', 'js/')\n\nvar videojs = null;\n\nvar videoViewer = {\n\tUI: {\n\t\tshow: function () {\n\n\t\t\tvar source = document.createElement('source');\n\t\t\tsource.src = escapeHTML(videoViewer.location).replace('&', '&');\n\n\t\t\tif (videoViewer.mime) {\n\t\t\t\tsource.type = escapeHTML(videoViewer.mime);\n\t\t\t}\n\n\t\t\tvar playerView = document.createElement('video');\n\t\t\tplayerView.id = 'my_video_1';\n\t\t\tplayerView.classList.add('video-js');\n\t\t\tplayerView.classList.add('vjs-fill');\n\t\t\tplayerView.classList.add('vjs-big-play-centered');\n\t\t\tplayerView.controls = true;\n\t\t\tplayerView.preload = \"auto\";\n\t\t\tplayerView.width = \"100%\";\n\t\t\tplayerView.height = \"100%\";\n\t\t\tplayerView.poster = OC.filePath('files_videoplayer', '', 'img') + '/poster.png';\n\t\t\tplayerView.setAttribute('data-setup', '{\"techOrder\": [\"html5\"]}');\n\t\t\tplayerView.appendChild(source);\n\n\t\t\tif (videoViewer.inline === null) {\n\t\t\t\tvar overlay = document.createElement('div');\n\t\t\t\toverlay.id = 'videoplayer_overlay';\n\n\t\t\t\tvar outer_container = document.createElement('div');\n\t\t\t\touter_container.id = 'videoplayer_outer_container';\n\n\t\t\t\tvar container = document.createElement('div');\n\t\t\t\tcontainer.id = 'videoplayer_container';\n\n\t\t\t\tvar player = document.createElement('div');\n\t\t\t\tplayer.id = 'videoplayer';\n\n\t\t\t\tcontainer.appendChild(player);\n\t\t\t\touter_container.appendChild(container);\n\t\t\t\toverlay.appendChild(outer_container);\n\n\t\t\t\tplayer.appendChild(playerView);\n\t\t\t\tdocument.body.appendChild(overlay);\n\n\t\t\t\t// close when clicking on the overlay\n\t\t\t\toverlay.addEventListener('click', function(e) {\n\t\t\t\t\tif (e.target === this) {\n\t\t\t\t\t\tvideoViewer.hidePlayer();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tsetTimeout(() => { overlay.className = 'show'; }, 0);\n\t\t\t} else {\n\t\t\t\tvar wrapper = document.createElement('div');\n\t\t\t\twrapper.id = 'videoplayer_view';\n\t\t\t\twrapper.appendChild(playerView);\n\t\t\t\tvideoViewer.inline.appendChild(wrapper);\n\t\t\t}\n\t\t\t// initialize player\n\t\t\tvideojs(\"my_video_1\", {\n\t\t\t\tfill: true,\n\t\t\t}).ready(function () {\n\t\t\t\tvideoViewer.player = this;\n\t\t\t\tif (videoViewer.inline === null) {\n\t\t\t\t\t// append close button to video element\n\t\t\t\t\tvar closeButton = document.createElement('a');\n\t\t\t\t\tcloseButton.className = 'icon-view-close';\n\t\t\t\t\tcloseButton.id = 'box-close';\n\t\t\t\t\tcloseButton.href = '#';\n\t\t\t\t\tcloseButton.addEventListener('click', function () {\n\t\t\t\t\t\tvideoViewer.hidePlayer();\n\t\t\t\t\t});\n\t\t\t\t\tdocument.getElementById('my_video_1').appendChild(closeButton);\n\t\t\t\t}\n\t\t\t\t// autoplay\n\t\t\t\tif (document.getElementById('body-public') === null) {\n\t\t\t\t\tvideoViewer.player.play();\n\t\t\t\t}\n\t\t\t\tthis.hotkeys({\n\t\t\t\t\tvolumeStep: 0.1,\n\t\t\t\t\tseekStep: 5,\n\t\t\t\t\tenableModifiersForNumbers: false\n\t\t\t\t });\n\t\t\t\t\n\t\t\t});\n\n\t\t},\n\t\thide: function () {\n\t\t\tvar overlay = document.getElementById('videoplayer_overlay');\n\t\t\toverlay.className = '';\n\t\t\tsetTimeout(() => {\n\t\t\t\toverlay.parentElement.removeChild(overlay);\n\t\t\t}, 500);\n\t\t}\n\t},\n\tmime: null,\n\tfile: null,\n\tlocation: null,\n\tplayer: null,\n\tinline: null,\n\tmimeTypes: [\n\t\t'video/mp4',\n\t\t'video/x-m4v',\n\t\t'video/webm',\n\t\t'video/x-flv',\n\t\t'video/ogg',\n\t\t'video/quicktime',\n\t\t'video/x-matroska'\n\t],\n\tmimeTypeAliasses: {\n\t\t'video/x-matroska': 'video/webm' // mkv support for Chrome. webm uses the same container format\n\t},\n\tonView: function (file, data) {\n\t\tvideoViewer.file = file;\n\t\tvideoViewer.dir = data.dir;\n\t\tvideoViewer.location = data.fileList.getDownloadUrl(file, videoViewer.dir);\n\t\tvideoViewer.mime = data.$file.attr('data-mime');\n\t\tif (videoViewer.mimeTypeAliasses.hasOwnProperty(videoViewer.mime)) {\n\t\t\tvideoViewer.mime = videoViewer.mimeTypeAliasses[videoViewer.mime];\n\t\t}\n\t\tvideoViewer.showPlayer();\n\t},\n\tonViewInline: function (element, file, mime) {\n\t\tvideoViewer.location = file;\n\t\tvideoViewer.mime = mime;\n\t\tif (videoViewer.mimeTypeAliasses.hasOwnProperty(videoViewer.mime)) {\n\t\t\tvideoViewer.mime = videoViewer.mimeTypeAliasses[videoViewer.mime];\n\t\t}\n\t\tvideoViewer.inline = element;\n\t\tvideoViewer.showPlayer();\n\t},\n\tshowPlayer: function () {\n\t\timport(/* webpackChunkName: \"videojs-hotkeys\" */ 'videojs-hotkeys')\n\t\timport(/* webpackChunkName: \"videojs\" */ 'video.js').then((_videojs) => {\n\t\t\tvideojs = _videojs.default;\n\t\t\tPromise.all([\n\t\t\t\timport(/* webpackChunkName: \"videojs\" */ '../css/style.css'),\n\t\t\t\timport(/* webpackChunkName: \"videojs\" */'!style-loader!css-loader!video.js/dist/video-js.css')\n\t\t\t]).then(() => {\n\t\t\t\tvideoViewer.UI.show();\n\t\t\t});\n\t\t});\n\t},\n\thidePlayer: function () {\n\t\tif (videoViewer.player !== null && videoViewer.player !== false && videoViewer.inline === null) {\n\t\t\tvideoViewer.player.dispose();\n\t\t\tvideoViewer.player = false;\n\t\t\tvideoViewer.UI.hide();\n\t\t}\n\t},\n\tlog: function (message) {\n\t\tconsole.log(message);\n\t}\n};\n\ndocument.addEventListener('DOMContentLoaded', function () {\n\n\t// add event to ESC key\n\tdocument.addEventListener('keyup', function(e) {\n\t\tif ((e.key !== undefined && e.key === 'Escape') ||\n\t\t\t(e.keyCode !== undefined && e.keyCode === 27)) {\n\t\t\tvideoViewer.hidePlayer();\n\t\t}\n\t});\n\n\tif (typeof FileActions !== 'undefined' && !OCA.Viewer) {\n\t\tfor (var i = 0; i < videoViewer.mimeTypes.length; ++i) {\n\t\t\tvar mime = videoViewer.mimeTypes[i];\n\t\t\tOCA.Files.fileActions.register(mime, 'View', OC.PERMISSION_READ, '', videoViewer.onView);\n\t\t\tOCA.Files.fileActions.setDefault(mime, 'View');\n\t\t\tif (mime === mimetype) {\n\t\t\t\tisSupportedMimetype = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Public page magic\n\tif (document.getElementById('body-public') && document.getElementById('imgframe')) {\n\t\tvar mimetype = document.getElementById('mimetype').value;\n\t\tfor (var i = 0; i < videoViewer.mimeTypes.length; ++i) {\n\t\t\tif (videoViewer.mimeTypes[i] === mimetype) {\n\t\t\t\tvar videoUrl = window.location + '/download';\n\t\t\t\tvideoViewer.onViewInline(document.getElementById('imgframe'), videoUrl, mimetype);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/vendors~videojs.js b/js/vendors~videojs.js index 3b700da..18d6191 100644 --- a/js/vendors~videojs.js +++ b/js/vendors~videojs.js @@ -1,9 +1,2 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[,,function(e,t,n){var i=n(53);"string"==typeof i&&(i=[[e.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(16)(i,r);i.locals&&(e.exports=i.locals)},function(e,t,n){"use strict";n.r(t);var i=n(17),r=n.n(i),a=n(18),s=n.n(a),o=n(22),l=n.n(o),u=n(23),c=n.n(u),d=n(30),h=n.n(d),p=n(6),f=n.n(p),m=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},g=Object.assign||function(e){for(var t=1;t-1},e.prototype.trigger=function(e){var t=this.listeners[e],n=void 0,i=void 0,r=void 0;if(t)if(2===arguments.length)for(i=t.length,n=0;n-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(b),T=function(e){for(var t=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},i=t.length,r=void 0;i--;)""!==t[i]&&((r=/([^=]*)=(.*)/.exec(t[i]).slice(1))[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),n[r[0]]=r[1]);return n},S=function(e){function t(){m(this,t);var n=y(this,e.call(this));return n.customParsers=[],n}return v(t,e),t.prototype.push=function(e){var t=void 0,n=void 0;if(0!==(e=e.replace(/^[\u0000\s]+|[\u0000\s]+$/g,"")).length)if("#"===e[0]){for(var i=0;i0&&(a.duration=e.duration),0===e.duration&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=r},key:function(){e.attributes?"NONE"!==e.attributes.METHOD?e.attributes.URI?(e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),o={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(o.iv=e.attributes.IV)):this.trigger("warn",{message:"ignoring key declaration without URI"}):o=null:this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,u=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){s={},e.uri&&(s.uri=e.uri),e.byterange&&(s.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=r,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(a.attributes||(a.attributes={}),g(a.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],(n={default:/yes/i.test(e.attributes.DEFAULT)}).default?n.autoselect=!0:n.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(n.language=e.attributes.LANGUAGE),e.attributes.URI&&(n.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(n.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(n.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(n.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=n}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){u+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(r.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),a.dateTimeString=e.dateTimeString,a.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):this.manifest.targetDuration=e.duration},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){a.cueOut=e.data},"cue-out-cont":function(){a.cueOutCont=e.data},"cue-in":function(){a.cueIn=e.data}}[e.tagType]||function(){}).call(i)},uri:function(){a.uri=e.uri,r.push(a),!this.manifest.targetDuration||"duration"in a||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),o&&(a.key=o),a.timeline=u,s&&(a.map=s),a={}},comment:function(){},custom:function(){e.segment?(a.custom=a.custom||{},a.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(i)}),n}return v(t,e),t.prototype.push=function(e){this.lineStream.push(e)},t.prototype.end=function(){this.lineStream.push("\n")},t.prototype.addParser=function(e){this.parseStream.addParser(e)},t}(b),w=n(31),C=n.n(w),j=n(33),E=n(7),A=n.n(E),x=n(35),L=n(49),O=n.n(L);var U=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},P=function(){function e(e,t){for(var n=0;n>7))^a]=a;for(s=o=0;!i[s];s^=c||1,o=u[o]||1)for(h=(h=o^o<<1^o<<2^o<<3^o<<4)>>8^255&h^99,i[s]=h,r[h]=s,f=16843009*l[d=l[c=l[s]]]^65537*d^257*c^16843008*s,p=257*l[h]^16843008*h,a=0;a<4;a++)t[a][s]=p=p<<24^p>>>8,n[a][h]=f=f<<24^f>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),n[a]=n[a].slice(0);return e},R=null,M=function(){function e(t){U(this,e),R||(R=D()),this._tables=[[R[0][0].slice(),R[0][1].slice(),R[0][2].slice(),R[0][3].slice(),R[0][4].slice()],[R[1][0].slice(),R[1][1].slice(),R[1][2].slice(),R[1][3].slice(),R[1][4].slice()]];var n=void 0,i=void 0,r=void 0,a=void 0,s=void 0,o=this._tables[0][4],l=this._tables[1],u=t.length,c=1;if(4!==u&&6!==u&&8!==u)throw new Error("Invalid aes key size");for(a=t.slice(0),s=[],this._key=[a,s],n=u;n<4*u+28;n++)r=a[n-1],(n%u==0||8===u&&n%u==4)&&(r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[255&r],n%u==0&&(r=r<<8^r>>>24^c<<24,c=c<<1^283*(c>>7))),a[n]=a[n-u]^r;for(i=0;n;i++,n--)r=a[3&i?n:n-4],s[i]=n<=4||i<4?r:l[0][o[r>>>24]]^l[1][o[r>>16&255]]^l[2][o[r>>8&255]]^l[3][o[255&r]]}return e.prototype.decrypt=function(e,t,n,i,r,a){var s=this._key[1],o=e^s[0],l=i^s[1],u=n^s[2],c=t^s[3],d=void 0,h=void 0,p=void 0,f=s.length/4-2,m=void 0,g=4,v=this._tables[1],y=v[0],b=v[1],_=v[2],T=v[3],S=v[4];for(m=0;m>>24]^b[l>>16&255]^_[u>>8&255]^T[255&c]^s[g],h=y[l>>>24]^b[u>>16&255]^_[c>>8&255]^T[255&o]^s[g+1],p=y[u>>>24]^b[c>>16&255]^_[o>>8&255]^T[255&l]^s[g+2],c=y[c>>>24]^b[o>>16&255]^_[l>>8&255]^T[255&u]^s[g+3],g+=4,o=d,l=h,u=p;for(m=0;m<4;m++)r[(3&-m)+a]=S[o>>>24]<<24^S[l>>16&255]<<16^S[u>>8&255]<<8^S[255&c]^s[g++],d=o,o=l,l=u,u=c,c=d},e}(),B=function(){function e(){U(this,e),this.listeners={}}return e.prototype.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},e.prototype.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e].splice(n,1),n>-1},e.prototype.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,i=0;i>8|e>>>24},V=function(e,t,n){var i=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new M(Array.prototype.slice.call(t)),a=new Uint8Array(e.byteLength),s=new Int32Array(a.buffer),o=void 0,l=void 0,u=void 0,c=void 0,d=void 0,h=void 0,p=void 0,f=void 0,m=void 0;for(o=n[0],l=n[1],u=n[2],c=n[3],m=0;m1?t-1:0),i=1;i0)for(var i=e.attributes,r=i.length-1;r>=0;r--){var a=i[r].name,s=i[r].value;"boolean"!=typeof e[a]&&-1===n.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function Se(e,t){return e.getAttribute(t)}function ke(e,t,n){e.setAttribute(t,n)}function we(e,t){e.removeAttribute(t)}function Ce(){C.a.body.focus(),C.a.onselectstart=function(){return!1}}function je(){C.a.onselectstart=function(){return!0}}function Ee(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(n[e]=t[e])}),n.height||(n.height=parseFloat(ae(e,"height"))),n.width||(n.width=parseFloat(ae(e,"width"))),n}}function Ae(e){var t;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var n=C.a.documentElement,i=C.a.body,r=n.clientLeft||i.clientLeft||0,a=f.a.pageXOffset||i.scrollLeft,s=t.left+a-r,o=n.clientTop||i.clientTop||0,l=f.a.pageYOffset||i.scrollTop,u=t.top+l-o;return{left:Math.round(s),top:Math.round(u)}}function xe(e,t){var n={},i=Ae(e),r=e.offsetWidth,a=e.offsetHeight,s=i.top,o=i.left,l=t.pageY,u=t.pageX;return t.changedTouches&&(u=t.changedTouches[0].pageX,l=t.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(s-l+a)/a)),n.x=Math.max(0,Math.min(1,(u-o)/r)),n}function Le(e){return ie(e)&&3===e.nodeType}function Oe(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Ue(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),ce(e)||Le(e)?e:"string"==typeof e&&/\S/.test(e)?C.a.createTextNode(e):void 0}).filter(function(e){return e})}function Pe(e,t){return Ue(t).forEach(function(t){return e.appendChild(t)}),e}function Ie(e,t){return Pe(Oe(e),t)}function De(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||0===e.button&&1===e.buttons)}var Re=he("querySelector"),Me=he("querySelectorAll"),Be=Object.freeze({isReal:ue,isEl:ce,isInFrame:de,createEl:pe,textContent:fe,prependTo:me,hasClass:ge,addClass:ve,removeClass:ye,toggleClass:be,setAttributes:_e,getAttributes:Te,getAttribute:Se,setAttribute:ke,removeAttribute:we,blockTextSelection:Ce,unblockTextSelection:je,getBoundingClientRect:Ee,findPosition:Ae,getPointerPosition:xe,isTextNode:Le,emptyEl:Oe,normalizeContent:Ue,appendContent:Pe,insertContent:Ie,isSingleLeftClick:De,$:Re,$$:Me}),Ne=1;function Fe(){return Ne++}var Ve={},ze="vdata"+(new Date).getTime();function He(e){var t=e[ze];return t||(t=e[ze]=Fe()),Ve[t]||(Ve[t]={}),Ve[t]}function qe(e){var t=e[ze];return!!t&&!!Object.getOwnPropertyNames(Ve[t]).length}function Ge(e){var t=e[ze];if(t){delete Ve[t];try{delete e[ze]}catch(t){e.removeAttribute?e.removeAttribute(ze):e[ze]=null}}}function We(e,t){var n=He(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&Ge(e)}function Ye(e,t,n,i){n.forEach(function(n){e(t,n,i)})}function Xe(e){function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped){var i=e||f.a.event;for(var r in e={},i)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&i.preventDefault||(e[r]=i[r]));if(e.target||(e.target=e.srcElement||C.a),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){i.preventDefault&&i.preventDefault(),e.returnValue=!1,i.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),e.cancelBubble=!0,i.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){var a=C.a.documentElement,s=C.a.body;e.pageX=e.clientX+(a&&a.scrollLeft||s&&s.scrollLeft||0)-(a&&a.clientLeft||s&&s.clientLeft||0),e.pageY=e.clientY+(a&&a.scrollTop||s&&s.scrollTop||0)-(a&&a.clientTop||s&&s.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}var Je=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){Je=!0}});f.a.addEventListener("test",null,e),f.a.removeEventListener("test",null,e)}catch(e){}}();var Ke=["touchstart","touchmove"];function Qe(e,t,n){if(Array.isArray(t))return Ye(Qe,e,t,n);var i=He(e);if(i.handlers||(i.handlers={}),i.handlers[t]||(i.handlers[t]=[]),n.guid||(n.guid=Fe()),i.handlers[t].push(n),i.dispatcher||(i.disabled=!1,i.dispatcher=function(t,n){if(!i.disabled){t=Xe(t);var r=i.handlers[t.type];if(r)for(var a=r.slice(0),s=0,o=a.length;s-1&&(r={passive:!0}),e.addEventListener(t,i.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,i.dispatcher)}function Ze(e,t,n){if(qe(e)){var i=He(e);if(i.handlers){if(Array.isArray(t))return Ye(Ze,e,t,n);var r=function(e,t){i.handlers[t]=[],We(e,t)};if(void 0!==t){var a=i.handlers[t];if(a)if(n){if(n.guid)for(var s=0;s0)for(var r=0,a=i.length;r=t&&(e.apply(void 0,arguments),n=i)}},dt=function(e,t,n,i){var r;void 0===i&&(i=f.a);var a=function(){var a=this,s=arguments,o=function(){r=null,o=null,n||e.apply(a,s)};!r&&n&&e.apply(a,s),i.clearTimeout(r),r=i.setTimeout(o,t)};return a.cancel=function(){i.clearTimeout(r),r=null},a},ht=function(){};ht.prototype.allowedEvents_={},ht.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},Qe(this,e,t),this.addEventListener=n},ht.prototype.addEventListener=ht.prototype.on,ht.prototype.off=function(e,t){Ze(this,e,t)},ht.prototype.removeEventListener=ht.prototype.off,ht.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},et(this,e,t),this.addEventListener=n},ht.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Xe(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),$e(this,e)},ht.prototype.dispatchEvent=ht.prototype.trigger,ht.prototype.queueTrigger=function(e){var t=this;st||(st=new Map);var n=e.type||e,i=st.get(this);i||(i=new Map,st.set(this,i));var r=i.get(n);i.delete(n),f.a.clearTimeout(r);var a=f.a.setTimeout(function(){0===i.size&&(i=null,st.delete(t)),t.trigger(e)},0);i.set(n,a)};var pt=function(e){return e instanceof ht||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},ft=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},mt=function(e){if(!e.nodeName&&!pt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},gt=function(e){if(!ft(e))throw new Error("Invalid event type; must be a non-empty string or array.")},vt=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},yt=function(e,t){var n,i,r,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(n=e.eventBusEl_,t.length>=3&&t.shift(),i=t[0],r=t[1]):(n=t[0],i=t[1],r=t[2]),mt(n),gt(i),vt(r),{isTargetingSelf:a,target:n,type:i,listener:r=ut(e,r)}},bt=function(e,t,n,i){mt(e),e.nodeName?nt[t](e,n,i):e[t](n,i)},_t={on:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Ge(this.el_),this.el_=null),this.player_=null},t.player=function(){return this.player_},t.options=function(e){return Q.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=Ct(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,n){return pe(e,t,n)},t.localize=function(e,t,n){void 0===n&&(n=e);var i=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[i],s=i&&i.split("-")[0],o=r&&r[s],l=n;return a&&a[e]?l=a[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,function(e,n){var i=t[n-1],r=i;return void 0===i&&(r=e),r})),l},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return e=wt(e),this.childNameIndex_[e]},t.addChild=function(t,n,i){var r,a;if(void 0===n&&(n={}),void 0===i&&(i=this.children_.length),"string"==typeof t){a=wt(t);var s=n.componentClass||a;n.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;r=new o(this.player_||this,n)}else r=t;if(this.children_.splice(i,0,r),"function"==typeof r.id&&(this.childIndex_[r.id()]=r),(a=a||r.name&&wt(r.name()))&&(this.childNameIndex_[a]=r),"function"==typeof r.el&&r.el()){var l=this.contentEl().children[i]||null;this.contentEl().insertBefore(r.el(),l)}return r},t.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,n=this.options_.children;if(n){var i,r=this.options_,a=e.getComponent("Tech");(i=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter(function(e){return!i.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var i,r;return"string"==typeof e?r=n[i=e]||t.options_[i]||{}:(i=e.name,r=e),{name:i,opts:r}}).filter(function(t){var n=e.getComponent(t.opts.componentClass||wt(t.name));return n&&!a.isTech(n)}).forEach(function(e){var n=e.name,i=e.opts;if(void 0!==r[n]&&(i=r[n]),!1!==i){!0===i&&(i={}),i.playerOptions=t.options_.playerOptions;var a=t.addChild(n,i);a&&(t[n]=a)}})}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},t.$=function(e,t){return Re(e,t||this.contentEl())},t.$$=function(e,t){return Me(e,t||this.contentEl())},t.hasClass=function(e){return ge(this.el_,e)},t.addClass=function(e){ve(this.el_,e)},t.removeClass=function(e){ye(this.el_,e)},t.toggleClass=function(e,t){be(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return Se(this.el_,e)},t.setAttribute=function(e,t){ke(this.el_,e,t)},t.removeAttribute=function(e){we(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var i=this.el_.style[e],r=i.indexOf("px");return-1!==r?parseInt(i.slice(0,r),10):parseInt(this.el_["offset"+wt(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"==typeof f.a.getComputedStyle){var n=f.a.getComputedStyle(this.el_);t=n.getPropertyValue(e)||n[e]}if(0===(t=parseFloat(t))){var i="offset"+wt(e);t=this.el_[i]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.emitTapEvents=function(){var e,t=0,n=null;this.on("touchstart",function(i){1===i.touches.length&&(n={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},t=(new Date).getTime(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(n){var i=t.touches[0].pageX-n.pageX,r=t.touches[0].pageY-n.pageY;Math.sqrt(i*i+r*r)>10&&(e=!1)}});var i=function(){e=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",function(i){(n=null,!0===e)&&((new Date).getTime()-t<200&&(i.preventDefault(),this.trigger("tap")))})},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=ut(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});var n=function(n){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",n),this.on("touchcancel",n)}},t.setTimeout=function(e,t){var n,i,r=this;return e=ut(this,e),n=f.a.setTimeout(function(){r.off("dispose",i),e()},t),(i=function(){return r.clearTimeout(n)}).guid="vjs-timeout-"+n,this.on("dispose",i),n},t.clearTimeout=function(e){f.a.clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},t.setInterval=function(e,t){var n=this;e=ut(this,e);var i=f.a.setInterval(e,t),r=function(){return n.clearInterval(i)};return r.guid="vjs-interval-"+i,this.on("dispose",r),i},t.clearInterval=function(e){f.a.clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},t.requestAnimationFrame=function(e){var t,n,i=this;return this.supportsRaf_?(e=ut(this,e),t=f.a.requestAnimationFrame(function(){i.off("dispose",n),e()}),(n=function(){return i.cancelAnimationFrame(t)}).guid="vjs-raf-"+t,this.on("dispose",n),t):this.setTimeout(e,1e3/60)},t.cancelAnimationFrame=function(e){if(this.supportsRaf_){f.a.cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,n){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var i,r=e.getComponent("Tech"),a=r&&r.isTech(n),s=e===n||e.prototype.isPrototypeOf(n.prototype);if(a||!s)throw i=a?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+i+".");t=wt(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var l=o.players,u=Object.keys(l);if(l&&u.length>0&&u.map(function(e){return l[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=n,n},e.getComponent=function(t){if(t)return t=wt(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();jt.prototype.supportsRaf_="function"==typeof f.a.requestAnimationFrame&&"function"==typeof f.a.cancelAnimationFrame,jt.registerComponent("Component",jt);var Et,At=f.a.navigator&&f.a.navigator.userAgent||"",xt=/AppleWebKit\/([\d.]+)/i.exec(At),Lt=xt?parseFloat(xt.pop()):null,Ot=/iPad/i.test(At),Ut=/iPhone/i.test(At)&&!Ot,Pt=/iPod/i.test(At),It=Ut||Ot||Pt,Dt=(Et=At.match(/OS (\d+)_/i))&&Et[1]?Et[1]:null,Rt=/Android/i.test(At),Mt=function(){var e=At.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),Bt=Rt&&Mt<5&&Lt<537,Nt=/Firefox/i.test(At),Ft=/Edge/i.test(At),Vt=!Ft&&(/Chrome/i.test(At)||/CriOS/i.test(At)),zt=function(){var e=At.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Ht=function(){var e=/MSIE\s(\d+)\.\d/.exec(At),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(At)&&/rv:11.0/.test(At)&&(t=11),t}(),qt=/Safari/i.test(At)&&!Vt&&!Rt&&!Ft,Gt=(qt||It)&&!Vt,Wt=ue()&&("ontouchstart"in f.a||f.a.navigator.maxTouchPoints||f.a.DocumentTouch&&f.a.document instanceof f.a.DocumentTouch),Yt=Object.freeze({IS_IPAD:Ot,IS_IPHONE:Ut,IS_IPOD:Pt,IS_IOS:It,IOS_VERSION:Dt,IS_ANDROID:Rt,ANDROID_VERSION:Mt,IS_NATIVE_ANDROID:Bt,IS_FIREFOX:Nt,IS_EDGE:Ft,IS_CHROME:Vt,CHROME_VERSION:zt,IE_VERSION:Ht,IS_SAFARI:qt,IS_ANY_SAFARI:Gt,TOUCH_ENABLED:Wt});function Xt(e,t,n,i){return function(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,i,n.length-1),n[i][t]}function Jt(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Xt.bind(null,"start",0,e),end:Xt.bind(null,"end",1,e)}}function Kt(e,t){return Array.isArray(e)?Jt(e):void 0===e||void 0===t?Jt():Jt([[e,t]])}function Qt(e,t){var n,i,r=0;if(!t)return 0;e&&e.length||(e=Kt(0,0));for(var a=0;at&&(i=t),r+=i-n;return r/t}for(var Zt,$t={},en=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],tn=en[0],nn=0;nn=0;i--)if(t[i].enabled){gn(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,n}return q(t,e),t.prototype.addTrack=function(t){var n=this;t.enabled&&gn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",function(){n.changing_||(n.changing_=!0,gn(n,t),n.changing_=!1,n.trigger("change"))})},t}(fn),yn=function(e,t){for(var n=0;n=0;i--)if(t[i].selected){yn(t,t[i]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(Y(Y(n)),"selectedIndex",{get:function(){for(var e=0;e',n=i.firstChild,i.setAttribute("style","display:none; position:absolute;"),C.a.body.appendChild(i));for(var a={},s=0;sx',e=t.firstChild.href}return e},Ln=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""},On=function(e){var t=f.a.location,n=An(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host},Un=Object.freeze({parseUrl:An,getAbsoluteURL:xn,getFileExtension:Ln,isCrossOrigin:On}),Pn=function(e,t){var n=new f.a.WebVTT.Parser(f.a,f.a.vttjs,f.a.WebVTT.StringDecoder()),i=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){i.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),i.length>0&&(f.a.console&&f.a.console.groupCollapsed&&f.a.console.groupCollapsed("Text Track parsing errors for "+t.src),i.forEach(function(e){return Q.error(e)}),f.a.console&&f.a.console.groupEnd&&f.a.console.groupEnd()),n.flush()},In=function(e,t){var n={uri:e},i=On(e);i&&(n.cors=i),c()(n,ut(this,function(e,n,i){if(e)return Q.error(e,n);if(t.loaded_=!0,"function"!=typeof f.a.WebVTT){if(t.tech_){var r=function(){return Pn(i,t)};t.tech_.on("vttjsloaded",r),t.tech_.on("vttjserror",function(){Q.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",r)})}}else Pn(i,t)}))},Dn=function(e){function t(t){var n;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var i=Ct(t,{kind:Cn[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=jn[i.mode]||"disabled",a=i.default;"metadata"!==i.kind&&"chapters"!==i.kind||(r="hidden"),(n=e.call(this,i)||this).tech_=i.tech,n.cues_=[],n.activeCues_=[];var s=new Sn(n.cues_),o=new Sn(n.activeCues_),l=!1,u=ut(Y(Y(n)),function(){this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1)});return"disabled"!==r&&n.tech_.ready(function(){n.tech_.on("timeupdate",u)},!0),Object.defineProperties(Y(Y(n)),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){var t=this;jn[e]&&("disabled"!==(r=e)?this.tech_.ready(function(){t.tech_.on("timeupdate",u)},!0):this.tech_.off("timeupdate",u),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],n=0,i=this.cues.length;n=e?t.push(r):r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e&&t.push(r)}if(l=!1,t.length!==this.activeCues_.length)l=!0;else for(var a=0;a0)return void this.trigger("vttjsloaded");var t=C.a.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){t.onload=null,t.onerror=null}),f.a.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},n.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),i=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};n.on("addtrack",i),n.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e=0;r--){var a=e[r];a[t]&&a[t](i,n)}}(e,n,o,s),o}var Kn={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Qn={setCurrentTime:1},Zn={play:1,pause:1};function $n(e){return function(t,n){return t===Yn?Yn:n[e]?n[e](t):t}}var ei={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},ti=function(e){void 0===e&&(e="");var t=Ln(e);return ei[t.toLowerCase()]||""};function ni(e){var t=ti(e.src);return!e.type&&t&&(e.type=t),e}var ii=function(e){function t(t,n,i){var r,a=Ct({createEl:!1},n);if(r=e.call(this,t,a,i)||this,n.playerOptions.sources&&0!==n.playerOptions.sources.length)t.src(n.playerOptions.sources);else for(var s=0,o=n.playerOptions.techOrder;s