!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("DPlayer",[],t):"object"==typeof exports?exports.DPlayer=t():n.DPlayer=t()}(this,function(){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="/",t(t.s=1)}([function(n){"use strict";var t={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"]};n.exports=function(n){return'<\/use><\/path><\/svg>\n'}},function(n,t,i){"use strict";n.exports=i(2)},function(n,t,i){"use strict";function u(n){return n&&n.__esModule?n:{"default":n}}function h(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var c=function(){function n(n,t){for(var i,r=0;r0?t:0;t=t<1?t:1;y[n+"Bar"].style[i]=100*t+"%"},document.addEventListener("click",function(){i.focus=!1},!0),this.element.addEventListener("click",function(){i.focus=!0},!0),this.option.danmaku&&(this.danmaku=new k.default({container:this.element.getElementsByClassName("dplayer-danmaku")[0],opacity:localStorage.getItem("danmaku-opacity")||.7,callback:function(){i.element.getElementsByClassName("dplayer-danloading")[0].style.display="none";i.option.autoplay&&!f.isMobile?i.play():f.isMobile&&i.pause()},error:function(n){i.notice(n)},apiBackend:this.option.apiBackend,borderColor:this.option.theme,height:this.arrow?24:30,time:function(){return i.video.currentTime},unlimited:this.option.danmaku.unlimited,api:{id:this.option.danmaku.id,address:this.option.danmaku.api,token:this.option.danmaku.token,maximum:this.option.danmaku.maximum,addition:this.option.danmaku.addition,user:this.option.danmaku.user},events:this.events})),this.arrow=this.element.offsetWidth<=500,this.arrow)&&(st=document.createElement("style"),st.innerHTML=".dplayer .dplayer-danmaku{font-size:18px}",document.head.appendChild(st));this.video=this.element.getElementsByClassName("dplayer-video-current")[0];this.bezel=this.element.getElementsByClassName("dplayer-bezel-icon")[0];this.bezel.addEventListener("animationend",function(){i.bezel.classList.remove("dplayer-bezel-transition")});this.playButton=this.element.getElementsByClassName("dplayer-play-icon")[0];this.paused=!0;this.playButton.addEventListener("click",function(){i.toggle()});ht=this.element.getElementsByClassName("dplayer-video-wrap")[0];ct=this.element.getElementsByClassName("dplayer-controller-mask")[0];f.isMobile?(lt=function(){i.element.classList.contains("dplayer-hide-controller")?i.element.classList.remove("dplayer-hide-controller"):i.element.classList.add("dplayer-hide-controller")},ht.addEventListener("click",lt),ct.addEventListener("click",lt)):(ht.addEventListener("click",function(){i.toggle()}),ct.addEventListener("click",function(){i.toggle()}));var at=0,it=0,ut=!1;window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){window.setTimeout(n,1e3/60)}}();vt=function(){i.checkLoading=setInterval(function(){it=i.video.currentTime;!ut&&itat+.01&&!i.video.paused&&(i.element.classList.remove("dplayer-loading"),ut=!1);at=it},100)};yt=function(){clearInterval(i.checkLoading)};this.playedTime=!1;this.animationFrame=function(){i.playedTime&&(i.updateBar("played",i.video.currentTime/i.video.duration,"width"),i.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=r.default.secondToTime(i.video.currentTime));window.requestAnimationFrame(i.animationFrame)};window.requestAnimationFrame(this.animationFrame);this.setTime=function(n){n?(i[n+"Time"]=!0,"played"===n&&vt()):(i.playedTime=!0,vt())};this.clearTime=function(n){n?(i[n+"Time"]=!1,"played"===n&&yt()):(i.playedTime=!1,yt())};c.addEventListener("click",function(n){var u=n||window.event,t;nt=c.clientWidth;t=(u.clientX-r.default.getElementViewLeft(c))/nt;t=t>0?t:0;t=t<1?t:1;i.updateBar("played",t,"width");i.seek(parseFloat(y.playedBar.style.width)/100*i.video.duration)});this.option.video.thumbnails&&this.initThumbnails();this.isTimeTipsShow=!0;this.mouseHandler=this.mouseHandler(c,ai).bind(this);c.addEventListener("mousemove",this.mouseHandler);c.addEventListener("mouseenter",this.mouseHandler);c.addEventListener("mouseleave",this.mouseHandler);pt=function(n){var u=n||window.event,t=(u.clientX-r.default.getElementViewLeft(c))/nt;t=t>0?t:0;t=t<1?t:1;i.updateBar("played",t,"width");i.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=r.default.secondToTime(t*i.video.duration)};ni=function n(){document.removeEventListener("mouseup",n);document.removeEventListener("mousemove",pt);i.seek(parseFloat(y.playedBar.style.width)/100*i.video.duration);i.setTime()};c.addEventListener("mousedown",function(){nt=c.clientWidth;i.clearTime();document.addEventListener("mousemove",pt);document.addEventListener("mouseup",ni)});var ti=this.element.getElementsByClassName("dplayer-volume")[0],ii=this.element.getElementsByClassName("dplayer-volume-bar-wrap")[0],ri=this.element.getElementsByClassName("dplayer-volume-bar")[0],ui=this.element.getElementsByClassName("dplayer-volume-icon")[0];this.switchVolumeIcon=function(){var n=i.element.getElementsByClassName("dplayer-volume-icon")[0];n.innerHTML=i.volume()>=.95?e.default("volume-up"):i.volume()>0?e.default("volume-down"):e.default("volume-off")};wt=function(n){var t=n||window.event,u=(t.clientX-r.default.getElementViewLeft(ri)-5.5)/35;i.volume(u)};fi=function n(){document.removeEventListener("mouseup",n);document.removeEventListener("mousemove",wt);ti.classList.remove("dplayer-volume-active")};ii.addEventListener("click",function(n){var t=n||window.event,u=(t.clientX-r.default.getElementViewLeft(ri)-5.5)/35;i.volume(u)});ii.addEventListener("mousedown",function(){document.addEventListener("mousemove",wt);document.addEventListener("mouseup",fi);ti.classList.add("dplayer-volume-active")});ui.addEventListener("click",function(){i.video.muted?(i.video.muted=!1,i.switchVolumeIcon(),i.updateBar("volume",i.volume(),"width")):(i.video.muted=!0,ui.innerHTML=e.default("volume-off"),i.updateBar("volume",0,"width"))});this.hideTime=0;d=function(){i.element.classList.remove("dplayer-hide-controller");clearTimeout(i.hideTime);i.hideTime=setTimeout(function(){i.video.played.length&&(i.element.classList.add("dplayer-hide-controller"),b(),dt())},2e3)};f.isMobile||(this.element.addEventListener("mousemove",d),this.element.addEventListener("click",d));var bt=o.default.setting(this.tran),vi=this.element.getElementsByClassName("dplayer-setting-icon")[0],l=this.element.getElementsByClassName("dplayer-setting-box")[0],a=this.element.getElementsByClassName("dplayer-mask")[0];l.innerHTML=bt.original;b=function(){l.classList.contains("dplayer-setting-box-open")&&(l.classList.remove("dplayer-setting-box-open"),a.classList.remove("dplayer-mask-show"),setTimeout(function(){l.classList.remove("dplayer-setting-box-narrow");l.innerHTML=bt.original;kt()},300))};ei=function(){l.classList.add("dplayer-setting-box-open");a.classList.add("dplayer-mask-show")};a.addEventListener("click",function(){b()});vi.addEventListener("click",function(){ei()});this.loop=this.option.loop;ft=!0;kt=function(){var u=i.element.getElementsByClassName("dplayer-setting-loop")[0],t=u.getElementsByClassName("dplayer-toggle-setting-input")[0],f,n,e,c;if(t.checked=i.loop,u.addEventListener("click",function(){t.checked=!t.checked;i.loop=t.checked?!0:!1;b()}),f=i.element.getElementsByClassName("dplayer-setting-showdan")[0],n=f.getElementsByClassName("dplayer-showdan-setting-input")[0],n.checked=ft,f.addEventListener("click",function(){n.checked=!n.checked;n.checked?(ft=!0,i.paused||i.danmaku.show()):(ft=!1,i.danmaku.hide());b()}),i.element.getElementsByClassName("dplayer-setting-speed")[0].addEventListener("click",function(){l.classList.add("dplayer-setting-box-narrow");l.innerHTML=bt.speed;for(var n=l.getElementsByClassName("dplayer-setting-speed-item"),t=0;t0?t:0;t=t<1?t:1;i.updateBar("danmaku",t,"width");i.danmaku.opacity(t)};c=function u(){document.removeEventListener("mouseup",u);document.removeEventListener("mousemove",e);h.classList.remove("dplayer-setting-danmaku-active")};o.addEventListener("click",function(n){var u=n||window.event,t=(u.clientX-r.default.getElementViewLeft(s))/130;t=t>0?t:0;t=t<1?t:1;i.updateBar("danmaku",t,"width");i.danmaku.opacity(t)});o.addEventListener("mousedown",function(){document.addEventListener("mousemove",e);document.addEventListener("mouseup",c);h.classList.add("dplayer-setting-danmaku-active")})}};kt();1!==this.video.duration&&(this.element.getElementsByClassName("dplayer-dtime")[0].innerHTML=this.video.duration?r.default.secondToTime(this.video.duration):"00:00");this.danmaku||(this.option.autoplay&&!f.isMobile?this.play():f.isMobile&&this.pause());var w=this.element.getElementsByClassName("dplayer-comment-input")[0],yi=this.element.getElementsByClassName("dplayer-comment-icon")[0],et=this.element.getElementsByClassName("dplayer-comment-box")[0],oi=this.element.getElementsByClassName("dplayer-comment-setting-icon")[0],g=this.element.getElementsByClassName("dplayer-comment-setting-box")[0],pi=this.element.getElementsByClassName("dplayer-send-icon")[0],si=function(){g.classList.contains("dplayer-comment-setting-open")&&g.classList.remove("dplayer-comment-setting-open")},wi=function(){g.classList.contains("dplayer-comment-setting-open")?g.classList.remove("dplayer-comment-setting-open"):g.classList.add("dplayer-comment-setting-open")},hi=0,ci=0,dt=function(){et.classList.contains("dplayer-comment-box-open")&&(et.classList.remove("dplayer-comment-box-open"),a.classList.remove("dplayer-mask-show"),i.element.classList.remove("dplayer-show-controller"),clearInterval(hi),clearTimeout(ci),si())},bi=function(){et.classList.contains("dplayer-comment-box-open")||(et.classList.add("dplayer-comment-box-open"),a.classList.add("dplayer-mask-show"),i.element.classList.add("dplayer-show-controller"),hi=setInterval(function(){clearTimeout(i.hideTime)},1e3),ci=setTimeout(function(){w.focus()},300))};a.addEventListener("click",function(){dt()});yi.addEventListener("click",function(){bi()});oi.addEventListener("click",function(){wi()});this.element.getElementsByClassName("dplayer-comment-setting-color")[0].addEventListener("click",function(){i.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked+span')&&(oi.getElementsByClassName("dplayer-fill")[0].style.fill=i.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked').value)});gt=function(){if(w.blur(),!w.value.replace(/^\s+|\s+$/g,""))return void i.notice(i.tran("Please input danmaku content!"));i.danmaku.send({text:w.value,color:i.element.querySelector(".dplayer-comment-setting-color input:checked").value,type:i.element.querySelector(".dplayer-comment-setting-type input:checked").value},function(){w.value="";dt()})};w.addEventListener("click",function(){si()});w.addEventListener("keydown",function(n){13===(n||window.event).keyCode&>()});pi.addEventListener("click",gt);this.fullScreen=new rt.default(this);this.element.getElementsByClassName("dplayer-full-icon")[0].addEventListener("click",function(){i.fullScreen.toggle("browser")});this.element.getElementsByClassName("dplayer-full-in-icon")[0].addEventListener("click",function(){i.fullScreen.toggle("web")});li=function(n){var u,f,t,r;if(i.focus&&(u=document.activeElement.tagName.toUpperCase(),f=document.activeElement.getAttribute("contenteditable"),"INPUT"!==u&&"TEXTAREA"!==u&&""!==f&&"true"!==f)){t=n||window.event;r=void 0;switch(t.keyCode){case 32:t.preventDefault();i.toggle();break;case 37:t.preventDefault();i.seek(i.video.currentTime-5);d();break;case 39:t.preventDefault();i.seek(i.video.currentTime+5);d();break;case 38:t.preventDefault();r=i.volume()+.1;i.volume(r);break;case 40:t.preventDefault();r=i.volume()-.1;i.volume(r)}}};this.option.hotkey&&document.addEventListener("keydown",li);document.addEventListener("keydown",function(n){switch((n||window.event).keyCode){case 27:i.fullScreen.isFullScreen("web")&&i.fullScreen.cancel("web")}});u=this.element.getElementsByClassName("dplayer-menu")[0];(this.element.addEventListener("contextmenu",function(n){var r=n||window.event;r.preventDefault();u.classList.add("dplayer-menu-show");var t=i.element.getBoundingClientRect(),f=r.clientX-t.left,e=r.clientY-t.top;f+u.offsetWidth>=t.width?(u.style.right=t.width-f+"px",u.style.left="initial"):(u.style.left=r.clientX-i.element.getBoundingClientRect().left+"px",u.style.right="initial");e+u.offsetHeight>=t.height?(u.style.bottom=t.height-e+"px",u.style.top="initial"):(u.style.top=r.clientY-i.element.getBoundingClientRect().top+"px",u.style.bottom="initial");a.classList.add("dplayer-mask-show");i.events.trigger("contextmenu_show");a.addEventListener("click",function(){a.classList.remove("dplayer-mask-show");u.classList.remove("dplayer-menu-show");i.events.trigger("contextmenu_hide")})}),this.option.video.quality&&this.element.getElementsByClassName("dplayer-quality-list")[0].addEventListener("click",function(n){n.target.classList.contains("dplayer-quality-item")&&i.switchQuality(n.target.dataset.index)}),this.option.screenshot)&&(ot=this.element.getElementsByClassName("dplayer-camera-icon")[0],ot.addEventListener("click",function(){var n=document.createElement("canvas"),t;n.width=i.video.videoWidth;n.height=i.video.videoHeight;n.getContext("2d").drawImage(i.video,0,0,n.width,n.height);t=n.toDataURL();ot.href=t;ot.download="DPlayer.png";i.events.trigger("screenshot",t)}));this.initVideo(this.video,this.quality&&this.quality.type||this.option.video.type);s++}return c(n,[{key:"seek",value:function(n){n=Math.max(n,0);this.video.duration&&(n=Math.min(n,this.video.duration));this.video.currentTimen&&this.notice(this.tran("REW to")+" "+r.default.secondToTime(n));this.video.currentTime=n;this.danmaku&&this.danmaku.seek();this.updateBar("played",n/this.video.duration,"width")}},{key:"play",value:function(){this.paused=!1;this.video.paused&&(this.bezel.innerHTML=e.default("play"),this.bezel.classList.add("dplayer-bezel-transition"));this.playButton.innerHTML=e.default("pause");this.video.play();this.setTime();this.element.classList.add("dplayer-playing");this.danmaku&&this.danmaku.play()}},{key:"pause",value:function(){this.paused=!0;this.element.classList.remove("dplayer-loading");this.video.paused||(this.bezel.innerHTML=e.default("pause"),this.bezel.classList.add("dplayer-bezel-transition"));this.ended=!1;this.playButton.innerHTML=e.default("play");this.video.pause();this.clearTime();this.element.classList.remove("dplayer-playing");this.danmaku&&this.danmaku.pause()}},{key:"volume",value:function(n,t,i){return n=parseFloat(n),isNaN(n)||(n=n>0?n:0,n=n<1?n:1,this.updateBar("volume",n,"width"),i||localStorage.setItem("dplayer-volume",n),t||this.notice(this.tran("Volume")+" "+(100*n).toFixed(0)+"%"),this.video.volume=n,this.video.muted&&(this.video.muted=!1),this.switchVolumeIcon()),this.video.volume}},{key:"toggle",value:function(){this.video.paused?this.play():this.pause()}},{key:"on",value:function(n,t){this.events.on(n,t)}},{key:"switchVideo",value:function(n,t){this.pause();this.video.poster=n.pic?n.pic:"";this.video.src=n.url;this.initMSE(this.video,n.type||"auto");t&&(this.element.getElementsByClassName("dplayer-danloading")[0].style.display="block",this.updateBar("played",0,"width"),this.updateBar("loaded",0,"width"),this.element.getElementsByClassName("dplayer-ptime")[0].innerHTML="00:00",this.element.getElementsByClassName("dplayer-danmaku")[0].innerHTML="",this.danmaku&&this.danmaku.reload({id:t.id,address:t.api,token:t.token,maximum:t.maximum,addition:t.addition,user:t.user}))}},{key:"initMSE",value:function(n,t){var i,r;(this.type=t,"auto"===this.type&&(this.type=/m3u8(#|\?|$)/i.exec(n.src)?"hls":/.flv(#|\?|$)/i.exec(n.src)?"flv":"normal"),"hls"===this.type&&Hls.isSupported())&&(i=new Hls,i.loadSource(n.src),i.attachMedia(n));"flv"===this.type&&flvjs.isSupported()&&(r=flvjs.createPlayer({type:"flv",url:n.src}),r.attachMediaElement(n),r.load())}},{key:"initVideo",value:function(n,t){var i=this,u;for(this.initMSE(n,t),this.on("durationchange",function(){1!==n.duration&&(i.element.getElementsByClassName("dplayer-dtime")[0].innerHTML=r.default.secondToTime(n.duration))}),this.on("progress",function(){var t=n.buffered.length?n.buffered.end(n.buffered.length-1)/n.duration:0;i.updateBar("loaded",t,"width")}),this.on("error",function(){i.tran&&i.notice&&i.notice(i.tran("This video fails to load"),-1)}),this.ended=!1,this.on("ended",function(){i.updateBar("played",1,"width");i.loop?(i.seek(0),n.play()):(i.ended=!0,i.pause());i.danmaku&&(i.danmaku.danIndex=0)}),this.on("play",function(){i.paused&&i.play()}),this.on("pause",function(){i.paused||i.pause()}),u=0;un.offsetWidth)){o=i.video.duration*(e/n.offsetWidth);switch(t.style.left=e-20+"px",f.type){case"mouseenter":i.thumbnails&&i.thumbnails.show();break;case"mousemove":i.thumbnails&&i.thumbnails.move(e);t.innerText=r.default.secondToTime(o);i.timeTipsDisplay(!0,t);break;case"mouseleave":i.thumbnails&&i.thumbnails.hide();i.timeTipsDisplay(!1,t)}}}}}},{key:"timeTipsDisplay",value:function(n,t){if(n){if(this.isTimeTipsShow)return;t.classList.remove("hidden");this.isTimeTipsShow=!0}else{if(!this.isTimeTipsShow)return;t.classList.add("hidden");this.isTimeTipsShow=!1}}},{key:"initThumbnails",value:function(){var n=this;this.thumbnails=new g.default(this.element.getElementsByClassName("dplayer-bar-preview")[0],this.element.getElementsByClassName("dplayer-bar-wrap")[0].offsetWidth,this.option.video.thumbnails,this.events);this.on("loadedmetadata",function(){n.thumbnails.resize(160,90)})}},{key:"notice",value:function(n){var i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8,t=this.element.getElementsByClassName("dplayer-notice")[0];t.innerHTML=n;t.style.opacity=u;this.noticeTime&&clearTimeout(this.noticeTime);this.events.trigger("notice_show",n);this.noticeTime=setTimeout(function(){t.style.opacity=0;i.events.trigger("notice_hide")},r)}},{key:"resize",value:function(){this.danmaku&&this.danmaku.resize();this.events.trigger("resize")}},{key:"destroy",value:function(){this.pause();clearTimeout(this.hideTime);this.video.src="";this.element.innerHTML="";this.events.trigger("destroy");for(var n in this)this.hasOwnProperty(n)&&"paused"!==n&&delete this[n]}}]),n}();n.exports=ut},function(){},function(n){"use strict";n.exports={secondToTime:function(n){var t=function(n){return n<10?"0"+n:""+n},i=parseInt(n/60),r=parseInt(n-60*i);return t(i)+":"+t(r)},getElementViewLeft:function(n){var i=n.offsetLeft,t=n.offsetParent,r=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==t&&t!==n;)i+=t.offsetLeft,t=t.offsetParent;else for(;null!==t;)i+=t.offsetLeft,t=t.offsetParent;return i-r},isMobile:/mobile/i.test(window.navigator.userAgent)}},function(n,t,i){"use strict";var r=i(6);n.exports=function(n){var i,t;/mobile/i.test(window.navigator.userAgent)&&(n.autoplay=!1);i={element:document.getElementsByClassName("dplayer")[0],autoplay:!1,theme:"#b7daff",loop:!1,lang:(navigator.language||navigator.browserLanguage).toLowerCase(),screenshot:!1,hotkey:!0,preload:"auto",volume:"0.7",apiBackend:r,video:{},contextmenu:[]};for(t in i)i.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=i[t]);return n.video&&!n.video.hasOwnProperty("type")&&(n.video.type="auto"),n.danmaku&&!n.danmaku.hasOwnProperty("user")&&(n.danmaku.user="DIYgod"),n.video.quality&&(n.video.url=[n.video.quality[n.video.defaultQuality].url]),n.lang&&(n.lang=n.lang.toLowerCase()),n.contextmenu=n.contextmenu.concat([{text:"安妮花教育",link:"http://www.anniekids.org"}]),n}},function(n){"use strict";var t=function(n,t,i,r,u){var f=new XMLHttpRequest;f.onreadystatechange=function(){if(4===f.readyState){if(f.status>=200&&f.status<300||304===f.status){var n=JSON.parse(f.responseText);return 1!==n.code?r(f,n):i(f,n)}u(f)}};f.open(null!==t?"POST":"GET",n,!0);f.send(null!==t?JSON.stringify(t):null)};n.exports={send:function(n,i,r){t(n,i,function(n,t){console.log("Post danmaku: ",t);r&&r()},function(n,t){alert(t.msg)},function(n){console.log("Request was unsuccessful: "+n.status)})},read:function(n,i){t(n,null,function(n,t){i(null,t.danmaku)},function(n,t){i({status:n.status,response:t})},function(n){i({status:n.status,response:null})})}}},function(n){"use strict";n.exports=function(n){var i=this;this.lang=n;this.tran=function(n){return t[i.lang]&&t[i.lang][n]?t[i.lang][n]:n}};var t={"zh-cn":{"Danmaku is loading":"弹幕加载中",Top:"顶部",Bottom:"底部",Rolling:"滚动",Volume:"音量","Input danmaku, hit Enter":"输入弹幕,回车发送","About author":"关于作者","DPlayer feedback":"播放器意见反馈","About DPlayer":"关于 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":"已经切换至",quality:"画质","FF to":"快进至","REW to":"快退至"},"zh-tw":{"Danmaku is loading":"彈幕加載中",Top:"頂部",Bottom:"底部",Rolling:"滾動","Input danmaku, hit Enter":"輸入彈幕,Enter 發送","About author":"關於作者","DPlayer feedback":"播放器意見反饋","About DPlayer":"關於 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":"已經切換至",quality:"畫質","FF to":"快進至","REW to":"快退至"}}},function(n,t,i){"use strict";var r=i(0),u={main:function(n,t,i){var f="";return'
<\/div>
'+(f+=u.video(!0,n.video.pic,n.screenshot,n.preload,n.video.url))+(n.logo?'