diff --git a/dist/DPlayer.min.js b/dist/DPlayer.min.js index 74a738c9a..dafde4659 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(a){if(n[a])return n[a].exports;var i=n[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=1)}([function(e,t,n){"use strict";var a={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,n){"use strict";console.log("%c DPlayer 1.5.1 %c http://dplayer.js.org ","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;"),e.exports=n(2)},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s="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},l=function(){function e(e,t){for(var n=0;n0?t:0,t=t<1?t:1,y[e+"Bar"].style[n]=100*t+"%"};var a=["play","pause","canplay","playing","ended","error"];this.event={};for(var s=0;sL+.01&&!n.video.attr("paused")&&(n.element.classList.remove("dplayer-loading"),x=!1),L=E},100)},q=function(){clearInterval(n.checkLoading)};this.animationFrame=function(){if(n.playedTime&&(n.updateBar("played",n.video.currentTime()/n.video.duration,"width"),n.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=d.default.secondToTime(n.video.currentTime()),n.trigger("playing")),n.danmakuTime&&n.option.danmaku&&Q&&n.dan){for(var e=n.dan[n.danIndex],t=[];e&&n.video.currentTime()>parseFloat(e.time);)t.push(e),e=n.dan[++n.danIndex];n.pushDanmaku(t)}window.requestAnimationFrame(n.animationFrame)},window.requestAnimationFrame(this.animationFrame),this.setTime=function(e){e?(n[e+"Time"]=!0,"played"===e&&T()):(n.danmakuTime=!0,n.playedTime=!0,T())},this.clearTime=function(e){e?(n[e+"Time"]=!1,"played"===e&&q()):(n.danmakuTime=!1,n.playedTime=!1,q())},f.addEventListener("click",function(e){var t=e||window.event;w=f.clientWidth;var a=(t.clientX-d.default.getElementViewLeft(f))/w;a=a>0?a:0,a=a<1?a:1,n.updateBar("played",a,"width"),n.video.seek(parseFloat(y.playedBar.style.width)/100*n.video.duration)}),this.isTipsShow=!1,this.timeTipsHandler=this.timeTipsHandler(f,b).bind(this),f.addEventListener("mousemove",this.timeTipsHandler),f.addEventListener("mouseover",this.timeTipsHandler),f.addEventListener("mouseenter",this.timeTipsHandler),f.addEventListener("mouseout",this.timeTipsHandler),f.addEventListener("mouseleave",this.timeTipsHandler);var B=function(e){var t=e||window.event,a=(t.clientX-d.default.getElementViewLeft(f))/w;a=a>0?a:0,a=a<1?a:1,n.updateBar("played",a,"width"),n.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=d.default.secondToTime(a*n.video.duration)},C=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",B),n.video.seek(parseFloat(y.playedBar.style.width)/100*n.video.duration),n.setTime()};f.addEventListener("mousedown",function(){w=f.clientWidth,n.clearTime(),document.addEventListener("mousemove",B),document.addEventListener("mouseup",C)}),y.volumeBar=this.element.getElementsByClassName("dplayer-volume-bar-inner")[0];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=n.element.getElementsByClassName("dplayer-volume-icon")[0];n.video.attr("volume")>=.8?e.innerHTML=(0,c.default)("volume-up"):n.video.attr("volume")>0?e.innerHTML=(0,c.default)("volume-down"):e.innerHTML=(0,c.default)("volume-off")};var D=function(e){var t=e||window.event,a=(t.clientX-d.default.getElementViewLeft(N)-5.5)/35;n.volume(a)},I=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",D),M.classList.remove("dplayer-volume-active")};z.addEventListener("click",function(e){var t=e||window.event,a=(t.clientX-d.default.getElementViewLeft(N)-5.5)/35;n.volume(a)}),z.addEventListener("mousedown",function(){document.addEventListener("mousemove",D),document.addEventListener("mouseup",I),M.classList.add("dplayer-volume-active")}),S.addEventListener("click",function(){n.video.attr("muted")?(n.video.attr("muted",!1),n.switchVolumeIcon(),n.updateBar("volume",n.video.attr("volume"),"width")):(n.video.attr("muted",!0),S.innerHTML=(0,c.default)("volume-off"),n.updateBar("volume",0,"width"))});var H=0;if(!o.isMobile){var F=function(){n.element.classList.remove("dplayer-hide-controller"),clearTimeout(H),H=setTimeout(function(){n.video.attr("played").length&&(n.element.classList.add("dplayer-hide-controller"),R(),le())},2e3)};this.element.addEventListener("mousemove",F),this.element.addEventListener("click",F)}this.danOpacity=localStorage.getItem("DPlayer-opacity")||.7;var P=h.default.setting(this.tran),A=this.element.getElementsByClassName("dplayer-setting-icon")[0],O=this.element.getElementsByClassName("dplayer-setting-box")[0],V=this.element.getElementsByClassName("dplayer-mask")[0];O.innerHTML=P.original;var R=function(){O.classList.contains("dplayer-setting-box-open")&&(O.classList.remove("dplayer-setting-box-open"),V.classList.remove("dplayer-mask-show"),setTimeout(function(){O.classList.remove("dplayer-setting-box-narrow"),O.innerHTML=P.original,W()},300))},j=function(){O.classList.add("dplayer-setting-box-open"),V.classList.add("dplayer-mask-show")};V.addEventListener("click",function(){R()}),A.addEventListener("click",function(){j()}),this.loop=this.option.loop;var X=this.element.getElementsByClassName("dplayer-danmaku")[0],Q=!0,W=function(){var e=n.element.getElementsByClassName("dplayer-setting-loop")[0],t=e.getElementsByClassName("dplayer-toggle-setting-input")[0];t.checked=n.loop,e.addEventListener("click",function(){t.checked=!t.checked,t.checked?n.loop=!0:n.loop=!1,R()});var a=n.element.getElementsByClassName("dplayer-setting-showdan")[0],i=a.getElementsByClassName("dplayer-showdan-setting-input")[0];if(i.checked=Q,a.addEventListener("click",function(){if(i.checked=!i.checked,i.checked){if(Q=!0,n.option.danmaku){for(var e=0;e=n.video.currentTime()){n.danIndex=e;break}n.danIndex=n.dan.length}n.paused||n.setTime("danmaku")}}else Q=!1,n.option.danmaku&&(n.clearTime("danmaku"),X.innerHTML="",n.danTunnel={right:{},top:{},bottom:{}});R()}),n.element.getElementsByClassName("dplayer-setting-speed")[0].addEventListener("click",function(){O.classList.add("dplayer-setting-box-narrow"),O.innerHTML=P.speed;for(var e=O.getElementsByClassName("dplayer-setting-speed-item"),t=0;t0?a:0,a=a<1?a:1,n.updateBar("danmaku",a,"width");for(var i=n.element.getElementsByClassName("dplayer-danmaku-item"),s=0;s0?a:0,a=a<1?a:1,n.updateBar("danmaku",a,"width");for(var i=n.element.getElementsByClassName("dplayer-danmaku-item"),s=0;s/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},te=function(){if($.blur(),!$.value.replace(/^\s+|\s+$/g,""))return void n.notice(n.tran("Please input danmaku content!"));var e={token:n.option.danmaku.token,player:n.option.danmaku.id,author:n.option.danmaku.user,time:n.video.currentTime(),text:$.value,color:n.element.querySelector(".dplayer-comment-setting-color input:checked").value,type:n.element.querySelector(".dplayer-comment-setting-type input:checked").value};n.option.apiBackend.send(n.option.danmaku.api,e),$.value="",le(),n.dan.splice(n.danIndex,0,e),n.danIndex++;var t={text:ee(e.text),color:e.color,type:e.type,border:"2px solid "+n.option.theme};n.pushDanmaku(t)},ne=function(){K.classList.contains("dplayer-comment-setting-open")&&K.classList.remove("dplayer-comment-setting-open")},ae=function(){K.classList.contains("dplayer-comment-setting-open")?K.classList.remove("dplayer-comment-setting-open"):K.classList.add("dplayer-comment-setting-open")},ie=0,se=0,le=function(){J.classList.contains("dplayer-comment-box-open")&&(J.classList.remove("dplayer-comment-box-open"),V.classList.remove("dplayer-mask-show"),n.element.classList.remove("dplayer-show-controller"),clearInterval(ie),clearTimeout(se),ne())},oe=function(){J.classList.contains("dplayer-comment-box-open")||(J.classList.add("dplayer-comment-box-open"),V.classList.add("dplayer-mask-show"),n.element.classList.add("dplayer-show-controller"),ie=setInterval(function(){clearTimeout(H)},1e3),se=setTimeout(function(){$.focus()},300))};V.addEventListener("click",function(){le()}),U.addEventListener("click",function(){oe()}),G.addEventListener("click",function(){ae()}),this.element.getElementsByClassName("dplayer-comment-setting-color")[0].addEventListener("click",function(){n.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked+span')&&(G.getElementsByClassName("dplayer-fill")[0].style.fill=n.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked').value)}),$.addEventListener("click",function(){ne()}),$.addEventListener("keydown",function(e){13===(e||window.event).keyCode&&te()}),Z.addEventListener("click",te);var de=function(){for(var e=X.offsetWidth,t=n.element.getElementsByClassName("dplayer-danmaku-item"),a=0;a=a.width?(ce.style.right=a.width-i+"px",ce.style.left="initial"):(ce.style.left=t.clientX-n.element.getBoundingClientRect().left+"px",ce.style.right="initial"),s+ce.offsetHeight>=a.height?(ce.style.bottom=a.height-s+"px",ce.style.top="initial"):(ce.style.top=t.clientY-n.element.getBoundingClientRect().top+"px",ce.style.bottom="initial"),V.classList.add("dplayer-mask-show"),V.addEventListener("click",function(){V.classList.remove("dplayer-mask-show"),ce.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")&&n.switchQuality(e.target.dataset.index)}),this.option.screenshot){var ue=this.element.getElementsByClassName("dplayer-camera-icon")[0];ue.addEventListener("click",function(){var e=document.createElement("canvas");e.width=n.video.attr("videoWidth"),e.height=n.video.attr("videoHeight"),e.getContext("2d").drawImage(n.video.current,0,0,e.width,e.height),ue.href=e.toDataURL(),ue.download="DPlayer.png"})}k++}return l(e,[{key:"play",value:function(e){"[object Number]"===Object.prototype.toString.call(e)&&this.video.seek(e),this.paused=!1,this.video.attr("paused")&&(this.bezel.innerHTML=(0,c.default)("play"),this.bezel.classList.add("dplayer-bezel-transition")),this.playButton.innerHTML=(0,c.default)("pause"),this.video.play(),this.setTime(),this.element.classList.add("dplayer-playing"),this.trigger("play")}},{key:"pause",value:function(){this.paused=!0,this.element.classList.remove("dplayer-loading"),this.video.attr("paused")||(this.bezel.innerHTML=(0,c.default)("pause"),this.bezel.classList.add("dplayer-bezel-transition")),this.ended=!1,this.playButton.innerHTML=(0,c.default)("play"),this.video.pause(),this.clearTime(),this.element.classList.remove("dplayer-playing"),this.trigger("pause")}},{key:"volume",value:function(e){e=e>0?e:0,e=e<1?e:1,this.updateBar("volume",e,"width"),this.video.attr("volume",e),this.video.attr("muted")&&this.video.attr("muted",!1),this.switchVolumeIcon()}},{key:"toggle",value:function(){this.video.attr("paused")?this.play():this.pause()}},{key:"on",value:function(e,t){"function"==typeof t&&this.event[e].push(t)}},{key:"_readAllEndpoints",value:function(e,t){for(var n=this,a=[],i=0,s=0;s=e.video.currentTime())return void(e.danIndex=t);e.danIndex=e.dan.length}}),this.video.on("all","durationchange",function(t,n){1!==n.duration&&(e.element.getElementsByClassName("dplayer-dtime")[0].innerHTML=d.default.secondToTime(e.video.duration))}),this.video.on("current","progress",function(t,n){var a=n.buffered.length?n.buffered.end(n.buffered.length-1)/n.duration:0;e.updateBar("loaded",a,"width")}),this.video.on("all","error",function(){e.notice(e.tran("This video fails to load"),-1),e.trigger("pause")}),this.video.on("current","canplay",function(){e.trigger("canplay")}),this.ended=!1,this.video.on("all","ended",function(t){t===e.video.videos.length-1&&(e.updateBar("played",1,"width"),e.loop?(e.video.switch(0),e.video.play()):(e.ended=!0,e.pause(),e.trigger("ended")),e.danIndex=0)}),this.video.on("current","play",function(){e.paused&&e.play()}),this.video.on("current","pause",function(){e.paused||e.pause()}),this.video.attr("volume",parseInt(this.element.getElementsByClassName("dplayer-volume-bar-inner")[0].style.width)/100)}},{key:"switchQuality",value:function(e){var t=this;if(this.qualityIndex!==e&&!this.switchingQuality){this.qualityIndex=e,this.switchingQuality=!0,this.quality=this.option.video.quality[e],this.element.getElementsByClassName("dplayer-quality-icon")[0].innerHTML=this.quality.name,this.video.pause();var n=h.default.video(!1,null,this.option.screenshot,"auto",this.quality.url),a=(new DOMParser).parseFromString(n,"text/html").body.firstChild,i=this.element.getElementsByClassName("dplayer-video-wrap")[0];i.insertBefore(a,i.getElementsByTagName("div")[0]),this.prevVideo=this.video,this.video=new g.default([a],this.prevVideo.duration),this.initVideo(),this.video.seek(this.prevVideo.currentTime()),this.notice(this.tran("Switching to")+" "+this.quality.name+" "+this.tran("quality"),-1),this.video.on("current","canplay",function(){if(t.prevVideo){if(t.video.currentTime()!==t.prevVideo.currentTime())return void t.video.seek(t.prevVideo.currentTime());i.removeChild(t.prevVideo.current),t.video.current.classList.add("dplayer-video-current"),t.video.play(),t.prevVideo=null,t.notice(t.tran("Switched to")+" "+t.quality.name+" "+t.tran("quality")),t.switchingQuality=!1}})}}},{key:"timeTipsHandler",value:function(e,t){var n=this,a=function(e){var t=0,n=0;do{t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:n}};return function(i){if(n.video.duration){var s=i.clientX,l=a(e).left,o=s-l;switch(t.innerText=d.default.secondToTime(n.video.duration*(o/e.offsetWidth)),t.style.left=o-20+"px",i.type){case"mouseenter":case"mouseover":case"mousemove":if(n.isTipsShow)return;t.classList.remove("hidden"),n.isTipsShow=!0;break;case"mouseleave":case"mouseout":if(!n.isTipsShow)return;t.classList.add("hidden"),n.isTipsShow=!1}}}}},{key:"notice",value:function(e,t){var n=this.element.getElementsByClassName("dplayer-notice")[0];n.innerHTML=e,n.style.opacity=1,this.noticeTime&&clearTimeout(this.noticeTime),t&&t<0||(this.noticeTime=setTimeout(function(){n.style.opacity=0},t||2e3))}}]),e}();e.exports=b},function(e,t){},function(e,t,n){"use strict";e.exports={secondToTime:function(e){var t=function(e){return e<10?"0"+e:""+e},n=parseInt(e/60),a=parseInt(e-60*n);return t(n)+":"+t(a)},getElementViewLeft:function(e){var t=e.offsetLeft,n=e.offsetParent,a=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==n&&n!==e;)t+=n.offsetLeft,n=n.offsetParent;else for(;null!==n;)t+=n.offsetLeft,n=n.offsetParent;return t-a},isMobile:/mobile/i.test(window.navigator.userAgent)}},function(e,t,n){"use strict";var a=n(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",apiBackend:a,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 n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n]);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,n){"use strict";var a=function(e,t,n,a,i){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(4===s.readyState){if(s.status>=200&&s.status<300||304===s.status){var e=JSON.parse(s.responseText);return 1!==e.code?a(s,e):n(s,e)}i(s)}},s.open(null!==t?"POST":"GET",e,!0),s.send(null!==t?JSON.stringify(t):null)};e.exports={send:function(e,t){a(e,t,function(e,t){console.log("Post danmaku: ",t)},function(e,t){alert(t.msg)},function(e){console.log("Request was unsuccessful: "+e.status)})},read:function(e,t){a(e,null,function(e,n){t(null,n.danmaku)},function(e,n){t({status:e.status,response:n})},function(e){t({status:e.status,response:null})})}}},function(e,t,n){"use strict";var a={"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"};e.exports=function(e){var t=this;this.lang=e,this.tran=function(e){return"en"===t.lang?e:"zh"===t.lang?a[e]:void 0}}},function(e,t,n){"use strict";var a=n(0),i={main:function(e,t,n){for(var s="",l=0;l
'+s+(e.logo?'':"")+'
'+(e.danmaku?''+n("Danmaku is loading")+"":"")+'
0:00 / 0:00
'+(e.video.quality?'
'+i.qualityList(e.video.quality)+"
":"")+(e.screenshot?''+a("camera")+"":"")+'
'+n("Set danmaku color")+'
'+n("Set danmaku type")+'
'+i.contextmenuList(e.contextmenu)+'
'},contextmenuList:function(e){for(var t='";return t+=""},qualityList:function(e){for(var t='
',n=0;n'+e[n].name+"
";return t+=""},video:function(e,t,n,a,i){return''},setting:function(e){return{original:'
'+e("Speed")+'
'+a("right")+'
'+e("Loop")+'
'+e("Danmaku")+'
'+e("Opacity for danmaku")+'
',speed:'
0.5
0.75
'+e("Normal")+'
1.25
1.5
2
'}}};e.exports=i},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n1,this.index=0,this.current=this.videos[this.index],this.duration=n||0,this.durationArr=[],this.eventAll=[],this.eventCurrent=[],this.on("all","durationchange",function(e,t){1!==t.duration&&(i.durationArr[e]=t.duration,n||(i.duration=i.durationArr.reduce(function(e,t){return e+t})))}),this.on("current","end",function(){i.switch(i.index+1)})}return i(e,[{key:"switch",value:function(e,t){this.index!==e?(this.videos[e].classList.add("dplayer-video-current"),this.current.paused||this.videos[e].play(),this.current.classList.remove("dplayer-video-current"),this.current.pause(),this.index=e,this.current=this.videos[this.index],this.videos[e].currentTime=t||0):this.videos[e].currentTime=t||0}},{key:"on",value:function(e,t,n){var a=this;if("function"==typeof n&&("all"===e?(this.eventAll[t]||(this.eventAll[t]=[]),this.eventAll[t].push(n)):(this.eventCurrent[t]||(this.eventCurrent[t]=[]),this.eventCurrent[t].push(n)),-1===["seeking"].indexOf(t)))for(var i=0;i\n'}},function(e,t,n){"use strict";console.log("%c DPlayer 1.5.2 %c http://dplayer.js.org ","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;"),e.exports=n(2)},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s="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},l=function(){function e(e,t){for(var n=0;n0?t:0,t=t<1?t:1,y[e+"Bar"].style[n]=100*t+"%"};var a=["play","pause","canplay","playing","ended","error"];this.event={};for(var s=0;sw+.01&&!n.video.paused&&(n.element.classList.remove("dplayer-loading"),E=!1),w=L},100)},T=function(){clearInterval(n.checkLoading)};this.animationFrame=function(){if(n.playedTime&&(n.updateBar("played",n.video.currentTime/n.video.duration,"width"),n.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=o.default.secondToTime(n.video.currentTime),n.trigger("playing")),n.danmakuTime&&n.option.danmaku&&X&&n.dan){for(var e=n.dan[n.danIndex],t=[];e&&n.video.currentTime>parseFloat(e.time);)t.push(e),e=n.dan[++n.danIndex];n.pushDanmaku(t)}window.requestAnimationFrame(n.animationFrame)},window.requestAnimationFrame(this.animationFrame),this.setTime=function(e){e?(n[e+"Time"]=!0,"played"===e&&x()):(n.danmakuTime=!0,n.playedTime=!0,x())},this.clearTime=function(e){e?(n[e+"Time"]=!1,"played"===e&&T()):(n.danmakuTime=!1,n.playedTime=!1,T())},g.addEventListener("click",function(e){var t=e||window.event;b=g.clientWidth;var a=(t.clientX-o.default.getElementViewLeft(g))/b;a=a>0?a:0,a=a<1?a:1,n.updateBar("played",a,"width"),n.seek(parseFloat(y.playedBar.style.width)/100*n.video.duration)}),this.isTipsShow=!1,this.timeTipsHandler=this.timeTipsHandler(g,k).bind(this),g.addEventListener("mousemove",this.timeTipsHandler),g.addEventListener("mouseover",this.timeTipsHandler),g.addEventListener("mouseenter",this.timeTipsHandler),g.addEventListener("mouseout",this.timeTipsHandler),g.addEventListener("mouseleave",this.timeTipsHandler);var q=function(e){var t=e||window.event,a=(t.clientX-o.default.getElementViewLeft(g))/b;a=a>0?a:0,a=a<1?a:1,n.updateBar("played",a,"width"),n.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=o.default.secondToTime(a*n.video.duration)},B=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",q),n.seek(parseFloat(y.playedBar.style.width)/100*n.video.duration),n.setTime()};g.addEventListener("mousedown",function(){b=g.clientWidth,n.clearTime(),document.addEventListener("mousemove",q),document.addEventListener("mouseup",B)}),y.volumeBar=this.element.getElementsByClassName("dplayer-volume-bar-inner")[0];var C=this.element.getElementsByClassName("dplayer-volume")[0],M=this.element.getElementsByClassName("dplayer-volume-bar-wrap")[0],z=this.element.getElementsByClassName("dplayer-volume-bar")[0],N=this.element.getElementsByClassName("dplayer-volume-icon")[0];this.switchVolumeIcon=function(){var e=n.element.getElementsByClassName("dplayer-volume-icon")[0];n.video.volume>=.8?e.innerHTML=(0,c.default)("volume-up"):n.video.volume>0?e.innerHTML=(0,c.default)("volume-down"):e.innerHTML=(0,c.default)("volume-off")};var S=function(e){var t=e||window.event,a=(t.clientX-o.default.getElementViewLeft(z)-5.5)/35;n.volume(a)},D=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",S),C.classList.remove("dplayer-volume-active")};M.addEventListener("click",function(e){var t=e||window.event,a=(t.clientX-o.default.getElementViewLeft(z)-5.5)/35;n.volume(a)}),M.addEventListener("mousedown",function(){document.addEventListener("mousemove",S),document.addEventListener("mouseup",D),C.classList.add("dplayer-volume-active")}),N.addEventListener("click",function(){n.video.muted?(n.video.muted=!1,n.switchVolumeIcon(),n.updateBar("volume",n.video.volume,"width")):(n.video.muted=!0,N.innerHTML=(0,c.default)("volume-off"),n.updateBar("volume",0,"width"))});var I=0;if(!d.isMobile){var H=function(){n.element.classList.remove("dplayer-hide-controller"),clearTimeout(I),I=setTimeout(function(){n.video.played.length&&(n.element.classList.add("dplayer-hide-controller"),R(),se())},2e3)};this.element.addEventListener("mousemove",H),this.element.addEventListener("click",H)}this.danOpacity=localStorage.getItem("DPlayer-opacity")||.7;var F=h.default.setting(this.tran),P=this.element.getElementsByClassName("dplayer-setting-icon")[0],O=this.element.getElementsByClassName("dplayer-setting-box")[0],V=this.element.getElementsByClassName("dplayer-mask")[0];O.innerHTML=F.original;var R=function(){O.classList.contains("dplayer-setting-box-open")&&(O.classList.remove("dplayer-setting-box-open"),V.classList.remove("dplayer-mask-show"),setTimeout(function(){O.classList.remove("dplayer-setting-box-narrow"),O.innerHTML=F.original,Q()},300))},A=function(){O.classList.add("dplayer-setting-box-open"),V.classList.add("dplayer-mask-show")};V.addEventListener("click",function(){R()}),P.addEventListener("click",function(){A()}),this.loop=this.option.loop;var j=this.element.getElementsByClassName("dplayer-danmaku")[0],X=!0,Q=function(){var e=n.element.getElementsByClassName("dplayer-setting-loop")[0],t=e.getElementsByClassName("dplayer-toggle-setting-input")[0];t.checked=n.loop,e.addEventListener("click",function(){t.checked=!t.checked,t.checked?n.loop=!0:n.loop=!1,R()});var a=n.element.getElementsByClassName("dplayer-setting-showdan")[0],i=a.getElementsByClassName("dplayer-showdan-setting-input")[0];if(i.checked=X,a.addEventListener("click",function(){if(i.checked=!i.checked,i.checked){if(X=!0,n.option.danmaku){for(var e=0;e=n.video.currentTime){n.danIndex=e;break}n.danIndex=n.dan.length}n.paused||n.setTime("danmaku")}}else X=!1,n.option.danmaku&&(n.clearTime("danmaku"),j.innerHTML="",n.danTunnel={right:{},top:{},bottom:{}});R()}),n.element.getElementsByClassName("dplayer-setting-speed")[0].addEventListener("click",function(){O.classList.add("dplayer-setting-box-narrow"),O.innerHTML=F.speed;for(var e=O.getElementsByClassName("dplayer-setting-speed-item"),t=0;t0?a:0,a=a<1?a:1,n.updateBar("danmaku",a,"width");for(var i=n.element.getElementsByClassName("dplayer-danmaku-item"),s=0;s0?a:0,a=a<1?a:1,n.updateBar("danmaku",a,"width");for(var i=n.element.getElementsByClassName("dplayer-danmaku-item"),s=0;s/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},ee=function(){if(Y.blur(),!Y.value.replace(/^\s+|\s+$/g,""))return void n.notice(n.tran("Please input danmaku content!"));var e={token:n.option.danmaku.token,player:n.option.danmaku.id,author:n.option.danmaku.user,time:n.video.currentTime,text:Y.value,color:n.element.querySelector(".dplayer-comment-setting-color input:checked").value,type:n.element.querySelector(".dplayer-comment-setting-type input:checked").value};n.option.apiBackend.send(n.option.danmaku.api,e),Y.value="",se(),n.dan.splice(n.danIndex,0,e),n.danIndex++;var t={text:Z(e.text),color:e.color,type:e.type,border:"2px solid "+n.option.theme};n.pushDanmaku(t)},te=function(){G.classList.contains("dplayer-comment-setting-open")&&G.classList.remove("dplayer-comment-setting-open")},ne=function(){G.classList.contains("dplayer-comment-setting-open")?G.classList.remove("dplayer-comment-setting-open"):G.classList.add("dplayer-comment-setting-open")},ae=0,ie=0,se=function(){U.classList.contains("dplayer-comment-box-open")&&(U.classList.remove("dplayer-comment-box-open"),V.classList.remove("dplayer-mask-show"),n.element.classList.remove("dplayer-show-controller"),clearInterval(ae),clearTimeout(ie),te())},le=function(){U.classList.contains("dplayer-comment-box-open")||(U.classList.add("dplayer-comment-box-open"),V.classList.add("dplayer-mask-show"),n.element.classList.add("dplayer-show-controller"),ae=setInterval(function(){clearTimeout(I)},1e3),ie=setTimeout(function(){Y.focus()},300))};V.addEventListener("click",function(){se()}),$.addEventListener("click",function(){le()}),J.addEventListener("click",function(){ne()}),this.element.getElementsByClassName("dplayer-comment-setting-color")[0].addEventListener("click",function(){n.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked+span')&&(J.getElementsByClassName("dplayer-fill")[0].style.fill=n.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked').value)}),Y.addEventListener("click",function(){te()}),Y.addEventListener("keydown",function(e){13===(e||window.event).keyCode&&ee()}),K.addEventListener("click",ee);var de=function(){for(var e=j.offsetWidth,t=n.element.getElementsByClassName("dplayer-danmaku-item"),a=0;a=a.width?(re.style.right=a.width-i+"px",re.style.left="initial"):(re.style.left=t.clientX-n.element.getBoundingClientRect().left+"px",re.style.right="initial"),s+re.offsetHeight>=a.height?(re.style.bottom=a.height-s+"px",re.style.top="initial"):(re.style.top=t.clientY-n.element.getBoundingClientRect().top+"px",re.style.bottom="initial"),V.classList.add("dplayer-mask-show"),V.addEventListener("click",function(){V.classList.remove("dplayer-mask-show"),re.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")&&n.switchQuality(e.target.dataset.index)}),this.option.screenshot){var ce=this.element.getElementsByClassName("dplayer-camera-icon")[0];ce.addEventListener("click",function(){var e=document.createElement("canvas");e.width=n.video.videoWidth,e.height=n.video.videoHeight,e.getContext("2d").drawImage(n.video,0,0,e.width,e.height),ce.href=e.toDataURL(),ce.download="DPlayer.png"})}f++}return l(e,[{key:"seek",value:function(e){e=Math.max(e,0),this.video.duration&&(e=Math.min(e,this.video.duration)),this.video.currentTime=e}},{key:"play",value:function(){this.paused=!1,this.video.paused&&(this.bezel.innerHTML=(0,c.default)("play"),this.bezel.classList.add("dplayer-bezel-transition")),this.playButton.innerHTML=(0,c.default)("pause"),this.video.play(),this.setTime(),this.element.classList.add("dplayer-playing"),this.trigger("play")}},{key:"pause",value:function(){this.paused=!0,this.element.classList.remove("dplayer-loading"),this.video.paused||(this.bezel.innerHTML=(0,c.default)("pause"),this.bezel.classList.add("dplayer-bezel-transition")),this.ended=!1,this.playButton.innerHTML=(0,c.default)("play"),this.video.pause(),this.clearTime(),this.element.classList.remove("dplayer-playing"),this.trigger("pause")}},{key:"volume",value:function(e){e=e>0?e:0,e=e<1?e:1,this.updateBar("volume",e,"width"),this.video.volume=e,this.video.muted&&(this.video.muted=!1),this.switchVolumeIcon()}},{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:"_readAllEndpoints",value:function(e,t){for(var n=this,a=[],i=0,s=0;s=e.video.currentTime)return void(e.danIndex=t);e.danIndex=e.dan.length}}),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.notice(e.tran("This video fails to load"),-1),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.danIndex=0}),this.video.addEventListener("play",function(){e.paused&&e.play()}),this.video.addEventListener("pause",function(){e.paused||e.pause()}),this.video.volume=parseInt(this.element.getElementsByClassName("dplayer-volume-bar-inner")[0].style.width)/100}},{key:"switchQuality",value:function(e){var t=this;if(this.qualityIndex!==e&&!this.switchingQuality){this.qualityIndex=e,this.switchingQuality=!0,this.quality=this.option.video.quality[e],this.element.getElementsByClassName("dplayer-quality-icon")[0].innerHTML=this.quality.name;var n=this.video.paused;this.video.pause();var a=h.default.video(!1,null,this.option.screenshot,"auto",this.quality.url),i=(new DOMParser).parseFromString(a,"text/html").body.firstChild,s=this.element.getElementsByClassName("dplayer-video-wrap")[0];s.insertBefore(i,s.getElementsByTagName("div")[0]),this.prevVideo=this.video,this.video=i,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"),n||t.video.play(),t.prevVideo=null,t.notice(t.tran("Switched to")+" "+t.quality.name+" "+t.tran("quality")),t.switchingQuality=!1}})}}},{key:"timeTipsHandler",value:function(e,t){var n=this,a=function(e){var t=0,n=0;do{t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:n}};return function(i){if(n.video.duration){var s=i.clientX,l=a(e).left,d=s-l;switch(t.innerText=o.default.secondToTime(n.video.duration*(d/e.offsetWidth)),t.style.left=d-20+"px",i.type){case"mouseenter":case"mouseover":case"mousemove":if(n.isTipsShow)return;t.classList.remove("hidden"),n.isTipsShow=!0;break;case"mouseleave":case"mouseout":if(!n.isTipsShow)return;t.classList.add("hidden"),n.isTipsShow=!1}}}}},{key:"notice",value:function(e,t){var n=this.element.getElementsByClassName("dplayer-notice")[0];n.innerHTML=e,n.style.opacity=1,this.noticeTime&&clearTimeout(this.noticeTime),t&&t<0||(this.noticeTime=setTimeout(function(){n.style.opacity=0},t||2e3))}}]),e}();e.exports=g},function(e,t){},function(e,t,n){"use strict";e.exports={secondToTime:function(e){var t=function(e){return e<10?"0"+e:""+e},n=parseInt(e/60),a=parseInt(e-60*n);return t(n)+":"+t(a)},getElementViewLeft:function(e){var t=e.offsetLeft,n=e.offsetParent,a=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==n&&n!==e;)t+=n.offsetLeft,n=n.offsetParent;else for(;null!==n;)t+=n.offsetLeft,n=n.offsetParent;return t-a},isMobile:/mobile/i.test(window.navigator.userAgent)}},function(e,t,n){"use strict";var a=n(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",apiBackend:a,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 n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n]);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,n){"use strict";var a=function(e,t,n,a,i){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(4===s.readyState){if(s.status>=200&&s.status<300||304===s.status){var e=JSON.parse(s.responseText);return 1!==e.code?a(s,e):n(s,e)}i(s)}},s.open(null!==t?"POST":"GET",e,!0),s.send(null!==t?JSON.stringify(t):null)};e.exports={send:function(e,t){a(e,t,function(e,t){console.log("Post danmaku: ",t)},function(e,t){alert(t.msg)},function(e){console.log("Request was unsuccessful: "+e.status)})},read:function(e,t){a(e,null,function(e,n){t(null,n.danmaku)},function(e,n){t({status:e.status,response:n})},function(e){t({status:e.status,response:null})})}}},function(e,t,n){"use strict";var a={"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"};e.exports=function(e){var t=this;this.lang=e,this.tran=function(e){return"en"===t.lang?e:"zh"===t.lang?a[e]:void 0}}},function(e,t,n){"use strict";var a=n(0),i={main:function(e,t,n){for(var s="",l=0;l
'+s+(e.logo?'':"")+'
'+(e.danmaku?''+n("Danmaku is loading")+"":"")+'
0:00 / 0:00
'+(e.video.quality?'
'+i.qualityList(e.video.quality)+"
":"")+(e.screenshot?''+a("camera")+"":"")+'
'+n("Set danmaku color")+'
'+n("Set danmaku type")+'
'+i.contextmenuList(e.contextmenu)+'
'},contextmenuList:function(e){for(var t='";return t+=""},qualityList:function(e){for(var t='
',n=0;n'+e[n].name+"
";return t+=""},video:function(e,t,n,a,i){return''},setting:function(e){return{original:'
'+e("Speed")+'
'+a("right")+'
'+e("Loop")+'
'+e("Danmaku")+'
'+e("Opacity for danmaku")+'
',speed:'
0.5
0.75
'+e("Normal")+'
1.25
1.5
2
'}}};e.exports=i}])}); //# sourceMappingURL=DPlayer.min.js.map \ No newline at end of file diff --git a/dist/DPlayer.min.js.map b/dist/DPlayer.min.js.map index 08d94b869..bed29a25c 100644 --- a/dist/DPlayer.min.js.map +++ b/dist/DPlayer.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///DPlayer.min.js","webpack:///webpack/bootstrap 27bd43ac2f416b5e045b","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/video.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","_typeof","Symbol","iterator","constructor","_createClass","defineProperties","target","props","length","descriptor","writable","key","protoProps","staticProps","_utils","_utils2","_svg","_svg2","_option","_option2","_i18n","_i18n2","_html","_html2","_video","_video2","index","DPlayer","option","_this","element","classList","add","video","quality","qualityIndex","defaultQuality","tran","lang","updateBar","percentage","direction","bar","style","eventTypes","event","trigger","_i","danmaku","isMobile","innerHTML","main","arrow","offsetWidth","arrowStyle","document","createElement","head","appendChild","getElementsByClassName","initVideo","bezel","addEventListener","remove","playButton","paused","toggle","videoWrap","conMask","toggleController","contains","playedBar","loadedBar","pbar","pbarTimeTips","barWidth","lastPlayPos","currentPlayPos","bufferingDetected","danmakuTime","playedTime","window","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","callback","setTimeout","setCheckLoadingTime","checkLoading","setInterval","currentTime","attr","clearCheckLoadingTime","clearInterval","animationFrame","duration","secondToTime","showdan","dan","item","danIndex","danmakus","parseFloat","time","push","pushDanmaku","setTime","clearTime","e","clientWidth","clientX","getElementViewLeft","seek","width","isTipsShow","timeTipsHandler","bind","thumbMove","thumbUp","removeEventListener","volumeBar","volumeEle","volumeBarWrapWrap","volumeBarWrap","volumeicon","switchVolumeIcon","volumeMove","volume","volumeUp","hideTime","hideController","clearTimeout","closeSetting","closeComment","danOpacity","localStorage","getItem","settingHTML","settingIcon","settingBox","mask","original","settingEvent","openSetting","danContainer","loopEle","loopToggle","checked","showDanEle","showDanToggle","_i2","danTunnel","top","bottom","speed","speedItem","_i3","dataset","danmakuBar","danmakuBarWrapWrap","danmakuBarWrap","danmakuSettingBox","danmakuMove","items","_i4","opacity","setItem","danmakuUp","_i5","measureStyle","getComputedStyle","context","getContext","font","getPropertyValue","danmakuMeasure","text","measureText","readDanmaku","autoplay","commentInput","commentIcon","commentBox","commentSettingIcon","commentSettingBox","commentSendIcon","htmlEncode","str","replace","sendComment","blur","value","notice","danmakuData","token","player","id","author","user","color","querySelector","apiBackend","api","splice","border","theme","closeCommentSetting","toggleCommentSetting","disableHide","commentFocusTimeout","openComment","focus","fill","keyCode","resetAnimation","danWidth","_i6","transform","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","cancelFullScreen","mozCancelFullScreen","webkitCancelFullScreen","requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","current","webkitEnterFullscreen","handleKeyDown","tag","activeElement","tagName","toUpperCase","editable","getAttribute","preventDefault","hotkey","clientRect","getBoundingClientRect","menuLeft","left","menuTop","clientY","offsetHeight","height","switchQuality","screenshot","camareIcon","canvas","drawImage","href","toDataURL","download","toString","ended","endpoints","finish","_this2","results","readCount","read","err","data","response","msg","status","_this3","apiurl","maximum","addition","slice","_readAllEndpoints","concat","apply","sort","a","b","display","_this4","itemHeight","danHeight","itemY","parseInt","danItemRight","ele","eleWidth","eleRight","danSpeed","getTunnel","tmp","_ret2","v","j","danRight","docFragment","createDocumentFragment","removeChild","itemWidth","error","pic","url","danTuel","_this5","exec","Hls","isSupported","hls","loadSource","attachMedia","flvjs","flvPlayer","createPlayer","attachMediaElement","load","on","buffered","end","videos","switch","_this6","switchingQuality","videoHTML","videoEle","DOMParser","parseFromString","body","firstChild","parent","insertBefore","getElementsByTagName","prevVideo","timeTips","_this7","cumulativeOffset","offsetTop","offsetLeft","offsetParent","px","tx","innerText","noticeEle","noticeTime","second","add0","num","min","sec","actualLeft","elementScrollLeft","scrollLeft","documentElement","test","navigator","userAgent","defaultApiBackend","defaultOption","language","indexOf","preload","contextmenu","link","defaultKey","SendXMLHttpRequest","success","fail","xhr","XMLHttpRequest","onreadystatechange","readyState","JSON","parse","responseText","code","open","stringify","endpoint","alert","cbk","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","svg","html","logo","qualityList","contextmenuList","result","Video","multi","durationArr","eventAll","eventCurrent","reduce","sum","cur","events","Math","max","tmptime","undefined"],"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,EAA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A4B,OAAA5B,KAAA6B,YAIA+a,IAEA/c,GAAAD,QAAAgd","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('%c DPlayer ' + \"1.5.1\" + ' %c http://dplayer.js.org ', '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 _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}();\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 _video = __webpack_require__(9);\nvar _video2 = _interopRequireDefault(_video);\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 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 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 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 = new _video2.default(this.element.getElementsByClassName('dplayer-video-current'));\n this.initVideo();\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 bar = {};\n bar.playedBar = this.element.getElementsByClassName('dplayer-played')[0];\n bar.loadedBar = this.element.getElementsByClassName('dplayer-loaded')[0];\n var pbar = this.element.getElementsByClassName('dplayer-bar-wrap')[0];\n var pbarTimeTips = this.element.getElementsByClassName('dplayer-bar-time')[0];\n var barWidth = void 0;\n var lastPlayPos = 0;\n var currentPlayPos = 0;\n var bufferingDetected = false;\n this.danmakuTime = false;\n this.playedTime = 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.attr('paused')) {\n _this.element.classList.add('dplayer-loading');\n bufferingDetected = true;\n }\n if (bufferingDetected && currentPlayPos > lastPlayPos + 0.01 && !_this.video.attr('paused')) {\n _this.element.classList.remove('dplayer-loading');\n bufferingDetected = false;\n }\n lastPlayPos = currentPlayPos;\n }, 100);\n };\n var clearCheckLoadingTime = function clearCheckLoadingTime() {\n clearInterval(_this.checkLoading);\n };\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 if (_this.danmakuTime && _this.option.danmaku && showdan && _this.dan) {\n var item = _this.dan[_this.danIndex];\n var danmakus = [];\n while (item && _this.video.currentTime() > parseFloat(item.time)) {\n danmakus.push(item);\n item = _this.dan[++_this.danIndex];\n }\n _this.pushDanmaku(danmakus);\n }\n window.requestAnimationFrame(_this.animationFrame);\n };\n window.requestAnimationFrame(this.animationFrame);\n this.setTime = function (type) {\n if (!type) {\n _this.danmakuTime = true;\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.danmakuTime = false;\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.video.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n });\n this.isTipsShow = false;\n this.timeTipsHandler = this.timeTipsHandler(pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.timeTipsHandler);\n pbar.addEventListener('mouseover', this.timeTipsHandler);\n pbar.addEventListener('mouseenter', this.timeTipsHandler);\n pbar.addEventListener('mouseout', this.timeTipsHandler);\n pbar.addEventListener('mouseleave', this.timeTipsHandler);\n 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.video.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 bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\n var volumeEle = this.element.getElementsByClassName('dplayer-volume')[0];\n var volumeBarWrapWrap = this.element.getElementsByClassName('dplayer-volume-bar-wrap')[0];\n var volumeBarWrap = this.element.getElementsByClassName('dplayer-volume-bar')[0];\n var volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0];\n var vWidth = 35;\n this.switchVolumeIcon = function () {\n var volumeicon = _this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (_this.video.attr('volume') >= 0.8) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-up');\n } else if (_this.video.attr('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.attr('muted')) {\n _this.video.attr('muted', false);\n _this.switchVolumeIcon();\n _this.updateBar('volume', _this.video.attr('volume'), 'width');\n } else {\n _this.video.attr('muted', true);\n volumeicon.innerHTML = (0, _svg2.default)('volume-off');\n _this.updateBar('volume', 0, 'width');\n }\n });\n var hideTime = 0;\n if (!_utils.isMobile) {\n var hideController = function hideController() {\n _this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(hideTime);\n hideTime = setTimeout(function () {\n if (_this.video.attr('played').length) {\n _this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n this.danOpacity = localStorage.getItem('DPlayer-opacity') || 0.7;\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 danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\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.option.danmaku) {\n for (var _i2 = 0; _i2 < _this.dan.length; _i2++) {\n if (_this.dan[_i2].time >= _this.video.currentTime()) {\n _this.danIndex = _i2;\n break;\n }\n _this.danIndex = _this.dan.length;\n }\n if (!_this.paused) {\n _this.setTime('danmaku');\n }\n }\n } else {\n showdan = false;\n if (_this.option.danmaku) {\n _this.clearTime('danmaku');\n danContainer.innerHTML = '';\n _this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n }\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(_i3) {\n speedItem[_i3].addEventListener('click', function () {\n _this.video.attr('playbackRate', speedItem[_i3].dataset.speed);\n closeSetting();\n });\n };\n for (var _i3 = 0; _i3 < speedItem.length; _i3++) {\n _loop(_i3);\n }\n });\n if (_this.option.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.danOpacity, '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 var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i4 = 0; _i4 < items.length; _i4++) {\n items[_i4].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n };\n var danmakuUp = function danmakuUp() {\n document.removeEventListener('mouseup', danmakuUp);\n document.removeEventListener('mousemove', danmakuMove);\n danmakuSettingBox.classList.remove('dplayer-setting-danmaku-active');\n };\n 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 var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i5 = 0; _i5 < items.length; _i5++) {\n items[_i5].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n });\n danmakuBarWrapWrap.addEventListener('mousedown', function () {\n document.addEventListener('mousemove', danmakuMove);\n document.addEventListener('mouseup', danmakuUp);\n danmakuSettingBox.classList.add('dplayer-setting-danmaku-active');\n });\n }\n };\n settingEvent();\n 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 this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n var measureStyle = getComputedStyle(this.element.getElementsByClassName('dplayer-danmaku-item')[0], null);\n var context = document.createElement('canvas').getContext('2d');\n context.font = measureStyle.getPropertyValue('font-size') + ' ' + measureStyle.getPropertyValue('font-family');\n this.danmakuMeasure = function (text) {\n return context.measureText(text).width;\n };\n if (this.option.danmaku) {\n this.danIndex = 0;\n this.readDanmaku();\n } else {\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 htmlEncode = function htmlEncode(str) {\n return str.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/'/g, ''').replace(/\\//g, '/');\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 var danmakuData = {\n token: _this.option.danmaku.token,\n player: _this.option.danmaku.id,\n author: _this.option.danmaku.user,\n time: _this.video.currentTime(),\n text: commentInput.value,\n color: _this.element.querySelector('.dplayer-comment-setting-color input:checked').value,\n type: _this.element.querySelector('.dplayer-comment-setting-type input:checked').value\n };\n _this.option.apiBackend.send(_this.option.danmaku.api, danmakuData);\n commentInput.value = '';\n closeComment();\n _this.dan.splice(_this.danIndex, 0, danmakuData);\n _this.danIndex++;\n var danmaku = {\n text: htmlEncode(danmakuData.text),\n color: danmakuData.color,\n type: danmakuData.type,\n border: '2px solid ' + _this.option.theme\n };\n _this.pushDanmaku(danmaku);\n };\n var closeCommentSetting = function closeCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n }\n };\n var toggleCommentSetting = function toggleCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n } else {\n commentSettingBox.classList.add('dplayer-comment-setting-open');\n }\n };\n 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(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 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 var resetAnimation = function resetAnimation() {\n var danWidth = danContainer.offsetWidth;\n var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i6 = 0; _i6 < items.length; _i6++) {\n items[_i6].style.transform = 'translateX(-' + danWidth + 'px)';\n }\n };\n this.element.addEventListener('fullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('mozfullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('webkitfullscreenchange', function () {\n resetAnimation();\n });\n this.element.getElementsByClassName('dplayer-full-icon')[0].addEventListener('click', function () {\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) {\n if (_this.element.requestFullscreen) {\n _this.element.requestFullscreen();\n } else if (_this.element.mozRequestFullScreen) {\n _this.element.mozRequestFullScreen();\n } else if (_this.element.webkitRequestFullscreen) {\n _this.element.webkitRequestFullscreen();\n } else if (_this.video.attr('webkitEnterFullscreen')) {\n _this.video.current.webkitEnterFullscreen();\n }\n } else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n resetAnimation();\n });\n this.element.getElementsByClassName('dplayer-full-in-icon')[0].addEventListener('click', function () {\n if (_this.element.classList.contains('dplayer-fulled')) {\n _this.element.classList.remove('dplayer-fulled');\n } else {\n _this.element.classList.add('dplayer-fulled');\n resetAnimation();\n }\n });\n var handleKeyDown = function handleKeyDown(e) {\n var tag = document.activeElement.tagName.toUpperCase();\n var editable = document.activeElement.getAttribute('contenteditable');\n if (tag !== 'INPUT' && tag !== 'TEXTAREA' && editable !== '' && editable !== 'true') {\n var event = e || window.event;\n var percentage = void 0;\n switch (event.keyCode) {\n case 32:\n event.preventDefault();\n _this.toggle();\n break;\n case 37:\n event.preventDefault();\n _this.video.seek(_this.video.currentTime() - 5);\n break;\n case 39:\n event.preventDefault();\n _this.video.seek(_this.video.currentTime() + 5);\n break;\n case 38:\n event.preventDefault();\n percentage = _this.video.attr('volume') + 0.1;\n _this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = _this.video.attr('volume') - 0.1;\n _this.volume(percentage);\n break;\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', function (e) {\n var event = e || window.event;\n switch (event.keyCode) {\n case 27:\n if (_this.element.classList.contains('dplayer-fulled')) {\n _this.element.classList.remove('dplayer-fulled');\n resetAnimation();\n }\n break;\n }\n });\n 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.attr('videoWidth');\n canvas.height = _this.video.attr('videoHeight');\n canvas.getContext('2d').drawImage(_this.video.current, 0, 0, canvas.width, canvas.height);\n camareIcon.href = canvas.toDataURL();\n camareIcon.download = 'DPlayer.png';\n });\n }\n index++;\n }\n _createClass(DPlayer, [\n {\n key: 'play',\n value: function play(time) {\n if (Object.prototype.toString.call(time) === '[object Number]') {\n this.video.seek(time);\n }\n this.paused = false;\n if (this.video.attr('paused')) {\n this.bezel.innerHTML = (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 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.attr('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 this.trigger('pause');\n }\n },\n {\n key: 'volume',\n value: function volume(percentage) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n this.video.attr('volume', percentage);\n if (this.video.attr('muted')) {\n this.video.attr('muted', false);\n }\n this.switchVolumeIcon();\n }\n },\n {\n key: 'toggle',\n value: function toggle() {\n if (this.video.attr('paused')) {\n this.play();\n } else {\n this.pause();\n }\n }\n },\n {\n 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: '_readAllEndpoints',\n value: function _readAllEndpoints(endpoints, finish) {\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.notice(err.response.msg);\n } else {\n _this2.notice('Request was unsuccessful: ' + err.status);\n }\n results[i] = [];\n } else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return finish(results);\n }\n };\n };\n for (var i = 0; i < endpoints.length; ++i) {\n this.option.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n },\n {\n key: 'readDanmaku',\n value: function readDanmaku() {\n var _this3 = this;\n var apiurl = void 0;\n if (this.option.danmaku.maximum) {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id + '&max=' + this.option.danmaku.maximum;\n } else {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id;\n }\n var endpoints = (this.option.danmaku.addition || []).slice(0);\n endpoints.push(apiurl);\n this._readAllEndpoints(endpoints, function (results) {\n _this3.danIndex = 0;\n _this3.dan = [].concat.apply([], results).sort(function (a, b) {\n return a.time - b.time;\n });\n _this3.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n if (_this3.option.autoplay && !_utils.isMobile) {\n _this3.play();\n } else if (_utils.isMobile) {\n _this3.pause();\n }\n });\n }\n },\n {\n key: 'pushDanmaku',\n value: function pushDanmaku(danmaku) {\n var _this4 = this;\n var danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n var itemHeight = this.arrow ? 24 : 30;\n var danWidth = danContainer.offsetWidth;\n var danHeight = danContainer.offsetHeight;\n var itemY = parseInt(danHeight / itemHeight);\n var danItemRight = function danItemRight(ele) {\n var eleWidth = ele.offsetWidth || parseInt(ele.style.width);\n var eleRight = ele.getBoundingClientRect().right || danContainer.getBoundingClientRect().right + eleWidth;\n return danContainer.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 _loop2 = function _loop2(i) {\n var item = _this4.danTunnel[type][i + ''];\n if (item && item.length) {\n for (var j = 0; j < item.length; j++) {\n var danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(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 _ret2 = _loop2(i);\n if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === 'object')\n return _ret2.v;\n }\n };\n if (Object.prototype.toString.call(danmaku) !== '[object Array]') {\n danmaku = [danmaku];\n }\n var docFragment = document.createDocumentFragment();\n var _loop3 = function _loop3(i) {\n if (!danmaku[i].type) {\n danmaku[i].type = 'right';\n }\n if (!danmaku[i].color) {\n danmaku[i].color = '#fff';\n }\n var item = document.createElement('div');\n item.classList.add('dplayer-danmaku-item');\n item.classList.add('dplayer-danmaku-' + danmaku[i].type);\n item.innerHTML = danmaku[i].text;\n item.style.opacity = _this4.danOpacity;\n item.style.color = danmaku[i].color;\n item.style.border = danmaku[i].border;\n item.addEventListener('animationend', function () {\n danContainer.removeChild(item);\n });\n var itemWidth = _this4.danmakuMeasure(danmaku[i].text);\n switch (danmaku[i].type) {\n case 'right':\n item.style.width = itemWidth + 1 + 'px';\n item.style.top = itemHeight * getTunnel(item, danmaku[i].type, itemWidth) + 'px';\n item.style.transform = 'translateX(-' + danWidth + 'px)';\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, danmaku[i].type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, danmaku[i].type) + 'px';\n break;\n default:\n console.error('Can\\'t handled danmaku type: ' + danmaku[i].type);\n }\n item.classList.add('dplayer-danmaku-move');\n docFragment.appendChild(item);\n };\n for (var i = 0; i < danmaku.length; i++) {\n _loop3(i);\n }\n danContainer.appendChild(docFragment);\n return docFragment;\n }\n },\n {\n key: 'switchVideo',\n value: function switchVideo(video, danmaku) {\n this.video.attr('poster', video.pic ? video.pic : '');\n this.video.attr('src', video.url);\n this.pause();\n if (danmaku) {\n this.dan = [];\n this.danIndex = 0;\n this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'block';\n this.updateBar('played', 0, 'width');\n this.updateBar('loaded', 0, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = '00:00';\n this.element.getElementsByClassName('dplayer-danmaku')[0].innerHTML = '';\n this.danTuel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.option.danmaku = danmaku;\n this.readDanmaku();\n }\n }\n },\n {\n key: 'initVideo',\n value: function initVideo() {\n var _this5 = this;\n var enablehls = void 0;\n if (this.option.video.type === 'auto') {\n enablehls = /m3u8(#|\\?|$)/i.exec(this.option.video.url);\n } else if (this.option.video.type === 'hls') {\n enablehls = true;\n } else {\n enablehls = false;\n }\n if (enablehls && Hls.isSupported()) {\n var hls = new Hls();\n hls.loadSource(this.option.video.url[0]);\n hls.attachMedia(this.video.current);\n }\n var enableflv = void 0;\n if (this.option.video.type === 'auto') {\n enableflv = /.flv(#|\\?|$)/i.exec(this.option.video.url);\n } else if (this.option.video.type === 'flv') {\n enableflv = true;\n } else {\n enableflv = false;\n }\n if (enableflv && flvjs.isSupported()) {\n var flvPlayer = flvjs.createPlayer({\n type: 'flv',\n url: this.option.video.url\n });\n flvPlayer.attachMediaElement(this.video.current);\n flvPlayer.load();\n }\n if (this.option.danmaku) {\n this.video.on('all', 'seeking', function () {\n for (var i = 0; i < _this5.dan.length; i++) {\n if (_this5.dan[i].time >= _this5.video.currentTime()) {\n _this5.danIndex = i;\n return;\n }\n _this5.danIndex = _this5.dan.length;\n }\n });\n }\n this.video.on('all', 'durationchange', function (i, video) {\n if (video.duration !== 1) {\n _this5.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = _utils2.default.secondToTime(_this5.video.duration);\n }\n });\n this.video.on('current', 'progress', function (i, video) {\n var percentage = video.buffered.length ? video.buffered.end(video.buffered.length - 1) / video.duration : 0;\n _this5.updateBar('loaded', percentage, 'width');\n });\n this.video.on('all', 'error', function () {\n _this5.notice(_this5.tran('This video fails to load'), -1);\n _this5.trigger('pause');\n });\n this.video.on('current', 'canplay', function () {\n _this5.trigger('canplay');\n });\n this.ended = false;\n this.video.on('all', 'ended', function (i) {\n if (i === _this5.video.videos.length - 1) {\n _this5.updateBar('played', 1, 'width');\n if (!_this5.loop) {\n _this5.ended = true;\n _this5.pause();\n _this5.trigger('ended');\n } else {\n _this5.video.switch(0);\n _this5.video.play();\n }\n _this5.danIndex = 0;\n }\n });\n this.video.on('current', 'play', function () {\n if (_this5.paused) {\n _this5.play();\n }\n });\n this.video.on('current', 'pause', function () {\n if (!_this5.paused) {\n _this5.pause();\n }\n });\n this.video.attr('volume', parseInt(this.element.getElementsByClassName('dplayer-volume-bar-inner')[0].style.width) / 100);\n }\n },\n {\n key: 'switchQuality',\n value: function switchQuality(index) {\n var _this6 = 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 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 = new _video2.default([videoEle], this.prevVideo.duration);\n this.initVideo();\n this.video.seek(this.prevVideo.currentTime());\n this.notice(this.tran('Switching to') + ' ' + this.quality.name + ' ' + this.tran('quality'), -1);\n this.video.on('current', 'canplay', function () {\n if (_this6.prevVideo) {\n if (_this6.video.currentTime() !== _this6.prevVideo.currentTime()) {\n _this6.video.seek(_this6.prevVideo.currentTime());\n return;\n }\n parent.removeChild(_this6.prevVideo.current);\n _this6.video.current.classList.add('dplayer-video-current');\n _this6.video.play();\n _this6.prevVideo = null;\n _this6.notice(_this6.tran('Switched to') + ' ' + _this6.quality.name + ' ' + _this6.tran('quality'));\n _this6.switchingQuality = false;\n }\n });\n }\n },\n {\n key: 'timeTipsHandler',\n value: function timeTipsHandler(pbar, timeTips) {\n var _this7 = 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 (!_this7.video.duration) {\n return;\n }\n var clientX = e.clientX;\n var px = cumulativeOffset(pbar).left;\n var tx = clientX - px;\n timeTips.innerText = _utils2.default.secondToTime(_this7.video.duration * (tx / pbar.offsetWidth));\n timeTips.style.left = tx - 20 + 'px';\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n if (_this7.isTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n _this7.isTipsShow = true;\n break;\n case 'mouseleave':\n case 'mouseout':\n if (!_this7.isTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n _this7.isTipsShow = false;\n break;\n }\n };\n }\n },\n {\n key: 'notice',\n value: function notice(text, time) {\n var noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = 1;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n if (time && time < 0) {\n return;\n }\n this.noticeTime = setTimeout(function () {\n noticeEle.style.opacity = 0;\n }, time || 2000);\n }\n }\n ]);\n return DPlayer;\n}();\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 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) {\n SendXMLHttpRequest(endpoint, danmakuData, function (xhr, response) {\n console.log('Post danmaku: ', response);\n }, function (xhr, response) {\n alert(response.msg);\n }, function (xhr) {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n read: function read(endpoint, cbk) {\n SendXMLHttpRequest(endpoint, null, function (xhr, response) {\n cbk(null, response.danmaku);\n }, function (xhr, response) {\n cbk({\n status: xhr.status,\n response: response\n });\n }, function (xhr) {\n cbk({\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};\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 _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 Video = function () {\n function Video(videos, duration) {\n var _this = this;\n _classCallCheck(this, Video);\n this.videos = videos;\n this.multi = this.videos.length > 1;\n this.index = 0;\n this.current = this.videos[this.index];\n this.duration = duration || 0;\n this.durationArr = [];\n this.eventAll = [];\n this.eventCurrent = [];\n this.on('all', 'durationchange', function (i, video) {\n if (video.duration !== 1) {\n _this.durationArr[i] = video.duration;\n if (!duration) {\n _this.duration = _this.durationArr.reduce(function (sum, cur) {\n return sum + cur;\n });\n }\n }\n });\n this.on('current', 'end', function () {\n _this.switch(_this.index + 1);\n });\n }\n _createClass(Video, [\n {\n key: 'switch',\n value: function _switch(index, time) {\n if (this.index !== index) {\n this.videos[index].classList.add('dplayer-video-current');\n if (!this.current.paused) {\n this.videos[index].play();\n }\n this.current.classList.remove('dplayer-video-current');\n this.current.pause();\n this.index = index;\n this.current = this.videos[this.index];\n this.videos[index].currentTime = time ? time : 0;\n } else {\n this.videos[index].currentTime = time ? time : 0;\n }\n }\n },\n {\n key: 'on',\n value: function on(type, event, callback) {\n var _this2 = this;\n if (typeof callback === 'function') {\n if (type === 'all') {\n if (!this.eventAll[event]) {\n this.eventAll[event] = [];\n }\n this.eventAll[event].push(callback);\n } else {\n if (!this.eventCurrent[event]) {\n this.eventCurrent[event] = [];\n }\n this.eventCurrent[event].push(callback);\n }\n if (['seeking'].indexOf(event) === -1) {\n var _loop = function _loop(i) {\n _this2.videos[i].addEventListener(event, function () {\n if (type === 'all' || _this2.videos[i] === _this2.current) {\n callback(i, _this2.videos[i]);\n }\n });\n };\n for (var i = 0; i < this.videos.length; i++) {\n _loop(i);\n }\n }\n }\n }\n },\n {\n key: 'trigger',\n value: function trigger(type, event) {\n var events = type === 'all' ? this.eventAll : this.eventCurrent;\n if (events[event]) {\n for (var i = 0; i < events[event].length; i++) {\n events[event][i]();\n }\n }\n }\n },\n {\n key: 'currentTime',\n value: function currentTime() {\n if (this.durationArr.slice(0, this.index).length) {\n return this.durationArr.slice(0, this.index).reduce(function (sum, cur) {\n return sum + cur;\n }) + this.current.currentTime;\n } else {\n return this.current.currentTime;\n }\n }\n },\n {\n key: 'seek',\n value: function seek(time) {\n time = Math.max(time, 0);\n time = Math.min(time, this.duration);\n var i = 0;\n var tmptime = 0;\n while (tmptime <= time) {\n tmptime += this.durationArr[i];\n i++;\n }\n var currentTime = void 0;\n if (this.durationArr.slice(0, this.index).length) {\n currentTime = time - this.durationArr.slice(0, i - 1).reduce(function (sum, cur) {\n return sum + cur;\n });\n } else {\n currentTime = time;\n }\n this.switch(i - 1, currentTime);\n this.trigger('all', 'seeking');\n }\n },\n {\n key: 'attr',\n value: function attr(option, value) {\n if (value !== undefined) {\n for (var i = 0; i < this.videos.length; i++) {\n this.videos[i][option] = value;\n }\n }\n return this.current[option];\n }\n },\n {\n key: 'play',\n value: function play() {\n this.current.play();\n }\n },\n {\n key: 'pause',\n value: function pause() {\n this.current.pause();\n }\n },\n {\n key: 'toggle',\n value: function toggle() {\n this.current.paused ? this.play() : this.pause();\n }\n }\n ]);\n return Video;\n}();\nmodule.exports = Video;\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 27bd43ac2f416b5e045b","'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('%c DPlayer ' + DPLAYER_VERSION + ' %c http://dplayer.js.org ', '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 _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}();\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 _video = require('./video');\nvar _video2 = _interopRequireDefault(_video);\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 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 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 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 = new _video2.default(this.element.getElementsByClassName('dplayer-video-current'));\n this.initVideo();\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 bar = {};\n bar.playedBar = this.element.getElementsByClassName('dplayer-played')[0];\n bar.loadedBar = this.element.getElementsByClassName('dplayer-loaded')[0];\n var pbar = this.element.getElementsByClassName('dplayer-bar-wrap')[0];\n var pbarTimeTips = this.element.getElementsByClassName('dplayer-bar-time')[0];\n var barWidth = void 0;\n var lastPlayPos = 0;\n var currentPlayPos = 0;\n var bufferingDetected = false;\n this.danmakuTime = false;\n this.playedTime = 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.attr('paused')) {\n _this.element.classList.add('dplayer-loading');\n bufferingDetected = true;\n }\n if (bufferingDetected && currentPlayPos > lastPlayPos + 0.01 && !_this.video.attr('paused')) {\n _this.element.classList.remove('dplayer-loading');\n bufferingDetected = false;\n }\n lastPlayPos = currentPlayPos;\n }, 100);\n };\n var clearCheckLoadingTime = function clearCheckLoadingTime() {\n clearInterval(_this.checkLoading);\n };\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 if (_this.danmakuTime && _this.option.danmaku && showdan && _this.dan) {\n var item = _this.dan[_this.danIndex];\n var danmakus = [];\n while (item && _this.video.currentTime() > parseFloat(item.time)) {\n danmakus.push(item);\n item = _this.dan[++_this.danIndex];\n }\n _this.pushDanmaku(danmakus);\n }\n window.requestAnimationFrame(_this.animationFrame);\n };\n window.requestAnimationFrame(this.animationFrame);\n this.setTime = function (type) {\n if (!type) {\n _this.danmakuTime = true;\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.danmakuTime = false;\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.video.seek(parseFloat(bar.playedBar.style.width) / 100 * _this.video.duration);\n });\n this.isTipsShow = false;\n this.timeTipsHandler = this.timeTipsHandler(pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.timeTipsHandler);\n pbar.addEventListener('mouseover', this.timeTipsHandler);\n pbar.addEventListener('mouseenter', this.timeTipsHandler);\n pbar.addEventListener('mouseout', this.timeTipsHandler);\n pbar.addEventListener('mouseleave', this.timeTipsHandler);\n 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.video.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 bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\n var volumeEle = this.element.getElementsByClassName('dplayer-volume')[0];\n var volumeBarWrapWrap = this.element.getElementsByClassName('dplayer-volume-bar-wrap')[0];\n var volumeBarWrap = this.element.getElementsByClassName('dplayer-volume-bar')[0];\n var volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0];\n var vWidth = 35;\n this.switchVolumeIcon = function () {\n var volumeicon = _this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (_this.video.attr('volume') >= 0.8) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-up');\n } else if (_this.video.attr('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.attr('muted')) {\n _this.video.attr('muted', false);\n _this.switchVolumeIcon();\n _this.updateBar('volume', _this.video.attr('volume'), 'width');\n } else {\n _this.video.attr('muted', true);\n volumeicon.innerHTML = (0, _svg2.default)('volume-off');\n _this.updateBar('volume', 0, 'width');\n }\n });\n var hideTime = 0;\n if (!_utils.isMobile) {\n var hideController = function hideController() {\n _this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(hideTime);\n hideTime = setTimeout(function () {\n if (_this.video.attr('played').length) {\n _this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n this.danOpacity = localStorage.getItem('DPlayer-opacity') || 0.7;\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 danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\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.option.danmaku) {\n for (var _i2 = 0; _i2 < _this.dan.length; _i2++) {\n if (_this.dan[_i2].time >= _this.video.currentTime()) {\n _this.danIndex = _i2;\n break;\n }\n _this.danIndex = _this.dan.length;\n }\n if (!_this.paused) {\n _this.setTime('danmaku');\n }\n }\n } else {\n showdan = false;\n if (_this.option.danmaku) {\n _this.clearTime('danmaku');\n danContainer.innerHTML = '';\n _this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n }\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(_i3) {\n speedItem[_i3].addEventListener('click', function () {\n _this.video.attr('playbackRate', speedItem[_i3].dataset.speed);\n closeSetting();\n });\n };\n for (var _i3 = 0; _i3 < speedItem.length; _i3++) {\n _loop(_i3);\n }\n });\n if (_this.option.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.danOpacity, '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 var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i4 = 0; _i4 < items.length; _i4++) {\n items[_i4].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n };\n var danmakuUp = function danmakuUp() {\n document.removeEventListener('mouseup', danmakuUp);\n document.removeEventListener('mousemove', danmakuMove);\n danmakuSettingBox.classList.remove('dplayer-setting-danmaku-active');\n };\n 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 var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i5 = 0; _i5 < items.length; _i5++) {\n items[_i5].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n });\n danmakuBarWrapWrap.addEventListener('mousedown', function () {\n document.addEventListener('mousemove', danmakuMove);\n document.addEventListener('mouseup', danmakuUp);\n danmakuSettingBox.classList.add('dplayer-setting-danmaku-active');\n });\n }\n };\n settingEvent();\n 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 this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n var measureStyle = getComputedStyle(this.element.getElementsByClassName('dplayer-danmaku-item')[0], null);\n var context = document.createElement('canvas').getContext('2d');\n context.font = measureStyle.getPropertyValue('font-size') + ' ' + measureStyle.getPropertyValue('font-family');\n this.danmakuMeasure = function (text) {\n return context.measureText(text).width;\n };\n if (this.option.danmaku) {\n this.danIndex = 0;\n this.readDanmaku();\n } else {\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 htmlEncode = function htmlEncode(str) {\n return str.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/'/g, ''').replace(/\\//g, '/');\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 var danmakuData = {\n token: _this.option.danmaku.token,\n player: _this.option.danmaku.id,\n author: _this.option.danmaku.user,\n time: _this.video.currentTime(),\n text: commentInput.value,\n color: _this.element.querySelector('.dplayer-comment-setting-color input:checked').value,\n type: _this.element.querySelector('.dplayer-comment-setting-type input:checked').value\n };\n _this.option.apiBackend.send(_this.option.danmaku.api, danmakuData);\n commentInput.value = '';\n closeComment();\n _this.dan.splice(_this.danIndex, 0, danmakuData);\n _this.danIndex++;\n var danmaku = {\n text: htmlEncode(danmakuData.text),\n color: danmakuData.color,\n type: danmakuData.type,\n border: '2px solid ' + _this.option.theme\n };\n _this.pushDanmaku(danmaku);\n };\n var closeCommentSetting = function closeCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n }\n };\n var toggleCommentSetting = function toggleCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n } else {\n commentSettingBox.classList.add('dplayer-comment-setting-open');\n }\n };\n 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(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 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 var resetAnimation = function resetAnimation() {\n var danWidth = danContainer.offsetWidth;\n var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i6 = 0; _i6 < items.length; _i6++) {\n items[_i6].style.transform = 'translateX(-' + danWidth + 'px)';\n }\n };\n this.element.addEventListener('fullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('mozfullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('webkitfullscreenchange', function () {\n resetAnimation();\n });\n this.element.getElementsByClassName('dplayer-full-icon')[0].addEventListener('click', function () {\n if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement) {\n if (_this.element.requestFullscreen) {\n _this.element.requestFullscreen();\n } else if (_this.element.mozRequestFullScreen) {\n _this.element.mozRequestFullScreen();\n } else if (_this.element.webkitRequestFullscreen) {\n _this.element.webkitRequestFullscreen();\n } else if (_this.video.attr('webkitEnterFullscreen')) {\n _this.video.current.webkitEnterFullscreen();\n }\n } else {\n if (document.cancelFullScreen) {\n document.cancelFullScreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitCancelFullScreen) {\n document.webkitCancelFullScreen();\n }\n }\n resetAnimation();\n });\n this.element.getElementsByClassName('dplayer-full-in-icon')[0].addEventListener('click', function () {\n if (_this.element.classList.contains('dplayer-fulled')) {\n _this.element.classList.remove('dplayer-fulled');\n } else {\n _this.element.classList.add('dplayer-fulled');\n resetAnimation();\n }\n });\n var handleKeyDown = function handleKeyDown(e) {\n var tag = document.activeElement.tagName.toUpperCase();\n var editable = document.activeElement.getAttribute('contenteditable');\n if (tag !== 'INPUT' && tag !== 'TEXTAREA' && editable !== '' && editable !== 'true') {\n var event = e || window.event;\n var percentage = void 0;\n switch (event.keyCode) {\n case 32:\n event.preventDefault();\n _this.toggle();\n break;\n case 37:\n event.preventDefault();\n _this.video.seek(_this.video.currentTime() - 5);\n break;\n case 39:\n event.preventDefault();\n _this.video.seek(_this.video.currentTime() + 5);\n break;\n case 38:\n event.preventDefault();\n percentage = _this.video.attr('volume') + 0.1;\n _this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = _this.video.attr('volume') - 0.1;\n _this.volume(percentage);\n break;\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', function (e) {\n var event = e || window.event;\n switch (event.keyCode) {\n case 27:\n if (_this.element.classList.contains('dplayer-fulled')) {\n _this.element.classList.remove('dplayer-fulled');\n resetAnimation();\n }\n break;\n }\n });\n 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.attr('videoWidth');\n canvas.height = _this.video.attr('videoHeight');\n canvas.getContext('2d').drawImage(_this.video.current, 0, 0, canvas.width, canvas.height);\n camareIcon.href = canvas.toDataURL();\n camareIcon.download = 'DPlayer.png';\n });\n }\n index++;\n }\n _createClass(DPlayer, [\n {\n key: 'play',\n value: function play(time) {\n if (Object.prototype.toString.call(time) === '[object Number]') {\n this.video.seek(time);\n }\n this.paused = false;\n if (this.video.attr('paused')) {\n this.bezel.innerHTML = (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 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.attr('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 this.trigger('pause');\n }\n },\n {\n key: 'volume',\n value: function volume(percentage) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n this.video.attr('volume', percentage);\n if (this.video.attr('muted')) {\n this.video.attr('muted', false);\n }\n this.switchVolumeIcon();\n }\n },\n {\n key: 'toggle',\n value: function toggle() {\n if (this.video.attr('paused')) {\n this.play();\n } else {\n this.pause();\n }\n }\n },\n {\n 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: '_readAllEndpoints',\n value: function _readAllEndpoints(endpoints, finish) {\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.notice(err.response.msg);\n } else {\n _this2.notice('Request was unsuccessful: ' + err.status);\n }\n results[i] = [];\n } else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return finish(results);\n }\n };\n };\n for (var i = 0; i < endpoints.length; ++i) {\n this.option.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n },\n {\n key: 'readDanmaku',\n value: function readDanmaku() {\n var _this3 = this;\n var apiurl = void 0;\n if (this.option.danmaku.maximum) {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id + '&max=' + this.option.danmaku.maximum;\n } else {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id;\n }\n var endpoints = (this.option.danmaku.addition || []).slice(0);\n endpoints.push(apiurl);\n this._readAllEndpoints(endpoints, function (results) {\n _this3.danIndex = 0;\n _this3.dan = [].concat.apply([], results).sort(function (a, b) {\n return a.time - b.time;\n });\n _this3.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n if (_this3.option.autoplay && !_utils.isMobile) {\n _this3.play();\n } else if (_utils.isMobile) {\n _this3.pause();\n }\n });\n }\n },\n {\n key: 'pushDanmaku',\n value: function pushDanmaku(danmaku) {\n var _this4 = this;\n var danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n var itemHeight = this.arrow ? 24 : 30;\n var danWidth = danContainer.offsetWidth;\n var danHeight = danContainer.offsetHeight;\n var itemY = parseInt(danHeight / itemHeight);\n var danItemRight = function danItemRight(ele) {\n var eleWidth = ele.offsetWidth || parseInt(ele.style.width);\n var eleRight = ele.getBoundingClientRect().right || danContainer.getBoundingClientRect().right + eleWidth;\n return danContainer.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 _loop2 = function _loop2(i) {\n var item = _this4.danTunnel[type][i + ''];\n if (item && item.length) {\n for (var j = 0; j < item.length; j++) {\n var danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(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 _ret2 = _loop2(i);\n if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === 'object')\n return _ret2.v;\n }\n };\n if (Object.prototype.toString.call(danmaku) !== '[object Array]') {\n danmaku = [danmaku];\n }\n var docFragment = document.createDocumentFragment();\n var _loop3 = function _loop3(i) {\n if (!danmaku[i].type) {\n danmaku[i].type = 'right';\n }\n if (!danmaku[i].color) {\n danmaku[i].color = '#fff';\n }\n var item = document.createElement('div');\n item.classList.add('dplayer-danmaku-item');\n item.classList.add('dplayer-danmaku-' + danmaku[i].type);\n item.innerHTML = danmaku[i].text;\n item.style.opacity = _this4.danOpacity;\n item.style.color = danmaku[i].color;\n item.style.border = danmaku[i].border;\n item.addEventListener('animationend', function () {\n danContainer.removeChild(item);\n });\n var itemWidth = _this4.danmakuMeasure(danmaku[i].text);\n switch (danmaku[i].type) {\n case 'right':\n item.style.width = itemWidth + 1 + 'px';\n item.style.top = itemHeight * getTunnel(item, danmaku[i].type, itemWidth) + 'px';\n item.style.transform = 'translateX(-' + danWidth + 'px)';\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, danmaku[i].type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, danmaku[i].type) + 'px';\n break;\n default:\n console.error('Can\\'t handled danmaku type: ' + danmaku[i].type);\n }\n item.classList.add('dplayer-danmaku-move');\n docFragment.appendChild(item);\n };\n for (var i = 0; i < danmaku.length; i++) {\n _loop3(i);\n }\n danContainer.appendChild(docFragment);\n return docFragment;\n }\n },\n {\n key: 'switchVideo',\n value: function switchVideo(video, danmaku) {\n this.video.attr('poster', video.pic ? video.pic : '');\n this.video.attr('src', video.url);\n this.pause();\n if (danmaku) {\n this.dan = [];\n this.danIndex = 0;\n this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'block';\n this.updateBar('played', 0, 'width');\n this.updateBar('loaded', 0, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = '00:00';\n this.element.getElementsByClassName('dplayer-danmaku')[0].innerHTML = '';\n this.danTuel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.option.danmaku = danmaku;\n this.readDanmaku();\n }\n }\n },\n {\n key: 'initVideo',\n value: function initVideo() {\n var _this5 = this;\n var enablehls = void 0;\n if (this.option.video.type === 'auto') {\n enablehls = /m3u8(#|\\?|$)/i.exec(this.option.video.url);\n } else if (this.option.video.type === 'hls') {\n enablehls = true;\n } else {\n enablehls = false;\n }\n if (enablehls && Hls.isSupported()) {\n var hls = new Hls();\n hls.loadSource(this.option.video.url[0]);\n hls.attachMedia(this.video.current);\n }\n var enableflv = void 0;\n if (this.option.video.type === 'auto') {\n enableflv = /.flv(#|\\?|$)/i.exec(this.option.video.url);\n } else if (this.option.video.type === 'flv') {\n enableflv = true;\n } else {\n enableflv = false;\n }\n if (enableflv && flvjs.isSupported()) {\n var flvPlayer = flvjs.createPlayer({\n type: 'flv',\n url: this.option.video.url\n });\n flvPlayer.attachMediaElement(this.video.current);\n flvPlayer.load();\n }\n if (this.option.danmaku) {\n this.video.on('all', 'seeking', function () {\n for (var i = 0; i < _this5.dan.length; i++) {\n if (_this5.dan[i].time >= _this5.video.currentTime()) {\n _this5.danIndex = i;\n return;\n }\n _this5.danIndex = _this5.dan.length;\n }\n });\n }\n this.video.on('all', 'durationchange', function (i, video) {\n if (video.duration !== 1) {\n _this5.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = _utils2.default.secondToTime(_this5.video.duration);\n }\n });\n this.video.on('current', 'progress', function (i, video) {\n var percentage = video.buffered.length ? video.buffered.end(video.buffered.length - 1) / video.duration : 0;\n _this5.updateBar('loaded', percentage, 'width');\n });\n this.video.on('all', 'error', function () {\n _this5.notice(_this5.tran('This video fails to load'), -1);\n _this5.trigger('pause');\n });\n this.video.on('current', 'canplay', function () {\n _this5.trigger('canplay');\n });\n this.ended = false;\n this.video.on('all', 'ended', function (i) {\n if (i === _this5.video.videos.length - 1) {\n _this5.updateBar('played', 1, 'width');\n if (!_this5.loop) {\n _this5.ended = true;\n _this5.pause();\n _this5.trigger('ended');\n } else {\n _this5.video.switch(0);\n _this5.video.play();\n }\n _this5.danIndex = 0;\n }\n });\n this.video.on('current', 'play', function () {\n if (_this5.paused) {\n _this5.play();\n }\n });\n this.video.on('current', 'pause', function () {\n if (!_this5.paused) {\n _this5.pause();\n }\n });\n this.video.attr('volume', parseInt(this.element.getElementsByClassName('dplayer-volume-bar-inner')[0].style.width) / 100);\n }\n },\n {\n key: 'switchQuality',\n value: function switchQuality(index) {\n var _this6 = 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 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 = new _video2.default([videoEle], this.prevVideo.duration);\n this.initVideo();\n this.video.seek(this.prevVideo.currentTime());\n this.notice(this.tran('Switching to') + ' ' + this.quality.name + ' ' + this.tran('quality'), -1);\n this.video.on('current', 'canplay', function () {\n if (_this6.prevVideo) {\n if (_this6.video.currentTime() !== _this6.prevVideo.currentTime()) {\n _this6.video.seek(_this6.prevVideo.currentTime());\n return;\n }\n parent.removeChild(_this6.prevVideo.current);\n _this6.video.current.classList.add('dplayer-video-current');\n _this6.video.play();\n _this6.prevVideo = null;\n _this6.notice(_this6.tran('Switched to') + ' ' + _this6.quality.name + ' ' + _this6.tran('quality'));\n _this6.switchingQuality = false;\n }\n });\n }\n },\n {\n key: 'timeTipsHandler',\n value: function timeTipsHandler(pbar, timeTips) {\n var _this7 = 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 (!_this7.video.duration) {\n return;\n }\n var clientX = e.clientX;\n var px = cumulativeOffset(pbar).left;\n var tx = clientX - px;\n timeTips.innerText = _utils2.default.secondToTime(_this7.video.duration * (tx / pbar.offsetWidth));\n timeTips.style.left = tx - 20 + 'px';\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n if (_this7.isTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n _this7.isTipsShow = true;\n break;\n case 'mouseleave':\n case 'mouseout':\n if (!_this7.isTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n _this7.isTipsShow = false;\n break;\n }\n };\n }\n },\n {\n key: 'notice',\n value: function notice(text, time) {\n var noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = 1;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n if (time && time < 0) {\n return;\n }\n this.noticeTime = setTimeout(function () {\n noticeEle.style.opacity = 0;\n }, time || 2000);\n }\n }\n ]);\n return DPlayer;\n}();\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 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) {\n SendXMLHttpRequest(endpoint, danmakuData, function (xhr, response) {\n console.log('Post danmaku: ', response);\n }, function (xhr, response) {\n alert(response.msg);\n }, function (xhr) {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n read: function read(endpoint, cbk) {\n SendXMLHttpRequest(endpoint, null, function (xhr, response) {\n cbk(null, response.danmaku);\n }, function (xhr, response) {\n cbk({\n status: xhr.status,\n response: response\n });\n }, function (xhr) {\n cbk({\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};\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 _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 Video = function () {\n function Video(videos, duration) {\n var _this = this;\n _classCallCheck(this, Video);\n this.videos = videos;\n this.multi = this.videos.length > 1;\n this.index = 0;\n this.current = this.videos[this.index];\n this.duration = duration || 0;\n this.durationArr = [];\n this.eventAll = [];\n this.eventCurrent = [];\n this.on('all', 'durationchange', function (i, video) {\n if (video.duration !== 1) {\n _this.durationArr[i] = video.duration;\n if (!duration) {\n _this.duration = _this.durationArr.reduce(function (sum, cur) {\n return sum + cur;\n });\n }\n }\n });\n this.on('current', 'end', function () {\n _this.switch(_this.index + 1);\n });\n }\n _createClass(Video, [\n {\n key: 'switch',\n value: function _switch(index, time) {\n if (this.index !== index) {\n this.videos[index].classList.add('dplayer-video-current');\n if (!this.current.paused) {\n this.videos[index].play();\n }\n this.current.classList.remove('dplayer-video-current');\n this.current.pause();\n this.index = index;\n this.current = this.videos[this.index];\n this.videos[index].currentTime = time ? time : 0;\n } else {\n this.videos[index].currentTime = time ? time : 0;\n }\n }\n },\n {\n key: 'on',\n value: function on(type, event, callback) {\n var _this2 = this;\n if (typeof callback === 'function') {\n if (type === 'all') {\n if (!this.eventAll[event]) {\n this.eventAll[event] = [];\n }\n this.eventAll[event].push(callback);\n } else {\n if (!this.eventCurrent[event]) {\n this.eventCurrent[event] = [];\n }\n this.eventCurrent[event].push(callback);\n }\n if (['seeking'].indexOf(event) === -1) {\n var _loop = function _loop(i) {\n _this2.videos[i].addEventListener(event, function () {\n if (type === 'all' || _this2.videos[i] === _this2.current) {\n callback(i, _this2.videos[i]);\n }\n });\n };\n for (var i = 0; i < this.videos.length; i++) {\n _loop(i);\n }\n }\n }\n }\n },\n {\n key: 'trigger',\n value: function trigger(type, event) {\n var events = type === 'all' ? this.eventAll : this.eventCurrent;\n if (events[event]) {\n for (var i = 0; i < events[event].length; i++) {\n events[event][i]();\n }\n }\n }\n },\n {\n key: 'currentTime',\n value: function currentTime() {\n if (this.durationArr.slice(0, this.index).length) {\n return this.durationArr.slice(0, this.index).reduce(function (sum, cur) {\n return sum + cur;\n }) + this.current.currentTime;\n } else {\n return this.current.currentTime;\n }\n }\n },\n {\n key: 'seek',\n value: function seek(time) {\n time = Math.max(time, 0);\n time = Math.min(time, this.duration);\n var i = 0;\n var tmptime = 0;\n while (tmptime <= time) {\n tmptime += this.durationArr[i];\n i++;\n }\n var currentTime = void 0;\n if (this.durationArr.slice(0, this.index).length) {\n currentTime = time - this.durationArr.slice(0, i - 1).reduce(function (sum, cur) {\n return sum + cur;\n });\n } else {\n currentTime = time;\n }\n this.switch(i - 1, currentTime);\n this.trigger('all', 'seeking');\n }\n },\n {\n key: 'attr',\n value: function attr(option, value) {\n if (value !== undefined) {\n for (var i = 0; i < this.videos.length; i++) {\n this.videos[i][option] = value;\n }\n }\n return this.current[option];\n }\n },\n {\n key: 'play',\n value: function play() {\n this.current.play();\n }\n },\n {\n key: 'pause',\n value: function pause() {\n this.current.pause();\n }\n },\n {\n key: 'toggle',\n value: function toggle() {\n this.current.paused ? this.play() : this.pause();\n }\n }\n ]);\n return Video;\n}();\nmodule.exports = Video;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/video.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 660b0524acba34390a9b","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"],"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","_typeof","Symbol","iterator","constructor","_createClass","defineProperties","target","props","length","descriptor","writable","key","protoProps","staticProps","_utils","_utils2","_svg","_svg2","_option","_option2","_i18n","_i18n2","_html","_html2","index","DPlayer","option","_this","element","classList","add","video","quality","qualityIndex","defaultQuality","tran","lang","updateBar","percentage","direction","bar","style","eventTypes","event","trigger","_i","danmaku","isMobile","innerHTML","main","arrow","offsetWidth","arrowStyle","document","createElement","head","appendChild","getElementsByClassName","initVideo","bezel","addEventListener","remove","playButton","paused","toggle","videoWrap","conMask","toggleController","contains","playedBar","loadedBar","pbar","pbarTimeTips","barWidth","lastPlayPos","currentPlayPos","bufferingDetected","danmakuTime","playedTime","window","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","callback","setTimeout","setCheckLoadingTime","checkLoading","setInterval","currentTime","clearCheckLoadingTime","clearInterval","animationFrame","duration","secondToTime","showdan","dan","item","danIndex","danmakus","parseFloat","time","push","pushDanmaku","setTime","clearTime","e","clientWidth","clientX","getElementViewLeft","seek","width","isTipsShow","timeTipsHandler","bind","thumbMove","thumbUp","removeEventListener","volumeBar","volumeEle","volumeBarWrapWrap","volumeBarWrap","volumeicon","switchVolumeIcon","volume","volumeMove","volumeUp","muted","hideTime","hideController","clearTimeout","played","closeSetting","closeComment","danOpacity","localStorage","getItem","settingHTML","settingIcon","settingBox","mask","original","settingEvent","openSetting","danContainer","loopEle","loopToggle","checked","showDanEle","showDanToggle","_i2","danTunnel","top","bottom","speed","speedItem","_i3","playbackRate","dataset","danmakuBar","danmakuBarWrapWrap","danmakuBarWrap","danmakuSettingBox","danmakuMove","items","_i4","opacity","setItem","danmakuUp","_i5","measureStyle","getComputedStyle","context","getContext","font","getPropertyValue","danmakuMeasure","text","measureText","readDanmaku","autoplay","commentInput","commentIcon","commentBox","commentSettingIcon","commentSettingBox","commentSendIcon","htmlEncode","str","replace","sendComment","blur","value","notice","danmakuData","token","player","id","author","user","color","querySelector","apiBackend","api","splice","border","theme","closeCommentSetting","toggleCommentSetting","disableHide","commentFocusTimeout","openComment","focus","fill","keyCode","resetAnimation","danWidth","_i6","transform","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","offsetHeight","height","switchQuality","screenshot","camareIcon","canvas","videoWidth","videoHeight","drawImage","href","toDataURL","download","Math","max","min","ended","endpoints","finish","_this2","results","readCount","read","err","data","response","msg","status","_this3","apiurl","maximum","addition","slice","_readAllEndpoints","concat","apply","sort","a","b","display","_this4","itemHeight","danHeight","itemY","parseInt","danItemRight","ele","eleWidth","eleRight","danSpeed","getTunnel","tmp","_ret2","v","j","danRight","toString","docFragment","createDocumentFragment","removeChild","itemWidth","error","poster","pic","src","url","danTuel","_this5","exec","Hls","isSupported","hls","loadSource","attachMedia","flvjs","flvPlayer","createPlayer","attachMediaElement","load","buffered","end","_this6","switchingQuality","videoHTML","videoEle","DOMParser","parseFromString","body","firstChild","parent","insertBefore","getElementsByTagName","prevVideo","timeTips","_this7","cumulativeOffset","offsetTop","offsetLeft","offsetParent","px","tx","innerText","noticeEle","noticeTime","second","add0","num","sec","actualLeft","current","elementScrollLeft","scrollLeft","documentElement","test","navigator","userAgent","defaultApiBackend","defaultOption","language","indexOf","preload","contextmenu","link","defaultKey","SendXMLHttpRequest","success","fail","xhr","XMLHttpRequest","onreadystatechange","readyState","JSON","parse","responseText","code","open","stringify","endpoint","alert","cbk","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","svg","html","videos","logo","qualityList","contextmenuList","result"],"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,IAAA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AA,UAGAF,YAAA,SAAAxX,GAEA,OADA0X,GAAA,qCACA1c,EAAA,EAAuBA,EAAAgF,EAAAxB,OAAoBxD,IAC3C0c,GAAA,iDAAA1c,EAAA,KAAAgF,EAAAhF,GAAAM,KAAA,QAGA,OADAoc,IAAA,UAGA3X,MAAA,SAAAkU,EAAA9C,EAAA3D,EAAAoH,EAAAvD,GACA,sCAAA4C,EAAA,mCAAA9C,EAAA,WAAAA,EAAA,4CAAA3D,EAAA,mCAAAoH,EAAA,YAAAA,EAAA,iBAAAvD,EAAA,cAEAtU,QAAA,SAAAoD,GACA,OACA2G,SAAA,uFAAA3G,EAAA,+CAAAiX,EAAA,2GAAAjX,EAAA,sQAAAA,EAAA,kRAAAA,EAAA,kKAAAqG,aAAAC,QAAA,yFACAkB,MAAA,kSAAAxH,EAAA,yUAIA3F,GAAAD,QAAA8c","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('%c DPlayer ' + \"1.5.2\" + ' %c http://dplayer.js.org ', '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 _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}();\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);\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 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 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 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.initVideo();\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 bar = {};\n bar.playedBar = this.element.getElementsByClassName('dplayer-played')[0];\n bar.loadedBar = this.element.getElementsByClassName('dplayer-loaded')[0];\n var pbar = this.element.getElementsByClassName('dplayer-bar-wrap')[0];\n var pbarTimeTips = this.element.getElementsByClassName('dplayer-bar-time')[0];\n var barWidth = void 0;\n var lastPlayPos = 0;\n var currentPlayPos = 0;\n var bufferingDetected = false;\n this.danmakuTime = false;\n this.playedTime = 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.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 if (_this.danmakuTime && _this.option.danmaku && showdan && _this.dan) {\n var item = _this.dan[_this.danIndex];\n var danmakus = [];\n while (item && _this.video.currentTime > parseFloat(item.time)) {\n danmakus.push(item);\n item = _this.dan[++_this.danIndex];\n }\n _this.pushDanmaku(danmakus);\n }\n window.requestAnimationFrame(_this.animationFrame);\n };\n window.requestAnimationFrame(this.animationFrame);\n this.setTime = function (type) {\n if (!type) {\n _this.danmakuTime = true;\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.danmakuTime = false;\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.isTipsShow = false;\n this.timeTipsHandler = this.timeTipsHandler(pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.timeTipsHandler);\n pbar.addEventListener('mouseover', this.timeTipsHandler);\n pbar.addEventListener('mouseenter', this.timeTipsHandler);\n pbar.addEventListener('mouseout', this.timeTipsHandler);\n pbar.addEventListener('mouseleave', this.timeTipsHandler);\n 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 bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\n var volumeEle = this.element.getElementsByClassName('dplayer-volume')[0];\n var volumeBarWrapWrap = this.element.getElementsByClassName('dplayer-volume-bar-wrap')[0];\n var volumeBarWrap = this.element.getElementsByClassName('dplayer-volume-bar')[0];\n var volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0];\n var vWidth = 35;\n this.switchVolumeIcon = function () {\n var volumeicon = _this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (_this.video.volume >= 0.8) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-up');\n } else if (_this.video.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.video.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 var hideTime = 0;\n if (!_utils.isMobile) {\n var hideController = function hideController() {\n _this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(hideTime);\n hideTime = setTimeout(function () {\n if (_this.video.played.length) {\n _this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n this.danOpacity = localStorage.getItem('DPlayer-opacity') || 0.7;\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 danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\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.option.danmaku) {\n for (var _i2 = 0; _i2 < _this.dan.length; _i2++) {\n if (_this.dan[_i2].time >= _this.video.currentTime) {\n _this.danIndex = _i2;\n break;\n }\n _this.danIndex = _this.dan.length;\n }\n if (!_this.paused) {\n _this.setTime('danmaku');\n }\n }\n } else {\n showdan = false;\n if (_this.option.danmaku) {\n _this.clearTime('danmaku');\n danContainer.innerHTML = '';\n _this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n }\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(_i3) {\n speedItem[_i3].addEventListener('click', function () {\n _this.video.playbackRate = speedItem[_i3].dataset.speed;\n closeSetting();\n });\n };\n for (var _i3 = 0; _i3 < speedItem.length; _i3++) {\n _loop(_i3);\n }\n });\n if (_this.option.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.danOpacity, '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 var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i4 = 0; _i4 < items.length; _i4++) {\n items[_i4].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n };\n var danmakuUp = function danmakuUp() {\n document.removeEventListener('mouseup', danmakuUp);\n document.removeEventListener('mousemove', danmakuMove);\n danmakuSettingBox.classList.remove('dplayer-setting-danmaku-active');\n };\n 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 var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i5 = 0; _i5 < items.length; _i5++) {\n items[_i5].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n });\n danmakuBarWrapWrap.addEventListener('mousedown', function () {\n document.addEventListener('mousemove', danmakuMove);\n document.addEventListener('mouseup', danmakuUp);\n danmakuSettingBox.classList.add('dplayer-setting-danmaku-active');\n });\n }\n };\n settingEvent();\n 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 this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n var measureStyle = getComputedStyle(this.element.getElementsByClassName('dplayer-danmaku-item')[0], null);\n var context = document.createElement('canvas').getContext('2d');\n context.font = measureStyle.getPropertyValue('font-size') + ' ' + measureStyle.getPropertyValue('font-family');\n this.danmakuMeasure = function (text) {\n return context.measureText(text).width;\n };\n if (this.option.danmaku) {\n this.danIndex = 0;\n this.readDanmaku();\n } else {\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 htmlEncode = function htmlEncode(str) {\n return str.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/'/g, ''').replace(/\\//g, '/');\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 var danmakuData = {\n token: _this.option.danmaku.token,\n player: _this.option.danmaku.id,\n author: _this.option.danmaku.user,\n time: _this.video.currentTime,\n text: commentInput.value,\n color: _this.element.querySelector('.dplayer-comment-setting-color input:checked').value,\n type: _this.element.querySelector('.dplayer-comment-setting-type input:checked').value\n };\n _this.option.apiBackend.send(_this.option.danmaku.api, danmakuData);\n commentInput.value = '';\n closeComment();\n _this.dan.splice(_this.danIndex, 0, danmakuData);\n _this.danIndex++;\n var danmaku = {\n text: htmlEncode(danmakuData.text),\n color: danmakuData.color,\n type: danmakuData.type,\n border: '2px solid ' + _this.option.theme\n };\n _this.pushDanmaku(danmaku);\n };\n var closeCommentSetting = function closeCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n }\n };\n var toggleCommentSetting = function toggleCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n } else {\n commentSettingBox.classList.add('dplayer-comment-setting-open');\n }\n };\n 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(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 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 var resetAnimation = function resetAnimation() {\n var danWidth = danContainer.offsetWidth;\n var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i6 = 0; _i6 < items.length; _i6++) {\n items[_i6].style.transform = 'translateX(-' + danWidth + 'px)';\n }\n };\n this.element.addEventListener('fullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('mozfullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('webkitfullscreenchange', function () {\n resetAnimation();\n });\n 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 resetAnimation();\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 resetAnimation();\n }\n });\n var handleKeyDown = function handleKeyDown(e) {\n var tag = document.activeElement.tagName.toUpperCase();\n var editable = document.activeElement.getAttribute('contenteditable');\n if (tag !== 'INPUT' && tag !== 'TEXTAREA' && editable !== '' && editable !== 'true') {\n var event = e || window.event;\n var percentage = void 0;\n switch (event.keyCode) {\n case 32:\n event.preventDefault();\n _this.toggle();\n break;\n case 37:\n event.preventDefault();\n _this.seek(_this.video.currentTime - 5);\n break;\n case 39:\n event.preventDefault();\n _this.seek(_this.video.currentTime + 5);\n break;\n case 38:\n event.preventDefault();\n percentage = _this.video.volume + 0.1;\n _this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = _this.video.volume - 0.1;\n _this.volume(percentage);\n break;\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', function (e) {\n var event = e || window.event;\n switch (event.keyCode) {\n case 27:\n if (_this.element.classList.contains('dplayer-fulled')) {\n _this.element.classList.remove('dplayer-fulled');\n resetAnimation();\n }\n break;\n }\n });\n 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 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 this.video.currentTime = time;\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 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 this.trigger('pause');\n }\n },\n {\n key: 'volume',\n value: function volume(percentage) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n this.video.volume = percentage;\n if (this.video.muted) {\n this.video.muted = false;\n }\n this.switchVolumeIcon();\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: '_readAllEndpoints',\n value: function _readAllEndpoints(endpoints, finish) {\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.notice(err.response.msg);\n } else {\n _this2.notice('Request was unsuccessful: ' + err.status);\n }\n results[i] = [];\n } else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return finish(results);\n }\n };\n };\n for (var i = 0; i < endpoints.length; ++i) {\n this.option.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n },\n {\n key: 'readDanmaku',\n value: function readDanmaku() {\n var _this3 = this;\n var apiurl = void 0;\n if (this.option.danmaku.maximum) {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id + '&max=' + this.option.danmaku.maximum;\n } else {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id;\n }\n var endpoints = (this.option.danmaku.addition || []).slice(0);\n endpoints.push(apiurl);\n this._readAllEndpoints(endpoints, function (results) {\n _this3.danIndex = 0;\n _this3.dan = [].concat.apply([], results).sort(function (a, b) {\n return a.time - b.time;\n });\n _this3.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n if (_this3.option.autoplay && !_utils.isMobile) {\n _this3.play();\n } else if (_utils.isMobile) {\n _this3.pause();\n }\n });\n }\n },\n {\n key: 'pushDanmaku',\n value: function pushDanmaku(danmaku) {\n var _this4 = this;\n var danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n var itemHeight = this.arrow ? 24 : 30;\n var danWidth = danContainer.offsetWidth;\n var danHeight = danContainer.offsetHeight;\n var itemY = parseInt(danHeight / itemHeight);\n var danItemRight = function danItemRight(ele) {\n var eleWidth = ele.offsetWidth || parseInt(ele.style.width);\n var eleRight = ele.getBoundingClientRect().right || danContainer.getBoundingClientRect().right + eleWidth;\n return danContainer.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 _loop2 = function _loop2(i) {\n var item = _this4.danTunnel[type][i + ''];\n if (item && item.length) {\n for (var j = 0; j < item.length; j++) {\n var danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(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 _ret2 = _loop2(i);\n if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === 'object')\n return _ret2.v;\n }\n };\n if (Object.prototype.toString.call(danmaku) !== '[object Array]') {\n danmaku = [danmaku];\n }\n var docFragment = document.createDocumentFragment();\n var _loop3 = function _loop3(i) {\n if (!danmaku[i].type) {\n danmaku[i].type = 'right';\n }\n if (!danmaku[i].color) {\n danmaku[i].color = '#fff';\n }\n var item = document.createElement('div');\n item.classList.add('dplayer-danmaku-item');\n item.classList.add('dplayer-danmaku-' + danmaku[i].type);\n item.innerHTML = danmaku[i].text;\n item.style.opacity = _this4.danOpacity;\n item.style.color = danmaku[i].color;\n item.style.border = danmaku[i].border;\n item.addEventListener('animationend', function () {\n danContainer.removeChild(item);\n });\n var itemWidth = _this4.danmakuMeasure(danmaku[i].text);\n switch (danmaku[i].type) {\n case 'right':\n item.style.width = itemWidth + 1 + 'px';\n item.style.top = itemHeight * getTunnel(item, danmaku[i].type, itemWidth) + 'px';\n item.style.transform = 'translateX(-' + danWidth + 'px)';\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, danmaku[i].type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, danmaku[i].type) + 'px';\n break;\n default:\n console.error('Can\\'t handled danmaku type: ' + danmaku[i].type);\n }\n item.classList.add('dplayer-danmaku-move');\n docFragment.appendChild(item);\n };\n for (var i = 0; i < danmaku.length; i++) {\n _loop3(i);\n }\n danContainer.appendChild(docFragment);\n return docFragment;\n }\n },\n {\n key: 'switchVideo',\n value: function switchVideo(video, danmaku) {\n this.video.poster = video.pic ? video.pic : '';\n this.video.src = video.url;\n this.pause();\n if (danmaku) {\n this.dan = [];\n this.danIndex = 0;\n this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'block';\n this.updateBar('played', 0, 'width');\n this.updateBar('loaded', 0, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = '00:00';\n this.element.getElementsByClassName('dplayer-danmaku')[0].innerHTML = '';\n this.danTuel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.option.danmaku = danmaku;\n this.readDanmaku();\n }\n }\n },\n {\n key: 'initVideo',\n value: function initVideo() {\n var _this5 = 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 if (this.option.danmaku) {\n this.video.addEventListener('seeking', function () {\n for (var i = 0; i < _this5.dan.length; i++) {\n if (_this5.dan[i].time >= _this5.video.currentTime) {\n _this5.danIndex = i;\n return;\n }\n _this5.danIndex = _this5.dan.length;\n }\n });\n }\n this.video.addEventListener('durationchange', function () {\n if (_this5.video.duration !== 1) {\n _this5.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = _utils2.default.secondToTime(_this5.video.duration);\n }\n });\n this.video.addEventListener('progress', function () {\n var percentage = _this5.video.buffered.length ? _this5.video.buffered.end(_this5.video.buffered.length - 1) / _this5.video.duration : 0;\n _this5.updateBar('loaded', percentage, 'width');\n });\n this.video.addEventListener('error', function () {\n _this5.notice(_this5.tran('This video fails to load'), -1);\n _this5.trigger('pause');\n });\n this.video.addEventListener('canplay', function () {\n _this5.trigger('canplay');\n });\n this.ended = false;\n this.video.addEventListener('ended', function () {\n _this5.updateBar('played', 1, 'width');\n if (!_this5.loop) {\n _this5.ended = true;\n _this5.pause();\n _this5.trigger('ended');\n } else {\n _this5.seek(0);\n _this5.video.play();\n }\n _this5.danIndex = 0;\n });\n this.video.addEventListener('play', function () {\n if (_this5.paused) {\n _this5.play();\n }\n });\n this.video.addEventListener('pause', function () {\n if (!_this5.paused) {\n _this5.pause();\n }\n });\n this.video.volume = parseInt(this.element.getElementsByClassName('dplayer-volume-bar-inner')[0].style.width) / 100;\n }\n },\n {\n key: 'switchQuality',\n value: function switchQuality(index) {\n var _this6 = 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 (_this6.prevVideo) {\n if (_this6.video.currentTime !== _this6.prevVideo.currentTime) {\n _this6.seek(_this6.prevVideo.currentTime);\n return;\n }\n parent.removeChild(_this6.prevVideo);\n _this6.video.classList.add('dplayer-video-current');\n if (!paused) {\n _this6.video.play();\n }\n _this6.prevVideo = null;\n _this6.notice(_this6.tran('Switched to') + ' ' + _this6.quality.name + ' ' + _this6.tran('quality'));\n _this6.switchingQuality = false;\n }\n });\n }\n },\n {\n key: 'timeTipsHandler',\n value: function timeTipsHandler(pbar, timeTips) {\n var _this7 = 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 (!_this7.video.duration) {\n return;\n }\n var clientX = e.clientX;\n var px = cumulativeOffset(pbar).left;\n var tx = clientX - px;\n timeTips.innerText = _utils2.default.secondToTime(_this7.video.duration * (tx / pbar.offsetWidth));\n timeTips.style.left = tx - 20 + 'px';\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n if (_this7.isTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n _this7.isTipsShow = true;\n break;\n case 'mouseleave':\n case 'mouseout':\n if (!_this7.isTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n _this7.isTipsShow = false;\n break;\n }\n };\n }\n },\n {\n key: 'notice',\n value: function notice(text, time) {\n var noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = 1;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n if (time && time < 0) {\n return;\n }\n this.noticeTime = setTimeout(function () {\n noticeEle.style.opacity = 0;\n }, time || 2000);\n }\n }\n ]);\n return DPlayer;\n}();\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 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) {\n SendXMLHttpRequest(endpoint, danmakuData, function (xhr, response) {\n console.log('Post danmaku: ', response);\n }, function (xhr, response) {\n alert(response.msg);\n }, function (xhr) {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n read: function read(endpoint, cbk) {\n SendXMLHttpRequest(endpoint, null, function (xhr, response) {\n cbk(null, response.danmaku);\n }, function (xhr, response) {\n cbk({\n status: xhr.status,\n response: response\n });\n }, function (xhr) {\n cbk({\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};\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/******/ ]);\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 660b0524acba34390a9b","'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('%c DPlayer ' + DPLAYER_VERSION + ' %c http://dplayer.js.org ', '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 _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}();\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);\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 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 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 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.initVideo();\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 bar = {};\n bar.playedBar = this.element.getElementsByClassName('dplayer-played')[0];\n bar.loadedBar = this.element.getElementsByClassName('dplayer-loaded')[0];\n var pbar = this.element.getElementsByClassName('dplayer-bar-wrap')[0];\n var pbarTimeTips = this.element.getElementsByClassName('dplayer-bar-time')[0];\n var barWidth = void 0;\n var lastPlayPos = 0;\n var currentPlayPos = 0;\n var bufferingDetected = false;\n this.danmakuTime = false;\n this.playedTime = 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.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 if (_this.danmakuTime && _this.option.danmaku && showdan && _this.dan) {\n var item = _this.dan[_this.danIndex];\n var danmakus = [];\n while (item && _this.video.currentTime > parseFloat(item.time)) {\n danmakus.push(item);\n item = _this.dan[++_this.danIndex];\n }\n _this.pushDanmaku(danmakus);\n }\n window.requestAnimationFrame(_this.animationFrame);\n };\n window.requestAnimationFrame(this.animationFrame);\n this.setTime = function (type) {\n if (!type) {\n _this.danmakuTime = true;\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.danmakuTime = false;\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.isTipsShow = false;\n this.timeTipsHandler = this.timeTipsHandler(pbar, pbarTimeTips).bind(this);\n pbar.addEventListener('mousemove', this.timeTipsHandler);\n pbar.addEventListener('mouseover', this.timeTipsHandler);\n pbar.addEventListener('mouseenter', this.timeTipsHandler);\n pbar.addEventListener('mouseout', this.timeTipsHandler);\n pbar.addEventListener('mouseleave', this.timeTipsHandler);\n 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 bar.volumeBar = this.element.getElementsByClassName('dplayer-volume-bar-inner')[0];\n var volumeEle = this.element.getElementsByClassName('dplayer-volume')[0];\n var volumeBarWrapWrap = this.element.getElementsByClassName('dplayer-volume-bar-wrap')[0];\n var volumeBarWrap = this.element.getElementsByClassName('dplayer-volume-bar')[0];\n var volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0];\n var vWidth = 35;\n this.switchVolumeIcon = function () {\n var volumeicon = _this.element.getElementsByClassName('dplayer-volume-icon')[0];\n if (_this.video.volume >= 0.8) {\n volumeicon.innerHTML = (0, _svg2.default)('volume-up');\n } else if (_this.video.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.video.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 var hideTime = 0;\n if (!_utils.isMobile) {\n var hideController = function hideController() {\n _this.element.classList.remove('dplayer-hide-controller');\n clearTimeout(hideTime);\n hideTime = setTimeout(function () {\n if (_this.video.played.length) {\n _this.element.classList.add('dplayer-hide-controller');\n closeSetting();\n closeComment();\n }\n }, 2000);\n };\n this.element.addEventListener('mousemove', hideController);\n this.element.addEventListener('click', hideController);\n }\n this.danOpacity = localStorage.getItem('DPlayer-opacity') || 0.7;\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 danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\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.option.danmaku) {\n for (var _i2 = 0; _i2 < _this.dan.length; _i2++) {\n if (_this.dan[_i2].time >= _this.video.currentTime) {\n _this.danIndex = _i2;\n break;\n }\n _this.danIndex = _this.dan.length;\n }\n if (!_this.paused) {\n _this.setTime('danmaku');\n }\n }\n } else {\n showdan = false;\n if (_this.option.danmaku) {\n _this.clearTime('danmaku');\n danContainer.innerHTML = '';\n _this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n }\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(_i3) {\n speedItem[_i3].addEventListener('click', function () {\n _this.video.playbackRate = speedItem[_i3].dataset.speed;\n closeSetting();\n });\n };\n for (var _i3 = 0; _i3 < speedItem.length; _i3++) {\n _loop(_i3);\n }\n });\n if (_this.option.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.danOpacity, '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 var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i4 = 0; _i4 < items.length; _i4++) {\n items[_i4].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n };\n var danmakuUp = function danmakuUp() {\n document.removeEventListener('mouseup', danmakuUp);\n document.removeEventListener('mousemove', danmakuMove);\n danmakuSettingBox.classList.remove('dplayer-setting-danmaku-active');\n };\n 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 var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i5 = 0; _i5 < items.length; _i5++) {\n items[_i5].style.opacity = percentage;\n }\n _this.danOpacity = percentage;\n localStorage.setItem('DPlayer-opacity', _this.danOpacity);\n });\n danmakuBarWrapWrap.addEventListener('mousedown', function () {\n document.addEventListener('mousemove', danmakuMove);\n document.addEventListener('mouseup', danmakuUp);\n danmakuSettingBox.classList.add('dplayer-setting-danmaku-active');\n });\n }\n };\n settingEvent();\n 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 this.danTunnel = {\n right: {},\n top: {},\n bottom: {}\n };\n var measureStyle = getComputedStyle(this.element.getElementsByClassName('dplayer-danmaku-item')[0], null);\n var context = document.createElement('canvas').getContext('2d');\n context.font = measureStyle.getPropertyValue('font-size') + ' ' + measureStyle.getPropertyValue('font-family');\n this.danmakuMeasure = function (text) {\n return context.measureText(text).width;\n };\n if (this.option.danmaku) {\n this.danIndex = 0;\n this.readDanmaku();\n } else {\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 htmlEncode = function htmlEncode(str) {\n return str.replace(/&/g, '&').replace(//g, '>').replace(/\"/g, '"').replace(/'/g, ''').replace(/\\//g, '/');\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 var danmakuData = {\n token: _this.option.danmaku.token,\n player: _this.option.danmaku.id,\n author: _this.option.danmaku.user,\n time: _this.video.currentTime,\n text: commentInput.value,\n color: _this.element.querySelector('.dplayer-comment-setting-color input:checked').value,\n type: _this.element.querySelector('.dplayer-comment-setting-type input:checked').value\n };\n _this.option.apiBackend.send(_this.option.danmaku.api, danmakuData);\n commentInput.value = '';\n closeComment();\n _this.dan.splice(_this.danIndex, 0, danmakuData);\n _this.danIndex++;\n var danmaku = {\n text: htmlEncode(danmakuData.text),\n color: danmakuData.color,\n type: danmakuData.type,\n border: '2px solid ' + _this.option.theme\n };\n _this.pushDanmaku(danmaku);\n };\n var closeCommentSetting = function closeCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n }\n };\n var toggleCommentSetting = function toggleCommentSetting() {\n if (commentSettingBox.classList.contains('dplayer-comment-setting-open')) {\n commentSettingBox.classList.remove('dplayer-comment-setting-open');\n } else {\n commentSettingBox.classList.add('dplayer-comment-setting-open');\n }\n };\n 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(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 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 var resetAnimation = function resetAnimation() {\n var danWidth = danContainer.offsetWidth;\n var items = _this.element.getElementsByClassName('dplayer-danmaku-item');\n for (var _i6 = 0; _i6 < items.length; _i6++) {\n items[_i6].style.transform = 'translateX(-' + danWidth + 'px)';\n }\n };\n this.element.addEventListener('fullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('mozfullscreenchange', function () {\n resetAnimation();\n });\n this.element.addEventListener('webkitfullscreenchange', function () {\n resetAnimation();\n });\n 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 resetAnimation();\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 resetAnimation();\n }\n });\n var handleKeyDown = function handleKeyDown(e) {\n var tag = document.activeElement.tagName.toUpperCase();\n var editable = document.activeElement.getAttribute('contenteditable');\n if (tag !== 'INPUT' && tag !== 'TEXTAREA' && editable !== '' && editable !== 'true') {\n var event = e || window.event;\n var percentage = void 0;\n switch (event.keyCode) {\n case 32:\n event.preventDefault();\n _this.toggle();\n break;\n case 37:\n event.preventDefault();\n _this.seek(_this.video.currentTime - 5);\n break;\n case 39:\n event.preventDefault();\n _this.seek(_this.video.currentTime + 5);\n break;\n case 38:\n event.preventDefault();\n percentage = _this.video.volume + 0.1;\n _this.volume(percentage);\n break;\n case 40:\n event.preventDefault();\n percentage = _this.video.volume - 0.1;\n _this.volume(percentage);\n break;\n }\n }\n };\n if (this.option.hotkey) {\n document.addEventListener('keydown', handleKeyDown);\n }\n document.addEventListener('keydown', function (e) {\n var event = e || window.event;\n switch (event.keyCode) {\n case 27:\n if (_this.element.classList.contains('dplayer-fulled')) {\n _this.element.classList.remove('dplayer-fulled');\n resetAnimation();\n }\n break;\n }\n });\n 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 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 this.video.currentTime = time;\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 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 this.trigger('pause');\n }\n },\n {\n key: 'volume',\n value: function volume(percentage) {\n percentage = percentage > 0 ? percentage : 0;\n percentage = percentage < 1 ? percentage : 1;\n this.updateBar('volume', percentage, 'width');\n this.video.volume = percentage;\n if (this.video.muted) {\n this.video.muted = false;\n }\n this.switchVolumeIcon();\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: '_readAllEndpoints',\n value: function _readAllEndpoints(endpoints, finish) {\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.notice(err.response.msg);\n } else {\n _this2.notice('Request was unsuccessful: ' + err.status);\n }\n results[i] = [];\n } else {\n results[i] = data;\n }\n if (readCount === endpoints.length) {\n return finish(results);\n }\n };\n };\n for (var i = 0; i < endpoints.length; ++i) {\n this.option.apiBackend.read(endpoints[i], cbk(i));\n }\n }\n },\n {\n key: 'readDanmaku',\n value: function readDanmaku() {\n var _this3 = this;\n var apiurl = void 0;\n if (this.option.danmaku.maximum) {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id + '&max=' + this.option.danmaku.maximum;\n } else {\n apiurl = this.option.danmaku.api + '?id=' + this.option.danmaku.id;\n }\n var endpoints = (this.option.danmaku.addition || []).slice(0);\n endpoints.push(apiurl);\n this._readAllEndpoints(endpoints, function (results) {\n _this3.danIndex = 0;\n _this3.dan = [].concat.apply([], results).sort(function (a, b) {\n return a.time - b.time;\n });\n _this3.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'none';\n if (_this3.option.autoplay && !_utils.isMobile) {\n _this3.play();\n } else if (_utils.isMobile) {\n _this3.pause();\n }\n });\n }\n },\n {\n key: 'pushDanmaku',\n value: function pushDanmaku(danmaku) {\n var _this4 = this;\n var danContainer = this.element.getElementsByClassName('dplayer-danmaku')[0];\n var itemHeight = this.arrow ? 24 : 30;\n var danWidth = danContainer.offsetWidth;\n var danHeight = danContainer.offsetHeight;\n var itemY = parseInt(danHeight / itemHeight);\n var danItemRight = function danItemRight(ele) {\n var eleWidth = ele.offsetWidth || parseInt(ele.style.width);\n var eleRight = ele.getBoundingClientRect().right || danContainer.getBoundingClientRect().right + eleWidth;\n return danContainer.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 _loop2 = function _loop2(i) {\n var item = _this4.danTunnel[type][i + ''];\n if (item && item.length) {\n for (var j = 0; j < item.length; j++) {\n var danRight = danItemRight(item[j]) - 10;\n if (danRight <= danWidth - tmp * danSpeed(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 _ret2 = _loop2(i);\n if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === 'object')\n return _ret2.v;\n }\n };\n if (Object.prototype.toString.call(danmaku) !== '[object Array]') {\n danmaku = [danmaku];\n }\n var docFragment = document.createDocumentFragment();\n var _loop3 = function _loop3(i) {\n if (!danmaku[i].type) {\n danmaku[i].type = 'right';\n }\n if (!danmaku[i].color) {\n danmaku[i].color = '#fff';\n }\n var item = document.createElement('div');\n item.classList.add('dplayer-danmaku-item');\n item.classList.add('dplayer-danmaku-' + danmaku[i].type);\n item.innerHTML = danmaku[i].text;\n item.style.opacity = _this4.danOpacity;\n item.style.color = danmaku[i].color;\n item.style.border = danmaku[i].border;\n item.addEventListener('animationend', function () {\n danContainer.removeChild(item);\n });\n var itemWidth = _this4.danmakuMeasure(danmaku[i].text);\n switch (danmaku[i].type) {\n case 'right':\n item.style.width = itemWidth + 1 + 'px';\n item.style.top = itemHeight * getTunnel(item, danmaku[i].type, itemWidth) + 'px';\n item.style.transform = 'translateX(-' + danWidth + 'px)';\n break;\n case 'top':\n item.style.top = itemHeight * getTunnel(item, danmaku[i].type) + 'px';\n break;\n case 'bottom':\n item.style.bottom = itemHeight * getTunnel(item, danmaku[i].type) + 'px';\n break;\n default:\n console.error('Can\\'t handled danmaku type: ' + danmaku[i].type);\n }\n item.classList.add('dplayer-danmaku-move');\n docFragment.appendChild(item);\n };\n for (var i = 0; i < danmaku.length; i++) {\n _loop3(i);\n }\n danContainer.appendChild(docFragment);\n return docFragment;\n }\n },\n {\n key: 'switchVideo',\n value: function switchVideo(video, danmaku) {\n this.video.poster = video.pic ? video.pic : '';\n this.video.src = video.url;\n this.pause();\n if (danmaku) {\n this.dan = [];\n this.danIndex = 0;\n this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'block';\n this.updateBar('played', 0, 'width');\n this.updateBar('loaded', 0, 'width');\n this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = '00:00';\n this.element.getElementsByClassName('dplayer-danmaku')[0].innerHTML = '';\n this.danTuel = {\n right: {},\n top: {},\n bottom: {}\n };\n this.option.danmaku = danmaku;\n this.readDanmaku();\n }\n }\n },\n {\n key: 'initVideo',\n value: function initVideo() {\n var _this5 = 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 if (this.option.danmaku) {\n this.video.addEventListener('seeking', function () {\n for (var i = 0; i < _this5.dan.length; i++) {\n if (_this5.dan[i].time >= _this5.video.currentTime) {\n _this5.danIndex = i;\n return;\n }\n _this5.danIndex = _this5.dan.length;\n }\n });\n }\n this.video.addEventListener('durationchange', function () {\n if (_this5.video.duration !== 1) {\n _this5.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = _utils2.default.secondToTime(_this5.video.duration);\n }\n });\n this.video.addEventListener('progress', function () {\n var percentage = _this5.video.buffered.length ? _this5.video.buffered.end(_this5.video.buffered.length - 1) / _this5.video.duration : 0;\n _this5.updateBar('loaded', percentage, 'width');\n });\n this.video.addEventListener('error', function () {\n _this5.notice(_this5.tran('This video fails to load'), -1);\n _this5.trigger('pause');\n });\n this.video.addEventListener('canplay', function () {\n _this5.trigger('canplay');\n });\n this.ended = false;\n this.video.addEventListener('ended', function () {\n _this5.updateBar('played', 1, 'width');\n if (!_this5.loop) {\n _this5.ended = true;\n _this5.pause();\n _this5.trigger('ended');\n } else {\n _this5.seek(0);\n _this5.video.play();\n }\n _this5.danIndex = 0;\n });\n this.video.addEventListener('play', function () {\n if (_this5.paused) {\n _this5.play();\n }\n });\n this.video.addEventListener('pause', function () {\n if (!_this5.paused) {\n _this5.pause();\n }\n });\n this.video.volume = parseInt(this.element.getElementsByClassName('dplayer-volume-bar-inner')[0].style.width) / 100;\n }\n },\n {\n key: 'switchQuality',\n value: function switchQuality(index) {\n var _this6 = 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 (_this6.prevVideo) {\n if (_this6.video.currentTime !== _this6.prevVideo.currentTime) {\n _this6.seek(_this6.prevVideo.currentTime);\n return;\n }\n parent.removeChild(_this6.prevVideo);\n _this6.video.classList.add('dplayer-video-current');\n if (!paused) {\n _this6.video.play();\n }\n _this6.prevVideo = null;\n _this6.notice(_this6.tran('Switched to') + ' ' + _this6.quality.name + ' ' + _this6.tran('quality'));\n _this6.switchingQuality = false;\n }\n });\n }\n },\n {\n key: 'timeTipsHandler',\n value: function timeTipsHandler(pbar, timeTips) {\n var _this7 = 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 (!_this7.video.duration) {\n return;\n }\n var clientX = e.clientX;\n var px = cumulativeOffset(pbar).left;\n var tx = clientX - px;\n timeTips.innerText = _utils2.default.secondToTime(_this7.video.duration * (tx / pbar.offsetWidth));\n timeTips.style.left = tx - 20 + 'px';\n switch (e.type) {\n case 'mouseenter':\n case 'mouseover':\n case 'mousemove':\n if (_this7.isTipsShow) {\n return;\n }\n timeTips.classList.remove('hidden');\n _this7.isTipsShow = true;\n break;\n case 'mouseleave':\n case 'mouseout':\n if (!_this7.isTipsShow) {\n return;\n }\n timeTips.classList.add('hidden');\n _this7.isTipsShow = false;\n break;\n }\n };\n }\n },\n {\n key: 'notice',\n value: function notice(text, time) {\n var noticeEle = this.element.getElementsByClassName('dplayer-notice')[0];\n noticeEle.innerHTML = text;\n noticeEle.style.opacity = 1;\n if (this.noticeTime) {\n clearTimeout(this.noticeTime);\n }\n if (time && time < 0) {\n return;\n }\n this.noticeTime = setTimeout(function () {\n noticeEle.style.opacity = 0;\n }, time || 2000);\n }\n }\n ]);\n return DPlayer;\n}();\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 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) {\n SendXMLHttpRequest(endpoint, danmakuData, function (xhr, response) {\n console.log('Post danmaku: ', response);\n }, function (xhr, response) {\n alert(response.msg);\n }, function (xhr) {\n console.log('Request was unsuccessful: ' + xhr.status);\n });\n },\n read: function read(endpoint, cbk) {\n SendXMLHttpRequest(endpoint, null, function (xhr, response) {\n cbk(null, response.danmaku);\n }, function (xhr, response) {\n cbk({\n status: xhr.status,\n response: response\n });\n }, function (xhr) {\n cbk({\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};\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"],"sourceRoot":""} \ No newline at end of file diff --git a/package.json b/package.json index 3c5a3c774..6c4ff84c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dplayer", - "version": "1.5.1", + "version": "1.5.2", "description": "Wow, such a lovely HTML5 danmaku video player", "main": "dist/DPlayer.min.js", "style": "dist/DPlayer.min.css", diff --git a/src/DPlayer.js b/src/DPlayer.js index 778cb40d0..62f13a5c9 100644 --- a/src/DPlayer.js +++ b/src/DPlayer.js @@ -5,7 +5,6 @@ import svg from './svg'; import handleOption from './option'; import i18n from './i18n'; import html from './html'; -import Video from './video'; let index = 0; @@ -73,7 +72,7 @@ class DPlayer { } // get this video manager - this.video = new Video(this.element.getElementsByClassName('dplayer-video-current')); + this.video = this.element.getElementsByClassName('dplayer-video-current')[0]; this.initVideo(); @@ -138,16 +137,16 @@ class DPlayer { const setCheckLoadingTime = () => { this.checkLoading = setInterval(() => { // whether the video is buffering - currentPlayPos = this.video.currentTime(); + currentPlayPos = this.video.currentTime; if (!bufferingDetected && currentPlayPos < lastPlayPos + 0.01 - && !this.video.attr('paused')) { + && !this.video.paused) { this.element.classList.add('dplayer-loading'); bufferingDetected = true; } if (bufferingDetected && currentPlayPos > lastPlayPos + 0.01 - && !this.video.attr('paused')) { + && !this.video.paused) { this.element.classList.remove('dplayer-loading'); bufferingDetected = false; } @@ -161,14 +160,14 @@ class DPlayer { this.animationFrame = () => { if (this.playedTime) { - this.updateBar('played', this.video.currentTime() / this.video.duration, 'width'); - this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = utils.secondToTime(this.video.currentTime()); + this.updateBar('played', this.video.currentTime / this.video.duration, 'width'); + this.element.getElementsByClassName('dplayer-ptime')[0].innerHTML = utils.secondToTime(this.video.currentTime); this.trigger('playing'); } if (this.danmakuTime && this.option.danmaku && showdan && this.dan) { let item = this.dan[this.danIndex]; const danmakus = []; - while (item && this.video.currentTime() > parseFloat(item.time)) { + while (item && this.video.currentTime > parseFloat(item.time)) { danmakus.push(item); item = this.dan[++this.danIndex]; } @@ -212,7 +211,7 @@ class DPlayer { percentage = percentage > 0 ? percentage : 0; percentage = percentage < 1 ? percentage : 1; this.updateBar('played', percentage, 'width'); - this.video.seek(parseFloat(bar.playedBar.style.width) / 100 * this.video.duration); + this.seek(parseFloat(bar.playedBar.style.width) / 100 * this.video.duration); }); this.isTipsShow = false; @@ -236,7 +235,7 @@ class DPlayer { const thumbUp = () => { document.removeEventListener('mouseup', thumbUp); document.removeEventListener('mousemove', thumbMove); - this.video.seek(parseFloat(bar.playedBar.style.width) / 100 * this.video.duration); + this.seek(parseFloat(bar.playedBar.style.width) / 100 * this.video.duration); this.setTime(); }; @@ -260,10 +259,10 @@ class DPlayer { this.switchVolumeIcon = () => { const volumeicon = this.element.getElementsByClassName('dplayer-volume-icon')[0]; - if (this.video.attr('volume') >= 0.8) { + if (this.video.volume >= 0.8) { volumeicon.innerHTML = svg('volume-up'); } - else if (this.video.attr('volume') > 0) { + else if (this.video.volume > 0) { volumeicon.innerHTML = svg('volume-down'); } else { @@ -292,13 +291,13 @@ class DPlayer { volumeEle.classList.add('dplayer-volume-active'); }); volumeicon.addEventListener('click', () => { - if (this.video.attr('muted')) { - this.video.attr('muted', false); + if (this.video.muted) { + this.video.muted = false; this.switchVolumeIcon(); - this.updateBar('volume', this.video.attr('volume'), 'width'); + this.updateBar('volume', this.video.volume, 'width'); } else { - this.video.attr('muted', true); + this.video.muted = true; volumeicon.innerHTML = svg('volume-off'); this.updateBar('volume', 0, 'width'); } @@ -314,7 +313,7 @@ class DPlayer { this.element.classList.remove('dplayer-hide-controller'); clearTimeout(hideTime); hideTime = setTimeout(() => { - if (this.video.attr('played').length) { + if (this.video.played.length) { this.element.classList.add('dplayer-hide-controller'); closeSetting(); closeComment(); @@ -394,7 +393,7 @@ class DPlayer { showdan = true; if (this.option.danmaku) { for (let i = 0; i < this.dan.length; i++) { - if (this.dan[i].time >= this.video.currentTime()) { + if (this.dan[i].time >= this.video.currentTime) { this.danIndex = i; break; } @@ -429,7 +428,7 @@ class DPlayer { const speedItem = settingBox.getElementsByClassName('dplayer-setting-speed-item'); for (let i = 0; i < speedItem.length; i++) { speedItem[i].addEventListener('click', () => { - this.video.attr('playbackRate', speedItem[i].dataset.speed); + this.video.playbackRate = speedItem[i].dataset.speed; closeSetting(); }); } @@ -547,7 +546,7 @@ class DPlayer { token: this.option.danmaku.token, player: this.option.danmaku.id, author: this.option.danmaku.user, - time: this.video.currentTime(), + time: this.video.currentTime, text: commentInput.value, color: this.element.querySelector('.dplayer-comment-setting-color input:checked').value, type: this.element.querySelector('.dplayer-comment-setting-type input:checked').value @@ -676,8 +675,8 @@ class DPlayer { else if (this.element.webkitRequestFullscreen) { this.element.webkitRequestFullscreen(); } - else if (this.video.attr('webkitEnterFullscreen')) { // Safari for iOS - this.video.current.webkitEnterFullscreen(); + else if (this.video.webkitEnterFullscreen) { // Safari for iOS + this.video.webkitEnterFullscreen(); } } else { @@ -720,20 +719,20 @@ class DPlayer { break; case 37: event.preventDefault(); - this.video.seek(this.video.currentTime() - 5); + this.seek(this.video.currentTime - 5); break; case 39: event.preventDefault(); - this.video.seek(this.video.currentTime() + 5); + this.seek(this.video.currentTime + 5); break; case 38: event.preventDefault(); - percentage = this.video.attr('volume') + 0.1; + percentage = this.video.volume + 0.1; this.volume(percentage); break; case 40: event.preventDefault(); - percentage = this.video.attr('volume') - 0.1; + percentage = this.video.volume - 0.1; this.volume(percentage); break; } @@ -809,9 +808,9 @@ class DPlayer { const camareIcon = this.element.getElementsByClassName('dplayer-camera-icon')[0]; camareIcon.addEventListener('click', () => { const canvas = document.createElement("canvas"); - canvas.width = this.video.attr('videoWidth'); - canvas.height = this.video.attr('videoHeight'); - canvas.getContext('2d').drawImage(this.video.current, 0, 0, canvas.width, canvas.height); + canvas.width = this.video.videoWidth; + canvas.height = this.video.videoHeight; + canvas.getContext('2d').drawImage(this.video, 0, 0, canvas.width, canvas.height); camareIcon.href = canvas.toDataURL(); camareIcon.download = "DPlayer.png"; @@ -822,14 +821,23 @@ class DPlayer { } /** - * Play music - */ - play (time) { - if (Object.prototype.toString.call(time) === '[object Number]') { - this.video.seek(time); + * Seek video + */ + seek (time) { + time = Math.max(time, 0); + if (this.video.duration) { + time = Math.min(time, this.video.duration); } + + this.video.currentTime = time; + } + + /** + * Play video + */ + play () { this.paused = false; - if (this.video.attr('paused')) { + if (this.video.paused) { this.bezel.innerHTML = svg('play'); this.bezel.classList.add('dplayer-bezel-transition'); } @@ -843,13 +851,13 @@ class DPlayer { } /** - * Pause music + * Pause video */ pause () { this.paused = true; this.element.classList.remove('dplayer-loading'); - if (!this.video.attr('paused')) { + if (!this.video.paused) { this.bezel.innerHTML = svg('pause'); this.bezel.classList.add('dplayer-bezel-transition'); } @@ -869,9 +877,9 @@ class DPlayer { percentage = percentage > 0 ? percentage : 0; percentage = percentage < 1 ? percentage : 1; this.updateBar('volume', percentage, 'width'); - this.video.attr('volume', percentage); - if (this.video.attr('muted')) { - this.video.attr('muted', false); + this.video.volume = percentage; + if (this.video.muted) { + this.video.muted = false; } this.switchVolumeIcon(); } @@ -880,7 +888,7 @@ class DPlayer { * Toggle between play and pause */ toggle () { - if (this.video.attr('paused')) { + if (this.video.paused) { this.play(); } else { @@ -1071,8 +1079,8 @@ class DPlayer { * @param {Object} danmaku - new danmaku info */ switchVideo (video, danmaku) { - this.video.attr('poster', video.pic ? video.pic : ''); - this.video.attr('src', video.url); + this.video.poster = video.pic ? video.pic : ''; + this.video.src = video.url; this.pause(); if (danmaku) { this.dan = []; @@ -1096,7 +1104,7 @@ class DPlayer { // Support HTTP Live Streaming let enablehls; if (this.option.video.type === 'auto') { - enablehls = /m3u8(#|\?|$)/i.exec(this.option.video.url); + enablehls = /m3u8(#|\?|$)/i.exec(this.video.src); } else if (this.option.video.type === 'hls') { enablehls = true; @@ -1107,14 +1115,14 @@ class DPlayer { if (enablehls && Hls.isSupported()) { // this.element.getElementsByClassName('dplayer-time')[0].style.display = 'none'; const hls = new Hls(); - hls.loadSource(this.option.video.url[0]); - hls.attachMedia(this.video.current); + hls.loadSource(this.video.src); + hls.attachMedia(this.video); } // Support FLV let enableflv; if (this.option.video.type === 'auto') { - enableflv = /.flv(#|\?|$)/i.exec(this.option.video.url); + enableflv = /.flv(#|\?|$)/i.exec(this.video.src); } else if (this.option.video.type === 'flv') { enableflv = true; @@ -1127,14 +1135,14 @@ class DPlayer { type: 'flv', url: this.option.video.url }); - flvPlayer.attachMediaElement(this.video.current); + flvPlayer.attachMediaElement(this.video); flvPlayer.load(); } if (this.option.danmaku) { - this.video.on('all', 'seeking', () => { + this.video.addEventListener('seeking', () => { for (let i = 0; i < this.dan.length; i++) { - if (this.dan[i].time >= this.video.currentTime()) { + if (this.dan[i].time >= this.video.currentTime) { this.danIndex = i; return; } @@ -1148,61 +1156,59 @@ class DPlayer { * video events */ // show video time: the metadata has loaded or changed - this.video.on('all', 'durationchange', (i, video) => { - if (video.duration !== 1) { // compatibility: Android browsers will output 1 at first + this.video.addEventListener('durationchange', () => { + if (this.video.duration !== 1) { // compatibility: Android browsers will output 1 at first this.element.getElementsByClassName('dplayer-dtime')[0].innerHTML = utils.secondToTime(this.video.duration); } }); // show video loaded bar: to inform interested parties of progress downloading the media - this.video.on('current', 'progress', (i, video) => { - const percentage = video.buffered.length ? video.buffered.end(video.buffered.length - 1) / video.duration : 0; + this.video.addEventListener('progress', () => { + const percentage = this.video.buffered.length ? this.video.buffered.end(this.video.buffered.length - 1) / this.video.duration : 0; this.updateBar('loaded', percentage, 'width'); }); // video download error: an error occurs - this.video.on('all', 'error', () => { + this.video.addEventListener('error', () => { this.notice(this.tran('This video fails to load'), -1); this.trigger('pause'); }); // video can play: enough data is available that the media can be played - this.video.on('current', 'canplay', () => { + this.video.addEventListener('canplay', () => { this.trigger('canplay'); }); - // music end + // video end this.ended = false; - this.video.on('all', 'ended', (i) => { - if (i === this.video.videos.length - 1) { - this.updateBar('played', 1, 'width'); - if (!this.loop) { - this.ended = true; - this.pause(); - this.trigger('ended'); - } - else { - this.video.switch(0); - this.video.play(); - } - this.danIndex = 0; + this.video.addEventListener('ended', () => { + this.updateBar('played', 1, 'width'); + if (!this.loop) { + this.ended = true; + this.pause(); + this.trigger('ended'); + } + else { + this.seek(0); + this.video.play(); } + this.danIndex = 0; }); - this.video.on('current', 'play', () => { + this.video.addEventListener('play', () => { if (this.paused) { this.play(); } }); - this.video.on('current', 'pause', () => { + this.video.addEventListener('pause', () => { if (!this.paused) { this.pause(); } }); // control volume - this.video.attr('volume', parseInt(this.element.getElementsByClassName('dplayer-volume-bar-inner')[0].style.width) / 100); + this.video.volume = parseInt(this.element.getElementsByClassName('dplayer-volume-bar-inner')[0].style.width) / 100; } switchQuality (index) { @@ -1216,25 +1222,28 @@ class DPlayer { this.quality = this.option.video.quality[index]; this.element.getElementsByClassName('dplayer-quality-icon')[0].innerHTML = this.quality.name; + const paused = this.video.paused; this.video.pause(); const videoHTML = html.video(false, null, this.option.screenshot, 'auto', this.quality.url); const videoEle = new DOMParser().parseFromString(videoHTML, 'text/html').body.firstChild; const parent = this.element.getElementsByClassName('dplayer-video-wrap')[0]; parent.insertBefore(videoEle, parent.getElementsByTagName('div')[0]); this.prevVideo = this.video; - this.video = new Video([videoEle], this.prevVideo.duration); + this.video = videoEle; this.initVideo(); - this.video.seek(this.prevVideo.currentTime()); + this.seek(this.prevVideo.currentTime); this.notice(`${this.tran('Switching to')} ${this.quality.name} ${this.tran('quality')}`, -1); - this.video.on('current', 'canplay', () => { + this.video.addEventListener('canplay', () => { if (this.prevVideo) { - if (this.video.currentTime() !== this.prevVideo.currentTime()) { - this.video.seek(this.prevVideo.currentTime()); + if (this.video.currentTime !== this.prevVideo.currentTime) { + this.seek(this.prevVideo.currentTime); return; } - parent.removeChild(this.prevVideo.current); - this.video.current.classList.add('dplayer-video-current'); - this.video.play(); + parent.removeChild(this.prevVideo); + this.video.classList.add('dplayer-video-current'); + if (!paused) { + this.video.play(); + } this.prevVideo = null; this.notice(`${this.tran('Switched to')} ${this.quality.name} ${this.tran('quality')}`); this.switchingQuality = false; diff --git a/src/video.js b/src/video.js deleted file mode 100644 index decc7c30e..000000000 --- a/src/video.js +++ /dev/null @@ -1,130 +0,0 @@ -class Video { - constructor (videos, duration = 0) { - this.videos = videos; - this.multi = this.videos.length > 1; - this.index = 0; - this.current = this.videos[this.index]; - - this.duration = duration; - this.durationArr = []; - this.eventAll = []; - this.eventCurrent = []; - - this.on('all', 'durationchange', (i, video) => { - if (video.duration !== 1) { // some Android browsers will output 1 at first - this.durationArr[i] = video.duration; - if (!duration) { - this.duration = this.durationArr.reduce((sum, cur) => sum + cur); - } - } - }); - this.on('current', 'end', () => { - this.switch(this.index + 1); - }); - } - - switch (index, time) { - if (this.index !== index) { - this.videos[index].classList.add('dplayer-video-current'); - if (!this.current.paused) { - this.videos[index].play(); - } - this.current.classList.remove('dplayer-video-current'); - this.current.pause(); - - this.index = index; - this.current = this.videos[this.index]; - this.videos[index].currentTime = time ? time : 0; - } - else { - this.videos[index].currentTime = time ? time : 0; - } - } - - // bind event - on (type, event, callback) { - if (typeof callback === 'function') { - const events = type === 'all' ? this.eventAll : this.eventCurrent; - if (!events[event]) { - events[event] = []; - } - events[event].push(callback); - - if (['seeking'].indexOf(event) === -1) { - for (let i = 0; i < this.videos.length; i++) { - this.videos[i].addEventListener(event, () => { - if (type === 'all' || this.videos[i] === this.current) { - callback(i, this.videos[i]); - } - }); - } - } - } - } - - // trigger event - trigger (type, event) { - const events = type === 'all' ? this.eventAll : this.eventCurrent; - if (events[event]) { - for (let i = 0; i < events[event].length; i++) { - events[event][i](); - } - } - } - - currentTime () { - if (this.durationArr.slice(0, this.index).length) { - return this.durationArr.slice(0, this.index).reduce((sum, cur) => sum + cur) + this.current.currentTime; - } - else { - return this.current.currentTime; - } - } - - seek (time) { - time = Math.max(time, 0); - time = Math.min(time, this.duration); - - let i = 0; - let tmptime = 0; - while (tmptime <= time) { - tmptime += this.durationArr[i]; - i++; - } - - let currentTime; - if (this.durationArr.slice(0, this.index).length) { - currentTime = time - this.durationArr.slice(0, i - 1).reduce((sum, cur) => sum + cur); - } - else { - currentTime = time; - } - - this.switch(i - 1, currentTime); - - this.trigger('all', 'seeking'); - } - - attr (option, value) { - if (value !== undefined) { - for (let i = 0; i < this.videos.length; i++) { - this.videos[i][option] = value; - } - } - return this.current[option]; - } - - play () { - this.current.play(); - } - - pause () { - this.current.pause(); - } - - toggle () { - this.current.paused ? this.play() : this.pause(); - } -} - -module.exports = Video;