diff --git a/dist/DPlayer.min.js b/dist/DPlayer.min.js index f8e5538..99d52f9 100644 --- a/dist/DPlayer.min.js +++ b/dist/DPlayer.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("DPlayer",[],t):"object"==typeof exports?exports.DPlayer=t():e.DPlayer=t()}(this,function(){return function(e){function t(n){if(i[n])return i[n].exports;var a=i[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=1)}([function(e,t,i){"use strict";var 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"],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"],"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"],"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"],"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"],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"],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"],"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"],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"],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"],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"],"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"],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"],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"],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"]};e.exports=function(e){return'\n'}},function(e,t,i){"use strict";console.log("\n %c DPlayer 1.6.1 %c http://dplayer.js.org \n\n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;"),e.exports=i(2)},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){for(var i=0;i0?t:0,t=t<1?t:1,d[e+"Bar"].style[i]=100*t+"%"},document.addEventListener("click",function(){i.focus=!1},!0),this.element.addEventListener("click",function(){i.focus=!0},!0),this.option.danmaku&&(this.danmaku=new f.default({container:this.element.getElementsByClassName("dplayer-danmaku")[0],opacity:localStorage.getItem("danmaku-opacity")||.7,callback:function(){i.element.getElementsByClassName("dplayer-danloading")[0].style.display="none",i.option.autoplay&&!l.isMobile?i.play():l.isMobile&&i.pause()},error:function(e){i.notice(e)},apiBackend:this.option.apiBackend,borderColor:this.option.theme,height:this.arrow?24:30,time:function(){return i.video.currentTime},api:{id:this.option.danmaku.id,address:this.option.danmaku.api,token:this.option.danmaku.token,maximum:this.option.danmaku.maximum,addition:this.option.danmaku.addition,user:this.option.danmaku.user}})),this.arrow=this.element.offsetWidth<=500,this.arrow){var y=document.createElement("style");y.innerHTML=".dplayer .dplayer-danmaku{font-size:18px}",document.head.appendChild(y)}this.video=this.element.getElementsByClassName("dplayer-video-current")[0],this.bezel=this.element.getElementsByClassName("dplayer-bezel-icon")[0],this.bezel.addEventListener("animationend",function(){i.bezel.classList.remove("dplayer-bezel-transition")}),this.playButton=this.element.getElementsByClassName("dplayer-play-icon")[0],this.paused=!0,this.playButton.addEventListener("click",function(){i.toggle()});var k=this.element.getElementsByClassName("dplayer-video-wrap")[0],w=this.element.getElementsByClassName("dplayer-controller-mask")[0];if(l.isMobile){var b=function(){i.element.classList.contains("dplayer-hide-controller")?i.element.classList.remove("dplayer-hide-controller"):i.element.classList.add("dplayer-hide-controller")};k.addEventListener("click",b),w.addEventListener("click",b)}else k.addEventListener("click",function(){i.toggle()}),w.addEventListener("click",function(){i.toggle()});var L=0,E=0,x=!1;window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();var T=function(){i.checkLoading=setInterval(function(){E=i.video.currentTime,!x&&EL+.01&&!i.video.paused&&(i.element.classList.remove("dplayer-loading"),x=!1),L=E},100)},q=function(){clearInterval(i.checkLoading)};this.playedTime=!1,this.animationFrame=function(){i.playedTime&&(i.updateBar("played",i.video.currentTime/i.video.duration,"width"),i.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=o.default.secondToTime(i.video.currentTime),i.trigger("playing")),window.requestAnimationFrame(i.animationFrame)},window.requestAnimationFrame(this.animationFrame),this.setTime=function(e){e?(i[e+"Time"]=!0,"played"===e&&T()):(i.playedTime=!0,T())},this.clearTime=function(e){e?(i[e+"Time"]=!1,"played"===e&&q()):(i.playedTime=!1,q())},c.addEventListener("click",function(e){var t=e||window.event;v=c.clientWidth;var n=(t.clientX-o.default.getElementViewLeft(c))/v;n=n>0?n:0,n=n<1?n:1,i.updateBar("played",n,"width"),i.seek(parseFloat(d.playedBar.style.width)/100*i.video.duration)}),this.initVideoPreview(),this.isPreViewShow=!1,this.isTimeTipsShow=!0,this.isMouseHoverPbar=!1,this.mouseHandler=this.mouseHandler(c,p).bind(this),c.addEventListener("mousemove",this.mouseHandler),c.addEventListener("mouseover",this.mouseHandler),c.addEventListener("mouseenter",this.mouseHandler),c.addEventListener("mouseout",this.mouseHandler),c.addEventListener("mouseleave",this.mouseHandler);var B=function(e){var t=e||window.event,n=(t.clientX-o.default.getElementViewLeft(c))/v;n=n>0?n:0,n=n<1?n:1,i.updateBar("played",n,"width"),i.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=o.default.secondToTime(n*i.video.duration)},C=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",B),i.seek(parseFloat(d.playedBar.style.width)/100*i.video.duration),i.setTime()};c.addEventListener("mousedown",function(){v=c.clientWidth,i.clearTime(),document.addEventListener("mousemove",B),document.addEventListener("mouseup",C)});var M=this.element.getElementsByClassName("dplayer-volume")[0],z=this.element.getElementsByClassName("dplayer-volume-bar-wrap")[0],N=this.element.getElementsByClassName("dplayer-volume-bar")[0],S=this.element.getElementsByClassName("dplayer-volume-icon")[0];this.switchVolumeIcon=function(){var e=i.element.getElementsByClassName("dplayer-volume-icon")[0];i.volume()>=.95?e.innerHTML=(0,r.default)("volume-up"):i.volume()>0?e.innerHTML=(0,r.default)("volume-down"):e.innerHTML=(0,r.default)("volume-off")};var P=function(e){var t=e||window.event,n=(t.clientX-o.default.getElementViewLeft(N)-5.5)/35;i.volume(n)},F=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",P),M.classList.remove("dplayer-volume-active")};z.addEventListener("click",function(e){var t=e||window.event,n=(t.clientX-o.default.getElementViewLeft(N)-5.5)/35;i.volume(n)}),z.addEventListener("mousedown",function(){document.addEventListener("mousemove",P),document.addEventListener("mouseup",F),M.classList.add("dplayer-volume-active")}),S.addEventListener("click",function(){i.video.muted?(i.video.muted=!1,i.switchVolumeIcon(),i.updateBar("volume",i.volume(),"width")):(i.video.muted=!0,S.innerHTML=(0,r.default)("volume-off"),i.updateBar("volume",0,"width"))}),this.hideTime=0;var H=function(){i.element.classList.remove("dplayer-hide-controller"),clearTimeout(i.hideTime),i.hideTime=setTimeout(function(){i.video.played.length&&(i.element.classList.add("dplayer-hide-controller"),R(),ee())},2e3)};l.isMobile||(this.element.addEventListener("mousemove",H),this.element.addEventListener("click",H));var D=h.default.setting(this.tran),I=this.element.getElementsByClassName("dplayer-setting-icon")[0],V=this.element.getElementsByClassName("dplayer-setting-box")[0],A=this.element.getElementsByClassName("dplayer-mask")[0];V.innerHTML=D.original;var R=function(){V.classList.contains("dplayer-setting-box-open")&&(V.classList.remove("dplayer-setting-box-open"),A.classList.remove("dplayer-mask-show"),setTimeout(function(){V.classList.remove("dplayer-setting-box-narrow"),V.innerHTML=D.original,j()},300))},W=function(){V.classList.add("dplayer-setting-box-open"),A.classList.add("dplayer-mask-show")};A.addEventListener("click",function(){R()}),I.addEventListener("click",function(){W()}),this.loop=this.option.loop;var O=!0,j=function(){var e=i.element.getElementsByClassName("dplayer-setting-loop")[0],t=e.getElementsByClassName("dplayer-toggle-setting-input")[0];t.checked=i.loop,e.addEventListener("click",function(){t.checked=!t.checked,t.checked?i.loop=!0:i.loop=!1,R()});var n=i.element.getElementsByClassName("dplayer-setting-showdan")[0],a=n.getElementsByClassName("dplayer-showdan-setting-input")[0];if(a.checked=O,n.addEventListener("click",function(){a.checked=!a.checked,a.checked?(O=!0,i.paused||i.danmaku.show()):(O=!1,i.danmaku.hide()),R()}),i.element.getElementsByClassName("dplayer-setting-speed")[0].addEventListener("click",function(){V.classList.add("dplayer-setting-box-narrow"),V.innerHTML=D.speed;for(var e=V.getElementsByClassName("dplayer-setting-speed-item"),t=0;t0?n:0,n=n<1?n:1,i.updateBar("danmaku",n,"width"),i.danmaku.opacity(n)},u=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",c),r.classList.remove("dplayer-setting-danmaku-active")};s.addEventListener("click",function(e){var t=e||window.event,n=(t.clientX-o.default.getElementViewLeft(l))/130;n=n>0?n:0,n=n<1?n:1,i.updateBar("danmaku",n,"width"),i.danmaku.opacity(n)}),s.addEventListener("mousedown",function(){document.addEventListener("mousemove",c),document.addEventListener("mouseup",u),r.classList.add("dplayer-setting-danmaku-active")})}};j(),1!==this.video.duration&&(this.element.getElementsByClassName("dplayer-dtime")[0].innerHTML=this.video.duration?o.default.secondToTime(this.video.duration):"00:00"),this.danmaku||(this.option.autoplay&&!l.isMobile?this.play():l.isMobile&&this.pause());var _=this.element.getElementsByClassName("dplayer-comment-input")[0],X=this.element.getElementsByClassName("dplayer-comment-icon")[0],Q=this.element.getElementsByClassName("dplayer-comment-box")[0],Y=this.element.getElementsByClassName("dplayer-comment-setting-icon")[0],$=this.element.getElementsByClassName("dplayer-comment-setting-box")[0],U=this.element.getElementsByClassName("dplayer-send-icon")[0],J=function(){$.classList.contains("dplayer-comment-setting-open")&&$.classList.remove("dplayer-comment-setting-open")},G=function(){$.classList.contains("dplayer-comment-setting-open")?$.classList.remove("dplayer-comment-setting-open"):$.classList.add("dplayer-comment-setting-open")},K=0,Z=0,ee=function(){Q.classList.contains("dplayer-comment-box-open")&&(Q.classList.remove("dplayer-comment-box-open"),A.classList.remove("dplayer-mask-show"),i.element.classList.remove("dplayer-show-controller"),clearInterval(K),clearTimeout(Z),J())},te=function(){Q.classList.contains("dplayer-comment-box-open")||(Q.classList.add("dplayer-comment-box-open"),A.classList.add("dplayer-mask-show"),i.element.classList.add("dplayer-show-controller"),K=setInterval(function(){clearTimeout(i.hideTime)},1e3),Z=setTimeout(function(){_.focus()},300))};A.addEventListener("click",function(){ee()}),X.addEventListener("click",function(){te()}),Y.addEventListener("click",function(){G()}),this.element.getElementsByClassName("dplayer-comment-setting-color")[0].addEventListener("click",function(){i.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked+span')&&(Y.getElementsByClassName("dplayer-fill")[0].style.fill=i.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked').value)});var ie=function(){if(_.blur(),!_.value.replace(/^\s+|\s+$/g,""))return void i.notice(i.tran("Please input danmaku content!"));i.danmaku.send({text:_.value,color:i.element.querySelector(".dplayer-comment-setting-color input:checked").value,type:i.element.querySelector(".dplayer-comment-setting-type input:checked").value},function(){_.value="",ee()})};_.addEventListener("click",function(){J()}),_.addEventListener("keydown",function(e){13===(e||window.event).keyCode&&ie()}),U.addEventListener("click",ie),this.element.addEventListener("fullscreenchange",function(){i.danmaku&&i.danmaku.resize()}),this.element.addEventListener("mozfullscreenchange",function(){i.danmaku&&i.danmaku.resize()}),this.element.addEventListener("webkitfullscreenchange",function(){i.danmaku&&i.danmaku.resize()}),this.element.getElementsByClassName("dplayer-full-icon")[0].addEventListener("click",function(){document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():i.element.requestFullscreen?i.element.requestFullscreen():i.element.mozRequestFullScreen?i.element.mozRequestFullScreen():i.element.webkitRequestFullscreen?i.element.webkitRequestFullscreen():i.video.webkitEnterFullscreen&&i.video.webkitEnterFullscreen(),i.danmaku&&i.danmaku.resize()}),this.element.getElementsByClassName("dplayer-full-in-icon")[0].addEventListener("click",function(){i.element.classList.contains("dplayer-fulled")?i.element.classList.remove("dplayer-fulled"):(i.element.classList.add("dplayer-fulled"),i.danmaku&&i.danmaku.resize())});var ne=function(e){if(i.focus){var t=document.activeElement.tagName.toUpperCase(),n=document.activeElement.getAttribute("contenteditable");if("INPUT"!==t&&"TEXTAREA"!==t&&""!==n&&"true"!==n){var a=e||window.event,s=void 0;switch(a.keyCode){case 32:a.preventDefault(),i.toggle();break;case 37:a.preventDefault(),i.seek(i.video.currentTime-5),H();break;case 39:a.preventDefault(),i.seek(i.video.currentTime+5),H();break;case 38:a.preventDefault(),s=i.volume()+.1,i.volume(s);break;case 40:a.preventDefault(),s=i.volume()-.1,i.volume(s)}}}};this.option.hotkey&&document.addEventListener("keydown",ne),document.addEventListener("keydown",function(e){switch((e||window.event).keyCode){case 27:i.element.classList.contains("dplayer-fulled")&&(i.element.classList.remove("dplayer-fulled"),i.danmaku&&i.danmaku.resize())}});var ae=this.element.getElementsByClassName("dplayer-menu")[0];if(this.element.addEventListener("contextmenu",function(e){var t=e||window.event;t.preventDefault(),ae.classList.add("dplayer-menu-show");var n=i.element.getBoundingClientRect(),a=t.clientX-n.left,s=t.clientY-n.top;a+ae.offsetWidth>=n.width?(ae.style.right=n.width-a+"px",ae.style.left="initial"):(ae.style.left=t.clientX-i.element.getBoundingClientRect().left+"px",ae.style.right="initial"),s+ae.offsetHeight>=n.height?(ae.style.bottom=n.height-s+"px",ae.style.top="initial"):(ae.style.top=t.clientY-i.element.getBoundingClientRect().top+"px",ae.style.bottom="initial"),A.classList.add("dplayer-mask-show"),A.addEventListener("click",function(){A.classList.remove("dplayer-mask-show"),ae.classList.remove("dplayer-menu-show")})}),this.option.video.quality&&this.element.getElementsByClassName("dplayer-quality-list")[0].addEventListener("click",function(e){e.target.classList.contains("dplayer-quality-item")&&i.switchQuality(e.target.dataset.index)}),this.option.screenshot){var se=this.element.getElementsByClassName("dplayer-camera-icon")[0];se.addEventListener("click",function(){var e=document.createElement("canvas");e.width=i.video.videoWidth,e.height=i.video.videoHeight,e.getContext("2d").drawImage(i.video,0,0,e.width,e.height),se.href=e.toDataURL(),se.download="DPlayer.png"})}this.initVideo(),g++}return s(e,[{key:"seek",value:function(e){e=Math.max(e,0),this.video.duration&&(e=Math.min(e,this.video.duration)),this.video.currentTimee&&this.notice(this.tran("REW to")+" "+o.default.secondToTime(e)),this.video.currentTime=e,this.danmaku&&this.danmaku.seek(),this.updateBar("played",e/this.video.duration,"width")}},{key:"play",value:function(){this.paused=!1,this.video.paused&&(this.bezel.innerHTML=(0,r.default)("play"),this.bezel.classList.add("dplayer-bezel-transition")),this.playButton.innerHTML=(0,r.default)("pause"),this.video.play(),this.setTime(),this.element.classList.add("dplayer-playing"),this.danmaku&&this.danmaku.play(),this.trigger("play")}},{key:"pause",value:function(){this.paused=!0,this.element.classList.remove("dplayer-loading"),this.video.paused||(this.bezel.innerHTML=(0,r.default)("pause"),this.bezel.classList.add("dplayer-bezel-transition")),this.ended=!1,this.playButton.innerHTML=(0,r.default)("play"),this.video.pause(),this.clearTime(),this.element.classList.remove("dplayer-playing"),this.danmaku&&this.danmaku.pause(),this.trigger("pause")}},{key:"volume",value:function(e,t,i){return e=parseFloat(e),isNaN(e)||(e=e>0?e:0,e=e<1?e:1,this.updateBar("volume",e,"width"),i||localStorage.setItem("dplayer-volume",e),t||this.notice(this.tran("Volume")+" "+(100*e).toFixed(0)+"%"),this.video.volume=e,this.video.muted&&(this.video.muted=!1),this.switchVolumeIcon()),this.video.volume}},{key:"toggle",value:function(){this.video.paused?this.play():this.pause()}},{key:"on",value:function(e,t){"function"==typeof t&&this.event[e].push(t)}},{key:"switchVideo",value:function(e,t){this.video.poster=e.pic?e.pic:"",this.video.src=e.url,this.pause(),t&&(this.element.getElementsByClassName("dplayer-danloading")[0].style.display="block",this.updateBar("played",0,"width"),this.updateBar("loaded",0,"width"),this.element.getElementsByClassName("dplayer-ptime")[0].innerHTML="00:00",this.element.getElementsByClassName("dplayer-danmaku")[0].innerHTML="",this.danmaku&&this.danmaku.reload({id:t.id,address:t.api,token:t.token,maximum:t.maximum,addition:t.addition,user:t.user}))}},{key:"initVideo",value:function(){var e=this;if(("auto"===this.option.video.type?/m3u8(#|\?|$)/i.exec(this.video.src):"hls"===this.option.video.type)&&Hls.isSupported()){var t=new Hls;t.loadSource(this.video.src),t.attachMedia(this.video)}if(("auto"===this.option.video.type?/.flv(#|\?|$)/i.exec(this.video.src):"flv"===this.option.video.type)&&flvjs.isSupported()){var i=flvjs.createPlayer({type:"flv",url:this.option.video.url});i.attachMediaElement(this.video),i.load()}this.video.addEventListener("durationchange",function(){1!==e.video.duration&&(e.element.getElementsByClassName("dplayer-dtime")[0].innerHTML=o.default.secondToTime(e.video.duration))}),this.video.addEventListener("progress",function(){var t=e.video.buffered.length?e.video.buffered.end(e.video.buffered.length-1)/e.video.duration:0;e.updateBar("loaded",t,"width")}),this.video.addEventListener("error",function(){e.tran&&e.notice&&e.notice(e.tran("This video fails to load"),-1),e.trigger&&e.trigger("pause")}),this.video.addEventListener("canplay",function(){e.trigger("canplay")}),this.ended=!1,this.video.addEventListener("ended",function(){e.updateBar("played",1,"width"),e.loop?(e.seek(0),e.video.play()):(e.ended=!0,e.pause(),e.trigger("ended")),e.danmaku&&(e.danmaku.danIndex=0)}),this.video.addEventListener("play",function(){e.paused&&e.play()}),this.video.addEventListener("pause",function(){e.paused||e.pause()}),this.volume(localStorage.getItem("dplayer-volume")||this.option.volume,!0,!0)}},{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;var i=this.video.paused;this.video.pause();var n=h.default.video(!1,null,this.option.screenshot,"auto",this.quality.url),a=(new DOMParser).parseFromString(n,"text/html").body.firstChild,s=this.element.getElementsByClassName("dplayer-video-wrap")[0];s.insertBefore(a,s.getElementsByTagName("div")[0]),this.prevVideo=this.video,this.video=a,this.initVideo(),this.seek(this.prevVideo.currentTime),this.notice(this.tran("Switching to")+" "+this.quality.name+" "+this.tran("quality"),-1),this.video.addEventListener("canplay",function(){if(t.prevVideo){if(t.video.currentTime!==t.prevVideo.currentTime)return void t.seek(t.prevVideo.currentTime);s.removeChild(t.prevVideo),t.video.classList.add("dplayer-video-current"),i||t.video.play(),t.prevVideo=null,t.notice(t.tran("Switched to")+" "+t.quality.name+" "+t.tran("quality")),t.switchingQuality=!1}})}}},{key:"mouseHandler",value:function(e,t){var i=this,n=function(e){var t=0,i=0;do{t+=e.offsetTop||0,i+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:i}};return function(a){if(i.video.duration){var s=a.clientX,l=n(e).left,d=s-l,r=i.video.duration*(d/e.offsetWidth);switch(t.innerText=o.default.secondToTime(r),t.style.left=d-20+"px",i.previewWrapper.style.left=d-i.previewWrapper.offsetWidth/2+"px",a.type){case"mouseenter":case"mouseover":case"mousemove":i.isMouseHoverPbar=!0,i.setPreviewSourceAndFrame({url:i.video.src,time:r}),i.timeTipsDisplay(!0,t);break;case"mouseleave":case"mouseout":i.isMouseHoverPbar=!1,i.previewDispaly(!1),i.timeTipsDisplay(!1,t)}}}}},{key:"timeTipsDisplay",value:function(e,t){if(e){if(this.isTimeTipsShow)return;t.classList.remove("hidden"),this.isTimeTipsShow=!0}else{if(!this.isTimeTipsShow)return;t.classList.add("hidden"),this.isTimeTipsShow=!1}}},{key:"initVideoPreview",value:function(){var e=this;this.previewVideo=document.createElement("video"),this.previewWrapper=this.element.getElementsByClassName("dplayer-bar-preview")[0],this.previewCanvas=this.element.getElementsByClassName("dplayer-bar-preview-canvas")[0],this.previewVideo.preload="auto";var t=function(){var t=e.element.offsetWidth/4,i=e.element.offsetHeight/4;e.previewWrapper.style.width=t+"px",e.previewWrapper.style.height=i+"px",e.previewWrapper.style.top=2-i+"px",e.previewCanvas.width=t,e.previewCanvas.height=i};t(),this.video.addEventListener("loadedmetadata",function(){t()}),this.setPreviewSourceAndFrame({url:this.video.src,time:0}),this.bindPreviewEvent()}},{key:"setPreviewSourceAndFrame",value:function(e){var t=e.url,i=e.time;t&&(this.previewVideo.src=t),i&&(this.previewVideo.currentTime=i)}},{key:"bindPreviewEvent",value:function(){var e=this;this.previewNumber=0,this.previewVideo.addEventListener("seeked",function(){e.previewNumber+=1,e.generPreviewImage(e.previewNumber)})}},{key:"generPreviewImage",value:function(e){if(e===this.previewNumber&&this.isMouseHoverPbar&&(this.previewDispaly(!0),this.isPreViewShow)){this.previewCanvas.getContext("2d").drawImage(this.previewVideo,0,0,this.previewWrapper.offsetWidth,this.previewWrapper.offsetHeight)}}},{key:"previewDispaly",value:function(e){if(e){if(this.isPreViewShow)return;if(!this.isMouseHoverPbar)return;this.previewWrapper.classList.remove("hidden"),this.isPreViewShow=!0}else{if(!this.isPreViewShow)return;this.previewWrapper.classList.add("hidden"),this.isPreViewShow=!1}}},{key:"notice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8,n=this.element.getElementsByClassName("dplayer-notice")[0];n.innerHTML=e,n.style.opacity=i,this.noticeTime&&clearTimeout(this.noticeTime),this.noticeTime=setTimeout(function(){n.style.opacity=0},t)}},{key:"destroy",value:function(){this.pause(),clearTimeout(this.hideTime),this.video.src="",this.element.innerHTML="";for(var e in this)this.hasOwnProperty(e)&&"paused"!==e&&delete this[e]}}]),e}();e.exports=k},function(e,t){},function(e,t,i){"use strict";e.exports={secondToTime:function(e){var t=function(e){return e<10?"0"+e:""+e},i=parseInt(e/60),n=parseInt(e-60*i);return t(i)+":"+t(n)},getElementViewLeft:function(e){var t=e.offsetLeft,i=e.offsetParent,n=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==i&&i!==e;)t+=i.offsetLeft,i=i.offsetParent;else for(;null!==i;)t+=i.offsetLeft,i=i.offsetParent;return t-n},isMobile:/mobile/i.test(window.navigator.userAgent)}},function(e,t,i){"use strict";var n=i(6);e.exports=function(e){/mobile/i.test(window.navigator.userAgent)&&(e.autoplay=!1);var t={element:document.getElementsByClassName("dplayer")[0],autoplay:!1,theme:"#b7daff",loop:!1,lang:-1!==navigator.language.indexOf("zh")?"zh":"en",screenshot:!1,hotkey:!0,preload:"auto",volume:"0.7",apiBackend:n,contextmenu:[{text:"\u5173\u4e8e\u4f5c\u8005",link:"http://diygod.me"},{text:"\u64ad\u653e\u5668\u610f\u89c1\u53cd\u9988",link:"https://github.com/DIYgod/DPlayer/issues"},{text:"\u5173\u4e8e DPlayer \u64ad\u653e\u5668",link:"https://github.com/DIYgod/DPlayer"}]};for(var i in t)t.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=t[i]);return"[object Array]"!==Object.prototype.toString.call(e.video.url)&&(e.video.url=[e.video.url]),e.video&&!e.video.hasOwnProperty("type")&&(e.video.type="auto"),e.danmaku&&!e.danmaku.hasOwnProperty("user")&&(e.danmaku.user="DIYgod"),e.video.quality&&(e.video.url=[e.video.quality[e.video.defaultQuality].url]),e}},function(e,t,i){"use strict";var n=function(e,t,i,n,a){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?n(s,e):i(s,e)}a(s)}},s.open(null!==t?"POST":"GET",e,!0),s.send(null!==t?JSON.stringify(t):null)};e.exports={send:function(e,t,i){n(e,t,function(e,t){console.log("Post danmaku: ",t),i&&i()},function(e,t){alert(t.msg)},function(e){console.log("Request was unsuccessful: "+e.status)})},read:function(e,t){n(e,null,function(e,i){t(null,i.danmaku)},function(e,i){t({status:e.status,response:i})},function(e){t({status:e.status,response:null})})}}},function(e,t,i){"use strict";var n={"Danmaku is loading":"\u5f39\u5e55\u52a0\u8f7d\u4e2d",Top:"\u9876\u90e8",Bottom:"\u5e95\u90e8",Rolling:"\u6eda\u52a8","Input danmaku, hit Enter":"\u8f93\u5165\u5f39\u5e55\uff0c\u56de\u8f66\u53d1\u9001","About author":"\u5173\u4e8e\u4f5c\u8005","DPlayer feedback":"\u64ad\u653e\u5668\u610f\u89c1\u53cd\u9988","About DPlayer":"\u5173\u4e8e DPlayer \u64ad\u653e\u5668",Loop:"\u6d17\u8111\u5faa\u73af",Speed:"\u901f\u5ea6","Opacity for danmaku":"\u5f39\u5e55\u900f\u660e\u5ea6",Normal:"\u6b63\u5e38","Please input danmaku content!":"\u8981\u8f93\u5165\u5f39\u5e55\u5185\u5bb9\u554a\u5582\uff01","Set danmaku color":"\u8bbe\u7f6e\u5f39\u5e55\u989c\u8272","Set danmaku type":"\u8bbe\u7f6e\u5f39\u5e55\u7c7b\u578b",Danmaku:"\u5f39\u5e55","This video fails to load":"\u89c6\u9891\u52a0\u8f7d\u5931\u8d25","Switching to":"\u6b63\u5728\u5207\u6362\u81f3","Switched to":"\u5df2\u7ecf\u5207\u6362\u81f3",quality:"\u753b\u8d28","FF to":"\u5feb\u8fdb\u81f3","REW to":"\u5feb\u9000\u81f3",Volume:"\u97f3\u91cf"};e.exports=function(e){var t=this;this.lang=e,this.tran=function(e){return"en"===t.lang?e:"zh"===t.lang?n[e]:void 0}}},function(e,t,i){"use strict";var n=i(0),a={main:function(e,t,i){for(var s="",l=0;l
'+s+(e.logo?'':"")+'
'+(e.danmaku?''+i("Danmaku is loading")+"":"")+'
0:00 / 0:00
'+(e.video.quality?'
'+a.qualityList(e.video.quality)+"
":"")+(e.screenshot?''+n("camera")+"":"")+'
'+i("Set danmaku color")+'
'+i("Set danmaku type")+'
'+a.contextmenuList(e.contextmenu)+'
'},contextmenuList:function(e){for(var t='";return t+=""},qualityList:function(e){for(var t='
',i=0;i'+e[i].name+"
";return t+=""},video:function(e,t,i,n,a){return''},setting:function(e){return{original:'
'+e("Speed")+'
'+n("right")+'
'+e("Loop")+'
'+e("Danmaku")+'
'+e("Opacity for danmaku")+'
',speed:'
0.5
0.75
'+e("Normal")+'
1.25
1.5
2
'}}};e.exports=a},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var i=0;iparseFloat(t.time);)i.push(t),t=this.dan[++this.danIndex];this.draw(i)}window.requestAnimationFrame(function(){e.frame()})}},{key:"opacity",value:function(e){if(void 0!==e){for(var t=this.container.getElementsByClassName("dplayer-danmaku-item"),i=0;i'+e[a].text+"":s.innerHTML=e[a].text,s.style.opacity=t._opacity,s.style.color=e[a].color,s.addEventListener("animationend",function(){t.container.removeChild(s)});var l=t._measure(e[a].text);switch(e[a].type){case"right":s.style.width=l+1+"px",s.style.top=i*r(s,e[a].type,l)+"px",s.style.transform="translateX(-"+n+"px)";break;case"top":s.style.top=i*r(s,e[a].type)+"px";break;case"bottom":s.style.bottom=i*r(s,e[a].type)+"px";break;default:console.error("Can't handled danmaku type: "+e[a].type)}s.classList.add("dplayer-danmaku-move"),c.appendChild(s)}(u);return this.container.appendChild(c),c}},{key:"play",value:function(){this.paused=!1}},{key:"pause",value:function(){this.paused=!0}},{key:"_measure",value:function(e){if(!this.context){var t=getComputedStyle(this.container.getElementsByClassName("dplayer-danmaku-item")[0],null);this.context=document.createElement("canvas").getContext("2d"),this.context.font=t.getPropertyValue("font")}return this.context.measureText(e).width}},{key:"seek",value:function(){for(var e=0;e=this.options.time()){this.danIndex=e;break}this.danIndex=this.dan.length}}},{key:"clear",value:function(){this.danTunnel={right:{},top:{},bottom:{}},this.danIndex=0,this.options.container.innerHTML=""}},{key:"htmlEncode",value:function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}},{key:"resize",value:function(){for(var e=this.container.offsetWidth,t=this.container.getElementsByClassName("dplayer-danmaku-item"),i=0;i\n'}},function(e,t,i){"use strict";console.log("\n %c DPlayer 1.6.1 %c http://dplayer.js.org \n\n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;"),e.exports=i(2)},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){for(var i=0;i0?t:0,t=t<1?t:1,d[e+"Bar"].style[i]=100*t+"%"},document.addEventListener("click",function(){i.focus=!1},!0),this.element.addEventListener("click",function(){i.focus=!0},!0),this.option.danmaku&&(this.danmaku=new f.default({container:this.element.getElementsByClassName("dplayer-danmaku")[0],opacity:localStorage.getItem("danmaku-opacity")||.7,callback:function(){i.element.getElementsByClassName("dplayer-danloading")[0].style.display="none",i.option.autoplay&&!l.isMobile?i.play():l.isMobile&&i.pause()},error:function(e){i.notice(e)},apiBackend:this.option.apiBackend,borderColor:this.option.theme,height:this.arrow?24:30,time:function(){return i.video.currentTime},api:{id:this.option.danmaku.id,address:this.option.danmaku.api,token:this.option.danmaku.token,maximum:this.option.danmaku.maximum,addition:this.option.danmaku.addition,user:this.option.danmaku.user}})),this.arrow=this.element.offsetWidth<=500,this.arrow){var y=document.createElement("style");y.innerHTML=".dplayer .dplayer-danmaku{font-size:18px}",document.head.appendChild(y)}this.video=this.element.getElementsByClassName("dplayer-video-current")[0],this.bezel=this.element.getElementsByClassName("dplayer-bezel-icon")[0],this.bezel.addEventListener("animationend",function(){i.bezel.classList.remove("dplayer-bezel-transition")}),this.playButton=this.element.getElementsByClassName("dplayer-play-icon")[0],this.paused=!0,this.playButton.addEventListener("click",function(){i.toggle()});var k=this.element.getElementsByClassName("dplayer-video-wrap")[0],w=this.element.getElementsByClassName("dplayer-controller-mask")[0];if(l.isMobile){var b=function(){i.element.classList.contains("dplayer-hide-controller")?i.element.classList.remove("dplayer-hide-controller"):i.element.classList.add("dplayer-hide-controller")};k.addEventListener("click",b),w.addEventListener("click",b)}else k.addEventListener("click",function(){i.toggle()}),w.addEventListener("click",function(){i.toggle()});var L=0,E=0,x=!1;window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();var T=function(){i.checkLoading=setInterval(function(){E=i.video.currentTime,!x&&EL+.01&&!i.video.paused&&(i.element.classList.remove("dplayer-loading"),x=!1),L=E},100)},q=function(){clearInterval(i.checkLoading)};this.playedTime=!1,this.animationFrame=function(){i.playedTime&&(i.updateBar("played",i.video.currentTime/i.video.duration,"width"),i.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=o.default.secondToTime(i.video.currentTime),i.trigger("playing")),window.requestAnimationFrame(i.animationFrame)},window.requestAnimationFrame(this.animationFrame),this.setTime=function(e){e?(i[e+"Time"]=!0,"played"===e&&T()):(i.playedTime=!0,T())},this.clearTime=function(e){e?(i[e+"Time"]=!1,"played"===e&&q()):(i.playedTime=!1,q())},c.addEventListener("click",function(e){var t=e||window.event;v=c.clientWidth;var n=(t.clientX-o.default.getElementViewLeft(c))/v;n=n>0?n:0,n=n<1?n:1,i.updateBar("played",n,"width"),i.seek(parseFloat(d.playedBar.style.width)/100*i.video.duration)}),this.initVideoPreview(),this.isPreViewShow=!1,this.isTimeTipsShow=!0,this.isMouseHoverPbar=!1,this.mouseHandler=this.mouseHandler(c,p).bind(this),c.addEventListener("mousemove",this.mouseHandler),c.addEventListener("mouseover",this.mouseHandler),c.addEventListener("mouseenter",this.mouseHandler),c.addEventListener("mouseout",this.mouseHandler),c.addEventListener("mouseleave",this.mouseHandler);var B=function(e){var t=e||window.event,n=(t.clientX-o.default.getElementViewLeft(c))/v;n=n>0?n:0,n=n<1?n:1,i.updateBar("played",n,"width"),i.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=o.default.secondToTime(n*i.video.duration)},C=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",B),i.seek(parseFloat(d.playedBar.style.width)/100*i.video.duration),i.setTime()};c.addEventListener("mousedown",function(){v=c.clientWidth,i.clearTime(),document.addEventListener("mousemove",B),document.addEventListener("mouseup",C)});var M=this.element.getElementsByClassName("dplayer-volume")[0],z=this.element.getElementsByClassName("dplayer-volume-bar-wrap")[0],N=this.element.getElementsByClassName("dplayer-volume-bar")[0],S=this.element.getElementsByClassName("dplayer-volume-icon")[0];this.switchVolumeIcon=function(){var e=i.element.getElementsByClassName("dplayer-volume-icon")[0];i.volume()>=.95?e.innerHTML=(0,r.default)("volume-up"):i.volume()>0?e.innerHTML=(0,r.default)("volume-down"):e.innerHTML=(0,r.default)("volume-off")};var P=function(e){var t=e||window.event,n=(t.clientX-o.default.getElementViewLeft(N)-5.5)/35;i.volume(n)},F=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",P),M.classList.remove("dplayer-volume-active")};z.addEventListener("click",function(e){var t=e||window.event,n=(t.clientX-o.default.getElementViewLeft(N)-5.5)/35;i.volume(n)}),z.addEventListener("mousedown",function(){document.addEventListener("mousemove",P),document.addEventListener("mouseup",F),M.classList.add("dplayer-volume-active")}),S.addEventListener("click",function(){i.video.muted?(i.video.muted=!1,i.switchVolumeIcon(),i.updateBar("volume",i.volume(),"width")):(i.video.muted=!0,S.innerHTML=(0,r.default)("volume-off"),i.updateBar("volume",0,"width"))}),this.hideTime=0;var H=function(){i.element.classList.remove("dplayer-hide-controller"),clearTimeout(i.hideTime),i.hideTime=setTimeout(function(){i.video.played.length&&(i.element.classList.add("dplayer-hide-controller"),R(),ee())},2e3)};l.isMobile||(this.element.addEventListener("mousemove",H),this.element.addEventListener("click",H));var I=h.default.setting(this.tran),D=this.element.getElementsByClassName("dplayer-setting-icon")[0],V=this.element.getElementsByClassName("dplayer-setting-box")[0],A=this.element.getElementsByClassName("dplayer-mask")[0];V.innerHTML=I.original;var R=function(){V.classList.contains("dplayer-setting-box-open")&&(V.classList.remove("dplayer-setting-box-open"),A.classList.remove("dplayer-mask-show"),setTimeout(function(){V.classList.remove("dplayer-setting-box-narrow"),V.innerHTML=I.original,j()},300))},W=function(){V.classList.add("dplayer-setting-box-open"),A.classList.add("dplayer-mask-show")};A.addEventListener("click",function(){R()}),D.addEventListener("click",function(){W()}),this.loop=this.option.loop;var O=!0,j=function(){var e=i.element.getElementsByClassName("dplayer-setting-loop")[0],t=e.getElementsByClassName("dplayer-toggle-setting-input")[0];t.checked=i.loop,e.addEventListener("click",function(){t.checked=!t.checked,t.checked?i.loop=!0:i.loop=!1,R()});var n=i.element.getElementsByClassName("dplayer-setting-showdan")[0],a=n.getElementsByClassName("dplayer-showdan-setting-input")[0];if(a.checked=O,n.addEventListener("click",function(){a.checked=!a.checked,a.checked?(O=!0,i.paused||i.danmaku.show()):(O=!1,i.danmaku.hide()),R()}),i.element.getElementsByClassName("dplayer-setting-speed")[0].addEventListener("click",function(){V.classList.add("dplayer-setting-box-narrow"),V.innerHTML=I.speed;for(var e=V.getElementsByClassName("dplayer-setting-speed-item"),t=0;t0?n:0,n=n<1?n:1,i.updateBar("danmaku",n,"width"),i.danmaku.opacity(n)},u=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",c),r.classList.remove("dplayer-setting-danmaku-active")};s.addEventListener("click",function(e){var t=e||window.event,n=(t.clientX-o.default.getElementViewLeft(l))/130;n=n>0?n:0,n=n<1?n:1,i.updateBar("danmaku",n,"width"),i.danmaku.opacity(n)}),s.addEventListener("mousedown",function(){document.addEventListener("mousemove",c),document.addEventListener("mouseup",u),r.classList.add("dplayer-setting-danmaku-active")})}};j(),1!==this.video.duration&&(this.element.getElementsByClassName("dplayer-dtime")[0].innerHTML=this.video.duration?o.default.secondToTime(this.video.duration):"00:00"),this.danmaku||(this.option.autoplay&&!l.isMobile?this.play():l.isMobile&&this.pause());var _=this.element.getElementsByClassName("dplayer-comment-input")[0],X=this.element.getElementsByClassName("dplayer-comment-icon")[0],Q=this.element.getElementsByClassName("dplayer-comment-box")[0],Y=this.element.getElementsByClassName("dplayer-comment-setting-icon")[0],$=this.element.getElementsByClassName("dplayer-comment-setting-box")[0],U=this.element.getElementsByClassName("dplayer-send-icon")[0],J=function(){$.classList.contains("dplayer-comment-setting-open")&&$.classList.remove("dplayer-comment-setting-open")},G=function(){$.classList.contains("dplayer-comment-setting-open")?$.classList.remove("dplayer-comment-setting-open"):$.classList.add("dplayer-comment-setting-open")},K=0,Z=0,ee=function(){Q.classList.contains("dplayer-comment-box-open")&&(Q.classList.remove("dplayer-comment-box-open"),A.classList.remove("dplayer-mask-show"),i.element.classList.remove("dplayer-show-controller"),clearInterval(K),clearTimeout(Z),J())},te=function(){Q.classList.contains("dplayer-comment-box-open")||(Q.classList.add("dplayer-comment-box-open"),A.classList.add("dplayer-mask-show"),i.element.classList.add("dplayer-show-controller"),K=setInterval(function(){clearTimeout(i.hideTime)},1e3),Z=setTimeout(function(){_.focus()},300))};A.addEventListener("click",function(){ee()}),X.addEventListener("click",function(){te()}),Y.addEventListener("click",function(){G()}),this.element.getElementsByClassName("dplayer-comment-setting-color")[0].addEventListener("click",function(){i.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked+span')&&(Y.getElementsByClassName("dplayer-fill")[0].style.fill=i.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked').value)});var ie=function(){if(_.blur(),!_.value.replace(/^\s+|\s+$/g,""))return void i.notice(i.tran("Please input danmaku content!"));i.danmaku.send({text:_.value,color:i.element.querySelector(".dplayer-comment-setting-color input:checked").value,type:i.element.querySelector(".dplayer-comment-setting-type input:checked").value},function(){_.value="",ee()})};_.addEventListener("click",function(){J()}),_.addEventListener("keydown",function(e){13===(e||window.event).keyCode&&ie()}),U.addEventListener("click",ie),this.element.addEventListener("fullscreenchange",function(){i.danmaku&&i.danmaku.resize()}),this.element.addEventListener("mozfullscreenchange",function(){i.danmaku&&i.danmaku.resize()}),this.element.addEventListener("webkitfullscreenchange",function(){i.danmaku&&i.danmaku.resize()}),this.element.getElementsByClassName("dplayer-full-icon")[0].addEventListener("click",function(){document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():i.element.requestFullscreen?i.element.requestFullscreen():i.element.mozRequestFullScreen?i.element.mozRequestFullScreen():i.element.webkitRequestFullscreen?i.element.webkitRequestFullscreen():i.video.webkitEnterFullscreen&&i.video.webkitEnterFullscreen(),i.danmaku&&i.danmaku.resize()}),this.element.getElementsByClassName("dplayer-full-in-icon")[0].addEventListener("click",function(){i.element.classList.contains("dplayer-fulled")?i.element.classList.remove("dplayer-fulled"):(i.element.classList.add("dplayer-fulled"),i.danmaku&&i.danmaku.resize())});var ne=function(e){if(i.focus){var t=document.activeElement.tagName.toUpperCase(),n=document.activeElement.getAttribute("contenteditable");if("INPUT"!==t&&"TEXTAREA"!==t&&""!==n&&"true"!==n){var a=e||window.event,s=void 0;switch(a.keyCode){case 32:a.preventDefault(),i.toggle();break;case 37:a.preventDefault(),i.seek(i.video.currentTime-5),H();break;case 39:a.preventDefault(),i.seek(i.video.currentTime+5),H();break;case 38:a.preventDefault(),s=i.volume()+.1,i.volume(s);break;case 40:a.preventDefault(),s=i.volume()-.1,i.volume(s)}}}};this.option.hotkey&&document.addEventListener("keydown",ne),document.addEventListener("keydown",function(e){switch((e||window.event).keyCode){case 27:i.element.classList.contains("dplayer-fulled")&&(i.element.classList.remove("dplayer-fulled"),i.danmaku&&i.danmaku.resize())}});var ae=this.element.getElementsByClassName("dplayer-menu")[0];if(this.element.addEventListener("contextmenu",function(e){var t=e||window.event;t.preventDefault(),ae.classList.add("dplayer-menu-show");var n=i.element.getBoundingClientRect(),a=t.clientX-n.left,s=t.clientY-n.top;a+ae.offsetWidth>=n.width?(ae.style.right=n.width-a+"px",ae.style.left="initial"):(ae.style.left=t.clientX-i.element.getBoundingClientRect().left+"px",ae.style.right="initial"),s+ae.offsetHeight>=n.height?(ae.style.bottom=n.height-s+"px",ae.style.top="initial"):(ae.style.top=t.clientY-i.element.getBoundingClientRect().top+"px",ae.style.bottom="initial"),A.classList.add("dplayer-mask-show"),A.addEventListener("click",function(){A.classList.remove("dplayer-mask-show"),ae.classList.remove("dplayer-menu-show")})}),this.option.video.quality&&this.element.getElementsByClassName("dplayer-quality-list")[0].addEventListener("click",function(e){e.target.classList.contains("dplayer-quality-item")&&i.switchQuality(e.target.dataset.index)}),this.option.screenshot){var se=this.element.getElementsByClassName("dplayer-camera-icon")[0];se.addEventListener("click",function(){var e=document.createElement("canvas");e.width=i.video.videoWidth,e.height=i.video.videoHeight,e.getContext("2d").drawImage(i.video,0,0,e.width,e.height),se.href=e.toDataURL(),se.download="DPlayer.png"})}this.initVideo(),g++}return s(e,[{key:"seek",value:function(e){e=Math.max(e,0),this.video.duration&&(e=Math.min(e,this.video.duration)),this.video.currentTimee&&this.notice(this.tran("REW to")+" "+o.default.secondToTime(e)),this.video.currentTime=e,this.danmaku&&this.danmaku.seek(),this.updateBar("played",e/this.video.duration,"width")}},{key:"play",value:function(){this.paused=!1,this.video.paused&&(this.bezel.innerHTML=(0,r.default)("play"),this.bezel.classList.add("dplayer-bezel-transition")),this.playButton.innerHTML=(0,r.default)("pause"),this.video.play(),this.setTime(),this.element.classList.add("dplayer-playing"),this.danmaku&&this.danmaku.play(),this.trigger("play")}},{key:"pause",value:function(){this.paused=!0,this.element.classList.remove("dplayer-loading"),this.video.paused||(this.bezel.innerHTML=(0,r.default)("pause"),this.bezel.classList.add("dplayer-bezel-transition")),this.ended=!1,this.playButton.innerHTML=(0,r.default)("play"),this.video.pause(),this.clearTime(),this.element.classList.remove("dplayer-playing"),this.danmaku&&this.danmaku.pause(),this.trigger("pause")}},{key:"volume",value:function(e,t,i){return e=parseFloat(e),isNaN(e)||(e=e>0?e:0,e=e<1?e:1,this.updateBar("volume",e,"width"),i||localStorage.setItem("dplayer-volume",e),t||this.notice(this.tran("Volume")+" "+(100*e).toFixed(0)+"%"),this.video.volume=e,this.video.muted&&(this.video.muted=!1),this.switchVolumeIcon()),this.video.volume}},{key:"toggle",value:function(){this.video.paused?this.play():this.pause()}},{key:"on",value:function(e,t){"function"==typeof t&&this.event[e].push(t)}},{key:"switchVideo",value:function(e,t){this.video.poster=e.pic?e.pic:"",this.video.src=e.url,this.pause(),t&&(this.element.getElementsByClassName("dplayer-danloading")[0].style.display="block",this.updateBar("played",0,"width"),this.updateBar("loaded",0,"width"),this.element.getElementsByClassName("dplayer-ptime")[0].innerHTML="00:00",this.element.getElementsByClassName("dplayer-danmaku")[0].innerHTML="",this.danmaku&&this.danmaku.reload({id:t.id,address:t.api,token:t.token,maximum:t.maximum,addition:t.addition,user:t.user}))}},{key:"initVideo",value:function(){var e=this;if(("auto"===this.option.video.type?/m3u8(#|\?|$)/i.exec(this.video.src):"hls"===this.option.video.type)&&Hls.isSupported()){var t=new Hls;t.loadSource(this.video.src),t.attachMedia(this.video)}if(("auto"===this.option.video.type?/.flv(#|\?|$)/i.exec(this.video.src):"flv"===this.option.video.type)&&flvjs.isSupported()){var i=flvjs.createPlayer({type:"flv",url:this.option.video.url});i.attachMediaElement(this.video),i.load()}this.video.addEventListener("durationchange",function(){1!==e.video.duration&&(e.element.getElementsByClassName("dplayer-dtime")[0].innerHTML=o.default.secondToTime(e.video.duration))}),this.video.addEventListener("progress",function(){var t=e.video.buffered.length?e.video.buffered.end(e.video.buffered.length-1)/e.video.duration:0;e.updateBar("loaded",t,"width")}),this.video.addEventListener("error",function(){e.tran&&e.notice&&e.notice(e.tran("This video fails to load"),-1),e.trigger&&e.trigger("pause")}),this.video.addEventListener("canplay",function(){e.trigger("canplay")}),this.ended=!1,this.video.addEventListener("ended",function(){e.updateBar("played",1,"width"),e.loop?(e.seek(0),e.video.play()):(e.ended=!0,e.pause(),e.trigger("ended")),e.danmaku&&(e.danmaku.danIndex=0)}),this.video.addEventListener("play",function(){e.paused&&e.play()}),this.video.addEventListener("pause",function(){e.paused||e.pause()}),this.volume(localStorage.getItem("dplayer-volume")||this.option.volume,!0,!0)}},{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;var i=this.video.paused;this.video.pause();var n=h.default.video(!1,null,this.option.screenshot,"auto",this.quality.url),a=(new DOMParser).parseFromString(n,"text/html").body.firstChild,s=this.element.getElementsByClassName("dplayer-video-wrap")[0];s.insertBefore(a,s.getElementsByTagName("div")[0]),this.prevVideo=this.video,this.video=a,this.initVideo(),this.seek(this.prevVideo.currentTime),this.notice(this.tran("Switching to")+" "+this.quality.name+" "+this.tran("quality"),-1),this.video.addEventListener("canplay",function(){if(t.prevVideo){if(t.video.currentTime!==t.prevVideo.currentTime)return void t.seek(t.prevVideo.currentTime);s.removeChild(t.prevVideo),t.video.classList.add("dplayer-video-current"),i||t.video.play(),t.prevVideo=null,t.notice(t.tran("Switched to")+" "+t.quality.name+" "+t.tran("quality")),t.switchingQuality=!1}})}}},{key:"mouseHandler",value:function(e,t){var i=this,n=function(e){var t=0,i=0;do{t+=e.offsetTop||0,i+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:i}};return function(a){if(i.video.duration){var s=a.clientX,l=n(e).left,d=s-l,r=i.video.duration*(d/e.offsetWidth);switch(t.style.left=d-20+"px",i.previewWrapper.style.left=d-i.previewWrapper.offsetWidth/2+"px",a.type){case"mouseenter":case"mouseover":case"mousemove":i.isMouseHoverPbar=!0,i.previewTime!==parseInt(r)&&(t.innerText=o.default.secondToTime(r),i.previewTime=parseInt(r),i.setPreview&&clearTimeout(i.setPreview),i.setPreview=setTimeout(function(){i.setPreviewSourceAndFrame({time:parseInt(r)})},500)),i.timeTipsDisplay(!0,t);break;case"mouseleave":case"mouseout":i.isMouseHoverPbar=!1,i.previewDispaly(!1),i.timeTipsDisplay(!1,t)}}}}},{key:"timeTipsDisplay",value:function(e,t){if(e){if(this.isTimeTipsShow)return;t.classList.remove("hidden"),this.isTimeTipsShow=!0}else{if(!this.isTimeTipsShow)return;t.classList.add("hidden"),this.isTimeTipsShow=!1}}},{key:"initVideoPreview",value:function(){var e=this;this.previewVideo=document.createElement("video"),this.previewWrapper=this.element.getElementsByClassName("dplayer-bar-preview")[0],this.previewCanvas=this.element.getElementsByClassName("dplayer-bar-preview-canvas")[0],this.previewVideo.preload="metadata";var t=function(){var t=e.element.offsetWidth/4,i=e.element.offsetHeight/4;e.previewWrapper.style.width=t+"px",e.previewWrapper.style.height=i+"px",e.previewWrapper.style.top=2-i+"px",e.previewCanvas.width=t,e.previewCanvas.height=i};t(),this.video.addEventListener("loadedmetadata",function(){t()}),this.setPreviewSourceAndFrame({url:this.video.src,time:0}),this.bindPreviewEvent()}},{key:"setPreviewSourceAndFrame",value:function(e){var t=e.url,i=e.time;t&&(this.previewVideo.src=t),i&&(this.previewVideo.currentTime=i)}},{key:"bindPreviewEvent",value:function(){var e=this;this.previewNumber=0,this.previewVideo.addEventListener("seeked",function(){e.previewNumber+=1,e.generPreviewImage(e.previewNumber)})}},{key:"generPreviewImage",value:function(e){if(e===this.previewNumber&&this.isMouseHoverPbar&&(this.previewDispaly(!0),this.isPreViewShow)){this.previewCanvas.getContext("2d").drawImage(this.previewVideo,0,0,this.previewWrapper.offsetWidth,this.previewWrapper.offsetHeight)}}},{key:"previewDispaly",value:function(e){if(e){if(this.isPreViewShow)return;if(!this.isMouseHoverPbar)return;this.previewWrapper.classList.remove("hidden"),this.isPreViewShow=!0}else{if(!this.isPreViewShow)return;this.previewWrapper.classList.add("hidden"),this.isPreViewShow=!1}}},{key:"notice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8,n=this.element.getElementsByClassName("dplayer-notice")[0];n.innerHTML=e,n.style.opacity=i,this.noticeTime&&clearTimeout(this.noticeTime),this.noticeTime=setTimeout(function(){n.style.opacity=0},t)}},{key:"destroy",value:function(){this.pause(),clearTimeout(this.hideTime),this.video.src="",this.element.innerHTML="";for(var e in this)this.hasOwnProperty(e)&&"paused"!==e&&delete this[e]}}]),e}();e.exports=k},function(e,t){},function(e,t,i){"use strict";e.exports={secondToTime:function(e){var t=function(e){return e<10?"0"+e:""+e},i=parseInt(e/60),n=parseInt(e-60*i);return t(i)+":"+t(n)},getElementViewLeft:function(e){var t=e.offsetLeft,i=e.offsetParent,n=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==i&&i!==e;)t+=i.offsetLeft,i=i.offsetParent;else for(;null!==i;)t+=i.offsetLeft,i=i.offsetParent;return t-n},isMobile:/mobile/i.test(window.navigator.userAgent)}},function(e,t,i){"use strict";var n=i(6);e.exports=function(e){/mobile/i.test(window.navigator.userAgent)&&(e.autoplay=!1);var t={element:document.getElementsByClassName("dplayer")[0],autoplay:!1,theme:"#b7daff",loop:!1,lang:-1!==navigator.language.indexOf("zh")?"zh":"en",screenshot:!1,hotkey:!0,preload:"auto",volume:"0.7",apiBackend:n,contextmenu:[{text:"\u5173\u4e8e\u4f5c\u8005",link:"http://diygod.me"},{text:"\u64ad\u653e\u5668\u610f\u89c1\u53cd\u9988",link:"https://github.com/DIYgod/DPlayer/issues"},{text:"\u5173\u4e8e DPlayer \u64ad\u653e\u5668",link:"https://github.com/DIYgod/DPlayer"}]};for(var i in t)t.hasOwnProperty(i)&&!e.hasOwnProperty(i)&&(e[i]=t[i]);return"[object Array]"!==Object.prototype.toString.call(e.video.url)&&(e.video.url=[e.video.url]),e.video&&!e.video.hasOwnProperty("type")&&(e.video.type="auto"),e.danmaku&&!e.danmaku.hasOwnProperty("user")&&(e.danmaku.user="DIYgod"),e.video.quality&&(e.video.url=[e.video.quality[e.video.defaultQuality].url]),e}},function(e,t,i){"use strict";var n=function(e,t,i,n,a){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?n(s,e):i(s,e)}a(s)}},s.open(null!==t?"POST":"GET",e,!0),s.send(null!==t?JSON.stringify(t):null)};e.exports={send:function(e,t,i){n(e,t,function(e,t){console.log("Post danmaku: ",t),i&&i()},function(e,t){alert(t.msg)},function(e){console.log("Request was unsuccessful: "+e.status)})},read:function(e,t){n(e,null,function(e,i){t(null,i.danmaku)},function(e,i){t({status:e.status,response:i})},function(e){t({status:e.status,response:null})})}}},function(e,t,i){"use strict";var n={"Danmaku is loading":"\u5f39\u5e55\u52a0\u8f7d\u4e2d",Top:"\u9876\u90e8",Bottom:"\u5e95\u90e8",Rolling:"\u6eda\u52a8","Input danmaku, hit Enter":"\u8f93\u5165\u5f39\u5e55\uff0c\u56de\u8f66\u53d1\u9001","About author":"\u5173\u4e8e\u4f5c\u8005","DPlayer feedback":"\u64ad\u653e\u5668\u610f\u89c1\u53cd\u9988","About DPlayer":"\u5173\u4e8e DPlayer \u64ad\u653e\u5668",Loop:"\u6d17\u8111\u5faa\u73af",Speed:"\u901f\u5ea6","Opacity for danmaku":"\u5f39\u5e55\u900f\u660e\u5ea6",Normal:"\u6b63\u5e38","Please input danmaku content!":"\u8981\u8f93\u5165\u5f39\u5e55\u5185\u5bb9\u554a\u5582\uff01","Set danmaku color":"\u8bbe\u7f6e\u5f39\u5e55\u989c\u8272","Set danmaku type":"\u8bbe\u7f6e\u5f39\u5e55\u7c7b\u578b",Danmaku:"\u5f39\u5e55","This video fails to load":"\u89c6\u9891\u52a0\u8f7d\u5931\u8d25","Switching to":"\u6b63\u5728\u5207\u6362\u81f3","Switched to":"\u5df2\u7ecf\u5207\u6362\u81f3",quality:"\u753b\u8d28","FF to":"\u5feb\u8fdb\u81f3","REW to":"\u5feb\u9000\u81f3",Volume:"\u97f3\u91cf"};e.exports=function(e){var t=this;this.lang=e,this.tran=function(e){return"en"===t.lang?e:"zh"===t.lang?n[e]:void 0}}},function(e,t,i){"use strict";var n=i(0),a={main:function(e,t,i){for(var s="",l=0;l
'+s+(e.logo?'':"")+'
'+(e.danmaku?''+i("Danmaku is loading")+"":"")+'
0:00 / 0:00
'+(e.video.quality?'
'+a.qualityList(e.video.quality)+"
":"")+(e.screenshot?''+n("camera")+"":"")+'
'+i("Set danmaku color")+'
'+i("Set danmaku type")+'
'+a.contextmenuList(e.contextmenu)+'
'},contextmenuList:function(e){for(var t='";return t+=""},qualityList:function(e){for(var t='
',i=0;i'+e[i].name+"
";return t+=""},video:function(e,t,i,n,a){return''},setting:function(e){return{original:'
'+e("Speed")+'
'+n("right")+'
'+e("Loop")+'
'+e("Danmaku")+'
'+e("Opacity for danmaku")+'
',speed:'
0.5
0.75
'+e("Normal")+'
1.25
1.5
2
'}}};e.exports=a},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var i=0;iparseFloat(t.time);)i.push(t),t=this.dan[++this.danIndex];this.draw(i)}window.requestAnimationFrame(function(){e.frame()})}},{key:"opacity",value:function(e){if(void 0!==e){for(var t=this.container.getElementsByClassName("dplayer-danmaku-item"),i=0;i'+e[a].text+"":s.innerHTML=e[a].text,s.style.opacity=t._opacity,s.style.color=e[a].color,s.addEventListener("animationend",function(){t.container.removeChild(s)});var l=t._measure(e[a].text);switch(e[a].type){case"right":s.style.width=l+1+"px",s.style.top=i*r(s,e[a].type,l)+"px",s.style.transform="translateX(-"+n+"px)";break;case"top":s.style.top=i*r(s,e[a].type)+"px";break;case"bottom":s.style.bottom=i*r(s,e[a].type)+"px";break;default:console.error("Can't handled danmaku type: "+e[a].type)}s.classList.add("dplayer-danmaku-move"),c.appendChild(s)}(u);return this.container.appendChild(c),c}},{key:"play",value:function(){this.paused=!1}},{key:"pause",value:function(){this.paused=!0}},{key:"_measure",value:function(e){if(!this.context){var t=getComputedStyle(this.container.getElementsByClassName("dplayer-danmaku-item")[0],null);this.context=document.createElement("canvas").getContext("2d"),this.context.font=t.getPropertyValue("font")}return this.context.measureText(e).width}},{key:"seek",value:function(){for(var e=0;e=this.options.time()){this.danIndex=e;break}this.danIndex=this.dan.length}}},{key:"clear",value:function(){this.danTunnel={right:{},top:{},bottom:{}},this.danIndex=0,this.options.container.innerHTML=""}},{key:"htmlEncode",value:function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}},{key:"resize",value:function(){for(var e=this.container.offsetWidth,t=this.container.getElementsByClassName("dplayer-danmaku-item"),i=0;i\\n';\n};\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nconsole.log('\\n' + ' %c DPlayer ' + \"1.6.1\" + ' %c http://dplayer.js.org ' + '\\n' + '\\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');\nmodule.exports = __webpack_require__(2);\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor)\n descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps)\n defineProperties(Constructor.prototype, protoProps);\n if (staticProps)\n defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n__webpack_require__(3);\nvar _utils = __webpack_require__(4);\nvar _utils2 = _interopRequireDefault(_utils);\nvar _svg = __webpack_require__(0);\nvar _svg2 = _interopRequireDefault(_svg);\nvar _option = __webpack_require__(5);\nvar _option2 = _interopRequireDefault(_option);\nvar _i18n = __webpack_require__(7);\nvar _i18n2 = _interopRequireDefault(_i18n);\nvar _html = __webpack_require__(8);\nvar _html2 = _interopRequireDefault(_html);\nvar _danmaku = __webpack_require__(9);\nvar _danmaku2 = _interopRequireDefault(_danmaku);\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n}\nvar index = 0;\nvar DPlayer = function () {\n function DPlayer(option) {\n var _this = this;\n _classCallCheck(this, DPlayer);\n this.option = (0, _option2.default)(option);\n this.option.element.classList.add('dplayer');\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 this.tran = new _i18n2.default(this.option.lang).tran;\n var eventTypes = [\n 'play',\n 'pause',\n 'canplay',\n 'playing',\n 'ended',\n 'error'\n ];\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 this.element = this.option.element;\n if (!this.option.danmaku) {\n this.element.classList.add('dplayer-no-danmaku');\n }\n if (_utils.isMobile) {\n this.element.classList.add('dplayer-mobile');\n }\n this.element.innerHTML = _html2.default.main(option, index, this.tran);\n var bar = {};\n bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\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 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 document.addEventListener('click', function () {\n _this.focus = false;\n }, true);\n this.element.addEventListener('click', function () {\n _this.focus = true;\n }, true);\n if (this.option.danmaku) {\n this.danmaku = new _danmaku2.default({\n container: this.element.getElementsByClassName('dplayer-danmaku')[0],\n opacity: localStorage.getItem('danmaku-opacity') || 0.7,\n callback: function callback() {\n _this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n if (_this.option.autoplay && !_utils.isMobile) {\n _this.play();\n } else if (_utils.isMobile) {\n _this.pause();\n }\n },\n error: function error(msg) {\n _this.notice(msg);\n },\n apiBackend: this.option.apiBackend,\n borderColor: this.option.theme,\n height: this.arrow ? 24 : 30,\n time: function time() {\n return _this.video.currentTime;\n },\n api: {\n id: this.option.danmaku.id,\n address: this.option.danmaku.api,\n token: this.option.danmaku.token,\n maximum: this.option.danmaku.maximum,\n addition: this.option.danmaku.addition,\n user: this.option.danmaku.user\n }\n });\n }\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 this.video = this.element.getElementsByClassName('dplayer-video-current')[0];\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 this.playButton = this.element.getElementsByClassName('dplayer-play-icon')[0];\n this.paused = true;\n this.playButton.addEventListener('click', function () {\n _this.toggle();\n });\n var videoWrap = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n var conMask = this.element.getElementsByClassName('dplayer-controller-mask')[0];\n if (!_utils.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 var lastPlayPos = 0;\n var currentPlayPos = 0;\n var bufferingDetected = false;\n window.requestAnimationFrame = function () {\n return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {\n window.setTimeout(callback, 1000 / 60);\n };\n }();\n var setCheckLoadingTime = function setCheckLoadingTime() {\n _this.checkLoading = setInterval(function () {\n currentPlayPos = _this.video.currentTime;\n if (!bufferingDetected && currentPlayPos < lastPlayPos + 0.01 && !_this.video.paused) {\n _this.element.classList.add('dplayer-loading');\n bufferingDetected = true;\n }\n if (bufferingDetected && currentPlayPos > lastPlayPos + 0.01 && !_this.video.paused) {\n _this.element.classList.remove('dplayer-loading');\n bufferingDetected = false;\n }\n lastPlayPos = currentPlayPos;\n }, 100);\n };\n var clearCheckLoadingTime = function clearCheckLoadingTime() {\n clearInterval(_this.checkLoading);\n };\n this.playedTime = false;\n this.animationFrame = function () {\n if (_this.playedTime) {\n _this.updateBar('played', _this.video.currentTime / _this.video.duration, 'width');\n _this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = _utils2.default.secondToTime(_this.video.currentTime);\n _this.trigger('playing');\n }\n window.requestAnimationFrame(_this.animationFrame);\n };\n window.requestAnimationFrame(this.animationFrame);\n this.setTime = function (type) {\n if (!type) {\n _this.playedTime = true;\n setCheckLoadingTime();\n } else {\n _this[type + 'Time'] = true;\n if (type === 'played') {\n setCheckLoadingTime();\n }\n }\n };\n this.clearTime = function (type) {\n if (!type) {\n _this.playedTime = false;\n clearCheckLoadingTime();\n } else {\n _this[type + 'Time'] = false;\n if (type === 'played') {\n clearCheckLoadingTime();\n }\n }\n };\n pbar.addEventListener('click', function (event) {\n var e = event || window.event;\n barWidth = pbar.clientWidth;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('played', percentage, 'width');\n _this.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n });\n this.initVideoPreview();\n this.isPreViewShow = false;\n this.isTimeTipsShow = true;\n this.isMouseHoverPbar = false;\n this.mouseHandler = this.mouseHandler(pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.mouseHandler);\n pbar.addEventListener('mouseover', this.mouseHandler);\n pbar.addEventListener('mouseenter', this.mouseHandler);\n pbar.addEventListener('mouseout', this.mouseHandler);\n pbar.addEventListener('mouseleave', this.mouseHandler);\n var thumbMove = function thumbMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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 = _utils2.default.secondToTime(percentage * _this.video.duration);\n };\n var thumbUp = function thumbUp() {\n document.removeEventListener('mouseup', thumbUp);\n document.removeEventListener('mousemove', thumbMove);\n _this.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n _this.setTime();\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 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 this.switchVolumeIcon = function () {\n var volumeicon = _this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (_this.volume() >= 0.95) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-up');\n } else if (_this.volume() > 0) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-down');\n } else {\n volumeicon.innerHTML = (0, _svg2.default)('volume-off');\n }\n };\n var volumeMove = function volumeMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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 volumeBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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.muted) {\n _this.video.muted = false;\n _this.switchVolumeIcon();\n _this.updateBar('volume', _this.volume(), 'width');\n } else {\n _this.video.muted = true;\n volumeicon.innerHTML = (0, _svg2.default)('volume-off');\n _this.updateBar('volume', 0, 'width');\n }\n });\n this.hideTime = 0;\n var hideController = function hideController() {\n _this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(_this.hideTime);\n _this.hideTime = setTimeout(function () {\n if (_this.video.played.length) {\n _this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n if (!_utils.isMobile) {\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n var settingHTML = _html2.default.setting(this.tran);\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 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 mask.addEventListener('click', function () {\n closeSetting();\n });\n settingIcon.addEventListener('click', function () {\n openSetting();\n });\n this.loop = this.option.loop;\n var showdan = true;\n var settingEvent = function settingEvent() {\n var loopEle = _this.element.getElementsByClassName('dplayer-setting-loop')[0];\n var loopToggle = loopEle.getElementsByClassName('dplayer-toggle-setting-input')[0];\n loopToggle.checked = _this.loop;\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 var showDanEle = _this.element.getElementsByClassName('dplayer-setting-showdan')[0];\n var showDanToggle = showDanEle.getElementsByClassName('dplayer-showdan-setting-input')[0];\n showDanToggle.checked = showdan;\n showDanEle.addEventListener('click', function () {\n showDanToggle.checked = !showDanToggle.checked;\n if (showDanToggle.checked) {\n showdan = true;\n if (!_this.paused) {\n _this.danmaku.show();\n }\n } else {\n showdan = false;\n _this.danmaku.hide();\n }\n closeSetting();\n });\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 var speedItem = settingBox.getElementsByClassName('dplayer-setting-speed-item');\n var _loop = function _loop(_i2) {\n speedItem[_i2].addEventListener('click', function () {\n _this.video.playbackRate = speedItem[_i2].dataset.speed;\n closeSetting();\n });\n };\n for (var _i2 = 0; _i2 < speedItem.length; _i2++) {\n _loop(_i2);\n }\n });\n if (_this.danmaku) {\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.danmaku.opacity(), 'width');\n var danmakuMove = function danmakuMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n _this.danmaku.opacity(percentage);\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 danmakuBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n _this.danmaku.opacity(percentage);\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 if (this.video.duration !== 1) {\n this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = this.video.duration ? _utils2.default.secondToTime(this.video.duration) : '00:00';\n }\n if (!this.danmaku) {\n if (this.option.autoplay && !_utils.isMobile) {\n this.play();\n } else if (_utils.isMobile) {\n this.pause();\n }\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 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 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 commentBox.classList.remove('dplayer-comment-box-open');\n mask.classList.remove('dplayer-mask-show');\n _this.element.classList.remove('dplayer-show-controller');\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 commentBox.classList.add('dplayer-comment-box-open');\n mask.classList.add('dplayer-mask-show');\n _this.element.classList.add('dplayer-show-controller');\n disableHide = setInterval(function () {\n clearTimeout(_this.hideTime);\n }, 1000);\n commentFocusTimeout = setTimeout(function () {\n commentInput.focus();\n }, 300);\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 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 var sendComment = function sendComment() {\n commentInput.blur();\n if (!commentInput.value.replace(/^\\s+|\\s+$/g, '')) {\n _this.notice(_this.tran('Please input danmaku content!'));\n return;\n }\n _this.danmaku.send({\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 }, function () {\n commentInput.value = '';\n closeComment();\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 commentSendIcon.addEventListener('click', sendComment);\n this.element.addEventListener('fullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\n this.element.addEventListener('mozfullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\n this.element.addEventListener('webkitfullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\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.webkitEnterFullscreen) {\n _this.video.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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n }\n });\n var handleKeyDown = function handleKeyDown(e) {\n if (_this.focus) {\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.seek(_this.video.currentTime - 5);\n hideController();\n break;\n case 39:\n event.preventDefault();\n _this.seek(_this.video.currentTime + 5);\n hideController();\n break;\n case 38:\n event.preventDefault();\n percentage = _this.volume() + 0.1;\n _this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = _this.volume() - 0.1;\n _this.volume(percentage);\n break;\n }\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', function (e) {\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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n }\n break;\n }\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 menu.classList.add('dplayer-menu-show');\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 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 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 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.videoWidth;\n canvas.height = _this.video.videoHeight;\n canvas.getContext('2d').drawImage(_this.video, 0, 0, canvas.width, canvas.height);\n camareIcon.href = canvas.toDataURL();\n camareIcon.download = 'DPlayer.png';\n });\n }\n this.initVideo();\n index++;\n }\n _createClass(DPlayer, [\n {\n key: 'seek',\n value: function seek(time) {\n time = Math.max(time, 0);\n if (this.video.duration) {\n time = Math.min(time, this.video.duration);\n }\n if (this.video.currentTime < time) {\n this.notice(this.tran('FF to') + ' ' + _utils2.default.secondToTime(time));\n } else if (this.video.currentTime > time) {\n this.notice(this.tran('REW to') + ' ' + _utils2.default.secondToTime(time));\n }\n this.video.currentTime = time;\n if (this.danmaku) {\n this.danmaku.seek();\n }\n this.updateBar('played', time / this.video.duration, 'width');\n }\n },\n {\n key: 'play',\n value: function play() {\n this.paused = false;\n if (this.video.paused) {\n this.bezel.innerHTML = (0, _svg2.default)('play');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n this.playButton.innerHTML = (0, _svg2.default)('pause');\n this.video.play();\n this.setTime();\n this.element.classList.add('dplayer-playing');\n if (this.danmaku) {\n this.danmaku.play();\n }\n this.trigger('play');\n }\n },\n {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n this.element.classList.remove('dplayer-loading');\n if (!this.video.paused) {\n this.bezel.innerHTML = (0, _svg2.default)('pause');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n this.ended = false;\n this.playButton.innerHTML = (0, _svg2.default)('play');\n this.video.pause();\n this.clearTime();\n this.element.classList.remove('dplayer-playing');\n if (this.danmaku) {\n this.danmaku.pause();\n }\n this.trigger('pause');\n }\n },\n {\n key: 'volume',\n value: function volume(percentage, nonotice, nostorage) {\n percentage = parseFloat(percentage);\n if (!isNaN(percentage)) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n if (!nostorage) {\n localStorage.setItem('dplayer-volume', percentage);\n }\n if (!nonotice) {\n this.notice(this.tran('Volume') + ' ' + (percentage * 100).toFixed(0) + '%');\n }\n this.video.volume = percentage;\n if (this.video.muted) {\n this.video.muted = false;\n }\n this.switchVolumeIcon();\n }\n return this.video.volume;\n }\n },\n {\n key: 'toggle',\n value: function toggle() {\n if (this.video.paused) {\n this.play();\n } else {\n this.pause();\n }\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 key: 'switchVideo',\n value: function switchVideo(video, danmakuAPI) {\n this.video.poster = video.pic ? video.pic : '';\n this.video.src = video.url;\n this.pause();\n if (danmakuAPI) {\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 if (this.danmaku) {\n this.danmaku.reload({\n id: danmakuAPI.id,\n address: danmakuAPI.api,\n token: danmakuAPI.token,\n maximum: danmakuAPI.maximum,\n addition: danmakuAPI.addition,\n user: danmakuAPI.user\n });\n }\n }\n }\n },\n {\n key: 'initVideo',\n value: function initVideo() {\n var _this2 = this;\n var enablehls = void 0;\n if (this.option.video.type === 'auto') {\n enablehls = /m3u8(#|\\?|$)/i.exec(this.video.src);\n } else if (this.option.video.type === 'hls') {\n enablehls = true;\n } else {\n enablehls = false;\n }\n if (enablehls && Hls.isSupported()) {\n var hls = new Hls();\n hls.loadSource(this.video.src);\n hls.attachMedia(this.video);\n }\n var enableflv = void 0;\n if (this.option.video.type === 'auto') {\n enableflv = /.flv(#|\\?|$)/i.exec(this.video.src);\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);\n flvPlayer.load();\n }\n this.video.addEventListener('durationchange', function () {\n if (_this2.video.duration !== 1) {\n _this2.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = _utils2.default.secondToTime(_this2.video.duration);\n }\n });\n this.video.addEventListener('progress', function () {\n var percentage = _this2.video.buffered.length ? _this2.video.buffered.end(_this2.video.buffered.length - 1) / _this2.video.duration : 0;\n _this2.updateBar('loaded', percentage, 'width');\n });\n this.video.addEventListener('error', function () {\n _this2.tran && _this2.notice && _this2.notice(_this2.tran('This video fails to load'), -1);\n _this2.trigger && _this2.trigger('pause');\n });\n this.video.addEventListener('canplay', function () {\n _this2.trigger('canplay');\n });\n this.ended = false;\n this.video.addEventListener('ended', function () {\n _this2.updateBar('played', 1, 'width');\n if (!_this2.loop) {\n _this2.ended = true;\n _this2.pause();\n _this2.trigger('ended');\n } else {\n _this2.seek(0);\n _this2.video.play();\n }\n if (_this2.danmaku) {\n _this2.danmaku.danIndex = 0;\n }\n });\n this.video.addEventListener('play', function () {\n if (_this2.paused) {\n _this2.play();\n }\n });\n this.video.addEventListener('pause', function () {\n if (!_this2.paused) {\n _this2.pause();\n }\n });\n this.volume(localStorage.getItem('dplayer-volume') || this.option.volume, true, true);\n }\n },\n {\n key: 'switchQuality',\n value: function switchQuality(index) {\n var _this3 = this;\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 var paused = this.video.paused;\n this.video.pause();\n var videoHTML = _html2.default.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.insertBefore(videoEle, parent.getElementsByTagName('div')[0]);\n this.prevVideo = this.video;\n this.video = videoEle;\n this.initVideo();\n this.seek(this.prevVideo.currentTime);\n this.notice(this.tran('Switching to') + ' ' + this.quality.name + ' ' + this.tran('quality'), -1);\n this.video.addEventListener('canplay', function () {\n if (_this3.prevVideo) {\n if (_this3.video.currentTime !== _this3.prevVideo.currentTime) {\n _this3.seek(_this3.prevVideo.currentTime);\n return;\n }\n parent.removeChild(_this3.prevVideo);\n _this3.video.classList.add('dplayer-video-current');\n if (!paused) {\n _this3.video.play();\n }\n _this3.prevVideo = null;\n _this3.notice(_this3.tran('Switched to') + ' ' + _this3.quality.name + ' ' + _this3.tran('quality'));\n _this3.switchingQuality = false;\n }\n });\n }\n },\n {\n key: 'mouseHandler',\n value: function mouseHandler(pbar, timeTips) {\n var _this4 = this;\n var cumulativeOffset = function cumulativeOffset(element) {\n var top = 0, left = 0;\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n return {\n top: top,\n left: left\n };\n };\n return function (e) {\n if (!_this4.video.duration) {\n return;\n }\n var clientX = e.clientX;\n var px = cumulativeOffset(pbar).left;\n var tx = clientX - px;\n var time = _this4.video.duration * (tx / pbar.offsetWidth);\n timeTips.innerText = _utils2.default.secondToTime(time);\n timeTips.style.left = tx - 20 + 'px';\n _this4.previewWrapper.style.left = tx - _this4.previewWrapper.offsetWidth / 2 + 'px';\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n _this4.isMouseHoverPbar = true;\n _this4.setPreviewSourceAndFrame({\n url: _this4.video.src,\n time: time\n });\n _this4.timeTipsDisplay(true, timeTips);\n break;\n case 'mouseleave':\n case 'mouseout':\n _this4.isMouseHoverPbar = false;\n _this4.previewDispaly(false);\n _this4.timeTipsDisplay(false, timeTips);\n break;\n }\n };\n }\n },\n {\n key: 'timeTipsDisplay',\n value: function timeTipsDisplay(show, timeTips) {\n if (show) {\n if (this.isTimeTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n this.isTimeTipsShow = true;\n } else {\n if (!this.isTimeTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n this.isTimeTipsShow = false;\n }\n }\n },\n {\n key: 'initVideoPreview',\n value: function initVideoPreview() {\n var _this5 = this;\n this.previewVideo = document.createElement('video');\n this.previewWrapper = this.element.getElementsByClassName('dplayer-bar-preview')[0];\n this.previewCanvas = this.element.getElementsByClassName('dplayer-bar-preview-canvas')[0];\n this.previewVideo.preload = 'auto';\n var resize = function resize() {\n var w = _this5.element.offsetWidth / 4;\n var h = _this5.element.offsetHeight / 4;\n _this5.previewWrapper.style.width = w + 'px';\n _this5.previewWrapper.style.height = h + 'px';\n _this5.previewWrapper.style.top = -h + 2 + 'px';\n _this5.previewCanvas.width = w;\n _this5.previewCanvas.height = h;\n };\n resize();\n this.video.addEventListener('loadedmetadata', function () {\n resize();\n });\n this.setPreviewSourceAndFrame({\n url: this.video.src,\n time: 0\n });\n this.bindPreviewEvent();\n }\n },\n {\n key: 'setPreviewSourceAndFrame',\n value: function setPreviewSourceAndFrame(_ref) {\n var url = _ref.url, time = _ref.time;\n if (url) {\n this.previewVideo.src = url;\n }\n if (time) {\n this.previewVideo.currentTime = time;\n }\n }\n },\n {\n key: 'bindPreviewEvent',\n value: function bindPreviewEvent() {\n var _this6 = this;\n this.previewNumber = 0;\n this.previewVideo.addEventListener('seeked', function () {\n _this6.previewNumber += 1;\n _this6.generPreviewImage(_this6.previewNumber);\n });\n }\n },\n {\n key: 'generPreviewImage',\n value: function generPreviewImage(number) {\n if (number !== this.previewNumber) {\n return;\n }\n if (!this.isMouseHoverPbar) {\n return;\n }\n this.previewDispaly(true);\n if (!this.isPreViewShow) {\n return;\n }\n var ctx = this.previewCanvas.getContext('2d');\n ctx.drawImage(this.previewVideo, 0, 0, this.previewWrapper.offsetWidth, this.previewWrapper.offsetHeight);\n }\n },\n {\n key: 'previewDispaly',\n value: function previewDispaly(show) {\n if (show) {\n if (this.isPreViewShow) {\n return;\n }\n if (!this.isMouseHoverPbar) {\n return;\n }\n this.previewWrapper.classList.remove('hidden');\n this.isPreViewShow = true;\n } else {\n if (!this.isPreViewShow) {\n return;\n }\n this.previewWrapper.classList.add('hidden');\n this.isPreViewShow = false;\n }\n }\n },\n {\n key: 'notice',\n value: function notice(text) {\n var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.8;\n var noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = opacity;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n this.noticeTime = setTimeout(function () {\n noticeEle.style.opacity = 0;\n }, time);\n }\n },\n {\n key: 'destroy',\n value: function destroy() {\n this.pause();\n clearTimeout(this.hideTime);\n this.video.src = '';\n this.element.innerHTML = '';\n for (var key in this) {\n if (this.hasOwnProperty(key) && key !== 'paused') {\n delete this[key];\n }\n }\n }\n }\n ]);\n return DPlayer;\n}();\nmodule.exports = DPlayer;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nmodule.exports = {\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 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 !== element) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n }\n return actualLeft - elementScrollLeft;\n },\n isMobile: /mobile/i.test(window.navigator.userAgent)\n};\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar defaultApiBackend = __webpack_require__(6);\nmodule.exports = function (option) {\n var isMobile = /mobile/i.test(window.navigator.userAgent);\n if (isMobile) {\n option.autoplay = false;\n }\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 volume: '0.7',\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 (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 if (option.video.quality) {\n option.video.url = [option.video.quality[option.video.defaultQuality].url];\n }\n return option;\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar SendXMLHttpRequest = function SendXMLHttpRequest(url, data, success, error, fail) {\n var xhr = new XMLHttpRequest();\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 if (response.code !== 1) {\n return error(xhr, response);\n }\n return success(xhr, response);\n }\n fail(xhr);\n }\n };\n xhr.open(data !== null ? 'POST' : 'GET', url, true);\n xhr.send(data !== null ? JSON.stringify(data) : null);\n};\nmodule.exports = {\n send: function send(endpoint, danmakuData, callback) {\n SendXMLHttpRequest(endpoint, danmakuData, function (xhr, response) {\n console.log('Post danmaku: ', response);\n if (callback) {\n callback();\n }\n }, function (xhr, response) {\n alert(response.msg);\n }, function (xhr) {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n read: function read(endpoint, callback) {\n SendXMLHttpRequest(endpoint, null, function (xhr, response) {\n callback(null, response.danmaku);\n }, function (xhr, response) {\n callback({\n status: xhr.status,\n response: response\n });\n }, function (xhr) {\n callback({\n status: xhr.status,\n response: null\n });\n });\n }\n};\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar tranZH = {\n 'Danmaku is loading': '弹幕加载中',\n 'Top': '顶部',\n 'Bottom': '底部',\n 'Rolling': '滚动',\n 'Input danmaku, hit Enter': '输入弹幕\\uFF0C回车发送',\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!': '要输入弹幕内容啊喂\\uFF01',\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 'FF to': '快进至',\n 'REW to': '快退至',\n 'Volume': '音量'\n};\nmodule.exports = function (lang) {\n var _this = this;\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/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar svg = __webpack_require__(0);\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 '
' + videos + '' + (option.logo ? '
' : '') + '
' + (option.danmaku ? '' + tran('Danmaku is loading') + '' : '') + '
0:00 / 0:00
' + (option.video.quality ? '
' + html.qualityList(option.video.quality) + '
' : '') + '' + (option.screenshot ? '' + svg('camera') + '' : '') + '
' + tran('Set danmaku color') + '
' + tran('Set danmaku type') + '
00:00
' + html.contextmenuList(option.contextmenu) + '
';\n },\n contextmenuList: function contextmenuList(contextmenu) {\n var result = '
';\n for (var i = 0; i < contextmenu.length; i++) {\n result += '';\n }\n result += '
';\n return result;\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 return result;\n },\n video: function video(current, pic, screenshot, preload, url) {\n return '';\n },\n setting: function setting(tran) {\n return {\n 'original': '
' + tran('Speed') + '
' + svg('right') + '
' + tran('Loop') + '
' + tran('Danmaku') + '
' + tran('Opacity for danmaku') + '
',\n 'speed': '
0.5
0.75
' + tran('Normal') + '
1.25
1.5
2
'\n };\n }\n};\nmodule.exports = html;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar _typeof = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;\n};\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor)\n descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps)\n defineProperties(Constructor.prototype, protoProps);\n if (staticProps)\n defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n}\nvar Danmaku = function () {\n function Danmaku(options) {\n _classCallCheck(this, Danmaku);\n this.options = options;\n this.container = this.options.container;\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.danIndex = 0;\n this.dan = [];\n this.showing = true;\n this._opacity = this.options.opacity;\n this.load();\n }\n _createClass(Danmaku, [\n {\n key: 'load',\n value: function load() {\n var _this = this;\n var apiurl = void 0;\n if (this.options.api.maximum) {\n apiurl = this.options.api.address + '?id=' + this.options.api.id + '&max=' + this.options.api.maximum;\n } else {\n apiurl = this.options.api.address + '?id=' + this.options.api.id;\n }\n var endpoints = (this.options.api.addition || []).slice(0);\n endpoints.push(apiurl);\n this._readAllEndpoints(endpoints, function (results) {\n _this.dan = [].concat.apply([], results).sort(function (a, b) {\n return a.time - b.time;\n });\n window.requestAnimationFrame(function () {\n _this.frame();\n });\n _this.options.callback();\n });\n }\n },\n {\n key: 'reload',\n value: function reload(newAPI) {\n this.options.api = newAPI;\n this.dan = [];\n this.clear();\n this.load();\n }\n },\n {\n key: '_readAllEndpoints',\n value: function _readAllEndpoints(endpoints, callback) {\n var _this2 = this;\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.options.error(err.response.msg);\n } else {\n _this2.options.error('Request was unsuccessful: ' + err.status);\n }\n results[i] = [];\n } else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return callback(results);\n }\n };\n };\n for (var i = 0; i < endpoints.length; ++i) {\n this.options.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n },\n {\n key: 'send',\n value: function send(dan, callback) {\n var danmakuData = {\n token: this.options.api.token,\n player: this.options.api.id,\n author: this.options.api.user,\n time: this.options.time(),\n text: dan.text,\n color: dan.color,\n type: dan.type\n };\n this.options.apiBackend.send(this.options.api.address, danmakuData, callback);\n this.dan.splice(this.danIndex, 0, danmakuData);\n this.danIndex++;\n var danmaku = {\n text: this.htmlEncode(danmakuData.text),\n color: danmakuData.color,\n type: danmakuData.type,\n border: '2px solid ' + this.options.borderColor\n };\n this.draw(danmaku);\n }\n },\n {\n key: 'frame',\n value: function frame() {\n var _this3 = this;\n if (this.dan.length && !this.paused && this.showing) {\n var item = this.dan[this.danIndex];\n var dan = [];\n while (item && this.options.time() > parseFloat(item.time)) {\n dan.push(item);\n item = this.dan[++this.danIndex];\n }\n this.draw(dan);\n }\n window.requestAnimationFrame(function () {\n _this3.frame();\n });\n }\n },\n {\n key: 'opacity',\n value: function opacity(percentage) {\n if (percentage !== undefined) {\n var items = this.container.getElementsByClassName('dplayer-danmaku-item');\n for (var i = 0; i < items.length; i++) {\n items[i].style.opacity = percentage;\n }\n this._opacity = percentage;\n localStorage.setItem('danmaku-opacity', this._opacity);\n }\n return this._opacity;\n }\n },\n {\n key: 'draw',\n value: function draw(dan) {\n var _this4 = this;\n var itemHeight = this.options.height;\n var danWidth = this.container.offsetWidth;\n var danHeight = this.container.offsetHeight;\n var itemY = parseInt(danHeight / itemHeight);\n var danItemRight = function danItemRight(ele) {\n var eleWidth = ele.offsetWidth || parseInt(ele.style.width);\n var eleRight = ele.getBoundingClientRect().right || _this4.container.getBoundingClientRect().right + eleWidth;\n return _this4.container.getBoundingClientRect().right - eleRight;\n };\n var danSpeed = function danSpeed(width) {\n return (danWidth + width) / 5;\n };\n var getTunnel = function getTunnel(ele, type, width) {\n var tmp = danWidth / danSpeed(width);\n var _loop = function _loop(i) {\n var item = _this4.danTunnel[type][i + ''];\n if (item && item.length) {\n if (type !== 'right') {\n return 'continue';\n }\n for (var j = 0; j < item.length; j++) {\n var danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(parseInt(item[j].style.width)) || 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 { v: i % itemY };\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 { v: i % itemY };\n }\n };\n for (var i = 0;; i++) {\n var _ret = _loop(i);\n switch (_ret) {\n case 'continue':\n continue;\n default:\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === 'object')\n return _ret.v;\n }\n }\n };\n if (Object.prototype.toString.call(dan) !== '[object Array]') {\n dan = [dan];\n }\n var docFragment = document.createDocumentFragment();\n var _loop2 = function _loop2(i) {\n if (!dan[i].type) {\n dan[i].type = 'right';\n }\n if (!dan[i].color) {\n dan[i].color = '#fff';\n }\n var item = document.createElement('div');\n item.classList.add('dplayer-danmaku-item');\n item.classList.add('dplayer-danmaku-' + dan[i].type);\n if (dan[i].border) {\n item.innerHTML = '' + dan[i].text + '';\n } else {\n item.innerHTML = dan[i].text;\n }\n item.style.opacity = _this4._opacity;\n item.style.color = dan[i].color;\n item.addEventListener('animationend', function () {\n _this4.container.removeChild(item);\n });\n var itemWidth = _this4._measure(dan[i].text);\n switch (dan[i].type) {\n case 'right':\n item.style.width = itemWidth + 1 + 'px';\n item.style.top = itemHeight * getTunnel(item, dan[i].type, itemWidth) + 'px';\n item.style.transform = 'translateX(-' + danWidth + 'px)';\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, dan[i].type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, dan[i].type) + 'px';\n break;\n default:\n console.error('Can\\'t handled danmaku type: ' + dan[i].type);\n }\n item.classList.add('dplayer-danmaku-move');\n docFragment.appendChild(item);\n };\n for (var i = 0; i < dan.length; i++) {\n _loop2(i);\n }\n this.container.appendChild(docFragment);\n return docFragment;\n }\n },\n {\n key: 'play',\n value: function play() {\n this.paused = false;\n }\n },\n {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n }\n },\n {\n key: '_measure',\n value: function _measure(text) {\n if (!this.context) {\n var measureStyle = getComputedStyle(this.container.getElementsByClassName('dplayer-danmaku-item')[0], null);\n this.context = document.createElement('canvas').getContext('2d');\n this.context.font = measureStyle.getPropertyValue('font');\n }\n return this.context.measureText(text).width;\n }\n },\n {\n key: 'seek',\n value: function seek() {\n for (var i = 0; i < this.dan.length; i++) {\n if (this.dan[i].time >= this.options.time()) {\n this.danIndex = i;\n break;\n }\n this.danIndex = this.dan.length;\n }\n }\n },\n {\n key: 'clear',\n value: function clear() {\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.danIndex = 0;\n this.options.container.innerHTML = '';\n }\n },\n {\n key: 'htmlEncode',\n value: function htmlEncode(str) {\n return str.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/'/g, ''').replace(/\\//g, '/');\n }\n },\n {\n key: 'resize',\n value: function resize() {\n var danWidth = this.container.offsetWidth;\n var items = this.container.getElementsByClassName('dplayer-danmaku-item');\n for (var i = 0; i < items.length; i++) {\n items[i].style.transform = 'translateX(-' + danWidth + 'px)';\n }\n }\n },\n {\n key: 'hide',\n value: function hide() {\n this.showing = false;\n this.pause();\n this.clear();\n }\n },\n {\n key: 'show',\n value: function show() {\n this.seek();\n this.showing = true;\n this.play();\n }\n }\n ]);\n return Danmaku;\n}();\nmodule.exports = Danmaku;\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// 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 = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0078637809dc45b79d16","'use strict';\nvar svgSource = {\n 'play': [\n '0 0 16 32',\n '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 ],\n 'pause': [\n '0 0 17 32',\n '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 ],\n 'volume-up': [\n '0 0 21 32',\n '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 ],\n 'volume-down': [\n '0 0 21 32',\n '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 ],\n 'volume-off': [\n '0 0 21 32',\n '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 ],\n 'loop': [\n '0 0 32 32',\n '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 ],\n 'full': [\n '0 0 32 33',\n '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 ],\n 'full-in': [\n '0 0 32 33',\n '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 ],\n 'setting': [\n '0 0 32 28',\n '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 ],\n 'right': [\n '0 0 32 32',\n '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 ],\n 'comment': [\n '0 0 32 32',\n '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 ],\n 'comment-off': [\n '0 0 32 32',\n '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 ],\n 'send': [\n '0 0 32 32',\n '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 ],\n 'menu': [\n '0 0 22 32',\n '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 ],\n 'camera': [\n '0 0 32 32',\n '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// WEBPACK FOOTER\n// ./src/svg.js\n// module id = 0\n// module chunks = 0","'use strict';\nconsole.log('\\n' + ' %c DPlayer ' + DPLAYER_VERSION + ' %c http://dplayer.js.org ' + '\\n' + '\\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');\nmodule.exports = require('./DPlayer');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/index.js\n// module id = 1\n// module chunks = 0","'use strict';\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor)\n descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps)\n defineProperties(Constructor.prototype, protoProps);\n if (staticProps)\n defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\nrequire('./DPlayer.scss');\nvar _utils = require('./utils');\nvar _utils2 = _interopRequireDefault(_utils);\nvar _svg = require('./svg');\nvar _svg2 = _interopRequireDefault(_svg);\nvar _option = require('./option');\nvar _option2 = _interopRequireDefault(_option);\nvar _i18n = require('./i18n');\nvar _i18n2 = _interopRequireDefault(_i18n);\nvar _html = require('./html');\nvar _html2 = _interopRequireDefault(_html);\nvar _danmaku = require('./danmaku');\nvar _danmaku2 = _interopRequireDefault(_danmaku);\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n}\nvar index = 0;\nvar DPlayer = function () {\n function DPlayer(option) {\n var _this = this;\n _classCallCheck(this, DPlayer);\n this.option = (0, _option2.default)(option);\n this.option.element.classList.add('dplayer');\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 this.tran = new _i18n2.default(this.option.lang).tran;\n var eventTypes = [\n 'play',\n 'pause',\n 'canplay',\n 'playing',\n 'ended',\n 'error'\n ];\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 this.element = this.option.element;\n if (!this.option.danmaku) {\n this.element.classList.add('dplayer-no-danmaku');\n }\n if (_utils.isMobile) {\n this.element.classList.add('dplayer-mobile');\n }\n this.element.innerHTML = _html2.default.main(option, index, this.tran);\n var bar = {};\n bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\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 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 document.addEventListener('click', function () {\n _this.focus = false;\n }, true);\n this.element.addEventListener('click', function () {\n _this.focus = true;\n }, true);\n if (this.option.danmaku) {\n this.danmaku = new _danmaku2.default({\n container: this.element.getElementsByClassName('dplayer-danmaku')[0],\n opacity: localStorage.getItem('danmaku-opacity') || 0.7,\n callback: function callback() {\n _this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n if (_this.option.autoplay && !_utils.isMobile) {\n _this.play();\n } else if (_utils.isMobile) {\n _this.pause();\n }\n },\n error: function error(msg) {\n _this.notice(msg);\n },\n apiBackend: this.option.apiBackend,\n borderColor: this.option.theme,\n height: this.arrow ? 24 : 30,\n time: function time() {\n return _this.video.currentTime;\n },\n api: {\n id: this.option.danmaku.id,\n address: this.option.danmaku.api,\n token: this.option.danmaku.token,\n maximum: this.option.danmaku.maximum,\n addition: this.option.danmaku.addition,\n user: this.option.danmaku.user\n }\n });\n }\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 this.video = this.element.getElementsByClassName('dplayer-video-current')[0];\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 this.playButton = this.element.getElementsByClassName('dplayer-play-icon')[0];\n this.paused = true;\n this.playButton.addEventListener('click', function () {\n _this.toggle();\n });\n var videoWrap = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n var conMask = this.element.getElementsByClassName('dplayer-controller-mask')[0];\n if (!_utils.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 var lastPlayPos = 0;\n var currentPlayPos = 0;\n var bufferingDetected = false;\n window.requestAnimationFrame = function () {\n return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {\n window.setTimeout(callback, 1000 / 60);\n };\n }();\n var setCheckLoadingTime = function setCheckLoadingTime() {\n _this.checkLoading = setInterval(function () {\n currentPlayPos = _this.video.currentTime;\n if (!bufferingDetected && currentPlayPos < lastPlayPos + 0.01 && !_this.video.paused) {\n _this.element.classList.add('dplayer-loading');\n bufferingDetected = true;\n }\n if (bufferingDetected && currentPlayPos > lastPlayPos + 0.01 && !_this.video.paused) {\n _this.element.classList.remove('dplayer-loading');\n bufferingDetected = false;\n }\n lastPlayPos = currentPlayPos;\n }, 100);\n };\n var clearCheckLoadingTime = function clearCheckLoadingTime() {\n clearInterval(_this.checkLoading);\n };\n this.playedTime = false;\n this.animationFrame = function () {\n if (_this.playedTime) {\n _this.updateBar('played', _this.video.currentTime / _this.video.duration, 'width');\n _this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = _utils2.default.secondToTime(_this.video.currentTime);\n _this.trigger('playing');\n }\n window.requestAnimationFrame(_this.animationFrame);\n };\n window.requestAnimationFrame(this.animationFrame);\n this.setTime = function (type) {\n if (!type) {\n _this.playedTime = true;\n setCheckLoadingTime();\n } else {\n _this[type + 'Time'] = true;\n if (type === 'played') {\n setCheckLoadingTime();\n }\n }\n };\n this.clearTime = function (type) {\n if (!type) {\n _this.playedTime = false;\n clearCheckLoadingTime();\n } else {\n _this[type + 'Time'] = false;\n if (type === 'played') {\n clearCheckLoadingTime();\n }\n }\n };\n pbar.addEventListener('click', function (event) {\n var e = event || window.event;\n barWidth = pbar.clientWidth;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('played', percentage, 'width');\n _this.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n });\n this.initVideoPreview();\n this.isPreViewShow = false;\n this.isTimeTipsShow = true;\n this.isMouseHoverPbar = false;\n this.mouseHandler = this.mouseHandler(pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.mouseHandler);\n pbar.addEventListener('mouseover', this.mouseHandler);\n pbar.addEventListener('mouseenter', this.mouseHandler);\n pbar.addEventListener('mouseout', this.mouseHandler);\n pbar.addEventListener('mouseleave', this.mouseHandler);\n var thumbMove = function thumbMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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 = _utils2.default.secondToTime(percentage * _this.video.duration);\n };\n var thumbUp = function thumbUp() {\n document.removeEventListener('mouseup', thumbUp);\n document.removeEventListener('mousemove', thumbMove);\n _this.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n _this.setTime();\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 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 this.switchVolumeIcon = function () {\n var volumeicon = _this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (_this.volume() >= 0.95) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-up');\n } else if (_this.volume() > 0) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-down');\n } else {\n volumeicon.innerHTML = (0, _svg2.default)('volume-off');\n }\n };\n var volumeMove = function volumeMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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 volumeBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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.muted) {\n _this.video.muted = false;\n _this.switchVolumeIcon();\n _this.updateBar('volume', _this.volume(), 'width');\n } else {\n _this.video.muted = true;\n volumeicon.innerHTML = (0, _svg2.default)('volume-off');\n _this.updateBar('volume', 0, 'width');\n }\n });\n this.hideTime = 0;\n var hideController = function hideController() {\n _this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(_this.hideTime);\n _this.hideTime = setTimeout(function () {\n if (_this.video.played.length) {\n _this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n if (!_utils.isMobile) {\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n var settingHTML = _html2.default.setting(this.tran);\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 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 mask.addEventListener('click', function () {\n closeSetting();\n });\n settingIcon.addEventListener('click', function () {\n openSetting();\n });\n this.loop = this.option.loop;\n var showdan = true;\n var settingEvent = function settingEvent() {\n var loopEle = _this.element.getElementsByClassName('dplayer-setting-loop')[0];\n var loopToggle = loopEle.getElementsByClassName('dplayer-toggle-setting-input')[0];\n loopToggle.checked = _this.loop;\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 var showDanEle = _this.element.getElementsByClassName('dplayer-setting-showdan')[0];\n var showDanToggle = showDanEle.getElementsByClassName('dplayer-showdan-setting-input')[0];\n showDanToggle.checked = showdan;\n showDanEle.addEventListener('click', function () {\n showDanToggle.checked = !showDanToggle.checked;\n if (showDanToggle.checked) {\n showdan = true;\n if (!_this.paused) {\n _this.danmaku.show();\n }\n } else {\n showdan = false;\n _this.danmaku.hide();\n }\n closeSetting();\n });\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 var speedItem = settingBox.getElementsByClassName('dplayer-setting-speed-item');\n var _loop = function _loop(_i2) {\n speedItem[_i2].addEventListener('click', function () {\n _this.video.playbackRate = speedItem[_i2].dataset.speed;\n closeSetting();\n });\n };\n for (var _i2 = 0; _i2 < speedItem.length; _i2++) {\n _loop(_i2);\n }\n });\n if (_this.danmaku) {\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.danmaku.opacity(), 'width');\n var danmakuMove = function danmakuMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n _this.danmaku.opacity(percentage);\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 danmakuBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n _this.danmaku.opacity(percentage);\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 if (this.video.duration !== 1) {\n this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = this.video.duration ? _utils2.default.secondToTime(this.video.duration) : '00:00';\n }\n if (!this.danmaku) {\n if (this.option.autoplay && !_utils.isMobile) {\n this.play();\n } else if (_utils.isMobile) {\n this.pause();\n }\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 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 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 commentBox.classList.remove('dplayer-comment-box-open');\n mask.classList.remove('dplayer-mask-show');\n _this.element.classList.remove('dplayer-show-controller');\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 commentBox.classList.add('dplayer-comment-box-open');\n mask.classList.add('dplayer-mask-show');\n _this.element.classList.add('dplayer-show-controller');\n disableHide = setInterval(function () {\n clearTimeout(_this.hideTime);\n }, 1000);\n commentFocusTimeout = setTimeout(function () {\n commentInput.focus();\n }, 300);\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 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 var sendComment = function sendComment() {\n commentInput.blur();\n if (!commentInput.value.replace(/^\\s+|\\s+$/g, '')) {\n _this.notice(_this.tran('Please input danmaku content!'));\n return;\n }\n _this.danmaku.send({\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 }, function () {\n commentInput.value = '';\n closeComment();\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 commentSendIcon.addEventListener('click', sendComment);\n this.element.addEventListener('fullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\n this.element.addEventListener('mozfullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\n this.element.addEventListener('webkitfullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\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.webkitEnterFullscreen) {\n _this.video.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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n }\n });\n var handleKeyDown = function handleKeyDown(e) {\n if (_this.focus) {\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.seek(_this.video.currentTime - 5);\n hideController();\n break;\n case 39:\n event.preventDefault();\n _this.seek(_this.video.currentTime + 5);\n hideController();\n break;\n case 38:\n event.preventDefault();\n percentage = _this.volume() + 0.1;\n _this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = _this.volume() - 0.1;\n _this.volume(percentage);\n break;\n }\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', function (e) {\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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n }\n break;\n }\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 menu.classList.add('dplayer-menu-show');\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 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 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 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.videoWidth;\n canvas.height = _this.video.videoHeight;\n canvas.getContext('2d').drawImage(_this.video, 0, 0, canvas.width, canvas.height);\n camareIcon.href = canvas.toDataURL();\n camareIcon.download = 'DPlayer.png';\n });\n }\n this.initVideo();\n index++;\n }\n _createClass(DPlayer, [\n {\n key: 'seek',\n value: function seek(time) {\n time = Math.max(time, 0);\n if (this.video.duration) {\n time = Math.min(time, this.video.duration);\n }\n if (this.video.currentTime < time) {\n this.notice(this.tran('FF to') + ' ' + _utils2.default.secondToTime(time));\n } else if (this.video.currentTime > time) {\n this.notice(this.tran('REW to') + ' ' + _utils2.default.secondToTime(time));\n }\n this.video.currentTime = time;\n if (this.danmaku) {\n this.danmaku.seek();\n }\n this.updateBar('played', time / this.video.duration, 'width');\n }\n },\n {\n key: 'play',\n value: function play() {\n this.paused = false;\n if (this.video.paused) {\n this.bezel.innerHTML = (0, _svg2.default)('play');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n this.playButton.innerHTML = (0, _svg2.default)('pause');\n this.video.play();\n this.setTime();\n this.element.classList.add('dplayer-playing');\n if (this.danmaku) {\n this.danmaku.play();\n }\n this.trigger('play');\n }\n },\n {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n this.element.classList.remove('dplayer-loading');\n if (!this.video.paused) {\n this.bezel.innerHTML = (0, _svg2.default)('pause');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n this.ended = false;\n this.playButton.innerHTML = (0, _svg2.default)('play');\n this.video.pause();\n this.clearTime();\n this.element.classList.remove('dplayer-playing');\n if (this.danmaku) {\n this.danmaku.pause();\n }\n this.trigger('pause');\n }\n },\n {\n key: 'volume',\n value: function volume(percentage, nonotice, nostorage) {\n percentage = parseFloat(percentage);\n if (!isNaN(percentage)) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n if (!nostorage) {\n localStorage.setItem('dplayer-volume', percentage);\n }\n if (!nonotice) {\n this.notice(this.tran('Volume') + ' ' + (percentage * 100).toFixed(0) + '%');\n }\n this.video.volume = percentage;\n if (this.video.muted) {\n this.video.muted = false;\n }\n this.switchVolumeIcon();\n }\n return this.video.volume;\n }\n },\n {\n key: 'toggle',\n value: function toggle() {\n if (this.video.paused) {\n this.play();\n } else {\n this.pause();\n }\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 key: 'switchVideo',\n value: function switchVideo(video, danmakuAPI) {\n this.video.poster = video.pic ? video.pic : '';\n this.video.src = video.url;\n this.pause();\n if (danmakuAPI) {\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 if (this.danmaku) {\n this.danmaku.reload({\n id: danmakuAPI.id,\n address: danmakuAPI.api,\n token: danmakuAPI.token,\n maximum: danmakuAPI.maximum,\n addition: danmakuAPI.addition,\n user: danmakuAPI.user\n });\n }\n }\n }\n },\n {\n key: 'initVideo',\n value: function initVideo() {\n var _this2 = this;\n var enablehls = void 0;\n if (this.option.video.type === 'auto') {\n enablehls = /m3u8(#|\\?|$)/i.exec(this.video.src);\n } else if (this.option.video.type === 'hls') {\n enablehls = true;\n } else {\n enablehls = false;\n }\n if (enablehls && Hls.isSupported()) {\n var hls = new Hls();\n hls.loadSource(this.video.src);\n hls.attachMedia(this.video);\n }\n var enableflv = void 0;\n if (this.option.video.type === 'auto') {\n enableflv = /.flv(#|\\?|$)/i.exec(this.video.src);\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);\n flvPlayer.load();\n }\n this.video.addEventListener('durationchange', function () {\n if (_this2.video.duration !== 1) {\n _this2.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = _utils2.default.secondToTime(_this2.video.duration);\n }\n });\n this.video.addEventListener('progress', function () {\n var percentage = _this2.video.buffered.length ? _this2.video.buffered.end(_this2.video.buffered.length - 1) / _this2.video.duration : 0;\n _this2.updateBar('loaded', percentage, 'width');\n });\n this.video.addEventListener('error', function () {\n _this2.tran && _this2.notice && _this2.notice(_this2.tran('This video fails to load'), -1);\n _this2.trigger && _this2.trigger('pause');\n });\n this.video.addEventListener('canplay', function () {\n _this2.trigger('canplay');\n });\n this.ended = false;\n this.video.addEventListener('ended', function () {\n _this2.updateBar('played', 1, 'width');\n if (!_this2.loop) {\n _this2.ended = true;\n _this2.pause();\n _this2.trigger('ended');\n } else {\n _this2.seek(0);\n _this2.video.play();\n }\n if (_this2.danmaku) {\n _this2.danmaku.danIndex = 0;\n }\n });\n this.video.addEventListener('play', function () {\n if (_this2.paused) {\n _this2.play();\n }\n });\n this.video.addEventListener('pause', function () {\n if (!_this2.paused) {\n _this2.pause();\n }\n });\n this.volume(localStorage.getItem('dplayer-volume') || this.option.volume, true, true);\n }\n },\n {\n key: 'switchQuality',\n value: function switchQuality(index) {\n var _this3 = this;\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 var paused = this.video.paused;\n this.video.pause();\n var videoHTML = _html2.default.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.insertBefore(videoEle, parent.getElementsByTagName('div')[0]);\n this.prevVideo = this.video;\n this.video = videoEle;\n this.initVideo();\n this.seek(this.prevVideo.currentTime);\n this.notice(this.tran('Switching to') + ' ' + this.quality.name + ' ' + this.tran('quality'), -1);\n this.video.addEventListener('canplay', function () {\n if (_this3.prevVideo) {\n if (_this3.video.currentTime !== _this3.prevVideo.currentTime) {\n _this3.seek(_this3.prevVideo.currentTime);\n return;\n }\n parent.removeChild(_this3.prevVideo);\n _this3.video.classList.add('dplayer-video-current');\n if (!paused) {\n _this3.video.play();\n }\n _this3.prevVideo = null;\n _this3.notice(_this3.tran('Switched to') + ' ' + _this3.quality.name + ' ' + _this3.tran('quality'));\n _this3.switchingQuality = false;\n }\n });\n }\n },\n {\n key: 'mouseHandler',\n value: function mouseHandler(pbar, timeTips) {\n var _this4 = this;\n var cumulativeOffset = function cumulativeOffset(element) {\n var top = 0, left = 0;\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n return {\n top: top,\n left: left\n };\n };\n return function (e) {\n if (!_this4.video.duration) {\n return;\n }\n var clientX = e.clientX;\n var px = cumulativeOffset(pbar).left;\n var tx = clientX - px;\n var time = _this4.video.duration * (tx / pbar.offsetWidth);\n timeTips.innerText = _utils2.default.secondToTime(time);\n timeTips.style.left = tx - 20 + 'px';\n _this4.previewWrapper.style.left = tx - _this4.previewWrapper.offsetWidth / 2 + 'px';\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n _this4.isMouseHoverPbar = true;\n _this4.setPreviewSourceAndFrame({\n url: _this4.video.src,\n time: time\n });\n _this4.timeTipsDisplay(true, timeTips);\n break;\n case 'mouseleave':\n case 'mouseout':\n _this4.isMouseHoverPbar = false;\n _this4.previewDispaly(false);\n _this4.timeTipsDisplay(false, timeTips);\n break;\n }\n };\n }\n },\n {\n key: 'timeTipsDisplay',\n value: function timeTipsDisplay(show, timeTips) {\n if (show) {\n if (this.isTimeTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n this.isTimeTipsShow = true;\n } else {\n if (!this.isTimeTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n this.isTimeTipsShow = false;\n }\n }\n },\n {\n key: 'initVideoPreview',\n value: function initVideoPreview() {\n var _this5 = this;\n this.previewVideo = document.createElement('video');\n this.previewWrapper = this.element.getElementsByClassName('dplayer-bar-preview')[0];\n this.previewCanvas = this.element.getElementsByClassName('dplayer-bar-preview-canvas')[0];\n this.previewVideo.preload = 'auto';\n var resize = function resize() {\n var w = _this5.element.offsetWidth / 4;\n var h = _this5.element.offsetHeight / 4;\n _this5.previewWrapper.style.width = w + 'px';\n _this5.previewWrapper.style.height = h + 'px';\n _this5.previewWrapper.style.top = -h + 2 + 'px';\n _this5.previewCanvas.width = w;\n _this5.previewCanvas.height = h;\n };\n resize();\n this.video.addEventListener('loadedmetadata', function () {\n resize();\n });\n this.setPreviewSourceAndFrame({\n url: this.video.src,\n time: 0\n });\n this.bindPreviewEvent();\n }\n },\n {\n key: 'setPreviewSourceAndFrame',\n value: function setPreviewSourceAndFrame(_ref) {\n var url = _ref.url, time = _ref.time;\n if (url) {\n this.previewVideo.src = url;\n }\n if (time) {\n this.previewVideo.currentTime = time;\n }\n }\n },\n {\n key: 'bindPreviewEvent',\n value: function bindPreviewEvent() {\n var _this6 = this;\n this.previewNumber = 0;\n this.previewVideo.addEventListener('seeked', function () {\n _this6.previewNumber += 1;\n _this6.generPreviewImage(_this6.previewNumber);\n });\n }\n },\n {\n key: 'generPreviewImage',\n value: function generPreviewImage(number) {\n if (number !== this.previewNumber) {\n return;\n }\n if (!this.isMouseHoverPbar) {\n return;\n }\n this.previewDispaly(true);\n if (!this.isPreViewShow) {\n return;\n }\n var ctx = this.previewCanvas.getContext('2d');\n ctx.drawImage(this.previewVideo, 0, 0, this.previewWrapper.offsetWidth, this.previewWrapper.offsetHeight);\n }\n },\n {\n key: 'previewDispaly',\n value: function previewDispaly(show) {\n if (show) {\n if (this.isPreViewShow) {\n return;\n }\n if (!this.isMouseHoverPbar) {\n return;\n }\n this.previewWrapper.classList.remove('hidden');\n this.isPreViewShow = true;\n } else {\n if (!this.isPreViewShow) {\n return;\n }\n this.previewWrapper.classList.add('hidden');\n this.isPreViewShow = false;\n }\n }\n },\n {\n key: 'notice',\n value: function notice(text) {\n var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.8;\n var noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = opacity;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n this.noticeTime = setTimeout(function () {\n noticeEle.style.opacity = 0;\n }, time);\n }\n },\n {\n key: 'destroy',\n value: function destroy() {\n this.pause();\n clearTimeout(this.hideTime);\n this.video.src = '';\n this.element.innerHTML = '';\n for (var key in this) {\n if (this.hasOwnProperty(key) && key !== 'paused') {\n delete this[key];\n }\n }\n }\n }\n ]);\n return DPlayer;\n}();\nmodule.exports = DPlayer;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/DPlayer.js\n// module id = 2\n// module chunks = 0","'use strict';\nmodule.exports = {\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 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 !== element) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n }\n return actualLeft - elementScrollLeft;\n },\n isMobile: /mobile/i.test(window.navigator.userAgent)\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/utils.js\n// module id = 4\n// module chunks = 0","'use strict';\nvar defaultApiBackend = require('./api.js');\nmodule.exports = function (option) {\n var isMobile = /mobile/i.test(window.navigator.userAgent);\n if (isMobile) {\n option.autoplay = false;\n }\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 volume: '0.7',\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 (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 if (option.video.quality) {\n option.video.url = [option.video.quality[option.video.defaultQuality].url];\n }\n return option;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/option.js\n// module id = 5\n// module chunks = 0","'use strict';\nvar SendXMLHttpRequest = function SendXMLHttpRequest(url, data, success, error, fail) {\n var xhr = new XMLHttpRequest();\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 if (response.code !== 1) {\n return error(xhr, response);\n }\n return success(xhr, response);\n }\n fail(xhr);\n }\n };\n xhr.open(data !== null ? 'POST' : 'GET', url, true);\n xhr.send(data !== null ? JSON.stringify(data) : null);\n};\nmodule.exports = {\n send: function send(endpoint, danmakuData, callback) {\n SendXMLHttpRequest(endpoint, danmakuData, function (xhr, response) {\n console.log('Post danmaku: ', response);\n if (callback) {\n callback();\n }\n }, function (xhr, response) {\n alert(response.msg);\n }, function (xhr) {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n read: function read(endpoint, callback) {\n SendXMLHttpRequest(endpoint, null, function (xhr, response) {\n callback(null, response.danmaku);\n }, function (xhr, response) {\n callback({\n status: xhr.status,\n response: response\n });\n }, function (xhr) {\n callback({\n status: xhr.status,\n response: null\n });\n });\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/api.js\n// module id = 6\n// module chunks = 0","'use strict';\nvar tranZH = {\n 'Danmaku is loading': '弹幕加载中',\n 'Top': '顶部',\n 'Bottom': '底部',\n 'Rolling': '滚动',\n 'Input danmaku, hit Enter': '输入弹幕\\uFF0C回车发送',\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!': '要输入弹幕内容啊喂\\uFF01',\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 'FF to': '快进至',\n 'REW to': '快退至',\n 'Volume': '音量'\n};\nmodule.exports = function (lang) {\n var _this = this;\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//////////////////\n// WEBPACK FOOTER\n// ./src/i18n.js\n// module id = 7\n// module chunks = 0","'use strict';\nvar svg = require('./svg.js');\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 '
' + videos + '' + (option.logo ? '
' : '') + '
' + (option.danmaku ? '' + tran('Danmaku is loading') + '' : '') + '
0:00 / 0:00
' + (option.video.quality ? '
' + html.qualityList(option.video.quality) + '
' : '') + '' + (option.screenshot ? '' + svg('camera') + '' : '') + '
' + tran('Set danmaku color') + '
' + tran('Set danmaku type') + '
00:00
' + html.contextmenuList(option.contextmenu) + '
';\n },\n contextmenuList: function contextmenuList(contextmenu) {\n var result = '
';\n for (var i = 0; i < contextmenu.length; i++) {\n result += '';\n }\n result += '
';\n return result;\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 return result;\n },\n video: function video(current, pic, screenshot, preload, url) {\n return '';\n },\n setting: function setting(tran) {\n return {\n 'original': '
' + tran('Speed') + '
' + svg('right') + '
' + tran('Loop') + '
' + tran('Danmaku') + '
' + tran('Opacity for danmaku') + '
',\n 'speed': '
0.5
0.75
' + tran('Normal') + '
1.25
1.5
2
'\n };\n }\n};\nmodule.exports = html;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/html.js\n// module id = 8\n// module chunks = 0","'use strict';\nvar _typeof = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;\n};\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor)\n descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps)\n defineProperties(Constructor.prototype, protoProps);\n if (staticProps)\n defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n}\nvar Danmaku = function () {\n function Danmaku(options) {\n _classCallCheck(this, Danmaku);\n this.options = options;\n this.container = this.options.container;\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.danIndex = 0;\n this.dan = [];\n this.showing = true;\n this._opacity = this.options.opacity;\n this.load();\n }\n _createClass(Danmaku, [\n {\n key: 'load',\n value: function load() {\n var _this = this;\n var apiurl = void 0;\n if (this.options.api.maximum) {\n apiurl = this.options.api.address + '?id=' + this.options.api.id + '&max=' + this.options.api.maximum;\n } else {\n apiurl = this.options.api.address + '?id=' + this.options.api.id;\n }\n var endpoints = (this.options.api.addition || []).slice(0);\n endpoints.push(apiurl);\n this._readAllEndpoints(endpoints, function (results) {\n _this.dan = [].concat.apply([], results).sort(function (a, b) {\n return a.time - b.time;\n });\n window.requestAnimationFrame(function () {\n _this.frame();\n });\n _this.options.callback();\n });\n }\n },\n {\n key: 'reload',\n value: function reload(newAPI) {\n this.options.api = newAPI;\n this.dan = [];\n this.clear();\n this.load();\n }\n },\n {\n key: '_readAllEndpoints',\n value: function _readAllEndpoints(endpoints, callback) {\n var _this2 = this;\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.options.error(err.response.msg);\n } else {\n _this2.options.error('Request was unsuccessful: ' + err.status);\n }\n results[i] = [];\n } else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return callback(results);\n }\n };\n };\n for (var i = 0; i < endpoints.length; ++i) {\n this.options.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n },\n {\n key: 'send',\n value: function send(dan, callback) {\n var danmakuData = {\n token: this.options.api.token,\n player: this.options.api.id,\n author: this.options.api.user,\n time: this.options.time(),\n text: dan.text,\n color: dan.color,\n type: dan.type\n };\n this.options.apiBackend.send(this.options.api.address, danmakuData, callback);\n this.dan.splice(this.danIndex, 0, danmakuData);\n this.danIndex++;\n var danmaku = {\n text: this.htmlEncode(danmakuData.text),\n color: danmakuData.color,\n type: danmakuData.type,\n border: '2px solid ' + this.options.borderColor\n };\n this.draw(danmaku);\n }\n },\n {\n key: 'frame',\n value: function frame() {\n var _this3 = this;\n if (this.dan.length && !this.paused && this.showing) {\n var item = this.dan[this.danIndex];\n var dan = [];\n while (item && this.options.time() > parseFloat(item.time)) {\n dan.push(item);\n item = this.dan[++this.danIndex];\n }\n this.draw(dan);\n }\n window.requestAnimationFrame(function () {\n _this3.frame();\n });\n }\n },\n {\n key: 'opacity',\n value: function opacity(percentage) {\n if (percentage !== undefined) {\n var items = this.container.getElementsByClassName('dplayer-danmaku-item');\n for (var i = 0; i < items.length; i++) {\n items[i].style.opacity = percentage;\n }\n this._opacity = percentage;\n localStorage.setItem('danmaku-opacity', this._opacity);\n }\n return this._opacity;\n }\n },\n {\n key: 'draw',\n value: function draw(dan) {\n var _this4 = this;\n var itemHeight = this.options.height;\n var danWidth = this.container.offsetWidth;\n var danHeight = this.container.offsetHeight;\n var itemY = parseInt(danHeight / itemHeight);\n var danItemRight = function danItemRight(ele) {\n var eleWidth = ele.offsetWidth || parseInt(ele.style.width);\n var eleRight = ele.getBoundingClientRect().right || _this4.container.getBoundingClientRect().right + eleWidth;\n return _this4.container.getBoundingClientRect().right - eleRight;\n };\n var danSpeed = function danSpeed(width) {\n return (danWidth + width) / 5;\n };\n var getTunnel = function getTunnel(ele, type, width) {\n var tmp = danWidth / danSpeed(width);\n var _loop = function _loop(i) {\n var item = _this4.danTunnel[type][i + ''];\n if (item && item.length) {\n if (type !== 'right') {\n return 'continue';\n }\n for (var j = 0; j < item.length; j++) {\n var danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(parseInt(item[j].style.width)) || 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 { v: i % itemY };\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 { v: i % itemY };\n }\n };\n for (var i = 0;; i++) {\n var _ret = _loop(i);\n switch (_ret) {\n case 'continue':\n continue;\n default:\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === 'object')\n return _ret.v;\n }\n }\n };\n if (Object.prototype.toString.call(dan) !== '[object Array]') {\n dan = [dan];\n }\n var docFragment = document.createDocumentFragment();\n var _loop2 = function _loop2(i) {\n if (!dan[i].type) {\n dan[i].type = 'right';\n }\n if (!dan[i].color) {\n dan[i].color = '#fff';\n }\n var item = document.createElement('div');\n item.classList.add('dplayer-danmaku-item');\n item.classList.add('dplayer-danmaku-' + dan[i].type);\n if (dan[i].border) {\n item.innerHTML = '' + dan[i].text + '';\n } else {\n item.innerHTML = dan[i].text;\n }\n item.style.opacity = _this4._opacity;\n item.style.color = dan[i].color;\n item.addEventListener('animationend', function () {\n _this4.container.removeChild(item);\n });\n var itemWidth = _this4._measure(dan[i].text);\n switch (dan[i].type) {\n case 'right':\n item.style.width = itemWidth + 1 + 'px';\n item.style.top = itemHeight * getTunnel(item, dan[i].type, itemWidth) + 'px';\n item.style.transform = 'translateX(-' + danWidth + 'px)';\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, dan[i].type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, dan[i].type) + 'px';\n break;\n default:\n console.error('Can\\'t handled danmaku type: ' + dan[i].type);\n }\n item.classList.add('dplayer-danmaku-move');\n docFragment.appendChild(item);\n };\n for (var i = 0; i < dan.length; i++) {\n _loop2(i);\n }\n this.container.appendChild(docFragment);\n return docFragment;\n }\n },\n {\n key: 'play',\n value: function play() {\n this.paused = false;\n }\n },\n {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n }\n },\n {\n key: '_measure',\n value: function _measure(text) {\n if (!this.context) {\n var measureStyle = getComputedStyle(this.container.getElementsByClassName('dplayer-danmaku-item')[0], null);\n this.context = document.createElement('canvas').getContext('2d');\n this.context.font = measureStyle.getPropertyValue('font');\n }\n return this.context.measureText(text).width;\n }\n },\n {\n key: 'seek',\n value: function seek() {\n for (var i = 0; i < this.dan.length; i++) {\n if (this.dan[i].time >= this.options.time()) {\n this.danIndex = i;\n break;\n }\n this.danIndex = this.dan.length;\n }\n }\n },\n {\n key: 'clear',\n value: function clear() {\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.danIndex = 0;\n this.options.container.innerHTML = '';\n }\n },\n {\n key: 'htmlEncode',\n value: function htmlEncode(str) {\n return str.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/'/g, ''').replace(/\\//g, '/');\n }\n },\n {\n key: 'resize',\n value: function resize() {\n var danWidth = this.container.offsetWidth;\n var items = this.container.getElementsByClassName('dplayer-danmaku-item');\n for (var i = 0; i < items.length; i++) {\n items[i].style.transform = 'translateX(-' + danWidth + 'px)';\n }\n }\n },\n {\n key: 'hide',\n value: function hide() {\n this.showing = false;\n this.pause();\n this.clear();\n }\n },\n {\n key: 'show',\n value: function show() {\n this.seek();\n this.showing = true;\n this.play();\n }\n }\n ]);\n return Danmaku;\n}();\nmodule.exports = Danmaku;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/danmaku.js\n// module id = 9\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///DPlayer.min.js","webpack:///webpack/bootstrap 818e5f31434b4a419028","webpack:///./src/svg.js","webpack:///./src/index.js","webpack:///./src/DPlayer.js","webpack:///./src/utils.js","webpack:///./src/option.js","webpack:///./src/api.js","webpack:///./src/i18n.js","webpack:///./src/html.js","webpack:///./src/danmaku.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","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","console","log","_interopRequireDefault","obj","default","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","props","length","descriptor","writable","key","protoProps","staticProps","_utils","_utils2","_svg","_svg2","_option","_option2","_i18n","_i18n2","_html","_html2","_danmaku","_danmaku2","index","DPlayer","option","_this","element","classList","add","video","quality","qualityIndex","defaultQuality","tran","lang","eventTypes","event","trigger","_i","danmaku","isMobile","innerHTML","main","bar","volumeBar","getElementsByClassName","playedBar","loadedBar","pbar","pbarTimeTips","barWidth","updateBar","percentage","direction","style","document","addEventListener","focus","container","opacity","localStorage","getItem","callback","display","autoplay","error","msg","notice","apiBackend","borderColor","theme","height","arrow","time","currentTime","api","id","address","token","maximum","addition","user","offsetWidth","arrowStyle","createElement","head","appendChild","bezel","remove","playButton","paused","toggle","videoWrap","conMask","toggleController","contains","lastPlayPos","currentPlayPos","bufferingDetected","window","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","setTimeout","setCheckLoadingTime","checkLoading","setInterval","clearCheckLoadingTime","clearInterval","playedTime","animationFrame","duration","secondToTime","setTime","clearTime","e","clientWidth","clientX","getElementViewLeft","seek","parseFloat","width","initVideoPreview","isPreViewShow","isTimeTipsShow","isMouseHoverPbar","mouseHandler","bind","thumbMove","thumbUp","removeEventListener","volumeEle","volumeBarWrapWrap","volumeBarWrap","volumeicon","switchVolumeIcon","volume","volumeMove","volumeUp","muted","hideTime","hideController","clearTimeout","played","closeSetting","closeComment","settingHTML","settingIcon","settingBox","mask","original","settingEvent","openSetting","showdan","loopEle","loopToggle","checked","showDanEle","showDanToggle","show","hide","speed","speedItem","_i2","playbackRate","dataset","danmakuBar","danmakuBarWrapWrap","danmakuBarWrap","danmakuSettingBox","danmakuMove","danmakuUp","commentInput","commentIcon","commentBox","commentSettingIcon","commentSettingBox","commentSendIcon","closeCommentSetting","toggleCommentSetting","disableHide","commentFocusTimeout","openComment","querySelector","fill","value","sendComment","blur","replace","text","color","keyCode","resize","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen","requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","webkitEnterFullscreen","handleKeyDown","tag","activeElement","tagName","toUpperCase","editable","getAttribute","preventDefault","hotkey","clientRect","getBoundingClientRect","menuLeft","left","menuTop","clientY","top","offsetHeight","bottom","switchQuality","screenshot","camareIcon","canvas","videoWidth","videoHeight","getContext","drawImage","href","toDataURL","download","initVideo","Math","max","min","ended","nonotice","nostorage","isNaN","setItem","toFixed","push","danmakuAPI","poster","pic","src","url","reload","_this2","exec","Hls","isSupported","hls","loadSource","attachMedia","flvjs","flvPlayer","createPlayer","attachMediaElement","load","buffered","end","danIndex","_this3","switchingQuality","videoHTML","videoEle","DOMParser","parseFromString","body","firstChild","parent","insertBefore","getElementsByTagName","prevVideo","removeChild","timeTips","_this4","cumulativeOffset","offsetTop","offsetLeft","offsetParent","px","tx","previewWrapper","previewTime","parseInt","innerText","setPreview","setPreviewSourceAndFrame","timeTipsDisplay","previewDispaly","_this5","previewVideo","previewCanvas","preload","w","h","bindPreviewEvent","_ref","_this6","previewNumber","generPreviewImage","number","arguments","undefined","noticeEle","noticeTime","second","add0","num","sec","actualLeft","current","elementScrollLeft","scrollLeft","documentElement","test","navigator","userAgent","defaultApiBackend","defaultOption","language","indexOf","contextmenu","link","defaultKey","toString","SendXMLHttpRequest","data","success","fail","xhr","XMLHttpRequest","onreadystatechange","readyState","status","response","JSON","parse","responseText","code","open","stringify","endpoint","danmakuData","alert","read","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","FF to","REW to","Volume","svg","html","videos","logo","qualityList","contextmenuList","result","_typeof","Symbol","iterator","constructor","options","danTunnel","dan","showing","_opacity","apiurl","endpoints","slice","_readAllEndpoints","results","concat","apply","sort","a","b","frame","newAPI","clear","readCount","err","player","author","splice","htmlEncode","border","draw","item","items","itemHeight","danWidth","danHeight","itemY","danItemRight","ele","eleWidth","eleRight","danSpeed","getTunnel","tmp","_ret","v","j","danRight","docFragment","createDocumentFragment","itemWidth","_measure","transform","context","measureStyle","getComputedStyle","font","getPropertyValue","measureText","str"],"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,KACCK,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,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAtB,GACA,GAAAe,GAAAf,KAAAuB,WACA,WAA2B,MAAAvB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAK,GAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDpB,EAAAuB,EAAA,IAGAvB,IAAAwB,EAAA,KDgBM,SAAU7B,EAAQD,EAASM,GAEjC,YE9EA,IAAAyB,IACAC,MACA,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AA5c,GAAAsG,MAAA0X,UAAA,eAAAlB,EAAA,SAKAvZ,IAAA,OACAoL,MAAA,WACAhP,KAAAyb,SAAA,EACAzb,KAAA6B,QACA7B,KAAAuc,WAIA3Y,IAAA,OACAoL,MAAA,WACAhP,KAAA8K,OACA9K,KAAAyb,SAAA,EACAzb,KAAA4B,WAIAwY,IAEAva,GAAAD,QAAAwa","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// 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 = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar svgSource = {\n 'play': [\n '0 0 16 32',\n '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 ],\n 'pause': [\n '0 0 17 32',\n '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 ],\n 'volume-up': [\n '0 0 21 32',\n '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 ],\n 'volume-down': [\n '0 0 21 32',\n '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 ],\n 'volume-off': [\n '0 0 21 32',\n '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 ],\n 'loop': [\n '0 0 32 32',\n '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 ],\n 'full': [\n '0 0 32 33',\n '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 ],\n 'full-in': [\n '0 0 32 33',\n '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 ],\n 'setting': [\n '0 0 32 28',\n '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 ],\n 'right': [\n '0 0 32 32',\n '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 ],\n 'comment': [\n '0 0 32 32',\n '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 ],\n 'comment-off': [\n '0 0 32 32',\n '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 ],\n 'send': [\n '0 0 32 32',\n '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 ],\n 'menu': [\n '0 0 22 32',\n '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 ],\n 'camera': [\n '0 0 32 32',\n '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/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nconsole.log('\\n' + ' %c DPlayer ' + \"1.6.1\" + ' %c http://dplayer.js.org ' + '\\n' + '\\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');\nmodule.exports = __webpack_require__(2);\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor)\n descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps)\n defineProperties(Constructor.prototype, protoProps);\n if (staticProps)\n defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n__webpack_require__(3);\nvar _utils = __webpack_require__(4);\nvar _utils2 = _interopRequireDefault(_utils);\nvar _svg = __webpack_require__(0);\nvar _svg2 = _interopRequireDefault(_svg);\nvar _option = __webpack_require__(5);\nvar _option2 = _interopRequireDefault(_option);\nvar _i18n = __webpack_require__(7);\nvar _i18n2 = _interopRequireDefault(_i18n);\nvar _html = __webpack_require__(8);\nvar _html2 = _interopRequireDefault(_html);\nvar _danmaku = __webpack_require__(9);\nvar _danmaku2 = _interopRequireDefault(_danmaku);\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n}\nvar index = 0;\nvar DPlayer = function () {\n function DPlayer(option) {\n var _this = this;\n _classCallCheck(this, DPlayer);\n this.option = (0, _option2.default)(option);\n this.option.element.classList.add('dplayer');\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 this.tran = new _i18n2.default(this.option.lang).tran;\n var eventTypes = [\n 'play',\n 'pause',\n 'canplay',\n 'playing',\n 'ended',\n 'error'\n ];\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 this.element = this.option.element;\n if (!this.option.danmaku) {\n this.element.classList.add('dplayer-no-danmaku');\n }\n if (_utils.isMobile) {\n this.element.classList.add('dplayer-mobile');\n }\n this.element.innerHTML = _html2.default.main(option, index, this.tran);\n var bar = {};\n bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\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 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 document.addEventListener('click', function () {\n _this.focus = false;\n }, true);\n this.element.addEventListener('click', function () {\n _this.focus = true;\n }, true);\n if (this.option.danmaku) {\n this.danmaku = new _danmaku2.default({\n container: this.element.getElementsByClassName('dplayer-danmaku')[0],\n opacity: localStorage.getItem('danmaku-opacity') || 0.7,\n callback: function callback() {\n _this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n if (_this.option.autoplay && !_utils.isMobile) {\n _this.play();\n } else if (_utils.isMobile) {\n _this.pause();\n }\n },\n error: function error(msg) {\n _this.notice(msg);\n },\n apiBackend: this.option.apiBackend,\n borderColor: this.option.theme,\n height: this.arrow ? 24 : 30,\n time: function time() {\n return _this.video.currentTime;\n },\n api: {\n id: this.option.danmaku.id,\n address: this.option.danmaku.api,\n token: this.option.danmaku.token,\n maximum: this.option.danmaku.maximum,\n addition: this.option.danmaku.addition,\n user: this.option.danmaku.user\n }\n });\n }\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 this.video = this.element.getElementsByClassName('dplayer-video-current')[0];\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 this.playButton = this.element.getElementsByClassName('dplayer-play-icon')[0];\n this.paused = true;\n this.playButton.addEventListener('click', function () {\n _this.toggle();\n });\n var videoWrap = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n var conMask = this.element.getElementsByClassName('dplayer-controller-mask')[0];\n if (!_utils.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 var lastPlayPos = 0;\n var currentPlayPos = 0;\n var bufferingDetected = false;\n window.requestAnimationFrame = function () {\n return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {\n window.setTimeout(callback, 1000 / 60);\n };\n }();\n var setCheckLoadingTime = function setCheckLoadingTime() {\n _this.checkLoading = setInterval(function () {\n currentPlayPos = _this.video.currentTime;\n if (!bufferingDetected && currentPlayPos < lastPlayPos + 0.01 && !_this.video.paused) {\n _this.element.classList.add('dplayer-loading');\n bufferingDetected = true;\n }\n if (bufferingDetected && currentPlayPos > lastPlayPos + 0.01 && !_this.video.paused) {\n _this.element.classList.remove('dplayer-loading');\n bufferingDetected = false;\n }\n lastPlayPos = currentPlayPos;\n }, 100);\n };\n var clearCheckLoadingTime = function clearCheckLoadingTime() {\n clearInterval(_this.checkLoading);\n };\n this.playedTime = false;\n this.animationFrame = function () {\n if (_this.playedTime) {\n _this.updateBar('played', _this.video.currentTime / _this.video.duration, 'width');\n _this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = _utils2.default.secondToTime(_this.video.currentTime);\n _this.trigger('playing');\n }\n window.requestAnimationFrame(_this.animationFrame);\n };\n window.requestAnimationFrame(this.animationFrame);\n this.setTime = function (type) {\n if (!type) {\n _this.playedTime = true;\n setCheckLoadingTime();\n } else {\n _this[type + 'Time'] = true;\n if (type === 'played') {\n setCheckLoadingTime();\n }\n }\n };\n this.clearTime = function (type) {\n if (!type) {\n _this.playedTime = false;\n clearCheckLoadingTime();\n } else {\n _this[type + 'Time'] = false;\n if (type === 'played') {\n clearCheckLoadingTime();\n }\n }\n };\n pbar.addEventListener('click', function (event) {\n var e = event || window.event;\n barWidth = pbar.clientWidth;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('played', percentage, 'width');\n _this.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n });\n this.initVideoPreview();\n this.isPreViewShow = false;\n this.isTimeTipsShow = true;\n this.isMouseHoverPbar = false;\n this.mouseHandler = this.mouseHandler(pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.mouseHandler);\n pbar.addEventListener('mouseover', this.mouseHandler);\n pbar.addEventListener('mouseenter', this.mouseHandler);\n pbar.addEventListener('mouseout', this.mouseHandler);\n pbar.addEventListener('mouseleave', this.mouseHandler);\n var thumbMove = function thumbMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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 = _utils2.default.secondToTime(percentage * _this.video.duration);\n };\n var thumbUp = function thumbUp() {\n document.removeEventListener('mouseup', thumbUp);\n document.removeEventListener('mousemove', thumbMove);\n _this.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n _this.setTime();\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 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 this.switchVolumeIcon = function () {\n var volumeicon = _this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (_this.volume() >= 0.95) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-up');\n } else if (_this.volume() > 0) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-down');\n } else {\n volumeicon.innerHTML = (0, _svg2.default)('volume-off');\n }\n };\n var volumeMove = function volumeMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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 volumeBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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.muted) {\n _this.video.muted = false;\n _this.switchVolumeIcon();\n _this.updateBar('volume', _this.volume(), 'width');\n } else {\n _this.video.muted = true;\n volumeicon.innerHTML = (0, _svg2.default)('volume-off');\n _this.updateBar('volume', 0, 'width');\n }\n });\n this.hideTime = 0;\n var hideController = function hideController() {\n _this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(_this.hideTime);\n _this.hideTime = setTimeout(function () {\n if (_this.video.played.length) {\n _this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n if (!_utils.isMobile) {\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n var settingHTML = _html2.default.setting(this.tran);\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 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 mask.addEventListener('click', function () {\n closeSetting();\n });\n settingIcon.addEventListener('click', function () {\n openSetting();\n });\n this.loop = this.option.loop;\n var showdan = true;\n var settingEvent = function settingEvent() {\n var loopEle = _this.element.getElementsByClassName('dplayer-setting-loop')[0];\n var loopToggle = loopEle.getElementsByClassName('dplayer-toggle-setting-input')[0];\n loopToggle.checked = _this.loop;\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 var showDanEle = _this.element.getElementsByClassName('dplayer-setting-showdan')[0];\n var showDanToggle = showDanEle.getElementsByClassName('dplayer-showdan-setting-input')[0];\n showDanToggle.checked = showdan;\n showDanEle.addEventListener('click', function () {\n showDanToggle.checked = !showDanToggle.checked;\n if (showDanToggle.checked) {\n showdan = true;\n if (!_this.paused) {\n _this.danmaku.show();\n }\n } else {\n showdan = false;\n _this.danmaku.hide();\n }\n closeSetting();\n });\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 var speedItem = settingBox.getElementsByClassName('dplayer-setting-speed-item');\n var _loop = function _loop(_i2) {\n speedItem[_i2].addEventListener('click', function () {\n _this.video.playbackRate = speedItem[_i2].dataset.speed;\n closeSetting();\n });\n };\n for (var _i2 = 0; _i2 < speedItem.length; _i2++) {\n _loop(_i2);\n }\n });\n if (_this.danmaku) {\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.danmaku.opacity(), 'width');\n var danmakuMove = function danmakuMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n _this.danmaku.opacity(percentage);\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 danmakuBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n _this.danmaku.opacity(percentage);\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 if (this.video.duration !== 1) {\n this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = this.video.duration ? _utils2.default.secondToTime(this.video.duration) : '00:00';\n }\n if (!this.danmaku) {\n if (this.option.autoplay && !_utils.isMobile) {\n this.play();\n } else if (_utils.isMobile) {\n this.pause();\n }\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 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 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 commentBox.classList.remove('dplayer-comment-box-open');\n mask.classList.remove('dplayer-mask-show');\n _this.element.classList.remove('dplayer-show-controller');\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 commentBox.classList.add('dplayer-comment-box-open');\n mask.classList.add('dplayer-mask-show');\n _this.element.classList.add('dplayer-show-controller');\n disableHide = setInterval(function () {\n clearTimeout(_this.hideTime);\n }, 1000);\n commentFocusTimeout = setTimeout(function () {\n commentInput.focus();\n }, 300);\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 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 var sendComment = function sendComment() {\n commentInput.blur();\n if (!commentInput.value.replace(/^\\s+|\\s+$/g, '')) {\n _this.notice(_this.tran('Please input danmaku content!'));\n return;\n }\n _this.danmaku.send({\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 }, function () {\n commentInput.value = '';\n closeComment();\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 commentSendIcon.addEventListener('click', sendComment);\n this.element.addEventListener('fullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\n this.element.addEventListener('mozfullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\n this.element.addEventListener('webkitfullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\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.webkitEnterFullscreen) {\n _this.video.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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n }\n });\n var handleKeyDown = function handleKeyDown(e) {\n if (_this.focus) {\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.seek(_this.video.currentTime - 5);\n hideController();\n break;\n case 39:\n event.preventDefault();\n _this.seek(_this.video.currentTime + 5);\n hideController();\n break;\n case 38:\n event.preventDefault();\n percentage = _this.volume() + 0.1;\n _this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = _this.volume() - 0.1;\n _this.volume(percentage);\n break;\n }\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', function (e) {\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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n }\n break;\n }\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 menu.classList.add('dplayer-menu-show');\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 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 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 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.videoWidth;\n canvas.height = _this.video.videoHeight;\n canvas.getContext('2d').drawImage(_this.video, 0, 0, canvas.width, canvas.height);\n camareIcon.href = canvas.toDataURL();\n camareIcon.download = 'DPlayer.png';\n });\n }\n this.initVideo();\n index++;\n }\n _createClass(DPlayer, [\n {\n key: 'seek',\n value: function seek(time) {\n time = Math.max(time, 0);\n if (this.video.duration) {\n time = Math.min(time, this.video.duration);\n }\n if (this.video.currentTime < time) {\n this.notice(this.tran('FF to') + ' ' + _utils2.default.secondToTime(time));\n } else if (this.video.currentTime > time) {\n this.notice(this.tran('REW to') + ' ' + _utils2.default.secondToTime(time));\n }\n this.video.currentTime = time;\n if (this.danmaku) {\n this.danmaku.seek();\n }\n this.updateBar('played', time / this.video.duration, 'width');\n }\n },\n {\n key: 'play',\n value: function play() {\n this.paused = false;\n if (this.video.paused) {\n this.bezel.innerHTML = (0, _svg2.default)('play');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n this.playButton.innerHTML = (0, _svg2.default)('pause');\n this.video.play();\n this.setTime();\n this.element.classList.add('dplayer-playing');\n if (this.danmaku) {\n this.danmaku.play();\n }\n this.trigger('play');\n }\n },\n {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n this.element.classList.remove('dplayer-loading');\n if (!this.video.paused) {\n this.bezel.innerHTML = (0, _svg2.default)('pause');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n this.ended = false;\n this.playButton.innerHTML = (0, _svg2.default)('play');\n this.video.pause();\n this.clearTime();\n this.element.classList.remove('dplayer-playing');\n if (this.danmaku) {\n this.danmaku.pause();\n }\n this.trigger('pause');\n }\n },\n {\n key: 'volume',\n value: function volume(percentage, nonotice, nostorage) {\n percentage = parseFloat(percentage);\n if (!isNaN(percentage)) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n if (!nostorage) {\n localStorage.setItem('dplayer-volume', percentage);\n }\n if (!nonotice) {\n this.notice(this.tran('Volume') + ' ' + (percentage * 100).toFixed(0) + '%');\n }\n this.video.volume = percentage;\n if (this.video.muted) {\n this.video.muted = false;\n }\n this.switchVolumeIcon();\n }\n return this.video.volume;\n }\n },\n {\n key: 'toggle',\n value: function toggle() {\n if (this.video.paused) {\n this.play();\n } else {\n this.pause();\n }\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 key: 'switchVideo',\n value: function switchVideo(video, danmakuAPI) {\n this.video.poster = video.pic ? video.pic : '';\n this.video.src = video.url;\n this.pause();\n if (danmakuAPI) {\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 if (this.danmaku) {\n this.danmaku.reload({\n id: danmakuAPI.id,\n address: danmakuAPI.api,\n token: danmakuAPI.token,\n maximum: danmakuAPI.maximum,\n addition: danmakuAPI.addition,\n user: danmakuAPI.user\n });\n }\n }\n }\n },\n {\n key: 'initVideo',\n value: function initVideo() {\n var _this2 = this;\n var enablehls = void 0;\n if (this.option.video.type === 'auto') {\n enablehls = /m3u8(#|\\?|$)/i.exec(this.video.src);\n } else if (this.option.video.type === 'hls') {\n enablehls = true;\n } else {\n enablehls = false;\n }\n if (enablehls && Hls.isSupported()) {\n var hls = new Hls();\n hls.loadSource(this.video.src);\n hls.attachMedia(this.video);\n }\n var enableflv = void 0;\n if (this.option.video.type === 'auto') {\n enableflv = /.flv(#|\\?|$)/i.exec(this.video.src);\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);\n flvPlayer.load();\n }\n this.video.addEventListener('durationchange', function () {\n if (_this2.video.duration !== 1) {\n _this2.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = _utils2.default.secondToTime(_this2.video.duration);\n }\n });\n this.video.addEventListener('progress', function () {\n var percentage = _this2.video.buffered.length ? _this2.video.buffered.end(_this2.video.buffered.length - 1) / _this2.video.duration : 0;\n _this2.updateBar('loaded', percentage, 'width');\n });\n this.video.addEventListener('error', function () {\n _this2.tran && _this2.notice && _this2.notice(_this2.tran('This video fails to load'), -1);\n _this2.trigger && _this2.trigger('pause');\n });\n this.video.addEventListener('canplay', function () {\n _this2.trigger('canplay');\n });\n this.ended = false;\n this.video.addEventListener('ended', function () {\n _this2.updateBar('played', 1, 'width');\n if (!_this2.loop) {\n _this2.ended = true;\n _this2.pause();\n _this2.trigger('ended');\n } else {\n _this2.seek(0);\n _this2.video.play();\n }\n if (_this2.danmaku) {\n _this2.danmaku.danIndex = 0;\n }\n });\n this.video.addEventListener('play', function () {\n if (_this2.paused) {\n _this2.play();\n }\n });\n this.video.addEventListener('pause', function () {\n if (!_this2.paused) {\n _this2.pause();\n }\n });\n this.volume(localStorage.getItem('dplayer-volume') || this.option.volume, true, true);\n }\n },\n {\n key: 'switchQuality',\n value: function switchQuality(index) {\n var _this3 = this;\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 var paused = this.video.paused;\n this.video.pause();\n var videoHTML = _html2.default.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.insertBefore(videoEle, parent.getElementsByTagName('div')[0]);\n this.prevVideo = this.video;\n this.video = videoEle;\n this.initVideo();\n this.seek(this.prevVideo.currentTime);\n this.notice(this.tran('Switching to') + ' ' + this.quality.name + ' ' + this.tran('quality'), -1);\n this.video.addEventListener('canplay', function () {\n if (_this3.prevVideo) {\n if (_this3.video.currentTime !== _this3.prevVideo.currentTime) {\n _this3.seek(_this3.prevVideo.currentTime);\n return;\n }\n parent.removeChild(_this3.prevVideo);\n _this3.video.classList.add('dplayer-video-current');\n if (!paused) {\n _this3.video.play();\n }\n _this3.prevVideo = null;\n _this3.notice(_this3.tran('Switched to') + ' ' + _this3.quality.name + ' ' + _this3.tran('quality'));\n _this3.switchingQuality = false;\n }\n });\n }\n },\n {\n key: 'mouseHandler',\n value: function mouseHandler(pbar, timeTips) {\n var _this4 = this;\n var cumulativeOffset = function cumulativeOffset(element) {\n var top = 0, left = 0;\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n return {\n top: top,\n left: left\n };\n };\n return function (e) {\n if (!_this4.video.duration) {\n return;\n }\n var clientX = e.clientX;\n var px = cumulativeOffset(pbar).left;\n var tx = clientX - px;\n var time = _this4.video.duration * (tx / pbar.offsetWidth);\n timeTips.style.left = tx - 20 + 'px';\n _this4.previewWrapper.style.left = tx - _this4.previewWrapper.offsetWidth / 2 + 'px';\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n _this4.isMouseHoverPbar = true;\n if (_this4.previewTime !== parseInt(time)) {\n timeTips.innerText = _utils2.default.secondToTime(time);\n _this4.previewTime = parseInt(time);\n _this4.setPreview && clearTimeout(_this4.setPreview);\n _this4.setPreview = setTimeout(function () {\n _this4.setPreviewSourceAndFrame({ time: parseInt(time) });\n }, 500);\n }\n _this4.timeTipsDisplay(true, timeTips);\n break;\n case 'mouseleave':\n case 'mouseout':\n _this4.isMouseHoverPbar = false;\n _this4.previewDispaly(false);\n _this4.timeTipsDisplay(false, timeTips);\n break;\n }\n };\n }\n },\n {\n key: 'timeTipsDisplay',\n value: function timeTipsDisplay(show, timeTips) {\n if (show) {\n if (this.isTimeTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n this.isTimeTipsShow = true;\n } else {\n if (!this.isTimeTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n this.isTimeTipsShow = false;\n }\n }\n },\n {\n key: 'initVideoPreview',\n value: function initVideoPreview() {\n var _this5 = this;\n this.previewVideo = document.createElement('video');\n this.previewWrapper = this.element.getElementsByClassName('dplayer-bar-preview')[0];\n this.previewCanvas = this.element.getElementsByClassName('dplayer-bar-preview-canvas')[0];\n this.previewVideo.preload = 'metadata';\n var resize = function resize() {\n var w = _this5.element.offsetWidth / 4;\n var h = _this5.element.offsetHeight / 4;\n _this5.previewWrapper.style.width = w + 'px';\n _this5.previewWrapper.style.height = h + 'px';\n _this5.previewWrapper.style.top = -h + 2 + 'px';\n _this5.previewCanvas.width = w;\n _this5.previewCanvas.height = h;\n };\n resize();\n this.video.addEventListener('loadedmetadata', function () {\n resize();\n });\n this.setPreviewSourceAndFrame({\n url: this.video.src,\n time: 0\n });\n this.bindPreviewEvent();\n }\n },\n {\n key: 'setPreviewSourceAndFrame',\n value: function setPreviewSourceAndFrame(_ref) {\n var url = _ref.url, time = _ref.time;\n if (url) {\n this.previewVideo.src = url;\n }\n if (time) {\n this.previewVideo.currentTime = time;\n }\n }\n },\n {\n key: 'bindPreviewEvent',\n value: function bindPreviewEvent() {\n var _this6 = this;\n this.previewNumber = 0;\n this.previewVideo.addEventListener('seeked', function () {\n _this6.previewNumber += 1;\n _this6.generPreviewImage(_this6.previewNumber);\n });\n }\n },\n {\n key: 'generPreviewImage',\n value: function generPreviewImage(number) {\n if (number !== this.previewNumber) {\n return;\n }\n if (!this.isMouseHoverPbar) {\n return;\n }\n this.previewDispaly(true);\n if (!this.isPreViewShow) {\n return;\n }\n var ctx = this.previewCanvas.getContext('2d');\n ctx.drawImage(this.previewVideo, 0, 0, this.previewWrapper.offsetWidth, this.previewWrapper.offsetHeight);\n }\n },\n {\n key: 'previewDispaly',\n value: function previewDispaly(show) {\n if (show) {\n if (this.isPreViewShow) {\n return;\n }\n if (!this.isMouseHoverPbar) {\n return;\n }\n this.previewWrapper.classList.remove('hidden');\n this.isPreViewShow = true;\n } else {\n if (!this.isPreViewShow) {\n return;\n }\n this.previewWrapper.classList.add('hidden');\n this.isPreViewShow = false;\n }\n }\n },\n {\n key: 'notice',\n value: function notice(text) {\n var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.8;\n var noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = opacity;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n this.noticeTime = setTimeout(function () {\n noticeEle.style.opacity = 0;\n }, time);\n }\n },\n {\n key: 'destroy',\n value: function destroy() {\n this.pause();\n clearTimeout(this.hideTime);\n this.video.src = '';\n this.element.innerHTML = '';\n for (var key in this) {\n if (this.hasOwnProperty(key) && key !== 'paused') {\n delete this[key];\n }\n }\n }\n }\n ]);\n return DPlayer;\n}();\nmodule.exports = DPlayer;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nmodule.exports = {\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 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 !== element) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n }\n return actualLeft - elementScrollLeft;\n },\n isMobile: /mobile/i.test(window.navigator.userAgent)\n};\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar defaultApiBackend = __webpack_require__(6);\nmodule.exports = function (option) {\n var isMobile = /mobile/i.test(window.navigator.userAgent);\n if (isMobile) {\n option.autoplay = false;\n }\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 volume: '0.7',\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 (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 if (option.video.quality) {\n option.video.url = [option.video.quality[option.video.defaultQuality].url];\n }\n return option;\n};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar SendXMLHttpRequest = function SendXMLHttpRequest(url, data, success, error, fail) {\n var xhr = new XMLHttpRequest();\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 if (response.code !== 1) {\n return error(xhr, response);\n }\n return success(xhr, response);\n }\n fail(xhr);\n }\n };\n xhr.open(data !== null ? 'POST' : 'GET', url, true);\n xhr.send(data !== null ? JSON.stringify(data) : null);\n};\nmodule.exports = {\n send: function send(endpoint, danmakuData, callback) {\n SendXMLHttpRequest(endpoint, danmakuData, function (xhr, response) {\n console.log('Post danmaku: ', response);\n if (callback) {\n callback();\n }\n }, function (xhr, response) {\n alert(response.msg);\n }, function (xhr) {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n read: function read(endpoint, callback) {\n SendXMLHttpRequest(endpoint, null, function (xhr, response) {\n callback(null, response.danmaku);\n }, function (xhr, response) {\n callback({\n status: xhr.status,\n response: response\n });\n }, function (xhr) {\n callback({\n status: xhr.status,\n response: null\n });\n });\n }\n};\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar tranZH = {\n 'Danmaku is loading': '弹幕加载中',\n 'Top': '顶部',\n 'Bottom': '底部',\n 'Rolling': '滚动',\n 'Input danmaku, hit Enter': '输入弹幕\\uFF0C回车发送',\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!': '要输入弹幕内容啊喂\\uFF01',\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 'FF to': '快进至',\n 'REW to': '快退至',\n 'Volume': '音量'\n};\nmodule.exports = function (lang) {\n var _this = this;\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/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar svg = __webpack_require__(0);\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 '
' + videos + '' + (option.logo ? '
' : '') + '
' + (option.danmaku ? '' + tran('Danmaku is loading') + '' : '') + '
0:00 / 0:00
' + (option.video.quality ? '
' + html.qualityList(option.video.quality) + '
' : '') + '' + (option.screenshot ? '' + svg('camera') + '' : '') + '
' + tran('Set danmaku color') + '
' + tran('Set danmaku type') + '
00:00
' + html.contextmenuList(option.contextmenu) + '
';\n },\n contextmenuList: function contextmenuList(contextmenu) {\n var result = '
';\n for (var i = 0; i < contextmenu.length; i++) {\n result += '';\n }\n result += '
';\n return result;\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 return result;\n },\n video: function video(current, pic, screenshot, preload, url) {\n return '';\n },\n setting: function setting(tran) {\n return {\n 'original': '
' + tran('Speed') + '
' + svg('right') + '
' + tran('Loop') + '
' + tran('Danmaku') + '
' + tran('Opacity for danmaku') + '
',\n 'speed': '
0.5
0.75
' + tran('Normal') + '
1.25
1.5
2
'\n };\n }\n};\nmodule.exports = html;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar _typeof = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;\n};\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor)\n descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps)\n defineProperties(Constructor.prototype, protoProps);\n if (staticProps)\n defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n}\nvar Danmaku = function () {\n function Danmaku(options) {\n _classCallCheck(this, Danmaku);\n this.options = options;\n this.container = this.options.container;\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.danIndex = 0;\n this.dan = [];\n this.showing = true;\n this._opacity = this.options.opacity;\n this.load();\n }\n _createClass(Danmaku, [\n {\n key: 'load',\n value: function load() {\n var _this = this;\n var apiurl = void 0;\n if (this.options.api.maximum) {\n apiurl = this.options.api.address + '?id=' + this.options.api.id + '&max=' + this.options.api.maximum;\n } else {\n apiurl = this.options.api.address + '?id=' + this.options.api.id;\n }\n var endpoints = (this.options.api.addition || []).slice(0);\n endpoints.push(apiurl);\n this._readAllEndpoints(endpoints, function (results) {\n _this.dan = [].concat.apply([], results).sort(function (a, b) {\n return a.time - b.time;\n });\n window.requestAnimationFrame(function () {\n _this.frame();\n });\n _this.options.callback();\n });\n }\n },\n {\n key: 'reload',\n value: function reload(newAPI) {\n this.options.api = newAPI;\n this.dan = [];\n this.clear();\n this.load();\n }\n },\n {\n key: '_readAllEndpoints',\n value: function _readAllEndpoints(endpoints, callback) {\n var _this2 = this;\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.options.error(err.response.msg);\n } else {\n _this2.options.error('Request was unsuccessful: ' + err.status);\n }\n results[i] = [];\n } else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return callback(results);\n }\n };\n };\n for (var i = 0; i < endpoints.length; ++i) {\n this.options.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n },\n {\n key: 'send',\n value: function send(dan, callback) {\n var danmakuData = {\n token: this.options.api.token,\n player: this.options.api.id,\n author: this.options.api.user,\n time: this.options.time(),\n text: dan.text,\n color: dan.color,\n type: dan.type\n };\n this.options.apiBackend.send(this.options.api.address, danmakuData, callback);\n this.dan.splice(this.danIndex, 0, danmakuData);\n this.danIndex++;\n var danmaku = {\n text: this.htmlEncode(danmakuData.text),\n color: danmakuData.color,\n type: danmakuData.type,\n border: '2px solid ' + this.options.borderColor\n };\n this.draw(danmaku);\n }\n },\n {\n key: 'frame',\n value: function frame() {\n var _this3 = this;\n if (this.dan.length && !this.paused && this.showing) {\n var item = this.dan[this.danIndex];\n var dan = [];\n while (item && this.options.time() > parseFloat(item.time)) {\n dan.push(item);\n item = this.dan[++this.danIndex];\n }\n this.draw(dan);\n }\n window.requestAnimationFrame(function () {\n _this3.frame();\n });\n }\n },\n {\n key: 'opacity',\n value: function opacity(percentage) {\n if (percentage !== undefined) {\n var items = this.container.getElementsByClassName('dplayer-danmaku-item');\n for (var i = 0; i < items.length; i++) {\n items[i].style.opacity = percentage;\n }\n this._opacity = percentage;\n localStorage.setItem('danmaku-opacity', this._opacity);\n }\n return this._opacity;\n }\n },\n {\n key: 'draw',\n value: function draw(dan) {\n var _this4 = this;\n var itemHeight = this.options.height;\n var danWidth = this.container.offsetWidth;\n var danHeight = this.container.offsetHeight;\n var itemY = parseInt(danHeight / itemHeight);\n var danItemRight = function danItemRight(ele) {\n var eleWidth = ele.offsetWidth || parseInt(ele.style.width);\n var eleRight = ele.getBoundingClientRect().right || _this4.container.getBoundingClientRect().right + eleWidth;\n return _this4.container.getBoundingClientRect().right - eleRight;\n };\n var danSpeed = function danSpeed(width) {\n return (danWidth + width) / 5;\n };\n var getTunnel = function getTunnel(ele, type, width) {\n var tmp = danWidth / danSpeed(width);\n var _loop = function _loop(i) {\n var item = _this4.danTunnel[type][i + ''];\n if (item && item.length) {\n if (type !== 'right') {\n return 'continue';\n }\n for (var j = 0; j < item.length; j++) {\n var danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(parseInt(item[j].style.width)) || 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 { v: i % itemY };\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 { v: i % itemY };\n }\n };\n for (var i = 0;; i++) {\n var _ret = _loop(i);\n switch (_ret) {\n case 'continue':\n continue;\n default:\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === 'object')\n return _ret.v;\n }\n }\n };\n if (Object.prototype.toString.call(dan) !== '[object Array]') {\n dan = [dan];\n }\n var docFragment = document.createDocumentFragment();\n var _loop2 = function _loop2(i) {\n if (!dan[i].type) {\n dan[i].type = 'right';\n }\n if (!dan[i].color) {\n dan[i].color = '#fff';\n }\n var item = document.createElement('div');\n item.classList.add('dplayer-danmaku-item');\n item.classList.add('dplayer-danmaku-' + dan[i].type);\n if (dan[i].border) {\n item.innerHTML = '' + dan[i].text + '';\n } else {\n item.innerHTML = dan[i].text;\n }\n item.style.opacity = _this4._opacity;\n item.style.color = dan[i].color;\n item.addEventListener('animationend', function () {\n _this4.container.removeChild(item);\n });\n var itemWidth = _this4._measure(dan[i].text);\n switch (dan[i].type) {\n case 'right':\n item.style.width = itemWidth + 1 + 'px';\n item.style.top = itemHeight * getTunnel(item, dan[i].type, itemWidth) + 'px';\n item.style.transform = 'translateX(-' + danWidth + 'px)';\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, dan[i].type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, dan[i].type) + 'px';\n break;\n default:\n console.error('Can\\'t handled danmaku type: ' + dan[i].type);\n }\n item.classList.add('dplayer-danmaku-move');\n docFragment.appendChild(item);\n };\n for (var i = 0; i < dan.length; i++) {\n _loop2(i);\n }\n this.container.appendChild(docFragment);\n return docFragment;\n }\n },\n {\n key: 'play',\n value: function play() {\n this.paused = false;\n }\n },\n {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n }\n },\n {\n key: '_measure',\n value: function _measure(text) {\n if (!this.context) {\n var measureStyle = getComputedStyle(this.container.getElementsByClassName('dplayer-danmaku-item')[0], null);\n this.context = document.createElement('canvas').getContext('2d');\n this.context.font = measureStyle.getPropertyValue('font');\n }\n return this.context.measureText(text).width;\n }\n },\n {\n key: 'seek',\n value: function seek() {\n for (var i = 0; i < this.dan.length; i++) {\n if (this.dan[i].time >= this.options.time()) {\n this.danIndex = i;\n break;\n }\n this.danIndex = this.dan.length;\n }\n }\n },\n {\n key: 'clear',\n value: function clear() {\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.danIndex = 0;\n this.options.container.innerHTML = '';\n }\n },\n {\n key: 'htmlEncode',\n value: function htmlEncode(str) {\n return str.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/'/g, ''').replace(/\\//g, '/');\n }\n },\n {\n key: 'resize',\n value: function resize() {\n var danWidth = this.container.offsetWidth;\n var items = this.container.getElementsByClassName('dplayer-danmaku-item');\n for (var i = 0; i < items.length; i++) {\n items[i].style.transform = 'translateX(-' + danWidth + 'px)';\n }\n }\n },\n {\n key: 'hide',\n value: function hide() {\n this.showing = false;\n this.pause();\n this.clear();\n }\n },\n {\n key: 'show',\n value: function show() {\n this.seek();\n this.showing = true;\n this.play();\n }\n }\n ]);\n return Danmaku;\n}();\nmodule.exports = Danmaku;\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// 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 = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 818e5f31434b4a419028","'use strict';\nvar svgSource = {\n 'play': [\n '0 0 16 32',\n '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 ],\n 'pause': [\n '0 0 17 32',\n '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 ],\n 'volume-up': [\n '0 0 21 32',\n '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 ],\n 'volume-down': [\n '0 0 21 32',\n '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 ],\n 'volume-off': [\n '0 0 21 32',\n '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 ],\n 'loop': [\n '0 0 32 32',\n '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 ],\n 'full': [\n '0 0 32 33',\n '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 ],\n 'full-in': [\n '0 0 32 33',\n '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 ],\n 'setting': [\n '0 0 32 28',\n '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 ],\n 'right': [\n '0 0 32 32',\n '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 ],\n 'comment': [\n '0 0 32 32',\n '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 ],\n 'comment-off': [\n '0 0 32 32',\n '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 ],\n 'send': [\n '0 0 32 32',\n '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 ],\n 'menu': [\n '0 0 22 32',\n '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 ],\n 'camera': [\n '0 0 32 32',\n '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// WEBPACK FOOTER\n// ./src/svg.js\n// module id = 0\n// module chunks = 0","'use strict';\nconsole.log('\\n' + ' %c DPlayer ' + DPLAYER_VERSION + ' %c http://dplayer.js.org ' + '\\n' + '\\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');\nmodule.exports = require('./DPlayer');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/index.js\n// module id = 1\n// module chunks = 0","'use strict';\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor)\n descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps)\n defineProperties(Constructor.prototype, protoProps);\n if (staticProps)\n defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\nrequire('./DPlayer.scss');\nvar _utils = require('./utils');\nvar _utils2 = _interopRequireDefault(_utils);\nvar _svg = require('./svg');\nvar _svg2 = _interopRequireDefault(_svg);\nvar _option = require('./option');\nvar _option2 = _interopRequireDefault(_option);\nvar _i18n = require('./i18n');\nvar _i18n2 = _interopRequireDefault(_i18n);\nvar _html = require('./html');\nvar _html2 = _interopRequireDefault(_html);\nvar _danmaku = require('./danmaku');\nvar _danmaku2 = _interopRequireDefault(_danmaku);\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n}\nvar index = 0;\nvar DPlayer = function () {\n function DPlayer(option) {\n var _this = this;\n _classCallCheck(this, DPlayer);\n this.option = (0, _option2.default)(option);\n this.option.element.classList.add('dplayer');\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 this.tran = new _i18n2.default(this.option.lang).tran;\n var eventTypes = [\n 'play',\n 'pause',\n 'canplay',\n 'playing',\n 'ended',\n 'error'\n ];\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 this.element = this.option.element;\n if (!this.option.danmaku) {\n this.element.classList.add('dplayer-no-danmaku');\n }\n if (_utils.isMobile) {\n this.element.classList.add('dplayer-mobile');\n }\n this.element.innerHTML = _html2.default.main(option, index, this.tran);\n var bar = {};\n bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\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 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 document.addEventListener('click', function () {\n _this.focus = false;\n }, true);\n this.element.addEventListener('click', function () {\n _this.focus = true;\n }, true);\n if (this.option.danmaku) {\n this.danmaku = new _danmaku2.default({\n container: this.element.getElementsByClassName('dplayer-danmaku')[0],\n opacity: localStorage.getItem('danmaku-opacity') || 0.7,\n callback: function callback() {\n _this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n if (_this.option.autoplay && !_utils.isMobile) {\n _this.play();\n } else if (_utils.isMobile) {\n _this.pause();\n }\n },\n error: function error(msg) {\n _this.notice(msg);\n },\n apiBackend: this.option.apiBackend,\n borderColor: this.option.theme,\n height: this.arrow ? 24 : 30,\n time: function time() {\n return _this.video.currentTime;\n },\n api: {\n id: this.option.danmaku.id,\n address: this.option.danmaku.api,\n token: this.option.danmaku.token,\n maximum: this.option.danmaku.maximum,\n addition: this.option.danmaku.addition,\n user: this.option.danmaku.user\n }\n });\n }\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 this.video = this.element.getElementsByClassName('dplayer-video-current')[0];\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 this.playButton = this.element.getElementsByClassName('dplayer-play-icon')[0];\n this.paused = true;\n this.playButton.addEventListener('click', function () {\n _this.toggle();\n });\n var videoWrap = this.element.getElementsByClassName('dplayer-video-wrap')[0];\n var conMask = this.element.getElementsByClassName('dplayer-controller-mask')[0];\n if (!_utils.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 var lastPlayPos = 0;\n var currentPlayPos = 0;\n var bufferingDetected = false;\n window.requestAnimationFrame = function () {\n return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {\n window.setTimeout(callback, 1000 / 60);\n };\n }();\n var setCheckLoadingTime = function setCheckLoadingTime() {\n _this.checkLoading = setInterval(function () {\n currentPlayPos = _this.video.currentTime;\n if (!bufferingDetected && currentPlayPos < lastPlayPos + 0.01 && !_this.video.paused) {\n _this.element.classList.add('dplayer-loading');\n bufferingDetected = true;\n }\n if (bufferingDetected && currentPlayPos > lastPlayPos + 0.01 && !_this.video.paused) {\n _this.element.classList.remove('dplayer-loading');\n bufferingDetected = false;\n }\n lastPlayPos = currentPlayPos;\n }, 100);\n };\n var clearCheckLoadingTime = function clearCheckLoadingTime() {\n clearInterval(_this.checkLoading);\n };\n this.playedTime = false;\n this.animationFrame = function () {\n if (_this.playedTime) {\n _this.updateBar('played', _this.video.currentTime / _this.video.duration, 'width');\n _this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = _utils2.default.secondToTime(_this.video.currentTime);\n _this.trigger('playing');\n }\n window.requestAnimationFrame(_this.animationFrame);\n };\n window.requestAnimationFrame(this.animationFrame);\n this.setTime = function (type) {\n if (!type) {\n _this.playedTime = true;\n setCheckLoadingTime();\n } else {\n _this[type + 'Time'] = true;\n if (type === 'played') {\n setCheckLoadingTime();\n }\n }\n };\n this.clearTime = function (type) {\n if (!type) {\n _this.playedTime = false;\n clearCheckLoadingTime();\n } else {\n _this[type + 'Time'] = false;\n if (type === 'played') {\n clearCheckLoadingTime();\n }\n }\n };\n pbar.addEventListener('click', function (event) {\n var e = event || window.event;\n barWidth = pbar.clientWidth;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(pbar)) / barWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('played', percentage, 'width');\n _this.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n });\n this.initVideoPreview();\n this.isPreViewShow = false;\n this.isTimeTipsShow = true;\n this.isMouseHoverPbar = false;\n this.mouseHandler = this.mouseHandler(pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.mouseHandler);\n pbar.addEventListener('mouseover', this.mouseHandler);\n pbar.addEventListener('mouseenter', this.mouseHandler);\n pbar.addEventListener('mouseout', this.mouseHandler);\n pbar.addEventListener('mouseleave', this.mouseHandler);\n var thumbMove = function thumbMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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 = _utils2.default.secondToTime(percentage * _this.video.duration);\n };\n var thumbUp = function thumbUp() {\n document.removeEventListener('mouseup', thumbUp);\n document.removeEventListener('mousemove', thumbMove);\n _this.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n _this.setTime();\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 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 this.switchVolumeIcon = function () {\n var volumeicon = _this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (_this.volume() >= 0.95) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-up');\n } else if (_this.volume() > 0) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-down');\n } else {\n volumeicon.innerHTML = (0, _svg2.default)('volume-off');\n }\n };\n var volumeMove = function volumeMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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 volumeBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.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.muted) {\n _this.video.muted = false;\n _this.switchVolumeIcon();\n _this.updateBar('volume', _this.volume(), 'width');\n } else {\n _this.video.muted = true;\n volumeicon.innerHTML = (0, _svg2.default)('volume-off');\n _this.updateBar('volume', 0, 'width');\n }\n });\n this.hideTime = 0;\n var hideController = function hideController() {\n _this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(_this.hideTime);\n _this.hideTime = setTimeout(function () {\n if (_this.video.played.length) {\n _this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n if (!_utils.isMobile) {\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n var settingHTML = _html2.default.setting(this.tran);\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 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 mask.addEventListener('click', function () {\n closeSetting();\n });\n settingIcon.addEventListener('click', function () {\n openSetting();\n });\n this.loop = this.option.loop;\n var showdan = true;\n var settingEvent = function settingEvent() {\n var loopEle = _this.element.getElementsByClassName('dplayer-setting-loop')[0];\n var loopToggle = loopEle.getElementsByClassName('dplayer-toggle-setting-input')[0];\n loopToggle.checked = _this.loop;\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 var showDanEle = _this.element.getElementsByClassName('dplayer-setting-showdan')[0];\n var showDanToggle = showDanEle.getElementsByClassName('dplayer-showdan-setting-input')[0];\n showDanToggle.checked = showdan;\n showDanEle.addEventListener('click', function () {\n showDanToggle.checked = !showDanToggle.checked;\n if (showDanToggle.checked) {\n showdan = true;\n if (!_this.paused) {\n _this.danmaku.show();\n }\n } else {\n showdan = false;\n _this.danmaku.hide();\n }\n closeSetting();\n });\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 var speedItem = settingBox.getElementsByClassName('dplayer-setting-speed-item');\n var _loop = function _loop(_i2) {\n speedItem[_i2].addEventListener('click', function () {\n _this.video.playbackRate = speedItem[_i2].dataset.speed;\n closeSetting();\n });\n };\n for (var _i2 = 0; _i2 < speedItem.length; _i2++) {\n _loop(_i2);\n }\n });\n if (_this.danmaku) {\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.danmaku.opacity(), 'width');\n var danmakuMove = function danmakuMove(event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n _this.danmaku.opacity(percentage);\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 danmakuBarWrapWrap.addEventListener('click', function (event) {\n var e = event || window.event;\n var percentage = (e.clientX - _utils2.default.getElementViewLeft(danmakuBarWrap)) / dWidth;\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n _this.updateBar('danmaku', percentage, 'width');\n _this.danmaku.opacity(percentage);\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 if (this.video.duration !== 1) {\n this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = this.video.duration ? _utils2.default.secondToTime(this.video.duration) : '00:00';\n }\n if (!this.danmaku) {\n if (this.option.autoplay && !_utils.isMobile) {\n this.play();\n } else if (_utils.isMobile) {\n this.pause();\n }\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 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 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 commentBox.classList.remove('dplayer-comment-box-open');\n mask.classList.remove('dplayer-mask-show');\n _this.element.classList.remove('dplayer-show-controller');\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 commentBox.classList.add('dplayer-comment-box-open');\n mask.classList.add('dplayer-mask-show');\n _this.element.classList.add('dplayer-show-controller');\n disableHide = setInterval(function () {\n clearTimeout(_this.hideTime);\n }, 1000);\n commentFocusTimeout = setTimeout(function () {\n commentInput.focus();\n }, 300);\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 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 var sendComment = function sendComment() {\n commentInput.blur();\n if (!commentInput.value.replace(/^\\s+|\\s+$/g, '')) {\n _this.notice(_this.tran('Please input danmaku content!'));\n return;\n }\n _this.danmaku.send({\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 }, function () {\n commentInput.value = '';\n closeComment();\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 commentSendIcon.addEventListener('click', sendComment);\n this.element.addEventListener('fullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\n this.element.addEventListener('mozfullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\n this.element.addEventListener('webkitfullscreenchange', function () {\n if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\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.webkitEnterFullscreen) {\n _this.video.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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n });\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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n }\n });\n var handleKeyDown = function handleKeyDown(e) {\n if (_this.focus) {\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.seek(_this.video.currentTime - 5);\n hideController();\n break;\n case 39:\n event.preventDefault();\n _this.seek(_this.video.currentTime + 5);\n hideController();\n break;\n case 38:\n event.preventDefault();\n percentage = _this.volume() + 0.1;\n _this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = _this.volume() - 0.1;\n _this.volume(percentage);\n break;\n }\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', function (e) {\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 if (_this.danmaku) {\n _this.danmaku.resize();\n }\n }\n break;\n }\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 menu.classList.add('dplayer-menu-show');\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 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 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 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.videoWidth;\n canvas.height = _this.video.videoHeight;\n canvas.getContext('2d').drawImage(_this.video, 0, 0, canvas.width, canvas.height);\n camareIcon.href = canvas.toDataURL();\n camareIcon.download = 'DPlayer.png';\n });\n }\n this.initVideo();\n index++;\n }\n _createClass(DPlayer, [\n {\n key: 'seek',\n value: function seek(time) {\n time = Math.max(time, 0);\n if (this.video.duration) {\n time = Math.min(time, this.video.duration);\n }\n if (this.video.currentTime < time) {\n this.notice(this.tran('FF to') + ' ' + _utils2.default.secondToTime(time));\n } else if (this.video.currentTime > time) {\n this.notice(this.tran('REW to') + ' ' + _utils2.default.secondToTime(time));\n }\n this.video.currentTime = time;\n if (this.danmaku) {\n this.danmaku.seek();\n }\n this.updateBar('played', time / this.video.duration, 'width');\n }\n },\n {\n key: 'play',\n value: function play() {\n this.paused = false;\n if (this.video.paused) {\n this.bezel.innerHTML = (0, _svg2.default)('play');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n this.playButton.innerHTML = (0, _svg2.default)('pause');\n this.video.play();\n this.setTime();\n this.element.classList.add('dplayer-playing');\n if (this.danmaku) {\n this.danmaku.play();\n }\n this.trigger('play');\n }\n },\n {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n this.element.classList.remove('dplayer-loading');\n if (!this.video.paused) {\n this.bezel.innerHTML = (0, _svg2.default)('pause');\n this.bezel.classList.add('dplayer-bezel-transition');\n }\n this.ended = false;\n this.playButton.innerHTML = (0, _svg2.default)('play');\n this.video.pause();\n this.clearTime();\n this.element.classList.remove('dplayer-playing');\n if (this.danmaku) {\n this.danmaku.pause();\n }\n this.trigger('pause');\n }\n },\n {\n key: 'volume',\n value: function volume(percentage, nonotice, nostorage) {\n percentage = parseFloat(percentage);\n if (!isNaN(percentage)) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n if (!nostorage) {\n localStorage.setItem('dplayer-volume', percentage);\n }\n if (!nonotice) {\n this.notice(this.tran('Volume') + ' ' + (percentage * 100).toFixed(0) + '%');\n }\n this.video.volume = percentage;\n if (this.video.muted) {\n this.video.muted = false;\n }\n this.switchVolumeIcon();\n }\n return this.video.volume;\n }\n },\n {\n key: 'toggle',\n value: function toggle() {\n if (this.video.paused) {\n this.play();\n } else {\n this.pause();\n }\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 key: 'switchVideo',\n value: function switchVideo(video, danmakuAPI) {\n this.video.poster = video.pic ? video.pic : '';\n this.video.src = video.url;\n this.pause();\n if (danmakuAPI) {\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 if (this.danmaku) {\n this.danmaku.reload({\n id: danmakuAPI.id,\n address: danmakuAPI.api,\n token: danmakuAPI.token,\n maximum: danmakuAPI.maximum,\n addition: danmakuAPI.addition,\n user: danmakuAPI.user\n });\n }\n }\n }\n },\n {\n key: 'initVideo',\n value: function initVideo() {\n var _this2 = this;\n var enablehls = void 0;\n if (this.option.video.type === 'auto') {\n enablehls = /m3u8(#|\\?|$)/i.exec(this.video.src);\n } else if (this.option.video.type === 'hls') {\n enablehls = true;\n } else {\n enablehls = false;\n }\n if (enablehls && Hls.isSupported()) {\n var hls = new Hls();\n hls.loadSource(this.video.src);\n hls.attachMedia(this.video);\n }\n var enableflv = void 0;\n if (this.option.video.type === 'auto') {\n enableflv = /.flv(#|\\?|$)/i.exec(this.video.src);\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);\n flvPlayer.load();\n }\n this.video.addEventListener('durationchange', function () {\n if (_this2.video.duration !== 1) {\n _this2.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = _utils2.default.secondToTime(_this2.video.duration);\n }\n });\n this.video.addEventListener('progress', function () {\n var percentage = _this2.video.buffered.length ? _this2.video.buffered.end(_this2.video.buffered.length - 1) / _this2.video.duration : 0;\n _this2.updateBar('loaded', percentage, 'width');\n });\n this.video.addEventListener('error', function () {\n _this2.tran && _this2.notice && _this2.notice(_this2.tran('This video fails to load'), -1);\n _this2.trigger && _this2.trigger('pause');\n });\n this.video.addEventListener('canplay', function () {\n _this2.trigger('canplay');\n });\n this.ended = false;\n this.video.addEventListener('ended', function () {\n _this2.updateBar('played', 1, 'width');\n if (!_this2.loop) {\n _this2.ended = true;\n _this2.pause();\n _this2.trigger('ended');\n } else {\n _this2.seek(0);\n _this2.video.play();\n }\n if (_this2.danmaku) {\n _this2.danmaku.danIndex = 0;\n }\n });\n this.video.addEventListener('play', function () {\n if (_this2.paused) {\n _this2.play();\n }\n });\n this.video.addEventListener('pause', function () {\n if (!_this2.paused) {\n _this2.pause();\n }\n });\n this.volume(localStorage.getItem('dplayer-volume') || this.option.volume, true, true);\n }\n },\n {\n key: 'switchQuality',\n value: function switchQuality(index) {\n var _this3 = this;\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 var paused = this.video.paused;\n this.video.pause();\n var videoHTML = _html2.default.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.insertBefore(videoEle, parent.getElementsByTagName('div')[0]);\n this.prevVideo = this.video;\n this.video = videoEle;\n this.initVideo();\n this.seek(this.prevVideo.currentTime);\n this.notice(this.tran('Switching to') + ' ' + this.quality.name + ' ' + this.tran('quality'), -1);\n this.video.addEventListener('canplay', function () {\n if (_this3.prevVideo) {\n if (_this3.video.currentTime !== _this3.prevVideo.currentTime) {\n _this3.seek(_this3.prevVideo.currentTime);\n return;\n }\n parent.removeChild(_this3.prevVideo);\n _this3.video.classList.add('dplayer-video-current');\n if (!paused) {\n _this3.video.play();\n }\n _this3.prevVideo = null;\n _this3.notice(_this3.tran('Switched to') + ' ' + _this3.quality.name + ' ' + _this3.tran('quality'));\n _this3.switchingQuality = false;\n }\n });\n }\n },\n {\n key: 'mouseHandler',\n value: function mouseHandler(pbar, timeTips) {\n var _this4 = this;\n var cumulativeOffset = function cumulativeOffset(element) {\n var top = 0, left = 0;\n do {\n top += element.offsetTop || 0;\n left += element.offsetLeft || 0;\n element = element.offsetParent;\n } while (element);\n return {\n top: top,\n left: left\n };\n };\n return function (e) {\n if (!_this4.video.duration) {\n return;\n }\n var clientX = e.clientX;\n var px = cumulativeOffset(pbar).left;\n var tx = clientX - px;\n var time = _this4.video.duration * (tx / pbar.offsetWidth);\n timeTips.style.left = tx - 20 + 'px';\n _this4.previewWrapper.style.left = tx - _this4.previewWrapper.offsetWidth / 2 + 'px';\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n _this4.isMouseHoverPbar = true;\n if (_this4.previewTime !== parseInt(time)) {\n timeTips.innerText = _utils2.default.secondToTime(time);\n _this4.previewTime = parseInt(time);\n _this4.setPreview && clearTimeout(_this4.setPreview);\n _this4.setPreview = setTimeout(function () {\n _this4.setPreviewSourceAndFrame({ time: parseInt(time) });\n }, 500);\n }\n _this4.timeTipsDisplay(true, timeTips);\n break;\n case 'mouseleave':\n case 'mouseout':\n _this4.isMouseHoverPbar = false;\n _this4.previewDispaly(false);\n _this4.timeTipsDisplay(false, timeTips);\n break;\n }\n };\n }\n },\n {\n key: 'timeTipsDisplay',\n value: function timeTipsDisplay(show, timeTips) {\n if (show) {\n if (this.isTimeTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n this.isTimeTipsShow = true;\n } else {\n if (!this.isTimeTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n this.isTimeTipsShow = false;\n }\n }\n },\n {\n key: 'initVideoPreview',\n value: function initVideoPreview() {\n var _this5 = this;\n this.previewVideo = document.createElement('video');\n this.previewWrapper = this.element.getElementsByClassName('dplayer-bar-preview')[0];\n this.previewCanvas = this.element.getElementsByClassName('dplayer-bar-preview-canvas')[0];\n this.previewVideo.preload = 'metadata';\n var resize = function resize() {\n var w = _this5.element.offsetWidth / 4;\n var h = _this5.element.offsetHeight / 4;\n _this5.previewWrapper.style.width = w + 'px';\n _this5.previewWrapper.style.height = h + 'px';\n _this5.previewWrapper.style.top = -h + 2 + 'px';\n _this5.previewCanvas.width = w;\n _this5.previewCanvas.height = h;\n };\n resize();\n this.video.addEventListener('loadedmetadata', function () {\n resize();\n });\n this.setPreviewSourceAndFrame({\n url: this.video.src,\n time: 0\n });\n this.bindPreviewEvent();\n }\n },\n {\n key: 'setPreviewSourceAndFrame',\n value: function setPreviewSourceAndFrame(_ref) {\n var url = _ref.url, time = _ref.time;\n if (url) {\n this.previewVideo.src = url;\n }\n if (time) {\n this.previewVideo.currentTime = time;\n }\n }\n },\n {\n key: 'bindPreviewEvent',\n value: function bindPreviewEvent() {\n var _this6 = this;\n this.previewNumber = 0;\n this.previewVideo.addEventListener('seeked', function () {\n _this6.previewNumber += 1;\n _this6.generPreviewImage(_this6.previewNumber);\n });\n }\n },\n {\n key: 'generPreviewImage',\n value: function generPreviewImage(number) {\n if (number !== this.previewNumber) {\n return;\n }\n if (!this.isMouseHoverPbar) {\n return;\n }\n this.previewDispaly(true);\n if (!this.isPreViewShow) {\n return;\n }\n var ctx = this.previewCanvas.getContext('2d');\n ctx.drawImage(this.previewVideo, 0, 0, this.previewWrapper.offsetWidth, this.previewWrapper.offsetHeight);\n }\n },\n {\n key: 'previewDispaly',\n value: function previewDispaly(show) {\n if (show) {\n if (this.isPreViewShow) {\n return;\n }\n if (!this.isMouseHoverPbar) {\n return;\n }\n this.previewWrapper.classList.remove('hidden');\n this.isPreViewShow = true;\n } else {\n if (!this.isPreViewShow) {\n return;\n }\n this.previewWrapper.classList.add('hidden');\n this.isPreViewShow = false;\n }\n }\n },\n {\n key: 'notice',\n value: function notice(text) {\n var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.8;\n var noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = opacity;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n this.noticeTime = setTimeout(function () {\n noticeEle.style.opacity = 0;\n }, time);\n }\n },\n {\n key: 'destroy',\n value: function destroy() {\n this.pause();\n clearTimeout(this.hideTime);\n this.video.src = '';\n this.element.innerHTML = '';\n for (var key in this) {\n if (this.hasOwnProperty(key) && key !== 'paused') {\n delete this[key];\n }\n }\n }\n }\n ]);\n return DPlayer;\n}();\nmodule.exports = DPlayer;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/DPlayer.js\n// module id = 2\n// module chunks = 0","'use strict';\nmodule.exports = {\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 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 !== element) {\n actualLeft += current.offsetLeft;\n current = current.offsetParent;\n }\n }\n return actualLeft - elementScrollLeft;\n },\n isMobile: /mobile/i.test(window.navigator.userAgent)\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/utils.js\n// module id = 4\n// module chunks = 0","'use strict';\nvar defaultApiBackend = require('./api.js');\nmodule.exports = function (option) {\n var isMobile = /mobile/i.test(window.navigator.userAgent);\n if (isMobile) {\n option.autoplay = false;\n }\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 volume: '0.7',\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 (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 if (option.video.quality) {\n option.video.url = [option.video.quality[option.video.defaultQuality].url];\n }\n return option;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/option.js\n// module id = 5\n// module chunks = 0","'use strict';\nvar SendXMLHttpRequest = function SendXMLHttpRequest(url, data, success, error, fail) {\n var xhr = new XMLHttpRequest();\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 if (response.code !== 1) {\n return error(xhr, response);\n }\n return success(xhr, response);\n }\n fail(xhr);\n }\n };\n xhr.open(data !== null ? 'POST' : 'GET', url, true);\n xhr.send(data !== null ? JSON.stringify(data) : null);\n};\nmodule.exports = {\n send: function send(endpoint, danmakuData, callback) {\n SendXMLHttpRequest(endpoint, danmakuData, function (xhr, response) {\n console.log('Post danmaku: ', response);\n if (callback) {\n callback();\n }\n }, function (xhr, response) {\n alert(response.msg);\n }, function (xhr) {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n read: function read(endpoint, callback) {\n SendXMLHttpRequest(endpoint, null, function (xhr, response) {\n callback(null, response.danmaku);\n }, function (xhr, response) {\n callback({\n status: xhr.status,\n response: response\n });\n }, function (xhr) {\n callback({\n status: xhr.status,\n response: null\n });\n });\n }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/api.js\n// module id = 6\n// module chunks = 0","'use strict';\nvar tranZH = {\n 'Danmaku is loading': '弹幕加载中',\n 'Top': '顶部',\n 'Bottom': '底部',\n 'Rolling': '滚动',\n 'Input danmaku, hit Enter': '输入弹幕\\uFF0C回车发送',\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!': '要输入弹幕内容啊喂\\uFF01',\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 'FF to': '快进至',\n 'REW to': '快退至',\n 'Volume': '音量'\n};\nmodule.exports = function (lang) {\n var _this = this;\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//////////////////\n// WEBPACK FOOTER\n// ./src/i18n.js\n// module id = 7\n// module chunks = 0","'use strict';\nvar svg = require('./svg.js');\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 '
' + videos + '' + (option.logo ? '
' : '') + '
' + (option.danmaku ? '' + tran('Danmaku is loading') + '' : '') + '
0:00 / 0:00
' + (option.video.quality ? '
' + html.qualityList(option.video.quality) + '
' : '') + '' + (option.screenshot ? '' + svg('camera') + '' : '') + '
' + tran('Set danmaku color') + '
' + tran('Set danmaku type') + '
00:00
' + html.contextmenuList(option.contextmenu) + '
';\n },\n contextmenuList: function contextmenuList(contextmenu) {\n var result = '
';\n for (var i = 0; i < contextmenu.length; i++) {\n result += '';\n }\n result += '
';\n return result;\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 return result;\n },\n video: function video(current, pic, screenshot, preload, url) {\n return '';\n },\n setting: function setting(tran) {\n return {\n 'original': '
' + tran('Speed') + '
' + svg('right') + '
' + tran('Loop') + '
' + tran('Danmaku') + '
' + tran('Opacity for danmaku') + '
',\n 'speed': '
0.5
0.75
' + tran('Normal') + '
1.25
1.5
2
'\n };\n }\n};\nmodule.exports = html;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/html.js\n// module id = 8\n// module chunks = 0","'use strict';\nvar _typeof = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;\n};\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor)\n descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps)\n defineProperties(Constructor.prototype, protoProps);\n if (staticProps)\n defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n}\nvar Danmaku = function () {\n function Danmaku(options) {\n _classCallCheck(this, Danmaku);\n this.options = options;\n this.container = this.options.container;\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.danIndex = 0;\n this.dan = [];\n this.showing = true;\n this._opacity = this.options.opacity;\n this.load();\n }\n _createClass(Danmaku, [\n {\n key: 'load',\n value: function load() {\n var _this = this;\n var apiurl = void 0;\n if (this.options.api.maximum) {\n apiurl = this.options.api.address + '?id=' + this.options.api.id + '&max=' + this.options.api.maximum;\n } else {\n apiurl = this.options.api.address + '?id=' + this.options.api.id;\n }\n var endpoints = (this.options.api.addition || []).slice(0);\n endpoints.push(apiurl);\n this._readAllEndpoints(endpoints, function (results) {\n _this.dan = [].concat.apply([], results).sort(function (a, b) {\n return a.time - b.time;\n });\n window.requestAnimationFrame(function () {\n _this.frame();\n });\n _this.options.callback();\n });\n }\n },\n {\n key: 'reload',\n value: function reload(newAPI) {\n this.options.api = newAPI;\n this.dan = [];\n this.clear();\n this.load();\n }\n },\n {\n key: '_readAllEndpoints',\n value: function _readAllEndpoints(endpoints, callback) {\n var _this2 = this;\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.options.error(err.response.msg);\n } else {\n _this2.options.error('Request was unsuccessful: ' + err.status);\n }\n results[i] = [];\n } else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return callback(results);\n }\n };\n };\n for (var i = 0; i < endpoints.length; ++i) {\n this.options.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n },\n {\n key: 'send',\n value: function send(dan, callback) {\n var danmakuData = {\n token: this.options.api.token,\n player: this.options.api.id,\n author: this.options.api.user,\n time: this.options.time(),\n text: dan.text,\n color: dan.color,\n type: dan.type\n };\n this.options.apiBackend.send(this.options.api.address, danmakuData, callback);\n this.dan.splice(this.danIndex, 0, danmakuData);\n this.danIndex++;\n var danmaku = {\n text: this.htmlEncode(danmakuData.text),\n color: danmakuData.color,\n type: danmakuData.type,\n border: '2px solid ' + this.options.borderColor\n };\n this.draw(danmaku);\n }\n },\n {\n key: 'frame',\n value: function frame() {\n var _this3 = this;\n if (this.dan.length && !this.paused && this.showing) {\n var item = this.dan[this.danIndex];\n var dan = [];\n while (item && this.options.time() > parseFloat(item.time)) {\n dan.push(item);\n item = this.dan[++this.danIndex];\n }\n this.draw(dan);\n }\n window.requestAnimationFrame(function () {\n _this3.frame();\n });\n }\n },\n {\n key: 'opacity',\n value: function opacity(percentage) {\n if (percentage !== undefined) {\n var items = this.container.getElementsByClassName('dplayer-danmaku-item');\n for (var i = 0; i < items.length; i++) {\n items[i].style.opacity = percentage;\n }\n this._opacity = percentage;\n localStorage.setItem('danmaku-opacity', this._opacity);\n }\n return this._opacity;\n }\n },\n {\n key: 'draw',\n value: function draw(dan) {\n var _this4 = this;\n var itemHeight = this.options.height;\n var danWidth = this.container.offsetWidth;\n var danHeight = this.container.offsetHeight;\n var itemY = parseInt(danHeight / itemHeight);\n var danItemRight = function danItemRight(ele) {\n var eleWidth = ele.offsetWidth || parseInt(ele.style.width);\n var eleRight = ele.getBoundingClientRect().right || _this4.container.getBoundingClientRect().right + eleWidth;\n return _this4.container.getBoundingClientRect().right - eleRight;\n };\n var danSpeed = function danSpeed(width) {\n return (danWidth + width) / 5;\n };\n var getTunnel = function getTunnel(ele, type, width) {\n var tmp = danWidth / danSpeed(width);\n var _loop = function _loop(i) {\n var item = _this4.danTunnel[type][i + ''];\n if (item && item.length) {\n if (type !== 'right') {\n return 'continue';\n }\n for (var j = 0; j < item.length; j++) {\n var danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(parseInt(item[j].style.width)) || 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 { v: i % itemY };\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 { v: i % itemY };\n }\n };\n for (var i = 0;; i++) {\n var _ret = _loop(i);\n switch (_ret) {\n case 'continue':\n continue;\n default:\n if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === 'object')\n return _ret.v;\n }\n }\n };\n if (Object.prototype.toString.call(dan) !== '[object Array]') {\n dan = [dan];\n }\n var docFragment = document.createDocumentFragment();\n var _loop2 = function _loop2(i) {\n if (!dan[i].type) {\n dan[i].type = 'right';\n }\n if (!dan[i].color) {\n dan[i].color = '#fff';\n }\n var item = document.createElement('div');\n item.classList.add('dplayer-danmaku-item');\n item.classList.add('dplayer-danmaku-' + dan[i].type);\n if (dan[i].border) {\n item.innerHTML = '' + dan[i].text + '';\n } else {\n item.innerHTML = dan[i].text;\n }\n item.style.opacity = _this4._opacity;\n item.style.color = dan[i].color;\n item.addEventListener('animationend', function () {\n _this4.container.removeChild(item);\n });\n var itemWidth = _this4._measure(dan[i].text);\n switch (dan[i].type) {\n case 'right':\n item.style.width = itemWidth + 1 + 'px';\n item.style.top = itemHeight * getTunnel(item, dan[i].type, itemWidth) + 'px';\n item.style.transform = 'translateX(-' + danWidth + 'px)';\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, dan[i].type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, dan[i].type) + 'px';\n break;\n default:\n console.error('Can\\'t handled danmaku type: ' + dan[i].type);\n }\n item.classList.add('dplayer-danmaku-move');\n docFragment.appendChild(item);\n };\n for (var i = 0; i < dan.length; i++) {\n _loop2(i);\n }\n this.container.appendChild(docFragment);\n return docFragment;\n }\n },\n {\n key: 'play',\n value: function play() {\n this.paused = false;\n }\n },\n {\n key: 'pause',\n value: function pause() {\n this.paused = true;\n }\n },\n {\n key: '_measure',\n value: function _measure(text) {\n if (!this.context) {\n var measureStyle = getComputedStyle(this.container.getElementsByClassName('dplayer-danmaku-item')[0], null);\n this.context = document.createElement('canvas').getContext('2d');\n this.context.font = measureStyle.getPropertyValue('font');\n }\n return this.context.measureText(text).width;\n }\n },\n {\n key: 'seek',\n value: function seek() {\n for (var i = 0; i < this.dan.length; i++) {\n if (this.dan[i].time >= this.options.time()) {\n this.danIndex = i;\n break;\n }\n this.danIndex = this.dan.length;\n }\n }\n },\n {\n key: 'clear',\n value: function clear() {\n this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.danIndex = 0;\n this.options.container.innerHTML = '';\n }\n },\n {\n key: 'htmlEncode',\n value: function htmlEncode(str) {\n return str.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/'/g, ''').replace(/\\//g, '/');\n }\n },\n {\n key: 'resize',\n value: function resize() {\n var danWidth = this.container.offsetWidth;\n var items = this.container.getElementsByClassName('dplayer-danmaku-item');\n for (var i = 0; i < items.length; i++) {\n items[i].style.transform = 'translateX(-' + danWidth + 'px)';\n }\n }\n },\n {\n key: 'hide',\n value: function hide() {\n this.showing = false;\n this.pause();\n this.clear();\n }\n },\n {\n key: 'show',\n value: function show() {\n this.seek();\n this.showing = true;\n this.play();\n }\n }\n ]);\n return Danmaku;\n}();\nmodule.exports = Danmaku;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/danmaku.js\n// module id = 9\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/src/DPlayer.js b/src/DPlayer.js index a09f916..f15ac3d 100644 --- a/src/DPlayer.js +++ b/src/DPlayer.js @@ -1104,7 +1104,6 @@ class DPlayer { const px = cumulativeOffset(pbar).left; const tx = clientX - px; const time = this.video.duration * (tx / pbar.offsetWidth); - timeTips.innerText = utils.secondToTime(time); timeTips.style.left = `${(tx - 20)}px`; this.previewWrapper.style.left = `${(tx - this.previewWrapper.offsetWidth / 2)}px`; @@ -1113,10 +1112,16 @@ class DPlayer { case 'mouseover': case 'mousemove': this.isMouseHoverPbar = true; - this.setPreviewSourceAndFrame({ - url: this.video.src, - time - }); + if (this.previewTime !== parseInt(time)) { + timeTips.innerText = utils.secondToTime(time); + this.previewTime = parseInt(time); + this.setPreview && clearTimeout(this.setPreview); + this.setPreview = setTimeout(() => { + this.setPreviewSourceAndFrame({ + time: parseInt(time) + }); + }, 500); + } this.timeTipsDisplay(true, timeTips); break; case 'mouseleave': @@ -1146,11 +1151,11 @@ class DPlayer { } initVideoPreview () { - this.previewVideo = document.createElement("video"); + this.previewVideo = document.createElement('video'); this.previewWrapper = this.element.getElementsByClassName('dplayer-bar-preview')[0]; this.previewCanvas = this.element.getElementsByClassName('dplayer-bar-preview-canvas')[0]; - this.previewVideo.preload = 'auto'; + this.previewVideo.preload = 'metadata'; const resize = () => { const w = this.element.offsetWidth / 4; const h = this.element.offsetHeight / 4;