=e.video.currentTime())return void(e.danIndex=t);e.danIndex=e.dan.length}}),this.video.on("all","durationchange",function(t,n){1!==n.duration&&(e.element.getElementsByClassName("dplayer-dtime")[0].innerHTML=l.secondToTime(e.video.duration))}),this.video.on("current","progress",function(t,n){var a=n.buffered.length?n.buffered.end(n.buffered.length-1)/n.duration:0;e.updateBar("loaded",a,"width")}),this.video.on("all","error",function(){e.notice(e.tran("This video fails to load"),-1),e.trigger("pause")}),this.video.on("current","canplay",function(){e.trigger("canplay")}),this.ended=!1,this.video.on("all","ended",function(t){t===e.video.videos.length-1&&(e.updateBar("played",1,"width"),e.loop?(e.video.switch(0),e.video.play()):(e.ended=!0,e.pause(),e.trigger("ended")))}),this.video.on("current","play",function(){e.paused&&e.play()}),this.video.on("current","pause",function(){e.paused||e.pause()}),this.video.attr("volume",parseInt(this.element.getElementsByClassName("dplayer-volume-bar-inner")[0].style.width)/100)}},{key:"switchQuality",value:function(e){var t=this;if(this.qualityIndex!==e&&!this.switchingQuality){this.qualityIndex=e,this.switchingQuality=!0,this.quality=this.option.video.quality[e],this.element.getElementsByClassName("dplayer-quality-icon")[0].innerHTML=this.quality.name,this.video.pause();var n=c.video(!1,null,this.option.screenshot,"auto",this.quality.url),a=(new DOMParser).parseFromString(n,"text/html").body.firstChild,i=this.element.getElementsByClassName("dplayer-video-wrap")[0];i.prepend(a),this.prevVideo=this.video,this.video=new u([a],this.prevVideo.duration),this.initVideo(),this.video.seek(this.prevVideo.currentTime()),this.notice(this.tran("Switching to")+" "+this.quality.name+" "+this.tran("quality"),-1),this.video.on("current","canplay",function(){if(t.prevVideo){if(t.video.currentTime()!==t.prevVideo.currentTime())return void t.video.seek(t.prevVideo.currentTime());i.removeChild(t.prevVideo.current),t.video.current.classList.add("dplayer-video-current"),t.video.play(),t.prevVideo=null,t.notice(t.tran("Switched to")+" "+t.quality.name+" "+t.tran("quality")),t.switchingQuality=!1}})}}},{key:"timeTipsHandler",value:function(e,t){var n=this,a=function(e){var t=0,n=0;do{t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:n}};return function(i){if(n.video.duration){var s=i.clientX,o=a(e).left,d=s-o;switch(t.innerText=l.secondToTime(n.video.duration*(d/e.offsetWidth)),t.style.left=d-20+"px",i.type){case"mouseenter":case"mouseover":case"mousemove":if(n.isTipsShow)return;t.classList.remove("hidden"),n.isTipsShow=!0;break;case"mouseleave":case"mouseout":if(!n.isTipsShow)return;t.classList.add("hidden"),n.isTipsShow=!1}}}}},{key:"notice",value:function(e,t){var n=this.element.getElementsByClassName("dplayer-notice")[0];n.innerHTML=e,n.style.opacity=1,this.noticeTime&&clearTimeout(this.noticeTime),t&&t<0||(this.noticeTime=setTimeout(function(){n.style.opacity=0},t||2e3))}}]),e}();e.exports=v},function(e,t,n){"use strict";var a=function(e,t,n,a,i){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(4===s.readyState){if(s.status>=200&&s.status<300||304===s.status){var e=JSON.parse(s.responseText);return 1!==e.code?a(s,e):n(s,e)}i(s)}},s.open(null!==t?"POST":"GET",e,!0),s.send(null!==t?JSON.stringify(t):null)};e.exports={send:function(e,t){a(e,t,function(e,t){console.log("Post danmaku: ",t)},function(e,t){alert(t.msg)},function(e){console.log("Request was unsuccessful: "+e.status)})},read:function(e,t){a(e,null,function(e,n){t(null,n.danmaku)},function(e,n){t({status:e.status,response:n})},function(e){t({status:e.status,response:null})})}}}])});
//# sourceMappingURL=DPlayer.min.js.map
\ No newline at end of file
diff --git a/dist/DPlayer.min.js.map b/dist/DPlayer.min.js.map
index 1b8206a0a..02199c10d 100644
--- a/dist/DPlayer.min.js.map
+++ b/dist/DPlayer.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///DPlayer.min.js","webpack:///webpack/bootstrap 0b494e2b37c87d63a439","webpack:///./src/svg.js","webpack:///./src/html.js","webpack:///./src/i18n.js","webpack:///./src/option.js","webpack:///./src/utils.js","webpack:///./src/video.js","webpack:///./src/DPlayer.js","webpack:///./src/api.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","svgSource","play","pause","volume-up","volume-down","volume-off","loop","full","full-in","setting","right","comment","comment-off","send","menu","camera","type","svg","html","main","option","index","tran","videos","video","url","length","pic","screenshot","preload","logo","danmaku","theme","quality","defaultQuality","qualityList","contextmenuList","contextmenu","result","link","text","current","original","localStorage","getItem","speed","tranZH","Danmaku is loading","Top","Bottom","Rolling","Input danmaku, hit Enter","About author","DPlayer feedback","About DPlayer","Loop","Speed","Opacity for danmaku","Normal","Please input danmaku content!","Set danmaku color","Set danmaku type","Danmaku","This video fails to load","Switching to","Switched to","lang","_this","defaultApiBackend","test","window","navigator","userAgent","autoplay","defaultOption","element","document","getElementsByClassName","language","indexOf","hotkey","apiBackend","defaultKey","toString","user","secondToTime","second","add0","num","min","parseInt","sec","getElementViewLeft","actualLeft","offsetLeft","offsetParent","elementScrollLeft","body","scrollLeft","documentElement","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","undefined","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","descriptor","writable","key","protoProps","staticProps","Video","duration","multi","durationArr","eventAll","eventCurrent","on","reduce","sum","cur","switch","time","classList","add","paused","remove","currentTime","event","callback","_this2","push","addEventListener","events","slice","Math","max","console","log","tmptime","trigger","_typeof","Symbol","iterator","obj","constructor","utils","handleOption","i18n","isMobile","DPlayer","qualityIndex","updateBar","percentage","direction","bar","style","eventTypes","innerHTML","arrow","offsetWidth","arrowStyle","createElement","head","appendChild","initVideo","bezel","playButton","toggle","videoWrap","conMask","toggleController","contains","playedBar","loadedBar","pbar","pbarTimeTips","barWidth","lastPlayPos","currentPlayPos","bufferingDetected","danmakuTime","setTime","playedTime","setInterval","attr","showdan","dan","item","danIndex","parseFloat","pushDanmaku","color","clearTime","clearInterval","e","clientWidth","clientX","seek","width","isTipsShow","timeTipsHandler","bind","thumbMove","thumbUp","removeEventListener","volumeBar","volumeEle","volumeBarWrapWrap","volumeBarWrap","volumeicon","switchVolumeIcon","volumeMove","volume","volumeUp","hideTime","hideController","clearTimeout","setTimeout","closeSetting","closeComment","danOpacity","settingHTML","settingIcon","settingBox","mask","settingEvent","openSetting","danContainer","loopEle","loopToggle","checked","showDanEle","showDanToggle","danTunnel","top","bottom","itemDemo","speedItem","dataset","danmakuBar","danmakuBarWrapWrap","danmakuBarWrap","danmakuSettingBox","danmakuMove","items","opacity","setItem","danmakuUp","readDanmaku","commentInput","commentIcon","commentBox","commentSettingIcon","commentSettingBox","commentSendIcon","htmlEncode","str","replace","sendComment","blur","notice","danmakuData","token","player","id","author","querySelector","api","splice","border","closeCommentSetting","toggleCommentSetting","disableHide","commentFocusTimeout","openComment","focus","fill","keyCode","resetAnimation","danWidth","transform","cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen","requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","webkitEnterFullscreen","handleKeyDown","tag","activeElement","tagName","toUpperCase","editable","getAttribute","preventDefault","clientRect","getBoundingClientRect","menuLeft","left","menuTop","clientY","offsetHeight","height","switchQuality","camareIcon","canvas","getContext","drawImage","href","toDataURL","download","ended","endpoints","finish","results","readCount","read","err","data","response","msg","status","_this3","apiurl","maximum","addition","_readAllEndpoints","concat","apply","sort","a","b","display","_this4","itemHeight","danHeight","itemY","danItemRight","ele","danSpeed","getTunnel","tmp","_ret2","v","j","danRight","removeChild","itemWidth","error","src","poster","danTuel","_this5","exec","Hls","isSupported","hls","attachMedia","Events","MEDIA_ATTACHED","loadSource","MANIFEST_PARSED","levels","flvjs","flvPlayer","createPlayer","attachMediaElement","load","buffered","end","_this6","switchingQuality","videoHTML","videoEle","DOMParser","parseFromString","firstChild","parent","prepend","prevVideo","timeTips","_this7","cumulativeOffset","offsetTop","px","tx","innerText","noticeEle","noticeTime","SendXMLHttpRequest","success","fail","xhr","XMLHttpRequest","onreadystatechange","readyState","JSON","parse","responseText","code","open","stringify","endpoint","alert","cbk"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,OAAA,aAAAH,GACA,gBAAAC,SACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,MACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA+DA,OAnCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAG,EAAA,SAAAK,GAA2C,MAAAA,IAG3CR,EAAAS,EAAA,SAAAf,EAAAgB,EAAAC,GACAX,EAAAY,EAAAlB,EAAAgB,IACAG,OAAAC,eAAApB,EAAAgB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAX,EAAAkB,EAAA,SAAAvB,GACA,GAAAgB,GAAAhB,KAAAwB,WACA,WAA2B,MAAAxB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAK,GAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAlB,KAAAe,EAAAC,IAGtDrB,EAAAwB,EAAA,GAGAxB,IAAAyB,EAAA,KDgBM,SAAU9B,EAAQD,EAASM,GAEjC,YE9EA,IAAM0B,IACFC,MAAS,YAAa,uJACtBC,OAAU,YAAa,4LACvBC,aAAc,YAAa,qsCAC3BC,eAAgB,YAAa,wfAC7BC,cAAe,YAAa,yMAC5BC,MAAS,YAAa,sbACtBC,MA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,KAAKK,UAAUnF,GAAQ,MAGpDrW,GAAOD,SACH6C,KAAM,SAAC6Y,EAAU9I,GACbiI,EAAmBa,EAAU9I,EAAa,SAACoI,EAAKzE,GAC5CxL,QAAQC,IAAI,iBAAkBuL,IAC/B,SAACyE,EAAKzE,GACLoF,MAAMpF,EAASC,MAChB,SAACwE,GACAjQ,QAAQC,IAAI,6BAA+BgQ,EAAIvE,WAIvDL,KAAM,SAACsF,EAAUE,GACbf,EAAmBa,EAAU,KAAM,SAACV,EAAKzE,GACrCqF,EAAI,KAAMrF,EAASxS,UACpB,SAACiX,EAAKzE,GACLqF,GAAMnF,OAAQuE,EAAIvE,OAAQF,cAC3B,SAACyE,GACAY,GAAMnF,OAAQuE,EAAIvE,OAAQF,SAAU","file":"DPlayer.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"DPlayer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"DPlayer\"] = factory();\n\telse\n\t\troot[\"DPlayer\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"DPlayer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"DPlayer\"] = factory();\n\telse\n\t\troot[\"DPlayer\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\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, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 7);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n* SVG used by DPlayer\n*/\n\nvar svgSource = {\n 'play': ['0 0 16 32', 'M15.552 15.168q0.448 0.32 0.448 0.832 0 0.448-0.448 0.768l-13.696 8.512q-0.768 0.512-1.312 0.192t-0.544-1.28v-16.448q0-0.96 0.544-1.28t1.312 0.192z'],\n 'pause': ['0 0 17 32', 'M14.080 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048zM2.88 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048z'],\n 'volume-up': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528zM25.152 16q0 2.72-1.536 5.056t-4 3.36q-0.256 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.704 0.672-1.056 1.024-0.512 1.376-0.8 1.312-0.96 2.048-2.4t0.736-3.104-0.736-3.104-2.048-2.4q-0.352-0.288-1.376-0.8-0.672-0.352-0.672-1.056 0-0.448 0.32-0.8t0.8-0.352q0.224 0 0.48 0.096 2.496 1.056 4 3.36t1.536 5.056zM29.728 16q0 4.096-2.272 7.552t-6.048 5.056q-0.224 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.64 0.704-1.056 0.128-0.064 0.384-0.192t0.416-0.192q0.8-0.448 1.44-0.896 2.208-1.632 3.456-4.064t1.216-5.152-1.216-5.152-3.456-4.064q-0.64-0.448-1.44-0.896-0.128-0.096-0.416-0.192t-0.384-0.192q-0.704-0.416-0.704-1.056 0-0.448 0.32-0.8t0.832-0.352q0.224 0 0.448 0.096 3.776 1.632 6.048 5.056t2.272 7.552z'],\n 'volume-down': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528z'],\n 'volume-off': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8z'],\n 'loop': ['0 0 32 32', 'M1.882 16.941c0 4.152 3.221 7.529 7.177 7.529v1.882c-4.996 0-9.060-4.222-9.060-9.412s4.064-9.412 9.060-9.412h7.96l-3.098-3.098 1.331-1.331 5.372 5.37-5.37 5.372-1.333-1.333 3.1-3.098h-7.962c-3.957 0-7.177 3.377-7.177 7.529zM22.94 7.529v1.882c3.957 0 7.177 3.377 7.177 7.529s-3.221 7.529-7.177 7.529h-7.962l3.098-3.098-1.331-1.331-5.37 5.37 5.372 5.372 1.331-1.331-3.1-3.1h7.96c4.998 0 9.062-4.222 9.062-9.412s-4.064-9.412-9.060-9.412z'],\n 'full': ['0 0 32 33', 'M6.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v4h4c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333zM30.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h4v-4c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM30.667 12c-0.8 0-1.333-0.533-1.333-1.333v-4h-4c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM1.333 12c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-4v4c0 0.8-0.533 1.333-1.333 1.333z'],\n 'full-in': ['0 0 32 33', 'M24.965 24.38h-18.132c-1.366 0-2.478-1.113-2.478-2.478v-11.806c0-1.364 1.111-2.478 2.478-2.478h18.132c1.366 0 2.478 1.113 2.478 2.478v11.806c0 1.364-1.11 2.478-2.478 2.478zM6.833 10.097v11.806h18.134l-0.002-11.806h-18.132zM2.478 28.928h5.952c0.684 0 1.238-0.554 1.238-1.239 0-0.684-0.554-1.238-1.238-1.238h-5.952v-5.802c0-0.684-0.554-1.239-1.238-1.239s-1.239 0.556-1.239 1.239v5.802c0 1.365 1.111 2.478 2.478 2.478zM30.761 19.412c-0.684 0-1.238 0.554-1.238 1.238v5.801h-5.951c-0.686 0-1.239 0.554-1.239 1.238 0 0.686 0.554 1.239 1.239 1.239h5.951c1.366 0 2.478-1.111 2.478-2.478v-5.801c0-0.683-0.554-1.238-1.239-1.238zM0 5.55v5.802c0 0.683 0.554 1.238 1.238 1.238s1.238-0.555 1.238-1.238v-5.802h5.952c0.684 0 1.238-0.554 1.238-1.238s-0.554-1.238-1.238-1.238h-5.951c-1.366-0.001-2.478 1.111-2.478 2.476zM32 11.35v-5.801c0-1.365-1.11-2.478-2.478-2.478h-5.951c-0.686 0-1.239 0.554-1.239 1.238s0.554 1.238 1.239 1.238h5.951v5.801c0 0.683 0.554 1.237 1.238 1.237 0.686 0.002 1.239-0.553 1.239-1.236z'],\n 'setting': ['0 0 32 28', 'M28.633 17.104c0.035 0.21 0.026 0.463-0.026 0.76s-0.14 0.598-0.262 0.904c-0.122 0.306-0.271 0.581-0.445 0.825s-0.367 0.419-0.576 0.524c-0.209 0.105-0.393 0.157-0.55 0.157s-0.332-0.035-0.524-0.105c-0.175-0.052-0.393-0.1-0.655-0.144s-0.528-0.052-0.799-0.026c-0.271 0.026-0.541 0.083-0.812 0.17s-0.502 0.236-0.694 0.445c-0.419 0.437-0.664 0.934-0.734 1.493s0.009 1.092 0.236 1.598c0.175 0.349 0.148 0.699-0.079 1.048-0.105 0.14-0.271 0.284-0.498 0.432s-0.476 0.284-0.747 0.406-0.555 0.218-0.851 0.288c-0.297 0.070-0.559 0.105-0.786 0.105-0.157 0-0.306-0.061-0.445-0.183s-0.236-0.253-0.288-0.393h-0.026c-0.192-0.541-0.52-1.009-0.982-1.402s-1-0.589-1.611-0.589c-0.594 0-1.131 0.197-1.611 0.589s-0.816 0.851-1.009 1.375c-0.087 0.21-0.218 0.362-0.393 0.458s-0.367 0.144-0.576 0.144c-0.244 0-0.52-0.044-0.825-0.131s-0.611-0.197-0.917-0.327c-0.306-0.131-0.581-0.284-0.825-0.458s-0.428-0.349-0.55-0.524c-0.087-0.122-0.135-0.266-0.144-0.432s0.057-0.397 0.197-0.694c0.192-0.402 0.266-0.86 0.223-1.375s-0.266-0.991-0.668-1.428c-0.244-0.262-0.541-0.432-0.891-0.511s-0.681-0.109-0.995-0.092c-0.367 0.017-0.742 0.087-1.127 0.21-0.244 0.070-0.489 0.052-0.734-0.052-0.192-0.070-0.371-0.231-0.537-0.485s-0.314-0.533-0.445-0.838c-0.131-0.306-0.231-0.62-0.301-0.943s-0.087-0.59-0.052-0.799c0.052-0.384 0.227-0.629 0.524-0.734 0.524-0.21 0.995-0.555 1.415-1.035s0.629-1.017 0.629-1.611c0-0.611-0.21-1.144-0.629-1.598s-0.891-0.786-1.415-0.996c-0.157-0.052-0.288-0.179-0.393-0.38s-0.157-0.406-0.157-0.616c0-0.227 0.035-0.48 0.105-0.76s0.162-0.55 0.275-0.812 0.244-0.502 0.393-0.72c0.148-0.218 0.31-0.38 0.485-0.485 0.14-0.087 0.275-0.122 0.406-0.105s0.275 0.052 0.432 0.105c0.524 0.21 1.070 0.275 1.637 0.197s1.070-0.327 1.506-0.747c0.21-0.209 0.362-0.467 0.458-0.773s0.157-0.607 0.183-0.904c0.026-0.297 0.026-0.568 0-0.812s-0.048-0.419-0.065-0.524c-0.035-0.105-0.066-0.227-0.092-0.367s-0.013-0.262 0.039-0.367c0.105-0.244 0.293-0.458 0.563-0.642s0.563-0.336 0.878-0.458c0.314-0.122 0.62-0.214 0.917-0.275s0.533-0.092 0.707-0.092c0.227 0 0.406 0.074 0.537 0.223s0.223 0.301 0.275 0.458c0.192 0.471 0.507 0.886 0.943 1.244s0.952 0.537 1.546 0.537c0.611 0 1.153-0.17 1.624-0.511s0.803-0.773 0.996-1.297c0.070-0.14 0.179-0.284 0.327-0.432s0.301-0.223 0.458-0.223c0.244 0 0.511 0.035 0.799 0.105s0.572 0.166 0.851 0.288c0.279 0.122 0.537 0.279 0.773 0.472s0.423 0.402 0.563 0.629c0.087 0.14 0.113 0.293 0.079 0.458s-0.070 0.284-0.105 0.354c-0.227 0.506-0.297 1.039-0.21 1.598s0.341 1.048 0.76 1.467c0.419 0.419 0.934 0.651 1.546 0.694s1.179-0.057 1.703-0.301c0.14-0.087 0.31-0.122 0.511-0.105s0.371 0.096 0.511 0.236c0.262 0.244 0.493 0.616 0.694 1.113s0.336 1 0.406 1.506c0.035 0.297-0.013 0.528-0.144 0.694s-0.266 0.275-0.406 0.327c-0.542 0.192-1.004 0.528-1.388 1.009s-0.576 1.026-0.576 1.637c0 0.594 0.162 1.113 0.485 1.559s0.747 0.764 1.27 0.956c0.122 0.070 0.227 0.14 0.314 0.21 0.192 0.157 0.323 0.358 0.393 0.602v0zM16.451 19.462c0.786 0 1.528-0.149 2.227-0.445s1.305-0.707 1.821-1.231c0.515-0.524 0.921-1.131 1.218-1.821s0.445-1.428 0.445-2.214c0-0.786-0.148-1.524-0.445-2.214s-0.703-1.292-1.218-1.808c-0.515-0.515-1.122-0.921-1.821-1.218s-1.441-0.445-2.227-0.445c-0.786 0-1.524 0.148-2.214 0.445s-1.292 0.703-1.808 1.218c-0.515 0.515-0.921 1.118-1.218 1.808s-0.445 1.428-0.445 2.214c0 0.786 0.149 1.524 0.445 2.214s0.703 1.297 1.218 1.821c0.515 0.524 1.118 0.934 1.808 1.231s1.428 0.445 2.214 0.445v0z'],\n 'right': ['0 0 32 32', 'M22 16l-10.105-10.6-1.895 1.987 8.211 8.613-8.211 8.612 1.895 1.988 8.211-8.613z'],\n 'comment': ['0 0 32 32', 'M27.128 0.38h-22.553c-2.336 0-4.229 1.825-4.229 4.076v16.273c0 2.251 1.893 4.076 4.229 4.076h4.229v-2.685h8.403l-8.784 8.072 1.566 1.44 7.429-6.827h9.71c2.335 0 4.229-1.825 4.229-4.076v-16.273c0-2.252-1.894-4.076-4.229-4.076zM28.538 19.403c0 1.5-1.262 2.717-2.819 2.717h-8.36l-0.076-0.070-0.076 0.070h-11.223c-1.557 0-2.819-1.217-2.819-2.717v-13.589c0-1.501 1.262-2.718 2.819-2.718h19.734c1.557 0 2.819-0.141 2.819 1.359v14.947zM9.206 10.557c-1.222 0-2.215 0.911-2.215 2.036s0.992 2.035 2.215 2.035c1.224 0 2.216-0.911 2.216-2.035s-0.992-2.036-2.216-2.036zM22.496 10.557c-1.224 0-2.215 0.911-2.215 2.036s0.991 2.035 2.215 2.035c1.224 0 2.215-0.911 2.215-2.035s-0.991-2.036-2.215-2.036zM15.852 10.557c-1.224 0-2.215 0.911-2.215 2.036s0.991 2.035 2.215 2.035c1.222 0 2.215-0.911 2.215-2.035s-0.992-2.036-2.215-2.036z'],\n 'comment-off': ['0 0 32 32', 'M27.090 0.131h-22.731c-2.354 0-4.262 1.839-4.262 4.109v16.401c0 2.269 1.908 4.109 4.262 4.109h4.262v-2.706h8.469l-8.853 8.135 1.579 1.451 7.487-6.88h9.787c2.353 0 4.262-1.84 4.262-4.109v-16.401c0-2.27-1.909-4.109-4.262-4.109v0zM28.511 19.304c0 1.512-1.272 2.738-2.841 2.738h-8.425l-0.076-0.070-0.076 0.070h-11.311c-1.569 0-2.841-1.226-2.841-2.738v-13.696c0-1.513 1.272-2.739 2.841-2.739h19.889c1.569 0 2.841-0.142 2.841 1.37v15.064z'],\n 'send': ['0 0 32 32', 'M13.725 30l3.9-5.325-3.9-1.125v6.45zM0 17.5l11.050 3.35 13.6-11.55-10.55 12.425 11.8 3.65 6.1-23.375-32 15.5z'],\n 'menu': ['0 0 22 32', 'M20.8 14.4q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2zM1.6 11.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2zM20.8 20.8q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2z'],\n 'camera': ['0 0 32 32', 'M16 23c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6zM16 13c-2.206 0-4 1.794-4 4s1.794 4 4 4c2.206 0 4-1.794 4-4s-1.794-4-4-4zM27 28h-22c-1.654 0-3-1.346-3-3v-16c0-1.654 1.346-3 3-3h3c0.552 0 1 0.448 1 1s-0.448 1-1 1h-3c-0.551 0-1 0.449-1 1v16c0 0.552 0.449 1 1 1h22c0.552 0 1-0.448 1-1v-16c0-0.551-0.448-1-1-1h-11c-0.552 0-1-0.448-1-1s0.448-1 1-1h11c1.654 0 3 1.346 3 3v16c0 1.654-1.346 3-3 3zM24 10.5c0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5zM15 4c0 0.552-0.448 1-1 1h-4c-0.552 0-1-0.448-1-1v0c0-0.552 0.448-1 1-1h4c0.552 0 1 0.448 1 1v0z']\n};\n\nmodule.exports = function (type) {\n return '\\n \\n';\n};\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar svg = __webpack_require__(0);\n\nvar html = {\n main: function main(option, index, tran) {\n var videos = '';\n for (var i = 0; i < option.video.url.length; i++) {\n videos += html.video(i === 0, option.video.pic, option.screenshot, option.video.url.length ? 'metadata' : option.preload, option.video.url[i]);\n }\n return '\\n \\n \\n ' + videos + '\\n ' + (option.logo ? '\\n
\\n ' : '') + '\\n
\\n
\\n \\n ' + (option.danmaku ? '' + tran('Danmaku is loading') + '' : '') + '\\n \\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\\n
\\n
\\n
0:00 / 0:00\\n
\\n
\\n ' + (option.video.quality ? '\\n
\\n
\\n
\\n ' + html.qualityList(option.video.quality) + '\\n
\\n
\\n ' : '') + '\\n ' + (option.screenshot ? '\\n
\\n ' + svg('camera') + '\\n \\n ' : '') + '\\n \\n
\\n
\\n
\\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\\n ' + html.contextmenuList(option.contextmenu) + '\\n ';\n },\n\n contextmenuList: function contextmenuList(contextmenu) {\n var result = '';\n\n return result;\n },\n\n qualityList: function qualityList(quality) {\n var result = '';\n for (var i = 0; i < quality.length; i++) {\n result += '
' + quality[i].name + '
';\n }\n result += '
';\n\n return result;\n },\n\n video: function video(current, pic, screenshot, preload, url) {\n return '';\n },\n\n setting: function setting(tran) {\n return {\n 'original': '\\n \\n
' + tran('Speed') + '\\n
\\n ' + svg('right') + '\\n
\\n
\\n \\n
' + tran('Loop') + '\\n
\\n \\n \\n
\\n
\\n \\n
' + tran('Danmaku') + '\\n
\\n \\n \\n
\\n
\\n \\n
' + tran('Opacity for danmaku') + '\\n
\\n
',\n 'speed': '\\n \\n 0.5\\n
\\n \\n 0.75\\n
\\n \\n ' + tran('Normal') + '\\n
\\n \\n 1.25\\n
\\n \\n 1.5\\n
\\n \\n 2\\n
'\n };\n }\n};\n\nmodule.exports = html;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar tranZH = {\n 'Danmaku is loading': '弹幕加载中',\n 'Top': '顶部',\n 'Bottom': '底部',\n 'Rolling': '滚动',\n 'Input danmaku, hit Enter': '输入弹幕,回车发送',\n 'About author': '关于作者',\n 'DPlayer feedback': '播放器意见反馈',\n 'About DPlayer': '关于 DPlayer 播放器',\n 'Loop': '洗脑循环',\n 'Speed': '速度',\n 'Opacity for danmaku': '弹幕透明度',\n 'Normal': '正常',\n 'Please input danmaku content!': '要输入弹幕内容啊喂!',\n 'Set danmaku color': '设置弹幕颜色',\n 'Set danmaku type': '设置弹幕类型',\n 'Danmaku': '弹幕',\n 'This video fails to load': '视频加载失败',\n 'Switching to': '正在切换至',\n 'Switched to': '已经切换至',\n 'quality': '画质'\n};\n\nmodule.exports = function (lang) {\n var _this = this;\n\n this.lang = lang;\n this.tran = function (text) {\n if (_this.lang === 'en') {\n return text;\n } else if (_this.lang === 'zh') {\n return tranZH[text];\n }\n };\n};\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar defaultApiBackend = __webpack_require__(8);\n\nmodule.exports = function (option) {\n var isMobile = /mobile/i.test(window.navigator.userAgent);\n // compatibility: some mobile browsers don't suppose autoplay\n if (isMobile) {\n option.autoplay = false;\n }\n\n // default options\n var defaultOption = {\n element: document.getElementsByClassName('dplayer')[0],\n autoplay: false,\n theme: '#b7daff',\n loop: false,\n lang: navigator.language.indexOf('zh') !== -1 ? 'zh' : 'en',\n screenshot: false,\n hotkey: true,\n preload: 'auto',\n apiBackend: defaultApiBackend,\n contextmenu: [{\n text: '关于作者',\n link: 'http://diygod.me'\n }, {\n text: '播放器意见反馈',\n link: 'https://github.com/DIYgod/DPlayer/issues'\n }, {\n text: '关于 DPlayer 播放器',\n link: 'https://github.com/DIYgod/DPlayer'\n }]\n };\n for (var defaultKey in defaultOption) {\n if (defaultOption.hasOwnProperty(defaultKey) && !option.hasOwnProperty(defaultKey)) {\n option[defaultKey] = defaultOption[defaultKey];\n }\n }\n if (Object.prototype.toString.call(option.video.url) !== '[object Array]') {\n option.video.url = [option.video.url];\n }\n if (option.video && !option.video.hasOwnProperty('type')) {\n option.video.type = 'auto';\n }\n if (option.danmaku && !option.danmaku.hasOwnProperty('user')) {\n option.danmaku.user = 'DIYgod';\n }\n\n if (option.video.quality) {\n option.video.url = [option.video.quality[option.video.defaultQuality].url];\n }\n\n return option;\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = {\n\n /**\n * Parse second to 00:00 format\n *\n * @param {Number} second\n * @return {String} 00:00 format\n */\n secondToTime: function secondToTime(second) {\n var add0 = function add0(num) {\n return num < 10 ? '0' + num : '' + num;\n };\n var min = parseInt(second / 60);\n var sec = parseInt(second - min * 60);\n return add0(min) + ':' + add0(sec);\n },\n\n /**\n * control play progress\n */\n // get element's view position\n getElementViewLeft: function getElementViewLeft(element) {\n var actualLeft = element.offsetLeft;\n var current = element.offsetParent;\n var elementScrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft;\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) {\n while (current !== null) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n } else {\n while (current !== null && current !== undefined.element) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n }\n return actualLeft - elementScrollLeft;\n }\n};\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Video = function () {\n function Video(videos, duration) {\n var _this = this;\n\n _classCallCheck(this, Video);\n\n this.videos = videos;\n this.multi = this.videos.length > 1;\n this.index = 0;\n this.current = this.videos[this.index];\n\n this.duration = duration || 0;\n this.durationArr = [];\n this.eventAll = [];\n this.eventCurrent = [];\n\n this.on('all', 'durationchange', function (i, video) {\n if (video.duration !== 1) {\n // some Android browsers will output 1 at first\n _this.durationArr[i] = video.duration;\n if (!duration) {\n _this.duration = _this.durationArr.reduce(function (sum, cur) {\n return sum + cur;\n });\n }\n }\n });\n this.on('current', 'end', function () {\n _this.switch(_this.index + 1);\n });\n }\n\n _createClass(Video, [{\n key: 'switch',\n value: function _switch(index, time) {\n if (this.index !== index) {\n this.videos[index].classList.add('dplayer-video-current');\n if (!this.current.paused) {\n this.videos[index].play();\n }\n this.current.classList.remove('dplayer-video-current');\n this.current.pause();\n\n this.index = index;\n this.current = this.videos[this.index];\n this.videos[index].currentTime = time ? time : 0;\n } else {\n this.videos[index].currentTime = time ? time : 0;\n }\n }\n\n // bind event \n\n }, {\n key: 'on',\n value: function on(type, event, callback) {\n var _this2 = this;\n\n if (typeof callback === 'function') {\n if (type === 'all') {\n if (!this.eventAll[event]) {\n this.eventAll[event] = [];\n }\n this.eventAll[event].push(callback);\n } else {\n if (!this.eventCurrent[event]) {\n this.eventCurrent[event] = [];\n }\n this.eventCurrent[event].push(callback);\n }\n\n if (['seeking'].indexOf(event) === -1) {\n var _loop = function _loop(i) {\n _this2.videos[i].addEventListener(event, function () {\n if (type === 'all' || _this2.videos[i] === _this2.current) {\n callback(i, _this2.videos[i]);\n }\n });\n };\n\n for (var i = 0; i < this.videos.length; i++) {\n _loop(i);\n }\n }\n }\n }\n\n // trigger event\n\n }, {\n key: 'trigger',\n value: function trigger(type, event) {\n var events = type === 'all' ? this.eventAll : this.eventCurrent;\n for (var i = 0; i < events[event].length; i++) {\n events[event][i]();\n }\n }\n }, {\n key: 'currentTime',\n value: function currentTime() {\n if (this.durationArr.slice(0, this.index).length) {\n return this.durationArr.slice(0, this.index).reduce(function (sum, cur) {\n return sum + cur;\n }) + this.current.currentTime;\n } else {\n return this.current.currentTime;\n }\n }\n }, {\n key: 'seek',\n value: function seek(time) {\n time = Math.max(time, 0);\n time = Math.min(time, this.duration);\n console.log(time);\n\n var i = 0;\n var tmptime = 0;\n while (tmptime <= time) {\n tmptime += this.durationArr[i];\n i++;\n }\n\n var currentTime = void 0;\n if (this.durationArr.slice(0, this.index).length) {\n currentTime = time - this.durationArr.slice(0, i - 1).reduce(function (sum, cur) {\n return sum + cur;\n });\n } else {\n currentTime = time;\n }\n\n this.switch(i - 1, currentTime);\n\n this.trigger('all', 'seeking');\n }\n }, {\n key: 'attr',\n value: function attr(option, value) {\n if (value !== undefined) {\n for (var i = 0; i < this.videos.length; i++) {\n this.videos[i][option] = value;\n }\n }\n return this.current[option];\n }\n }, {\n key: 'play',\n value: function play() {\n this.current.play();\n }\n }, {\n key: 'pause',\n value: function pause() {\n this.current.pause();\n }\n }, {\n key: 'toggle',\n value: function toggle() {\n this.current.paused ? this.play() : this.pause();\n }\n }]);\n\n return Video;\n}();\n\nmodule.exports = Video;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nconsole.log('\\n %c DPlayer 1.3.0 %c http://dplayer.js.org \\n\\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');\n\n__webpack_require__(6);\nvar utils = __webpack_require__(4);\nvar svg = __webpack_require__(0);\nvar handleOption = __webpack_require__(3);\nvar i18n = __webpack_require__(2);\nvar html = __webpack_require__(1);\nvar Video = __webpack_require__(5);\nvar isMobile = /mobile/i.test(window.navigator.userAgent);\n\nvar index = 0;\n\nvar DPlayer = function () {\n\n /**\n * DPlayer constructor function\n *\n * @param {Object} option - See README\n * @constructor\n */\n function DPlayer(option) {\n var _this = this;\n\n _classCallCheck(this, DPlayer);\n\n this.option = handleOption(option);\n\n this.option.element.classList.add('dplayer');\n\n if (this.option.video.quality) {\n this.qualityIndex = this.option.video.defaultQuality;\n this.quality = this.option.video.quality[this.option.video.defaultQuality];\n }\n\n this.tran = new i18n(this.option.lang).tran;\n\n /**\n * Update progress bar, including loading progress bar and play progress bar\n *\n * @param {String} type - Point out which bar it is, should be played loaded or volume\n * @param {Number} percentage\n * @param {String} direction - Point out the direction of this bar, Should be height or width\n */\n this.updateBar = function (type, percentage, direction) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n bar[type + 'Bar'].style[direction] = percentage * 100 + '%';\n };\n\n // define DPlayer events\n var eventTypes = ['play', 'pause', 'canplay', 'playing', 'ended', 'error'];\n this.event = {};\n for (var i = 0; i < eventTypes.length; i++) {\n this.event[eventTypes[i]] = [];\n }\n this.trigger = function (type) {\n for (var _i = 0; _i < _this.event[type].length; _i++) {\n _this.event[type][_i]();\n }\n };\n\n this.element = this.option.element;\n if (!this.option.danmaku) {\n this.element.classList.add('dplayer-no-danmaku');\n }\n if (isMobile) {\n this.element.classList.add('dplayer-mobile');\n }\n\n this.element.innerHTML = html.main(option, index, this.tran);\n\n // arrow style\n this.arrow = this.element.offsetWidth <= 500;\n if (this.arrow) {\n var arrowStyle = document.createElement('style');\n arrowStyle.innerHTML = '.dplayer .dplayer-danmaku{font-size:18px}';\n document.head.appendChild(arrowStyle);\n }\n\n // get this video manager\n this.video = new Video(this.element.getElementsByClassName('dplayer-video-current'));\n\n this.initVideo();\n\n this.bezel = this.element.getElementsByClassName('dplayer-bezel-icon')[0];\n this.bezel.addEventListener('animationend', function () {\n _this.bezel.classList.remove('dplayer-bezel-transition');\n });\n\n // play and pause button\n this.playButton = this.element.getElementsByClassName('dplayer-play-icon')[0];\n this.paused = true;\n this.playButton.addEventListener('click', function () {\n _this.toggle();\n });\n\n var videoWrap = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n var conMask = this.element.getElementsByClassName('dplayer-controller-mask')[0];\n if (!isMobile) {\n videoWrap.addEventListener('click', function () {\n _this.toggle();\n });\n conMask.addEventListener('click', function () {\n _this.toggle();\n });\n } else {\n var toggleController = function toggleController() {\n if (_this.element.classList.contains('dplayer-hide-controller')) {\n _this.element.classList.remove('dplayer-hide-controller');\n } else {\n _this.element.classList.add('dplayer-hide-controller');\n }\n };\n videoWrap.addEventListener('click', toggleController);\n conMask.addEventListener('click', toggleController);\n }\n\n var bar = {};\n bar.playedBar = this.element.getElementsByClassName('dplayer-played')[0];\n bar.loadedBar = this.element.getElementsByClassName('dplayer-loaded')[0];\n var pbar = this.element.getElementsByClassName('dplayer-bar-wrap')[0];\n var pbarTimeTips = this.element.getElementsByClassName('dplayer-bar-time')[0];\n var barWidth = void 0;\n\n var lastPlayPos = 0;\n var currentPlayPos = 0;\n var bufferingDetected = false;\n var danmakuTime = void 0;\n this.setTime = function () {\n _this.playedTime = setInterval(function () {\n // whether the video is buffering\n currentPlayPos = _this.video.currentTime();\n if (!bufferingDetected && currentPlayPos < lastPlayPos + 0.01 && !_this.video.attr('paused')) {\n _this.element.classList.add('dplayer-loading');\n bufferingDetected = true;\n }\n if (bufferingDetected && currentPlayPos > lastPlayPos + 0.01 && !_this.video.attr('paused')) {\n _this.element.classList.remove('dplayer-loading');\n bufferingDetected = false;\n }\n lastPlayPos = currentPlayPos;\n\n _this.updateBar('played', _this.video.currentTime() / _this.video.duration, 'width');\n _this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = utils.secondToTime(_this.video.currentTime());\n _this.trigger('playing');\n }, 100);\n if (_this.option.danmaku && showdan) {\n danmakuTime = setInterval(function () {\n if (_this.dan) {\n var item = _this.dan[_this.danIndex];\n while (item && _this.video.currentTime() > parseFloat(item.time)) {\n _this.pushDanmaku(item.text, item.color, item.type);\n item = _this.dan[++_this.danIndex];\n }\n }\n }, 100);\n }\n };\n this.clearTime = function () {\n clearInterval(_this.playedTime);\n if (_this.option.danmaku) {\n clearInterval(danmakuTime);\n }\n };\n\n pbar.addEventListener('click', function (event) {\n var e = event || window.event;\n barWidth = pbar.clientWidth;\n var percentage = (e.clientX - utils.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('played', percentage, 'width');\n _this.video.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n });\n\n this.isTipsShow = false;\n this.timeTipsHandler = this.timeTipsHandler(pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.timeTipsHandler);\n pbar.addEventListener('mouseover', this.timeTipsHandler);\n pbar.addEventListener('mouseenter', this.timeTipsHandler);\n pbar.addEventListener('mouseout', this.timeTipsHandler);\n pbar.addEventListener('mouseleave', this.timeTipsHandler);\n\n var thumbMove = function thumbMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - utils.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('played', percentage, 'width');\n _this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = utils.secondToTime(percentage * _this.video.duration);\n };\n\n var thumbUp = function thumbUp() {\n document.removeEventListener('mouseup', thumbUp);\n document.removeEventListener('mousemove', thumbMove);\n _this.video.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n _this.setTime();\n };\n\n pbar.addEventListener('mousedown', function () {\n barWidth = pbar.clientWidth;\n _this.clearTime();\n document.addEventListener('mousemove', thumbMove);\n document.addEventListener('mouseup', thumbUp);\n });\n\n /**\n * control volume\n */\n bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\n var volumeEle = this.element.getElementsByClassName('dplayer-volume')[0];\n var volumeBarWrapWrap = this.element.getElementsByClassName('dplayer-volume-bar-wrap')[0];\n var volumeBarWrap = this.element.getElementsByClassName('dplayer-volume-bar')[0];\n var volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0];\n var vWidth = 35;\n\n this.switchVolumeIcon = function () {\n var volumeicon = _this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (_this.video.attr('volume') >= 0.8) {\n volumeicon.innerHTML = svg('volume-up');\n } else if (_this.video.attr('volume') > 0) {\n volumeicon.innerHTML = svg('volume-down');\n } else {\n volumeicon.innerHTML = svg('volume-off');\n }\n };\n var volumeMove = function volumeMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - utils.getElementViewLeft(volumeBarWrap) - 5.5) / vWidth;\n _this.volume(percentage);\n };\n var volumeUp = function volumeUp() {\n document.removeEventListener('mouseup', volumeUp);\n document.removeEventListener('mousemove', volumeMove);\n volumeEle.classList.remove('dplayer-volume-active');\n };\n\n volumeBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - utils.getElementViewLeft(volumeBarWrap) - 5.5) / vWidth;\n _this.volume(percentage);\n });\n volumeBarWrapWrap.addEventListener('mousedown', function () {\n document.addEventListener('mousemove', volumeMove);\n document.addEventListener('mouseup', volumeUp);\n volumeEle.classList.add('dplayer-volume-active');\n });\n volumeicon.addEventListener('click', function () {\n if (_this.video.attr('muted')) {\n _this.video.attr('muted', false);\n _this.switchVolumeIcon();\n _this.updateBar('volume', _this.video.attr('volume'), 'width');\n } else {\n _this.video.attr('muted', true);\n volumeicon.innerHTML = svg('volume-off');\n _this.updateBar('volume', 0, 'width');\n }\n });\n\n /**\n * auto hide controller\n */\n var hideTime = 0;\n if (!isMobile) {\n var hideController = function hideController() {\n _this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(hideTime);\n hideTime = setTimeout(function () {\n if (_this.video.attr('played').length) {\n _this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n\n /**\n * setting\n */\n this.danOpacity = localStorage.getItem('DPlayer-opacity') || 0.7;\n var settingHTML = html.setting(this.tran);\n\n // toggle setting box\n var settingIcon = this.element.getElementsByClassName('dplayer-setting-icon')[0];\n var settingBox = this.element.getElementsByClassName('dplayer-setting-box')[0];\n var mask = this.element.getElementsByClassName('dplayer-mask')[0];\n settingBox.innerHTML = settingHTML.original;\n\n var closeSetting = function closeSetting() {\n if (settingBox.classList.contains('dplayer-setting-box-open')) {\n settingBox.classList.remove('dplayer-setting-box-open');\n mask.classList.remove('dplayer-mask-show');\n setTimeout(function () {\n settingBox.classList.remove('dplayer-setting-box-narrow');\n settingBox.innerHTML = settingHTML.original;\n settingEvent();\n }, 300);\n }\n };\n var openSetting = function openSetting() {\n settingBox.classList.add('dplayer-setting-box-open');\n mask.classList.add('dplayer-mask-show');\n };\n\n mask.addEventListener('click', function () {\n closeSetting();\n });\n settingIcon.addEventListener('click', function () {\n openSetting();\n });\n\n this.loop = this.option.loop;\n var danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n var showdan = true;\n var settingEvent = function settingEvent() {\n // loop control\n var loopEle = _this.element.getElementsByClassName('dplayer-setting-loop')[0];\n var loopToggle = loopEle.getElementsByClassName('dplayer-toggle-setting-input')[0];\n\n loopToggle.checked = _this.loop;\n\n loopEle.addEventListener('click', function () {\n loopToggle.checked = !loopToggle.checked;\n if (loopToggle.checked) {\n _this.loop = true;\n } else {\n _this.loop = false;\n }\n closeSetting();\n });\n\n // show danmaku control\n var showDanEle = _this.element.getElementsByClassName('dplayer-setting-showdan')[0];\n var showDanToggle = showDanEle.getElementsByClassName('dplayer-showdan-setting-input')[0];\n\n showDanToggle.checked = showdan;\n\n showDanEle.addEventListener('click', function () {\n showDanToggle.checked = !showDanToggle.checked;\n if (showDanToggle.checked) {\n showdan = true;\n if (_this.option.danmaku) {\n for (var _i2 = 0; _i2 < _this.dan.length; _i2++) {\n if (_this.dan[_i2].time >= _this.video.currentTime()) {\n _this.danIndex = _i2;\n break;\n }\n _this.danIndex = _this.dan.length;\n }\n danmakuTime = setInterval(function () {\n var item = _this.dan[_this.danIndex];\n while (item && _this.video.currentTime() >= parseFloat(item.time)) {\n _this.pushDanmaku(item.text, item.color, item.type);\n item = _this.dan[++_this.danIndex];\n }\n }, 0);\n }\n } else {\n showdan = false;\n if (_this.option.danmaku) {\n clearInterval(danmakuTime);\n danContainer.innerHTML = '';\n _this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n _this.itemDemo = _this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n }\n }\n closeSetting();\n });\n\n // speed control\n var speedEle = _this.element.getElementsByClassName('dplayer-setting-speed')[0];\n speedEle.addEventListener('click', function () {\n settingBox.classList.add('dplayer-setting-box-narrow');\n settingBox.innerHTML = settingHTML.speed;\n\n var speedItem = settingBox.getElementsByClassName('dplayer-setting-speed-item');\n\n var _loop = function _loop(_i3) {\n speedItem[_i3].addEventListener('click', function () {\n _this.video.attr('playbackRate', speedItem[_i3].dataset.speed);\n closeSetting();\n });\n };\n\n for (var _i3 = 0; _i3 < speedItem.length; _i3++) {\n _loop(_i3);\n }\n });\n\n if (_this.option.danmaku) {\n // danmaku opacity\n bar.danmakuBar = _this.element.getElementsByClassName('dplayer-danmaku-bar-inner')[0];\n var danmakuBarWrapWrap = _this.element.getElementsByClassName('dplayer-danmaku-bar-wrap')[0];\n var danmakuBarWrap = _this.element.getElementsByClassName('dplayer-danmaku-bar')[0];\n var danmakuSettingBox = _this.element.getElementsByClassName('dplayer-setting-danmaku')[0];\n var dWidth = 130;\n _this.updateBar('danmaku', _this.danOpacity, 'width');\n\n var danmakuMove = function danmakuMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - utils.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i4 = 0; _i4 < items.length; _i4++) {\n items[_i4].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n };\n var danmakuUp = function danmakuUp() {\n document.removeEventListener('mouseup', danmakuUp);\n document.removeEventListener('mousemove', danmakuMove);\n danmakuSettingBox.classList.remove('dplayer-setting-danmaku-active');\n };\n\n danmakuBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - utils.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i5 = 0; _i5 < items.length; _i5++) {\n items[_i5].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n });\n danmakuBarWrapWrap.addEventListener('mousedown', function () {\n document.addEventListener('mousemove', danmakuMove);\n document.addEventListener('mouseup', danmakuUp);\n danmakuSettingBox.classList.add('dplayer-setting-danmaku-active');\n });\n }\n };\n settingEvent();\n\n // set duration time\n if (this.video.duration !== 1) {\n // compatibility: Android browsers will output 1 at first\n this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = this.video.duration ? utils.secondToTime(this.video.duration) : '00:00';\n }\n\n // danmaku\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.itemDemo = this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n\n if (this.option.danmaku) {\n this.danIndex = 0;\n this.readDanmaku();\n } else {\n // autoplay\n if (this.option.autoplay && !isMobile) {\n this.play();\n } else if (isMobile) {\n this.pause();\n }\n }\n\n /**\n * comment\n */\n var commentInput = this.element.getElementsByClassName('dplayer-comment-input')[0];\n var commentIcon = this.element.getElementsByClassName('dplayer-comment-icon')[0];\n var commentBox = this.element.getElementsByClassName('dplayer-comment-box')[0];\n var commentSettingIcon = this.element.getElementsByClassName('dplayer-comment-setting-icon')[0];\n var commentSettingBox = this.element.getElementsByClassName('dplayer-comment-setting-box')[0];\n var commentSendIcon = this.element.getElementsByClassName('dplayer-send-icon')[0];\n\n var htmlEncode = function htmlEncode(str) {\n return str.replace(/&/g, \"&\").replace(//g, \">\").replace(/\"/g, \""\").replace(/'/g, \"'\").replace(/\\//g, \"/\");\n };\n\n var sendComment = function sendComment() {\n commentInput.blur();\n\n // text can't be empty\n if (!commentInput.value.replace(/^\\s+|\\s+$/g, '')) {\n _this.notice(_this.tran('Please input danmaku content!'));\n return;\n }\n\n var danmakuData = {\n token: _this.option.danmaku.token,\n player: _this.option.danmaku.id,\n author: _this.option.danmaku.user,\n time: _this.video.currentTime(),\n text: commentInput.value,\n color: _this.element.querySelector('.dplayer-comment-setting-color input:checked').value,\n type: _this.element.querySelector('.dplayer-comment-setting-type input:checked').value\n };\n _this.option.apiBackend.send(_this.option.danmaku.api, danmakuData);\n\n commentInput.value = '';\n closeComment();\n _this.dan.splice(_this.danIndex, 0, danmakuData);\n _this.danIndex++;\n var item = _this.pushDanmaku(htmlEncode(danmakuData.text), danmakuData.color, danmakuData.type);\n item.style.border = '2px solid ' + _this.option.theme;\n };\n\n var closeCommentSetting = function closeCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n }\n };\n var toggleCommentSetting = function toggleCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n } else {\n commentSettingBox.classList.add('dplayer-comment-setting-open');\n }\n };\n\n var disableHide = 0;\n var commentFocusTimeout = 0;\n var closeComment = function closeComment() {\n if (!commentBox.classList.contains('dplayer-comment-box-open')) {\n return;\n }\n\n commentBox.classList.remove('dplayer-comment-box-open');\n mask.classList.remove('dplayer-mask-show');\n _this.element.classList.remove('dplayer-show-controller');\n\n clearInterval(disableHide);\n clearTimeout(commentFocusTimeout);\n closeCommentSetting();\n };\n var openComment = function openComment() {\n if (commentBox.classList.contains('dplayer-comment-box-open')) {\n return;\n }\n\n commentBox.classList.add('dplayer-comment-box-open');\n mask.classList.add('dplayer-mask-show');\n _this.element.classList.add('dplayer-show-controller');\n\n disableHide = setInterval(function () {\n clearTimeout(hideTime);\n }, 1000);\n commentFocusTimeout = setTimeout(function () {\n commentInput.focus();\n }, 300);\n };\n\n mask.addEventListener('click', function () {\n closeComment();\n });\n commentIcon.addEventListener('click', function () {\n openComment();\n });\n commentSettingIcon.addEventListener('click', function () {\n toggleCommentSetting();\n });\n\n // comment setting box\n this.element.getElementsByClassName('dplayer-comment-setting-color')[0].addEventListener('click', function () {\n var sele = _this.element.querySelector('input[name=\"dplayer-danmaku-color-${index}\"]:checked+span');\n if (sele) {\n commentSettingIcon.getElementsByClassName('dplayer-fill')[0].style.fill = _this.element.querySelector('input[name=\"dplayer-danmaku-color-${index}\"]:checked').value;\n }\n });\n\n commentInput.addEventListener('click', function () {\n closeCommentSetting();\n });\n commentInput.addEventListener('keydown', function (e) {\n var event = e || window.event;\n if (event.keyCode === 13) {\n sendComment();\n }\n });\n\n commentSendIcon.addEventListener('click', sendComment);\n\n /**\n * full screen\n */\n var resetAnimation = function resetAnimation() {\n var danWidth = danContainer.offsetWidth;\n var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i6 = 0; _i6 < items.length; _i6++) {\n items[_i6].style.transform = 'translateX(-' + danWidth + 'px)';\n }\n };\n\n this.element.addEventListener('fullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('mozfullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('webkitfullscreenchange', function () {\n resetAnimation();\n });\n // browser full screen\n this.element.getElementsByClassName('dplayer-full-icon')[0].addEventListener('click', function () {\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) {\n if (_this.element.requestFullscreen) {\n _this.element.requestFullscreen();\n } else if (_this.element.mozRequestFullScreen) {\n _this.element.mozRequestFullScreen();\n } else if (_this.element.webkitRequestFullscreen) {\n _this.element.webkitRequestFullscreen();\n } else if (_this.video.attr('webkitEnterFullscreen')) {\n // Safari for iOS\n _this.video.current.webkitEnterFullscreen();\n }\n } else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n resetAnimation();\n });\n // web full screen\n this.element.getElementsByClassName('dplayer-full-in-icon')[0].addEventListener('click', function () {\n if (_this.element.classList.contains('dplayer-fulled')) {\n _this.element.classList.remove('dplayer-fulled');\n } else {\n _this.element.classList.add('dplayer-fulled');\n resetAnimation();\n }\n });\n\n /**\n * hot key\n */\n var handleKeyDown = function handleKeyDown(e) {\n var tag = document.activeElement.tagName.toUpperCase();\n var editable = document.activeElement.getAttribute('contenteditable');\n if (tag !== 'INPUT' && tag !== 'TEXTAREA' && editable !== '' && editable !== 'true') {\n var event = e || window.event;\n var percentage = void 0;\n switch (event.keyCode) {\n case 32:\n event.preventDefault();\n _this.toggle();\n break;\n case 37:\n event.preventDefault();\n _this.video.seek(_this.video.currentTime() - 5);\n break;\n case 39:\n event.preventDefault();\n _this.video.seek(_this.video.currentTime() + 5);\n break;\n case 38:\n event.preventDefault();\n percentage = _this.video.attr('volume') + 0.1;\n _this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = _this.video.attr('volume') - 0.1;\n _this.volume(percentage);\n break;\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', function (e) {\n // Press ESC to quit web full screen\n var event = e || window.event;\n switch (event.keyCode) {\n case 27:\n if (_this.element.classList.contains('dplayer-fulled')) {\n _this.element.classList.remove('dplayer-fulled');\n resetAnimation();\n }\n break;\n }\n });\n\n /**\n * right key\n */\n var menu = this.element.getElementsByClassName('dplayer-menu')[0];\n this.element.addEventListener('contextmenu', function (e) {\n var event = e || window.event;\n event.preventDefault();\n\n menu.classList.add('dplayer-menu-show');\n\n var clientRect = _this.element.getBoundingClientRect();\n var menuLeft = event.clientX - clientRect.left;\n var menuTop = event.clientY - clientRect.top;\n if (menuLeft + menu.offsetWidth >= clientRect.width) {\n menu.style.right = clientRect.width - menuLeft + 'px';\n menu.style.left = 'initial';\n } else {\n menu.style.left = event.clientX - _this.element.getBoundingClientRect().left + 'px';\n menu.style.right = 'initial';\n }\n if (menuTop + menu.offsetHeight >= clientRect.height) {\n menu.style.bottom = clientRect.height - menuTop + 'px';\n menu.style.top = 'initial';\n } else {\n menu.style.top = event.clientY - _this.element.getBoundingClientRect().top + 'px';\n menu.style.bottom = 'initial';\n }\n\n mask.classList.add('dplayer-mask-show');\n mask.addEventListener('click', function () {\n mask.classList.remove('dplayer-mask-show');\n menu.classList.remove('dplayer-menu-show');\n });\n });\n\n /**\n * Switch quality\n */\n if (this.option.video.quality) {\n this.element.getElementsByClassName('dplayer-quality-list')[0].addEventListener('click', function (e) {\n if (e.target.classList.contains('dplayer-quality-item')) {\n _this.switchQuality(e.target.dataset.index);\n _this.element.getElementsByClassName('dplayer-quality-icon')[0].innerHTML = _this.option.video.quality[_this.qualityIndex].name;\n }\n });\n }\n\n /**\n * Screenshot\n */\n if (this.option.screenshot) {\n var camareIcon = this.element.getElementsByClassName('dplayer-camera-icon')[0];\n camareIcon.addEventListener('click', function () {\n var canvas = document.createElement(\"canvas\");\n canvas.width = _this.video.attr('videoWidth');\n canvas.height = _this.video.attr('videoHeight');\n canvas.getContext('2d').drawImage(_this.video.current, 0, 0, canvas.width, canvas.height);\n\n camareIcon.href = canvas.toDataURL();\n camareIcon.download = \"DPlayer.png\";\n });\n }\n\n index++;\n }\n\n /**\n * Play music\n */\n\n\n _createClass(DPlayer, [{\n key: 'play',\n value: function play(time) {\n if (Object.prototype.toString.call(time) === '[object Number]') {\n this.video.seek(time);\n }\n this.paused = false;\n if (this.video.attr('paused')) {\n this.bezel.innerHTML = svg('play');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n\n this.playButton.innerHTML = svg('pause');\n\n this.video.play();\n if (this.playedTime) {\n this.clearTime();\n }\n this.setTime();\n this.element.classList.add('dplayer-playing');\n this.trigger('play');\n }\n\n /**\n * Pause music\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n this.element.classList.remove('dplayer-loading');\n\n if (!this.video.attr('paused')) {\n this.bezel.innerHTML = svg('pause');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n\n this.ended = false;\n this.playButton.innerHTML = svg('play');\n this.video.pause();\n this.clearTime();\n this.element.classList.remove('dplayer-playing');\n this.trigger('pause');\n }\n\n /**\n * Set volume\n */\n\n }, {\n key: 'volume',\n value: function volume(percentage) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n this.video.attr('volume', percentage);\n if (this.video.attr('muted')) {\n this.video.attr('muted', false);\n }\n this.switchVolumeIcon();\n }\n\n /**\n * Toggle between play and pause\n */\n\n }, {\n key: 'toggle',\n value: function toggle() {\n if (this.video.attr('paused')) {\n this.play();\n } else {\n this.pause();\n }\n }\n\n /**\n * attach event\n */\n\n }, {\n key: 'on',\n value: function on(event, callback) {\n if (typeof callback === 'function') {\n this.event[event].push(callback);\n }\n }\n\n /**\n * Asynchronously read danmaku from all API endpoints\n */\n\n }, {\n key: '_readAllEndpoints',\n value: function _readAllEndpoints(endpoints, finish) {\n var _this2 = this;\n\n var results = [];\n var readCount = 0;\n var cbk = function cbk(i) {\n return function (err, data) {\n ++readCount;\n if (err) {\n if (err.response) {\n _this2.notice(err.response.msg);\n } else {\n _this2.notice('Request was unsuccessful: ' + err.status);\n }\n results[i] = [];\n } else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return finish(results);\n }\n };\n };\n\n for (var i = 0; i < endpoints.length; ++i) {\n this.option.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n\n /**\n * Read danmaku from API\n */\n\n }, {\n key: 'readDanmaku',\n value: function readDanmaku() {\n var _this3 = this;\n\n var isMobile = /mobile/i.test(window.navigator.userAgent);\n var apiurl = void 0;\n if (this.option.danmaku.maximum) {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id + '&max=' + this.option.danmaku.maximum;\n } else {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id;\n }\n var endpoints = (this.option.danmaku.addition || []).slice(0);\n endpoints.push(apiurl);\n\n this._readAllEndpoints(endpoints, function (results) {\n _this3.danIndex = 0;\n _this3.dan = [].concat.apply([], results).sort(function (a, b) {\n return a.time - b.time;\n });\n _this3.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n\n // autoplay\n if (_this3.option.autoplay && !isMobile) {\n _this3.play();\n } else if (isMobile) {\n _this3.pause();\n }\n });\n }\n\n /**\n * Push a danmaku into DPlayer\n *\n * @param {String} text - danmaku content\n * @param {String} color - danmaku color, default: `#fff`\n * @param {String} type - danmaku type, `right` `top` `bottom`, default: `right`\n */\n\n }, {\n key: 'pushDanmaku',\n value: function pushDanmaku(text, color, type) {\n var _this4 = this;\n\n var danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n var itemHeight = this.arrow ? 24 : 30;\n var danWidth = danContainer.offsetWidth;\n var danHeight = danContainer.offsetHeight;\n var itemY = parseInt(danHeight / itemHeight);\n\n var danItemRight = function danItemRight(ele) {\n return danContainer.getBoundingClientRect().right - ele.getBoundingClientRect().right;\n };\n\n var danSpeed = function danSpeed(width) {\n return (danWidth + width) / 5;\n };\n\n var getTunnel = function getTunnel(ele, type, width) {\n var tmp = danWidth / danSpeed(width);\n\n var _loop2 = function _loop2(i) {\n var item = _this4.danTunnel[type][i + ''];\n if (item && item.length) {\n for (var j = 0; j < item.length; j++) {\n var danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(item[j].offsetWidth) || danRight <= 0) {\n break;\n }\n if (j === item.length - 1) {\n _this4.danTunnel[type][i + ''].push(ele);\n ele.addEventListener('animationend', function () {\n _this4.danTunnel[type][i + ''].splice(0, 1);\n });\n return {\n v: i % itemY\n };\n }\n }\n } else {\n _this4.danTunnel[type][i + ''] = [ele];\n ele.addEventListener('animationend', function () {\n _this4.danTunnel[type][i + ''].splice(0, 1);\n });\n return {\n v: i % itemY\n };\n }\n };\n\n for (var i = 0;; i++) {\n var _ret2 = _loop2(i);\n\n if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === \"object\") return _ret2.v;\n }\n };\n\n if (!type) {\n type = 'right';\n }\n if (!color) {\n color = '#fff';\n }\n var item = document.createElement('div');\n item.classList.add('dplayer-danmaku-item');\n item.classList.add('dplayer-danmaku-' + type);\n item.innerHTML = text;\n item.style.opacity = this.danOpacity;\n item.style.color = color;\n item.addEventListener('animationend', function () {\n danContainer.removeChild(item);\n });\n\n // measure\n this.itemDemo.innerHTML = text;\n var itemWidth = this.itemDemo.offsetWidth;\n\n // adjust\n switch (type) {\n case 'right':\n item.style.top = itemHeight * getTunnel(item, type, itemWidth) + 'px';\n item.style.width = itemWidth + 1 + 'px';\n item.style.transform = 'translateX(-' + danWidth + 'px)';\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, type) + 'px';\n break;\n default:\n console.error('Can\\'t handled danmaku type: ' + type);\n }\n\n // insert\n danContainer.appendChild(item);\n\n // move\n item.classList.add('dplayer-danmaku-move');\n\n return item;\n }\n\n /**\n * Switch to a new video\n *\n * @param {Object} video - new video info\n * @param {Object} danmaku - new danmaku info\n */\n // TODO\n\n }, {\n key: 'switchVideo',\n value: function switchVideo(video, danmaku) {\n this.video.src = video.url;\n this.video.poster = video.pic ? video.pic : '';\n this.video.currentTime = 0;\n this.pause();\n if (danmaku) {\n this.dan = [];\n this.danIndex = 0;\n this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'block';\n this.updateBar('played', 0, 'width');\n this.updateBar('loaded', 0, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = '00:00';\n this.element.getElementsByClassName('dplayer-danmaku')[0].innerHTML = '';\n this.danTuel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.itemDemo = this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n this.option.danmaku = danmaku;\n this.readDanmaku();\n }\n }\n }, {\n key: 'initVideo',\n value: function initVideo() {\n var _this5 = this;\n\n // Support HTTP Live Streaming\n var enablehls = void 0;\n if (this.option.video.type === 'auto') {\n enablehls = /m3u8(#|\\?|$)/i.exec(this.option.video.url);\n } else if (this.option.video.type === 'hls') {\n enablehls = true;\n } else {\n enablehls = false;\n }\n if (enablehls && Hls.isSupported()) {\n // this.element.getElementsByClassName('dplayer-time')[0].style.display = 'none';\n var hls = new Hls();\n hls.attachMedia(this.video.current);\n hls.on(Hls.Events.MEDIA_ATTACHED, function () {\n hls.loadSource(_this5.option.video.url);\n hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {\n this.notice(\"manifest loaded, found \" + data.levels.length + \" quality level\");\n });\n });\n }\n\n // Support FLV\n var enableflv = void 0;\n if (this.option.video.type === 'auto') {\n enableflv = /.flv(#|\\?|$)/i.exec(this.option.video.url);\n } else if (this.option.video.type === 'flv') {\n enableflv = true;\n } else {\n enableflv = false;\n }\n if (enableflv && flvjs.isSupported()) {\n var flvPlayer = flvjs.createPlayer({\n type: 'flv',\n url: this.option.video.url\n });\n flvPlayer.attachMediaElement(this.video.current);\n flvPlayer.load();\n }\n\n if (this.option.danmaku) {\n this.video.on('all', 'seeking', function () {\n for (var i = 0; i < _this5.dan.length; i++) {\n if (_this5.dan[i].time >= _this5.video.currentTime()) {\n _this5.danIndex = i;\n return;\n }\n _this5.danIndex = _this5.dan.length;\n }\n });\n }\n\n /**\n * video events\n */\n // show video time: the metadata has loaded or changed\n this.video.on('all', 'durationchange', function (i, video) {\n if (video.duration !== 1) {\n // compatibility: Android browsers will output 1 at first\n _this5.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = utils.secondToTime(_this5.video.duration);\n }\n });\n\n // show video loaded bar: to inform interested parties of progress downloading the media\n this.video.on('current', 'progress', function (i, video) {\n var percentage = video.buffered.length ? video.buffered.end(video.buffered.length - 1) / video.duration : 0;\n _this5.updateBar('loaded', percentage, 'width');\n });\n\n // video download error: an error occurs\n this.video.on('all', 'error', function () {\n _this5.notice(_this5.tran('This video fails to load'), -1);\n _this5.trigger('pause');\n });\n\n // video can play: enough data is available that the media can be played\n this.video.on('current', 'canplay', function () {\n _this5.trigger('canplay');\n });\n\n // music end\n this.ended = false;\n this.video.on('all', 'ended', function (i) {\n if (i === _this5.video.videos.length - 1) {\n _this5.updateBar('played', 1, 'width');\n if (!_this5.loop) {\n _this5.ended = true;\n _this5.pause();\n _this5.trigger('ended');\n } else {\n _this5.video.switch(0);\n _this5.video.play();\n }\n }\n });\n\n this.video.on('current', 'play', function () {\n if (_this5.paused) {\n _this5.play();\n }\n });\n\n this.video.on('current', 'pause', function () {\n if (!_this5.paused) {\n _this5.pause();\n }\n });\n\n // control volume\n this.video.attr('volume', parseInt(this.element.getElementsByClassName('dplayer-volume-bar-inner')[0].style.width) / 100);\n }\n }, {\n key: 'switchQuality',\n value: function switchQuality(index) {\n var _this6 = this;\n\n if (this.qualityIndex === index || this.switchingQuality) {\n return;\n } else {\n this.qualityIndex = index;\n }\n this.switchingQuality = true;\n this.video.pause();\n this.quality = this.option.video.quality[index];\n var videoHTML = html.video(false, null, this.option.screenshot, 'auto', this.quality.url);\n var videoEle = new DOMParser().parseFromString(videoHTML, 'text/html').body.firstChild;\n var parent = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n parent.prepend(videoEle);\n this.prevVideo = this.video;\n this.video = new Video([videoEle], this.prevVideo.duration);\n this.initVideo();\n this.video.seek(this.prevVideo.currentTime());\n this.notice(this.tran('Switching to') + ' ' + this.quality.name + ' ' + this.tran('quality'), -1);\n this.video.on('current', 'canplay', function () {\n if (_this6.prevVideo) {\n if (_this6.video.currentTime() !== _this6.prevVideo.currentTime()) {\n _this6.video.seek(_this6.prevVideo.currentTime());\n return;\n }\n parent.removeChild(_this6.prevVideo.current);\n _this6.video.current.classList.add('dplayer-video-current');\n _this6.video.play();\n _this6.prevVideo = null;\n _this6.notice(_this6.tran('Switched to') + ' ' + _this6.quality.name + ' ' + _this6.tran('quality'));\n _this6.switchingQuality = false;\n }\n });\n }\n }, {\n key: 'timeTipsHandler',\n value: function timeTipsHandler(pbar, timeTips) {\n var _this7 = this;\n\n // http://stackoverflow.com/questions/1480133/how-can-i-get-an-objects-absolute-position-on-the-page-in-javascript\n var cumulativeOffset = function cumulativeOffset(element) {\n var top = 0,\n left = 0;\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n\n return {\n top: top,\n left: left\n };\n };\n\n return function (e) {\n if (!_this7.video.duration) {\n return;\n }\n var clientX = e.clientX;\n\n var px = cumulativeOffset(pbar).left;\n var tx = clientX - px;\n timeTips.innerText = utils.secondToTime(_this7.video.duration * (tx / pbar.offsetWidth));\n timeTips.style.left = tx - 20 + 'px';\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n if (_this7.isTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n _this7.isTipsShow = true;\n break;\n case 'mouseleave':\n case 'mouseout':\n if (!_this7.isTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n _this7.isTipsShow = false;\n break;\n }\n };\n }\n }, {\n key: 'notice',\n value: function notice(text, time) {\n var noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = 1;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n if (time && time < 0) {\n return;\n }\n this.noticeTime = setTimeout(function () {\n noticeEle.style.opacity = 0;\n }, time || 2000);\n }\n }]);\n\n return DPlayer;\n}();\n\nmodule.exports = DPlayer;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/*\n * xhr.status ---> fail\n * response.code === 1 ---> success\n * response.code !== 1 ---> error\n * */\n\nvar SendXMLHttpRequest = function SendXMLHttpRequest(url, data, success, error, fail) {\n var xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {\n var response = JSON.parse(xhr.responseText);\n\n if (response.code !== 1) {\n return error(xhr, response);\n }\n\n return success(xhr, response);\n }\n\n fail(xhr);\n }\n };\n\n xhr.open(data !== null ? 'POST' : 'GET', url, true);\n xhr.send(data !== null ? JSON.stringify(data) : null);\n};\n\nmodule.exports = {\n send: function send(endpoint, danmakuData) {\n SendXMLHttpRequest(endpoint, danmakuData, function (xhr, response) {\n console.log('Post danmaku: ', response);\n }, function (xhr, response) {\n alert(response.msg);\n }, function (xhr) {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n\n read: function read(endpoint, cbk) {\n SendXMLHttpRequest(endpoint, null, function (xhr, response) {\n cbk(null, response.danmaku);\n }, function (xhr, response) {\n cbk({ status: xhr.status, response: response });\n }, function (xhr) {\n cbk({ status: xhr.status, response: null });\n });\n }\n};\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// DPlayer.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\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, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0b494e2b37c87d63a439","/**\n* SVG used by DPlayer\n*/\n\nconst svgSource = {\n 'play': ['0 0 16 32', 'M15.552 15.168q0.448 0.32 0.448 0.832 0 0.448-0.448 0.768l-13.696 8.512q-0.768 0.512-1.312 0.192t-0.544-1.28v-16.448q0-0.96 0.544-1.28t1.312 0.192z'],\n 'pause': ['0 0 17 32', 'M14.080 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048zM2.88 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048z'],\n 'volume-up': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528zM25.152 16q0 2.72-1.536 5.056t-4 3.36q-0.256 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.704 0.672-1.056 1.024-0.512 1.376-0.8 1.312-0.96 2.048-2.4t0.736-3.104-0.736-3.104-2.048-2.4q-0.352-0.288-1.376-0.8-0.672-0.352-0.672-1.056 0-0.448 0.32-0.8t0.8-0.352q0.224 0 0.48 0.096 2.496 1.056 4 3.36t1.536 5.056zM29.728 16q0 4.096-2.272 7.552t-6.048 5.056q-0.224 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.64 0.704-1.056 0.128-0.064 0.384-0.192t0.416-0.192q0.8-0.448 1.44-0.896 2.208-1.632 3.456-4.064t1.216-5.152-1.216-5.152-3.456-4.064q-0.64-0.448-1.44-0.896-0.128-0.096-0.416-0.192t-0.384-0.192q-0.704-0.416-0.704-1.056 0-0.448 0.32-0.8t0.832-0.352q0.224 0 0.448 0.096 3.776 1.632 6.048 5.056t2.272 7.552z'],\n 'volume-down': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528z'],\n 'volume-off': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8z'],\n 'loop': ['0 0 32 32', 'M1.882 16.941c0 4.152 3.221 7.529 7.177 7.529v1.882c-4.996 0-9.060-4.222-9.060-9.412s4.064-9.412 9.060-9.412h7.96l-3.098-3.098 1.331-1.331 5.372 5.37-5.37 5.372-1.333-1.333 3.1-3.098h-7.962c-3.957 0-7.177 3.377-7.177 7.529zM22.94 7.529v1.882c3.957 0 7.177 3.377 7.177 7.529s-3.221 7.529-7.177 7.529h-7.962l3.098-3.098-1.331-1.331-5.37 5.37 5.372 5.372 1.331-1.331-3.1-3.1h7.96c4.998 0 9.062-4.222 9.062-9.412s-4.064-9.412-9.060-9.412z'],\n 'full': ['0 0 32 33', 'M6.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v4h4c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333zM30.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h4v-4c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM30.667 12c-0.8 0-1.333-0.533-1.333-1.333v-4h-4c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM1.333 12c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-4v4c0 0.8-0.533 1.333-1.333 1.333z'],\n 'full-in': ['0 0 32 33', 'M24.965 24.38h-18.132c-1.366 0-2.478-1.113-2.478-2.478v-11.806c0-1.364 1.111-2.478 2.478-2.478h18.132c1.366 0 2.478 1.113 2.478 2.478v11.806c0 1.364-1.11 2.478-2.478 2.478zM6.833 10.097v11.806h18.134l-0.002-11.806h-18.132zM2.478 28.928h5.952c0.684 0 1.238-0.554 1.238-1.239 0-0.684-0.554-1.238-1.238-1.238h-5.952v-5.802c0-0.684-0.554-1.239-1.238-1.239s-1.239 0.556-1.239 1.239v5.802c0 1.365 1.111 2.478 2.478 2.478zM30.761 19.412c-0.684 0-1.238 0.554-1.238 1.238v5.801h-5.951c-0.686 0-1.239 0.554-1.239 1.238 0 0.686 0.554 1.239 1.239 1.239h5.951c1.366 0 2.478-1.111 2.478-2.478v-5.801c0-0.683-0.554-1.238-1.239-1.238zM0 5.55v5.802c0 0.683 0.554 1.238 1.238 1.238s1.238-0.555 1.238-1.238v-5.802h5.952c0.684 0 1.238-0.554 1.238-1.238s-0.554-1.238-1.238-1.238h-5.951c-1.366-0.001-2.478 1.111-2.478 2.476zM32 11.35v-5.801c0-1.365-1.11-2.478-2.478-2.478h-5.951c-0.686 0-1.239 0.554-1.239 1.238s0.554 1.238 1.239 1.238h5.951v5.801c0 0.683 0.554 1.237 1.238 1.237 0.686 0.002 1.239-0.553 1.239-1.236z'],\n 'setting': ['0 0 32 28', 'M28.633 17.104c0.035 0.21 0.026 0.463-0.026 0.76s-0.14 0.598-0.262 0.904c-0.122 0.306-0.271 0.581-0.445 0.825s-0.367 0.419-0.576 0.524c-0.209 0.105-0.393 0.157-0.55 0.157s-0.332-0.035-0.524-0.105c-0.175-0.052-0.393-0.1-0.655-0.144s-0.528-0.052-0.799-0.026c-0.271 0.026-0.541 0.083-0.812 0.17s-0.502 0.236-0.694 0.445c-0.419 0.437-0.664 0.934-0.734 1.493s0.009 1.092 0.236 1.598c0.175 0.349 0.148 0.699-0.079 1.048-0.105 0.14-0.271 0.284-0.498 0.432s-0.476 0.284-0.747 0.406-0.555 0.218-0.851 0.288c-0.297 0.070-0.559 0.105-0.786 0.105-0.157 0-0.306-0.061-0.445-0.183s-0.236-0.253-0.288-0.393h-0.026c-0.192-0.541-0.52-1.009-0.982-1.402s-1-0.589-1.611-0.589c-0.594 0-1.131 0.197-1.611 0.589s-0.816 0.851-1.009 1.375c-0.087 0.21-0.218 0.362-0.393 0.458s-0.367 0.144-0.576 0.144c-0.244 0-0.52-0.044-0.825-0.131s-0.611-0.197-0.917-0.327c-0.306-0.131-0.581-0.284-0.825-0.458s-0.428-0.349-0.55-0.524c-0.087-0.122-0.135-0.266-0.144-0.432s0.057-0.397 0.197-0.694c0.192-0.402 0.266-0.86 0.223-1.375s-0.266-0.991-0.668-1.428c-0.244-0.262-0.541-0.432-0.891-0.511s-0.681-0.109-0.995-0.092c-0.367 0.017-0.742 0.087-1.127 0.21-0.244 0.070-0.489 0.052-0.734-0.052-0.192-0.070-0.371-0.231-0.537-0.485s-0.314-0.533-0.445-0.838c-0.131-0.306-0.231-0.62-0.301-0.943s-0.087-0.59-0.052-0.799c0.052-0.384 0.227-0.629 0.524-0.734 0.524-0.21 0.995-0.555 1.415-1.035s0.629-1.017 0.629-1.611c0-0.611-0.21-1.144-0.629-1.598s-0.891-0.786-1.415-0.996c-0.157-0.052-0.288-0.179-0.393-0.38s-0.157-0.406-0.157-0.616c0-0.227 0.035-0.48 0.105-0.76s0.162-0.55 0.275-0.812 0.244-0.502 0.393-0.72c0.148-0.218 0.31-0.38 0.485-0.485 0.14-0.087 0.275-0.122 0.406-0.105s0.275 0.052 0.432 0.105c0.524 0.21 1.070 0.275 1.637 0.197s1.070-0.327 1.506-0.747c0.21-0.209 0.362-0.467 0.458-0.773s0.157-0.607 0.183-0.904c0.026-0.297 0.026-0.568 0-0.812s-0.048-0.419-0.065-0.524c-0.035-0.105-0.066-0.227-0.092-0.367s-0.013-0.262 0.039-0.367c0.105-0.244 0.293-0.458 0.563-0.642s0.563-0.336 0.878-0.458c0.314-0.122 0.62-0.214 0.917-0.275s0.533-0.092 0.707-0.092c0.227 0 0.406 0.074 0.537 0.223s0.223 0.301 0.275 0.458c0.192 0.471 0.507 0.886 0.943 1.244s0.952 0.537 1.546 0.537c0.611 0 1.153-0.17 1.624-0.511s0.803-0.773 0.996-1.297c0.070-0.14 0.179-0.284 0.327-0.432s0.301-0.223 0.458-0.223c0.244 0 0.511 0.035 0.799 0.105s0.572 0.166 0.851 0.288c0.279 0.122 0.537 0.279 0.773 0.472s0.423 0.402 0.563 0.629c0.087 0.14 0.113 0.293 0.079 0.458s-0.070 0.284-0.105 0.354c-0.227 0.506-0.297 1.039-0.21 1.598s0.341 1.048 0.76 1.467c0.419 0.419 0.934 0.651 1.546 0.694s1.179-0.057 1.703-0.301c0.14-0.087 0.31-0.122 0.511-0.105s0.371 0.096 0.511 0.236c0.262 0.244 0.493 0.616 0.694 1.113s0.336 1 0.406 1.506c0.035 0.297-0.013 0.528-0.144 0.694s-0.266 0.275-0.406 0.327c-0.542 0.192-1.004 0.528-1.388 1.009s-0.576 1.026-0.576 1.637c0 0.594 0.162 1.113 0.485 1.559s0.747 0.764 1.27 0.956c0.122 0.070 0.227 0.14 0.314 0.21 0.192 0.157 0.323 0.358 0.393 0.602v0zM16.451 19.462c0.786 0 1.528-0.149 2.227-0.445s1.305-0.707 1.821-1.231c0.515-0.524 0.921-1.131 1.218-1.821s0.445-1.428 0.445-2.214c0-0.786-0.148-1.524-0.445-2.214s-0.703-1.292-1.218-1.808c-0.515-0.515-1.122-0.921-1.821-1.218s-1.441-0.445-2.227-0.445c-0.786 0-1.524 0.148-2.214 0.445s-1.292 0.703-1.808 1.218c-0.515 0.515-0.921 1.118-1.218 1.808s-0.445 1.428-0.445 2.214c0 0.786 0.149 1.524 0.445 2.214s0.703 1.297 1.218 1.821c0.515 0.524 1.118 0.934 1.808 1.231s1.428 0.445 2.214 0.445v0z'],\n 'right': ['0 0 32 32', 'M22 16l-10.105-10.6-1.895 1.987 8.211 8.613-8.211 8.612 1.895 1.988 8.211-8.613z'],\n 'comment': ['0 0 32 32', 'M27.128 0.38h-22.553c-2.336 0-4.229 1.825-4.229 4.076v16.273c0 2.251 1.893 4.076 4.229 4.076h4.229v-2.685h8.403l-8.784 8.072 1.566 1.44 7.429-6.827h9.71c2.335 0 4.229-1.825 4.229-4.076v-16.273c0-2.252-1.894-4.076-4.229-4.076zM28.538 19.403c0 1.5-1.262 2.717-2.819 2.717h-8.36l-0.076-0.070-0.076 0.070h-11.223c-1.557 0-2.819-1.217-2.819-2.717v-13.589c0-1.501 1.262-2.718 2.819-2.718h19.734c1.557 0 2.819-0.141 2.819 1.359v14.947zM9.206 10.557c-1.222 0-2.215 0.911-2.215 2.036s0.992 2.035 2.215 2.035c1.224 0 2.216-0.911 2.216-2.035s-0.992-2.036-2.216-2.036zM22.496 10.557c-1.224 0-2.215 0.911-2.215 2.036s0.991 2.035 2.215 2.035c1.224 0 2.215-0.911 2.215-2.035s-0.991-2.036-2.215-2.036zM15.852 10.557c-1.224 0-2.215 0.911-2.215 2.036s0.991 2.035 2.215 2.035c1.222 0 2.215-0.911 2.215-2.035s-0.992-2.036-2.215-2.036z'],\n 'comment-off': ['0 0 32 32', 'M27.090 0.131h-22.731c-2.354 0-4.262 1.839-4.262 4.109v16.401c0 2.269 1.908 4.109 4.262 4.109h4.262v-2.706h8.469l-8.853 8.135 1.579 1.451 7.487-6.88h9.787c2.353 0 4.262-1.84 4.262-4.109v-16.401c0-2.27-1.909-4.109-4.262-4.109v0zM28.511 19.304c0 1.512-1.272 2.738-2.841 2.738h-8.425l-0.076-0.070-0.076 0.070h-11.311c-1.569 0-2.841-1.226-2.841-2.738v-13.696c0-1.513 1.272-2.739 2.841-2.739h19.889c1.569 0 2.841-0.142 2.841 1.37v15.064z'],\n 'send': ['0 0 32 32', 'M13.725 30l3.9-5.325-3.9-1.125v6.45zM0 17.5l11.050 3.35 13.6-11.55-10.55 12.425 11.8 3.65 6.1-23.375-32 15.5z'],\n 'menu': ['0 0 22 32', 'M20.8 14.4q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2zM1.6 11.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2zM20.8 20.8q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2z'],\n 'camera': ['0 0 32 32', 'M16 23c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6zM16 13c-2.206 0-4 1.794-4 4s1.794 4 4 4c2.206 0 4-1.794 4-4s-1.794-4-4-4zM27 28h-22c-1.654 0-3-1.346-3-3v-16c0-1.654 1.346-3 3-3h3c0.552 0 1 0.448 1 1s-0.448 1-1 1h-3c-0.551 0-1 0.449-1 1v16c0 0.552 0.449 1 1 1h22c0.552 0 1-0.448 1-1v-16c0-0.551-0.448-1-1-1h-11c-0.552 0-1-0.448-1-1s0.448-1 1-1h11c1.654 0 3 1.346 3 3v16c0 1.654-1.346 3-3 3zM24 10.5c0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5zM15 4c0 0.552-0.448 1-1 1h-4c-0.552 0-1-0.448-1-1v0c0-0.552 0.448-1 1-1h4c0.552 0 1 0.448 1 1v0z']\n};\n\nmodule.exports = (type) => `\n \n \n \n \n`;\n\n\n// WEBPACK FOOTER //\n// ./src/svg.js","const svg = require('./svg.js');\n\nconst html = {\n main: (option, index, tran) => {\n let videos = ``;\n for (let i = 0; i < option.video.url.length; i++) {\n videos += html.video(i === 0, option.video.pic, option.screenshot, option.video.url.length ? 'metadata' : option.preload, option.video.url[i]);\n }\n return `\n \n \n ${videos}\n ${option.logo ? `\n
\n ` : ``}\n
\n
\n \n ${option.danmaku ? `${tran('Danmaku is loading')}` : ``}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n
\n
\n
\n
\n
\n
\n
0:00 / 0:00\n
\n
\n ${option.video.quality ? `\n
\n
\n
\n ${html.qualityList(option.video.quality)}\n
\n
\n ` : ``}\n ${option.screenshot ? `\n
\n ${svg('camera')}\n \n ` : ``}\n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n ${html.contextmenuList(option.contextmenu)}\n `;\n },\n\n contextmenuList: (contextmenu) => {\n let result = '';\n\n return result;\n },\n\n qualityList: (quality) => {\n let result = '';\n for (let i = 0; i < quality.length; i++) {\n result += `
${quality[i].name}
`;\n }\n result += '
';\n\n return result;\n },\n\n video: (current, pic, screenshot, preload, url) => ``,\n\n setting: (tran) => ({\n 'original': `\n \n
${tran('Speed')}\n
\n ${svg('right')}\n
\n
\n \n
${tran('Loop')}\n
\n \n \n
\n
\n \n
${tran('Danmaku')}\n
\n \n \n
\n
\n \n
${tran('Opacity for danmaku')}\n
\n
`,\n 'speed': `\n \n 0.5\n
\n \n 0.75\n
\n \n ${tran('Normal')}\n
\n \n 1.25\n
\n \n 1.5\n
\n \n 2\n
`\n }) \n};\n\nmodule.exports = html;\n\n\n// WEBPACK FOOTER //\n// ./src/html.js","const tranZH = {\n 'Danmaku is loading': '弹幕加载中',\n 'Top': '顶部',\n 'Bottom': '底部',\n 'Rolling': '滚动',\n 'Input danmaku, hit Enter': '输入弹幕,回车发送',\n 'About author': '关于作者',\n 'DPlayer feedback': '播放器意见反馈',\n 'About DPlayer': '关于 DPlayer 播放器',\n 'Loop': '洗脑循环',\n 'Speed': '速度',\n 'Opacity for danmaku': '弹幕透明度',\n 'Normal': '正常',\n 'Please input danmaku content!': '要输入弹幕内容啊喂!',\n 'Set danmaku color': '设置弹幕颜色',\n 'Set danmaku type': '设置弹幕类型',\n 'Danmaku': '弹幕',\n 'This video fails to load': '视频加载失败',\n 'Switching to': '正在切换至',\n 'Switched to': '已经切换至',\n 'quality': '画质',\n};\n\nmodule.exports = function (lang) {\n this.lang = lang;\n this.tran = (text) => {\n if (this.lang === 'en') {\n return text;\n }\n else if (this.lang === 'zh') {\n return tranZH[text];\n }\n };\n};\n\n\n// WEBPACK FOOTER //\n// ./src/i18n.js","const defaultApiBackend = require('./api.js');\n\nmodule.exports = (option) => {\n const isMobile = /mobile/i.test(window.navigator.userAgent);\n // compatibility: some mobile browsers don't suppose autoplay\n if (isMobile) {\n option.autoplay = false;\n }\n\n // default options\n const defaultOption = {\n element: document.getElementsByClassName('dplayer')[0],\n autoplay: false,\n theme: '#b7daff',\n loop: false,\n lang: navigator.language.indexOf('zh') !== -1 ? 'zh' : 'en',\n screenshot: false,\n hotkey: true,\n preload: 'auto',\n apiBackend: defaultApiBackend,\n contextmenu: [\n {\n text: '关于作者',\n link: 'http://diygod.me'\n },\n {\n text: '播放器意见反馈',\n link: 'https://github.com/DIYgod/DPlayer/issues'\n },\n {\n text: '关于 DPlayer 播放器',\n link: 'https://github.com/DIYgod/DPlayer'\n }\n ]\n };\n for (const defaultKey in defaultOption) {\n if (defaultOption.hasOwnProperty(defaultKey) && !option.hasOwnProperty(defaultKey)) {\n option[defaultKey] = defaultOption[defaultKey];\n }\n }\n if (Object.prototype.toString.call(option.video.url) !== '[object Array]') {\n option.video.url = [option.video.url];\n }\n if (option.video && !option.video.hasOwnProperty('type')) {\n option.video.type = 'auto';\n }\n if (option.danmaku && !option.danmaku.hasOwnProperty('user')) {\n option.danmaku.user = 'DIYgod';\n }\n\n if (option.video.quality) {\n option.video.url = [option.video.quality[option.video.defaultQuality].url];\n }\n\n return option;\n};\n\n\n// WEBPACK FOOTER //\n// ./src/option.js","module.exports = {\n\n /**\n * Parse second to 00:00 format\n *\n * @param {Number} second\n * @return {String} 00:00 format\n */\n secondToTime: (second) => {\n const add0 = (num) => num < 10 ? '0' + num : '' + num;\n const min = parseInt(second / 60);\n const sec = parseInt(second - min * 60);\n return add0(min) + ':' + add0(sec);\n },\n\n /**\n * control play progress\n */\n // get element's view position\n getElementViewLeft: (element) => {\n let actualLeft = element.offsetLeft;\n let current = element.offsetParent;\n const elementScrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft;\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) {\n while (current !== null) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n }\n else {\n while (current !== null && current !== this.element) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n }\n return actualLeft - elementScrollLeft;\n },\n};\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","class Video {\n constructor (videos, duration) {\n this.videos = videos;\n this.multi = this.videos.length > 1;\n this.index = 0;\n this.current = this.videos[this.index];\n\n this.duration = duration || 0;\n this.durationArr = [];\n this.eventAll = [];\n this.eventCurrent = [];\n \n this.on('all', 'durationchange', (i, video) => {\n if (video.duration !== 1) { // some Android browsers will output 1 at first\n this.durationArr[i] = video.duration;\n if (!duration) {\n this.duration = this.durationArr.reduce((sum, cur) => sum + cur); \n }\n }\n });\n this.on('current', 'end', () => {\n this.switch(this.index + 1);\n });\n }\n\n switch (index, time) {\n if (this.index !== index) {\n this.videos[index].classList.add('dplayer-video-current');\n if (!this.current.paused) {\n this.videos[index].play();\n }\n this.current.classList.remove('dplayer-video-current');\n this.current.pause();\n\n this.index = index;\n this.current = this.videos[this.index];\n this.videos[index].currentTime = time ? time : 0;\n }\n else {\n this.videos[index].currentTime = time ? time : 0;\n }\n }\n\n // bind event \n on (type, event, callback) {\n if (typeof callback === 'function') {\n if (type === 'all') {\n if (!this.eventAll[event]) {\n this.eventAll[event] = [];\n }\n this.eventAll[event].push(callback);\n }\n else {\n if (!this.eventCurrent[event]) {\n this.eventCurrent[event] = [];\n }\n this.eventCurrent[event].push(callback);\n }\n\n if (['seeking'].indexOf(event) === -1) {\n for (let i = 0; i < this.videos.length; i++) {\n this.videos[i].addEventListener(event, () => {\n if (type === 'all' || this.videos[i] === this.current) {\n callback(i, this.videos[i]);\n }\n });\n }\n }\n }\n }\n\n // trigger event\n trigger (type, event) {\n const events = type === 'all' ? this.eventAll : this.eventCurrent;\n for (let i = 0; i < events[event].length; i++) {\n events[event][i]();\n }\n }\n\n currentTime () {\n if (this.durationArr.slice(0, this.index).length) {\n return this.durationArr.slice(0, this.index).reduce((sum, cur) => sum + cur) + this.current.currentTime;\n }\n else {\n return this.current.currentTime;\n }\n }\n\n seek (time) {\n time = Math.max(time, 0);\n time = Math.min(time, this.duration);\n console.log(time);\n\n let i = 0;\n let tmptime = 0;\n while (tmptime <= time) {\n tmptime += this.durationArr[i];\n i++;\n }\n\n let currentTime;\n if (this.durationArr.slice(0, this.index).length) {\n currentTime = time - this.durationArr.slice(0, i - 1).reduce((sum, cur) => sum + cur);\n }\n else {\n currentTime = time;\n }\n \n this.switch(i - 1, currentTime);\n\n this.trigger('all', 'seeking');\n }\n\n attr (option, value) {\n if (value !== undefined) {\n for (let i = 0; i < this.videos.length; i++) {\n this.videos[i][option] = value;\n }\n }\n return this.current[option];\n }\n\n play () {\n this.current.play();\n }\n\n pause () {\n this.current.pause();\n }\n\n toggle () {\n this.current.paused ? this.play() : this.pause();\n }\n}\n\nmodule.exports = Video;\n\n\n// WEBPACK FOOTER //\n// ./src/video.js","console.log('\\n %c DPlayer 1.3.0 %c http://dplayer.js.org \\n\\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');\n\nrequire('./DPlayer.scss');\nconst utils = require('./utils.js');\nconst svg = require('./svg.js');\nconst handleOption = require('./option.js');\nconst i18n = require('./i18n.js');\nconst html = require('./html.js');\nconst Video = require('./video.js');\nconst isMobile = /mobile/i.test(window.navigator.userAgent);\n\nlet index = 0;\n\nclass DPlayer {\n \n /**\n * DPlayer constructor function\n *\n * @param {Object} option - See README\n * @constructor\n */\n constructor (option) {\n this.option = handleOption(option);\n\n this.option.element.classList.add('dplayer');\n\n if (this.option.video.quality) {\n this.qualityIndex = this.option.video.defaultQuality;\n this.quality = this.option.video.quality[this.option.video.defaultQuality];\n }\n\n this.tran = new i18n(this.option.lang).tran;\n\n /**\n * Update progress bar, including loading progress bar and play progress bar\n *\n * @param {String} type - Point out which bar it is, should be played loaded or volume\n * @param {Number} percentage\n * @param {String} direction - Point out the direction of this bar, Should be height or width\n */\n this.updateBar = (type, percentage, direction) => {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n bar[type + 'Bar'].style[direction] = percentage * 100 + '%';\n };\n\n // define DPlayer events\n const eventTypes = ['play', 'pause', 'canplay', 'playing', 'ended', 'error'];\n this.event = {};\n for (let i = 0; i < eventTypes.length; i++) {\n this.event[eventTypes[i]] = [];\n }\n this.trigger = (type) => {\n for (let i = 0; i < this.event[type].length; i++) {\n this.event[type][i]();\n }\n };\n\n this.element = this.option.element;\n if (!this.option.danmaku) {\n this.element.classList.add('dplayer-no-danmaku');\n }\n if (isMobile) {\n this.element.classList.add('dplayer-mobile');\n }\n\n this.element.innerHTML = html.main(option, index, this.tran);\n\n // arrow style\n this.arrow = this.element.offsetWidth <= 500;\n if (this.arrow) {\n const arrowStyle = document.createElement('style');\n arrowStyle.innerHTML = `.dplayer .dplayer-danmaku{font-size:18px}`;\n document.head.appendChild(arrowStyle);\n }\n\n // get this video manager\n this.video = new Video(this.element.getElementsByClassName('dplayer-video-current'));\n\n this.initVideo();\n\n this.bezel = this.element.getElementsByClassName('dplayer-bezel-icon')[0];\n this.bezel.addEventListener('animationend', () => {\n this.bezel.classList.remove('dplayer-bezel-transition');\n });\n\n // play and pause button\n this.playButton = this.element.getElementsByClassName('dplayer-play-icon')[0];\n this.paused = true;\n this.playButton.addEventListener('click', () => {\n this.toggle();\n });\n\n const videoWrap = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n const conMask = this.element.getElementsByClassName('dplayer-controller-mask')[0];\n if (!isMobile) {\n videoWrap.addEventListener('click', () => {\n this.toggle();\n });\n conMask.addEventListener('click', () => {\n this.toggle();\n });\n }\n else {\n const toggleController = () => {\n if (this.element.classList.contains('dplayer-hide-controller')) {\n this.element.classList.remove('dplayer-hide-controller');\n }\n else {\n this.element.classList.add('dplayer-hide-controller');\n }\n };\n videoWrap.addEventListener('click', toggleController);\n conMask.addEventListener('click', toggleController);\n }\n\n const bar = {};\n bar.playedBar = this.element.getElementsByClassName('dplayer-played')[0];\n bar.loadedBar = this.element.getElementsByClassName('dplayer-loaded')[0];\n const pbar = this.element.getElementsByClassName('dplayer-bar-wrap')[0];\n const pbarTimeTips = this.element.getElementsByClassName('dplayer-bar-time')[0];\n let barWidth;\n\n let lastPlayPos = 0;\n let currentPlayPos = 0;\n let bufferingDetected = false;\n let danmakuTime;\n this.setTime = () => {\n this.playedTime = setInterval(() => {\n // whether the video is buffering\n currentPlayPos = this.video.currentTime();\n if (!bufferingDetected\n && currentPlayPos < lastPlayPos + 0.01\n && !this.video.attr('paused')) {\n this.element.classList.add('dplayer-loading');\n bufferingDetected = true;\n }\n if (bufferingDetected\n && currentPlayPos > lastPlayPos + 0.01\n && !this.video.attr('paused')) {\n this.element.classList.remove('dplayer-loading');\n bufferingDetected = false;\n }\n lastPlayPos = currentPlayPos;\n\n this.updateBar('played', this.video.currentTime() / this.video.duration, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = utils.secondToTime(this.video.currentTime());\n this.trigger('playing');\n }, 100);\n if (this.option.danmaku && showdan) {\n danmakuTime = setInterval(() => {\n if (this.dan) {\n let item = this.dan[this.danIndex];\n while (item && this.video.currentTime() > parseFloat(item.time)) {\n this.pushDanmaku(item.text, item.color, item.type);\n item = this.dan[++this.danIndex];\n }\n }\n }, 100);\n }\n };\n this.clearTime = () => {\n clearInterval(this.playedTime);\n if (this.option.danmaku) {\n clearInterval(danmakuTime);\n }\n };\n\n pbar.addEventListener('click', (event) => {\n const e = event || window.event;\n barWidth = pbar.clientWidth;\n let percentage = (e.clientX - utils.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('played', percentage, 'width');\n this.video.seek(parseFloat(bar.playedBar.style.width) / 100 * this.video.duration);\n });\n\n this.isTipsShow = false;\n this.timeTipsHandler = this.timeTipsHandler(\n pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.timeTipsHandler);\n pbar.addEventListener('mouseover', this.timeTipsHandler);\n pbar.addEventListener('mouseenter', this.timeTipsHandler);\n pbar.addEventListener('mouseout', this.timeTipsHandler);\n pbar.addEventListener('mouseleave', this.timeTipsHandler);\n\n const thumbMove = (event) => {\n const e = event || window.event;\n let percentage = (e.clientX - utils.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('played', percentage, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = utils.secondToTime(percentage * this.video.duration);\n };\n\n const thumbUp = () => {\n document.removeEventListener('mouseup', thumbUp);\n document.removeEventListener('mousemove', thumbMove);\n this.video.seek(parseFloat(bar.playedBar.style.width) / 100 * this.video.duration);\n this.setTime();\n };\n\n pbar.addEventListener('mousedown', () => {\n barWidth = pbar.clientWidth;\n this.clearTime();\n document.addEventListener('mousemove', thumbMove);\n document.addEventListener('mouseup', thumbUp);\n });\n\n\n /**\n * control volume\n */\n bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\n const volumeEle = this.element.getElementsByClassName('dplayer-volume')[0];\n const volumeBarWrapWrap = this.element.getElementsByClassName('dplayer-volume-bar-wrap')[0];\n const volumeBarWrap = this.element.getElementsByClassName('dplayer-volume-bar')[0];\n const volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0];\n const vWidth = 35;\n\n this.switchVolumeIcon = () => {\n const volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (this.video.attr('volume') >= 0.8) {\n volumeicon.innerHTML = svg('volume-up');\n }\n else if (this.video.attr('volume') > 0) {\n volumeicon.innerHTML = svg('volume-down');\n }\n else {\n volumeicon.innerHTML = svg('volume-off');\n }\n };\n const volumeMove = (event) => {\n const e = event || window.event;\n const percentage = (e.clientX - utils.getElementViewLeft(volumeBarWrap) - 5.5) / vWidth;\n this.volume(percentage);\n };\n const volumeUp = () => {\n document.removeEventListener('mouseup', volumeUp);\n document.removeEventListener('mousemove', volumeMove);\n volumeEle.classList.remove('dplayer-volume-active');\n };\n\n volumeBarWrapWrap.addEventListener('click', (event) => {\n const e = event || window.event;\n const percentage = (e.clientX - utils.getElementViewLeft(volumeBarWrap) - 5.5) / vWidth;\n this.volume(percentage);\n });\n volumeBarWrapWrap.addEventListener('mousedown', () => {\n document.addEventListener('mousemove', volumeMove);\n document.addEventListener('mouseup', volumeUp);\n volumeEle.classList.add('dplayer-volume-active');\n });\n volumeicon.addEventListener('click', () => {\n if (this.video.attr('muted')) {\n this.video.attr('muted', false);\n this.switchVolumeIcon();\n this.updateBar('volume', this.video.attr('volume'), 'width');\n }\n else {\n this.video.attr('muted', true);\n volumeicon.innerHTML = svg('volume-off');\n this.updateBar('volume', 0, 'width');\n }\n });\n\n\n /**\n * auto hide controller\n */\n let hideTime = 0;\n if (!isMobile) {\n const hideController = () => {\n this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(hideTime);\n hideTime = setTimeout(() => {\n if (this.video.attr('played').length) {\n this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n\n\n /**\n * setting\n */\n this.danOpacity = localStorage.getItem('DPlayer-opacity') || 0.7;\n const settingHTML = html.setting(this.tran);\n\n // toggle setting box\n const settingIcon = this.element.getElementsByClassName('dplayer-setting-icon')[0];\n const settingBox = this.element.getElementsByClassName('dplayer-setting-box')[0];\n const mask = this.element.getElementsByClassName('dplayer-mask')[0];\n settingBox.innerHTML = settingHTML.original;\n\n const closeSetting = () => {\n if (settingBox.classList.contains('dplayer-setting-box-open')) {\n settingBox.classList.remove('dplayer-setting-box-open');\n mask.classList.remove('dplayer-mask-show');\n setTimeout(() => {\n settingBox.classList.remove('dplayer-setting-box-narrow');\n settingBox.innerHTML = settingHTML.original;\n settingEvent();\n }, 300);\n }\n };\n const openSetting = () => {\n settingBox.classList.add('dplayer-setting-box-open');\n mask.classList.add('dplayer-mask-show');\n };\n\n mask.addEventListener('click', () => {\n closeSetting();\n });\n settingIcon.addEventListener('click', () => {\n openSetting();\n });\n\n this.loop = this.option.loop;\n const danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n let showdan = true;\n const settingEvent = () => {\n // loop control\n const loopEle = this.element.getElementsByClassName('dplayer-setting-loop')[0];\n const loopToggle = loopEle.getElementsByClassName('dplayer-toggle-setting-input')[0];\n\n loopToggle.checked = this.loop;\n\n loopEle.addEventListener('click', () => {\n loopToggle.checked = !loopToggle.checked;\n if (loopToggle.checked) {\n this.loop = true;\n }\n else {\n this.loop = false;\n }\n closeSetting();\n });\n\n // show danmaku control\n const showDanEle = this.element.getElementsByClassName('dplayer-setting-showdan')[0];\n const showDanToggle = showDanEle.getElementsByClassName('dplayer-showdan-setting-input')[0];\n\n showDanToggle.checked = showdan;\n\n showDanEle.addEventListener('click', () => {\n showDanToggle.checked = !showDanToggle.checked;\n if (showDanToggle.checked) {\n showdan = true;\n if (this.option.danmaku) {\n for (let i = 0; i < this.dan.length; i++) {\n if (this.dan[i].time >= this.video.currentTime()) {\n this.danIndex = i;\n break;\n }\n this.danIndex = this.dan.length;\n }\n danmakuTime = setInterval(() => {\n let item = this.dan[this.danIndex];\n while (item && this.video.currentTime() >= parseFloat(item.time)) {\n this.pushDanmaku(item.text, item.color, item.type);\n item = this.dan[++this.danIndex];\n }\n }, 0);\n }\n }\n else {\n showdan = false;\n if (this.option.danmaku) {\n clearInterval(danmakuTime);\n danContainer.innerHTML = ``;\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.itemDemo = this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n }\n }\n closeSetting();\n });\n\n // speed control\n const speedEle = this.element.getElementsByClassName('dplayer-setting-speed')[0];\n speedEle.addEventListener('click', () => {\n settingBox.classList.add('dplayer-setting-box-narrow');\n settingBox.innerHTML = settingHTML.speed;\n\n const speedItem = settingBox.getElementsByClassName('dplayer-setting-speed-item');\n for (let i = 0; i < speedItem.length; i++) {\n speedItem[i].addEventListener('click', () => {\n this.video.attr('playbackRate', speedItem[i].dataset.speed);\n closeSetting();\n });\n }\n });\n\n if (this.option.danmaku) {\n // danmaku opacity\n bar.danmakuBar = this.element.getElementsByClassName('dplayer-danmaku-bar-inner')[0];\n const danmakuBarWrapWrap = this.element.getElementsByClassName('dplayer-danmaku-bar-wrap')[0];\n const danmakuBarWrap = this.element.getElementsByClassName('dplayer-danmaku-bar')[0];\n const danmakuSettingBox = this.element.getElementsByClassName('dplayer-setting-danmaku')[0];\n const dWidth = 130;\n this.updateBar('danmaku', this.danOpacity, 'width');\n\n const danmakuMove = (event) => {\n const e = event || window.event;\n let percentage = (e.clientX - utils.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('danmaku', percentage, 'width');\n const items = this.element.getElementsByClassName('dplayer-danmaku-item');\n for (let i = 0; i < items.length; i++) {\n items[i].style.opacity = percentage;\n }\n this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', this.danOpacity);\n };\n const danmakuUp = () => {\n document.removeEventListener('mouseup', danmakuUp);\n document.removeEventListener('mousemove', danmakuMove);\n danmakuSettingBox.classList.remove('dplayer-setting-danmaku-active');\n };\n\n danmakuBarWrapWrap.addEventListener('click', (event) => {\n const e = event || window.event;\n let percentage = (e.clientX - utils.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('danmaku', percentage, 'width');\n const items = this.element.getElementsByClassName('dplayer-danmaku-item');\n for (let i = 0; i < items.length; i++) {\n items[i].style.opacity = percentage;\n }\n this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', this.danOpacity);\n });\n danmakuBarWrapWrap.addEventListener('mousedown', () => {\n document.addEventListener('mousemove', danmakuMove);\n document.addEventListener('mouseup', danmakuUp);\n danmakuSettingBox.classList.add('dplayer-setting-danmaku-active');\n });\n }\n };\n settingEvent();\n\n // set duration time\n if (this.video.duration !== 1) { // compatibility: Android browsers will output 1 at first\n this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = this.video.duration ? utils.secondToTime(this.video.duration) : '00:00';\n }\n\n // danmaku\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.itemDemo = this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n\n if (this.option.danmaku) {\n this.danIndex = 0;\n this.readDanmaku();\n }\n else {\n // autoplay\n if (this.option.autoplay && !isMobile) {\n this.play();\n }\n else if (isMobile) {\n this.pause();\n }\n }\n\n\n /**\n * comment\n */\n const commentInput = this.element.getElementsByClassName('dplayer-comment-input')[0];\n const commentIcon = this.element.getElementsByClassName('dplayer-comment-icon')[0];\n const commentBox = this.element.getElementsByClassName('dplayer-comment-box')[0];\n const commentSettingIcon = this.element.getElementsByClassName('dplayer-comment-setting-icon')[0];\n const commentSettingBox = this.element.getElementsByClassName('dplayer-comment-setting-box')[0];\n const commentSendIcon = this.element.getElementsByClassName('dplayer-send-icon')[0];\n\n const htmlEncode = (str) => str.\n replace(/&/g, \"&\").\n replace(//g, \">\").\n replace(/\"/g, \""\").\n replace(/'/g, \"'\").\n replace(/\\//g, \"/\");\n\n const sendComment = () => {\n commentInput.blur();\n\n // text can't be empty\n if (!commentInput.value.replace(/^\\s+|\\s+$/g, '')) {\n this.notice(this.tran('Please input danmaku content!'));\n return;\n }\n\n const danmakuData = {\n token: this.option.danmaku.token,\n player: this.option.danmaku.id,\n author: this.option.danmaku.user,\n time: this.video.currentTime(),\n text: commentInput.value,\n color: this.element.querySelector('.dplayer-comment-setting-color input:checked').value,\n type: this.element.querySelector('.dplayer-comment-setting-type input:checked').value\n };\n this.option.apiBackend.send(this.option.danmaku.api, danmakuData);\n\n commentInput.value = '';\n closeComment();\n this.dan.splice(this.danIndex, 0, danmakuData);\n this.danIndex++;\n const item = this.pushDanmaku(htmlEncode(danmakuData.text), danmakuData.color, danmakuData.type);\n item.style.border = `2px solid ${this.option.theme}`;\n };\n\n const closeCommentSetting = () => {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n }\n };\n const toggleCommentSetting = () => {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n }\n else {\n commentSettingBox.classList.add('dplayer-comment-setting-open');\n }\n };\n\n let disableHide = 0;\n let commentFocusTimeout = 0;\n const closeComment = () => {\n if (!commentBox.classList.contains('dplayer-comment-box-open')) {\n return;\n }\n\n commentBox.classList.remove('dplayer-comment-box-open');\n mask.classList.remove('dplayer-mask-show');\n this.element.classList.remove('dplayer-show-controller');\n\n clearInterval(disableHide);\n clearTimeout(commentFocusTimeout);\n closeCommentSetting();\n };\n const openComment = () => {\n if (commentBox.classList.contains('dplayer-comment-box-open')) {\n return;\n }\n\n commentBox.classList.add('dplayer-comment-box-open');\n mask.classList.add('dplayer-mask-show');\n this.element.classList.add('dplayer-show-controller');\n\n disableHide = setInterval(() => {\n clearTimeout(hideTime);\n }, 1000);\n commentFocusTimeout = setTimeout(() => {\n commentInput.focus();\n }, 300);\n };\n\n mask.addEventListener('click', () => {\n closeComment();\n });\n commentIcon.addEventListener('click', () => {\n openComment();\n });\n commentSettingIcon.addEventListener('click', () => {\n toggleCommentSetting();\n });\n\n // comment setting box\n this.element.getElementsByClassName('dplayer-comment-setting-color')[0].addEventListener('click', () => {\n const sele = this.element.querySelector('input[name=\"dplayer-danmaku-color-${index}\"]:checked+span');\n if (sele) {\n commentSettingIcon.getElementsByClassName('dplayer-fill')[0].style.fill = this.element.querySelector('input[name=\"dplayer-danmaku-color-${index}\"]:checked').value;\n }\n });\n\n commentInput.addEventListener('click', () => {\n closeCommentSetting();\n });\n commentInput.addEventListener('keydown', (e) => {\n const event = e || window.event;\n if (event.keyCode === 13) {\n sendComment();\n }\n });\n\n commentSendIcon.addEventListener('click', sendComment);\n\n\n /**\n * full screen\n */\n const resetAnimation = () => {\n const danWidth = danContainer.offsetWidth;\n const items = this.element.getElementsByClassName('dplayer-danmaku-item');\n for (let i = 0; i < items.length; i++) {\n items[i].style.transform = `translateX(-${danWidth}px)`;\n }\n };\n\n this.element.addEventListener('fullscreenchange', () => {\n resetAnimation();\n });\n this.element.addEventListener('mozfullscreenchange', () => {\n resetAnimation();\n });\n this.element.addEventListener('webkitfullscreenchange', () => {\n resetAnimation();\n });\n // browser full screen\n this.element.getElementsByClassName('dplayer-full-icon')[0].addEventListener('click', () => {\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) {\n if (this.element.requestFullscreen) {\n this.element.requestFullscreen();\n }\n else if (this.element.mozRequestFullScreen) {\n this.element.mozRequestFullScreen();\n }\n else if (this.element.webkitRequestFullscreen) {\n this.element.webkitRequestFullscreen();\n }\n else if (this.video.attr('webkitEnterFullscreen')) { // Safari for iOS\n this.video.current.webkitEnterFullscreen();\n }\n }\n else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n }\n else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n }\n else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n resetAnimation();\n });\n // web full screen\n this.element.getElementsByClassName('dplayer-full-in-icon')[0].addEventListener('click', () => {\n if (this.element.classList.contains('dplayer-fulled')) {\n this.element.classList.remove('dplayer-fulled');\n }\n else {\n this.element.classList.add('dplayer-fulled');\n resetAnimation();\n }\n });\n\n /**\n * hot key\n */\n const handleKeyDown = (e) => {\n const tag = document.activeElement.tagName.toUpperCase();\n const editable = document.activeElement.getAttribute('contenteditable');\n if (tag !== 'INPUT' && tag !== 'TEXTAREA' && editable !== '' && editable !== 'true') {\n const event = e || window.event;\n let percentage;\n switch (event.keyCode) {\n case 32:\n event.preventDefault();\n this.toggle();\n break;\n case 37:\n event.preventDefault();\n this.video.seek(this.video.currentTime() - 5);\n break;\n case 39:\n event.preventDefault();\n this.video.seek(this.video.currentTime() + 5);\n break;\n case 38:\n event.preventDefault();\n percentage = this.video.attr('volume') + 0.1;\n this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = this.video.attr('volume') - 0.1;\n this.volume(percentage);\n break;\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', (e) => { // Press ESC to quit web full screen\n const event = e || window.event;\n switch (event.keyCode) {\n case 27:\n if (this.element.classList.contains('dplayer-fulled')) {\n this.element.classList.remove('dplayer-fulled');\n resetAnimation();\n }\n break;\n }\n });\n\n /**\n * right key\n */\n const menu = this.element.getElementsByClassName('dplayer-menu')[0];\n this.element.addEventListener('contextmenu', (e) => {\n const event = e || window.event;\n event.preventDefault();\n\n menu.classList.add('dplayer-menu-show');\n\n const clientRect = this.element.getBoundingClientRect();\n const menuLeft = event.clientX - clientRect.left;\n const menuTop = event.clientY - clientRect.top;\n if (menuLeft + menu.offsetWidth >= clientRect.width) {\n menu.style.right = clientRect.width - menuLeft + 'px';\n menu.style.left = 'initial';\n }\n else {\n menu.style.left = event.clientX - this.element.getBoundingClientRect().left + 'px';\n menu.style.right = 'initial';\n }\n if (menuTop + menu.offsetHeight >= clientRect.height) {\n menu.style.bottom = clientRect.height - menuTop + 'px';\n menu.style.top = 'initial';\n }\n else {\n menu.style.top = event.clientY - this.element.getBoundingClientRect().top + 'px';\n menu.style.bottom = 'initial';\n }\n\n mask.classList.add('dplayer-mask-show');\n mask.addEventListener('click', () => {\n mask.classList.remove('dplayer-mask-show');\n menu.classList.remove('dplayer-menu-show');\n });\n });\n\n /**\n * Switch quality\n */\n if (this.option.video.quality) {\n this.element.getElementsByClassName('dplayer-quality-list')[0].addEventListener('click', (e) => {\n if (e.target.classList.contains('dplayer-quality-item')) {\n this.switchQuality(e.target.dataset.index);\n this.element.getElementsByClassName('dplayer-quality-icon')[0].innerHTML = this.option.video.quality[this.qualityIndex].name;\n }\n });\n }\n\n /**\n * Screenshot\n */\n if (this.option.screenshot) {\n const camareIcon = this.element.getElementsByClassName('dplayer-camera-icon')[0];\n camareIcon.addEventListener('click', () => {\n const canvas = document.createElement(\"canvas\");\n canvas.width = this.video.attr('videoWidth');\n canvas.height = this.video.attr('videoHeight');\n canvas.getContext('2d').drawImage(this.video.current, 0, 0, canvas.width, canvas.height);\n\n camareIcon.href = canvas.toDataURL();\n camareIcon.download = \"DPlayer.png\";\n });\n }\n\n index++;\n }\n\n /**\n * Play music\n */\n play (time) {\n if (Object.prototype.toString.call(time) === '[object Number]') {\n this.video.seek(time);\n }\n this.paused = false;\n if (this.video.attr('paused')) {\n this.bezel.innerHTML = svg('play');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n\n this.playButton.innerHTML = svg('pause');\n\n this.video.play();\n if (this.playedTime) {\n this.clearTime();\n }\n this.setTime();\n this.element.classList.add('dplayer-playing');\n this.trigger('play');\n }\n\n /**\n * Pause music\n */\n pause () {\n this.paused = true;\n this.element.classList.remove('dplayer-loading');\n\n if (!this.video.attr('paused')) {\n this.bezel.innerHTML = svg('pause');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n\n this.ended = false;\n this.playButton.innerHTML = svg('play');\n this.video.pause();\n this.clearTime();\n this.element.classList.remove('dplayer-playing');\n this.trigger('pause');\n }\n\n /**\n * Set volume\n */\n volume (percentage) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n this.video.attr('volume', percentage);\n if (this.video.attr('muted')) {\n this.video.attr('muted', false);\n }\n this.switchVolumeIcon();\n }\n\n /**\n * Toggle between play and pause\n */\n toggle () {\n if (this.video.attr('paused')) {\n this.play();\n }\n else {\n this.pause();\n }\n }\n\n /**\n * attach event\n */\n on (event, callback) {\n if (typeof callback === 'function') {\n this.event[event].push(callback);\n }\n }\n\n /**\n * Asynchronously read danmaku from all API endpoints\n */\n _readAllEndpoints (endpoints, finish) {\n const results = [];\n let readCount = 0;\n const cbk = (i) => (err, data) => {\n ++readCount;\n if (err) {\n if (err.response) {\n this.notice(err.response.msg); \n }\n else {\n this.notice('Request was unsuccessful: ' + err.status); \n }\n results[i] = [];\n }\n else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return finish(results);\n }\n };\n\n for (let i = 0; i < endpoints.length; ++i) {\n this.option.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n\n /**\n * Read danmaku from API\n */\n readDanmaku () {\n const isMobile = /mobile/i.test(window.navigator.userAgent);\n let apiurl;\n if (this.option.danmaku.maximum) {\n apiurl = `${this.option.danmaku.api}?id=${this.option.danmaku.id}&max=${this.option.danmaku.maximum}`;\n }\n else {\n apiurl = `${this.option.danmaku.api}?id=${this.option.danmaku.id}`;\n }\n const endpoints = (this.option.danmaku.addition || []).slice(0);\n endpoints.push(apiurl);\n\n this._readAllEndpoints(endpoints, (results) => {\n this.danIndex = 0;\n this.dan = [].concat.apply([], results).sort((a, b) => a.time - b.time);\n this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n\n // autoplay\n if (this.option.autoplay && !isMobile) {\n this.play();\n }\n else if (isMobile) {\n this.pause();\n }\n });\n }\n\n /**\n * Push a danmaku into DPlayer\n *\n * @param {String} text - danmaku content\n * @param {String} color - danmaku color, default: `#fff`\n * @param {String} type - danmaku type, `right` `top` `bottom`, default: `right`\n */\n pushDanmaku (text, color, type) {\n const danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n const itemHeight = this.arrow ? 24 : 30;\n const danWidth = danContainer.offsetWidth;\n const danHeight = danContainer.offsetHeight;\n const itemY = parseInt(danHeight / itemHeight);\n\n const danItemRight = (ele) => danContainer.getBoundingClientRect().right - ele.getBoundingClientRect().right;\n\n const danSpeed = (width) => (danWidth + width) / 5;\n\n const getTunnel = (ele, type, width) => {\n const tmp = danWidth / danSpeed(width);\n\n for (let i = 0; ; i++) {\n const item = this.danTunnel[type][i + ''];\n if (item && item.length) {\n for (let j = 0; j < item.length; j++) {\n const danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(item[j].offsetWidth) || danRight <= 0) {\n break;\n }\n if (j === item.length - 1) {\n this.danTunnel[type][i + ''].push(ele);\n ele.addEventListener('animationend', () => {\n this.danTunnel[type][i + ''].splice(0, 1);\n });\n return i % itemY;\n }\n }\n }\n else {\n this.danTunnel[type][i + ''] = [ele];\n ele.addEventListener('animationend', () => {\n this.danTunnel[type][i + ''].splice(0, 1);\n });\n return i % itemY;\n }\n }\n };\n\n if (!type) {\n type = 'right';\n }\n if (!color) {\n color = '#fff';\n }\n const item = document.createElement(`div`);\n item.classList.add(`dplayer-danmaku-item`);\n item.classList.add(`dplayer-danmaku-${type}`);\n item.innerHTML = text;\n item.style.opacity = this.danOpacity;\n item.style.color = color;\n item.addEventListener('animationend', () => {\n danContainer.removeChild(item);\n });\n\n // measure\n this.itemDemo.innerHTML = text;\n const itemWidth = this.itemDemo.offsetWidth;\n\n // adjust\n switch (type) {\n case 'right':\n item.style.top = itemHeight * getTunnel(item, type, itemWidth) + 'px';\n item.style.width = itemWidth + 1 + 'px';\n item.style.transform = `translateX(-${danWidth}px)`;\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, type) + 'px';\n break;\n default:\n console.error(`Can't handled danmaku type: ${type}`);\n }\n\n // insert\n danContainer.appendChild(item);\n\n // move\n item.classList.add(`dplayer-danmaku-move`);\n\n return item;\n }\n\n /**\n * Switch to a new video\n *\n * @param {Object} video - new video info\n * @param {Object} danmaku - new danmaku info\n */\n // TODO\n switchVideo (video, danmaku) {\n this.video.src = video.url;\n this.video.poster = video.pic ? video.pic : '';\n this.video.currentTime = 0;\n this.pause();\n if (danmaku) {\n this.dan = [];\n this.danIndex = 0;\n this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'block';\n this.updateBar('played', 0, 'width');\n this.updateBar('loaded', 0, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = '00:00';\n this.element.getElementsByClassName('dplayer-danmaku')[0].innerHTML = ``;\n this.danTuel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.itemDemo = this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n this.option.danmaku = danmaku;\n this.readDanmaku();\n }\n }\n\n initVideo () {\n // Support HTTP Live Streaming\n let enablehls;\n if (this.option.video.type === 'auto') {\n enablehls = /m3u8(#|\\?|$)/i.exec(this.option.video.url);\n }\n else if (this.option.video.type === 'hls') {\n enablehls = true;\n }\n else {\n enablehls = false;\n }\n if (enablehls && Hls.isSupported()) {\n // this.element.getElementsByClassName('dplayer-time')[0].style.display = 'none';\n const hls = new Hls();\n hls.attachMedia(this.video.current);\n hls.on(Hls.Events.MEDIA_ATTACHED, () => {\n hls.loadSource(this.option.video.url);\n hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {\n this.notice(\"manifest loaded, found \" + data.levels.length + \" quality level\");\n });\n });\n }\n\n // Support FLV\n let enableflv;\n if (this.option.video.type === 'auto') {\n enableflv = /.flv(#|\\?|$)/i.exec(this.option.video.url);\n }\n else if (this.option.video.type === 'flv') {\n enableflv = true;\n }\n else {\n enableflv = false;\n }\n if (enableflv && flvjs.isSupported()) {\n const flvPlayer = flvjs.createPlayer({\n type: 'flv',\n url: this.option.video.url\n });\n flvPlayer.attachMediaElement(this.video.current);\n flvPlayer.load();\n }\n\n if (this.option.danmaku) {\n this.video.on('all', 'seeking', () => {\n for (let i = 0; i < this.dan.length; i++) {\n if (this.dan[i].time >= this.video.currentTime()) {\n this.danIndex = i;\n return;\n }\n this.danIndex = this.dan.length;\n }\n });\n }\n\n\n /**\n * video events\n */\n // show video time: the metadata has loaded or changed\n this.video.on('all', 'durationchange', (i, video) => {\n if (video.duration !== 1) { // compatibility: Android browsers will output 1 at first\n this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = utils.secondToTime(this.video.duration);\n }\n });\n\n // show video loaded bar: to inform interested parties of progress downloading the media\n this.video.on('current', 'progress', (i, video) => {\n const percentage = video.buffered.length ? video.buffered.end(video.buffered.length - 1) / video.duration : 0;\n this.updateBar('loaded', percentage, 'width');\n });\n\n // video download error: an error occurs\n this.video.on('all', 'error', () => {\n this.notice(this.tran('This video fails to load'), -1);\n this.trigger('pause');\n });\n\n // video can play: enough data is available that the media can be played\n this.video.on('current', 'canplay', () => {\n this.trigger('canplay');\n });\n\n // music end\n this.ended = false;\n this.video.on('all', 'ended', (i) => {\n if (i === this.video.videos.length - 1) {\n this.updateBar('played', 1, 'width');\n if (!this.loop) {\n this.ended = true;\n this.pause();\n this.trigger('ended');\n }\n else {\n this.video.switch(0);\n this.video.play();\n }\n }\n });\n\n this.video.on('current', 'play', () => {\n if (this.paused) {\n this.play();\n }\n });\n\n this.video.on('current', 'pause', () => {\n if (!this.paused) {\n this.pause();\n }\n });\n\n // control volume\n this.video.attr('volume', parseInt(this.element.getElementsByClassName('dplayer-volume-bar-inner')[0].style.width) / 100);\n }\n\n switchQuality (index) {\n if (this.qualityIndex === index || this.switchingQuality) {\n return;\n }\n else {\n this.qualityIndex = index;\n }\n this.switchingQuality = true;\n this.video.pause();\n this.quality = this.option.video.quality[index];\n const videoHTML = html.video(false, null, this.option.screenshot, 'auto', this.quality.url);\n const videoEle = new DOMParser().parseFromString(videoHTML, 'text/html').body.firstChild;\n const parent = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n parent.prepend(videoEle);\n this.prevVideo = this.video;\n this.video = new Video([videoEle], this.prevVideo.duration);\n this.initVideo();\n this.video.seek(this.prevVideo.currentTime());\n this.notice(`${this.tran('Switching to')} ${this.quality.name} ${this.tran('quality')}`, -1);\n this.video.on('current', 'canplay', () => {\n if (this.prevVideo) {\n if (this.video.currentTime() !== this.prevVideo.currentTime()) {\n this.video.seek(this.prevVideo.currentTime());\n return;\n }\n parent.removeChild(this.prevVideo.current);\n this.video.current.classList.add('dplayer-video-current');\n this.video.play(); \n this.prevVideo = null;\n this.notice(`${this.tran('Switched to')} ${this.quality.name} ${this.tran('quality')}`);\n this.switchingQuality = false;\n }\n });\n }\n\n timeTipsHandler (pbar, timeTips) {\n // http://stackoverflow.com/questions/1480133/how-can-i-get-an-objects-absolute-position-on-the-page-in-javascript\n const cumulativeOffset = (element) => {\n let top = 0, left = 0;\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n\n return {\n top: top,\n left: left\n };\n };\n\n return (e) => {\n if (!this.video.duration) {\n return;\n }\n const { clientX } = e;\n const px = cumulativeOffset(pbar).left;\n const tx = clientX - px;\n timeTips.innerText = utils.secondToTime(this.video.duration * (tx / pbar.offsetWidth));\n timeTips.style.left = `${(tx - 20)}px`;\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n if (this.isTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n this.isTipsShow = true;\n break;\n case 'mouseleave':\n case 'mouseout':\n if (!this.isTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n this.isTipsShow = false;\n break;\n }\n };\n }\n\n notice (text, time) {\n const noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = 1;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n if (time && time < 0) {\n return;\n }\n this.noticeTime = setTimeout(() => {\n noticeEle.style.opacity = 0;\n }, time || 2000);\n }\n}\n\nmodule.exports = DPlayer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/DPlayer.js","/*\n * xhr.status ---> fail\n * response.code === 1 ---> success\n * response.code !== 1 ---> error\n * */\n\nconst SendXMLHttpRequest = (url, data, success, error, fail) => {\n const xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {\n const response = JSON.parse(xhr.responseText);\n\n if (response.code !== 1) {\n return error(xhr, response);\n }\n\n return success(xhr, response);\n }\n\n fail(xhr);\n }\n };\n\n xhr.open(data !== null ? 'POST' : 'GET', url, true);\n xhr.send(data !== null ? JSON.stringify(data) : null);\n};\n\nmodule.exports = {\n send: (endpoint, danmakuData) => {\n SendXMLHttpRequest(endpoint, danmakuData, (xhr, response) => {\n console.log('Post danmaku: ', response);\n }, (xhr, response) => {\n alert(response.msg);\n }, (xhr) => {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n\n read: (endpoint, cbk) => {\n SendXMLHttpRequest(endpoint, null, (xhr, response) => {\n cbk(null, response.danmaku);\n }, (xhr, response) => {\n cbk({ status: xhr.status, response });\n }, (xhr) => {\n cbk({ status: xhr.status, response: null });\n });\n }\n};\n\n\n// WEBPACK FOOTER //\n// ./src/api.js"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///DPlayer.min.js","webpack:///webpack/bootstrap ff2c376758a41e638e40","webpack:///./src/svg.js","webpack:///./src/html.js","webpack:///./src/i18n.js","webpack:///./src/option.js","webpack:///./src/utils.js","webpack:///./src/video.js","webpack:///./src/DPlayer.js","webpack:///./src/api.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","svgSource","play","pause","volume-up","volume-down","volume-off","loop","full","full-in","setting","right","comment","comment-off","send","menu","camera","type","svg","html","main","option","index","tran","videos","video","url","length","pic","screenshot","preload","logo","danmaku","theme","quality","defaultQuality","qualityList","contextmenuList","contextmenu","result","link","text","current","original","localStorage","getItem","speed","tranZH","Danmaku is loading","Top","Bottom","Rolling","Input danmaku, hit Enter","About author","DPlayer feedback","About DPlayer","Loop","Speed","Opacity for danmaku","Normal","Please input danmaku content!","Set danmaku color","Set danmaku type","Danmaku","This video fails to load","Switching to","Switched to","lang","_this","defaultApiBackend","test","window","navigator","userAgent","autoplay","defaultOption","element","document","getElementsByClassName","language","indexOf","hotkey","apiBackend","defaultKey","toString","user","secondToTime","second","add0","num","min","parseInt","sec","getElementViewLeft","actualLeft","offsetLeft","offsetParent","elementScrollLeft","body","scrollLeft","documentElement","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","undefined","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","descriptor","writable","key","protoProps","staticProps","Video","duration","multi","durationArr","eventAll","eventCurrent","on","reduce","sum","cur","switch","time","classList","add","paused","remove","currentTime","event","callback","_this2","push","addEventListener","events","slice","Math","max","console","log","tmptime","trigger","_typeof","Symbol","iterator","obj","constructor","utils","handleOption","i18n","isMobile","DPlayer","qualityIndex","updateBar","percentage","direction","bar","style","eventTypes","innerHTML","arrow","offsetWidth","arrowStyle","createElement","head","appendChild","initVideo","bezel","playButton","toggle","videoWrap","conMask","toggleController","contains","playedBar","loadedBar","pbar","pbarTimeTips","barWidth","lastPlayPos","currentPlayPos","bufferingDetected","danmakuTime","setTime","playedTime","setInterval","attr","showdan","dan","item","danIndex","parseFloat","pushDanmaku","color","clearTime","clearInterval","e","clientWidth","clientX","seek","width","isTipsShow","timeTipsHandler","bind","thumbMove","thumbUp","removeEventListener","volumeBar","volumeEle","volumeBarWrapWrap","volumeBarWrap","volumeicon","switchVolumeIcon","volumeMove","volume","volumeUp","hideTime","hideController","clearTimeout","setTimeout","closeSetting","closeComment","danOpacity","settingHTML","settingIcon","settingBox","mask","settingEvent","openSetting","danContainer","loopEle","loopToggle","checked","showDanEle","showDanToggle","danTunnel","top","bottom","itemDemo","speedItem","dataset","danmakuBar","danmakuBarWrapWrap","danmakuBarWrap","danmakuSettingBox","danmakuMove","items","opacity","setItem","danmakuUp","readDanmaku","commentInput","commentIcon","commentBox","commentSettingIcon","commentSettingBox","commentSendIcon","htmlEncode","str","replace","sendComment","blur","notice","danmakuData","token","player","id","author","querySelector","api","splice","border","closeCommentSetting","toggleCommentSetting","disableHide","commentFocusTimeout","openComment","focus","fill","keyCode","resetAnimation","danWidth","transform","cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen","requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","webkitEnterFullscreen","handleKeyDown","tag","activeElement","tagName","toUpperCase","editable","getAttribute","preventDefault","clientRect","getBoundingClientRect","menuLeft","left","menuTop","clientY","offsetHeight","height","switchQuality","camareIcon","canvas","getContext","drawImage","href","toDataURL","download","ended","endpoints","finish","results","readCount","read","err","data","response","msg","status","_this3","apiurl","maximum","addition","_readAllEndpoints","concat","apply","sort","a","b","display","_this4","itemHeight","danHeight","itemY","danItemRight","ele","danSpeed","getTunnel","tmp","_ret2","v","j","danRight","removeChild","itemWidth","error","src","poster","danTuel","_this5","exec","Hls","isSupported","hls","attachMedia","Events","MEDIA_ATTACHED","loadSource","MANIFEST_PARSED","levels","flvjs","flvPlayer","createPlayer","attachMediaElement","load","buffered","end","_this6","switchingQuality","videoHTML","videoEle","DOMParser","parseFromString","firstChild","parent","prepend","prevVideo","timeTips","_this7","cumulativeOffset","offsetTop","px","tx","innerText","noticeEle","noticeTime","SendXMLHttpRequest","success","fail","xhr","XMLHttpRequest","onreadystatechange","readyState","JSON","parse","responseText","code","open","stringify","endpoint","alert","cbk"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,OAAA,aAAAH,GACA,gBAAAC,SACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,MACCK,KAAA,WAC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a,EAAU,KAAM,SAACV,EAAKzE,GACrCqF,EAAI,KAAMrF,EAASxS,UACpB,SAACiX,EAAKzE,GACLqF,GAAMnF,OAAQuE,EAAIvE,OAAQF,cAC3B,SAACyE,GACAY,GAAMnF,OAAQuE,EAAIvE,OAAQF,SAAU","file":"DPlayer.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"DPlayer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"DPlayer\"] = factory();\n\telse\n\t\troot[\"DPlayer\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"DPlayer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"DPlayer\"] = factory();\n\telse\n\t\troot[\"DPlayer\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\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, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 7);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n* SVG used by DPlayer\n*/\n\nvar svgSource = {\n 'play': ['0 0 16 32', 'M15.552 15.168q0.448 0.32 0.448 0.832 0 0.448-0.448 0.768l-13.696 8.512q-0.768 0.512-1.312 0.192t-0.544-1.28v-16.448q0-0.96 0.544-1.28t1.312 0.192z'],\n 'pause': ['0 0 17 32', 'M14.080 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048zM2.88 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048z'],\n 'volume-up': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528zM25.152 16q0 2.72-1.536 5.056t-4 3.36q-0.256 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.704 0.672-1.056 1.024-0.512 1.376-0.8 1.312-0.96 2.048-2.4t0.736-3.104-0.736-3.104-2.048-2.4q-0.352-0.288-1.376-0.8-0.672-0.352-0.672-1.056 0-0.448 0.32-0.8t0.8-0.352q0.224 0 0.48 0.096 2.496 1.056 4 3.36t1.536 5.056zM29.728 16q0 4.096-2.272 7.552t-6.048 5.056q-0.224 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.64 0.704-1.056 0.128-0.064 0.384-0.192t0.416-0.192q0.8-0.448 1.44-0.896 2.208-1.632 3.456-4.064t1.216-5.152-1.216-5.152-3.456-4.064q-0.64-0.448-1.44-0.896-0.128-0.096-0.416-0.192t-0.384-0.192q-0.704-0.416-0.704-1.056 0-0.448 0.32-0.8t0.832-0.352q0.224 0 0.448 0.096 3.776 1.632 6.048 5.056t2.272 7.552z'],\n 'volume-down': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528z'],\n 'volume-off': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8z'],\n 'loop': ['0 0 32 32', 'M1.882 16.941c0 4.152 3.221 7.529 7.177 7.529v1.882c-4.996 0-9.060-4.222-9.060-9.412s4.064-9.412 9.060-9.412h7.96l-3.098-3.098 1.331-1.331 5.372 5.37-5.37 5.372-1.333-1.333 3.1-3.098h-7.962c-3.957 0-7.177 3.377-7.177 7.529zM22.94 7.529v1.882c3.957 0 7.177 3.377 7.177 7.529s-3.221 7.529-7.177 7.529h-7.962l3.098-3.098-1.331-1.331-5.37 5.37 5.372 5.372 1.331-1.331-3.1-3.1h7.96c4.998 0 9.062-4.222 9.062-9.412s-4.064-9.412-9.060-9.412z'],\n 'full': ['0 0 32 33', 'M6.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v4h4c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333zM30.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h4v-4c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM30.667 12c-0.8 0-1.333-0.533-1.333-1.333v-4h-4c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM1.333 12c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-4v4c0 0.8-0.533 1.333-1.333 1.333z'],\n 'full-in': ['0 0 32 33', 'M24.965 24.38h-18.132c-1.366 0-2.478-1.113-2.478-2.478v-11.806c0-1.364 1.111-2.478 2.478-2.478h18.132c1.366 0 2.478 1.113 2.478 2.478v11.806c0 1.364-1.11 2.478-2.478 2.478zM6.833 10.097v11.806h18.134l-0.002-11.806h-18.132zM2.478 28.928h5.952c0.684 0 1.238-0.554 1.238-1.239 0-0.684-0.554-1.238-1.238-1.238h-5.952v-5.802c0-0.684-0.554-1.239-1.238-1.239s-1.239 0.556-1.239 1.239v5.802c0 1.365 1.111 2.478 2.478 2.478zM30.761 19.412c-0.684 0-1.238 0.554-1.238 1.238v5.801h-5.951c-0.686 0-1.239 0.554-1.239 1.238 0 0.686 0.554 1.239 1.239 1.239h5.951c1.366 0 2.478-1.111 2.478-2.478v-5.801c0-0.683-0.554-1.238-1.239-1.238zM0 5.55v5.802c0 0.683 0.554 1.238 1.238 1.238s1.238-0.555 1.238-1.238v-5.802h5.952c0.684 0 1.238-0.554 1.238-1.238s-0.554-1.238-1.238-1.238h-5.951c-1.366-0.001-2.478 1.111-2.478 2.476zM32 11.35v-5.801c0-1.365-1.11-2.478-2.478-2.478h-5.951c-0.686 0-1.239 0.554-1.239 1.238s0.554 1.238 1.239 1.238h5.951v5.801c0 0.683 0.554 1.237 1.238 1.237 0.686 0.002 1.239-0.553 1.239-1.236z'],\n 'setting': ['0 0 32 28', 'M28.633 17.104c0.035 0.21 0.026 0.463-0.026 0.76s-0.14 0.598-0.262 0.904c-0.122 0.306-0.271 0.581-0.445 0.825s-0.367 0.419-0.576 0.524c-0.209 0.105-0.393 0.157-0.55 0.157s-0.332-0.035-0.524-0.105c-0.175-0.052-0.393-0.1-0.655-0.144s-0.528-0.052-0.799-0.026c-0.271 0.026-0.541 0.083-0.812 0.17s-0.502 0.236-0.694 0.445c-0.419 0.437-0.664 0.934-0.734 1.493s0.009 1.092 0.236 1.598c0.175 0.349 0.148 0.699-0.079 1.048-0.105 0.14-0.271 0.284-0.498 0.432s-0.476 0.284-0.747 0.406-0.555 0.218-0.851 0.288c-0.297 0.070-0.559 0.105-0.786 0.105-0.157 0-0.306-0.061-0.445-0.183s-0.236-0.253-0.288-0.393h-0.026c-0.192-0.541-0.52-1.009-0.982-1.402s-1-0.589-1.611-0.589c-0.594 0-1.131 0.197-1.611 0.589s-0.816 0.851-1.009 1.375c-0.087 0.21-0.218 0.362-0.393 0.458s-0.367 0.144-0.576 0.144c-0.244 0-0.52-0.044-0.825-0.131s-0.611-0.197-0.917-0.327c-0.306-0.131-0.581-0.284-0.825-0.458s-0.428-0.349-0.55-0.524c-0.087-0.122-0.135-0.266-0.144-0.432s0.057-0.397 0.197-0.694c0.192-0.402 0.266-0.86 0.223-1.375s-0.266-0.991-0.668-1.428c-0.244-0.262-0.541-0.432-0.891-0.511s-0.681-0.109-0.995-0.092c-0.367 0.017-0.742 0.087-1.127 0.21-0.244 0.070-0.489 0.052-0.734-0.052-0.192-0.070-0.371-0.231-0.537-0.485s-0.314-0.533-0.445-0.838c-0.131-0.306-0.231-0.62-0.301-0.943s-0.087-0.59-0.052-0.799c0.052-0.384 0.227-0.629 0.524-0.734 0.524-0.21 0.995-0.555 1.415-1.035s0.629-1.017 0.629-1.611c0-0.611-0.21-1.144-0.629-1.598s-0.891-0.786-1.415-0.996c-0.157-0.052-0.288-0.179-0.393-0.38s-0.157-0.406-0.157-0.616c0-0.227 0.035-0.48 0.105-0.76s0.162-0.55 0.275-0.812 0.244-0.502 0.393-0.72c0.148-0.218 0.31-0.38 0.485-0.485 0.14-0.087 0.275-0.122 0.406-0.105s0.275 0.052 0.432 0.105c0.524 0.21 1.070 0.275 1.637 0.197s1.070-0.327 1.506-0.747c0.21-0.209 0.362-0.467 0.458-0.773s0.157-0.607 0.183-0.904c0.026-0.297 0.026-0.568 0-0.812s-0.048-0.419-0.065-0.524c-0.035-0.105-0.066-0.227-0.092-0.367s-0.013-0.262 0.039-0.367c0.105-0.244 0.293-0.458 0.563-0.642s0.563-0.336 0.878-0.458c0.314-0.122 0.62-0.214 0.917-0.275s0.533-0.092 0.707-0.092c0.227 0 0.406 0.074 0.537 0.223s0.223 0.301 0.275 0.458c0.192 0.471 0.507 0.886 0.943 1.244s0.952 0.537 1.546 0.537c0.611 0 1.153-0.17 1.624-0.511s0.803-0.773 0.996-1.297c0.070-0.14 0.179-0.284 0.327-0.432s0.301-0.223 0.458-0.223c0.244 0 0.511 0.035 0.799 0.105s0.572 0.166 0.851 0.288c0.279 0.122 0.537 0.279 0.773 0.472s0.423 0.402 0.563 0.629c0.087 0.14 0.113 0.293 0.079 0.458s-0.070 0.284-0.105 0.354c-0.227 0.506-0.297 1.039-0.21 1.598s0.341 1.048 0.76 1.467c0.419 0.419 0.934 0.651 1.546 0.694s1.179-0.057 1.703-0.301c0.14-0.087 0.31-0.122 0.511-0.105s0.371 0.096 0.511 0.236c0.262 0.244 0.493 0.616 0.694 1.113s0.336 1 0.406 1.506c0.035 0.297-0.013 0.528-0.144 0.694s-0.266 0.275-0.406 0.327c-0.542 0.192-1.004 0.528-1.388 1.009s-0.576 1.026-0.576 1.637c0 0.594 0.162 1.113 0.485 1.559s0.747 0.764 1.27 0.956c0.122 0.070 0.227 0.14 0.314 0.21 0.192 0.157 0.323 0.358 0.393 0.602v0zM16.451 19.462c0.786 0 1.528-0.149 2.227-0.445s1.305-0.707 1.821-1.231c0.515-0.524 0.921-1.131 1.218-1.821s0.445-1.428 0.445-2.214c0-0.786-0.148-1.524-0.445-2.214s-0.703-1.292-1.218-1.808c-0.515-0.515-1.122-0.921-1.821-1.218s-1.441-0.445-2.227-0.445c-0.786 0-1.524 0.148-2.214 0.445s-1.292 0.703-1.808 1.218c-0.515 0.515-0.921 1.118-1.218 1.808s-0.445 1.428-0.445 2.214c0 0.786 0.149 1.524 0.445 2.214s0.703 1.297 1.218 1.821c0.515 0.524 1.118 0.934 1.808 1.231s1.428 0.445 2.214 0.445v0z'],\n 'right': ['0 0 32 32', 'M22 16l-10.105-10.6-1.895 1.987 8.211 8.613-8.211 8.612 1.895 1.988 8.211-8.613z'],\n 'comment': ['0 0 32 32', 'M27.128 0.38h-22.553c-2.336 0-4.229 1.825-4.229 4.076v16.273c0 2.251 1.893 4.076 4.229 4.076h4.229v-2.685h8.403l-8.784 8.072 1.566 1.44 7.429-6.827h9.71c2.335 0 4.229-1.825 4.229-4.076v-16.273c0-2.252-1.894-4.076-4.229-4.076zM28.538 19.403c0 1.5-1.262 2.717-2.819 2.717h-8.36l-0.076-0.070-0.076 0.070h-11.223c-1.557 0-2.819-1.217-2.819-2.717v-13.589c0-1.501 1.262-2.718 2.819-2.718h19.734c1.557 0 2.819-0.141 2.819 1.359v14.947zM9.206 10.557c-1.222 0-2.215 0.911-2.215 2.036s0.992 2.035 2.215 2.035c1.224 0 2.216-0.911 2.216-2.035s-0.992-2.036-2.216-2.036zM22.496 10.557c-1.224 0-2.215 0.911-2.215 2.036s0.991 2.035 2.215 2.035c1.224 0 2.215-0.911 2.215-2.035s-0.991-2.036-2.215-2.036zM15.852 10.557c-1.224 0-2.215 0.911-2.215 2.036s0.991 2.035 2.215 2.035c1.222 0 2.215-0.911 2.215-2.035s-0.992-2.036-2.215-2.036z'],\n 'comment-off': ['0 0 32 32', 'M27.090 0.131h-22.731c-2.354 0-4.262 1.839-4.262 4.109v16.401c0 2.269 1.908 4.109 4.262 4.109h4.262v-2.706h8.469l-8.853 8.135 1.579 1.451 7.487-6.88h9.787c2.353 0 4.262-1.84 4.262-4.109v-16.401c0-2.27-1.909-4.109-4.262-4.109v0zM28.511 19.304c0 1.512-1.272 2.738-2.841 2.738h-8.425l-0.076-0.070-0.076 0.070h-11.311c-1.569 0-2.841-1.226-2.841-2.738v-13.696c0-1.513 1.272-2.739 2.841-2.739h19.889c1.569 0 2.841-0.142 2.841 1.37v15.064z'],\n 'send': ['0 0 32 32', 'M13.725 30l3.9-5.325-3.9-1.125v6.45zM0 17.5l11.050 3.35 13.6-11.55-10.55 12.425 11.8 3.65 6.1-23.375-32 15.5z'],\n 'menu': ['0 0 22 32', 'M20.8 14.4q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2zM1.6 11.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2zM20.8 20.8q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2z'],\n 'camera': ['0 0 32 32', 'M16 23c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6zM16 13c-2.206 0-4 1.794-4 4s1.794 4 4 4c2.206 0 4-1.794 4-4s-1.794-4-4-4zM27 28h-22c-1.654 0-3-1.346-3-3v-16c0-1.654 1.346-3 3-3h3c0.552 0 1 0.448 1 1s-0.448 1-1 1h-3c-0.551 0-1 0.449-1 1v16c0 0.552 0.449 1 1 1h22c0.552 0 1-0.448 1-1v-16c0-0.551-0.448-1-1-1h-11c-0.552 0-1-0.448-1-1s0.448-1 1-1h11c1.654 0 3 1.346 3 3v16c0 1.654-1.346 3-3 3zM24 10.5c0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5zM15 4c0 0.552-0.448 1-1 1h-4c-0.552 0-1-0.448-1-1v0c0-0.552 0.448-1 1-1h4c0.552 0 1 0.448 1 1v0z']\n};\n\nmodule.exports = function (type) {\n return '\\n \\n \\n \\n \\n';\n};\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar svg = __webpack_require__(0);\n\nvar html = {\n main: function main(option, index, tran) {\n var videos = '';\n for (var i = 0; i < option.video.url.length; i++) {\n videos += html.video(i === 0, option.video.pic, option.screenshot, option.video.url.length ? 'metadata' : option.preload, option.video.url[i]);\n }\n return '\\n \\n \\n ' + videos + '\\n ' + (option.logo ? '\\n
\\n ' : '') + '\\n
\\n
\\n \\n ' + (option.danmaku ? '' + tran('Danmaku is loading') + '' : '') + '\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\\n
\\n
\\n
0:00 / 0:00\\n
\\n
\\n ' + (option.video.quality ? '\\n
\\n
\\n
\\n ' + html.qualityList(option.video.quality) + '\\n
\\n
\\n ' : '') + '\\n ' + (option.screenshot ? '\\n
\\n ' + svg('camera') + '\\n \\n ' : '') + '\\n \\n
\\n
\\n
\\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\\n ' + html.contextmenuList(option.contextmenu) + '\\n ';\n },\n\n contextmenuList: function contextmenuList(contextmenu) {\n var result = '';\n\n return result;\n },\n\n qualityList: function qualityList(quality) {\n var result = '';\n for (var i = 0; i < quality.length; i++) {\n result += '
' + quality[i].name + '
';\n }\n result += '
';\n\n return result;\n },\n\n video: function video(current, pic, screenshot, preload, url) {\n return '';\n },\n\n setting: function setting(tran) {\n return {\n 'original': '\\n \\n
' + tran('Speed') + '\\n
\\n ' + svg('right') + '\\n
\\n
\\n \\n
' + tran('Loop') + '\\n
\\n \\n \\n
\\n
\\n \\n
' + tran('Danmaku') + '\\n
\\n \\n \\n
\\n
\\n \\n
' + tran('Opacity for danmaku') + '\\n
\\n
',\n 'speed': '\\n \\n 0.5\\n
\\n \\n 0.75\\n
\\n \\n ' + tran('Normal') + '\\n
\\n \\n 1.25\\n
\\n \\n 1.5\\n
\\n \\n 2\\n
'\n };\n }\n};\n\nmodule.exports = html;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar tranZH = {\n 'Danmaku is loading': '弹幕加载中',\n 'Top': '顶部',\n 'Bottom': '底部',\n 'Rolling': '滚动',\n 'Input danmaku, hit Enter': '输入弹幕,回车发送',\n 'About author': '关于作者',\n 'DPlayer feedback': '播放器意见反馈',\n 'About DPlayer': '关于 DPlayer 播放器',\n 'Loop': '洗脑循环',\n 'Speed': '速度',\n 'Opacity for danmaku': '弹幕透明度',\n 'Normal': '正常',\n 'Please input danmaku content!': '要输入弹幕内容啊喂!',\n 'Set danmaku color': '设置弹幕颜色',\n 'Set danmaku type': '设置弹幕类型',\n 'Danmaku': '弹幕',\n 'This video fails to load': '视频加载失败',\n 'Switching to': '正在切换至',\n 'Switched to': '已经切换至',\n 'quality': '画质'\n};\n\nmodule.exports = function (lang) {\n var _this = this;\n\n this.lang = lang;\n this.tran = function (text) {\n if (_this.lang === 'en') {\n return text;\n } else if (_this.lang === 'zh') {\n return tranZH[text];\n }\n };\n};\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar defaultApiBackend = __webpack_require__(8);\n\nmodule.exports = function (option) {\n var isMobile = /mobile/i.test(window.navigator.userAgent);\n // compatibility: some mobile browsers don't suppose autoplay\n if (isMobile) {\n option.autoplay = false;\n }\n\n // default options\n var defaultOption = {\n element: document.getElementsByClassName('dplayer')[0],\n autoplay: false,\n theme: '#b7daff',\n loop: false,\n lang: navigator.language.indexOf('zh') !== -1 ? 'zh' : 'en',\n screenshot: false,\n hotkey: true,\n preload: 'auto',\n apiBackend: defaultApiBackend,\n contextmenu: [{\n text: '关于作者',\n link: 'http://diygod.me'\n }, {\n text: '播放器意见反馈',\n link: 'https://github.com/DIYgod/DPlayer/issues'\n }, {\n text: '关于 DPlayer 播放器',\n link: 'https://github.com/DIYgod/DPlayer'\n }]\n };\n for (var defaultKey in defaultOption) {\n if (defaultOption.hasOwnProperty(defaultKey) && !option.hasOwnProperty(defaultKey)) {\n option[defaultKey] = defaultOption[defaultKey];\n }\n }\n if (Object.prototype.toString.call(option.video.url) !== '[object Array]') {\n option.video.url = [option.video.url];\n }\n if (option.video && !option.video.hasOwnProperty('type')) {\n option.video.type = 'auto';\n }\n if (option.danmaku && !option.danmaku.hasOwnProperty('user')) {\n option.danmaku.user = 'DIYgod';\n }\n\n if (option.video.quality) {\n option.video.url = [option.video.quality[option.video.defaultQuality].url];\n }\n\n return option;\n};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = {\n\n /**\n * Parse second to 00:00 format\n *\n * @param {Number} second\n * @return {String} 00:00 format\n */\n secondToTime: function secondToTime(second) {\n var add0 = function add0(num) {\n return num < 10 ? '0' + num : '' + num;\n };\n var min = parseInt(second / 60);\n var sec = parseInt(second - min * 60);\n return add0(min) + ':' + add0(sec);\n },\n\n /**\n * control play progress\n */\n // get element's view position\n getElementViewLeft: function getElementViewLeft(element) {\n var actualLeft = element.offsetLeft;\n var current = element.offsetParent;\n var elementScrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft;\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) {\n while (current !== null) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n } else {\n while (current !== null && current !== undefined.element) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n }\n return actualLeft - elementScrollLeft;\n }\n};\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Video = function () {\n function Video(videos, duration) {\n var _this = this;\n\n _classCallCheck(this, Video);\n\n this.videos = videos;\n this.multi = this.videos.length > 1;\n this.index = 0;\n this.current = this.videos[this.index];\n\n this.duration = duration || 0;\n this.durationArr = [];\n this.eventAll = [];\n this.eventCurrent = [];\n\n this.on('all', 'durationchange', function (i, video) {\n if (video.duration !== 1) {\n // some Android browsers will output 1 at first\n _this.durationArr[i] = video.duration;\n if (!duration) {\n _this.duration = _this.durationArr.reduce(function (sum, cur) {\n return sum + cur;\n });\n }\n }\n });\n this.on('current', 'end', function () {\n _this.switch(_this.index + 1);\n });\n }\n\n _createClass(Video, [{\n key: 'switch',\n value: function _switch(index, time) {\n if (this.index !== index) {\n this.videos[index].classList.add('dplayer-video-current');\n if (!this.current.paused) {\n this.videos[index].play();\n }\n this.current.classList.remove('dplayer-video-current');\n this.current.pause();\n\n this.index = index;\n this.current = this.videos[this.index];\n this.videos[index].currentTime = time ? time : 0;\n } else {\n this.videos[index].currentTime = time ? time : 0;\n }\n }\n\n // bind event \n\n }, {\n key: 'on',\n value: function on(type, event, callback) {\n var _this2 = this;\n\n if (typeof callback === 'function') {\n if (type === 'all') {\n if (!this.eventAll[event]) {\n this.eventAll[event] = [];\n }\n this.eventAll[event].push(callback);\n } else {\n if (!this.eventCurrent[event]) {\n this.eventCurrent[event] = [];\n }\n this.eventCurrent[event].push(callback);\n }\n\n if (['seeking'].indexOf(event) === -1) {\n var _loop = function _loop(i) {\n _this2.videos[i].addEventListener(event, function () {\n if (type === 'all' || _this2.videos[i] === _this2.current) {\n callback(i, _this2.videos[i]);\n }\n });\n };\n\n for (var i = 0; i < this.videos.length; i++) {\n _loop(i);\n }\n }\n }\n }\n\n // trigger event\n\n }, {\n key: 'trigger',\n value: function trigger(type, event) {\n var events = type === 'all' ? this.eventAll : this.eventCurrent;\n for (var i = 0; i < events[event].length; i++) {\n events[event][i]();\n }\n }\n }, {\n key: 'currentTime',\n value: function currentTime() {\n if (this.durationArr.slice(0, this.index).length) {\n return this.durationArr.slice(0, this.index).reduce(function (sum, cur) {\n return sum + cur;\n }) + this.current.currentTime;\n } else {\n return this.current.currentTime;\n }\n }\n }, {\n key: 'seek',\n value: function seek(time) {\n time = Math.max(time, 0);\n time = Math.min(time, this.duration);\n console.log(time);\n\n var i = 0;\n var tmptime = 0;\n while (tmptime <= time) {\n tmptime += this.durationArr[i];\n i++;\n }\n\n var currentTime = void 0;\n if (this.durationArr.slice(0, this.index).length) {\n currentTime = time - this.durationArr.slice(0, i - 1).reduce(function (sum, cur) {\n return sum + cur;\n });\n } else {\n currentTime = time;\n }\n\n this.switch(i - 1, currentTime);\n\n this.trigger('all', 'seeking');\n }\n }, {\n key: 'attr',\n value: function attr(option, value) {\n if (value !== undefined) {\n for (var i = 0; i < this.videos.length; i++) {\n this.videos[i][option] = value;\n }\n }\n return this.current[option];\n }\n }, {\n key: 'play',\n value: function play() {\n this.current.play();\n }\n }, {\n key: 'pause',\n value: function pause() {\n this.current.pause();\n }\n }, {\n key: 'toggle',\n value: function toggle() {\n this.current.paused ? this.play() : this.pause();\n }\n }]);\n\n return Video;\n}();\n\nmodule.exports = Video;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nconsole.log('\\n %c DPlayer 1.3.1 %c http://dplayer.js.org \\n\\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');\n\n__webpack_require__(6);\nvar utils = __webpack_require__(4);\nvar svg = __webpack_require__(0);\nvar handleOption = __webpack_require__(3);\nvar i18n = __webpack_require__(2);\nvar html = __webpack_require__(1);\nvar Video = __webpack_require__(5);\nvar isMobile = /mobile/i.test(window.navigator.userAgent);\n\nvar index = 0;\n\nvar DPlayer = function () {\n\n /**\n * DPlayer constructor function\n *\n * @param {Object} option - See README\n * @constructor\n */\n function DPlayer(option) {\n var _this = this;\n\n _classCallCheck(this, DPlayer);\n\n this.option = handleOption(option);\n\n this.option.element.classList.add('dplayer');\n\n if (this.option.video.quality) {\n this.qualityIndex = this.option.video.defaultQuality;\n this.quality = this.option.video.quality[this.option.video.defaultQuality];\n }\n\n this.tran = new i18n(this.option.lang).tran;\n\n /**\n * Update progress bar, including loading progress bar and play progress bar\n *\n * @param {String} type - Point out which bar it is, should be played loaded or volume\n * @param {Number} percentage\n * @param {String} direction - Point out the direction of this bar, Should be height or width\n */\n this.updateBar = function (type, percentage, direction) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n bar[type + 'Bar'].style[direction] = percentage * 100 + '%';\n };\n\n // define DPlayer events\n var eventTypes = ['play', 'pause', 'canplay', 'playing', 'ended', 'error'];\n this.event = {};\n for (var i = 0; i < eventTypes.length; i++) {\n this.event[eventTypes[i]] = [];\n }\n this.trigger = function (type) {\n for (var _i = 0; _i < _this.event[type].length; _i++) {\n _this.event[type][_i]();\n }\n };\n\n this.element = this.option.element;\n if (!this.option.danmaku) {\n this.element.classList.add('dplayer-no-danmaku');\n }\n if (isMobile) {\n this.element.classList.add('dplayer-mobile');\n }\n\n this.element.innerHTML = html.main(option, index, this.tran);\n\n // arrow style\n this.arrow = this.element.offsetWidth <= 500;\n if (this.arrow) {\n var arrowStyle = document.createElement('style');\n arrowStyle.innerHTML = '.dplayer .dplayer-danmaku{font-size:18px}';\n document.head.appendChild(arrowStyle);\n }\n\n // get this video manager\n this.video = new Video(this.element.getElementsByClassName('dplayer-video-current'));\n\n this.initVideo();\n\n this.bezel = this.element.getElementsByClassName('dplayer-bezel-icon')[0];\n this.bezel.addEventListener('animationend', function () {\n _this.bezel.classList.remove('dplayer-bezel-transition');\n });\n\n // play and pause button\n this.playButton = this.element.getElementsByClassName('dplayer-play-icon')[0];\n this.paused = true;\n this.playButton.addEventListener('click', function () {\n _this.toggle();\n });\n\n var videoWrap = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n var conMask = this.element.getElementsByClassName('dplayer-controller-mask')[0];\n if (!isMobile) {\n videoWrap.addEventListener('click', function () {\n _this.toggle();\n });\n conMask.addEventListener('click', function () {\n _this.toggle();\n });\n } else {\n var toggleController = function toggleController() {\n if (_this.element.classList.contains('dplayer-hide-controller')) {\n _this.element.classList.remove('dplayer-hide-controller');\n } else {\n _this.element.classList.add('dplayer-hide-controller');\n }\n };\n videoWrap.addEventListener('click', toggleController);\n conMask.addEventListener('click', toggleController);\n }\n\n var bar = {};\n bar.playedBar = this.element.getElementsByClassName('dplayer-played')[0];\n bar.loadedBar = this.element.getElementsByClassName('dplayer-loaded')[0];\n var pbar = this.element.getElementsByClassName('dplayer-bar-wrap')[0];\n var pbarTimeTips = this.element.getElementsByClassName('dplayer-bar-time')[0];\n var barWidth = void 0;\n\n var lastPlayPos = 0;\n var currentPlayPos = 0;\n var bufferingDetected = false;\n var danmakuTime = void 0;\n this.setTime = function () {\n _this.playedTime = setInterval(function () {\n // whether the video is buffering\n currentPlayPos = _this.video.currentTime();\n if (!bufferingDetected && currentPlayPos < lastPlayPos + 0.01 && !_this.video.attr('paused')) {\n _this.element.classList.add('dplayer-loading');\n bufferingDetected = true;\n }\n if (bufferingDetected && currentPlayPos > lastPlayPos + 0.01 && !_this.video.attr('paused')) {\n _this.element.classList.remove('dplayer-loading');\n bufferingDetected = false;\n }\n lastPlayPos = currentPlayPos;\n\n _this.updateBar('played', _this.video.currentTime() / _this.video.duration, 'width');\n _this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = utils.secondToTime(_this.video.currentTime());\n _this.trigger('playing');\n }, 100);\n if (_this.option.danmaku && showdan) {\n danmakuTime = setInterval(function () {\n if (_this.dan) {\n var item = _this.dan[_this.danIndex];\n while (item && _this.video.currentTime() > parseFloat(item.time)) {\n _this.pushDanmaku(item.text, item.color, item.type);\n item = _this.dan[++_this.danIndex];\n }\n }\n }, 100);\n }\n };\n this.clearTime = function () {\n clearInterval(_this.playedTime);\n if (_this.option.danmaku) {\n clearInterval(danmakuTime);\n }\n };\n\n pbar.addEventListener('click', function (event) {\n var e = event || window.event;\n barWidth = pbar.clientWidth;\n var percentage = (e.clientX - utils.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('played', percentage, 'width');\n _this.video.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n });\n\n this.isTipsShow = false;\n this.timeTipsHandler = this.timeTipsHandler(pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.timeTipsHandler);\n pbar.addEventListener('mouseover', this.timeTipsHandler);\n pbar.addEventListener('mouseenter', this.timeTipsHandler);\n pbar.addEventListener('mouseout', this.timeTipsHandler);\n pbar.addEventListener('mouseleave', this.timeTipsHandler);\n\n var thumbMove = function thumbMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - utils.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('played', percentage, 'width');\n _this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = utils.secondToTime(percentage * _this.video.duration);\n };\n\n var thumbUp = function thumbUp() {\n document.removeEventListener('mouseup', thumbUp);\n document.removeEventListener('mousemove', thumbMove);\n _this.video.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n _this.setTime();\n };\n\n pbar.addEventListener('mousedown', function () {\n barWidth = pbar.clientWidth;\n _this.clearTime();\n document.addEventListener('mousemove', thumbMove);\n document.addEventListener('mouseup', thumbUp);\n });\n\n /**\n * control volume\n */\n bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\n var volumeEle = this.element.getElementsByClassName('dplayer-volume')[0];\n var volumeBarWrapWrap = this.element.getElementsByClassName('dplayer-volume-bar-wrap')[0];\n var volumeBarWrap = this.element.getElementsByClassName('dplayer-volume-bar')[0];\n var volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0];\n var vWidth = 35;\n\n this.switchVolumeIcon = function () {\n var volumeicon = _this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (_this.video.attr('volume') >= 0.8) {\n volumeicon.innerHTML = svg('volume-up');\n } else if (_this.video.attr('volume') > 0) {\n volumeicon.innerHTML = svg('volume-down');\n } else {\n volumeicon.innerHTML = svg('volume-off');\n }\n };\n var volumeMove = function volumeMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - utils.getElementViewLeft(volumeBarWrap) - 5.5) / vWidth;\n _this.volume(percentage);\n };\n var volumeUp = function volumeUp() {\n document.removeEventListener('mouseup', volumeUp);\n document.removeEventListener('mousemove', volumeMove);\n volumeEle.classList.remove('dplayer-volume-active');\n };\n\n volumeBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - utils.getElementViewLeft(volumeBarWrap) - 5.5) / vWidth;\n _this.volume(percentage);\n });\n volumeBarWrapWrap.addEventListener('mousedown', function () {\n document.addEventListener('mousemove', volumeMove);\n document.addEventListener('mouseup', volumeUp);\n volumeEle.classList.add('dplayer-volume-active');\n });\n volumeicon.addEventListener('click', function () {\n if (_this.video.attr('muted')) {\n _this.video.attr('muted', false);\n _this.switchVolumeIcon();\n _this.updateBar('volume', _this.video.attr('volume'), 'width');\n } else {\n _this.video.attr('muted', true);\n volumeicon.innerHTML = svg('volume-off');\n _this.updateBar('volume', 0, 'width');\n }\n });\n\n /**\n * auto hide controller\n */\n var hideTime = 0;\n if (!isMobile) {\n var hideController = function hideController() {\n _this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(hideTime);\n hideTime = setTimeout(function () {\n if (_this.video.attr('played').length) {\n _this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n\n /**\n * setting\n */\n this.danOpacity = localStorage.getItem('DPlayer-opacity') || 0.7;\n var settingHTML = html.setting(this.tran);\n\n // toggle setting box\n var settingIcon = this.element.getElementsByClassName('dplayer-setting-icon')[0];\n var settingBox = this.element.getElementsByClassName('dplayer-setting-box')[0];\n var mask = this.element.getElementsByClassName('dplayer-mask')[0];\n settingBox.innerHTML = settingHTML.original;\n\n var closeSetting = function closeSetting() {\n if (settingBox.classList.contains('dplayer-setting-box-open')) {\n settingBox.classList.remove('dplayer-setting-box-open');\n mask.classList.remove('dplayer-mask-show');\n setTimeout(function () {\n settingBox.classList.remove('dplayer-setting-box-narrow');\n settingBox.innerHTML = settingHTML.original;\n settingEvent();\n }, 300);\n }\n };\n var openSetting = function openSetting() {\n settingBox.classList.add('dplayer-setting-box-open');\n mask.classList.add('dplayer-mask-show');\n };\n\n mask.addEventListener('click', function () {\n closeSetting();\n });\n settingIcon.addEventListener('click', function () {\n openSetting();\n });\n\n this.loop = this.option.loop;\n var danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n var showdan = true;\n var settingEvent = function settingEvent() {\n // loop control\n var loopEle = _this.element.getElementsByClassName('dplayer-setting-loop')[0];\n var loopToggle = loopEle.getElementsByClassName('dplayer-toggle-setting-input')[0];\n\n loopToggle.checked = _this.loop;\n\n loopEle.addEventListener('click', function () {\n loopToggle.checked = !loopToggle.checked;\n if (loopToggle.checked) {\n _this.loop = true;\n } else {\n _this.loop = false;\n }\n closeSetting();\n });\n\n // show danmaku control\n var showDanEle = _this.element.getElementsByClassName('dplayer-setting-showdan')[0];\n var showDanToggle = showDanEle.getElementsByClassName('dplayer-showdan-setting-input')[0];\n\n showDanToggle.checked = showdan;\n\n showDanEle.addEventListener('click', function () {\n showDanToggle.checked = !showDanToggle.checked;\n if (showDanToggle.checked) {\n showdan = true;\n if (_this.option.danmaku) {\n for (var _i2 = 0; _i2 < _this.dan.length; _i2++) {\n if (_this.dan[_i2].time >= _this.video.currentTime()) {\n _this.danIndex = _i2;\n break;\n }\n _this.danIndex = _this.dan.length;\n }\n danmakuTime = setInterval(function () {\n var item = _this.dan[_this.danIndex];\n while (item && _this.video.currentTime() >= parseFloat(item.time)) {\n _this.pushDanmaku(item.text, item.color, item.type);\n item = _this.dan[++_this.danIndex];\n }\n }, 0);\n }\n } else {\n showdan = false;\n if (_this.option.danmaku) {\n clearInterval(danmakuTime);\n danContainer.innerHTML = '';\n _this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n _this.itemDemo = _this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n }\n }\n closeSetting();\n });\n\n // speed control\n var speedEle = _this.element.getElementsByClassName('dplayer-setting-speed')[0];\n speedEle.addEventListener('click', function () {\n settingBox.classList.add('dplayer-setting-box-narrow');\n settingBox.innerHTML = settingHTML.speed;\n\n var speedItem = settingBox.getElementsByClassName('dplayer-setting-speed-item');\n\n var _loop = function _loop(_i3) {\n speedItem[_i3].addEventListener('click', function () {\n _this.video.attr('playbackRate', speedItem[_i3].dataset.speed);\n closeSetting();\n });\n };\n\n for (var _i3 = 0; _i3 < speedItem.length; _i3++) {\n _loop(_i3);\n }\n });\n\n if (_this.option.danmaku) {\n // danmaku opacity\n bar.danmakuBar = _this.element.getElementsByClassName('dplayer-danmaku-bar-inner')[0];\n var danmakuBarWrapWrap = _this.element.getElementsByClassName('dplayer-danmaku-bar-wrap')[0];\n var danmakuBarWrap = _this.element.getElementsByClassName('dplayer-danmaku-bar')[0];\n var danmakuSettingBox = _this.element.getElementsByClassName('dplayer-setting-danmaku')[0];\n var dWidth = 130;\n _this.updateBar('danmaku', _this.danOpacity, 'width');\n\n var danmakuMove = function danmakuMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - utils.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i4 = 0; _i4 < items.length; _i4++) {\n items[_i4].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n };\n var danmakuUp = function danmakuUp() {\n document.removeEventListener('mouseup', danmakuUp);\n document.removeEventListener('mousemove', danmakuMove);\n danmakuSettingBox.classList.remove('dplayer-setting-danmaku-active');\n };\n\n danmakuBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - utils.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i5 = 0; _i5 < items.length; _i5++) {\n items[_i5].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n });\n danmakuBarWrapWrap.addEventListener('mousedown', function () {\n document.addEventListener('mousemove', danmakuMove);\n document.addEventListener('mouseup', danmakuUp);\n danmakuSettingBox.classList.add('dplayer-setting-danmaku-active');\n });\n }\n };\n settingEvent();\n\n // set duration time\n if (this.video.duration !== 1) {\n // compatibility: Android browsers will output 1 at first\n this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = this.video.duration ? utils.secondToTime(this.video.duration) : '00:00';\n }\n\n // danmaku\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.itemDemo = this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n\n if (this.option.danmaku) {\n this.danIndex = 0;\n this.readDanmaku();\n } else {\n // autoplay\n if (this.option.autoplay && !isMobile) {\n this.play();\n } else if (isMobile) {\n this.pause();\n }\n }\n\n /**\n * comment\n */\n var commentInput = this.element.getElementsByClassName('dplayer-comment-input')[0];\n var commentIcon = this.element.getElementsByClassName('dplayer-comment-icon')[0];\n var commentBox = this.element.getElementsByClassName('dplayer-comment-box')[0];\n var commentSettingIcon = this.element.getElementsByClassName('dplayer-comment-setting-icon')[0];\n var commentSettingBox = this.element.getElementsByClassName('dplayer-comment-setting-box')[0];\n var commentSendIcon = this.element.getElementsByClassName('dplayer-send-icon')[0];\n\n var htmlEncode = function htmlEncode(str) {\n return str.replace(/&/g, \"&\").replace(//g, \">\").replace(/\"/g, \""\").replace(/'/g, \"'\").replace(/\\//g, \"/\");\n };\n\n var sendComment = function sendComment() {\n commentInput.blur();\n\n // text can't be empty\n if (!commentInput.value.replace(/^\\s+|\\s+$/g, '')) {\n _this.notice(_this.tran('Please input danmaku content!'));\n return;\n }\n\n var danmakuData = {\n token: _this.option.danmaku.token,\n player: _this.option.danmaku.id,\n author: _this.option.danmaku.user,\n time: _this.video.currentTime(),\n text: commentInput.value,\n color: _this.element.querySelector('.dplayer-comment-setting-color input:checked').value,\n type: _this.element.querySelector('.dplayer-comment-setting-type input:checked').value\n };\n _this.option.apiBackend.send(_this.option.danmaku.api, danmakuData);\n\n commentInput.value = '';\n closeComment();\n _this.dan.splice(_this.danIndex, 0, danmakuData);\n _this.danIndex++;\n var item = _this.pushDanmaku(htmlEncode(danmakuData.text), danmakuData.color, danmakuData.type);\n item.style.border = '2px solid ' + _this.option.theme;\n };\n\n var closeCommentSetting = function closeCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n }\n };\n var toggleCommentSetting = function toggleCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n } else {\n commentSettingBox.classList.add('dplayer-comment-setting-open');\n }\n };\n\n var disableHide = 0;\n var commentFocusTimeout = 0;\n var closeComment = function closeComment() {\n if (!commentBox.classList.contains('dplayer-comment-box-open')) {\n return;\n }\n\n commentBox.classList.remove('dplayer-comment-box-open');\n mask.classList.remove('dplayer-mask-show');\n _this.element.classList.remove('dplayer-show-controller');\n\n clearInterval(disableHide);\n clearTimeout(commentFocusTimeout);\n closeCommentSetting();\n };\n var openComment = function openComment() {\n if (commentBox.classList.contains('dplayer-comment-box-open')) {\n return;\n }\n\n commentBox.classList.add('dplayer-comment-box-open');\n mask.classList.add('dplayer-mask-show');\n _this.element.classList.add('dplayer-show-controller');\n\n disableHide = setInterval(function () {\n clearTimeout(hideTime);\n }, 1000);\n commentFocusTimeout = setTimeout(function () {\n commentInput.focus();\n }, 300);\n };\n\n mask.addEventListener('click', function () {\n closeComment();\n });\n commentIcon.addEventListener('click', function () {\n openComment();\n });\n commentSettingIcon.addEventListener('click', function () {\n toggleCommentSetting();\n });\n\n // comment setting box\n this.element.getElementsByClassName('dplayer-comment-setting-color')[0].addEventListener('click', function () {\n var sele = _this.element.querySelector('input[name=\"dplayer-danmaku-color-${index}\"]:checked+span');\n if (sele) {\n commentSettingIcon.getElementsByClassName('dplayer-fill')[0].style.fill = _this.element.querySelector('input[name=\"dplayer-danmaku-color-${index}\"]:checked').value;\n }\n });\n\n commentInput.addEventListener('click', function () {\n closeCommentSetting();\n });\n commentInput.addEventListener('keydown', function (e) {\n var event = e || window.event;\n if (event.keyCode === 13) {\n sendComment();\n }\n });\n\n commentSendIcon.addEventListener('click', sendComment);\n\n /**\n * full screen\n */\n var resetAnimation = function resetAnimation() {\n var danWidth = danContainer.offsetWidth;\n var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i6 = 0; _i6 < items.length; _i6++) {\n items[_i6].style.transform = 'translateX(-' + danWidth + 'px)';\n }\n };\n\n this.element.addEventListener('fullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('mozfullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('webkitfullscreenchange', function () {\n resetAnimation();\n });\n // browser full screen\n this.element.getElementsByClassName('dplayer-full-icon')[0].addEventListener('click', function () {\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) {\n if (_this.element.requestFullscreen) {\n _this.element.requestFullscreen();\n } else if (_this.element.mozRequestFullScreen) {\n _this.element.mozRequestFullScreen();\n } else if (_this.element.webkitRequestFullscreen) {\n _this.element.webkitRequestFullscreen();\n } else if (_this.video.attr('webkitEnterFullscreen')) {\n // Safari for iOS\n _this.video.current.webkitEnterFullscreen();\n }\n } else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n resetAnimation();\n });\n // web full screen\n this.element.getElementsByClassName('dplayer-full-in-icon')[0].addEventListener('click', function () {\n if (_this.element.classList.contains('dplayer-fulled')) {\n _this.element.classList.remove('dplayer-fulled');\n } else {\n _this.element.classList.add('dplayer-fulled');\n resetAnimation();\n }\n });\n\n /**\n * hot key\n */\n var handleKeyDown = function handleKeyDown(e) {\n var tag = document.activeElement.tagName.toUpperCase();\n var editable = document.activeElement.getAttribute('contenteditable');\n if (tag !== 'INPUT' && tag !== 'TEXTAREA' && editable !== '' && editable !== 'true') {\n var event = e || window.event;\n var percentage = void 0;\n switch (event.keyCode) {\n case 32:\n event.preventDefault();\n _this.toggle();\n break;\n case 37:\n event.preventDefault();\n _this.video.seek(_this.video.currentTime() - 5);\n break;\n case 39:\n event.preventDefault();\n _this.video.seek(_this.video.currentTime() + 5);\n break;\n case 38:\n event.preventDefault();\n percentage = _this.video.attr('volume') + 0.1;\n _this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = _this.video.attr('volume') - 0.1;\n _this.volume(percentage);\n break;\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', function (e) {\n // Press ESC to quit web full screen\n var event = e || window.event;\n switch (event.keyCode) {\n case 27:\n if (_this.element.classList.contains('dplayer-fulled')) {\n _this.element.classList.remove('dplayer-fulled');\n resetAnimation();\n }\n break;\n }\n });\n\n /**\n * right key\n */\n var menu = this.element.getElementsByClassName('dplayer-menu')[0];\n this.element.addEventListener('contextmenu', function (e) {\n var event = e || window.event;\n event.preventDefault();\n\n menu.classList.add('dplayer-menu-show');\n\n var clientRect = _this.element.getBoundingClientRect();\n var menuLeft = event.clientX - clientRect.left;\n var menuTop = event.clientY - clientRect.top;\n if (menuLeft + menu.offsetWidth >= clientRect.width) {\n menu.style.right = clientRect.width - menuLeft + 'px';\n menu.style.left = 'initial';\n } else {\n menu.style.left = event.clientX - _this.element.getBoundingClientRect().left + 'px';\n menu.style.right = 'initial';\n }\n if (menuTop + menu.offsetHeight >= clientRect.height) {\n menu.style.bottom = clientRect.height - menuTop + 'px';\n menu.style.top = 'initial';\n } else {\n menu.style.top = event.clientY - _this.element.getBoundingClientRect().top + 'px';\n menu.style.bottom = 'initial';\n }\n\n mask.classList.add('dplayer-mask-show');\n mask.addEventListener('click', function () {\n mask.classList.remove('dplayer-mask-show');\n menu.classList.remove('dplayer-menu-show');\n });\n });\n\n /**\n * Switch quality\n */\n if (this.option.video.quality) {\n this.element.getElementsByClassName('dplayer-quality-list')[0].addEventListener('click', function (e) {\n if (e.target.classList.contains('dplayer-quality-item')) {\n _this.switchQuality(e.target.dataset.index);\n }\n });\n }\n\n /**\n * Screenshot\n */\n if (this.option.screenshot) {\n var camareIcon = this.element.getElementsByClassName('dplayer-camera-icon')[0];\n camareIcon.addEventListener('click', function () {\n var canvas = document.createElement(\"canvas\");\n canvas.width = _this.video.attr('videoWidth');\n canvas.height = _this.video.attr('videoHeight');\n canvas.getContext('2d').drawImage(_this.video.current, 0, 0, canvas.width, canvas.height);\n\n camareIcon.href = canvas.toDataURL();\n camareIcon.download = \"DPlayer.png\";\n });\n }\n\n index++;\n }\n\n /**\n * Play music\n */\n\n\n _createClass(DPlayer, [{\n key: 'play',\n value: function play(time) {\n if (Object.prototype.toString.call(time) === '[object Number]') {\n this.video.seek(time);\n }\n this.paused = false;\n if (this.video.attr('paused')) {\n this.bezel.innerHTML = svg('play');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n\n this.playButton.innerHTML = svg('pause');\n\n this.video.play();\n if (this.playedTime) {\n this.clearTime();\n }\n this.setTime();\n this.element.classList.add('dplayer-playing');\n this.trigger('play');\n }\n\n /**\n * Pause music\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n this.element.classList.remove('dplayer-loading');\n\n if (!this.video.attr('paused')) {\n this.bezel.innerHTML = svg('pause');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n\n this.ended = false;\n this.playButton.innerHTML = svg('play');\n this.video.pause();\n this.clearTime();\n this.element.classList.remove('dplayer-playing');\n this.trigger('pause');\n }\n\n /**\n * Set volume\n */\n\n }, {\n key: 'volume',\n value: function volume(percentage) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n this.video.attr('volume', percentage);\n if (this.video.attr('muted')) {\n this.video.attr('muted', false);\n }\n this.switchVolumeIcon();\n }\n\n /**\n * Toggle between play and pause\n */\n\n }, {\n key: 'toggle',\n value: function toggle() {\n if (this.video.attr('paused')) {\n this.play();\n } else {\n this.pause();\n }\n }\n\n /**\n * attach event\n */\n\n }, {\n key: 'on',\n value: function on(event, callback) {\n if (typeof callback === 'function') {\n this.event[event].push(callback);\n }\n }\n\n /**\n * Asynchronously read danmaku from all API endpoints\n */\n\n }, {\n key: '_readAllEndpoints',\n value: function _readAllEndpoints(endpoints, finish) {\n var _this2 = this;\n\n var results = [];\n var readCount = 0;\n var cbk = function cbk(i) {\n return function (err, data) {\n ++readCount;\n if (err) {\n if (err.response) {\n _this2.notice(err.response.msg);\n } else {\n _this2.notice('Request was unsuccessful: ' + err.status);\n }\n results[i] = [];\n } else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return finish(results);\n }\n };\n };\n\n for (var i = 0; i < endpoints.length; ++i) {\n this.option.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n\n /**\n * Read danmaku from API\n */\n\n }, {\n key: 'readDanmaku',\n value: function readDanmaku() {\n var _this3 = this;\n\n var isMobile = /mobile/i.test(window.navigator.userAgent);\n var apiurl = void 0;\n if (this.option.danmaku.maximum) {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id + '&max=' + this.option.danmaku.maximum;\n } else {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id;\n }\n var endpoints = (this.option.danmaku.addition || []).slice(0);\n endpoints.push(apiurl);\n\n this._readAllEndpoints(endpoints, function (results) {\n _this3.danIndex = 0;\n _this3.dan = [].concat.apply([], results).sort(function (a, b) {\n return a.time - b.time;\n });\n _this3.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n\n // autoplay\n if (_this3.option.autoplay && !isMobile) {\n _this3.play();\n } else if (isMobile) {\n _this3.pause();\n }\n });\n }\n\n /**\n * Push a danmaku into DPlayer\n *\n * @param {String} text - danmaku content\n * @param {String} color - danmaku color, default: `#fff`\n * @param {String} type - danmaku type, `right` `top` `bottom`, default: `right`\n */\n\n }, {\n key: 'pushDanmaku',\n value: function pushDanmaku(text, color, type) {\n var _this4 = this;\n\n var danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n var itemHeight = this.arrow ? 24 : 30;\n var danWidth = danContainer.offsetWidth;\n var danHeight = danContainer.offsetHeight;\n var itemY = parseInt(danHeight / itemHeight);\n\n var danItemRight = function danItemRight(ele) {\n return danContainer.getBoundingClientRect().right - ele.getBoundingClientRect().right;\n };\n\n var danSpeed = function danSpeed(width) {\n return (danWidth + width) / 5;\n };\n\n var getTunnel = function getTunnel(ele, type, width) {\n var tmp = danWidth / danSpeed(width);\n\n var _loop2 = function _loop2(i) {\n var item = _this4.danTunnel[type][i + ''];\n if (item && item.length) {\n for (var j = 0; j < item.length; j++) {\n var danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(item[j].offsetWidth) || danRight <= 0) {\n break;\n }\n if (j === item.length - 1) {\n _this4.danTunnel[type][i + ''].push(ele);\n ele.addEventListener('animationend', function () {\n _this4.danTunnel[type][i + ''].splice(0, 1);\n });\n return {\n v: i % itemY\n };\n }\n }\n } else {\n _this4.danTunnel[type][i + ''] = [ele];\n ele.addEventListener('animationend', function () {\n _this4.danTunnel[type][i + ''].splice(0, 1);\n });\n return {\n v: i % itemY\n };\n }\n };\n\n for (var i = 0;; i++) {\n var _ret2 = _loop2(i);\n\n if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === \"object\") return _ret2.v;\n }\n };\n\n if (!type) {\n type = 'right';\n }\n if (!color) {\n color = '#fff';\n }\n var item = document.createElement('div');\n item.classList.add('dplayer-danmaku-item');\n item.classList.add('dplayer-danmaku-' + type);\n item.innerHTML = text;\n item.style.opacity = this.danOpacity;\n item.style.color = color;\n item.addEventListener('animationend', function () {\n danContainer.removeChild(item);\n });\n\n // measure\n this.itemDemo.innerHTML = text;\n var itemWidth = this.itemDemo.offsetWidth;\n\n // adjust\n switch (type) {\n case 'right':\n item.style.top = itemHeight * getTunnel(item, type, itemWidth) + 'px';\n item.style.width = itemWidth + 1 + 'px';\n item.style.transform = 'translateX(-' + danWidth + 'px)';\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, type) + 'px';\n break;\n default:\n console.error('Can\\'t handled danmaku type: ' + type);\n }\n\n // insert\n danContainer.appendChild(item);\n\n // move\n item.classList.add('dplayer-danmaku-move');\n\n return item;\n }\n\n /**\n * Switch to a new video\n *\n * @param {Object} video - new video info\n * @param {Object} danmaku - new danmaku info\n */\n // TODO\n\n }, {\n key: 'switchVideo',\n value: function switchVideo(video, danmaku) {\n this.video.src = video.url;\n this.video.poster = video.pic ? video.pic : '';\n this.video.currentTime = 0;\n this.pause();\n if (danmaku) {\n this.dan = [];\n this.danIndex = 0;\n this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'block';\n this.updateBar('played', 0, 'width');\n this.updateBar('loaded', 0, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = '00:00';\n this.element.getElementsByClassName('dplayer-danmaku')[0].innerHTML = '';\n this.danTuel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.itemDemo = this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n this.option.danmaku = danmaku;\n this.readDanmaku();\n }\n }\n }, {\n key: 'initVideo',\n value: function initVideo() {\n var _this5 = this;\n\n // Support HTTP Live Streaming\n var enablehls = void 0;\n if (this.option.video.type === 'auto') {\n enablehls = /m3u8(#|\\?|$)/i.exec(this.option.video.url);\n } else if (this.option.video.type === 'hls') {\n enablehls = true;\n } else {\n enablehls = false;\n }\n if (enablehls && Hls.isSupported()) {\n // this.element.getElementsByClassName('dplayer-time')[0].style.display = 'none';\n var hls = new Hls();\n hls.attachMedia(this.video.current);\n hls.on(Hls.Events.MEDIA_ATTACHED, function () {\n hls.loadSource(_this5.option.video.url);\n hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {\n this.notice(\"manifest loaded, found \" + data.levels.length + \" quality level\");\n });\n });\n }\n\n // Support FLV\n var enableflv = void 0;\n if (this.option.video.type === 'auto') {\n enableflv = /.flv(#|\\?|$)/i.exec(this.option.video.url);\n } else if (this.option.video.type === 'flv') {\n enableflv = true;\n } else {\n enableflv = false;\n }\n if (enableflv && flvjs.isSupported()) {\n var flvPlayer = flvjs.createPlayer({\n type: 'flv',\n url: this.option.video.url\n });\n flvPlayer.attachMediaElement(this.video.current);\n flvPlayer.load();\n }\n\n if (this.option.danmaku) {\n this.video.on('all', 'seeking', function () {\n for (var i = 0; i < _this5.dan.length; i++) {\n if (_this5.dan[i].time >= _this5.video.currentTime()) {\n _this5.danIndex = i;\n return;\n }\n _this5.danIndex = _this5.dan.length;\n }\n });\n }\n\n /**\n * video events\n */\n // show video time: the metadata has loaded or changed\n this.video.on('all', 'durationchange', function (i, video) {\n if (video.duration !== 1) {\n // compatibility: Android browsers will output 1 at first\n _this5.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = utils.secondToTime(_this5.video.duration);\n }\n });\n\n // show video loaded bar: to inform interested parties of progress downloading the media\n this.video.on('current', 'progress', function (i, video) {\n var percentage = video.buffered.length ? video.buffered.end(video.buffered.length - 1) / video.duration : 0;\n _this5.updateBar('loaded', percentage, 'width');\n });\n\n // video download error: an error occurs\n this.video.on('all', 'error', function () {\n _this5.notice(_this5.tran('This video fails to load'), -1);\n _this5.trigger('pause');\n });\n\n // video can play: enough data is available that the media can be played\n this.video.on('current', 'canplay', function () {\n _this5.trigger('canplay');\n });\n\n // music end\n this.ended = false;\n this.video.on('all', 'ended', function (i) {\n if (i === _this5.video.videos.length - 1) {\n _this5.updateBar('played', 1, 'width');\n if (!_this5.loop) {\n _this5.ended = true;\n _this5.pause();\n _this5.trigger('ended');\n } else {\n _this5.video.switch(0);\n _this5.video.play();\n }\n }\n });\n\n this.video.on('current', 'play', function () {\n if (_this5.paused) {\n _this5.play();\n }\n });\n\n this.video.on('current', 'pause', function () {\n if (!_this5.paused) {\n _this5.pause();\n }\n });\n\n // control volume\n this.video.attr('volume', parseInt(this.element.getElementsByClassName('dplayer-volume-bar-inner')[0].style.width) / 100);\n }\n }, {\n key: 'switchQuality',\n value: function switchQuality(index) {\n var _this6 = this;\n\n if (this.qualityIndex === index || this.switchingQuality) {\n return;\n } else {\n this.qualityIndex = index;\n }\n this.switchingQuality = true;\n this.quality = this.option.video.quality[index];\n this.element.getElementsByClassName('dplayer-quality-icon')[0].innerHTML = this.quality.name;\n\n this.video.pause();\n var videoHTML = html.video(false, null, this.option.screenshot, 'auto', this.quality.url);\n var videoEle = new DOMParser().parseFromString(videoHTML, 'text/html').body.firstChild;\n var parent = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n parent.prepend(videoEle);\n this.prevVideo = this.video;\n this.video = new Video([videoEle], this.prevVideo.duration);\n this.initVideo();\n this.video.seek(this.prevVideo.currentTime());\n this.notice(this.tran('Switching to') + ' ' + this.quality.name + ' ' + this.tran('quality'), -1);\n this.video.on('current', 'canplay', function () {\n if (_this6.prevVideo) {\n if (_this6.video.currentTime() !== _this6.prevVideo.currentTime()) {\n _this6.video.seek(_this6.prevVideo.currentTime());\n return;\n }\n parent.removeChild(_this6.prevVideo.current);\n _this6.video.current.classList.add('dplayer-video-current');\n _this6.video.play();\n _this6.prevVideo = null;\n _this6.notice(_this6.tran('Switched to') + ' ' + _this6.quality.name + ' ' + _this6.tran('quality'));\n _this6.switchingQuality = false;\n }\n });\n }\n }, {\n key: 'timeTipsHandler',\n value: function timeTipsHandler(pbar, timeTips) {\n var _this7 = this;\n\n // http://stackoverflow.com/questions/1480133/how-can-i-get-an-objects-absolute-position-on-the-page-in-javascript\n var cumulativeOffset = function cumulativeOffset(element) {\n var top = 0,\n left = 0;\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n\n return {\n top: top,\n left: left\n };\n };\n\n return function (e) {\n if (!_this7.video.duration) {\n return;\n }\n var clientX = e.clientX;\n\n var px = cumulativeOffset(pbar).left;\n var tx = clientX - px;\n timeTips.innerText = utils.secondToTime(_this7.video.duration * (tx / pbar.offsetWidth));\n timeTips.style.left = tx - 20 + 'px';\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n if (_this7.isTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n _this7.isTipsShow = true;\n break;\n case 'mouseleave':\n case 'mouseout':\n if (!_this7.isTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n _this7.isTipsShow = false;\n break;\n }\n };\n }\n }, {\n key: 'notice',\n value: function notice(text, time) {\n var noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = 1;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n if (time && time < 0) {\n return;\n }\n this.noticeTime = setTimeout(function () {\n noticeEle.style.opacity = 0;\n }, time || 2000);\n }\n }]);\n\n return DPlayer;\n}();\n\nmodule.exports = DPlayer;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/*\n * xhr.status ---> fail\n * response.code === 1 ---> success\n * response.code !== 1 ---> error\n * */\n\nvar SendXMLHttpRequest = function SendXMLHttpRequest(url, data, success, error, fail) {\n var xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {\n var response = JSON.parse(xhr.responseText);\n\n if (response.code !== 1) {\n return error(xhr, response);\n }\n\n return success(xhr, response);\n }\n\n fail(xhr);\n }\n };\n\n xhr.open(data !== null ? 'POST' : 'GET', url, true);\n xhr.send(data !== null ? JSON.stringify(data) : null);\n};\n\nmodule.exports = {\n send: function send(endpoint, danmakuData) {\n SendXMLHttpRequest(endpoint, danmakuData, function (xhr, response) {\n console.log('Post danmaku: ', response);\n }, function (xhr, response) {\n alert(response.msg);\n }, function (xhr) {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n\n read: function read(endpoint, cbk) {\n SendXMLHttpRequest(endpoint, null, function (xhr, response) {\n cbk(null, response.danmaku);\n }, function (xhr, response) {\n cbk({ status: xhr.status, response: response });\n }, function (xhr) {\n cbk({ status: xhr.status, response: null });\n });\n }\n};\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// DPlayer.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\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, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ff2c376758a41e638e40","/**\n* SVG used by DPlayer\n*/\n\nconst svgSource = {\n 'play': ['0 0 16 32', 'M15.552 15.168q0.448 0.32 0.448 0.832 0 0.448-0.448 0.768l-13.696 8.512q-0.768 0.512-1.312 0.192t-0.544-1.28v-16.448q0-0.96 0.544-1.28t1.312 0.192z'],\n 'pause': ['0 0 17 32', 'M14.080 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048zM2.88 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048z'],\n 'volume-up': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528zM25.152 16q0 2.72-1.536 5.056t-4 3.36q-0.256 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.704 0.672-1.056 1.024-0.512 1.376-0.8 1.312-0.96 2.048-2.4t0.736-3.104-0.736-3.104-2.048-2.4q-0.352-0.288-1.376-0.8-0.672-0.352-0.672-1.056 0-0.448 0.32-0.8t0.8-0.352q0.224 0 0.48 0.096 2.496 1.056 4 3.36t1.536 5.056zM29.728 16q0 4.096-2.272 7.552t-6.048 5.056q-0.224 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.64 0.704-1.056 0.128-0.064 0.384-0.192t0.416-0.192q0.8-0.448 1.44-0.896 2.208-1.632 3.456-4.064t1.216-5.152-1.216-5.152-3.456-4.064q-0.64-0.448-1.44-0.896-0.128-0.096-0.416-0.192t-0.384-0.192q-0.704-0.416-0.704-1.056 0-0.448 0.32-0.8t0.832-0.352q0.224 0 0.448 0.096 3.776 1.632 6.048 5.056t2.272 7.552z'],\n 'volume-down': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528z'],\n 'volume-off': ['0 0 21 32', 'M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8z'],\n 'loop': ['0 0 32 32', 'M1.882 16.941c0 4.152 3.221 7.529 7.177 7.529v1.882c-4.996 0-9.060-4.222-9.060-9.412s4.064-9.412 9.060-9.412h7.96l-3.098-3.098 1.331-1.331 5.372 5.37-5.37 5.372-1.333-1.333 3.1-3.098h-7.962c-3.957 0-7.177 3.377-7.177 7.529zM22.94 7.529v1.882c3.957 0 7.177 3.377 7.177 7.529s-3.221 7.529-7.177 7.529h-7.962l3.098-3.098-1.331-1.331-5.37 5.37 5.372 5.372 1.331-1.331-3.1-3.1h7.96c4.998 0 9.062-4.222 9.062-9.412s-4.064-9.412-9.060-9.412z'],\n 'full': ['0 0 32 33', 'M6.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v4h4c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333zM30.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h4v-4c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM30.667 12c-0.8 0-1.333-0.533-1.333-1.333v-4h-4c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM1.333 12c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-4v4c0 0.8-0.533 1.333-1.333 1.333z'],\n 'full-in': ['0 0 32 33', 'M24.965 24.38h-18.132c-1.366 0-2.478-1.113-2.478-2.478v-11.806c0-1.364 1.111-2.478 2.478-2.478h18.132c1.366 0 2.478 1.113 2.478 2.478v11.806c0 1.364-1.11 2.478-2.478 2.478zM6.833 10.097v11.806h18.134l-0.002-11.806h-18.132zM2.478 28.928h5.952c0.684 0 1.238-0.554 1.238-1.239 0-0.684-0.554-1.238-1.238-1.238h-5.952v-5.802c0-0.684-0.554-1.239-1.238-1.239s-1.239 0.556-1.239 1.239v5.802c0 1.365 1.111 2.478 2.478 2.478zM30.761 19.412c-0.684 0-1.238 0.554-1.238 1.238v5.801h-5.951c-0.686 0-1.239 0.554-1.239 1.238 0 0.686 0.554 1.239 1.239 1.239h5.951c1.366 0 2.478-1.111 2.478-2.478v-5.801c0-0.683-0.554-1.238-1.239-1.238zM0 5.55v5.802c0 0.683 0.554 1.238 1.238 1.238s1.238-0.555 1.238-1.238v-5.802h5.952c0.684 0 1.238-0.554 1.238-1.238s-0.554-1.238-1.238-1.238h-5.951c-1.366-0.001-2.478 1.111-2.478 2.476zM32 11.35v-5.801c0-1.365-1.11-2.478-2.478-2.478h-5.951c-0.686 0-1.239 0.554-1.239 1.238s0.554 1.238 1.239 1.238h5.951v5.801c0 0.683 0.554 1.237 1.238 1.237 0.686 0.002 1.239-0.553 1.239-1.236z'],\n 'setting': ['0 0 32 28', 'M28.633 17.104c0.035 0.21 0.026 0.463-0.026 0.76s-0.14 0.598-0.262 0.904c-0.122 0.306-0.271 0.581-0.445 0.825s-0.367 0.419-0.576 0.524c-0.209 0.105-0.393 0.157-0.55 0.157s-0.332-0.035-0.524-0.105c-0.175-0.052-0.393-0.1-0.655-0.144s-0.528-0.052-0.799-0.026c-0.271 0.026-0.541 0.083-0.812 0.17s-0.502 0.236-0.694 0.445c-0.419 0.437-0.664 0.934-0.734 1.493s0.009 1.092 0.236 1.598c0.175 0.349 0.148 0.699-0.079 1.048-0.105 0.14-0.271 0.284-0.498 0.432s-0.476 0.284-0.747 0.406-0.555 0.218-0.851 0.288c-0.297 0.070-0.559 0.105-0.786 0.105-0.157 0-0.306-0.061-0.445-0.183s-0.236-0.253-0.288-0.393h-0.026c-0.192-0.541-0.52-1.009-0.982-1.402s-1-0.589-1.611-0.589c-0.594 0-1.131 0.197-1.611 0.589s-0.816 0.851-1.009 1.375c-0.087 0.21-0.218 0.362-0.393 0.458s-0.367 0.144-0.576 0.144c-0.244 0-0.52-0.044-0.825-0.131s-0.611-0.197-0.917-0.327c-0.306-0.131-0.581-0.284-0.825-0.458s-0.428-0.349-0.55-0.524c-0.087-0.122-0.135-0.266-0.144-0.432s0.057-0.397 0.197-0.694c0.192-0.402 0.266-0.86 0.223-1.375s-0.266-0.991-0.668-1.428c-0.244-0.262-0.541-0.432-0.891-0.511s-0.681-0.109-0.995-0.092c-0.367 0.017-0.742 0.087-1.127 0.21-0.244 0.070-0.489 0.052-0.734-0.052-0.192-0.070-0.371-0.231-0.537-0.485s-0.314-0.533-0.445-0.838c-0.131-0.306-0.231-0.62-0.301-0.943s-0.087-0.59-0.052-0.799c0.052-0.384 0.227-0.629 0.524-0.734 0.524-0.21 0.995-0.555 1.415-1.035s0.629-1.017 0.629-1.611c0-0.611-0.21-1.144-0.629-1.598s-0.891-0.786-1.415-0.996c-0.157-0.052-0.288-0.179-0.393-0.38s-0.157-0.406-0.157-0.616c0-0.227 0.035-0.48 0.105-0.76s0.162-0.55 0.275-0.812 0.244-0.502 0.393-0.72c0.148-0.218 0.31-0.38 0.485-0.485 0.14-0.087 0.275-0.122 0.406-0.105s0.275 0.052 0.432 0.105c0.524 0.21 1.070 0.275 1.637 0.197s1.070-0.327 1.506-0.747c0.21-0.209 0.362-0.467 0.458-0.773s0.157-0.607 0.183-0.904c0.026-0.297 0.026-0.568 0-0.812s-0.048-0.419-0.065-0.524c-0.035-0.105-0.066-0.227-0.092-0.367s-0.013-0.262 0.039-0.367c0.105-0.244 0.293-0.458 0.563-0.642s0.563-0.336 0.878-0.458c0.314-0.122 0.62-0.214 0.917-0.275s0.533-0.092 0.707-0.092c0.227 0 0.406 0.074 0.537 0.223s0.223 0.301 0.275 0.458c0.192 0.471 0.507 0.886 0.943 1.244s0.952 0.537 1.546 0.537c0.611 0 1.153-0.17 1.624-0.511s0.803-0.773 0.996-1.297c0.070-0.14 0.179-0.284 0.327-0.432s0.301-0.223 0.458-0.223c0.244 0 0.511 0.035 0.799 0.105s0.572 0.166 0.851 0.288c0.279 0.122 0.537 0.279 0.773 0.472s0.423 0.402 0.563 0.629c0.087 0.14 0.113 0.293 0.079 0.458s-0.070 0.284-0.105 0.354c-0.227 0.506-0.297 1.039-0.21 1.598s0.341 1.048 0.76 1.467c0.419 0.419 0.934 0.651 1.546 0.694s1.179-0.057 1.703-0.301c0.14-0.087 0.31-0.122 0.511-0.105s0.371 0.096 0.511 0.236c0.262 0.244 0.493 0.616 0.694 1.113s0.336 1 0.406 1.506c0.035 0.297-0.013 0.528-0.144 0.694s-0.266 0.275-0.406 0.327c-0.542 0.192-1.004 0.528-1.388 1.009s-0.576 1.026-0.576 1.637c0 0.594 0.162 1.113 0.485 1.559s0.747 0.764 1.27 0.956c0.122 0.070 0.227 0.14 0.314 0.21 0.192 0.157 0.323 0.358 0.393 0.602v0zM16.451 19.462c0.786 0 1.528-0.149 2.227-0.445s1.305-0.707 1.821-1.231c0.515-0.524 0.921-1.131 1.218-1.821s0.445-1.428 0.445-2.214c0-0.786-0.148-1.524-0.445-2.214s-0.703-1.292-1.218-1.808c-0.515-0.515-1.122-0.921-1.821-1.218s-1.441-0.445-2.227-0.445c-0.786 0-1.524 0.148-2.214 0.445s-1.292 0.703-1.808 1.218c-0.515 0.515-0.921 1.118-1.218 1.808s-0.445 1.428-0.445 2.214c0 0.786 0.149 1.524 0.445 2.214s0.703 1.297 1.218 1.821c0.515 0.524 1.118 0.934 1.808 1.231s1.428 0.445 2.214 0.445v0z'],\n 'right': ['0 0 32 32', 'M22 16l-10.105-10.6-1.895 1.987 8.211 8.613-8.211 8.612 1.895 1.988 8.211-8.613z'],\n 'comment': ['0 0 32 32', 'M27.128 0.38h-22.553c-2.336 0-4.229 1.825-4.229 4.076v16.273c0 2.251 1.893 4.076 4.229 4.076h4.229v-2.685h8.403l-8.784 8.072 1.566 1.44 7.429-6.827h9.71c2.335 0 4.229-1.825 4.229-4.076v-16.273c0-2.252-1.894-4.076-4.229-4.076zM28.538 19.403c0 1.5-1.262 2.717-2.819 2.717h-8.36l-0.076-0.070-0.076 0.070h-11.223c-1.557 0-2.819-1.217-2.819-2.717v-13.589c0-1.501 1.262-2.718 2.819-2.718h19.734c1.557 0 2.819-0.141 2.819 1.359v14.947zM9.206 10.557c-1.222 0-2.215 0.911-2.215 2.036s0.992 2.035 2.215 2.035c1.224 0 2.216-0.911 2.216-2.035s-0.992-2.036-2.216-2.036zM22.496 10.557c-1.224 0-2.215 0.911-2.215 2.036s0.991 2.035 2.215 2.035c1.224 0 2.215-0.911 2.215-2.035s-0.991-2.036-2.215-2.036zM15.852 10.557c-1.224 0-2.215 0.911-2.215 2.036s0.991 2.035 2.215 2.035c1.222 0 2.215-0.911 2.215-2.035s-0.992-2.036-2.215-2.036z'],\n 'comment-off': ['0 0 32 32', 'M27.090 0.131h-22.731c-2.354 0-4.262 1.839-4.262 4.109v16.401c0 2.269 1.908 4.109 4.262 4.109h4.262v-2.706h8.469l-8.853 8.135 1.579 1.451 7.487-6.88h9.787c2.353 0 4.262-1.84 4.262-4.109v-16.401c0-2.27-1.909-4.109-4.262-4.109v0zM28.511 19.304c0 1.512-1.272 2.738-2.841 2.738h-8.425l-0.076-0.070-0.076 0.070h-11.311c-1.569 0-2.841-1.226-2.841-2.738v-13.696c0-1.513 1.272-2.739 2.841-2.739h19.889c1.569 0 2.841-0.142 2.841 1.37v15.064z'],\n 'send': ['0 0 32 32', 'M13.725 30l3.9-5.325-3.9-1.125v6.45zM0 17.5l11.050 3.35 13.6-11.55-10.55 12.425 11.8 3.65 6.1-23.375-32 15.5z'],\n 'menu': ['0 0 22 32', 'M20.8 14.4q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2zM1.6 11.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2zM20.8 20.8q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2z'],\n 'camera': ['0 0 32 32', 'M16 23c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6zM16 13c-2.206 0-4 1.794-4 4s1.794 4 4 4c2.206 0 4-1.794 4-4s-1.794-4-4-4zM27 28h-22c-1.654 0-3-1.346-3-3v-16c0-1.654 1.346-3 3-3h3c0.552 0 1 0.448 1 1s-0.448 1-1 1h-3c-0.551 0-1 0.449-1 1v16c0 0.552 0.449 1 1 1h22c0.552 0 1-0.448 1-1v-16c0-0.551-0.448-1-1-1h-11c-0.552 0-1-0.448-1-1s0.448-1 1-1h11c1.654 0 3 1.346 3 3v16c0 1.654-1.346 3-3 3zM24 10.5c0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5zM15 4c0 0.552-0.448 1-1 1h-4c-0.552 0-1-0.448-1-1v0c0-0.552 0.448-1 1-1h4c0.552 0 1 0.448 1 1v0z']\n};\n\nmodule.exports = (type) => `\n \n \n \n \n`;\n\n\n// WEBPACK FOOTER //\n// ./src/svg.js","const svg = require('./svg.js');\n\nconst html = {\n main: (option, index, tran) => {\n let videos = ``;\n for (let i = 0; i < option.video.url.length; i++) {\n videos += html.video(i === 0, option.video.pic, option.screenshot, option.video.url.length ? 'metadata' : option.preload, option.video.url[i]);\n }\n return `\n \n \n ${videos}\n ${option.logo ? `\n
\n ` : ``}\n
\n
\n \n ${option.danmaku ? `${tran('Danmaku is loading')}` : ``}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n
\n
\n
\n
\n
\n
\n
0:00 / 0:00\n
\n
\n ${option.video.quality ? `\n
\n
\n
\n ${html.qualityList(option.video.quality)}\n
\n
\n ` : ``}\n ${option.screenshot ? `\n
\n ${svg('camera')}\n \n ` : ``}\n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n ${html.contextmenuList(option.contextmenu)}\n `;\n },\n\n contextmenuList: (contextmenu) => {\n let result = '';\n\n return result;\n },\n\n qualityList: (quality) => {\n let result = '';\n for (let i = 0; i < quality.length; i++) {\n result += `
${quality[i].name}
`;\n }\n result += '
';\n\n return result;\n },\n\n video: (current, pic, screenshot, preload, url) => ``,\n\n setting: (tran) => ({\n 'original': `\n \n
${tran('Speed')}\n
\n ${svg('right')}\n
\n
\n \n
${tran('Loop')}\n
\n \n \n
\n
\n \n
${tran('Danmaku')}\n
\n \n \n
\n
\n \n
${tran('Opacity for danmaku')}\n
\n
`,\n 'speed': `\n \n 0.5\n
\n \n 0.75\n
\n \n ${tran('Normal')}\n
\n \n 1.25\n
\n \n 1.5\n
\n \n 2\n
`\n }) \n};\n\nmodule.exports = html;\n\n\n// WEBPACK FOOTER //\n// ./src/html.js","const tranZH = {\n 'Danmaku is loading': '弹幕加载中',\n 'Top': '顶部',\n 'Bottom': '底部',\n 'Rolling': '滚动',\n 'Input danmaku, hit Enter': '输入弹幕,回车发送',\n 'About author': '关于作者',\n 'DPlayer feedback': '播放器意见反馈',\n 'About DPlayer': '关于 DPlayer 播放器',\n 'Loop': '洗脑循环',\n 'Speed': '速度',\n 'Opacity for danmaku': '弹幕透明度',\n 'Normal': '正常',\n 'Please input danmaku content!': '要输入弹幕内容啊喂!',\n 'Set danmaku color': '设置弹幕颜色',\n 'Set danmaku type': '设置弹幕类型',\n 'Danmaku': '弹幕',\n 'This video fails to load': '视频加载失败',\n 'Switching to': '正在切换至',\n 'Switched to': '已经切换至',\n 'quality': '画质',\n};\n\nmodule.exports = function (lang) {\n this.lang = lang;\n this.tran = (text) => {\n if (this.lang === 'en') {\n return text;\n }\n else if (this.lang === 'zh') {\n return tranZH[text];\n }\n };\n};\n\n\n// WEBPACK FOOTER //\n// ./src/i18n.js","const defaultApiBackend = require('./api.js');\n\nmodule.exports = (option) => {\n const isMobile = /mobile/i.test(window.navigator.userAgent);\n // compatibility: some mobile browsers don't suppose autoplay\n if (isMobile) {\n option.autoplay = false;\n }\n\n // default options\n const defaultOption = {\n element: document.getElementsByClassName('dplayer')[0],\n autoplay: false,\n theme: '#b7daff',\n loop: false,\n lang: navigator.language.indexOf('zh') !== -1 ? 'zh' : 'en',\n screenshot: false,\n hotkey: true,\n preload: 'auto',\n apiBackend: defaultApiBackend,\n contextmenu: [\n {\n text: '关于作者',\n link: 'http://diygod.me'\n },\n {\n text: '播放器意见反馈',\n link: 'https://github.com/DIYgod/DPlayer/issues'\n },\n {\n text: '关于 DPlayer 播放器',\n link: 'https://github.com/DIYgod/DPlayer'\n }\n ]\n };\n for (const defaultKey in defaultOption) {\n if (defaultOption.hasOwnProperty(defaultKey) && !option.hasOwnProperty(defaultKey)) {\n option[defaultKey] = defaultOption[defaultKey];\n }\n }\n if (Object.prototype.toString.call(option.video.url) !== '[object Array]') {\n option.video.url = [option.video.url];\n }\n if (option.video && !option.video.hasOwnProperty('type')) {\n option.video.type = 'auto';\n }\n if (option.danmaku && !option.danmaku.hasOwnProperty('user')) {\n option.danmaku.user = 'DIYgod';\n }\n\n if (option.video.quality) {\n option.video.url = [option.video.quality[option.video.defaultQuality].url];\n }\n\n return option;\n};\n\n\n// WEBPACK FOOTER //\n// ./src/option.js","module.exports = {\n\n /**\n * Parse second to 00:00 format\n *\n * @param {Number} second\n * @return {String} 00:00 format\n */\n secondToTime: (second) => {\n const add0 = (num) => num < 10 ? '0' + num : '' + num;\n const min = parseInt(second / 60);\n const sec = parseInt(second - min * 60);\n return add0(min) + ':' + add0(sec);\n },\n\n /**\n * control play progress\n */\n // get element's view position\n getElementViewLeft: (element) => {\n let actualLeft = element.offsetLeft;\n let current = element.offsetParent;\n const elementScrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft;\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) {\n while (current !== null) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n }\n else {\n while (current !== null && current !== this.element) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n }\n return actualLeft - elementScrollLeft;\n },\n};\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","class Video {\n constructor (videos, duration) {\n this.videos = videos;\n this.multi = this.videos.length > 1;\n this.index = 0;\n this.current = this.videos[this.index];\n\n this.duration = duration || 0;\n this.durationArr = [];\n this.eventAll = [];\n this.eventCurrent = [];\n \n this.on('all', 'durationchange', (i, video) => {\n if (video.duration !== 1) { // some Android browsers will output 1 at first\n this.durationArr[i] = video.duration;\n if (!duration) {\n this.duration = this.durationArr.reduce((sum, cur) => sum + cur); \n }\n }\n });\n this.on('current', 'end', () => {\n this.switch(this.index + 1);\n });\n }\n\n switch (index, time) {\n if (this.index !== index) {\n this.videos[index].classList.add('dplayer-video-current');\n if (!this.current.paused) {\n this.videos[index].play();\n }\n this.current.classList.remove('dplayer-video-current');\n this.current.pause();\n\n this.index = index;\n this.current = this.videos[this.index];\n this.videos[index].currentTime = time ? time : 0;\n }\n else {\n this.videos[index].currentTime = time ? time : 0;\n }\n }\n\n // bind event \n on (type, event, callback) {\n if (typeof callback === 'function') {\n if (type === 'all') {\n if (!this.eventAll[event]) {\n this.eventAll[event] = [];\n }\n this.eventAll[event].push(callback);\n }\n else {\n if (!this.eventCurrent[event]) {\n this.eventCurrent[event] = [];\n }\n this.eventCurrent[event].push(callback);\n }\n\n if (['seeking'].indexOf(event) === -1) {\n for (let i = 0; i < this.videos.length; i++) {\n this.videos[i].addEventListener(event, () => {\n if (type === 'all' || this.videos[i] === this.current) {\n callback(i, this.videos[i]);\n }\n });\n }\n }\n }\n }\n\n // trigger event\n trigger (type, event) {\n const events = type === 'all' ? this.eventAll : this.eventCurrent;\n for (let i = 0; i < events[event].length; i++) {\n events[event][i]();\n }\n }\n\n currentTime () {\n if (this.durationArr.slice(0, this.index).length) {\n return this.durationArr.slice(0, this.index).reduce((sum, cur) => sum + cur) + this.current.currentTime;\n }\n else {\n return this.current.currentTime;\n }\n }\n\n seek (time) {\n time = Math.max(time, 0);\n time = Math.min(time, this.duration);\n console.log(time);\n\n let i = 0;\n let tmptime = 0;\n while (tmptime <= time) {\n tmptime += this.durationArr[i];\n i++;\n }\n\n let currentTime;\n if (this.durationArr.slice(0, this.index).length) {\n currentTime = time - this.durationArr.slice(0, i - 1).reduce((sum, cur) => sum + cur);\n }\n else {\n currentTime = time;\n }\n \n this.switch(i - 1, currentTime);\n\n this.trigger('all', 'seeking');\n }\n\n attr (option, value) {\n if (value !== undefined) {\n for (let i = 0; i < this.videos.length; i++) {\n this.videos[i][option] = value;\n }\n }\n return this.current[option];\n }\n\n play () {\n this.current.play();\n }\n\n pause () {\n this.current.pause();\n }\n\n toggle () {\n this.current.paused ? this.play() : this.pause();\n }\n}\n\nmodule.exports = Video;\n\n\n// WEBPACK FOOTER //\n// ./src/video.js","console.log('\\n %c DPlayer 1.3.1 %c http://dplayer.js.org \\n\\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');\n\nrequire('./DPlayer.scss');\nconst utils = require('./utils.js');\nconst svg = require('./svg.js');\nconst handleOption = require('./option.js');\nconst i18n = require('./i18n.js');\nconst html = require('./html.js');\nconst Video = require('./video.js');\nconst isMobile = /mobile/i.test(window.navigator.userAgent);\n\nlet index = 0;\n\nclass DPlayer {\n \n /**\n * DPlayer constructor function\n *\n * @param {Object} option - See README\n * @constructor\n */\n constructor (option) {\n this.option = handleOption(option);\n\n this.option.element.classList.add('dplayer');\n\n if (this.option.video.quality) {\n this.qualityIndex = this.option.video.defaultQuality;\n this.quality = this.option.video.quality[this.option.video.defaultQuality];\n }\n\n this.tran = new i18n(this.option.lang).tran;\n\n /**\n * Update progress bar, including loading progress bar and play progress bar\n *\n * @param {String} type - Point out which bar it is, should be played loaded or volume\n * @param {Number} percentage\n * @param {String} direction - Point out the direction of this bar, Should be height or width\n */\n this.updateBar = (type, percentage, direction) => {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n bar[type + 'Bar'].style[direction] = percentage * 100 + '%';\n };\n\n // define DPlayer events\n const eventTypes = ['play', 'pause', 'canplay', 'playing', 'ended', 'error'];\n this.event = {};\n for (let i = 0; i < eventTypes.length; i++) {\n this.event[eventTypes[i]] = [];\n }\n this.trigger = (type) => {\n for (let i = 0; i < this.event[type].length; i++) {\n this.event[type][i]();\n }\n };\n\n this.element = this.option.element;\n if (!this.option.danmaku) {\n this.element.classList.add('dplayer-no-danmaku');\n }\n if (isMobile) {\n this.element.classList.add('dplayer-mobile');\n }\n\n this.element.innerHTML = html.main(option, index, this.tran);\n\n // arrow style\n this.arrow = this.element.offsetWidth <= 500;\n if (this.arrow) {\n const arrowStyle = document.createElement('style');\n arrowStyle.innerHTML = `.dplayer .dplayer-danmaku{font-size:18px}`;\n document.head.appendChild(arrowStyle);\n }\n\n // get this video manager\n this.video = new Video(this.element.getElementsByClassName('dplayer-video-current'));\n\n this.initVideo();\n\n this.bezel = this.element.getElementsByClassName('dplayer-bezel-icon')[0];\n this.bezel.addEventListener('animationend', () => {\n this.bezel.classList.remove('dplayer-bezel-transition');\n });\n\n // play and pause button\n this.playButton = this.element.getElementsByClassName('dplayer-play-icon')[0];\n this.paused = true;\n this.playButton.addEventListener('click', () => {\n this.toggle();\n });\n\n const videoWrap = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n const conMask = this.element.getElementsByClassName('dplayer-controller-mask')[0];\n if (!isMobile) {\n videoWrap.addEventListener('click', () => {\n this.toggle();\n });\n conMask.addEventListener('click', () => {\n this.toggle();\n });\n }\n else {\n const toggleController = () => {\n if (this.element.classList.contains('dplayer-hide-controller')) {\n this.element.classList.remove('dplayer-hide-controller');\n }\n else {\n this.element.classList.add('dplayer-hide-controller');\n }\n };\n videoWrap.addEventListener('click', toggleController);\n conMask.addEventListener('click', toggleController);\n }\n\n const bar = {};\n bar.playedBar = this.element.getElementsByClassName('dplayer-played')[0];\n bar.loadedBar = this.element.getElementsByClassName('dplayer-loaded')[0];\n const pbar = this.element.getElementsByClassName('dplayer-bar-wrap')[0];\n const pbarTimeTips = this.element.getElementsByClassName('dplayer-bar-time')[0];\n let barWidth;\n\n let lastPlayPos = 0;\n let currentPlayPos = 0;\n let bufferingDetected = false;\n let danmakuTime;\n this.setTime = () => {\n this.playedTime = setInterval(() => {\n // whether the video is buffering\n currentPlayPos = this.video.currentTime();\n if (!bufferingDetected\n && currentPlayPos < lastPlayPos + 0.01\n && !this.video.attr('paused')) {\n this.element.classList.add('dplayer-loading');\n bufferingDetected = true;\n }\n if (bufferingDetected\n && currentPlayPos > lastPlayPos + 0.01\n && !this.video.attr('paused')) {\n this.element.classList.remove('dplayer-loading');\n bufferingDetected = false;\n }\n lastPlayPos = currentPlayPos;\n\n this.updateBar('played', this.video.currentTime() / this.video.duration, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = utils.secondToTime(this.video.currentTime());\n this.trigger('playing');\n }, 100);\n if (this.option.danmaku && showdan) {\n danmakuTime = setInterval(() => {\n if (this.dan) {\n let item = this.dan[this.danIndex];\n while (item && this.video.currentTime() > parseFloat(item.time)) {\n this.pushDanmaku(item.text, item.color, item.type);\n item = this.dan[++this.danIndex];\n }\n }\n }, 100);\n }\n };\n this.clearTime = () => {\n clearInterval(this.playedTime);\n if (this.option.danmaku) {\n clearInterval(danmakuTime);\n }\n };\n\n pbar.addEventListener('click', (event) => {\n const e = event || window.event;\n barWidth = pbar.clientWidth;\n let percentage = (e.clientX - utils.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('played', percentage, 'width');\n this.video.seek(parseFloat(bar.playedBar.style.width) / 100 * this.video.duration);\n });\n\n this.isTipsShow = false;\n this.timeTipsHandler = this.timeTipsHandler(\n pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.timeTipsHandler);\n pbar.addEventListener('mouseover', this.timeTipsHandler);\n pbar.addEventListener('mouseenter', this.timeTipsHandler);\n pbar.addEventListener('mouseout', this.timeTipsHandler);\n pbar.addEventListener('mouseleave', this.timeTipsHandler);\n\n const thumbMove = (event) => {\n const e = event || window.event;\n let percentage = (e.clientX - utils.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('played', percentage, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = utils.secondToTime(percentage * this.video.duration);\n };\n\n const thumbUp = () => {\n document.removeEventListener('mouseup', thumbUp);\n document.removeEventListener('mousemove', thumbMove);\n this.video.seek(parseFloat(bar.playedBar.style.width) / 100 * this.video.duration);\n this.setTime();\n };\n\n pbar.addEventListener('mousedown', () => {\n barWidth = pbar.clientWidth;\n this.clearTime();\n document.addEventListener('mousemove', thumbMove);\n document.addEventListener('mouseup', thumbUp);\n });\n\n\n /**\n * control volume\n */\n bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\n const volumeEle = this.element.getElementsByClassName('dplayer-volume')[0];\n const volumeBarWrapWrap = this.element.getElementsByClassName('dplayer-volume-bar-wrap')[0];\n const volumeBarWrap = this.element.getElementsByClassName('dplayer-volume-bar')[0];\n const volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0];\n const vWidth = 35;\n\n this.switchVolumeIcon = () => {\n const volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (this.video.attr('volume') >= 0.8) {\n volumeicon.innerHTML = svg('volume-up');\n }\n else if (this.video.attr('volume') > 0) {\n volumeicon.innerHTML = svg('volume-down');\n }\n else {\n volumeicon.innerHTML = svg('volume-off');\n }\n };\n const volumeMove = (event) => {\n const e = event || window.event;\n const percentage = (e.clientX - utils.getElementViewLeft(volumeBarWrap) - 5.5) / vWidth;\n this.volume(percentage);\n };\n const volumeUp = () => {\n document.removeEventListener('mouseup', volumeUp);\n document.removeEventListener('mousemove', volumeMove);\n volumeEle.classList.remove('dplayer-volume-active');\n };\n\n volumeBarWrapWrap.addEventListener('click', (event) => {\n const e = event || window.event;\n const percentage = (e.clientX - utils.getElementViewLeft(volumeBarWrap) - 5.5) / vWidth;\n this.volume(percentage);\n });\n volumeBarWrapWrap.addEventListener('mousedown', () => {\n document.addEventListener('mousemove', volumeMove);\n document.addEventListener('mouseup', volumeUp);\n volumeEle.classList.add('dplayer-volume-active');\n });\n volumeicon.addEventListener('click', () => {\n if (this.video.attr('muted')) {\n this.video.attr('muted', false);\n this.switchVolumeIcon();\n this.updateBar('volume', this.video.attr('volume'), 'width');\n }\n else {\n this.video.attr('muted', true);\n volumeicon.innerHTML = svg('volume-off');\n this.updateBar('volume', 0, 'width');\n }\n });\n\n\n /**\n * auto hide controller\n */\n let hideTime = 0;\n if (!isMobile) {\n const hideController = () => {\n this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(hideTime);\n hideTime = setTimeout(() => {\n if (this.video.attr('played').length) {\n this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n\n\n /**\n * setting\n */\n this.danOpacity = localStorage.getItem('DPlayer-opacity') || 0.7;\n const settingHTML = html.setting(this.tran);\n\n // toggle setting box\n const settingIcon = this.element.getElementsByClassName('dplayer-setting-icon')[0];\n const settingBox = this.element.getElementsByClassName('dplayer-setting-box')[0];\n const mask = this.element.getElementsByClassName('dplayer-mask')[0];\n settingBox.innerHTML = settingHTML.original;\n\n const closeSetting = () => {\n if (settingBox.classList.contains('dplayer-setting-box-open')) {\n settingBox.classList.remove('dplayer-setting-box-open');\n mask.classList.remove('dplayer-mask-show');\n setTimeout(() => {\n settingBox.classList.remove('dplayer-setting-box-narrow');\n settingBox.innerHTML = settingHTML.original;\n settingEvent();\n }, 300);\n }\n };\n const openSetting = () => {\n settingBox.classList.add('dplayer-setting-box-open');\n mask.classList.add('dplayer-mask-show');\n };\n\n mask.addEventListener('click', () => {\n closeSetting();\n });\n settingIcon.addEventListener('click', () => {\n openSetting();\n });\n\n this.loop = this.option.loop;\n const danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n let showdan = true;\n const settingEvent = () => {\n // loop control\n const loopEle = this.element.getElementsByClassName('dplayer-setting-loop')[0];\n const loopToggle = loopEle.getElementsByClassName('dplayer-toggle-setting-input')[0];\n\n loopToggle.checked = this.loop;\n\n loopEle.addEventListener('click', () => {\n loopToggle.checked = !loopToggle.checked;\n if (loopToggle.checked) {\n this.loop = true;\n }\n else {\n this.loop = false;\n }\n closeSetting();\n });\n\n // show danmaku control\n const showDanEle = this.element.getElementsByClassName('dplayer-setting-showdan')[0];\n const showDanToggle = showDanEle.getElementsByClassName('dplayer-showdan-setting-input')[0];\n\n showDanToggle.checked = showdan;\n\n showDanEle.addEventListener('click', () => {\n showDanToggle.checked = !showDanToggle.checked;\n if (showDanToggle.checked) {\n showdan = true;\n if (this.option.danmaku) {\n for (let i = 0; i < this.dan.length; i++) {\n if (this.dan[i].time >= this.video.currentTime()) {\n this.danIndex = i;\n break;\n }\n this.danIndex = this.dan.length;\n }\n danmakuTime = setInterval(() => {\n let item = this.dan[this.danIndex];\n while (item && this.video.currentTime() >= parseFloat(item.time)) {\n this.pushDanmaku(item.text, item.color, item.type);\n item = this.dan[++this.danIndex];\n }\n }, 0);\n }\n }\n else {\n showdan = false;\n if (this.option.danmaku) {\n clearInterval(danmakuTime);\n danContainer.innerHTML = ``;\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.itemDemo = this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n }\n }\n closeSetting();\n });\n\n // speed control\n const speedEle = this.element.getElementsByClassName('dplayer-setting-speed')[0];\n speedEle.addEventListener('click', () => {\n settingBox.classList.add('dplayer-setting-box-narrow');\n settingBox.innerHTML = settingHTML.speed;\n\n const speedItem = settingBox.getElementsByClassName('dplayer-setting-speed-item');\n for (let i = 0; i < speedItem.length; i++) {\n speedItem[i].addEventListener('click', () => {\n this.video.attr('playbackRate', speedItem[i].dataset.speed);\n closeSetting();\n });\n }\n });\n\n if (this.option.danmaku) {\n // danmaku opacity\n bar.danmakuBar = this.element.getElementsByClassName('dplayer-danmaku-bar-inner')[0];\n const danmakuBarWrapWrap = this.element.getElementsByClassName('dplayer-danmaku-bar-wrap')[0];\n const danmakuBarWrap = this.element.getElementsByClassName('dplayer-danmaku-bar')[0];\n const danmakuSettingBox = this.element.getElementsByClassName('dplayer-setting-danmaku')[0];\n const dWidth = 130;\n this.updateBar('danmaku', this.danOpacity, 'width');\n\n const danmakuMove = (event) => {\n const e = event || window.event;\n let percentage = (e.clientX - utils.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('danmaku', percentage, 'width');\n const items = this.element.getElementsByClassName('dplayer-danmaku-item');\n for (let i = 0; i < items.length; i++) {\n items[i].style.opacity = percentage;\n }\n this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', this.danOpacity);\n };\n const danmakuUp = () => {\n document.removeEventListener('mouseup', danmakuUp);\n document.removeEventListener('mousemove', danmakuMove);\n danmakuSettingBox.classList.remove('dplayer-setting-danmaku-active');\n };\n\n danmakuBarWrapWrap.addEventListener('click', (event) => {\n const e = event || window.event;\n let percentage = (e.clientX - utils.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('danmaku', percentage, 'width');\n const items = this.element.getElementsByClassName('dplayer-danmaku-item');\n for (let i = 0; i < items.length; i++) {\n items[i].style.opacity = percentage;\n }\n this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', this.danOpacity);\n });\n danmakuBarWrapWrap.addEventListener('mousedown', () => {\n document.addEventListener('mousemove', danmakuMove);\n document.addEventListener('mouseup', danmakuUp);\n danmakuSettingBox.classList.add('dplayer-setting-danmaku-active');\n });\n }\n };\n settingEvent();\n\n // set duration time\n if (this.video.duration !== 1) { // compatibility: Android browsers will output 1 at first\n this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = this.video.duration ? utils.secondToTime(this.video.duration) : '00:00';\n }\n\n // danmaku\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.itemDemo = this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n\n if (this.option.danmaku) {\n this.danIndex = 0;\n this.readDanmaku();\n }\n else {\n // autoplay\n if (this.option.autoplay && !isMobile) {\n this.play();\n }\n else if (isMobile) {\n this.pause();\n }\n }\n\n\n /**\n * comment\n */\n const commentInput = this.element.getElementsByClassName('dplayer-comment-input')[0];\n const commentIcon = this.element.getElementsByClassName('dplayer-comment-icon')[0];\n const commentBox = this.element.getElementsByClassName('dplayer-comment-box')[0];\n const commentSettingIcon = this.element.getElementsByClassName('dplayer-comment-setting-icon')[0];\n const commentSettingBox = this.element.getElementsByClassName('dplayer-comment-setting-box')[0];\n const commentSendIcon = this.element.getElementsByClassName('dplayer-send-icon')[0];\n\n const htmlEncode = (str) => str.\n replace(/&/g, \"&\").\n replace(//g, \">\").\n replace(/\"/g, \""\").\n replace(/'/g, \"'\").\n replace(/\\//g, \"/\");\n\n const sendComment = () => {\n commentInput.blur();\n\n // text can't be empty\n if (!commentInput.value.replace(/^\\s+|\\s+$/g, '')) {\n this.notice(this.tran('Please input danmaku content!'));\n return;\n }\n\n const danmakuData = {\n token: this.option.danmaku.token,\n player: this.option.danmaku.id,\n author: this.option.danmaku.user,\n time: this.video.currentTime(),\n text: commentInput.value,\n color: this.element.querySelector('.dplayer-comment-setting-color input:checked').value,\n type: this.element.querySelector('.dplayer-comment-setting-type input:checked').value\n };\n this.option.apiBackend.send(this.option.danmaku.api, danmakuData);\n\n commentInput.value = '';\n closeComment();\n this.dan.splice(this.danIndex, 0, danmakuData);\n this.danIndex++;\n const item = this.pushDanmaku(htmlEncode(danmakuData.text), danmakuData.color, danmakuData.type);\n item.style.border = `2px solid ${this.option.theme}`;\n };\n\n const closeCommentSetting = () => {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n }\n };\n const toggleCommentSetting = () => {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n }\n else {\n commentSettingBox.classList.add('dplayer-comment-setting-open');\n }\n };\n\n let disableHide = 0;\n let commentFocusTimeout = 0;\n const closeComment = () => {\n if (!commentBox.classList.contains('dplayer-comment-box-open')) {\n return;\n }\n\n commentBox.classList.remove('dplayer-comment-box-open');\n mask.classList.remove('dplayer-mask-show');\n this.element.classList.remove('dplayer-show-controller');\n\n clearInterval(disableHide);\n clearTimeout(commentFocusTimeout);\n closeCommentSetting();\n };\n const openComment = () => {\n if (commentBox.classList.contains('dplayer-comment-box-open')) {\n return;\n }\n\n commentBox.classList.add('dplayer-comment-box-open');\n mask.classList.add('dplayer-mask-show');\n this.element.classList.add('dplayer-show-controller');\n\n disableHide = setInterval(() => {\n clearTimeout(hideTime);\n }, 1000);\n commentFocusTimeout = setTimeout(() => {\n commentInput.focus();\n }, 300);\n };\n\n mask.addEventListener('click', () => {\n closeComment();\n });\n commentIcon.addEventListener('click', () => {\n openComment();\n });\n commentSettingIcon.addEventListener('click', () => {\n toggleCommentSetting();\n });\n\n // comment setting box\n this.element.getElementsByClassName('dplayer-comment-setting-color')[0].addEventListener('click', () => {\n const sele = this.element.querySelector('input[name=\"dplayer-danmaku-color-${index}\"]:checked+span');\n if (sele) {\n commentSettingIcon.getElementsByClassName('dplayer-fill')[0].style.fill = this.element.querySelector('input[name=\"dplayer-danmaku-color-${index}\"]:checked').value;\n }\n });\n\n commentInput.addEventListener('click', () => {\n closeCommentSetting();\n });\n commentInput.addEventListener('keydown', (e) => {\n const event = e || window.event;\n if (event.keyCode === 13) {\n sendComment();\n }\n });\n\n commentSendIcon.addEventListener('click', sendComment);\n\n\n /**\n * full screen\n */\n const resetAnimation = () => {\n const danWidth = danContainer.offsetWidth;\n const items = this.element.getElementsByClassName('dplayer-danmaku-item');\n for (let i = 0; i < items.length; i++) {\n items[i].style.transform = `translateX(-${danWidth}px)`;\n }\n };\n\n this.element.addEventListener('fullscreenchange', () => {\n resetAnimation();\n });\n this.element.addEventListener('mozfullscreenchange', () => {\n resetAnimation();\n });\n this.element.addEventListener('webkitfullscreenchange', () => {\n resetAnimation();\n });\n // browser full screen\n this.element.getElementsByClassName('dplayer-full-icon')[0].addEventListener('click', () => {\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) {\n if (this.element.requestFullscreen) {\n this.element.requestFullscreen();\n }\n else if (this.element.mozRequestFullScreen) {\n this.element.mozRequestFullScreen();\n }\n else if (this.element.webkitRequestFullscreen) {\n this.element.webkitRequestFullscreen();\n }\n else if (this.video.attr('webkitEnterFullscreen')) { // Safari for iOS\n this.video.current.webkitEnterFullscreen();\n }\n }\n else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n }\n else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n }\n else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n resetAnimation();\n });\n // web full screen\n this.element.getElementsByClassName('dplayer-full-in-icon')[0].addEventListener('click', () => {\n if (this.element.classList.contains('dplayer-fulled')) {\n this.element.classList.remove('dplayer-fulled');\n }\n else {\n this.element.classList.add('dplayer-fulled');\n resetAnimation();\n }\n });\n\n /**\n * hot key\n */\n const handleKeyDown = (e) => {\n const tag = document.activeElement.tagName.toUpperCase();\n const editable = document.activeElement.getAttribute('contenteditable');\n if (tag !== 'INPUT' && tag !== 'TEXTAREA' && editable !== '' && editable !== 'true') {\n const event = e || window.event;\n let percentage;\n switch (event.keyCode) {\n case 32:\n event.preventDefault();\n this.toggle();\n break;\n case 37:\n event.preventDefault();\n this.video.seek(this.video.currentTime() - 5);\n break;\n case 39:\n event.preventDefault();\n this.video.seek(this.video.currentTime() + 5);\n break;\n case 38:\n event.preventDefault();\n percentage = this.video.attr('volume') + 0.1;\n this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = this.video.attr('volume') - 0.1;\n this.volume(percentage);\n break;\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', (e) => { // Press ESC to quit web full screen\n const event = e || window.event;\n switch (event.keyCode) {\n case 27:\n if (this.element.classList.contains('dplayer-fulled')) {\n this.element.classList.remove('dplayer-fulled');\n resetAnimation();\n }\n break;\n }\n });\n\n /**\n * right key\n */\n const menu = this.element.getElementsByClassName('dplayer-menu')[0];\n this.element.addEventListener('contextmenu', (e) => {\n const event = e || window.event;\n event.preventDefault();\n\n menu.classList.add('dplayer-menu-show');\n\n const clientRect = this.element.getBoundingClientRect();\n const menuLeft = event.clientX - clientRect.left;\n const menuTop = event.clientY - clientRect.top;\n if (menuLeft + menu.offsetWidth >= clientRect.width) {\n menu.style.right = clientRect.width - menuLeft + 'px';\n menu.style.left = 'initial';\n }\n else {\n menu.style.left = event.clientX - this.element.getBoundingClientRect().left + 'px';\n menu.style.right = 'initial';\n }\n if (menuTop + menu.offsetHeight >= clientRect.height) {\n menu.style.bottom = clientRect.height - menuTop + 'px';\n menu.style.top = 'initial';\n }\n else {\n menu.style.top = event.clientY - this.element.getBoundingClientRect().top + 'px';\n menu.style.bottom = 'initial';\n }\n\n mask.classList.add('dplayer-mask-show');\n mask.addEventListener('click', () => {\n mask.classList.remove('dplayer-mask-show');\n menu.classList.remove('dplayer-menu-show');\n });\n });\n\n /**\n * Switch quality\n */\n if (this.option.video.quality) {\n this.element.getElementsByClassName('dplayer-quality-list')[0].addEventListener('click', (e) => {\n if (e.target.classList.contains('dplayer-quality-item')) {\n this.switchQuality(e.target.dataset.index);\n }\n });\n }\n\n /**\n * Screenshot\n */\n if (this.option.screenshot) {\n const camareIcon = this.element.getElementsByClassName('dplayer-camera-icon')[0];\n camareIcon.addEventListener('click', () => {\n const canvas = document.createElement(\"canvas\");\n canvas.width = this.video.attr('videoWidth');\n canvas.height = this.video.attr('videoHeight');\n canvas.getContext('2d').drawImage(this.video.current, 0, 0, canvas.width, canvas.height);\n\n camareIcon.href = canvas.toDataURL();\n camareIcon.download = \"DPlayer.png\";\n });\n }\n\n index++;\n }\n\n /**\n * Play music\n */\n play (time) {\n if (Object.prototype.toString.call(time) === '[object Number]') {\n this.video.seek(time);\n }\n this.paused = false;\n if (this.video.attr('paused')) {\n this.bezel.innerHTML = svg('play');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n\n this.playButton.innerHTML = svg('pause');\n\n this.video.play();\n if (this.playedTime) {\n this.clearTime();\n }\n this.setTime();\n this.element.classList.add('dplayer-playing');\n this.trigger('play');\n }\n\n /**\n * Pause music\n */\n pause () {\n this.paused = true;\n this.element.classList.remove('dplayer-loading');\n\n if (!this.video.attr('paused')) {\n this.bezel.innerHTML = svg('pause');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n\n this.ended = false;\n this.playButton.innerHTML = svg('play');\n this.video.pause();\n this.clearTime();\n this.element.classList.remove('dplayer-playing');\n this.trigger('pause');\n }\n\n /**\n * Set volume\n */\n volume (percentage) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n this.video.attr('volume', percentage);\n if (this.video.attr('muted')) {\n this.video.attr('muted', false);\n }\n this.switchVolumeIcon();\n }\n\n /**\n * Toggle between play and pause\n */\n toggle () {\n if (this.video.attr('paused')) {\n this.play();\n }\n else {\n this.pause();\n }\n }\n\n /**\n * attach event\n */\n on (event, callback) {\n if (typeof callback === 'function') {\n this.event[event].push(callback);\n }\n }\n\n /**\n * Asynchronously read danmaku from all API endpoints\n */\n _readAllEndpoints (endpoints, finish) {\n const results = [];\n let readCount = 0;\n const cbk = (i) => (err, data) => {\n ++readCount;\n if (err) {\n if (err.response) {\n this.notice(err.response.msg); \n }\n else {\n this.notice('Request was unsuccessful: ' + err.status); \n }\n results[i] = [];\n }\n else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return finish(results);\n }\n };\n\n for (let i = 0; i < endpoints.length; ++i) {\n this.option.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n\n /**\n * Read danmaku from API\n */\n readDanmaku () {\n const isMobile = /mobile/i.test(window.navigator.userAgent);\n let apiurl;\n if (this.option.danmaku.maximum) {\n apiurl = `${this.option.danmaku.api}?id=${this.option.danmaku.id}&max=${this.option.danmaku.maximum}`;\n }\n else {\n apiurl = `${this.option.danmaku.api}?id=${this.option.danmaku.id}`;\n }\n const endpoints = (this.option.danmaku.addition || []).slice(0);\n endpoints.push(apiurl);\n\n this._readAllEndpoints(endpoints, (results) => {\n this.danIndex = 0;\n this.dan = [].concat.apply([], results).sort((a, b) => a.time - b.time);\n this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n\n // autoplay\n if (this.option.autoplay && !isMobile) {\n this.play();\n }\n else if (isMobile) {\n this.pause();\n }\n });\n }\n\n /**\n * Push a danmaku into DPlayer\n *\n * @param {String} text - danmaku content\n * @param {String} color - danmaku color, default: `#fff`\n * @param {String} type - danmaku type, `right` `top` `bottom`, default: `right`\n */\n pushDanmaku (text, color, type) {\n const danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n const itemHeight = this.arrow ? 24 : 30;\n const danWidth = danContainer.offsetWidth;\n const danHeight = danContainer.offsetHeight;\n const itemY = parseInt(danHeight / itemHeight);\n\n const danItemRight = (ele) => danContainer.getBoundingClientRect().right - ele.getBoundingClientRect().right;\n\n const danSpeed = (width) => (danWidth + width) / 5;\n\n const getTunnel = (ele, type, width) => {\n const tmp = danWidth / danSpeed(width);\n\n for (let i = 0; ; i++) {\n const item = this.danTunnel[type][i + ''];\n if (item && item.length) {\n for (let j = 0; j < item.length; j++) {\n const danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(item[j].offsetWidth) || danRight <= 0) {\n break;\n }\n if (j === item.length - 1) {\n this.danTunnel[type][i + ''].push(ele);\n ele.addEventListener('animationend', () => {\n this.danTunnel[type][i + ''].splice(0, 1);\n });\n return i % itemY;\n }\n }\n }\n else {\n this.danTunnel[type][i + ''] = [ele];\n ele.addEventListener('animationend', () => {\n this.danTunnel[type][i + ''].splice(0, 1);\n });\n return i % itemY;\n }\n }\n };\n\n if (!type) {\n type = 'right';\n }\n if (!color) {\n color = '#fff';\n }\n const item = document.createElement(`div`);\n item.classList.add(`dplayer-danmaku-item`);\n item.classList.add(`dplayer-danmaku-${type}`);\n item.innerHTML = text;\n item.style.opacity = this.danOpacity;\n item.style.color = color;\n item.addEventListener('animationend', () => {\n danContainer.removeChild(item);\n });\n\n // measure\n this.itemDemo.innerHTML = text;\n const itemWidth = this.itemDemo.offsetWidth;\n\n // adjust\n switch (type) {\n case 'right':\n item.style.top = itemHeight * getTunnel(item, type, itemWidth) + 'px';\n item.style.width = itemWidth + 1 + 'px';\n item.style.transform = `translateX(-${danWidth}px)`;\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, type) + 'px';\n break;\n default:\n console.error(`Can't handled danmaku type: ${type}`);\n }\n\n // insert\n danContainer.appendChild(item);\n\n // move\n item.classList.add(`dplayer-danmaku-move`);\n\n return item;\n }\n\n /**\n * Switch to a new video\n *\n * @param {Object} video - new video info\n * @param {Object} danmaku - new danmaku info\n */\n // TODO\n switchVideo (video, danmaku) {\n this.video.src = video.url;\n this.video.poster = video.pic ? video.pic : '';\n this.video.currentTime = 0;\n this.pause();\n if (danmaku) {\n this.dan = [];\n this.danIndex = 0;\n this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'block';\n this.updateBar('played', 0, 'width');\n this.updateBar('loaded', 0, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = '00:00';\n this.element.getElementsByClassName('dplayer-danmaku')[0].innerHTML = ``;\n this.danTuel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.itemDemo = this.element.getElementsByClassName('dplayer-danmaku-item')[0];\n this.option.danmaku = danmaku;\n this.readDanmaku();\n }\n }\n\n initVideo () {\n // Support HTTP Live Streaming\n let enablehls;\n if (this.option.video.type === 'auto') {\n enablehls = /m3u8(#|\\?|$)/i.exec(this.option.video.url);\n }\n else if (this.option.video.type === 'hls') {\n enablehls = true;\n }\n else {\n enablehls = false;\n }\n if (enablehls && Hls.isSupported()) {\n // this.element.getElementsByClassName('dplayer-time')[0].style.display = 'none';\n const hls = new Hls();\n hls.attachMedia(this.video.current);\n hls.on(Hls.Events.MEDIA_ATTACHED, () => {\n hls.loadSource(this.option.video.url);\n hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {\n this.notice(\"manifest loaded, found \" + data.levels.length + \" quality level\");\n });\n });\n }\n\n // Support FLV\n let enableflv;\n if (this.option.video.type === 'auto') {\n enableflv = /.flv(#|\\?|$)/i.exec(this.option.video.url);\n }\n else if (this.option.video.type === 'flv') {\n enableflv = true;\n }\n else {\n enableflv = false;\n }\n if (enableflv && flvjs.isSupported()) {\n const flvPlayer = flvjs.createPlayer({\n type: 'flv',\n url: this.option.video.url\n });\n flvPlayer.attachMediaElement(this.video.current);\n flvPlayer.load();\n }\n\n if (this.option.danmaku) {\n this.video.on('all', 'seeking', () => {\n for (let i = 0; i < this.dan.length; i++) {\n if (this.dan[i].time >= this.video.currentTime()) {\n this.danIndex = i;\n return;\n }\n this.danIndex = this.dan.length;\n }\n });\n }\n\n\n /**\n * video events\n */\n // show video time: the metadata has loaded or changed\n this.video.on('all', 'durationchange', (i, video) => {\n if (video.duration !== 1) { // compatibility: Android browsers will output 1 at first\n this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = utils.secondToTime(this.video.duration);\n }\n });\n\n // show video loaded bar: to inform interested parties of progress downloading the media\n this.video.on('current', 'progress', (i, video) => {\n const percentage = video.buffered.length ? video.buffered.end(video.buffered.length - 1) / video.duration : 0;\n this.updateBar('loaded', percentage, 'width');\n });\n\n // video download error: an error occurs\n this.video.on('all', 'error', () => {\n this.notice(this.tran('This video fails to load'), -1);\n this.trigger('pause');\n });\n\n // video can play: enough data is available that the media can be played\n this.video.on('current', 'canplay', () => {\n this.trigger('canplay');\n });\n\n // music end\n this.ended = false;\n this.video.on('all', 'ended', (i) => {\n if (i === this.video.videos.length - 1) {\n this.updateBar('played', 1, 'width');\n if (!this.loop) {\n this.ended = true;\n this.pause();\n this.trigger('ended');\n }\n else {\n this.video.switch(0);\n this.video.play();\n }\n }\n });\n\n this.video.on('current', 'play', () => {\n if (this.paused) {\n this.play();\n }\n });\n\n this.video.on('current', 'pause', () => {\n if (!this.paused) {\n this.pause();\n }\n });\n\n // control volume\n this.video.attr('volume', parseInt(this.element.getElementsByClassName('dplayer-volume-bar-inner')[0].style.width) / 100);\n }\n\n switchQuality (index) {\n if (this.qualityIndex === index || this.switchingQuality) {\n return;\n }\n else {\n this.qualityIndex = index;\n }\n this.switchingQuality = true;\n this.quality = this.option.video.quality[index];\n this.element.getElementsByClassName('dplayer-quality-icon')[0].innerHTML = this.quality.name;\n \n this.video.pause();\n const videoHTML = html.video(false, null, this.option.screenshot, 'auto', this.quality.url);\n const videoEle = new DOMParser().parseFromString(videoHTML, 'text/html').body.firstChild;\n const parent = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n parent.prepend(videoEle);\n this.prevVideo = this.video;\n this.video = new Video([videoEle], this.prevVideo.duration);\n this.initVideo();\n this.video.seek(this.prevVideo.currentTime());\n this.notice(`${this.tran('Switching to')} ${this.quality.name} ${this.tran('quality')}`, -1);\n this.video.on('current', 'canplay', () => {\n if (this.prevVideo) {\n if (this.video.currentTime() !== this.prevVideo.currentTime()) {\n this.video.seek(this.prevVideo.currentTime());\n return;\n }\n parent.removeChild(this.prevVideo.current);\n this.video.current.classList.add('dplayer-video-current');\n this.video.play(); \n this.prevVideo = null;\n this.notice(`${this.tran('Switched to')} ${this.quality.name} ${this.tran('quality')}`);\n this.switchingQuality = false;\n }\n });\n }\n\n timeTipsHandler (pbar, timeTips) {\n // http://stackoverflow.com/questions/1480133/how-can-i-get-an-objects-absolute-position-on-the-page-in-javascript\n const cumulativeOffset = (element) => {\n let top = 0, left = 0;\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n\n return {\n top: top,\n left: left\n };\n };\n\n return (e) => {\n if (!this.video.duration) {\n return;\n }\n const { clientX } = e;\n const px = cumulativeOffset(pbar).left;\n const tx = clientX - px;\n timeTips.innerText = utils.secondToTime(this.video.duration * (tx / pbar.offsetWidth));\n timeTips.style.left = `${(tx - 20)}px`;\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n if (this.isTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n this.isTipsShow = true;\n break;\n case 'mouseleave':\n case 'mouseout':\n if (!this.isTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n this.isTipsShow = false;\n break;\n }\n };\n }\n\n notice (text, time) {\n const noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = 1;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n if (time && time < 0) {\n return;\n }\n this.noticeTime = setTimeout(() => {\n noticeEle.style.opacity = 0;\n }, time || 2000);\n }\n}\n\nmodule.exports = DPlayer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/DPlayer.js","/*\n * xhr.status ---> fail\n * response.code === 1 ---> success\n * response.code !== 1 ---> error\n * */\n\nconst SendXMLHttpRequest = (url, data, success, error, fail) => {\n const xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {\n const response = JSON.parse(xhr.responseText);\n\n if (response.code !== 1) {\n return error(xhr, response);\n }\n\n return success(xhr, response);\n }\n\n fail(xhr);\n }\n };\n\n xhr.open(data !== null ? 'POST' : 'GET', url, true);\n xhr.send(data !== null ? JSON.stringify(data) : null);\n};\n\nmodule.exports = {\n send: (endpoint, danmakuData) => {\n SendXMLHttpRequest(endpoint, danmakuData, (xhr, response) => {\n console.log('Post danmaku: ', response);\n }, (xhr, response) => {\n alert(response.msg);\n }, (xhr) => {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n\n read: (endpoint, cbk) => {\n SendXMLHttpRequest(endpoint, null, (xhr, response) => {\n cbk(null, response.danmaku);\n }, (xhr, response) => {\n cbk({ status: xhr.status, response });\n }, (xhr) => {\n cbk({ status: xhr.status, response: null });\n });\n }\n};\n\n\n// WEBPACK FOOTER //\n// ./src/api.js"],"sourceRoot":""}
\ No newline at end of file
diff --git a/package.json b/package.json
index 4edf77703..c872112af 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "dplayer",
- "version": "1.3.0",
+ "version": "1.3.1",
"description": "Wow, such a lovely HTML5 danmaku video player",
"main": "dist/DPlayer.min.js",
"style": "dist/DPlayer.min.css",
diff --git a/src/DPlayer.js b/src/DPlayer.js
index 07d975a3d..89b1866c8 100644
--- a/src/DPlayer.js
+++ b/src/DPlayer.js
@@ -1,4 +1,4 @@
-console.log('\n %c DPlayer 1.3.0 %c http://dplayer.js.org \n\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');
+console.log('\n %c DPlayer 1.3.1 %c http://dplayer.js.org \n\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');
require('./DPlayer.scss');
const utils = require('./utils.js');
@@ -756,7 +756,6 @@ class DPlayer {
this.element.getElementsByClassName('dplayer-quality-list')[0].addEventListener('click', (e) => {
if (e.target.classList.contains('dplayer-quality-item')) {
this.switchQuality(e.target.dataset.index);
- this.element.getElementsByClassName('dplayer-quality-icon')[0].innerHTML = this.option.video.quality[this.qualityIndex].name;
}
});
}
@@ -1169,8 +1168,10 @@ class DPlayer {
this.qualityIndex = index;
}
this.switchingQuality = true;
- this.video.pause();
this.quality = this.option.video.quality[index];
+ this.element.getElementsByClassName('dplayer-quality-icon')[0].innerHTML = this.quality.name;
+
+ this.video.pause();
const videoHTML = html.video(false, null, this.option.screenshot, 'auto', this.quality.url);
const videoEle = new DOMParser().parseFromString(videoHTML, 'text/html').body.firstChild;
const parent = this.element.getElementsByClassName('dplayer-video-wrap')[0];