From 3dc02c5f7797786b71e4ca003e61c8ecdcff8bcf Mon Sep 17 00:00:00 2001 From: FGHRSH <1070816008@qq.com> Date: Thu, 30 Mar 2017 22:41:58 +0800 Subject: [PATCH] V1.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新 DPlayer 至 1.3.3 版 新增 FLV 和 HLS(m3u8)支持 新增 额外弹幕源 支持(新版 DPlayer 功能) 修复 若干BUG 和 若干优化,新增了几项可选自定义参数 --- DPlayer.min.js | 5 +- README.md | 36 ++++------- function.php | 94 +++++++++++----------------- include.php | 78 +++++++++++++----------- jcolor/jcolor.min.css | 1 + jcolor/jcolor.min.js | 1 + main.php | 139 +++++++++++++++++++++++++++--------------- plugin.xml | 4 +- plugin/flv.min.js | 6 ++ plugin/hls.min.js | 6 ++ 10 files changed, 195 insertions(+), 175 deletions(-) create mode 100644 jcolor/jcolor.min.css create mode 100644 jcolor/jcolor.min.js create mode 100644 plugin/flv.min.js create mode 100644 plugin/hls.min.js diff --git a/DPlayer.min.js b/DPlayer.min.js index bb640c0..df4e59a 100644 --- a/DPlayer.min.js +++ b/DPlayer.min.js @@ -1,3 +1,2 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var a=t();for(var r in a)("object"==typeof exports?exports:e)[r]=a[r]}}(this,function(){return function(e){function t(r){if(a[r])return a[r].exports;var n=a[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}([function(e,t,a){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},l=function(){function e(e,t){for(var a=0;a\n \n \n \n '};var o=navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i);o&&(t.autoplay=!1);var s={element:document.getElementsByClassName("dplayer")[0],autoplay:!1,theme:"#b7daff",loop:!1,lang:navigator.language.indexOf("zh")!==-1?"zh":"en",screenshot:!1,hotkey:!0,preload:"auto"};for(var i in s)s.hasOwnProperty(i)&&!t.hasOwnProperty(i)&&(t[i]=s[i]);var d={"Danmaku is loading":"弹幕加载中",Top:"顶部",Bottom:"底部",Rolling:"滚动","Input danmaku, hit Enter":"输入弹幕,回车发送","About author":"关于作者","DPlayer feedback":"播放器意见反馈","About DPlayer":"关于 DPlay 播放器",Loop:"洗脑循环",Speed:"速度","Opacity for danmaku":"弹幕透明度",Normal:"正常","Please input danmaku!":"要输入弹幕内容啊喂!","Set danmaku color":"设置弹幕颜色","Set danmaku type":"设置弹幕类型",Danmaku:"弹幕"},p=function(e){return"en"===t.lang?e:"zh"===t.lang?d[e]:void 0};this.updateBar=function(e,t,a){t=t>0?t:0,t=t<1?t:1,v[e+"Bar"].style[a]=100*t+"%"};var c=["play","pause","canplay","playing","ended","error"];this.event={};for(var m=0;m\n
\n \n
\n
\n
\n
\n \n '+(t.danmaku?''+p("Danmaku is loading")+"":"")+'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n
\n
\n
\n 0:00 / 0:00\n
\n
\n '+(t.screenshot?'\n '+this.getSVG("camera")+" \n ":"")+'\n
\n \n
\n \n
\n
\n
'+p("Set danmaku color")+'
\n \n \n \n \n \n \n
\n
\n
'+p("Set danmaku type")+'
\n \n \n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n "),this.video=this.element.getElementsByClassName("dplayer-video")[0],t.video.url.match(/(m3u8)$/i)&&Hls.isSupported()&&!function(){a.element.getElementsByClassName("dplayer-time")[0].style.display="none";var e=new Hls;e.attachMedia(a.video),e.on(Hls.Events.MEDIA_ATTACHED,function(){e.loadSource(t.video.url),e.on(Hls.Events.MANIFEST_PARSED,function(e,t){console.log("manifest loaded, found "+t.levels.length+" quality level")})})}(),this.bezel=this.element.getElementsByClassName("dplayer-bezel-icon")[0],this.bezel.addEventListener("animationend",function(){a.bezel.classList.remove("dplayer-bezel-transition")}),this.playButton=this.element.getElementsByClassName("dplayer-play-icon")[0],this.shouldpause=!0,this.playButton.addEventListener("click",function(){a.toggle()});var y=this.element.getElementsByClassName("dplayer-video-wrap")[0],u=this.element.getElementsByClassName("dplayer-controller-mask")[0];if(o){var g=function(){a.element.classList.contains("dplayer-hide-controller")?a.element.classList.remove("dplayer-hide-controller"):a.element.classList.add("dplayer-hide-controller")};y.addEventListener("click",g),u.addEventListener("click",g)}else y.addEventListener("click",function(){a.toggle()}),u.addEventListener("click",function(){a.toggle()});var f=function(e){var t=function(e){return e<10?"0"+e:""+e},a=parseInt(e/60),r=parseInt(e-60*a);return t(a)+":"+t(r)},b=function(e){var t=e.offsetLeft,r=e.offsetParent,n=void 0;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==r&&r!==a.element;)t+=r.offsetLeft,r=r.offsetParent;else for(;null!==r;)t+=r.offsetLeft,r=r.offsetParent;return n=document.body.scrollLeft+document.documentElement.scrollLeft,t-n},v={};v.playedBar=this.element.getElementsByClassName("dplayer-played")[0],v.loadedBar=this.element.getElementsByClassName("dplayer-loaded")[0];var h=this.element.getElementsByClassName("dplayer-bar-wrap")[0],x=void 0;t.danmaku&&this.video.addEventListener("seeking",function(){for(var e=0;e=a.video.currentTime)return void(a.danIndex=e);a.danIndex=a.dan.length}});var k=0,w=0,Y=!1,E=void 0;this.setTime=function(){a.playedTime=setInterval(function(){w=a.video.currentTime,!Y&&wk+.01&&!a.video.paused&&(a.element.classList.remove("dplayer-loading"),Y=!1),k=w,a.updateBar("played",a.video.currentTime/a.video.duration,"width"),a.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=f(a.video.currentTime),a.trigger("playing")},100),t.danmaku&&(E=setInterval(function(){for(var e=a.dan[a.danIndex];e&&a.video.currentTime>=parseFloat(e.time);)ae(e.text,e.color,e.type),e=a.dan[++a.danIndex]},0))},this.clearTime=function(){clearInterval(a.playedTime),t.danmaku&&clearInterval(E)},h.addEventListener("click",function(e){var t=e||window.event;x=h.clientWidth;var r=(t.clientX-b(h))/x;r=r>0?r:0,r=r<1?r:1,a.updateBar("played",r,"width"),a.video.currentTime=parseFloat(v.playedBar.style.width)/100*a.video.duration});var L=function(e){var t=e||window.event,r=(t.clientX-b(h))/x;r=r>0?r:0,r=r<1?r:1,a.updateBar("played",r,"width"),a.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=f(r*a.video.duration)},z=function he(){document.removeEventListener("mouseup",he),document.removeEventListener("mousemove",L),a.video.currentTime=parseFloat(v.playedBar.style.width)/100*a.video.duration,a.setTime()};h.addEventListener("mousedown",function(){x=h.clientWidth,a.clearTime(),document.addEventListener("mousemove",L),document.addEventListener("mouseup",z)}),v.volumeBar=this.element.getElementsByClassName("dplayer-volume-bar-inner")[0];var B=this.element.getElementsByClassName("dplayer-volume")[0],C=this.element.getElementsByClassName("dplayer-volume-bar-wrap")[0],M=this.element.getElementsByClassName("dplayer-volume-bar")[0],N=this.element.getElementsByClassName("dplayer-volume-icon")[0],T=35;this.switchVolumeIcon=function(){var e=a.element.getElementsByClassName("dplayer-volume-icon")[0];a.video.volume>=.8?e.innerHTML=a.getSVG("volume-up"):a.video.volume>0?e.innerHTML=a.getSVG("volume-down"):e.innerHTML=a.getSVG("volume-off")};var q=function(e){var t=e||window.event,r=(t.clientX-b(M)-5.5)/T;a.volume(r)},S=function xe(){document.removeEventListener("mouseup",xe),document.removeEventListener("mousemove",q),B.classList.remove("dplayer-volume-active")};C.addEventListener("click",function(e){var t=e||window.event,r=(t.clientX-b(M)-5.5)/T;a.volume(r)}),C.addEventListener("mousedown",function(){document.addEventListener("mousemove",q),document.addEventListener("mouseup",S),B.classList.add("dplayer-volume-active")}),N.addEventListener("click",function(){a.video.muted?(a.video.muted=!1,a.switchVolumeIcon(),a.updateBar("volume",a.video.volume,"width")):(a.video.muted=!0,N.innerHTML=a.getSVG("volume-off"),a.updateBar("volume",0,"width"))});var A=0;if(!o){var I=function(){a.element.classList.remove("dplayer-hide-controller"),clearTimeout(A),A=setTimeout(function(){a.video.played.length&&(a.element.classList.add("dplayer-hide-controller"),X(),ue())},2e3)};this.element.addEventListener("mousemove",I),this.element.addEventListener("click",I)}var D=localStorage.getItem("DPlayer-opacity")||.7,R={original:'\n
\n '+p("Speed")+'\n
'+this.getSVG("right")+('
\n
\n
\n '+p("Loop")+'\n
\n \n \n
\n
\n
\n '+p("Danmaku")+'\n
\n \n \n
\n
\n
\n '+p("Opacity for danmaku")+'\n
\n
\n
\n \n
\n
\n
\n
'),speed:'\n
\n 0.5\n
\n
\n 0.75\n
\n
\n '+p("Normal")+'\n
\n
\n 1.25\n
\n
\n 1.5\n
\n
\n 2\n
'},F=this.element.getElementsByClassName("dplayer-setting-icon")[0],H=this.element.getElementsByClassName("dplayer-setting-box")[0],P=this.element.getElementsByClassName("dplayer-mask")[0];H.innerHTML=R.original;var X=function(){H.classList.contains("dplayer-setting-box-open")&&(H.classList.remove("dplayer-setting-box-open"),P.classList.remove("dplayer-mask-show"),setTimeout(function(){H.classList.remove("dplayer-setting-box-narrow"),H.innerHTML=R.original,j()},300))},O=function(){H.classList.add("dplayer-setting-box-open"),P.classList.add("dplayer-mask-show")};P.addEventListener("click",function(){X()}),F.addEventListener("click",function(){O()});var V=t.loop,U=this.element.getElementsByClassName("dplayer-danmaku")[0],G=!0,j=function(){var e=a.element.getElementsByClassName("dplayer-setting-loop")[0],r=e.getElementsByClassName("dplayer-toggle-setting-input")[0];r.checked=V,e.addEventListener("click",function(){r.checked=!r.checked,r.checked?(V=!0,a.video.loop=V):(V=!1,a.video.loop=V),X()});var n=a.element.getElementsByClassName("dplayer-setting-showdan")[0],l=n.getElementsByClassName("dplayer-showdan-setting-input")[0];l.checked=G,n.addEventListener("click",function(){if(l.checked=!l.checked,l.checked){if(G=!0,t.danmaku){for(var e=0;e=a.video.currentTime){a.danIndex=e;break}a.danIndex=a.dan.length}E=setInterval(function(){for(var e=a.dan[a.danIndex];e&&a.video.currentTime>=parseFloat(e.time);)ae(e.text,e.color,e.type),e=a.dan[++a.danIndex]},0)}}else if(G=!1,t.danmaku){clearInterval(E),U.innerHTML='
'}X()});var o=a.element.getElementsByClassName("dplayer-setting-speed")[0];o.addEventListener("click",function(){H.classList.add("dplayer-setting-box-narrow"),H.innerHTML=R.speed;for(var e=H.getElementsByClassName("dplayer-setting-speed-item"),t=function(t){e[t].addEventListener("click",function(){a.video.playbackRate=e[t].dataset.speed,X()})},r=0;r0?l:0,l=l<1?l:1, -a.updateBar("danmaku",l,"width");for(var o=a.element.getElementsByClassName("dplayer-danmaku-item"),s=0;s0?l:0,l=l<1?l:1,a.updateBar("danmaku",l,"width");for(var o=a.element.getElementsByClassName("dplayer-danmaku-item"),s=0;s=200&&e.status<300||304===e.status){var r=JSON.parse(e.responseText);1!==r.code?alert(r.msg):(a.dan=r.danmaku.sort(function(e,t){return e.time-t.time}),a.element.getElementsByClassName("dplayer-danloading")[0].style.display="none",t.autoplay&&!o?a.play():o&&a.pause())}else console.log("Request was unsuccessful: "+e.status)};var r=void 0;r=t.danmaku.maximum?t.danmaku.api+"?id="+t.danmaku.id+"&max="+t.danmaku.maximum:t.danmaku.api+"?id="+t.danmaku.id,e.open("get",r,!0),e.send(null)}():t.autoplay&&!o?this.play():o&&this.pause();var re=this.element.getElementsByClassName("dplayer-comment-input")[0],ne=this.element.getElementsByClassName("dplayer-comment-icon")[0],le=this.element.getElementsByClassName("dplayer-comment-box")[0],oe=this.element.getElementsByClassName("dplayer-comment-setting-icon")[0],se=this.element.getElementsByClassName("dplayer-comment-setting-box")[0],ie=this.element.getElementsByClassName("dplayer-send-icon")[0],de=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},pe=function(){if(re.blur(),!re.value.replace(/^\s+|\s+$/g,""))return void alert(p("Please input danmaku!"));var e={token:t.danmaku.token,player:t.danmaku.id,author:"DIYgod",time:a.video.currentTime,text:re.value,color:a.element.querySelector('input[name="dplayer-danmaku-color"]:checked').value,type:a.element.querySelector('input[name="dplayer-danmaku-type"]:checked').value},r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState)if(r.status>=200&&r.status<300||304===r.status){var e=JSON.parse(r.responseText);1!==e.code?alert(e.msg):console.log("Post danmaku: ",JSON.parse(r.responseText))}else console.log("Request was unsuccessful: "+r.status)},r.open("post",t.danmaku.api,!0),r.send(JSON.stringify(e)),re.value="",ue(),a.dan.splice(a.danIndex,0,e),a.danIndex++;var n=ae(de(e.text),e.color,e.type);n.style.border="2px solid "+t.theme},ce=function(){se.classList.contains("dplayer-comment-setting-open")&&se.classList.remove("dplayer-comment-setting-open")},me=function(){se.classList.contains("dplayer-comment-setting-open")?se.classList.remove("dplayer-comment-setting-open"):se.classList.add("dplayer-comment-setting-open")},ye=0,ue=function(){le.classList.contains("dplayer-comment-box-open")&&(le.classList.remove("dplayer-comment-box-open"),P.classList.remove("dplayer-mask-show"),clearInterval(ye),a.element.classList.remove("dplayer-show-controller"),ce())},ge=function(){le.classList.add("dplayer-comment-box-open"),P.classList.add("dplayer-mask-show"),ye=setInterval(function(){clearTimeout(A)},1e3),a.element.classList.add("dplayer-show-controller")};P.addEventListener("click",function(){ue()}),ne.addEventListener("click",function(){ge(),setTimeout(function(){re.focus()},300)}),oe.addEventListener("click",function(){me()}),this.element.getElementsByClassName("dplayer-comment-setting-color")[0].addEventListener("click",function(){var e=a.element.querySelector('input[name="dplayer-danmaku-color"]:checked+span');e&&(oe.getElementsByClassName("dplayer-fill")[0].style.fill=a.element.querySelector('input[name="dplayer-danmaku-color"]:checked').value)}),re.addEventListener("click",function(){ce()}),re.addEventListener("keydown",function(e){var t=e||window.event;13===t.keyCode&&pe()}),ie.addEventListener("click",pe);var fe=function(){W=U.offsetWidth;for(var e=a.element.getElementsByClassName("dplayer-danmaku-item"),t=0;t0?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)}}]),e}();t.DPlayer=o},function(e,t,a){var r=a(2);"string"==typeof r&&(r=[[e.id,r,""]]);a(4)(r,{});r.locals&&(e.exports=r.locals)},function(e,t,a){t=e.exports=a(3)(),t.push([e.id,'.dplayer{position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:1}.dplayer:-webkit-full-screen{width:100%;height:100%;background:#000}.dplayer:-webkit-full-screen .dplayer-danmaku .dplayer-danmaku-bottom.dplayer-danmaku-move,.dplayer:-webkit-full-screen .dplayer-danmaku .dplayer-danmaku-top.dplayer-danmaku-move{-webkit-animation:danmaku-center 6s linear;animation:danmaku-center 6s linear;-webkit-animation-play-state:paused;animation-play-state:paused}.dplayer:-webkit-full-screen .dplayer-danmaku .dplayer-danmaku-right.dplayer-danmaku-move{-webkit-animation:danmaku 8s linear;animation:danmaku 8s linear;-webkit-animation-play-state:paused;animation-play-state:paused}.dplayer.dplayer-no-danmaku .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-box{height:60px}.dplayer.dplayer-no-danmaku .dplayer-controller .dplayer-icons .dplayer-comment,.dplayer.dplayer-no-danmaku .dplayer-danmaku{display:none}.dplayer.dplayer-playing .dplayer-danmaku .dplayer-danmaku-move{-webkit-animation-play-state:running!important;animation-play-state:running!important}@media (min-width:900px){.dplayer.dplayer-playing .dplayer-controller,.dplayer.dplayer-playing .dplayer-controller-mask{opacity:0}.dplayer.dplayer-playing:hover .dplayer-controller,.dplayer.dplayer-playing:hover .dplayer-controller-mask{opacity:1}}.dplayer.dplayer-loading .dplayer-bezel .diplayer-loading-icon{display:block}.dplayer.dplayer-loading .dplayer-danmaku .dplayer-danmaku-move{-webkit-animation-play-state:paused!important;animation-play-state:paused!important}.dplayer.dplayer-hide-controller .dplayer-controller,.dplayer.dplayer-hide-controller .dplayer-controller-mask{opacity:0;-webkit-transform:translateY(100%);transform:translateY(100%)}.dplayer.dplayer-show-controller .dplayer-controller,.dplayer.dplayer-show-controller .dplayer-controller-mask{opacity:1}.dplayer .dplayer-mask{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;display:none}.dplayer .dplayer-mask.dplayer-mask-show{display:block}.dplayer .dplayer-video-wrap{position:relative;background:#000;font-size:0;width:100%;height:100%}.dplayer .dplayer-video-wrap .dplayer-video{width:100%;height:100%}.dplayer .dplayer-danmaku{position:absolute;left:0;right:0;top:0;bottom:0;font-size:22px;color:#fff}.dplayer .dplayer-danmaku .dplayer-danmaku-item{display:inline-block;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default;white-space:nowrap;font-weight:bolder;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.dplayer .dplayer-danmaku .dplayer-danmaku-item--demo{position:absolute;visibility:hidden}.dplayer .dplayer-danmaku .dplayer-danmaku-right{position:absolute;right:0;-webkit-transform:translateX(100%);transform:translateX(100%)}.dplayer .dplayer-danmaku .dplayer-danmaku-right.dplayer-danmaku-move{will-change:transform;-webkit-animation:danmaku 5s linear;animation:danmaku 5s linear;-webkit-animation-play-state:paused;animation-play-state:paused}@-webkit-keyframes danmaku{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}}@keyframes danmaku{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}}.dplayer .dplayer-danmaku .dplayer-danmaku-bottom,.dplayer .dplayer-danmaku .dplayer-danmaku-top{position:absolute;width:100%;text-align:center;visibility:hidden}.dplayer .dplayer-danmaku .dplayer-danmaku-bottom.dplayer-danmaku-move,.dplayer .dplayer-danmaku .dplayer-danmaku-top.dplayer-danmaku-move{will-change:visibility;-webkit-animation:danmaku-center 4s linear;animation:danmaku-center 4s linear;-webkit-animation-play-state:paused;animation-play-state:paused}@-webkit-keyframes danmaku-center{0%{visibility:visible}to{visibility:visible}}@keyframes danmaku-center{0%{visibility:visible}to{visibility:visible}}.dplayer .dplayer-bezel{position:absolute;left:0;right:0;top:0;bottom:0;font-size:22px;color:#fff;pointer-events:none}.dplayer .dplayer-bezel .dplayer-fill{fill:hsla(0,0%,100%,.8)}.dplayer .dplayer-bezel .dplayer-bezel-icon{position:absolute;top:50%;left:50%;margin:-26px 0 0 -26px;height:52px;width:52px;padding:12px;box-sizing:border-box;background:rgba(0,0,0,.5);border-radius:50%;opacity:0;pointer-events:none}.dplayer .dplayer-bezel .dplayer-bezel-icon.dplayer-bezel-transition{-webkit-animation:bezel-hide .5s linear;animation:bezel-hide .5s linear}@-webkit-keyframes bezel-hide{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(2);transform:scale(2)}}@keyframes bezel-hide{0%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(2);transform:scale(2)}}.dplayer .dplayer-bezel .dplayer-danloading{position:absolute;top:50%;margin-top:-7px;width:100%;text-align:center;font-size:14px;line-height:14px;-webkit-animation:my-face 5s infinite ease-in-out;animation:my-face 5s infinite ease-in-out}.dplayer .dplayer-bezel .diplayer-loading-icon{display:none;position:absolute;top:50%;left:50%;margin:-18px 0 0 -18px;height:36px;width:36px;pointer-events:none}.dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-hide{display:none}.dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot{-webkit-animation:diplayer-loading-dot-fade .8s ease infinite;animation:diplayer-loading-dot-fade .8s ease infinite;opacity:0;fill:#fff;-webkit-transform-origin:4px 4px;transform-origin:4px 4px}.dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-7{-webkit-animation-delay:.7s;animation-delay:.7s}.dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-6{-webkit-animation-delay:.6s;animation-delay:.6s}.dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-5{-webkit-animation-delay:.5s;animation-delay:.5s}.dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-4{-webkit-animation-delay:.4s;animation-delay:.4s}.dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-3{-webkit-animation-delay:.3s;animation-delay:.3s}.dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-2{-webkit-animation-delay:.2s;animation-delay:.2s}.dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-1{-webkit-animation-delay:.1s;animation-delay:.1s}@-webkit-keyframes diplayer-loading-dot-fade{0%{opacity:.7;-webkit-transform:scale(1.2);transform:scale(1.2)}50%{opacity:.25;-webkit-transform:scale(.9);transform:scale(.9)}to{opacity:.25;-webkit-transform:scale(.85);transform:scale(.85)}}@keyframes diplayer-loading-dot-fade{0%{opacity:.7;-webkit-transform:scale(1.2);transform:scale(1.2)}50%{opacity:.25;-webkit-transform:scale(.9);transform:scale(.9)}to{opacity:.25;-webkit-transform:scale(.85);transform:scale(.85)}}.dplayer .dplayer-controller-mask{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom;height:98px;width:100%}.dplayer .dplayer-controller,.dplayer .dplayer-controller-mask{position:absolute;bottom:0;-webkit-transition:all .3s ease;transition:all .3s ease}.dplayer .dplayer-controller{left:0;right:0;height:41px;padding:0 20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.dplayer .dplayer-controller .dplayer-bar-wrap{padding:5px 0;cursor:pointer;position:absolute;bottom:33px;width:calc(100% - 40px);height:3px}.dplayer .dplayer-controller .dplayer-bar-wrap:hover .dplayer-thumb{-webkit-transform:scale(1)!important;transform:scale(1)!important}.dplayer .dplayer-controller .dplayer-bar-wrap .dplayer-bar{position:relative;height:3px;width:100%;background:hsla(0,0%,100%,.2);cursor:pointer!important}.dplayer .dplayer-controller .dplayer-bar-wrap .dplayer-bar .dplayer-loaded{position:absolute;left:0;top:0;bottom:0;background:hsla(0,0%,100%,.4);height:3px;-webkit-transition:all .5s ease;transition:all .5s ease;will-change:width}.dplayer .dplayer-controller .dplayer-bar-wrap .dplayer-bar .dplayer-played{position:absolute;left:0;top:0;bottom:0;height:3px;will-change:width}.dplayer .dplayer-controller .dplayer-bar-wrap .dplayer-bar .dplayer-played .dplayer-thumb{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer!important;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;-webkit-transform:scale(0);transform:scale(0)}.dplayer .dplayer-controller .dplayer-icons{height:38px;position:absolute;bottom:0}.dplayer .dplayer-controller .dplayer-icons.dplayer-icons-left .dplayer-icon{padding:7px}.dplayer .dplayer-controller .dplayer-icons.dplayer-icons-right{right:20px}.dplayer .dplayer-controller .dplayer-icons.dplayer-icons-right .dplayer-icon{padding:8px}.dplayer .dplayer-controller .dplayer-icons #dplayer-menu{stroke:#ddd;stroke-width:1px}.dplayer .dplayer-controller .dplayer-icons .dplayer-time{line-height:38px;color:#eee;text-shadow:0 0 2px rgba(0,0,0,.5);vertical-align:middle;font-size:13px;cursor:default}.dplayer .dplayer-controller .dplayer-icons .dplayer-icon{width:46px;height:100%;border:none;background-color:transparent;outline:none;cursor:pointer;opacity:.8;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;vertical-align:middle;box-sizing:border-box;display:inline-block}.dplayer .dplayer-controller .dplayer-icons .dplayer-icon:hover{opacity:1}.dplayer .dplayer-controller .dplayer-icons .dplayer-icon.dplayer-comment-icon{padding:10px 9px 9px}.dplayer .dplayer-controller .dplayer-icons .dplayer-icon.dplayer-setting-icon{padding-top:8.5px}.dplayer .dplayer-controller .dplayer-icons .dplayer-fill{fill:#fff}.dplayer .dplayer-controller .dplayer-icons .dplayer-volume{position:relative;display:inline-block;cursor:pointer!important;height:100%}.dplayer .dplayer-controller .dplayer-icons .dplayer-volume:hover .dplayer-volume-bar{width:45px!important}.dplayer .dplayer-controller .dplayer-icons .dplayer-volume:hover .dplayer-thumb{-webkit-transform:scale(1)!important;transform:scale(1)!important}.dplayer .dplayer-controller .dplayer-icons .dplayer-volume.dplayer-volume-active .dplayer-volume-bar{width:45px!important}.dplayer .dplayer-controller .dplayer-icons .dplayer-volume.dplayer-volume-active .dplayer-thumb{-webkit-transform:scale(1)!important;transform:scale(1)!important}.dplayer .dplayer-controller .dplayer-icons .dplayer-volume .dplayer-volume-bar-wrap{display:inline-block;margin:0 5px 0 -5px;vertical-align:middle;height:100%}.dplayer .dplayer-controller .dplayer-icons .dplayer-volume .dplayer-volume-bar-wrap .dplayer-volume-bar{position:relative;top:17px;width:0;height:3px;background:#aaa;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.dplayer .dplayer-controller .dplayer-icons .dplayer-volume .dplayer-volume-bar-wrap .dplayer-volume-bar .dplayer-volume-bar-inner{position:absolute;bottom:0;left:0;height:100%;-webkit-transition:all .1s ease;transition:all .1s ease;will-change:width}.dplayer .dplayer-controller .dplayer-icons .dplayer-volume .dplayer-volume-bar-wrap .dplayer-volume-bar .dplayer-volume-bar-inner .dplayer-thumb{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer!important;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;-webkit-transform:scale(0);transform:scale(0)}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting{display:inline-block;height:100%}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-box{position:absolute;right:0;bottom:50px;-webkit-transform:translateX(170px);transform:translateX(170px);width:150px;height:120px;border-radius:2px;background:rgba(28,28,28,.9);padding:7px 0;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;overflow:hidden;z-index:2}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-box.dplayer-setting-box-open{-webkit-transform:translateX(0);transform:translateX(0)}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-box.dplayer-setting-box-narrow{width:70px;height:180px;text-align:center}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-item,.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-speed-item{height:30px;padding:5px 10px;box-sizing:border-box;cursor:pointer}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-item:hover,.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-speed-item:hover{background-color:hsla(0,0%,100%,.1)}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku{padding:5px 0}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku .dplayer-label{padding:0 10px;display:inline}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku:hover .dplayer-label{display:none}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku:hover .dplayer-danmaku-bar-wrap{display:inline-block}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku.dplayer-setting-danmaku-active .dplayer-label{display:none}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku.dplayer-setting-danmaku-active .dplayer-danmaku-bar-wrap{display:inline-block}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku .dplayer-danmaku-bar-wrap{padding:0 10px;box-sizing:border-box;display:none;vertical-align:middle;height:100%;width:100%}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku .dplayer-danmaku-bar-wrap .dplayer-danmaku-bar{position:relative;top:8.5px;width:100%;height:3px;background:#fff;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku .dplayer-danmaku-bar-wrap .dplayer-danmaku-bar .dplayer-danmaku-bar-inner{position:absolute;bottom:0;left:0;height:100%;-webkit-transition:all .1s ease;transition:all .1s ease;background:#aaa;will-change:width}.dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku .dplayer-danmaku-bar-wrap .dplayer-danmaku-bar .dplayer-danmaku-bar-inner .dplayer-thumb{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer!important;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;background:#aaa}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment{display:inline-block;height:100%}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box{position:absolute;right:0;bottom:50px;-webkit-transform:translateX(382px);transform:translateX(382px);border-radius:2px;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;z-index:2}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box.dplayer-comment-box-open{-webkit-transform:translateX(0);transform:translateX(0)}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-icon{height:24px;width:24px;position:absolute;top:5px;left:7px;padding:0;opacity:1}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-icon:hover .dplayer-fill{fill:#aaa}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-icon .dplayer-fill{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;fill:#ddd}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box{position:absolute;background:#fff;bottom:40px;left:-93px;box-shadow:0 0 25px rgba(0,0,0,.3);border-radius:4px;padding:10px 10px 16px;font-size:14px;width:204px;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;-webkit-transform:scale(0);transform:scale(0)}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box.dplayer-comment-setting-open{-webkit-transform:scale(1);transform:scale(1)}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box:after{content:\'\';position:absolute;top:100%;left:50%;margin-left:-12px;background:url(\'data:image/svg+xml;utf8,\');width:24px;height:12px}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box input[type=radio]{display:none}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box label{cursor:pointer}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-title{font-size:14px;color:#555;padding:6px}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-type{font-size:0}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-type label:nth-child(2) span{border-radius:4px 0 0 4px}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-type label:nth-child(4) span{border-radius:0 4px 4px 0}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-type span{width:33%;padding:4px 6px;line-height:16px;display:inline-block;font-size:12px;color:#555;border:1px solid #e4e4e6;margin-right:-1px;box-sizing:border-box;text-align:center;cursor:pointer}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-type input:checked+span{background:#e4e4e6}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-color{font-size:0}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-color label{font-size:0;padding:6px;display:inline-block}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-color span{width:22px;height:22px;display:inline-block;border-radius:50%;box-sizing:border-box;cursor:pointer}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-color span:hover{-webkit-animation:my-face 5s infinite ease-in-out;animation:my-face 5s infinite ease-in-out;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12)}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-color input:checked+span{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);border:none!important}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-input{outline:none;border:none;padding:8px 31px;font-size:14px;line-height:18px;text-align:center;border-radius:4px;width:300px}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-send-icon{height:22px;width:22px;position:absolute;top:6px;right:7px;padding:0;opacity:1}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-send-icon:hover .dplayer-fill{fill:#aaa}.dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-send-icon .dplayer-fill{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;fill:#ddd}.dplayer .dplayer-controller .dplayer-icons .dplayer-label{color:#eee;font-size:13px;display:inline-block;vertical-align:middle}.dplayer .dplayer-controller .dplayer-icons .dplayer-toggle{width:32px;height:100%;text-align:center;display:inline-block;font-size:0;vertical-align:middle;float:right}.dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input{max-height:0;max-width:0;display:none}.dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input+label{display:inline-block;position:relative;box-shadow:inset 0 0 0 0 #dfdfdf;border:1px solid #dfdfdf;height:20px;width:32px;border-radius:10px;box-sizing:border-box;cursor:pointer;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out}.dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input+label:after,.dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input+label:before{content:"";position:absolute;display:block;height:18px;width:18px;top:0;left:0;border-radius:15px;-webkit-transition:.2s ease-in-out;transition:.2s ease-in-out}.dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input+label:after{background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.4)}.dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input:checked+label{border-color:hsla(0,0%,100%,.5)}.dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input:checked+label:before{width:30px;background:hsla(0,0%,100%,.5)}.dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input:checked+label:after{left:12px}.dplayer .dplayer-menu{position:absolute;width:150px;border-radius:2px;background:rgba(28,28,28,.9);padding:5px 0;overflow:hidden;z-index:3;display:none}.dplayer .dplayer-menu.dplayer-menu-show{display:block}.dplayer .dplayer-menu .dplayer-menu-item{height:30px;padding:5px 10px;box-sizing:border-box;cursor:pointer}.dplayer .dplayer-menu .dplayer-menu-item:hover{background-color:hsla(0,0%,100%,.1)}.dplayer .dplayer-menu .dplayer-menu-item .dplayer-menu-label a{color:#eee;font-size:13px;display:inline-block;vertical-align:middle}@-webkit-keyframes my-face{2%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}4%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}6%{-webkit-transform:translateY(1.5px) rotate(-1.5deg);transform:translateY(1.5px) rotate(-1.5deg)}8%{-webkit-transform:translateY(-1.5px) rotate(-1.5deg);transform:translateY(-1.5px) rotate(-1.5deg)}10%{-webkit-transform:translateY(2.5px) rotate(1.5deg);transform:translateY(2.5px) rotate(1.5deg)}12%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}14%{-webkit-transform:translateY(-1.5px) rotate(1.5deg);transform:translateY(-1.5px) rotate(1.5deg)}16%{-webkit-transform:translateY(-.5px) rotate(-1.5deg);transform:translateY(-.5px) rotate(-1.5deg)}18%{-webkit-transform:translateY(.5px) rotate(-1.5deg);transform:translateY(.5px) rotate(-1.5deg)}20%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}22%{-webkit-transform:translateY(.5px) rotate(-1.5deg);transform:translateY(.5px) rotate(-1.5deg)}24%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}26%{-webkit-transform:translateY(.5px) rotate(.5deg);transform:translateY(.5px) rotate(.5deg)}28%{-webkit-transform:translateY(.5px) rotate(1.5deg);transform:translateY(.5px) rotate(1.5deg)}30%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}32%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}34%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}36%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}38%{-webkit-transform:translateY(1.5px) rotate(-1.5deg);transform:translateY(1.5px) rotate(-1.5deg)}40%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}42%{-webkit-transform:translateY(2.5px) rotate(-1.5deg);transform:translateY(2.5px) rotate(-1.5deg)}44%{-webkit-transform:translateY(1.5px) rotate(.5deg);transform:translateY(1.5px) rotate(.5deg)}46%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}48%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}50%{-webkit-transform:translateY(.5px) rotate(.5deg);transform:translateY(.5px) rotate(.5deg)}52%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}54%{-webkit-transform:translateY(-1.5px) rotate(1.5deg);transform:translateY(-1.5px) rotate(1.5deg)}56%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}58%{-webkit-transform:translateY(.5px) rotate(2.5deg);transform:translateY(.5px) rotate(2.5deg)}60%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}62%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}64%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}66%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}68%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}70%{-webkit-transform:translateY(1.5px) rotate(.5deg);transform:translateY(1.5px) rotate(.5deg)}72%{-webkit-transform:translateY(2.5px) rotate(1.5deg);transform:translateY(2.5px) rotate(1.5deg)}74%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}76%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}78%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}80%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}82%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}84%{-webkit-transform:translateY(1.5px) rotate(2.5deg);transform:translateY(1.5px) rotate(2.5deg)}86%{-webkit-transform:translateY(-1.5px) rotate(-1.5deg);transform:translateY(-1.5px) rotate(-1.5deg)}88%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}90%{-webkit-transform:translateY(2.5px) rotate(-.5deg);transform:translateY(2.5px) rotate(-.5deg)}92%{-webkit-transform:translateY(.5px) rotate(-.5deg);transform:translateY(.5px) rotate(-.5deg)}94%{-webkit-transform:translateY(2.5px) rotate(.5deg);transform:translateY(2.5px) rotate(.5deg)}96%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}98%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}0%,to{-webkit-transform:translate(0) rotate(0deg);transform:translate(0) rotate(0deg)}}@keyframes my-face{2%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}4%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}6%{-webkit-transform:translateY(1.5px) rotate(-1.5deg);transform:translateY(1.5px) rotate(-1.5deg)}8%{-webkit-transform:translateY(-1.5px) rotate(-1.5deg);transform:translateY(-1.5px) rotate(-1.5deg)}10%{-webkit-transform:translateY(2.5px) rotate(1.5deg);transform:translateY(2.5px) rotate(1.5deg)}12%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}14%{-webkit-transform:translateY(-1.5px) rotate(1.5deg);transform:translateY(-1.5px) rotate(1.5deg)}16%{-webkit-transform:translateY(-.5px) rotate(-1.5deg);transform:translateY(-.5px) rotate(-1.5deg)}18%{-webkit-transform:translateY(.5px) rotate(-1.5deg);transform:translateY(.5px) rotate(-1.5deg)}20%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}22%{-webkit-transform:translateY(.5px) rotate(-1.5deg);transform:translateY(.5px) rotate(-1.5deg)}24%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}26%{-webkit-transform:translateY(.5px) rotate(.5deg);transform:translateY(.5px) rotate(.5deg)}28%{-webkit-transform:translateY(.5px) rotate(1.5deg);transform:translateY(.5px) rotate(1.5deg)}30%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}32%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}34%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}36%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}38%{-webkit-transform:translateY(1.5px) rotate(-1.5deg);transform:translateY(1.5px) rotate(-1.5deg)}40%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}42%{-webkit-transform:translateY(2.5px) rotate(-1.5deg);transform:translateY(2.5px) rotate(-1.5deg)}44%{-webkit-transform:translateY(1.5px) rotate(.5deg);transform:translateY(1.5px) rotate(.5deg)}46%{-webkit-transform:translateY(-1.5px) rotate(2.5deg);transform:translateY(-1.5px) rotate(2.5deg)}48%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}50%{-webkit-transform:translateY(.5px) rotate(.5deg);transform:translateY(.5px) rotate(.5deg)}52%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}54%{-webkit-transform:translateY(-1.5px) rotate(1.5deg);transform:translateY(-1.5px) rotate(1.5deg)}56%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}58%{-webkit-transform:translateY(.5px) rotate(2.5deg);transform:translateY(.5px) rotate(2.5deg)}60%{-webkit-transform:translateY(2.5px) rotate(2.5deg);transform:translateY(2.5px) rotate(2.5deg)}62%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}64%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}66%{-webkit-transform:translateY(1.5px) rotate(-.5deg);transform:translateY(1.5px) rotate(-.5deg)}68%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}70%{-webkit-transform:translateY(1.5px) rotate(.5deg);transform:translateY(1.5px) rotate(.5deg)}72%{-webkit-transform:translateY(2.5px) rotate(1.5deg);transform:translateY(2.5px) rotate(1.5deg)}74%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}76%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}78%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}80%{-webkit-transform:translateY(1.5px) rotate(1.5deg);transform:translateY(1.5px) rotate(1.5deg)}82%{-webkit-transform:translateY(-.5px) rotate(.5deg);transform:translateY(-.5px) rotate(.5deg)}84%{-webkit-transform:translateY(1.5px) rotate(2.5deg);transform:translateY(1.5px) rotate(2.5deg)}86%{-webkit-transform:translateY(-1.5px) rotate(-1.5deg);transform:translateY(-1.5px) rotate(-1.5deg)}88%{-webkit-transform:translateY(-.5px) rotate(2.5deg);transform:translateY(-.5px) rotate(2.5deg)}90%{-webkit-transform:translateY(2.5px) rotate(-.5deg);transform:translateY(2.5px) rotate(-.5deg)}92%{-webkit-transform:translateY(.5px) rotate(-.5deg);transform:translateY(.5px) rotate(-.5deg)}94%{-webkit-transform:translateY(2.5px) rotate(.5deg);transform:translateY(2.5px) rotate(.5deg)}96%{-webkit-transform:translateY(-.5px) rotate(1.5deg);transform:translateY(-.5px) rotate(1.5deg)}98%{-webkit-transform:translateY(-1.5px) rotate(-.5deg);transform:translateY(-1.5px) rotate(-.5deg)}0%,to{-webkit-transform:translate(0) rotate(0deg);transform:translate(0) rotate(0deg)}}',""]); -},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t=0&&h.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",l(e,t),t}function i(e){var t=document.createElement("link");return t.rel="stylesheet",l(e,t),t}function d(e,t){var a,r,n;if(t.singleton){var l=v++;a=b||(b=s(t)),r=p.bind(null,a,l,!1),n=p.bind(null,a,l,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(a=i(t),r=m.bind(null,a),n=function(){o(a),a.href&&URL.revokeObjectURL(a.href)}):(a=s(t),r=c.bind(null,a),n=function(){o(a)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else n()}}function p(e,t,a,r){var n=a?"":r.css;if(e.styleSheet)e.styleSheet.cssText=x(t,n);else{var l=document.createTextNode(n),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(l,o[t]):e.appendChild(l)}}function c(e,t){var a=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=a;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(a))}}function m(e,t){var a=t.css,r=t.sourceMap;r&&(a+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var n=new Blob([a],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(n),l&&URL.revokeObjectURL(l)}var y={},u=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},g=u(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),f=u(function(){return document.head||document.getElementsByTagName("head")[0]}),b=null,v=0,h=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=g()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var a=n(e);return r(a,t),function(e){for(var l=[],o=0;o=200&&l.status<300||304===l.status){var e=JSON.parse(l.responseText);return 1!==e.code?a(l,e):t(l,e)}r(l)}},l.open(null!==n?"POST":"GET",e,!0),l.send(null!==n?JSON.stringify(n):null)};n.send=function(e,n){a(e,n,function(e,n){console.log("Post danmaku: ",n)},function(e,n){alert(n.msg)},function(e){console.log("Request was unsuccessful: "+e.status)})},n.read=function(e,n){a(e,null,function(e,t){n(null,t.danmaku)},function(e,t){n({status:e.status,response:t})},function(e){n({status:e.status,response:null})})}},function(e,n,t){var a=t(2);"string"==typeof a&&(a=[[e.i,a,""]]);t(4)(a,{});a.locals&&(e.exports=a.locals)},function(e,n,t){n=e.exports=t(3)(),n.push([e.i,'.dplayer {\n position: relative;\n overflow: hidden;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n line-height: 1; }\n .dplayer:-webkit-full-screen {\n width: 100% !important;\n height: 100% !important;\n background: #000; }\n .dplayer:-webkit-full-screen .dplayer-danmaku .dplayer-danmaku-top.dplayer-danmaku-move,\n .dplayer:-webkit-full-screen .dplayer-danmaku .dplayer-danmaku-bottom.dplayer-danmaku-move {\n -webkit-animation: danmaku-center 6s linear;\n animation: danmaku-center 6s linear;\n -webkit-animation-play-state: paused;\n animation-play-state: paused; }\n .dplayer:-webkit-full-screen .dplayer-danmaku .dplayer-danmaku-right.dplayer-danmaku-move {\n -webkit-animation: danmaku 8s linear;\n animation: danmaku 8s linear;\n -webkit-animation-play-state: paused;\n animation-play-state: paused; }\n .dplayer.dplayer-no-danmaku .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-box {\n height: 60px; }\n .dplayer.dplayer-no-danmaku .dplayer-controller .dplayer-icons .dplayer-comment {\n display: none; }\n .dplayer.dplayer-no-danmaku .dplayer-danmaku {\n display: none; }\n .dplayer.dplayer-playing .dplayer-danmaku .dplayer-danmaku-move {\n -webkit-animation-play-state: running !important;\n animation-play-state: running !important; }\n @media (min-width: 900px) {\n .dplayer.dplayer-playing .dplayer-controller-mask {\n opacity: 0; }\n .dplayer.dplayer-playing .dplayer-controller {\n opacity: 0; }\n .dplayer.dplayer-playing:hover .dplayer-controller-mask {\n opacity: 1; }\n .dplayer.dplayer-playing:hover .dplayer-controller {\n opacity: 1; } }\n .dplayer.dplayer-loading .dplayer-bezel .diplayer-loading-icon {\n display: block; }\n .dplayer.dplayer-loading .dplayer-danmaku .dplayer-danmaku-move {\n -webkit-animation-play-state: paused !important;\n animation-play-state: paused !important; }\n .dplayer.dplayer-hide-controller .dplayer-controller-mask {\n opacity: 0;\n -webkit-transform: translateY(100%);\n transform: translateY(100%); }\n .dplayer.dplayer-hide-controller .dplayer-controller {\n opacity: 0;\n -webkit-transform: translateY(100%);\n transform: translateY(100%); }\n .dplayer.dplayer-show-controller .dplayer-controller-mask {\n opacity: 1; }\n .dplayer.dplayer-show-controller .dplayer-controller {\n opacity: 1; }\n .dplayer .dplayer-mask {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 1;\n display: none; }\n .dplayer .dplayer-mask.dplayer-mask-show {\n display: block; }\n .dplayer .dplayer-video-wrap {\n position: relative;\n background: #000;\n font-size: 0;\n width: 100%;\n height: 100%; }\n .dplayer .dplayer-video-wrap .dplayer-video {\n width: 100%;\n height: 100%; }\n .dplayer .dplayer-danmaku {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n font-size: 22px;\n color: #fff; }\n .dplayer .dplayer-danmaku .dplayer-danmaku-item {\n display: inline-block;\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n cursor: default;\n white-space: nowrap;\n font-weight: bolder;\n text-shadow: 0.5px 0.5px 0.5px rgba(0, 0, 0, 0.5); }\n .dplayer .dplayer-danmaku .dplayer-danmaku-item--demo {\n position: absolute;\n visibility: hidden; }\n .dplayer .dplayer-danmaku .dplayer-danmaku-right {\n position: absolute;\n right: 0;\n -webkit-transform: translateX(100%);\n transform: translateX(100%); }\n .dplayer .dplayer-danmaku .dplayer-danmaku-right.dplayer-danmaku-move {\n will-change: transform;\n -webkit-animation: danmaku 5s linear;\n animation: danmaku 5s linear;\n -webkit-animation-play-state: paused;\n animation-play-state: paused; }\n\n@-webkit-keyframes danmaku {\n from {\n -webkit-transform: translateX(100%);\n transform: translateX(100%); } }\n\n@keyframes danmaku {\n from {\n -webkit-transform: translateX(100%);\n transform: translateX(100%); } }\n .dplayer .dplayer-danmaku .dplayer-danmaku-top,\n .dplayer .dplayer-danmaku .dplayer-danmaku-bottom {\n position: absolute;\n width: 100%;\n text-align: center;\n visibility: hidden; }\n .dplayer .dplayer-danmaku .dplayer-danmaku-top.dplayer-danmaku-move,\n .dplayer .dplayer-danmaku .dplayer-danmaku-bottom.dplayer-danmaku-move {\n will-change: visibility;\n -webkit-animation: danmaku-center 4s linear;\n animation: danmaku-center 4s linear;\n -webkit-animation-play-state: paused;\n animation-play-state: paused; }\n\n@-webkit-keyframes danmaku-center {\n from {\n visibility: visible; }\n to {\n visibility: visible; } }\n\n@keyframes danmaku-center {\n from {\n visibility: visible; }\n to {\n visibility: visible; } }\n .dplayer .dplayer-bezel {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n font-size: 22px;\n color: #fff;\n pointer-events: none; }\n .dplayer .dplayer-bezel .dplayer-fill {\n fill: rgba(255, 255, 255, 0.8); }\n .dplayer .dplayer-bezel .dplayer-bezel-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n margin: -26px 0 0 -26px;\n height: 52px;\n width: 52px;\n padding: 12px;\n box-sizing: border-box;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n opacity: 0;\n pointer-events: none; }\n .dplayer .dplayer-bezel .dplayer-bezel-icon.dplayer-bezel-transition {\n -webkit-animation: bezel-hide .5s linear;\n animation: bezel-hide .5s linear; }\n\n@-webkit-keyframes bezel-hide {\n from {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1); }\n to {\n opacity: 0;\n -webkit-transform: scale(2);\n transform: scale(2); } }\n\n@keyframes bezel-hide {\n from {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1); }\n to {\n opacity: 0;\n -webkit-transform: scale(2);\n transform: scale(2); } }\n .dplayer .dplayer-bezel .dplayer-danloading {\n position: absolute;\n top: 50%;\n margin-top: -7px;\n width: 100%;\n text-align: center;\n font-size: 14px;\n line-height: 14px;\n -webkit-animation: my-face 5s infinite ease-in-out;\n animation: my-face 5s infinite ease-in-out; }\n .dplayer .dplayer-bezel .diplayer-loading-icon {\n display: none;\n position: absolute;\n top: 50%;\n left: 50%;\n margin: -18px 0 0 -18px;\n height: 36px;\n width: 36px;\n pointer-events: none; }\n .dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-hide {\n display: none; }\n .dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot {\n -webkit-animation: diplayer-loading-dot-fade .8s ease infinite;\n animation: diplayer-loading-dot-fade .8s ease infinite;\n opacity: 0;\n fill: #fff;\n -webkit-transform-origin: 4px 4px;\n transform-origin: 4px 4px; }\n .dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-7 {\n -webkit-animation-delay: 0.7s;\n animation-delay: 0.7s; }\n .dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-6 {\n -webkit-animation-delay: 0.6s;\n animation-delay: 0.6s; }\n .dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-5 {\n -webkit-animation-delay: 0.5s;\n animation-delay: 0.5s; }\n .dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-4 {\n -webkit-animation-delay: 0.4s;\n animation-delay: 0.4s; }\n .dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-3 {\n -webkit-animation-delay: 0.3s;\n animation-delay: 0.3s; }\n .dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-2 {\n -webkit-animation-delay: 0.2s;\n animation-delay: 0.2s; }\n .dplayer .dplayer-bezel .diplayer-loading-icon .diplayer-loading-dot.diplayer-loading-dot-1 {\n -webkit-animation-delay: 0.1s;\n animation-delay: 0.1s; }\n\n@-webkit-keyframes diplayer-loading-dot-fade {\n 0% {\n opacity: .7;\n -webkit-transform: scale(1.2, 1.2);\n transform: scale(1.2, 1.2); }\n 50% {\n opacity: .25;\n -webkit-transform: scale(0.9, 0.9);\n transform: scale(0.9, 0.9); }\n to {\n opacity: .25;\n -webkit-transform: scale(0.85, 0.85);\n transform: scale(0.85, 0.85); } }\n\n@keyframes diplayer-loading-dot-fade {\n 0% {\n opacity: .7;\n -webkit-transform: scale(1.2, 1.2);\n transform: scale(1.2, 1.2); }\n 50% {\n opacity: .25;\n -webkit-transform: scale(0.9, 0.9);\n transform: scale(0.9, 0.9); }\n to {\n opacity: .25;\n -webkit-transform: scale(0.85, 0.85);\n transform: scale(0.85, 0.85); } }\n .dplayer .dplayer-controller-mask {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom;\n height: 98px;\n width: 100%;\n position: absolute;\n bottom: 0;\n -webkit-transition: all 0.3s ease;\n transition: all 0.3s ease; }\n .dplayer .dplayer-controller {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 41px;\n padding: 0 20px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-transition: all 0.3s ease;\n transition: all 0.3s ease; }\n .dplayer .dplayer-controller .dplayer-bar-wrap {\n padding: 5px 0;\n cursor: pointer;\n position: absolute;\n bottom: 33px;\n width: calc(100% - 40px);\n height: 3px; }\n .dplayer .dplayer-controller .dplayer-bar-wrap:hover .dplayer-thumb {\n -webkit-transform: scale(1) !important;\n transform: scale(1) !important; }\n .dplayer .dplayer-controller .dplayer-bar-wrap .dplayer-bar {\n position: relative;\n height: 3px;\n width: 100%;\n background: rgba(255, 255, 255, 0.2);\n cursor: pointer !important; }\n .dplayer .dplayer-controller .dplayer-bar-wrap .dplayer-bar .dplayer-loaded {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n background: rgba(255, 255, 255, 0.4);\n height: 3px;\n -webkit-transition: all 0.5s ease;\n transition: all 0.5s ease;\n will-change: width; }\n .dplayer .dplayer-controller .dplayer-bar-wrap .dplayer-bar .dplayer-played {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n height: 3px;\n will-change: width; }\n .dplayer .dplayer-controller .dplayer-bar-wrap .dplayer-bar .dplayer-played .dplayer-thumb {\n position: absolute;\n top: 0;\n right: 5px;\n margin-top: -4px;\n margin-right: -10px;\n height: 11px;\n width: 11px;\n border-radius: 50%;\n cursor: pointer !important;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n -webkit-transform: scale(0);\n transform: scale(0); }\n .dplayer .dplayer-controller .dplayer-icons {\n height: 38px;\n position: absolute;\n bottom: 0; }\n .dplayer .dplayer-controller .dplayer-icons.dplayer-icons-left .dplayer-icon {\n padding: 7px; }\n .dplayer .dplayer-controller .dplayer-icons.dplayer-icons-right {\n right: 20px; }\n .dplayer .dplayer-controller .dplayer-icons.dplayer-icons-right .dplayer-icon {\n padding: 8px; }\n .dplayer .dplayer-controller .dplayer-icons #dplayer-menu {\n stroke: #ddd;\n stroke-width: 1px; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-time {\n line-height: 38px;\n color: #eee;\n text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);\n vertical-align: middle;\n font-size: 13px;\n cursor: default; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-icon {\n width: 46px;\n height: 100%;\n border: none;\n background-color: transparent;\n outline: none;\n cursor: pointer;\n opacity: .8;\n -webkit-transition: all .2s ease-in-out;\n transition: all .2s ease-in-out;\n vertical-align: middle;\n box-sizing: border-box;\n display: inline-block; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-icon:hover {\n opacity: 1; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-icon.dplayer-comment-icon {\n padding: 10px 9px 9px; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-icon.dplayer-setting-icon {\n padding-top: 8.5px; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-fill {\n fill: #fff; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-volume {\n position: relative;\n display: inline-block;\n cursor: pointer !important;\n height: 100%; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-volume:hover .dplayer-volume-bar {\n width: 45px !important; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-volume:hover .dplayer-thumb {\n -webkit-transform: scale(1) !important;\n transform: scale(1) !important; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-volume.dplayer-volume-active .dplayer-volume-bar {\n width: 45px !important; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-volume.dplayer-volume-active .dplayer-thumb {\n -webkit-transform: scale(1) !important;\n transform: scale(1) !important; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-volume .dplayer-volume-bar-wrap {\n display: inline-block;\n margin: 0 5px 0 -5px;\n vertical-align: middle;\n height: 100%; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-volume .dplayer-volume-bar-wrap .dplayer-volume-bar {\n position: relative;\n top: 17px;\n width: 0;\n height: 3px;\n background: #aaa;\n -webkit-transition: all 0.3s ease-in-out;\n transition: all 0.3s ease-in-out; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-volume .dplayer-volume-bar-wrap .dplayer-volume-bar .dplayer-volume-bar-inner {\n position: absolute;\n bottom: 0;\n left: 0;\n height: 100%;\n -webkit-transition: all 0.1s ease;\n transition: all 0.1s ease;\n will-change: width; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-volume .dplayer-volume-bar-wrap .dplayer-volume-bar .dplayer-volume-bar-inner .dplayer-thumb {\n position: absolute;\n top: 0;\n right: 5px;\n margin-top: -4px;\n margin-right: -10px;\n height: 11px;\n width: 11px;\n border-radius: 50%;\n cursor: pointer !important;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n -webkit-transform: scale(0);\n transform: scale(0); }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting {\n display: inline-block;\n height: 100%; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-box {\n position: absolute;\n right: 0;\n bottom: 50px;\n -webkit-transform: translateX(170px);\n transform: translateX(170px);\n width: 150px;\n height: 120px;\n border-radius: 2px;\n background: rgba(28, 28, 28, 0.9);\n padding: 7px 0;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n overflow: hidden;\n z-index: 2; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-box.dplayer-setting-box-open {\n -webkit-transform: translateX(0);\n transform: translateX(0); }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-box.dplayer-setting-box-narrow {\n width: 70px;\n height: 180px;\n text-align: center; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-item,\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-speed-item {\n height: 30px;\n padding: 5px 10px;\n box-sizing: border-box;\n cursor: pointer; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-item:hover,\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-speed-item:hover {\n background-color: rgba(255, 255, 255, 0.1); }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku {\n padding: 5px 0; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku .dplayer-label {\n padding: 0 10px;\n display: inline; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku:hover .dplayer-label {\n display: none; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku:hover .dplayer-danmaku-bar-wrap {\n display: inline-block; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku.dplayer-setting-danmaku-active .dplayer-label {\n display: none; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku.dplayer-setting-danmaku-active .dplayer-danmaku-bar-wrap {\n display: inline-block; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku .dplayer-danmaku-bar-wrap {\n padding: 0 10px;\n box-sizing: border-box;\n display: none;\n vertical-align: middle;\n height: 100%;\n width: 100%; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku .dplayer-danmaku-bar-wrap .dplayer-danmaku-bar {\n position: relative;\n top: 8.5px;\n width: 100%;\n height: 3px;\n background: #fff;\n -webkit-transition: all 0.3s ease-in-out;\n transition: all 0.3s ease-in-out; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku .dplayer-danmaku-bar-wrap .dplayer-danmaku-bar .dplayer-danmaku-bar-inner {\n position: absolute;\n bottom: 0;\n left: 0;\n height: 100%;\n -webkit-transition: all 0.1s ease;\n transition: all 0.1s ease;\n background: #aaa;\n will-change: width; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-setting .dplayer-setting-danmaku .dplayer-danmaku-bar-wrap .dplayer-danmaku-bar .dplayer-danmaku-bar-inner .dplayer-thumb {\n position: absolute;\n top: 0;\n right: 5px;\n margin-top: -4px;\n margin-right: -10px;\n height: 11px;\n width: 11px;\n border-radius: 50%;\n cursor: pointer !important;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n background: #aaa; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment {\n display: inline-block;\n height: 100%; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box {\n position: absolute;\n right: 0;\n bottom: 50px;\n -webkit-transform: translateX(382px);\n transform: translateX(382px);\n border-radius: 2px;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n z-index: 2; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box.dplayer-comment-box-open {\n -webkit-transform: translateX(0);\n transform: translateX(0); }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-icon {\n height: 24px;\n width: 24px;\n position: absolute;\n top: 5px;\n left: 7px;\n padding: 0;\n opacity: 1; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-icon:hover .dplayer-fill {\n fill: #aaa; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-icon .dplayer-fill {\n -webkit-transition: all .2s ease-in-out;\n transition: all .2s ease-in-out;\n fill: #ddd; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box {\n position: absolute;\n background: #fff;\n bottom: 40px;\n left: -93px;\n box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);\n border-radius: 4px;\n padding: 10px 10px 16px;\n font-size: 14px;\n width: 204px;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n -webkit-transform: scale(0);\n transform: scale(0); }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box.dplayer-comment-setting-open {\n -webkit-transform: scale(1);\n transform: scale(1); }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box::after {\n content: \'\';\n position: absolute;\n top: 100%;\n left: 50%;\n margin-left: -12px;\n background: url(\'data:image/svg+xml;utf8,\');\n width: 24px;\n height: 12px; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box input[type=radio] {\n display: none; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box label {\n cursor: pointer; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-title {\n font-size: 14px;\n color: #555;\n padding: 6px; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-type {\n font-size: 0; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-type label:nth-child(2) span {\n border-radius: 4px 0 0 4px; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-type label:nth-child(4) span {\n border-radius: 0 4px 4px 0; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-type span {\n width: 33%;\n padding: 4px 6px;\n line-height: 16px;\n display: inline-block;\n font-size: 12px;\n color: #555;\n border: 1px solid #E4E4E6;\n margin-right: -1px;\n box-sizing: border-box;\n text-align: center;\n cursor: pointer; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-type input:checked + span {\n background: #E4E4E6; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-color {\n font-size: 0; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-color label {\n font-size: 0;\n padding: 6px;\n display: inline-block; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-color span {\n width: 22px;\n height: 22px;\n display: inline-block;\n border-radius: 50%;\n box-sizing: border-box;\n cursor: pointer; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-color span:hover {\n -webkit-animation: my-face 5s infinite ease-in-out;\n animation: my-face 5s infinite ease-in-out;\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-setting-box .dplayer-comment-setting-color input:checked + span {\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\n border: none !important; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-comment-input {\n outline: none;\n border: none;\n padding: 8px 31px;\n font-size: 14px;\n line-height: 18px;\n text-align: center;\n border-radius: 4px;\n width: 300px;\n background: #fff;\n margin: 0;\n height: auto; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-send-icon {\n height: 22px;\n width: 22px;\n position: absolute;\n top: 6px;\n right: 7px;\n padding: 0;\n opacity: 1; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-send-icon:hover .dplayer-fill {\n fill: #aaa; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-comment .dplayer-comment-box .dplayer-send-icon .dplayer-fill {\n -webkit-transition: all .2s ease-in-out;\n transition: all .2s ease-in-out;\n fill: #ddd; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-label {\n color: #eee;\n font-size: 13px;\n display: inline-block;\n vertical-align: middle; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-toggle {\n width: 32px;\n height: 100%;\n text-align: center;\n display: inline-block;\n font-size: 0;\n vertical-align: middle;\n float: right; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input {\n max-height: 0;\n max-width: 0;\n display: none; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input + label {\n display: inline-block;\n position: relative;\n box-shadow: #dfdfdf 0 0 0 0 inset;\n border: 1px solid #dfdfdf;\n height: 20px;\n width: 32px;\n border-radius: 10px;\n box-sizing: border-box;\n cursor: pointer;\n -webkit-transition: .2s ease-in-out;\n transition: .2s ease-in-out; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input + label:before {\n content: "";\n position: absolute;\n display: block;\n height: 18px;\n width: 18px;\n top: 0;\n left: 0;\n border-radius: 15px;\n -webkit-transition: .2s ease-in-out;\n transition: .2s ease-in-out; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input + label:after {\n content: "";\n position: absolute;\n display: block;\n left: 0;\n top: 0;\n border-radius: 15px;\n background: #fff;\n -webkit-transition: .2s ease-in-out;\n transition: .2s ease-in-out;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);\n height: 18px;\n width: 18px; }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input:checked + label {\n border-color: rgba(255, 255, 255, 0.5); }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input:checked + label:before {\n width: 30px;\n background: rgba(255, 255, 255, 0.5); }\n .dplayer .dplayer-controller .dplayer-icons .dplayer-toggle input:checked + label:after {\n left: 12px; }\n .dplayer .dplayer-menu {\n position: absolute;\n width: 150px;\n border-radius: 2px;\n background: rgba(28, 28, 28, 0.9);\n padding: 5px 0;\n overflow: hidden;\n z-index: 3;\n display: none; }\n .dplayer .dplayer-menu.dplayer-menu-show {\n display: block; }\n .dplayer .dplayer-menu .dplayer-menu-item {\n height: 30px;\n padding: 5px 10px;\n box-sizing: border-box;\n cursor: pointer; }\n .dplayer .dplayer-menu .dplayer-menu-item:hover {\n background-color: rgba(255, 255, 255, 0.1); }\n .dplayer .dplayer-menu .dplayer-menu-item .dplayer-menu-label a {\n color: #eee;\n font-size: 13px;\n display: inline-block;\n vertical-align: middle; }\n\n@-webkit-keyframes my-face {\n 2% {\n -webkit-transform: translate(0, 1.5px) rotate(1.5deg);\n transform: translate(0, 1.5px) rotate(1.5deg); }\n 4% {\n -webkit-transform: translate(0, -1.5px) rotate(-0.5deg);\n transform: translate(0, -1.5px) rotate(-0.5deg); }\n 6% {\n -webkit-transform: translate(0, 1.5px) rotate(-1.5deg);\n transform: translate(0, 1.5px) rotate(-1.5deg); }\n 8% {\n -webkit-transform: translate(0, -1.5px) rotate(-1.5deg);\n transform: translate(0, -1.5px) rotate(-1.5deg); }\n 10% {\n -webkit-transform: translate(0, 2.5px) rotate(1.5deg);\n transform: translate(0, 2.5px) rotate(1.5deg); }\n 12% {\n -webkit-transform: translate(0, -0.5px) rotate(1.5deg);\n transform: translate(0, -0.5px) rotate(1.5deg); }\n 14% {\n -webkit-transform: translate(0, -1.5px) rotate(1.5deg);\n transform: translate(0, -1.5px) rotate(1.5deg); }\n 16% {\n -webkit-transform: translate(0, -0.5px) rotate(-1.5deg);\n transform: translate(0, -0.5px) rotate(-1.5deg); }\n 18% {\n -webkit-transform: translate(0, 0.5px) rotate(-1.5deg);\n transform: translate(0, 0.5px) rotate(-1.5deg); }\n 20% {\n -webkit-transform: translate(0, -1.5px) rotate(2.5deg);\n transform: translate(0, -1.5px) rotate(2.5deg); }\n 22% {\n -webkit-transform: translate(0, 0.5px) rotate(-1.5deg);\n transform: translate(0, 0.5px) rotate(-1.5deg); }\n 24% {\n -webkit-transform: translate(0, 1.5px) rotate(1.5deg);\n transform: translate(0, 1.5px) rotate(1.5deg); }\n 26% {\n -webkit-transform: translate(0, 0.5px) rotate(0.5deg);\n transform: translate(0, 0.5px) rotate(0.5deg); }\n 28% {\n -webkit-transform: translate(0, 0.5px) rotate(1.5deg);\n transform: translate(0, 0.5px) rotate(1.5deg); }\n 30% {\n -webkit-transform: translate(0, -0.5px) rotate(2.5deg);\n transform: translate(0, -0.5px) rotate(2.5deg); }\n 32% {\n -webkit-transform: translate(0, 1.5px) rotate(-0.5deg);\n transform: translate(0, 1.5px) rotate(-0.5deg); }\n 34% {\n -webkit-transform: translate(0, 1.5px) rotate(-0.5deg);\n transform: translate(0, 1.5px) rotate(-0.5deg); }\n 36% {\n -webkit-transform: translate(0, -1.5px) rotate(2.5deg);\n transform: translate(0, -1.5px) rotate(2.5deg); }\n 38% {\n -webkit-transform: translate(0, 1.5px) rotate(-1.5deg);\n transform: translate(0, 1.5px) rotate(-1.5deg); }\n 40% {\n -webkit-transform: translate(0, -0.5px) rotate(2.5deg);\n transform: translate(0, -0.5px) rotate(2.5deg); }\n 42% {\n -webkit-transform: translate(0, 2.5px) rotate(-1.5deg);\n transform: translate(0, 2.5px) rotate(-1.5deg); }\n 44% {\n -webkit-transform: translate(0, 1.5px) rotate(0.5deg);\n transform: translate(0, 1.5px) rotate(0.5deg); }\n 46% {\n -webkit-transform: translate(0, -1.5px) rotate(2.5deg);\n transform: translate(0, -1.5px) rotate(2.5deg); }\n 48% {\n -webkit-transform: translate(0, -0.5px) rotate(0.5deg);\n transform: translate(0, -0.5px) rotate(0.5deg); }\n 50% {\n -webkit-transform: translate(0, 0.5px) rotate(0.5deg);\n transform: translate(0, 0.5px) rotate(0.5deg); }\n 52% {\n -webkit-transform: translate(0, 2.5px) rotate(2.5deg);\n transform: translate(0, 2.5px) rotate(2.5deg); }\n 54% {\n -webkit-transform: translate(0, -1.5px) rotate(1.5deg);\n transform: translate(0, -1.5px) rotate(1.5deg); }\n 56% {\n -webkit-transform: translate(0, 2.5px) rotate(2.5deg);\n transform: translate(0, 2.5px) rotate(2.5deg); }\n 58% {\n -webkit-transform: translate(0, 0.5px) rotate(2.5deg);\n transform: translate(0, 0.5px) rotate(2.5deg); }\n 60% {\n -webkit-transform: translate(0, 2.5px) rotate(2.5deg);\n transform: translate(0, 2.5px) rotate(2.5deg); }\n 62% {\n -webkit-transform: translate(0, -0.5px) rotate(2.5deg);\n transform: translate(0, -0.5px) rotate(2.5deg); }\n 64% {\n -webkit-transform: translate(0, -0.5px) rotate(1.5deg);\n transform: translate(0, -0.5px) rotate(1.5deg); }\n 66% {\n -webkit-transform: translate(0, 1.5px) rotate(-0.5deg);\n transform: translate(0, 1.5px) rotate(-0.5deg); }\n 68% {\n -webkit-transform: translate(0, -1.5px) rotate(-0.5deg);\n transform: translate(0, -1.5px) rotate(-0.5deg); }\n 70% {\n -webkit-transform: translate(0, 1.5px) rotate(0.5deg);\n transform: translate(0, 1.5px) rotate(0.5deg); }\n 72% {\n -webkit-transform: translate(0, 2.5px) rotate(1.5deg);\n transform: translate(0, 2.5px) rotate(1.5deg); }\n 74% {\n -webkit-transform: translate(0, -0.5px) rotate(0.5deg);\n transform: translate(0, -0.5px) rotate(0.5deg); }\n 76% {\n -webkit-transform: translate(0, -0.5px) rotate(2.5deg);\n transform: translate(0, -0.5px) rotate(2.5deg); }\n 78% {\n -webkit-transform: translate(0, -0.5px) rotate(1.5deg);\n transform: translate(0, -0.5px) rotate(1.5deg); }\n 80% {\n -webkit-transform: translate(0, 1.5px) rotate(1.5deg);\n transform: translate(0, 1.5px) rotate(1.5deg); }\n 82% {\n -webkit-transform: translate(0, -0.5px) rotate(0.5deg);\n transform: translate(0, -0.5px) rotate(0.5deg); }\n 84% {\n -webkit-transform: translate(0, 1.5px) rotate(2.5deg);\n transform: translate(0, 1.5px) rotate(2.5deg); }\n 86% {\n -webkit-transform: translate(0, -1.5px) rotate(-1.5deg);\n transform: translate(0, -1.5px) rotate(-1.5deg); }\n 88% {\n -webkit-transform: translate(0, -0.5px) rotate(2.5deg);\n transform: translate(0, -0.5px) rotate(2.5deg); }\n 90% {\n -webkit-transform: translate(0, 2.5px) rotate(-0.5deg);\n transform: translate(0, 2.5px) rotate(-0.5deg); }\n 92% {\n -webkit-transform: translate(0, 0.5px) rotate(-0.5deg);\n transform: translate(0, 0.5px) rotate(-0.5deg); }\n 94% {\n -webkit-transform: translate(0, 2.5px) rotate(0.5deg);\n transform: translate(0, 2.5px) rotate(0.5deg); }\n 96% {\n -webkit-transform: translate(0, -0.5px) rotate(1.5deg);\n transform: translate(0, -0.5px) rotate(1.5deg); }\n 98% {\n -webkit-transform: translate(0, -1.5px) rotate(-0.5deg);\n transform: translate(0, -1.5px) rotate(-0.5deg); }\n 0%, 100% {\n -webkit-transform: translate(0, 0) rotate(0deg);\n transform: translate(0, 0) rotate(0deg); } }\n\n@keyframes my-face {\n 2% {\n -webkit-transform: translate(0, 1.5px) rotate(1.5deg);\n transform: translate(0, 1.5px) rotate(1.5deg); }\n 4% {\n -webkit-transform: translate(0, -1.5px) rotate(-0.5deg);\n transform: translate(0, -1.5px) rotate(-0.5deg); }\n 6% {\n -webkit-transform: translate(0, 1.5px) rotate(-1.5deg);\n transform: translate(0, 1.5px) rotate(-1.5deg); }\n 8% {\n -webkit-transform: translate(0, -1.5px) rotate(-1.5deg);\n transform: translate(0, -1.5px) rotate(-1.5deg); }\n 10% {\n -webkit-transform: translate(0, 2.5px) rotate(1.5deg);\n transform: translate(0, 2.5px) rotate(1.5deg); }\n 12% {\n -webkit-transform: translate(0, -0.5px) rotate(1.5deg);\n transform: translate(0, -0.5px) rotate(1.5deg); }\n 14% {\n -webkit-transform: translate(0, -1.5px) rotate(1.5deg);\n transform: translate(0, -1.5px) rotate(1.5deg); }\n 16% {\n -webkit-transform: translate(0, -0.5px) rotate(-1.5deg);\n transform: translate(0, -0.5px) rotate(-1.5deg); }\n 18% {\n -webkit-transform: translate(0, 0.5px) rotate(-1.5deg);\n transform: translate(0, 0.5px) rotate(-1.5deg); }\n 20% {\n -webkit-transform: translate(0, -1.5px) rotate(2.5deg);\n transform: translate(0, -1.5px) rotate(2.5deg); }\n 22% {\n -webkit-transform: translate(0, 0.5px) rotate(-1.5deg);\n transform: translate(0, 0.5px) rotate(-1.5deg); }\n 24% {\n -webkit-transform: translate(0, 1.5px) rotate(1.5deg);\n transform: translate(0, 1.5px) rotate(1.5deg); }\n 26% {\n -webkit-transform: translate(0, 0.5px) rotate(0.5deg);\n transform: translate(0, 0.5px) rotate(0.5deg); }\n 28% {\n -webkit-transform: translate(0, 0.5px) rotate(1.5deg);\n transform: translate(0, 0.5px) rotate(1.5deg); }\n 30% {\n -webkit-transform: translate(0, -0.5px) rotate(2.5deg);\n transform: translate(0, -0.5px) rotate(2.5deg); }\n 32% {\n -webkit-transform: translate(0, 1.5px) rotate(-0.5deg);\n transform: translate(0, 1.5px) rotate(-0.5deg); }\n 34% {\n -webkit-transform: translate(0, 1.5px) rotate(-0.5deg);\n transform: translate(0, 1.5px) rotate(-0.5deg); }\n 36% {\n -webkit-transform: translate(0, -1.5px) rotate(2.5deg);\n transform: translate(0, -1.5px) rotate(2.5deg); }\n 38% {\n -webkit-transform: translate(0, 1.5px) rotate(-1.5deg);\n transform: translate(0, 1.5px) rotate(-1.5deg); }\n 40% {\n -webkit-transform: translate(0, -0.5px) rotate(2.5deg);\n transform: translate(0, -0.5px) rotate(2.5deg); }\n 42% {\n -webkit-transform: translate(0, 2.5px) rotate(-1.5deg);\n transform: translate(0, 2.5px) rotate(-1.5deg); }\n 44% {\n -webkit-transform: translate(0, 1.5px) rotate(0.5deg);\n transform: translate(0, 1.5px) rotate(0.5deg); }\n 46% {\n -webkit-transform: translate(0, -1.5px) rotate(2.5deg);\n transform: translate(0, -1.5px) rotate(2.5deg); }\n 48% {\n -webkit-transform: translate(0, -0.5px) rotate(0.5deg);\n transform: translate(0, -0.5px) rotate(0.5deg); }\n 50% {\n -webkit-transform: translate(0, 0.5px) rotate(0.5deg);\n transform: translate(0, 0.5px) rotate(0.5deg); }\n 52% {\n -webkit-transform: translate(0, 2.5px) rotate(2.5deg);\n transform: translate(0, 2.5px) rotate(2.5deg); }\n 54% {\n -webkit-transform: translate(0, -1.5px) rotate(1.5deg);\n transform: translate(0, -1.5px) rotate(1.5deg); }\n 56% {\n -webkit-transform: translate(0, 2.5px) rotate(2.5deg);\n transform: translate(0, 2.5px) rotate(2.5deg); }\n 58% {\n -webkit-transform: translate(0, 0.5px) rotate(2.5deg);\n transform: translate(0, 0.5px) rotate(2.5deg); }\n 60% {\n -webkit-transform: translate(0, 2.5px) rotate(2.5deg);\n transform: translate(0, 2.5px) rotate(2.5deg); }\n 62% {\n -webkit-transform: translate(0, -0.5px) rotate(2.5deg);\n transform: translate(0, -0.5px) rotate(2.5deg); }\n 64% {\n -webkit-transform: translate(0, -0.5px) rotate(1.5deg);\n transform: translate(0, -0.5px) rotate(1.5deg); }\n 66% {\n -webkit-transform: translate(0, 1.5px) rotate(-0.5deg);\n transform: translate(0, 1.5px) rotate(-0.5deg); }\n 68% {\n -webkit-transform: translate(0, -1.5px) rotate(-0.5deg);\n transform: translate(0, -1.5px) rotate(-0.5deg); }\n 70% {\n -webkit-transform: translate(0, 1.5px) rotate(0.5deg);\n transform: translate(0, 1.5px) rotate(0.5deg); }\n 72% {\n -webkit-transform: translate(0, 2.5px) rotate(1.5deg);\n transform: translate(0, 2.5px) rotate(1.5deg); }\n 74% {\n -webkit-transform: translate(0, -0.5px) rotate(0.5deg);\n transform: translate(0, -0.5px) rotate(0.5deg); }\n 76% {\n -webkit-transform: translate(0, -0.5px) rotate(2.5deg);\n transform: translate(0, -0.5px) rotate(2.5deg); }\n 78% {\n -webkit-transform: translate(0, -0.5px) rotate(1.5deg);\n transform: translate(0, -0.5px) rotate(1.5deg); }\n 80% {\n -webkit-transform: translate(0, 1.5px) rotate(1.5deg);\n transform: translate(0, 1.5px) rotate(1.5deg); }\n 82% {\n -webkit-transform: translate(0, -0.5px) rotate(0.5deg);\n transform: translate(0, -0.5px) rotate(0.5deg); }\n 84% {\n -webkit-transform: translate(0, 1.5px) rotate(2.5deg);\n transform: translate(0, 1.5px) rotate(2.5deg); }\n 86% {\n -webkit-transform: translate(0, -1.5px) rotate(-1.5deg);\n transform: translate(0, -1.5px) rotate(-1.5deg); }\n 88% {\n -webkit-transform: translate(0, -0.5px) rotate(2.5deg);\n transform: translate(0, -0.5px) rotate(2.5deg); }\n 90% {\n -webkit-transform: translate(0, 2.5px) rotate(-0.5deg);\n transform: translate(0, 2.5px) rotate(-0.5deg); }\n 92% {\n -webkit-transform: translate(0, 0.5px) rotate(-0.5deg);\n transform: translate(0, 0.5px) rotate(-0.5deg); }\n 94% {\n -webkit-transform: translate(0, 2.5px) rotate(0.5deg);\n transform: translate(0, 2.5px) rotate(0.5deg); }\n 96% {\n -webkit-transform: translate(0, -0.5px) rotate(1.5deg);\n transform: translate(0, -0.5px) rotate(1.5deg); }\n 98% {\n -webkit-transform: translate(0, -1.5px) rotate(-0.5deg);\n transform: translate(0, -1.5px) rotate(-0.5deg); }\n 0%, 100% {\n -webkit-transform: translate(0, 0) rotate(0deg);\n transform: translate(0, 0) rotate(0deg); } }\n',""])},function(e,n){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],n=0;n=0&&v.splice(n,1)}function o(e){var n=document.createElement("style");return n.type="text/css",r(e,n),n}function i(e){var n=document.createElement("link");return n.rel="stylesheet",r(e,n),n}function s(e,n){var t,a,r;if(n.singleton){var s=b++;t=f||(f=o(n)),a=d.bind(null,t,s,!1),r=d.bind(null,t,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(t=i(n),a=c.bind(null,t),r=function(){l(t),t.href&&URL.revokeObjectURL(t.href)}):(t=o(n),a=p.bind(null,t),r=function(){l(t)});return a(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;a(e=n)}else r()}}function d(e,n,t,a){var r=t?"":a.css;if(e.styleSheet)e.styleSheet.cssText=h(n,r);else{var l=document.createTextNode(r),o=e.childNodes;o[n]&&e.removeChild(o[n]),o.length?e.insertBefore(l,o[n]):e.appendChild(l)}}function p(e,n){var t=n.css,a=n.media;if(a&&e.setAttribute("media",a),e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}function c(e,n){var t=n.css,a=n.sourceMap;a&&(t+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */");var r=new Blob([t],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(r),l&&URL.revokeObjectURL(l)}var m={},y=function(e){var n;return function(){return void 0===n&&(n=e.apply(this,arguments)),n}},u=y(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),g=y(function(){return document.head||document.getElementsByTagName("head")[0]}),f=null,b=0,v=[];e.exports=function(e,n){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");n=n||{},void 0===n.singleton&&(n.singleton=u()),void 0===n.insertAt&&(n.insertAt="bottom");var r=a(e);return t(r,n),function(e){for(var l=[],o=0;o\n \n \n \n '},this.option=n;var s=/mobile/i.test(window.navigator.userAgent);s&&(this.option.autoplay=!1);var d={element:document.getElementsByClassName("dplayer")[0],autoplay:!1,theme:"#b7daff",loop:!1,lang:navigator.language.indexOf("zh")!==-1?"zh":"en",screenshot:!1,hotkey:!0,preload:"auto",apiBackend:o};for(var p in d)d.hasOwnProperty(p)&&!this.option.hasOwnProperty(p)&&(this.option[p]=d[p]);var c={"Danmaku is loading":"弹幕加载中",Top:"顶部",Bottom:"底部",Rolling:"滚动","Input danmaku, hit Enter":"输入弹幕,回车发送","About author":"关于作者","DPlayer feedback":"播放器意见反馈","About DPlayer":"关于 DPlay 播放器",Loop:"洗脑循环",Speed:"速度","Opacity for danmaku":"弹幕透明度",Normal:"正常","Please input danmaku!":"要输入弹幕内容啊喂!","Set danmaku color":"设置弹幕颜色","Set danmaku type":"设置弹幕类型",Danmaku:"弹幕"},m=function(e){return"en"===t.option.lang?e:"zh"===t.option.lang?c[e]:void 0};this.updateBar=function(e,n,t){n=n>0?n:0,n=n<1?n:1,L[e+"Bar"].style[t]=100*n+"%"};var y=["play","pause","canplay","playing","ended","error"];this.event={};for(var u=0;u\n
\n \n
\n
\n
\n
\n \n '+(this.option.danmaku?''+m("Danmaku is loading")+"":"")+'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n
\n
\n
\n 0:00 / 0:00\n
\n
\n '+(this.option.screenshot?'\n "+this.getSVG("camera")+" \n ":"")+'\n
\n \n
\n \n
\n
\n
'+m("Set danmaku color")+'
\n \n \n \n \n \n \n
\n
\n
'+m("Set danmaku type")+'
\n \n \n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n ";var g=this.element.offsetWidth<=500;if(g){var f=document.createElement("style");f.innerHTML=".dplayer .dplayer-danmaku{font-size:18px}",document.head.appendChild(f)}if(this.video=this.element.getElementsByClassName("dplayer-video")[0],/(m3u8\?|m3u8$)/i.exec(this.option.video.url)&&Hls.isSupported()){this.element.getElementsByClassName("dplayer-time")[0].style.display="none";var b=new Hls;b.attachMedia(this.video),b.on(Hls.Events.MEDIA_ATTACHED,function(){b.loadSource(t.option.video.url),b.on(Hls.Events.MANIFEST_PARSED,function(e,n){console.log("manifest loaded, found "+n.levels.length+" quality level")})})}if(/(flv\?|flv$)/i.exec(this.option.video.url)&&flvjs.isSupported()){var v=flvjs.createPlayer({type:"flv",url:this.option.video.url});v.attachMediaElement(this.video),v.load()}this.bezel=this.element.getElementsByClassName("dplayer-bezel-icon")[0],this.bezel.addEventListener("animationend",function(){t.bezel.classList.remove("dplayer-bezel-transition")}),this.playButton=this.element.getElementsByClassName("dplayer-play-icon")[0],this.paused=!0,this.playButton.addEventListener("click",function(){t.toggle()});var h=this.element.getElementsByClassName("dplayer-video-wrap")[0],x=this.element.getElementsByClassName("dplayer-controller-mask")[0];if(s){var k=function(){t.element.classList.contains("dplayer-hide-controller")?t.element.classList.remove("dplayer-hide-controller"):t.element.classList.add("dplayer-hide-controller")};h.addEventListener("click",k),x.addEventListener("click",k)}else h.addEventListener("click",function(){t.toggle()}),x.addEventListener("click",function(){t.toggle()});var w=function(e){var n=function(e){return e<10?"0"+e:""+e},t=parseInt(e/60),a=parseInt(e-60*t);return n(t)+":"+n(a)},E=function(e){var n=e.offsetLeft,a=e.offsetParent,r=void 0;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==a&&a!==t.element;)n+=a.offsetLeft,a=a.offsetParent;else for(;null!==a;)n+=a.offsetLeft,a=a.offsetParent;return r=document.body.scrollLeft+document.documentElement.scrollLeft,n-r},L={};L.playedBar=this.element.getElementsByClassName("dplayer-played")[0],L.loadedBar=this.element.getElementsByClassName("dplayer-loaded")[0];var z=this.element.getElementsByClassName("dplayer-bar-wrap")[0],B=void 0;this.option.danmaku&&this.video.addEventListener("seeking",function(){for(var e=0;e=t.video.currentTime)return void(t.danIndex=e);t.danIndex=t.dan.length}});var C=0,T=0,M=!1,N=void 0;this.setTime=function(){t.playedTime=setInterval(function(){T=t.video.currentTime,!M&&TC+.01&&!t.video.paused&&(t.element.classList.remove("dplayer-loading"),M=!1),C=T,t.updateBar("played",t.video.currentTime/t.video.duration,"width"),t.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=w(t.video.currentTime),t.trigger("playing")},100),t.option.danmaku&&$&&(N=setInterval(function(){for(var e=t.dan[t.danIndex];e&&t.video.currentTime>=parseFloat(e.time);)oe(e.text,e.color,e.type),e=t.dan[++t.danIndex]},0))},this.clearTime=function(){clearInterval(t.playedTime),t.option.danmaku&&clearInterval(N)},z.addEventListener("click",function(e){var n=e||window.event;B=z.clientWidth;var a=(n.clientX-E(z))/B;a=a>0?a:0,a=a<1?a:1,t.updateBar("played",a,"width"),t.video.currentTime=parseFloat(L.playedBar.style.width)/100*t.video.duration});var q=function(e){var n=e||window.event,a=(n.clientX-E(z))/B;a=a>0?a:0,a=a<1?a:1,t.updateBar("played",a,"width"),t.element.getElementsByClassName("dplayer-ptime")[0].innerHTML=w(a*t.video.duration)},S=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",q),t.video.currentTime=parseFloat(L.playedBar.style.width)/100*t.video.duration,t.setTime()};z.addEventListener("mousedown",function(){B=z.clientWidth,t.clearTime(),document.addEventListener("mousemove",q),document.addEventListener("mouseup",S)}),L.volumeBar=this.element.getElementsByClassName("dplayer-volume-bar-inner")[0];var A=this.element.getElementsByClassName("dplayer-volume")[0],D=this.element.getElementsByClassName("dplayer-volume-bar-wrap")[0],I=this.element.getElementsByClassName("dplayer-volume-bar")[0],R=this.element.getElementsByClassName("dplayer-volume-icon")[0],F=35;this.switchVolumeIcon=function(){var e=t.element.getElementsByClassName("dplayer-volume-icon")[0];t.video.volume>=.8?e.innerHTML=t.getSVG("volume-up"):t.video.volume>0?e.innerHTML=t.getSVG("volume-down"):e.innerHTML=t.getSVG("volume-off")};var H=function(e){var n=e||window.event,a=(n.clientX-E(I)-5.5)/F;t.volume(a)},P=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",H),A.classList.remove("dplayer-volume-active")};D.addEventListener("click",function(e){var n=e||window.event,a=(n.clientX-E(I)-5.5)/F;t.volume(a)}),D.addEventListener("mousedown",function(){document.addEventListener("mousemove",H),document.addEventListener("mouseup",P),A.classList.add("dplayer-volume-active")}),R.addEventListener("click",function(){t.video.muted?(t.video.muted=!1,t.switchVolumeIcon(),t.updateBar("volume",t.video.volume,"width")):(t.video.muted=!0,R.innerHTML=t.getSVG("volume-off"),t.updateBar("volume",0,"width"))});var X=0;if(!s){var O=function(){t.element.classList.remove("dplayer-hide-controller"),clearTimeout(X),X=setTimeout(function(){t.video.played.length&&(t.element.classList.add("dplayer-hide-controller"),W(),ve())},2e3)};this.element.addEventListener("mousemove",O),this.element.addEventListener("click",O)}var V=localStorage.getItem("DPlayer-opacity")||.7,j={original:'\n
\n '+m("Speed")+'\n
'+this.getSVG("right")+'
\n
\n
\n '+m("Loop")+'\n
\n \n \n
\n
\n
\n '+m("Danmaku")+'\n
\n \n \n
\n
\n
\n '+m("Opacity for danmaku")+'\n
\n
\n
\n \n
\n
\n
\n
',speed:'\n
\n 0.5\n
\n
\n 0.75\n
\n
\n '+m("Normal")+'\n
\n
\n 1.25\n
\n
\n 1.5\n
\n
\n 2\n
'},U=this.element.getElementsByClassName("dplayer-setting-icon")[0],G=this.element.getElementsByClassName("dplayer-setting-box")[0],Y=this.element.getElementsByClassName("dplayer-mask")[0];G.innerHTML=j.original;var W=function(){G.classList.contains("dplayer-setting-box-open")&&(G.classList.remove("dplayer-setting-box-open"),Y.classList.remove("dplayer-mask-show"),setTimeout(function(){G.classList.remove("dplayer-setting-box-narrow"),G.innerHTML=j.original,Z()},300))},_=function(){G.classList.add("dplayer-setting-box-open"),Y.classList.add("dplayer-mask-show")};Y.addEventListener("click",function(){W()}),U.addEventListener("click",function(){_()});var J=this.option.loop,Q=this.element.getElementsByClassName("dplayer-danmaku")[0],$=!0,Z=function(){var e=t.element.getElementsByClassName("dplayer-setting-loop")[0],n=e.getElementsByClassName("dplayer-toggle-setting-input")[0];n.checked=J,e.addEventListener("click",function(){n.checked=!n.checked,n.checked?(J=!0,t.video.loop=J):(J=!1,t.video.loop=J),W()});var a=t.element.getElementsByClassName("dplayer-setting-showdan")[0],r=a.getElementsByClassName("dplayer-showdan-setting-input")[0];if(r.checked=$,a.addEventListener("click",function(){if(r.checked=!r.checked,r.checked){if($=!0,t.option.danmaku){for(var e=0;e=t.video.currentTime){t.danIndex=e;break}t.danIndex=t.dan.length}N=setInterval(function(){for(var e=t.dan[t.danIndex];e&&t.video.currentTime>=parseFloat(e.time);)oe(e.text,e.color,e.type),e=t.dan[++t.danIndex]},0)}}else $=!1,t.option.danmaku&&(clearInterval(N),Q.innerHTML='
',t.danTunnel={right:{},top:{},bottom:{}},t.itemDemo=t.element.getElementsByClassName("dplayer-danmaku-item")[0]);W()}),t.element.getElementsByClassName("dplayer-setting-speed")[0].addEventListener("click",function(){G.classList.add("dplayer-setting-box-narrow"),G.innerHTML=j.speed;for(var e=G.getElementsByClassName("dplayer-setting-speed-item"),n=function(n){e[n].addEventListener("click",function(){t.video.playbackRate=e[n].dataset.speed,W()})},a=0;a0?a:0,a=a<1?a:1,t.updateBar("danmaku",a,"width");for(var r=t.element.getElementsByClassName("dplayer-danmaku-item"),l=0;l0?a:0,a=a<1?a:1,t.updateBar("danmaku",a,"width");for(var r=t.element.getElementsByClassName("dplayer-danmaku-item"),l=0;l/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},ue=function(){if(ie.blur(),!ie.value.replace(/^\s+|\s+$/g,""))return void alert(m("Please input danmaku!"));var e={token:t.option.danmaku.token,player:t.option.danmaku.id,author:"DIYgod",time:t.video.currentTime,text:ie.value,color:t.element.querySelector(".dplayer-comment-setting-color input:checked").value,type:t.element.querySelector(".dplayer-comment-setting-type input:checked").value};t.option.apiBackend.send(t.option.danmaku.api,e),ie.value="",ve(),t.dan.splice(t.danIndex,0,e),t.danIndex++,oe(ye(e.text),e.color,e.type).style.border="2px solid "+t.option.theme},ge=function(){ce.classList.contains("dplayer-comment-setting-open")&&ce.classList.remove("dplayer-comment-setting-open")},fe=function(){ce.classList.contains("dplayer-comment-setting-open")?ce.classList.remove("dplayer-comment-setting-open"):ce.classList.add("dplayer-comment-setting-open")},be=0,ve=function(){de.classList.contains("dplayer-comment-box-open")&&(de.classList.remove("dplayer-comment-box-open"),Y.classList.remove("dplayer-mask-show"),clearInterval(be),t.element.classList.remove("dplayer-show-controller"),ge())},he=function(){de.classList.add("dplayer-comment-box-open"),Y.classList.add("dplayer-mask-show"),be=setInterval(function(){clearTimeout(X)},1e3),t.element.classList.add("dplayer-show-controller")};Y.addEventListener("click",function(){ve()}),se.addEventListener("click",function(){he(),setTimeout(function(){ie.focus()},300)}),pe.addEventListener("click",function(){fe()}),this.element.getElementsByClassName("dplayer-comment-setting-color")[0].addEventListener("click",function(){t.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked+span')&&(pe.getElementsByClassName("dplayer-fill")[0].style.fill=t.element.querySelector('input[name="dplayer-danmaku-color-${index}"]:checked').value)}),ie.addEventListener("click",function(){ge()}),ie.addEventListener("keydown",function(e){13===(e||window.event).keyCode&&ue()}),me.addEventListener("click",ue);var xe=function(){ee=Q.offsetWidth;for(var e=t.element.getElementsByClassName("dplayer-danmaku-item"),n=0;n=a.width?(we.style.right=a.width-r+"px",we.style.left="initial"):(we.style.left=n.clientX-t.element.getBoundingClientRect().left+"px",we.style.right="initial"),l+we.offsetHeight>=a.height?(we.style.bottom=a.height-l+"px",we.style.top="initial"):(we.style.top=n.clientY-t.element.getBoundingClientRect().top+"px",we.style.bottom="initial"),Y.classList.add("dplayer-mask-show"),Y.addEventListener("click",function(){Y.classList.remove("dplayer-mask-show"),we.classList.remove("dplayer-menu-show")})}),this.option.screenshot){var Ee=this.element.getElementsByClassName("dplayer-camera-icon")[0];Ee.addEventListener("click",function(){var e=document.createElement("canvas");e.width=t.video.videoWidth,e.height=t.video.videoHeight,e.getContext("2d").drawImage(t.video,0,0,e.width,e.height),Ee.href=e.toDataURL(),Ee.download="DPlayer.png"})}i++}return l(e,[{key:"play",value:function(e){"[object Number]"===Object.prototype.toString.call(e)&&(this.video.currentTime=e),this.paused=!1,this.video.paused&&(this.bezel.innerHTML=this.getSVG("play"),this.bezel.classList.add("dplayer-bezel-transition")),this.playButton.innerHTML=this.getSVG("pause"),this.video.play(),this.playedTime&&this.clearTime(),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=this.getSVG("pause"),this.bezel.classList.add("dplayer-bezel-transition")),this.ended=!1,this.playButton.innerHTML=this.getSVG("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,n){"function"==typeof n&&this.event[e].push(n)}},{key:"_readAllEndpoints",value:function(e,n){for(var t=[],a=0,r=function(r){return function(l,o){if(++a,l?(l.response?alert(l.response.msg):console.log("Request was unsuccessful: "+l.status),t[r]=[]):t[r]=o,a==e.length)return n(t)}},l=0;l',this.danTunnel={right:{},top:{},bottom:{}},this.itemDemo=this.element.getElementsByClassName("dplayer-danmaku-item")[0],this.option.danmaku=n,this.readDanmaku())}}]),e}();e.exports=s}])}); +//# sourceMappingURL=DPlayer.min.js.map \ No newline at end of file diff --git a/README.md b/README.md index 2b62e5b..135230e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -#[DPlayer_for_Z-BlogPHP](https://app.zblogcn.com/?id=1033) +# [DPlayer_for_Z-BlogPHP](https://app.zblogcn.com/?id=1033) Demo:https://www.fghrsh.net/post/57.html 效果截图 @@ -7,29 +7,15 @@ Demo:https://www.fghrsh.net/post/57.html DIYgod开发的超级好看的HTML5弹幕视频播放器,现已移植到了 Z-BlogPHP 233 -##声明 -部分代码参考 [https://github.com/volio/DPlayer-for-typecho](https://github.com/volio/DPlayer-for-typecho) - -##使用方式 +## 声明 +部分代码参考 [https://github.com/volio/DPlayer-for-typecho](https://github.com/volio/DPlayer-for-typecho) + +## 使用方式 ``` [dplayer url="http://xxx.com/xxx.mp4" pic="http://xxx.com/xxx.jpg" autoplay="true" danmu="false"/] -``` -直接在文章插入上述标签即可,默认不自动播放,弹幕开启 - -###参数说明 -``` -url - 视频地址(必须)   // 填url地址 -pic - 视频封面(可选)   // 填url地址 -autoplay - 自动播放(可选)  // true(开启) 或 false(关闭) -theme - 自定义颜色(可选)   // 十六进制 (hex) 例:#FADFA3 -loop - 循环播放(可选)   // true(开启) 或 false(关闭) -lang - 界面语言(可选)   // 'zh'(中文) 或 'en'(英文) -danmu - 弹幕开关(可选)   // true(开启) 或 false(关闭) -id - 指定弹幕ID(可选)   // 跳过弹幕ID生成,直接绑定弹幕池ID -screenshot - 截图功能(可选) // true 或 false,开启截图功能需源站支持 Cross-Origin -hotkey - 热键(可选)   // true 或 false,空格 播放/暂停,↕调节音量,↔调节进度 -preload - 预加载(可选)   //'auto'(自动) 或 'metadata'(开启) 或 'none'(关闭) -``` - -## LICENSE -MIT © [FGHRSH](https://www.fghrsh.net) \ No newline at end of file +``` +直接在文章插入上述标签即可,默认不自动播放,弹幕开启 +更多说明见 Z-Blog 应用中心 https://app.zblogcn.com/?id=1033 + +## LICENSE +MIT © [FGHRSH](https://www.fghrsh.net) \ No newline at end of file diff --git a/function.php b/function.php index 03de354..f77a1c2 100644 --- a/function.php +++ b/function.php @@ -2,56 +2,45 @@ class dplayer_class { function parseCallback($post,$config) { - $pattern = self::get_shortcode_regex(array('dplayer')); - preg_match_all("/$pattern/",$post,$matches); - if (empty($matches[0])) { - return $post.""; - } + preg_match_all('/'.self::get_shortcode_regex(array('dplayer')).'/', $post, $matches); + if (empty($matches[0])) return $post . ''; for ($i=0;$i md5($siteurl.$atts['url'])); - if (isset($atts['hotkey'])) $data['hotkey']=self::str2bool($atts['hotkey']); else $data['hotkey']=(bool)$config['hotkey']; - if (isset($atts['screenshot'])) $data['screenshot']=self::str2bool($atts['screenshot']); else $data['screenshot']=(bool)$config['screenshot']; - if (isset($atts['loop'])) $data['loop']=self::str2bool($atts['loop']); else $data['loop']=(bool)$config['loop']; - if (isset($atts['autoplay'])) $data['autoplay']=self::str2bool($atts['autoplay']); else $data['autoplay']=(bool)$config['autoplay']; - if (isset($atts['theme'])) $data['theme']=$atts['theme']; else $data['theme']=$config['theme']; - if ($config['lang']==1) $data['lang'] = 'zh'; elseif ($config['lang']==2) $data['lang'] = 'en'; - if ($config['preload']==1) $data['preload'] = 'metadata'; elseif ($config['preload']==2) $data['preload'] = 'none'; else $data['preload'] = 'auto'; - if (isset($atts['lang'])) $data['lang'] = $atts['lang'];if (isset($atts['preload'])) $data['preload'] = $atts['preload']; - $data['video'] = array( - 'url' => $atts['url'] ? $atts['url'] : '', - 'pic' => $atts['pic'] ? $atts['pic'] : '' - ); - if (isset($atts['id'])) $dmid = $atts['id']; else $dmid = md5($data['id']); - $data['danmaku'] = array( - 'id' => $dmid, - 'token' => md5($dmid.date('YmdH',time())), - 'api' => $config['dmserver'] - ); + $data['hotkey'] = isset($atts['hotkey']) ? self::str2bool($atts['hotkey']) : (bool)$config['hotkey']; + $data['screenshot'] = isset($atts['screenshot']) ? self::str2bool($atts['screenshot']) : (bool)$config['screenshot']; + $data['loop'] = isset($atts['loop']) ? self::str2bool($atts['loop']) : (bool)$config['loop']; + $data['autoplay'] = isset($atts['autoplay']) ? self::str2bool($atts['autoplay']) : (bool)$config['autoplay']; + $data['theme'] = isset($atts['theme']) ? $atts['theme'] : $config['theme']; + $data['lang'] = isset($atts['lang']) ? $atts['lang'] : $config['lang']=='1' ? 'zh' : 'en'; + $data['preload'] = isset($atts['preload']) ? $atts['preload'] : $config['preload']=='1' ? 'metadata' : $config['preload']=='2' ? 'none' : 'auto'; + $data['video'] = array_filter(array( + 'url' => $atts['url'] ? $atts['url'] : null, + 'pic' => $atts['pic'] ? $atts['pic'] : null, + 'type' => $atts['type'] ? $atts['type'] : 'auto' )); + $data['danmaku'] = array_filter(array( + 'id' => $atts['id'] ? $atts['id'] : md5($data['id']), + 'api' => $atts['api'] ? $atts['api'] : $config['dmserver'], + 'token' => $atts['token'] ? $atts['token'] : md5($data['id'].time()), + 'maximum' => $atts['maximum'] ? $atts['maximum'] : $config['maximum'], + 'addition' => $atts['addition'] ? explode('|',$atts['addition']) : null )); if (empty($config['dmserver']) or !$config['danmaku']) $data['danmaku'] = null; if (isset($atts['danmu'])) if (!self::str2bool($atts['danmu'])) $data['danmaku'] = null; - if (empty($out)) { - $js = "DPlayerOptions.push(".json_encode($data).");"; - $out = self::str_replace_once($matches[0][$i], "
", $post); - } else { - $js .= "DPlayerOptions.push(".json_encode($data).");"; - $out = self::str_replace_once($matches[0][$i], "
", $out); - } + $js .= "DPlayerOptions.push(".json_encode(array_filter($data, 'self::is_not_null')).");"; + $out = empty($out) ? + self::str_replace_once($matches[0][$i], '
', $post): + self::str_replace_once($matches[0][$i], '
', $out); } } } - $out .= ""; - if (isset($dp)) foreach ($dp as $k => $v) return str_replace($k,$v,$out); else return $out; + $out .= ''; + if (isset($dp)) foreach ($dp as $k => $v) $out = str_replace($k,$v,$out); return $out; } function shortcode_parse_atts($text) { @@ -60,24 +49,13 @@ function shortcode_parse_atts($text) { $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text); if (preg_match_all($pattern, $text, $match, PREG_SET_ORDER)) { foreach ($match as $m) { - if (!empty($m[1])) - $atts[strtolower($m[1])] = stripcslashes($m[2]); - elseif (!empty($m[3])) - $atts[strtolower($m[3])] = stripcslashes($m[4]); - elseif (!empty($m[5])) - $atts[strtolower($m[5])] = stripcslashes($m[6]); - elseif (isset($m[7]) && strlen($m[7])) - $atts[] = stripcslashes($m[7]); - elseif (isset($m[8])) - $atts[] = stripcslashes($m[8]); - } - foreach ($atts as &$value) { - if (false !== strpos($value, '<')) { - if (1 !== preg_match('/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value)) { - $value = ''; - } - } + if (!empty($m[1])) $atts[strtolower($m[1])] = stripcslashes($m[2]); + elseif (!empty($m[3])) $atts[strtolower($m[3])] = stripcslashes($m[4]); + elseif (!empty($m[5])) $atts[strtolower($m[5])] = stripcslashes($m[6]); + elseif (isset($m[7]) && strlen($m[7])) $atts[] = stripcslashes($m[7]); + elseif (isset($m[8])) $atts[] = stripcslashes($m[8]); } + foreach ($atts as &$value) if (false !== strpos($value, '<')) if (1 !== preg_match('/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value)) $value = ''; } else { $atts = ltrim($text); } @@ -91,14 +69,14 @@ function get_shortcode_regex($tagnames = null) { function str_replace_once($needle, $replace, $haystack) { $pos = strpos($haystack, $needle); - if ($pos === false) { - return $haystack; - } + if ($pos === false) return $haystack; return substr_replace($haystack, $replace, $pos, strlen($needle)); } function str2bool($str) { - if ($str=='true') return true;elseif ($str=='false') return false;else return $str; + if ($str=='true') return true; elseif ($str=='false') return false; else return $str; } + + function is_not_null($val) { return !is_null($val); } } ?> \ No newline at end of file diff --git a/include.php b/include.php index 62b33de..74d7091 100644 --- a/include.php +++ b/include.php @@ -1,66 +1,68 @@ GetTags('article'); $config = array( - "seturl" => $zbp->Config('DPlayer')->seturl, - "dmserver" => $zbp->Config('DPlayer')->dmserver, - "hotkey" => $zbp->Config('DPlayer')->hotkey, - "danmaku" => $zbp->Config('DPlayer')->danmaku, - "screenshot" => $zbp->Config('DPlayer')->screenshot, - "loop" => $zbp->Config('DPlayer')->loop, - "autoplay" => $zbp->Config('DPlayer')->autoplay, - "preload" => $zbp->Config('DPlayer')->preload, - "lang" => $zbp->Config('DPlayer')->lang, - "maximum" => $zbp->Config('DPlayer')->maximum, - "theme" => $zbp->Config('DPlayer')->theme - ); - $article->Content = $dplayer->parseCallback($article->Content,$config); + 'seturl' => $zbp->Config('DPlayer')->seturl, + 'dmserver' => $zbp->Config('DPlayer')->dmserver, + 'hotkey' => $zbp->Config('DPlayer')->hotkey, + 'danmaku' => $zbp->Config('DPlayer')->danmaku, + 'screenshot' => $zbp->Config('DPlayer')->screenshot, + 'loop' => $zbp->Config('DPlayer')->loop, + 'autoplay' => $zbp->Config('DPlayer')->autoplay, + 'preload' => $zbp->Config('DPlayer')->preload, + 'lang' => $zbp->Config('DPlayer')->lang, + 'maximum' => $zbp->Config('DPlayer')->maximum, + 'theme' => $zbp->Config('DPlayer')->theme ); + $article->Content = $dplayer->parseCallback($article->Content, $config); } function DPlayer_Filter_Plugin_ViewList_Template(&$template) { + global $zbp; global $dplayer; - global $zbp; $articles = $template->GetTags('articles'); $config = array( - "seturl" => $zbp->Config('DPlayer')->seturl, - "dmserver" => $zbp->Config('DPlayer')->dmserver, - "hotkey" => $zbp->Config('DPlayer')->hotkey, - "danmaku" => $zbp->Config('DPlayer')->danmaku, - "screenshot" => $zbp->Config('DPlayer')->screenshot, - "loop" => $zbp->Config('DPlayer')->loop, - "autoplay" => $zbp->Config('DPlayer')->autoplay, - "preload" => $zbp->Config('DPlayer')->preload, - "lang" => $zbp->Config('DPlayer')->lang, - "maximum" => $zbp->Config('DPlayer')->maximum, - "theme" => $zbp->Config('DPlayer')->theme - ); + 'seturl' => $zbp->Config('DPlayer')->seturl, + 'dmserver' => $zbp->Config('DPlayer')->dmserver, + 'hotkey' => $zbp->Config('DPlayer')->hotkey, + 'danmaku' => $zbp->Config('DPlayer')->danmaku, + 'screenshot' => $zbp->Config('DPlayer')->screenshot, + 'loop' => $zbp->Config('DPlayer')->loop, + 'autoplay' => $zbp->Config('DPlayer')->autoplay, + 'preload' => $zbp->Config('DPlayer')->preload, + 'lang' => $zbp->Config('DPlayer')->lang, + 'maximum' => $zbp->Config('DPlayer')->maximum, + 'theme' => $zbp->Config('DPlayer')->theme ); foreach($articles as $article) { - $article->Intro = $dplayer->parseCallback($article->Intro,$config); + $article->Intro = $dplayer->parseCallback($article->Intro, $config); } } function DPlayer_Filter_Plugin_Zbp_MakeTemplatetags() { global $zbp; - $zbp->footer .= ''."\r\n".""; + if ($zbp->Config('DPlayer')->flv) $zbp->footer .= ''."\n"; + if ($zbp->Config('DPlayer')->hls) $zbp->footer .= ''."\n"; + $zbp->footer .= + ''."\n". + ''; } function InstallPlugin_DPlayer() { global $zbp,$obj,$bucket; if (!$zbp->Config('DPlayer')->HasKey('theme')) { $zbp->Config('DPlayer')->seturl = $zbp->host; - $zbp->Config('DPlayer')->dmserver = '//dplayer.daoapp.io/'; + $zbp->Config('DPlayer')->dmserver = '//api.prprpr.me/dplayer/'; $zbp->Config('DPlayer')->useue = 1; $zbp->Config('DPlayer')->hidermmenu = 0; $zbp->Config('DPlayer')->hotkey = 1; @@ -71,6 +73,8 @@ function InstallPlugin_DPlayer() { $zbp->Config('DPlayer')->preload = 0; $zbp->Config('DPlayer')->lang = 1; $zbp->Config('DPlayer')->maximum = 1000; + $zbp->Config('DPlayer')->flv = 1; + $zbp->Config('DPlayer')->hls = 0; $zbp->Config('DPlayer')->theme = '#FADFA3'; $zbp->SaveConfig('DPlayer'); } @@ -80,9 +84,9 @@ function UninstallPlugin_DPlayer() { global $zbp; if ($zbp->Config('DPlayer')->hidermmenu == '1') { $dpjs = file_get_contents(dirname(__FILE__)."/DPlayer.min.js"); - $dpjs = str_replace('\n','About DPlayer")+"\n \n',$dpjs); - file_put_contents(dirname(__FILE__)."/DPlayer.min.js",$dpjs); + $dpjs = str_replace('\n', 'About DPlayer")+"\n \n', $dpjs); + file_put_contents(dirname(__FILE__)."/DPlayer.min.js", $dpjs); } $zbp->DelConfig('DPlayer'); } \ No newline at end of file diff --git a/jcolor/jcolor.min.css b/jcolor/jcolor.min.css new file mode 100644 index 0000000..b7ed970 --- /dev/null +++ b/jcolor/jcolor.min.css @@ -0,0 +1 @@ +.colorpicker{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;font-size:15px;width:2.8em;height:2.8em;-webkit-perspective:25em;perspective:25em;position:relative;transition:transform .5s;font-family:monospace}.colorpicker .maximize-wrapper{position:absolute;border-radius:.3em;background:#fff;padding:.4em;box-shadow:0 .1em .2em rgba(0,0,0,.2);-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-animation:collapse-animation .5s;animation:collapse-animation .5s;cursor:pointer}.colorpicker .display,.colorpicker .slider{box-shadow:0 .1em .15em 0 rgba(0,0,0,.2)inset}.colorpicker.expanded .maximize-wrapper{-webkit-animation:expand-animation .5s;animation:expand-animation .5s;cursor:default}@-webkit-keyframes expand-animation{0%,100%{-webkit-transform:translateZ(0)rotateX(0)rotateY(0)}40%{-webkit-transform:translateZ(.6em)rotateX(-10deg)rotateY(5deg)}}@keyframes expand-animation{0%,100%{transform:translateZ(0)rotateX(0)rotateY(0)}40%{transform:translateZ(.6em)rotateX(-10deg)rotateY(5deg)}}@-webkit-keyframes collapse-animation{0%,100%{-webkit-transform:translateZ(0)rotateX(0)rotateY(0)}40%{-webkit-transform:translateZ(-2em)rotateX(10deg)rotateY(-5deg)}}@keyframes collapse-animation{0%,100%{transform:translateZ(0)rotateX(0)rotateY(0)}40%{transform:translateZ(-2em)rotateX(10deg)rotateY(-5deg)}}.colorpicker .inner-maximize-wrapper{position:relative;width:2em;height:2em;overflow:hidden;transition:height .5s,width .5s}.colorpicker .ui-wrapper{white-space:nowrap;display:inline-block}.colorpicker .ui-wrapper>*{display:inline-block;vertical-align:top}.colorpicker .display-wrapper{margin-right:.4em;background-size:41%;-webkit-transform-origin:top left;transform-origin:top left;transition:transform .5s}.colorpicker.componentcount-3 .display-wrapper{-webkit-transform:scale(.6);transform:scale(.6);width:3.4em;height:3.4em}.colorpicker.componentcount-4 .display-wrapper{-webkit-transform:scale(.45);transform:scale(.45);width:4.6em;height:4.6em}.colorpicker.expanded .display-wrapper{-webkit-transform:scale(1);transform:scale(1)}.colorpicker .display-wrapper,.colorpicker .slider.a:before{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyIiBoZWlnaHQ9IjIiPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHg9IjAiIHk9IjAiIHN0eWxlPSJmaWxsOiNjYWNhY2EiIC8+PHJlY3Qgd2lkdGg9IjEiIGhlaWdodD0iMSIgeD0iMSIgeT0iMSIgc3R5bGU9ImZpbGw6I2NhY2FjYSIgLz48L3N2Zz4=)}.colorpicker .display{width:100%;height:100%}.colorpicker .slider-container{opacity:0;transition:transform .5s,opacity .5s}.colorpicker.componentcount-3 .slider-container{-webkit-transform:translateX(-1.4em);transform:translateX(-1.4em)}.colorpicker.componentcount-4 .slider-container{-webkit-transform:translateX(-2.6em);transform:translateX(-2.6em)}.colorpicker.expanded .slider-container{opacity:1;-webkit-transform:translateX(0);transform:translateX(0)}.colorpicker .slider{box-sizing:border-box;position:relative;display:block;width:12em;height:1em;background:rgba(128,128,128,.12);overflow:hidden;margin-bottom:.2em;cursor:col-resize}.colorpicker .slider.a:before{content:'';position:absolute;left:0;top:0;width:100%;height:100%;background-position:left center;background-size:auto 27%;z-index:-1}.colorpicker.show-labels .slider .handle:after{content:attr(data-component);text-transform:uppercase;position:absolute;left:100%;color:#fff;font-size:.8em;top:.2em;margin-left:.2em;text-shadow:1px 0 0 rgba(0,0,0,.25),-1px 0 0 rgba(0,0,0,.25),0 1px 0 rgba(0,0,0,.25),0 -1px 0 rgba(0,0,0,.25)}.colorpicker .slider:last-child{margin-bottom:0}.colorpicker .slider .handle{display:inline-block;position:relative;content:'';margin-top:-.1em;margin-left:-.2em;width:.4em;height:100%;padding-bottom:.2em;background:rgba(255,255,255,.6);box-shadow:0 .1em .2em 0 rgba(0,0,0,.3),0 0 .3em .1em #fff inset,0 0 0 .1em #fff inset;pointer-events:none;z-index:1}.colorpicker .display,.colorpicker .display-wrapper,.colorpicker .inner-maximize-wrapper,.colorpicker .slider{border-radius:.2em}.colorpicker .output-wrapper{font-size:.8em;height:1.2em;margin-top:.4em;color:#333;-webkit-touch-callout:text;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text} \ No newline at end of file diff --git a/jcolor/jcolor.min.js b/jcolor/jcolor.min.js new file mode 100644 index 0000000..16146a4 --- /dev/null +++ b/jcolor/jcolor.min.js @@ -0,0 +1 @@ +!function(a){"use strict";function b(a,b,c){return Math.max(Math.min(a,c),b)}function c(a){return a.toFixed(2)}function d(a){return(255*a|0)+""}function e(a){return(360*a|0)+""}function f(a){return(100*a).toFixed(2)+"%"}function g(a,b,c){var d,e=c?b.split("").map(function(a){return n[a](u[a])}):b.split(""),f=b.indexOf(a),g=[],h=v[a];for(d=0;h>d;++d){var i=d/(h-1);e[f]=n[a](i);var j=q?b+"("+e.join().toUpperCase()+")":'';g.push(j)}return g=g.join(q?",":""),function(b){var c=g;for(var d in b)d===a||(c=c.replace(m[d],n[d](b[d])));if(q)return"linear-gradient(to right, "+c+")";var e=''+c+'';return"url(data:image/svg+xml;base64,"+l(e)+")"}}function h(a){function b(a,b,c){return 0>c&&(c+=1),c>1&&(c-=1),1/6>c?a+6*(b-a)*c:.5>c?b:2/3>c?a+(b-a)*(2/3-c)*6:a}if("r"in a)return a;var c,d,e,f=a.h,g=a.s,h=a.l;if(0===g)c=d=e=h;else{var i=.5>h?h*(1+g):h+g-h*g,j=2*h-i;c=b(j,i,f+1/3),d=b(j,i,f),e=b(j,i,f-1/3)}var k={r:c,g:d,b:e};return"a"in a&&(k.a=a.a),k}function i(a){if("h"in a)return a;var b,c,d=a.r,e=a.g,f=a.b,g=Math.max(d,e,f),h=Math.min(d,e,f),i=(g+h)/2;if(g===h)b=c=0;else{var j=g-h;switch(c=i>.5?j/(2-g-h):j/(g+h),g){case d:b=(e-f)/j+(f>e?6:0);break;case e:b=(f-d)/j+2;break;case f:b=(d-e)/j+4}b/=6}var k={h:b,s:c,l:i};return"a"in a&&(k.a=a.a),k}function j(b,c){var d,e={};if(b=b.toLowerCase(),!/^(rgb|hsl)a?$/i.test(b))throw'Color spaces must be any of the following: "rgb", "rgba", "hsl" or "hsla"';if("string"==typeof c)if(c=c.toLowerCase(),/^#[0-9a-f]{6}([0-9a-f]{2})?$/.test(c))for(4===b.length&&9!==c.length&&(c+="ff"),d=1;d").addClass(b).appendTo(c)}function f(a,b,c,d){c&&n.setComponent(c,d);for(var e=0;e>2,h[1]=(3&b)<<4|c>>4,isNaN(c)?h[2]=h[3]=64:(d=a.charCodeAt(++f),h[2]=(15&c)<<2|d>>6,h[3]=isNaN(d)?64:63&d),e.push(t.charAt(h[0]),t.charAt(h[1]),t.charAt(h[2]),t.charAt(h[3]));return e.join("")},m={r:/R/g,g:/G/g,b:/B/g,h:/H/g,s:/S/g,l:/L/g,a:/A/g},n={r:d,g:d,b:d,h:e,s:f,l:f,a:c},o=/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent),p=/MSIE [1-8]/.test(navigator.userAgent),q=!/MSIE 9.0/.test(navigator.userAgent),r=q,s="ontouchstart"in document.documentElement,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u={r:0,g:0,b:0,h:0,s:1,l:.5,a:1},v={r:2,g:2,b:2,h:7,s:2,l:3,a:2},w=0,x=o?"webkitTransitionEnd":"transitionend",y=s?"touchstart":"mousedown",z=s?"touchmove":"mousemove",A=s?"touchend touchcancel":"mouseup",B="newcolor",C=999999;j.prototype.convertComponents=function(b){b=b||this.getSpace();var c=a.extend({},this.getComponents());if(new RegExp(b).test(this.getSpace()))return 3===b.length&&delete c.a,c;if(c=/rgb/.test(b)?h(c):i(c),/a/.test(b)){var d=this.getComponent("a");c.a="undefined"==typeof d?1:d}return c},j.prototype.componentsToString=function(a,b){function c(a){return(1===a.length?"0":"")+a}for(var d="#",e=0;eConfig('DPlayer')->dmserver = ''; - $tips .= '弹幕服务器地址为空,弹幕设置将失效;'; + $tips .= '弹幕池 地址 为空,弹幕将不显示;'; }else{ - if (!$dmserver == ($zbp->Config('DPlayer')->dmserver)){ + if ($dmserver != ($zbp->Config('DPlayer')->dmserver)){ $zbp->Config('DPlayer')->dmserver = $dmserver; - $tips .= '弹幕服务器地址设置成功;'; + $tips .= '弹幕池 地址 设置成功;'; } } if (!$hidermmenu == ($zbp->Config('DPlayer')->hidermmenu)){ @@ -40,11 +40,11 @@ $zbp->Config('DPlayer')->hidermmenu = $hidermmenu; $tips .= '附加设置已应用,刷新播放器js缓存后生效;'; } - if (in_array('hotkey',$options)) $hotkey = 1; else $hotkey = 0; - if (in_array('danmaku',$options)) $danmaku = 1; else $danmaku = 0; - if (in_array('screenshot',$options)) $screenshot = 1; else $screenshot = 0; - if (in_array('loop',$options)) $loop = 1; else $loop = 0; - if (in_array('autoplay',$options)) $autoplay = 1; else $autoplay = 0; + $hotkey = in_array('hotkey',$options) ? 1 : 0; + $danmaku = in_array('danmaku',$options) ? 1 : 0; + $screenshot = in_array('screenshot',$options) ? 1 : 0; + $loop = in_array('loop',$options) ? 1 : 0; + $autoplay = in_array('autoplay',$options) ? 1 : 0; if ($hotkey != $zbp->Config('DPlayer')->hotkey) { $zbp->Config('DPlayer')->hotkey = $hotkey; $tips .= '设置已应用;'; @@ -87,6 +87,15 @@ $tips .= '设置已应用;'; } $zbp->SaveConfig('DPlayer'); + if ($flv != $zbp->Config('DPlayer')->flv) { + $zbp->Config('DPlayer')->flv = $flv; + $tips .= '设置已应用;'; + } + if ($hls != $zbp->Config('DPlayer')->hls) { + $zbp->Config('DPlayer')->hls = $hls; + $tips .= '设置已应用;'; + } + $zbp->SaveConfig('DPlayer'); if ( isset($tips) ) { $tips = explode(";",$tips); @@ -98,35 +107,33 @@ } } ?> - - - - + +
DPlayer for Z-BlogPHP - 插件配置
- +
$zbp->Config('DPlayer')->seturl, - "dmserver" => $zbp->Config('DPlayer')->dmserver, - "useue" => $zbp->Config('DPlayer')->useue, - "hidermmenu" => $zbp->Config('DPlayer')->hidermmenu, - "hotkey" => $zbp->Config('DPlayer')->hotkey, - "danmaku" => $zbp->Config('DPlayer')->danmaku, - "screenshot" => $zbp->Config('DPlayer')->screenshot, - "loop" => $zbp->Config('DPlayer')->loop, - "autoplay" => $zbp->Config('DPlayer')->autoplay, - "preload" => $zbp->Config('DPlayer')->preload, - "lang" => $zbp->Config('DPlayer')->lang, - "maximum" => $zbp->Config('DPlayer')->maximum + 'seturl' => $zbp->Config('DPlayer')->seturl, + 'dmserver' => $zbp->Config('DPlayer')->dmserver, + 'useue' => $zbp->Config('DPlayer')->useue, + 'hidermmenu' => $zbp->Config('DPlayer')->hidermmenu, + 'hotkey' => $zbp->Config('DPlayer')->hotkey, + 'danmaku' => $zbp->Config('DPlayer')->danmaku, + 'screenshot' => $zbp->Config('DPlayer')->screenshot, + 'loop' => $zbp->Config('DPlayer')->loop, + 'autoplay' => $zbp->Config('DPlayer')->autoplay, + 'preload' => $zbp->Config('DPlayer')->preload, + 'lang' => $zbp->Config('DPlayer')->lang, + 'maximum' => $zbp->Config('DPlayer')->maximum, + 'flv' => $zbp->Config('DPlayer')->flv, + 'hls' => $zbp->Config('DPlayer')->hls ); ?> @@ -134,7 +141,7 @@ - + @@ -173,32 +180,64 @@ 自动播放/>  

---------------------------------------------------------

-

      ♦ 开启截图功能需源站支持 Cross-Origin

-

      ◊ 关于作者 | 意见反馈 | 关于 DPlayer 播放器

+

      FLV 支持:   + />开启 +     + />关闭 +

+

      HLS(m3u8) 支持:   + />开启 +     + />关闭 +

+

---------------------------------------------------------

+

      + 自定义颜色   +    + 预览颜色 + +

+

      + 推荐配色   +         +         +         +         +         +         +

+ +

---------------------------------------------------------

+

      ♦  开启 截图 功能需 源站 支持 Cross-Origin

+

      ◊  关于作者  |  意见反馈  |  关于 DPlayer 播放器

设置

选项

弹幕服务器

弹幕池地址

- - - - - - - - - -

选择配色

-
-
-
-
-
-
-
-
-
自定义颜色
- ©2016 FGHRSH - DPlayer for Z-BlogPHP V1.6 (DPlayer 1.0.8) +
+
+ ©2017 FGHRSH - DPlayer for Z-BlogPHP V1.7 (DPlayer 1.1.3) +
+
+ +
+
diff --git a/plugin.xml b/plugin.xml index d3439d6..8c543b5 100644 --- a/plugin.xml +++ b/plugin.xml @@ -19,9 +19,9 @@ 140614 -1.6 +1.7 2016-05-30 -2016-09-03 +2017-03-30 0 diff --git a/plugin/flv.min.js b/plugin/flv.min.js new file mode 100644 index 0000000..6ef9dad --- /dev/null +++ b/plugin/flv.min.js @@ -0,0 +1,6 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.flvjs=e()}}(function(){var e;return function e(t,n,i){function r(a,o){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var h=n[a]={exports:{}};t[a][0].call(h.exports,function(e){var n=t[a][1][e];return r(n?n:e)},h,h.exports,e,t,n,i)}return n[a].exports}for(var s="function"==typeof require&&require,a=0;a1)for(var n=1;n0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},i.prototype.removeListener=function(e,t){var n,i,s,o;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],s=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(o=s;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},{}],3:[function(e,t,n){var i=arguments[3],r=arguments[4],s=arguments[5],a=JSON.stringify;t.exports=function(e,t){function n(e){p[e]=!0;for(var t in r[e][1]){var i=r[e][1][t];p[i]||n(i)}}for(var o,u=Object.keys(s),l=0,h=u.length;l=e[r]&&t0&&e[0].originalDts=t[r].dts&&et[i].lastSample.originalDts&&e=t[i].lastSample.originalDts&&(i===t.length-1||i0&&(r=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,n)}},{key:"getLastSegmentBefore",value:function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}},{key:"getLastSampleBefore",value:function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}},{key:"getLastSyncPointBefore",value:function(e){for(var t=this._searchNearestSegmentBefore(e),n=this._list[t].syncPoints;0===n.length&&t>0;)t--,n=this._list[t].syncPoints;return n.length>0?n[n.length-1]:null}},{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}}]),e}()},{}],9:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0){var n=e[t].shift();try{this._sourceBuffers[t].appendBuffer(n.data),this._isBufferFull=!1,"video"===t&&n.hasOwnProperty("info")&&this._idrList.appendArray(n.info.syncPoints)}catch(e){this._pendingSegments[t].unshift(n),22===e.code?(this._isBufferFull||this._emitter.emit(c.default.BUFFER_FULL),this._isBufferFull=!0):(l.default.e(this.TAG,e.message),this._emitter.emit(c.default.ERROR,{code:e.code,msg:e.message}))}}}},{key:"_onSourceOpen",value:function(){if(l.default.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(c.default.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){l.default.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){l.default.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(c.default.UPDATE_END)}},{key:"_onSourceBufferError",value:function(e){l.default.e(this.TAG,"SourceBuffer Error: "+e)}}]),e}();n.default=p},{"../utils/browser.js":39,"../utils/exception.js":40,"../utils/logger.js":41,"./media-segment-info.js":8,"./mse-events.js":10,events:2}],10:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"};n.default=i},{}],11:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,r=this._demuxer.parseChunks(e,t);else if((i=m.default.probe(e)).match){this._demuxer=new m.default(i,this._config),this._remuxer||(this._remuxer=new v.default(this._config));var s=this._mediaDataSource;void 0==s.duration||isNaN(s.duration)||(this._demuxer.overridedDuration=s.duration),this._demuxer.timestampBase=s.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),r=this._demuxer.parseChunks(e,t)}else i=null,l.default.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then(function(){n._internalAbort()}),this._emitter.emit(k.default.DEMUX_ERROR,y.default.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),r=0;return r}},{key:"_onMediaInfo",value:function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,c.default.prototype));var n=Object.assign({},e);Object.setPrototypeOf(n,c.default.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=n,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then(function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)})}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(e){var t=e,n=t+1;n0&&n[0].originalDts===i&&(i=n[0].pts),this._emitter.emit(k.default.RECOMMEND_SEEKPOINT,i)}}},{key:"_enableStatisticsReporter",value:function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(e){var t=this._mediaInfo.segments[e],n=Object.assign({},t);n.duration=this._mediaInfo.duration,n.segmentCount=this._mediaInfo.segmentCount,delete n.segments,delete n.keyframesIndex,this._emitter.emit(k.default.MEDIA_INFO,n)}},{key:"_reportStatisticsInfo",value:function(){var e={};e.url=this._ioctl.currentUrl,e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(k.default.STATISTICS_INFO,e)}}]),e}());n.default=w},{"../demux/demux-errors.js":16,"../demux/flv-demuxer.js":18,"../io/io-controller.js":23,"../io/loader.js":24,"../remux/mp4-remuxer.js":38,"../utils/browser.js":39,"../utils/logger.js":41,"./media-info.js":7,"./transmuxing-events.js":13,events:2}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"};n.default=i},{}],14:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var r=e("../utils/logger.js"),s=(i(r),e("../utils/logging-control.js")),a=i(s),o=e("../utils/polyfill.js"),u=i(o),l=e("./transmuxing-controller.js"),h=i(l),d=e("./transmuxing-events.js"),f=i(d),c=function(e){function t(t,n){var i={msg:f.default.INIT_SEGMENT,data:{type:t,data:n}};e.postMessage(i,[n.data])}function n(t,n){var i={msg:f.default.MEDIA_SEGMENT,data:{type:t,data:n}};e.postMessage(i,[n.data])}function i(){var t={msg:f.default.LOADING_COMPLETE};e.postMessage(t)}function r(){var t={msg:f.default.RECOVERED_EARLY_EOF};e.postMessage(t)}function s(t){var n={msg:f.default.MEDIA_INFO,data:t};e.postMessage(n)}function o(t){var n={msg:f.default.STATISTICS_INFO,data:t};e.postMessage(n)}function l(t,n){e.postMessage({msg:f.default.IO_ERROR,data:{type:t,info:n}})}function d(t,n){e.postMessage({msg:f.default.DEMUX_ERROR,data:{type:t,info:n}})}function c(t){e.postMessage({msg:f.default.RECOMMEND_SEEKPOINT,data:t})}var _=null;u.default.install(),e.addEventListener("message",function(u){switch(u.data.cmd){case"init":_=new h.default(u.data.param[0],u.data.param[1]),_.on(f.default.IO_ERROR,l.bind(this)),_.on(f.default.DEMUX_ERROR,d.bind(this)),_.on(f.default.INIT_SEGMENT,t.bind(this)),_.on(f.default.MEDIA_SEGMENT,n.bind(this)),_.on(f.default.LOADING_COMPLETE,i.bind(this)),_.on(f.default.RECOVERED_EARLY_EOF,r.bind(this)),_.on(f.default.MEDIA_INFO,s.bind(this)),_.on(f.default.STATISTICS_INFO,o.bind(this)),_.on(f.default.RECOMMEND_SEEKPOINT,c.bind(this));break;case"destroy":_&&(_.destroy(),_=null),e.postMessage({msg:"destroyed"});break;case"start":_.start();break;case"stop":_.stop();break;case"seek":_.seek(u.data.param);break;case"pause":_.pause();break;case"resume":_.resume();break;case"logging_config":a.default.applyConfig(u.data.param)}})};n.default=c},{"../utils/logger.js":41,"../utils/logging-control.js":42,"../utils/polyfill.js":43,"./transmuxing-controller.js":12,"./transmuxing-events.js":13}],15:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0?(0,l.default)(new Uint8Array(e,t+2,r)):"",{data:s,size:2+r}}},{key:"parseLongString",value:function(e,t,n){if(n<4)throw new h.IllegalStateException("Data not enough when parse LongString");var i=new DataView(e,t,n),r=i.getUint32(0,!d),s=void 0;return s=r>0?(0,l.default)(new Uint8Array(e,t+4,r)):"",{data:s,size:4+r}}},{key:"parseDate",value:function(e,t,n){if(n<10)throw new h.IllegalStateException("Data size invalid when parse Date");var i=new DataView(e,t,n),r=i.getFloat64(0,!d),s=i.getInt16(8,!d);return r+=60*s*1e3,{data:new Date(r),size:10}}},{key:"parseValue",value:function(t,n,i){if(i<1)throw new h.IllegalStateException("Data not enough when parse Value");var r=new DataView(t,n,i),s=1,a=r.getUint8(0),u=void 0,l=!1;try{switch(a){case 0:u=r.getFloat64(1,!d),s+=8;break;case 1:var f=r.getUint8(1);u=!!f,s+=1;break;case 2:var c=e.parseString(t,n+1,i-1);u=c.data,s+=c.size;break;case 3:u={};var _=0;for(9===(16777215&r.getUint32(i-4,!d))&&(_=3);s32)throw new s.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var n=this._current_word_bits_left?this._current_word:0;n>>>=32-this._current_word_bits_left;var i=e-this._current_word_bits_left;this._fillCurrentWord();var r=Math.min(i,this._current_word_bits_left),a=this._current_word>>>32-r;return this._current_word<<=r,this._current_word_bits_left-=r,n=n<>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}},{key:"readUEG",value:function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1}},{key:"readSEG",value:function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}}]),e}();n.default=a},{"../utils/exception.js":40}],18:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}Object.defineProperty(n,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n13))return 0;var s=e.probe(t);i=s.dataOffset,n=s.dataOffset}if(this._firstParse){this._firstParse=!1,n!==this._dataOffset&&l.default.w(this.TAG,"First time parsing but chunk byteStart invalid!");var a=new DataView(t,i),o=a.getUint32(0,!r);0!==o&&l.default.w(this.TAG,"PrevTagSize0 !== 0 !!!"),i+=4}for(;it.byteLength)break;var h=u.getUint8(0),d=16777215&u.getUint32(0,!r);if(i+11+d+4>t.byteLength)break;if(8===h||9===h||18===h){var f=u.getUint8(4),c=u.getUint8(5),_=u.getUint8(6),m=u.getUint8(7),p=_|c<<8|f<<16|m<<24,v=16777215&u.getUint32(7,!r);0!==v&&l.default.w(this.TAG,"Meet tag which has StreamID != 0!");var y=i+11;switch(h){case 8:this._parseAudioData(t,y,d,p);break;case 9:this._parseVideoData(t,y,d,p,n+i);break;case 18:this._parseScriptData(t,y,d)}var E=u.getUint32(11+d,!r);E!==11+d&&l.default.w(this.TAG,"Invalid PrevTagSize "+E),i+=11+d+4}else l.default.w(this.TAG,"Unsupported tag type "+h+", skipped"),i+=11+d+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),i}},{key:"_parseScriptData",value:function(e,t,n){var i=d.default.parseScriptData(e,t,n);if(i.hasOwnProperty("onMetaData")){this._metadata&&l.default.w(this.TAG,"Found another onMetaData tag!"),this._metadata=i;var r=this._metadata.onMetaData;if("boolean"==typeof r.hasAudio&&(this._hasAudio=r.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof r.hasVideo&&(this._hasVideo=r.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof r.audiodatarate&&(this._mediaInfo.audioDataRate=r.audiodatarate),"number"==typeof r.videodatarate&&(this._mediaInfo.videoDataRate=r.videodatarate),"number"==typeof r.width&&(this._mediaInfo.width=r.width),"number"==typeof r.height&&(this._mediaInfo.height=r.height),"number"==typeof r.duration){if(!this._durationOverrided){var s=Math.floor(r.duration*this._timescale);this._duration=s,this._mediaInfo.duration=s}}else this._mediaInfo.duration=0;if("number"==typeof r.framerate){var o=Math.floor(1e3*r.framerate);if(o>0){var u=o/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=u,this._referenceFrameRate.fps_num=o,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=u}}if("object"===a(r.keyframes)){this._mediaInfo.hasKeyframesIndex=!0;var h=r.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(h),r.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=r,l.default.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}}},{key:"_parseKeyframesIndex",value:function(e){for(var t=[],n=[],i=1;i>>4;if(10!==u)return void this._onError(m.default.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+u);var h=0,d=(12&o)>>>2,f=[5500,11025,22050,44100,48e3];if(!(d>>3,l=(7&i[0])<<1|i[1]>>>7,l<0||l>=s.length)return void this._onError(m.default.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");var d=s[l],f=(120&i[1])>>>3;if(f<0||f>=8)return void this._onError(m.default.FORMAT_ERROR,"Flv: AAC invalid channel configuration");5===a&&(h=(7&i[1])<<1|i[2]>>>7,u=(124&i[2])>>>2);var c=self.navigator.userAgent.toLowerCase();return c.indexOf("firefox")!==-1?l>=6?(a=5,r=new Array(4),h=l-3):(a=2,r=new Array(2),h=l):c.indexOf("android")!==-1?(a=2,r=new Array(2),h=l):(a=5,h=l,r=new Array(4),l>=6?h=l-3:1===f&&(a=2,r=new Array(2),h=l)),r[0]=a<<3,r[0]|=(15&l)>>>1,r[1]=(15&l)<<7,r[1]|=(15&f)<<3,5===a&&(r[1]|=(15&h)>>>1,r[2]=(1&h)<<7,r[2]|=8,r[3]=0),{config:r,samplingRate:d,channelCount:f,codec:"mp4a.40."+a,originalAudioObjectType:o}}},{key:"_parseVideoData",value:function(e,t,n,i,r){if(n<=1)return void l.default.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");var s=new Uint8Array(e,t,n)[0],a=(240&s)>>>4,o=15&s;return 7!==o?void this._onError(m.default.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+o):void this._parseAVCVideoPacket(e,t+1,n-1,i,r,a)}},{key:"_parseAVCVideoPacket",value:function(e,t,n,i,r,s){if(n<4)return void l.default.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");var a=this._littleEndian,o=new DataView(e,t,n),u=o.getUint8(0),h=16777215&o.getUint32(0,!a);if(0===u)this._parseAVCDecoderConfigurationRecord(e,t+4,n-4);else if(1===u)this._parseAVCVideoData(e,t+4,n-4,i,r,s,h);else if(2!==u)return void this._onError(m.default.FORMAT_ERROR,"Flv: Invalid video packet type "+u)}},{key:"_parseAVCDecoderConfigurationRecord",value:function(e,t,n){if(n<7)return void l.default.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");var i=this._videoMetadata,r=this._videoTrack,s=this._littleEndian,a=new DataView(e,t,n);i?"undefined"!=typeof i.avcc&&l.default.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(i=this._videoMetadata={},i.type="video",i.id=r.id,i.timescale=this._timescale,i.duration=this._duration);var o=a.getUint8(0),u=a.getUint8(1);a.getUint8(2),a.getUint8(3);if(1!==o||0===u)return void this._onError(m.default.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord");if(this._naluLengthSize=(3&a.getUint8(4))+1,3!==this._naluLengthSize&&4!==this._naluLengthSize)return void this._onError(m.default.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: "+(this._naluLengthSize-1));var h=31&a.getUint8(5);if(0===h||h>1)return void this._onError(m.default.FORMAT_ERROR,"Flv: Invalid H264 SPS count: "+h);for(var d=6,f=0;f1)return void this._onError(m.default.FORMAT_ERROR,"Flv: Invalid H264 PPS count: "+L);d++;for(var O=0;O=n){l.default.w(this.TAG,"Malformed Nalu near timestamp "+_+", offset = "+f+", dataSize = "+n); +break}var p=u.getUint32(f,!o);if(3===c&&(p>>>=8),p>n-c)return void l.default.w(this.TAG,"Malformed Nalus near timestamp "+_+", NaluSize > DataSize!");var v=31&u.getUint8(f+c);5===v&&(m=!0);var g=new Uint8Array(e,t+f,c+p),y={type:v,data:g};h.push(y),d+=g.byteLength,f+=c+p}if(h.length){var E=this._videoTrack,b={units:h,length:d,isKeyframe:m,dts:_,cts:a,pts:_+a};m&&(b.fileposition=r),E.samples.push(b),E.length+=d}}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(e){this._timestampBase=e}},{key:"overridedDuration",get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}}],[{key:"probe",value:function(e){var t=new Uint8Array(e),n={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return n;var i=(4&t[4])>>>2!==0,r=0!==(1&t[4]);if(!i&&!r)return n;var a=s(t,5);return a<9?n:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:i,hasVideoTrack:r}}}]),e}();n.default=y},{"../core/media-info.js":7,"../utils/exception.js":40,"../utils/logger.js":41,"./amf-parser.js":15,"./demux-errors.js":16,"./sps-parser.js":19}],19:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n=2&&3===t[s]&&0===t[s-1]&&0===t[s-2]||(i[r]=t[s],r++);return new Uint8Array(i.buffer,0,r)}},{key:"parseSPS",value:function(t){var n=e._ebsp2rbsp(t),i=new o.default(n);i.readByte();var r=i.readByte();i.readByte();var s=i.readByte();i.readUEG();var a=e.getProfileString(r),u=e.getLevelString(s),l=1,h=420,d=[0,420,422,444],f=8;if((100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r)&&(l=i.readUEG(),3===l&&i.readBits(1),l<=3&&(h=d[l]),f=i.readUEG()+8,i.readUEG(),i.readBits(1),i.readBool()))for(var c=3!==l?8:12,_=0;_0&&M<16?(O=D[M-1],A=j[M-1]):255===M&&(O=i.readByte()<<8|i.readByte(),A=i.readByte()<<8|i.readByte())}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(4),i.readBool()&&i.readBits(24)),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool()){var P=i.readBits(32),B=i.readBits(32);R=i.readBool(),I=B,C=2*P,T=I/C}}var N=1;1===O&&1===A||(N=O/A);var U=0,F=0;if(0===l)U=1,F=2-E;else{var G=3===l?1:2,z=1===l?2:1;U=G,F=z*(2-E)}var V=16*(g+1),H=(2-E)*(16*(y+1));V-=(b+S)*U,H-=(k+w)*F;var K=Math.ceil(V*N);return i.destroy(),i=null,{profile_string:a,level_string:u,bit_depth:f,chroma_format:h,chroma_format_string:e.getChromaFormatString(h),frame_rate:{fixed:R,fps:T,fps_den:C,fps_num:I},sar_ratio:{width:O,height:A},codec_size:{width:V,height:H},present_size:{width:K,height:H}}}},{key:"_skipScalingList",value:function(e,t){for(var n=8,i=8,r=0,s=0;s=200&&e.status<=299){var t=e.headers.get("Content-Length");return null!=t&&(n._contentLength=parseInt(t),0!==n._contentLength&&n._onContentLengthKnown&&n._onContentLengthKnown(n._contentLength)),n._pump.call(n,e.body.getReader())}if(n._status=c.LoaderStatus.kError,!n._onError)throw new _.RuntimeException("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);n._onError(c.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})}).catch(function(e){if(n._status=c.LoaderStatus.kError,!n._onError)throw e;n._onError(c.LoaderErrors.EXCEPTION,{code:-1,msg:e.message})})}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(e){var t=this;return e.read().then(function(n){if(!n.done){if(t._requestAbort===!0)return t._requestAbort=!1,t._status=c.LoaderStatus.kComplete,e.cancel();t._status=c.LoaderStatus.kBuffering;var i=n.value.buffer,r=t._range.from+t._receivedLength;return t._receivedLength+=i.byteLength,t._onDataArrival&&t._onDataArrival(i,r,t._receivedLength),t._pump(e)}t._status=c.LoaderStatus.kComplete,t._onComplete&&t._onComplete(t._range.from,t._range.from+t._receivedLength-1)}).catch(function(e){t._status=c.LoaderStatus.kError;var n=0,i=null;if(19===e.code&&(null===t._contentLength||null!==t._contentLength&&t._receivedLength0&&(this._stashInitialSize=n.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,n.enableStashBuffer===!1&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=t,this._isWebSocketURL=/wss?:\/\/(.+?)\//.test(t.url),this._refTotalLength=t.filesize?t.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._speedNormalized=0,this._speedSampler=new l.default,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return s(e,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"_selectSeekHandler",value:function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new b.default(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",n=e.seekParamEnd||"bend";this._seekHandler=new k.default(t,n)}else{if("custom"!==e.seekType)throw new w.InvalidArgumentException("Invalid seekType in config: "+e.seekType);if("function"!=typeof e.customSeekHandler)throw new w.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}},{key:"_selectLoader",value:function(){if(this._isWebSocketURL)this._loaderClass=y.default;else if(f.default.isSupported())this._loaderClass=f.default;else if(_.default.isSupported())this._loaderClass=_.default;else{if(!v.default.isSupported())throw new w.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=v.default}}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler),this._loader.needStashBuffer===!1&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}},{key:"seek",value:function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}},{key:"_internalSeek",value:function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var n={from:e,to:-1};this._currentRange={from:n.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,n),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(e){if(!e||"string"!=typeof e||0===e.length)throw new w.InvalidArgumentException("Url must be a non-empty string!");this._dataSource.url=e}},{key:"_expandBuffer",value:function(e){for(var t=this._stashSize;t+10485760){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed),r=new Uint8Array(n,0,t);r.set(i,0)}this._stashBuffer=n,this._bufferSize=t}}},{key:"_normalizeSpeed",value:function(e){var t=this._speedNormalizeList,n=t.length-1,i=0,r=0,s=n;if(e=t[i]&&e=512&&e<=1024?Math.floor(1.5*e):2*e,t>8192&&(t=8192);var n=1024*t+1048576;this._bufferSize0){var o=this._stashBuffer.slice(0,this._stashUsed),u=this._dispatchChunks(o,this._stashByteStart);if(u0){var l=new Uint8Array(o,u);a.set(l,0),this._stashUsed=l.byteLength,this._stashByteStart+=u}}else this._stashUsed=0,this._stashByteStart+=u;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var h=this._dispatchChunks(e,t);if(hthis._bufferSize&&(this._expandBuffer(d),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e,h),0),this._stashUsed+=d,this._stashByteStart=t+h}}}else if(0===this._stashUsed){var f=this._dispatchChunks(e,t);if(fthis._bufferSize&&this._expandBuffer(c);var _=new Uint8Array(this._stashBuffer,0,this._bufferSize);_.set(new Uint8Array(e,f),0),this._stashUsed+=c,this._stashByteStart=t+f}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var m=new Uint8Array(this._stashBuffer,0,this._bufferSize);m.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var p=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(p0){var v=new Uint8Array(this._stashBuffer,p);m.set(v,0)}this._stashUsed-=p,this._stashByteStart+=p}}}},{key:"_flushStashBuffer",value:function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart),i=t.byteLength-n;if(n0){var r=new Uint8Array(this._stashBuffer,0,this._bufferSize),s=new Uint8Array(t,n);r.set(s,0),this._stashUsed=s.byteLength,this._stashByteStart+=n}return 0}o.default.w(this.TAG,i+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,i}return 0}},{key:"_onLoaderComplete",value:function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(e,t){switch(o.default.e(this.TAG,"Loader error, code = "+t.code+", msg = "+t.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=h.LoaderErrors.UNRECOVERABLE_EARLY_EOF),e){case h.LoaderErrors.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var n=this._currentRange.to+1;return void(n=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}}]),e}();n.default=s},{}],28:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var o=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var s=Object.getPrototypeOf(t);return null===s?void 0:e(s,n,i)}if("value"in r)return r.value;var a=r.get;if(void 0!==a)return a.call(i)},u=function(){function e(e,t){for(var n=0;n299)){if(this._status=f.LoaderStatus.kError,!this._onError)throw new c.RuntimeException("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(f.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=f.LoaderStatus.kBuffering}},{key:"_onProgress",value:function(e){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}},{key:"_onLoadEnd",value:function(e){return this._requestAbort===!0?void(this._requestAbort=!1):void(this._status!==f.LoaderStatus.kError&&(this._status=f.LoaderStatus.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)))}},{key:"_onXhrError",value:function(e){this._status=f.LoaderStatus.kError;var t=0,n=null;if(this._contentLength&&e.loaded=200&&t.status<=299){this._status=f.LoaderStatus.kBuffering;var n=t.getResponseHeader("Content-Length");if(null!=n&&null==this._contentLength){var i=parseInt(n);i>0&&(this._contentLength=i,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength))}var r=t.response;this._reader.readAsArrayBuffer(r)}else{if(this._status=f.LoaderStatus.kError,!this._onError)throw new c.RuntimeException("MSStreamLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(f.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},{key:"_xhrOnError",value:function(e){this._status=f.LoaderStatus.kError;var t=f.LoaderErrors.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type};if(!this._onError)throw new c.RuntimeException(n.msg);this._onError(t,n)}},{key:"_msrOnProgress",value:function(e){var t=e.target,n=t.result;if(null==n)return void this._doReconnectIfNeeded();var i=n.slice(this._lastTimeBufferSize);this._lastTimeBufferSize=n.byteLength;var r=this._totalRange.from+this._receivedLength;this._receivedLength+=i.byteLength,this._onDataArrival&&this._onDataArrival(i,r,this._receivedLength),n.byteLength>=this._bufferLimit&&(d.default.v(this.TAG,"MSStream buffer exceeded max size near "+(r+i.byteLength)+", reconnecting..."),this._doReconnectIfNeeded())}},{key:"_doReconnectIfNeeded",value:function(){if(null==this._contentLength||this._receivedLength=this._contentLength&&(n=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(e,t){this._lastTimeLoaded=0;var n=this._seekHandler.getConfig(e.url,t),i=this._xhr=new XMLHttpRequest;if(i.open("GET",n.url,!0),i.responseType="arraybuffer",i.onreadystatechange=this._onReadyStateChange.bind(this),i.onprogress=this._onProgress.bind(this),i.onload=this._onLoad.bind(this),i.onerror=this._onXhrError.bind(this),e.withCredentials&&i.withCredentials&&(i.withCredentials=!0),"object"===o(n.headers)){var r=n.headers;for(var s in r)r.hasOwnProperty(s)&&i.setRequestHeader(s,r[s])}i.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=_.LoaderStatus.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState)if(t.status>=200&&t.status<300){if(this._waitForTotalLength)return;this._status=_.LoaderStatus.kBuffering}else{if(this._status=_.LoaderStatus.kError,!this._onError)throw new m.RuntimeException("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(_.LoaderErrors.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},{key:"_onProgress",value:function(e){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var n=e.total;this._internalAbort(),null!=n&0!==n&&(this._totalLength=n)}if(this._range.to===-1?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(i)}},{key:"_normalizeSpeed",value:function(e){var t=this._chunkSizeKBList,n=t.length-1,i=0,r=0,s=n;if(e=t[i]&&e=3&&(t=this._speedSampler.currentKBps)),0!==t){var n=this._normalizeSpeed(t);this._currentSpeedNormalized!==n&&(this._currentSpeedNormalized=n,this._currentChunkSizeKB=n)}var i=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var s=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new p.default(this._mediaDataSource,this._config),this._transmuxer.on(g.default.INIT_SEGMENT,function(t,n){e._msectl.appendInitSegment(n)}),this._transmuxer.on(g.default.MEDIA_SEGMENT,function(t,n){if(e._msectl.appendMediaSegment(n),e._config.lazyLoad&&!e._config.isLive){var i=e._mediaElement.currentTime;n.info.endDts>=1e3*(i+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(h.default.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}}),this._transmuxer.on(g.default.LOADING_COMPLETE,function(){e._msectl.endOfStream(),e._emitter.emit(_.default.LOADING_COMPLETE)}),this._transmuxer.on(g.default.RECOVERED_EARLY_EOF,function(){e._emitter.emit(_.default.RECOVERED_EARLY_EOF)}),this._transmuxer.on(g.default.IO_ERROR,function(t,n){e._emitter.emit(_.default.ERROR,k.ErrorTypes.NETWORK_ERROR,t,n)}),this._transmuxer.on(g.default.DEMUX_ERROR,function(t,n){e._emitter.emit(_.default.ERROR,k.ErrorTypes.MEDIA_ERROR,t,{code:-1,msg:n})}),this._transmuxer.on(g.default.MEDIA_INFO,function(t){e._mediaInfo=t,e._emitter.emit(_.default.MEDIA_INFO,Object.assign({},t))}),this._transmuxer.on(g.default.STATISTICS_INFO,function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(_.default.STATISTICS_INFO,Object.assign({},e._statisticsInfo))}),this._transmuxer.on(g.default.RECOMMEND_SEEKPOINT,function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)}),this._transmuxer.open()}}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"_fillStatisticsInfo",value:function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();n=r.totalVideoFrames,i=r.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e}},{key:"_onmseUpdateEnd",value:function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,n=0,i=0,r=0;r=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(h.default.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}},{key:"_onmseBufferFull",value:function(){h.default.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,n=!1,i=0;i=r&&e=s-30&&(n=!0);break}}n&&(window.clearInterval(this._progressChecker),this._progressChecker=null,n&&(h.default.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(e){for(var t=this._mediaElement.buffered,n=0;n=i&&e0){var r=this._mediaElement.buffered.start(0);(r<1&&e0&&t.currentTime0){var i=n.start(0);if(i<1&&t0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval); +}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(h.default.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(h.default.STATISTICS_INFO,this.statisticsInfo)}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){var e=this._mediaElement instanceof HTMLAudioElement?"audio/":"video/",t={mimeType:e+this._mediaDataSource.type};return this._mediaElement&&(t.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(t.width=this._mediaElement.videoWidth,t.height=this._mediaElement.videoHeight)),t}},{key:"statisticsInfo",get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();n=r.totalVideoFrames,i=r.droppedVideoFrames}else void 0!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e}}]),e}();n.default=c},{"../config.js":5,"../utils/exception.js":40,"./player-events.js":35,events:2}],34:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.ErrorDetails=n.ErrorTypes=void 0;var r=e("../io/loader.js"),s=e("../demux/demux-errors.js"),a=i(s);n.ErrorTypes={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},n.ErrorDetails={NETWORK_EXCEPTION:r.LoaderErrors.EXCEPTION,NETWORK_STATUS_CODE_INVALID:r.LoaderErrors.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:r.LoaderErrors.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:r.LoaderErrors.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:a.default.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:a.default.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:a.default.CODEC_UNSUPPORTED}},{"../demux/demux-errors.js":16,"../io/loader.js":24}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",STATISTICS_INFO:"statistics_info"};n.default=i},{}],36:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n>>24&255,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n.set(e,4);for(var a=8,o=0;o>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var n=t.id,i=t.duration,r=t.presentWidth,s=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>>8&255,255&r,0,0,s>>>8&255,255&s,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var n=t.timescale,i=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))}},{key:"hdlr",value:function(t){var n=null;return n="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,n)}},{key:"minf",value:function(t){var n=null;return n="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,n,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){var t=e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF));return t}},{key:"stbl",value:function(t){var n=e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO));return n}},{key:"stsd",value:function(t){return"audio"===t.type?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))}},{key:"mp4a",value:function(t){var n=t.channelCount,i=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types.mp4a,r,e.esds(t))}},{key:"esds",value:function(t){var n=t.config,i=n.length,r=new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(n).concat([6,1,2]));return e.box(e.types.esds,r)}},{key:"avc1",value:function(t){var n=t.avcc,i=t.codecWidth,r=t.codecHeight,s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,s,e.box(e.types.avcC,n))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var n=t.id,i=new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,i)}},{key:"moof",value:function(t,n){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,n))}},{key:"mfhd",value:function(t){var n=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,n)}},{key:"traf",value:function(t,n){var i=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),s=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),a=e.sdtp(t),o=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,r,s,o,a)}},{key:"sdtp",value:function(t){for(var n=t.samples||[],i=n.length,r=new Uint8Array(4+i),s=0;s>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0);for(var o=0;o>>24&255,u>>>16&255,u>>>8&255,255&u,l>>>24&255,l>>>16&255,l>>>8&255,255&l,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.isNonSync,0,0,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*o)}return e.box(e.types.trun,a)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();s.init(),n.default=s},{}],38:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n>>24&255,h[1]=u>>>16&255,h[2]=u>>>8&255,h[3]=255&u,h.set(l.default.types.mdat,4);for(var d=8,f=[];n.length;){var c=n.shift(),m=c.unit,p=c.dts-this._dtsBase;if(void 0==i)if(void 0==this._audioNextDts)if(this._audioSegmentInfoList.isEmpty())i=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&(a=!0);else{var v=this._audioSegmentInfoList.getLastSampleBefore(p);if(null!=v){var g=p-(v.originalDts+v.duration);g<=3&&(g=0);var y=v.dts+v.duration+g;i=p-y}else i=0}else i=p-this._audioNextDts;var E=p-i;if(a){var b=this._videoSegmentInfoList.getLastSegmentBefore(p);null!=b&&b.beginDts>>24&255,h[1]=u>>>16&255,h[2]=u>>>8&255,h[3]=255&u,h.set(l.default.types.mdat,4),h.set(w,d),d+=w.byteLength}else{var L=0;if(n.length>=1){var O=n[0].dts-this._dtsBase-i;L=O-E}else L=f.length>=1?f[f.length-1].duration:this._audioMeta.refSampleDuration;var A={dts:E,pts:E,cts:0,size:m.byteLength,duration:L,originalDts:p,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};f.push(A),h.set(m,d),d+=m.byteLength}}var T=f[f.length-1];s=T.dts+T.duration,this._audioNextDts=s;var R=new _.MediaSegmentInfo;R.beginDts=r,R.endDts=s,R.beginPts=r,R.endPts=s,R.originalBeginDts=f[0].originalDts,R.originalEndDts=T.originalDts+T.duration,R.firstSample=new _.SampleInfo(f[0].dts,f[0].pts,f[0].duration,f[0].originalDts,(!1)),R.lastSample=new _.SampleInfo(T.dts,T.pts,T.duration,T.originalDts,(!1)),this._isLive||this._audioSegmentInfoList.append(R),t.samples=f,t.sequenceNumber++;var I=l.default.moof(t,r);t.samples=[],t.length=0,this._onMediaSegment("audio",{type:"audio",data:this._mergeBoxes(I,h).buffer,sampleCount:f.length,info:R})}}},{key:"_generateSilentAudio",value:function(e,t){o.default.v(this.TAG,"GenerateSilentAudio: dts = "+e+", duration = "+t);var n=d.default.getSilentFrame(this._audioMeta.channelCount);if(null==n)return o.default.w(this.TAG,"Cannot generate silent aac frame for channelCount = "+this._audioMeta.channelCount),null;var i={dts:e,pts:e,cts:0,size:n.byteLength,duration:t,originalDts:e,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};return{unit:n,mp4Sample:i}}},{key:"_remuxVideo",value:function(e){var t=e,n=t.samples,i=void 0,r=-1,s=-1,a=-1,o=-1;if(n&&0!==n.length){var u=8+e.length,h=new Uint8Array(u);h[0]=u>>>24&255,h[1]=u>>>16&255,h[2]=u>>>8&255,h[3]=255&u,h.set(l.default.types.mdat,4);for(var d=8,f=[],c=new _.MediaSegmentInfo;n.length;){var m=n.shift(),p=m.isKeyframe,v=m.dts-this._dtsBase;if(void 0==i)if(void 0==this._videoNextDts)if(this._videoSegmentInfoList.isEmpty())i=0;else{var g=this._videoSegmentInfoList.getLastSampleBefore(v);if(null!=g){var y=v-(g.originalDts+g.duration);y<=3&&(y=0);var E=g.dts+g.duration+y;i=v-E}else i=0}else i=v-this._videoNextDts;var b=v-i,S=m.cts,k=b+S;r===-1&&(r=b,a=k);for(var w=0;m.units.length;){var L=m.units.shift(),O=L.data;h.set(O,d),d+=O.byteLength,w+=O.byteLength}var A=0;if(n.length>=1){var T=n[0].dts-this._dtsBase-i;A=T-b}else A=f.length>=1?f[f.length-1].duration:this._videoMeta.refSampleDuration;if(p){var R=new _.SampleInfo(b,k,A,m.dts,(!0));R.fileposition=m.fileposition,c.appendSyncPoint(R)}var I={dts:b,pts:k,cts:S,size:w,isKeyframe:p,duration:A,originalDts:v,flags:{isLeading:0,dependsOn:p?2:1,isDependedOn:p?1:0,hasRedundancy:0,isNonSync:p?0:1}};f.push(I)}var C=f[f.length-1];if(s=C.dts+C.duration,o=C.pts+C.duration,this._videoNextDts=s,c.beginDts=r,c.endDts=s,c.beginPts=a,c.endPts=o,c.originalBeginDts=f[0].originalDts,c.originalEndDts=C.originalDts+C.duration,c.firstSample=new _.SampleInfo(f[0].dts,f[0].pts,f[0].duration,f[0].originalDts,f[0].isKeyframe),c.lastSample=new _.SampleInfo(C.dts,C.pts,C.duration,C.originalDts,C.isKeyframe),this._isLive||this._videoSegmentInfoList.append(c),t.samples=f,t.sequenceNumber++,this._forceFirstIDR){var x=f[0].flags;x.dependsOn=2,x.isNonSync=0}var M=l.default.moof(t,r);t.samples=[],t.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(M,h).buffer,sampleCount:f.length,info:c})}}},{key:"_mergeBoxes",value:function(e,t){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e}}]),e}();n.default=p},{"../core/media-segment-info.js":8,"../utils/browser.js":39,"../utils/exception.js":40,"../utils/logger.js":41,"./aac-silent.js":36,"./mp4-generator.js":37}],39:[function(e,t,n){"use strict";function i(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[],n=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],i={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:n[0]||""},s={};if(i.browser){s[i.browser]=!0;var a=i.majorVersion.split(".");s.version={major:parseInt(i.majorVersion,10),string:i.version},a.length>1&&(s.version.minor=parseInt(a[1],10)),a.length>2&&(s.version.build=parseInt(a[2],10))}if(i.platform&&(s[i.platform]=!0),(s.chrome||s.opr||s.safari)&&(s.webkit=!0),s.rv||s.iemobile){s.rv&&delete s.rv;var o="msie";i.browser=o,s[o]=!0}if(s.edge){delete s.edge;var u="msedge";i.browser=u,s[u]=!0}if(s.opr){var l="opera";i.browser=l,s[l]=!0}if(s.safari&&s.android){var h="android";i.browser=h,s[h]=!0}s.name=i.browser,s.platform=i.platform;for(var d in r)r.hasOwnProperty(d)&&delete r[d];Object.assign(r,s)}Object.defineProperty(n,"__esModule",{value:!0});var r={};i(),n.default=r},{}],40:[function(e,t,n){"use strict";function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n "+n;console.error?console.error(i):console.warn?console.warn(i):console.log(i)}}},{key:"i",value:function(t,n){if(e.ENABLE_INFO){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+n;console.info?console.info(i):console.log(i)}}},{key:"w",value:function(t,n){if(e.ENABLE_WARN){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+n;console.warn?console.warn(i):console.log(i)}}},{key:"d",value:function(t,n){if(e.ENABLE_DEBUG){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="["+t+"] > "+n;console.debug?console.debug(i):console.log(i)}}},{key:"v",value:function(t,n){e.ENABLE_VERBOSE&&(t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG),console.log("["+t+"] > "+n))}}]),e}();s.GLOBAL_TAG="flv.js",s.FORCE_GLOBAL_TAG=!1,s.ENABLE_ERROR=!0,s.ENABLE_INFO=!0,s.ENABLE_WARN=!0,s.ENABLE_DEBUG=!0,s.ENABLE_VERBOSE=!0,n.default=s},{}],42:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n0){var n=e.getConfig();t.emit("change",n)}}},{key:"registerListener",value:function(t){e.emitter.addListener("change",t)}},{key:"removeListener",value:function(t){e.emitter.removeListener("change",t)}},{key:"forceGlobalTag",get:function(){return l.default.FORCE_GLOBAL_TAG},set:function(t){l.default.FORCE_GLOBAL_TAG=t,e._notifyChange()}},{key:"globalTag",get:function(){return l.default.GLOBAL_TAG},set:function(t){l.default.GLOBAL_TAG=t,e._notifyChange()}},{key:"enableAll",get:function(){return l.default.ENABLE_VERBOSE&&l.default.ENABLE_DEBUG&&l.default.ENABLE_INFO&&l.default.ENABLE_WARN&&l.default.ENABLE_ERROR},set:function(t){l.default.ENABLE_VERBOSE=t,l.default.ENABLE_DEBUG=t,l.default.ENABLE_INFO=t,l.default.ENABLE_WARN=t,l.default.ENABLE_ERROR=t,e._notifyChange()}},{key:"enableDebug",get:function(){return l.default.ENABLE_DEBUG},set:function(t){l.default.ENABLE_DEBUG=t,e._notifyChange()}},{key:"enableVerbose",get:function(){return l.default.ENABLE_VERBOSE},set:function(t){l.default.ENABLE_VERBOSE=t,e._notifyChange()}},{key:"enableInfo",get:function(){return l.default.ENABLE_INFO},set:function(t){l.default.ENABLE_INFO=t,e._notifyChange()}},{key:"enableWarn",get:function(){return l.default.ENABLE_WARN},set:function(t){l.default.ENABLE_WARN=t,e._notifyChange()}},{key:"enableError",get:function(){return l.default.ENABLE_ERROR},set:function(t){l.default.ENABLE_ERROR=t,e._notifyChange()}}]),e}();h.emitter=new o.default,n.default=h},{"./logger.js":41,events:2}],43:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n=128){t.push(String.fromCharCode(65535&a)),r+=2;continue}}}else if(n[r]<240){if(i(n,r,2)){var o=(15&n[r])<<12|(63&n[r+1])<<6|63&n[r+2];if(o>=2048&&55296!==(63488&o)){t.push(String.fromCharCode(65535&o)),r+=3;continue}}}else if(n[r]<248&&i(n,r,3)){var u=(7&n[r])<<18|(63&n[r+1])<<12|(63&n[r+2])<<6|63&n[r+3];if(u>65536&&u<1114112){u-=65536,t.push(String.fromCharCode(u>>>10|55296)),t.push(String.fromCharCode(1023&u|56320)),r+=4;continue}}t.push(String.fromCharCode(65533)),++r}return t.join("")}Object.defineProperty(n,"__esModule",{value:!0}),n.default=r},{}]},{},[21])(21)}); +//# sourceMappingURL=flv.min.js.map diff --git a/plugin/hls.min.js b/plugin/hls.min.js new file mode 100644 index 0000000..d7b9f1e --- /dev/null +++ b/plugin/hls.min.js @@ -0,0 +1,6 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Hls=e()}}(function(){return function s(e,t,r){function i(a,d){if(!t[a]){if(!e[a]){var l="function"==typeof require&&require;if(!d&&l)return l(a,!0);if(n)return n(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var o=t[a]={exports:{}};e[a][0].call(o.exports,function(t){var r=e[a][1][t];return i(r?r:t)},o,o.exports,s,e,t,r)}return t[a].exports}for(var n="function"==typeof require&&require,a=0;ae||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},e.prototype.emit=function(l){var s,e,u,a,n,o;if(this._events||(this._events={}),"error"===l&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if(s=arguments[1],s instanceof Error)throw s;throw TypeError('Uncaught, unspecified "error" event.')}if(e=this._events[l],i(e))return!1;if(t(e))switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),e.apply(this,a)}else if(r(e))for(a=Array.prototype.slice.call(arguments,1),o=e.slice(),u=o.length,n=0;u>n;n++)o[n].apply(this,a);return!0},e.prototype.addListener=function(a,n){var s;if(!t(n))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,t(n.listener)?n.listener:n),this._events[a]?r(this._events[a])?this._events[a].push(n):this._events[a]=[this._events[a],n]:this._events[a]=n,r(this._events[a])&&!this._events[a].warned&&(s=i(this._maxListeners)?e.defaultMaxListeners:this._maxListeners,s&&s>0&&this._events[a].length>s&&(this._events[a].warned=!0,"function"==typeof console.trace)),this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(i,e){function r(){this.removeListener(i,r),a||(a=!0,e.apply(this,arguments))}if(!t(e))throw TypeError("listener must be a function");var a=!1;return r.listener=e,this.on(i,r),this},e.prototype.removeListener=function(a,i){var e,s,o,n;if(!t(i))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(e=this._events[a],o=e.length,s=-1,e===i||t(e.listener)&&e.listener===i)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,i);else if(r(e)){for(n=o;n-- >0;)if(e[n]===i||e[n].listener&&e[n].listener===i){s=n;break}if(0>s)return this;1===e.length?(e.length=0,delete this._events[a]):e.splice(s,1),this._events.removeListener&&this.emit("removeListener",a,i)}return this},e.prototype.removeAllListeners=function(r){var i,e;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[r]&&delete this._events[r],this;if(0===arguments.length){for(i in this._events)"removeListener"!==i&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events={},this}if(e=this._events[r],t(e))this.removeListener(r,e);else if(e)for(;e.length;)this.removeListener(r,e[e.length-1]);return delete this._events[r],this},e.prototype.listeners=function(e){var r;return r=this._events&&this._events[e]?t(this._events[e])?[this._events[e]]:this._events[e].slice():[]},e.prototype.listenerCount=function(r){if(this._events){var e=this._events[r];if(t(e))return 1;if(e)return e.length}return 0},e.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(n,i,s){var a=arguments[3],e=arguments[4],r=arguments[5],t=JSON.stringify;i.exports=function(l){for(var i,s=Object.keys(r),n=0,d=s.length;d>n;n++){var o=s[n],u=r[o].exports;if(u===l||u.default===l){i=o;break}}if(!i){i=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var h={},n=0,d=s.length;d>n;n++){var o=s[n];h[o]=o}e[i]=[Function(["require","module","exports"],"("+l+")(self)"),h]}var f=Math.floor(Math.pow(16,8)*Math.random()).toString(16),c={};c[i]=i,e[f]=[Function(["require"],"var f = require("+t(i)+");(f.default ? f.default : f)(self);"),c];var v="("+a+")({"+Object.keys(e).map(function(r){return t(r)+":["+e[r][0]+","+t(e[r][1])+"]"}).join(",")+"},{},["+t(f)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(g.createObjectURL(new Blob([v],{type:"text/javascript"})))}},{}],3:[function(e,m,o){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(o,"__esModule",{value:!0});var g=function(){function e(i,r){for(var t=0;t500*e.duration/f){var p=o.levels,v=Math.max(1,i.bw?i.bw/8:1e3*i.loaded/h),y=i.total?i.total:Math.max(i.loaded,Math.round(e.duration*p[e.level].bitrate/8)),g=s.currentTime,c=(y-i.loaded)/v,u=(n.default.bufferInfo(s,g,o.config.maxBufferHole).end-g)/f;if(u<2*e.duration/f&&c>u){var d=void 0,a=void 0;for(a=e.level-1;a>=0&&(d=e.duration*p[a].bitrate/(6.4*v),t.logger.log("fragLoadedDelay/bufferStarvationDelay/fragLevelNextLoadedDelay["+a+"] :"+c.toFixed(1)+"/"+u.toFixed(1)+"/"+d.toFixed(1)),!(u>d));a--);c>d&&(a=Math.max(0,a),o.nextLoadLevel=a,this.bwEstimator.sample(h,i.loaded),t.logger.warn("loading too slow, abort fragment loading and switch to level "+a),e.loader.abort(),this.clearTimer(),o.trigger(r.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,stats:i}))}}}}},{key:"onFragLoaded",value:function(r){var e=r.frag;if("main"===e.type){var t=r.stats;if(void 0===t.aborted&&1===e.loadCounter){var i=t.tload-t.trequest;this.bwEstimator.sample(i,t.loaded),e.bitrateTest?this.bitrateTestDelay=i/1e3:this.bitrateTestDelay=0}this.clearTimer(),this.lastLoadedFragLevel=e.level,this._nextAutoLevel=-1}}},{key:"onError",value:function(e){switch(e.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}}},{key:"clearTimer",value:function(){this.timer&&(clearInterval(this.timer),this.timer=null)}},{key:"findBestLevel",value:function(g,h,s,v,u,c,f,l){for(var e=v;e>=0;e--){var d=l[e],n=d.details,o=n?n.totalduration/n.fragments.length:h,r=void 0;r=g>=e?c*s:f*s;var a=l[e].bitrate,i=a*o/r;if(t.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+e+"/"+Math.round(r)+"/"+a+"/"+o+"/"+u+"/"+i),r>a&&(!i||u>i))return e}return-1}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){this._autoLevelCapping=e}},{key:"nextAutoLevel",get:function(){var e=this._nextAutoLevel,r=this.bwEstimator;if(!(-1===e||r&&r.canEstimate()))return Math.min(e,this.maxAutoLevel);var t=this.nextABRAutoLevel;return-1!==e&&(t=Math.min(e,t)),t},set:function(e){this._nextAutoLevel=e}},{key:"maxAutoLevel",get:function(){var r,e=this.hls.levels,t=this._autoLevelCapping;return r=-1===t&&e&&e.length?e.length-1:t}},{key:"nextABRAutoLevel",get:function(){var a=this.hls,u=this.maxAutoLevel,c=a.levels,e=a.config,r=a.media,f=this.lastLoadedFragLevel,h=this.fragCurrent?this.fragCurrent.duration:0,v=r?r.currentTime:0,g=r&&0!==r.playbackRate?Math.abs(r.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():e.abrEwmaDefaultEstimate,l=(n.default.bufferInfo(r,v,e.maxBufferHole).end-v)/g,i=this.findBestLevel(f,h,d,u,l,e.abrBandWidthFactor,e.abrBandWidthUpFactor,c);if(i>=0)return i;t.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var s=e.maxStarvationDelay;if(0===l){var o=this.bitrateTestDelay;o&&(s-=o,t.logger.trace("bitrate test took "+Math.round(1e3*o)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*s)+" ms"))}return i=this.findBestLevel(f,h,d,u,l+s,e.abrBandWidthFactor,e.abrBandWidthUpFactor,c),Math.max(i,0)}}]),e}(a.default);o.default=y},{24:24,25:25,26:26,28:28,43:43,8:8}],4:[function(i,A,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function k(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(s,"__esModule",{value:!0});var _=function(){function e(i,r){for(var t=0;t1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){var g,v,n,f=this.hls,d=f.config;switch(this.state){case e.ERROR:case e.PAUSED:break;case e.STARTING:this.state=e.WAITING_TRACK,this.loadedmetadata=!1;break;case e.IDLE:if(!this.media&&(this.startFragRequested||!d.startFragPrefetch))break;g=this.loadedmetadata?this.media.currentTime:this.nextLoadPosition;var c=this.mediaBuffer?this.mediaBuffer:this.media,E=h.default.bufferInfo(c,g,d.maxBufferHole),T=E.len,o=E.end,l=this.fragPrevious,A=d.maxMaxBufferLength;if(A>T&&this.trackIdo?i=s[0]:!function(){var e=void 0,t=d.maxFragLookUpTolerance;m>o?(o>m-t&&(t=0),e=u.default.search(s,function(e){return e.start+e.duration-t<=o?1:e.start-t>o?-1:0})):e=s[p-1],e&&(i=e,y=e.start,l&&i.level===l.level&&i.sn===l.sn&&(i.snb&&Math.abs(this.fragLoadIdx-i.loadIdx)=R||k)&&(r.logger.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=e.IDLE);break;case e.STOPPED:case e.FRAG_LOADING:case e.PARSING:case e.PARSED:case e.ENDED:}}},{key:"onMediaAttached",value:function(r){var e=this.media=this.mediaBuffer=r.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("ended",this.onvended);var t=this.config;this.tracks&&t.autoStartLoad&&this.startLoad(t.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(r.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.tracks;t&&t.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){this.state===e.ENDED&&(this.state=e.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.tick()}},{key:"onMediaEnded",value:function(){this.startPosition=this.lastCurrentTime=0}},{key:"onAudioTracksUpdated",value:function(e){r.logger.log("audio tracks updated"),this.tracks=e.audioTracks}},{key:"onAudioTrackSwitch",value:function(r){var i=!!r.url;this.trackId=r.id,this.state=e.IDLE,this.fragCurrent=null,this.state=e.PAUSED,i?this.timer||(this.timer=setInterval(this.ontick,100)):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.hls.trigger(t.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),this.tick()}},{key:"onAudioTrackLoaded",value:function(a){var t=a.details,n=a.id,s=this.tracks[n],o=t.totalduration;if(r.logger.log("track "+n+" loaded ["+t.startSN+","+t.endSN+"],duration:"+o),t.PTSKnown=!1,s.details=t,!this.startFragRequested){if(-1===this.startPosition){var i=t.startTimeOffset;isNaN(i)?this.startPosition=0:(r.logger.log("start time offset found in playlist, adjust startPosition to "+i),this.startPosition=i)}this.nextLoadPosition=this.startPosition}this.state===e.WAITING_TRACK&&(this.state=e.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===e.KEY_LOADING&&(this.state=e.IDLE,this.tick())}},{key:"onFragLoaded",value:function(i){var t=this.fragCurrent;if(this.state===e.FRAG_LOADING&&t&&"audio"===i.frag.type&&i.frag.level===t.level&&i.frag.sn===t.sn){this.state=e.PARSING,this.stats=i.stats;var n=this.tracks[this.trackId],a=n.details,l=a.totalduration,u=t.start,s=t.level,o=t.sn,d=this.config.defaultAudioCodec||n.audioCodec;this.pendingAppending=0,this.demuxer||(this.demuxer=new T.default(this.hls,"audio")),r.logger.log("Demuxing "+o+" of ["+a.startSN+" ,"+a.endSN+"],track "+s);var h=a.PTSKnown||!a.live;this.demuxer.push(i.payload,d,null,u,t.cc,s,o,l,t.decryptdata,h)}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(a){var n=this.fragCurrent;if(n&&"audio"===a.id&&a.sn===n.sn&&a.level===n.level&&this.state===e.PARSING){var s=a.tracks,i=void 0;if(i=s.audio){i.levelCodec="mp4a.40.2",i.id=a.id,this.hls.trigger(t.default.BUFFER_CODECS,s),r.logger.log("audio track:audio,container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var o=i.initSegment;o&&(this.pendingAppending++,this.hls.trigger(t.default.BUFFER_APPENDING,{type:"audio",data:o,parent:"audio",content:"initSegment"})),this.tick()}}}},{key:"onFragParsingData",value:function(i){var n=this,a=this.fragCurrent;if(a&&"audio"===i.id&&i.sn===a.sn&&i.level===a.level&&this.state===e.PARSING){var s=this.tracks[this.trackId],o=this.fragCurrent;r.logger.log("parsed "+i.type+",PTS:["+i.startPTS.toFixed(3)+","+i.endPTS.toFixed(3)+"],DTS:["+i.startDTS.toFixed(3)+"/"+i.endDTS.toFixed(3)+"],nb:"+i.nb),E.default.updateFragPTSDTS(s.details,o.sn,i.startPTS,i.endPTS),[i.data1,i.data2].forEach(function(e){e&&(n.pendingAppending++,n.hls.trigger(t.default.BUFFER_APPENDING,{type:i.type,data:e,parent:"audio",content:"data"}))}),this.nextLoadPosition=i.endPTS,this.tick()}}},{key:"onFragParsed",value:function(t){var r=this.fragCurrent;r&&"audio"===t.id&&t.sn===r.sn&&t.level===r.level&&this.state===e.PARSING&&(this.stats.tparsed=performance.now(),this.state=e.PARSED,this._checkAppendedParsed())}},{key:"onBufferCreated",value:function(t){var e=t.tracks.audio;e&&(this.mediaBuffer=e.buffer,this.loadedmetadata=!0)}},{key:"onBufferAppended",value:function(t){if("audio"===t.parent)switch(this.state){case e.PARSING:case e.PARSED:this.pendingAppending--,this._checkAppendedParsed()}}},{key:"_checkAppendedParsed",value:function(){if(this.state===e.PARSED&&0===this.pendingAppending){var i=this.fragCurrent,a=this.stats;if(i){this.fragPrevious=i,a.tbuffered=performance.now(),this.hls.trigger(t.default.FRAG_BUFFERED,{stats:a,frag:i,id:"audio"});var n=this.mediaBuffer?this.mediaBuffer:this.media;r.logger.log("audio buffered : "+R.default.toString(n.buffered)),this.state=e.IDLE}this.tick()}}},{key:"onError",value:function(i){var s=i.frag;if(!s||"audio"===s.type)switch(i.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:if(!i.fatal){var n=this.fragLoadError;n?n++:n=1;var o=this.config;if(n<=o.fragLoadingMaxRetry){this.fragLoadError=n,s.loadCounter=0;var l=Math.min(Math.pow(2,n-1)*o.fragLoadingRetryDelay,o.fragLoadingMaxRetryTimeout);r.logger.warn("audioStreamController: frag loading failed, retry in "+l+" ms"),this.retryDate=performance.now()+l,this.state=e.FRAG_LOADING_WAITING_RETRY}else r.logger.error("audioStreamController: "+i.details+" reaches max retry, redispatch as fatal ..."),i.fatal=!0,this.hls.trigger(t.default.ERROR,i),this.state=e.ERROR}break;case a.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==e.ERROR&&(this.state=i.fatal?e.ERROR:e.IDLE,r.logger.warn("audioStreamController: "+i.details+" while loading frag,switch to "+this.state+" state ..."))}}},{key:"onBufferFlushed",value:function(){this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.state=e.IDLE,this.fragPrevious=null,this.tick()}}]),i}(o.default);s.default=c},{20:20,24:24,25:25,26:26,28:28,29:29,39:39,43:43,45:45}],5:[function(r,c,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var f=function(){function e(i,r){for(var t=0;t=0&&rthis._msDuration&&(e.logger.log("Updating mediasource duration to "+this._levelDuration),t.duration=this._levelDuration,this._msDuration=this._levelDuration)}}}},{key:"doFlush",value:function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var r=0,i=this.sourceBuffer;for(var a in i)r+=i[a].buffered.length;this.appended=r,this.hls.trigger(t.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var a=this.hls,s=this.sourceBuffer,n=this.segments;if(Object.keys(s).length){if(this.media.error)return this.segments=[],void e.logger.error("trying to append although a media error occured, flush segment and abort"); +if(this.appending)return;if(n&&n.length){var o=n.shift();try{var l=o.type;s[l]?(s[l].ended=!1,this.parent=o.parent,s[l].appendBuffer(o.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(s){e.logger.error("error while trying to append buffer:"+s.message),n.unshift(o);var i={type:r.ErrorTypes.MEDIA_ERROR};if(22===s.code)return this.segments=[],i.details=r.ErrorDetails.BUFFER_FULL_ERROR,void a.trigger(t.default.ERROR,i);if(this.appendError?this.appendError++:this.appendError=1,i.details=r.ErrorDetails.BUFFER_APPEND_ERROR,i.frag=this.fragCurrent,this.appendError>a.config.appendErrorMaxRetry)return e.logger.log("fail "+a.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),n=[],i.fatal=!0,void a.trigger(t.default.ERROR,i);i.fatal=!1,a.trigger(t.default.ERROR,i)}}}}},{key:"flushBuffer",value:function(l,n,h){var t,r,o,s,i,a,u=this.sourceBuffer;if(Object.keys(u).length){if(e.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime+"/"+l+"/"+n),this.flushBufferCounter.5)return this.flushBufferCounter++,e.logger.log("flush "+d+" ["+i+","+a+"], of ["+o+","+s+"], pos:"+this.media.currentTime),t.remove(i,a),!1}}else e.logger.warn("abort flushing too many retries");e.logger.log("buffer flushed")}return!0}}]),i}(s.default);a.default=o},{24:24,25:25,26:26,43:43}],7:[function(t,f,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(i,r){for(var t=0;tthis.autoLevelCapping&&this.hls.streamController.nextLevelSwitch(),this.autoLevelCapping=this.hls.autoLevelCapping)}}},{key:"getMaxLevel",value:function(n){var r=0,e=void 0,t=void 0,s=this.mediaWidth,o=this.mediaHeight,i=0,a=0;for(e=0;n>=e&&(t=this.levels[e],!this.isLevelRestricted(e))&&(r=e,i=t.width,a=t.height,!(i>=s||a>=o));e++);return r}},{key:"isLevelRestricted",value:function(e){return!(!this.restrictedLevels||-1===this.restrictedLevels.indexOf(e))}},{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e}},{key:"mediaWidth",get:function(){var e=void 0;return this.media&&(e=this.media.width||this.media.clientWidth||this.media.offsetWidth,e*=this.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0;return this.media&&(e=this.media.height||this.media.clientHeight||this.media.offsetHeight,e*=this.contentScaleFactor),e}}]),t}(s.default);r.default=u},{25:25,26:26}],8:[function(r,l,e){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function e(i,r){for(var t=0;t=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),e}();e.default=o},{42:42}],9:[function(e,c,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(r,"__esModule",{value:!0});var f=function(){function e(i,r){for(var t=0;t0&&a>this.hls.config.fpsDroppedMonitoringThreshold*s){var e=this.hls.currentLevel;o.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===this.hls.autoLevelCapping||this.hls.autoLevelCapping>=e)&&(e-=1,this.hls.trigger(t.default.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:this.hls.currentLevel}),this.hls.autoLevelCapping=e,this.hls.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=i,this.lastDecodedFrames=r}}},{key:"checkFPSInterval",value:function(){if(this.video)if(this.isVideoPlaybackQualityAvailable){var e=this.video.getVideoPlaybackQuality();this.checkFPS(this.video,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(this.video,this.video.webkitDecodedFrameCount,this.video.webkitDroppedFrameCount)}}]),e}(h.default);r.default=u},{25:25,26:26,43:43}],10:[function(i,v,a){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(a,"__esModule",{value:!0});var c=function(){function e(i,r){for(var t=0;t=0&&i1e3){r.logger.log("(re)loading playlist for level "+i);var o=a.urlId;this.hls.trigger(t.default.LEVEL_LOADING,{url:a.url[o],level:i,id:o})}}else this.hls.trigger(t.default.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.LEVEL_SWITCH_ERROR,level:i,fatal:!1,reason:"invalid level idx"})}},{key:"onError",value:function(n){if(!n.fatal){var a=n.details,o=this.hls,s=void 0,i=void 0,l=!1;switch(a){case e.ErrorDetails.FRAG_LOAD_ERROR:case e.ErrorDetails.FRAG_LOAD_TIMEOUT:case e.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case e.ErrorDetails.KEY_LOAD_ERROR:case e.ErrorDetails.KEY_LOAD_TIMEOUT:s=n.frag.level;break;case e.ErrorDetails.LEVEL_LOAD_ERROR:case e.ErrorDetails.LEVEL_LOAD_TIMEOUT:s=n.context.level,l=!0}if(void 0!==s)if(i=this._levels[s],i.urlIde&&(this._level===e&&void 0!==t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(e){this._manualLevel=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this._manualLevel?this._manualLevel:this.hls.abrController.nextAutoLevel},set:function(e){this.level=e,-1===this._manualLevel&&(this.hls.abrController.nextAutoLevel=e)}}]),i}(h.default);a.default=o},{24:24,25:25,26:26,43:43}],11:[function(a,A,d){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function k(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(d,"__esModule",{value:!0});var E=function(){function e(i,r){for(var t=0;t0?(t.logger.log("configure startPosition @"+i),this.lastPaused||(t.logger.log("resuming video"),r.play())):this.lastCurrentTime=this.startPosition?this.startPosition:a,this.state=this.startFragRequested?e.IDLE:e.STARTING,this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else t.logger.warn("cannot start loading as manifest not parsed yet"),this.state=e.STOPPED}},{key:"stopLoad",value:function(){var t=this.fragCurrent;t&&(t.loader&&t.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=e.STOPPED}},{key:"tick",value:function(){this.ticks++,1===this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){switch(this.state){case e.STARTING:var i=this.hls,r=i.startLevel;-1===r&&(r=0,this.fragBitrateTest=!0),this.level=i.nextLoadLevel=r,this.state=e.WAITING_LEVEL,this.loadedmetadata=!1;break;case e.IDLE:if(!this._doTickIdle())return;break;case e.WAITING_LEVEL:var a=this.levels[this.level];a&&a.details&&(this.state=e.IDLE);break;case e.FRAG_LOADING_WAITING_RETRY:var s=performance.now(),n=this.retryDate;(!n||s>=n||this.media&&this.media.seeking)&&(t.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=e.IDLE);break;case e.ERROR:case e.PAUSED:case e.STOPPED:case e.FRAG_LOADING:case e.PARSING:case e.PARSED:case e.ENDED:}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var d=this.hls,a=d.config,o=this.media;if(!o&&(this.startFragRequested||!a.startFragPrefetch))return!0;var f=void 0;f=this.loadedmetadata?o.currentTime:this.nextLoadPosition;var i=d.nextLoadLevel,n=void 0;n=this.levels[i].hasOwnProperty("bitrate")?Math.max(8*a.maxBufferSize/this.levels[i].bitrate,a.maxBufferLength):a.maxBufferLength,n=Math.min(n,a.maxMaxBufferLength);var u=s.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:o,f,a.maxBufferHole),c=u.len;if(c>=n)return!0;t.logger.trace("buffer length of "+c.toFixed(3)+" is below max of "+n.toFixed(3)+". checking for more payload ..."),d.nextLoadLevel=i,this.level=i;var l=this.levels[i].details;if("undefined"==typeof l||l.live&&this.levelLastLoaded!==i)return this.state=e.WAITING_LEVEL,!0;var h=this.fragPrevious;if(!l.live&&h&&h.sn===l.endSN&&(!o.seeking&&u.len||o.duration-u.end<=h.duration/2)){var v={};return this.altAudio&&(v.type="video"),this.hls.trigger(r.default.BUFFER_EOS,v),this.state=e.ENDED,!0}return this._fetchPayloadOrEos({pos:f,bufferInfo:u,levelDetails:l})}},{key:"_fetchPayloadOrEos",value:function(s){var h=s.pos,u=s.bufferInfo,r=s.levelDetails,o=this.fragPrevious,d=this.level,e=r.fragments,i=e.length;if(0===i)return!1;var n=e[0].start,l=e[i-1].start+e[i-1].duration,a=u.end,t=void 0;if(r.live){if(t=this._ensureFragmentAtLivePoint({levelDetails:r,bufferEnd:a,start:n,end:l,fragPrevious:o,fragments:e,fragLen:i}),null===t)return!1}else n>a&&(t=e[0]);return t||(t=this._findFragment({start:n,fragPrevious:o,fragLen:i,fragments:e,bufferEnd:a,end:l,levelDetails:r})),t?this._loadFragmentOrKey({frag:t,level:d,levelDetails:r,pos:h,bufferEnd:a}):!0}},{key:"_ensureFragmentAtLivePoint",value:function(e){var r=e.levelDetails,n=e.bufferEnd,f=e.start,h=e.end,d=e.fragPrevious,u=e.fragments,c=e.fragLen,o=this.hls.config,a=this.media,i=void 0,v=void 0!==o.liveMaxLatencyDuration?o.liveMaxLatencyDuration:o.liveMaxLatencyDurationCount*r.targetduration;if(ns&&(a.currentTime=s)}if(r.PTSKnown&&n>h&&a&&a.readyState)return null;if(this.startFragRequested&&!r.PTSKnown){if(d){var l=d.sn+1;l>=r.startSN&&l<=r.endSN&&(i=u[l-r.startSN],t.logger.log("live playlist, switching playlist, load frag with next SN: "+i.sn))}i||(i=u[Math.min(c-1,Math.round(c/2))],t.logger.log("live playlist, switching playlist, unknown, load middle frag : "+i.sn))}return i}},{key:"_findFragment",value:function(r){var c=r.start,i=r.fragPrevious,v=r.fragLen,s=r.fragments,o=r.bufferEnd,d=r.end,f=r.levelDetails,u=this.hls.config,e=void 0,a=void 0,n=u.maxFragLookUpTolerance;if(d>o?(o>d-n&&(n=0),a=g.default.search(s,function(e){return e.start+e.duration-n<=o?1:e.start-n>o&&e.start?-1:0})):a=s[v-1],a&&(e=a,c=a.start,i&&e.level===i.level&&e.sn===i.sn))if(e.snu.maxBufferHole&&i.dropped&&l?(e=s[l-1],t.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this"),i.loadCounter--):(e=s[l+1],t.logger.log("SN just loaded, load next one: "+e.sn))}else e=null;return e}},{key:"_loadFragmentOrKey",value:function(n){var a=n.frag,l=n.level,o=n.levelDetails,d=n.pos,h=n.bufferEnd,s=this.hls,f=s.config;if(null==a.decryptdata.uri||null!=a.decryptdata.key){if(t.logger.log("Loading "+a.sn+" of ["+o.startSN+" ,"+o.endSN+"],level "+l+", currentTime:"+d+",bufferEnd:"+h.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,a.loadCounter){a.loadCounter++;var u=f.fragLoadingLoopThreshold;if(a.loadCounter>u&&Math.abs(this.fragLoadIdx-a.loadIdx)=0;e--)if(t=r[e],i>=t.start&&i<=t.end)return t;return null}},{key:"followingBufferRange",value:function(e){return e?this.getBufferRange(e.end+.5):null}},{key:"isBuffered",value:function(r){var i=this.media;if(i)for(var t=i.buffered,e=0;e=t.start(e)&&r<=t.end(e))return!0;return!1}},{key:"_checkFragmentChanged",value:function(){var i,e,t=this.media;if(t&&t.readyState&&t.seeking===!1&&(e=t.currentTime,e>t.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=e),this.isBuffered(e)?i=this.getBufferRange(e):this.isBuffered(e+.1)&&(i=this.getBufferRange(e+.1)),i)){var a=i.frag;a!==this.fragPlaying&&(this.fragPlaying=a,this.hls.trigger(r.default.FRAG_CHANGED,{frag:a}))}}},{key:"immediateLevelSwitch",value:function(){if(t.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var i=this.media,a=void 0;i?(a=i.paused,i.pause()):a=!0,this.previouslyPaused=a}var n=this.fragCurrent;n&&n.loader&&n.loader.abort(),this.fragCurrent=null,this.state=e.PAUSED,this.hls.trigger(r.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY})}},{key:"immediateLevelSwitchEnd",value:function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,this.isBuffered(e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())}},{key:"nextLevelSwitch",value:function(){var t=this.media;if(t&&t.readyState){var n=void 0,a=void 0,i=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,a=this.getBufferRange(t.currentTime),a&&a.start>1&&(this.state=e.PAUSED,this.hls.trigger(r.default.BUFFER_FLUSHING,{startOffset:0,endOffset:a.start-1})),t.paused)n=0;else{var l=this.hls.nextLoadLevel,u=this.levels[l],o=this.fragLastKbps;n=o&&this.fragCurrent?this.fragCurrent.duration*u.bitrate/(1e3*o)+1:0}if(i=this.getBufferRange(t.currentTime+n),i&&(i=this.followingBufferRange(i))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.state=e.PAUSED,this.hls.trigger(r.default.BUFFER_FLUSHING,{startOffset:i.start,endOffset:Number.POSITIVE_INFINITY})}}}},{key:"onMediaAttached",value:function(r){var e=this.media=this.mediaBuffer=r.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),e.addEventListener("seeking",this.onvseeking),e.addEventListener("seeked",this.onvseeked),e.addEventListener("ended",this.onvended);var t=this.config;this.levels&&t.autoStartLoad&&this.hls.startLoad(t.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(t.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var r=this.levels;r&&r.forEach(function(e){e.details&&e.details.fragments.forEach(function(e){e.loadCounter=void 0})}),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){var a=this.media,i=a?a.currentTime:void 0;if(t.logger.log("media seeking to "+i),this.state===e.FRAG_LOADING){var o=s.default.bufferInfo(a,i,this.config.maxBufferHole),r=this.fragCurrent;if(0===o.len&&r){var n=this.config.maxFragLookUpTolerance,l=r.start-n,u=r.start+r.duration+n;l>i||i>u?(r.loader&&(t.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),r.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=e.IDLE):t.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===e.ENDED&&(this.state=e.IDLE);a&&(this.lastCurrentTime=i),this.state!==e.FRAG_LOADING&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold),this.tick()}},{key:"onMediaSeeked",value:function(){t.logger.log("media seeked to "+this.media.currentTime),this.tick()}},{key:"onMediaEnded",value:function(){t.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){t.logger.log("trigger BUFFER_RESET"),this.hls.trigger(r.default.BUFFER_RESET),this.bufferRange=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(r){var e,i=!1,a=!1;r.levels.forEach(function(t){e=t.audioCodec,e&&(-1!==e.indexOf("mp4a.40.2")&&(i=!0),-1!==e.indexOf("mp4a.40.5")&&(a=!0))}),this.audioCodecSwitch=i&&a,this.audioCodecSwitch&&t.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=r.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var n=this.config;n.autoStartLoad&&this.hls.startLoad(n.startPosition)}},{key:"onLevelLoaded",value:function(u){var i=u.details,s=u.level,d=this.levels[s],h=i.totalduration,n=0;if(t.logger.log("level "+s+" loaded ["+i.startSN+","+i.endSN+"],duration:"+h),this.levelLastLoaded=s,i.live){var l=d.details;l&&i.fragments.length>0?(o.default.mergeDetails(l,i),n=i.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(n,l),i.PTSKnown?t.logger.log("live playlist sliding:"+n.toFixed(3)):t.logger.log("live playlist - outdated PTS, unknown sliding")):(i.PTSKnown=!1,t.logger.log("live playlist - first load, unknown sliding"))}else i.PTSKnown=!1;if(d.details=i,this.hls.trigger(r.default.LEVEL_UPDATED,{details:i,level:s}),this.startFragRequested===!1){if(-1===this.startPosition||-1===this.lastCurrentTime){var a=i.startTimeOffset;isNaN(a)?i.live?(this.startPosition=this.computeLivePosition(n,i),t.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(0>a&&(t.logger.log("negative start time offset "+a+", count from end of last fragment"),a=n+h+a),t.logger.log("start time offset found in playlist, adjust startPosition to "+a),this.startPosition=a)}this.nextLoadPosition=this.startPosition}this.state===e.WAITING_LEVEL&&(this.state=e.IDLE),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===e.KEY_LOADING&&(this.state=e.IDLE,this.tick())}},{key:"onFragLoaded",value:function(l){var i=this.fragCurrent,s=l.frag;if(this.state===e.FRAG_LOADING&&i&&"main"===s.type&&s.level===i.level&&s.sn===i.sn){var o=l.stats;if(t.logger.log("Loaded "+i.sn+" of level "+i.level),this.fragBitrateTest=!1,s.bitrateTest===!0&&this.hls.nextLoadLevel)this.state=e.IDLE,this.startFragRequested=!1,o.tparsed=o.tbuffered=performance.now(),this.hls.trigger(r.default.FRAG_BUFFERED,{stats:o,frag:i,id:"main"}),this.tick();else{this.state=e.PARSING,this.stats=o;var d=this.levels[this.level],n=d.details,p=n.totalduration,g=void 0!==i.startDTS?i.startDTS:i.start,f=i.level,c=i.sn,a=this.config.defaultAudioCodec||d.audioCodec;this.audioCodecSwap&&(t.logger.log("swapping playlist audio codec"),void 0===a&&(a=this.lastAudioCodec),a&&(a=-1!==a.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingAppending=0,t.logger.log("Demuxing "+c+" of ["+n.startSN+" ,"+n.endSN+"],level "+f+", cc "+i.cc);var h=this.demuxer;h||(h=this.demuxer=new u.default(this.hls,"main"));var v=n.PTSKnown||!n.live;h.push(l.payload,a,d.videoCodec,g,i.cc,f,c,p,i.decryptdata,v)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(n){var u=this.fragCurrent;if(u&&"main"===n.id&&n.sn===u.sn&&n.level===u.level&&this.state===e.PARSING){var l,i,a=n.tracks;if(a.audio&&this.altAudio&&delete a.audio,i=a.audio){var s=this.levels[this.level].audioCodec,d=navigator.userAgent.toLowerCase();s&&this.audioCodecSwap&&(t.logger.log("swapping playlist audio codec"),s=-1!==s.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==i.metadata.channelCount&&-1===d.indexOf("firefox")&&(s="mp4a.40.5"),-1!==d.indexOf("android")&&(s="mp4a.40.2",t.logger.log("Android: force audio codec to"+s)),i.levelCodec=s,i.id=n.id}if(i=a.video,i&&(i.levelCodec=this.levels[this.level].videoCodec,i.id=n.id),n.unique){var o={codec:"",levelCodec:""};for(l in n.tracks)i=a[l],o.container=i.container,o.codec&&(o.codec+=",",o.levelCodec+=","),i.codec&&(o.codec+=i.codec),i.levelCodec&&(o.levelCodec+=i.levelCodec);a={audiovideo:o}}this.hls.trigger(r.default.BUFFER_CODECS,a);for(l in a){i=a[l],t.logger.log("main track:"+l+",container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var h=i.initSegment;h&&(this.pendingAppending++,this.hls.trigger(r.default.BUFFER_APPENDING,{type:l,data:h,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(i){var u=this,a=this.fragCurrent;if(a&&"main"===i.id&&i.sn===a.sn&&i.level===a.level&&("audio"!==i.type||"AUDIO"!==this.audioTrackType)&&this.state===e.PARSING){var s=this.levels[this.level],n=this.fragCurrent;t.logger.log("parsed "+i.type+",PTS:["+i.startPTS.toFixed(3)+","+i.endPTS.toFixed(3)+"],DTS:["+i.startDTS.toFixed(3)+"/"+i.endDTS.toFixed(3)+"],nb:"+i.nb+",dropped:"+(i.dropped||0));var d=o.default.updateFragPTSDTS(s.details,n.sn,i.startPTS,i.endPTS,i.startDTS,i.endDTS),l=this.hls;l.trigger(r.default.LEVEL_PTS_UPDATED,{details:s.details,level:this.level,drift:d}),"video"===i.type&&(n.dropped=i.dropped),[i.data1,i.data2].forEach(function(e){ +e&&(u.pendingAppending++,l.trigger(r.default.BUFFER_APPENDING,{type:i.type,data:e,parent:"main",content:"data"}))}),this.nextLoadPosition=i.endPTS,this.bufferRange.push({type:i.type,start:i.startPTS,end:i.endPTS,frag:n}),this.tick()}}},{key:"onFragParsed",value:function(t){var r=this.fragCurrent;r&&"main"===t.id&&t.sn===r.sn&&t.level===r.level&&this.state===e.PARSING&&(this.stats.tparsed=performance.now(),this.state=e.PARSED,this._checkAppendedParsed())}},{key:"onAudioTrackSwitch",value:function(a){var r=!!a.url;if(r)this.videoBuffer&&this.mediaBuffer!==this.videoBuffer&&(t.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=this.videoBuffer);else if(this.mediaBuffer!==this.media){t.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var i=this.fragCurrent;i.loader&&(t.logger.log("switching to main audio track, cancel main fragment load"),i.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=e.IDLE}this.altAudio=r}},{key:"onBufferCreated",value:function(o){var r=o.tracks,i=void 0,a=void 0,n=!1;for(var e in r){var s=r[e];"main"===s.id?(a=e,i=s,"video"===e&&(this.videoBuffer=r[e].buffer)):n=!0}n&&i?(t.logger.log("alternate track found, use "+a+".buffered to schedule main fragment loading"),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(t){if("main"===t.parent)switch(this.state){case e.PARSING:case e.PARSED:this.pendingAppending--,this._checkAppendedParsed()}}},{key:"_checkAppendedParsed",value:function(){if(this.state===e.PARSED&&0===this.pendingAppending){var a=this.fragCurrent,i=this.stats;if(a){this.fragPrevious=a,i.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*i.total/(i.tbuffered-i.tfirst)),this.hls.trigger(r.default.FRAG_BUFFERED,{stats:i,frag:a,id:"main"});var n=this.mediaBuffer?this.mediaBuffer:this.media;t.logger.log("main buffered : "+R.default.toString(n.buffered)),this.state=e.IDLE}this.tick()}}},{key:"onError",value:function(a){var n=a.frag||this.fragCurrent;if(!n||"main"===n.type){var o=this.media,l=o&&this.isBuffered(o.currentTime)&&this.isBuffered(o.currentTime+.4);switch(a.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:if(!a.fatal){var s=this.fragLoadError;s?s++:s=1;var u=this.config;if(s<=u.fragLoadingMaxRetry||l){this.fragLoadError=s,n.loadCounter=0;var d=Math.min(Math.pow(2,s-1)*u.fragLoadingRetryDelay,u.fragLoadingMaxRetryTimeout);t.logger.warn("mediaController: frag loading failed, retry in "+d+" ms"),this.retryDate=performance.now()+d,this.state=e.FRAG_LOADING_WAITING_RETRY}else t.logger.error("mediaController: "+a.details+" reaches max retry, redispatch as fatal ..."),a.fatal=!0,this.hls.trigger(r.default.ERROR,a),this.state=e.ERROR}break;case i.ErrorDetails.FRAG_LOOP_LOADING_ERROR:a.fatal||(l?(this._reduceMaxMaxBufferLength(n.duration),this.state=e.IDLE):n.autoLevel&&0!==n.level||(a.fatal=!0,this.hls.trigger(r.default.ERROR,a),this.state=e.ERROR));break;case i.ErrorDetails.LEVEL_LOAD_ERROR:case i.ErrorDetails.LEVEL_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.state!==e.ERROR&&(this.state=a.fatal?e.ERROR:e.IDLE,t.logger.warn("mediaController: "+a.details+" while loading frag,switch to "+this.state+" state ..."));break;case i.ErrorDetails.BUFFER_FULL_ERROR:this.state!==e.PARSING&&this.state!==e.PARSED||(l?(this._reduceMaxMaxBufferLength(n.duration),this.state=e.IDLE):(t.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.state=e.PAUSED,this.hls.trigger(r.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY})))}}}},{key:"_reduceMaxMaxBufferLength",value:function(r){var e=this.config;e.maxMaxBufferLength>=r&&(e.maxMaxBufferLength/=2,t.logger.warn("reduce max buffer length to "+e.maxMaxBufferLength+"s and switch to IDLE state"),this.fragLoadIdx+=2*e.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var e=this.media;if(e&&e.readyState){var n=e.currentTime,d=e.buffered;if(!this.loadedmetadata&&d.length){this.loadedmetadata=!0;var a=this.startPosition,h=this.isBuffered(a);n===a&&h||(t.logger.log("target start position:"+a),h||(a=d.start(0),t.logger.log("target start position not buffered, seek to buffered.start(0) "+a)),t.logger.log("adjust currentTime from "+n+" to "+a),e.currentTime=a)}else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var l=s.default.bufferInfo(e,n,0),g=!(e.paused||e.ended||0===e.buffered.length),u=.4,f=n>e.playbackRate*this.lastCurrentTime;if(this.stalled&&f&&(this.stalled=!1,t.logger.log("playback not stuck anymore @"+n)),g&&l.len<=u&&(f?(u=0,this.seekHoleNudgeDuration=0):this.stalled?this.seekHoleNudgeDuration+=this.config.seekHoleNudgeDuration:(this.seekHoleNudgeDuration=0,t.logger.log("playback seems stuck @"+n),this.hls.trigger(r.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1}),this.stalled=!0),l.len<=u)){var o=l.nextStart,c=o-n;if(o&&c0){t.logger.log("adjust currentTime from "+e.currentTime+" to next buffered @ "+o+" + nudge "+this.seekHoleNudgeDuration);var v=o+this.seekHoleNudgeDuration-e.currentTime;e.currentTime=o+this.seekHoleNudgeDuration,this.hls.trigger(r.default.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:v})}}}}}},{key:"onFragLoadEmergencyAborted",value:function(){this.state=e.IDLE,this.loadedmetadata||(this.startFragRequested=!1),this.tick()}},{key:"onBufferFlushed",value:function(){var t,r,i=[];for(r=0;r0;)e.removeCue(e.cues[0])}},{key:"getExistingTrack",value:function(i){var e=this.media;if(e)for(var t=0;tl;l++)t=e[a++],r=127&e[a++],i=127&e[a++],s=0!==(4&t),o=3&t,0===r&&0===i||s&&0===o&&(n.push(r),n.push(i));return n}}]),t}(a.default);i.default=u},{25:25,26:26,40:40}],13:[function(a,n,e){"use strict";function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function e(i,r){for(var t=0;te;e++)c[(a[e]=e<<1^283*(e>>7))^e]=e;for(i=r=0;!f[i];i^=u||1,r=c[r]||1)for(t=r^r<<1^r<<2^r<<3^r<<4,t=t>>8^255&t^99,f[i]=t,v[t]=i,d=a[h=a[u=a[i]]],l=16843009*d^65537*h^257*u^16843008*i,s=257*a[t]^16843008*t,e=0;4>e;e++)n[e][i]=s=s<<24^s>>>8,o[e][t]=l=l<<24^l>>>8;for(e=0;5>e;e++)n[e]=n[e].slice(0),o[e]=o[e].slice(0)}},{key:"decrypt",value:function(k,p,R,b,E,m){var f,g,v,n,e=this._key[1],t=k^e[0],i=b^e[1],a=R^e[2],r=p^e[3],y=e.length/4-2,s=4,o=this._tables[1],h=o[0],d=o[1],u=o[2],l=o[3],c=o[4];for(n=0;y>n;n++)f=h[t>>>24]^d[i>>16&255]^u[a>>8&255]^l[255&r]^e[s],g=h[i>>>24]^d[a>>16&255]^u[r>>8&255]^l[255&t]^e[s+1],v=h[a>>>24]^d[r>>16&255]^u[t>>8&255]^l[255&i]^e[s+2],r=h[r>>>24]^d[t>>16&255]^u[i>>8&255]^l[255&a]^e[s+3],s+=4,t=f,i=g,a=v;for(n=0;4>n;n++)E[(3&-n)+m]=c[t>>>24]<<24^c[i>>16&255]<<16^c[a>>8&255]<<8^c[255&r]^e[s++],f=t,t=i,i=a,a=r,r=f}}]),e}();e.default=i},{}],14:[function(t,l,e){"use strict";function r(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")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function e(i,r){for(var t=0;t>8|e>>>24}},{key:"doDecrypt",value:function(i,g,a){var u,f,o,h,l,c,d,n,e,r=new Int32Array(i.buffer,i.byteOffset,i.byteLength>>2),p=new s.default(Array.prototype.slice.call(g)),v=new Uint8Array(i.byteLength),t=new Int32Array(v.buffer);for(u=~~a[0],f=~~a[1],o=~~a[2],h=~~a[3],e=0;ee&&(255!==r[e]||240!==(240&r[e+1]));e++);for(i.audiosamplerate||(n=o.default.getAudioConfig(this.observer,r,e,b),i.config=n.config,i.audiosamplerate=n.samplerate,i.channelCount=n.channelCount,i.codec=n.codec,i.duration=_,t.logger.log("parsed codec:"+i.codec+",rate:"+n.samplerate+",nb channel:"+n.channelCount)),f=0,p=9216e4/i.audiosamplerate;u>e+5&&(l=1&r[e+1]?7:9,s=(3&r[e+3])<<11|r[e+4]<<3|(224&r[e+5])>>>5,s-=l,s>0&&u>=e+l+s);)for(c=v+f*p,m={unit:r.subarray(e+l,e+l+s),pts:c,dts:c},i.samples.push(m),i.len+=s,e+=s+l,f++;u-1>e&&(255!==r[e]||240!==(240&r[e+1]));e++);this.remuxer.remux(d,g,this._aacTrack,{samples:[]},{samples:[{pts:v,dts:v,unit:h.payload}]},{samples:[]},R,E,k)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(t){var e,r,i=new a.default(t);if(i.hasTimeStamp)for(e=i.length,r=t.length;r-1>e;e++)if(255===t[e]&&240===(240&t[e+1]))return!0;return!1}}]),e}();r.default=s},{17:17,22:22,43:43}],17:[function(e,o,t){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(i,r){for(var t=0;t>>6)+1,e=(60&u[l+2])>>>2,e>d.length-1?void f.trigger(Event.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,details:r.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+e}):(o=(1&u[l+2])<<2,o|=(192&u[l+3])>>>6,n.logger.log("manifest codec:"+a+",ADTS data:type:"+i+",sampleingIndex:"+e+"["+d[e]+"Hz],channelConfig:"+o),/firefox|OPR/i.test(h)?e>=6?(i=5,t=new Array(4),s=e-3):(i=2,t=new Array(2),s=e):-1!==h.indexOf("android")?(i=2,t=new Array(2),s=e):(i=5,t=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&e>=6?s=e-3:((a&&-1!==a.indexOf("mp4a.40.2")&&e>=6&&1===o||!a&&1===o)&&(i=2,t=new Array(2)),s=e)),t[0]=i<<3,t[0]|=(14&e)>>1,t[1]|=(1&e)<<7,t[1]|=o<<3,5===i&&(t[1]|=(14&s)>>1,t[2]=(1&s)<<7,t[2]|=8,t[3]=0),{config:t,samplerate:d[e],channelCount:o,codec:"mp4a.40."+i})}}]),e}();t.default=s},{24:24,43:43}],18:[function(e,y,i){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var f=function(){function e(i,r){for(var t=0;t1?r-1:0),e=1;r>e;e++)a[e-1]=arguments[e];t.emit.apply(t,[i,i].concat(a))},t.off=function(a){for(var r=arguments.length,i=Array(r>1?r-1:0),e=1;r>e;e++)i[e-1]=arguments[e];t.removeListener.apply(t,[a].concat(i))},r.addEventListener("message",function(a){var e=a.data;switch(e.cmd){case"init":var i=JSON.parse(e.config);r.demuxer=new n.default(t,e.id,e.typeSupported,i);try{(0,l.enableLogs)(i.debug)}catch(e){}break;case"demux":r.demuxer.push(new Uint8Array(e.data),e.audioCodec,e.videoCodec,e.timeOffset,e.cc,e.level,e.sn,e.duration,e.accurateTimeOffset)}});var i=function(e,t){r.postMessage({event:e,data:t})};t.on(e.default.FRAG_PARSING_INIT_SEGMENT,i),t.on(e.default.FRAG_PARSED,i),t.on(e.default.ERROR,i),t.on(e.default.FRAG_PARSING_METADATA,i),t.on(e.default.FRAG_PARSING_USERDATA,i),t.on(e.default.FRAG_PARSING_DATA,function(a,e){var t=e.data1.buffer,i=e.data2.buffer;delete e.data1,delete e.data2,r.postMessage({event:a,data:e,data1:t,data2:i},[t,i])})};i.default=o},{1:1,18:18,26:26,43:43}],20:[function(e,p,r){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var u=function(){function e(i,r){for(var t=0;t0&&null!=e&&null!=e.key&&"AES-128"===e.method){null==this.decrypter&&(this.decrypter=new v.default(this.hls));var d=this;this.decrypter.decrypt(t,e.key,e.iv,function(e){d.pushDecrypted(e,n,r,i,a,l,s,o,u)})}else this.pushDecrypted(t,n,r,i,a,l,s,o,u)}},{key:"onWorkerMessage",value:function(t){var e=t.data,r=this.hls;switch(e.event){case i.default.FRAG_PARSING_DATA:e.data.data1=new Uint8Array(e.data1),e.data.data2=new Uint8Array(e.data2);default:r.trigger(e.event,e.data)}}}]),t}();r.default=o},{15:15,18:18,19:19,2:2,24:24,26:26,43:43}],21:[function(t,s,e){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function e(i,r){for(var t=0;te?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&a.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),e=t-e,e>0&&this.bitsAvailable?r<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(a){var t,i,r=8,e=8;for(t=0;a>t;t++)0!==e&&(i=this.readEG(),e=(r+i+256)%256),r=0===e?r:e}},{key:"readSPS",value:function(){var t,g,p,l,a,n,i,o,r,s=0,d=0,h=0,f=0,c=1;if(this.readUByte(),t=this.readUByte(),g=this.readBits(5),this.skipBits(3),p=this.readUByte(),this.skipUEG(),100===t||110===t||122===t||244===t||44===t||83===t||86===t||118===t||128===t){var v=this.readUEG();if(3===v&&this.skipBits(1),this.skipUEG(),this.skipUEG(),this.skipBits(1),this.readBoolean())for(o=3!==v?8:12,r=0;o>r;r++)this.readBoolean()&&(6>r?this.skipScalingList(16):this.skipScalingList(64))}this.skipUEG();var u=this.readUEG();if(0===u)this.readUEG();else if(1===u)for(this.skipBits(1),this.skipEG(),this.skipEG(),l=this.readUEG(),r=0;l>r;r++)this.skipEG();if(this.skipUEG(),this.skipBits(1),a=this.readUEG(),n=this.readUEG(),i=this.readBits(1),0===i&&this.skipBits(1),this.skipBits(1),this.readBoolean()&&(s=this.readUEG(),d=this.readUEG(),h=this.readUEG(),f=this.readUEG()),this.readBoolean()&&this.readBoolean()){var e=void 0,y=this.readUByte();switch(y){case 1:e=[1,1];break;case 2:e=[12,11];break;case 3:e=[10,11];break;case 4:e=[16,11];break;case 5:e=[40,33];break;case 6:e=[24,11];break;case 7:e=[20,11];break;case 8:e=[32,11];break;case 9:e=[80,33];break;case 10:e=[18,11];break;case 11:e=[15,11];break;case 12:e=[64,33];break;case 13:e=[160,99];break;case 14:e=[4,3];break;case 15:e=[3,2];break;case 16:e=[2,1];break;case 255:e=[this.readUByte()<<8|this.readUByte(),this.readUByte()<<8|this.readUByte()]}e&&(c=e[0]/e[1])}return{width:Math.ceil((16*(a+1)-2*s-2*d)*c),height:(2-i)*(n+1)*16-(i?2:4)*(h+f)}}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}}]),e}();e.default=n},{43:43}],22:[function(r,s,t){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(i,r){for(var t=0;tr);return t}},{key:"_parseID3Frames",value:function(r,t,n){for(var a,s,o,l,i;n>=t+8;)switch(a=this.readUTF(r,t,4),t+=4,s=r[t++]<<24+r[t++]<<16+r[t++]<<8+r[t++],l=r[t++]<<8+r[t++],o=t,a){case"PRIV":if("com.apple.streaming.transportStreamTimestamp"===this.readUTF(r,t,44)){t+=44,t+=4;var u=1&r[t++];this._hasTimeStamp=!0,i=((r[t++]<<23)+(r[t++]<<15)+(r[t++]<<7)+r[t++])/45,u&&(i+=47721858.84),i=Math.round(i),e.logger.trace("ID3 timestamp found: "+i),this._timeStamp=i}}}},{key:"hasTimeStamp",get:function(){return this._hasTimeStamp}},{key:"timeStamp",get:function(){return this._timeStamp}},{key:"length",get:function(){return this._length}},{key:"payload",get:function(){return this._payload}}]),t}();t.default=n},{43:43}],23:[function(t,v,a){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var h=function(){function e(i,r){for(var t=0;tt;t+=188)if(71===i[t]){if(c=!!(64&i[t+1]),S=((31&i[t+1])<<8)+i[t+2],A=(48&i[t+3])>>4,A>1){if(a=t+5+i[t+4],a===t+188)continue}else a=t+4;switch(S){case R:if(c){if(u&&(s=f(u))&&(I(s,!1),P&&d.codec&&(-1===E||h.codec)))return void this.remux(v,p,i,k);u={data:[],size:0}}u&&(u.data.push(i.subarray(a,t+188)),u.size+=t+188-a);break;case E:if(c){if(o&&(s=f(o))&&(w(s),P&&h.codec&&(-1===R||d.codec)))return void this.remux(v,p,i,k);o={data:[],size:0}}o&&(o.data.push(i.subarray(a,t+188)),o.size+=t+188-a);break;case L:c&&(l&&(s=f(l))&&O(s),l={data:[],size:0}),l&&(l.data.push(i.subarray(a,t+188)),l.size+=t+188-a);break;case 0:c&&(a+=i[a]+1),D=this._pmtId=N(i,a);break;case D:c&&(a+=i[a]+1);var y=C(i,a);R=d.id=y.avc,E=h.id=y.aac,L=g.id=y.id3,b&&!T&&(e.logger.log("reparse from beginning"),b=!1,t=-188),T=this.pmtParsed=!0;break;case 17:case 8191:break;default:b=!0}}else this.observer.trigger(n.default.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,id:this.id,details:r.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});u&&(s=f(u))?(I(s,!0),d.pesData=null):d.pesData=u,o&&(s=f(o))?(w(s),h.pesData=null):(o&&o.size&&e.logger.log("last AAC PES packet truncated,might overlap between fragments"),h.pesData=o),l&&(s=f(l))?(O(s),g.pesData=null):g.pesData=l,this.remux(v,p,null,k)}},{key:"remux",value:function(r,i,a,n){var e=this._avcTrack,s=e.samples,t=s.reduce(function(t,r){var e=r.units.units.reduce(function(e,t){return{len:e.len+t.data.length,nbNalu:e.nbNalu+1}},{len:0,nbNalu:0});return r.length=e.len,{len:t.len+e.len,nbNalu:t.nbNalu+e.nbNalu}},{len:0,nbNalu:0});e.len=t.len,e.nbNalu=t.nbNalu,this.remuxer.remux(r,i,this._aacTrack,this._avcTrack,this._id3Track,this._txtTrack,n,this.contiguous,this.accurateTimeOffset,a)}},{key:"destroy",value:function(){this.switchLevel(),this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(e,t){return(31&e[t+10])<<8|e[t+11]}},{key:"_parsePMT",value:function(r,t){var n,s,o,a,i={aac:-1,avc:-1,id3:-1};for(n=(15&r[t+1])<<8|r[t+2],s=t+3+n-4,o=(15&r[t+10])<<8|r[t+11],t+=12+o;s>t;){switch(a=(31&r[t+1])<<8|r[t+2],r[t]){case 15:-1===i.aac&&(i.aac=a);break;case 21:-1===i.id3&&(i.id3=a);break;case 27:-1===i.avc&&(i.avc=a);break;case 36:e.logger.warn("HEVC stream type found, not supported for now");break;default:e.logger.log("unkown stream type:"+r[t])}t+=((15&r[t+3])<<8|r[t+4])+5}return i}},{key:"_parsePES",value:function(i){var e,d,f,a,u,l,s,n,r,c=0,t=i.data;if(!i||0===i.size)return null;for(;t[0].length<19&&t.length>1;){var h=new Uint8Array(t[0].length+t[1].length);h.set(t[0]),h.set(t[1],t[0].length),t[0]=h,t.splice(1,1)}if(e=t[0],f=(e[0]<<16)+(e[1]<<8)+e[2],1===f){if(a=(e[4]<<8)+e[5],a&&a!==i.size-6)return null;for(d=e[7],192&d&&(s=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,s>4294967295&&(s-=8589934592),64&d?(n=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,n>4294967295&&(n-=8589934592)):n=s),u=e[8],r=u+9,i.size-=r,l=new Uint8Array(i.size);t.length;){e=t.shift();var o=e.byteLength;if(r){if(r>o){r-=o;continue}e=e.subarray(r),o-=r,r=0}l.set(e,c),c+=o}return a&&(a-=u+3),{data:l,pts:s,dts:n,len:a}}return null}},{key:"pushAccesUnit",value:function(t,r){t.units.units.length&&(!this.config.forceKeyFrameOnDiscontinuity||t.key===!0||r.sps&&(r.samples.length||this.contiguous)?r.samples.push(t):r.dropped++),t.debug.length&&e.logger.log(t.pts+"/"+t.dts+":"+t.debug+","+t.units.length)}},{key:"_parseAVCPES",value:function(o,u){var t,a,r,n=this,i=this._avcTrack,d=this._parseAVCNALu(o.data),l=!1,e=this.avcSample;o.data=null,d.forEach(function(u){switch(u.type){case 1:a=!0,l&&e&&(e.debug+="NDR ");break;case 5:a=!0,e||(e=n.avcSample=n._createAVCSample(!0,o.pts,o.dts,"")),l&&(e.debug+="IDR "),e.key=!0;break;case 6:a=!0,l&&e&&(e.debug+="SEI "),t=new s.default(n.discardEPB(u.data)),t.readUByte();for(var v=0,h=0,m=!1,d=0;!m&&t.bytesAvailable>1;){v=0;do d=t.readUByte(),v+=d;while(255===d);h=0;do d=t.readUByte(),h+=d;while(255===d);if(4===v&&0!==t.bytesAvailable){m=!0;var A=t.readUByte();if(181===A){var T=t.readUShort();if(49===T){var k=t.readUInt();if(1195456820===k){var R=t.readUByte();if(3===R){var y=t.readUByte(),E=t.readUByte(),b=31&y,c=[y,E];for(r=0;b>r;r++)c.push(t.readUByte()),c.push(t.readUByte()),c.push(t.readUByte());n._insertSampleInOrder(n._txtTrack.samples,{type:3,pts:o.pts,bytes:c})}}}}}else if(hr;r++)t.readUByte()}break;case 7:if(a=!0,l&&e&&(e.debug+="SPS "),!i.sps){t=new s.default(u.data);var p=t.readSPS();i.width=p.width,i.height=p.height,i.sps=[u.data],i.duration=n._duration;var _=u.data.subarray(1,4),g="avc1.";for(r=0;3>r;r++){var f=_[r].toString(16);f.length<2&&(f="0"+f),g+=f}i.codec=g}break;case 8:a=!0,l&&e&&(e.debug+="PPS "),i.pps||(i.pps=[u.data]);break;case 9:a=!1,e&&n.pushAccesUnit(e,i),e=n.avcSample=n._createAVCSample(!1,o.pts,o.dts,l?"AUD ":"");break;case 12:a=!1;break;default:a=!1,e&&(e.debug+="unknown NAL "+u.type+" ")}if(e&&a){var S=e.units;S.units.push(u)}}),u&&e&&(this.pushAccesUnit(e,i),this.avcSample=null)}},{key:"_createAVCSample",value:function(e,t,r,i){return{key:e,pts:t,dts:r,units:{units:[],length:0},debug:i}}},{key:"_insertSampleInOrder",value:function(e,t){var i=e.length;if(i>0){if(t.pts>=e[i-1].pts)e.push(t);else for(var r=i-1;r>=0;r--)if(t.ptsi;)switch(a=r[i++],e){case 0:0===a&&(e=1);break;case 1:e=0===a?2:0;break;case 2:case 3:if(0===a)e=3;else if(1===a){if(n>=0)u={data:r.subarray(n,i-e-1),type:o},d.push(u);else{var t=this._getLastNalUnit();if(t&&(c&&4-c>=i&&t.state&&(t.data=t.data.subarray(0,t.data.byteLength-c)),l=i-e-1,l>0)){var v=new Uint8Array(t.data.byteLength+l);v.set(t.data,0),v.set(r.subarray(0,l),t.data.byteLength),t.data=v}}f>i?(g=31&r[i],n=i,o=g,e=0):e=-1}else e=0;break;case-1:n=0,o=31&a,e=0}if(n>=0&&e>=0&&(u={data:r.subarray(n,f),type:o,state:e},d.push(u)),0===d.length){var s=this._getLastNalUnit();if(s){var h=new Uint8Array(s.data.byteLength+r.byteLength);h.set(s.data,0),h.set(r,s.data.byteLength),s.data=h}}return p.naluState=e,d}},{key:"discardEPB",value:function(t){for(var a,n,s=t.byteLength,r=[],e=1;s-2>e;)0===t[e]&&0===t[e+1]&&3===t[e+2]?(r.push(e+2),e+=2):e++;if(0===r.length)return t;a=s-r.length,n=new Uint8Array(a);var i=0;for(e=0;a>e;i++,e++)i===r[0]&&(i++,r.shift()),n[e]=t[i];return n}},{key:"_parseAACPES",value:function(k){var o,u,p,y,t,d,h,s,R,a=this._aacTrack,i=k.data,f=k.pts,_=0,l=this.aacOverFlow,b=this.aacLastPTS;if(l){var E=new Uint8Array(l.byteLength+i.byteLength);E.set(l,0),E.set(i,l.byteLength),i=E}for(t=_,s=i.length;s-1>t&&(255!==i[t]||240!==(240&i[t+1]));t++);if(t){var v,g;if(s-1>t?(v="AAC PES did not start with ADTS header,offset:"+t,g=!1):(v="no ADTS header found in AAC PES",g=!0),e.logger.warn("parsing error:"+v),this.observer.trigger(n.default.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,id:this.id,details:r.ErrorDetails.FRAG_PARSING_ERROR,fatal:g,reason:v}),g)return}if(a.audiosamplerate||(o=c.default.getAudioConfig(this.observer,i,t,this.audioCodec),a.config=o.config,a.audiosamplerate=o.samplerate,a.channelCount=o.channelCount,a.codec=o.codec,a.duration=this._duration,e.logger.log("parsed codec:"+a.codec+",rate:"+o.samplerate+",nb channel:"+o.channelCount)),y=0,p=9216e4/a.audiosamplerate,l&&b){var m=b+p;Math.abs(m-f)>1&&(e.logger.log("AAC: align PTS for overlapping frames by "+Math.round((m-f)/90)),f=m)}for(;s>t+5&&(d=1&i[t+1]?7:9,u=(3&i[t+3])<<11|i[t+4]<<3|(224&i[t+5])>>>5,u-=d,u>0&&s>=t+d+u);)for(h=f+y*p,R={unit:i.subarray(t+d,t+d+u),pts:h,dts:h},a.samples.push(R),a.len+=u,t+=u+d,y++;s-1>t&&(255!==i[t]||240!==(240&i[t+1]));t++);l=s>t?i.subarray(t,s):null,this.aacOverFlow=l,this.aacLastPTS=h}},{key:"_parseID3PES",value:function(e){this._id3Track.samples.push(e)}}],[{key:"probe",value:function(e){return e.length>=564&&71===e[0]&&71===e[188]&&71===e[376]}}]),t}();a.default=o},{17:17,21:21,24:24,26:26,43:43}],24:[function(t,r,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",OTHER_ERROR:"otherError"},e.ErrorDetails={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOOP_LOADING_ERROR:"fragLoopLoadingError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",INTERNAL_EXCEPTION:"internalException"}},{}],25:[function(e,h,t){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},d=function(){function e(i,r){for(var t=0;t1?r-1:0),t=1;r>t;t++)i[t-1]=arguments[t];this.handledEvents=i,this.useGenericHandler=!0,this.registerListeners()}return d(e,[{key:"destroy",value:function(){this.unregisterListeners()}},{key:"isEventHandler",value:function(){return"object"===n(this.handledEvents)&&this.handledEvents.length&&"function"==typeof this.onEvent}},{key:"registerListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach(function(e){if("hlsEventGeneric"===e)throw new Error("Forbidden event name: "+e);this.hls.on(e,this.onEvent)}.bind(this))}},{key:"unregisterListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach(function(e){this.hls.off(e,this.onEvent)}.bind(this))}},{key:"onEvent",value:function(e,t){this.onEventGeneric(e,t)}},{key:"onEventGeneric",value:function(e,t){var i=function(t,r){var e="on"+t.replace("hls","");if("function"!=typeof this[e])throw new Error("Event "+t+" has no generic handler in this "+this.constructor.name+" class (tried "+e+")");return this[e].bind(this,r)};try{i.call(this,e,t).call()}catch(t){o.logger.error("internal error happened while processing "+e+":"+t.message),this.hls.trigger(s.default.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,err:t})}}}]),e}();t.default=l},{24:24,26:26,43:43}],26:[function(t,e,r){"use strict";e.exports={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",LEVEL_SWITCH:"hlsLevelSwitch",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCH:"hlsAudioTrackSwitch",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"}},{}],27:[function(a,n,e){"use strict";function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function e(i,r){for(var t=0;td&&(t[u-1].end=r[e].end):t.push(r[e])}else t.push(r[e])}for(e=0,o=0,l=a=i;e=n&&h>i)l=n,a=h,o=a-i;else if(n>i+s){f=n;break}}return{len:o,start:l,end:a,nextStart:f}}}]),e}();e.default=i},{}],29:[function(r,s,t){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(i,r){for(var t=0;tf)return void(i.PTSKnown=!1);for(var r=c;f>=r;r++){var s=h[u+r],n=l[r];n&&s&&(d=s.cc-n.cc,isNaN(s.startPTS)||(n.start=n.startPTS=s.startPTS,n.endPTS=s.endPTS,n.duration=s.duration,a=n))}if(d)for(e.logger.log("discontinuity sliding from playlist, take drift into account"),r=0;r=0&&ua.endSN)return 0;if(o=l-a.startSN,n=a.fragments,e=n[o],!isNaN(e.startPTS)){var h=Math.abs(e.startPTS-i);isNaN(e.deltaPTS)?e.deltaPTS=h:e.deltaPTS=Math.max(h,e.deltaPTS),i=Math.min(i,e.startPTS),s=Math.max(s,e.endPTS),d=Math.min(d,e.startDTS),u=Math.max(u,e.endDTS)}var f=i-e.start;for(e.start=e.startPTS=i,e.endPTS=s,e.startDTS=d,e.endDTS=u,e.duration=s-i,r=o;r>0;r--)t.updatePTS(n,r,r-1);for(r=o;ri?r.start=t.start+t.duration:r.start=t.start-r.duration:a>i?(t.duration=n-t.start,t.duration<0&&e.logger.error("negative duration computed for frag "+t.sn+",level "+t.level+", there should be some duration drift between playlist and fragment!")):(r.duration=t.start-n,r.duration<0&&e.logger.error("negative duration computed for frag "+r.sn+",level "+r.level+", there should be some duration drift between playlist and fragment!"))}}]),t}();t.default=n},{43:43}],30:[function(e,B,a){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var n=function(){function e(i,r){for(var t=0;t1?t-1:0),e=1;t>e;e++)a[e-1]=arguments[e];i.emit.apply(i,[r,r].concat(a))},i.off=function(a){for(var t=arguments.length,r=Array(t>1?t-1:0),e=1;t>e;e++)r[e-1]=arguments[e];i.removeListener.apply(i,[a].concat(r))},this.on=i.on.bind(i),this.off=i.off.bind(i),this.trigger=i.trigger.bind(i),this.playlistLoader=new d.default(this),this.fragmentLoader=new f.default(this),this.levelController=new T.default(this),this.abrController=new t.abrController(this),this.bufferController=new t.bufferController(this),this.capLevelController=new t.capLevelController(this),this.fpsController=new t.fpsController(this),this.streamController=new t.streamController(this),this.audioStreamController=new t.audioStreamController(this),this.timelineController=new t.timelineController(this),this.audioTrackController=new w.default(this),this.keyLoader=new F.default(this)}return n(e,null,[{key:"isSupported",value:function(){return window.MediaSource&&"function"==typeof window.MediaSource.isTypeSupported&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"version",get:function(){return"0.6.6"}},{key:"Events",get:function(){return i.default}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return e.defaultConfig||(e.defaultConfig={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,maxSeekHole:2,seekHoleNudgeDuration:.01,stalledInBufferedNudgeThreshold:10,maxFragLookUpTolerance:.2,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,fragLoadingLoopThreshold:3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:C.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,fetchSetup:void 0,abrController:v.default,bufferController:p.default,capLevelController:m.default,fpsController:D.default,streamController:k.default,audioStreamController:G.default,timelineController:S.default,cueHandler:b.default,enableCEA708Captions:!0,enableMP2TPassThrough:!1,stretchShortVideoTrack:!1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:5,abrEwmaSlowLive:9,abrEwmaFastVoD:4,abrEwmaSlowVoD:15,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.8,abrBandWidthUpFactor:.7,maxStarvationDelay:4}),e.defaultConfig},set:function(t){e.defaultConfig=t}}]),n(e,[{key:"destroy",value:function(){r.logger.log("destroy"),this.trigger(i.default.DESTROYING),this.detachMedia(),this.playlistLoader.destroy(),this.fragmentLoader.destroy(),this.levelController.destroy(),this.abrController.destroy(),this.bufferController.destroy(),this.capLevelController.destroy(),this.fpsController.destroy(),this.streamController.destroy(),this.audioStreamController.destroy(),this.timelineController.destroy(),this.audioTrackController.destroy(),this.keyLoader.destroy(),this.url=null,this.observer.removeAllListeners()}},{key:"attachMedia",value:function(e){r.logger.log("attachMedia"),this.media=e,this.trigger(i.default.MEDIA_ATTACHING,{media:e})}},{key:"detachMedia",value:function(){r.logger.log("detachMedia"),this.trigger(i.default.MEDIA_DETACHING),this.media=null}},{key:"loadSource",value:function(e){r.logger.log("loadSource:"+e),this.url=e,this.trigger(i.default.MANIFEST_LOADING,{url:e})}},{key:"startLoad",value:function(){var e=arguments.length<=0||void 0===arguments[0]?-1:arguments[0];r.logger.log("startLoad"),this.levelController.startLoad(),this.streamController.startLoad(e),this.audioStreamController.startLoad(e)}},{key:"stopLoad",value:function(){r.logger.log("stopLoad"),this.levelController.stopLoad(),this.streamController.stopLoad(),this.audioStreamController.stopLoad()}},{key:"swapAudioCodec",value:function(){r.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){r.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){r.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){r.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){r.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return this.levelController.firstLevel},set:function(e){r.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){r.logger.log("set startLevel:"+e),this.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this.abrController.autoLevelCapping},set:function(e){r.logger.log("set autoLevelCapping:"+e),this.abrController.autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"audioTracks",get:function(){return this.audioTrackController.audioTracks}},{key:"audioTrack",get:function(){return this.audioTrackController.audioTrack},set:function(e){this.audioTrackController.audioTrack=e}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}}]),e}();a.default=l},{1:1,10:10,11:11,12:12,24:24,26:26,3:3,32:32,33:33,34:34,4:4,41:41,43:43,47:47,5:5,6:6,7:7,9:9}],31:[function(e,t,r){"use strict";t.exports=e(30).default},{30:30}],32:[function(t,v,i){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var c=function(){function e(i,r){for(var t=0;te;e++)t[e]=r>>8*(15-e)&255;return t}},{key:"fragmentDecryptdataFromLevelkey",value:function(e,r){var t=e;return e&&e.method&&e.uri&&!e.iv&&(t=this.cloneObj(e),t.iv=this.createInitializationVector(r)),t}},{key:"avc1toavcoti",value:function(r){var e,t=r.split(".");return t.length>2?(e=t.shift()+".",e+=parseInt(t.shift()).toString(16),e+=("000"+parseInt(t.shift()).toString(16)).substr(-4)):e=r,e}},{key:"cloneObj",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"parseLevelPlaylist",value:function(P,f,L,S){var b,e,_,h=0,o=0,t={type:null,version:null,url:f,fragments:[],live:!0,startSN:0},i={method:null,key:null,iv:null,uri:null},m=0,g=null,r=null,l=null,v=null,c=null,u=null,s=[];for(_=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE):(\d+))|(?:#EXT-X-(TARGETDURATION):(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT(INF):(\d+(?:\.\d+)?)(?:,(.*))?)|(?:(?!#)()(\S.+))|(?:#EXT-X-(BYTERANGE):(\d+(?:@\d+(?:\.\d+)?)?)|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(PROGRAM-DATE-TIME):(.+))|(?:#EXT-X-(VERSION):(\d+))|(?:(#)(.*):(.*))|(?:(#)(.*)))(?:.*)\r?\n?/g;null!==(e=_.exec(P));)switch(e.shift(),e=e.filter(function(e){return void 0!==e}),e[0]){case"PLAYLIST-TYPE":t.type=e[1].toUpperCase();break;case"MEDIA-SEQUENCE":h=t.startSN=parseInt(e[1]);break;case"TARGETDURATION":t.targetduration=parseFloat(e[1]);break;case"VERSION":t.version=parseInt(e[1]);break;case"EXTM3U":break;case"ENDLIST":t.live=!1;break;case"DIS":m++,s.push(e);break;case"BYTERANGE":var p=e[1].split("@");u=1===p.length?c:parseInt(p[1]),c=parseInt(p[0])+u;break;case"INF":l=parseFloat(e[1]),v=e[2]?e[2]:null,s.push(e);break;case"":if(!isNaN(l)){var k=h++;b=this.fragmentDecryptdataFromLevelkey(i,k);var A=e[1]?this.resolve(e[1],f):null;r={url:A,type:S,duration:l,title:v,start:o,sn:k,level:L,cc:m,decryptdata:b,programDateTime:g,tagList:s},null!==u&&(r.byteRangeStartOffset=u,r.byteRangeEndOffset=c),t.fragments.push(r),o+=l,l=null,v=null,u=null,g=null,s=[]}break;case"KEY":var T=e[1],y=new n.default(T),d=y.enumeratedString("METHOD"),R=y.URI,D=y.hexadecimalInteger("IV");d&&(i={method:null,key:null,iv:null,uri:null},R&&"AES-128"===d&&(i.method=d,i.uri=this.resolve(R,f),i.key=null,i.iv=D));break;case"START":var O=e[1],w=new n.default(O),E=w.decimalFloatingPoint("TIME-OFFSET");isNaN(E)||(t.startTimeOffset=E);break;case"PROGRAM-DATE-TIME":g=new Date(Date.parse(e[1])),s.push(e);break;case"#":e.shift(),s.push(e);break;default:a.logger.warn("line parsed but not handled: "+e)}return r&&!r.url&&(t.fragments.pop(),o-=r.duration),t.totalduration=o,t.averagetargetduration=o/t.fragments.length,t.endSN=h-1,t}},{key:"loadsuccess",value:function(g,i,u){var s=g.data,r=g.url,c=u.type,f=u.id,v=u.level,n=this.hls;if(this.loaders[c]=void 0,void 0!==r&&0!==r.indexOf("data:")||(r=u.url),i.tload=performance.now(),0===s.indexOf("#EXTM3U"))if(s.indexOf("#EXTINF:")>0){var h="audioTrack"!==c,l=this.parseLevelPlaylist(s,r,(h?v:f)||0,h?"main":"audio");l.tload=i.tload,"manifest"===c&&n.trigger(t.default.MANIFEST_LOADED,{levels:[{url:r,details:l}],url:r,stats:i}),i.tparsed=performance.now(),h?n.trigger(t.default.LEVEL_LOADED,{details:l,level:v||0,id:f||0,stats:i}):n.trigger(t.default.AUDIO_TRACK_LOADED,{details:l,id:f,stats:i})}else{var o=this.parseMasterPlaylist(s,r);if(o.length){var d=this.parseMasterPlaylistMedia(s,r,"AUDIO");if(d.length){var p=!1;d.forEach(function(e){e.url||(p=!0)}),p===!1&&o[0].audioCodec&&!o[0].attrs.AUDIO&&(a.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),d.unshift({type:"main",name:"main"}))}n.trigger(t.default.MANIFEST_LOADED,{levels:o,audioTracks:d,url:r,stats:i})}else n.trigger(t.default.ERROR,{type:e.ErrorTypes.NETWORK_ERROR,details:e.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:r,reason:"no level found in manifest"})}else n.trigger(t.default.ERROR,{type:e.ErrorTypes.NETWORK_ERROR,details:e.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:r,reason:"no EXTM3U delimiter"})}},{key:"loaderror",value:function(s,r){var i,a,n=r.loader;switch(r.type){case"manifest":i=e.ErrorDetails.MANIFEST_LOAD_ERROR,a=!0;break;case"level":i=e.ErrorDetails.LEVEL_LOAD_ERROR,a=!1;break;case"audioTrack":i=e.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,a=!1}n&&(n.abort(),this.loaders[r.type]=void 0),this.hls.trigger(t.default.ERROR,{type:e.ErrorTypes.NETWORK_ERROR,details:i,fatal:a,url:n.url,loader:n,response:s,context:r})}},{key:"loadtimeout",value:function(s,r){var i,a,n=r.loader;switch(r.type){case"manifest":i=e.ErrorDetails.MANIFEST_LOAD_TIMEOUT,a=!0;break;case"level":i=e.ErrorDetails.LEVEL_LOAD_TIMEOUT,a=!1;break;case"audioTrack":i=e.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,a=!1}n&&(n.abort(),this.loaders[r.type]=void 0),this.hls.trigger(t.default.ERROR,{type:e.ErrorTypes.NETWORK_ERROR,details:i,fatal:a,url:n.url,loader:n,context:r})}}]),r}(s.default);o.default=y},{24:24,25:25,26:26,38:38,43:43,46:46}],35:[function(a,n,e){"use strict";function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function e(i,r){for(var t=0;t>24&255,t[1]=e>>16&255,t[2]=e>>8&255,t[3]=255&e,t.set(a,4),r=0,e=8;n>r;r++)t.set(i[r],e),e+=i[r].byteLength;return t}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}},{key:"mdhd",value:function(t,r){return r*=t,e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,r,i){return e.box(e.types.moof,e.mfhd(t),e.traf(i,r))}},{key:"moov",value:function(t){for(var r=t.length,i=[];r--;)i[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(i).concat(e.mvex(t)))}},{key:"mvex",value:function(r){for(var t=r.length,i=[];t--;)i[t]=e.trex(r[t]);return e.box.apply(null,[e.types.mvex].concat(i))}},{key:"mvhd",value:function(t,r){r*=t;var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,i)}},{key:"sdtp",value:function(n){var r,t,i=n.samples||[],a=new Uint8Array(4+i.length);for(t=0;t>>8&255),i.push(255&n),i=i.concat(Array.prototype.slice.call(a));for(r=0;r>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(a));var u=e.box(e.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|t.sps.length].concat(i).concat([t.pps.length]).concat(s))),o=t.width,l=t.height;return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,255&o,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))}},{key:"esds",value:function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))}},{key:"mp4a",value:function(t){var r=t.audiosamplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"stsd",value:function(t){return"audio"===t.type?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var r=t.id,i=t.duration*t.timescale,a=t.width,n=t.height;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,n>>8&255,255&n,0,0]))}},{key:"traf",value:function(i,t){var a=e.sdtp(i),r=i.id;return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),e.box(e.types.tfdt,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t])),e.trun(i,a.length+16+16+8+16+8+8),a)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(r){var t=r.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(f,o){var i,a,n,s,t,l,d=f.samples||[],r=d.length,h=12+16*r,u=new Uint8Array(h);for(o+=8+h,u.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,o>>>24&255,o>>>16&255,o>>>8&255,255&o],0),i=0;r>i;i++)a=d[i],n=a.duration,s=a.size,t=a.flags,l=a.cts,u.set([n>>>24&255,n>>>16&255,n>>>8&255,255&n,s>>>24&255,s>>>16&255,s>>>8&255,255&s,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,61440&t.degradPrio,15&t.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return e.box(e.types.trun,u)}},{key:"initSegment",value:function(i){e.types||e.init();var t,r=e.moov(i);return t=new Uint8Array(e.FTYP.byteLength+r.byteLength),t.set(e.FTYP),t.set(r,e.FTYP.byteLength),t}}]),e}();e.default=i},{}],36:[function(r,v,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(s,"__esModule",{value:!0});var l=function(){function e(i,r){for(var t=0;tMath.pow(2,32)&&!function(){var e=function r(t,e){return e?r(e,t%e):t};r.timescale=r.audiosamplerate/e(r.audiosamplerate,1024)}(),e.logger.log("audio mp4 timescale :"+r.timescale),l.audio={container:"audio/mp4",codec:r.codec,initSegment:i.default.initSegment([r]),metadata:{channelCount:r.channelCount}},u&&(n=s=v[0].pts-h*f)),a.sps&&a.pps&&d.length&&(a.timescale=this.MP4_TIMESCALE,l.video={container:"video/mp4",codec:a.codec,initSegment:i.default.initSegment([a]),metadata:{width:a.width,height:a.height}},u&&(n=Math.min(n,d[0].pts-h*f),s=Math.min(s,d[0].dts-h*f))),Object.keys(l).length?(c.trigger(t.default.FRAG_PARSING_INIT_SEGMENT,g),this.ISGenerated=!0,u&&(this._initPTS=n,this._initDTS=s)):c.trigger(t.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,id:this.id,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})}},{key:"remuxVideo",value:function(s,H,I,P){var a,g,N,f,l,V,k,E,m=8,v=this.PES_TIMESCALE,n=this.PES2MP4SCALEFACTOR,r=s.samples,p=[],L=r.reduce(function(t,e){return Math.max(Math.min(t,e.pts-e.dts),-18e3)},0);if(0>L){e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(L/90)+" ms to overcome this issue");for(var A=0;A1?e.logger.log("AVC:"+c+" ms hole between fragments detected,filling it"):-1>c&&e.logger.log("AVC:"+-c+" ms overlapping between fragments detected"),l=d,r[0].dts=l+this._initDTS,f=Math.max(f-c,d),r[0].pts=f+this._initDTS,e.logger.log("Video/PTS/DTS adjusted: "+Math.round(f/90)+"/"+Math.round(l/90)+",delta:"+c+" ms")),V=l,y=r[r.length-1],E=Math.max(this._PTSNormalize(y.dts-this._initDTS,d),0),k=Math.max(this._PTSNormalize(y.pts-this._initDTS,d),0),k=Math.max(k,E);var w=navigator.vendor,M=navigator.userAgent,O=w&&w.indexOf("Apple")>-1&&M&&!M.match("CriOS");O&&(a=Math.round((E-l)/(n*(r.length-1))));for(var _=0;_0?h-1:h].dts;if(D.stretchShortVideoTrack){var G=D.maxBufferHole,B=D.maxSeekHole,j=Math.floor(Math.min(G,B)*v),T=(P?f+P*v:this.nextAacPts)-o.pts;T>j?(a=T-b,0>a&&(a=b),e.logger.log("It is approximately "+T/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=b}else a=b}a/=n,S=Math.round((o.pts-o.dts)/n)}p.push({size:C,duration:a,cts:S,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:o.key?2:1,isNonSync:o.key?0:1}})}this.nextAvcDts=E+a*n;var K=s.dropped;if(s.len=0,s.nbNalu=0,s.dropped=0,p.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var x=p[0].flags;x.dependsOn=2,x.isNonSync=0}s.samples=p,N=i.default.moof(s.sequenceNumber++,l/n,s),s.samples=[];var F={id:this.id,level:this.level,sn:this.sn,data1:N,data2:g,startPTS:f/v,endPTS:(k+n*a)/v,startDTS:l/v,endDTS:this.nextAvcDts/v,type:"video",nb:p.length,dropped:K};return this.observer.trigger(t.default.FRAG_PARSING_DATA,F),F}},{key:"remuxAudio",value:function(r,M,O,K){var N,S,E,p,g,x,G,C,k,P,I,c,v,n,y,f=this.PES_TIMESCALE,V=r.timescale,R=f/V,H=1024*r.timescale/r.audiosamplerate,A=8,b=[],u=[];r.samples.sort(function(e,t){return e.pts-t.pts}),u=r.samples,O|=u.length&&this.nextAacPts&&Math.abs(M-this.nextAacPts/f)<.1;var d=O?this.nextAacPts:M*f,s=H*R,h=d;if(K)for(var l=0;l=m)e.logger.warn("Dropping 1 audio frame @ "+Math.round(h/90)/1e3+"s due to "+Math.round(Math.abs(m/90))+" ms overlap."),u.splice(l,1),r.len-=o.unit.length;else if(m>=s){var F=Math.round(m/s);e.logger.warn("Injecting "+F+" audio frame @ "+Math.round(h/90)/1e3+"s due to "+Math.round(m/90)+" ms gap.");for(var U=0;F>U;U++)y=h+this._initDTS,y=Math.max(y,this._initDTS),n=a.default.getSilentFrame(r.channelCount),n||(e.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),n=o.unit.slice(0)),u.splice(l,0,{unit:n,pts:y,dts:y}),r.len+=n.length,h+=s,l+=1;o.pts=o.dts=h+this._initDTS,h+=s,l+=1}else Math.abs(m)>.1*s,h+=s,0===l?o.pts=o.dts=this._initDTS+d:o.pts=o.dts=u[l-1].pts+s,l+=1}for(;u.length;){if(S=u.shift(),p=S.unit,P=S.pts-this._initDTS,I=S.dts-this._initDTS,void 0!==k)c=this._PTSNormalize(P,k),v=this._PTSNormalize(I,k),E.duration=Math.round((v-k)/R);else{c=this._PTSNormalize(P,d),v=this._PTSNormalize(I,d);var T=Math.round(1e3*(c-d)/f),_=0;if(O&&T){if(T>0)_=Math.round((c-d)/s),e.logger.log(T+" ms hole between AAC samples detected,filling it"),_>0&&(n=a.default.getSilentFrame(r.channelCount),n||(n=p.slice(0)),r.len+=_*n.length);else if(-12>T){e.logger.log(-T+" ms overlapping between AAC samples detected, drop frame"),r.len-=p.byteLength;continue}c=v=d}if(G=Math.max(0,c),C=Math.max(0,v),!(r.len>0))return;g=new Uint8Array(r.len+8),N=new DataView(g.buffer),N.setUint32(0,g.byteLength),g.set(i.default.types.mdat,4);for(var w=0;_>w;w++)y=c-(_-w)*s,n=a.default.getSilentFrame(r.channelCount),n||(e.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),n=p.slice(0)),g.set(n,A),A+=n.byteLength,E={size:n.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},b.push(E)}g.set(p,A),A+=p.byteLength,E={size:p.byteLength,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},b.push(E),k=v}var D=0,L=b.length;if(L>=2&&(D=b[L-2].duration,E.duration=D),L){this.nextAacPts=c+R*D,r.len=0,r.samples=b,x=i.default.moof(r.sequenceNumber++,C/R,r),r.samples=[];var B={id:this.id,level:this.level,sn:this.sn,data1:x,data2:g,startPTS:G/f,endPTS:this.nextAacPts/f,startDTS:C/f,endDTS:(v+R*D)/f,type:"audio",nb:L};return this.observer.trigger(t.default.FRAG_PARSING_DATA,B),B}return null}},{key:"remuxEmptyAudio",value:function(t,f,p,l){var i=this.PES_TIMESCALE,g=t.timescale?t.timescale:t.audiosamplerate,v=i/g,u=l.startDTS*i+this._initDTS,y=l.endDTS*i+this._initDTS,h=1024,d=v*h,c=Math.ceil((y-u)/d),n=a.default.getSilentFrame(t.channelCount);if(!n)return void e.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");for(var o=[],r=0;c>r;r++){var s=u+r*d;o.push({unit:n.slice(0),pts:s,dts:s}),t.len+=n.length}t.samples=o,this.remuxAudio(t,f,p)}},{key:"remuxID3",value:function(r,a){var e,n=r.samples.length;if(n){for(var i=0;n>i;i++)e=r.samples[i],e.pts=(e.pts-this._initPTS)/this.PES_TIMESCALE,e.dts=(e.dts-this._initDTS)/this.PES_TIMESCALE;this.observer.trigger(t.default.FRAG_PARSING_METADATA,{id:this.id,level:this.level,sn:this.sn,samples:r.samples})}r.samples=[],a=a}},{key:"remuxText",value:function(e,a){e.samples.sort(function(e,t){return e.pts-t.pts});var r,n=e.samples.length;if(n){for(var i=0;n>i;i++)r=e.samples[i],r.pts=(r.pts-this._initPTS)/this.PES_TIMESCALE;this.observer.trigger(t.default.FRAG_PARSING_USERDATA,{id:this.id,level:this.level,sn:this.sn,samples:e.samples})}e.samples=[],a=a}},{key:"_PTSNormalize",value:function(e,t){var r;if(void 0===t)return e;for(r=e>t?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=r;return e}},{key:"passthrough",get:function(){return!1}}]),r}();s.default=c},{24:24,26:26,27:27,35:35,43:43,44:44}],37:[function(r,l,e){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function e(i,r){for(var t=0;tNumber.MAX_SAFE_INTEGER?1/0:e}},{key:"hexadecimalInteger",value:function(r){if(this[r]){var e=(this[r]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var i=new Uint8Array(e.length/2),t=0;tNumber.MAX_SAFE_INTEGER?1/0:e}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"decimalResolution",value:function(t){var e=/^(\d+)x(\d+)$/.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}}],[{key:"parseAttrList",value:function(a){for(var t,n=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,r={};null!==(t=n.exec(a));){var e=t[2],i='"';0===e.indexOf(i)&&e.lastIndexOf(i)===e.length-1&&(e=e.slice(1,-1)),r[t[1]]=e}return r}}]),e}();e.default=i},{}],39:[function(r,e,i){"use strict";var t={search:function(a,s){for(var t=0,r=a.length-1,e=null,i=null;r>=t;){e=(t+r)/2|0,i=a[e];var n=s(i);if(n>0)t=e+1;else{if(!(0>n))return i;r=e-1}}return null}};e.exports=t},{}],40:[function(R,b,o){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(o,"__esModule",{value:!0});var n=function(){function e(i,r){for(var t=0;t=t}},i=function(t){for(var r=[],e=0;ee;e++)this.chars.push(new y);this.pos=0,this.currPenState=new h}return n(t,[{key:"equals",value:function(i){for(var t=!0,e=0;r>e;e++)if(!this.chars[e].equals(i.chars[e])){ +t=!1;break}return t}},{key:"copy",value:function(t){for(var e=0;r>e;e++)this.chars[e].copy(t.chars[e])}},{key:"isEmpty",value:function(){for(var t=!0,e=0;r>e;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t}},{key:"setCursor",value:function(t){this.pos!==t&&(this.pos=t),this.pos<0?(e.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>r&&(e.log("ERROR","Too large cursor position "+this.pos),this.pos=r)}},{key:"moveCursor",value:function(t){var r=this.pos+t;if(t>1)for(var e=this.pos+1;r+1>e;e++)this.chars[e].setPenState(this.currPenState);this.setCursor(r)}},{key:"backSpace",value:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}},{key:"insertChar",value:function(t){t>=144&&this.backSpace();var i=u(t);return this.pos>=r?void e.log("ERROR","Cannot insert "+t.toString(16)+" ("+i+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(i,this.currPenState),void this.moveCursor(1))}},{key:"clearFromPos",value:function(t){var e;for(e=t;r>e;e++)this.chars[e].reset()}},{key:"clear",value:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}},{key:"clearToEndOfRow",value:function(){this.clearFromPos(this.pos)}},{key:"getTextString",value:function(){for(var t=[],i=!0,e=0;r>e;e++){var a=this.chars[e].uchar;" "!==a&&(i=!1),t.push(a)}return i?"":t.join("")}},{key:"setPenStyles",value:function(e){this.currPenState.setStyles(e);var t=this.chars[this.pos];t.setPenState(this.currPenState)}}]),t}(),s=function(){function r(){a(this,r),this.rows=[];for(var e=0;t>e;e++)this.rows.push(new m);this.currRow=t-1,this.nrRollUpRows=null,this.reset()}return n(r,[{key:"reset",value:function(){for(var e=0;t>e;e++)this.rows[e].clear();this.currRow=t-1}},{key:"equals",value:function(i){for(var r=!0,e=0;t>e;e++)if(!this.rows[e].equals(i.rows[e])){r=!1;break}return r}},{key:"copy",value:function(r){for(var e=0;t>e;e++)this.rows[e].copy(r.rows[e])}},{key:"isEmpty",value:function(){for(var r=!0,e=0;t>e;e++)if(!this.rows[e].isEmpty()){r=!1;break}return r}},{key:"backSpace",value:function(){var e=this.rows[this.currRow];e.backSpace()}},{key:"clearToEndOfRow",value:function(){var e=this.rows[this.currRow];e.clearToEndOfRow()}},{key:"insertChar",value:function(e){var t=this.rows[this.currRow];t.insertChar(e)}},{key:"setPen",value:function(e){var t=this.rows[this.currRow];t.setPenStyles(e)}},{key:"moveCursor",value:function(e){var t=this.rows[this.currRow];t.moveCursor(e)}},{key:"setCursor",value:function(t){e.log("INFO","setCursor: "+t);var r=this.rows[this.currRow];r.setCursor(t)}},{key:"setPAC",value:function(t){e.log("INFO","pacData = "+JSON.stringify(t));var r=t.row-1;this.nrRollUpRows&&ri;i++){var a=this.rows[i].getTextString();a&&(s=i+1,r?e.push("Row "+s+": '"+a+"'"):e.push(a.trim()))}return e.length>0&&(n=r?"["+e.join(" | ")+"]":e.join("\n")),n}},{key:"getTextAndFormat",value:function(){return this.rows}}]),r}(),l=function(){function r(e,i){a(this,r),this.chNr=e,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new s,this.nonDisplayedMemory=new s,this.lastOutputScreen=new s,this.currRollUpRow=this.displayedMemory.rows[t-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return n(r,[{key:"reset",value:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[t-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null}},{key:"getHandler",value:function(){return this.outputFilter}},{key:"setHandler",value:function(e){this.outputFilter=e}},{key:"setPAC",value:function(e){this.writeScreen.setPAC(e)}},{key:"setBkgData",value:function(e){this.writeScreen.setBkgData(e)}},{key:"setMode",value:function(t){t!==this.mode&&(this.mode=t,e.log("INFO","MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)}},{key:"insertChars",value:function(r){for(var t=0;t=46,t.italics)t.foreground="white";else{var i=Math.floor(r/2)-16,a=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=a[i]}e.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}},{key:"outputDataUpdate",value:function(){var t=e.time;null!==t&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(t,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}]),r}(),p=function(){function t(i,e,r){a(this,t),this.field=i||1,this.outputs=[e,r],this.channels=[new l(1,e),new l(2,r)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return n(t,[{key:"getHandler",value:function(e){return this.channels[e].getHandler()}},{key:"setHandler",value:function(e,t){this.channels[e].setHandler(t)}},{key:"addData",value:function(l,s){var t,r,a,o=!1;this.lastTime=l,e.setTime(l);for(var n=0;n ("+i([r,a])+")"),t=this.parseCmd(r,a),t||(t=this.parseMidrow(r,a)),t||(t=this.parsePAC(r,a)),t||(t=this.parseBackgroundAttributes(r,a)),!t&&(o=this.parseChars(r,a)))if(this.currChNr&&this.currChNr>=0){var u=this.channels[this.currChNr-1];u.insertChars(o)}else e.log("WARNING","No channel found yet. TEXT-MODE?");t?this.dataCounters.cmd+=2:o?this.dataCounters.char+=2:(this.dataCounters.other+=2,e.log("WARNING","Couldn't parse cleaned data "+i([r,a])+" orig: "+i([s[n],s[n+1]])))}else this.dataCounters.padding+=2}},{key:"parseCmd",value:function(a,t){var n=null,s=(20===a||28===a)&&t>=32&&47>=t,o=(23===a||31===a)&&t>=33&&35>=t;if(!s&&!o)return!1;if(a===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,e.log("DEBUG","Repeated command ("+i([a,t])+") is dropped"),!0;n=20===a||23===a?1:2;var r=this.channels[n-1];return 20===a||28===a?32===t?r.ccRCL():33===t?r.ccBS():34===t?r.ccAOF():35===t?r.ccAON():36===t?r.ccDER():37===t?r.ccRU(2):38===t?r.ccRU(3):39===t?r.ccRU(4):40===t?r.ccFON():41===t?r.ccRDC():42===t?r.ccTR():43===t?r.ccRTD():44===t?r.ccEDM():45===t?r.ccCR():46===t?r.ccENM():47===t&&r.ccEOC():r.ccTO(t-32),this.lastCmdA=a,this.lastCmdB=t,this.currChNr=n,!0}},{key:"parseMidrow",value:function(t,r){var a=null;if((17===t||25===t)&&r>=32&&47>=r){if(a=17===t?1:2,a!==this.currChNr)return e.log("ERROR","Mismatch channel in midrow parsing"),!1;var n=this.channels[a-1];return n.ccMIDROW(r),e.log("DEBUG","MIDROW ("+i([t,r])+")"),!0}return!1}},{key:"parsePAC",value:function(e,t){var r=null,i=null,a=(e>=17&&23>=e||e>=25&&31>=e)&&t>=64&&127>=t,n=(16===e||24===e)&&t>=64&&95>=t;if(!a&&!n)return!1;if(e===this.lastCmdA&&t===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;r=23>=e?1:2,i=t>=64&&95>=t?1===r?v[e]:f[e]:1===r?g[e]:E[e];var s=this.interpretPAC(i,t),o=this.channels[r-1];return o.setPAC(s),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=r,!0}},{key:"interpretPAC",value:function(i,r){var e=r,t={color:null,italics:!1,indent:null,underline:!1,row:i};return e=r>95?r-96:r-64,t.underline=1===(1&e),13>=e?t.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(e/2)]:15>=e?(t.italics=!0,t.color="white"):t.indent=4*Math.floor((e-16)/2),t}},{key:"parseChars",value:function(t,r){var s=null,n=null,a=null;if(t>=25?(s=2,a=t-8):(s=1,a=t),a>=17&&19>=a){var o=r;o=17===a?r+80:18===a?r+112:r+144,e.log("INFO","Special char '"+u(o)+"' in channel "+s),n=[o]}else t>=32&&127>=t&&(n=0===r?[t]:[t,r]);if(n){var l=i(n);e.log("DEBUG","Char codes = "+l.join(",")),this.lastCmdA=null,this.lastCmdB=null}return n}},{key:"parseBackgroundAttributes",value:function(r,e){var t,i,a,n,s=(16===r||24===r)&&e>=32&&47>=e,o=(23===r||31===r)&&e>=45&&47>=e;return s||o?(t={},16===r||24===r?(i=Math.floor((e-32)/2),t.background=c[i],e%2===1&&(t.background=t.background+"_semi")):45===e?t.background="transparent":(t.foreground="black",47===e&&(t.underline=!0)),a=24>r?1:2,n=this.channels[a-1],n.setBkgData(t),this.lastCmdA=null,this.lastCmdB=null,!0):!1}},{key:"reset",value:function(){for(var e=0;e=16?r--:r++,navigator.userAgent.match(/Firefox\//)?t.line=e+1:t.line=e>7?e-2:e+1,t.align="left",t.position=100*(r/32)+(navigator.userAgent.match(/Firefox\//)?50:0),h.addCue(t)}}};e.exports=t},{}],42:[function(a,n,e){"use strict";function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function e(i,r){for(var t=0;t "+e}function n(t){var r=self.console[t];return r?function(){for(var n=arguments.length,e=Array(n),i=0;n>i;i++)e[i]=arguments[i];e[0]&&(e[0]=a(t,e[0])),r.apply(self.console,e)}:e}function s(r){for(var i=arguments.length,a=Array(i>1?i-1:0),e=1;i>e;e++)a[e-1]=arguments[e];a.forEach(function(e){t[e]=r[e]?r[e].bind(r):n(e)})}Object.defineProperty(r,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},i={trace:e,debug:e,log:e,warn:e,info:e,error:e},t=i;r.enableLogs=function(e){if(e===!0||"object"===("undefined"==typeof e?"undefined":o(e))){s(e,"debug","log","info","warn","error");try{t.log()}catch(e){t=i}}else t=i},r.logger=t},{}],44:[function(e,t,r){"use strict";"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(r,t){var i=new Uint8Array(this);void 0===t&&(t=i.length);for(var a=new ArrayBuffer(t-r),n=new Uint8Array(a),e=0;ee;e++)r+="["+t.start(e)+","+t.end(e)+"]";return r}}]),e}();e.default=i},{}],46:[function(r,t,i){"use strict";var e={buildAbsoluteURL:function(r,t){if(t=t.trim(),/^[a-z]+:/i.test(t))return t;var l=null,o=null,n=/^([^#]*)(.*)$/.exec(t);n&&(o=n[2],t=n[1]);var s=/^([^\?]*)(.*)$/.exec(t);s&&(l=s[2],t=s[1]);var h=/^([^#]*)(.*)$/.exec(r);h&&(r=h[1]);var u=/^([^\?]*)(.*)$/.exec(r);u&&(r=u[1]);var i=/^(([a-z]+:)?\/\/[a-z0-9\.\-_~]+(:[0-9]+)?)?(\/.*)$/i.exec(r);if(!i)throw new Error("Error trying to parse base URL.");var f=i[2]||"",d=i[1]||"",c=i[4],a=null;return a=/^\/\//.test(t)?f+"//"+e.buildAbsolutePath("",t.substring(2)):/^\//.test(t)?d+"/"+e.buildAbsolutePath("",t.substring(1)):e.buildAbsolutePath(d+c,t),l&&(a+=l),o&&(a+=o),a},buildAbsolutePath:function(n,s){for(var i,e,o=s,a="",t=n.replace(/[^\/]*$/,o.replace(/(\/|^)(?:\.?\/+)+/g,"$1")),r=0;e=t.indexOf("/../",r),e>-1;r=e+i)i=/^\/(?:\.\.\/)*/.exec(t.slice(e))[0].length,a=(a+t.substring(r,e)).replace(new RegExp("(?:\\/+[^\\/]*){0,"+(i-1)/3+"}$"),"/");return a+t.substr(r)}};t.exports=e},{}],47:[function(r,s,t){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(i,r){for(var t=0;t=2&&(0===t.tfirst&&(t.tfirst=Math.max(performance.now(),t.trequest),this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),s.timeout-(t.tfirst-t.trequest))),4===l))){var r=i.status;if(r>=200&&300>r){t.tload=Math.max(t.tfirst,performance.now());var n=void 0,o=void 0;"arraybuffer"===a.responseType?(n=i.response,o=n.byteLength):(n=i.responseText,o=n.length),t.loaded=t.total=o;var d={url:i.responseURL,data:n};this.callbacks.onSuccess(d,t,a)}else t.retry>=s.maxRetry||r>=400&&499>r?(e.logger.error(r+" while loading "+a.url),this.callbacks.onError({code:r,text:i.statusText},a)):(e.logger.warn(r+" while loading "+a.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),t.retry++)}}},{key:"loadtimeout",value:function(){e.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context)}},{key:"loadprogress",value:function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total);var r=this.callbacks.onProgress;r&&r(t,this.context,null)}}]),t}();t.default=n},{43:43}]},{},[31])(31)});