diff --git a/server/src/main/config/application.properties b/server/src/main/config/application.properties index 415e72c3..5678f067 100644 --- a/server/src/main/config/application.properties +++ b/server/src/main/config/application.properties @@ -91,7 +91,7 @@ ftp.control.encoding = ${KK_FTP_CONTROL_ENCODING:UTF-8} #视频设置 #多媒体类型,默认如下,可自定义添加 -media = ${KK_MEDIA:mp3,wav,mp4,flv} +media = ${KK_MEDIA:mp3,wav,mp4,flv,mpd,m3u8,ts,mpeg,3gp,m4a} #是否开启多媒体类型转视频格式转换,目前可转换视频格式有:avi,mov,wmv,3gp,rm #请谨慎开启此功能,建议异步调用添加到处理队列,并且增加任务队列处理线程,防止视频转换占用完线程资源,转换比较耗费时间,并且控制了只能串行处理转换任务 media.convert.disable = ${KK_MEDIA_CONVERT_DISABLE:false} diff --git a/server/src/main/java/cn/keking/model/FileType.java b/server/src/main/java/cn/keking/model/FileType.java index 9fb1c9f7..ac48be56 100644 --- a/server/src/main/java/cn/keking/model/FileType.java +++ b/server/src/main/java/cn/keking/model/FileType.java @@ -21,7 +21,6 @@ public enum FileType { MEDIA("mediaFilePreviewImpl"), MARKDOWN("markdownFilePreviewImpl"), XML("xmlFilePreviewImpl"), - FLV("flvFilePreviewImpl"), CAD("cadFilePreviewImpl"), TIFF("tiffFilePreviewImpl"), OFD("ofdFilePreviewImpl"), @@ -111,7 +110,6 @@ public enum FileType { } FILE_TYPE_MAPPER.put("md", FileType.MARKDOWN); FILE_TYPE_MAPPER.put("pdf", FileType.PDF); - FILE_TYPE_MAPPER.put("flv", FileType.FLV); FILE_TYPE_MAPPER.put("bpmn", FileType.BPMN); } diff --git a/server/src/main/java/cn/keking/service/FilePreview.java b/server/src/main/java/cn/keking/service/FilePreview.java index 71b08e3f..00d636e9 100644 --- a/server/src/main/java/cn/keking/service/FilePreview.java +++ b/server/src/main/java/cn/keking/service/FilePreview.java @@ -9,7 +9,6 @@ import org.springframework.ui.Model; */ public interface FilePreview { - String FLV_FILE_PREVIEW_PAGE = "flv"; String PDF_FILE_PREVIEW_PAGE = "pdf"; String PPT_FILE_PREVIEW_PAGE = "ppt"; String COMPRESS_FILE_PREVIEW_PAGE = "compress"; diff --git a/server/src/main/java/cn/keking/service/impl/FlvFilePreviewImpl.java b/server/src/main/java/cn/keking/service/impl/FlvFilePreviewImpl.java deleted file mode 100644 index 1e1950d8..00000000 --- a/server/src/main/java/cn/keking/service/impl/FlvFilePreviewImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.keking.service.impl; - -import cn.keking.model.FileAttribute; -import cn.keking.service.FilePreview; -import org.springframework.stereotype.Service; -import org.springframework.ui.Model; - -/** - * @author : kl - * create : 2020-12-27 2:50 下午 - * flv文件预览处理实现 - **/ -@Service -public class FlvFilePreviewImpl implements FilePreview { - - private final MediaFilePreviewImpl mediaFilePreview; - - public FlvFilePreviewImpl(MediaFilePreviewImpl mediaFilePreview) { - this.mediaFilePreview = mediaFilePreview; - } - - @Override - public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) { - mediaFilePreview.filePreviewHandle(url,model,fileAttribute); - return FLV_FILE_PREVIEW_PAGE; - } -} diff --git a/server/src/main/resources/static/ckplayer/css/ckplayer.css b/server/src/main/resources/static/ckplayer/css/ckplayer.css new file mode 100644 index 00000000..2c400437 --- /dev/null +++ b/server/src/main/resources/static/ckplayer/css/ckplayer.css @@ -0,0 +1,1609 @@ +.ckplayer-error{ + position: fixed; + z-index: 9999999; + left: 10px; + bottom: 10px; + width: auto; + height: 38px; + line-height: 38px; + padding: 0 .85rem; + background: rgb(0,0,0,.9); + border-radius: .25rem; + color: #FFF; + font-size: 14px; + white-space: nowrap; +} +.ckplayer-ckplayer{ + width: 100%; + height: 100%; + float: left; + background: #000; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main.ck-nocursor{ + cursor: none; +} +.ckplayer-ckplayer-smallwindow{ + position: fixed; + z-index: 9999999; + width: 420px; + max-width: 100%; + height: 266px; + right: 10px; + bottom: 10px; +} +.ckplayer-ckplayer .ck-main{ + width: 100%; + height: 100%; + overflow: hidden; + background: #000; + position: relative; +} +.ckplayer-ckplayer .ck-main .ck-video{ + width: 100%; + height: 100%; + overflow: hidden; + position:absolute; + z-index: 1; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-video video,.ckplayer-ckplayer .ck-main .ck-video canvas{ + width: 100%; + height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-error{ + width: 100%; + height: 80px; + line-height: 35px; + text-align: center; + color: #FFF; + position:absolute; + z-index: 70; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main .ck-logo{ + position:absolute; + right: 20px; + top:20px; + z-index: 400; +} +.ckplayer-ckplayer .ck-main .ck-loading{ + position:absolute; + top:0; + bottom: 0; + left: 0; + right: 0; + margin: auto; + z-index: 80; + width: 80px; + height: 80px; + border-radius: 50%; + background: url(images/loading.png) no-repeat center center; + background-size: 100% 100%; + animation: ck-Circle 1.5s linear infinite; + -webkit-animation: ck-Circle 1.5s linear infinite +} +.ckplayer-ckplayer .ck-main .ck-center-play{ + background: url(images/play.png) no-repeat 70% center; + background-size:60% 60%; + border: 8px solid rgba(255,255,255,.3); + border-radius: 50%; + box-sizing:border-box; + -moz-box-sizing:border-box; /* Firefox */ + -webkit-box-sizing:border-box; /* Safari */ + width: 80px; + height: 80px; + position: absolute; + display: none; + z-index: 90; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; + cursor: pointer; + transition: .2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-center-play{ + width: 100px; + height: 100px; +} +.ckplayer-ckplayer .ck-main .ck-center-play:hover{ + width: 100px; + height: 100px; + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-center-play:hover{ + width: 120px; + height: 120px; +} +.ckplayer-ckplayer .ck-main .ck-buffer{ + background: url(images/buffer.png) no-repeat center center; + background-size:100% 100%; + border-radius: 50%; + width: 60px; + height: 60px; + position: absolute; + z-index: 100; + top:0; + bottom: 0; + left: 0; + right: 0; + margin: auto; + display: none; + animation: ck-Circle 1s linear infinite; + -webkit-animation: ck-Circle 1s linear infinite +} +.ckplayer-ckplayer .ck-main .ck-message{ + position: absolute; + z-index: 240; + left:5px; + bottom: 78px; + padding: 0 1rem; + line-height: 30px; + height: 30px; + width: auto; + min-width: 1px; + border-radius: .25rem; + background: rgba(0,0,0,.6); + font-size: 14px; + color: #FFF; + display: none; + white-space:nowrap; +} +.ckplayer-ckplayer .ck-main .ck-message-right{ + left:auto; + right: 5px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-message{ + font-size: 18px; + bottom: 100px; +} +.ckplayer-ckplayer .ck-main .ck-tip{ + width: auto; + height: auto; + position: absolute; + z-index: 230; + display: none; + margin-bottom: 1px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-content{ + width: auto; + height: auto; + white-space: nowrap; + min-width: 1px; + background: rgba(0,0,0,.6); + font-size: 14px; + color: #FFF; + line-height: 32px; + height: 32px; + padding: 0 15px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-content-float-auto{ + border-radius: 5px; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-content-float-left{ + border-radius: 5px; + float: left; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-tip .ck-content{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-triangle{ + width: 0px; + height: 0px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-triangle-auto{ + border-left: 8px solid transparent; + border-top: 8px solid rgba(0, 0, 0,.6); + border-right: 8px solid transparent; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-triangle-left{ + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 8px solid rgba(0, 0, 0,.6); + float: left; + margin-top: 10px; +} +.ckplayer-ckplayer .ck-main .ck-preview{ + position: absolute; + z-index: 210; + width: 100%; + left:0; + bottom: 64px; + overflow: hidden; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-preview{ + bottom: 86px; +} +.ckplayer-ckplayer .ck-main .ck-preview-load-img{ + position: absolute; + z-index: 210; + top:110%; +} +.ckplayer-ckplayer .ck-main .ck-preview .ck-preview-bg{ + position: absolute; + z-index: 1; + top:0; + float: left; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-preview .ck-preview-bg .ck-preview-img{ + background-repeat: no-repeat ; + float: left; +} +.ckplayer-ckplayer .ck-main .ck-preview .ck-preview-frame{ + position: absolute; + z-index: 2; + top:0; + left:-1000px; + border:4px solid #0078ff; + box-sizing:content-box; + -moz-box-sizing:content-box; /* Firefox */ + -webkit-box-sizing:content-box; /* Safari */ +} +.ckplayer-ckplayer .ck-main .ck-prompt-words{ + position: absolute; + z-index: 220; + width: 213px; + line-height: 23px; + font-size: 14px; + color: #FFF; + background: rgba(0, 0, 0,.6); + overflow: hidden; + display: none; + margin-bottom: 10px; + border-radius: 3px; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .2s; + animation-duration: .2s; + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} +.ckplayer-ckplayer .ck-main .ck-prompt-words .ck-prompt-content{ + padding: 5px; +} +.ckplayer-ckplayer .ck-main .ck-layer{ + position: absolute; + z-index: 101; +} +.ckplayer-ckplayer .ck-main .ck-tempTime{ + position: absolute; + z-index: 20; + left:10px; + bottom: 5px; + display: none; + font-size: 14px; + line-height: 28px; + color: #FFF; +} +/*关于*/ +.ckplayer-ckplayer .ck-main .ck-about{ + position: absolute; + z-index: 200; + width: 50%; + max-width: 600px; + min-width: 400px; + left: 1rem; + top: 1rem; + background: rgba(0,0,0,.6); + padding: 1rem 0; + display: none; +} +.ckplayer-ckplayer .ck-main .ck-about ul{ + padding: 0; + margin: 0; +} +.ckplayer-ckplayer .ck-main .ck-about ul li{ + list-style:none; + color: #FFF; + font-size: 12px; + line-height: 18px; + height: 18px; + padding: 0; + margin: 0; +} +.ckplayer-ckplayer .ck-main .ck-about ul li .ck-about-title{ + width: 100px; + text-align: right; + float: left; + padding-right: .5rem; +} +.ckplayer-ckplayer .ck-main .ck-about ul li .ck-about-content{ + width: auto; + float: left; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar{ + position: absolute; + z-index: 1; + top: 0; + right: 0; + width: 96px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar{ + width: 140px; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-copy{ + background-position:-1632px 0; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-copy:hover{ + background-position:-1680px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-copy{ + background-position:-2380px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-copy:hover{ + background-position:-2450px 0; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-close{ + background-position:-1728px 0; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-close:hover{ + background-position:-1776px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-close{ + background-position:-2520px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-close:hover{ + background-position:-2590px 0; +} +/*截图显示容器*/ +.ckplayer-ckplayer .ck-main .ck-screenshot{ + position: absolute; + z-index: 220; + width: auto; + height: 144px; + margin: auto !important; + top: 0; + bottom: 0; + right: 55px; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-screenshot{ + height: 210px; + right: 77px; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-img{ + position: absolute; + z-index: 1; + width: 100%; + height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-img img{ + height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar{ + position: absolute; + z-index: 1; + width: 100%; + height: 36px; + bottom: 5px; + text-align: center; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-btn{ + display: inline-block; + overflow: hidden; + border: 0px solid transparent; + border-radius: 5px; + vertical-align: middle; + text-align: center; + text-decoration: none; + white-space: nowrap; + font-size: 14px; + line-height: 30px; + padding: 0px 15px; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: #fff; + margin: 0 5px; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-btn:hover{ + color: #FFFF00; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-btn:focus{ + outline:0; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-down{ + background-color: #007bff; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-close{ + background-color: #505050; + color: #fff; +} +/*广告*/ +.ckplayer-ckplayer .ck-main .ck-yytf{ + position: absolute; + z-index: 800; + width: 100%; + height: 100%; + left: 0px; + top: 0px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-front-link{ + width: 100%; + height: 100%; + display: none; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-front-picture{ + width: 100%; + height: 100%; + background: #000; + display: none; + text-align: center; + line-height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-front-picture img{ + max-width: 100%; + max-height: 100%; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top{ + position: absolute; + z-index: 3; + top: 10px; + right: 10px; +} + +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top div{ + float: right; + margin-left: 10px; + font-size: 14px; + border-radius: 15px; + background: rgba(0,0,0,.6); + padding: 0px 10px; + line-height: 30px; + height: 30px; + color: #FFF; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-top div{ + font-size: 18px; + border-radius: 20px; + line-height: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top .ck-yytf-closetime{ + display: none; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top .ck-yytf-closead{ + cursor: pointer; + display: none; +} + +/*显示广告时的底部内容*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom{ + position: absolute; + z-index: 3; + bottom: 10px; + right: 10px; +} +/*显示广告时的底部按钮-共用*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-btn{ + background-color: rgba(0,0,0,.6); + background-image: url(images/ckplayer.png); + background-size: auto 100%; + border: none; + outline: none; + width: 30px; + height: 30px; + cursor: pointer; + background-repeat: no-repeat; + border-radius: 50%; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-btn{ + width: 40px; + height: 40px; +} +/*显示广告时的静音按钮*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit{ + float: right; + width: 30px; + height: 30px; + margin-left: 10px; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit{ + width: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted{ + background-position:-180px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted:hover{ + background-position:-210px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted{ + background-position:-240px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted:hover{ + background-position:-270px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted{ + background-position:-240px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted:hover{ + background-position:-280px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted{ + background-position:-320px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted:hover{ + background-position:-360px 0; +} +/*显示广告时的全屏按钮*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit{ + float: right; + width: 30px; + height: 30px; + margin-left: 10px; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit{ + width: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full{ + background-position:-300px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full:hover{ + background-position:-330px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull{ + background-position:-360px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull:hover{ + background-position:-390px 0; +} + +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full{ + background-position:-400px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full:hover{ + background-position:-440px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull{ + background-position:-480px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull:hover{ + background-position:-520px 0; +} +/*广告查看详情按钮*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-details{ + float: right; + font-size: 14px; + border-radius: 15px; + background: rgba(0,0,0,.6); + padding: 0 10px; + color: #FFF; + line-height: 30px; + height: 30px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-details{ + font-size: 18px; + border-radius: 20px; + line-height: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-details a{ + color: #FFF; + text-decoration: none; +} +/*暂停广告容器*/ +.ckplayer-ckplayer .ck-main .ck-pause-yytf{ + display: none; + position:absolute; + z-index: 800; + max-width: 100%; + max-height: 100%; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-pause-yytf img{ + max-width: 100%; + max-height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-pause-close{ + position:absolute; + z-index: 1; + right: -15px; + top:-15px; + width: 30px; + height: 30px; + background-color: transparent; + background-image: url(images/adclose.png); + border: none; + outline: none; + cursor: pointer; + background-repeat: no-repeat ; +} +.ckplayer-ckplayer .ck-main .ck-pause-close:hover{ + background-position:-30px 0; +} +/*右键菜单*/ +.ckplayer-ckplayer-menu{ + width:120px; + background: rgba(50,50,50,.6); + position: absolute; + z-index: 9000; + font-size:14px ; + border: 1px #000 solid; + display: none; +} +.ckplayer-ckplayer-menu .ck-li{ + color: #adadad; + line-height: 35px; + padding: 0 0 0 5px; +} +.ckplayer-ckplayer-menu .ck-li a{ + color: #FFF; + text-decoration: none; +} +.ckplayer-ckplayer-menu .ck-underline{ + border-bottom: 1px #000 solid; +} +/*控制栏*/ +.ckplayer-ckplayer .ck-main .ck-bar{ + position:absolute; + z-index: 260; + left:0px; + bottom:0px; + width: 100%; + height: 48px; + background: rgba(0,0,0,.3); + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar{ + height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar.ck-bar-out{ + bottom: -50px; + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar.ck-bar-out{ + bottom: -80px; + transition: 0.2s; +} + +/*按钮公用样式*/ +.ckplayer-ckplayer .ck-main .ck-bar-btn{ + background-color: transparent; + background-image: url(images/ckplayer.48.png); + background-size: auto 100%; + border: none; + outline: none; + width: 48px; + height: 48px; + cursor: pointer; + background-repeat: no-repeat ; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar-btn{ + background-image: url(images/ckplayer.png); + width: 70px; + height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-btn:hover{ + background-size:auto 100%; +} + +/*播放暂停按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-play{ + background-position:0px top; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-play:hover{ + background-position:-48px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-play:hover{ + background-position:-70px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-pause{ + background-position:-96px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-pause{ + background-position:-140px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-pause:hover{ + background-position:-144px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-pause:hover{ + background-position:-210px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-refresh{ + background-position:-192px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-refresh{ + background-position:-280px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-refresh:hover{ + background-position:-240px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-refresh:hover{ + background-position:-350px 0; +} + +/*返回播放按钮*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-btn-backlive{ + float: left; + font-size: 16px; + line-height: 28px; + border-radius: 3px; + margin: 10px; + border: 0px; + background: rgba(3,60,146,.5); + color: #FFF; + cursor: pointer; + padding: 0 8px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-btn-backlive{ + font-size: 18px; + line-height: 36px; + margin: 17px 10px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-btn-backlive:hover{ + background: rgba(3,60,146,.9); +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-btn-backlive:focus{ + outline:0; + background: rgba(3,60,146,.6); +} +/*静音取消静音按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-muted{ + background-position:-288px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-muted{ + background-position:-420px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-muted:hover{ + background-position:-336px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-muted:hover{ + background-position:-490px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-exitmuted{ + background-position:-384px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-exitmuted{ + background-position:-560px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-exitmuted:hover{ + background-position:-432px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-exitmuted:hover{ + background-position:-630px 0; +} + +/*全屏按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit{ + float: right; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-full{ + background-position:-480px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-full{ + background-position:-700px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-full:hover{ + background-position:-528px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-full:hover{ + background-position:-770px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-exitfull{ + background-position:-672px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-exitfull{ + background-position:-840px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-exitfull:hover{ + background-position:-720px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-exitfull:hover{ + background-position:-910px 0; +} + +/*网页全屏按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit{ + float: right; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-webfull{ + background-position:-768px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-webfull{ + background-position:-1120px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-webfull:hover{ + background-position:-816px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-webfull:hover{ + background-position:-1190px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull{ + background-position:-864px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull{ + background-position:-1260px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull:hover{ + background-position:-912px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull:hover{ + background-position:-1330px 0; +} + +/*剧场模式按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit{ + float: right; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-theatre{ + background-position:-960px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-theatre{ + background-position:-1400px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-theatre:hover{ + background-position:-1008px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-theatre:hover{ + background-position:-1470px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre{ + background-position:-1056px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre{ + background-position:-1540px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre:hover{ + background-position:-1104px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre:hover{ + background-position:-1610px 0; +} +/*播放速度*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box{ + float: right; + height: 48px; + line-height: 48px; + position: relative; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playbackrate-box{ + height: 70px; + line-height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate{ + height: 100%; + padding: 0 10px; + white-space:nowrap; + font-size: 16px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate:hover{ + color: #0368d0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate-bg-box { + width: auto; + height: auto; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box:hover .ck-bar-playbackrate-bg-box { + display: block; +} +/*字幕*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box{ + float: right; + height: 48px; + line-height: 48px; + position: relative; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-track-box{ + height: 70px; + line-height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box .ck-bar-track{ + height: 100%; + padding: 0 10px; + white-space:nowrap; + font-size: 16px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-track-box .ck-bar-track{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box .ck-bar-track:hover{ + color: #0368d0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box .ck-bar-track-bg-box { + width: auto; + height: auto; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box:hover .ck-bar-track-bg-box { + display: block; +} +/*清晰度*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box{ + float: right; + height: 48px; + line-height: 48px; + position: relative; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-definition-box{ + height: 70px; + line-height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box .ck-bar-definition{ + height: 100%; + padding: 0 10px; + white-space:nowrap; + font-size: 16px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-definition-box .ck-bar-definition{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box .ck-bar-definition:hover{ + color: #0368d0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box .ck-bar-definition-bg-box { + width: auto; + height: auto; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box:hover .ck-bar-definition-bg-box { + display: block; +} +/*列表切换*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box { + background: rgba(0,0,0,.001); + position: absolute; + z-index: 1; + bottom: 46px; + display: none; + -webkit-animation-duration: .2s; + animation-duration: .2s; + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-list-bg-box { + bottom: 68px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg{ + background: rgba(0,0,0,.6); + float: left; + border-radius: 5px; + padding: 10px; + margin-bottom: 10px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p{ + width: 100%; + float: left; + line-height: 35px; + color: #FFF; + text-align: center; + font-size: 14px; + background-color: rgba(0,0,0,0); + border: 0px; + white-space:nowrap; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p:hover{ + color: #0368d0; + font-size: 16px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p:hover{ + font-size: 20px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p-focus{ + color: #0368d0; +} +/*下一集按钮*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-next{ + float: left; + background-position:-672px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-next{ + background-position:-980px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-next:hover{ + background-position:-720px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-next:hover{ + background-position:-1050px 0; +} +/*进度栏*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress{ + width: 100%; + position:absolute; + z-index: 1; + height: 12px; + top:-11px; + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg{ + width: 100%; + background: rgba(255,255,255,.3); + margin-top: 2px; + overflow: hidden; + height: 10px; + transition: .2s; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-load{ + float: left; + width: 0px; + background: rgba(169,169,169,.7); + height: 10px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-play{ + width: 0px; + background: #0368d0; + position: absolute; + z-index: 1; + height: 10px; + transition: .2s; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-mouseline{ + width: 3px; + background: rgba(255,255,255,.6); + position: absolute; + z-index: 2; + display: none; + height: 10px; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-prompt{ + background: #FFF; + position: absolute; + z-index: 3; + border-radius: 50%; + width: 10px; + height: 10px; + top:2px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-slider{ + border-radius: 50%; + overflow: hidden; + position: relative; + float: left; + z-index: 4; + left: 0px; + cursor: pointer; + width: 12px; + height: 12px; + top: -11px; + background: #FFF; + box-shadow: 0px 0px 0px 4px rgba(255,255,255,.5); +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-slider:hover{ + background: #0368d0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg:hover .ck-bar-progress-mouseline{ + display: block; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out{ + height: 2px; + top:-2px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-bg,.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-load,.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-bg .ck-bar-progress-play{ + height: 2px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-slider{ + width: 12px; + height: 2px; + top: -2px; + box-shadow: 0px 0px 0px 0px rgba(255,255,255,0); + background: rgba(255,255,255,0); + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-bg .ck-bar-progress-prompt{ + height: 2px; + border-radius: 0; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-slider-move .ck-bar-progress-play,.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-slider-move .ck-bar-progress-slider{ + transition: 0s; +} + +/*音量调节栏*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox{ + float: right; + width: 48px; + overflow-x: hidden; +} +/*音量调节栏*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox{ + width: 70px; +} +/*默认状态-音量调节总外框*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume{ + width: 48px; + height: 215px; + background: rgba(0,0,0,.01); + position: absolute; + z-index: 1; + bottom: 46px; + display: none; + overflow: hidden; +} +/*全屏状态-音量调节总外框*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-bar-volume{ + width: 70px; + bottom: 68px; +} +/*默认状态-音量调节总外框-鼠标经过时样式*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox:hover .ck-bar-volume{ + display: block; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .1s; + animation-duration: .1s; + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} +/*共用状态-音量调节内部外框*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volumex{ + width: 100%; + height: 200px; + float: left; + background: rgba(0,0,0,.8); + border-radius: 5px; +} +/*共用状态-音量调节顶部文字*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-txt{ + width: 100%; + height: 40px; + line-height: 40px; + color: #FFF; + text-align: center; + font-size: 1rem; + float: left; + overflow: hidden; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +/*共用状态-音量调节背景色*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-bg{ + width: 8px; + height: 140px; + background: #808080; + border-radius: 3px; + overflow: hidden; + cursor: pointer; + margin: auto; +} +/*共用状态-音量调节前景色*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-bg .ck-bar-volume-pp{ + width: 8px; + height: 140px; + background: #0368d0; + margin-top: 140px; +} +/*共用状态-音量调节拖动小按钮*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-slider{ + width: 10px; + height: 10px; + background: #FFF; + border-radius: 50%; + overflow: hidden; + box-shadow: 0px 0px 0px 8px rgba(255,255,255,.5); + position: absolute; + z-index: 1; + top: 0px; + left: 19px; + cursor: pointer; +} +/*全屏状态-音量调节拖动小按钮*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-slider{ + left: 30px; +} +/*默认状态-显示时间*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-time{ + float: left; + line-height: 48px; + font-size: 16px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +/*全屏状态-显示时间*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-time{ + float: left; + line-height: 70px; + font-size: 18px; + color: #FFF; +} +/*右侧控制栏*/ +.ckplayer-ckplayer .ck-main .ck-right-bar{ + position: absolute; + z-index: 260; + top: 0; + right: 2px; + bottom: 0; + margin: auto !important; + width: 48px; + height: 144px; + background: rgba(0,0,0,.3); + border-radius: 5px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-right-bar-hide{ + right: -48px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar{ + width: 70px; + height: 210px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar-hide{ + right: -70px; + transition: .2s; +} +/*截图按钮*/ +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-btn-screenshot{ + float: left; + background-position:-1536px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-btn-screenshot{ + background-position:-2240px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-btn-screenshot:hover{ + background-position:-1584px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-btn-screenshot:hover{ + background-position:-2310px 0; +} +/*小窗口按钮组*/ +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows button{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open{ + background-position:-1248px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open{ + background-position:-1820px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open:hover{ + background-position:-1296px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open:hover{ + background-position:-1890px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close{ + background-position:-1152px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close{ + background-position:-1680px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close:hover{ + background-position:-1200px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close:hover{ + background-position:-1750px 0; +} +/*循环按钮组*/ +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open{ + background-position:-1440px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open{ + background-position:-2100px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open:hover{ + background-position:-1488px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open:hover{ + background-position:-2170px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close{ + background-position:-1344px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close{ + background-position:-1960px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close:hover{ + background-position:-1392px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close:hover{ + background-position:-2030px 0; +} +/*顶部显示栏*/ +.ckplayer-ckplayer .ck-main .ck-top-bar{ + position: absolute; + z-index: 260; + top: -36px; + width: 100%; + height: 36px; + background: rgba(0,0,0,.3); + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-top-bar-hide{ + top: -36px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-top-bar{ + top: 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-top-bar-hide{ + top: -36px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom{ + position: absolute; + z-index: 260; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container{ + float: left; + margin-left: 10px; + margin-top: 9px; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left{ + float: left; + width: 20px; + height: 18px; + border: 1px solid #FFF; + box-sizing:content-box; + -moz-box-sizing:content-box; /* Firefox */ + -webkit-box-sizing:content-box; /* Safari */ +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container:hover .ck-top-bar-zoom-left, +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container.ck-top-bar-zoom-container-focus .ck-top-bar-zoom-left{ + border-color: #0368d0; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container:hover .ck-top-bar-zoom-left div, +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container.ck-top-bar-zoom-container-focus .ck-top-bar-zoom-left div{ + background: #0368d0; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-right{ + float: left; + font-size: 14px; + color: #FFF; + padding-left: 5px; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container:hover .ck-top-bar-zoom-right, +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container.ck-top-bar-zoom-container-focus .ck-top-bar-zoom-right{ + color: #0368d0; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left .ck-top-bar-zoom-button-50{ + width: 50%; + height: 50%; + background: #FFF; + margin: 4.5px 25%; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left .ck-top-bar-zoom-button-75{ + width: 75%; + height: 50%; + background: #FFF; + margin: 4.5px 12.5%; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left .ck-top-bar-zoom-button-100{ + width: 100%; + height: 50%; + background: #FFF; + margin: 4.5px 0; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-title{ + position: absolute; + z-index: 1; + top: 0px; + width: 100%; + height: 36px; + line-height: 36px; + text-align: center; + font-size: 18px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-time{ + float: right; + height: 36px; + line-height: 36px; + font-size: 14px; + color: #FFF; + padding: 0 1rem 0; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +/*以下为缓动效果样式*/ +.ck-animate { + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .3s; + animation-duration: .3s; +} +.ck-animate-bouncein { + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} + +@-webkit-keyframes ck-bounceIn { + 0% { + opacity: 0; + -webkit-transform: scale(.5); + transform: scale(.5) + } + 100% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } +} + +@keyframes ck-bounceIn { + 0% { + opacity: 0; + -webkit-transform: scale(.5); + -ms-transform: scale(.5); + transform: scale(.5); + } + 100% { + opacity: 1; + -webkit-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); + } +} +.ck-animate-bounceout { + -webkit-animation-name: ck-bounceOut; + animation-name: ck-bounceOut; +} + +@-webkit-keyframes ck-bounceOut { + 0% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } + 100% { + opacity: 0; + -webkit-transform: scale(.5); + transform: scale(.5); + } +} + +@keyframes ck-bounceOut { + 0% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } + 100% { + opacity: 0; + -webkit-transform: scale(.5); + transform: scale(.5); + } +} +.ck-animate-circle { + animation: ck-Circle 1s linear infinite; + -webkit-animation: ck-Circle 1s linear infinite +} + +@-webkit-keyframes ck-Circle { + 0% { + transform: rotate(0deg); + -webkit-transform: rotate(0deg); + -ms-transform: rotate(0deg) + } + 25% { + transform: rotate(90deg); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg) + } + 50% { + transform: rotate(180deg); + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg) + } + 75% { + transform: rotate(270deg); + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg) + } + 100% { + transform: rotate(360deg); + -webkit-transform: rotate(360deg); + -ms-transform: rotate(360deg) + } +} + +@keyframes ck-Circle { + 0% { + transform: rotate(0deg); + -webkit-transform: rotate(0deg); + -ms-transform: rotate(0deg) + } + 25% { + transform: rotate(90deg); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg) + } + 50% { + transform: rotate(180deg); + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg) + } + 75% { + transform: rotate(270deg); + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg) + } + 100% { + transform: rotate(360deg); + -webkit-transform: rotate(360deg); + -ms-transform: rotate(360deg) + } +} \ No newline at end of file diff --git a/server/src/main/resources/static/ckplayer/css/ckplayer.ixigua.css b/server/src/main/resources/static/ckplayer/css/ckplayer.ixigua.css new file mode 100644 index 00000000..31281d62 --- /dev/null +++ b/server/src/main/resources/static/ckplayer/css/ckplayer.ixigua.css @@ -0,0 +1,1707 @@ +.ckplayer-error{ + position: fixed; + z-index: 9999999; + left: 10px; + bottom: 10px; + width: auto; + height: 38px; + line-height: 38px; + padding: 0 .85rem; + background: rgb(0,0,0,.9); + border-radius: .25rem; + color: #FFF; + font-size: 14px; + white-space: nowrap; +} +.ckplayer-ckplayer{ + width: 100%; + height: 100%; + float: left; + background: #000; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main.ck-nocursor{ + cursor: none; +} +.ckplayer-ckplayer-smallwindow{ + position: fixed; + z-index: 9999999; + width: 420px; + max-width: 100%; + height: 266px; + right: 10px; + bottom: 10px; +} +.ckplayer-ckplayer .ck-main{ + width: 100%; + height: 100%; + overflow: hidden; + background: #000; + position: relative; +} +.ckplayer-ckplayer .ck-main .ck-video{ + width: 100%; + height: 100%; + overflow: hidden; + position:absolute; + z-index: 1; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-video video,.ckplayer-ckplayer .ck-main .ck-video canvas{ + width: 100%; + height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-error{ + width: 100%; + height: 80px; + line-height: 35px; + text-align: center; + color: #FFF; + position:absolute; + z-index: 70; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main .ck-logo{ + position:absolute; + right: 20px; + top:20px; + z-index: 400; +} +.ckplayer-ckplayer .ck-main .ck-loading{ + position:absolute; + top:0; + bottom: 0; + left: 0; + right: 0; + margin: auto; + z-index: 80; + width: 80px; + height: 80px; + border-radius: 50%; + background: url(images/loading.png) no-repeat center center; + background-size: 100% 100%; + animation: ck-Circle 1.5s linear infinite; + -webkit-animation: ck-Circle 1.5s linear infinite +} +.ckplayer-ckplayer .ck-main .ck-center-play{ + background: url(images/play.png) no-repeat 70% center; + background-size:60% 60%; + border: 8px solid rgba(255,255,255,.3); + border-radius: 50%; + box-sizing:border-box; + -moz-box-sizing:border-box; /* Firefox */ + -webkit-box-sizing:border-box; /* Safari */ + width: 80px; + height: 80px; + position: absolute; + display: none; + z-index: 90; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; + cursor: pointer; + transition: .2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-center-play{ + width: 100px; + height: 100px; +} +.ckplayer-ckplayer .ck-main .ck-center-play:hover{ + width: 100px; + height: 100px; + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-center-play:hover{ + width: 120px; + height: 120px; +} +.ckplayer-ckplayer .ck-main .ck-buffer{ + background: url(images/buffer.png) no-repeat center center; + background-size:100% 100%; + border-radius: 50%; + width: 60px; + height: 60px; + position: absolute; + z-index: 100; + top:0; + bottom: 0; + left: 0; + right: 0; + margin: auto; + display: none; + animation: ck-Circle 1s linear infinite; + -webkit-animation: ck-Circle 1s linear infinite +} +.ckplayer-ckplayer .ck-main .ck-message{ + position: absolute; + z-index: 240; + left:5px; + bottom: 78px; + padding: 0 1rem; + line-height: 30px; + height: 30px; + width: auto; + min-width: 1px; + border-radius: .25rem; + background: rgba(0,0,0,.6); + font-size: 14px; + color: #FFF; + display: none; + white-space:nowrap; +} +.ckplayer-ckplayer .ck-main .ck-message-right{ + left:auto; + right: 5px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-message{ + font-size: 18px; + bottom: 100px; +} +.ckplayer-ckplayer .ck-main .ck-tip{ + width: auto; + height: auto; + position: absolute; + z-index: 230; + display: none; + margin-bottom: 1px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-content{ + width: auto; + height: auto; + white-space: nowrap; + min-width: 1px; + background: rgba(0,0,0,.6); + font-size: 14px; + color: #FFF; + line-height: 32px; + height: 32px; + padding: 0 15px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-content-float-auto{ + border-radius: 5px; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-content-float-left{ + border-radius: 5px; + float: left; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-tip .ck-content{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-triangle{ + width: 0px; + height: 0px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-triangle-auto{ + border-left: 8px solid transparent; + border-top: 8px solid rgba(0, 0, 0,.6); + border-right: 8px solid transparent; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-triangle-left{ + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 8px solid rgba(0, 0, 0,.6); + float: left; + margin-top: 10px; +} +.ckplayer-ckplayer .ck-main .ck-preview{ + position: absolute; + z-index: 210; + width: 100%; + left:0; + bottom: 64px; + overflow: hidden; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-preview{ + bottom: 86px; +} +.ckplayer-ckplayer .ck-main .ck-preview-load-img{ + position: absolute; + z-index: 210; + top:110%; +} +.ckplayer-ckplayer .ck-main .ck-preview .ck-preview-bg{ + position: absolute; + z-index: 1; + top:0; + float: left; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-preview .ck-preview-bg .ck-preview-img{ + background-repeat: no-repeat ; + float: left; +} +.ckplayer-ckplayer .ck-main .ck-preview .ck-preview-frame{ + position: absolute; + z-index: 2; + top:0; + left:-1000px; + border:4px solid #0078ff; + box-sizing:content-box; + -moz-box-sizing:content-box; /* Firefox */ + -webkit-box-sizing:content-box; /* Safari */ +} +.ckplayer-ckplayer .ck-main .ck-prompt-words{ + position: absolute; + z-index: 220; + width: 213px; + line-height: 23px; + font-size: 14px; + color: #FFF; + background: rgba(0, 0, 0,.6); + overflow: hidden; + display: none; + margin-bottom: 10px; + border-radius: 3px; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .2s; + animation-duration: .2s; + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} +.ckplayer-ckplayer .ck-main .ck-prompt-words .ck-prompt-content{ + padding: 5px; +} +.ckplayer-ckplayer .ck-main .ck-layer{ + position: absolute; + z-index: 101; +} +.ckplayer-ckplayer .ck-main .ck-tempTime{ + position: absolute; + z-index: 20; + left:10px; + bottom: 5px; + display: none; + font-size: 14px; + line-height: 28px; + color: #FFF; +} +/*关于*/ +.ckplayer-ckplayer .ck-main .ck-about{ + position: absolute; + z-index: 200; + width: 50%; + max-width: 600px; + min-width: 400px; + left: 1rem; + top: 1rem; + background: rgba(0,0,0,.6); + padding: 1rem 0; + display: none; +} +.ckplayer-ckplayer .ck-main .ck-about ul{ + padding: 0; + margin: 0; +} +.ckplayer-ckplayer .ck-main .ck-about ul li{ + list-style:none; + color: #FFF; + font-size: 12px; + line-height: 18px; + height: 18px; + padding: 0; + margin: 0; +} +.ckplayer-ckplayer .ck-main .ck-about ul li .ck-about-title{ + width: 100px; + text-align: right; + float: left; + padding-right: .5rem; +} +.ckplayer-ckplayer .ck-main .ck-about ul li .ck-about-content{ + width: auto; + float: left; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar{ + position: absolute; + z-index: 1; + top: 0; + right: 0; + width: 96px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar{ + width: 140px; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-copy{ + background-position:-1632px 0; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-copy:hover{ + background-position:-1680px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-copy{ + background-position:-2380px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-copy:hover{ + background-position:-2450px 0; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-close{ + background-position:-1728px 0; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-close:hover{ + background-position:-1776px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-close{ + background-position:-2520px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-close:hover{ + background-position:-2590px 0; +} +/*截图显示容器*/ +.ckplayer-ckplayer .ck-main .ck-screenshot{ + position: absolute; + z-index: 220; + width: auto; + height: 144px; + margin: auto !important; + top: 0; + bottom: 0; + right: 55px; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-screenshot{ + height: 210px; + right: 77px; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-img{ + position: absolute; + z-index: 1; + width: 100%; + height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-img img{ + height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar{ + position: absolute; + z-index: 1; + width: 100%; + height: 36px; + bottom: 5px; + text-align: center; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-btn{ + display: inline-block; + overflow: hidden; + border: 0px solid transparent; + border-radius: 5px; + vertical-align: middle; + text-align: center; + text-decoration: none; + white-space: nowrap; + font-size: 14px; + line-height: 30px; + padding: 0px 15px; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: #fff; + margin: 0 5px; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-btn:hover{ + color: #FFFF00; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-btn:focus{ + outline:0; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-down{ + background-color: #007bff; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-close{ + background-color: #505050; + color: #fff; +} +/*广告*/ +.ckplayer-ckplayer .ck-main .ck-yytf{ + position: absolute; + z-index: 800; + width: 100%; + height: 100%; + left: 0px; + top: 0px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-front-link{ + width: 100%; + height: 100%; + display: none; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-front-picture{ + width: 100%; + height: 100%; + background: #000; + display: none; + text-align: center; + line-height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-front-picture img{ + max-width: 100%; + max-height: 100%; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top{ + position: absolute; + z-index: 3; + top: 10px; + right: 10px; +} + +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top div{ + float: right; + margin-left: 10px; + font-size: 14px; + border-radius: 15px; + background: rgba(0,0,0,.6); + padding: 0px 10px; + line-height: 30px; + height: 30px; + color: #FFF; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-top div{ + font-size: 18px; + border-radius: 20px; + line-height: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top .ck-yytf-closetime{ + display: none; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top .ck-yytf-closead{ + cursor: pointer; + display: none; +} + +/*显示广告时的底部内容*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom{ + position: absolute; + z-index: 3; + bottom: 10px; + right: 10px; +} +/*显示广告时的底部按钮-共用*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-btn{ + background-color: rgba(0,0,0,.6); + background-image: url(images/ckplayer_ixigua.png); + background-size: auto 100%; + border: none; + outline: none; + width: 30px; + height: 30px; + cursor: pointer; + background-repeat: no-repeat; + border-radius: 50%; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-btn{ + width: 40px; + height: 40px; +} +/*显示广告时的静音按钮*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit{ + float: right; + width: 30px; + height: 30px; + margin-left: 10px; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit{ + width: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted{ + background-position:-180px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted:hover{ + background-position:-210px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted{ + background-position:-240px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted:hover{ + background-position:-270px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted{ + background-position:-240px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted:hover{ + background-position:-280px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted{ + background-position:-320px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted:hover{ + background-position:-360px 0; +} +/*显示广告时的全屏按钮*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit{ + float: right; + width: 30px; + height: 30px; + margin-left: 10px; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit{ + width: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full{ + background-position:-300px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full:hover{ + background-position:-330px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull{ + background-position:-360px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull:hover{ + background-position:-390px 0; +} + +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full{ + background-position:-400px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full:hover{ + background-position:-440px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull{ + background-position:-480px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull:hover{ + background-position:-520px 0; +} +/*广告查看详情按钮*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-details{ + float: right; + font-size: 14px; + border-radius: 15px; + background: rgba(0,0,0,.6); + padding: 0 10px; + color: #FFF; + line-height: 30px; + height: 30px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-details{ + font-size: 18px; + border-radius: 20px; + line-height: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-details a{ + color: #FFF; + text-decoration: none; +} +/*暂停广告容器*/ +.ckplayer-ckplayer .ck-main .ck-pause-yytf{ + display: none; + position:absolute; + z-index: 800; + max-width: 100%; + max-height: 100%; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-pause-yytf img{ + max-width: 100%; + max-height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-pause-close{ + position:absolute; + z-index: 1; + right: -15px; + top:-15px; + width: 30px; + height: 30px; + background-color: transparent; + background-image: url(images/adclose.png); + border: none; + outline: none; + cursor: pointer; + background-repeat: no-repeat ; +} +.ckplayer-ckplayer .ck-main .ck-pause-close:hover{ + background-position:-30px 0; +} +/*右键菜单*/ +.ckplayer-ckplayer-menu{ + width:120px; + background: rgba(0,0,0,.8); + position: absolute; + z-index: 9000; + font-size:14px ; + border: 1px #000 solid; + display: none; + border-radius: 5px; +} +.ckplayer-ckplayer-menu .ck-li{ + color: #adadad; + line-height: 35px; + padding: 0 0 0 5px; +} +.ckplayer-ckplayer-menu .ck-li a{ + color: #FFF; + text-decoration: none; +} +.ckplayer-ckplayer-menu .ck-underline{ + border-bottom: 1px #000 solid; +} +/*控制栏*/ +.ckplayer-ckplayer .ck-main .ck-bar{ + position:absolute; + z-index: 260; + left:0px; + bottom:0px; + width: 100%; + height: 48px; + background: rgba(0,0,0,.3); + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar{ + height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar.ck-bar-out{ + bottom: -50px; + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar.ck-bar-out{ + bottom: -80px; + transition: 0.2s; +} + +/*按钮公用样式*/ +.ckplayer-ckplayer .ck-main .ck-bar-btn{ + background-color: transparent; + background-image: url(images/ckplayer_ixigua.48.png); + background-size: auto 100%; + border: none; + outline: none; + width: 48px; + height: 48px; + cursor: pointer; + background-repeat: no-repeat ; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar-btn{ + background-image: url(images/ckplayer_ixigua.png); + width: 70px; + height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-btn:hover{ + background-size:auto 100%; +} + +/*播放暂停按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-play{ + background-position:0px top; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-play:hover{ + background-position:-48px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-play:hover{ + background-position:-70px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-pause{ + background-position:-96px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-pause{ + background-position:-140px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-pause:hover{ + background-position:-144px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-pause:hover{ + background-position:-210px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-refresh{ + background-position:-192px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-refresh{ + background-position:-280px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-refresh:hover{ + background-position:-240px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-refresh:hover{ + background-position:-350px 0; +} + +/*返回播放按钮*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-btn-backlive{ + float: left; + font-size: 16px; + line-height: 28px; + border-radius: 3px; + margin: 10px; + border: 0px; + background: rgba(3,60,146,.5); + color: #FFF; + cursor: pointer; + padding: 0 8px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-btn-backlive{ + font-size: 18px; + line-height: 36px; + margin: 17px 10px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-btn-backlive:hover{ + background: rgba(3,60,146,.9); +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-btn-backlive:focus{ + outline:0; + background: rgba(3,60,146,.6); +} +/*静音取消静音按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-muted{ + background-position:-288px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-muted{ + background-position:-420px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-muted:hover{ + background-position:-336px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-muted:hover{ + background-position:-490px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-exitmuted{ + background-position:-384px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-exitmuted{ + background-position:-560px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-exitmuted:hover{ + background-position:-432px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-exitmuted:hover{ + background-position:-630px 0; +} + +/*全屏按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit{ + float: right; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-full{ + background-position:-480px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-full{ + background-position:-700px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-full:hover{ + background-position:-528px 0; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .5s; + animation-duration: .5s; + -webkit-animation-name: ck-button-hover; + animation-name: ck-button-hover; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-full:hover{ + background-position:-770px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-exitfull{ + background-position:-672px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-exitfull{ + background-position:-840px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-exitfull:hover{ + background-position:-720px 0; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .5s; + animation-duration: .5s; + -webkit-animation-name: ck-button-hover; + animation-name: ck-button-hover; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-exitfull:hover{ + background-position:-910px 0; +} + +/*网页全屏按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit{ + float: right; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-webfull{ + background-position:-768px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-webfull{ + background-position:-1120px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-webfull:hover{ + background-position:-816px 0; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .5s; + animation-duration: .5s; + -webkit-animation-name: ck-button-hover; + animation-name: ck-button-hover; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-webfull:hover{ + background-position:-1190px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull{ + background-position:-864px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull{ + background-position:-1260px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull:hover{ + background-position:-912px 0; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .5s; + animation-duration: .5s; + -webkit-animation-name: ck-button-hover; + animation-name: ck-button-hover; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull:hover{ + background-position:-1330px 0; +} + +/*剧场模式按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit{ + float: right; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-theatre{ + background-position:-960px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-theatre{ + background-position:-1400px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-theatre:hover{ + background-position:-1008px 0; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .5s; + animation-duration: .5s; + -webkit-animation-name: ck-button-hover-x; + animation-name: ck-button-hover-x; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-theatre:hover{ + background-position:-1470px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre{ + background-position:-1056px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre{ + background-position:-1540px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre:hover{ + background-position:-1104px 0; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .5s; + animation-duration: .5s; + -webkit-animation-name: ck-button-hover-x; + animation-name: ck-button-hover-x; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre:hover{ + background-position:-1610px 0; +} +/*播放速度*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box{ + float: right; + height: 48px; + line-height: 48px; + position: relative; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playbackrate-box{ + height: 70px; + line-height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate{ + height: 100%; + padding: 0 10px; + white-space:nowrap; + font-size: 16px; + color: #cfcccc; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate:hover{ + color: #FFF; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate-bg-box { + width: auto; + height: auto; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box:hover .ck-bar-playbackrate-bg-box { + display: block; +} +/*字幕*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box{ + float: right; + height: 48px; + line-height: 48px; + position: relative; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-track-box{ + height: 70px; + line-height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box .ck-bar-track{ + height: 100%; + padding: 0 10px; + white-space:nowrap; + font-size: 16px; + color: #cfcccc; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-track-box .ck-bar-track{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box .ck-bar-track:hover{ + color: #FFF; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box .ck-bar-track-bg-box { + width: auto; + height: auto; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box:hover .ck-bar-track-bg-box { + display: block; +} +/*清晰度*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box{ + float: right; + height: 48px; + line-height: 48px; + position: relative; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-definition-box{ + height: 70px; + line-height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box .ck-bar-definition{ + height: 100%; + padding: 0 10px; + white-space:nowrap; + font-size: 16px; + color: #cfcccc; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-definition-box .ck-bar-definition{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box .ck-bar-definition:hover{ + color: #FFF; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box .ck-bar-definition-bg-box { + width: auto; + height: auto; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box:hover .ck-bar-definition-bg-box { + display: block; +} +/*列表切换*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box { + background: rgba(0,0,0,.001); + position: absolute; + z-index: 1; + bottom: 46px; + display: none; + -webkit-animation-duration: .2s; + animation-duration: .2s; + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-list-bg-box { + bottom: 68px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg{ + background: rgba(0,0,0,.6); + float: left; + border-radius: 5px; + padding: 10px; + margin-bottom: 10px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p{ + width: 100%; + float: left; + line-height: 35px; + color: #cfcccc; + text-align: center; + font-size: 14px; + background-color: rgba(0,0,0,0); + border: 0px; + white-space:nowrap; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p:hover{ + color: #FFF; + font-size: 16px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p:hover{ + font-size: 20px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p-focus{ + color: #FF0302; +} +/*下一集按钮*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-next{ + float: left; + background-position:-672px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-next{ + background-position:-980px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-next:hover{ + background-position:-720px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-next:hover{ + background-position:-1050px 0; +} +/*进度栏*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress{ + width: 100%; + position:absolute; + z-index: 1; + height: 12px; + top:-11px; + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg{ + width: 100%; + background: rgba(255,255,255,.3); + margin-top: 2px; + overflow: hidden; + height: 10px; + transition: .2s; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-load{ + float: left; + width: 0px; + background: rgba(169,169,169,.7); + height: 10px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-play{ + width: 0px; + background: #e80101; + position: absolute; + z-index: 1; + height: 10px; + transition: .2s; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-mouseline{ + width: 3px; + background: rgba(255,255,255,.6); + position: absolute; + z-index: 2; + display: none; + height: 10px; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-prompt{ + background: #FFF; + position: absolute; + z-index: 3; + border-radius: 50%; + width: 10px; + height: 10px; + top:2px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-slider{ + border-radius: 50%; + overflow: hidden; + position: relative; + float: left; + z-index: 4; + left: 0px; + cursor: pointer; + width: 12px; + height: 12px; + top: -11px; + background: #FFF; + box-shadow: 0px 0px 0px 4px rgba(255,255,255,.5); +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-slider:hover{ + background: #e80101; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg:hover .ck-bar-progress-mouseline{ + display: block; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out{ + height: 2px; + top:-2px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-bg,.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-load,.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-bg .ck-bar-progress-play{ + height: 2px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-slider{ + width: 12px; + height: 2px; + top: -2px; + box-shadow: 0px 0px 0px 0px rgba(255,255,255,0); + background: rgba(232,1,1,0); + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-bg .ck-bar-progress-prompt{ + height: 2px; + border-radius: 0; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-slider-move .ck-bar-progress-play,.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-slider-move .ck-bar-progress-slider{ + transition: 0s; +} + +/*音量调节栏*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox{ + float: right; + width: 48px; + overflow-x: hidden; +} +/*音量调节栏*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox{ + width: 70px; +} +/*默认状态-音量调节总外框*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume{ + width: 48px; + height: 215px; + background: rgba(0,0,0,.01); + position: absolute; + z-index: 1; + bottom: 46px; + display: none; + overflow: hidden; +} +/*全屏状态-音量调节总外框*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-bar-volume{ + width: 70px; + bottom: 68px; +} +/*默认状态-音量调节总外框-鼠标经过时样式*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox:hover .ck-bar-volume{ + display: block; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .1s; + animation-duration: .1s; + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} +/*共用状态-音量调节内部外框*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volumex{ + width: 100%; + height: 200px; + float: left; + background: rgba(0,0,0,.8); + border-radius: 5px; +} +/*共用状态-音量调节顶部文字*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-txt{ + width: 100%; + height: 40px; + line-height: 40px; + color: #FFF; + text-align: center; + font-size: 1rem; + float: left; + overflow: hidden; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +/*共用状态-音量调节背景色*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-bg{ + width: 8px; + height: 140px; + background: #808080; + border-radius: 3px; + overflow: hidden; + cursor: pointer; + margin: auto; +} +/*共用状态-音量调节前景色*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-bg .ck-bar-volume-pp{ + width: 8px; + height: 140px; + background: #e80101; + margin-top: 140px; +} +/*共用状态-音量调节拖动小按钮*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-slider{ + width: 10px; + height: 10px; + background: #FFF; + border-radius: 50%; + overflow: hidden; + box-shadow: 0px 0px 0px 8px rgba(255,255,255,.5); + position: absolute; + z-index: 1; + top: 0px; + left: 19px; + cursor: pointer; +} +/*全屏状态-音量调节拖动小按钮*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-slider{ + left: 30px; +} +/*默认状态-显示时间*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-time{ + float: left; + line-height: 48px; + font-size: 16px; + color: #cfcccc; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +/*全屏状态-显示时间*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-time{ + float: left; + line-height: 70px; + font-size: 18px; + color: #cfcccc; +} +/*右侧控制栏*/ +.ckplayer-ckplayer .ck-main .ck-right-bar{ + position: absolute; + z-index: 260; + top: 0; + right: 2px; + bottom: 0; + margin: auto !important; + width: 48px; + height: 144px; + background: rgba(0,0,0,.3); + border-radius: 5px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-right-bar-hide{ + right: -48px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar{ + width: 70px; + height: 210px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar-hide{ + right: -70px; + transition: .2s; +} +/*截图按钮*/ +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-btn-screenshot{ + float: left; + background-position:-1536px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-btn-screenshot{ + background-position:-2240px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-btn-screenshot:hover{ + background-position:-1584px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-btn-screenshot:hover{ + background-position:-2310px 0; +} +/*小窗口按钮组*/ +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows button{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open{ + background-position:-1248px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open{ + background-position:-1820px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open:hover{ + background-position:-1296px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open:hover{ + background-position:-1890px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close{ + background-position:-1152px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close{ + background-position:-1680px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close:hover{ + background-position:-1200px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close:hover{ + background-position:-1750px 0; +} +/*循环按钮组*/ +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open{ + background-position:-1440px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open{ + background-position:-2100px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open:hover{ + background-position:-1488px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open:hover{ + background-position:-2170px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close{ + background-position:-1344px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close{ + background-position:-1960px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close:hover{ + background-position:-1392px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close:hover{ + background-position:-2030px 0; +} +/*顶部显示栏*/ +.ckplayer-ckplayer .ck-main .ck-top-bar{ + position: absolute; + z-index: 260; + top: -36px; + width: 100%; + height: 36px; + background: rgba(0,0,0,.3); + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-top-bar-hide{ + top: -36px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-top-bar{ + top: 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-top-bar-hide{ + top: -36px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom{ + position: absolute; + z-index: 260; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container{ + float: left; + margin-left: 10px; + margin-top: 9px; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left{ + float: left; + width: 20px; + height: 18px; + border: 1px solid #FFF; + box-sizing:content-box; + -moz-box-sizing:content-box; /* Firefox */ + -webkit-box-sizing:content-box; /* Safari */ +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container:hover .ck-top-bar-zoom-left, +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container.ck-top-bar-zoom-container-focus .ck-top-bar-zoom-left{ + border-color: #e80101; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container:hover .ck-top-bar-zoom-left div, +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container.ck-top-bar-zoom-container-focus .ck-top-bar-zoom-left div{ + background: #e80101; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-right{ + float: left; + font-size: 14px; + color: #FFF; + padding-left: 5px; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container:hover .ck-top-bar-zoom-right, +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container.ck-top-bar-zoom-container-focus .ck-top-bar-zoom-right{ + color: #e80101; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left .ck-top-bar-zoom-button-50{ + width: 50%; + height: 50%; + background: #FFF; + margin: 4.5px 25%; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left .ck-top-bar-zoom-button-75{ + width: 75%; + height: 50%; + background: #FFF; + margin: 4.5px 12.5%; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left .ck-top-bar-zoom-button-100{ + width: 100%; + height: 50%; + background: #FFF; + margin: 4.5px 0; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-title{ + position: absolute; + z-index: 1; + top: 0px; + width: 100%; + height: 36px; + line-height: 36px; + text-align: center; + font-size: 18px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-time{ + float: right; + height: 36px; + line-height: 36px; + font-size: 14px; + color: #FFF; + padding: 0 1rem 0; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +/*以下为缓动效果样式*/ +.ck-animate { + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .3s; + animation-duration: .3s; +} +.ck-animate-bouncein { + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} + +@-webkit-keyframes ck-bounceIn { + 0% { + opacity: 0; + -webkit-transform: scale(.5); + transform: scale(.5) + } + 100% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } +} + +@keyframes ck-bounceIn { + 0% { + opacity: 0; + -webkit-transform: scale(.5); + -ms-transform: scale(.5); + transform: scale(.5); + } + 100% { + opacity: 1; + -webkit-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); + } +} +.ck-animate-bounceout { + -webkit-animation-name: ck-bounceOut; + animation-name: ck-bounceOut; +} + +@-webkit-keyframes ck-bounceOut { + 0% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } + 100% { + opacity: 0; + -webkit-transform: scale(.5); + transform: scale(.5); + } +} + +@keyframes ck-bounceOut { + 0% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } + 100% { + opacity: 0; + -webkit-transform: scale(.5); + transform: scale(.5); + } +} + +.ck-animate-circle { + animation: ck-Circle 1s linear infinite; + -webkit-animation: ck-Circle 1s linear infinite +} + +@-webkit-keyframes ck-Circle { + 0% { + transform: rotate(0deg); + -webkit-transform: rotate(0deg); + -ms-transform: rotate(0deg) + } + 25% { + transform: rotate(90deg); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg) + } + 50% { + transform: rotate(180deg); + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg) + } + 75% { + transform: rotate(270deg); + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg) + } + 100% { + transform: rotate(360deg); + -webkit-transform: rotate(360deg); + -ms-transform: rotate(360deg) + } +} + +@keyframes ck-Circle { + 0% { + transform: rotate(0deg); + -webkit-transform: rotate(0deg); + -ms-transform: rotate(0deg) + } + 25% { + transform: rotate(90deg); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg) + } + 50% { + transform: rotate(180deg); + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg) + } + 75% { + transform: rotate(270deg); + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg) + } + 100% { + transform: rotate(360deg); + -webkit-transform: rotate(360deg); + -ms-transform: rotate(360deg) + } +} + +@-webkit-keyframes ck-button-hover { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + } + 50% { + -webkit-transform: scale(1.2); + transform: scale(1.2); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + } +} + +@keyframes ck-button-hover { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + } + 50% { + -webkit-transform: scale(1.2); + transform: scale(1.2); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + } +} + +@-webkit-keyframes ck-button-hover-x { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + } + 50% { + -webkit-transform: scale(1.2,1); + transform: scale(1.2,1); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + } +} + +@keyframes ck-button-hover-x { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + } + 50% { + -webkit-transform: scale(1.2,1); + transform: scale(1.2,1); + } + 100% { + -webkit-transform: scale(1); + transform: scale(1); + } +} \ No newline at end of file diff --git a/server/src/main/resources/static/ckplayer/css/ckplayer.red.css b/server/src/main/resources/static/ckplayer/css/ckplayer.red.css new file mode 100644 index 00000000..fc804e37 --- /dev/null +++ b/server/src/main/resources/static/ckplayer/css/ckplayer.red.css @@ -0,0 +1,1609 @@ +.ckplayer-error{ + position: fixed; + z-index: 9999999; + left: 10px; + bottom: 10px; + width: auto; + height: 38px; + line-height: 38px; + padding: 0 .85rem; + background: rgb(0,0,0,.9); + border-radius: .25rem; + color: #FFF; + font-size: 14px; + white-space: nowrap; +} +.ckplayer-ckplayer{ + width: 100%; + height: 100%; + float: left; + background: #000; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main.ck-nocursor{ + cursor: none; +} +.ckplayer-ckplayer-smallwindow{ + position: fixed; + z-index: 9999999; + width: 420px; + max-width: 100%; + height: 266px; + right: 10px; + bottom: 10px; +} +.ckplayer-ckplayer .ck-main{ + width: 100%; + height: 100%; + overflow: hidden; + background: #000; + position: relative; +} +.ckplayer-ckplayer .ck-main .ck-video{ + width: 100%; + height: 100%; + overflow: hidden; + position:absolute; + z-index: 1; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-video video,.ckplayer-ckplayer .ck-main .ck-video canvas{ + width: 100%; + height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-error{ + width: 100%; + height: 80px; + line-height: 35px; + text-align: center; + color: #FFF; + position:absolute; + z-index: 70; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main .ck-logo{ + position:absolute; + right: 20px; + top:20px; + z-index: 400; +} +.ckplayer-ckplayer .ck-main .ck-loading{ + position:absolute; + top:0; + bottom: 0; + left: 0; + right: 0; + margin: auto; + z-index: 80; + width: 80px; + height: 80px; + border-radius: 50%; + background: url(images/loading.png) no-repeat center center; + background-size: 100% 100%; + animation: ck-Circle 1.5s linear infinite; + -webkit-animation: ck-Circle 1.5s linear infinite +} +.ckplayer-ckplayer .ck-main .ck-center-play{ + background: url(images/play.png) no-repeat 70% center; + background-size:60% 60%; + border: 8px solid rgba(255,255,255,.3); + border-radius: 50%; + box-sizing:border-box; + -moz-box-sizing:border-box; /* Firefox */ + -webkit-box-sizing:border-box; /* Safari */ + width: 80px; + height: 80px; + position: absolute; + display: none; + z-index: 90; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; + cursor: pointer; + transition: .2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-center-play{ + width: 100px; + height: 100px; +} +.ckplayer-ckplayer .ck-main .ck-center-play:hover{ + width: 100px; + height: 100px; + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-center-play:hover{ + width: 120px; + height: 120px; +} +.ckplayer-ckplayer .ck-main .ck-buffer{ + background: url(images/buffer.png) no-repeat center center; + background-size:100% 100%; + border-radius: 50%; + width: 60px; + height: 60px; + position: absolute; + z-index: 100; + top:0; + bottom: 0; + left: 0; + right: 0; + margin: auto; + display: none; + animation: ck-Circle 1s linear infinite; + -webkit-animation: ck-Circle 1s linear infinite +} +.ckplayer-ckplayer .ck-main .ck-message{ + position: absolute; + z-index: 240; + left:5px; + bottom: 78px; + padding: 0 1rem; + line-height: 30px; + height: 30px; + width: auto; + min-width: 1px; + border-radius: .25rem; + background: rgba(0,0,0,.6); + font-size: 14px; + color: #FFF; + display: none; + white-space:nowrap; +} +.ckplayer-ckplayer .ck-main .ck-message-right{ + left:auto; + right: 5px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-message{ + font-size: 18px; + bottom: 100px; +} +.ckplayer-ckplayer .ck-main .ck-tip{ + width: auto; + height: auto; + position: absolute; + z-index: 230; + display: none; + margin-bottom: 1px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-content{ + width: auto; + height: auto; + white-space: nowrap; + min-width: 1px; + background: rgba(0,0,0,.6); + font-size: 14px; + color: #FFF; + line-height: 32px; + height: 32px; + padding: 0 15px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-content-float-auto{ + border-radius: 5px; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-content-float-left{ + border-radius: 5px; + float: left; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-tip .ck-content{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-triangle{ + width: 0px; + height: 0px; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-triangle-auto{ + border-left: 8px solid transparent; + border-top: 8px solid rgba(0, 0, 0,.6); + border-right: 8px solid transparent; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-tip .ck-triangle-left{ + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 8px solid rgba(0, 0, 0,.6); + float: left; + margin-top: 10px; +} +.ckplayer-ckplayer .ck-main .ck-preview{ + position: absolute; + z-index: 210; + width: 100%; + left:0; + bottom: 64px; + overflow: hidden; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-preview{ + bottom: 86px; +} +.ckplayer-ckplayer .ck-main .ck-preview-load-img{ + position: absolute; + z-index: 210; + top:110%; +} +.ckplayer-ckplayer .ck-main .ck-preview .ck-preview-bg{ + position: absolute; + z-index: 1; + top:0; + float: left; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-preview .ck-preview-bg .ck-preview-img{ + background-repeat: no-repeat ; + float: left; +} +.ckplayer-ckplayer .ck-main .ck-preview .ck-preview-frame{ + position: absolute; + z-index: 2; + top:0; + left:-1000px; + border:4px solid #0078ff; + box-sizing:content-box; + -moz-box-sizing:content-box; /* Firefox */ + -webkit-box-sizing:content-box; /* Safari */ +} +.ckplayer-ckplayer .ck-main .ck-prompt-words{ + position: absolute; + z-index: 220; + width: 213px; + line-height: 23px; + font-size: 14px; + color: #FFF; + background: rgba(0, 0, 0,.6); + overflow: hidden; + display: none; + margin-bottom: 10px; + border-radius: 3px; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .2s; + animation-duration: .2s; + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} +.ckplayer-ckplayer .ck-main .ck-prompt-words .ck-prompt-content{ + padding: 5px; +} +.ckplayer-ckplayer .ck-main .ck-layer{ + position: absolute; + z-index: 101; +} +.ckplayer-ckplayer .ck-main .ck-tempTime{ + position: absolute; + z-index: 20; + left:10px; + bottom: 5px; + display: none; + font-size: 14px; + line-height: 28px; + color: #FFF; +} +/*关于*/ +.ckplayer-ckplayer .ck-main .ck-about{ + position: absolute; + z-index: 200; + width: 50%; + max-width: 600px; + min-width: 400px; + left: 1rem; + top: 1rem; + background: rgba(0,0,0,.6); + padding: 1rem 0; + display: none; +} +.ckplayer-ckplayer .ck-main .ck-about ul{ + padding: 0; + margin: 0; +} +.ckplayer-ckplayer .ck-main .ck-about ul li{ + list-style:none; + color: #FFF; + font-size: 12px; + line-height: 18px; + height: 18px; + padding: 0; + margin: 0; +} +.ckplayer-ckplayer .ck-main .ck-about ul li .ck-about-title{ + width: 100px; + text-align: right; + float: left; + padding-right: .5rem; +} +.ckplayer-ckplayer .ck-main .ck-about ul li .ck-about-content{ + width: auto; + float: left; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar{ + position: absolute; + z-index: 1; + top: 0; + right: 0; + width: 96px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar{ + width: 140px; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-copy{ + background-position:-1632px 0; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-copy:hover{ + background-position:-1680px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-copy{ + background-position:-2380px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-copy:hover{ + background-position:-2450px 0; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-close{ + background-position:-1728px 0; +} +.ckplayer-ckplayer .ck-main .ck-about .ck-about-bar .ck-btn-about-close:hover{ + background-position:-1776px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-close{ + background-position:-2520px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-about .ck-about-bar .ck-btn-about-close:hover{ + background-position:-2590px 0; +} +/*截图显示容器*/ +.ckplayer-ckplayer .ck-main .ck-screenshot{ + position: absolute; + z-index: 220; + width: auto; + height: 144px; + margin: auto !important; + top: 0; + bottom: 0; + right: 55px; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-screenshot{ + height: 210px; + right: 77px; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-img{ + position: absolute; + z-index: 1; + width: 100%; + height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-img img{ + height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar{ + position: absolute; + z-index: 1; + width: 100%; + height: 36px; + bottom: 5px; + text-align: center; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-btn{ + display: inline-block; + overflow: hidden; + border: 0px solid transparent; + border-radius: 5px; + vertical-align: middle; + text-align: center; + text-decoration: none; + white-space: nowrap; + font-size: 14px; + line-height: 30px; + padding: 0px 15px; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: #fff; + margin: 0 5px; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-btn:hover{ + color: #FFFF00; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-btn:focus{ + outline:0; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-down{ + background-color: #007bff; +} +.ckplayer-ckplayer .ck-main .ck-screenshot .ck-screenshot-bar .ck-screenshot-close{ + background-color: #505050; + color: #fff; +} +/*广告*/ +.ckplayer-ckplayer .ck-main .ck-yytf{ + position: absolute; + z-index: 800; + width: 100%; + height: 100%; + left: 0px; + top: 0px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-front-link{ + width: 100%; + height: 100%; + display: none; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-front-picture{ + width: 100%; + height: 100%; + background: #000; + display: none; + text-align: center; + line-height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-front-picture img{ + max-width: 100%; + max-height: 100%; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top{ + position: absolute; + z-index: 3; + top: 10px; + right: 10px; +} + +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top div{ + float: right; + margin-left: 10px; + font-size: 14px; + border-radius: 15px; + background: rgba(0,0,0,.6); + padding: 0px 10px; + line-height: 30px; + height: 30px; + color: #FFF; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-top div{ + font-size: 18px; + border-radius: 20px; + line-height: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top .ck-yytf-closetime{ + display: none; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-top .ck-yytf-closead{ + cursor: pointer; + display: none; +} + +/*显示广告时的底部内容*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom{ + position: absolute; + z-index: 3; + bottom: 10px; + right: 10px; +} +/*显示广告时的底部按钮-共用*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-btn{ + background-color: rgba(0,0,0,.6); + background-image: url(images/ckplayer_red.png); + background-size: auto 100%; + border: none; + outline: none; + width: 30px; + height: 30px; + cursor: pointer; + background-repeat: no-repeat; + border-radius: 50%; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-btn{ + width: 40px; + height: 40px; +} +/*显示广告时的静音按钮*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit{ + float: right; + width: 30px; + height: 30px; + margin-left: 10px; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit{ + width: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted{ + background-position:-180px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted:hover{ + background-position:-210px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted{ + background-position:-240px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted:hover{ + background-position:-270px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted{ + background-position:-240px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-muted:hover{ + background-position:-280px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted{ + background-position:-320px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-mutedandexit .ck-yytf-mutedandexit-exitmuted:hover{ + background-position:-360px 0; +} +/*显示广告时的全屏按钮*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit{ + float: right; + width: 30px; + height: 30px; + margin-left: 10px; + overflow: hidden; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit{ + width: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full{ + background-position:-300px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full:hover{ + background-position:-330px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull{ + background-position:-360px 0; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull:hover{ + background-position:-390px 0; +} + +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full{ + background-position:-400px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-full:hover{ + background-position:-440px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull{ + background-position:-480px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-fullandexit .ck-yytf-fullandexit-exitfull:hover{ + background-position:-520px 0; +} +/*广告查看详情按钮*/ +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-details{ + float: right; + font-size: 14px; + border-radius: 15px; + background: rgba(0,0,0,.6); + padding: 0 10px; + color: #FFF; + line-height: 30px; + height: 30px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-yytf .ck-yytf-bottom .ck-yytf-details{ + font-size: 18px; + border-radius: 20px; + line-height: 40px; + height: 40px; +} +.ckplayer-ckplayer .ck-main .ck-yytf .ck-yytf-bottom .ck-yytf-details a{ + color: #FFF; + text-decoration: none; +} +/*暂停广告容器*/ +.ckplayer-ckplayer .ck-main .ck-pause-yytf{ + display: none; + position:absolute; + z-index: 800; + max-width: 100%; + max-height: 100%; + top: 0; + left: 0; + right: 0; + bottom: 0; + margin: auto; +} +.ckplayer-ckplayer .ck-main .ck-pause-yytf img{ + max-width: 100%; + max-height: 100%; +} +.ckplayer-ckplayer .ck-main .ck-pause-close{ + position:absolute; + z-index: 1; + right: -15px; + top:-15px; + width: 30px; + height: 30px; + background-color: transparent; + background-image: url(images/adclose.png); + border: none; + outline: none; + cursor: pointer; + background-repeat: no-repeat ; +} +.ckplayer-ckplayer .ck-main .ck-pause-close:hover{ + background-position:-30px 0; +} +/*右键菜单*/ +.ckplayer-ckplayer-menu{ + width:120px; + background: rgba(50,50,50,.6); + position: absolute; + z-index: 9000; + font-size:14px ; + border: 1px #000 solid; + display: none; +} +.ckplayer-ckplayer-menu .ck-li{ + color: #adadad; + line-height: 35px; + padding: 0 0 0 5px; +} +.ckplayer-ckplayer-menu .ck-li a{ + color: #FFF; + text-decoration: none; +} +.ckplayer-ckplayer-menu .ck-underline{ + border-bottom: 1px #000 solid; +} +/*控制栏*/ +.ckplayer-ckplayer .ck-main .ck-bar{ + position:absolute; + z-index: 260; + left:0px; + bottom:0px; + width: 100%; + height: 48px; + background: rgba(0,0,0,.3); + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar{ + height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar.ck-bar-out{ + bottom: -50px; + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar.ck-bar-out{ + bottom: -80px; + transition: 0.2s; +} + +/*按钮公用样式*/ +.ckplayer-ckplayer .ck-main .ck-bar-btn{ + background-color: transparent; + background-image: url(images/ckplayer_red.48.png); + background-size: auto 100%; + border: none; + outline: none; + width: 48px; + height: 48px; + cursor: pointer; + background-repeat: no-repeat ; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar-btn{ + background-image: url(images/ckplayer_red.png); + width: 70px; + height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-btn:hover{ + background-size:auto 100%; +} + +/*播放暂停按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-play{ + background-position:0px top; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-play:hover{ + background-position:-48px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-play:hover{ + background-position:-70px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-pause{ + background-position:-96px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-pause{ + background-position:-140px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-pause:hover{ + background-position:-144px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-pause:hover{ + background-position:-210px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-refresh{ + background-position:-192px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-refresh{ + background-position:-280px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playandpause .ck-btn-refresh:hover{ + background-position:-240px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playandpause .ck-btn-refresh:hover{ + background-position:-350px 0; +} + +/*返回播放按钮*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-btn-backlive{ + float: left; + font-size: 16px; + line-height: 28px; + border-radius: 3px; + margin: 10px; + border: 0px; + background: rgba(3,60,146,.5); + color: #FFF; + cursor: pointer; + padding: 0 8px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-btn-backlive{ + font-size: 18px; + line-height: 36px; + margin: 17px 10px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-btn-backlive:hover{ + background: rgba(3,60,146,.9); +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-btn-backlive:focus{ + outline:0; + background: rgba(3,60,146,.6); +} +/*静音取消静音按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-muted{ + background-position:-288px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-muted{ + background-position:-420px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-muted:hover{ + background-position:-336px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-muted:hover{ + background-position:-490px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-exitmuted{ + background-position:-384px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-exitmuted{ + background-position:-560px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-btn-exitmuted:hover{ + background-position:-432px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-btn-exitmuted:hover{ + background-position:-630px 0; +} + +/*全屏按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit{ + float: right; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-full{ + background-position:-480px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-full{ + background-position:-700px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-full:hover{ + background-position:-528px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-full:hover{ + background-position:-770px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-exitfull{ + background-position:-672px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-exitfull{ + background-position:-840px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-fullandexit .ck-btn-exitfull:hover{ + background-position:-720px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-fullandexit .ck-btn-exitfull:hover{ + background-position:-910px 0; +} + +/*网页全屏按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit{ + float: right; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-webfull{ + background-position:-768px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-webfull{ + background-position:-1120px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-webfull:hover{ + background-position:-816px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-webfull:hover{ + background-position:-1190px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull{ + background-position:-864px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull{ + background-position:-1260px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull:hover{ + background-position:-912px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-webfullandexit .ck-btn-exitwebfull:hover{ + background-position:-1330px 0; +} + +/*剧场模式按钮组*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit{ + float: right; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-theatre{ + background-position:-960px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-theatre{ + background-position:-1400px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-theatre:hover{ + background-position:-1008px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-theatre:hover{ + background-position:-1470px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre{ + background-position:-1056px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre{ + background-position:-1540px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre:hover{ + background-position:-1104px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-theatreandexit .ck-btn-exittheatre:hover{ + background-position:-1610px 0; +} +/*播放速度*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box{ + float: right; + height: 48px; + line-height: 48px; + position: relative; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playbackrate-box{ + height: 70px; + line-height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate{ + height: 100%; + padding: 0 10px; + white-space:nowrap; + font-size: 16px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate:hover{ + color: #e80101; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box .ck-bar-playbackrate-bg-box { + width: auto; + height: auto; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-playbackrate-box:hover .ck-bar-playbackrate-bg-box { + display: block; +} +/*字幕*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box{ + float: right; + height: 48px; + line-height: 48px; + position: relative; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-track-box{ + height: 70px; + line-height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box .ck-bar-track{ + height: 100%; + padding: 0 10px; + white-space:nowrap; + font-size: 16px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-track-box .ck-bar-track{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box .ck-bar-track:hover{ + color: #0368d0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box .ck-bar-track-bg-box { + width: auto; + height: auto; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-track-box:hover .ck-bar-track-bg-box { + display: block; +} +/*清晰度*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box{ + float: right; + height: 48px; + line-height: 48px; + position: relative; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-definition-box{ + height: 70px; + line-height: 70px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box .ck-bar-definition{ + height: 100%; + padding: 0 10px; + white-space:nowrap; + font-size: 16px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-definition-box .ck-bar-definition{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box .ck-bar-definition:hover{ + color: #e80101; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box .ck-bar-definition-bg-box { + width: auto; + height: auto; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-definition-box:hover .ck-bar-definition-bg-box { + display: block; +} +/*列表切换*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box { + background: rgba(0,0,0,.001); + position: absolute; + z-index: 1; + bottom: 46px; + display: none; + -webkit-animation-duration: .2s; + animation-duration: .2s; + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-list-bg-box { + bottom: 68px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg{ + background: rgba(0,0,0,.6); + float: left; + border-radius: 5px; + padding: 10px; + margin-bottom: 10px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p{ + width: 100%; + float: left; + line-height: 35px; + color: #FFF; + text-align: center; + font-size: 14px; + background-color: rgba(0,0,0,0); + border: 0px; + white-space:nowrap; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p:hover{ + color: #e80101; + font-size: 16px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p:hover{ + font-size: 20px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p{ + font-size: 18px; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-list-bg-box .ck-list-bg .ck-list-p-focus{ + color: #FF0302; +} +/*下一集按钮*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-next{ + float: left; + background-position:-672px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-next{ + background-position:-980px 0; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-next:hover{ + background-position:-720px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-next:hover{ + background-position:-1050px 0; +} +/*进度栏*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress{ + width: 100%; + position:absolute; + z-index: 1; + height: 12px; + top:-11px; + transition: 0.2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg{ + width: 100%; + background: rgba(255,255,255,.3); + margin-top: 2px; + overflow: hidden; + height: 10px; + transition: .2s; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-load{ + float: left; + width: 0px; + background: rgba(169,169,169,.7); + height: 10px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-play{ + width: 0px; + background: #e80101; + position: absolute; + z-index: 1; + height: 10px; + transition: .2s; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-mouseline{ + width: 3px; + background: rgba(255,255,255,.6); + position: absolute; + z-index: 2; + display: none; + height: 10px; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg .ck-bar-progress-prompt{ + background: #FFF; + position: absolute; + z-index: 3; + border-radius: 50%; + width: 10px; + height: 10px; + top:2px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-slider{ + border-radius: 50%; + overflow: hidden; + position: relative; + float: left; + z-index: 4; + left: 0px; + cursor: pointer; + width: 12px; + height: 12px; + top: -11px; + background: #FFF; + box-shadow: 0px 0px 0px 4px rgba(255,255,255,.5); +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-slider:hover{ + background: #e80101; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress .ck-bar-progress-bg:hover .ck-bar-progress-mouseline{ + display: block; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out{ + height: 2px; + top:-2px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-bg,.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-load,.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-bg .ck-bar-progress-play{ + height: 2px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-slider{ + width: 12px; + height: 2px; + top: -2px; + box-shadow: 0px 0px 0px 0px rgba(255,255,255,0); + background: rgba(232,1,1,0); + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-out .ck-bar-progress-bg .ck-bar-progress-prompt{ + height: 2px; + border-radius: 0; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-slider-move .ck-bar-progress-play,.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-progress.ck-bar-progress-slider-move .ck-bar-progress-slider{ + transition: 0s; +} + +/*音量调节栏*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox{ + float: right; + width: 48px; + overflow-x: hidden; +} +/*音量调节栏*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox{ + width: 70px; +} +/*默认状态-音量调节总外框*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume{ + width: 48px; + height: 215px; + background: rgba(0,0,0,.01); + position: absolute; + z-index: 1; + bottom: 46px; + display: none; + overflow: hidden; +} +/*全屏状态-音量调节总外框*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-bar-volume{ + width: 70px; + bottom: 68px; +} +/*默认状态-音量调节总外框-鼠标经过时样式*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox:hover .ck-bar-volume{ + display: block; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .1s; + animation-duration: .1s; + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} +/*共用状态-音量调节内部外框*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volumex{ + width: 100%; + height: 200px; + float: left; + background: rgba(0,0,0,.8); + border-radius: 5px; +} +/*共用状态-音量调节顶部文字*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-txt{ + width: 100%; + height: 40px; + line-height: 40px; + color: #FFF; + text-align: center; + font-size: 1rem; + float: left; + overflow: hidden; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +/*共用状态-音量调节背景色*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-bg{ + width: 8px; + height: 140px; + background: #808080; + border-radius: 3px; + overflow: hidden; + cursor: pointer; + margin: auto; +} +/*共用状态-音量调节前景色*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-bg .ck-bar-volume-pp{ + width: 8px; + height: 140px; + background: #e80101; + margin-top: 140px; +} +/*共用状态-音量调节拖动小按钮*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-slider{ + width: 10px; + height: 10px; + background: #FFF; + border-radius: 50%; + overflow: hidden; + box-shadow: 0px 0px 0px 8px rgba(255,255,255,.5); + position: absolute; + z-index: 1; + top: 0px; + left: 19px; + cursor: pointer; +} +/*全屏状态-音量调节拖动小按钮*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-volumebox .ck-bar-volume .ck-bar-volume-slider{ + left: 30px; +} +/*默认状态-显示时间*/ +.ckplayer-ckplayer .ck-main .ck-bar .ck-bar-time{ + float: left; + line-height: 48px; + font-size: 16px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +/*全屏状态-显示时间*/ +.ckplayer-ckplayer .ck-main.ck-main-full .ck-bar .ck-bar-time{ + float: left; + line-height: 70px; + font-size: 18px; + color: #FFF; +} +/*右侧控制栏*/ +.ckplayer-ckplayer .ck-main .ck-right-bar{ + position: absolute; + z-index: 260; + top: 0; + right: 2px; + bottom: 0; + margin: auto !important; + width: 48px; + height: 144px; + background: rgba(0,0,0,.3); + border-radius: 5px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-right-bar-hide{ + right: -48px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar{ + width: 70px; + height: 210px; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar-hide{ + right: -70px; + transition: .2s; +} +/*截图按钮*/ +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-btn-screenshot{ + float: left; + background-position:-1536px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-btn-screenshot{ + background-position:-2240px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-btn-screenshot:hover{ + background-position:-1584px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-btn-screenshot:hover{ + background-position:-2310px 0; +} +/*小窗口按钮组*/ +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows button{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open{ + background-position:-1248px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open{ + background-position:-1820px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open:hover{ + background-position:-1296px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-open:hover{ + background-position:-1890px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close{ + background-position:-1152px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close{ + background-position:-1680px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close:hover{ + background-position:-1200px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-smallwindows .ck-btn-smallwindows-close:hover{ + background-position:-1750px 0; +} +/*循环按钮组*/ +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop{ + float: left; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open{ + background-position:-1440px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open{ + background-position:-2100px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open:hover{ + background-position:-1488px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-open:hover{ + background-position:-2170px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close{ + background-position:-1344px 0; + display: none; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close{ + background-position:-1960px 0; +} +.ckplayer-ckplayer .ck-main .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close:hover{ + background-position:-1392px 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-right-bar .ck-right-bar-loop .ck-btn-loop-close:hover{ + background-position:-2030px 0; +} +/*顶部显示栏*/ +.ckplayer-ckplayer .ck-main .ck-top-bar{ + position: absolute; + z-index: 260; + top: -36px; + width: 100%; + height: 36px; + background: rgba(0,0,0,.3); + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-top-bar-hide{ + top: -36px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-top-bar{ + top: 0; +} +.ckplayer-ckplayer .ck-main.ck-main-full .ck-top-bar-hide{ + top: -36px; + transition: .2s; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom{ + position: absolute; + z-index: 260; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container{ + float: left; + margin-left: 10px; + margin-top: 9px; + cursor: pointer; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left{ + float: left; + width: 20px; + height: 18px; + border: 1px solid #FFF; + box-sizing:content-box; + -moz-box-sizing:content-box; /* Firefox */ + -webkit-box-sizing:content-box; /* Safari */ +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container:hover .ck-top-bar-zoom-left, +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container.ck-top-bar-zoom-container-focus .ck-top-bar-zoom-left{ + border-color: #e80101; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container:hover .ck-top-bar-zoom-left div, +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container.ck-top-bar-zoom-container-focus .ck-top-bar-zoom-left div{ + background: #e80101; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-right{ + float: left; + font-size: 14px; + color: #FFF; + padding-left: 5px; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container:hover .ck-top-bar-zoom-right, +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container.ck-top-bar-zoom-container-focus .ck-top-bar-zoom-right{ + color: #e80101; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left .ck-top-bar-zoom-button-50{ + width: 50%; + height: 50%; + background: #FFF; + margin: 4.5px 25%; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left .ck-top-bar-zoom-button-75{ + width: 75%; + height: 50%; + background: #FFF; + margin: 4.5px 12.5%; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-zoom .ck-top-bar-zoom-container .ck-top-bar-zoom-left .ck-top-bar-zoom-button-100{ + width: 100%; + height: 50%; + background: #FFF; + margin: 4.5px 0; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-title{ + position: absolute; + z-index: 1; + top: 0px; + width: 100%; + height: 36px; + line-height: 36px; + text-align: center; + font-size: 18px; + color: #FFF; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +.ckplayer-ckplayer .ck-main .ck-top-bar .ck-top-bar-time{ + float: right; + height: 36px; + line-height: 36px; + font-size: 14px; + color: #FFF; + padding: 0 1rem 0; + -moz-user-select:none; /*火狐*/ + -webkit-user-select:none; /*webkit浏览器*/ + -ms-user-select:none; /*IE10*/ + -khtml-user-select:none; /*早期浏览器*/ + user-select:none; +} +/*以下为缓动效果样式*/ +.ck-animate { + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: .3s; + animation-duration: .3s; +} +.ck-animate-bouncein { + -webkit-animation-name: ck-bounceIn; + animation-name: ck-bounceIn; +} + +@-webkit-keyframes ck-bounceIn { + 0% { + opacity: 0; + -webkit-transform: scale(.5); + transform: scale(.5) + } + 100% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } +} + +@keyframes ck-bounceIn { + 0% { + opacity: 0; + -webkit-transform: scale(.5); + -ms-transform: scale(.5); + transform: scale(.5); + } + 100% { + opacity: 1; + -webkit-transform: scale(1); + -ms-transform: scale(1); + transform: scale(1); + } +} +.ck-animate-bounceout { + -webkit-animation-name: ck-bounceOut; + animation-name: ck-bounceOut; +} + +@-webkit-keyframes ck-bounceOut { + 0% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } + 100% { + opacity: 0; + -webkit-transform: scale(.5); + transform: scale(.5); + } +} + +@keyframes ck-bounceOut { + 0% { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } + 100% { + opacity: 0; + -webkit-transform: scale(.5); + transform: scale(.5); + } +} +.ck-animate-circle { + animation: ck-Circle 1s linear infinite; + -webkit-animation: ck-Circle 1s linear infinite +} + +@-webkit-keyframes ck-Circle { + 0% { + transform: rotate(0deg); + -webkit-transform: rotate(0deg); + -ms-transform: rotate(0deg) + } + 25% { + transform: rotate(90deg); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg) + } + 50% { + transform: rotate(180deg); + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg) + } + 75% { + transform: rotate(270deg); + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg) + } + 100% { + transform: rotate(360deg); + -webkit-transform: rotate(360deg); + -ms-transform: rotate(360deg) + } +} + +@keyframes ck-Circle { + 0% { + transform: rotate(0deg); + -webkit-transform: rotate(0deg); + -ms-transform: rotate(0deg) + } + 25% { + transform: rotate(90deg); + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg) + } + 50% { + transform: rotate(180deg); + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg) + } + 75% { + transform: rotate(270deg); + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg) + } + 100% { + transform: rotate(360deg); + -webkit-transform: rotate(360deg); + -ms-transform: rotate(360deg) + } +} \ No newline at end of file diff --git a/server/src/main/resources/static/ckplayer/css/images/adclose.png b/server/src/main/resources/static/ckplayer/css/images/adclose.png new file mode 100644 index 00000000..b3c0b7b0 Binary files /dev/null and b/server/src/main/resources/static/ckplayer/css/images/adclose.png differ diff --git a/server/src/main/resources/static/ckplayer/css/images/buffer.png b/server/src/main/resources/static/ckplayer/css/images/buffer.png new file mode 100644 index 00000000..198d4a14 Binary files /dev/null and b/server/src/main/resources/static/ckplayer/css/images/buffer.png differ diff --git a/server/src/main/resources/static/ckplayer/css/images/ckplayer.48.png b/server/src/main/resources/static/ckplayer/css/images/ckplayer.48.png new file mode 100644 index 00000000..650c1171 Binary files /dev/null and b/server/src/main/resources/static/ckplayer/css/images/ckplayer.48.png differ diff --git a/server/src/main/resources/static/ckplayer/css/images/ckplayer.png b/server/src/main/resources/static/ckplayer/css/images/ckplayer.png new file mode 100644 index 00000000..15940cf9 Binary files /dev/null and b/server/src/main/resources/static/ckplayer/css/images/ckplayer.png differ diff --git a/server/src/main/resources/static/ckplayer/css/images/ckplayer_ixigua.48.png b/server/src/main/resources/static/ckplayer/css/images/ckplayer_ixigua.48.png new file mode 100644 index 00000000..7301e36b Binary files /dev/null and b/server/src/main/resources/static/ckplayer/css/images/ckplayer_ixigua.48.png differ diff --git a/server/src/main/resources/static/ckplayer/css/images/ckplayer_ixigua.png b/server/src/main/resources/static/ckplayer/css/images/ckplayer_ixigua.png new file mode 100644 index 00000000..818c2611 Binary files /dev/null and b/server/src/main/resources/static/ckplayer/css/images/ckplayer_ixigua.png differ diff --git a/server/src/main/resources/static/ckplayer/css/images/ckplayer_red.48.png b/server/src/main/resources/static/ckplayer/css/images/ckplayer_red.48.png new file mode 100644 index 00000000..5f226ac3 Binary files /dev/null and b/server/src/main/resources/static/ckplayer/css/images/ckplayer_red.48.png differ diff --git a/server/src/main/resources/static/ckplayer/css/images/ckplayer_red.png b/server/src/main/resources/static/ckplayer/css/images/ckplayer_red.png new file mode 100644 index 00000000..d872a0a4 Binary files /dev/null and b/server/src/main/resources/static/ckplayer/css/images/ckplayer_red.png differ diff --git a/server/src/main/resources/static/ckplayer/css/images/loading.png b/server/src/main/resources/static/ckplayer/css/images/loading.png new file mode 100644 index 00000000..fe16ca36 Binary files /dev/null and b/server/src/main/resources/static/ckplayer/css/images/loading.png differ diff --git a/server/src/main/resources/static/ckplayer/css/images/play.png b/server/src/main/resources/static/ckplayer/css/images/play.png new file mode 100644 index 00000000..f9e111bb Binary files /dev/null and b/server/src/main/resources/static/ckplayer/css/images/play.png differ diff --git a/server/src/main/resources/static/ckplayer/flv.js/flv.min.js b/server/src/main/resources/static/ckplayer/flv.js/flv.min.js new file mode 100644 index 00000000..c5010fb6 --- /dev/null +++ b/server/src/main/resources/static/ckplayer/flv.js/flv.min.js @@ -0,0 +1,10 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.flvjs=t():e.flvjs=t()}(self,(function(){return function(){var e={264:function(e,t,i){ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version v4.2.8+1e68dce6 + */ +e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,s=void 0,o=void 0,a=function(e,t){b[r]=e,b[r+1]=t,2===(r+=2)&&(o?o(E):A())};function h(e){o=e}function u(e){a=e}var l="undefined"!=typeof window?window:void 0,d=l||{},c=d.MutationObserver||d.WebKitMutationObserver,f="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),_="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){return function(){return process.nextTick(E)}}function m(){return void 0!==s?function(){s(E)}:y()}function g(){var e=0,t=new c(E),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){i.data=e=++e%2}}function v(){var e=new MessageChannel;return e.port1.onmessage=E,function(){return e.port2.postMessage(0)}}function y(){var e=setTimeout;return function(){return e(E,1)}}var b=new Array(1e3);function E(){for(var e=0;e0&&o.length>r&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=l.bind(n);return r.listener=i,n.wrapFn=r,r}function c(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[e];if(void 0===h)return!1;if("function"==typeof h)n(h,this,t);else{var u=h.length,l=_(h,u);for(i=0;i=0;s--)if(i[s]===t||i[s].listener===t){o=i[s].listener,r=s;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return c(this,e,!0)},s.prototype.rawListeners=function(e){return c(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},397:function(e,t,i){function n(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var n=i(i.s=ENTRY_MODULE);return n.default||n}var r="[\\.|\\-|\\+|\\w|/|@]+",s="\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function a(e,t,n){var a={};a[n]=[];var h=t.toString(),u=h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return a;for(var l,d=u[1],c=new RegExp("(\\\\n|\\W)"+o(d)+s,"g");l=c.exec(h);)"dll-reference"!==l[3]&&a[n].push(l[3]);for(c=new RegExp("\\("+o(d)+'\\("(dll-reference\\s('+r+'))"\\)\\)'+s,"g");l=c.exec(h);)e[l[2]]||(a[n].push(l[1]),e[l[2]]=i(l[1]).m),a[l[2]]=a[l[2]]||[],a[l[2]].push(l[4]);for(var f,_=Object.keys(a),p=0;p<_.length;p++)for(var m=0;m0}),!1)}e.exports=function(e,t){t=t||{};var r={main:i.m},s=t.all?{main:Object.keys(r.main)}:function(e,t){for(var i={main:[t]},n={main:[]},r={main:{}};h(i);)for(var s=Object.keys(i),o=0;o=e[r]&&t0&&e[0].originalDts=t[r].dts&&et[n].lastSample.originalDts&&e=t[n].lastSample.originalDts&&(n===t.length-1||n0&&(r=this._searchNearestSegmentBefore(i.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,i)},e.prototype.getLastSegmentBefore=function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null},e.prototype.getLastSampleBefore=function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null},e.prototype.getLastSyncPointBefore=function(e){for(var t=this._searchNearestSegmentBefore(e),i=this._list[t].syncPoints;0===i.length&&t>0;)t--,i=this._list[t].syncPoints;return i.length>0?i[i.length-1]:null},e}()},949:function(e,t,i){"use strict";i.d(t,{Z:function(){return R}});var n=i(716),r=i.n(n),s=i(300),o=i(538),a=i(118);function h(e,t,i){var n=e;if(t+i=128){t.push(String.fromCharCode(65535&s)),n+=2;continue}}else if(i[n]<240){if(h(i,n,2))if((s=(15&i[n])<<12|(63&i[n+1])<<6|63&i[n+2])>=2048&&55296!=(63488&s)){t.push(String.fromCharCode(65535&s)),n+=3;continue}}else if(i[n]<248){var s;if(h(i,n,3))if((s=(7&i[n])<<18|(63&i[n+1])<<12|(63&i[n+2])<<6|63&i[n+3])>65536&&s<1114112){s-=65536,t.push(String.fromCharCode(s>>>10|55296)),t.push(String.fromCharCode(1023&s|56320)),n+=4;continue}}t.push(String.fromCharCode(65533)),++n}return t.join("")},d=i(29),c=(u=new ArrayBuffer(2),new DataView(u).setInt16(0,256,!0),256===new Int16Array(u)[0]),f=function(){function e(){}return e.parseScriptData=function(t,i,n){var r={};try{var o=e.parseValue(t,i,n),a=e.parseValue(t,i+o.size,n-o.size);r[o.data]=a.data}catch(e){s.Z.e("AMF",e.toString())}return r},e.parseObject=function(t,i,n){if(n<3)throw new d.rT("Data not enough when parse ScriptDataObject");var r=e.parseString(t,i,n),s=e.parseValue(t,i+r.size,n-r.size),o=s.objectEnd;return{data:{name:r.data,value:s.data},size:r.size+s.size,objectEnd:o}},e.parseVariable=function(t,i,n){return e.parseObject(t,i,n)},e.parseString=function(e,t,i){if(i<2)throw new d.rT("Data not enough when parse String");var n=new DataView(e,t,i).getUint16(0,!c);return{data:n>0?l(new Uint8Array(e,t+2,n)):"",size:2+n}},e.parseLongString=function(e,t,i){if(i<4)throw new d.rT("Data not enough when parse LongString");var n=new DataView(e,t,i).getUint32(0,!c);return{data:n>0?l(new Uint8Array(e,t+4,n)):"",size:4+n}},e.parseDate=function(e,t,i){if(i<10)throw new d.rT("Data size invalid when parse Date");var n=new DataView(e,t,i),r=n.getFloat64(0,!c),s=n.getInt16(8,!c);return{data:new Date(r+=60*s*1e3),size:10}},e.parseValue=function(t,i,n){if(n<1)throw new d.rT("Data not enough when parse Value");var r,o=new DataView(t,i,n),a=1,h=o.getUint8(0),u=!1;try{switch(h){case 0:r=o.getFloat64(1,!c),a+=8;break;case 1:r=!!o.getUint8(1),a+=1;break;case 2:var l=e.parseString(t,i+1,n-1);r=l.data,a+=l.size;break;case 3:r={};var f=0;for(9==(16777215&o.getUint32(n-4,!c))&&(f=3);a32)throw new d.OC("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 i=this._current_word_bits_left?this._current_word:0;i>>>=32-this._current_word_bits_left;var n=e-this._current_word_bits_left;this._fillCurrentWord();var r=Math.min(n,this._current_word_bits_left),s=this._current_word>>>32-r;return this._current_word<<=r,this._current_word_bits_left-=r,i=i<>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()},e.prototype.readUEG=function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1},e.prototype.readSEG=function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)},e}(),p=function(){function e(){}return e._ebsp2rbsp=function(e){for(var t=e,i=t.byteLength,n=new Uint8Array(i),r=0,s=0;s=2&&3===t[s]&&0===t[s-1]&&0===t[s-2]||(n[r]=t[s],r++);return new Uint8Array(n.buffer,0,r)},e.parseSPS=function(t){var i=e._ebsp2rbsp(t),n=new _(i);n.readByte();var r=n.readByte();n.readByte();var s=n.readByte();n.readUEG();var o=e.getProfileString(r),a=e.getLevelString(s),h=1,u=420,l=8;if((100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r)&&(3===(h=n.readUEG())&&n.readBits(1),h<=3&&(u=[0,420,422,444][h]),l=n.readUEG()+8,n.readUEG(),n.readBits(1),n.readBool()))for(var d=3!==h?8:12,c=0;c0&&k<16?(L=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][k-1],R=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][k-1]):255===k&&(L=n.readByte()<<8|n.readByte(),R=n.readByte()<<8|n.readByte())}if(n.readBool()&&n.readBool(),n.readBool()&&(n.readBits(4),n.readBool()&&n.readBits(24)),n.readBool()&&(n.readUEG(),n.readUEG()),n.readBool()){var D=n.readBits(32),I=n.readBits(32);O=n.readBool(),w=(T=I)/(C=2*D)}}var M=1;1===L&&1===R||(M=L/R);var B=0,x=0;0===h?(B=1,x=2-y):(B=3===h?1:2,x=(1===h?2:1)*(2-y));var P=16*(g+1),U=16*(v+1)*(2-y);P-=(b+E)*B,U-=(S+A)*x;var N=Math.ceil(P*M);return n.destroy(),n=null,{profile_string:o,level_string:a,bit_depth:l,ref_frames:m,chroma_format:u,chroma_format_string:e.getChromaFormatString(u),frame_rate:{fixed:O,fps:w,fps_den:C,fps_num:T},sar_ratio:{width:L,height:R},codec_size:{width:P,height:U},present_size:{width:N,height:U}}},e._skipScalingList=function(e,t){for(var i=8,n=8,r=0;r>>2!=0,o=0!=(1&t[4]),a=(n=t)[r=5]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3];return a<9?i:{match:!0,consumed:a,dataOffset:a,hasAudioTrack:s,hasVideoTrack:o}},e.prototype.bindDataSource=function(e){return e.onDataArrival=this.parseChunks.bind(this),this},Object.defineProperty(e.prototype,"onTrackMetadata",{get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaInfo",{get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMetaDataArrived",{get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScriptDataArrived",{get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataAvailable",{get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timestampBase",{get:function(){return this._timestampBase},set:function(e){this._timestampBase=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedDuration",{get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasAudio",{set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overridedHasVideo",{set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e},enumerable:!1,configurable:!0}),e.prototype.resetMediaInfo=function(){this._mediaInfo=new a.Z},e.prototype._isInitialMetadataDispatched=function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched},e.prototype.parseChunks=function(t,i){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new d.rT("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var n=0,r=this._littleEndian;if(0===i){if(!(t.byteLength>13))return 0;n=e.probe(t).dataOffset}this._firstParse&&(this._firstParse=!1,i+n!==this._dataOffset&&s.Z.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==(o=new DataView(t,n)).getUint32(0,!r)&&s.Z.w(this.TAG,"PrevTagSize0 !== 0 !!!"),n+=4);for(;nt.byteLength)break;var a=o.getUint8(0),h=16777215&o.getUint32(0,!r);if(n+11+h+4>t.byteLength)break;if(8===a||9===a||18===a){var u=o.getUint8(4),l=o.getUint8(5),c=o.getUint8(6)|l<<8|u<<16|o.getUint8(7)<<24;0!==(16777215&o.getUint32(7,!r))&&s.Z.w(this.TAG,"Meet tag which has StreamID != 0!");var f=n+11;switch(a){case 8:this._parseAudioData(t,f,h,c);break;case 9:this._parseVideoData(t,f,h,c,i+n);break;case 18:this._parseScriptData(t,f,h)}var _=o.getUint32(11+h,!r);_!==11+h&&s.Z.w(this.TAG,"Invalid PrevTagSize "+_),n+=11+h+4}else s.Z.w(this.TAG,"Unsupported tag type "+a+", skipped"),n+=11+h+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),n},e.prototype._parseScriptData=function(e,t,i){var n=f.parseScriptData(e,t,i);if(n.hasOwnProperty("onMetaData")){if(null==n.onMetaData||"object"!=typeof n.onMetaData)return void s.Z.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&s.Z.w(this.TAG,"Found another onMetaData tag!"),this._metadata=n;var r=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},r)),"boolean"==typeof r.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=r.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof r.hasVideo&&!1===this._hasVideoFlagOverrided&&(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 o=Math.floor(r.duration*this._timescale);this._duration=o,this._mediaInfo.duration=o}}else this._mediaInfo.duration=0;if("number"==typeof r.framerate){var a=Math.floor(1e3*r.framerate);if(a>0){var h=a/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=h,this._referenceFrameRate.fps_num=a,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=h}}if("object"==typeof r.keyframes){this._mediaInfo.hasKeyframesIndex=!0;var u=r.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(u),r.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=r,s.Z.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(n).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},n))},e.prototype._parseKeyframesIndex=function(e){for(var t=[],i=[],n=1;n>>4;if(2===o||10===o){var a=0,h=(12&r)>>>2;if(h>=0&&h<=4){a=this._flvSoundRateTable[h];var u=1&r,l=this._audioMetadata,d=this._audioTrack;if(l||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(l=this._audioMetadata={}).type="audio",l.id=d.id,l.timescale=this._timescale,l.duration=this._duration,l.audioSampleRate=a,l.channelCount=0===u?1:2),10===o){var c=this._parseAACAudioData(e,t+1,i-1);if(null==c)return;if(0===c.packetType){l.config&&s.Z.w(this.TAG,"Found another AudioSpecificConfig!");var f=c.data;l.audioSampleRate=f.samplingRate,l.channelCount=f.channelCount,l.codec=f.codec,l.originalCodec=f.originalCodec,l.config=f.config,l.refSampleDuration=1024/l.audioSampleRate*l.timescale,s.Z.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",l),(g=this._mediaInfo).audioCodec=l.originalCodec,g.audioSampleRate=l.audioSampleRate,g.audioChannelCount=l.channelCount,g.hasVideo?null!=g.videoCodec&&(g.mimeType='video/x-flv; codecs="'+g.videoCodec+","+g.audioCodec+'"'):g.mimeType='video/x-flv; codecs="'+g.audioCodec+'"',g.isComplete()&&this._onMediaInfo(g)}else if(1===c.packetType){var _=this._timestampBase+n,p={unit:c.data,length:c.data.byteLength,dts:_,pts:_};d.samples.push(p),d.length+=c.data.length}else s.Z.e(this.TAG,"Flv: Unsupported AAC data type "+c.packetType)}else if(2===o){if(!l.codec){var g;if(null==(f=this._parseMP3AudioData(e,t+1,i-1,!0)))return;l.audioSampleRate=f.samplingRate,l.channelCount=f.channelCount,l.codec=f.codec,l.originalCodec=f.originalCodec,l.refSampleDuration=1152/l.audioSampleRate*l.timescale,s.Z.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",l),(g=this._mediaInfo).audioCodec=l.codec,g.audioSampleRate=l.audioSampleRate,g.audioChannelCount=l.channelCount,g.audioDataRate=f.bitRate,g.hasVideo?null!=g.videoCodec&&(g.mimeType='video/x-flv; codecs="'+g.videoCodec+","+g.audioCodec+'"'):g.mimeType='video/x-flv; codecs="'+g.audioCodec+'"',g.isComplete()&&this._onMediaInfo(g)}var v=this._parseMP3AudioData(e,t+1,i-1,!1);if(null==v)return;_=this._timestampBase+n;var y={unit:v,length:v.byteLength,dts:_,pts:_};d.samples.push(y),d.length+=v.length}}else this._onError(m.Z.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+h)}else this._onError(m.Z.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+o)}},e.prototype._parseAACAudioData=function(e,t,i){if(!(i<=1)){var n={},r=new Uint8Array(e,t,i);return n.packetType=r[0],0===r[0]?n.data=this._parseAACAudioSpecificConfig(e,t+1,i-1):n.data=r.subarray(1),n}s.Z.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")},e.prototype._parseAACAudioSpecificConfig=function(e,t,i){var n,r,s=new Uint8Array(e,t,i),o=null,a=0,h=null;if(a=n=s[0]>>>3,(r=(7&s[0])<<1|s[1]>>>7)<0||r>=this._mpegSamplingRates.length)this._onError(m.Z.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var u=this._mpegSamplingRates[r],l=(120&s[1])>>>3;if(!(l<0||l>=8)){5===a&&(h=(7&s[1])<<1|s[2]>>>7,(124&s[2])>>>2);var d=self.navigator.userAgent.toLowerCase();return-1!==d.indexOf("firefox")?r>=6?(a=5,o=new Array(4),h=r-3):(a=2,o=new Array(2),h=r):-1!==d.indexOf("android")?(a=2,o=new Array(2),h=r):(a=5,h=r,o=new Array(4),r>=6?h=r-3:1===l&&(a=2,o=new Array(2),h=r)),o[0]=a<<3,o[0]|=(15&r)>>>1,o[1]=(15&r)<<7,o[1]|=(15&l)<<3,5===a&&(o[1]|=(15&h)>>>1,o[2]=(1&h)<<7,o[2]|=8,o[3]=0),{config:o,samplingRate:u,channelCount:l,codec:"mp4a.40."+a,originalCodec:"mp4a.40."+n}}this._onError(m.Z.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}},e.prototype._parseMP3AudioData=function(e,t,i,n){if(!(i<4)){this._littleEndian;var r=new Uint8Array(e,t,i),o=null;if(n){if(255!==r[0])return;var a=r[1]>>>3&3,h=(6&r[1])>>1,u=(240&r[2])>>>4,l=(12&r[2])>>>2,d=3!==(r[3]>>>6&3)?2:1,c=0,f=0;switch(a){case 0:c=this._mpegAudioV25SampleRateTable[l];break;case 2:c=this._mpegAudioV20SampleRateTable[l];break;case 3:c=this._mpegAudioV10SampleRateTable[l]}switch(h){case 1:34,u>>4,h=15&o;7===h?this._parseAVCVideoPacket(e,t+1,i-1,n,r,a):this._onError(m.Z.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: "+h)}},e.prototype._parseAVCVideoPacket=function(e,t,i,n,r,o){if(i<4)s.Z.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var a=this._littleEndian,h=new DataView(e,t,i),u=h.getUint8(0),l=(16777215&h.getUint32(0,!a))<<8>>8;if(0===u)this._parseAVCDecoderConfigurationRecord(e,t+4,i-4);else if(1===u)this._parseAVCVideoData(e,t+4,i-4,n,r,o,l);else if(2!==u)return void this._onError(m.Z.FORMAT_ERROR,"Flv: Invalid video packet type "+u)}},e.prototype._parseAVCDecoderConfigurationRecord=function(e,t,i){if(i<7)s.Z.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var n=this._videoMetadata,r=this._videoTrack,o=this._littleEndian,a=new DataView(e,t,i);n?void 0!==n.avcc&&s.Z.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(n=this._videoMetadata={}).type="video",n.id=r.id,n.timescale=this._timescale,n.duration=this._duration);var h=a.getUint8(0),u=a.getUint8(1);a.getUint8(2),a.getUint8(3);if(1===h&&0!==u)if(this._naluLengthSize=1+(3&a.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var l=31&a.getUint8(5);if(0!==l){l>1&&s.Z.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = "+l);for(var d=6,c=0;c1&&s.Z.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = "+R),d++;for(c=0;c=i){s.Z.w(this.TAG,"Malformed Nalu near timestamp "+_+", offset = "+c+", dataSize = "+i);break}var m=u.getUint32(c,!h);if(3===f&&(m>>>=8),m>i-f)return void s.Z.w(this.TAG,"Malformed Nalus near timestamp "+_+", NaluSize > DataSize!");var g=31&u.getUint8(c+f);5===g&&(p=!0);var v=new Uint8Array(e,t+c,f+m),y={type:g,data:v};l.push(y),d+=v.byteLength,c+=f+m}if(l.length){var b=this._videoTrack,E={units:l,length:d,isKeyframe:p,dts:_,cts:a,pts:_+a};p&&(E.fileposition=r),b.samples.push(E),b.length+=d}},e}(),v=function(){function e(){}return e.init=function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=e.constants={};i.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),i.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),i.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSC=i.STCO=i.STTS,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),i.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])},e.box=function(e){for(var t=8,i=null,n=Array.prototype.slice.call(arguments,1),r=n.length,s=0;s>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);var o=8;for(s=0;s>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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]))},e.trak=function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.tkhd=function(t){var i=t.id,n=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,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,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]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))},e.mdhd=function(t){var i=t.timescale,n=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,n>>>24&255,n>>>16&255,n>>>8&255,255&n,85,196,0,0]))},e.hdlr=function(t){var i=null;return i="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)},e.minf=function(t){var i=null;return i="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,i,e.dinf(),e.stbl(t))},e.dinf=function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))},e.stbl=function(t){return 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))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))},e.mp3=function(t){var i=t.channelCount,n=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types[".mp3"],r)},e.mp4a=function(t){var i=t.channelCount,n=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,n>>>8&255,255&n,0,0]);return e.box(e.types.mp4a,r,e.esds(t))},e.esds=function(t){var i=t.config||[],n=i.length,r=new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(i).concat([6,1,2]));return e.box(e.types.esds,r)},e.avc1=function(t){var i=t.avcc,n=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,n>>>8&255,255&n,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,i))},e.mvex=function(t){return e.box(e.types.mvex,e.trex(t))},e.trex=function(t){var i=t.id,n=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,n)},e.moof=function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))},e.mfhd=function(t){var i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,i)},e.traf=function(t,i){var n=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),s=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),o=e.sdtp(t),a=e.trun(t,o.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,r,s,a,o)},e.sdtp=function(t){for(var i=t.samples||[],n=i.length,r=new Uint8Array(4+n),s=0;s>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var a=0;a>>24&255,h>>>16&255,h>>>8&255,255&h,u>>>24&255,u>>>16&255,u>>>8&255,255&u,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.isNonSync,0,0,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*a)}return e.box(e.types.trun,o)},e.mdat=function(t){return e.box(e.types.mdat,t)},e}();v.init();var y=v,b=function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},e}(),E=i(51),S=function(){function e(e){this.TAG="MP4Remuxer",this._config=e,this._isLive=!0===e.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new E.J1("audio"),this._videoSegmentInfoList=new E.J1("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!o.Z.chrome||!(o.Z.version.major<50||50===o.Z.version.major&&o.Z.version.build<2661)),this._fillSilentAfterSeek=o.Z.msedge||o.Z.msie,this._mp3UseMpegAudio=!o.Z.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return e.prototype.destroy=function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null},e.prototype.bindDataSource=function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this},Object.defineProperty(e.prototype,"onInitSegment",{get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onMediaSegment",{get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e},enumerable:!1,configurable:!0}),e.prototype.insertDiscontinuity=function(){this._audioNextDts=this._videoNextDts=void 0},e.prototype.seek=function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()},e.prototype.remux=function(e,t){if(!this._onMediaSegment)throw new d.rT("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)},e.prototype._onTrackMetadataReceived=function(e,t){var i=null,n="mp4",r=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(n="mpeg",r="",i=new Uint8Array):i=y.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,i=y.generateInitSegment(t)}if(!this._onInitSegment)throw new d.rT("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:i.buffer,codec:r,container:e+"/"+n,mediaDuration:t.duration})},e.prototype._calculateDtsBase=function(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)},e.prototype.flushStashedSamples=function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,i={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(i.samples.push(e),i.length=e.length);var n={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(n.samples.push(t),n.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(i,!0),this._remuxAudio(n,!0)},e.prototype._remuxAudio=function(e,t){if(null!=this._audioMeta){var i,n=e,r=n.samples,a=void 0,h=-1,u=this._audioMeta.refSampleDuration,l="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,d=this._dtsBaseInited&&void 0===this._audioNextDts,c=!1;if(r&&0!==r.length&&(1!==r.length||t)){var f=0,_=null,p=0;l?(f=0,p=n.length):(f=8,p=8+n.length);var m=null;if(r.length>1&&(p-=(m=r.pop()).length),null!=this._audioStashedLastSample){var g=this._audioStashedLastSample;this._audioStashedLastSample=null,r.unshift(g),p+=g.length}null!=m&&(this._audioStashedLastSample=m);var v=r[0].dts-this._dtsBase;if(this._audioNextDts)a=v-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())a=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(c=!0);else{var S=this._audioSegmentInfoList.getLastSampleBefore(v);if(null!=S){var A=v-(S.originalDts+S.duration);A<=3&&(A=0),a=v-(S.dts+S.duration+A)}else a=0}if(c){var L=v-a,R=this._videoSegmentInfoList.getLastSegmentBefore(v);if(null!=R&&R.beginDts=3*u&&this._fillAudioTimestampGap&&!o.Z.safari){I=!0;var P,U=Math.floor(a/u);s.Z.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\noriginalDts: "+D+" ms, curRefDts: "+x+" ms, dtsCorrection: "+Math.round(a)+" ms, generate: "+U+" frames"),w=Math.floor(x),B=Math.floor(x+u)-w,null==(P=b.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount))&&(s.Z.w(this.TAG,"Unable to generate silent frame for "+this._audioMeta.originalCodec+" with "+this._audioMeta.channelCount+" channels, repeat last frame"),P=k),M=[];for(var N=0;N=1?T[T.length-1].duration:Math.floor(u);this._audioNextDts=w+B}-1===h&&(h=w),T.push({dts:w,pts:w,cts:0,unit:g.unit,size:g.unit.byteLength,duration:B,originalDts:D,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),I&&T.push.apply(T,M)}}if(0===T.length)return n.samples=[],void(n.length=0);l?_=new Uint8Array(p):((_=new Uint8Array(p))[0]=p>>>24&255,_[1]=p>>>16&255,_[2]=p>>>8&255,_[3]=255&p,_.set(y.types.mdat,4));for(C=0;C1&&(d-=(c=s.pop()).length),null!=this._videoStashedLastSample){var f=this._videoStashedLastSample;this._videoStashedLastSample=null,s.unshift(f),d+=f.length}null!=c&&(this._videoStashedLastSample=c);var _=s[0].dts-this._dtsBase;if(this._videoNextDts)o=_-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())o=0;else{var p=this._videoSegmentInfoList.getLastSampleBefore(_);if(null!=p){var m=_-(p.originalDts+p.duration);m<=3&&(m=0),o=_-(p.dts+p.duration+m)}else o=0}for(var g=new E.Yy,v=[],b=0;b=1?v[v.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(A){var T=new E.Wk(L,w,O,f.dts,!0);T.fileposition=f.fileposition,g.appendSyncPoint(T)}v.push({dts:L,pts:w,cts:R,units:f.units,size:f.length,isKeyframe:A,duration:O,originalDts:S,flags:{isLeading:0,dependsOn:A?2:1,isDependedOn:A?1:0,hasRedundancy:0,isNonSync:A?0:1}})}(l=new Uint8Array(d))[0]=d>>>24&255,l[1]=d>>>16&255,l[2]=d>>>8&255,l[3]=255&d,l.set(y.types.mdat,4);for(b=0;b0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,r=this._demuxer.parseChunks(e,t);else if((n=g.probe(e)).match){this._demuxer=new g(n,this._config),this._remuxer||(this._remuxer=new S(this._config));var o=this._mediaDataSource;null==o.duration||isNaN(o.duration)||(this._demuxer.overridedDuration=o.duration),"boolean"==typeof o.hasAudio&&(this._demuxer.overridedHasAudio=o.hasAudio),"boolean"==typeof o.hasVideo&&(this._demuxer.overridedHasVideo=o.hasVideo),this._demuxer.timestampBase=o.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.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 n=null,s.Z.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then((function(){i._internalAbort()})),this._emitter.emit(L.Z.DEMUX_ERROR,m.Z.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),r=0;return r},e.prototype._onMediaInfo=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,a.Z.prototype));var i=Object.assign({},e);Object.setPrototypeOf(i,a.Z.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=i,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)}))},e.prototype._onMetaDataArrived=function(e){this._emitter.emit(L.Z.METADATA_ARRIVED,e)},e.prototype._onScriptDataArrived=function(e){this._emitter.emit(L.Z.SCRIPTDATA_ARRIVED,e)},e.prototype._onIOSeeked=function(){this._remuxer.insertDiscontinuity()},e.prototype._onIOComplete=function(e){var t=e+1;t0&&i[0].originalDts===n&&(n=i[0].pts),this._emitter.emit(L.Z.RECOMMEND_SEEKPOINT,n)}},e.prototype._enableStatisticsReporter=function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))},e.prototype._disableStatisticsReporter=function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype._reportSegmentMediaInfo=function(e){var t=this._mediaInfo.segments[e],i=Object.assign({},t);i.duration=this._mediaInfo.duration,i.segmentCount=this._mediaInfo.segmentCount,delete i.segments,delete i.keyframesIndex,this._emitter.emit(L.Z.MEDIA_INFO,i)},e.prototype._reportStatisticsInfo=function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(L.Z.STATISTICS_INFO,e)},e}()},257:function(e,t){"use strict";t.Z={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",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"}},82:function(e,t,i){"use strict";i(846),i(219),i(949),i(257)},600:function(e,t){"use strict";t.Z={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"}},60:function(e,t,i){"use strict";i.d(t,{default:function(){return D}});var n=i(219),r=i(191),s={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function o(){return Object.assign({},s)}var a=function(){function e(){}return e.supportMSEH264Playback=function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')},e.supportNetworkStreamIO=function(){var e=new r.Z({},o()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"==t||"xhr-moz-chunked-loader"==t},e.getNetworkLoaderTypeName=function(){var e=new r.Z({},o()),t=e.loaderType;return e.destroy(),t},e.supportNativeMediaPlayback=function(t){null==e.videoElement&&(e.videoElement=window.document.createElement("video"));var i=e.videoElement.canPlayType(t);return"probably"===i||"maybe"==i},e.getFeatureList=function(){var t={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.mseFlvPlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName(),t.mseLiveFlvPlayback=t.mseFlvPlayback&&t.networkStreamIO,t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t},e}(),h=i(939),u=i(716),l=i.n(u),d=i(300),c=i(538),f={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},_=i(397),p=i.n(_),m=i(846),g=i(949),v=i(257),y=i(118),b=function(){function e(e,t){if(this.TAG="Transmuxer",this._emitter=new(l()),t.enableWorker&&"undefined"!=typeof Worker)try{this._worker=p()(82),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[e,t]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},m.Z.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:m.Z.getConfig()})}catch(i){d.Z.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new g.Z(e,t)}else this._controller=new g.Z(e,t);if(this._controller){var i=this._controller;i.on(v.Z.IO_ERROR,this._onIOError.bind(this)),i.on(v.Z.DEMUX_ERROR,this._onDemuxError.bind(this)),i.on(v.Z.INIT_SEGMENT,this._onInitSegment.bind(this)),i.on(v.Z.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),i.on(v.Z.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),i.on(v.Z.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),i.on(v.Z.MEDIA_INFO,this._onMediaInfo.bind(this)),i.on(v.Z.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),i.on(v.Z.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),i.on(v.Z.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),i.on(v.Z.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return e.prototype.destroy=function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),m.Z.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.hasWorker=function(){return null!=this._worker},e.prototype.open=function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()},e.prototype.close=function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()},e.prototype.seek=function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)},e.prototype.pause=function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()},e.prototype.resume=function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()},e.prototype._onInitSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(v.Z.INIT_SEGMENT,e,t)}))},e.prototype._onMediaSegment=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(v.Z.MEDIA_SEGMENT,e,t)}))},e.prototype._onLoadingComplete=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(v.Z.LOADING_COMPLETE)}))},e.prototype._onRecoveredEarlyEof=function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(v.Z.RECOVERED_EARLY_EOF)}))},e.prototype._onMediaInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(v.Z.MEDIA_INFO,e)}))},e.prototype._onMetaDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(v.Z.METADATA_ARRIVED,e)}))},e.prototype._onScriptDataArrived=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(v.Z.SCRIPTDATA_ARRIVED,e)}))},e.prototype._onStatisticsInfo=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(v.Z.STATISTICS_INFO,e)}))},e.prototype._onIOError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(v.Z.IO_ERROR,e,t)}))},e.prototype._onDemuxError=function(e,t){var i=this;Promise.resolve().then((function(){i._emitter.emit(v.Z.DEMUX_ERROR,e,t)}))},e.prototype._onRecommendSeekpoint=function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(v.Z.RECOMMEND_SEEKPOINT,e)}))},e.prototype._onLoggingConfigChanged=function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})},e.prototype._onWorkerMessage=function(e){var t=e.data,i=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case v.Z.INIT_SEGMENT:case v.Z.MEDIA_SEGMENT:this._emitter.emit(t.msg,i.type,i.data);break;case v.Z.LOADING_COMPLETE:case v.Z.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case v.Z.MEDIA_INFO:Object.setPrototypeOf(i,y.Z.prototype),this._emitter.emit(t.msg,i);break;case v.Z.METADATA_ARRIVED:case v.Z.SCRIPTDATA_ARRIVED:case v.Z.STATISTICS_INFO:this._emitter.emit(t.msg,i);break;case v.Z.IO_ERROR:case v.Z.DEMUX_ERROR:this._emitter.emit(t.msg,i.type,i.info);break;case v.Z.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,i);break;case"logcat_callback":d.Z.emitter.emit("log",i.type,i.logcat)}},e}(),E={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},S=i(51),A=i(29),L=function(){function e(e){this.TAG="MSEController",this._config=e,this._emitter=new(l()),this._config.isLive&&null==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new S.Vn}return e.prototype.destroy=function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){if(this._mediaSource)throw new A.rT("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL},e.prototype.detachMediaElement=function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var i=this._pendingSegments[t];i.splice(0,i.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var n=this._sourceBuffers[t];if(n){if("closed"!==e.readyState){try{e.removeSourceBuffer(n)}catch(e){d.Z.e(this.TAG,e.message)}n.removeEventListener("error",this.e.onSourceBufferError),n.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){d.Z.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)},e.prototype.appendInitSegment=function(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var i=e,n=""+i.container;i.codec&&i.codec.length>0&&(n+=";codecs="+i.codec);var r=!1;if(d.Z.v(this.TAG,"Received Initialization Segment, mimeType: "+n),this._lastInitSegments[i.type]=i,n!==this._mimeTypes[i.type]){if(this._mimeTypes[i.type])d.Z.v(this.TAG,"Notice: "+i.type+" mimeType changed, origin: "+this._mimeTypes[i.type]+", target: "+n);else{r=!0;try{var s=this._sourceBuffers[i.type]=this._mediaSource.addSourceBuffer(n);s.addEventListener("error",this.e.onSourceBufferError),s.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return d.Z.e(this.TAG,e.message),void this._emitter.emit(E.ERROR,{code:e.code,msg:e.message})}}this._mimeTypes[i.type]=n}t||this._pendingSegments[i.type].push(i),r||this._sourceBuffers[i.type]&&!this._sourceBuffers[i.type].updating&&this._doAppendSegments(),c.Z.safari&&"audio/mpeg"===i.container&&i.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=i.mediaDuration/1e3,this._updateMediaSourceDuration())},e.prototype.appendMediaSegment=function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var i=this._sourceBuffers[t.type];!i||i.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()},e.prototype.seek=function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var i=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{i.abort()}catch(e){d.Z.e(this.TAG,e.message)}this._idrList.clear();var n=this._pendingSegments[t];if(n.splice(0,n.length),"closed"!==this._mediaSource.readyState){for(var r=0;r=1&&e-n.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1},e.prototype._doCleanupSourceBuffer=function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var i=this._sourceBuffers[t];if(i){for(var n=i.buffered,r=!1,s=0;s=this._config.autoCleanupMaxBackwardDuration){r=!0;var h=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:o,end:h})}}else a0&&(isNaN(t)||i>t)&&(d.Z.v(this.TAG,"Update MediaSource duration from "+t+" to "+i),this._mediaSource.duration=i),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}},e.prototype._doRemoveRanges=function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating)for(var t=this._sourceBuffers[e],i=this._pendingRemoveRanges[e];i.length&&!t.updating;){var n=i.shift();t.remove(n.start,n.end)}},e.prototype._doAppendSegments=function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var i=e[t].shift();if(i.timestampOffset){var n=this._sourceBuffers[t].timestampOffset,r=i.timestampOffset/1e3;Math.abs(n-r)>.1&&(d.Z.v(this.TAG,"Update MPEG audio timestampOffset from "+n+" to "+r),this._sourceBuffers[t].timestampOffset=r),delete i.timestampOffset}if(!i.data||0===i.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(i.data),this._isBufferFull=!1,"video"===t&&i.hasOwnProperty("info")&&this._idrList.appendArray(i.info.syncPoints)}catch(e){this._pendingSegments[t].unshift(i),22===e.code?(this._isBufferFull||this._emitter.emit(E.BUFFER_FULL),this._isBufferFull=!0):(d.Z.e(this.TAG,e.message),this._emitter.emit(E.ERROR,{code:e.code,msg:e.message}))}}},e.prototype._onSourceOpen=function(){if(d.Z.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(E.SOURCE_OPEN)},e.prototype._onSourceEnded=function(){d.Z.v(this.TAG,"MediaSource onSourceEnded")},e.prototype._onSourceClose=function(){d.Z.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))},e.prototype._hasPendingSegments=function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0},e.prototype._hasPendingRemoveRanges=function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0},e.prototype._onSourceBufferUpdateEnd=function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(E.UPDATE_END)},e.prototype._onSourceBufferError=function(e){d.Z.e(this.TAG,"SourceBuffer Error: "+e)},e}(),R=i(600),w={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},O={NETWORK_EXCEPTION:h.nm.EXCEPTION,NETWORK_STATUS_CODE_INVALID:h.nm.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:h.nm.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:h.nm.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:R.Z.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:R.Z.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:R.Z.CODEC_UNSUPPORTED},T=function(){function e(e,t){if(this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(l()),this._config=o(),"object"==typeof t&&Object.assign(this._config,t),"flv"!==e.type.toLowerCase())throw new A.OC("FlvPlayer requires an flv MediaDataSource input!");!0===e.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=e,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var i=c.Z.chrome&&(c.Z.version.major<50||50===c.Z.version.major&&c.Z.version.build<2661);this._alwaysSeekKeyframe=!!(i||c.Z.msedge||c.Z.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return e.prototype.destroy=function(){null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null},e.prototype.on=function(e,t){var i=this;e===f.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){i._emitter.emit(f.MEDIA_INFO,i.mediaInfo)})):e===f.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){i._emitter.emit(f.STATISTICS_INFO,i.statisticsInfo)})),this._emitter.addListener(e,t)},e.prototype.off=function(e,t){this._emitter.removeListener(e,t)},e.prototype.attachMediaElement=function(e){var t=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new L(this._config),this._msectl.on(E.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(E.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(E.SOURCE_OPEN,(function(){t._mseSourceOpened=!0,t._hasPendingLoad&&(t._hasPendingLoad=!1,t.load())})),this._msectl.on(E.ERROR,(function(e){t._emitter.emit(f.ERROR,w.MEDIA_ERROR,O.MEDIA_MSE_ERROR,e)})),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}},e.prototype.detachMediaElement=function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)},e.prototype.load=function(){var e=this;if(!this._mediaElement)throw new A.rT("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new A.rT("FlvPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new b(this._mediaDataSource,this._config),this._transmuxer.on(v.Z.INIT_SEGMENT,(function(t,i){e._msectl.appendInitSegment(i)})),this._transmuxer.on(v.Z.MEDIA_SEGMENT,(function(t,i){if(e._msectl.appendMediaSegment(i),e._config.lazyLoad&&!e._config.isLive){var n=e._mediaElement.currentTime;i.info.endDts>=1e3*(n+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(d.Z.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(v.Z.LOADING_COMPLETE,(function(){e._msectl.endOfStream(),e._emitter.emit(f.LOADING_COMPLETE)})),this._transmuxer.on(v.Z.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(f.RECOVERED_EARLY_EOF)})),this._transmuxer.on(v.Z.IO_ERROR,(function(t,i){e._emitter.emit(f.ERROR,w.NETWORK_ERROR,t,i)})),this._transmuxer.on(v.Z.DEMUX_ERROR,(function(t,i){e._emitter.emit(f.ERROR,w.MEDIA_ERROR,t,{code:-1,msg:i})})),this._transmuxer.on(v.Z.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(f.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(v.Z.METADATA_ARRIVED,(function(t){e._emitter.emit(f.METADATA_ARRIVED,t)})),this._transmuxer.on(v.Z.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(f.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(v.Z.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(f.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(v.Z.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()))},e.prototype.unload=function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){return Object.assign({},this._mediaInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)},enumerable:!1,configurable:!0}),e.prototype._fillStatisticsInfo=function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},e.prototype._onmseUpdateEnd=function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,i=0,n=0;n=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(d.Z.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}},e.prototype._onmseBufferFull=function(){d.Z.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()},e.prototype._suspendTransmuxer=function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))},e.prototype._checkProgressAndResume=function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,i=!1,n=0;n=r&&e=s-this._config.lazyLoadRecoverDuration&&(i=!0);break}}i&&(window.clearInterval(this._progressChecker),this._progressChecker=null,i&&(d.Z.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))},e.prototype._isTimepointBuffered=function(e){for(var t=this._mediaElement.buffered,i=0;i=n&&e0){var r=this._mediaElement.buffered.start(0);(r<1&&e0&&t.currentTime0){var n=i.start(0);if(n<1&&t0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)},e.prototype.unload=function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)},e.prototype.play=function(){return this._mediaElement.play()},e.prototype.pause=function(){this._mediaElement.pause()},Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffered",{get:function(){return this._mediaElement.buffered},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._mediaElement.duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"muted",{get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mediaInfo",{get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statisticsInfo",{get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,i=0,n=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();i=r.totalVideoFrames,n=r.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(i=this._mediaElement.webkitDecodedFrameCount,n=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=i,e.droppedFrames=n),e},enumerable:!1,configurable:!0}),e.prototype._onvLoadedMetadata=function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(f.MEDIA_INFO,this.mediaInfo)},e.prototype._reportStatisticsInfo=function(){this._emitter.emit(f.STATISTICS_INFO,this.statisticsInfo)},e}();n.Z.install();var k={createPlayer:function(e,t){var i=e;if(null==i||"object"!=typeof i)throw new A.OC("MediaDataSource must be an javascript object!");if(!i.hasOwnProperty("type"))throw new A.OC("MediaDataSource must has type field to indicate video file type!");switch(i.type){case"flv":return new T(i,t);default:return new C(i,t)}},isSupported:function(){return a.supportMSEH264Playback()},getFeatureList:function(){return a.getFeatureList()}};k.BaseLoader=h.fp,k.LoaderStatus=h.GM,k.LoaderErrors=h.nm,k.Events=f,k.ErrorTypes=w,k.ErrorDetails=O,k.FlvPlayer=T,k.NativePlayer=C,k.LoggingControl=m.Z,Object.defineProperty(k,"version",{enumerable:!0,get:function(){return"1.6.2"}});var D=k},324:function(e,t,i){e.exports=i(60).default},191:function(e,t,i){"use strict";i.d(t,{Z:function(){return y}});var n,r=i(300),s=function(){function e(){this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return e.prototype.reset=function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0},e.prototype.addBytes=function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())},Object.defineProperty(e.prototype,"currentKBps",{get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastSecondKBps",{get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"averageKBps",{get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024},enumerable:!1,configurable:!0}),e}(),o=i(939),a=i(538),h=i(29),u=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),l=function(e){function t(t,i){var n=e.call(this,"fetch-stream-loader")||this;return n.TAG="FetchStreamLoader",n._seekHandler=t,n._config=i,n._needStash=!0,n._requestAbort=!1,n._contentLength=null,n._receivedLength=0,n}return u(t,e),t.isSupported=function(){try{var e=a.Z.msedge&&a.Z.version.minor>=15048,t=!a.Z.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}},t.prototype.destroy=function(){this.isWorking()&&this.abort(),e.prototype.destroy.call(this)},t.prototype.open=function(e,t){var i=this;this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(n=e.redirectedURL);var r=this._seekHandler.getConfig(n,t),s=new self.Headers;if("object"==typeof r.headers){var a=r.headers;for(var u in a)a.hasOwnProperty(u)&&s.append(u,a[u])}var l={method:"GET",headers:s,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"==typeof this._config.headers)for(var u in this._config.headers)s.append(u,this._config.headers[u]);!1===e.cors&&(l.mode="same-origin"),e.withCredentials&&(l.credentials="include"),e.referrerPolicy&&(l.referrerPolicy=e.referrerPolicy),self.AbortController&&(this._abortController=new self.AbortController,l.signal=this._abortController.signal),this._status=o.GM.kConnecting,self.fetch(r.url,l).then((function(e){if(i._requestAbort)return i._status=o.GM.kIdle,void e.body.cancel();if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==r.url&&i._onURLRedirect){var t=i._seekHandler.removeURLParameters(e.url);i._onURLRedirect(t)}var n=e.headers.get("Content-Length");return null!=n&&(i._contentLength=parseInt(n),0!==i._contentLength&&i._onContentLengthKnown&&i._onContentLengthKnown(i._contentLength)),i._pump.call(i,e.body.getReader())}if(i._status=o.GM.kError,!i._onError)throw new h.OZ("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);i._onError(o.nm.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(!i._abortController||!i._abortController.signal.aborted){if(i._status=o.GM.kError,!i._onError)throw e;i._onError(o.nm.EXCEPTION,{code:-1,msg:e.message})}}))},t.prototype.abort=function(){if(this._requestAbort=!0,(this._status!==o.GM.kBuffering||!a.Z.chrome)&&this._abortController)try{this._abortController.abort()}catch(e){}},t.prototype._pump=function(e){var t=this;return e.read().then((function(i){if(i.done)if(null!==t._contentLength&&t._receivedLength299)){if(this._status=o.GM.kError,!this._onError)throw new h.OZ("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(o.nm.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=o.GM.kBuffering}},t.prototype._onProgress=function(e){if(this._status!==o.GM.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,i=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,i,this._receivedLength)}},t.prototype._onLoadEnd=function(e){!0!==this._requestAbort?this._status!==o.GM.kError&&(this._status=o.GM.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1},t.prototype._onXhrError=function(e){this._status=o.GM.kError;var t=0,i=null;if(this._contentLength&&e.loaded=this._contentLength&&(i=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:i},this._internalOpen(this._dataSource,this._currentRequestRange)},t.prototype._internalOpen=function(e,t){this._lastTimeLoaded=0;var i=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?i=this._currentRedirectedURL:null!=e.redirectedURL&&(i=e.redirectedURL));var n=this._seekHandler.getConfig(i,t);this._currentRequestURL=n.url;var r=this._xhr=new XMLHttpRequest;if(r.open("GET",n.url,!0),r.responseType="arraybuffer",r.onreadystatechange=this._onReadyStateChange.bind(this),r.onprogress=this._onProgress.bind(this),r.onload=this._onLoad.bind(this),r.onerror=this._onXhrError.bind(this),e.withCredentials&&(r.withCredentials=!0),"object"==typeof n.headers){var s=n.headers;for(var o in s)s.hasOwnProperty(o)&&r.setRequestHeader(o,s[o])}if("object"==typeof this._config.headers){s=this._config.headers;for(var o in s)s.hasOwnProperty(o)&&r.setRequestHeader(o,s[o])}r.send()},t.prototype.abort=function(){this._requestAbort=!0,this._internalAbort(),this._status=o.GM.kComplete},t.prototype._internalAbort=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)},t.prototype._onReadyStateChange=function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var i=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&i!==this._currentRedirectedURL&&(this._currentRedirectedURL=i,this._onURLRedirect&&this._onURLRedirect(i))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=o.GM.kBuffering}else{if(this._status=o.GM.kError,!this._onError)throw new h.OZ("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(o.nm.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}},t.prototype._onProgress=function(e){if(this._status!==o.GM.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var i=e.total;this._internalAbort(),null!=i&0!==i&&(this._totalLength=i)}if(-1===this._range.to?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 n=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(n)}},t.prototype._normalizeSpeed=function(e){var t=this._chunkSizeKBList,i=t.length-1,n=0,r=0,s=i;if(e=t[n]&&e=3&&(t=this._speedSampler.currentKBps)),0!==t){var i=this._normalizeSpeed(t);this._currentSpeedNormalized!==i&&(this._currentSpeedNormalized=i,this._currentChunkSizeKB=i)}var n=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=n.byteLength;var s=!1;null!=this._contentLength&&this._receivedLength0&&this._receivedLength0)for(var s=i.split("&"),o=0;o0;a[0]!==this._startName&&a[0]!==this._endName&&(h&&(r+="&"),r+=s[o])}return 0===r.length?t:t+"?"+r},e}(),y=function(){function e(e,t,i){this.TAG="IOController",this._config=t,this._extraData=i,this._stashInitialSize=393216,null!=t.stashInitialSize&&t.stashInitialSize>0&&(this._stashInitialSize=t.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===t.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=e,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(e.url),this._refTotalLength=e.filesize?e.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new s,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._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return e.prototype.destroy=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._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null},e.prototype.isWorking=function(){return this._loader&&this._loader.isWorking()&&!this._paused},e.prototype.isPaused=function(){return this._paused},Object.defineProperty(e.prototype,"status",{get:function(){return this._loader.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extraData",{get:function(){return this._extraData},set:function(e){this._extraData=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onDataArrival",{get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSeeked",{get:function(){return this._onSeeked},set:function(e){this._onSeeked=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onError",{get:function(){return this._onError},set:function(e){this._onError=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onComplete",{get:function(){return this._onComplete},set:function(e){this._onComplete=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRedirect",{get:function(){return this._onRedirect},set:function(e){this._onRedirect=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRecoveredEarlyEof",{get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentURL",{get:function(){return this._dataSource.url},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRedirect",{get:function(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentRedirectedURL",{get:function(){return this._redirectedURL||this._dataSource.redirectedURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentSpeed",{get:function(){return this._loaderClass===_?this._loader.currentSpeed:this._speedSampler.lastSecondKBps},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"loaderType",{get:function(){return this._loader.type},enumerable:!1,configurable:!0}),e.prototype._selectSeekHandler=function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new g(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",i=e.seekParamEnd||"bend";this._seekHandler=new v(t,i)}else{if("custom"!==e.seekType)throw new h.OC("Invalid seekType in config: "+e.seekType);if("function"!=typeof e.customSeekHandler)throw new h.OC("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}},e.prototype._selectLoader=function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=m;else if(l.isSupported())this._loaderClass=l;else if(c.isSupported())this._loaderClass=c;else{if(!_.isSupported())throw new h.OZ("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=_}},e.prototype._createLoader=function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)},e.prototype.open=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))},e.prototype.abort=function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)},e.prototype.pause=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)},e.prototype.resume=function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}},e.prototype.seek=function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)},e.prototype._internalSeek=function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var i={from:e,to:-1};this._currentRange={from:i.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,i),this._onSeeked&&this._onSeeked()},e.prototype.updateUrl=function(e){if(!e||"string"!=typeof e||0===e.length)throw new h.OC("Url must be a non-empty string!");this._dataSource.url=e},e.prototype._expandBuffer=function(e){for(var t=this._stashSize;t+10485760){var n=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(i,0,t).set(n,0)}this._stashBuffer=i,this._bufferSize=t}},e.prototype._normalizeSpeed=function(e){var t=this._speedNormalizeList,i=t.length-1,n=0,r=0,s=i;if(e=t[n]&&e=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var i=1024*t+1048576;this._bufferSize0){var s=this._stashBuffer.slice(0,this._stashUsed);if((u=this._dispatchChunks(s,this._stashByteStart))0){l=new Uint8Array(s,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{if((u=this._dispatchChunks(e,t))this._bufferSize&&(this._expandBuffer(o),a=new Uint8Array(this._stashBuffer,0,this._bufferSize)),a.set(new Uint8Array(e,u),0),this._stashUsed+=o,this._stashByteStart=t+u}}else if(0===this._stashUsed){var o;if((u=this._dispatchChunks(e,t))this._bufferSize&&this._expandBuffer(o),(a=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e,u),0),this._stashUsed+=o,this._stashByteStart=t+u}else{var a,u;if(this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength),(a=new Uint8Array(this._stashBuffer,0,this._bufferSize)).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength,(u=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart))0){var l=new Uint8Array(this._stashBuffer,u);a.set(l,0)}this._stashUsed-=u,this._stashByteStart+=u}}},e.prototype._flushStashBuffer=function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),i=this._dispatchChunks(t,this._stashByteStart),n=t.byteLength-i;if(i0){var s=new Uint8Array(this._stashBuffer,0,this._bufferSize),o=new Uint8Array(t,i);s.set(o,0),this._stashUsed=o.byteLength,this._stashByteStart+=i}return 0}r.Z.w(this.TAG,n+" bytes unconsumed data remain when flush buffer, dropped")}return this._stashUsed=0,this._stashByteStart=0,n}return 0},e.prototype._onLoaderComplete=function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)},e.prototype._onLoaderError=function(e,t){switch(r.Z.e(this.TAG,"Loader error, code = "+t.code+", msg = "+t.msg),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=o.nm.UNRECOVERABLE_EARLY_EOF),e){case o.nm.EARLY_EOF:if(!this._config.isLive&&this._totalLength){var i=this._currentRange.to+1;return void(i=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\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)||[],r={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:n[0]||""},s={};if(r.browser){s[r.browser]=!0;var o=r.majorVersion.split(".");s.version={major:parseInt(r.majorVersion,10),string:r.version},o.length>1&&(s.version.minor=parseInt(o[1],10)),o.length>2&&(s.version.build=parseInt(o[2],10))}if(r.platform&&(s[r.platform]=!0),(s.chrome||s.opr||s.safari)&&(s.webkit=!0),s.rv||s.iemobile){s.rv&&delete s.rv;var a="msie";r.browser=a,s.msie=!0}if(s.edge){delete s.edge;var h="msedge";r.browser=h,s.msedge=!0}if(s.opr){var u="opera";r.browser=u,s.opera=!0}if(s.safari&&s.android){var l="android";r.browser=l,s.android=!0}for(var d in s.name=r.browser,s.platform=r.platform,i)i.hasOwnProperty(d)&&delete i[d];Object.assign(i,s)}(),t.Z=i},29:function(e,t,i){"use strict";i.d(t,{OZ:function(){return s},rT:function(){return o},OC:function(){return a},do:function(){return h}});var n,r=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=function(){function e(e){this._message=e}return Object.defineProperty(e.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),o=function(e){function t(t){return e.call(this,t)||this}return r(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"IllegalStateException"},enumerable:!1,configurable:!0}),t}(s),a=function(e){function t(t){return e.call(this,t)||this}return r(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"InvalidArgumentException"},enumerable:!1,configurable:!0}),t}(s),h=function(e){function t(t){return e.call(this,t)||this}return r(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"NotImplementedException"},enumerable:!1,configurable:!0}),t}(s)},300:function(e,t,i){"use strict";var n=i(716),r=i.n(n),s=function(){function e(){}return e.e=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","error",n),e.ENABLE_ERROR&&(console.error?console.error(n):console.warn?console.warn(n):console.log(n))},e.i=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","info",n),e.ENABLE_INFO&&(console.info?console.info(n):console.log(n))},e.w=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",n),e.ENABLE_WARN&&(console.warn?console.warn(n):console.log(n))},e.d=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",n),e.ENABLE_DEBUG&&(console.debug?console.debug(n):console.log(n))},e.v=function(t,i){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var n="["+t+"] > "+i;e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",n),e.ENABLE_VERBOSE&&console.log(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,s.ENABLE_CALLBACK=!1,s.emitter=new(r()),t.Z=s},846:function(e,t,i){"use strict";var n=i(716),r=i.n(n),s=i(300),o=function(){function e(){}return Object.defineProperty(e,"forceGlobalTag",{get:function(){return s.Z.FORCE_GLOBAL_TAG},set:function(t){s.Z.FORCE_GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"globalTag",{get:function(){return s.Z.GLOBAL_TAG},set:function(t){s.Z.GLOBAL_TAG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableAll",{get:function(){return s.Z.ENABLE_VERBOSE&&s.Z.ENABLE_DEBUG&&s.Z.ENABLE_INFO&&s.Z.ENABLE_WARN&&s.Z.ENABLE_ERROR},set:function(t){s.Z.ENABLE_VERBOSE=t,s.Z.ENABLE_DEBUG=t,s.Z.ENABLE_INFO=t,s.Z.ENABLE_WARN=t,s.Z.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableDebug",{get:function(){return s.Z.ENABLE_DEBUG},set:function(t){s.Z.ENABLE_DEBUG=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableVerbose",{get:function(){return s.Z.ENABLE_VERBOSE},set:function(t){s.Z.ENABLE_VERBOSE=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableInfo",{get:function(){return s.Z.ENABLE_INFO},set:function(t){s.Z.ENABLE_INFO=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableWarn",{get:function(){return s.Z.ENABLE_WARN},set:function(t){s.Z.ENABLE_WARN=t,e._notifyChange()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"enableError",{get:function(){return s.Z.ENABLE_ERROR},set:function(t){s.Z.ENABLE_ERROR=t,e._notifyChange()},enumerable:!1,configurable:!0}),e.getConfig=function(){return{globalTag:s.Z.GLOBAL_TAG,forceGlobalTag:s.Z.FORCE_GLOBAL_TAG,enableVerbose:s.Z.ENABLE_VERBOSE,enableDebug:s.Z.ENABLE_DEBUG,enableInfo:s.Z.ENABLE_INFO,enableWarn:s.Z.ENABLE_WARN,enableError:s.Z.ENABLE_ERROR,enableCallback:s.Z.ENABLE_CALLBACK}},e.applyConfig=function(e){s.Z.GLOBAL_TAG=e.globalTag,s.Z.FORCE_GLOBAL_TAG=e.forceGlobalTag,s.Z.ENABLE_VERBOSE=e.enableVerbose,s.Z.ENABLE_DEBUG=e.enableDebug,s.Z.ENABLE_INFO=e.enableInfo,s.Z.ENABLE_WARN=e.enableWarn,s.Z.ENABLE_ERROR=e.enableError,s.Z.ENABLE_CALLBACK=e.enableCallback},e._notifyChange=function(){var t=e.emitter;if(t.listenerCount("change")>0){var i=e.getConfig();t.emit("change",i)}},e.registerListener=function(t){e.emitter.addListener("change",t)},e.removeListener=function(t){e.emitter.removeListener("change",t)},e.addLogListener=function(t){s.Z.emitter.addListener("log",t),s.Z.emitter.listenerCount("log")>0&&(s.Z.ENABLE_CALLBACK=!0,e._notifyChange())},e.removeLogListener=function(t){s.Z.emitter.removeListener("log",t),0===s.Z.emitter.listenerCount("log")&&(s.Z.ENABLE_CALLBACK=!1,e._notifyChange())},e}();o.emitter=new(r()),t.Z=o},219:function(e,t,i){"use strict";var n=function(){function e(){}return e.install=function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i"):i}function o(t){if(self.console&&!0===t||"object"==typeof t){!function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i>8*(15-r)&255;return e},r.setDecryptDataFromLevelKey=function(t,e){var r=t;return"AES-128"===(null==t?void 0:t.method)&&t.uri&&!t.iv&&((r=o.a.fromURI(t.uri)).method=t.method,r.iv=this.createInitializationVector(e),r.keyFormat="identity"),r},r.setElementaryStreamInfo=function(t,e,r,i,n,a){void 0===a&&(a=!1);var s=this.elementaryStreams,o=s[t];o?(o.startPTS=Math.min(o.startPTS,e),o.endPTS=Math.max(o.endPTS,r),o.startDTS=Math.min(o.startDTS,i),o.endDTS=Math.max(o.endDTS,n)):s[t]={startPTS:e,endPTS:r,startDTS:i,endDTS:n,partial:a}},r.clearElementaryStreamInfo=function(){var t=this.elementaryStreams;t[i.AUDIO]=null,t[i.VIDEO]=null,t[i.AUDIOVIDEO]=null},c(e,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var t=this.sn;"number"!=typeof t&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&s.b.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),t=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,t)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(n.a)(this.programDateTime))return null;var t=Object(n.a)(this.duration)?this.duration:0;return this.programDateTime+1e3*t}},{key:"encrypted",get:function(){var t;return!(null===(t=this.decryptdata)||void 0===t||!t.keyFormat||!this.decryptdata.uri)}}]),e}(f),v=function(t){function e(e,r,i,n,a){var s;(s=t.call(this,i)||this).fragOffset=0,s.duration=0,s.gap=!1,s.independent=!1,s.relurl=void 0,s.fragment=void 0,s.index=void 0,s.stats=new l.a,s.duration=e.decimalFloatingPoint("DURATION"),s.gap=e.bool("GAP"),s.independent=e.bool("INDEPENDENT"),s.relurl=e.enumeratedString("URI"),s.fragment=r,s.index=n;var o=e.enumeratedString("BYTERANGE");return o&&s.setByteRange(o,a),a&&(s.fragOffset=a.fragOffset+a.duration),s}return u(e,t),c(e,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),e}(f)},function(t,e,r){"use strict";r.d(e,"b",(function(){return h})),r.d(e,"g",(function(){return d})),r.d(e,"f",(function(){return c})),r.d(e,"d",(function(){return f})),r.d(e,"c",(function(){return g})),r.d(e,"e",(function(){return p})),r.d(e,"h",(function(){return m})),r.d(e,"a",(function(){return y}));var i=r(9),n=r(5),a=Math.pow(2,32)-1,s=[].push;function o(t){return String.fromCharCode.apply(null,t)}function l(t,e){"data"in t&&(e+=t.start,t=t.data);var r=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return r<0?4294967296+r:r}function u(t,e,r){"data"in t&&(e+=t.start,t=t.data),t[e]=r>>24,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r}function h(t,e){var r,i,n,a=[];if(!e.length)return a;"data"in t?(r=t.data,i=t.start,n=t.end):(i=0,n=(r=t).byteLength);for(var u=i;u1?u+d:n;if(o(r.subarray(u+4,u+8))===e[0])if(1===e.length)a.push({data:r,start:u+8,end:c});else{var f=h({data:r,start:u+8,end:c},e.slice(1));f.length&&s.apply(a,f)}u=c}return a}function d(t){var e=h(t,["moov"])[0],r=e?e.end:null,i=h(t,["sidx"]);if(!i||!i[0])return null;var n=[],a=i[0],s=a.data[0],o=0===s?8:16,u=l(a,o);o+=4;o+=0===s?8:16,o+=2;var d=a.end+0,c=function(t,e){"data"in t&&(e+=t.start,t=t.data);var r=t[e]<<8|t[e+1];return r<0?65536+r:r}(a,o);o+=2;for(var f=0;f>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var m=l(a,g);g+=4,n.push({referenceSize:p,subsegmentDuration:m,info:{duration:m/u,start:d,end:d+p-1}}),d+=p,o=g+=4}return{earliestPresentationTime:0,timescale:u,version:s,referencesCount:c,references:n,moovEndOffset:r}}function c(t){for(var e=[],r=h(t,["moov","trak"]),i=0;i0)return t.subarray(r,r+i)},o=function(t,e){var r=0;return r=(127&t[e])<<21,r|=(127&t[e+1])<<14,r|=(127&t[e+2])<<7,r|=127&t[e+3]},l=function(t,e){return n(t,e)&&o(t,e+6)+10<=t.length-e},u=function(t){for(var e=c(t),r=0;r>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:u+=String.fromCharCode(a);break;case 12:case 13:s=t[h++],u+=String.fromCharCode((31&a)<<6|63&s);break;case 14:s=t[h++],o=t[h++],u+=String.fromCharCode((15&a)<<12|(63&s)<<6|(63&o)<<0)}}return u};function T(){return i||void 0===self.TextDecoder||(i=new self.TextDecoder("utf-8")),i}},function(t,e,r){"use strict";r.d(e,"c",(function(){return n})),r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return s}));function i(t,e,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var n=t*e*r;return i?Math.round(n):n}function n(t,e,r,n){return void 0===r&&(r=1),void 0===n&&(n=!1),i(t,e,1/r,n)}function a(t,e){return void 0===e&&(e=!1),i(t,1e3,1/9e4,e)}function s(t,e){return void 0===e&&(e=1),i(t,9e4,1/e)}},function(t,e,r){"use strict";function i(t,e,r){return Uint8Array.prototype.slice?t.slice(e,r):new Uint8Array(Array.prototype.slice.call(t,e,r))}r.d(e,"a",(function(){return i}))},function(t,e,r){"use strict";r.d(e,"c",(function(){return lt})),r.d(e,"d",(function(){return ht})),r.d(e,"a",(function(){return dt})),r.d(e,"b",(function(){return ct}));var i=r(0),n=r(2),a=r(15),s=r(3),o=r(7);var l=r(6),u=r(9),h=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var e=t.prototype;return e.resetInitSegment=function(t,e,r){this._id3Track={type:"id3",id:0,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},e.resetTimeStamp=function(){},e.resetContiguity=function(){},e.canParse=function(t,e){return!1},e.appendFrame=function(t,e,r){},e.demux=function(t,e){this.cachedData&&(t=Object(l.a)(this.cachedData,t),this.cachedData=null);var r,i,n=o.b(t,0),a=n?n.length:0,s=this._audioTrack,h=this._id3Track,c=n?o.d(n):void 0,f=t.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=d(c,e)),n&&n.length>0&&h.samples.push({pts:this.initPTS,dts:this.initPTS,data:n}),i=this.initPTS;a>>5}function m(t,e){return e+1=t.length)return!1;var i=p(t,e);if(i<=r)return!1;var n=e+i;return n===t.length||m(t,n)}return!1}function T(t,e,r,a,s){if(!t.samplerate){var o=function(t,e,r,a){var s,o,l,u,h=navigator.userAgent.toLowerCase(),d=a,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];s=1+((192&e[r+2])>>>6);var g=(60&e[r+2])>>>2;if(!(g>c.length-1))return l=(1&e[r+2])<<2,l|=(192&e[r+3])>>>6,f.b.log("manifest codec:"+a+", ADTS type:"+s+", samplingIndex:"+g),/firefox/i.test(h)?g>=6?(s=5,u=new Array(4),o=g-3):(s=2,u=new Array(2),o=g):-1!==h.indexOf("android")?(s=2,u=new Array(2),o=g):(s=5,u=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&g>=6?o=g-3:((a&&-1!==a.indexOf("mp4a.40.2")&&(g>=6&&1===l||/vivaldi/i.test(h))||!a&&1===l)&&(s=2,u=new Array(2)),o=g)),u[0]=s<<3,u[0]|=(14&g)>>1,u[1]|=(1&g)<<7,u[1]|=l<<3,5===s&&(u[1]|=(14&o)>>1,u[2]=(1&o)<<7,u[2]|=8,u[3]=0),{config:u,samplerate:c[g],channelCount:l,codec:"mp4a.40."+s,manifestCodec:d};t.trigger(i.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+g})}(e,r,a,s);if(!o)return;t.config=o.config,t.samplerate=o.samplerate,t.channelCount=o.channelCount,t.codec=o.codec,t.manifestCodec=o.manifestCodec,f.b.log("parsed codec:"+t.codec+", rate:"+o.samplerate+", channels:"+o.channelCount)}}function b(t){return 9216e4/t}function E(t,e,r,i,n){var a=function(t,e,r,i,n){var a=v(t,e),s=p(t,e);if((s-=a)>0)return{headerLength:a,frameLength:s,stamp:r+i*n}}(e,r,i,n,b(t.samplerate));if(a){var s,o=a.frameLength,l=a.headerLength,u=a.stamp,h=l+o,d=Math.max(0,r+h-e.length);d?(s=new Uint8Array(h-l)).set(e.subarray(r+l,e.length),0):s=e.subarray(r+l,r+h);var c={unit:s,pts:u};return d||t.samples.push(c),{sample:c,length:h,missing:d}}}function S(t,e){return(S=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var L=function(t){var e,r;function i(e,r){var i;return(i=t.call(this)||this).observer=void 0,i.config=void 0,i.observer=e,i.config=r,i}r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,S(e,r);var n=i.prototype;return n.resetInitSegment=function(e,r,i){t.prototype.resetInitSegment.call(this,e,r,i),this._audioTrack={container:"audio/adts",type:"audio",id:0,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}},i.probe=function(t){if(!t)return!1;for(var e=(o.b(t,0)||[]).length,r=t.length;e0},e.demux=function(t){var e=t,r={type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0};if(this.config.progressive){this.remainderData&&(e=Object(l.a)(this.remainderData,t));var i=Object(l.h)(e);this.remainderData=i.remainder,r.samples=i.valid||new Uint8Array}else r.samples=e;return{audioTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},avcTrack:r,id3Track:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},textTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},e.flush=function(){var t={type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0};return t.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},avcTrack:t,id3Track:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0},textTrack:{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},e.demuxSampleAes=function(t,e,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},e.destroy=function(){},t}();R.minProbeByteLength=1024;var D=R,k=null,_=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],I=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],C=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],w=[0,1,1,4];function O(t,e,r,i,n){if(!(r+24>e.length)){var a=x(e,r);if(a&&r+a.frameLength<=e.length){var s=i+n*(9e4*a.samplesPerFrame/a.sampleRate),o={unit:e.subarray(r,r+a.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(o),{sample:o,length:a.frameLength,missing:0}}}}function x(t,e){var r=t[e+1]>>3&3,i=t[e+1]>>1&3,n=t[e+2]>>4&15,a=t[e+2]>>2&3;if(1!==r&&0!==n&&15!==n&&3!==a){var s=t[e+2]>>1&1,o=t[e+3]>>6,l=1e3*_[14*(3===r?3-i:3===i?3:4)+n-1],u=I[3*(3===r?0:2===r?1:2)+a],h=3===o?1:2,d=C[r][i],c=w[i],f=8*d*c,g=Math.floor(d*l/u+s)*c;if(null===k){var v=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);k=v?parseInt(v[1]):0}return!!k&&k<=87&&2===i&&l>=224e3&&0===o&&(t[e+3]=128|t[e+3]),{sampleRate:u,channelCount:h,frameLength:g,samplesPerFrame:f}}}function P(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function M(t,e){return e+1t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},e.readBits=function(t){var e=Math.min(this.bitsAvailable,t),r=this.word>>>32-e;return t>32&&f.b.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)>0&&this.bitsAvailable?r<>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},e.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.skipEG=function(){this.skipBits(1+this.skipLZ())},e.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},e.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},e.readBoolean=function(){return 1===this.readBits(1)},e.readUByte=function(){return this.readBits(8)},e.readUShort=function(){return this.readBits(16)},e.readUInt=function(){return this.readBits(32)},e.skipScalingList=function(t){for(var e=8,r=8,i=0;i=t.length)return void r();if(!(t[e].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(t,e,r,i),!i)return}}},e.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,r=new Int8Array(e),i=0,n=32;n<=t.length-16;n+=160,i+=16)r.set(t.subarray(n,n+16),i);return r},e.getAvcDecryptedUnit=function(t,e){for(var r=new Uint8Array(e),i=0,n=32;n<=t.length-16;n+=160,i+=16)t.set(r.subarray(i,i+16),n);return t},e.decryptAvcSample=function(t,e,r,i,n,a){var s=q(n.data),o=this.getAvcEncryptedData(s),l=this;this.decryptBuffer(o.buffer,(function(o){n.data=l.getAvcDecryptedUnit(s,o),a||l.decryptAvcSamples(t,e,r+1,i)}))},e.decryptAvcSamples=function(t,e,r,i){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,r=0){if(e>=t.length)return void i();for(var n=t[e].units;!(r>=n.length);r++){var a=n[r];if(!(a.data.length<=48||1!==a.type&&5!==a.type)){var s=this.decrypter.isSync();if(this.decryptAvcSample(t,e,r,i,a,s),!s)return}}}},t}(),B={video:1,audio:2,id3:3,text:4},G=function(){function t(t,e,r){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=r}t.probe=function(e){var r=t.syncOffset(e);return!(r<0)&&(r&&f.b.warn("MPEG2-TS detected but first sync word found @ offset "+r+", junk ahead ?"),!0)},t.syncOffset=function(t){for(var e=Math.min(1e3,t.length-564),r=0;r>4>1){if((k=A+5+e[A+4])===A+188)continue}else k=A+4;switch(D){case c:R&&(g&&(o=V(g))&&this.parseAVCPES(o,!1),g={data:[],size:0}),g&&(g.data.push(e.subarray(k,A+188)),g.size+=A+188-k);break;case v:R&&(m&&(o=V(m))&&(h.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),m={data:[],size:0}),m&&(m.data.push(e.subarray(k,A+188)),m.size+=A+188-k);break;case p:R&&(y&&(o=V(y))&&this.parseID3PES(o),y={data:[],size:0}),y&&(y.data.push(e.subarray(k,A+188)),y.size+=A+188-k);break;case 0:R&&(k+=e[k]+1),E=this._pmtId=j(e,k);break;case E:R&&(k+=e[k]+1);var _=H(e,k,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,a);(c=_.avc)>0&&(u.pid=c),(v=_.audio)>0&&(h.pid=v,h.isAAC=_.isAAC),(p=_.id3)>0&&(d.pid=p),T&&!b&&(f.b.log("reparse from beginning"),T=!1,A=L-188),b=this.pmtParsed=!0;break;case 17:case 8191:break;default:T=!0}}else this.observer.emit(i.a.ERROR,i.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});u.pesData=g,h.pesData=m,d.pesData=y;var I={audioTrack:h,avcTrack:u,id3Track:d,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(I),I},e.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},e.extractRemainingSamples=function(t){var e,r=t.audioTrack,i=t.avcTrack,n=t.id3Track,a=i.pesData,s=r.pesData,o=n.pesData;a&&(e=V(a))?(this.parseAVCPES(e,!0),i.pesData=null):i.pesData=a,s&&(e=V(s))?(r.isAAC?this.parseAACPES(e):this.parseMPEGPES(e),r.pesData=null):(null!=s&&s.size&&f.b.log("last AAC PES packet truncated,might overlap between fragments"),r.pesData=s),o&&(e=V(o))?(this.parseID3PES(e),n.pesData=null):n.pesData=o},e.demuxSampleAes=function(t,e,r){var i=this.demux(t,r,!0,!this.config.progressive),n=this.sampleAes=new U(this.observer,this.config,e);return this.decrypt(i,n)},e.decrypt=function(t,e){return new Promise((function(r){var i=t.audioTrack,n=t.avcTrack;i.samples&&i.isAAC?e.decryptAacSamples(i.samples,0,(function(){n.samples?e.decryptAvcSamples(n.samples,0,0,(function(){r(t)})):r(t)})):n.samples&&e.decryptAvcSamples(n.samples,0,0,(function(){r(t)}))}))},e.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},e.parseAVCPES=function(t,e){var r,i=this,n=this._avcTrack,a=this.parseAVCNALu(t.data),s=this.avcSample,l=!1;t.data=null,s&&a.length&&!n.audFound&&(W(s,n),s=this.avcSample=K(!1,t.pts,t.dts,"")),a.forEach((function(e){switch(e.type){case 1:r=!0,s||(s=i.avcSample=K(!0,t.pts,t.dts,"")),s.frame=!0;var a=e.data;if(l&&a.length>4){var u=new N(a).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(s.key=!0)}break;case 5:r=!0,s||(s=i.avcSample=K(!0,t.pts,t.dts,"")),s.key=!0,s.frame=!0;break;case 6:r=!0;var h=new N(q(e.data));h.readUByte();for(var d=0,c=0,f=!1,g=0;!f&&h.bytesAvailable>1;){d=0;do{d+=g=h.readUByte()}while(255===g);c=0;do{c+=g=h.readUByte()}while(255===g);if(4===d&&0!==h.bytesAvailable){if(f=!0,181===h.readUByte())if(49===h.readUShort())if(1195456820===h.readUInt())if(3===h.readUByte()){for(var v=h.readUByte(),p=31&v,m=[v,h.readUByte()],y=0;y16){for(var T=[],b=0;b<16;b++)T.push(h.readUByte().toString(16)),3!==b&&5!==b&&7!==b&&9!==b||T.push("-");for(var E=c-16,S=new Uint8Array(E),L=0;L=0){var d={data:t.subarray(u,l-a-1),type:h};o.push(d)}else{var c=this.getLastNalUnit();if(c&&(s&&l<=4-s&&c.state&&(c.data=c.data.subarray(0,c.data.byteLength-s)),(r=l-a-1)>0)){var f=new Uint8Array(c.data.byteLength+r);f.set(c.data,0),f.set(t.subarray(0,r),c.data.byteLength),c.data=f}}l=0&&a>=0){var g={data:t.subarray(u,i),type:h,state:a};o.push(g)}if(0===o.length){var v=this.getLastNalUnit();if(v){var p=new Uint8Array(v.data.byteLength+t.byteLength);p.set(v.data,0),p.set(t,v.data.byteLength),v.data=p}}return n.naluState=a,o},e.parseAACPES=function(t){var e,r,a,s,o,l=0,u=this._audioTrack,h=this.aacOverFlow,d=t.data;if(h){this.aacOverFlow=null;var c=h.sample.unit.byteLength,g=Math.min(h.missing,c),v=c-g;h.sample.unit.set(d.subarray(0,g),v),u.samples.push(h.sample),l=h.missing}for(e=l,r=d.length;e1;){var l=new Uint8Array(o[0].length+o[1].length);l.set(o[0]),l.set(o[1],o[0].length),o[0]=l,o.splice(1,1)}if(1===((e=o[0])[0]<<16)+(e[1]<<8)+e[2]){if((r=(e[4]<<8)+e[5])&&r>t.size-6)return null;var u=e[7];192&u&&(n=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&u?n-(a=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(f.b.warn(Math.round((n-a)/9e4)+"s delta between PTS and DTS, align them"),n=a):a=n);var h=(i=e[8])+9;if(t.size<=h)return null;t.size-=h;for(var d=new Uint8Array(t.size),c=0,g=o.length;cv){h-=v;continue}e=e.subarray(h),v-=h,h=0}d.set(e,s),s+=v}return r&&(r-=i+3),{data:d,pts:n,dts:a,len:r}}return null}function W(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){var r=e.samples,i=r.length;if(!i)return void e.dropped++;var n=r[i-1];t.pts=n.pts,t.dts=n.dts}e.samples.push(t)}t.debug.length&&f.b.log(t.pts+"/"+t.dts+":"+t.debug)}function Y(t,e){var r=t.length;if(r>0){if(e.pts>=t[r-1].pts)t.push(e);else for(var i=r-1;i>=0;i--)if(e.pts0?this.lastEndDTS=p:(f.b.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var m=!!c.audio,y=!!c.video,T="";m&&(T+="audio"),y&&(T+="video");var b={data1:h,startPTS:v,startDTS:v,endPTS:p,endDTS:p,type:T,hasAudio:m,hasVideo:y,nb:1,dropped:0};return u.audio="audio"===b.type?b:void 0,u.video="audio"!==b.type?b:void 0,u.text=i,u.id3=r,u.initSegment=d,u},t}(),et=function(t,e,r){return Object(l.d)(t,e)-r};function rt(t,e){var r=null==t?void 0:t.codec;return r&&r.length>4?r:"hvc1"===r?"hvc1.1.c.L120.90":"av01"===r?"av01.0.04M.08":"avc1"===r||e===Z.a.VIDEO?"avc1.42e01e":"mp4a.40.5"}var it,nt=tt,at=r(13);try{it=self.performance.now.bind(self.performance)}catch(t){f.b.debug("Unable to use Performance API on this environment"),it=self.Date.now}var st=[{demux:X,remux:J.a},{demux:D,remux:nt},{demux:A,remux:J.a},{demux:$,remux:J.a}],ot=1024;st.forEach((function(t){var e=t.demux;ot=Math.max(ot,e.minProbeByteLength)}));var lt=function(){function t(t,e,r,i,n){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new at.a,this.observer=t,this.typeSupported=e,this.config=r,this.vendor=i,this.id=n}var e=t.prototype;return e.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},e.push=function(t,e,r,i){var n=this,a=r.transmuxing;a.executeStart=it();var s=new Uint8Array(t),o=this.cache,u=this.config,h=this.currentTransmuxState,d=this.transmuxConfig;i&&(this.currentTransmuxState=i);var c=function(t,e){var r=null;t.byteLength>0&&null!=e&&null!=e.key&&null!==e.iv&&null!=e.method&&(r=e);return r}(s,e);if(c&&"AES-128"===c.method){var f=this.getDecrypter();if(!u.enableSoftwareAES)return this.decryptionPromise=f.webCryptoDecrypt(s,c.key.buffer,c.iv.buffer).then((function(t){var e=n.push(t,null,r);return n.decryptionPromise=null,e})),this.decryptionPromise;var g=f.softwareDecrypt(s,c.key.buffer,c.iv.buffer);if(!g)return a.executeEnd=it(),ut(r);s=new Uint8Array(g)}var v=i||h,p=v.contiguous,m=v.discontinuity,y=v.trackSwitch,T=v.accurateTimeOffset,b=v.timeOffset,E=d.audioCodec,S=d.videoCodec,L=d.defaultInitPts,A=d.duration,R=d.initSegmentData;if((m||y)&&this.resetInitSegment(R,E,S,A),m&&this.resetInitialTimestamp(L),p||this.resetContiguity(),this.needsProbing(s,m,y)){if(o.dataLength){var D=o.flush();s=Object(l.a)(D,s)}this.configureTransmuxer(s,d)}var k=this.transmux(s,c,b,T,r),_=this.currentTransmuxState;return _.contiguous=!0,_.discontinuity=!1,_.trackSwitch=!1,a.executeEnd=it(),k},e.flush=function(t){var e=this,r=t.transmuxing;r.executeStart=it();var a=this.decrypter,s=this.cache,o=this.currentTransmuxState,l=this.decryptionPromise;if(l)return l.then((function(){return e.flush(t)}));var u=[],h=o.timeOffset;if(a){var d=a.flush();d&&u.push(this.push(d,null,t))}var c=s.dataLength;s.reset();var f=this.demuxer,g=this.remuxer;if(!f||!g)return c>=ot&&this.observer.emit(i.a.ERROR,i.a.ERROR,{type:n.b.MEDIA_ERROR,details:n.a.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),r.executeEnd=it(),[ut(t)];var v=f.flush(h);return ht(v)?v.then((function(r){return e.flushRemux(u,r,t),u})):(this.flushRemux(u,v,t),u)},e.flushRemux=function(t,e,r){var i=e.audioTrack,n=e.avcTrack,a=e.id3Track,s=e.textTrack,o=this.currentTransmuxState,l=o.accurateTimeOffset,u=o.timeOffset;f.b.log("[transmuxer.ts]: Flushed fragment "+r.sn+(r.part>-1?" p: "+r.part:"")+" of level "+r.level);var h=this.remuxer.remux(i,n,a,s,u,l,!0,this.id);t.push({remuxResult:h,chunkMeta:r}),r.transmuxing.executeEnd=it()},e.resetInitialTimestamp=function(t){var e=this.demuxer,r=this.remuxer;e&&r&&(e.resetTimeStamp(t),r.resetTimeStamp(t))},e.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},e.resetInitSegment=function(t,e,r,i){var n=this.demuxer,a=this.remuxer;n&&a&&(n.resetInitSegment(e,r,i),a.resetInitSegment(t,e,r))},e.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},e.transmux=function(t,e,r,i,n){return e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,r,i,n):this.transmuxUnencrypted(t,r,i,n)},e.transmuxUnencrypted=function(t,e,r,i){var n=this.demuxer.demux(t,e,!1,!this.config.progressive),a=n.audioTrack,s=n.avcTrack,o=n.id3Track,l=n.textTrack;return{remuxResult:this.remuxer.remux(a,s,o,l,e,r,!1,this.id),chunkMeta:i}},e.transmuxSampleAes=function(t,e,r,i,n){var a=this;return this.demuxer.demuxSampleAes(t,e,r).then((function(t){return{remuxResult:a.remuxer.remux(t.audioTrack,t.avcTrack,t.id3Track,t.textTrack,r,i,!1,a.id),chunkMeta:n}}))},e.configureTransmuxer=function(t,e){for(var r,i=this.config,n=this.observer,a=this.typeSupported,s=this.vendor,o=e.audioCodec,l=e.defaultInitPts,u=e.duration,h=e.initSegmentData,d=e.videoCodec,c=0,g=st.length;c>>8^255&p^99,t[f]=p,e[p]=f;var m=c[f],y=c[m],T=c[y],b=257*c[p]^16843008*p;i[f]=b<<24|b>>>8,n[f]=b<<16|b>>>16,a[f]=b<<8|b>>>24,s[f]=b,b=16843009*T^65537*y^257*m^16843008*f,l[p]=b<<24|b>>>8,u[p]=b<<16|b>>>16,h[p]=b<<8|b>>>24,d[p]=b,f?(f=m^c[c[c[T^m]]],g^=c[c[g]]):f=g=1}},e.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),r=!0,i=0;i1?r-1:0),n=1;n>24&255,o[1]=e>>16&255,o[2]=e>>8&255,o[3]=255&e,o.set(t,4),a=0,e=8;a>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,r,i){return t.box(t.types.moof,t.mfhd(e),t.traf(i,r))},t.moov=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trak(e[r]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(t.mvex(e)))},t.mvex=function(e){for(var r=e.length,i=[];r--;)i[r]=t.trex(e[r]);return t.box.apply(null,[t.types.mvex].concat(i))},t.mvhd=function(e,r){r*=e;var i=Math.floor(r/(a+1)),n=Math.floor(r%(a+1)),s=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,n>>24,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]);return t.box(t.types.mvhd,s)},t.sdtp=function(e){var r,i,n=e.samples||[],a=new Uint8Array(4+n.length);for(r=0;r>>8&255),a.push(255&n),a=a.concat(Array.prototype.slice.call(i));for(r=0;r>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(i));var o=t.box(t.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|e.sps.length].concat(a).concat([e.pps.length]).concat(s))),l=e.width,u=e.height,h=e.pixelRatio[0],d=e.pixelRatio[1];return t.box(t.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,l>>8&255,255&l,u>>8&255,255&u,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]),o,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,255&h,d>>24,d>>16&255,d>>8&255,255&d])))},t.esds=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]))},t.mp4a=function(e){var r=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var r=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var r=e.id,i=e.duration*e.timescale,n=e.width,s=e.height,o=Math.floor(i/(a+1)),l=Math.floor(i%(a+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,l>>24,l>>16&255,l>>8&255,255&l,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,n>>8&255,255&n,0,0,s>>8&255,255&s,0,0]))},t.traf=function(e,r){var i=t.sdtp(e),n=e.id,s=Math.floor(r/(a+1)),o=Math.floor(r%(a+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,o>>24,o>>16&255,o>>8&255,255&o])),t.trun(e,i.length+16+20+8+16+8+8),i)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var r=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,r){var i,n,a,s,o,l,u=e.samples||[],h=u.length,d=12+16*h,c=new Uint8Array(d);for(r+=8+d,c.set([0,0,15,1,h>>>24&255,h>>>16&255,h>>>8&255,255&h,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),i=0;i>>24&255,a>>>16&255,a>>>8&255,255&a,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return t.box(t.types.trun,c)},t.initSegment=function(e){t.types||t.init();var r=t.moov(e),i=new Uint8Array(t.FTYP.byteLength+r.byteLength);return i.set(t.FTYP),i.set(r,t.FTYP.byteLength),i},t}();s.types=void 0,s.HDLR_TYPES=void 0,s.STTS=void 0,s.STSC=void 0,s.STCO=void 0,s.STSZ=void 0,s.VMHD=void 0,s.SMHD=void 0,s.STSD=void 0,s.FTYP=void 0,s.DINF=void 0;var o=s,l=r(0),u=r(2),h=r(1),d=r(4),c=r(8);function f(){return(f=Object.assign||function(t){for(var e=1;e0?t:r.pts}),t[0].pts);return e&&h.b.debug("PTS rollover detected"),r},e.remux=function(t,e,r,i,n,a,s,o){var l,u,c,f,g,v,p=n,m=n,T=t.pid>-1,b=e.pid>-1,E=e.samples.length,S=t.samples.length>0,L=E>1;if((!T||S)&&(!b||L)||this.ISGenerated||s){this.ISGenerated||(c=this.generateIS(t,e,n));var A=this.isVideoContiguous,R=-1;if(L&&(R=function(t){for(var e=0;e0){h.b.warn("[mp4-remuxer]: Dropped "+R+" out of "+E+" video samples due to a missing keyframe");var D=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(R),e.dropped+=R,m+=(e.samples[0].pts-D)/(e.timescale||9e4)}else-1===R&&(h.b.warn("[mp4-remuxer]: No keyframe found out of "+E+" video samples"),v=!1);if(this.ISGenerated){if(S&&L){var k=this.getVideoStartPts(e.samples),_=(y(t.samples[0].pts,k)-k)/e.inputTimeScale;p+=Math.max(0,_),m+=Math.max(0,-_)}if(S){if(t.samplerate||(h.b.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),c=this.generateIS(t,e,n)),u=this.remuxAudio(t,p,this.isAudioContiguous,a,b||L||o===d.b.AUDIO?m:void 0),L){var I=u?u.endPTS-u.startPTS:0;e.inputTimeScale||(h.b.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),c=this.generateIS(t,e,n)),l=this.remuxVideo(e,m,A,I)}}else L&&(l=this.remuxVideo(e,m,A,0));l&&(l.firstKeyFrame=R,l.independent=-1!==R)}}return this.ISGenerated&&(r.samples.length&&(g=this.remuxID3(r,n)),i.samples.length&&(f=this.remuxText(i,n))),{audio:u,video:l,initSegment:c,independent:v,text:f,id3:g}},e.generateIS=function(t,e,r){var n,a,s,l=t.samples,u=e.samples,h=this.typeSupported,d={},c=!Object(i.a)(this._initPTS),f="audio/mp4";if(c&&(n=a=1/0),t.config&&l.length&&(t.timescale=t.samplerate,t.isAAC||(h.mpeg?(f="audio/mpeg",t.codec=""):h.mp3&&(t.codec="mp3")),d.audio={id:"audio",container:f,codec:t.codec,initSegment:!t.isAAC&&h.mpeg?new Uint8Array(0):o.initSegment([t]),metadata:{channelCount:t.channelCount}},c&&(s=t.inputTimeScale,n=a=l[0].pts-Math.round(s*r))),e.sps&&e.pps&&u.length&&(e.timescale=e.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:o.initSegment([e]),metadata:{width:e.width,height:e.height}},c)){s=e.inputTimeScale;var g=this.getVideoStartPts(u),v=Math.round(s*r);a=Math.min(a,y(u[0].dts,g)-v),n=Math.min(n,g-v)}if(Object.keys(d).length)return this.ISGenerated=!0,c&&(this._initPTS=n,this._initDTS=a),{tracks:d,initPTS:n,timescale:s}},e.remuxVideo=function(t,e,r,i){var n,a,s,d=t.inputTimeScale,v=t.samples,m=[],b=v.length,E=this._initPTS,S=this.nextAvcDts,L=8,A=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,D=0,k=!1;r&&null!==S||(S=e*d-(v[0].pts-y(v[0].dts,v[0].pts)));for(var _=0;_I.pts){D=Math.max(Math.min(D,I.pts-I.dts),-18e3)}I.dts0?_-1:_].dts&&(k=!0)}k&&v.sort((function(t,e){var r=t.dts-e.dts,i=t.pts-e.pts;return r||i})),a=v[0].dts,s=v[v.length-1].dts;var C=Math.round((s-a)/(b-1));if(D<0){if(D<-2*C){h.b.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(c.b)(-C,!0)+" ms");for(var w=D,O=0;OC;if(M||P<-1){M?h.b.warn("AVC: "+Object(c.b)(P,!0)+" ms ("+P+"dts) hole between fragments detected, filling it"):h.b.warn("AVC: "+Object(c.b)(-P,!0)+" ms ("+P+"dts) overlapping between fragments detected"),a=S;var F=v[0].pts-P;v[0].dts=a,v[0].pts=F,h.b.log("Video: First PTS/DTS adjusted: "+Object(c.b)(F,!0)+"/"+Object(c.b)(a,!0)+", delta: "+Object(c.b)(P,!0)+" ms")}}p&&(a=Math.max(0,a));for(var N=0,U=0,B=0;B0?X-1:X].dts;if(it.stretchShortVideoTrack&&null!==this.nextAudioPts){var at=Math.floor(it.maxBufferHole*d),st=(i?A+i*d:this.nextAudioPts)-z.pts;st>at?((n=st-nt)<0&&(n=nt),h.b.log("[mp4-remuxer]: It is approximately "+st/90+" ms to the next segment; using duration "+n/90+" ms for the last video frame.")):n=nt}else n=nt}var ot=Math.round(z.pts-z.dts);m.push(new T(z.key,n,$,ot))}if(m.length&&g&&g<70){var lt=m[0].flags;lt.dependsOn=2,lt.isNonSync=0}this.nextAvcDts=S=s+n,this.isVideoContiguous=!0;var ut={data1:o.moof(t.sequenceNumber++,a,f({},t,{samples:m})),data2:W,startPTS:A/d,endPTS:(R+n)/d,startDTS:a/d,endDTS:S/d,type:"video",hasAudio:!1,hasVideo:!0,nb:m.length,dropped:t.dropped};return t.samples=[],t.dropped=0,ut},e.remuxAudio=function(t,e,r,i,a){var s=t.inputTimeScale,d=s/(t.samplerate?t.samplerate:s),c=t.isAAC?1024:1152,g=c*d,v=this._initPTS,p=!t.isAAC&&this.typeSupported.mpeg,m=[],b=t.samples,E=p?0:8,S=this.nextAudioPts||-1,L=e*s;if(this.isAudioContiguous=r=r||b.length&&S>0&&(i&&Math.abs(L-S)<9e3||Math.abs(y(b[0].pts-v,L)-S)<20*g),b.forEach((function(t){t.pts=y(t.pts-v,L)})),!r||S<0){if(!(b=b.filter((function(t){return t.pts>=0}))).length)return;S=0===a?0:i?Math.max(0,L):b[0].pts}if(t.isAAC)for(var A=void 0!==a,R=this.config.maxAudioFramesDrift,D=0,k=S;D=R*g&&w<1e4&&A){var O=Math.round(C/g);(k=I-O*g)<0&&(O--,k+=g),0===D&&(this.nextAudioPts=S=k),h.b.warn("[mp4-remuxer]: Injecting "+O+" audio frame @ "+(k/s).toFixed(3)+"s due to "+Math.round(1e3*C/s)+" ms gap.");for(var x=0;x0))return;B+=E;try{F=new Uint8Array(B)}catch(t){return void this.observer.emit(l.a.ERROR,l.a.ERROR,{type:u.b.MUX_ERROR,details:u.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:B,reason:"fail allocating audio mdat "+B})}p||(new DataView(F.buffer).setUint32(0,B),F.set(o.types.mdat,4))}F.set(V,E);var Y=V.byteLength;E+=Y,m.push(new T(!0,c,Y,0)),U=W}var q=m.length;if(q){var X=m[m.length-1];this.nextAudioPts=S=U+d*X.duration;var z=p?new Uint8Array(0):o.moof(t.sequenceNumber++,N/d,f({},t,{samples:m}));t.samples=[];var Q=N/s,$=S/s,J={data1:z,data2:F,startPTS:Q,endPTS:$,startDTS:Q,endDTS:$,type:"audio",hasAudio:!0,hasVideo:!1,nb:q};return this.isAudioContiguous=!0,J}},e.remuxEmptyAudio=function(t,e,r,i){var a=t.inputTimeScale,s=a/(t.samplerate?t.samplerate:a),o=this.nextAudioPts,l=(null!==o?o:i.startDTS*a)+this._initDTS,u=i.endDTS*a+this._initDTS,d=1024*s,c=Math.ceil((u-l)/d),f=n.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(h.b.warn("[mp4-remuxer]: remux empty Audio"),f){for(var g=[],v=0;v4294967296;)t+=r;return t}var T=function(t,e,r,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=r,this.cts=i,this.flags=new b(t)},b=function(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var i=r(11);function n(t,e){for(var r=0;r0}),!1)}t.exports=function(t,e){e=e||{};var n={main:r.m},o=e.all?{main:Object.keys(n.main)}:function(t,e){for(var r={main:[e]},i={main:[]},n={main:{}};s(r);)for(var o=Object.keys(r),l=0;lt.endSN||e>0||0===e&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay},e=t,(r=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(n.a)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var t=this.driftEndTime-this.driftStartTime;return t>0?1e3*(this.driftEnd-this.driftStart)/t:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var t;return null!==(t=this.fragments)&&void 0!==t&&t.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&h(e.prototype,r),i&&h(e,i),t}(),c=r(17),f=/^(\d+)x(\d+)$/,g=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,v=function(){function t(e){for(var r in"string"==typeof e&&(e=t.parseAttrList(e)),e)e.hasOwnProperty(r)&&(this[r]=e[r])}var e=t.prototype;return e.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var r=new Uint8Array(e.length/2),i=0;iNumber.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var r=this[t];return r?parseFloat(r):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=f.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,r={};for(g.lastIndex=0;null!==(e=g.exec(t));){var i=e[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),r[e[1]]=i}return r},t}(),p={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function m(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}var y=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,T=/#EXT-X-MEDIA:(.*)/g,b=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),E=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),S=/\.(mp4|m4s|m4v|m4a)$/i;var L=function(){function t(){}return t.findGroup=function(t,e){for(var r=0;r2){var r=e.shift()+".";return r+=parseInt(e.shift()).toString(16),r+=("000"+parseInt(e.shift()).toString(16)).substr(-4)}return t},t.resolve=function(t,e){return i.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,r){var i,n=[],a={},s=!1;for(y.lastIndex=0;null!=(i=y.exec(e));)if(i[1]){var o=new v(i[1]),l={attrs:o,bitrate:o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),name:o.NAME,url:t.resolve(i[2],r)},u=o.decimalResolution("RESOLUTION");u&&(l.width=u.width,l.height=u.height),A((o.CODECS||"").split(/[ ,]+/).filter((function(t){return t})),l),l.videoCodec&&-1!==l.videoCodec.indexOf("avc1")&&(l.videoCodec=t.convertAVC1ToAVCOTI(l.videoCodec)),n.push(l)}else if(i[3]){var h=new v(i[3]);h["DATA-ID"]&&(s=!0,a[h["DATA-ID"]]=h)}return{levels:n,sessionData:s?a:null}},t.parseMasterPlaylistMedia=function(e,r,i,n){var a;void 0===n&&(n=[]);var s=[],o=0;for(T.lastIndex=0;null!==(a=T.exec(e));){var l=new v(a[1]);if(l.TYPE===i){var u={attrs:l,bitrate:0,id:o++,groupId:l["GROUP-ID"],instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:i,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?t.resolve(l.URI,r):""};if(n.length){var h=t.findGroup(n,u.groupId)||n[0];R(u,h,"audioCodec"),R(u,h,"textCodec")}s.push(u)}}return s},t.parseLevelPlaylist=function(t,e,r,a,s){var l,h,f,g=new d(e),p=g.fragments,m=null,y=0,T=0,L=0,A=0,R=null,k=new u.b(a,e),_=-1,I=!1;for(b.lastIndex=0,g.m3u8=t;null!==(l=b.exec(t));){I&&(I=!1,(k=new u.b(a,e)).start=L,k.sn=y,k.cc=A,k.level=r,m&&(k.initSegment=m,k.rawProgramDateTime=m.rawProgramDateTime));var C=l[1];if(C){k.duration=parseFloat(C);var w=(" "+l[2]).slice(1);k.title=w||null,k.tagList.push(w?["INF",C,w]:["INF",C])}else if(l[3])Object(n.a)(k.duration)&&(k.start=L,f&&(k.levelkey=f),k.sn=y,k.level=r,k.cc=A,k.urlId=s,p.push(k),k.relurl=(" "+l[3]).slice(1),D(k,R),R=k,L+=k.duration,y++,T=0,I=!0);else if(l[4]){var O=(" "+l[4]).slice(1);R?k.setByteRange(O,R):k.setByteRange(O)}else if(l[5])k.rawProgramDateTime=(" "+l[5]).slice(1),k.tagList.push(["PROGRAM-DATE-TIME",k.rawProgramDateTime]),-1===_&&(_=p.length);else{if(!(l=l[0].match(E))){o.b.warn("No matches on slow regex match for level playlist!");continue}for(h=1;h-1){o.b.warn("Keyformat "+q+" is not supported from the manifest");continue}if("identity"!==q)continue;j&&(f=c.a.fromURL(e,H),H&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(j)>=0&&(f.method=j,f.keyFormat=q,Y&&(f.keyID=Y),W&&(f.keyFormatVersions=W),f.iv=V));break;case"START":var X=new v(P).decimalFloatingPoint("TIME-OFFSET");Object(n.a)(X)&&(g.startTimeOffset=X);break;case"MAP":var z=new v(P);k.relurl=z.URI,z.BYTERANGE&&k.setByteRange(z.BYTERANGE),k.level=r,k.sn="initSegment",f&&(k.levelkey=f),k.initSegment=null,m=k,I=!0;break;case"SERVER-CONTROL":var Q=new v(P);g.canBlockReload=Q.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=Q.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&Q.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=Q.optionalFloat("PART-HOLD-BACK",0),g.holdBack=Q.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var $=new v(P);g.partTarget=$.decimalFloatingPoint("PART-TARGET");break;case"PART":var J=g.partList;J||(J=g.partList=[]);var Z=T>0?J[J.length-1]:void 0,tt=T++,et=new u.c(new v(P),k,e,tt,Z);J.push(et),k.duration+=et.duration;break;case"PRELOAD-HINT":var rt=new v(P);g.preloadHint=rt;break;case"RENDITION-REPORT":var it=new v(P);g.renditionReports=g.renditionReports||[],g.renditionReports.push(it);break;default:o.b.warn("line parsed but not handled: "+l)}}}R&&!R.relurl?(p.pop(),L-=R.duration,g.partList&&(g.fragmentHint=R)):g.partList&&(D(k,R),k.cc=A,g.fragmentHint=k);var nt=p.length,at=p[0],st=p[nt-1];if((L+=g.skippedSegments*g.targetduration)>0&&nt&&st){g.averagetargetduration=L/nt;var ot=st.sn;g.endSN="initSegment"!==ot?ot:0,at&&(g.startCC=at.cc,at.initSegment||g.fragments.every((function(t){return t.relurl&&(e=t.relurl,S.test(null!=(r=null===(n=i.parseURL(e))||void 0===n?void 0:n.path)?r:""));var e,r,n}))&&(o.b.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(k=new u.b(a,e)).relurl=st.relurl,k.level=r,k.sn="initSegment",at.initSegment=k,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(L+=g.fragmentHint.duration),g.totalduration=L,g.endCC=A,_>0&&function(t,e){for(var r=t[e],i=e;i--;){var n=t[i];if(!n)return;n.programDateTime=r.programDateTime-1e3*n.duration,r=n}}(p,_),g},t}();function A(t,e){["video","audio","text"].forEach((function(r){var i=t.filter((function(t){return function(t,e){var r=p[e];return!!r&&!0===r[t.slice(0,4)]}(t,r)}));if(i.length){var n=i.filter((function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)}));e[r+"Codec"]=n.length>0?n[0]:i[0],t=t.filter((function(t){return-1===i.indexOf(t)}))}})),e.unknownCodecs=t}function R(t,e,r){var i=e[r];i&&(t[r]=i)}function D(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),Object(n.a)(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}var k=r(4);function _(t,e){var r=t.url;return void 0!==r&&0!==r.indexOf("data:")||(r=e.url),r}var I=function(){function t(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.on(a.a.LEVEL_LOADING,this.onLevelLoading,this),t.on(a.a.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(a.a.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.unregisterListeners=function(){var t=this.hls;t.off(a.a.MANIFEST_LOADING,this.onManifestLoading,this),t.off(a.a.LEVEL_LOADING,this.onLevelLoading,this),t.off(a.a.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(a.a.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.createInternalLoader=function(t){var e=this.hls.config,r=e.pLoader,i=e.loader,n=new(r||i)(e);return t.loader=n,this.loaders[t.type]=n,n},e.getInternalLoader=function(t){return this.loaders[t.type]},e.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onManifestLoading=function(t,e){var r=e.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:k.a.MANIFEST,url:r,deliveryDirectives:null})},e.onLevelLoading=function(t,e){var r=e.id,i=e.level,n=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:null,level:i,responseType:"text",type:k.a.LEVEL,url:n,deliveryDirectives:a})},e.onAudioTrackLoading=function(t,e){var r=e.id,i=e.groupId,n=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:i,level:null,responseType:"text",type:k.a.AUDIO_TRACK,url:n,deliveryDirectives:a})},e.onSubtitleTrackLoading=function(t,e){var r=e.id,i=e.groupId,n=e.url,a=e.deliveryDirectives;this.load({id:r,groupId:i,level:null,responseType:"text",type:k.a.SUBTITLE_TRACK,url:n,deliveryDirectives:a})},e.load=function(t){var e,r,i,n,a,s,l=this.hls.config,u=this.getInternalLoader(t);if(u){var h=u.context;if(h&&h.url===t.url)return void o.b.trace("[playlist-loader]: playlist request ongoing");o.b.log("[playlist-loader]: aborting previous loader for type: "+t.type),u.abort()}switch(t.type){case k.a.MANIFEST:r=l.manifestLoadingMaxRetry,i=l.manifestLoadingTimeOut,n=l.manifestLoadingRetryDelay,a=l.manifestLoadingMaxRetryTimeout;break;case k.a.LEVEL:case k.a.AUDIO_TRACK:case k.a.SUBTITLE_TRACK:r=0,i=l.levelLoadingTimeOut;break;default:r=l.levelLoadingMaxRetry,i=l.levelLoadingTimeOut,n=l.levelLoadingRetryDelay,a=l.levelLoadingMaxRetryTimeout}if((u=this.createInternalLoader(t),null!==(e=t.deliveryDirectives)&&void 0!==e&&e.part)&&(t.type===k.a.LEVEL&&null!==t.level?s=this.hls.levels[t.level].details:t.type===k.a.AUDIO_TRACK&&null!==t.id?s=this.hls.audioTracks[t.id].details:t.type===k.a.SUBTITLE_TRACK&&null!==t.id&&(s=this.hls.subtitleTracks[t.id].details),s)){var d=s.partTarget,c=s.targetduration;d&&c&&(i=Math.min(1e3*Math.max(3*d,.8*c),i))}var f={timeout:i,maxRetry:r,retryDelay:n,maxRetryDelay:a,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(t,f,g)},e.loadsuccess=function(t,e,r,i){if(void 0===i&&(i=null),r.isSidxRequest)return this.handleSidxRequest(t,r),void this.handlePlaylistLoaded(t,e,r,i);this.resetInternalLoader(r.type);var n=t.data;0===n.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),n.indexOf("#EXTINF:")>0||n.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,e,r,i):this.handleMasterPlaylist(t,e,r,i)):this.handleManifestParsingError(t,r,"no EXTM3U delimiter",i)},e.loaderror=function(t,e,r){void 0===r&&(r=null),this.handleNetworkError(e,r,!1,t)},e.loadtimeout=function(t,e,r){void 0===r&&(r=null),this.handleNetworkError(e,r,!0)},e.handleMasterPlaylist=function(t,e,r,i){var n=this.hls,s=t.data,l=_(t,r),u=L.parseMasterPlaylist(s,l),h=u.levels,d=u.sessionData;if(h.length){var c=h.map((function(t){return{id:t.attrs.AUDIO,audioCodec:t.audioCodec}})),f=h.map((function(t){return{id:t.attrs.SUBTITLES,textCodec:t.textCodec}})),g=L.parseMasterPlaylistMedia(s,l,"AUDIO",c),p=L.parseMasterPlaylistMedia(s,l,"SUBTITLES",f),m=L.parseMasterPlaylistMedia(s,l,"CLOSED-CAPTIONS");if(g.length)g.some((function(t){return!t.url}))||!h[0].audioCodec||h[0].attrs.AUDIO||(o.b.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v({}),bitrate:0,url:""}));n.trigger(a.a.MANIFEST_LOADED,{levels:h,audioTracks:g,subtitles:p,captions:m,url:l,stats:e,networkDetails:i,sessionData:d})}else this.handleManifestParsingError(t,r,"no level found in manifest",i)},e.handleTrackOrLevelPlaylist=function(t,e,r,i){var o=this.hls,l=r.id,u=r.level,h=r.type,d=_(t,r),c=Object(n.a)(l)?l:0,f=Object(n.a)(u)?u:c,g=function(t){switch(t.type){case k.a.AUDIO_TRACK:return k.b.AUDIO;case k.a.SUBTITLE_TRACK:return k.b.SUBTITLE;default:return k.b.MAIN}}(r),p=L.parseLevelPlaylist(t.data,d,f,g,c);if(p.fragments.length){if(h===k.a.MANIFEST){var m={attrs:new v({}),bitrate:0,details:p,name:"",url:d};o.trigger(a.a.MANIFEST_LOADED,{levels:[m],audioTracks:[],url:d,stats:e,networkDetails:i,sessionData:null})}if(e.parsing.end=performance.now(),p.needSidxRanges){var y,T=null===(y=p.fragments[0].initSegment)||void 0===y?void 0:y.url;this.load({url:T,isSidxRequest:!0,type:h,level:u,levelDetails:p,id:l,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else r.levelDetails=p,this.handlePlaylistLoaded(t,e,r,i)}else o.trigger(a.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.LEVEL_EMPTY_ERROR,fatal:!1,url:d,reason:"no fragments found in level",level:"number"==typeof r.level?r.level:void 0})},e.handleSidxRequest=function(t,e){var r=Object(l.g)(new Uint8Array(t.data));if(r){var i=r.references,n=e.levelDetails;i.forEach((function(t,e){var i=t.info,a=n.fragments[e];0===a.byteRange.length&&a.setByteRange(String(1+i.end-i.start)+"@"+String(i.start)),a.initSegment&&a.initSegment.setByteRange(String(r.moovEndOffset)+"@0")}))}},e.handleManifestParsingError=function(t,e,r,i){this.hls.trigger(a.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.MANIFEST_PARSING_ERROR,fatal:e.type===k.a.MANIFEST,url:t.url,reason:r,response:t,context:e,networkDetails:i})},e.handleNetworkError=function(t,e,r,i){void 0===r&&(r=!1),o.b.warn("[playlist-loader]: A network "+(r?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var n=s.a.UNKNOWN,l=!1,u=this.getInternalLoader(t);switch(t.type){case k.a.MANIFEST:n=r?s.a.MANIFEST_LOAD_TIMEOUT:s.a.MANIFEST_LOAD_ERROR,l=!0;break;case k.a.LEVEL:n=r?s.a.LEVEL_LOAD_TIMEOUT:s.a.LEVEL_LOAD_ERROR,l=!1;break;case k.a.AUDIO_TRACK:n=r?s.a.AUDIO_TRACK_LOAD_TIMEOUT:s.a.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case k.a.SUBTITLE_TRACK:n=r?s.a.SUBTITLE_TRACK_LOAD_TIMEOUT:s.a.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(t.type);var h={type:s.b.NETWORK_ERROR,details:n,fatal:l,url:t.url,loader:u,context:t,networkDetails:e};i&&(h.response=i),this.hls.trigger(a.a.ERROR,h)},e.handlePlaylistLoaded=function(t,e,r,i){var n=r.type,s=r.level,o=r.id,l=r.groupId,u=r.loader,h=r.levelDetails,d=r.deliveryDirectives;if(null!=h&&h.targetduration){if(u)switch(h.live&&(u.getCacheAge&&(h.ageHeader=u.getCacheAge()||0),u.getCacheAge&&!isNaN(h.ageHeader)||(h.ageHeader=0)),n){case k.a.MANIFEST:case k.a.LEVEL:this.hls.trigger(a.a.LEVEL_LOADED,{details:h,level:s||0,id:o||0,stats:e,networkDetails:i,deliveryDirectives:d});break;case k.a.AUDIO_TRACK:this.hls.trigger(a.a.AUDIO_TRACK_LOADED,{details:h,id:o||0,groupId:l||"",stats:e,networkDetails:i,deliveryDirectives:d});break;case k.a.SUBTITLE_TRACK:this.hls.trigger(a.a.SUBTITLE_TRACK_LOADED,{details:h,id:o||0,groupId:l||"",stats:e,networkDetails:i,deliveryDirectives:d})}}else this.handleManifestParsingError(t,r,"invalid target duration",i)},t}(),C=function(){function t(t){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){this.hls.on(a.a.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(a.a.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){for(var t in this._unregisterListeners(),this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={}},e.onKeyLoading=function(t,e){var r=e.frag,i=r.type,n=this.loaders[i];if(r.decryptdata){var s=r.decryptdata.uri;if(s!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;if(n&&(o.b.warn("abort previous key loader for type:"+i),n.abort()),!s)return void o.b.warn("key uri is falsy");var u=l.loader,h=r.loader=this.loaders[i]=new u(l);this.decrypturl=s,this.decryptkey=null;var d={url:s,frag:r,responseType:"arraybuffer"},c={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};h.load(d,c,f)}else this.decryptkey&&(r.decryptdata.key=this.decryptkey,this.hls.trigger(a.a.KEY_LOADED,{frag:r}))}else o.b.warn("Missing decryption data on fragment in onKeyLoading")},e.loadsuccess=function(t,e,r){var i=r.frag;i.decryptdata?(this.decryptkey=i.decryptdata.key=new Uint8Array(t.data),i.loader=null,delete this.loaders[i.type],this.hls.trigger(a.a.KEY_LOADED,{frag:i})):o.b.error("after key load, decryptdata unset")},e.loaderror=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),delete this.loaders[r.type],this.hls.trigger(a.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.KEY_LOAD_ERROR,fatal:!1,frag:r,response:t})},e.loadtimeout=function(t,e){var r=e.frag,i=r.loader;i&&i.abort(),delete this.loaders[r.type],this.hls.trigger(a.a.ERROR,{type:s.b.NETWORK_ERROR,details:s.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})},t}();function w(t,e){var r;try{r=new Event("addtrack")}catch(t){(r=document.createEvent("Event")).initEvent("addtrack",!1,!1)}r.track=t,e.dispatchEvent(r)}function O(t,e){var r=t.mode;if("disabled"===r&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error("addCue is failed for: "+e)}catch(r){o.b.debug("[texttrack-utils]: "+r);var i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,t.addCue(i)}"disabled"===r&&(t.mode=r)}function x(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(var r=t.cues.length;r--;)t.removeCue(t.cues[r]);"disabled"===e&&(t.mode=e)}function P(t,e,r){var i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var n=function(t,e,r){var i=[],n=function(t,e){if(et[r].endTime)return-1;var i=0,n=r;for(;i<=n;){var a=Math.floor((n+i)/2);if(et[a].startTime&&i-1)for(var a=n,s=t.length;a=e&&o.endTime<=r)i.push(o);else if(o.startTime>r)return i}return i}(t.cues,e,r),a=0;a.05&&this.forwardBufferLength>1){var u=Math.min(2,Math.max(1,a)),h=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;t.playbackRate=Math.min(u,Math.max(1,h))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}}},n.estimateLiveEdge=function(){var t=this.levelDetails;return null===t?null:t.edge+t.age},n.computeLatency=function(){var t=this.estimateLiveEdge();return null===t?null:t-this.currentTime},e=t,(r=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(null===t)return null;var e=t.holdBack,r=t.partHoldBack,i=t.targetduration,n=this.config,a=n.liveSyncDuration,s=n.liveSyncDurationCount,o=n.lowLatencyMode,l=this.hls.userConfig,u=o&&r||e;(l.liveSyncDuration||l.liveSyncDurationCount||0===u)&&(u=void 0!==a?a:s*i);var h=i;return u+Math.min(1*this.stallCount,h)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,r=this.levelDetails;if(null===t||null===e||null===r)return null;var i=r.edge,n=t-e-this.edgeStalled,a=i-r.totalduration,s=i-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(a,n),s)}},{key:"drift",get:function(){var t=this.levelDetails;return null===t?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(null===t)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var r=t.buffered.length;return r?t.buffered.end(r-1):e.edge-this.currentTime}}])&&N(e.prototype,r),i&&N(e,i),t}();function G(t,e){for(var r=0;rt.sn?(a=r-t.start,i=t):(a=t.start-r,i=e),i.duration!==a&&(i.duration=a)}else if(e.sn>t.sn){t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration}else e.start=Math.max(t.start-e.duration,0)}function Y(t,e,r,i,a,s){i-r<=0&&(o.b.warn("Fragment should have a positive duration",e),i=r+e.duration,s=a+e.duration);var l=r,u=i,h=e.startPTS,d=e.endPTS;if(Object(n.a)(h)){var c=Math.abs(h-r);Object(n.a)(e.deltaPTS)?e.deltaPTS=Math.max(c,e.deltaPTS):e.deltaPTS=c,l=Math.max(r,h),r=Math.min(r,h),a=Math.min(a,e.startDTS),u=Math.min(i,d),i=Math.max(i,d),s=Math.max(s,e.endDTS)}e.duration=i-r;var f=r-e.start;e.appendedPTS=i,e.start=e.startPTS=r,e.maxStartPTS=l,e.startDTS=a,e.endPTS=i,e.minEndPTS=u,e.endDTS=s;var g,v=e.sn;if(!t||vt.endSN)return 0;var p=v-t.startSN,m=t.fragments;for(m[p]=e,g=p;g>0;g--)W(m[g],m[g-1]);for(g=p;g=0;a--){var s=i[a].initSegment;if(s){r=s;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var l,u=0;if(function(t,e,r){for(var i=e.skippedSegments,n=Math.max(t.startSN,e.startSN)-e.startSN,a=(t.fragmentHint?1:0)+(i?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,s=e.startSN-t.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=n;u<=a;u++){var h=l[s+u],d=o[u];i&&!d&&u=i.length||z(e,i[r].start)}function z(t,e){if(e){for(var r=t.fragments,i=t.skippedSegments;ie.partTarget&&(l+=1)}if(Object(n.a)(o))return new K(o,Object(n.a)(l)?l:void 0,U.No)}}},e.loadPlaylist=function(t){},e.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},e.playlistLoaded=function(t,e,r){var i=this,n=e.details,a=e.stats,s=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(n.advancedDateTime=Date.now()-s,n.live||null!=r&&r.live){if(n.reloaded(r),r&&this.log("live playlist "+t+" "+(n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED")),r&&n.fragments.length>0&&q(r,n),!this.canLoad||!n.live)return;var o,l=void 0,u=void 0;if(n.canBlockReload&&n.endSN&&n.advanced){var h=this.hls.config.lowLatencyMode,d=n.lastPartSn,c=n.endSN,f=n.lastPartIndex,g=d===c;-1!==f?(l=g?c+1:d,u=g?h?0:f:f+1):l=c+1;var v=n.age,p=v+n.ageHeader,m=Math.min(p-n.partTarget,1.5*n.targetduration);if(m>0){if(r&&m>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+m+" with playlist age: "+n.age),m=0;else{var y=Math.floor(m/n.targetduration);if(l+=y,void 0!==u)u+=Math.round(m%n.targetduration/n.partTarget);this.log("CDN Tune-in age: "+n.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+m+" skip sn "+y+" to part "+u)}n.tuneInGoal=m}if(o=this.getDeliveryDirectives(n,e.deliveryDirectives,l,u),h||!g)return void this.loadPlaylist(o)}else o=this.getDeliveryDirectives(n,e.deliveryDirectives,l,u);var T=function(t,e){var r,i=1e3*t.levelTargetDuration,n=i/2,a=t.age,s=a>0&&a<3*i,o=e.loading.end-e.loading.start,l=t.availabilityDelay;if(!1===t.updated)if(s){var u=333*t.misses;r=Math.max(Math.min(n,2*o),u),t.availabilityDelay=(t.availabilityDelay||0)+r}else r=n;else s?(l=Math.min(l||i/2,a),t.availabilityDelay=l,r=l+i-a):r=i-o;return Math.round(r)}(n,a);void 0!==l&&n.canBlockReload&&(T-=n.partTarget||1),this.log("reload live playlist "+t+" in "+Math.round(T)+" ms"),this.timer=self.setTimeout((function(){return i.loadPlaylist(o)}),T)}else this.clearTimer()},e.getDeliveryDirectives=function(t,e,r,i){var n=function(t,e){var r=t.canSkipUntil,i=t.canSkipDateRanges,n=t.endSN;return r&&(void 0!==e?e-n:0)-1&&null!==(e=t.context)&&void 0!==e&&e.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*i.levelLoadingRetryDelay,i.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return r.loadPlaylist()}),a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+t.details+'"')}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return n},t}();function $(){return($=Object.assign||function(t){for(var e=1;e0){r=n[0].bitrate,n.sort((function(t,e){return t.bitrate-e.bitrate})),this._levels=n;for(var f=0;fthis.hls.config.fragLoadingMaxRetry&&(a=r.frag.level)):a=r.frag.level}break;case s.a.LEVEL_LOAD_ERROR:case s.a.LEVEL_LOAD_TIMEOUT:i&&(i.deliveryDirectives&&(l=!1),a=i.level),o=!0;break;case s.a.REMUX_ALLOC_ERROR:a=r.level,o=!0}void 0!==a&&this.recoverLevel(r,a,o,l)}}},u.recoverLevel=function(t,e,r,i){var n=t.details,a=this._levels[e];if(a.loadError++,r){if(!this.retryLoadingOrFail(t))return void(this.currentLevelIndex=-1);t.levelRetry=!0}if(i){var s=a.url.length;if(s>1&&a.loadError1){var i=(e.urlId+1)%r;this.warn("Switching to redundant URL-id "+i),this._levels.forEach((function(t){t.urlId=i})),this.level=t}},u.onFragLoaded=function(t,e){var r=e.frag;if(void 0!==r&&r.type===k.b.MAIN){var i=this._levels[r.level];void 0!==i&&(i.fragmentError=0,i.loadError=0)}},u.onLevelLoaded=function(t,e){var r,i,n=e.level,a=e.details,s=this._levels[n];if(!s)return this.warn("Invalid level index "+n),void(null!==(i=e.deliveryDirectives)&&void 0!==i&&i.skip&&(a.deltaUpdateFailed=!0));n===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0,this.retryCount=0),this.playlistLoaded(n,e,s.details)):null!==(r=e.deliveryDirectives)&&void 0!==r&&r.skip&&(a.deltaUpdateFailed=!0)},u.onAudioTrackSwitched=function(t,e){var r=this.hls.levels[this.currentLevelIndex];if(r&&r.audioGroupIds){for(var i=-1,n=this.hls.audioTracks[e.id].groupId,a=0;a0){var i=r.urlId,n=r.url[i];if(t)try{n=t.addDirectives(n)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Attempt loading level index "+e+(t?" at sn "+t.msn+" part "+t.part:"")+" with URL-id "+i+" "+n),this.clearTimer(),this.hls.trigger(a.a.LEVEL_LOADING,{url:n,level:e,id:i,deliveryDirectives:t||null})}},u.removeLevel=function(t,e){var r=function(t,r){return r!==e},i=this._levels.filter((function(i,n){return n!==t||i.url.length>1&&void 0!==e&&(i.url=i.url.filter(r),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(r)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(r)),i.urlId=0,!0)})).map((function(t,e){var r=t.details;return null!=r&&r.fragments&&r.fragments.forEach((function(t){t.level=e})),t}));this._levels=i,this.hls.trigger(a.a.LEVELS_UPDATED,{levels:i})},n=i,(o=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e,r=this._levels;if(0!==r.length&&(this.currentLevelIndex!==t||null===(e=r[t])||void 0===e||!e.details)){if(t<0||t>=r.length){var i=t<0;if(this.hls.trigger(a.a.ERROR,{type:s.b.OTHER_ERROR,details:s.a.LEVEL_SWITCH_ERROR,level:t,fatal:i,reason:"invalid level idx"}),i)return;t=Math.min(t,r.length-1)}this.clearTimer();var n=this.currentLevelIndex,o=r[n],l=r[t];this.log("switching to level "+t+" from "+n),this.currentLevelIndex=t;var u=$({},l,{level:t,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete u._urlId,this.hls.trigger(a.a.LEVEL_SWITCHING,u);var h=l.details;if(!h||h.live){var d=this.switchParams(l.uri,null==o?void 0:o.details);this.loadPlaylist(d)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}])&&J(n.prototype,o),l&&J(n,l),i}(Q);!function(t){t.NOT_LOADED="NOT_LOADED",t.BACKTRACKED="BACKTRACKED",t.APPENDING="APPENDING",t.PARTIAL="PARTIAL",t.OK="OK"}(tt||(tt={}));var it=function(){function t(t){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){var t=this.hls;t.on(a.a.BUFFER_APPENDED,this.onBufferAppended,this),t.on(a.a.FRAG_BUFFERED,this.onFragBuffered,this),t.on(a.a.FRAG_LOADED,this.onFragLoaded,this)},e._unregisterListeners=function(){var t=this.hls;t.off(a.a.BUFFER_APPENDED,this.onBufferAppended,this),t.off(a.a.FRAG_BUFFERED,this.onFragBuffered,this),t.off(a.a.FRAG_LOADED,this.onFragLoaded,this)},e.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},e.getAppendedFrag=function(t,e){if(e===k.b.MAIN){var r=this.activeFragment,i=this.activeParts;if(!r)return null;if(i)for(var n=i.length;n--;){var a=i[n],s=a?a.end:r.appendedPTS;if(a.start<=t&&void 0!==s&&t<=s)return n>9&&(this.activeParts=i.slice(n-9)),a}else if(r.start<=t&&void 0!==r.appendedPTS&&t<=r.appendedPTS)return r}return this.getBufferedFrag(t,e)},e.getBufferedFrag=function(t,e){for(var r=this.fragments,i=Object.keys(r),n=i.length;n--;){var a=r[i[n]];if((null==a?void 0:a.body.type)===e&&a.buffered){var s=a.body;if(s.start<=t&&t<=s.end)return s}}return null},e.detectEvictedFragments=function(t,e,r){var i=this;Object.keys(this.fragments).forEach((function(n){var a=i.fragments[n];if(a)if(a.buffered){var s=a.range[t];s&&s.time.some((function(t){var r=!i.isTimeBuffered(t.startPTS,t.endPTS,e);return r&&i.removeFragment(a.body),r}))}else a.body.type===r&&i.removeFragment(a.body)}))},e.detectPartialFragments=function(t){var e=this,r=this.timeRanges,i=t.frag,n=t.part;if(r&&"initSegment"!==i.sn){var a=at(i),s=this.fragments[a];s&&(Object.keys(r).forEach((function(t){var a=i.elementaryStreams[t];if(a){var o=r[t],l=null!==n||!0===a.partial;s.range[t]=e.getBufferedTimes(i,n,l,o)}})),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body))}},e.fragBuffered=function(t){var e=at(t),r=this.fragments[e];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},e.getBufferedTimes=function(t,e,r,i){for(var n={time:[],partial:r},a=e?e.start:t.start,s=e?e.end:t.end,o=t.minEndPTS||s,l=t.maxStartPTS||a,u=0;u=h&&o<=d){n.time.push({startPTS:Math.max(a,i.start(u)),endPTS:Math.min(s,i.end(u))});break}if(ah)n.partial=!0,n.time.push({startPTS:Math.max(a,i.start(u)),endPTS:Math.min(s,i.end(u))});else if(s<=h)break}return n},e.getPartialFragment=function(t){var e,r,i,n=null,a=0,s=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach((function(l){var u=o[l];u&&nt(u)&&(r=u.body.start-s,i=u.body.end+s,t>=r&&t<=i&&(e=Math.min(t-r,i-t),a<=e&&(n=u.body,a=e)))})),n},e.getState=function(t){var e=at(t),r=this.fragments[e];return r?r.buffered?nt(r)?tt.PARTIAL:tt.OK:r.backtrack?tt.BACKTRACKED:tt.APPENDING:tt.NOT_LOADED},e.backtrack=function(t,e){var r=at(t),i=this.fragments[r];if(!i||i.backtrack)return null;var n=i.backtrack=e||i.loaded;return i.loaded=null,n},e.getBacktrackData=function(t){var e=at(t),r=this.fragments[e];if(r){var i,n=r.backtrack;if(null!=n&&null!==(i=n.payload)&&void 0!==i&&i.byteLength)return n;this.removeFragment(t)}return null},e.isTimeBuffered=function(t,e,r){for(var i,n,a=0;a=i&&e<=n)return!0;if(e<=i)return!1}return!1},e.onFragLoaded=function(t,e){var r=e.frag,i=e.part;if("initSegment"!==r.sn&&!r.bitrateTest&&!i){var n=at(r);this.fragments[n]={body:r,loaded:e,backtrack:null,buffered:!1,range:Object.create(null)}}},e.onBufferAppended=function(t,e){var r=this,i=e.frag,n=e.part,a=e.timeRanges;if(i.type===k.b.MAIN)if(this.activeFragment=i,n){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(n)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach((function(t){var e=a[t];if(r.detectEvictedFragments(t,e),!n)for(var s=0;st&&i.removeFragment(s)}}))},e.removeFragment=function(t){var e=at(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),delete this.fragments[e]},e.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},t}();function nt(t){var e,r;return t.buffered&&((null===(e=t.range.video)||void 0===e?void 0:e.partial)||(null===(r=t.range.audio)||void 0===r?void 0:r.partial))}function at(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn}var st=function(){function t(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var e=t.prototype;return e.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},e.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.onHandlerDestroyed=function(){},e.hasInterval=function(){return!!this._tickInterval},e.hasNextTick=function(){return!!this._tickTimer},e.setInterval=function(t){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,t),!0)},e.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},e.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},e.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},e.doTick=function(){},t}(),ot={length:0,start:function(){return 0},end:function(){return 0}},lt=function(){function t(){}return t.isBuffered=function(e,r){try{if(e)for(var i=t.getBuffered(e),n=0;n=i.start(n)&&r<=i.end(n))return!0}catch(t){}return!1},t.bufferInfo=function(e,r,i){try{if(e){var n,a=t.getBuffered(e),s=[];for(n=0;ns&&(i[a-1].end=t[n].end):i.push(t[n])}else i.push(t[n])}else i=t;for(var o,l=0,u=e,h=e,d=0;d=c&&er.startCC||t&&t.cc0)r=n+1;else{if(!(s<0))return a;i=n-1}}return null}};function pt(t,e,r){if(null===e||!Array.isArray(t)||!t.length||!Object(n.a)(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;r=r||0;for(var i=0;it&&r.start?-1:0}function Tt(t,e,r){var i=1e3*Math.min(e,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-i>t}function bt(t){var e="function"==typeof Map?new Map:void 0;return(bt=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return Et(t,arguments,At(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Lt(i,t)})(t)}function Et(t,e,r){return(Et=St()?Reflect.construct:function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&Lt(n,r.prototype),n}).apply(null,arguments)}function St(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Lt(t,e){return(Lt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function At(t){return(At=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Rt=Math.pow(2,17),Dt=function(){function t(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=t.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(t,e){var r=this,i=t.url;if(!i)return Promise.reject(new _t({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(i?"part list":"url")));this.abort();var n=this.config,a=n.fLoader,o=n.loader;return new Promise((function(i,l){r.loader&&r.loader.destroy();var u=r.loader=t.loader=a?new a(n):new o(n),h=kt(t),d={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:Rt};t.stats=u.stats,u.load(h,d,{onSuccess:function(e,n,a,s){r.resetLoader(t,u),i({frag:t,part:null,payload:e.data,networkDetails:s})},onError:function(e,i,n){r.resetLoader(t,u),l(new _t({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:e,networkDetails:n}))},onAbort:function(e,i,n){r.resetLoader(t,u),l(new _t({type:s.b.NETWORK_ERROR,details:s.a.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:n}))},onTimeout:function(e,i,n){r.resetLoader(t,u),l(new _t({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:n}))},onProgress:function(r,i,n,a){e&&e({frag:t,part:null,payload:n,networkDetails:a})}})}))},e.loadPart=function(t,e,r){var i=this;this.abort();var n=this.config,a=n.fLoader,o=n.loader;return new Promise((function(l,u){i.loader&&i.loader.destroy();var h=i.loader=t.loader=a?new a(n):new o(n),d=kt(t,e),c={timeout:n.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:n.fragLoadingMaxRetryTimeout,highWaterMark:Rt};e.stats=h.stats,h.load(d,c,{onSuccess:function(n,a,s,o){i.resetLoader(t,h),i.updateStatsFromPart(t,e);var u={frag:t,part:e,payload:n.data,networkDetails:o};r(u),l(u)},onError:function(r,n,a){i.resetLoader(t,h),u(new _t({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:r,networkDetails:a}))},onAbort:function(r,n,a){t.stats.aborted=e.stats.aborted,i.resetLoader(t,h),u(new _t({type:s.b.NETWORK_ERROR,details:s.a.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,networkDetails:a}))},onTimeout:function(r,n,a){i.resetLoader(t,h),u(new _t({type:s.b.NETWORK_ERROR,details:s.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,networkDetails:a}))}})}))},e.updateStatsFromPart=function(t,e){var r=t.stats,i=e.stats,n=i.total;if(r.loaded+=i.loaded,n){var a=Math.round(t.duration/e.duration),s=Math.min(Math.round(r.loaded/n),a),o=(a-s)*Math.round(r.loaded/s);r.total=r.loaded+o}else r.total=Math.max(r.loaded,r.total);var l=r.loading,u=i.loading;l.start?l.first+=u.first-u.start:(l.start=u.start,l.first=u.first),l.end=u.end},e.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},t}();function kt(t,e){void 0===e&&(e=null);var r=e||t,i={frag:t,part:e,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},a=r.byteRangeStartOffset,s=r.byteRangeEndOffset;return Object(n.a)(a)&&Object(n.a)(s)&&(i.rangeStart=a,i.rangeEnd=s),i}var _t=function(t){var e,r;function i(e){for(var r,i=arguments.length,n=new Array(i>1?i-1:0),a=1;ae.start+e.duration+l;(s0&&s&&s.key&&s.iv&&"AES-128"===s.method){var o=self.performance.now();return e.decrypter.webCryptoDecrypt(new Uint8Array(n),s.key.buffer,s.iv.buffer).then((function(e){var n=self.performance.now();return i.trigger(a.a.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:o,tdecrypt:n}}),r.payload=e,r}))}return r})).then((function(r){var i=e.fragCurrent,n=e.hls,s=e.levels;if(!s)throw new Error("init load aborted, missing levels");s[t.level].details;var o=t.stats;e.state=Pt,e.fragLoadError=0,t.data=new Uint8Array(r.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),r.frag===i&&n.trigger(a.a.FRAG_BUFFERED,{stats:o,frag:i,part:null,id:t.type}),e.tick()})).catch((function(r){e.warn(r),e.resetFragmentLoading(t)}))},c.fragContextChanged=function(t){var e=this.fragCurrent;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId},c.fragBufferedComplete=function(t,e){var r=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+t.type+" sn: "+t.sn+(e?" part: "+e.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level+" "+Ct.toString(lt.getBuffered(r))),this.state=Pt,this.tick()},c._handleFragmentLoadComplete=function(t){var e=this.transmuxer;if(e){var r=t.frag,i=t.part,n=t.partsLoaded,a=!n||0===n.length||n.some((function(t){return!t})),s=new ut(r.level,r.sn,r.stats.chunkCount+1,0,i?i.index:-1,!a);e.flush(s)}},c._handleFragmentLoadProgress=function(t){},c._doFragLoad=function(t,e,r,i){var s=this;if(void 0===r&&(r=null),!this.levels)throw new Error("frag load aborted, missing levels");if(r=Math.max(t.start,r||0),this.config.lowLatencyMode&&e){var o=e.partList;if(o&&i){r>t.end&&e.fragmentHint&&(t=e.fragmentHint);var l=this.getNextPart(o,t,r);if(l>-1){var u=o[l];return this.log("Loading part sn: "+t.sn+" p: "+u.index+" cc: "+t.cc+" of playlist ["+e.startSN+"-"+e.endSN+"] parts [0-"+l+"-"+(o.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(r.toFixed(3))),this.nextLoadPosition=u.start+u.duration,this.state=Ft,this.hls.trigger(a.a.FRAG_LOADING,{frag:t,part:o[l],targetBufferTime:r}),this.doFragPartsLoad(t,o,l,i).catch((function(t){return s.handleFragLoadError(t)}))}if(!t.url||this.loadedEndOfParts(o,r))return Promise.resolve(null)}}return this.log("Loading fragment "+t.sn+" cc: "+t.cc+" "+(e?"of ["+e.startSN+"-"+e.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(r.toFixed(3))),Object(n.a)(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=Ft,this.hls.trigger(a.a.FRAG_LOADING,{frag:t,targetBufferTime:r}),this.fragmentLoader.load(t,i).catch((function(t){return s.handleFragLoadError(t)}))},c.doFragPartsLoad=function(t,e,r,i){var n=this;return new Promise((function(s,o){var l=[];!function r(u){var h=e[u];n.fragmentLoader.loadPart(t,h,i).then((function(i){l[h.index]=i;var o=i.part;n.hls.trigger(a.a.FRAG_LOADED,i);var d=e[u+1];if(!d||d.fragment!==t)return s({frag:t,part:o,partsLoaded:l});r(u+1)})).catch(o)}(r)}))},c.handleFragLoadError=function(t){var e=t.data;return e&&e.details===s.a.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(a.a.ERROR,e),null},c._handleTransmuxerFlush=function(t){var e=this.getCurrentContext(t);if(e&&this.state===Bt){var r=e.frag,i=e.part,n=e.level,a=self.performance.now();r.stats.parsing.end=a,i&&(i.stats.parsing.end=a),this.updateLevelTiming(r,i,n,t.partial)}else this.fragCurrent||(this.state=Pt)},c.getCurrentContext=function(t){var e=this.levels,r=t.level,i=t.sn,n=t.part;if(!e||!e[r])return this.warn("Levels object was unset while buffering fragment "+i+" of level "+r+". The current chunk will not be buffered."),null;var a=e[r],s=n>-1?function(t,e,r){if(!t||!t.details)return null;var i=t.details.partList;if(i)for(var n=i.length;n--;){var a=i[n];if(a.index===r&&a.fragment.sn===e)return a}return null}(a,i,n):null,o=s?s.fragment:function(t,e,r){if(!t||!t.details)return null;var i=t.details,n=i.fragments[e-i.startSN];return n||((n=i.fragmentHint)&&n.sn===e?n:ea&&this.flushMainBuffer(s,t.start)}else this.flushMainBuffer(0,t.start)},c.getFwdBufferInfo=function(t,e){var r=this.config,i=this.getLoadPosition();if(!Object(n.a)(i))return null;var a=lt.bufferInfo(t,i,r.maxBufferHole);if(0===a.len&&void 0!==a.nextStart){var s=this.fragmentTracker.getBufferedFrag(i,e);if(s&&a.nextStart=r&&(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},c.getNextFragment=function(t,e){var r,i,n=e.fragments,a=n.length;if(!a)return null;var s,o=this.config,l=n[0].start;if(e.live){var u=o.initialLiveManifestSize;if(a-1&&rr.start&&r.loaded},c.getInitialLiveFragment=function(t,e){var r=this.fragPrevious,i=null;if(r){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+r.programDateTime),i=pt(e,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){var n=r.sn+1;if(n>=t.startSN&&n<=t.endSN){var a=e[n-t.startSN];r.cc===a.cc&&(i=a,this.log("Live playlist, switching playlist, load frag with next SN: "+i.sn))}i||(i=function(t,e){return vt.search(t,(function(t){return t.cce?-1:0}))}(e,r.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+i.sn)}}else{var s=this.hls.liveSyncPosition;null!==s&&(i=this.getFragmentAtPosition(s,this.bitrateTest?t.fragmentEnd:t.edge,t))}return i},c.getFragmentAtPosition=function(t,e,r){var i,n=this.config,a=this.fragPrevious,s=r.fragments,o=r.endSN,l=r.fragmentHint,u=n.maxFragLookUpTolerance,h=!!(n.lowLatencyMode&&r.partList&&l);(h&&l&&!this.bitrateTest&&(s=s.concat(l),o=l.sn),te-u?0:u):i=s[s.length-1];if(i){var d=i.sn-r.startSN,c=a&&i.level===a.level,f=s[d+1];if(this.fragmentTracker.getState(i)===tt.BACKTRACKED){i=null;for(var g=d;s[g]&&this.fragmentTracker.getState(s[g])===tt.BACKTRACKED;)i=a?s[g--]:s[--g];i||(i=f)}else a&&i.sn===a.sn&&!h&&c&&(i.sn=a-e.maxFragLookUpTolerance&&n<=s;if(null!==i&&r.duration>i&&(n"+t.startSN+" prev-sn: "+(a?a.sn:"na")+" fragments: "+o),d}return l},c.waitForCdnTuneIn=function(t){return t.live&&t.canBlockReload&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)},c.setStartPosition=function(t,e){var r=this.startPosition;if(r"+t))}}])&&wt(u.prototype,h),d&&wt(u,d),i}(st);function qt(){return self.MediaSource||self.WebKitMediaSource}function Xt(){return self.SourceBuffer||self.WebKitSourceBuffer}var zt=r(18),Qt=r(10),$t=r(14),Jt=qt()||{isTypeSupported:function(){return!1}},Zt=function(){function t(t,e,r,i){var n=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=t,this.id=e,this.onTransmuxComplete=r,this.onFlush=i;var l=t.config,u=function(e,r){(r=r||{}).frag=n.frag,r.id=n.id,t.trigger(e,r)};this.observer=new $t.EventEmitter,this.observer.on(a.a.FRAG_DECRYPTED,u),this.observer.on(a.a.ERROR,u);var h={mp4:Jt.isTypeSupported("video/mp4"),mpeg:Jt.isTypeSupported("audio/mpeg"),mp3:Jt.isTypeSupported('audio/mp4; codecs="mp3"')},d=navigator.vendor;if(l.enableWorker&&"undefined"!=typeof Worker){var c;o.b.log("demuxing in webworker");try{c=this.worker=zt(19),this.onwmsg=this.onWorkerMessage.bind(this),c.addEventListener("message",this.onwmsg),c.onerror=function(e){t.trigger(a.a.ERROR,{type:s.b.OTHER_ERROR,details:s.a.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(e.message+" ("+e.filename+":"+e.lineno+")")})},c.postMessage({cmd:"init",typeSupported:h,vendor:d,id:e,config:JSON.stringify(l)})}catch(t){o.b.warn("Error in worker:",t),o.b.error("Error while initializing DemuxerWorker, fallback to inline"),c&&self.URL.revokeObjectURL(c.objectURL),this.transmuxer=new Qt.c(this.observer,h,l,d,e),this.worker=null}}else this.transmuxer=new Qt.c(this.observer,h,l,d,e)}var e=t.prototype;return e.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}var r=this.observer;r&&r.removeAllListeners(),this.observer=null},e.push=function(t,e,r,i,n,a,s,l,u,h){var d=this;u.transmuxing.start=self.performance.now();var c=this.transmuxer,f=this.worker,g=a?a.start:n.start,v=n.decryptdata,p=this.frag,m=!(p&&n.cc===p.cc),y=!(p&&u.level===p.level),T=p?u.sn-p.sn:-1,b=this.part?u.part-this.part.index:1,E=!y&&(1===T||0===T&&1===b),S=self.performance.now();(y||T||0===n.stats.parsing.start)&&(n.stats.parsing.start=S),!a||!b&&E||(a.stats.parsing.start=S);var L=new Qt.b(m,E,l,y,g);if(!E||m){o.b.log("[transmuxer-interface, "+n.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+"\n discontinuity: "+m+"\n trackSwitch: "+y+"\n contiguous: "+E+"\n accurateTimeOffset: "+l+"\n timeOffset: "+g);var A=new Qt.a(r,i,e,s,h);this.configureTransmuxer(A)}if(this.frag=n,this.part=a,f)f.postMessage({cmd:"demux",data:t,decryptdata:v,chunkMeta:u,state:L},t instanceof ArrayBuffer?[t]:[]);else if(c){var R=c.push(t,v,u,L);Object(Qt.d)(R)?R.then((function(t){d.handleTransmuxComplete(t)})):this.handleTransmuxComplete(R)}},e.flush=function(t){var e=this;t.transmuxing.start=self.performance.now();var r=this.transmuxer,i=this.worker;if(i)i.postMessage({cmd:"flush",chunkMeta:t});else if(r){var n=r.flush(t);Object(Qt.d)(n)?n.then((function(r){e.handleFlushResult(r,t)})):this.handleFlushResult(n,t)}},e.handleFlushResult=function(t,e){var r=this;t.forEach((function(t){r.handleTransmuxComplete(t)})),this.onFlush(e)},e.onWorkerMessage=function(t){var e=t.data,r=this.hls;switch(e.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,r.trigger(e.event,e.data)}},e.configureTransmuxer=function(t){var e=this.worker,r=this.transmuxer;e?e.postMessage({cmd:"configure",config:t}):r&&r.configure(t)},e.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},t}(),te=function(){function t(t,e,r,i){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=r,this.hls=i}var e=t.prototype;return e.destroy=function(){this.hls=this.fragmentTracker=this.media=null},e.poll=function(t){var e=this.config,r=this.media,i=this.stalled,n=r.currentTime,a=r.seeking,s=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,n===t){if((l||s)&&(this.stalled=null),!r.paused&&!r.ended&&0!==r.playbackRate&<.getBuffered(r).length){var u=lt.bufferInfo(r,n,0),h=u.len>0,d=u.nextStart||0;if(h||d){if(a){var c=u.len>2,f=!d||d-n>2&&!this.fragmentTracker.getPartialFragment(n);if(c||f)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var g,v=Math.max(d,u.start||0)-n,p=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,m=(null==p||null===(g=p.details)||void 0===g?void 0:g.live)?2*p.details.targetduration:2;if(v>0&&v<=m)return void this._trySkipBufferHole(null)}var y=self.performance.now();if(null!==i){var T=y-i;!a&&T>=250&&this._reportStall(u.len);var b=lt.bufferInfo(r,n,e.maxBufferHole);this._tryFixBufferStall(b,T)}else this.stalled=y}}}else if(this.moved=!0,null!==i){if(this.stallReported){var E=self.performance.now()-i;o.b.warn("playback not stuck anymore @"+n+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},e._tryFixBufferStall=function(t,e){var r=this.config,i=this.fragmentTracker,n=this.media.currentTime,a=i.getPartialFragment(n);if(a&&this._trySkipBufferHole(a))return;t.len>r.maxBufferHole&&e>1e3*r.highBufferWatchdogPeriod&&(o.b.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},e._reportStall=function(t){var e=this.hls,r=this.media;this.stallReported||(this.stallReported=!0,o.b.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+t+")"),e.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:t}))},e._trySkipBufferHole=function(t){for(var e=this.config,r=this.hls,i=this.media,n=i.currentTime,l=0,u=lt.getBuffered(i),h=0;h=l&&n0&&-1===t&&(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=Pt,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=xt},c.stopLoad=function(){this._forceStartLoad=!1,t.prototype.stopLoad.call(this)},c.doTick=function(){switch(this.state){case Pt:this.doTickIdle();break;case Wt:var t,e=this.levels,r=this.level,i=null==e||null===(t=e[r])||void 0===t?void 0:t.details;if(i&&(!i.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(i))break;this.state=Pt;break}break;case Nt:var n,a=self.performance.now(),s=this.retryDate;(!s||a>=s||null!==(n=this.media)&&void 0!==n&&n.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=Pt)}this.onTickEnd()},c.onTickEnd=function(){t.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},c.doTickIdle=function(){var t,e,r=this.hls,i=this.levelLastLoaded,n=this.levels,s=this.media,o=r.config,l=r.nextLoadLevel;if(null!==i&&(s||!this.startFragRequested&&o.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&n&&n[l]){var h=n[l];this.level=r.nextLoadLevel=l;var d=h.details;if(!d||this.state===Wt||d.live&&this.levelLastLoaded!==l)this.state=Wt;else{var c=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:s,k.b.MAIN);if(null!==c)if(!(c.len>=this.getMaxBufferLength(h.maxBitrate))){if(this._streamEnded(c,d)){var f={};return this.altAudio&&(f.type="video"),this.hls.trigger(a.a.BUFFER_EOS,f),void(this.state=jt)}var g=c.end,v=this.getNextFragment(g,d);if(this.couldBacktrack&&!this.fragPrevious&&v&&"initSegment"!==v.sn){var p=v.sn-d.startSN;p>1&&(v=d.fragments[p-1],this.fragmentTracker.removeFragment(v))}if(v&&this.fragmentTracker.getState(v)===tt.OK&&this.nextLoadPosition>g){var m=this.audioOnly&&!this.altAudio?u.a.AUDIO:u.a.VIDEO;this.afterBufferFlushed(s,m,k.b.MAIN),v=this.getNextFragment(this.nextLoadPosition,d)}v&&(!v.initSegment||v.initSegment.data||this.bitrateTest||(v=v.initSegment),"identity"!==(null===(t=v.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=v.decryptdata)&&void 0!==e&&e.key?this.loadFragment(v,d,g):this.loadKey(v,d))}}}},c.loadFragment=function(e,r,i){var n,a=this.fragmentTracker.getState(e);if(this.fragCurrent=e,a===tt.BACKTRACKED){var s=this.fragmentTracker.getBacktrackData(e);if(s)return this._handleFragmentLoadProgress(s),void this._handleFragmentLoadComplete(s);a=tt.NOT_LOADED}a===tt.NOT_LOADED||a===tt.PARTIAL?"initSegment"===e.sn?this._loadInitSegment(e):this.bitrateTest?(e.bitrateTest=!0,this.log("Fragment "+e.sn+" of level "+e.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(e)):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,i)):a===tt.APPENDING?this.reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e):0===(null===(n=this.media)||void 0===n?void 0:n.buffered.length)&&this.fragmentTracker.removeAllFragments()},c.getAppendedFrag=function(t){var e=this.fragmentTracker.getAppendedFrag(t,k.b.MAIN);return e&&"fragment"in e?e.fragment:e},c.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,k.b.MAIN)},c.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.end+.5):null},c.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},c.nextLevelSwitch=function(){var t=this.levels,e=this.media;if(null!=e&&e.readyState){var r,i=this.getAppendedFrag(e.currentTime);if(i&&i.start>1&&this.flushMainBuffer(0,i.start-1),!e.paused&&t){var n=t[this.hls.nextLoadLevel],a=this.fragLastKbps;r=a&&this.fragCurrent?this.fragCurrent.duration*n.maxBitrate/(1e3*a)+1:0}else r=0;var s=this.getBufferedFrag(e.currentTime+r);if(s){var o=this.followingBufferedFrag(s);if(o){this.abortCurrentFrag();var l=o.maxStartPTS?o.maxStartPTS:o.start,u=o.duration,h=Math.max(s.end,l+Math.min(Math.max(u-this.config.maxFragLookUpTolerance,.5*u),.75*u));this.flushMainBuffer(h,Number.POSITIVE_INFINITY)}}}},c.abortCurrentFrag=function(){var t=this.fragCurrent;this.fragCurrent=null,null!=t&&t.loader&&t.loader.abort(),this.state===Mt&&(this.state=Pt),this.nextLoadPosition=this.getLoadPosition()},c.flushMainBuffer=function(e,r){t.prototype.flushMainBuffer.call(this,e,r,this.altAudio?"video":null)},c.onMediaAttached=function(e,r){t.prototype.onMediaAttached.call(this,e,r);var i=r.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new te(this.config,i,this.fragmentTracker,this.hls)},c.onMediaDetaching=function(){var e=this.media;e&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),t.prototype.onMediaDetaching.call(this)},c.onMediaPlaying=function(){this.tick()},c.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:null;Object(n.a)(e)&&this.log("Media seeked to "+e.toFixed(3)),this.tick()},c.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(a.a.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},c.onManifestParsed=function(t,e){var r,i,n,a=!1,s=!1;e.levels.forEach((function(t){(r=t.audioCodec)&&(-1!==r.indexOf("mp4a.40.2")&&(a=!0),-1!==r.indexOf("mp4a.40.5")&&(s=!0))})),this.audioCodecSwitch=a&&s&&!("function"==typeof(null==(n=Xt())||null===(i=n.prototype)||void 0===i?void 0:i.changeType)),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1},c.onLevelLoading=function(t,e){var r=this.levels;if(r&&this.state===Pt){var i=r[e.level];(!i.details||i.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(i.details))&&(this.state=Wt)}},c.onLevelLoaded=function(t,e){var r,i=this.levels,n=e.level,s=e.details,o=s.totalduration;if(i){this.log("Level "+n+" loaded ["+s.startSN+","+s.endSN+"], cc ["+s.startCC+", "+s.endCC+"] duration:"+o);var l=this.fragCurrent;!l||this.state!==Ft&&this.state!==Nt||l.level!==e.level&&l.loader&&(this.state=Pt,l.loader.abort());var u=i[n],h=0;if(s.live||null!==(r=u.details)&&void 0!==r&&r.live){if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed)return;h=this.alignPlaylists(s,u.details)}if(u.details=s,this.levelLastLoaded=n,this.hls.trigger(a.a.LEVEL_UPDATED,{details:s,level:n}),this.state===Wt){if(this.waitForCdnTuneIn(s))return;this.state=Pt}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,h),this.tick()}else this.warn("Levels were reset while loading level "+n)},c._handleFragmentLoadProgress=function(t){var e,r=t.frag,i=t.part,n=t.payload,a=this.levels;if(a){var s=a[r.level],o=s.details;if(o){var l=s.videoCodec,u=o.PTSKnown||!o.live,h=null===(e=r.initSegment)||void 0===e?void 0:e.data,d=this._getAudioCodec(s),c=this.transmuxer=this.transmuxer||new Zt(this.hls,k.b.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=i?i.index:-1,g=-1!==f,v=new ut(r.level,r.sn,r.stats.chunkCount,n.byteLength,f,g),p=this.initPTS[r.cc];c.push(n,h,d,l,r,i,o.totalduration,u,v,p)}else this.warn("Dropping fragment "+r.sn+" of level "+r.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},c.onAudioTrackSwitching=function(t,e){var r=this.altAudio,i=!!e.url,n=e.id;if(!i){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var s=this.fragCurrent;null!=s&&s.loader&&(this.log("Switching to main audio track, cancel main fragment load"),s.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var o=this.hls;r&&o.trigger(a.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),o.trigger(a.a.AUDIO_TRACK_SWITCHED,{id:n})}},c.onAudioTrackSwitched=function(t,e){var r=e.id,i=!!this.hls.audioTracks[r].url;if(i){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=i,this.tick()},c.onBufferCreated=function(t,e){var r,i,n=e.tracks,a=!1;for(var s in n){var o=n[s];if("main"===o.id){if(i=s,r=o,"video"===s){var l=n[s];l&&(this.videoBuffer=l.buffer)}}else a=!0}a&&r?(this.log("Alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media},c.onFragBuffered=function(t,e){var r=e.frag,i=e.part;if(!r||r.type===k.b.MAIN){if(this.fragContextChanged(r))return this.warn("Fragment "+r.sn+(i?" p: "+i.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===Gt&&(this.state=Pt));var n=i?i.stats:r.stats;this.fragLastKbps=Math.round(8*n.total/(n.buffering.end-n.loading.first)),"initSegment"!==r.sn&&(this.fragPrevious=r),this.fragBufferedComplete(r,i)}},c.onError=function(t,e){switch(e.details){case s.a.FRAG_LOAD_ERROR:case s.a.FRAG_LOAD_TIMEOUT:case s.a.KEY_LOAD_ERROR:case s.a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(k.b.MAIN,e);break;case s.a.LEVEL_LOAD_ERROR:case s.a.LEVEL_LOAD_TIMEOUT:this.state!==Ht&&(e.fatal?(this.warn(""+e.details),this.state=Ht):e.levelRetry||this.state!==Wt||(this.state=Pt));break;case s.a.BUFFER_FULL_ERROR:if("main"===e.parent&&(this.state===Bt||this.state===Gt)){var r=!0,i=this.getFwdBufferInfo(this.media,k.b.MAIN);i&&i.len>.5&&(r=!this.reduceMaxBufferLength(i.len)),r&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},c.checkBuffer=function(){var t=this.media,e=this.gapController;if(t&&e&&t.readyState){var r=lt.getBuffered(t);!this.loadedmetadata&&r.length?(this.loadedmetadata=!0,this.seekToStartPos()):e.poll(this.lastCurrentTime),this.lastCurrentTime=t.currentTime}},c.onFragLoadEmergencyAborted=function(){this.state=Pt,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},c.onBufferFlushed=function(t,e){var r=e.type;if(r!==u.a.AUDIO||this.audioOnly&&!this.altAudio){var i=(r===u.a.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(i,r,k.b.MAIN)}},c.onLevelsUpdated=function(t,e){this.levels=e.levels},c.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},c.seekToStartPos=function(){var t=this.media,e=t.currentTime,r=this.startPosition;if(r>=0&&e0&&(n1&&!1===t.seeking){var r=t.currentTime;if(lt.isBuffered(t,r)?e=this.getAppendedFrag(r):lt.isBuffered(t,r+.1)&&(e=this.getAppendedFrag(r+.1)),e){var i=this.fragPlaying,n=e.level;i&&e.sn===i.sn&&i.level===n&&e.urlId===i.urlId||(this.hls.trigger(a.a.FRAG_CHANGED,{frag:e}),i&&i.level===n||this.hls.trigger(a.a.LEVEL_SWITCHED,{level:n}),this.fragPlaying=e)}}},l=i,(h=[{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);return this.followingBufferedFrag(e)}return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&ee(l.prototype,h),d&&ee(l,d),i}(Yt),ne=function(){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=r}var e=t.prototype;return e.sample=function(t,e){var r=Math.pow(this.alpha_,t);this.estimate_=e*(1-r)+r*this.estimate_,this.totalWeight_+=t},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_},t}(),ae=function(){function t(t,e,r){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new ne(t),this.fast_=new ne(e)}var e=t.prototype;return e.update=function(t,e){var r=this.slow_,i=this.fast_;this.slow_.halfLife!==t&&(this.slow_=new ne(t,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==e&&(this.fast_=new ne(e,i.getEstimate(),i.getTotalWeight()))},e.sample=function(t,e){var r=(t=Math.max(t,this.minDelayMs_))/1e3,i=8*e/r;this.fast_.sample(r,i),this.slow_.sample(r,i)},e.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},e.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.destroy=function(){},t}();function se(t,e){for(var r=0;r=2*h/c||y<=b)){var E,S=Number.POSITIVE_INFINITY;for(E=t.level-1;E>g;E--){if((S=h*f[E].maxBitrate/(6.4*m))=y)){var L=this.bwEstimator.getEstimate();o.b.warn("Fragment "+t.sn+(e?" part "+e.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+E+"\n Current BW estimate: "+(Object(n.a)(L)?(L/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+y.toFixed(3)+" s\n Estimated load time for the next fragment: "+S.toFixed(3)+" s\n Time to underbuffer: "+b.toFixed(3)+" s"),r.nextLoadLevel=E,this.bwEstimator.sample(d,u.loaded),this.clearTimer(),t.loader&&(this.fragCurrent=this.partCurrent=null,t.loader.abort()),r.trigger(a.a.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:u})}}}}}},l.onFragLoaded=function(t,e){var r=e.frag,i=e.part;if(r.type===k.b.MAIN&&Object(n.a)(r.sn)){var s=i?i.stats:r.stats,o=i?i.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var l=this.hls.levels[r.level],u=(l.loaded?l.loaded.bytes:0)+s.loaded,h=(l.loaded?l.loaded.duration:0)+o;l.loaded={bytes:u,duration:h},l.realBitrate=Math.round(8*u/h)}if(r.bitrateTest){var d={stats:s,frag:r,part:i,id:r.type};this.onFragBuffered(a.a.FRAG_BUFFERED,d),r.bitrateTest=!1}}},l.onFragBuffered=function(t,e){var r=e.frag,i=e.part,n=i?i.stats:r.stats;if(!n.aborted&&r.type===k.b.MAIN&&"initSegment"!==r.sn){var a=n.parsing.end-n.loading.start;this.bwEstimator.sample(a,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}},l.onError=function(t,e){switch(e.details){case s.a.FRAG_LOAD_ERROR:case s.a.FRAG_LOAD_TIMEOUT:this.clearTimer()}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var t=this.fragCurrent,e=this.partCurrent,r=this.hls,i=r.maxAutoLevel,n=r.config,a=r.minAutoLevel,s=r.media,l=e?e.duration:t?t.duration:0,u=s?s.currentTime:0,h=s&&0!==s.playbackRate?Math.abs(s.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,c=(lt.bufferInfo(s,u,n.maxBufferHole).end-u)/h,f=this.findBestLevel(d,a,i,c,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(f>=0)return f;o.b.trace((c?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=l?Math.min(l,n.maxStarvationDelay):n.maxStarvationDelay,v=n.abrBandWidthFactor,p=n.abrBandWidthUpFactor;if(!c){var m=this.bitrateTestDelay;if(m)g=(l?Math.min(l,n.maxLoadingDelay):n.maxLoadingDelay)-m,o.b.trace("bitrate test took "+Math.round(1e3*m)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),v=p=1}return f=this.findBestLevel(d,a,i,c+g,v,p),Math.max(f,0)},l.findBestLevel=function(t,e,r,i,n,a){for(var s,l=this.fragCurrent,u=this.partCurrent,h=this.lastLoadedFragLevel,d=this.hls.levels,c=d[h],f=!(null==c||null===(s=c.details)||void 0===s||!s.live),g=null==c?void 0:c.codecSet,v=u?u.duration:l?l.duration:0,p=r;p>=e;p--){var m=d[p];if(m&&(!g||m.codecSet===g)){var y=m.details,T=(u?null==y?void 0:y.partTarget:null==y?void 0:y.averagetargetduration)||v,b=void 0;b=p<=h?n*t:a*t;var E=d[p].maxBitrate,S=E*T/b;if(o.b.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+p+"/"+Math.round(b)+"/"+E+"/"+T+"/"+i+"/"+S),b>E&&(!S||f&&!this.bitrateTestDelay||S0&&-1===t?(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=Pt):(this.loadedmetadata=!1,this.state=Ut),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},l.doTick=function(){switch(this.state){case Pt:this.doTickIdle();break;case Ut:var e,r=this.levels,i=this.trackId,n=null==r||null===(e=r[i])||void 0===e?void 0:e.details;if(n){if(this.waitForCdnTuneIn(n))break;this.state=Vt}break;case Nt:var a,s=performance.now(),l=this.retryDate;(!l||s>=l||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=Pt);break;case Vt:var u=this.waitingData;if(u){var h=u.frag,d=u.part,c=u.cache,f=u.complete;if(void 0!==this.initPTS[h.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=Ft;var g={frag:h,part:d,payload:c.flush(),networkDetails:null};this._handleFragmentLoadProgress(g),f&&t.prototype._handleFragmentLoadComplete.call(this,g)}else if(this.videoTrackCC!==this.waitingVideoCC)o.b.log("Waiting fragment cc ("+h.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var v=this.getLoadPosition(),p=lt.bufferInfo(this.mediaBuffer,v,this.config.maxBufferHole);yt(p.end,this.config.maxFragLookUpTolerance,h)<0&&(o.b.log("Waiting fragment cc ("+h.cc+") @ "+h.start+" cancelled because another fragment at "+p.end+" is needed"),this.clearWaitingFragment())}}else this.state=Pt}this.onTickEnd()},l.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Pt)},l.onTickEnd=function(){var t=this.media;if(t&&t.readyState){var e=(this.mediaBuffer?this.mediaBuffer:t).buffered;!this.loadedmetadata&&e.length&&(this.loadedmetadata=!0),this.lastCurrentTime=t.currentTime}},l.doTickIdle=function(){var t,e,r=this.hls,i=this.levels,n=this.media,s=this.trackId,o=r.config;if(i&&i[s]&&(n||!this.startFragRequested&&o.startFragPrefetch)){var l=i[s].details;if(!l||l.live&&this.levelLastLoaded!==s||this.waitForCdnTuneIn(l))this.state=Ut;else{this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,u.a.AUDIO,k.b.AUDIO));var h=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,k.b.AUDIO);if(null!==h){var d=h.len,c=this.getMaxBufferLength(),f=this.audioSwitch;if(!(d>=c)||f){if(!f&&this._streamEnded(h,l))return r.trigger(a.a.BUFFER_EOS,{type:"audio"}),void(this.state=jt);var g=l.fragments[0].start,v=h.end;if(f){var p=this.getLoadPosition();v=p,l.PTSKnown&&pg||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=g+.05)}var m=this.getNextFragment(v,l);m?"identity"!==(null===(t=m.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=m.decryptdata)&&void 0!==e&&e.key?this.loadFragment(m,l,v):this.loadKey(m,l):this.bufferFlushed=!0}}}}},l.getMaxBufferLength=function(){var e=t.prototype.getMaxBufferLength.call(this),r=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,k.b.MAIN);return null===r?e:Math.max(e,r.len)},l.onMediaDetaching=function(){this.videoBuffer=null,t.prototype.onMediaDetaching.call(this)},l.onAudioTracksUpdated=function(t,e){var r=e.audioTracks;this.resetTransmuxer(),this.levels=r.map((function(t){return new j(t)}))},l.onAudioTrackSwitching=function(t,e){var r=!!e.url;this.trackId=e.id;var i=this.fragCurrent;null!=i&&i.loader&&i.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),r?this.setInterval(100):this.resetTransmuxer(),r?(this.audioSwitch=!0,this.state=Pt):this.state=xt,this.tick()},l.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},l.onLevelLoaded=function(t,e){this.mainDetails=e.details},l.onAudioTrackLoaded=function(t,e){var r,i=this.levels,n=e.details,a=e.id;if(i){this.log("Track "+a+" loaded ["+n.startSN+","+n.endSN+"],duration:"+n.totalduration);var s=i[a],o=0;if(n.live||null!==(r=s.details)&&void 0!==r&&r.live){var l=this.mainDetails;if(n.fragments[0]||(n.deltaUpdateFailed=!0),n.deltaUpdateFailed||!l)return;!s.details&&n.hasProgramDateTime&&l.hasProgramDateTime?(gt(n,l),o=n.fragments[0].start):o=this.alignPlaylists(n,s.details)}s.details=n,this.levelLastLoaded=a,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(s.details,o),this.state!==Ut||this.waitForCdnTuneIn(n)||(this.state=Pt),this.tick()}else this.warn("Audio tracks were reset while loading level "+a)},l._handleFragmentLoadProgress=function(t){var e,r=t.frag,i=t.part,n=t.payload,a=this.config,s=this.trackId,l=this.levels;if(l){var u=l[s],h=u.details,d=a.defaultAudioCodec||u.audioCodec||"mp4a.40.2",c=this.transmuxer;c||(c=this.transmuxer=new Zt(this.hls,k.b.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var f=this.initPTS[r.cc],g=null===(e=r.initSegment)||void 0===e?void 0:e.data;if(void 0!==f){var v=i?i.index:-1,p=-1!==v,m=new ut(r.level,r.sn,r.stats.chunkCount,n.byteLength,v,p);c.push(n,g,d,"",r,i,h.totalduration,!1,m,f)}else{o.b.log("Unknown video PTS for cc "+r.cc+", waiting for video PTS before demuxing audio frag "+r.sn+" of ["+h.startSN+" ,"+h.endSN+"],track "+s),(this.waitingData=this.waitingData||{frag:r,part:i,cache:new le.a,complete:!1}).cache.push(new Uint8Array(n)),this.waitingVideoCC=this.videoTrackCC,this.state=Vt}}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+r.sn+" of level "+r.level+" will not be buffered")},l._handleFragmentLoadComplete=function(e){this.waitingData?this.waitingData.complete=!0:t.prototype._handleFragmentLoadComplete.call(this,e)},l.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},l.onBufferCreated=function(t,e){var r=e.tracks.audio;r&&(this.mediaBuffer=r.buffer),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},l.onFragBuffered=function(t,e){var r=e.frag,i=e.part;r.type===k.b.AUDIO&&(this.fragContextChanged(r)?this.warn("Fragment "+r.sn+(i?" p: "+i.index:"")+" of level "+r.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==r.sn&&(this.fragPrevious=r,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(a.a.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(r,i)))},l.onError=function(e,r){switch(r.details){case s.a.FRAG_LOAD_ERROR:case s.a.FRAG_LOAD_TIMEOUT:case s.a.KEY_LOAD_ERROR:case s.a.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(k.b.AUDIO,r);break;case s.a.AUDIO_TRACK_LOAD_ERROR:case s.a.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==Ht&&this.state!==xt&&(this.state=r.fatal?Ht:Pt,this.warn(r.details+" while loading frag, switching to "+this.state+" state"));break;case s.a.BUFFER_FULL_ERROR:if("audio"===r.parent&&(this.state===Bt||this.state===Gt)){var i=!0,n=this.getFwdBufferInfo(this.mediaBuffer,k.b.AUDIO);n&&n.len>.5&&(i=!this.reduceMaxBufferLength(n.len)),i&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},l.onBufferFlushed=function(t,e){e.type===u.a.AUDIO&&(this.bufferFlushed=!0)},l._handleTransmuxComplete=function(t){var e,r="audio",i=this.hls,n=t.remuxResult,s=t.chunkMeta,o=this.getCurrentContext(s);if(!o)return this.warn("The loading context changed while buffering fragment "+s.sn+" of level "+s.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(s.level);var l=o.frag,h=o.part,d=n.audio,c=n.text,f=n.id3,g=n.initSegment;if(!this.fragContextChanged(l)){if(this.state=Bt,this.audioSwitch&&d&&this.completeAudioSwitch(),null!=g&&g.tracks&&(this._bufferInitSegment(g.tracks,l,s),i.trigger(a.a.FRAG_PARSING_INIT_SEGMENT,{frag:l,id:r,tracks:g.tracks})),d){var v=d.startPTS,p=d.endPTS,m=d.startDTS,y=d.endDTS;h&&(h.elementaryStreams[u.a.AUDIO]={startPTS:v,endPTS:p,startDTS:m,endDTS:y}),l.setElementaryStreamInfo(u.a.AUDIO,v,p,m,y),this.bufferFragmentData(d,l,h,s)}if(null!=f&&null!==(e=f.samples)&&void 0!==e&&e.length){var T=ue({frag:l,id:r},f);i.trigger(a.a.FRAG_PARSING_METADATA,T)}if(c){var b=ue({frag:l,id:r},c);i.trigger(a.a.FRAG_PARSING_USERDATA,b)}}},l._bufferInitSegment=function(t,e,r){if(this.state===Bt){t.video&&delete t.video;var i=t.audio;if(i){i.levelCodec=i.codec,i.id="audio",this.log("Init audio buffer, container:"+i.container+", codecs[parsed]=["+i.codec+"]"),this.hls.trigger(a.a.BUFFER_CODECS,t);var n=i.initSegment;if(null!=n&&n.byteLength){var s={type:"audio",frag:e,part:null,chunkMeta:r,parent:e.type,data:n};this.hls.trigger(a.a.BUFFER_APPENDING,s)}this.tick()}}},l.loadFragment=function(e,r,i){var a=this.fragmentTracker.getState(e);this.fragCurrent=e,(this.audioSwitch||a===tt.NOT_LOADED||a===tt.PARTIAL)&&("initSegment"===e.sn?this._loadInitSegment(e):r.live&&!Object(n.a)(this.initPTS[e.cc])?(this.log("Waiting for video PTS in continuity counter "+e.cc+" of live stream before loading audio fragment "+e.sn+" of level "+this.trackId),this.state=Vt):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,r,i)))},l.completeAudioSwitch=function(){var e=this.hls,r=this.media,i=this.trackId;r&&(this.log("Switching audio track : flushing all audio"),t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,e.trigger(a.a.AUDIO_TRACK_SWITCHED,{id:i})},i}(Yt);function ce(t,e){for(var r=0;r=e.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var r=e[this.trackId];this.log("Now switching to audio-track index "+t);var i=e[t],n=i.id,s=i.groupId,o=void 0===s?"":s,l=i.name,u=i.type,h=i.url;if(this.trackId=t,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(a.a.AUDIO_TRACK_SWITCHING,{id:n,groupId:o,name:l,type:u,url:h}),!i.details||i.details.live){var d=this.switchParams(i.url,null==r?void 0:r.details);this.loadPlaylist(d)}}},u.selectInitialTrack=function(){this.tracksInGroup;var t=this.trackName,e=this.findTrackId(t)||this.findTrackId();-1!==e?this.setAudioTrack(e):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},u.findTrackId=function(t){for(var e=this.tracksInGroup,r=0;r=n[o].start&&s<=n[o].end){a=n[o];break}var l=r.start+r.duration;a?a.end=l:(a={start:s,end:l},n.push(a)),this.fragmentTracker.fragBuffered(r)}}},u.onBufferFlushing=function(t,e){var r=e.startOffset,i=e.endOffset;if(0===r&&i!==Number.POSITIVE_INFINITY){var n=this.currentTrackId,a=this.levels;if(!a.length||!a[n]||!a[n].details)return;var s=i-a[n].details.targetduration;if(s<=0)return;e.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach((function(t){for(var e=0;e=s.length||n!==a)&&o){if(this.mediaBuffer=this.mediaBufferTimeRanges,i.live||null!==(r=o.details)&&void 0!==r&&r.live){var l=this.mainDetails;if(i.deltaUpdateFailed||!l)return;var u=l.fragments[0];if(o.details)0===this.alignPlaylists(i,o.details)&&u&&z(i,u.start);else i.hasProgramDateTime&&l.hasProgramDateTime?gt(i,l):u&&z(i,u.start)}if(o.details=i,this.levelLastLoaded=n,this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===Pt)mt(null,i.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}},u._handleFragmentLoadComplete=function(t){var e=t.frag,r=t.payload,i=e.decryptdata,n=this.hls;if(!this.fragContextChanged(e)&&r&&r.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){var s=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(r),i.key.buffer,i.iv.buffer).then((function(t){var r=performance.now();n.trigger(a.a.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:s,tdecrypt:r}})}))}},u.doTick=function(){if(this.media){if(this.state===Pt){var t,e=this.currentTrackId,r=this.levels;if(!r.length||!r[e]||!r[e].details)return;var i=r[e].details,n=i.targetduration,s=this.config,l=this.media,u=lt.bufferedInfo(this.mediaBufferTimeRanges,l.currentTime-n,s.maxBufferHole),h=u.end;if(u.len>this.getMaxBufferLength()+n)return;var d,c=i.fragments,f=c.length,g=i.edge,v=this.fragPrevious;if(h-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},l.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},l.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),be(this.media.textTracks).forEach((function(t){x(t)})),this.subtitleTrack=-1,this.media=null)},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(t,e){this.tracks=e.subtitleTracks},l.onSubtitleTrackLoaded=function(t,e){var r=e.id,i=e.details,n=this.trackId,a=this.tracksInGroup[n];if(a){var s=a.details;a.details=e.details,this.log("subtitle track "+r+" loaded ["+i.startSN+"-"+i.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,e,s))}else this.warn("Invalid subtitle track id "+r)},l.onLevelLoading=function(t,e){this.switchLevel(e.level)},l.onLevelSwitching=function(t,e){this.switchLevel(e.level)},l.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.textGroupIds){var r=e.textGroupIds[e.urlId];if(this.groupId!==r){var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,n=this.tracks.filter((function(t){return!r||t.groupId===r}));this.tracksInGroup=n;var s=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=r;var o={subtitleTracks:n};this.log("Updating subtitle tracks, "+n.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(a.a.SUBTITLE_TRACKS_UPDATED,o),-1!==s&&this.setSubtitleTrack(s,i)}}},l.findTrackId=function(t){for(var e=this.tracksInGroup,r=0;r=i.length)){this.clearTimer();var n=i[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,n){var s=n.id,o=n.groupId,l=void 0===o?"":o,u=n.name,h=n.type,d=n.url;this.hls.trigger(a.a.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:u,type:h,url:d});var c=this.switchParams(n.url,null==e?void 0:e.details);this.loadPlaylist(c)}else this.hls.trigger(a.a.SUBTITLE_TRACK_SWITCH,{id:t})}}else this.queuedDefaultTrack=t},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var t=-1,e=be(this.media.textTracks),r=0;r0||Object.keys(this.pendingTracks).length>0},e.destroy=function(){this.unregisterListeners(),this.details=null},e.registerListeners=function(){var t=this.hls;t.on(a.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.on(a.a.BUFFER_RESET,this.onBufferReset,this),t.on(a.a.BUFFER_APPENDING,this.onBufferAppending,this),t.on(a.a.BUFFER_CODECS,this.onBufferCodecs,this),t.on(a.a.BUFFER_EOS,this.onBufferEos,this),t.on(a.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(a.a.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(a.a.FRAG_PARSED,this.onFragParsed,this),t.on(a.a.FRAG_CHANGED,this.onFragChanged,this)},e.unregisterListeners=function(){var t=this.hls;t.off(a.a.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(a.a.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(a.a.MANIFEST_PARSED,this.onManifestParsed,this),t.off(a.a.BUFFER_RESET,this.onBufferReset,this),t.off(a.a.BUFFER_APPENDING,this.onBufferAppending,this),t.off(a.a.BUFFER_CODECS,this.onBufferCodecs,this),t.off(a.a.BUFFER_EOS,this.onBufferEos,this),t.off(a.a.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(a.a.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(a.a.FRAG_PARSED,this.onFragParsed,this),t.off(a.a.FRAG_CHANGED,this.onFragChanged,this)},e._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new Le(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},e.onManifestParsed=function(t,e){var r=2;(e.audio&&!e.video||!e.altAudio)&&(r=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=r,this.details=null,o.b.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},e.onMediaAttaching=function(t,e){var r=this.media=e.media;if(r&&Ae){var i=this.mediaSource=new Ae;i.addEventListener("sourceopen",this._onMediaSourceOpen),i.addEventListener("sourceended",this._onMediaSourceEnded),i.addEventListener("sourceclose",this._onMediaSourceClose),r.src=self.URL.createObjectURL(i),this._objectUrl=r.src}},e.onMediaDetaching=function(){var t=this.media,e=this.mediaSource,r=this._objectUrl;if(e){if(o.b.log("[buffer-controller]: media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){o.b.warn("[buffer-controller]: onMediaDetaching: "+t.message+" while calling endOfStream")}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(r&&self.URL.revokeObjectURL(r),t.src===r?(t.removeAttribute("src"),t.load()):o.b.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(a.a.MEDIA_DETACHED,void 0)},e.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach((function(e){var r=t.sourceBuffer[e];try{r&&(t.removeBufferListeners(e),t.mediaSource&&t.mediaSource.removeSourceBuffer(r),t.sourceBuffer[e]=void 0)}catch(t){o.b.warn("[buffer-controller]: Failed to reset the "+e+" buffer",t)}})),this._initSourceBuffer()},e.onBufferCodecs=function(t,e){var r=this,i=this.getSourceBufferTypes().length;Object.keys(e).forEach((function(t){if(i){var n=r.tracks[t];if(n&&"function"==typeof n.buffer.changeType){var a=e[t],s=a.codec,o=a.levelCodec,l=a.container;if((n.levelCodec||n.codec).replace(Re,"$1")!==(o||s).replace(Re,"$1")){var u=l+";codecs="+(o||s);r.appendChangeType(t,u)}}}else r.pendingTracks[t]=e[t]})),i||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},e.appendChangeType=function(t,e){var r=this,i=this.operationQueue,n={execute:function(){var n=r.sourceBuffer[t];n&&(o.b.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+e),n.changeType(e)),i.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(e){o.b.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",e)}};i.append(n,t)},e.onBufferAppending=function(t,e){var r=this,i=this.hls,n=this.operationQueue,l=this.tracks,u=e.data,h=e.type,d=e.frag,c=e.part,f=e.chunkMeta,g=f.buffering[h],v=self.performance.now();g.start=v;var p=d.stats.buffering,m=c?c.stats.buffering:null;0===p.start&&(p.start=v),m&&0===m.start&&(m.start=v);var y=l.audio,T="audio"===h&&1===f.id&&"audio/mpeg"===(null==y?void 0:y.container),b={execute:function(){if(g.executeStart=self.performance.now(),T){var t=r.sourceBuffer[h];if(t){var e=d.start-t.timestampOffset;Math.abs(e)>=.1&&(o.b.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+e+") sn: "+d.sn+")"),t.timestampOffset=d.start)}}r.appendExecutor(u,h)},onStart:function(){},onComplete:function(){var t=self.performance.now();g.executeEnd=g.end=t,0===p.first&&(p.first=t),m&&0===m.first&&(m.first=t);var e=r.sourceBuffer,i={};for(var n in e)i[n]=lt.getBuffered(e[n]);r.appendError=0,r.hls.trigger(a.a.BUFFER_APPENDED,{type:h,frag:d,part:c,chunkMeta:f,parent:d.type,timeRanges:i})},onError:function(t){o.b.error("[buffer-controller]: Error encountered while trying to append to the "+h+" SourceBuffer",t);var e={type:s.b.MEDIA_ERROR,parent:d.type,details:s.a.BUFFER_APPEND_ERROR,err:t,fatal:!1};t.code===DOMException.QUOTA_EXCEEDED_ERR?e.details=s.a.BUFFER_FULL_ERROR:(r.appendError++,e.details=s.a.BUFFER_APPEND_ERROR,r.appendError>i.config.appendErrorMaxRetry&&(o.b.error("[buffer-controller]: Failed "+i.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),e.fatal=!0)),i.trigger(a.a.ERROR,e)}};n.append(b,h)},e.onBufferFlushing=function(t,e){var r=this,i=this.operationQueue,n=function(t){return{execute:r.removeExecutor.bind(r,t,e.startOffset,e.endOffset),onStart:function(){},onComplete:function(){r.hls.trigger(a.a.BUFFER_FLUSHED,{type:t})},onError:function(e){o.b.warn("[buffer-controller]: Failed to remove from "+t+" SourceBuffer",e)}}};e.type?i.append(n(e.type),e.type):this.getSourceBufferTypes().forEach((function(t){i.append(n(t),t)}))},e.onFragParsed=function(t,e){var r=this,i=e.frag,n=e.part,s=[],l=n?n.elementaryStreams:i.elementaryStreams;l[u.a.AUDIOVIDEO]?s.push("audiovideo"):(l[u.a.AUDIO]&&s.push("audio"),l[u.a.VIDEO]&&s.push("video"));0===s.length&&o.b.warn("Fragments must have at least one ElementaryStreamType set. type: "+i.type+" level: "+i.level+" sn: "+i.sn),this.blockBuffers((function(){var t=self.performance.now();i.stats.buffering.end=t,n&&(n.stats.buffering.end=t);var e=n?n.stats:i.stats;r.hls.trigger(a.a.FRAG_BUFFERED,{frag:i,part:n,stats:e,id:i.type})}),s)},e.onFragChanged=function(t,e){this.flushBackBuffer()},e.onBufferEos=function(t,e){var r=this;this.getSourceBufferTypes().reduce((function(t,i){var n=r.sourceBuffer[i];return e.type&&e.type!==i||n&&!n.ended&&(n.ended=!0,o.b.log("[buffer-controller]: "+i+" sourceBuffer now EOS")),t&&!(n&&!n.ended)}),!0)&&this.blockBuffers((function(){var t=r.mediaSource;t&&"open"===t.readyState&&t.endOfStream()}))},e.onLevelUpdated=function(t,e){var r=e.details;r.fragments.length&&(this.details=r,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},e.flushBackBuffer=function(){var t=this.hls,e=this.details,r=this.media,i=this.sourceBuffer;if(r&&null!==e){var s=this.getSourceBufferTypes();if(s.length){var o=e.live&&null!==t.config.liveBackBufferLength?t.config.liveBackBufferLength:t.config.backBufferLength;if(Object(n.a)(o)&&!(o<0)){var l=r.currentTime,u=e.levelTargetDuration,h=Math.max(o,u),d=Math.floor(l/u)*u-h;s.forEach((function(r){var n=i[r];if(n){var s=lt.getBuffered(n);s.length>0&&d>s.start(0)&&(t.trigger(a.a.BACK_BUFFER_REACHED,{bufferEnd:d}),e.live&&t.trigger(a.a.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),t.trigger(a.a.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:r}))}}))}}}},e.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var t=this.details,e=this.hls,r=this.media,i=this.mediaSource,a=t.fragments[0].start+t.totalduration,s=r.duration,l=Object(n.a)(i.duration)?i.duration:0;t.live&&e.config.liveDurationInfinity?(o.b.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(t)):(a>l&&a>s||!Object(n.a)(s))&&(o.b.log("[buffer-controller]: Updating Media Source duration to "+a.toFixed(3)),i.duration=a)}},e.updateSeekableRange=function(t){var e=this.mediaSource,r=t.fragments;if(r.length&&t.live&&null!=e&&e.setLiveSeekableRange){var i=Math.max(0,r[0].start),n=Math.max(i,i+t.totalduration);e.setLiveSeekableRange(i,n)}},e.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,e=this.operationQueue,r=this.pendingTracks,i=Object.keys(r).length;if(i&&!t||2===i){this.createSourceBuffers(r),this.pendingTracks={};var n=this.getSourceBufferTypes();if(0===n.length)return void this.hls.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});n.forEach((function(t){e.executeNext(t)}))}},e.createSourceBuffers=function(t){var e=this.sourceBuffer,r=this.mediaSource;if(!r)throw Error("createSourceBuffers called when mediaSource was null");var i=0;for(var n in t)if(!e[n]){var l=t[n];if(!l)throw Error("source buffer exists for track "+n+", however track does not");var u=l.levelCodec||l.codec,h=l.container+";codecs="+u;o.b.log("[buffer-controller]: creating sourceBuffer("+h+")");try{var d=e[n]=r.addSourceBuffer(h),c=n;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[n]={buffer:d,codec:u,container:l.container,levelCodec:l.levelCodec,id:l.id},i++}catch(t){o.b.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:h})}}i&&this.hls.trigger(a.a.BUFFER_CREATED,{tracks:this.tracks})},e._onSBUpdateStart=function(t){this.operationQueue.current(t).onStart()},e._onSBUpdateEnd=function(t){var e=this.operationQueue;e.current(t).onComplete(),e.shiftAndExecuteNext(t)},e._onSBUpdateError=function(t,e){o.b.error("[buffer-controller]: "+t+" SourceBuffer error",e),this.hls.trigger(a.a.ERROR,{type:s.b.MEDIA_ERROR,details:s.a.BUFFER_APPENDING_ERROR,fatal:!1});var r=this.operationQueue.current(t);r&&r.onError(e)},e.removeExecutor=function(t,e,r){var i=this.media,a=this.mediaSource,s=this.operationQueue,l=this.sourceBuffer[t];if(!i||!a||!l)return o.b.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),void s.shiftAndExecuteNext(t);var u=Object(n.a)(i.duration)?i.duration:1/0,h=Object(n.a)(a.duration)?a.duration:1/0,d=Math.max(0,e),c=Math.min(r,u,h);c>d?(o.b.log("[buffer-controller]: Removing ["+d+","+c+"] from the "+t+" SourceBuffer"),l.remove(d,c)):s.shiftAndExecuteNext(t)},e.appendExecutor=function(t,e){var r=this.operationQueue,i=this.sourceBuffer[e];if(!i)return o.b.warn("[buffer-controller]: Attempting to append to the "+e+" SourceBuffer, but it does not exist"),void r.shiftAndExecuteNext(e);i.ended=!1,i.appendBuffer(t)},e.blockBuffers=function(t,e){var r=this;if(void 0===e&&(e=this.getSourceBufferTypes()),!e.length)return o.b.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(t);var i=this.operationQueue,n=e.map((function(t){return i.appendBlocker(t)}));Promise.all(n).then((function(){t(),e.forEach((function(t){var e=r.sourceBuffer[t];e&&e.updating||i.shiftAndExecuteNext(t)}))}))},e.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},e.addBufferListener=function(t,e,r){var i=this.sourceBuffer[t];if(i){var n=r.bind(this,t);this.listeners[t].push({event:e,listener:n}),i.addEventListener(e,n)}},e.removeBufferListeners=function(t){var e=this.sourceBuffer[t];e&&this.listeners[t].forEach((function(t){e.removeEventListener(t.event,t.listener)}))},t}(),ke={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},_e=function(t){var e=t;return ke.hasOwnProperty(t)&&(e=ke[t]),String.fromCharCode(e)},Ie={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Ce={17:2,18:4,21:6,22:8,23:10,19:13,20:15},we={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Oe={25:2,26:4,29:6,30:8,31:10,27:13,28:15},xe=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];!function(t){t[t.ERROR=0]="ERROR",t[t.TEXT=1]="TEXT",t[t.WARNING=2]="WARNING",t[t.INFO=2]="INFO",t[t.DEBUG=3]="DEBUG",t[t.DATA=3]="DATA"}(Ee||(Ee={}));var Pe=function(){function t(){this.time=null,this.verboseLevel=Ee.ERROR}return t.prototype.log=function(t,e){this.verboseLevel>=t&&o.b.log(this.time+" ["+t+"] "+e)},t}(),Me=function(t){for(var e=[],r=0;r100&&(this.logger.log(Ee.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},e.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var r=this.pos+1;r=144&&this.backSpace();var e=_e(t);this.pos>=100?this.logger.log(Ee.ERROR,"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))},e.clearFromPos=function(t){var e;for(e=t;e<100;e++)this.chars[e].reset()},e.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},e.clearToEndOfRow=function(){this.clearFromPos(this.pos)},e.getTextString=function(){for(var t=[],e=!0,r=0;r<100;r++){var i=this.chars[r].uchar;" "!==i&&(e=!1),t.push(i)}return e?"":t.join("")},e.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),Be=function(){function t(t){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var e=0;e<15;e++)this.rows.push(new Ue(t));this.logger=t,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var e=t.prototype;return e.reset=function(){for(var t=0;t<15;t++)this.rows[t].clear();this.currRow=14},e.equals=function(t){for(var e=!0,r=0;r<15;r++)if(!this.rows[r].equals(t.rows[r])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<15;e++)this.rows[e].copy(t.rows[e])},e.isEmpty=function(){for(var t=!0,e=0;e<15;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},e.backSpace=function(){this.rows[this.currRow].backSpace()},e.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},e.insertChar=function(t){this.rows[this.currRow].insertChar(t)},e.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},e.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},e.setCursor=function(t){this.logger.log(Ee.INFO,"setCursor: "+t),this.rows[this.currRow].setCursor(t)},e.setPAC=function(t){this.logger.log(Ee.INFO,"pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e0&&(r=t?"["+e.join(" | ")+"]":e.join("\n")),r},e.getTextAndFormat=function(){return this.rows},t}(),Ge=function(){function t(t,e,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new Be(r),this.nonDisplayedMemory=new Be(r),this.lastOutputScreen=new Be(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}var e=t.prototype;return e.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},e.getHandler=function(){return this.outputFilter},e.setHandler=function(t){this.outputFilter=t},e.setPAC=function(t){this.writeScreen.setPAC(t)},e.setBkgData=function(t){this.writeScreen.setBkgData(t)},e.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(Ee.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)},e.insertChars=function(t){for(var e=0;e=46,e.italics)e.foreground="white";else{var r=Math.floor(t/2)-16;e.foreground=["white","green","blue","cyan","red","yellow","magenta"][r]}this.logger.log(Ee.INFO,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},e.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},e.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}();function Ke(t,e,r){r.a=t,r.b=e}function je(t,e,r){return r.a===t&&r.b===e}var He=function(){function t(t,e,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var i=new Pe;this.channels=[null,new Ge(t,e,i),new Ge(t+1,r,i)],this.cmdHistory={a:null,b:null},this.logger=i}var e=t.prototype;return e.getHandler=function(t){return this.channels[t].getHandler()},e.setHandler=function(t,e){this.channels[t].setHandler(e)},e.addData=function(t,e){var r,i,n,a=!1;this.logger.time=t;for(var s=0;s ("+Me([i,n])+")"),(r=this.parseCmd(i,n))||(r=this.parseMidrow(i,n)),r||(r=this.parsePAC(i,n)),r||(r=this.parseBackgroundAttributes(i,n)),!r&&(a=this.parseChars(i,n))){var o=this.currentChannel;if(o&&o>0)this.channels[o].insertChars(a);else this.logger.log(Ee.WARNING,"No channel found yet. TEXT-MODE?")}r||a||this.logger.log(Ee.WARNING,"Couldn't parse cleaned data "+Me([i,n])+" orig: "+Me([e[s],e[s+1]]))}},e.parseCmd=function(t,e){var r=this.cmdHistory;if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=33&&e<=35))return!1;if(je(t,e,r))return Ke(null,null,r),this.logger.log(Ee.DEBUG,"Repeated command ("+Me([t,e])+") is dropped"),!0;var i=20===t||21===t||23===t?1:2,n=this.channels[i];return 20===t||21===t||28===t||29===t?32===e?n.ccRCL():33===e?n.ccBS():34===e?n.ccAOF():35===e?n.ccAON():36===e?n.ccDER():37===e?n.ccRU(2):38===e?n.ccRU(3):39===e?n.ccRU(4):40===e?n.ccFON():41===e?n.ccRDC():42===e?n.ccTR():43===e?n.ccRTD():44===e?n.ccEDM():45===e?n.ccCR():46===e?n.ccENM():47===e&&n.ccEOC():n.ccTO(e-32),Ke(t,e,r),this.currentChannel=i,!0},e.parseMidrow=function(t,e){var r=0;if((17===t||25===t)&&e>=32&&e<=47){if((r=17===t?1:2)!==this.currentChannel)return this.logger.log(Ee.ERROR,"Mismatch channel in midrow parsing"),!1;var i=this.channels[r];return!!i&&(i.ccMIDROW(e),this.logger.log(Ee.DEBUG,"MIDROW ("+Me([t,e])+")"),!0)}return!1},e.parsePAC=function(t,e){var r,i=this.cmdHistory;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127)&&!((16===t||24===t)&&e>=64&&e<=95))return!1;if(je(t,e,i))return Ke(null,null,i),!0;var n=t<=23?1:2;r=e>=64&&e<=95?1===n?Ie[t]:we[t]:1===n?Ce[t]:Oe[t];var a=this.channels[n];return!!a&&(a.setPAC(this.interpretPAC(r,e)),Ke(t,e,i),this.currentChannel=n,!0)},e.interpretPAC=function(t,e){var r,i={color:null,italics:!1,indent:null,underline:!1,row:t};return r=e>95?e-96:e-64,i.underline=1==(1&r),r<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((r-16)/2),i},e.parseChars=function(t,e){var r,i,n=null,a=null;(t>=25?(r=2,a=t-8):(r=1,a=t),a>=17&&a<=19)?(i=17===a?e+80:18===a?e+112:e+144,this.logger.log(Ee.INFO,"Special char '"+_e(i)+"' in channel "+r),n=[i]):t>=32&&t<=127&&(n=0===e?[t]:[t,e]);if(n){var s=Me(n);this.logger.log(Ee.DEBUG,"Char codes = "+s.join(",")),Ke(t,e,this.cmdHistory)}return n},e.parseBackgroundAttributes=function(t,e){var r;if(!((16===t||24===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=45&&e<=47))return!1;var i={};16===t||24===t?(r=Math.floor((e-32)/2),i.background=xe[r],e%2==1&&(i.background=i.background+"_semi")):45===e?i.background="transparent":(i.foreground="black",47===e&&(i.underline=!0));var n=t<=23?1:2;return this.channels[n].setBkgData(i),Ke(t,e,this.cmdHistory),!0},e.reset=function(){for(var t=0;tt)&&(this.startTime=t),this.endTime=e,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)},e.reset=function(){this.cueRanges=[]},t}(),We=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var t=["","lr","rl"],e=["start","middle","end","left","right"];function r(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;var r=e.toLowerCase();return!!~t.indexOf(r)&&r}function i(t){return r(e,t)}function n(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i100)throw new Error("Position must be between 0 and 100.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",n({},l,{get:function(){return b},set:function(t){var e=i(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",n({},l,{get:function(){return E},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",n({},l,{get:function(){return S},set:function(t){var e=i(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");S=e,this.hasBeenReset=!0}})),o.displayState=void 0}return a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}(),Ye=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}();function qe(t){function e(t,e,r,i){return 3600*(0|t)+60*(0|e)+(0|r)+parseFloat(i||0)}var r=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?e(r[2],r[3],0,r[4]):e(r[1],r[2],r[3],r[4]):null}var Xe=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)},e.get=function(t,e,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,r){for(var i=0;i=0&&r<=100)return this.set(t,r),!0}return!1},t}();function ze(t,e,r,i){var n=i?t.split(i):[t];for(var a in n)if("string"==typeof n[a]){var s=n[a].split(r);if(2===s.length)e(s[0],s[1])}}var Qe=new We(0,0,""),$e="middle"===Qe.align?"middle":"center";function Je(t,e,r){var i=t;function n(){var e=qe(t);if(null===e)throw new Error("Malformed timestamp: "+i);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function a(){t=t.replace(/^\s+/,"")}if(a(),e.startTime=n(),a(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);t=t.substr(3),a(),e.endTime=n(),a(),function(t,e){var i=new Xe;ze(t,(function(t,e){var n;switch(t){case"region":for(var a=r.length-1;a>=0;a--)if(r[a].id===e){i.set(t,r[a].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":n=e.split(","),i.integer(t,n[0]),i.percent(t,n[0])&&i.set("snapToLines",!1),i.alt(t,n[0],["auto"]),2===n.length&&i.alt("lineAlign",n[1],["start",$e,"end"]);break;case"position":n=e.split(","),i.percent(t,n[0]),2===n.length&&i.alt("positionAlign",n[1],["start",$e,"end","line-left","line-right","auto"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start",$e,"end","left","right"])}}),/:/,/\s/),e.region=i.get("region",null),e.vertical=i.get("vertical","");var n=i.get("line","auto");"auto"===n&&-1===Qe.line&&(n=-1),e.line=n,e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100),e.align=i.get("align",$e);var a=i.get("position","auto");"auto"===a&&50===Qe.position&&(a="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=a}(t,e)}function Ze(t){return t.replace(//gi,"\n")}var tr=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new Ye,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;function r(){var t=e.buffer,r=0;for(t=Ze(t);r>>0).toString()};function sr(t,e,r){return ar(t.toString())+ar(e.toString())+ar(r)}function or(t,e,r,i,a,s,o,l){var u,h=new tr,d=Object(M.f)(new Uint8Array(t)).trim().replace(ir,"\n").split("\n"),c=[],f=Object(er.a)(e,r),g="00:00.000",v=0,p=0,m=!0,y=!1;h.oncue=function(t){var e=i[a],r=i.ccOffset,n=(v-f)/9e4;if(null!=e&&e.new&&(void 0!==p?r=i.ccOffset=e.start:function(t,e,r){var i=t[e],n=t[i.prevCC];if(!n||!n.new&&i.new)return t.ccOffset=t.presentationOffset=i.start,void(i.new=!1);for(;null!==(a=n)&&void 0!==a&&a.new;){var a;t.ccOffset+=i.start-n.start,i.new=!1,n=t[(i=n).prevCC]}t.presentationOffset=r}(i,a,n)),n&&(r=n-i.presentationOffset),y){var o=t.endTime-t.startTime,l=Object(rr.b)(9e4*(t.startTime+r-p),9e4*s)/9e4;t.startTime=l,t.endTime=l+o}var u=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(u)),t.id||(t.id=sr(t.startTime,t.endTime,u)),t.endTime>0&&c.push(t)},h.onparsingerror=function(t){u=t},h.onflush=function(){u?l(u):o(c)},d.forEach((function(t){if(m){if(nr(t,"X-TIMESTAMP-MAP=")){m=!1,y=!0,t.substr(16).split(",").forEach((function(t){nr(t,"LOCAL:")?g=t.substr(6):nr(t,"MPEGTS:")&&(v=parseInt(t.substr(7)))}));try{p=function(t){var e=parseInt(t.substr(-3)),r=parseInt(t.substr(-6,2)),i=parseInt(t.substr(-9,2)),a=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;if(!(Object(n.a)(e)&&Object(n.a)(r)&&Object(n.a)(i)&&Object(n.a)(a)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*r,e+=6e4*i,e+=36e5*a}(g)/1e3}catch(t){y=!1,u=t}return}""===t&&(m=!1)}h.parse(t+"\n")})),h.flush()}function lr(){return(lr=Object.assign||function(t){for(var e=1;e=0&&(c[0]=Math.min(c[0],e),c[1]=Math.max(c[1],r),h=!0,f/(r-e)>.5))return}if(h||n.push([e,r]),this.config.renderTextTracksNatively){var g=this.captionsTracks[t];this.Cues.newCue(g,e,r,i)}else{var v=this.Cues.newCue(null,e,r,i);this.hls.trigger(a.a.CUES_PARSED,{type:"captions",cues:v,track:t})}},e.onInitPtsFound=function(t,e){var r=this,i=e.frag,n=e.id,s=e.initPTS,o=e.timescale,l=this.unparsedVttFrags;"main"===n&&(this.initPTS[i.cc]=s,this.timescale[i.cc]=o),l.length&&(this.unparsedVttFrags=[],l.forEach((function(t){r.onFragLoaded(a.a.FRAG_LOADED,t)})))},e.getExistingTrack=function(t){var e=this.media;if(e)for(var r=0;r0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},n.getMaxLevel=function(e){var r=this,i=this.hls.levels;if(!i.length)return-1;var n=i.filter((function(i,n){return t.isLevelAllowed(n,r.restrictedLevels)&&n<=e}));return this.clientRect=null,t.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},n.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,e={width:0,height:0};if(t){var r=t.getBoundingClientRect();e.width=r.width,e.height=r.height,e.width||e.height||(e.width=r.right-r.left||t.width||0,e.height=r.bottom-r.top||t.height||0)}return this.clientRect=e,e},t.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},t.getMaxLevelByMediaSize=function(t,e,r){if(!t||!t.length)return-1;for(var i,n,a=t.length-1,s=0;s=e||o.height>=r)&&(i=o,!(n=t[s+1])||i.width!==n.width||i.height!==n.height)){a=s;break}}return a},e=t,i=[{key:"contentScaleFactor",get:function(){var t=1;try{t=self.devicePixelRatio}catch(t){}return t}}],(r=[{key:"mediaWidth",get:function(){return this.getDimensions().width*t.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*t.contentScaleFactor}}])&&br(e.prototype,r),i&&br(e,i),t}(),Lr=function(){function t(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}var e=t.prototype;return e.setStreamController=function(t){this.streamController=t},e.registerListeners=function(){this.hls.on(a.a.MEDIA_ATTACHING,this.onMediaAttaching,this)},e.unregisterListeners=function(){this.hls.off(a.a.MEDIA_ATTACHING,this.onMediaAttaching)},e.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},e.onMediaAttaching=function(t,e){var r=this.hls.config;if(r.capLevelOnFPSDrop){var i=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=i,i&&"function"==typeof i.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}},e.checkFPS=function(t,e,r){var i=performance.now();if(e){if(this.lastTime){var n=i-this.lastTime,s=r-this.lastDroppedFrames,l=e-this.lastDecodedFrames,u=1e3*s/n,h=this.hls;if(h.trigger(a.a.FPS_DROP,{currentDropped:s,currentDecoded:l,totalDroppedFrames:r}),u>0&&s>h.config.fpsDroppedMonitoringThreshold*l){var d=h.currentLevel;o.b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===h.autoLevelCapping||h.autoLevelCapping>=d)&&(d-=1,h.trigger(a.a.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:h.currentLevel}),h.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=r,this.lastDecodedFrames=e}},e.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},t}();!function(t){t.WIDEVINE="com.widevine.alpha",t.PLAYREADY="com.microsoft.playready"}(Er||(Er={}));var Ar="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function Rr(t,e){for(var r=0;r3)return void this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var u=3-this._requestLicenseFailureCount+1;o.b.warn("Retrying license request, "+u+" attempts left"),this._requestLicense(r,i)}}},n._generateLicenseRequestChallenge=function(t,e){switch(t.mediaKeySystemDomain){case Er.WIDEVINE:return e}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},n._requestLicense=function(t,e){o.b.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r)return o.b.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var i=this.getLicenseServerUrl(r.mediaKeySystemDomain),n=this._createLicenseXhr(i,t,e);o.b.log("Sending license request to URL: "+i);var l=this._generateLicenseRequestChallenge(r,t);n.send(l)}catch(t){o.b.error("Failure requesting DRM license: "+t),this.hls.trigger(a.a.ERROR,{type:s.b.KEY_SYSTEM_ERROR,details:s.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},n.onMediaAttached=function(t,e){if(this._emeEnabled){var r=e.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)}},n.onMediaDetached=function(){var t=this._media,e=this._mediaKeysList;t&&(t.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map((function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch((function(){}))}))).then((function(){return t.setMediaKeys(null)})).catch((function(){})))},n.onManifestParsed=function(t,e){if(this._emeEnabled){var r=e.levels.map((function(t){return t.audioCodec})).filter((function(t){return!!t})),i=e.levels.map((function(t){return t.videoCodec})).filter((function(t){return!!t}));this._attemptKeySystemAccess(Er.WIDEVINE,r,i)}},e=t,(r=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&Rr(e.prototype,r),i&&Rr(e,i),t}();function Cr(t,e){for(var r=0;r=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);rr&&(r=n.bitrate)}return r>0?r:NaN},e.getBufferLength=function(t){var e=this.hls.media,r=t===Dr.AUDIO?this.audioBuffer:this.videoBuffer;return r&&e?1e3*lt.bufferInfo(r,e.currentTime,this.config.maxBufferHole).len:NaN},e.createPlaylistLoader=function(){var t=this.config.pLoader,e=this.applyPlaylistData,r=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new r(t)}var i=t.prototype;return i.destroy=function(){this.loader.destroy()},i.abort=function(){this.loader.abort()},i.load=function(t,r,i){e(t),this.loader.load(t,r,i)},wr(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},e.createFragmentLoader=function(){var t=this.config.fLoader,e=this.applyFragmentData,r=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new r(t)}var i=t.prototype;return i.destroy=function(){this.loader.destroy()},i.abort=function(){this.loader.abort()},i.load=function(t,r,i){e(t),this.loader.load(t,r,i)},wr(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},t.uuid=function(){var t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.substr(e.lastIndexOf("/")+1)},t.serialize=function(t){for(var e,r=[],i=function(t){return!Number.isNaN(t)&&null!=t&&""!==t&&!1!==t},n=function(t){return Math.round(t)},a=function(t){return 100*n(t/100)},s={br:n,d:n,bl:a,dl:a,mtp:a,nor:function(t){return encodeURIComponent(t)},rtp:a,tb:n},o=Or(Object.keys(t||{}).sort());!(e=o()).done;){var l=e.value,u=t[l];if(i(u)&&!("v"===l&&1===u||"pr"==l&&1===u)){var h=s[l];h&&(u=h(u));var d=typeof u,c=void 0;c="ot"===l||"sf"===l||"st"===l?l+"="+u:"boolean"===d?l:"number"===d?l+"="+u:l+"="+JSON.stringify(u),r.push(c)}}return r.join(",")},t.toHeaders=function(e){for(var r={},i=["Object","Request","Session","Status"],n=[{},{},{},{}],a={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},s=0,o=Object.keys(e);s=2)if(self.clearTimeout(this.requestTimeout),0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start)),4===i){e.onreadystatechange=null,e.onprogress=null;var a=e.status;if(a>=200&&a<300){var s,l;if(r.loading.end=Math.max(self.performance.now(),r.loading.first),l="arraybuffer"===t.responseType?(s=e.response).byteLength:(s=e.responseText).length,r.loaded=r.total=l,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(r,t,s,e),!this.callbacks)return;var h={url:e.responseURL,data:s};this.callbacks.onSuccess(h,r,t,e)}else r.retry>=n.maxRetry||a>=400&&a<499?(o.b.error(a+" while loading "+t.url),this.callbacks.onError({code:a,text:e.statusText},t,e)):(o.b.warn(a+" while loading "+t.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,n.maxRetryDelay),r.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout)}},e.loadtimeout=function(){o.b.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)},e.getCacheAge=function(){var t=null;if(this.loader&&Nr.test(this.loader.getAllResponseHeaders())){var e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t},t}();function Br(t){var e="function"==typeof Map?new Map:void 0;return(Br=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return Gr(t,arguments,Hr(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),jr(i,t)})(t)}function Gr(t,e,r){return(Gr=Kr()?Reflect.construct:function(t,e,r){var i=[null];i.push.apply(i,e);var n=new(Function.bind.apply(t,i));return r&&jr(n,r.prototype),n}).apply(null,arguments)}function Kr(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function jr(t,e){return(jr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Hr(t){return(Hr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Vr(){return(Vr=Object.assign||function(t){for(var e=1;e=i&&n(e,r,a.flush(),t)):n(e,r,l,t),o()})).catch((function(){return Promise.reject()}))}()},t}();function Yr(t,e){return new self.Request(t.url,e)}var qr=function(t){var e,r;function i(e,r,i){var n;return(n=t.call(this,e)||this).code=void 0,n.details=void 0,n.code=r,n.details=i,n}return r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,jr(e,r),i}(Br(Error)),Xr=Wr,zr=/\s/;function Qr(){return(Qr=Object.assign||function(t){for(var e=1;e=16?o--:o++;var f=Ze(l.trim()),g=sr(e,r,f);t&&t.cues&&t.cues.getCueById(g)||((a=new h(e,r,f)).id=g,a.line=d+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*o/32)),u.push(a))}return t&&u.length&&(u.sort((function(t,e){return"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line})),u.forEach((function(e){return O(t,e)}))),u}},enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:me,subtitleTrackController:Se,timelineController:yr,audioStreamController:de,audioTrackController:ge,emeController:Ir,cmcdController:Mr});function ei(t){var e=t.loader;e!==Xr&&e!==Ur?(o.b.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1):function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}()&&(t.loader=Xr,t.progressive=!0,t.enableSoftwareAES=!0,o.b.log("[config]: Progressive streaming enabled, using FetchLoader"))}function ri(t,e){for(var r=0;re)return i;return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,e=this.autoLevelCapping;return-1===e&&t&&t.length?t.length-1:e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(t){this.config.lowLatencyMode=t}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}])&&ri(e.prototype,r),n&&ri(e,n),t}();ii.defaultConfig=void 0}]).default})); +//# sourceMappingURL=hls.min.js.map \ No newline at end of file diff --git a/server/src/main/resources/static/ckplayer/js/ckplayer.min.js b/server/src/main/resources/static/ckplayer/js/ckplayer.min.js new file mode 100644 index 00000000..2021200c --- /dev/null +++ b/server/src/main/resources/static/ckplayer/js/ckplayer.min.js @@ -0,0 +1,7 @@ +/* + * 软件名称:ckplayer + * 版本:X3 + * 版权:www.ckplayer.com + * 开源协议:MIT + */ +(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=global||self,global.ckplayer=factory())}(this,function(){'use strict';var language={play:'%E6%92%AD%E6%94%BE',pause:'%E6%9A%82%E5%81%9C',refresh:'%E9%87%8D%E6%92%AD',full:'%E5%85%A8%E5%B1%8F',exitFull:'%E9%80%80%E5%87%BA%E5%85%A8%E5%B1%8F',webFull:'%E9%A1%B5%E9%9D%A2%E5%85%A8%E5%B1%8F',exitWebFull:'%E9%80%80%E5%87%BA%E9%A1%B5%E9%9D%A2%E5%85%A8%E5%B1%8F',theatre:'%E5%89%A7%E5%9C%BA%E6%A8%A1%E5%BC%8F',exitTheatre:'%E9%80%80%E5%87%BA%E5%89%A7%E5%9C%BA%E6%A8%A1%E5%BC%8F',volume:'%E9%9F%B3%E9%87%8F%EF%BC%9A',muted:'%E9%9D%99%E9%9F%B3',exitmuted:'%E6%81%A2%E5%A4%8D%E9%9F%B3%E9%87%8F',seek:'seek%EF%BC%9A',waiting:'%E7%BC%93%E5%86%B2',live:'%E7%9B%B4%E6%92%AD%E4%B8%AD',backLive:'%E8%BF%94%E5%9B%9E%E7%9B%B4%E6%92%AD',lookBack:'%E5%9B%9E%E7%9C%8B%EF%BC%9A',next:'%E4%B8%8B%E4%B8%80%E9%9B%86',screenshot:'%E8%A7%86%E9%A2%91%E6%88%AA%E5%9B%BE',smallwindows:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E6%92%AD%E6%94%BE%E5%8A%9F%E8%83%BD',playbackrate:'%E5%80%8D%E9%80%9F',playbackrateSuffix:'%E5%80%8D',track:'%E5%AD%97%E5%B9%95',noTrack:'%E6%97%A0%E5%AD%97%E5%B9%95',definition:'%E6%B8%85%E6%99%B0%E5%BA%A6',switchTo:'%E5%88%87%E6%8D%A2%E6%88%90%EF%BC%9A',closeTime:'%7Bseconds%7D%E7%A7%92%E5%90%8E%E5%8F%AF%E5%85%B3%E9%97%AD%E5%B9%BF%E5%91%8A',closeAd:'%E5%85%B3%E9%97%AD%E5%B9%BF%E5%91%8A',second:'%E7%A7%92',details:'%E6%9F%A5%E7%9C%8B%E8%AF%A6%E6%83%85',copy:'%E5%A4%8D%E5%88%B6',copySucceeded:'%E5%A4%8D%E5%88%B6%E6%88%90%E5%8A%9F%EF%BC%8C%E5%8F%AF%E8%B4%B4%E7%B2%98%EF%BC%81',smallwindowsOpen:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%BC%80%E5%90%AF',smallwindowsClose:'%E5%B0%8F%E7%AA%97%E5%8F%A3%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%85%B3%E9%97%AD',screenshotStart:'%E6%88%AA%E5%9B%BE%E4%B8%AD%EF%BC%8C%E8%AF%B7%E7%A8%8D%E5%80%99...',screenshotClose:'%E6%88%AA%E5%9B%BE%E5%8A%9F%E8%83%BD%E5%B7%B2%E5%85%B3%E9%97%AD',loopOpen:'%E5%BE%AA%E7%8E%AF%E6%92%AD%E6%94%BE',loopClose:'%E5%B7%B2%E5%85%B3%E9%97%AD%E5%BE%AA%E7%8E%AF%E6%92%AD%E6%94%BE',close:'%E5%85%B3%E9%97%AD',down:'%E4%B8%8B%E8%BD%BD',p50:'50%25',p75:'75%25',p100:'100%25',timeScheduleAdjust:{prohibit:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%8B%96%E5%8A%A8',prohibitBackOff:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E9%87%8D%E5%A4%8D%E8%A7%82%E7%9C%8B',prohibitForward:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E5%BF%AB%E8%BF%9B',prohibitLookBack:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%92%AD%E6%94%BE%E9%83%A8%E5%88%86%E5%86%85%E5%AE%B9',prohibitForwardNotViewed:'%E8%A7%86%E9%A2%91%E7%A6%81%E6%AD%A2%E6%92%AD%E6%94%BE%E6%9C%AA%E8%A7%82%E7%9C%8B%E7%9A%84%E9%83%A8%E5%88%86'},error:{noMessage:'%E6%9C%AA%E7%9F%A5%E9%94%99%E8%AF%AF',supportVideoError:'%E8%AF%A5%E6%B5%8F%E8%A7%88%E5%99%A8%E7%89%88%E6%9C%AC%E5%A4%AA%E4%BD%8E%EF%BC%8C%E5%BB%BA%E8%AE%AE%E6%9B%B4%E6%8D%A2%E6%88%90%E5%85%B6%E5%AE%83%E6%B5%8F%E8%A7%88%E5%99%A8',videoTypeError:'%E8%AF%A5%E6%B5%8F%E8%A7%88%E5%99%A8%E4%B8%8D%E6%94%AF%E6%8C%81%E6%92%AD%E6%94%BE%E8%AF%A5%E8%A7%86%E9%A2%91%EF%BC%8C%E5%BB%BA%E8%AE%AE%E6%9B%B4%E6%8D%A2%E6%88%90%E5%85%B6%E5%AE%83%E6%B5%8F%E8%A7%88%E5%99%A8',loadingFailed:'%E5%8A%A0%E8%BD%BD%E5%A4%B1%E8%B4%A5',emptied:'%E8%A7%86%E9%A2%91%E6%96%87%E4%BB%B6%E5%8A%A0%E8%BD%BD%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF',screenshot:'%E8%A7%86%E9%A2%91%E6%88%AA%E5%9B%BE%E5%A4%B1%E8%B4%A5',ajax:'Ajax%E6%95%B0%E6%8D%AE%E8%AF%B7%E6%B1%82%E9%94%99%E8%AF%AF',noVideoContainer:'%E6%9C%AA%E6%89%BE%E5%88%B0%E6%94%BE%E7%BD%AE%E8%A7%86%E9%A2%91%E7%9A%84%E5%AE%B9%E5%99%A8'}};var videoObjectDefault={container:'',volume:0.8,poster:'',autoplay:false,loop:false,live:false,rotate:0,zoom:0,ad:null,backLive:false,seek:0,next:null,loaded:'',plug:'',duration:0,preview:null,prompt:null,crossOrigin:'',video:null,type:'',playbackrate:1,ended:null,webFull:false,theatre:null,controls:false,rightBar:null,smallWindows:null,smallWindowsDrag:true,screenshot:false,timeScheduleAdjust:1,logo:'',menu:null,information:{'Load:':'{loadTime} second','Duration:':'{duration} second','Size:':'{videoWidth}x{videoHeight}','Volume:':'{volume}%','Fps:':'{fps}fps','Sudio decoded:':'{audioDecodedByteCount} Byte','Video decoded:':'{videoDecodedByteCount} Byte'},track:null,title:'',language:'',barHideTime:1500,playbackrateOpen:true,playbackrateList:[0.75,1,1.25,1.5,2,4],cookie:null,domain:null,cookiePath:'/',documentFocusPause:false,mouseWheelVolume:2,keyVolume:2,errorShow:true};function ckplayerEmbed(videoObj){var rightMenu=[{title:'ckplayer',link:'http://www.ckplayer.com'},{title:'version:X3',underline:true},{title:'about',click:'aboutShow'}];var vars={},varsTemp={};var video=null;var duration=0;var mutedState='';var recoveryVolume=false;var waited=true;var paused=true;var loadTime=0;var seekTime=0;var oldTime=0,playTime=0,firstSeekTime=-1,maxSeeTime=0;var isChangeDef=true;var playType='';var msgSetTime=null,tipSetTime=null,mouseSetTime=null;var adFrontSetTime=null,adPauseSetTime=null;var closeTipFun=null;var closeTipMouseOut=null;var waitingMessage=true;var hidePreviewSetTime=null;var pSliderMouseDown=false;var playbackTime=0;var loadedmetadataNum=0;var screenshotImg=null;var ad=null;var frontAdPlay=false,pauseAdPlay=false;var barShow=true,rightBarShow=true;var EventTarget=null,newEvent=null,eventTargetList=null;var loadedTrack=false;var C={};var CT=null,CK=null,CM=null,CV=null;var pugPlayer=null;var hls=null;var loadMeta=true;var app='';var nowRotate=0;var nowZoom=100;var smallWindowsState=false;var isDrag=false;var ckplayerCookie='ckplayer-player-cookie';var cookieName='';var cookieTime=0;var cookieArray=[];var focusPause=true;var existenceObj=false;var into=function(obj){if(isUndefined(obj)){player.add=player.into=into;return player}language=decodeURIString(language);if(!isUndefined(window.ckplayerLanguage)){language=mergeObj(language,window.ckplayerLanguage)}eventTarget();documentHidden(function(state){eventTarget('visibilityState',state)});app=getApp();varsTemp={};for(var key in videoObjectDefault){varsTemp[key]=videoObjectDefault[key]}if(valType(obj)=='string'&&(obj.substr(0,8)=='website:'||obj.substr(0,4)=='url:')){var ajaxUrl='';if(obj.substr(0,8)=='website:'){ajaxUrl=obj.substring(8)}if(obj.substr(0,4)=='url:'){ajaxUrl=obj.substring(4)}ajax({url:ajaxUrl,success:function(data){if(data){return into(data)}else{showWindowsError(language['error']['ajax']+',url:'+ajaxUrl);return null}}})}else if(valType(obj)=='object'){varsTemp=standardization(varsTemp,obj);if(!isUndefined(obj['container'])&&obj['container']){CT=$(obj['container']);if(CT){return loadLanguage(obj)}else{return bodyReady(obj)}}else{return bodyReady(obj)}}else{showWindowsError(language['error']['noVideoContainer']);return null}},bodyReady=function(obj){documentReady(function(){if(!isUndefined(obj['container'])){CT=$(obj['container']);if(CT){return loadLanguage(obj)}else{showWindowsError(language['error']['noVideoContainer']);return null}}else{return ajaxWebsite(obj)}});return null},ajaxWebsite=function(obj){if(valType(obj['video'])=='string'&&(obj['video'].substr(0,8)=='website:'||obj['video'].substr(0,4)=='url:')){varsTemp=standardization(varsTemp,obj);var ajaxUrl='';if(obj['video'].substr(0,8)=='website:'){ajaxUrl=obj['video'].substring(8)}if(obj['video'].substr(0,4)=='url:'){ajaxUrl=obj['video'].substring(4)}ajax({url:ajaxUrl,success:function(data){if(data){return into(data)}else{showWindowsError(language['error']['ajax']+',url:'+ajaxUrl);return null}}})}else{showWindowsError(language['error']['noVideoContainer']);return null}},loadLanguage=function(obj){vars=standardization(varsTemp,obj);if(vars['language']){var path=getPath('language')+vars['language']+'.js';loadJs(path,function(){if(!isUndefined(window['ckplayerLanguage'])){language=mergeObj(language,window['ckplayerLanguage'])}return embed(obj)})}else{return embed(obj)}},embed=function(obj){mutedState=vars['volume']>0?false:true;if(!isUndefined(CT)&&CT!=null){if(valType(CT)=='htmlarray'){CT=CT.eq(0)}}else{return null}calculationFps();existenceObj=valType(vars['video'])=='string'&&((vars['video'].substr(0,1)=='.'&&vars['video'].indexOf('/')==-1)||vars['video'].substr(0,1)=='#');if(existenceObj){CK=CT.find('.ckplayer-ckplayer')?CT.find('.ckplayer-ckplayer').eq(0):null;if(CK){CM=CK.find('.ck-main')?CK.find('.ck-main').eq(0):null}if(CM){CV=CM.find('.ck-video')?CM.find('.ck-video').eq(0):null}}if(!CK||!CM||!CV){CT.htm('');CK=createlDiv('ckplayer-ckplayer');CT.append(CK);CM=createlDiv('ck-main');CK.append(CM);CV=createlDiv('ck-video');CM.append(CV)}if(video){video.remove();video=null}if(existenceObj){video=$(vars['video'])?$(vars['video']).eq(0):null}if(!video){video=createlVideo();video.attr('width','100%').attr('height','100%');CV.append(video)}video.volume=vars['volume'];if(vars['autoplay']){player.volume(0);player.muted();recoveryVolume=true;video.attr('autoplay','autoplay');paused=false}else{video.attr('preload','metadata')}CT.loop=vars['loop'];if(CT.loop){video.attr('loop','loop')}if(vars['controls']){video.controls=true}else{video.controls=false}try{if(!existenceObj){video.attr('controlslist','nodownload');video.attr('x-webkit-airplay','true');video.attr('x5-video-orientation','portraint');video.attr('playsinline','true');video.attr('webkit-playsinline','true');video.attr('x5-playsinline','true')}if(vars['crossOrigin']){video.useCORS=true;video.crossOrigin=vars['crossOrigin']}}catch(event){}CT.smallWindows=true;CT.webFull=false;CT.theatre=false;loadFace();if(vars['rotate']>0){player.rotate(vars['rotate'])}if(vars['zoom']>0){player.zoom(vars['zoom'])}if(isUndefined(video.canPlayType)){CT.error={code:5,message:language['error']['supportVideoError']};eventTarget('error',CT.error);showError();return player}addAllListener();if(!isUndefined(vars['loaded'])){if(valType(vars['loaded'])=='function'){try{vars['loaded'](player)}catch(event){}}else if(valType(vars['loaded'])=='string'){try{eval(vars['loaded']+'(player)')}catch(event){}}}if(!existenceObj){changeVideo(vars['video'])}else{changeVideo(video.attr('src'))}return player},changeVideo=function(vstr){var i=0;if(video.attr('src')||video.htm()){player.pause()}if(video.attr('src')&&!existenceObj){video.attr('src','');video.removeAttr('src')}if(!isUndefined(video.textTracks)&&video.textTracks.length>0){for(i=video.find('track').length-1;i>-1;i--){video.find('track').eq(i).remove()}}if(!existenceObj){video.htm('')}if(!isUndefined(vars['ad'])){ad=vars['ad']}var source='';if(valType(vstr)=='string'){if(vstr.substr(0,8)=='website:'||vstr.substr(0,4)=='url:'){var ajaxUrl='';if(vstr.substr(0,8)=='website:'){ajaxUrl=vstr.substring(8)}if(vstr.substr(0,4)=='url:'){ajaxUrl=vstr.substring(4)}ajax({url:ajaxUrl,success:function(data){if(data!=null){vars=standardization(varsTemp,data);changeVideo(vars['video'])}else{CT.error={code:8,message:language['error']['ajax']};eventTarget('error',CT.error);showError()}}});return}else{if(vars['plug']&&!canPlay(vstr)){plugPlayer(vstr)}else{if(!existenceObj){video.attr('src',vstr)}}loadTrack()}}else if(valType(vstr)=='array'){for(i=0;i1){source+=''}}}}if(source){video.htm(source)}loadTrack()}else if(valType(vstr)=='object'){if(vars['plug']){plugPlayer(vstr)}else{CT.error={code:10,message:language['error']['emptied']};eventTarget('error',CT.error);showError()}loadTrack()}if(!isUndefined(video.find('source'))&&video.find('source').length>0){video.find('source').eq(video.find('source').length-1).addListener('error',videoHandler.error)}checkBar();loadLogo();if(isChangeDef){checkDefinition()}if(vars['cookie']){if(valType(vars['cookie'])=='array'&&vars['cookie'].length>=2){if(vars['cookie'][0]&&valType(vars['cookie'][0])=='string'){cookieName=vars['cookie'][0]}if(vars['cookie'][1]&&valType(vars['cookie'][1])=='number'){cookieTime=vars['cookie'][1]}}if(valType(vars['cookie'])=='object'&&!isUndefined(vars['cookie']['name'])){cookieName=vars['cookie']['name'];if(!isUndefined(vars['cookie']['hour'])&&valType(vars['cookie']['hour'])=='number'){cookieTime=vars['cookie']['hour']}}if(valType(vars['cookie'])=='string'){cookieName=vars['cookie']}if(cookieName){cookieName=cookieName.replace(/[ ]*,[ ]*|[ ]+/g,'').replace(/[ ]*;[ ]*|[ ]+/g,'')}}if(!isUndefined(vars['seek'])&&!seekTime){if(valType(vars['seek'])=='number'&&vars['seek']>0){seekTime=vars['seek']}if(valType(vars['seek'])=='string'&&vars['seek']=='cookie'&&cookieName){var cke=player.cookie(cookieName);if(cke){seekTime=cke['time']}}}},plugPlayer=function(url){switch(vars['plug']){case'hls.js':hlsPlayer(url);break;case'flv.js':flvPlayer(url);break;case'mpegts.js':mpegtsPlayer(url);break;case'dash.js':dashPlayer(url);break;default:if(valType(vars['plug'])=='function'){vars['plug'](video,url)}else{CT.error={code:10,message:language['error']['emptied']};eventTarget('error',CT.error);showError()}break}},hlsPlayer=function(url){var path=getPath('hls.js')+'hls.min.js';loadJs(path,function(){if(!isUndefined(Hls)&&Hls.isSupported()){hls=new Hls();hls.loadSource(url);hls.attachMedia(video);hls.on(Hls.Events.ERROR,function(event,data){var code=9;var message=language['error']['loadingFailed'];var fatal=data.fatal;if(!isUndefined(data.response)){if(!isUndefined(data.response.code)){code=data.response.code}if(!isUndefined(data.response.text)&&data.response.text){message=data.response.text}else{if(!isUndefined(event)){message=event}}}CT.error={code:code,message:message};eventTarget('error',CT.error);if(fatal){showError()}})}else if(canPlay(url)){video.attr('src',url)}})},flvPlayer=function(url){var path=getPath('flv.js')+'flv.min.js';loadJs(path,function(){if(typeof(flvjs)!='undefined'&&!isUndefined(flvjs)&&flvjs.isSupported()){var config={type:'flv',url:url};if(valType(url)=='object'){config=url}if(vars['live']){config['isLive']=true}if(pugPlayer){pugPlayer.pause();pugPlayer.unload();pugPlayer.detachMediaElement();pugPlayer.destroy();pugPlayer=null}pugPlayer=flvjs.createPlayer(config);pugPlayer.attachMediaElement(video);pugPlayer.load();pugPlayer.on(flvjs.Events.METADATA_ARRIVED,function(res){videoHandler.loadedMetaData()});pugPlayer.on(flvjs.Events.ERROR,function(errorType,errorDetail,errorInfo){CT.error={code:errorInfo['code'],message:errorInfo['msg']};eventTarget('error',CT.error);showError()})}})},mpegtsPlayer=function(url){var path=getPath('mpegts.js')+'mpegts.js';loadJs(path,function(){if(typeof(mpegts)!='undefined'&&!isUndefined(mpegts)&&mpegts.getFeatureList().mseLivePlayback){var config={type:'mse',url:url};if(valType(url)=='object'){config=url}if(vars['live']){config['isLive']=true}if(pugPlayer){pugPlayer.pause();pugPlayer.unload();pugPlayer.detachMediaElement();pugPlayer.destroy();pugPlayer=null}pugPlayer=mpegts.createPlayer(config);pugPlayer.attachMediaElement(video);pugPlayer.load();pugPlayer.on(mpegts.Events.METADATA_ARRIVED,function(res){videoHandler.loadedMetaData()});pugPlayer.on(mpegts.Events.ERROR,function(errorType,errorDetail,errorInfo){CT.error={code:errorInfo['code'],message:errorInfo['msg']};eventTarget('error',CT.error);showError()})}})},canPlay=function(vStr,num){var vTypeArr=[{vidType:'video/ogg',codType:'theora, vorbis'},{vidType:'video/mp4',codType:'avc1.4D401E, mp4a.40.2'},{vidType:'video/mp4',codType:'avc1'},{vidType:'video/mp4',codType:'hevc'},{vidType:'video/webm',codType:'vp8.0, vorbis'},{vidType:'video/webm',codType:'vp9'},{vidType:'',codType:'application/x-mpegURL'},{vidType:'',codType:'application/vnd.apple.mpegurl'}];var vType={ogg:vTypeArr[0],mp4:[vTypeArr[1],vTypeArr[2],vTypeArr[3]],webm:[vTypeArr[4],vTypeArr[5]],m3u8:[vTypeArr[6],vTypeArr[7]]};var arr=[];var k='';var supportType=function(obj){var vType=obj['vidType'];var str='';if(vType){str=vType+'; codecs="'+obj['codType']+'"'}else{str=obj['codType']}var sup=video.canPlayType(str);if(sup==''){sup='no'}return sup};var getExtension=function(filepath){return filepath.replace(/.+\./,'')};if(isUndefined(num)){if(valType(vStr)=='string'){if(vars['type']){for(k in vTypeArr){if(vTypeArr[k]['vidType']==vars['type']){arr.push(vTypeArr[k])}}}else{if(getExtension(vStr)&&getExtension(vStr)in vType){var temp=vType[getExtension(vStr)];if(valType(temp)=='array'){for(var i=0;i0){for(var i=0;icTime&&arr[i][0]!=cookieName&&y<19){tempArr.push(arr[i]);y++}}arr=tempArr}if(arr.length>0){cookie(ckplayerCookie,'delete',vars['domain'],vars['cookiePath']);cookie(ckplayerCookie,arrayToString(arr),vars['domain'],vars['cookiePath'])}cookieArray=arr},loadTrack=function(){if(isUndefined(video.textTracks)){return}var i=0;if(!isUndefined(vars['track'])&&valType(vars['track'])=='array'&&!video.find('track')){var track='';var arr=vars['track'];C['bar']['track'].show();for(i=0;i'}if(video){var html=video.htm()+track;video.htm(html)}if(video.find('track')&&!loadedTrack){loadedTrack=true;checkTrack()}}},loadedMetaData=function(){eventTarget('loadedMetaData',{width:CK.getWidth(),height:CK.getHeight(),videoWidth:CT.videoWidth,videoHeight:CT.videoHeight,duration:duration,volume:CT.volume});eventTarget('duration',duration);if('error'in C){C['error'].hide()}replaceInformation('videoWidth',CT.videoWidth);replaceInformation('videoHeight',CT.videoHeight);replaceInformation('volume',parseInt(CT.volume*100));replaceInformation('duration',parseInt(duration));documentHidden(function(state){if(vars['documentFocusPause']){if(state=='show'){if(!focusPause&&paused){player.play()}}else{focusPause=paused;player.pause()}}})};var videoHandler={loadStart:function(){if(!vars['controls']&&app!='iphone'){C['loading'].show()}C['centerPlay'].hide();eventTarget('loadstart')},canPlay:function(){C['loading'].hide();eventTarget('canplay')},loadedData:function(){eventTarget('loadeddata')},loadedMetaData:function(){duration=this.duration;if(!isUndefined(this.duration)&&vars['duration']){duration=vars['duration']}if(!vars['live']){C['time'].htm(formatSeconds(this.currentTime)+'/'+formatSeconds(duration));C['tempTime'].htm(formatSeconds(this.currentTime)+'/'+formatSeconds(duration))}C['loading'].hide();if(vars['poster']){video.attr('poster',vars['poster'])}if(!vars['autoplay']&&!vars['controls']){C['centerPlay'].show();C['buffer'].hide()}CT.duration=duration;CT.videoWidth=this.videoWidth;CT.videoHeight=this.videoHeight;CT.volume=this.volume;if(CT.videoWidth||CT.videoHeight||duration){loadedMetaData()}var len=0;if(!isUndefined(this.buffered)){len=this.buffered.length}if(len>0){changeLoad()}if(!vars['live']){changePreview(vars['preview'])}else{changePreview()}if(!isUndefined(vars['prompt'])&&valType(vars['prompt'])=='array'&&!vars['live']){changePrompt()}else{deletePrompt()}if(isChangeDef){checkDefinition();isChangeDef=false}pSliderMouseDown=false;loadedmetadataNum++;if(!isUndefined(ad)&&!isUndefined(ad['frontPlay'])&&ad['frontPlay']&&loadedmetadataNum>1){player.play();calculationAdFrontTime(duration)}if(!isUndefined(ad)&&!isUndefined(ad['frontPlay'])&&!ad['frontPlay']){player.volume(vars['volume']);player.play()}if(!vars['autoplay']&&loadMeta){loadMeta=false;player.pause();setTimeout(player.pause,300)}},timeUpDate:function(){if(!waited){waited=true;C['buffer'].hide();eventTarget('buffer','end')}var len=this.buffered.length;if(len>0){changeLoad()}if(!duration&&this.duration){duration=this.duration;CT.duration=duration;CT.videoWidth=this.videoWidth;CT.videoHeight=this.videoHeight;if(CT.videoWidth||CT.videoHeight||duration){loadedMetaData()}}oldTime=playTime;playTime=this.currentTime;if(maxSeeTime1){calculationAdFrontTime(duration-playTime)}if(!isUndefined(C['error'])&&C['error'].css('display')=='block'){C['error'].hide()}if(cookieName){changeCookie(playTime)}replaceInformation('audioDecodedByteCount',this.webkitAudioDecodedByteCount||this.audioDecodedByteCount||0);replaceInformation('videoDecodedByteCount',this.webkitVideoDecodedByteCount||this.videoDecodedByteCount||0)},ended:function(){if(!isUndefined(ad)&&!isUndefined(ad['frontPlay'])&&ad['frontPlay']){adFrontEnded()}else{C['bar']['playAndPause']['pause'].hide();C['bar']['playAndPause']['play'].hide();C['bar']['playAndPause']['refresh'].show();eventTarget('ended');showEnded();message()}},error:function(event){if(!isUndefined(event.type)){var errorInfo=this.error;var errorBak=function(){var code=12;var msg=language['error']['loadingFailed'];if(!isUndefined(errorInfo)){if(!isUndefined(errorInfo.code)){code=errorInfo.code}if(!isUndefined(errorInfo.message)){msg=errorInfo.message}CT.error={code:code,message:msg};showError()}else{CT.error={code:code,message:msg};if(event.target.attr('src')){showError()}}eventTarget('error',CT.error)};if(event.type=='error'){try{if(video.currentSrc){ajax({url:video.currentSrc,error:function(info){if(info&&valType(info)=='object'&&'code'in info&&info['code']){CT.error=info;eventTarget('error',CT.error);showError()}else{errorBak()}},success:function(data){if(!data){errorBak()}}})}else{errorBak()}}catch(event){errorBak()}}}},stalled:function(){eventTarget('stalled');CT.error={code:13,message:'load:stalled'};eventTarget('error',CT.error)},suspend:function(){eventTarget('suspend')},emptied:function(){eventTarget('emptied');CT.error={code:7,message:language['error']['emptied']};eventTarget('error',CT.error)},seeked:function(){if(paused){player.play()}pSliderMouseDown=false;eventTarget('seek',{time:this.currentTime,state:'seeked'});eventTarget('seeked')},seeking:function(){if(paused){player.play()}var seekingTime=this.currentTime;if(firstSeekTime==-1){firstSeekTime=seekingTime}switch(vars['timeScheduleAdjust']){case 0:if(oldTime!=seekingTime){waitingMessage=false;player.seek(oldTime);message(language['timeScheduleAdjust']['prohibit']);return}break;case 2:if(seekingTimeoldTime){waitingMessage=false;player.seek(oldTime);message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(seekingTimemaxSeeTime){waitingMessage=false;player.seek(maxSeeTime);message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}eventTarget('seek',{time:seekingTime,state:'seeking'});eventTarget('seeking');if(!vars['live']){C['time'].htm(formatSeconds(seekingTime)+'/'+formatSeconds(duration));C['tempTime'].htm(formatSeconds(seekingTime)+'/'+formatSeconds(duration))}},waiting:function(){waited=false;eventTarget('buffer','start');C['centerPlay'].hide();if(!vars['controls']){C['buffer'].show()}if(!waitingMessage){waitingMessage=true}else{message(language['waiting'])}},play:function(){paused=false;C['bar']['playAndPause']['play'].hide();C['bar']['playAndPause']['pause'].show();C['bar']['playAndPause']['refresh'].hide();C['centerPlay'].hide();if(playType=='button'){C['bar']['pbox'].removeClass('ck-bar-progress-out')}else{C['bar']['pbox'].addClass('ck-bar-progress-out')}if(recoveryVolume){recoveryVolume=false;player.exitMuted()}hideBar();closePauseAd();playType='';if(!isUndefined(C['ended'])){player.closeLayer(C['ended'])}if('error'in C){C['error'].hide()}eventTarget('play');if(!isUndefined(ad)){if(!isUndefined(ad['front'])){if(isUndefined(ad['frontPlay'])){ad['frontPlayI']=0;ad['frontPlay']=true;player.pause();adFrontPlay();return}}}if(seekTime&&(isUndefined(vars['live'])||(!isUndefined(vars['live'])&&valType(vars['live'])=='boolean'&&!vars['live']))&&seekTime0&&mutedState){this.muted=false}if(mutedState!=this.muted){mutedState=this.muted;changeMuted(this.muted);CT.muted=this.muted;eventTarget('muted',CT.muted)}CT.volume=this.volume;eventTarget('volume',this.volume);if(!isUndefined(C['bar']['vbox'])){var vol=parseInt(this.volume*100);C['bar']['vbox']['volume']['txt'].htm(vol);if(!C['bar']['vbox']['mouseDown']){changeVolumeSlider(this.muted?0:this.volume)}if(!this.muted){message(language['volume']+vol+'%')}}replaceInformation('volume',parseInt(this.volume*100))},resize:function(){var fullState=document.fullScreen||document.mozFullScreen||document.webkitIsFullScreen||document.msFullscreenElement;if(fullState){C['bar']['fullAndExit']['exitFull'].show();C['bar']['fullAndExit']['full'].hide();C['ad']['bottom']['fullAndExit']['exitFull'].show();C['ad']['bottom']['fullAndExit']['full'].hide();if(!CM.hasClass('ck-main-full')){CM.addClass('ck-main-full')}message(language['full']);C['bar']['webFullAndExit'].hide();C['bar']['theatreAndExit'].hide();if(!isUndefined(C['menu'])){CM.append(C['menu'])}}else{fullState=false;C['bar']['fullAndExit']['full'].show();C['bar']['fullAndExit']['exitFull'].hide();C['ad']['bottom']['fullAndExit']['full'].show();C['ad']['bottom']['fullAndExit']['exitFull'].hide();if(CM.hasClass('ck-main-full')){CM.removeClass('ck-main-full')}if(!isUndefined(vars['webFull'])&&vars['webFull']){C['bar']['webFullAndExit'].show()}if(!isUndefined(vars['theatre'])&&!CT.webFull){C['bar']['theatreAndExit'].show()}if(!isUndefined(C['menu'])){$('body').append(C['menu'])}if(CV.css('width')!=CM.css('width')){player.zoom(100)}}if(CT.full!=fullState){CT.full=fullState;eventTarget('full',fullState)}checkVideoRotate();changeProgress(player.time())},keydown:function(event){event=window.event||event;var keycode=event.keyCode||event.which;var v=player.volume();var pre=function(){if(event.preventDefault){event.preventDefault()}else{event.returnValue=false}};switch(keycode){case 32:pre();player.playOrPause();break;case 37:player.fastBack();break;case 39:player.fastNext();break;case 38:if(valType(vars['keyVolume'])=='number'&&(vars['keyVolume']==1||(vars['keyVolume']==2&&CT.full))){pre();player.volume(v+.1<1?v+=.1:1)}break;case 40:if(valType(vars['keyVolume'])=='number'&&(vars['keyVolume']==1||(vars['keyVolume']==2&&CT.full))){pre();player.volume(v-.1>0?v-=.1:0)}break;default:break}},mouseWheel:function(event){if(valType(vars['mouseWheelVolume'])=='number'&&(vars['mouseWheelVolume']==1||(vars['mouseWheelVolume']==2&&CT.full))){event=window.event||event;var v=player.volume();if(event.preventDefault){event.preventDefault()}else{event.returnValue=false}if(event.wheelDelta){if(event.wheelDelta>0){player.volume(v+.1<1?v+=.1:1)}if(event.wheelDelta<0){player.volume(v-.1>0?v-=.1:0)}}else if(event.detail){if(event.detail>0){player.volume(v-.1>0?v-=.1:0)}if(event.detail<0){player.volume(v+.1<1?v+=.1:1)}}}}};var adFrontPlay=function(){if(ad['frontPlayI']==0){allBarHide(false);C['ad'].show();ad['front']['video']=false;if(!isUndefined(ad['front']['closeTime'])){if(ad['front']['closeTime']>0){C['ad']['top']['closeTime'].show();adFrontCloseTime()}else{C['ad']['top']['closeAd'].show()}}}if(!isUndefined(ad['front']['node'])&&ad['front']['node']!=null){CM.append(ad['front']['node']);player.closeLayer(ad['front']['node']);ad['front']['node']=null}C['ad']['picture'].htm('');C['ad']['picture'].hide();C['ad']['link'].hide();if(!isUndefined(ad['front']['list'][ad['frontPlayI']])){var adv=ad['front']['list'][ad['frontPlayI']];frontAdPlay=true;eventTarget('frontAd',adv);if(adv['type']=='picture'){adPicturePlay(adv)}else if(adv['type']=='node'){adNode(adv)}else{C['ad']['link'].attr('data-link',adv['link']);adVideoPlay(adv['file'])}if(!isUndefined(adv['link'])){C['ad']['bottom']['details'].show();C['ad']['bottom']['details'].htm(''+language['details']+'')}else{C['ad']['bottom']['details'].hide()}}},adFrontCloseTime=function(){if(!isUndefined(ad['front']['closeSetTime'])){clearTimeout(ad['front']['closeSetTime']);ad['front']['closeSetTime']=null}C['ad']['top']['closeTime'].htmReplace('{seconds}',ad['front']['closeTime'],language['closeTime']);ad['front']['closeTime']--;if(ad['front']['closeTime']>0){ad['front']['closeSetTime']=setTimeout(adFrontCloseTime,1000)}else{C['ad']['top']['closeAd'].show();C['ad']['top']['closeTime'].hide()}},calculationAdFrontTime=function(t){if(!isUndefined(t)){ad['front']['list'][ad['frontPlayI']]['time']=t}ad['front']['countDown']=0;for(var i=ad['frontPlayI'];i0){adv['time']--;ad['front']['countDown']--;C['ad']['top']['countDown'].htm(ad['front']['countDown']+language['second']);adFrontSetTime=setTimeout(adFrontCountDown,1000)}else{adFrontEnded()}},adFrontEnded=function(){if(ad['frontPlayI']0||h>0){if(adv['link']){var a=createlA('',adv['link']);a.append(this);C['ad']['picture'].append(a)}else{C['ad']['picture'].append(this)}img.unbind();img.click(function(){eventTarget('frontAdClick',adv)})}else{if(imgloadNum<10){imgloadNum++;imgLoadHandler()}}})};imgLoadHandler();calculationAdFrontTime();adFrontCountDown();C['ad']['bottom']['mutedAndExit'].hide()},adNode=function(adv){if(isUndefined(adv['content']))return;ad['front']['node']=player.layer(adv);ad['front']['node'].css({'z-index':1});C['ad'].append(ad['front']['node']);ad['front']['node'].unbind();ad['front']['node'].click(function(){eventTarget('frontAdClick',adv)});calculationAdFrontTime();adFrontCountDown();C['ad']['bottom']['mutedAndExit'].hide()},frontVideoClickHandler=function(){var url=C['ad']['link'].attr('data-link');window.open(url,'_blank')},closeFrontAd=function(){if(!isUndefined(ad)&&!isUndefined(ad['front'])&&!isUndefined(ad['front']['closeButtonClick'])){if(valType(ad['front']['closeButtonClick'])=='function'){try{ad['front']['closeButtonClick']()}catch(event){console.error(event)}}else if(valType(ad['front']['closeButtonClick'])=='string'){try{eval(ad['front']['closeButtonClick']+'()')}catch(event){console.error(event)}}}else{player.closeFrontAd()}},adPausePlay=function(){closePauseAd();if(!isUndefined(ad)&&!isUndefined(ad['pause'])&&!isUndefined(ad['pause']['list'])&&ad['pause']['list'].length-1>=ad['pausePlayI']){var adv=ad['pause']['list'][ad['pausePlayI']];if(!isUndefined(ad['pause']['close'])&&ad['pause']['close']){ad['pauseClose']=createlButton('ck-pause-close');ad['pauseClose'].click(function(){C['centerPlay'].show();C['buffer'].hide();closePauseAd()})}if(!isUndefined(adv['file'])){var img=null;var imgloadNum=0;var imgLoadHandler=function(){img=createlImg(adv['file']);C['adPause'].show();C['adPause'].htm('');C['adPause'].append(img);img.addListener('load',function(){var w=this.getWidth(),h=this.getHeight();if(w>0||h>0){C['adPause'].htm('');if(adv['link']){var a=createlA('',adv['link']);a.append(this);C['adPause'].append(a)}else{C['adPause'].append(this)}C['adPause'].css({'width':w+'px','height':h+'px'});if(ad['pauseClose']){C['adPause'].append(ad['pauseClose'])}img.click(function(){eventTarget('pauseAdClick',adv)})}else{if(imgloadNum<10){imgloadNum++;imgLoadHandler()}}})};imgLoadHandler()}else if(!isUndefined(adv['content'])){ad['pause']['node']=player.layer(adv);if(ad['pauseClose']){ad['pause']['node'].append(ad['pauseClose'])}ad['pause']['node'].click(function(){eventTarget('pauseAdClick',adv)})}eventTarget('pauseAd',adv);if(!isUndefined(adv['time'])&&adv['time']>0){adPauseSetTime=setTimeout(function(){ad['pausePlayI']++;if(ad['pausePlayI']>ad['pause']['list'].length-1){ad['pausePlayI']=0}adPausePlay()},adv['time']*1000)}}},closePauseAd=function(){if(adPauseSetTime){clearTimeout(adPauseSetTime);adPauseSetTime=null}C['adPause'].hide();if(!isUndefined(ad)&&!isUndefined(ad['pauseClose'])&&ad['pauseClose']!=null){ad['pauseClose'].remove();ad['pauseClose']=null}if(!isUndefined(ad)&&!isUndefined(ad['pause'])&&!isUndefined(ad['pause']['node'])&&ad['pause']['node']){ad['pause']['node'].unbind();player.closeLayer(ad['pause']['node']);eventTarget('pauseAdClose')}};var player={width:function(value){if(!isUndefined(value)){if(valType(value)=='number'){value+='px'}CT.css({'width':value});checkVideoRotate()}return CK.getWidth()},height:function(value){if(!isUndefined(value)){if(valType(value)=='number'){value+='px'}CT.css({'height':value});checkVideoRotate()}return CK.getHeight()},videoWidth:function(){if(video){return video.videoWidth}return null},videoHeight:function(){if(video){return video.videoHeight}return null},zoom:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('zoom',fn)}if(valType(fn)=='number'){var arr=[C['topBar']['zoomEle']['zoom50'],C['topBar']['zoomEle']['zoom75'],C['topBar']['zoomEle']['zoom100']];for(var i=0;ifn&&fn>0){rot=arr[fn]}else{if(arr.indexOf(fn)>-1){rot=fn}}if(rot!=nowRotate){eventTarget('rotate',rot);nowRotate=rot;checkVideoRotate()}}}},vars:function(obj,val){if(isUndefined(obj)){return}if(valType(obj)=='string'&&!isUndefined(val)){var temp={};temp[obj]=val;obj=temp}var isChange=false;for(var k in obj){if(k in vars&&obj[k]!=vars[k]){isChange=true;break}}if(isChange){vars=standardization(vars,obj)}if(!isUndefined(obj['video'])){isChangeDef=true;changeVideo(vars['video'])}if(!isUndefined(obj['title'])){C['topBar']['titleEle'].htm(obj['title'])}},loadstart:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('loadstart',fn)}},loadeddata:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('loadeddata',fn)}},loadedMetaData:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('loadedMetaData',fn)}},canplay:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('canplay',fn)}},play:function(fn){if(valType(fn)=='object'){if(fn['target']==C['bar']['playAndPause']['play']||fn['target']==C['bar']['playAndPause']['refresh']){playType='button'}}if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('play',fn)}else{if(loadedmetadataNum>0&&video){try{video.play()}catch(event){console.error(event)}}}return player},pause:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('pause',fn)}else{if(loadedmetadataNum>0&&video){try{video.pause()}catch(event){console.error(event)}}}return player},playOrPause:function(){if(paused){player.play()}else{player.pause()}return player},volume:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('volume',fn)}else if(valType(fn)=='number'&&video){if(fn<0)fn=0;if(fn>1)fn=1;if(video.muted){video.volume=fn*.5}video.volume=fn}}else if(video){return video.volume}return player},muted:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('muted',fn)}else if(video){video.muted=true}return player},exitMuted:function(){if(video){video.muted=false;if(video.volume==0){player.volume(vars['volume']>0?vars['volume']:.8)}}return player},time:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('time',fn)}else if(video){return video.currentTime||0}},seek:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('seek',fn)}if(valType(fn)=='number'&&video){switch(vars['timeScheduleAdjust']){case 0:message(language['timeScheduleAdjust']['prohibit']);return;break;case 1:break;case 2:if(fnoldTime){message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(fnmaxSeeTime){waitingMessage=false;video.currentTime=maxSeeTime;message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}pSliderMouseDown=false;video.currentTime=fn}}return player},buffer:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('buffer',fn)}return player},ended:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('ended',fn)}return player},next:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('next',fn)}return player},error:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('error',fn)}return player},emptied:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('emptied',fn)}return player},duration:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('duration',fn)}else{return duration||0}},playbackRate:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('playbackRate',fn)}else if(valType(fn)=='number'&&video){video.playbackRate=fn;CT.playbackRate=fn;eventTarget('playbackRate',fn);changePlaybackrateVal(fn)}}else{return video.playbackRate}},track:function(fn){if(!isUndefined(fn)){if(valType(fn)=='function'){newEvent.addEventListener('track',fn)}else if(valType(fn)=='number'&&video){var track=null;if(!isUndefined(video.textTracks)){track=video.textTracks}if(track&&valType(track)=='texttracklist'){var arr=vars['track'];for(var i=track.length-1;i>-1;i--){video.find('track').eq(i).remove()}for(var i=0;i'}if(video){var html=video.htm()+track;video.htm(html)}changeTrackVal(fn)}}}else{return CT.track}},fastBack:function(num){if(duration==0)return;if(isUndefined(num)||valType(num)!='number'){num=20}var time=player.time();if(time-num>0){time-=num}else{time=0}player.seek(time);return player},fastNext:function(num){if(duration==0)return;if(isUndefined(num)||valType(num)!='number'){num=20}var time=player.time();if(time+num200)zIndex=200;if(isUndefined(ele.cssDisplay)){ele.cssPosition=ele.css('position');ele.cssDisplay=ele.css('display')}ele.css({'position':'absolute','z-index':zIndex});if(!cBar){CM.append(ele)}else{C['bar'].append(ele)}ele.CK=CK;ele.show()}return ele},closeLayer:function(ele){if(valType(ele)=='string'){var temp=$(ele);if(!isUndefined(temp)){if(temp.length>0){ele=temp.eq(0)}}}if(!isUndefined(ele)&&valType(ele)=='htmlobject'){if(!isUndefined(ele.captureParentNode)){var eleP=ele.captureParentNode;if(ele.nextElement){try{eleP.insertBefore(ele,ele.nextElement)}catch(event){eleP.append(ele)}}else if(ele.prevElement){try{eleP.insertAfter(ele,ele.prevElement)}catch(event){eleP.append(ele)}}else{eleP.append(ele)}ele.css({'display':ele.cssDisplay})}else{ele.remove()}if(!isUndefined(ele.cssDisplay)){ele.css({'display':ele.cssDisplay,'position':ele.cssPosition})}}return player},message:function(str){message(str);return player},closeFrontAd:function(){if(frontAdPlay&&!isUndefined(ad)&&!isUndefined(ad['front'])&&!isUndefined(ad['front']['list'])){ad['frontPlayI']=ad['front']['list'].length-1;adFrontEnded();clearAdFrontSetTime()}return player},addListener:function(name,fn){newEvent.addEventListener(name,fn)},removeListener:function(name,fn){newEvent.removeEventListener(name,fn)},bar:function(bool){barShow=bool;if(bool){C['bar'].show()}else{C['bar'].hide()}},rightBar:function(bool){rightBarShow=bool;if(bool){C['rightBar'].show()}else{C['rightBar'].hide()}},mouseActive:function(fn){if(!isUndefined(fn)&&valType(fn)=='function'){newEvent.addEventListener('mouseActive',fn)}return this},cookie:function(name){if(name=='delete'){cookie(ckplayerCookie,'delete',vars['domain']);return null}if(!isUndefined(name)&&name){name=name.replace(/[ ]*,[ ]*|[ ]+/g,'').replace(/[ ]*;[ ]*|[ ]+/g,'')}var cStr=cookie(ckplayerCookie);if(cStr){var arr=stringToArray(cStr);var tempArr=[];var cTime=parseInt(Date.now()*0.001);for(i=0;icTime){tempArr.push(arr[i])}}arr=tempArr;if(arr.length>0){cookie(ckplayerCookie,'delete',vars['domain'],vars['cookiePath']);cookie(ckplayerCookie,arrayToString(arr),vars['domain'],vars['cookiePath']);for(var i=0;i-1;i--){var pTemp=createlButton('ck-list-p',playbackrate[i]+language['playbackrateSuffix']);pTemp.attr('data-i',i).attr('data-val',playbackrate[i]);C['bar']['playbackrate']['bg']['p'].push(pTemp);C['bar']['playbackrate']['bg'].append(pTemp);pTemp.click(playbackrateClick)}C['bar']['playbackrate'].hide();if(!isUndefined(vars['playbackrateOpen'])&&vars['playbackrateOpen']){C['bar']['playbackrate'].show();C['bar']['playbackrate']['bgbox'].show();var w=C['bar']['playbackrate']['bg'].getWidth(),h=C['bar']['playbackrate']['bg'].getHeight();var bw=C['bar']['playbackrate']['button'].getWidth();C['bar']['playbackrate']['bg'].css({'width':w+10+'px'});w=C['bar']['playbackrate']['bg'].getWidth();if(getBarHeight()>C['bar'].getHeight()){h+=(getBarHeight()-C['bar'].getHeight())}C['bar']['playbackrate']['bgbox'].attr('style','');C['bar']['playbackrate']['bgbox'].css({'width':w+'px','height':(h+2)+'px','left':-(w-bw)*0.5+'px'});C['bar']['playbackrate']['button'].mouseover(function(){w=C['bar']['playbackrate']['bg'].getWidth();bw=C['bar']['playbackrate']['button'].getWidth();C['bar']['playbackrate']['bgbox'].css({'left':-(w-bw)*0.5+'px'})});changePlaybackrateVal(pbr)}},playbackrateClick=function(e){C['bar']['playbackrate']['bgbox'].hide();setTimeout(function(){C['bar']['playbackrate']['bgbox'].removeCss('display')},300);message(language['switchTo']+$(this).htm());player.playbackRate(parseFloat($(this).attr('data-val')))},changePlaybackrateVal=function(num){C['bar']['playbackrate']['bg'].find('button').each(function(index,ele){var val=parseFloat(ele.attr('data-val'));ele.removeClass('ck-list-p-focus');if(num==val){ele.addClass('ck-list-p-focus');if(num!=1){C['bar']['playbackrate']['button'].htm(ele.htm())}else{C['bar']['playbackrate']['button'].htm(language['playbackrate'])}}else{ele.removeClass('ck-list-p-focus')}})},checkTrack=function(){var track=vars['track'];var pbr=-1;C['bar']['track']['bgbox'].htm('');C['bar']['track']['bg']=createlDiv('ck-list-bg');C['bar']['track']['bgbox'].append(C['bar']['track']['bg']);C['bar']['track']['bg']['p']=[];var pTemp=null;for(var i=track.length-1;i>-1;i--){pTemp=createlButton('ck-list-p',track[i]['label']);pTemp.attr('data-i',i).attr('data-title',track[i]['label']);C['bar']['track']['bg']['p'].push(pTemp);C['bar']['track']['bg'].append(pTemp);if(!isUndefined(track[i]['default'])&&track[i]['default']){pbr=i}pTemp.click(trackClick)}pTemp=createlButton('ck-list-p',language['noTrack']);pTemp.attr('data-i',-1).attr('data-title',language['noTrack']);C['bar']['track']['bg']['p'].push(pTemp);C['bar']['track']['bg'].append(pTemp);pTemp.click(trackClick);C['bar']['track'].hide();C['bar']['track'].show();C['bar']['track']['bgbox'].show();var w=C['bar']['track']['bg'].getWidth(),h=C['bar']['track']['bg'].getHeight();var bw=C['bar']['track']['button'].getWidth();C['bar']['track']['bg'].css({'width':w+10+'px'});w=C['bar']['track']['bg'].getWidth();if(getBarHeight()>C['bar'].getHeight()){h+=(getBarHeight()-C['bar'].getHeight())}C['bar']['track']['bgbox'].attr('style','');C['bar']['track']['bgbox'].css({'width':w+'px','height':(h+2)+'px','left':-(w-bw)*0.5+'px'});C['bar']['track']['button'].mouseover(function(){w=C['bar']['track']['bg'].getWidth();bw=C['bar']['track']['button'].getWidth();C['bar']['track']['bgbox'].css({'left':-(w-bw)*0.5+'px'})});changeTrackVal(pbr)},trackClick=function(e){C['bar']['track']['bgbox'].hide();setTimeout(function(){C['bar']['track']['bgbox'].removeCss('display')},300);message(language['switchTo']+$(this).attr('data-title'));player.track(parseFloat($(this).attr('data-i')))},changeTrackVal=function(num){C['bar']['track']['bg'].find('button').each(function(index,ele){var i=parseInt(ele.attr('data-i'));if(num==i){C['bar']['track']['button'].htm(ele.attr('data-title'));if(i>-1){CT.track=vars['track'][i];eventTarget('track',vars['track'][i])}else{CT.track=null;eventTarget('track',null)}ele.addClass('ck-list-p-focus')}else{ele.removeClass('ck-list-p-focus')}})},checkDefinition=function(){var pi=-1;var videoUrl=video['currentSrc'];if(!isUndefined(C['bar']['definition']['bg'])){C['bar']['definition']['bgbox'].htm('');C['bar']['definition']['bgbox'].attr('style','');C['bar']['definition']['button'].htm(language['definition'])}if(valType(vars['video'])=='array'){var arr=vars['video'];C['bar']['definition']['bg']=createlDiv('ck-list-bg');C['bar']['definition']['bgbox'].append(C['bar']['definition']['bg']);C['bar']['definition']['bg']['p']=[];for(var i=arr.length-1;i>-1;i--){var pTemp=createlButton('ck-list-p',arr[i][2]);pTemp.attr('data-i',i).attr('data-video',arr[i][0]).attr('data-type',arr[i][1]).attr('data-title',arr[i][2]);C['bar']['definition']['bg']['p'].push(pTemp);C['bar']['definition']['bg'].append(pTemp);if(videoUrl&&videoUrl.indexOf(arr[i][0])>-1){pi=i}pTemp.click(definitionClick)}C['bar']['definition'].show();C['bar']['definition']['bgbox'].show();var w=C['bar']['definition']['bg'].getWidth(),h=C['bar']['definition']['bg'].getHeight();var bw=C['bar']['definition']['button'].getWidth();C['bar']['definition']['bg'].css({'width':w+10+'px'});w=C['bar']['definition']['bg'].getWidth();if(getBarHeight()>C['bar'].getHeight()){h+=(getBarHeight()-C['bar'].getHeight())}C['bar']['definition']['bgbox'].attr('style','');C['bar']['definition']['bgbox'].css({'width':w+'px','height':(h+2)+'px','left':-(w-bw)*0.5+'px'});C['bar']['definition']['button'].mouseover(function(){w=C['bar']['definition']['bg'].getWidth();bw=C['bar']['definition']['button'].getWidth();C['bar']['definition']['bgbox'].css({'left':-(w-bw)*0.5+'px'})})}if(pi>-1){C['bar']['definition']['bg'].find('button').each(function(index,ele){var i=parseInt(ele.attr('data-i'));if(pi==i){ele.addClass('ck-list-p-focus')}else{ele.removeClass('ck-list-p-focus')}})}},definitionClick=function(e){C['bar']['definition']['bgbox'].hide();setTimeout(function(){C['bar']['definition']['bgbox'].removeCss('display')},300);changeDefinition(parseInt($(this).attr('data-i')))},changeDefinition=function(num){C['bar']['definition']['bg'].find('button').each(function(index,ele){var i=parseInt(ele.attr('data-i'));if(num==i){if(!isUndefined(video.textTracks)&&video.textTracks.length>0){for(var y=video.find('track').length-1;y>-1;y--){video.find('track').eq(y).remove()}}seekTime=player.time();video.attr('autoplay','autoplay');changeVideo(ele.attr('data-video'));message(language['switchTo']+ele.htm());C['bar']['definition']['button'].htm(ele.htm());ele.addClass('ck-list-p-focus');eventTarget('definition',{id:i,video:ele.attr('data-video'),title:ele.attr('data-title')})}else{ele.removeClass('ck-list-p-focus')}})},deletePrompt=function(){var i=0;if(!isUndefined(C['prompt'])&&valType(C['prompt'])=='array'){for(i=C['prompt'].length;i>-1;i--){if(!isUndefined(C['prompt'][i])){C['prompt'][i].remove()}}C['prompt']=null}C['prompt']=[]},changePrompt=function(){deletePrompt();for(var i=0;i100)left=100;ele.css({'left':left+'%'});ele.mouseover(function(){if(this.attr('data-words')){showPromptWords(this)}});ele.mouseout(function(){if(this.attr('data-words')){showPromptWords()}});C['prompt'].push(ele)}}},showPromptWords=function(ele){if(isUndefined(C['promptWords'])){C['promptWords']=createlDiv('ck-prompt-words');CM.append(C['promptWords']);C['promptWords']['content']=createlDiv('ck-prompt-content');C['promptWords'].append(C['promptWords']['content'])}if(isUndefined(ele)){C['promptWords']['content'].htm('');C['promptWords'].hide();return}C['promptWords']['content'].htm(ele.attr('data-words'));C['promptWords'].show();var pW=C['promptWords'].getWidth(),pH=C['promptWords'].getHeight();var bg=C['bar']['pbox']['bg'];var time=parseFloat(ele.attr('data-time'));var top=CK.getHeight()-getBarHeight();var left=ele.offset()['left']-CK.offset()['left']+ele.getWidth()*.5-pW*.5;if(!isUndefined(C['preview'])){top=CK.getHeight()-parseFloat((getBarHeight()+C['preview']['smallHight']+parseInt(C['preview'].css('margin-bottom'))))}else{top=CK.getHeight()-parseFloat((getBarHeight()+C['tip']['minHeight']+parseInt(C['tip'].css('margin-bottom'))));top-=(getBarHeight()-C['bar'].getHeight())}top-=parseFloat(C['promptWords'].css('margin-bottom'));top-=pH;left-=parseFloat(C['promptWords'].css('margin-right'));if(left<0)left=0;if(left>CK.getWidth()-pW)left=CK.getWidth()-pW;C['promptWords'].css({'top':top+'px','left':left+'px'})},changePreview=function(preview){if(!isUndefined(C['preview'])){C['preview'].remove();C['preview']=null}if(!isUndefined(preview)){C['preview']=createlDiv('ck-preview');CM.append(C['preview']);if(isUndefined(vars['preview']['type'])){vars['preview']['type']=0}if(vars['preview']['type']==1){C['preview']['bg']=createlDiv('ck-preview-bg');C['preview'].append(C['preview']['bg'])}var files=[];var loadImg=function(bigW,bigH,smallW,smallH){if(vars['preview']['type']==1){C['preview']['bg']['img']=[];for(var i=0;i1){if(valType(vars['preview']['thumbnail'][0])=='number'){thumbnail[0]=vars['preview']['thumbnail'][0]}if(valType(vars['preview']['thumbnail'][1])=='number'){thumbnail[1]=vars['preview']['thumbnail'][1]}vars['preview']['thumbnail']=thumbnail}if(files[0]){var img=createlImg(files[0],'ck-preview-load-img').addListener('load',function(){loadImg(this.getWidth(),this.getHeight(),this.getWidth()/thumbnail[0],this.getHeight()/thumbnail[1]);this.remove()});CM.append(img)}}else{C['preview'].removeChild();C['preview']=null}}else{C['preview'].removeChild();C['preview']=null}}},showPreview=function(time){if(hidePreviewSetTime){clearTimeout(hidePreviewSetTime);hidePreviewSetTime=null}if(time<0){if(!isUndefined(C['preview'])){hidePreviewSetTime=setTimeout(function(){C['preview'].hide();hidePreviewSetTime=null},200);return}}if(!isUndefined(C['preview'])&&!isUndefined(vars['preview']['thumbnail'])&&duration>0){if(isUndefined(vars['preview']['type'])){vars['preview']['type']=0}var scale=2,thumbnail=vars['preview']['thumbnail'];if(!isUndefined(vars['preview']['scale'])){scale=vars['preview']['scale']}var divI=0,imgI=0;var left=0,frameLeft=0;var pW=0;var smallW=C['preview']['smallWidth'],smallH=C['preview']['smallHight'];var bgXw=time*C['bar']['pbox']['bg'].getWidth()/duration+(C['bar']['pbox']['bg'].offset()['left']-CK.offset()['left']);if(C['preview'].css('display')=='none'){C['preview'].show()}C['preview'].css({'height':smallH+'px',});if(vars['preview']['type']==1){divI=parseInt(time/(scale*thumbnail[0]));imgI=parseInt(time/scale);var minI=divI-5,maxI=divI+5;if(minI<0)minI=0;if(maxI>C['preview']['bg']['img'].length-1){maxI=C['preview']['bg']['img'].length-1}for(var i=minI;iC['preview'].getWidth()-C['preview']['frame'].getWidth()){var xz=frameLeft-(C['preview'].getWidth()-C['preview']['frame'].getWidth());frameLeft=C['preview'].getWidth()-C['preview']['frame'].getWidth();left-=xz}C['preview']['bg'].css({'left':left+'px'});C['preview']['frame'].css({'left':frameLeft+'px'})}else{var temp=(time/scale)/(thumbnail[0]*thumbnail[1]);imgI=parseInt(temp);var smallI=parseInt((temp-imgI)*100);var rows=parseInt(smallI/thumbnail[0]);var column=smallI%thumbnail[0];var files=vars['preview']['file'];left=bgXw-smallW*.5;if(left<0){left=0}if(left>CK.getWidth()-smallW){left=CK.getWidth()-smallW}C['preview'].css({'width':C['preview']['smallWidth']+'px','background':'url('+files[imgI]+') no-repeat','background-position':'-'+column*smallW+'px -'+rows*smallH+'px','left':left+'px'})}}},showError=function(){C['loading'].hide();if(vars['controls']||!vars['errorShow']){return}if(isUndefined(C['error'])){C['error']=createlDiv('ck-error');CM.append(C['error'])}var msg=CT.error['message'];if(!msg)msg=language['error']['noMessage'];var html=msg+'(code:'+CT.error['code']+')';C['error'].htm(html);C['error'].show()},showWindowsError=function(error){var ele=createlDiv('ckplayer-error',error);$('body').append(ele)},showNextEpisode=function(){if(isUndefined(vars['next']))return;if(valType(vars['next'])=='object'){if('content'in vars['next']){C['next']=player.layer(vars['next']);return}if('title'in vars['next']){tip(C['bar']['nextEpisode'],vars['next']['title']);return}}tip(C['bar']['nextEpisode'],language['next'])},nextClick=function(){if(valType(vars['next'])=='object'){if('click'in vars['next']){if(valType(vars['next']['click'])=='function'){vars['next']['click']()}else if(valType(vars['next']['click'])=='string'){eval(vars['next']['click']+'()')}}if('link'in vars['next']){window.location.href=vars['next']['link']}eventTarget('next')}},showEnded=function(){if(!CT.loop&&!isUndefined(vars['ended'])){closePauseAd();C['ended']=player.layer(vars['ended']);if(C['ended']){C['centerPlay'].hide()}return}},windowScroll=function(){if(!CT.smallWindows)return;if(CT.webFull||CT.theatre||CT.full){exitSmallWindows();return}var scrollTop=document.documentElement.scrollTop||document.body.scrollTop;if(scrollTop>CT.offset()['top']+CT.getHeight()){if(!CK.hasClass('ckplayer-ckplayer-smallwindow')){CK.addClass('ckplayer-ckplayer-smallwindow');eventTarget('smallWindows',true);smallWindowsState=true;if(vars['smallWindowsDrag']){drag(true)}allBarHide();checkVideoRotate()}}else{exitSmallWindows()}},exitSmallWindows=function(){if(CK.hasClass('ckplayer-ckplayer-smallwindow')){CK.removeClass('ckplayer-ckplayer-smallwindow');if(vars['smallWindowsDrag']){drag()}eventTarget('smallWindows',false);smallWindowsState=false;allBarShow();checkVideoRotate()}},drag=function(state){var doc=$(document);var posX=0,posY=0,posXRecord=0,posYRecord=0;var open=false;if(!isUndefined(state)){open=state}var mouseDown=function(e){e.preventDefault&&e.preventDefault();e=e||window.event;var client=getClient(e);posXRecord=client['x'];posYRecord=client['y'];doc.mousemove(docMouseMove);doc.mouseup(docMouseUp);CK.css({'cursor':'move'})};var docMouseMove=function(e){e=e||window.event;var client=getClient(e);var eleOffset=CK.offset();posY=client['y']-posYRecord;posX=client['x']-posXRecord;posXRecord=client['x'];posYRecord=client['y'];var left=eleOffset['left']+posX;var top=eleOffset['top']+posY;CK.css({'left':left+'px','top':top+'px'});if(CK.css('position')!='fixed'){CK.css({'position':'fixed'})}isDrag=true};var docMouseUp=function(){doc.removeListener('mousemove',docMouseMove);doc.removeListener('mouseup',docMouseUp);CK.css({'cursor':'default'})};if(open){CK.mousedown(mouseDown)}else{CK.unbind('mousedown')}},checkVideoRotate=function(){var ckW=CK.getWidth()*nowZoom*0.01,ckH=CK.getHeight()*nowZoom*0.01;var vW=CV.getWidth(),vH=CV.getHeight();CV.css({'transform':'rotate('+nowRotate+'deg)','-ms-transform':'rotate('+nowRotate+'deg)','-moz-transform':'rotate('+nowRotate+'deg)','-webkit-transform':'rotate('+nowRotate+'deg)','-o-transform':'rotate('+nowRotate+'deg)','width':nowZoom+'%','height':nowZoom+'%'});if(nowRotate!=0&&nowRotate!=180){if(vH>ckW&&vW>ckH){if(vH/ckW>vW/ckH){CV.css({'height':nowZoom+'%','width':ckH+'px'})}else{CV.css({'width':nowZoom+'%','height':ckW+'px'})}return}if(vHckH){CV.css({'height':nowZoom+'%','width':ckH+'px'})}else{if(vH/vW>=ckW/ckH){CV.css({'width':nowZoom+'%','height':ckW+'px'})}else{CV.css({'height':nowZoom+'%','width':ckH+'px'})}}return}if(vH>=ckW&&vW<=ckH){CV.css({'width':nowZoom+'%','height':ckW+'px'});return}if(vW>=ckH&&vHC['bar'].getHeight()){top-=(getBarHeight()-C['bar'].getHeight())}if(w>ew){left=offset['left']-ckOffset['left']-(w-ew)*.5}else{left=offset['left']-ckOffset['left']+(ew-w)*.5}if(align=='left'){left=offset['left']-ckOffset['left']-w;top=offset['top']-ckOffset['top']}if(!isUndefined(cl)){left=cl['x']-ckOffset['left']-w*.5}if(left<0){left=0}if(top<0){top=0}if(left>CM.getWidth()-w){left=CM.getWidth()-w}if(top>CM.getHeight()-h){top=CM.getHeight()-h}C['tip'].css({'left':left+'px','top':top-parseInt(C['tip'].css('margin-bottom'))+'px'})},progressDragX=function(){var bg=C['bar']['pbox']['bg'],play=C['bar']['pbox']['play'],slider=C['bar']['pbox']['slider'],mouseLine=C['bar']['pbox']['mouseLine'];slider.unbind();bg.unbind();var pos=0,posRecord=0;var doc=$(document);var sliderDownTime=0;var sliderMouseDown=function(e){e.preventDefault&&e.preventDefault();if(!vars['timeScheduleAdjust']){return}e=e||window.event;var eleOffset=slider.offset(),bgOffset=bg.offset(),client=getClient(e);pSliderMouseDown=true;posRecord=client['x'];var left=eleOffset['left']-bgOffset['left'];sliderDownTime=left*duration/(bg.getWidth()-slider.getWidth());slider.removeListener('mousedown',sliderMouseDown);slider.removeListener('touchstart',sliderMouseDown);doc.mousemove(docMouseMove);doc.mouseup(docMouseUp);slider.touchmove(docMouseMove);slider.touchend(docMouseUp);noScrolling(true)};var docMouseMove=function(e){e=e||window.event;var eleOffset=slider.offset(),bgOffset=bg.offset(),client=getClient(e);pSliderMouseDown=true;pos=posRecord-client['x'];posRecord=client['x'];var left=eleOffset['left']-pos-bgOffset['left'];if(left<0){left=0}if(left>bg.getWidth()-slider.getWidth()){left=bg.getWidth()-slider.getWidth()}C['bar']['pbox'].addClass('ck-bar-progress-slider-move');var time='';if(!vars['live']){time=left*duration/(bg.getWidth()-slider.getWidth());switch(vars['timeScheduleAdjust']){case 2:if(timesliderDownTime){left=-1000;message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(timemaxSeeTime){left=-1000;player.seek(maxSeeTime);message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}time=formatSeconds(time)}else{time=formatLiveTime(left*getLiveTime()/(bg.getWidth()-slider.getWidth()))}tip(slider,time);if(left>=0){slider.css({'left':left+'px'});play.css({'width':left+slider.getWidth()*.5+'px'})}else{pSliderMouseDown=false}};var docMouseUp=function(){noScrolling();doc.removeListener('mousemove',docMouseMove);doc.removeListener('mouseup',docMouseUp);slider.removeListener('touchmove',docMouseMove);slider.removeListener('touchend',docMouseUp);slider.mousedown(sliderMouseDown);slider.touchstart(sliderMouseDown);if(!vars['live']){var time=play.getWidth()*duration/(bg.getWidth()-slider.getWidth()*.5);if(time>duration){time=duration}seekTime=0;player.seek(time)}else{var playbackTime=parseInt(vars['live']+play.getWidth()*getLiveTime()/(bg.getWidth()-slider.getWidth()*.5));eventTarget('playback',{time:playbackTime,date:date('Y-m-d H:i:s',playbackTime)});eventTarget('seek',{time:playbackTime,state:'seeking',date:date('Y-m-d H:i:s',playbackTime)})}C['bar']['pbox'].removeClass('ck-bar-progress-slider-move');if(isMouseLeave){tip()}};var isMouseLeave=true;var sliderMouseOver=function(){var time='';if(!vars['live']){time=formatSeconds(parseInt(slider.css('left'))*duration/(bg.getWidth()-slider.getWidth()))}else{time=language['live']}isMouseLeave=false;tip(slider,time)};var sliderMouseLeave=function(){isMouseLeave=true};slider.mousedown(sliderMouseDown);slider.mouseover(sliderMouseOver);slider.mouseleave(sliderMouseLeave);slider.touchstart(sliderMouseDown);var bgMouseDown=function(e){e=e||window.event;var client=getClient(e);var bgOffset=bg.offset();var w=client['x']-bgOffset['left'];if(CT.full){w+=CK.offset()['left']}if(!vars['live']){var time=duration*w/bg.getWidth();switch(vars['timeScheduleAdjust']){case 0:message(language['timeScheduleAdjust']['prohibit']);return;break;case 2:if(timeoldTime){message(language['timeScheduleAdjust']['prohibitForward']);return}break;case 4:if(timemaxSeeTime){message(language['timeScheduleAdjust']['prohibitForwardNotViewed']);return}break}seekTime=0;player.seek(time)}else{var playbackTime=parseInt(vars['live']+getLiveTime()*w/bg.getWidth());eventTarget('playback',{time:playbackTime,date:date('Y-m-d H:i:s',playbackTime)});eventTarget('seek',{time:playbackTime,state:'seeking',date:date('Y-m-d H:i:s',playbackTime)})}if(w>bg.getWidth()-slider.getWidth()*.5){w=bg.getWidth()-slider.getWidth()*.5}if(wmaxTop){sliderTop=maxTop}slider.css({'top':sliderTop+'px'});var ppMarginTop=sliderTop-minTop+slider.getHeight()*0.5;pp.css({'margin-top':ppMarginTop+'px'});var vol=(bg.getHeight()-ppMarginTop-slider.getHeight()*0.5)/(bg.getHeight()-slider.getHeight());player.volume(vol)};var docMouseUp=function(){noScrolling();doc.removeListener('mousemove',docMouseMove);doc.removeListener('mouseup',docMouseUp);slider.removeListener('touchmove',docMouseMove);slider.removeListener('touchend',docMouseUp);slider.mousedown(sliderMouseDown);slider.touchstart(sliderMouseDown);C['bar']['vbox']['mouseDown']=false};slider.mousedown(sliderMouseDown);slider.touchstart(sliderMouseDown);var bgMouseDown=function(e){e=e||window.event;var client=getClient(e);var bgOffset=bg.offset();var h=client['y']-bgOffset['top'];var max=bg.getHeight();var vol=1-h/max;player.volume(vol)};bg.mousedown(bgMouseDown)},changeProgress=function(time){if((valType(vars['live'])=='boolean'&&vars['live'])){return}if(!pSliderMouseDown){var bg=C['bar']['pbox']['bg'],slider=C['bar']['pbox']['slider'];var playW=(time/duration)*100;if(valType(vars['live'])=='number'){playW='100'}C['bar']['pbox']['play'].css({'width':playW+'%'});var sliderW=(slider.getWidth()/bg.getWidth())*100;var sliderLeft=playW-sliderW*.5;if(sliderLeft<0){sliderLeft=0}if(sliderLeft>100-sliderW){sliderLeft=100-sliderW}C['bar']['pbox']['slider'].css({'left':sliderLeft+'%'});checkProgressSlider()}},checkProgressSlider=function(){var bg=C['bar']['pbox']['bg'],slider=C['bar']['pbox']['slider'];var st=0;if(C['bar']['pbox'].css('transition-duration')){st=parseFloat(C['bar']['pbox'].css('transition-duration'))*1000+20}var checkThis=function(){var sliderLeft=parseInt(C['bar']['pbox']['slider'].css('left'));if(sliderLeft<0){sliderLeft=0;C['bar']['pbox']['slider'].css({'left':sliderLeft+'px'})}if(sliderLeft>bg.getWidth()-slider.getWidth()){sliderLeft=bg.getWidth()-slider.getWidth();C['bar']['pbox']['slider'].css({'left':sliderLeft+'px'})}};setTimeout(checkThis,st)},changeTopTime=function(){C['topBar']['timeEle'].htm(date('H:i:s'));setTimeout(changeTopTime,1000)},changeVolumeSlider=function(vol){if(!isUndefined(C['bar']['vbox'])){var box=C['bar']['vbox']['volume']['box'],bg=C['bar']['vbox']['volume']['bg'],pp=C['bar']['vbox']['volume']['pp'],slider=C['bar']['vbox']['volume']['slider'];C['bar']['vbox']['volume']['txt'].htm(parseInt(vol*100));var bgH=bg.getHeight();if(bgH){var ppMarginTop=bgH-vol*bgH;pp.css({'margin-top':ppMarginTop+'px'});var sliderTop=bg.offset()['top']-box.offset()['top']+ppMarginTop-slider.getHeight()*0.5;slider.css({'top':sliderTop+'px'})}}},changeLoad=function(){if(video){var len=video.buffered.length;if(len>0){var bufferEnd=video.buffered.end(len-1);if(loadTime=1000){last+=offset;appendFps(fps);fps=0}requestAnimationFrame(step)};var appendFps=function(fps){if(fps!=CT.fps){CT.fps=fps;replaceInformation('fps',fps);eventTarget('fps',fps)}};if(isUndefined(CT.fps)){CT.fps=0}step()},getElement=function(content){var ele=$(content);if(isUndefined(ele))return;if(valType(ele)=='htmlarray'){ele=ele[0]}if(isUndefined(ele.captureParentNode)){ele.captureParentNode=ele.parentNode;ele.prevElement=ele.prev();ele.nextElement=ele.next()}return ele},$=function(obj,eL){var parent=null;if(document){parent=document}if(!isUndefined(eL)){parent=eL}var res=[];if(obj){if(valType(obj)=='htmlobject'||valType(obj)=='object'){res=obj;if(!isUndefined(res.ckplayer)){return res}}else if(valType(obj)=='string'&&obj!=''){switch(obj.substr(0,1)){case'.':obj=obj.substr(1,obj.length);if(parent.getElementsByClassName){res=parent.getElementsByClassName(obj);if(!res.length){return null}}else if(!parent&&document.getElementsByClassName){res=document.getElementsByClassName(obj);if(!res.length){return null}}else{var reg=new RegExp(' '+obj+' ','i');var ele=null;if(parent.getElementsByTagName){ele=parent.getElementsByTagName('*')}else{ele=document.getElementsByTagName('*')}for(var i=0;i1){b=arr[1].substr(0,1).toLocaleUpperCase()+arr[1].substr(1,arr[1].length-1)}if(arr.length>2){b=arr[2].substr(0,1).toLocaleUpperCase()+arr[2].substr(1,arr[2].length-1)}return a+b+c}return str};if(isUndefined(value)){if(!isUndefined(key)&&valType(key)=='string'){if(this.currentStyle){return this.currentStyle[key]}else{return document.defaultView.getComputedStyle(this,null)[key]}}if(isUndefined(key)){if(this.currentStyle){return this.currentStyle}else{return document.defaultView.getComputedStyle(this,null)}}}if(valType(key)!='object'){var newKey=keyNew(key);if(this.length>1){for(var i=0;i=m+1){return this[m]}return null}return null};for(var i=0;imaxZ){maxZ=parseInt(temp)}}return maxZ}function getWindowSize(){return{width:window.innerWidth,height:window.innerHeight}}function standardization(o,n){var h={};var k;for(k in o){h[k]=o[k]}for(k in n){if(k in h){h[k]=n[k]}}return h}function mergeObj(o,n){var h={};var k;for(k in o){h[k]=o[k]}for(k in n){if(k in h){switch(valType(h[k])){case'object':if(valType(n[k])=='object'){h[k]=mergeObj(h[k],n[k])}break;default:if(valType(h[k])==valType(n[k])){h[k]=n[k]}break}}}return h}function valType(val){if(typeof val==='undefined')return'undefined';var str=Object.prototype.toString.call(val).split(' ')[1].replace(']','').toLowerCase();if(str.substr(0,4)=='html'&&(str.substr(-7)=='element'||str.substr(-8)=='document'||str=='window')){str='htmlobject'}if(str=='htmlcollection'||str=='nodelist'){str='htmlarray'}return str}function isUndefined(val){try{return valType(val)==='undefined'||val===undefined||val===null||(valType(val)==='number'&&isNaN(val))}catch(event){return true}return false}function prev(ele){var e=ele.previousSibling;if(e==null){return null}if(e.nodeType==3){var t=prev(e);if(t&&t.nodeType==1){return t}}else{if(e.nodeType==1){return e}else{return false}}}function next(ele){var e=ele.nextSibling;if(e==null){return null}if(e.nodeType==3){var t=next(e);if(t&&t.nodeType==1){return t}}else{if(e.nodeType==1){return e}else{return false}}}function addListener(ele,e,f,t){if(isUndefined(t)){t=false}if(ele.addEventListener){try{ele.addEventListener(e,f,t)}catch(event){}}else if(ele.attachEvent){try{ele.attachEvent('on'+e,f)}catch(event){}}else{ele['on'+e]=f}if(isUndefined(ele.listenerList)){ele.listenerList=[]}ele.listenerList.push([e,f]);return ele};function removeListener(ele,e,f,t){if(isUndefined(t)){t=false}if(ele.removeEventListener){try{ele.removeEventListener(e,f,t)}catch(e){}}else if(ele.detachEvent){try{ele.detachEvent('on'+e,f)}catch(e){}}else{ele['on'+e]=null}if(!isUndefined(ele.listenerList)){var temp=[];for(var i=0;i>0},W:function(){var a=f.z(),b=364+f.L()-a;var nd2,nd=(new Date(jsdate.getFullYear()+'/1/1').getDay()||7)-1;if(b<=2&&((jsdate.getDay()||7)-1)<=2-b){return 1}else{if(a<=2&&nd>=4&&a>=(6-nd)){nd2=new Date(jsdate.getFullYear()-1+'/12/31');return date('W',Math.round(nd2.getTime()/1000))}else{return(1+(nd<=3?((a+nd)/7):(a-(7-nd))/7)>>0)}}},F:function(){return txt_months[f.n()]},m:function(){return pad(f.n(),2)},M:function(){return f.F().substr(0,3)},n:function(){return jsdate.getMonth()+1},t:function(){var n;if((n=jsdate.getMonth()+1)==2){return 28+f.L()}else{if(n&1&&n<8||!(n&1)&&n>7){return 31}else{return 30}}},L:function(){var y=f.Y();return(!(y&3)&&(y%1e2||!(y%4e2)))?1:0},Y:function(){return jsdate.getFullYear()},y:function(){return(jsdate.getFullYear()+'').slice(2)},a:function(){return jsdate.getHours()>11?'pm':'am'},A:function(){return f.a().toUpperCase()},B:function(){var off=(jsdate.getTimezoneOffset()+60)*60;var theSeconds=(jsdate.getHours()*3600)+(jsdate.getMinutes()*60)+jsdate.getSeconds()+off;var beat=Math.floor(theSeconds/86.4);if(beat>1000)beat-=1000;if(beat<0)beat+=1000;if((String(beat)).length==1)beat='00'+beat;if((String(beat)).length==2)beat='0'+beat;return beat},g:function(){return jsdate.getHours()%12||12},G:function(){return jsdate.getHours()},h:function(){return pad(f.g(),2)},H:function(){return pad(jsdate.getHours(),2)},i:function(){return pad(jsdate.getMinutes(),2)},s:function(){return pad(jsdate.getSeconds(),2)},O:function(){var t=pad(Math.abs(jsdate.getTimezoneOffset()/60*100),4);if(jsdate.getTimezoneOffset()>0)t='-'+t;else t='+'+t;return t},P:function(){var O=f.O();return(O.substr(0,3)+':'+O.substr(3,2))},c:function(){return f.Y()+'-'+f.m()+'-'+f.d()+'T'+f.h()+':'+f.i()+':'+f.s()+f.P()},U:function(){return Math.round(jsdate.getTime()/1000)}};return format.replace(/([a-zA-Z])/g,function(t,s){var ret='';if(t!=s){ret=s}else if(f[s]){ret=f[s]()}else{ret=s}return ret})}function dataURLtoBlob(dataurl){var arr=dataurl.split(','),mime=arr[0].match(/:(.*?);/)[1],bstr=atob(arr[1]),n=bstr.length,u8arr=new Uint8Array(n);while(n--){u8arr[n]=bstr.charCodeAt(n)}return new Blob([u8arr],{type:mime})}function decodeURIString(obj){for(var k in obj){if(valType(obj[k])=='string'&&obj[k]){try{obj[k]=decodeURI(obj[k])}catch(event){}}if(valType(obj[k])=='object'){obj[k]=decodeURIString(obj[k])}}return obj}function getApp(){var u=navigator.userAgent.toLowerCase();if(u.indexOf('iphone')>-1){return'iphone'}}function cookie(name,value,domain,path){if(isUndefined(domain)){domain=''}if(isUndefined(path)){path='/'}var ckStr=';domain='+domain+';path='+path;if(location.protocol=='https'){ckStr+=';SameSite=None;Secure=true'}var set=function(name,value){var time=360*24*60*60*1000;var exp=new Date();exp.setTime(exp.getTime()+time);try{document.cookie=name+'='+escape(value)+';expires='+exp.toGMTString()+ckStr}catch(event){console.error(event)}},get=function(name){var arr,reg=new RegExp('(^| )'+name+'=([^;]*)(;|$)');if(arr=document.cookie.match(reg)){return unescape(arr[2])}else{return null}},del=function(name){var exp=new Date();exp.setTime(exp.getTime()-1);var cval=get(name);if(cval!=null){document.cookie=name+'='+cval+';expires='+exp.toGMTString()+ckStr}};if(!isUndefined(name)&&!isUndefined(value)){if(value=='delete'){del(name);return null}else{set(name,value);return get(name)}}else if(!isUndefined(name)&&isUndefined(value)){return get(name)}else if(!isUndefined(name)){}}function arrayToString(arr){var str='';if(!isUndefined(arr)){for(var i=0;i0){str+=','}for(var y=0;y0){str+=';'}if(valType(temp[y])=='number'){str+=parseInt(temp[y]*100)}else{str+=temp[y]}}}}return str}function stringToArray(str){var newArr=[];if(!isUndefined(str)){var arr=str.split(',');for(var i=0;i0&&(r+=" ");for(var s=arguments.length,u=new Array(s>2?s-2:0),l=2;l=e&&g[e](r),p&&p.get().debug.dispatchEvent&&h.trigger(i.a.LOG,{message:r,level:e})}return t={getLogger:function(e){return{fatal:y.bind(e),error:E.bind(e),warn:_.bind(e),info:v.bind(e),debug:T.bind(e)}},setLogTimestampVisible:function(e){n=e},setCalleeNameVisible:function(e){a=e}},n=!0,a=!0,f=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(g[o]=m(window.console.error),g[s]=m(window.console.error),g[u]=m(window.console.warn),g[l]=m(window.console.info),g[c]=m(window.console.debug)),t}f.__dashjs_factory_name="Debug";var d=a.a.getSingletonFactory(f);d.LOG_LEVEL_NONE=0,d.LOG_LEVEL_FATAL=o,d.LOG_LEVEL_ERROR=s,d.LOG_LEVEL_WARNING=u,d.LOG_LEVEL_INFO=l,d.LOG_LEVEL_DEBUG=c,a.a.updateSingletonFactory(f.__dashjs_factory_name,d),t.a=d},function(e,t,n){"use strict";var r=n(3),i=n(4);function a(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}return{on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var o=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var s={callback:r,scope:i,priority:o};i&&i.getStreamId&&(s.streamId=i.getStreamId()),i&&i.getType&&(s.mediaType=i.getType()),a&&a.mode&&(s.mode=a.mode);var u=e[n].some((function(t,r){if(t&&o>t.priority)return e[n].splice(r,0,s),!0}));u||e[n].push(s)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!!e&&((!r.streamId||!e.streamId||e.streamId===r.streamId)&&((!r.mediaType||!e.mediaType||e.mediaType===r.mediaType)&&!(r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.a.EVENT_MODE_ON_RECEIVE)))})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}}}a.__dashjs_factory_name="EventBus";var o=r.a.getSingletonFactory(a);o.EVENT_PRIORITY_LOW=0,o.EVENT_PRIORITY_HIGH=5e3,r.a.updateSingletonFactory(a.__dashjs_factory_name,o),t.a=o},function(e,t,n){"use strict";t.a=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},function(e,t,n){"use strict";function r(e){return(r="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})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function o(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var u=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENT_BASE_LOADER_ERROR_CODE=15,e.TIME_SYNC_FAILED_ERROR_CODE=16,e.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,e.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,e.APPEND_ERROR_CODE=20,e.REMOVE_ERROR_CODE=21,e.DATA_UPDATE_FAILED_ERROR_CODE=22,e.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,e.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,e.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,e.DOWNLOAD_ERROR_ID_SIDX_CODE=26,e.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,e.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,e.DOWNLOAD_ERROR_ID_XLINK_CODE=29,e.MANIFEST_ERROR_ID_PARSE_CODE=31,e.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,e.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,e.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,e.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",e.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",e.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",e.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",e.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",e.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",e.APPEND_ERROR_MESSAGE="chunk is not defined",e.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",e.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",e.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",e.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",e.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",e.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",e}return n}(n(24).a));t.a=u},function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return f}));var r=n(27);function i(e,t){for(;e.lengthr&&o=a)}return!0}function c(e,t,n,r){var i,a,o;i=n.segmentDuration,isNaN(i)&&(i=n.adaptation.period.duration),a=parseFloat((n.adaptation.period.start+r*i).toFixed(5)),o=parseFloat((a+i).toFixed(5));var s=u(n,i,a,e.calcMediaTimeFromPresentationTime(a,n),e,o,t,r);return l(e,n,s,t)?s:null}function f(e,t,n,r,i,a,o,c,f,d){var h,p,g=r/a,m=i/a;return h=e.calcPresentationTimeFromMediaTime(g,n),l(e,n,p=u(n,m,h,g,e,h+m,t,f),t)?(p.replacementTime=d||r,o=s(o,"Number",p.replacementNumber),o=s(o,"Time",p.replacementTime),p.media=o,p.mediaRange=c,p):null}},function(e,t,n){"use strict";var r=n(3);function i(){var e,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},o=function(e,t){var n=s;if(!t)return e;if(!c(e))return e;f(e)&&(n=u),d(e)&&(n=l);var r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function s(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function u(e){var t=e.match(i);return t?t[1]:""}function l(e){var n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function f(e){return c(e)&&"/"===e.charAt(0)}function d(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y");e=a}catch(e){}finally{e=e||o}}(),{parseBaseUrl:s,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:f,isSchemeRelative:d,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}i.__dashjs_factory_name="DefaultURLUtils";var a=r.a.getSingletonFactory(i);function o(){var e,t=[],n=this.context;function r(n,r,i){var a=function(n){var r;for(r=0;r0&&(t[a.substring(0,o)]=a.substring(o+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n=e-n}))}function m(e,t){t<=e+.5||(r=r.filter((function(n){var r=p(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function y(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],a=i.startTime,o=a+i.duration;if(n=isNaN(n)?p(i):n,!isNaN(a)&&!isNaN(o)&&t+n>=a&&t-n0&&m(n,t)}else g()},abortRequests:function(){n.debug("abort requests"),l.abort(),a=[]},executeRequest:function(e){switch(e.action){case i.a.ACTION_DOWNLOAD:E(e,"loading"),a.push(e),function(e){o.trigger(s.FRAGMENT_LOADING_STARTED,{request:e},{streamId:f.id,mediaType:d}),l.load(e)}(e);break;default:n.warn("Unknown request action.")}},reset:function(){o.off(s.LOADING_COMPLETED,_,this),o.off(s.LOADING_DATA_PROGRESS,v,this),o.off(s.LOADING_ABANDONED,T,this),l&&l.reset(),S()},resetInitialSettings:S,addExecutedRequest:function(e){r.push(e)}},n=c.getLogger(t),S(),o.on(s.LOADING_COMPLETED,_,t),o.on(s.LOADING_DATA_PROGRESS,v,t),o.on(s.LOADING_ABANDONED,T,t),t}a.__dashjs_factory_name="FragmentModel";var o=r.a.getClassFactory(a);o.FRAGMENT_MODEL_LOADING="loading",o.FRAGMENT_MODEL_EXECUTED="executed",o.FRAGMENT_MODEL_CANCELED="canceled",o.FRAGMENT_MODEL_FAILED="failed",r.a.updateClassFactory(a.__dashjs_factory_name,o),t.a=o},function(e,t,n){"use strict";var r=n(3),i=n(41);function a(e){e=e||{};var t,n,r=this.context;return t=Object(i.a)(r).getInstance(),{load:function(i){if(!n){var a=t.getLoader(i&&i.request?i.request.url:null);n=a(r).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})}n.load(i)},abort:function(){n&&n.abort()}}}a.__dashjs_factory_name="URLLoader";var o=r.a.getClassFactory(a);t.a=o},function(e,t,n){"use strict";var r=n(6);function i(e,t){for(var n=0;n0?n[n.length-1]:null}}}s.__dashjs_factory_name="IsoFile";var u=o.a.getClassFactory(s),l=n(22),c=n.n(l);var f=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=r};function d(){var e,t,n=this.context;function i(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=c.a.parseBuffer(e),r=u(n).create();return r.setData(t),r}function a(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function o(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:i,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new f(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,s=0;n=0?r=new f(n,!0,u):s=n+u),n+=u}return r||new f(s,!1)},getMediaTimescaleFromMoov:function(e){var t=i(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,n,r,a,o,s,u,l,c,f,d,h,p,g,m,y,E=i(e),_=E.getBoxes("moof"),v=E.getBoxes("mfhd");m=E.getBoxes("moof").length,g=v[v.length-1].sequence_number,n=0,o=[];var T=-1,S=-1;for(f=0;f<_.length;f++){var A=_[f],b=A.getChildBoxes("traf");for(l=0;lS&&(T++,S+=M.entries[T].sample_delta),u==S){O.subSizes=[];var P=M.entries[T];for(h=0;h=t.byteLength)return new f(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,s=0;n=0?r=new f(n,!0,u,l):s=n+u),n+=u}return r||new f(s,!1)}},e=Object(r.a)(n).getInstance().getLogger(t),t}d.__dashjs_factory_name="BoxParser";t.a=o.a.getSingletonFactory(d)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){ +/*! codem-isoboxer v0.3.6 https://github.com/madebyhiro/codem-isoboxer/blob/master/LICENSE.txt */ +var r={parseBuffer:function(e){return new i(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(a.prototype._boxProcessors[e]=t)},createFile:function(){return new i},createBox:function(e,t,n){var r=a.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,n){var i=r.createBox(e,t,n);return i.version=0,i.flags=0,i},Utils:{}};r.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},r.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a>3,t},a.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},a.prototype._readString=function(e){for(var t="",n=0;n0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},a.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?r.Utils.dataViewToString(t):t},a.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},a.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},a.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset>3}else this.size+=e>>3},a.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeString=function(e,t){for(var n=0;n>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},a.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},a.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},a.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},a.prototype._boxProcessors.mp4a=a.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},a.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},a.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},a.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},a.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},a.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},a.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},a.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},a.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},a.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},a.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},a.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},a.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},a.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},a.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},a.prototype._boxProcessors["url "]=a.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},a.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},a.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},a.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},a.prototype._boxProcessors.vtte=function(){}},function(e,t,n){"use strict";var r=n(3);function i(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}i.__dashjs_factory_name="RequestModifier",t.a=r.a.getSingletonFactory(i)},function(e,t,n){"use strict";function r(e,t){for(var n=0;n1)for(var n=1;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&T.a.indexOf(n[0].schemeIdUri)>=0)return t===r.a.IMAGE}if(e.ContentComponent_asArray&&e.ContentComponent_asArray.length>0){if(e.ContentComponent_asArray.length>1)return t===r.a.MUXED;if(e.ContentComponent_asArray[0].contentType===t)return!0}var a=t===r.a.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation_asArray&&e.Representation_asArray.length){var o=e.Representation_asArray[0].codecs;if(a.test(o))return!0}if(e.hasOwnProperty(i.a.MIME_TYPE))return a.test(e.mimeType);if(e.Representation_asArray)for(var s,u=0;u0){var t=e.Representation_asArray[0];if(t.hasOwnProperty(i.a.SEGMENT_TEMPLATE)||t.hasOwnProperty(i.a.SEGMENT_TIMELINE)||t.hasOwnProperty(i.a.SEGMENT_LIST)||t.hasOwnProperty(i.a.SEGMENT_BASE))return!0}return!1}function R(e){return b(e,r.a.AUDIO)}function N(e){return b(e,r.a.VIDEO)}function w(e){return b(e,r.a.TEXT)}function C(e){return b(e,r.a.IMAGE)}function D(){return function(e,t){return e.bandwidth-t.bandwidth}}function O(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function M(e,t){return e&&e.Period_asArray&&A(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function P(e){return e&&e.Period_asArray?e.Period_asArray:[]}function L(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===i.a.DYNAMIC),t}function F(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function x(e){if(!e||!e.S_asArray)return NaN;var t=e.S_asArray[0],n=e.S_asArray[1];return t.hasOwnProperty("d")?t.d:n.t-t.t}function U(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=l.DEFAULT_ID+"_"+t;return e.hasOwnProperty(i.a.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function B(e,t){var n,a=[];if(!e)return a;for(n=0;n0&&A(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=M(t,n),i=0;i0&&A(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=A(t)&&t>=0&&t0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(i.a.CENC_DEFAULT_KID)?e[i.a.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(i.a.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=NaN;return e&&e.hasOwnProperty(i.a.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(i.a.PUBLISH_TIME)?new Date(e[i.a.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=O(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&A(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,a,s=[],u=function(e){if(e&&e.period&&A(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&A(e.index))return O(t.AdaptationSet_asArray[e.index])}}(e);if(u&&u.Representation_asArray){if(e&&e.period&&A(e.period.index)){var l=k(e.period.mpd.manifest);l&&(n=l[0])}for(var c=0,f=u.Representation_asArray.length;c=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(r.tilesHor=parseInt(t[0],10),r.tilesVert=parseInt(t[1],10))}})),t?m.updateSegmentData(e).then((function(t){!function(e,t,n){var r=[],i=function(e,t){var n,r,i,a,o=[],s=0;for(n=0,r=e.segments.length;ne)return i=t.url,!0})),i?n(i):t.segments.some((function(i){if(i.mediaStartTime<=e&&i.mediaStartTime+i.duration>e){var a=T.resolve(t.path);return y.load({method:"get",url:a.url,request:{range:i.mediaRange,responseType:"arraybuffer"},onload:function(e){var t=E.getSamplesInfo(e.target.response),a=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),o=window.URL.createObjectURL(a);r.push({start:i.mediaStartTime,end:i.mediaStartTime+i.duration,url:o}),n&&n(o)}}),!0}}))}}(r,e,t)})):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=function(e){var t=w.isRelative(e.media)?w.resolve(e.media,T.resolve(e.path).url):e.media;if(!t)return"";return Object(u.c)(t,e.id)}(e)),r.tilesHor>0&&r.tilesVert>0&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,n.push(r))}function D(){n=[],p=-1,g=null}return t={getTracks:function(){return n},addTracks:function(){if(S&&v&&(g=v.getMediaInfoForType(S,r.a.IMAGE))){var e=v.getVoRepresentations(g);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===i.a.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===i.a.SEGMENT_TIMELINE)&&C(e),e.segmentInfoType===i.a.SEGMENT_BASE&&C(e,!0)})),n.length>0&&n.sort((function(e,t){return e.bitrate-t.bitrate}))}},reset:D,setTrackByIndex:function(e){n&&0!==n.length&&(e>=n.length&&(e=n.length-1),p=e)},getCurrentTrack:function(){return p<0?null:n[p]},getCurrentTrackIndex:function(){return p},getThumbnailRequestForTime:function(e){for(var t,r=v.getVoRepresentations(g),i=0;it)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(a.index)&&a.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!l||e.segmentInfoType===u.a.SEGMENT_TEMPLATE)return!0;if(l&&e.segmentInfoType===u.a.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(l&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===u.a.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&a&&!isNaN(a.mediaStartTime)&&!isNaN(a.duration)&&a.mediaStartTime+a.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},reset:function(){v(),f.off(o.a.DYNAMIC_TO_STATIC,b,t)},getNextSegmentRequestIdempotent:function(e,t){var n=a?a.index+1:0,r=m.getSegmentByIndex(t,n,a?a.mediaStartTime:-1);return r?S(e,r):null},getValidTimeCloseToTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),A(t,n,e))return e;for(var i=n.adaptation.period.start,a=n.adaptation.period.start+n.adaptation.period.duration,o=Math.min(e+r,a),s=Math.max(e-r,i),u=NaN,l=null;o<=a||s>=i;){var c=null,f=null;if(o<=a&&(c=A(t,n,o)),s>=i&&(f=A(t,n,s)),f){u=s,l=f;break}if(c){u=o,l=c;break}o+=r,s-=r}if(l){var d=l.startTime+l.duration;return e>=l.startTime&&d-e>r?e:e=s.startTime&&l-e>r?e:e=i-.5*f.d/d&&(l=!0),!1})),u},getSegmentByTime:function(e,r){if(o(),!e)return null;void 0===r&&(r=null);var i=null,u=n.calcMediaTimeFromPresentationTime(r,e);return s(e,(function(r,o,s,l,c,f,d,h){if(u=o){var p=s.media,g=c.mediaRange;return l&&(p=l[h].media||"",g=l[h].mediaRange),i=Object(a.b)(n,t,e,r,c.d,f,p,g,d,c.tManifest),!0}return!1})),i},getMediaFinishedInformation:function(e){if(!e)return 0;var t,n,r,i,a,o,s,l=(e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList).SegmentTimeline,c=0,f=0,d=0;for(s=e.timescale,i=(t=l.S_asArray).length,r=0;r0)for(o=0;o=i&&t-n=n&&console.log(this.time+" ["+e+"] "+t)}},l=function(e){for(var t=[],n=0;n32&&(u.log("ERROR","Too large cursor position "+this.pos),this.pos=32)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n=144&&this.backSpace();var t=n(e);this.pos>=32?u.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<32;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<32;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var h=function(){this.rows=[];for(var e=0;e<15;e++)this.rows.push(new d);this.currRow=14,this.nrRollUpRows=null,this.reset()};h.prototype={reset:function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){u.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){u.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var p=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new h,this.nonDisplayedMemory=new h,this.lastOutputScreen=new h,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};p.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,u.log("INFO","MODE="+e),"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=e)},insertChars:function(e){for(var t=0;t=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}u.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=u.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var g=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new p(1,t),new p(2,n)],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}};g.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,u.setTime(e);for(var o=0;o=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB)this.lastCmdA=null,this.lastCmdB=null,u.log("DEBUG","Repeated command ("+l([r,i])+") is dropped");else if(0!==r||0!==i){if(u.log("DATA","["+l([t[o],t[o+1]])+"] -> ("+l([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),!n)if(a=this.parseChars(r,i))if(this.currChNr&&this.currChNr>=0)this.channels[this.currChNr-1].insertChars(a);else u.log("WARNING","No channel found yet. TEXT-MODE?");n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,u.log("WARNING","Couldn't parse cleaned data "+l([r,i])+" orig: "+l([t[o],t[o+1]])))}else this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47)&&!((23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return u.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),u.log("DEBUG","MIDROW ("+l([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,s=null;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127)&&!((16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,s=64<=t&&t<=95?1===n?r[e]:a[e]:1===n?i[e]:o[e];var u=this.interpretPAC(s,t);return this.channels[n-1].setPAC(u),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var o=t;o=17===a?t+80:18===a?t+112:t+144,u.log("INFO","Special char '"+n(o)+"' in channel "+r),i=[o],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(i){var s=l(i);u.log("DEBUG","Char codes = "+s.join(","))}return i},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=s[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function u(e,t,n,r){for(var i=0;i0&&u(e.arrayAccessFormPaths,t,n,r)&&(t[n]=[t[n]])}function c(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(n.setHours(t[3],t[4],r[0]),r.length>1&&n.setMilliseconds(r[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),n.setMinutes(n.getMinutes()-i-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function f(n,r,i,a){return!(r==t&&e.xmlElementsFilter.length>0)||u(e.xmlElementsFilter,n,i,a)}function d(s,h){if(s.nodeType==a){for(var p=new Object,g=s.childNodes,m=0;m0){var i=r.split(".#")[0];return u(e.datetimeAccessFormPaths,t,n,i)?c(t):t}return t}(p.__text,_,h+"."+_)),null!=p["#cdata-section"]&&(p.__cdata=p["#cdata-section"],delete p["#cdata-section"],"property"==e.arrayAccessForm&&delete p["#cdata-section_asArray"]),0==p.__cnt&&"text"==e.emptyNodeForm?p="":1==p.__cnt&&null!=p.__text?p=p.__text:1!=p.__cnt||null==p.__cdata||e.keepCData?p.__cnt>1&&null!=p.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==p.__text||""==p.__text.trim())&&delete p.__text:p=p.__cdata,delete p.__cnt,!e.enableToStringFunc||null==p.__text&&null==p.__cdata||(p.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),p}if(s.nodeType==n||s.nodeType==r)return s.nodeValue}function h(t,n,r,i){var a="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=r)for(var o=0;o":">"}function p(e,t){return""}function g(t,n){return"property"==e.arrayAccessForm&&(r=n.toString(),i="_asArray",-1!==r.indexOf(i,r.length-i.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function m(e){var t=0;if(e instanceof Object)for(var n in e)g(e,n)||t++;return t}function y(t,n,r){return 0==e.jsonPropertiesFilter.length||""==r||u(e.jsonPropertiesFilter,t,n,r)}function E(t){var n=[];if(t instanceof Object)for(var r in t)-1==r.toString().indexOf("__")&&0==r.toString().indexOf(e.attributePrefix)&&n.push(r);return n}function _(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+=""),null!=t.__text&&(e.escapeMode?n+=s(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=s(t):n+=t),n}function v(e,t){return""===e?t:e+"."+t}function T(e,t,n,r){var i="";if(0==e.length)i+=h(e,t,n,!0);else for(var a=0;a0)for(var r in e)if(!g(e,r)&&(""==t||y(e,r,v(t,r)))){var i=e[r],a=E(i);if(null==i||null==i)n+=h(i,r,a,!0);else if(i instanceof Object)if(i instanceof Array)n+=T(i,r,a,t);else if(i instanceof Date)n+=h(i,r,a,!1),n+=i.toISOString(),n+=p(i,r);else{m(i)>0||null!=i.__text||null!=i.__cdata?(n+=h(i,r,a,!1),n+=S(i,v(t,r)),n+=p(i,r)):n+=h(i,r,a,!0)}else n+=h(i,r,a,!1),n+=_(i),n+=p(i,r)}return n+=_(e)}this.parseXmlString=function(e){var t;window.ActiveXObject||window;if(void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?c(e):e},this.xml2json=function(e){return d(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return S(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}}},function(e,t,n){"use strict";var r=n(3),i=n(25),a=n(15),o=n(1);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt/4/e.length}))).length>1){var n=0,r=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach((function(t,i){var a=e[i+1];if(a){var o=a.ts-t.ts;n+=o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(r.headers.keys());try{for(p.s();!(a=p.n()).done;){var g=a.value;c+=g+": "+r.headers.get(g)+"\r\n"}}catch(e){p.e(e)}finally{p.f()}if(e.response.responseHeaders=c,!r.body)return r.arrayBuffer().then((function(t){e.response.response=t;var n={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var m,y,T=parseInt(r.headers.get("Content-Length"),10),S=0,A=!1,b=new Uint8Array,I=0;if(E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&i){var R=n,N=0,w=s(r.body.tee(),2),C=w[0],D=w[1];m=C.getReader(),y=[],m.read().then((function r(a){var o=a.value,s=a.done;if(N=Date.now(),o&&o.length){var u=N-R,l=o.length;y.push({chunkDownloadTimeRelativeMS:N-n,chunkDownloadDurationMS:u,chunkBytes:l,kbps:Math.round(8*l/(u/1e3)),bufferLevel:t.getCurrentBufferLevel(h.mediaType)})}if(s){var f=N-n,d=y.reduce((function(e,t){return e+t.chunkBytes}),0);return i.addMeasurement(h,f,y,_,v,c),void e.progress({loaded:d,total:d,lengthComputable:!0,time:i.getEstimatedDownloadDurationMS(h),stream:!0})}return R=Date.now(),m.read().then(r)})),e.reader=D.getReader()}else e.reader=r.body.getReader();var O=[],M=[],P=[],L=!0;f(e,(function t(n){var r=n.value;if(n.done){if(b){if(E!==o.a.ABR_FETCH_THROUGHPUT_CALCULATION_AAST){var i=null;E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&(i=function(e,t){try{var n,r;n=e.filter((function(t,n){return n1){for(var a=0,o=0,s=0;s1)i.push(8*r[s].bytes/u);else{0===o&&(o=n[s].ts);var l=r[s].ts-o;l>1?(i.push(8*a/l),a=0,o=0):a+=r[s].bytes}}if(i.length>0)return i.reduce((function(e,t){return e+t}),0)/i.length}return null}catch(e){return null}}(M,P)),e.progress({loaded:S,total:isNaN(T)?S:T,lengthComputable:!0,time:d(O,S),throughput:i,stream:!0})}e.response.response=b.buffer}return e.onload(),void e.onend()}if(r&&r.length>0){if(b=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(b,r),S+=r.length,O.push({ts:Date.now(),bytes:r.length}),E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&L)l.findLastTopIsoBoxCompleted(["moof"],b,I).found&&(L=!1,M.push({ts:performance.now(),bytes:r.length}));var a=l.findLastTopIsoBoxCompleted(["moov","mdat"],b,I);if(a.found){var s,u=a.lastCompletedOffset+a.size;E!==o.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING||L||(L=!0,P.push({ts:performance.now(),bytes:b.length})),u===b.length?(s=b,b=new Uint8Array):(s=new Uint8Array(b.subarray(0,u)),b=b.subarray(u)),e.progress({data:s.buffer,lengthComputable:!1,noTrace:!0}),I=0}else I=a.lastCompletedOffset,A||(e.progress({lengthComputable:!1,noTrace:!0}),A=!0)}f(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))}))},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:d,setup:function(e){t=e.dashMetrics}}}c.__dashjs_factory_name="FetchLoader";var f=r.a.getClassFactory(c),d=n(5),h=n(8),p=n(36),g=n(14),m=n(6),y=n(7),E=n(2);function _(){var e,t,n=this.context,r={};function i(){t=Object(m.a)(n).getInstance().getLogger(e)}function a(e){for(var t={},n=0,r=0,i=0,a=0,o=e.length,s=0;se.bitrate&&(n=!1):t=e.bitrate})),n}return e={setup:i,addMeasurement:function(e,t,n,i,o){e&&e.mediaType&&!r[e.mediaType]&&(r[e.mediaType]=[]);var s=e.mediaInfo.bitrateList.find((function(t){return t.id===e.representationId}));r[e.mediaType].push({index:e.index,repId:e.representationId,mediaType:e.mediaType,requestTimeMS:i,adjustedAvailabilityStartTimeMS:e.availabilityStartTime.getTime(),segDurationMS:1e3*e.duration,chunksDurationMS:n.reduce((function(e,t){return e+t.chunkDownloadDurationMS}),0),segmentBytes:n.reduce((function(e,t){return e+t.chunkBytes}),0),bitrate:s&&s.bandwidth,bitrateList:e.mediaInfo.bitrateList,chunkMeasurements:n,fetchDownloadDurationMS:t,throughputCapacityDelayMS:o,getEstimatedBufferLevel:a(n.slice(1))}),r[e.mediaType].length>10&&r[e.mediaType].shift()},getThroughputCapacityDelayMS:function(e,t){var n=r[e.mediaType]&&r[e.mediaType].slice(-3);return!n||n.length<3?0:o(n)?t/4>250?250:t/4:0},getEstimatedDownloadDurationMS:function(e){var n=r[e.mediaType].slice(-1).pop(),i=r[e.mediaType].slice(-3),a=n.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;n.bufferLevelAtSegmentStart=n.getEstimatedBufferLevel(a/2),n.bufferLevelAtSegmentEnd=n.getEstimatedBufferLevel(a);var s=o(i),u=s?.6:.8;if(n.isBufferStable&&1.05*n.segDurationMS.2*n.chunkMeasurements.length){var g=c/f,m=n.segmentBytes/g;return n.fetchDownloadDurationMSn.bitrate)return y=e.bandwidth,!0})),y===n.bitrate?n.fetchDownloadDurationMS*u:u*n.segmentBytes*8*1e3/y}},i(),e}_.__dashjs_factory_name="LowLatencyThroughputModel";var v=r.a.getSingletonFactory(_);function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){e=e||{};var t,n,r,s,u,l,c,_,S,A=this.context,b=e.errHandler,I=e.dashMetrics,R=e.mediaPlayerModel,N=e.requestModifier,w=e.boxParser,C=e.errors,D=e.requestTimeout||0,O=Object(y.a)(A).getInstance(),M=Object(a.a)(A).getInstance();function P(e,t){var a,p=e.request,m=[],y=!0,v=!0,T=new Date,S=T,C=0;if(!N||!I||!b)throw new Error("config object is not correct or missing");var L,F=function(e){if(v=!1,p.requestStartDate=T,p.requestEndDate=new Date,p.firstByteDate=p.firstByteDate||T,!p.checkExistenceOnly){var t=a.response?a.response.responseURL:null,n=a.response?a.response.status:null,r=a.response&&a.response.getAllResponseHeaders?a.response.getAllResponseHeaders():a.response?a.response.responseHeaders:[];I.addHttpRequest(p,t,n,r,e?m:null),p.type===d.a.MPD_TYPE&&I.addManifestUpdate(p)}},x=function(){if(-1!==n.indexOf(a)&&(n.splice(n.indexOf(a),1),v))if(F(!1),t>0){try{if(M.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&p.type===d.a.MEDIA_SEGMENT_TYPE)R.getRetryAttemptsForType(d.a.MEDIA_SEGMENT_TYPE)===t&&O.trigger(E.a.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var r={config:e};s.push(r),r.timeout=setTimeout((function(){-1!==s.indexOf(r)&&(s.splice(s.indexOf(r),1),P(e,t))}),R.getRetryIntervalsForType(p.type))}else{if(p.type===d.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;b.error(new h.a(u[p.type],p.url+" is not available",{request:p,response:a.response})),e.error&&e.error(p,"error",a.response.statusText),e.complete&&e.complete(p,a.response.statusText)}};M.get().streaming.lowLatencyEnabled&&window.fetch&&"arraybuffer"===p.responseType&&p.type===d.a.MEDIA_SEGMENT_TYPE?(L=f(A).create({requestModifier:N,lowLatencyThroughputModel:c,boxParser:w})).setup({dashMetrics:I}):L=Object(i.a)(A).create({requestModifier:N});var U=null,B=N.modifyRequestURL(p.url);if(M.get().streaming.cmcd&&M.get().streaming.cmcd.enabled){var k=M.get().streaming.cmcd.mode;if(k===o.a.CMCD_MODE_QUERY){var G=function(e){try{var t=[],n=l.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(p);B=g.a.addAditionalQueryParameterToUrl(B,G)}else k===o.a.CMCD_MODE_HEADER&&(U=l.getHeaderParameters(p))}p.url=B;var j=p.checkExistenceOnly?d.a.HEAD:d.a.GET,Y=R.getXHRWithCredentialsForType(p.type);a={url:B,method:j,withCredentials:Y,request:p,onload:function(){a.response.status>=200&&a.response.status<=299&&(F(!0),e.success&&e.success(a.response.response,a.response.statusText,a.response.responseURL),e.complete&&e.complete(p,a.response.statusText))},onend:x,onerror:x,progress:function(t){var n=new Date;y&&(y=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(p.firstByteDate=n)),t.lengthComputable&&(p.bytesLoaded=t.loaded,p.bytesTotal=t.total),t.noTrace||(m.push({s:S,d:t.time?t.time:n.getTime()-S.getTime(),b:[t.loaded?t.loaded-C:0],t:t.throughput}),S=n,C=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(p)},ontimeout:function(e){var t;if(e.lengthComputable){var n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";_.warn(t)},loader:L,timeout:D,headers:U};var H=(new Date).getTime();if(isNaN(p.delayLoadingTime)||H>=p.delayLoadingTime)n.push(a),L.load(a);else{var K={httpRequest:a};r.push(K),K.delayTimeout=setTimeout((function(){if(-1!==r.indexOf(K)){r.splice(r.indexOf(K),1);try{T=new Date,S=T,n.push(K.httpRequest),L.load(K.httpRequest)}catch(e){K.httpRequest.onerror()}}}),p.delayLoadingTime-H)}}return t={load:function(e){e.request?P(e,R.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){s.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),s=[],r.forEach((function(e){return clearTimeout(e.delayTimeout)})),r=[],n.forEach((function(e){e.request.type!==d.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),n=[]}},_=Object(m.a)(A).getInstance().getLogger(t),n=[],r=[],s=[],l=Object(p.a)(A).getInstance(),c=v(A).getInstance(),T(S={},d.a.MPD_TYPE,C.DOWNLOAD_ERROR_ID_MANIFEST_CODE),T(S,d.a.XLINK_EXPANSION_TYPE,C.DOWNLOAD_ERROR_ID_XLINK_CODE),T(S,d.a.INIT_SEGMENT_TYPE,C.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),T(S,d.a.MEDIA_SEGMENT_TYPE,C.DOWNLOAD_ERROR_ID_CONTENT_CODE),T(S,d.a.INDEX_SEGMENT_TYPE,C.DOWNLOAD_ERROR_ID_CONTENT_CODE),T(S,d.a.BITSTREAM_SWITCHING_SEGMENT_TYPE,C.DOWNLOAD_ERROR_ID_CONTENT_CODE),T(S,d.a.OTHER_TYPE,C.DOWNLOAD_ERROR_ID_CONTENT_CODE),u=S,t}S.__dashjs_factory_name="HTTPLoader";var A=r.a.getClassFactory(S);function b(){var e;function t(){e={}}function n(){t()}return n(),{getLoader:function(t){for(var n in e)if(e.hasOwnProperty(n)&&t.startsWith(n))return e[n];return A},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}b.__dashjs_factory_name="SchemeLoaderFactory";var I=r.a.getSingletonFactory(b);t.a=I},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(60).Buffer)},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!i;a--){var o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,i="/"===o.charAt(0))}return(i?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!i).join("/"))||"."},t.normalize=function(e){var a=t.isAbsolute(e),o="/"===i(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!a).join("/"))||a||(e="."),e&&o&&(e+="/"),(a?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),a=r(n.split("/")),o=Math.min(i.length,a.length),s=o,u=0;u=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,a=0,o=e.length-1;o>=0;--o){var s=e.charCodeAt(o);if(47!==s)-1===r&&(i=!1,r=o+1),46===s?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){n=o+1;break}}return-1===t||-1===r||0===a||1===a&&t===r-1&&t===n+1?"":e.slice(t,r)};var i="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(26))},function(e,t,n){t.generateISD=n(74).generateISD,t.fromXML=n(75).fromXML,t.renderHTML=n(91).render},function(e,t,n){"use strict";var r=n(3),i=n(13);function a(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;nthis.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&tthis.customTimeRangeArray[n].start&&ethis.customTimeRangeArray[n].start&&t=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return Object(i.a)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}a.__dashjs_factory_name="CustomTimeRanges",t.a=r.a.getClassFactory(a)},function(e,t,n){"use strict";n.d(t,"b",(function(){return s}));var r=n(3),i=n(29),a=n(1),o=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function s(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function u(){var e,t,n;return e={setConfig:function(e){e&&e.settings&&(t=e.settings)},supportsMediaSource:s,supportsEncryptedMedia:function(){return n},supportsCodec:function(e,n){return n!==a.a.AUDIO&&n!==a.a.VIDEO?Promise.resolve(!0):function(e,n){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&n===a.a.AUDIO||n===a.a.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,n)?function(e,t){return new Promise((function(n){if(e&&e.codec){var r={type:"media-source"};r[t]={},r[t].contentType=e.codec,r[t].width=e.width,r[t].height=e.height,r[t].bitrate=parseInt(e.bitrate),r[t].framerate=parseFloat(e.framerate),navigator.mediaCapabilities.decodingInfo(r).then((function(e){n(e.supported)})).catch((function(){n(!1)}))}else n(!1)}))}(e,n):function(e){return new Promise((function(t){if(e&&e.codec){var n=e.codec;e.width&&e.height&&(n+=';width="'+e.width+'";height="'+e.height+'"'),"MediaSource"in window&&MediaSource.isTypeSupported(n)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(n)?t(!0):t(!1)}else t(!1)}))}(e)},setEncryptedMediaSupported:function(e){n=e},supportsEssentialProperty:function(e){try{return-1!==i.a.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n,r=e.split(".")[0],i=0===t.indexOf(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:null;return parseFloat((O(e)-B()).toFixed(5))}function O(e){var t=e||g;return t.start+t.duration}function M(){g&&o&&o.getElement()?o.play():E=!0}function P(){return g&&o?o.isPaused():null}function L(){g&&o&&o.pause()}function F(){return g&&o?o.isSeeking():null}function x(){return g&&o?o.isStalled():null}function U(e,n,r){g&&o&&(e!==(isNaN(T)?o.getTime():T)&&((S=!0===r)||(T=e,C.trigger(c.a.PLAYBACK_SEEK_ASKED)),t.info("Requesting seek to time: "+e+(S?" (internal)":"")),o.setCurrentTime(e,n)))}function B(){return g&&o?o.getTime():null}function k(){return g&&o?o.getPlaybackRate():null}function G(){return g&&o?o.getEnded():null}function j(){return m}function Y(){if(!m||isNaN(v))return NaN;var e=B();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*s.getClientTimeOffset();return Math.max(((t-v-1e3*e)/1e3).toFixed(3),0)}function H(){L(),E=!1,p=0,v=0,R=!1,T=NaN,o&&(C.off(c.a.DATA_UPDATE_COMPLETED,z,e),C.off(c.a.LOADING_PROGRESS,me,e),C.off(c.a.MANIFEST_UPDATED,Te,e),C.off(c.a.STREAMS_COMPOSED,Se,e),C.off(h.a.BUFFER_LEVEL_STATE_CHANGED,ye,e),C.off(h.a.PLAYBACK_PROGRESS,fe,e),C.off(h.a.PLAYBACK_TIME_UPDATED,fe,e),C.off(h.a.PLAYBACK_ENDED,le,e),C.off(h.a.STREAM_INITIALIZING,_e,e),C.off(h.a.REPRESENTATION_SWITCH,ve,e),o.setPlaybackRate(1,!0),V(),o.removeEventListener("canplay",X),o.removeEventListener("canplaythrough",Q),o.removeEventListener("play",$),o.removeEventListener("waiting",Z),o.removeEventListener("playing",J),o.removeEventListener("pause",ee),o.removeEventListener("error",ce),o.removeEventListener("seeking",te),o.removeEventListener("seeked",ne),o.removeEventListener("timeupdate",re),o.removeEventListener("progress",ie),o.removeEventListener("ratechange",ae),o.removeEventListener("loadedmetadata",oe),o.removeEventListener("loadeddata",se),o.removeEventListener("stalled",Ee),o.removeEventListener("ended",ue)),f=null,o=null,g=null,m=null}function K(e,t){var n=r.getCurrentDVRInfo(t),i=n?n.range:null;return i?e>i.end?Math.max(i.end-p,i.start):e>0&&e+.25_+500)&&(_=e,re())):W())}),N.get().streaming.wallclockTimeUpdateInterval)}}function V(){clearInterval(f),f=null}function W(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!P()&&m&&0!==o.getReadyState()&&!F()&&!R){e||(e=n.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO);var r=B(),i=K(r,e),s=!isNaN(i)&&i!==r;s&&!F()&&(x()||b||1===o.getReadyState())&&(t.debug("UpdateCurrentTime: Seek to actual time: ".concat(i," from currentTime: ").concat(r)),U(i))}}function z(e){var t=i.convertRepresentationToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&g.id===n.id&&(g=n)}function X(){C.trigger(c.a.CAN_PLAY)}function Q(){C.trigger(c.a.CAN_PLAY_THROUGH)}function $(){t.info("Native video element event: play"),W(),q(),C.trigger(c.a.PLAYBACK_STARTED,{startTime:B()})}function Z(){t.info("Native video element event: waiting"),C.trigger(c.a.PLAYBACK_WAITING,{playingTime:B()})}function J(){t.info("Native video element event: playing"),C.trigger(c.a.PLAYBACK_PLAYING,{playingTime:B()})}function ee(){t.info("Native video element event: pause"),C.trigger(c.a.PLAYBACK_PAUSED,{ended:G()})}function te(){if(S)S=!1;else{var e=B();isNaN(T)||T===e||(e=T),T=NaN,t.info("Seeking to: "+e),q(),C.trigger(c.a.PLAYBACK_SEEKING,{seekTime:e,streamId:g.id})}}function ne(){t.info("Native video element event: seeked"),C.trigger(c.a.PLAYBACK_SEEKED)}function re(){g&&C.trigger(c.a.PLAYBACK_TIME_UPDATED,{timeToEnd:D(),time:B(),streamId:g.id})}function ie(){C.trigger(c.a.PLAYBACK_PROGRESS,{streamId:g.id})}function ae(){var e=k();t.info("Native video element event: ratechange: ",e),C.trigger(c.a.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function oe(){t.info("Native video element event: loadedmetadata"),C.trigger(c.a.PLAYBACK_METADATA_LOADED),q()}function se(){t.info("Native video element event: loadeddata"),C.trigger(c.a.PLAYBACK_LOADED_DATA)}function ue(){t.info("Native video element event: ended"),L(),V();var e=n?n.getActiveStreamInfo():null;e&&C.trigger(c.a.PLAYBACK_ENDED,{isLast:e.isLast})}function le(e){if(f&&e.isLast){t.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var n=e.seekTime?e.seekTime:O();o.setCurrentTime(n),L(),V()}}function ce(e){var t=e.target||e.srcElement;C.trigger(c.a.PLAYBACK_ERROR,{error:t.error})}function fe(){m&&de()&&N.get().streaming.liveCatchup.playbackRate>0&&!P()&&!F()&&(function(){try{if(de()&&N.get().streaming.liveCatchup.playbackRate>0&&B()>0){var e=pe(),t=Y(),n=y.getLiveDelay(),r=y.getLiveCatchupLatencyThreshold(),i=N.get().streaming.liveCatchup.minDrift;if(e===a.a.LIVE_CATCHUP_MODE_LOLP){var o=he(),s=N.get().streaming.liveCatchup.playbackBufferMin;return function(e,t,n,r,i,a){try{var o=Math.abs(e-t);return(isNaN(a)||e<=a)&&(o>n||rr&&(isNaN(n)||e<=n)}catch(e){return!1}}(t,n,r,i)}}catch(e){return!1}}()?function(){if(o){var e,i=o.getPlaybackRate(),s=N.get().streaming.liveCatchup.playbackRate,u=Y(),l=y.getLiveDelay(),c=he();if(pe()===a.a.LIVE_CATCHUP_MODE_LOLP){N.get().streaming.liveCatchup.minDrift;var f=N.get().streaming.liveCatchup.playbackBufferMin;e=function(e,n,r,i,a,o,s){var u,l=e;if(or/2&&(b=!1);Math.abs(s-u)<=I&&(u=null);return{newRate:u}}(s,u,l,0,f,c,i)}else e=function(e,t,n,r,i){var a=e,o=t-n,s=5*o,u=2*a/(1+Math.pow(Math.E,-s)),l=1-a+u;b&&(r>n/2?b=!1:o>0&&(l=1));Math.abs(i-l)<=I&&(l=null);return{newRate:l}}(s,u,l,c,i);var d=e.newRate;d&&o.setPlaybackRate(d);var h=u-l;N.get().streaming.liveCatchup.maxDrift>0&&!A&&h>N.get().streaming.liveCatchup.maxDrift?(t.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),A=!0,p=n&&n.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,g=r.getCurrentDVRInfo(p),(m=g?g.range:null)&&!isNaN(m.end)&&U(m.end-y.getLiveDelay(),!0,!1)):A=!1}var p,g,m}():ge())}function de(){return N.get().streaming.liveCatchup.enabled||N.get().streaming.lowLatencyEnabled}function he(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=null;return n.getActiveStreamProcessors().forEach((function(n){if(!e||0===e.length||-1===e.indexOf(n.getType())){var r=n.getBufferLevel();t=null===t?r:Math.min(t,r)}})),t}function pe(){var e=N.get().streaming.liveCatchup.playbackBufferMin;return N.get().streaming.liveCatchup.mode!==a.a.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?a.a.LIVE_CATCHUP_MODE_DEFAULT:a.a.LIVE_CATCHUP_MODE_LOLP}function ge(){o&&o.setPlaybackRate(1)}function me(e){if(!1===e.stream&&N.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var n=1.2*e.request.duration;n>y.getLiveDelay()&&(t.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",n.toFixed(2)),N.update({streaming:{delay:{liveDelay:n}}}))}}function ye(e){e.streamId===g.id&&(de()?e.state!==u.BUFFER_EMPTY||F()||b||(b=!0,ge()):N.get().streaming.buffer.setStallState&&o.setStallState(e.mediaType,e.state===u.BUFFER_EMPTY))}function Ee(e){C.trigger(c.a.PLAYBACK_STALLED,{e:e})}function _e(e){var n;(n=e.mediaInfo)&&n.supplementalProperties&&"true"===n.supplementalProperties[a.a.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(t.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),N.update({streaming:{lowLatencyEnabled:!0}}))}function ve(e){var t=n.getActiveStreamInfo();if(N.get().streaming.lowLatencyEnabledByManifest&&e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===a.a.VIDEO||e.mediaType===a.a.AUDIO)){var r=!e.currentRepresentation.availabilityTimeComplete;r&&N.update({streaming:{lowLatencyEnabled:r}})}}function Te(){R=!0}function Se(){R=!1}return e={initialize:function(t,n){g=t,!0!==n&&function(){o.addEventListener("canplay",X),o.addEventListener("canplaythrough",Q),o.addEventListener("play",$),o.addEventListener("waiting",Z),o.addEventListener("playing",J),o.addEventListener("pause",ee),o.addEventListener("error",ce),o.addEventListener("seeking",te),o.addEventListener("seeked",ne),o.addEventListener("timeupdate",re),o.addEventListener("progress",ie),o.addEventListener("ratechange",ae),o.addEventListener("loadedmetadata",oe),o.addEventListener("loadeddata",se),o.addEventListener("stalled",Ee),o.addEventListener("ended",ue),m=g.manifestInfo.isDynamic,A=!1,b=!1,S=!1;var t="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",n=/safari/.test(t)&&!/chrome/.test(t);I=n?.25:.02,C.on(c.a.DATA_UPDATE_COMPLETED,z,e),C.on(c.a.LOADING_PROGRESS,me,e),C.on(c.a.MANIFEST_UPDATED,Te,e),C.on(c.a.STREAMS_COMPOSED,Se,e),C.on(h.a.BUFFER_LEVEL_STATE_CHANGED,ye,e),C.on(h.a.PLAYBACK_PROGRESS,fe,e),C.on(h.a.PLAYBACK_TIME_UPDATED,fe,e),C.on(h.a.PLAYBACK_ENDED,le,e,{priority:l.a.EVENT_PRIORITY_HIGH}),C.on(h.a.STREAM_INITIALIZING,_e,e),C.on(h.a.REPRESENTATION_SWITCH,ve,e),E&&(E=!1,M())}()},setConfig:function(e){e&&(e.streamController&&(n=e.streamController),e.dashMetrics&&(r=e.dashMetrics),e.mediaPlayerModel&&(y=e.mediaPlayerModel),e.adapter&&(i=e.adapter),e.videoModel&&(o=e.videoModel),e.timelineConverter&&(s=e.timelineConverter),e.settings&&(N=e.settings))},getTimeToStreamEnd:D,getBufferLevel:he,getTime:B,getIsManifestUpdateInProgress:function(){return R},getPlaybackRate:k,getPlayedRanges:function(){return g&&o?o.getPlayedRanges():null},getEnded:G,getIsDynamic:j,getStreamController:function(){return n},computeAndSetLiveDelay:function(e,n){var r,o,s,u=!isNaN(e)&&isFinite(e)?e:NaN,l=i.getSuggestedPresentationDelay();if(N.get().streaming.delay.applyServiceDescription&&isNaN(N.get().streaming.delay.liveDelay)&&isNaN(N.get().streaming.delay.liveDelayFragmentCount)&&function(e){if(!e||!e.serviceDescriptions)return;for(var n=null,r=0;r0&&(t.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),N.update({streaming:{delay:{liveDelay:n.latency.target/1e3}}}),n.latency.max&&n.latency.max>n.latency.target&&(t.debug("Apply LL properties coming from service description. Max Latency:",n.latency.max),N.update({streaming:{liveCatchup:{maxDrift:(n.latency.max-n.latency.target)/1e3}}}))),n.playbackRate&&n.playbackRate.max>1&&(t.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),N.update({streaming:{liveCatchup:{playbackRate:n.playbackRate.max-1}}})))}(n),r=y.getLiveDelay()?y.getLiveDelay():null===N.get().streaming.delay.liveDelayFragmentCount||isNaN(N.get().streaming.delay.liveDelayFragmentCount)||isNaN(u)?!0===N.get().streaming.delay.useSuggestedPresentationDelay&&null!==l&&!isNaN(l)&&l>0?l:isNaN(u)?n&&!isNaN(n.minBufferTime)?4*n.minBufferTime:4*g.manifestInfo.minBufferTime:4*u:u*N.get().streaming.delay.liveDelayFragmentCount,null!==(s=i.getAvailabilityStartTime())&&(v=s),n&&n.dvrWindowSize>0){var c=Math.max(n.dvrWindowSize-10,n.dvrWindowSize/2);o=Math.min(r,c)}else o=r;return p=o,o},getLiveDelay:function(){return p},getCurrentLiveLatency:Y,play:M,isPaused:P,pause:L,isSeeking:F,getStreamEndTime:O,seek:U,reset:H,updateCurrentTime:W,getAvailabilityStartTime:function(){return v}},t=Object(d.a)(w).getInstance().getLogger(e),H(),e}p.__dashjs_factory_name="PlaybackController";var g=f.a.getSingletonFactory(p),m=n(18),y=n(8),E=n(9),_=n(15),v=n(5);function T(e){var t,n,r,i,o,s,u=this.context,l=Object(_.a)(u).getInstance(),f=e.textController,h=e.eventBus,p=[],g=[],m=!1,T=e.mediaSource,S=null;function A(e){return new Promise((function(t){P((function(){i.changeType&&i.changeType(e),t()}))}))}function b(e){return i=f.getTextSourceBuffer(e),Promise.resolve()}function I(){if("function"==typeof i.addEventListener)try{i.addEventListener("updateend",O,!1),i.addEventListener("error",M,!1),i.addEventListener("abort",M,!1)}catch(e){s=setInterval(O,50)}else s=setInterval(O,50)}function R(e){return new Promise((function(t){i&&l.get().streaming.buffer.useAppendWindow?P((function(){try{if(!i)return void t();var n=T.duration,a=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(n=e.start+e.duration),e&&!isNaN(e.start)&&(a=e.start),i.appendWindowEnd===n&&i.appendWindowStart===a||(i.appendWindowStart=0,i.appendWindowEnd=n+.01,i.appendWindowStart=Math.max(a-.1,0),r.debug("Updated append window for ".concat(o.type,". Set start to ").concat(i.appendWindowStart," and end to ").concat(i.appendWindowEnd))),t()}catch(e){r.warn("Failed to set append window"),t()}})):t()}))}function N(e){return new Promise((function(t){i?P((function(){try{i.timestampOffset===e||isNaN(e)||(i.timestampOffset=e,r.debug("Set MSE timestamp offset to ".concat(e))),t()}catch(e){t()}})):t()}))}function w(){return new Promise((function(e){P((function(){var t=i.appendWindowStart,n=i.appendWindowEnd;i&&(i.abort(),i.appendWindowStart=t,i.appendWindowEnd=n),e()}))}))}function C(){if(!m&&g.length>0){m=!0;var e=g[0];g.splice(0,1);var t=function(){m=!1,g.length>0&&C.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==v.a.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{S=e.request,0===e.data.bytes.byteLength?t.call(this):(i.appendBuffer?i.appendBuffer(e.data.bytes):i.append(e.data.bytes,e.data),P(t.bind(this)))}catch(t){r.fatal('SourceBuffer append failed "'+t+'"'),g.length>0?C():m=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new y.a(t.code,t.message)})}}}function D(){p.length>0&&(i.updating||(p.shift()(),D()))}function O(){i.updating||D()}function M(e){var t,r,i=e.target||{};t=c.a.SOURCE_BUFFER_ERROR,r={error:i,lastRequestAppended:S}||{},h.trigger(t,r,{streamId:o.streamInfo.id,mediaType:n})}function P(e){p.push(e),i.updating||D()}return t={getType:function(){return n},getAllBufferRanges:function(){try{return i.buffered}catch(e){return r.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return i},append:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(r,i){e?(g.push({data:e,promise:{resolve:r,reject:i},request:n}),P(C.bind(t))):i({chunk:e,error:new y.a(E.a.APPEND_ERROR_CODE,E.a.APPEND_ERROR_MESSAGE)})}))},remove:function(e){return new Promise((function(t,n){var r=e.start,a=e.end;r>=0&&a>r?P((function(){try{i.remove(r,a),P((function(){t({from:r,to:a,unintended:!1}),e.resolve&&e.resolve()}))}catch(t){n({from:r,to:a,unintended:!1,error:new y.a(E.a.REMOVE_ERROR_CODE,E.a.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}})):t()}))},abort:function(){return new Promise((function(e){try{g=[],"open"===T.readyState?P((function(){try{i&&i.abort(),e()}catch(t){e()}})):i&&i.setTextTrack&&"ended"===T.readyState?(i.abort(),e()):e()}catch(t){e()}}))},reset:function(){if(i){try{p=[],function(){try{"function"==typeof i.removeEventListener&&(i.removeEventListener("updateend",O,!1),i.removeEventListener("error",M,!1),i.removeEventListener("abort",M,!1)),clearInterval(s)}catch(e){r.error(e)}}(),m=!1,g=[],i.getClassName&&"TextSourceBuffer"===i.getClassName()||(r.debug("Removing sourcebuffer from media source"),T.removeSourceBuffer(i))}catch(e){}i=null}S=null},updateTimestampOffset:N,initializeForStreamSwitch:function(e,t,r){n=(o=e).type;var a=o.codec;!function(e){i=e.getBuffer()}(r),I();var s=[];return s.push(w),s.push(R(o.streamInfo)),s.push(A(a)),t&&void 0!==t.MSETimeOffset&&s.push(N(t.MSETimeOffset)),Promise.all(s)},initializeForFirstUse:function(e,t,r){n=(o=t).type;var s=o.codec;try{if(s.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return b(e);i=T.addSourceBuffer(s),I();var u=[];return u.push(R(o.streamInfo)),r&&void 0!==r.MSETimeOffset&&u.push(N(r.MSETimeOffset)),Promise.all(u)}catch(t){return o.type==a.a.TEXT&&!o.isFragmented||-1!==s.indexOf('codecs="stpp')||-1!==s.indexOf('codecs="vtt')?b(e):Promise.reject(t)}},updateAppendWindow:R,changeType:A},r=Object(d.a)(u).getInstance().getLogger(t),t}T.__dashjs_factory_name="SourceBufferSink";var S=f.a.getClassFactory(T);function A(){var e={};return{save:function(t){var n=t.streamId,r=t.representationId;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}A.__dashjs_factory_name="InitCache";var b=f.a.getSingletonFactory(A);function I(e){e=e||{};var t,n,r,i,o,s,f,p,g,_,T,A,I,R,N,w,C,D,O=this.context,M=Object(l.a)(O).getInstance(),P=e.errHandler,L=e.fragmentModel,F=e.representationController,x=e.adapter,U=e.textController,B=e.abrController,k=e.playbackController,G=e.streamInfo,j=e.type,Y=e.settings;function H(e){s=e}function K(e){return x.convertRepresentationToRepresentationInfo(F.getRepresentationForQuality(e))}function q(e,t,n){var r=K(n);return t&&t[j]&&(j===a.a.VIDEO||j===a.a.AUDIO)?g.initializeForStreamSwitch(e,r,t[j]):g.initializeForFirstUse(G,e,r)}function V(e){Y.get().streaming.cacheInitSegments&&(n.info("Init fragment finished loading saving to",j+"'s init cache"),N.save(e.chunk)),n.debug("Append Init fragment",j," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),z(e.chunk)}function W(e){z(e.chunk,e.request)}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;g.append(e,t).then((function(e){Q(e)})).catch((function(e){Q(e)})),e.mediaInfo.type===a.a.VIDEO&&Ee(c.a.VIDEO_CHUNK_RECEIVED,{chunk:e})}function X(e){if(e&&e.length>0)for(var t=0,r=e.length;t0){var e=Math.max(.2*o,1),t=o-e,r=Math.min(Y.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),i=Math.min(Y.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),a={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(r.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(i.toFixed(5))}}};Y.update(a)}}(),void(22!==e.error.code&&ye()||(n.warn("Clearing playback buffer to overcome quota exceed situation"),Ee(c.a.QUOTA_EXCEEDED,{criticalBufferLevel:o,quotaExceededTime:e.chunk.start}),ue(se())));if(g&&(re(),R=!1,(T=e.chunk)&&T.endFragment)){T&&!isNaN(T.index)&&(f=Math.max(T.index,f),ie());var t=g.getAllBufferRanges();T.segmentType===v.a.MEDIA_SEGMENT_TYPE&&(X(t),J(),function(){if(isNaN(D))return;if(j!==a.a.AUDIO&&j!==a.a.VIDEO)return void(D=NaN);var e=k.getTime(),t=ne(e,0),n=ne(D,0);if(t&&n&&t.start===n.start)return void(D=NaN);var r=F.getCurrentRepresentation().segmentDuration,i=ne(D,r);if(!i)return;Y.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-D)>r?D<=i.end&&k.seek(Math.max(D,i.start),!1,!0):en){var i=Math.max(0,e-n),a=L.getRequests({state:m.a.FRAGMENT_MODEL_EXECUTED,time:e,threshold:.01})[0];if(a&&(i=Math.min(a.startTime,i)),i>0)return{start:r,end:i}}return null}(e,n),i=function(e,t){var n=t.end(t.length-1)+.5,r=G.manifestInfo.duration>=Y.get().streaming.buffer.longFormContentDurationThreshold?Y.get().streaming.buffer.bufferTimeAtTopQualityLongForm:Y.get().streaming.buffer.bufferTimeAtTopQuality;if(n-e>r){var i=e+r,a=L.getRequests({state:m.a.FRAGMENT_MODEL_EXECUTED,time:e,threshold:.01})[0];if(a&&(i=Math.max(a.startTime+a.duration,i)),i=a&&e=p-1,t=k.getTimeToStreamEnd(G)-i<=0;!e&&!t||r||(ge(!0),n.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ".concat(G.id," and type ").concat(j)))}function ae(){j!==a.a.AUDIO&&j!==a.a.VIDEO||((!Y.get().streaming.lowLatencyEnabled&&i=Y.get().streaming.buffer.stallThreshold||Y.get().streaming.lowLatencyEnabled&&i>0)&&oe(u.BUFFER_LOADED))}function oe(e){_===e||e===u.BUFFER_EMPTY&&0===k.getTime()||j===a.a.TEXT&&!U.isTextEnabled()||(_=e,Ee(c.a.BUFFER_LEVEL_STATE_CHANGED,{state:e}),Ee(e===u.BUFFER_LOADED?c.a.BUFFER_LOADED:c.a.BUFFER_EMPTY),n.debug(e===u.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function se(){var e=[],t=g.getAllBufferRanges();if(!t||0===t.length)return e;var n=k.getTime(),r=Math.max(0,n-Y.get().streaming.buffer.bufferToKeep),i=L.getRequests({state:m.a.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(i)r=Math.min(i.startTime,r);else if(0===n&&k.getIsDynamic())return[];if(t.start(0)<=r){for(var a={start:0,end:r},o=0;o=Y.get().streaming.buffer.bufferPruningInterval&&(A=0,g&&j!==a.a.TEXT&&(r||ue(se())))}function pe(){ae()}function ge(e){r!==e&&((r=e)?Ee(c.a.BUFFERING_COMPLETED):p=Number.POSITIVE_INFINITY)}function me(){try{var e,t,n=g.getAllBufferRanges(),r=0;if(!n)return r;for(t=0,e=n.length;t1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(r,i){if(N&&e&&s){var a=B.getQualityFor(j,G.id);g=S(O).create({mediaSource:s,textController:U,eventBus:M}),q(e,t,a).then((function(){return fe(K(a))})).then((function(){r(g)})).catch((function(e){n.fatal("Caught error on create SourceBuffer: "+e),P.error(new y.a(E.a.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,E.a.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+j)),i(e)}))}else r(null)}))},getBuffer:function(){return g},getBufferLevel:function(){return i},getRangeAt:ne,setMediaSource:H,getMediaSource:function(){return s},appendInitSegmentFromCache:function(e){var t=N.extract(G.id,e);return!!t&&(n.info("Append Init fragment",j," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),z(t),!0)},getIsBufferingCompleted:function(){return r},setIsBufferingCompleted:ge,getIsPruningInProgress:function(){return I},reset:function(e,t){M.off(c.a.INIT_FRAGMENT_LOADED,V,this),M.off(c.a.MEDIA_FRAGMENT_LOADED,W,this),M.off(c.a.WALLCLOCK_TIME_UPDATED,he,this),M.off(h.a.PLAYBACK_PLAYING,te,this),M.off(h.a.PLAYBACK_PROGRESS,J,this),M.off(h.a.PLAYBACK_TIME_UPDATED,J,this),M.off(h.a.PLAYBACK_RATE_CHANGED,pe,this),M.off(h.a.PLAYBACK_STALLED,ee,this),_e(e,t)},prepareForPlaybackSeek:function(){return r&&ge(!1),g.abort()},prepareForReplacementTrackSwitch:function(e){return new Promise((function(t,n){g.abort().then((function(){return de()})).then((function(){return g.changeType(e)})).then((function(){return $()})).then((function(){ge(!1),t()})).catch((function(e){n(e)}))}))},prepareForNonReplacementTrackSwitch:function(e){return new Promise((function(t,n){de().then((function(){return g.changeType(e)})).then((function(){t()})).catch((function(e){n(e)}))}))},prepareForReplacementQualitySwitch:function(){return new Promise((function(e,t){g.abort().then((function(){return de()})).then((function(){return $()})).then((function(){ge(!1),e()})).catch((function(e){t(e)}))}))},updateAppendWindow:de,getAllRangesWithSafetyFactor:Z,getContinuousBufferTimeForTargetTime:function(e){try{var t=e,n=g.getAllBufferRanges();if(!n||0===n.length)return NaN;for(var r=0;t===e&&r=i&&t<=a&&(t=a),r+=1}return t===e?NaN:t}catch(e){}},clearBuffers:ue,pruneAllSafely:$,updateBufferTimestampOffset:fe,setSeekTarget:function(e){D=e},segmentRequestingCompleted:function(e){isNaN(e)||(p=e,ie())}},n=Object(d.a)(O).getInstance().getLogger(t),N=b(O).getInstance(),_e(),t}I.__dashjs_factory_name="BufferController";var R=f.a.getClassFactory(I);function N(e){e=e||{};var t,n,r,i,a,o,s=this.context,u=Object(l.a)(s).getInstance(),f=e.textController,d=e.errHandler,h=e.streamInfo,p=e.type;function g(e){i=e}function m(e){var t,r,i;n!==e&&((n=e)&&(t=c.a.BUFFERING_COMPLETED,i=r||{},u.trigger(t,i,{streamId:h.id,mediaType:p})))}function _(e){e.chunk.bytes&&!n&&(o.save(e.chunk),a.append(e.chunk),m(!0))}return t={initialize:function(e){g(e)},getStreamId:function(){return h.id},getType:function(){return p},getBufferControllerType:function(){return"NotFragmentedTextBufferController"},createBufferSink:function(e){return new Promise((function(t,n){try{(a=S(s).create({mediaSource:i,textController:f,eventBus:u})).initializeForFirstUse(h,e),r||(a.getBuffer()&&"function"==typeof a.getBuffer().initialize&&a.getBuffer().initialize(),r=!0),t(a)}catch(e){d.error(new y.a(E.a.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,E.a.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+p)),n(e)}}))},getBuffer:function(){return a},getBufferLevel:function(){return 0},getRangeAt:function(){return null},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},setMediaSource:g,getMediaSource:function(){return i},appendInitSegmentFromCache:function(e){return null!==o.extract(h.id,e)},getIsBufferingCompleted:function(){return n},setIsBufferingCompleted:m,getIsPruningInProgress:function(){return!1},reset:function(e){u.off(c.a.INIT_FRAGMENT_LOADED,_,t),!e&&a&&(a.abort(),a.reset(),a=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return n=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},r=!1,i=null,n=!1,o=b(s).getInstance(),u.on(c.a.INIT_FRAGMENT_LOADED,_,t),t}N.__dashjs_factory_name="NotFragmentedTextBufferController";var w=f.a.getClassFactory(N);function C(e){e=e||{};var t,n,r,i,o,s,f,p,g,y,E,_,v,T=this.context,S=Object(l.a)(T).getInstance(),A=e.dashMetrics,b=e.mediaPlayerModel,I=e.fragmentModel,R=e.abrController,N=e.playbackController,w=e.textController,C=e.type,D=e.bufferController,O=e.settings;function M(e){if(!D.getIsBufferingCompleted()){P();var t=isNaN(e)?0:e;s=setTimeout(L,t)}}function P(){s&&(clearTimeout(s),s=null)}function L(){try{if(function(){try{return C===a.a.TEXT&&!w.isTextEnabled()||N.isPaused()&&(!N.getStreamController().getInitialPlayback()||!N.getStreamController().getAutoPlay())&&!O.get().streaming.scheduling.scheduleWhilePaused}catch(e){return!1}}())return void P();if(function(){try{return i&&(isNaN(y)||E||(e=n.id,t=R.getMaxAllowedIndexFor(C,e),!(!isNaN(g)&&g==t||(r.info("Top quality "+C+" index has changed from "+g+" to "+t),g=t,0)))||function(){if(!C||!i)return!0;return A.getCurrentBufferLevel(C)=O.get().streaming.buffer.longFormContentDurationThreshold?O.get().streaming.buffer.bufferTimeAtTopQualityLongForm:O.get().streaming.buffer.bufferTimeAtTopQuality:b.getStableBufferTime()}catch(e){return b.getStableBufferTime()}}():e}function x(){U(!0)}function U(e){if(N&&I){var t=I.getRequests({state:m.a.FRAGMENT_MODEL_EXECUTED,time:N.getTime(),threshold:0})[0];t&&N.getTime()>=t.startTime&&((!p.mediaInfo||t.mediaInfo.type===p.mediaInfo.type&&t.mediaInfo.id!==p.mediaInfo.id)&&e&&S.trigger(c.a.TRACK_CHANGE_RENDERED,{mediaType:C,oldMediaInfo:p.mediaInfo,newMediaInfo:t.mediaInfo,streamId:n.id}),t.quality===p.quality&&t.adaptationIndex===p.adaptationIndex||!e||(r.debug("Quality change rendered for streamId ".concat(n.id," and type ").concat(C)),S.trigger(c.a.QUALITY_CHANGE_RENDERED,{mediaType:C,oldQuality:p.quality,newQuality:t.quality,streamId:n.id})),p={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function B(e){r.debug("Appended bytes for ".concat(e.mediaType," and stream id ").concat(n.id)),(isNaN(e.index)||isNaN(y))&&(y=e.quality,r.info("["+C+"] lastInitializedRepresentationInfo changed to "+e.quality)),M(0)}function k(){I.abortRequests(),P()}function G(){O.get().streaming.scheduling.scheduleWhilePaused||M()}function j(e){A.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function Y(){v=!0,o=0,y=NaN,p={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},g=NaN,E=!1,_=!1}return t={initialize:function(e){f=e,S.on(c.a.BYTES_APPENDED_END_FRAGMENT,B,t),S.on(c.a.URL_RESOLUTION_FAILED,k,t),S.on(h.a.PLAYBACK_STARTED,G,t),S.on(h.a.PLAYBACK_RATE_CHANGED,j,t),S.on(h.a.PLAYBACK_TIME_UPDATED,x,t)},getType:function(){return C},getStreamId:function(){return n.id},setCurrentRepresentation:function(e){i=e},setTimeToLoadDelay:function(e){o=e},getTimeToLoadDelay:function(){return o},setSwitchTrack:function(e){E=e},getSwitchStrack:function(){return E},startScheduleTimer:M,clearScheduleTimer:P,reset:function(){S.off(c.a.BYTES_APPENDED_END_FRAGMENT,B,t),S.off(c.a.URL_RESOLUTION_FAILED,k,t),S.off(h.a.PLAYBACK_STARTED,G,t),S.off(h.a.PLAYBACK_RATE_CHANGED,j,t),S.off(h.a.PLAYBACK_TIME_UPDATED,x,t),P(),U(!1),Y(),n=null},getBufferTarget:F,getPlaybackController:function(){return N},setCheckPlaybackQuality:function(e){v=e},setInitSegmentRequired:function(e){_=e}},r=Object(d.a)(T).getInstance().getLogger(t),Y(),n=e.streamInfo,t}C.__dashjs_factory_name="ScheduleController";var D=f.a.getClassFactory(C),O=n(54),M=n(13),P=n(31),L=n(23),F=n(11),x=n(20);function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var B=function e(){U(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};B.INITIAL_PLAYOUT_START_REASON="initial_playout",B.SEEK_START_REASON="seek",B.RESUME_FROM_PAUSE_START_REASON="resume",B.METRICS_COLLECTION_START_REASON="metrics_collection_start";var k=function e(){U(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};k.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",k.REBUFFERING_REASON="rebuffering",k.USER_REQUEST_STOP_REASON="user_request",k.END_OF_PERIOD_STOP_REASON="end_of_period",k.END_OF_CONTENT_STOP_REASON="end_of_content",k.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",k.FAILURE_STOP_REASON="failure";var G=n(32);function j(e){e=e||{};var t,n,r,i,s,f,h,p,g,_,T,S,A,b=this.context,I=Object(l.a)(b).getInstance(),N=e.streamInfo,C=e.type,U=e.errHandler,B=e.mimeType,j=e.timelineConverter,Y=e.adapter,H=e.manifestModel,K=e.mediaPlayerModel,q=e.fragmentModel,V=e.abrController,W=e.playbackController,z=e.mediaController,X=e.textController,Q=e.dashMetrics,$=e.settings,Z=e.boxParser,J=e.segmentBlacklistController;function ee(){return N.id}function te(){return C}function ne(){return Y.getIsTextTrack(p.getData())}function re(){s=[],i=null,A=0,g=!1,_=!1}function ie(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.sender)if(W.getIsManifestUpdateInProgress())le();else if((!ne()||X.isTextEnabled())&&f&&e.representationId&&!f.appendInitSegmentFromCache(e.representationId)){var n=p.getCurrentRepresentation();if(0===n.range)return void ae();var r=T?T.getInitRequest(i,n):null;r?q.executeRequest(r):t&&(h.setInitSegmentRequired(!0),le())}}function ae(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(W.getIsManifestUpdateInProgress()||f.getIsPruningInProgress())le();else{var n=ue();n?(g=!1,oe(n)):se(t)}}function oe(e){isNaN(e.startTime+e.duration)||(A=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+h.getTimeToLoadDelay(),h.setTimeToLoadDelay(0),!function(e){var t=e.url;e.range&&(t=t.concat("_",e.range));return J.contains(t)}(e)?(n.debug("Next fragment request url for stream id ".concat(N.id," and media type ").concat(C," is ").concat(e.url)),q.executeRequest(e)):(n.warn("Fragment request url ".concat(e.url," for stream id ").concat(N.id," and media type ").concat(C," is on the ignore list and will be skipped")),le())}function se(e){var t,a=p.getCurrentRepresentation();if($.get().streaming.gaps.enableSeekFix&&(g||0===W.getTime())&&(r?r&&a.segmentInfoType===o.a.SEGMENT_TIMELINE&&(t=T.getValidTimeAheadOfTargetTime(A,i,a,$.get().streaming.gaps.threshold)):t=T.getValidTimeCloseToTargetTime(A,i,a,$.get().streaming.gaps.threshold),!isNaN(t)&&t!==A))return void(W.isSeeking()||0===W.getTime()?(n.warn("Adjusting playback time ".concat(t," because of gap in the manifest. Seeking by ").concat(t-A)),W.seek(t,!1,!1)):(n.warn("Adjusting buffering time ".concat(t," because of gap in the manifest. Adjusting time by ").concat(t-A)),Ce(t),e&&le()));if(T.isLastSegmentRequested(a,A)){var s=T.getCurrentIndex();return n.debug("Segment requesting for stream ".concat(N.id," has finished")),I.trigger(c.a.STREAM_REQUESTING_COMPLETED,{segmentIndex:s},{streamId:N.id,mediaType:C}),f.segmentRequestingCompleted(s),void h.clearScheduleTimer()}e&&le()}function ue(){var e,t=Ae();if(isNaN(A)||te()===a.a.TEXT&&!X.isTextEnabled())return null;var n=g;if(T){var r=p&&t?p.getRepresentationForQuality(t.quality):null;e=n?T.getSegmentRequestForTime(i,r,A):T.getNextSegmentRequest(i,r)}return e}function le(){h.startScheduleTimer($.get().streaming.lowLatencyEnabled?$.get().streaming.scheduling.lowLatencyTimeout:$.get().streaming.scheduling.defaultTimeout)}function ce(e){e.error||(h.setCurrentRepresentation(Y.convertRepresentationToRepresentationInfo(e.currentRepresentation)),f.getIsBufferingCompleted()||f.updateBufferTimestampOffset(e.currentRepresentation))}function fe(e){Q.addBufferState(C,e.state,h.getBufferTarget()),e.state!==u.BUFFER_EMPTY||W.isSeeking()||(n.info("Buffer is empty! Stalling!"),Q.pushPlayListTraceMetrics(new Date,k.REBUFFERING_REASON))}function de(e){q.syncExecutedRequestsWithBufferedRange(f.getBuffer().getAllBufferRanges(),N.duration),e.quotaExceeded&&e.from>W.getTime()&&Ce(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&h.startScheduleTimer()}function he(e){if(e&&e.lastRequestAppended&&e.lastRequestAppended.url){var t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),n.warn("Blacklisting segment with url ".concat(t)),J.add(t)}}function pe(){Ne(),_=!1}function ge(e){n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),W.isSeeking()||h.getSwitchStrack()||_||(n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?h.setInitSegmentRequired(!0):Ce(e.request.startTime+e.request.duration/2),h.startScheduleTimer(0))}function me(e){n.info("OnFragmentLoadingCompleted for stream id "+N.id+" and media type "+C+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),ne()&&h.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){if(n.info("Fragment loading completed with an error"),!e||!e.request||!e.request.type)return;e.request.type===v.a.INIT_SEGMENT_TYPE?ie({representationId:e.request.representationId,sender:{}},!1):e.request.type===v.a.MEDIA_SEGMENT_TYPE&&(Ce(e.request.startTime+e.request.duration/2),ae({},!1))}(e)}function ye(){Ce(W.getTime()),Se().startScheduleTimer()}function Ee(e){var t=e.currentTrackInfo;if(t){var n=s.find((function(e){return e.index===t.index&&e.lang===t.lang}));n&&Te(n).then((function(){f.setIsBufferingCompleted(!1),Ce(W.getTime()),h.setInitSegmentRequired(!0),h.startScheduleTimer()}))}}function _e(e){Ce(e.quotaExceededTime),h.clearScheduleTimer()}function ve(){return f?f.getBuffer():null}function Te(e){e===i||e&&i&&e.type!==i.type||(i=e);var t=Y.getRealAdaptation(N,i),n=Y.getVoRepresentations(i);if(p){var o,s=p.getData(),u=V.getMaxAllowedIndexFor(C,N.id),l=V.getMinAllowedIndexFor(C,N.id),c=null;return null!==s&&s.id===t.id||C===a.a.TEXT?o=V.getQualityFor(C,N.id):(c=V.getThroughputHistory().getAverageThroughput(C,r)||V.getInitialBitrateFor(C,N.id),o=V.getQualityForBitrate(i,c,N.id)),void 0!==l&&ou&&(o=u),p.updateData(t,n,C,i.isFragmented,o)}return Promise.resolve()}function Se(){return h}function Ae(e){var t;return void 0!==e?(Object(M.a)(e),t=p?p.getRepresentationForQuality(e):null):t=p?p.getCurrentRepresentation():null,Y.convertRepresentationToRepresentationInfo(t)}function be(){return!!f&&f.getIsBufferingCompleted()}function Ie(e){var t=e.chunk,n=t.bytes,r=t.quality,i=Ae(r),a=p&&i?p.getRepresentationForQuality(i.quality):null;if(i&&a){var o=Y.getEventsFor(i.mediaInfo),s=Y.getEventsFor(i,a);if(o&&o.length>0||s&&s.length>0){var u=function(e,t,n,r){try{for(var i={},a=[],o=n.concat(r),s=0,u=o.length;s$.get().streaming.buffer.stallThreshold;if(f.getIsBufferingCompleted()&&!t)return f.prepareForNonReplacementTrackSwitch(i.codec).then((function(){I.trigger(c.a.BUFFERING_COMPLETED,{},{streamId:N.id,mediaType:C})})).catch((function(){I.trigger(c.a.BUFFERING_COMPLETED,{},{streamId:N.id,mediaType:C})})),void e();h.clearScheduleTimer(),h.setSwitchTrack(!0),t?(I.trigger(c.a.BUFFER_REPLACEMENT_STARTED,{mediaType:C,streamId:N.id},{mediaType:C,streamId:N.id}),q.abortRequests(),f.prepareForReplacementTrackSwitch(i.codec).then((function(){var e=Ae();return f.updateBufferTimestampOffset(e)})).then((function(){Re(),e()})).catch((function(){Re(),e()}))):f.prepareForNonReplacementTrackSwitch(i.codec).then((function(){Ne(),e()})).catch((function(){Ne(),e()}))}))},prepareQualityChange:function(e){n.debug("Preparing quality switch for type ".concat(C));var t=e.newQuality;_=!0,h.clearScheduleTimer();var r=Ae(t);h.setCurrentRepresentation(r),p.prepareQualityChange(t),q.abortRequests(),f.updateBufferTimestampOffset(r).then((function(){e.reason&&e.reason.forceReplace?(I.trigger(c.a.BUFFER_REPLACEMENT_STARTED,{mediaType:C,streamId:N.id},{mediaType:C,streamId:N.id}),f.prepareForReplacementQualitySwitch().then((function(){Re(),_=!1})).catch((function(){Re(),_=!1}))):$.get().streaming.buffer.fastSwitchEnabled?function(e){var t=W.getTime(),n=q.getRequests({state:m.a.FRAGMENT_MODEL_EXECUTED,time:t+1.5,threshold:0})[0];if(n&&!ne()){var r=f.getBufferLevel(),i=V.getAbandonmentStateFor(N.id,C);if(n.quality=1.5&&i!==u.ABANDON_LOAD)Ce(t+1.5),h.setCheckPlaybackQuality(!1),h.startScheduleTimer();else pe()}else h.startScheduleTimer();_=!1}(r):pe(),Q.pushPlayListTraceMetrics(new Date,k.REPRESENTATION_SWITCH_STOP_REASON),Q.createPlaylistTraceMetrics(r.id,1e3*W.getTime(),W.getPlaybackRate())}))},getMediaInfo:function(){return i},getMediaSource:function(){return f.getMediaSource()},setMediaSource:function(e){f.setMediaSource(e)},getBuffer:ve,setExplicitBufferingTime:Ce,finalisePlayList:function(e,t){Q.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=Ae(),t=p&&e?p.getRepresentationForQuality(e.quality):null;return T.getNextSegmentRequestIdempotent(i,t)},prepareInnerPeriodPlaybackSeeking:function(e){return new Promise((function(t){h.clearScheduleTimer(),q.abortRequests(),f.prepareForPlaybackSeek().then((function(){var t=f.getAllRangesWithSafetyFactor(e.seekTime);return f.clearBuffers(t)})).then((function(){var n=f.getContinuousBufferTimeForTargetTime(e.seekTime);if(!isNaN(n)&&!isNaN(N.duration)&&isFinite(N.duration)&&n>=N.start+N.duration)f.setIsBufferingCompleted(!0),t();else{var r=isNaN(n)?e.seekTime:n;Ce(r),f.setSeekTarget(r);var i=[];i.push(f.updateAppendWindow());var a=Ae();i.push(f.updateBufferTimestampOffset(a)),Promise.all(i).then((function(){h.setInitSegmentRequired(!0),h.setCheckPlaybackQuality(!1),h.startScheduleTimer(),t()}))}})).catch((function(e){n.error(e)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((function(e,t){try{h.clearScheduleTimer(),q.abortRequests(),f.prepareForPlaybackSeek().then((function(){return f.pruneAllSafely()})).then((function(){e()}))}catch(e){t(e)}}))},reset:function(e,n){T&&T.reset(),f&&(f.reset(e,n),f=null),h&&(h.reset(),h=null),p&&(p.reset(),p=null),S&&(S=null),V&&V.unRegisterStreamType(ee(),C),I.off(c.a.DATA_UPDATE_COMPLETED,ce,t),I.off(c.a.INIT_FRAGMENT_NEEDED,ie,t),I.off(c.a.MEDIA_FRAGMENT_NEEDED,ae,t),I.off(c.a.MEDIA_FRAGMENT_LOADED,Ie,t),I.off(c.a.BUFFER_LEVEL_STATE_CHANGED,fe,t),I.off(c.a.BUFFER_CLEARED,de,t),I.off(c.a.SEEK_TARGET,we,t),I.off(c.a.FRAGMENT_LOADING_ABANDONED,ge,t),I.off(c.a.FRAGMENT_LOADING_COMPLETED,me,t),I.off(c.a.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ye,t),I.off(c.a.SET_NON_FRAGMENTED_TEXT,Ee,t),I.off(c.a.QUOTA_EXCEEDED,_e,t),I.off(c.a.SOURCE_BUFFER_ERROR,he,t),re(),C=null,N=null}},n=Object(d.a)(b).getInstance().getLogger(t),re(),I.on(c.a.DATA_UPDATE_COMPLETED,ce,t,{priority:l.a.EVENT_PRIORITY_HIGH}),I.on(c.a.INIT_FRAGMENT_NEEDED,ie,t),I.on(c.a.MEDIA_FRAGMENT_NEEDED,ae,t),I.on(c.a.MEDIA_FRAGMENT_LOADED,Ie,t),I.on(c.a.BUFFER_LEVEL_STATE_CHANGED,fe,t),I.on(c.a.BUFFER_CLEARED,de,t),I.on(c.a.SEEK_TARGET,we,t),I.on(c.a.FRAGMENT_LOADING_ABANDONED,ge,t),I.on(c.a.FRAGMENT_LOADING_COMPLETED,me,t),I.on(c.a.QUOTA_EXCEEDED,_e,t),I.on(c.a.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ye,t),I.on(c.a.SET_NON_FRAGMENTED_TEXT,Ee,t),I.on(c.a.SOURCE_BUFFER_ERROR,he,t),t}j.__dashjs_factory_name="StreamProcessor";var Y=f.a.getClassFactory(j),H=n(55),K=n(58);function q(e){e=e||{};var t,n,r,i=this.context,o=Object(l.a)(i).getInstance(),s=e.errHandler,u=e.mediaPlayerModel,f=e.dashMetrics,p=Object(d.a)(i).getInstance(),g=e.streamInfo;function y(){return g.id}function _(){for(var e in r)r[e].reset();r={}}function v(e){if(e.sender){var t=e.request,r=e.response,i=t.isInitializationRequest(),s=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===a.a.AUDIO||t.mediaType===a.a.VIDEO||t.mediaType===a.a.TEXT&&t.mediaInfo.isFragmented)&&o.trigger(c.a.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation}),r&&s){var u=function(e,t,n,r){var i=new H.a;return i.streamId=n,i.mediaInfo=t.mediaInfo,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.quality=t.quality,i.representationId=t.representationId,i.endFragment=r,i}(r,t,g.id,e.type!==c.a.FRAGMENT_LOADING_PROGRESS);o.trigger(i?c.a.INIT_FRAGMENT_LOADED:c.a.MEDIA_FRAGMENT_LOADED,{chunk:u,request:t},{streamId:s.id,mediaType:t.mediaType})}else n.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getStreamId:y,getModel:function(t){var n=r[t];return n||(n=Object(m.a)(i).create({streamInfo:g,type:t,dashMetrics:f,fragmentLoader:Object(K.a)(i).create({dashMetrics:f,mediaPlayerModel:u,errHandler:s,requestModifier:Object(L.a)(i).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:o,events:c.a,errors:E.a,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:y()}),debug:p,eventBus:o,events:c.a}),r[t]=n),n},reset:function(){o.off(h.a.FRAGMENT_LOADING_COMPLETED,v,this),o.off(h.a.FRAGMENT_LOADING_PROGRESS,v,this),_()}},n=p.getLogger(t),_(),o.on(h.a.FRAGMENT_LOADING_COMPLETED,v,t),o.on(h.a.FRAGMENT_LOADING_PROGRESS,v,t),t}q.__dashjs_factory_name="FragmentController";var V=f.a.getClassFactory(q);var W=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null},z=n(29);var X=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN},Q=n(10);function $(e){var t,n,r=this.context,i=e.streamInfo;function o(e){n.setTrackByIndex(e)}function s(){n&&n.reset()}return t={getStreamId:function(){return i.id},initialize:function(){n.addTracks();var e=n.getTracks();e&&e.length>0&&o(0)},provide:function(e,t){if("function"==typeof t){var r,i,a=n.getCurrentTrack();if(!a||a.segmentDuration<=0||null==e)t(null);else{(i=n.getThumbnailRequestForTime(e))&&(a.segmentDuration=i.duration),r=e%a.segmentDuration;var o=Math.floor(r*a.tilesHor*a.tilesVert/a.segmentDuration),s=new W;if(s.width=Math.floor(a.widthPerTile),s.height=Math.floor(a.heightPerTile),s.x=Math.floor(o%a.tilesHor)*a.widthPerTile,s.y=Math.floor(o/a.tilesHor)*a.heightPerTile,"readThumbnail"in a)return a.readThumbnail(e,(function(e){s.url=e,t(s)}));if(i)s.url=i.url,a.segmentDuration=NaN;else{var u=Math.floor(e/a.segmentDuration);s.url=function(e,t){var n=t+e.startNumber,r=Object(Q.d)(e.templateUrl,"Number",n);return r=Object(Q.d)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=Object(Q.d)(r,"Bandwidth",e.bandwidth),Object(Q.e)(r)}(a,u)}t(s)}}},setTrackByIndex:o,getCurrentTrackIndex:function(){return n.getCurrentTrackIndex()},getBitrateList:function(){var e=n.getTracks(),t=0;return e.map((function(e){var n=new X;return n.mediaType=a.a.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:s},s(),n=Object(z.b)(r).create({streamInfo:i,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),t}$.__dashjs_factory_name="ThumbnailController";var Z=f.a.getClassFactory($);function J(e){var t;e=e||{};var n=[],r=Object(l.a)(this.context).getInstance(),i=e.updateEventName,a=e.addBlacklistEventName;function o(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(i,{entry:e}))}function s(e){o(e.entry)}return t={add:o,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},a&&r.on(a,s,t),t}J.__dashjs_factory_name="BlackListController";var ee=f.a.getClassFactory(J),te=[a.a.VIDEO,a.a.AUDIO,a.a.TEXT,a.a.MUXED,a.a.IMAGE];function ne(e){e=e||{};var t,n,r,i,s,u,f,h,p,g,m,_,v,T,S,A,b,I,R=this.context,N=Object(l.a)(R).getInstance(),w=Object(F.a)(R).getInstance(),C=e.manifestModel,D=e.mediaPlayerModel,O=e.dashMetrics,M=e.manifestUpdater,P=e.adapter,L=e.timelineConverter,U=e.capabilities,B=e.errHandler,k=e.abrController,G=e.playbackController,j=e.eventController,H=e.mediaController,K=e.protectionController,q=e.textController,W=e.videoModel,z=e.streamInfo,X=e.settings;function Q(t,i){return new Promise((function(s,u){se(),g=!0,le();var l,d=W.getElement();te.forEach((function(i){(i!==a.a.VIDEO||!d||d&&/^VIDEO$/i.test(d.nodeName))&&function(t,i){var s,u=P.getAllMediaInfoForType(z,t),l=[],d=null;if(!u||0===u.length)return void n.info("No "+t+" data.");t===a.a.VIDEO&&(f=!0);t===a.a.AUDIO&&(h=!0);for(var p=0,g=u.length;p0&&(H.setInitialMediaSettingsForType(t,z),q.setInitialSettings(H.getInitialSettings(t)),q.addMediaInfosToBuffer(z,t,l));if(0===(u=u.filter((function(e){return!e.isEmbedded}))).length)return;if(t===a.a.IMAGE)return void(_=Z(R).create({streamInfo:z,adapter:P,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:A,eventBus:N,events:c.a,dashConstants:o.a,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController})).initialize();N.trigger(c.a.STREAM_INITIALIZING,{streamInfo:z,mediaInfo:d}),H.setInitialMediaSettingsForType(t,z);var y=function(t,n){var i=t&&t.length>0?t[0]:null,o=m.getModel(i?i.type:null),s=i?i.type:null,u=i?i.mimeType:null,l=i?i.isFragmented:null,c=Y(R).create({streamInfo:z,type:s,mimeType:u,timelineConverter:L,adapter:P,manifestModel:C,mediaPlayerModel:D,fragmentModel:o,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:k,playbackController:G,mediaController:H,textController:q,errHandler:B,settings:X,boxParser:S,segmentBlacklistController:v});c.initialize(n,f,l),r.push(c);for(var d=0;d0&&e.Representation[0].ContentProtection)}function _e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():oe();if(!r||!i)return!1;var a=P.getAdaptationForType(r.index,t,r),o=P.getAdaptationForType(i.index,t,i);if(!a||!o)return!a&&!o;var s=a&&o&&a.mimeType===o.mimeType,u=o.Representation_asArray.map((function(e){return e.codecs})),l=a.Representation_asArray.map((function(e){return e.codecs})),c=l.some((function(e){return u.indexOf(e)>-1})),f=l.some((function(e){return u.some((function(t){return U.codecRootCompatibleWithCodec(t,e)}))}));return c||f&&s}function ve(e){T=e}function Te(){return T}return t={initialize:function(){N.on(c.a.BUFFERING_COMPLETED,fe,t),N.on(c.a.DATA_UPDATE_COMPLETED,de,t),N.on(c.a.INBAND_EVENTS,he,t),K&&(N.on(c.a.KEY_ERROR,ue,t),N.on(c.a.SERVER_CERTIFICATE_UPDATED,ue,t),N.on(c.a.LICENSE_REQUEST_COMPLETE,ue,t),N.on(c.a.KEY_SYSTEM_SELECTED,ue,t),N.on(c.a.KEY_SESSION_CREATED,ue,t),N.on(c.a.KEY_STATUSES_CHANGED,ue,t)),q.initializeForStream(z),N.trigger(c.a.STREAM_UPDATED,{streamInfo:z})},getStreamId:function(){return z?z.id:null},activate:function(e,t){return new Promise((function(n,r){if(!s)return Te()?(s=!0,N.trigger(c.a.STREAM_ACTIVATED,{streamInfo:z}),void n(t)):void function(e,t){return Q(e,t)}(e,t).then((function(e){s=!0,N.trigger(c.a.STREAM_ACTIVATED,{streamInfo:z}),n(e)})).catch((function(e){r(e)}));n(t)}))},deactivate:J,getIsActive:function(){return s},getDuration:function(){return z?z.duration:NaN},getStartTime:ie,getId:ae,getStreamInfo:oe,getHasAudioTrack:function(){return h},getHasVideoTrack:function(){return f},startPreloading:function(e,t){return new Promise((function(i,a){Te()?a():(n.info("[startPreloading] Preloading next stream with id ".concat(ae())),ve(!0),Q(e,t).then((function(){for(var e=0;e0;){var e=I.pop(),t=e.newMediaInfo,r=pe(e.oldMediaInfo);if(!r)return;n.push(r.prepareTrackSwitch()),r.selectMediaInfo(t)}return Promise.all(n)})).then((function(){g=!1,ce(),N.trigger(c.a.STREAM_UPDATED,{streamInfo:z}),t()}))}))},reset:function(e){m&&(m.reset(),m=null),k&&z&&k.clearDataForStream(z.id),v&&(v.reset(),v=null),ne(e),z=null,N.off(c.a.DATA_UPDATE_COMPLETED,de,t),N.off(c.a.BUFFERING_COMPLETED,fe,t),N.off(c.a.INBAND_EVENTS,he,t),K&&(N.off(c.a.KEY_ERROR,ue,t),N.off(c.a.SERVER_CERTIFICATE_UPDATED,ue,t),N.off(c.a.LICENSE_REQUEST_COMPLETE,ue,t),N.off(c.a.KEY_SYSTEM_SELECTED,ue,t),N.off(c.a.KEY_SESSION_CREATED,ue,t),N.off(c.a.KEY_STATUSES_CHANGED,ue,t))},getProcessors:me,setMediaSource:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:null;return _e(e,a.a.VIDEO,t)&&_e(e,a.a.AUDIO,t)},isProtectionCompatible:function(e){return!e||ye(a.a.VIDEO,e)&&ye(a.a.AUDIO,e)},getPreloaded:Te,getIsEndedEventSignaled:function(){return b},setIsEndedEventSignaled:re,getAdapter:function(){return P},getHasFinishedBuffering:function(){return u},setPreloaded:ve,startScheduleControllers:function(){for(var e=r.length,t=0;t0&&void 0!==arguments[0]&&arguments[0];s=!0;var t=f.getValue(),n=t.url,r=p.getPatchLocation(t),i=p.getLocation(t);r&&!e?n=r:i&&(n=i),v.isRelative(n)&&(n=v.resolve(n,t.url)),u.load(n)}function I(e){if(e){if(p.getIsPatch(e)){var r=e;e=f.getValue();var u=p.isPatchValid(e,r),l=u;if(u){var d=p.getPublishTime(e);l=p.applyPatchToManifest(e,r);var h=p.getPublishTime(e);l=d.getTime()!=h.getTime()}if(!l)return t.debug("Patch provided is invalid, performing full manifest refresh"),void b(!0);e.loadedTime=new Date}}else(e=f.getValue()).loadedTime=new Date;if(f.getValue()&&f.getValue().type===o.a.DYNAMIC&&e.type===o.a.STATIC)return _.trigger(c.a.DYNAMIC_TO_STATIC),s=!1,void(a=!0);f.setValue(e);var g=new Date,m=(g.getTime()-e.loadedTime.getTime())/1e3;1e3*(n=p.getManifestUpdatePeriod(e,m))>2147483647&&(n=2147483.647),_.trigger(c.a.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+g+"["+g.getTime()/1e3+"] "),i||A()}function R(){i||(s?A(m.get().streaming.manifestUpdateRetryInterval):b())}function N(e){e.error?e.error.code===E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&g.error(e.error):I(e.manifest)}function w(){i=!1,A()}function C(){(i=!m.get().streaming.scheduling.scheduleWhilePaused)&&S()}function D(){s=!1}return e={initialize:function(){T(),_.on(c.a.STREAMS_COMPOSED,D,this),_.on(h.a.PLAYBACK_STARTED,w,this),_.on(h.a.PLAYBACK_PAUSED,C,this),_.on(c.a.INTERNAL_MANIFEST_LOADED,N,this)},setManifest:function(e){I(e)},refreshManifest:b,getIsUpdating:function(){return s},setConfig:function(e){e&&(e.manifestModel&&(f=e.manifestModel),e.adapter&&(p=e.adapter),e.manifestLoader&&(u=e.manifestLoader),e.errHandler&&(g=e.errHandler),e.settings&&(m=e.settings))},reset:function(){_.off(h.a.PLAYBACK_STARTED,w,this),_.off(h.a.PLAYBACK_PAUSED,C,this),_.off(c.a.STREAMS_COMPOSED,D,this),_.off(c.a.INTERNAL_MANIFEST_LOADED,N,this),T()}},t=Object(d.a)(y).getInstance().getLogger(e),e}ie.__dashjs_factory_name="ManifestUpdater";var ae=f.a.getClassFactory(ie);function oe(){var e,t,n,r,i,a,o,s,u,f,h,p,g,m,_,T,S=this.context,A=Object(l.a)(S).getInstance(),b=Object(F.a)(S).getInstance();function I(){s=[],u=[],f=null,h=null,g=null,p=NaN,n=!1,r=!1,m=i.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function R(){i.get().streaming.utcSynchronization.enabled&&!n&&!r&&g&&g.value&&g.schemeIdUri&&!isNaN(p)&&!isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)&&(h&&(Date.now()-h)/1e3<30||(s=[],r=!0,function e(t){try{if(t<=0)return void k();var n=Date.now();a[g.schemeIdUri](g.value,(function(r){var i=Date.now(),a=N(n,i,r);s.push(a),e(t-1)}),(function(){k()}))}catch(e){k()}}(isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)?2:i.get().streaming.utcSynchronization.backgroundAttempts)))}function N(e,t,n){return n-(t-(t-e)/2)}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&i.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?U():B(t,e)}function C(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t,n,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function D(e){return Date.parse(e)}function O(e){return Date.parse(e)}function M(e,t,n){n()}function P(e,t,n){var r=C(e);isNaN(r)?n():t(r)}function L(e,t,n,r,i){var a,o,s=!1,u=new XMLHttpRequest,l=i?v.a.HEAD:v.a.GET,c=t.match(/\S+/g);if(t=c.shift(),a=function(){s||(s=!0,c.length?L(e,c.join(" "),n,r,i):r())},o=function(){var t,r;200===u.status&&(t=i?u.getResponseHeader("Date"):u.response,r=e(t),isNaN(r)||(n(r),s=!0))},b.isRelative(t)){var f=T.resolve();f&&(t=b.resolve(t,f.url))}u.open(l,t),u.timeout=5e3,u.onload=o,u.onloadend=a,u.send()}function x(e,t,n){L(O,e,t,n,!0)}function U(){var e=o.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?B(!0):B(!1,t-Date.now())}function B(e,r){if(isNaN(p)||isNaN(r)||e||function(e){try{var n,r=G(e),a=isNaN(m)?30:m,o=isNaN(i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,s=isNaN(i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,u=isNaN(i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;r?(n=Math.min(a*o,s),t.debug("Increasing timeBetweenSyncAttempts to ".concat(n))):(n=Math.max(a/o,u),t.debug("Decreasing timeBetweenSyncAttempts to ".concat(n))),m=n}catch(e){}}(r),!e&&!isNaN(r)){f=Date.now(),n=!1;var a=isNaN(p);p=r,a&&R(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(r))}e&&(g=null,n=!1,_.error(new y.a(E.a.TIME_SYNC_FAILED_ERROR_CODE,E.a.TIME_SYNC_FAILED_ERROR_MESSAGE))),A.trigger(c.a.UPDATE_TIME_SYNC_OFFSET,{offset:r}),A.trigger(c.a.TIME_SYNCHRONIZATION_COMPLETED)}function k(){if(s&&0!==s.length){var e=s.reduce((function(e,t){return e+t}),0)/s.length;G(e)?t.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(t.debug("Completed background UTC sync. Setting client - server offset to ".concat(e)),p=e,A.trigger(c.a.UPDATE_TIME_SYNC_OFFSET,{offset:p})),r=!1,h=Date.now()}}function G(e){try{if(isNaN(p))return!0;var t=i.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(i.get().streaming.utcSynchronization.maximumAllowedDrift)?i.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=p-t&&e<=p+t}catch(e){return!0}}return e={initialize:function(){I(),a={"urn:mpeg:dash:utc:http-head:2014":x,"urn:mpeg:dash:utc:http-xsdate:2014":L.bind(null,C),"urn:mpeg:dash:utc:http-iso:2014":L.bind(null,D),"urn:mpeg:dash:utc:direct:2014":P,"urn:mpeg:dash:utc:http-head:2012":x,"urn:mpeg:dash:utc:http-xsdate:2012":L.bind(null,C),"urn:mpeg:dash:utc:http-iso:2012":L.bind(null,D),"urn:mpeg:dash:utc:direct:2012":P,"urn:mpeg:dash:utc:http-ntp:2014":M,"urn:mpeg:dash:utc:ntp:2014":M,"urn:mpeg:dash:utc:sntp:2014":M}},attemptSync:function(e,t){u=e,n||(!function(e){try{if(!e||!i.get().streaming.utcSynchronization.enabled)return!1;var t=isNaN(m)?30:m;return!(f&&t&&!isNaN(t))||(Date.now()-f)/1e3>=t}catch(e){return!0}}(t)?A.trigger(c.a.TIME_SYNCHRONIZATION_COMPLETED):(n=!0,function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=t||0;if(!u||0===u.length||n>=u.length)return void w();var r=u[n];if(r)if(a.hasOwnProperty(r.schemeIdUri)){var i=(new Date).getTime();a[r.schemeIdUri](r.value,(function(e){var t=(new Date).getTime(),n=N(i,t,e);g=r,w(n)}),(function(){e(n+1)}))}else e(n+1);else w()}()))},setConfig:function(e){e&&(e.dashMetrics&&(o=e.dashMetrics),e.baseURLController&&(T=e.baseURLController),e.errHandler&&(_=e.errHandler),e.settings&&(i=e.settings))},reset:function(){I(),A.off(c.a.ATTEMPT_BACKGROUND_SYNC,R,e)}},t=Object(d.a)(S).getInstance().getLogger(e),A.on(c.a.ATTEMPT_BACKGROUND_SYNC,R,e),e}oe.__dashjs_factory_name="TimeSyncController";var se=f.a.getSingletonFactory(oe);se.HTTP_TIMEOUT_MS=5e3,f.a.updateSingletonFactory(oe.__dashjs_factory_name,se);var ue=se;function le(){var e,t,n,r=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?t=new MediaSource:e&&(t=new WebKitMediaSource),t},attachMediaSource:function(e){var n=window.URL.createObjectURL(t);return e.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(r){t&&"open"===t.readyState&&(null===r&&isNaN(r)||t.duration!==r&&(!function(e){for(var t=e.sourceBuffers,n=0;n=0&&e2&&void 0!==arguments[2]&&arguments[2],r=e.eventStream.schemeIdUri,i=e.eventStream.value,a=e.id,o=p;t[r]||(t[r]=[]);var s=t[r].findIndex((function(e){return(!i||e.eventStream.value&&e.eventStream.value===i)&&e.id===a}));return-1===s?(t[r].push(e),o=m):n&&(t[r][s]=e,o=g),o}function A(e){try{if(1==e.eventStream.value){var t,n=e.calculatedPresentationTime;t=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,E.trigger(h.a.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:n,newDuration:t,newManifestValidAfter:NaN},{mode:h.a.EVENT_MODE_ON_START})}}catch(e){}}function b(){try{if(!c){c=!0;var e=s.getTime(),t=e-a;t=a>0?Math.max(0,t):0,I(r,t,e),I(n,t,e),a=e,c=!1}}catch(e){c=!1}}function I(e,n,r){try{N(e,(function(i){if(void 0!==i){var a=isNaN(i.duration)?0:i.duration;i.calculatedPresentationTime<=r&&i.calculatedPresentationTime+n+a>=r?w(i,e,h.a.EVENT_MODE_ON_START):(function(e,t,n){try{return e-t>n}catch(e){return!1}}(r,a+n,i.calculatedPresentationTime)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return!1}}(i))&&(t.debug("Deleting event ".concat(i.id," as it is expired or invalid")),C(e,i))}}))}catch(e){}}function R(e){try{var t=s.getTime();N(e,(function(n){var r=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.duration)?n.eventStream.period.duration:NaN,i=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.start)?n.eventStream.period.start:NaN;if(!isNaN(r)&&!isNaN(i)){var a=n.calculatedPresentationTime;Math.abs(a-t)<300&&w(n,e,h.a.EVENT_MODE_ON_START)}}))}catch(e){}}function N(e,t){try{if(e)for(var n=Object.keys(e),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&p.updateManifestUpdateInfo({currentTime:K.getTime(),buffered:H.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:C.getClientTimeOffset()}),D.length>0&&function(e){if(0===e.length)return void t.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.");D=D.filter((function(n){var r=e.filter((function(e){return e.id===n.getId()})).length>0||n.getId()===O.getId();return r||(t.debug("Removing stream ".concat(n.getId())),n.reset(!0)),r}))}(e);for(var n=[],r=0,i=e.length;r0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=f.convertRepresentationToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,ge(i))}return isFinite(n)?n:NaN}catch(e){return NaN}}(n,o);K.computeAndSetLiveDelay(s,o)}var u=function(){var e;if(f.getIsDynamic()){var n=p.getCurrentDVRInfo(),r=n&&n.range?n.range.end:0;e=r-K.getLiveDelay();var i=n?n.range:null;if(i){var a=xe(!0);if(!isNaN(a)){t.info("Start time from URI parameters: "+a);var o=Z.get().streaming.timeShiftBuffer.calcFromSegmentTimeline?.1:0;e=Math.max(Math.min(e,a),i.start+o)}}}else{var s=Qe()[0].getStreamInfo();e=s.start;var u=xe(!1);isNaN(u)||(t.info("Start time from URI parameters: "+u),e=Math.max(e,u))}return e}(),l=Ae(u),d=null!==l?l:D[0];ie.trigger(c.a.INITIAL_STREAM_SWITCH,{startTime:u}),fe(d,null,u),z||(z=setInterval((function(){!U&&K.getTimeToStreamEnd()<=0&&!K.isSeeking()&&ie.trigger(c.a.PLAYBACK_ENDED,{isLast:He().isLast})}),200))}(e),ie.trigger(c.a.STREAMS_COMPOSED),Oe()})).catch((function(e){throw e}))}catch(e){w.error(new y.a(E.a.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+" nostreamscomposed",s.getValue())),j=!0,ze()}}()}function se(){J=!0}function le(e){var t=Ke(e.id);return t?t.updateData(e):(t=re(ne).create({manifestModel:s,mediaPlayerModel:q,dashMetrics:p,manifestUpdater:i,adapter:f,timelineConverter:C,capabilities:n,capabilitiesFilter:r,errHandler:w,baseURLController:_,segmentBaseController:v,textController:P,abrController:S,playbackController:K,eventController:I,mediaController:A,protectionController:M,videoModel:H,streamInfo:e,settings:Z}),D.push(t),t.initialize(),Promise.resolve())}function fe(e,n,r){try{if(U||!e||n===e&&e.getIsActive())return;U=!0,ie.trigger(c.a.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var i=!1;O=e,n&&(i=Te(e,n),n.deactivate(i)),r=isNaN(r)?!i&&n?e.getStreamInfo().start:NaN:r,t.info("Switch to stream ".concat(e.getId(),". Seektime is ").concat(r,", current playback time is ").concat(K.getTime(),". Seamless period switch is set to ").concat(i)),Q=Q.filter((function(e){return e.getId()!==O.getId()})),K.initialize(He(),!!n),H.getElement()&&de(r,i)}catch(e){U=!1}}function de(e,n){var r;function i(){if(Y&&"open"===Y.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(r),Y.removeEventListener("sourceopen",i),Y.removeEventListener("webkitsourceopen",i),Fe();var a=p.getCurrentDVRInfo();g.setSeekable(a.range.start,a.range.end),me(e,n)}}function a(){Y.addEventListener("sourceopen",i,!1),Y.addEventListener("webkitsourceopen",i,!1),r=g.attachMediaSource(H),t.debug("MediaSource attached to element. Waiting on open...")}Y?n?me(e,n):(g.detachMediaSource(H),a()):(Y=g.createMediaSource(),a())}function me(e,t){O.activate(Y,t?X:void 0,e).then((function(t){if(t){var n=Object.keys(t);n.length>0&&t[n[0]].getBuffer().changeType&&($=!0),X=t}isNaN(e)||(ie.trigger(c.a.SEEK_TARGET,{time:e},{streamId:O.getId()}),K.seek(e,!1,!0),O.startScheduleControllers()),U=!1,ie.trigger(c.a.PERIOD_SWITCH_COMPLETED,{toStreamInfo:He()})}))}function ye(e){var t=K.getTime(),n=e.seekTime,r=Ae(n);r&&r!==O?r&&r!==O&&(Ee(t,n,r),function(e,t){var n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=O.getProcessors().map((function(t){return t.prepareOuterPeriodPlaybackSeeking(e)}));Promise.all(r).then((function(){fe(t,O,n)})).catch((function(e){w.error(e)}))}(e,r)):(Ee(t,n),function(e){O.getProcessors().forEach((function(t){return t.prepareInnerPeriodPlaybackSeeking(e)})),Ge(k.USER_REQUEST_STOP_REASON)}(e)),je(B.SEEK_START_REASON)}function Ee(e,t){_e()}function _e(){Q&&Q.length>0&&(Q.forEach((function(e){e.deactivate(!0)})),Q=[])}function ve(e){e.newMediaInfo.streamInfo.id===O.getId()&&(_e(),O.prepareTrackChange(e))}function Te(e,t){try{return Z.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||J)&&($||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function Se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(Y&&!e.getPreloaded()){var n=Te(e,t);n&&e.startPreloading(Y,X).then((function(){Q.push(e)}))}}function Ae(e){if(isNaN(e))return null;for(var t=D.length,n=0;nK.getLiveDelay())&&(W=!1,je(B.INITIAL_PLAYOUT_START_REASON),K.play())}e&&e.mediaType&&p.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Re(e){e.streamInfo.id===O.getId()&&e.reason&&e.reason.forceReplace&&_e(),Ke(e.streamInfo.id).prepareQualityChange(e)}function Ne(){if(Be()){var e=H.getPlaybackQuality();e&&p.addDroppedFrames(e)}}function we(){t.debug("[onPlaybackStarted]"),!W&&V&&je(B.RESUME_FROM_PAUSE_START_REASON),W&&(W=!1),V=!1}function Ce(e){t.debug("[onPlaybackPaused]"),e.ended||(V=!0,Ge(k.USER_REQUEST_STOP_REASON))}function De(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var n=e.streamInfo.isLast;Y&&n?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),g.signalEndOfStream(Y)):Oe()}function Oe(){if(O&&O.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||(O||null);if(t){var n=t.getStreamInfo();return D.filter((function(e){var t=e.getStreamInfo();return t.start>n.start&&n.id!==t.id}))}}catch(e){return[]}}(O),t=0;t0&&void 0!==arguments[0]?arguments[0]:null,t=e||(O||null);if(!t)return null;var n=t.getStreamInfo(),r=n.start,i=0,a=-1,o=NaN;for(;i0&&(isNaN(o)||l=0)return D[a];return null}();n?(t.debug("StreamController onEnded, found next stream with id ".concat(n.getStreamInfo().id,". Switching from ").concat(O.getStreamInfo().id," to ").concat(n.getStreamInfo().id)),fe(n,O,NaN)):(t.debug("StreamController no next stream found"),O.setIsEndedEventSignaled(!1)),Ge(n?k.END_OF_PERIOD_STOP_REASON:k.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&Me()}function Fe(e){var t=e||He().manifestInfo.duration;g.setDuration(t)}function xe(e){var t=T.getURIFragmentData();if(!t||!t.t)return NaN;var n=Qe()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var r=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(r)?r-K.getAvailabilityStartTime()/1e3:parseInt(t.t)+n}function Ue(e){if(e.error)j=!0,ze();else{t.info("Manifest updated... updating data system wide.");var n=e.manifest;f.updatePeriods(n);var i=f.getUTCTimingSources();!f.getIsDynamic()||i&&0!==i.length||ie.trigger(h.a.CONFORMANCE_VIOLATION,{level:pe.LEVELS.WARNING,event:pe.EVENTS.NO_UTC_TIMING_ELEMENT});var a=f.getIsDynamic()?i.concat(q.getUTCTimingSources()):i,o=N.isHTTPS(e.manifest.url);a.forEach((function(e){e.value.replace(/.*?:\/\//g,"")===q.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(o?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),o?"https://":"http://"),t.debug("Matching default timing source protocol to manifest protocol: ",e.value))})),r.filterUnsupportedFeatures(n).then((function(){_.initialize(n),m.attemptSync(a,f.getIsDynamic())}))}}function Be(){return!!O&&O.getHasVideoTrack()}function ke(){return!!O&&O.getHasAudioTrack()}function Ge(e,t){t=t||new Date,Pe().forEach((function(n){n.finalisePlayList(t,e)})),p.addPlayList()}function je(e){p.createPlaylistMetrics(1e3*K.getTime(),e)}function Ye(e){if(e.error){var n="";switch(e.error.code){case 1:n="MEDIA_ERR_ABORTED";break;case 2:n="MEDIA_ERR_NETWORK";break;case 3:n="MEDIA_ERR_DECODE",te.counts.mediaErrorDecode+=1;break;case 4:n="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:n="MEDIA_ERR_ENCRYPTED";break;default:n="UNKNOWN"}"MEDIA_ERR_DECODE"===n&&Z.get().errors.recoverAttempts.mediaErrorDecode>=te.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=K.getTime();O.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),de(e,!1)}():(G=!0,e.error.message&&(n+=" ("+e.error.message+")"),e.error.msExtendedCode&&(n+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),t.fatal("Video Element Error: "+n),e.error&&t.fatal(e.error),w.error(new y.a(e.error.code,n)),ze())}}function He(){return O?O.getStreamInfo():null}function Ke(e){for(var t=0,n=D.length;t=10){var e=o.getTime();t===e?R(e,!0):(t=e,a=NaN),r=0}}function A(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!s.getActiveStream())return!1;var t=Object.keys(h).some((function(e){return h[e]})),r=!!e&&b();return!t&&n.get().streaming.gaps.jumpGaps&&s.getActiveStreamProcessors().length>0&&(!o.isSeeking()||r)&&!o.isPaused()&&!s.getIsStreamSwitchInProgress()&&!s.getHasMediaOrInitialisationError()}function b(){var e=s.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5));return o.getTime()+n.get().streaming.gaps.threshold>=t}function I(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var r=NaN,i=0;isNaN(r)&&i0?e.end(i-1):0;t1&&void 0!==arguments[1]&&arguments[1],i=n.get().streaming.gaps.smallGapLimit,l=n.get().streaming.gaps.jumpLargeGaps,c=u.getBufferRange(),d=NaN,h=!1;if(t=I(c,e),!isNaN(t)){var g=c.start(t),m=g-e;m>0&&(m<=i||l)&&(d=g)}var y=o.getTimeToStreamEnd();if(isNaN(d)&&r&&isFinite(y)&&!isNaN(y)&&y0&&a!==d&&d>e&&!f){var E=d-e;if(h){var _=s.getStreamForTime(d),v=_&&!!_.getPreloaded();p.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(d,". Gap duration: ").concat(E)),o.seek(d,!0,v)}else{var T=o.getIsDynamic(),S=t>0?c.end(t-1):e,A=T?1e3*Math.max(0,E-.1):0;f=window.setTimeout((function(){o.seek(d,!0,!0),p.warn("Jumping gap occuring in period ".concat(s.getActiveStream().getStreamId()," starting at ").concat(S," and ending at ").concat(d,". Jumping by: ").concat(d-S)),f=null}),A)}a=d}}return e={reset:y,setConfig:function(e){e&&(e.settings&&(n=e.settings),e.playbackController&&(o=e.playbackController),e.streamController&&(s=e.streamController),e.videoModel&&(u=e.videoModel))},initialize:function(){!function(){m.on(c.a.WALLCLOCK_TIME_UPDATED,S,this),m.on(c.a.INITIAL_STREAM_SWITCH,T,this),m.on(c.a.PLAYBACK_SEEKING,E,this),m.on(c.a.BUFFER_REPLACEMENT_STARTED,_,e),m.on(c.a.TRACK_CHANGE_RENDERED,v,e)}()}},p=Object(d.a)(g).getInstance().getLogger(e),y(),e}_e.__dashjs_factory_name="GapController";var ve=f.a.getSingletonFactory(_e);function Te(){var e,t,n,r,i,o,s,u,f=this.context,h=Object(l.a)(f).getInstance();function p(e,t){return e&&n[t]&&n[t][e]?n[t][e].list:[]}function g(e,t){return e&&n[t]&&n[t][e]?n[t][e].current:null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.streamInfo){var i=e.type,u=e.streamInfo,l=u.id,f=g(i,l);if(n[l]&&n[l][i]&&!_(e,f)&&(n[l][i].current=e,n[l][i].current&&(i!==a.a.TEXT||i===a.a.TEXT&&e.isFragmented)&&h.trigger(c.a.CURRENT_TRACK_CHANGED,{oldMediaInfo:f,newMediaInfo:e,switchMode:r.get().streaming.trackSwitchMode[i]},{streamId:l}),!t)){var d=T(e);if(!d||!n[l][i].storeLastSettings)return;d.roles&&(d.role=d.roles[0],delete d.roles),d.accessibility&&(d.accessibility=d.accessibility[0]),d.audioChannelConfiguration&&(d.audioChannelConfiguration=d.audioChannelConfiguration[0]),o[i]=d,s.setSavedMediaSettings(i,d)}}}function y(e,t){e&&t&&(i[e]=t)}function E(e){return e?i[e]:null}function _(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.codec===t.codec,o=e.roles.toString()===t.roles.toString(),s=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&a&&r&&i&&o&&s&&u}function v(){n={},o={},i={audio:null,video:null,text:null}}function T(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}function S(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!e.lang||t.lang.match(e.lang),i=void 0===e.index||null===e.index||t.index===e.index,o=!e.viewpoint||e.viewpoint===t.viewpoint,s=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],u=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],l=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return r&&i&&o&&(s||t.type===a.a.AUDIO&&n)&&u&&l}function A(e){var t,n=0,r=[];return e.forEach((function(e){(t=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function b(e){var t,n=1/0,r=[];return e.forEach((function(e){var i=e.bitrateList.reduce((function(e,t){var n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0);(t=i/e.bitrateList.length)n?(n=t,r=[e]):t===n&&r.push(e)})),r}function R(e,n){if(e===a.a.TEXT)return n[0];var i,o=r.get().streaming.selectionModeForInitialTrack;if(u&&"function"==typeof u)i=u(n);else switch(o){case a.a.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:i=function(e){var t=(n=e,r=0,i=[],n.forEach((function(e){isNaN(e.selectionPriority)||(e.selectionPriority>r?(r=e.selectionPriority,i=[e]):e.selectionPriority===r&&i.push(e))})),i);var n,r,i;t.length>1&&(t=A(t));t.length>1&&(t=I(t));return t}(n);break;case a.a.TRACK_SELECTION_MODE_HIGHEST_BITRATE:i=function(e){var t=A(e);t.length>1&&(t=I(t));return t}(n);break;case a.a.TRACK_SELECTION_MODE_FIRST_TRACK:i=N(n);break;case a.a.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:i=function(e){var t=b(e);t.length>1&&(t=A(t));return t}(n);break;case a.a.TRACK_SELECTION_MODE_WIDEST_RANGE:i=function(e){var t=I(e);t.length>1&&(t=A(e));return t}(n);break;default:t.warn("Track selection mode ".concat(o," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),i=N(n)}return i.length>0?i[0]:n[0]}function N(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var n=o[e]||E(e),r=p(e,t.id),i=[];n||(n=s.getSavedMediaSettings(e),y(e,n)),r&&0!==r.length&&(n&&r.forEach((function(t){S(n,t,!!o[e])&&i.push(t)})),0===i.length?m(R(e,r),!0):i.length>1?m(R(e,i,o[e])):m(i[0]))},addTrack:function(e){if(e){var t=e.type;if((r=t)===a.a.AUDIO||r===a.a.VIDEO||r===a.a.TEXT||r===a.a.IMAGE){var r,i=e.streamInfo.id;n[i]||(n[i]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var o=n[i][t].list,s=0,u=o.length;s1&&(n.forEach((function(e){r+=e.dvb_weight,i.push(r)})),t=Math.floor(Math.random()*(r-1)),i.every((function(e,n){return a=n,!(t")+2),r=t.resolvedContent.substr(0,i)+""+t.resolvedContent.substr(i)+"",t.resolvedContent=a.xml_str2json(r)}(function(e){var t;for(t=0;t=0;o--){if(t=e.elements[o],n=t.type+"_asArray",t.resolvedContent){if(t.resolvedContent)for(s=0;s0&&r.run(i)}(e),"onActuate"===e.resolveType&&f.trigger(c.a.XLINK_READY,{manifest:i}),"onLoad"===e.resolveType)switch(e.type){case o.a.PERIOD:for(t=0;t=0;a--)(i=e[a]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===i["xlink:href"]&&e.splice(a,1);for(a=0;a-1?(p&&(t=p.createMssParser(),p.registerEvents()),t):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?Object(Qe.a)(u).create({debug:f}):t}(t)),null!==s){i.setMatchers(s.getMatchers()),i.setIron(s.getIron());try{m=s.parse(t)}catch(t){return void d.trigger(c.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new y.a(E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}m?(m.url=l||e,m.originalUrl||(m.originalUrl=m.url),m.hasOwnProperty(a.a.LOCATION)&&(g=h.parseBaseUrl(m.Location_asArray[0]),n.debug("BaseURI set by Location to: "+g)),m.baseUri=g,m.loadedTime=new Date,i.resolveManifestOnLoad(m),d.trigger(c.a.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})):d.trigger(c.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new y.a(E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}else d.trigger(c.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new y.a(E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))});else d.trigger(c.a.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,n,r){d.trigger(c.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new y.a(E.a.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,E.a.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+"".concat(e,", ").concat(r))})}})},reset:function(){d.off(c.a.XLINK_READY,m,t),p&&p.reset(),i&&(i.reset(),i=null),r&&(r.abort(),r=null)}},n=f.getLogger(t),d.on(c.a.XLINK_READY,m,t),r=Object(Ue.a)(u).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:h,constants:a.a,dashConstants:o.a,errors:E.a}),i=Xe(u).create({errHandler:g,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),s=null,t}$e.__dashjs_factory_name="ManifestLoader";var Ze=f.a.getClassFactory($e);function Je(){var e=this.context,t=Object(l.a)(e).getInstance();return{error:function(e){t.trigger(c.a.ERROR,{error:e})}}}Je.__dashjs_factory_name="ErrorHandler";var et=f.a.getSingletonFactory(Je),tt=n(46);function nt(){var e,t,n,r,i,o,s=this.context;function u(e,r){if(!r||!r.Period_asArray||0===r.Period_asArray.length)return Promise.resolve();var o=[];return r.Period_asArray.forEach((function(r){o.push(function(e,r){return new Promise((function(o){if(e&&e.AdaptationSet_asArray&&0!==e.AdaptationSet_asArray.length){var s=[];e.AdaptationSet_asArray.forEach((function(e){t.getIsTypeOf(e,r)&&s.push(function(e,r){return new Promise((function(o){if(e.Representation_asArray&&0!==e.Representation_asArray.length){var s=[],u=[];e.Representation_asArray.forEach((function(i,o){var l=t.getCodec(e,o,!1),c=function(e,t,n){switch(e){case a.a.VIDEO:return function(e,t){var n=e.width||null,r=e.height||null,i=e.frameRate||null,a=e.bandwidth||null;return{codec:t,width:n,height:r,framerate:i,bitrate:a}}(t,n);case a.a.AUDIO:return function(e,t){var n=e.audioSamplingRate||null,r=e.bandwidth||null;return{codec:t,bitrate:r,samplerate:n}}(t,n);default:return null}}(r,i,l);u.push(c),s.push(n.supportsCodec(c,r))})),Promise.all(s).then((function(t){e.Representation_asArray=e.Representation_asArray.filter((function(e,n){return t[n]||i.debug("[Stream] Codec ".concat(u[n].codec," not supported ")),t[n]})),o()})).catch((function(){o()}))}else o()}))}(e,r))})),Promise.all(s).then((function(){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){var t=e.Representation_asArray&&e.Representation_asArray.length>0;return t||i.warn("AdaptationSet has been removed because of no supported Representation"),t})),o()})).catch((function(){o()}))}else o()}))}(r,e))})),Promise.all(o)}return e={setConfig:function(e){e&&(e.adapter&&(t=e.adapter),e.capabilities&&(n=e.capabilities),e.settings&&(r=e.settings))},filterUnsupportedFeatures:function(e){return new Promise((function(s){var l=[];l.push(u(a.a.VIDEO,e)),l.push(u(a.a.AUDIO,e)),Promise.all(l).then((function(){r.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){if(!e||!e.Period_asArray||0===e.Period_asArray.length)return;e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var r=t.getEssentialPropertiesForRepresentation(e);if(r&&r.length>0)for(var a=0;a0)}))}))}(e),function(e){if(!o||0===o.length||!e||!e.Period_asArray||0===e.Period_asArray.length)return;e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!o.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),s()})).catch((function(){s()}))}))},setCustomCapabilitiesFilters:function(e){o=e}},i=Object(d.a)(s).getInstance().getLogger(e),e}nt.__dashjs_factory_name="CapabilitiesFilter";var rt=f.a.getSingletonFactory(nt);var it=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null};function at(){var e;return{initialize:function(t){if(e=new it,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var r=t.substr(n+1).split("&"),i=0,a=r.length;i0&&r[e.mediaType].ignoreCount--}return t={getMaxIndex:function(e){var t=ht(i).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!s||!s.hasOwnProperty("getCurrentBufferLevel")||!s.hasOwnProperty("getCurrentBufferState"))throw new Error(a.a.MISSING_CONFIG_ERROR)}();var o=e.getMediaType(),l=s.getCurrentBufferState(o),c=e.getRepresentationInfo().fragmentDuration,d=e.getStreamInfo(),h=d?d.id:null,p=d&&d.manifestInfo&&d.manifestInfo.isDynamic;if(function(e){return!f.get().streaming.lowLatencyEnabled&&r[e].ignoreCount>0}(o)||!c)return t;if(l&&l.state===u.BUFFER_EMPTY)n.debug("["+o+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty";else{var g=e.getMediaInfo(),m=e.getAbrController(),y=m.getThroughputHistory(),E=s.getCurrentBufferLevel(o),_=y.getAverageThroughput(o,p),v=y.getAverageLatency(o),T=_*(E/c)*.5;t.quality=m.getQualityForBitrate(g,T,h,v),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return t},reset:function(){p(),o.off(h.a.PLAYBACK_SEEKING,g,t),o.off(c.a.BYTES_APPENDED_END_FRAGMENT,m,t)}},n=Object(d.a)(i).getInstance().getLogger(t),p(),o.on(h.a.PLAYBACK_SEEKING,g,t),o.on(c.a.BYTES_APPENDED_END_FRAGMENT,m,t),t}mt.__dashjs_factory_name="InsufficientBufferRule";var yt=f.a.getClassFactory(mt);function Et(e){e=e||{};var t,n,r,i,a,o=this.context,s=e.mediaPlayerModel,u=e.dashMetrics,l=e.settings;function c(){r={},i={},a=[]}return t={shouldAbandon:function(e){var t=ht(o).create(ht.NO_CHANGE,{name:Et.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var c,f,d=e.getMediaInfo(),h=e.getMediaType(),p=e.getStreamInfo(),g=p?p.id:null,m=e.getCurrentRequest();if(!isNaN(m.index)){c=h,f=m.index,r[c]=r[c]||{},r[c][f]=r[c][f]||{};var y=s.getStableBufferTime();if(u.getCurrentBufferLevel(h)>y)return t;var E=r[h][m.index];if(null===E||null===m.firstByteDate||i.hasOwnProperty(E.id))return t;if(void 0===E.firstByteTime&&(a[h]=[],E.firstByteTime=m.firstByteDate.getTime(),E.segmentDuration=m.duration,E.bytesTotal=m.bytesTotal,E.id=m.index),E.bytesLoaded=m.bytesLoaded,E.elapsedTime=(new Date).getTime()-E.firstByteTime,E.bytesLoaded>0&&E.elapsedTime>0&&function(e,t){a[e]=a[e]||[],a[e].push(t)}(h,Math.round(8*E.bytesLoaded/E.elapsedTime)),a[h].length>=5&&E.elapsedTime>500&&E.bytesLoadedE.bytesTotal*S[I].bitrate/S[v.getQualityFor(h,g)].bitrate&&(t.quality=I,t.reason.throughput=E.measuredBandwidthInKbps,t.reason.fragmentID=E.id,i[E.id]=E,n.debug("["+h+"] frag id",E.id," is asking to abandon and switch to quality to ",I," measured bandwidth was",E.measuredBandwidthInKbps),delete r[h][E.id])}}else E.bytesLoaded===E.bytesTotal&&delete r[h][E.id]}return t},reset:c},n=Object(d.a)(o).getInstance().getLogger(t),c(),t}Et.__dashjs_factory_name="AbandonRequestsRule";var _t=f.a.getClassFactory(Et);function vt(){var e,t,n=this.context;return e={getMaxIndex:function(e){var r=ht(n).create();if(!e||!e.hasOwnProperty("getDroppedFramesHistory"))return r;var i=e.getDroppedFramesHistory(),a=e.getStreamInfo().id;if(i){var o=i.getFrameHistory(a);if(!o||0===o.length)return r;for(var s=0,u=0,l=ht.NO_CHANGE,c=1;c375&&s/u>.15)){l=c-1,t.debug("index: "+l+" Dropped Frames: "+s+" Total Frames: "+u);break}return ht(n).create(l,{droppedFrames:s})}return r}},t=Object(d.a)(n).getInstance().getLogger(e),e}vt.__dashjs_factory_name="DroppedFramesRule";var Tt=f.a.getClassFactory(vt);function St(){var e,t,n=this.context;return e={getMaxIndex:function(e){for(var r=e?e.getSwitchHistory():null,i=r?r.getSwitchRequests():[],a=0,o=0,s=0,u=ht(n).create(),l=0;l=6&&a/o>.075)){u.quality=l>0&&i[l].drops>0?l-1:l,u.reason={index:u.quality,drops:a,noDrops:o,dropSize:s},t.debug("Switch history rule index: "+u.quality+" samples: "+(a+o)+" drops: "+a);break}return u}},t=Object(d.a)(n).getInstance().getLogger(e),e}St.__dashjs_factory_name="SwitchHistoryRule";var At=f.a.getClassFactory(St);function bt(e){e=e||{};var t,n,r,i=this.context,a=e.dashMetrics,o=e.mediaPlayerModel,s=Object(l.a)(i).getInstance();function f(e,t,n){var r=n.reduce((function(e,t,r){return t>n[e]?r:e}),0);if(0===r)return null;var i=Math.max(e,10+2*t.length),a=(n[r]-1)/(i/10-1);return{gp:a,Vp:10/a}}function p(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),r=function(e){return e.map((function(e){return Math.log(e)}))}(n);r=r.map((function(e){return e-r[0]+1}));var i=o.getStableBufferTime(),a=f(i,n,r);return a?(t.state=1,t.bitrates=n,t.utilities=r,t.stableBufferTime=i,t.Vp=a.Vp,t.gp=a.gp,t.lastQuality=0,g(t)):t.state=0,t}function g(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function m(e,t){var n=o.getStableBufferTime();if(e.stableBufferTime!==n){var r=f(n,e.bitrates,e.utilities);if(r.Vp!==e.Vp||r.gp!==e.gp){var i=a.getCurrentBufferLevel(t),s=i+e.placeholderBuffer;s-=10,s*=r.Vp/e.Vp,s+=10,e.stableBufferTime=n,e.Vp=r.Vp,e.gp=r.gp,e.placeholderBuffer=Math.max(0,s-i)}}}function y(e,t){return e.Vp*(e.utilities[t]+e.gp)}function E(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,b(t,e.chunk.mediaInfo.type)}}}function A(e){if(e&&e.metric===u.HTTP_REQUEST&&e.value&&e.value.type===v.a.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=r[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),b(t,e.mediaType))}}function b(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var n=a.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),r=y(e,e.lastQuality),i=Math.max(0,r-n);e.placeholderBuffer=Math.min(i,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function I(e){if(e){var t=r[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function R(e){if(e){var t=r[e.mediaType];if(t&&0!==t.state){var n,i=a.getCurrentBufferLevel(e.mediaType);n=t.abrQuality>0?E(t,t.abrQuality):10;var o=Math.max(0,n-i);t.placeholderBuffer=Math.min(t.placeholderBuffer,o)}}}function N(){r={}}return t={getMaxIndex:function(e){var t=ht(i).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var o=e.getMediaInfo(),s=e.getMediaType(),u=e.getScheduleController(),l=e.getStreamInfo(),c=e.getAbrController(),f=c.getThroughputHistory(),d=l?l.id:null,h=l&&l.manifestInfo&&l.manifestInfo.isDynamic,_=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!_)return t;u.setTimeToLoadDelay(0);var v=function(e){var t=e.getMediaType(),n=r[t];return n?0!==n.state&&m(n,t):(n=p(e),r[t]=n),n}(e);if(0===v.state)return t;var T,S=a.getCurrentBufferLevel(s),A=f.getAverageThroughput(s,h),b=f.getSafeAverageThroughput(s,h),I=f.getAverageLatency(s);if(t.reason.state=v.state,t.reason.throughput=A,t.reason.latency=I,isNaN(A))return t;switch(v.state){case 1:T=c.getQualityForBitrate(o,b,d,I),t.quality=T,t.reason.throughput=b,v.placeholderBuffer=Math.max(0,E(v,T)-S),v.lastQuality=T,!isNaN(v.lastSegmentDurationS)&&S>=v.lastSegmentDurationS&&(v.state=2);break;case 2:!function(e,t){var n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var r=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,r)}}else{var i=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,i)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,m(e,t)}(v,s),T=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a=i)&&(i=o,r=a)}return r}(v,S+v.placeholderBuffer);var R=c.getQualityForBitrate(o,b,d,I);T>v.lastQuality&&T>R&&(T=Math.max(R,v.lastQuality));var N=Math.max(0,S+v.placeholderBuffer-y(v,T));N<=v.placeholderBuffer?(v.placeholderBuffer-=N,N=0):(N-=v.placeholderBuffer,v.placeholderBuffer=0,Tt.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=a,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=a,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,E(t,i)}}}function y(e){if(e&&e.metric===u.HTTP_REQUEST&&e.value&&e.value.type===v.a.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=n[e.mediaType],i=r[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),E(t,i))}}function E(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function _(e){if(e&&e.mediaType){var t=n[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function T(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r=D.B_target){C.state=2,D.Q=l;for(var O=0;OF&&(U=-1),D.w[B]=D.prev_w[B]+U*(x/(2*c))*((D.Q+l)*(w*g[B]/F));D.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i=a[l+1]){n=!0;break}n||(s=(o+a[t-1]-1)/t);for(var c=0;cC.lastQuality&&g[C.lastQuality+1]<=F&&(t=C.lastQuality+1),g[t]>=F&&(D.Q=2*Math.max(l,D.Q)),u.quality=t,u.reason.throughput=R,u.reason.latency=N,u.reason.bufferLevel=b,C.lastQuality=u.quality;break;default:i.debug("L2A ABR rule invoked in bad state."),u.quality=_.getQualityForBitrate(f,I,E.id,N),u.reason.state=C.state,u.reason.throughput=I,u.reason.latency=N,C.state=1,p(C)}return u},reset:function(){S(),f.off(c.a.PLAYBACK_SEEKING,g,t),f.off(c.a.MEDIA_FRAGMENT_LOADED,m,t),f.off(c.a.METRIC_ADDED,y,t),f.off(c.a.QUALITY_CHANGE_REQUESTED,_,t)}},i=Object(d.a)(o).getInstance().getLogger(t),S(),f.on(c.a.PLAYBACK_SEEKING,g,t),f.on(c.a.MEDIA_FRAGMENT_LOADED,m,t),f.on(c.a.METRIC_ADDED,y,t),f.on(c.a.QUALITY_CHANGE_REQUESTED,_,t),t}Rt.__dashjs_factory_name="L2ARule";var Nt=f.a.getClassFactory(Rt),wt="manual_weight_selection",Ct="random_weight_selection",Dt="dynamic_weight_selection";function Ot(){var e,t,n,r,i,a,o,s,u,l=this.context;function c(){n=null,r=1,i=100,a=0,o=null,s=null,u=Dt}function f(){var e=0;if(n)for(var t=0;te&&(e=r.state.throughput)}return e}function h(e,t,n){var r=e.map((function(e,r){return n[r]*Math.pow(e-t[r],2)})).reduce((function(e,t){return e+t}));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function p(e,t){return h([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function g(e,t,n){for(var r=0;ro)&&(a=u,o=l)}t.push(a)}for(var p=null,g=null,m=0;mp)&&(p=y,g=m)}var _=[];_.push(t[g]),t.splice(g,1);for(;t.length>0;){for(var v=null,T=null,S=0;S1&&(A=f()),c/=i,t.debug("getNextQuality called throughput:".concat(A," latency:").concat(c," bufferSize:").concat(d," currentQualityIndex:").concat(m," playbackRate:").concat(p));var b=S[m],I=b.bitrate*E.getSegmentDuration()/T,R=Math.max(0,I-v);if(v-In?e-n:e+n-t}return t={getMinBuffer:function(){return s},getSegmentDuration:c,getNextBufferWithBitrate:function(e,t,n){return f(t,e*u/n)},getNextBuffer:f,findWeightVector:function(e,t,i,a,c,d){var h=null,p=null,g=null,m=Math.abs(t-r);return e.forEach((function(e){n.forEach((function(n){n[0];var r=n[1],a=n[2],y=(n[3],e.bitrate*u/c),E=f(i,y),_=(0===a?10:1/a)*Math.max(1e-5,y-E),v=(0===r?10:1/r)*e.state.latency,T=l.calculateSingleUseQoe(e.bitrate,_,v,d);(null===h||T>h)&&function(e,t,n){if(e>o+n)return!1;return t>=s}(t,E,m)&&(h=T,p=n,g=e.bitrate)}))})),null===p&&null===g&&(p=-1),r=t,p}},i=[.2,.4,.6,.8,1],a=4,n=function e(t,n,r){if(r===n)return t;for(var a=t.length,o=0;oI?I=N:NA?D-A:0;i.setupPerSegmentQoe(A,I,b),i.logSegmentMetrics(w,O,_,v);var M=Ut(s).create({targetLatency:1.5,bufferMin:.3,segmentDuration:A,qoeEvaluator:i});return n.quality=r.getNextQuality(h,1e3*T,_,m,v,d,M),n.reason={throughput:T,latency:_},n.priority=ht.PRIORITY.STRONG,g.setTimeToLoadDelay(0),n.quality!==d&&console.log("[TgcLearningRule]["+l+"] requesting switch to index: ",n.quality,"Average throughput",Math.round(T),"kbps"),n}catch(e){throw e}},reset:function(){r.reset(),i.reset()}},t=Object(d.a)(s).getInstance().getLogger(n),r=Mt(s).create(),i=Ft(s).create(),n}Bt.__dashjs_factory_name="LoLPRule";var kt=f.a.getClassFactory(Bt);function Gt(e){e=e||{};var t,n,r=this.context,i=e.mediaPlayerModel,o=e.dashMetrics,s=e.settings;function u(e){return e.filter((function(e){return e.quality>ht.NO_CHANGE}))}function l(e){var t,n,i,a,o,s={},u=null;if(0!==e.length){for(s[ht.PRIORITY.STRONG]={quality:ht.NO_CHANGE,reason:null},s[ht.PRIORITY.WEAK]={quality:ht.NO_CHANGE,reason:null},s[ht.PRIORITY.DEFAULT]={quality:ht.NO_CHANGE,reason:null},t=0,n=e.length;ti.quality)&&(s[i.priority].quality=i.quality,s[i.priority].reason=i.reason||null);return s[ht.PRIORITY.WEAK].quality!==ht.NO_CHANGE&&(u=s[ht.PRIORITY.WEAK]),s[ht.PRIORITY.DEFAULT].quality!==ht.NO_CHANGE&&(u=s[ht.PRIORITY.DEFAULT]),s[ht.PRIORITY.STRONG].quality!==ht.NO_CHANGE&&(u=s[ht.PRIORITY.STRONG]),u&&(a=u.quality,o=u.reason),ht(r).create(a,o)}}return{initialize:function(){t=[],n=[],s.get().streaming.abr.useDefaultABRRules&&(s.get().streaming.abr.ABRStrategy===a.a.ABR_STRATEGY_L2A?t.push(Nt(r).create({dashMetrics:o,mediaPlayerModel:i,settings:s})):s.get().streaming.abr.ABRStrategy===a.a.ABR_STRATEGY_LoLP?t.push(kt(r).create({dashMetrics:o})):(t.push(It(r).create({dashMetrics:o,mediaPlayerModel:i,settings:s})),t.push(gt(r).create({dashMetrics:o})),s.get().streaming.abr.additionalAbrRules.insufficientBufferRule&&t.push(yt(r).create({dashMetrics:o,settings:s})),s.get().streaming.abr.additionalAbrRules.switchHistoryRule&&t.push(At(r).create()),s.get().streaming.abr.additionalAbrRules.droppedFramesRule&&t.push(Tt(r).create()),s.get().streaming.abr.additionalAbrRules.abandonRequestsRule&&n.push(_t(r).create({dashMetrics:o,mediaPlayerModel:i,settings:s})))),i.getABRCustomRules().forEach((function(e){"qualitySwitchRules"===e.type&&t.push(e.rule(r).create()),"abandonFragmentRules"===e.type&&n.push(e.rule(r).create())}))},reset:function(){[t,n].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),t=[],n=[]},getMaxQuality:function(e){return l(u(t.map((function(t){return t.getMaxIndex(e)}))))||ht(r).create()},getMinSwitchRequest:l,shouldAbandonFragment:function(e,t){return l(u(n.map((function(n){return n.shouldAbandon(e,t)}))))||ht(r).create()},getQualitySwitchRules:function(){return t}}}Gt.__dashjs_factory_name="ABRRulesCollection";var jt=f.a.getClassFactory(Gt);jt.QUALITY_SWITCH_RULES="qualitySwitchRules",jt.ABANDON_FRAGMENT_RULES="abandonFragmentRules",f.a.updateSingletonFactory(Gt.__dashjs_factory_name,jt);var Yt=jt;function Ht(){var e,t,n,r,i=this.context,o=Object(_.a)(i).getInstance();function s(e){var t;for(t=0;t0?e:o.get().streaming.buffer.fastSwitchEnabled?20:12}function l(){return o.get().streaming.lowLatencyEnabled?o.get().streaming.delay.liveDelay||3:o.get().streaming.delay.liveDelay}function c(e,n){f(e,n);var r=new lt.a;r.schemeIdUri=e,r.value=n,t.push(r)}function f(e,n){Object(M.b)(e,"string"),Object(M.b)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getABRCustomRules:function(){return r},addABRCustomRule:function(e,t,n){if("string"!=typeof e||e!==Yt.ABANDON_FRAGMENT_RULES&&e!==Yt.QUALITY_SWITCH_RULES||"string"!=typeof t)throw a.a.BAD_ARGUMENT_ERROR;var i=s(t);-1===i?r.push({type:e,rulename:t,rule:n}):(r[i].type=e,r[i].rule=n)},removeABRCustomRule:function(e){if(e){var t=s(e);-1!==t&&r.splice(t,1)}else r=[]},getStableBufferTime:u,getInitialBufferLevel:function(){var e=o.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(u(),e)},getRetryAttemptsForType:function(e){var t=isNaN(o.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:o.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return o.get().streaming.lowLatencyEnabled?o.get().streaming.retryAttempts[e]*t:o.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(o.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:o.get().streaming.retryIntervals.lowLatencyReductionFactor;return o.get().streaming.lowLatencyEnabled?o.get().streaming.retryIntervals[e]/t:o.get().streaming.retryIntervals[e]},getLiveDelay:l,getLiveCatchupLatencyThreshold:function(){try{var e=o.get().streaming.liveCatchup.latencyThreshold,t=l();if(null!==e&&!isNaN(e))return Math.max(e,t);var n=o.get().streaming.liveCatchup.minDrift,r=!isNaN(t)&&t?isNaN(n)?l():o.get().streaming.liveCatchup.minDrift+l():NaN;return r&&!isNaN(r)?Math.max(4*r,5):NaN}catch(e){return NaN}},addUTCTimingSource:c,removeUTCTimingSource:f,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=o.get().streaming.utcSynchronization.defaultTimingSource;c(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},getDefaultUtcTimingSource:function(){return o.get().streaming.utcSynchronization.defaultTimingSource},reset:function(){}},t=[],n={default:!1},r=[],e}Ht.__dashjs_factory_name="MediaPlayerModel";var Kt=f.a.getSingletonFactory(Ht);function qt(e){var t=(e=e||{}).abrController,n=e.switchHistory,r=e.droppedFramesHistory,i=e.currentRequest,a=e.useBufferOccupancyABR,o=e.useL2AABR,s=e.useLoLPABR,u=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function f(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=f();return e?e.type:null},getMediaInfo:f,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=f();return e?e.streamInfo:null},getScheduleController:function(){return u},getAbrController:function(){return t},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return a},useL2AABR:function(){return o},useLoLPABR:function(){return s},getVideoModel:function(){return c}}}qt.__dashjs_factory_name="RulesContext";var Vt=f.a.getClassFactory(qt);function Wt(){var e=[],t=[];return{push:function(n){n.newValue===ht.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var r=n.newValue-n.oldValue,i=r<0?1:0,a=i?-r:0,o=i?0:1;if(e[n.oldValue].drops+=i,e[n.oldValue].dropSize+=a,e[n.oldValue].noDrops+=o,t.push({idx:n.oldValue,noDrop:o,drop:i,dropSize:a}),t.length>8){var s=t.shift();e[s.idx].drops-=s.drop,e[s.idx].dropSize-=s.dropSize,e[s.idx].noDrops-=s.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}Wt.__dashjs_factory_name="SwitchRequestHistory";var zt=f.a.getClassFactory(Wt);function Xt(){var e={},t={},n={};return{push:function(r,i,a){if(i){e[r]||(e[r]=[],t[r]=0,n[r]=0);var o=a&&a.droppedVideoFrames?a.droppedVideoFrames:0,s=a&&a.totalVideoFrames?a.totalVideoFrames:0,u=o-t;t[r]=o;var l=s-n;n[r]=s;var c=e[r];isNaN(i)||(c[i]?(c[i].droppedVideoFrames+=u,c[i].totalVideoFrames+=l):c[i]={droppedVideoFrames:u,totalVideoFrames:l})}},getFrameHistory:function(t){return e[t]},clearForStream:function(r){try{delete e[r],delete t[r],delete n[r]}catch(e){}},reset:function(){e={},t={},n={}}}}Xt.__dashjs_factory_name="DroppedFramesHistory";var Qt=f.a.getClassFactory(Xt);function $t(e){var t,n,r,i,o,s=(e=e||{}).settings;function u(e,t,n,r){var i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function l(e,u,l){return s.get().streaming.abr.movingAverageMethod!==a.a.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?o.throughputHalfLife:o.latencyHalfLife,a=e?r[t]:i[t];if(!a||a.totalWeight<=0)return NaN;var s=a.fastEstimate/(1-Math.pow(.5,a.totalWeight/n.fast)),u=a.slowEstimate/(1-Math.pow(.5,a.totalWeight/n.slow));return e?Math.min(s,u):Math.max(s,u)}(e,u):function(e,r,i){var a=function(e,r,i){var a,o;if(e?(a=t[r],o=i?3:4):(a=n[r],o=4),a){if(o>=a.length)o=a.length;else if(e)for(var s=1;s=1.3||u<=1/1.3)&&(o+=1)===a.length)break}}else o=0;return o}(e,r,i),o=(e?t:n)[r];if(0===a||!o||0===o.length)return NaN;return(o=o.slice(-a)).reduce((function(e,t){return e+t}))/o.length}(e,u,l)}function c(e,t){return l(!0,e,t)}function f(e){t[e]=t[e]||[],n[e]=n[e]||[],r[e]=r[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function d(){t={},n={},r={},i={}}var h={push:function(e,l,c){if(l.trace&&l.trace.length){var d=l.tresponse.getTime()-l.trequest.getTime()||1,h=l._tfinish.getTime()-l.tresponse.getTime()||1,p=l.trace.reduce((function(e,t){return e+t.b[0]}),0),g=0,m=0;if(s.get().streaming.lowLatencyEnabled){if(s.get().streaming.abr.fetchThroughputCalculationMode===a.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING){var y=l.trace.reduce((function(e,t){return e+t.t}),0);m=Math.round(y/l.trace.length)}0===m&&(g=l.trace.reduce((function(e,t){return e+t.d}),0))}else g=c?h:d+h;if(0!==g&&(m=Math.round(8*p/g)),f(e),function(e,t,n){return e===a.a.VIDEO?n0&&!t[e].hasCachedEntries)return;t[e].hasCachedEntries=!0}else t[e]&&t[e].hasCachedEntries&&function(e){delete t[e],delete n[e],delete r[e],delete i[e],f(e)}(e);t[e].push(m),t[e].length>20&&t[e].shift(),n[e].push(d),n[e].length>20&&n[e].shift(),u(r[e],m,.001*h,o.throughputHalfLife),u(i[e],d,1,o.latencyHalfLife)}},getAverageThroughput:c,getSafeAverageThroughput:function(e,t){var n=c(e,t);return isNaN(n)||(n*=s.get().streaming.abr.bandwidthSafetyFactor),n},getAverageLatency:function(e){return l(!1,e)},reset:d};return o={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},d(),h}$t.__dashjs_factory_name="ThroughputHistory";var Zt=f.a.getClassFactory($t);function Jt(){var e,t,n,r,i,o,s,f,p,g,y,E,_,T,S,A,b,I,R,N,w,C,D,O,P,L=this.context,F=Object(d.a)(L).getInstance(),x=Object(l.a)(L).getInstance();function U(){i={},o={},f={},s={},I={},w={},C={},D={},void 0===g&&(g=!1),R&&R.reset(),b=void 0,R=void 0,N=void 0,clearTimeout(p),p=null}function B(t){var i=t.request.mediaType,a=t.streamId;if(i&&a&&s[a]&&P.get().streaming.abr.autoSwitchBitrate[i]){var o=s[a][i];if(o){var l=Vt(L).create({abrController:e,streamProcessor:o,currentRequest:t.request,useBufferOccupancyABR:w[i],useL2AABR:C[i],useLoLPABR:D[i],videoModel:T}),c=n.shouldAbandonFragment(l,a);if(c.quality>ht.NO_CHANGE){var d=o.getFragmentModel();d.getRequests({state:m.a.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(d.abortRequests(),f[a][i].state=u.ABANDON_LOAD,I[a][i].reset(),I[a][i].push({oldValue:H(i,a),newValue:c.quality,confidence:1,reason:c.reason}),K(i,r.getActiveStreamInfo(),c.quality,c.reason),clearTimeout(p),p=setTimeout((function(){f[a][i].state=u.ALLOW_LOAD,p=null}),P.get().streaming.abandonLoadTimeout))}}}}function k(e){e.mediaType===a.a.VIDEO&&(void 0!==b&&R.push(e.streamId,b,T.getPlaybackQuality()),b=e.newQuality)}function G(e){var n,r;e.metric!==u.HTTP_REQUEST||!e.value||e.value.type!==v.a.MEDIA_SEGMENT_TYPE||e.mediaType!==a.a.AUDIO&&e.mediaType!==a.a.VIDEO||N.push(e.mediaType,e.value,P.get().streaming.abr.useDeadTimeLatency),e.metric!==u.BUFFER_LEVEL||e.mediaType!==a.a.AUDIO&&e.mediaType!==a.a.VIDEO||(n=e.mediaType,r=.001*e.value.level,P.get().streaming.abr.ABRStrategy===a.a.ABR_STRATEGY_DYNAMIC&&function(e,n){var r=S.getStableBufferTime(),i=r,a=.5*r,o=w[e],s=n>(o?a:i);w[e]=s,s!==o&&(s?t.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+n.toFixed(3)+")."):t.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+n.toFixed(3)+")."))}(n,r))}function j(e,t){try{return i[t]=i[t]||{},i[t].hasOwnProperty(e)||(i[t][e]=0),function(e,t,n){if(t!==a.a.VIDEO||!P.get().streaming.abr.limitBitrateByPortal||!s[n]||!s[n][t])return e;g||z();var r=s[n][t].getStreamInfo(),i=_.getAdaptationForType(r.index,t,r).Representation,o=e;if(y>0&&E>0){for(;o>0&&i[o]&&y=1||a<0)return e;return Math.min(e,Math.round(r*a))}(function(e,t){var n=i[t][e],r=n;if(!s[t]||!s[t][e])return r;var a=Y(e,t);void 0!==a&&(r=Math.max(n,a));var o=function(e,t){try{var n=P.get().streaming.abr.maxBitrate[e];return n>-1?V(s[t][e].getMediaInfo(),n,t):void 0}catch(e){return}}(e,t);void 0!==o&&(r=Math.min(r,o));return r}(e,t),e,t),e,t)}catch(e){return}}function Y(e,t){try{return function(e,t){try{var n=P.get().streaming.abr.minBitrate[e];if(n>-1){var r=s[t][e].getMediaInfo(),i=W(r),a=V(r,n,t);return i[a]&&a1&&void 0!==arguments[1]?arguments[1]:null;try{if(t||(t=r.getActiveStreamInfo().id),e&&s[t]&&s[t][e])if(t)return o[t]=o[t]||{},o[t].hasOwnProperty(e)||(o[t][e]=0),o[t][e];return 0}catch(e){return 0}}function K(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t&&t.id&&e){var i=t.id,a=H(e,i);Object(M.a)(n);var o=j(e,i);n!==a&&n>=0&&n<=o&&q(e,a,n,o,r,i)}}function q(e,n,r,i,a,u){if(e&&s[u]&&s[u][e]){var l=s[u][e].getStreamInfo(),f=l&&l.manifestInfo&&l.manifestInfo.isDynamic,d=O.getCurrentBufferLevel(e);t.info("Stream ID: "+u+" ["+e+"] switch from "+n+" to "+r+"/"+i+" (buffer: "+d+") "+(a?JSON.stringify(a):".")),o[u]=o[u]||{},o[u][e]=r;var h=function(e,t,n){if(t&&s&&s[e]&&s[e][t]){var r=W(s[e][t].getMediaInfo());return r[n]?r[n]:null}return null}(u,e,r);x.trigger(c.a.QUALITY_CHANGE_REQUESTED,{oldQuality:n,newQuality:r,reason:a,streamInfo:l,bitrateInfo:h,maxIdx:i,mediaType:e},{streamId:l.id,mediaType:e});var p=N.getAverageThroughput(e,f);isNaN(p)||A.setSavedBitrateSettings(e,p)}}function V(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e&&e.type?s[n][e.type].getRepresentationInfo():null;if(P.get().streaming.abr.useDeadTimeLatency&&r&&i&&i.fragmentDuration){r/=1e3;var a=i.fragmentDuration;if(r>a)return 0;var o=r/a;t*=1-o}for(var u=W(e),l=u.length-1;l>=0;l--){var c=u[l];if(1e3*t>=c.bitrate)return l}return 0}function W(e){var t=[];if(!e||!e.bitrateList)return t;for(var n,r=e.bitrateList,i=e.type,a=0,o=r.length;a1&&void 0!==arguments[1]?arguments[1]:null;if(t||(t=r.getActiveStreamInfo().id),e&&s&&s[t]&&s[t][e]){var n=j(e,t),i=W(s[t][e].getMediaInfo());return i[n]?i[n]:null}return null},getMinAllowedIndexFor:Y,getMaxAllowedIndexFor:j,getInitialBitrateFor:function(e,t){if(function(){if(!A||!A.hasOwnProperty("getSavedBitrateSettings"))throw new Error(a.a.MISSING_CONFIG_ERROR)}(),e===a.a.TEXT)return NaN;var n=A.getSavedBitrateSettings(e),r=P.get().streaming.abr.initialBitrate[e],i=P.get().streaming.abr.initialRepresentationRatio[e];if(-1===r)if(i>-1){var o=s[t][e].getStreamInfo(),u=_.getAdaptationForType(o.index,e,o).Representation;if(Array.isArray(u))r=u[Math.max(Math.round(u.length*i)-1,0)].bandwidth/1e3;else r=0}else r=isNaN(n)?e===a.a.VIDEO?1e3:100:n;return r},getQualityFor:H,getAbandonmentStateFor:function(e,t){return f[e]&&f[e][t]?f[e][t].state:null},setPlaybackQuality:K,checkPlaybackQuality:function(t,r){try{if(!(t&&s&&s[r]&&s[r][t]))return!1;if(R){var i=T.getPlaybackQuality();i&&R.push(r,b,i)}if(!P.get().streaming.abr.autoSwitchBitrate[t])return!1;var a=H(t,r),o=Vt(L).create({abrController:e,switchHistory:I[r][t],droppedFramesHistory:R,streamProcessor:s[r][t],currentValue:a,useBufferOccupancyABR:w[t],useL2AABR:C[t],useLoLPABR:D[t],videoModel:T}),l=Y(t,r),c=j(t,r),d=n.getMaxQuality(o),h=d.quality;return void 0!==l&&(h>ht.NO_CHANGE?h:a)c&&(h=c),I[r][t].push({oldValue:a,newValue:h}),h>ht.NO_CHANGE&&h!==a&&(f[r][t].state===u.ALLOW_LOAD||h>a)&&(q(t,a,h,c,d.reason,r),!0)}catch(e){return!1}},setElementSize:z,setWindowResizeEventCalled:function(e){g=e},registerStreamType:function(e,t){var n=t.getStreamInfo().id;s[n]||(s[n]={}),I[n]||(I[n]={}),f[n]||(f[n]={}),I[n][e]=zt(L).create(),s[n][e]=t,f[n][e]={},f[n][e].state=u.ALLOW_LOAD,function(e){var t=P.get().streaming.abr.ABRStrategy;t===a.a.ABR_STRATEGY_L2A?(w[e]=!1,D[e]=!1,C[e]=!0):t===a.a.ABR_STRATEGY_LoLP?(w[e]=!1,D[e]=!0,C[e]=!1):t===a.a.ABR_STRATEGY_BOLA?(w[e]=!0,D[e]=!1,C[e]=!1):t===a.a.ABR_STRATEGY_THROUGHPUT?(w[e]=!1,D[e]=!1,C[e]=!1):t===a.a.ABR_STRATEGY_DYNAMIC&&(w[e]=!(!w||!w[e])&&w[e],D[e]=!1,C[e]=!1)}(e),e===a.a.VIDEO&&z()},unRegisterStreamType:function(e,t){try{s[e]&&s[e][t]&&delete s[e][t],I[e]&&I[e][t]&&delete I[e][t],f[e]&&f[e][t]&&delete f[e][t]}catch(e){}},setConfig:function(e){e&&(e.streamController&&(r=e.streamController),e.domStorage&&(A=e.domStorage),e.mediaPlayerModel&&(S=e.mediaPlayerModel),e.dashMetrics&&(O=e.dashMetrics),e.adapter&&(_=e.adapter),e.videoModel&&(T=e.videoModel),e.settings&&(P=e.settings))},reset:function(){U(),x.off(c.a.LOADING_PROGRESS,B,e),x.off(h.a.QUALITY_CHANGE_RENDERED,k,e),x.off(h.a.METRIC_ADDED,G,e),n&&n.reset()}},t=F.getLogger(e),U(),e}Jt.__dashjs_factory_name="AbrController";var en=f.a.getSingletonFactory(Jt);en.QUALITY_DEFAULT=0,f.a.updateSingletonFactory(Jt.__dashjs_factory_name,en);var tn=en,nn=n(41),rn=new Map([[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function an(){var e,t,n,r,i,o=this.context,s=Object(l.a)(o).getInstance(),u=[];function f(){n&&(n.playbackRate=1,n.removeEventListener("canplay",f))}function h(){return u.length>0}function p(){if(n&&h()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function g(e,t){n&&n.addEventListener(e,t)}function m(e,t){n&&n.removeEventListener(e,t)}function y(){return n?n.readyState:NaN}function E(){return n?n.buffered:null}function _(e,t,r,i,a){if(n)for(var o=0;o=e?t():function(e,t){g(e,(function n(){m(e,n),t(e)}))}(rn.get(e),t)}return e={initialize:function(){s.on(c.a.PLAYBACK_PLAYING,p,this)},setCurrentTime:function(e,t){r=e,v(a.a.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(function(){if(n){if(n.currentTime===r)return void(r=NaN);try{r=t?function(e){var t=E(),n=e,r=9999999999;if(t)for(var i=0;i=a&&e<=o)return e;s1&&void 0!==arguments[1]&&arguments[1];n&&(!t&&n.readyState<=2&&e>0?n.addEventListener("canplay",f):n.playbackRate=e)},getPlayedRanges:function(){return n?n.played:null},getEnded:function(){return n?n.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){if(null===e||!n||n.seeking||-1!==u.indexOf(e))return;u.push(e)}(e):function(e){var t=u.indexOf(e);if(null===e)return;-1!==t&&u.splice(t,1)}(e)}(e,t)},getElement:function(){return n},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(n=e)&&(n.preload="auto")},setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return i},setTTMLRenderingDiv:function(e){(i=e).style.position="absolute",i.style.display="flex",i.style.overflow="hidden",i.style.pointerEvents="none",i.style.top=0,i.style.left=0},getPlaybackQuality:function(){if(!n)return null;var e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:g,removeEventListener:m,getReadyState:y,getBufferRange:E,getClientWidth:function(){return n?n.clientWidth:NaN},getClientHeight:function(){return n?n.clientHeight:NaN},getTextTracks:function(){return n?n.textTracks:[]},getTextTrack:_,addTextTrack:function(e,t,r,i,a){if(!n)return null;var o=_(e,t,r,i,a);return o||((o=n.addTextTrack(e,t,r)).isEmbedded=a,o.isTTML=i),o},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){n&&n.removeChild(e)},getVideoWidth:function(){return n?n.videoWidth:NaN},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},waitForReadyState:v,reset:function(){s.off(c.a.PLAYBACK_PLAYING,p,this)}},t=Object(d.a)(o).getInstance().getLogger(e),r=NaN,e}an.__dashjs_factory_name="VideoModel";var on=f.a.getSingletonFactory(an),sn=n(36),un=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}];function ln(e){e=e||{};var t,n,r,i=this.context,o=e.settings;function s(e){if(void 0!==r)return r;r=!1;var t;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return n.warn("DOMStorage access denied: "+e.message),r}if(!t||"localStorage"!==e&&"sessionStorage"!==e)return r;try{t.setItem("1","1"),t.removeItem("1"),r=!0}catch(e){n.warn("DOMStorage is supported, but cannot be used: "+e.message)}return r}function u(){return 6e5*Math.round((new Date).getTime()/6e5)}function l(e,t){return s(e)&&o.get().streaming[t+"CachingInfo"].enabled}function c(){if(!o)throw new Error(a.a.MISSING_CONFIG_ERROR)}return t={getSavedBitrateSettings:function(e){var t=NaN;if(c(),l("localStorage","lastBitrate")){var r="dashjs_?_bitrate".replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=o.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(i.bitrate);isNaN(s)||a?a&&localStorage.removeItem(r):(t=s,n.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(l("localStorage","lastBitrate")&&t){var r="dashjs_?_bitrate".replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({bitrate:t.toFixed(3),timestamp:u()}))}catch(e){n.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(c(),l("localStorage","lastMediaSettings")){var n="dashjs_?_settings".replace(/\?/,e);try{var r=JSON.parse(localStorage.getItem(n))||{},i=(new Date).getTime()-parseInt(r.timestamp,10)>=o.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=r.settings,i&&(localStorage.removeItem(n),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(l("localStorage","lastMediaSettings")){var r="dashjs_?_settings".replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({settings:t,timestamp:u()}))}catch(e){n.error(e.message)}}}},n=Object(d.a)(i).getInstance().getLogger(t),s("localStorage")&&un.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){n.error(e.message)}}})),t}ln.__dashjs_factory_name="DOMStorage";var cn=f.a.getSingletonFactory(ln),fn=n(51),dn=n(27);function hn(){var e,t,n,r,i,a,o,s,u,l,c,f,d,h=this.context;function p(e,t,n){n({segments:e,representation:t,error:e?void 0:new y.a(u.SEGMENT_BASE_LOADER_ERROR_CODE,u.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function g(e){if(e.url){var t=new Be.a;return t.setInfo(e),t}}return e={setConfig:function(s){s.baseURLController&&(d=s.baseURLController),s.dashMetrics&&(a=s.dashMetrics),s.mediaPlayerModel&&(o=s.mediaPlayerModel),s.errHandler&&(n=s.errHandler),s.boxParser&&(r=s.boxParser),s.debug&&(t=s.debug.getLogger(e)),s.requestModifier&&(i=s.requestModifier),s.errors&&(u=s.errors),s.urlUtils&&(f=s.urlUtils),s.constants&&(l=s.constants),s.dashConstants&&(c=s.dashConstants)},initialize:function(){s=Object(Ue.a)(h).create({errHandler:n,dashMetrics:a,mediaPlayerModel:o,requestModifier:i,boxParser:r,errors:u,urlUtils:f,constants:l,dashConstants:c})},loadInitialization:function(e,n){return new Promise((function(i){!function e(n,i,a,o){var u=null,l=n?d.resolve(n.path):null,c=o||{init:!0,url:l?l.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:i};t.debug("Start searching for initialization.");var f=g(c),h=function(t){if(c.bytesLoaded=c.range.end,!(u=r.findInitRange(t)))return c.range.end=c.bytesLoaded+c.bytesToLoad,e(n,i,a,c);n.range=u,a(n)};s.load({request:f,success:h,error:function(){a(n)}}),t.debug("Perform init search: "+c.url)}(e,n,i)}))},loadSegments:function(e,n,i){return new Promise((function(a){!function e(n,i,a,o,u,l){if(a&&(void 0===a.start||void 0===a.end)){var c=a?a.toString().split("-"):null;a=c?{start:parseFloat(c[0]),end:parseFloat(c[1])}:null}u=u||p;var f=null,h=null,m=!!a,y=n?d.resolve(n.path):null,E={init:!1,url:y?y.url:void 0,range:m?a:{start:0,end:1500},searching:!m,bytesLoaded:l?l.bytesLoaded:0,bytesToLoad:1500,mediaType:i},_=g(E),v=function(a){var s=E.bytesToLoad,l=a.byteLength;if(E.bytesLoaded=E.range.end-E.range.start,f=r.parse(a),(h=f.getBox("sidx"))&&h.isComplete){var c,d,p=h.references;if(null!=p&&p.length>0&&(c=1===p[0].reference_type),c){var g,m,y,_;t.debug("Initiate multiple SIDX load."),E.range.end=E.range.start+h.size;var v=[],T=0,S=(h.offset||E.range.start)+h.size,A=function(e){e?(v=v.concat(e),++T>=m&&(v.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),u(v,n,o))):u(null,n,o)};for(g=0,m=p.length;g16777215?(n.getUint32(r)!==e.tag&&(i=!1),a=4):e.tag>65535?(256*n.getUint16(r)+n.getUint8(r+2)!==e.tag&&(i=!1),a=3):e.tag>255?(n.getUint16(r)!==e.tag&&(i=!1),a=2):(n.getUint8(r)!==e.tag&&(i=!1),a=1),!i&&e.required&&!t)throw new Error("required tag not found");return i&&(r+=a),i}function a(e){var t=1,i=128,a=-1,o=0,s=n.getUint8(r),u=0;for(u=0;u<8;u+=1){if((s&i)===i){o=void 0===e?s&~i:s,a=u;break}i>>=1}for(u=0;u1&&a){var l=d(a,n);if(i[a.id]&&i[a.id][n])for(var f=0,h=u.length;f0))return u;s=r[0].mpd.manifest}var l=E(e,o),c=t.getAdaptationsForType(s,e?e.index:null,n);return u=f(s,l,e,c,n),n===a.TEXT&&(c=t.getAdaptationsForType(s,e?e.index:null,a.VIDEO),u=u.concat(f(s,l,e,c,n,!0))),u}function h(e){var n=p(e);return t.getRegularPeriods(n)}function p(e){var n=m(e);return t.getMpd(n)}function g(){r=[],i={}}function m(e){return e||(r.length>0?r[0].mpd.manifest:null)}function y(e){try{var n=E(e.streamInfo,r),i=t.getAdaptationsForPeriod(n);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&i?i[e.index]:null}catch(e){return null}}function E(e,t){for(var n=t.length,r=0;r=0&&void 0!==s&&(n=t?"cea-608:"+t:"cea-608",r.embeddedCaptions=!0),n})),r.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i).map((function(e){return e.value})),0===r.audioChannelConfiguration.length&&Array.isArray(i.Representation_asArray)&&i.Representation_asArray.length>0&&(r.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(i.Representation_asArray[0]).map((function(e){return e.value}))),r.roles=t.getRolesForAdaptation(i).map((function(e){return e.value})),r.codec=t.getCodec(i),r.mimeType=t.getMimeType(i),r.contentProtection=t.getContentProtectionData(i),r.bitrateList=t.getBitrateListForAdaptation(i),r.selectionPriority=t.getSelectionPriority(i),r.contentProtection){var a=r.contentProtection.map((function(e){return t.getKID(e)})).filter((function(e){return null!==e}));if(a.length){var o=a[0];r.contentProtection.forEach((function(e){e.keyId=o}))}}return r.isText=t.getIsText(i),r.supplementalProperties=t.getSupplementalProperties(i),r.isFragmented=t.getIsFragmented(i),r.isEmbedded=!1,r}function v(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=a.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1,e.lang=n,e.roles=["caption"]}function T(e){var n,r,i=new An;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(n=e.mpd,(r=new bn).dvrWindowSize=n.timeShiftBufferDepth,r.loadedTime=n.manifest.loadedTime,r.availableFrom=n.availabilityStartTime,r.minBufferTime=n.manifest.minBufferTime,r.maxFragmentDuration=n.maxSegmentDuration,r.duration=t.getDuration(n.manifest),r.isDynamic=t.getIsDynamic(n.manifest),r.serviceDescriptions=t.getServiceDescriptions(n.manifest),r.protocol=n.manifest.protocol,r),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function S(){if(!a)throw new Error("setConfig function has to be called previously")}function A(e){return r.length>0?r[0].mpd.manifest.Period_asArray[e]:null}function b(e,t,n){var r,i,a,o,s;if(e)for(r=e.AdaptationSet_asArray,o=0;o0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=_(e.adaptation),n}return null},getStreamsInfo:function(e,t){var n=[],i=r;if(e&&(S(),i=h(e)),i.length>0){(!t||t>i.length)&&(t=i.length);for(var a=0;a0&&o&&(a=i?t.getAdaptationForId(i,r[0].mpd.manifest,o.index):t.getAdaptationForIndex(n?n.index:null,r[0].mpd.manifest,o.index)),a},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,r[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var n=y(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n){var i=[];if(r.length>0){var a=r[0].mpd.manifest;e instanceof An?i=t.getEventsForPeriod(E(e,r)):e instanceof Sn?i=t.getEventStreamForAdaptationSet(a,y(e)):e instanceof Tn&&(i=t.getEventStreamForRepresentation(a,n))}return i},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;var i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;var o,s=new In.a,u=e.timescale||1,l=r.adaptation.period.start,c=t[i+"/"+a],f=isNaN(r.presentationTimeOffset)?isNaN(c.presentationTimeOffset)?0:c.presentationTimeOffset:r.presentationTimeOffset,d=e.presentation_time_delta/u;o=0===e.version?l+n-f+d:l-f+d;var h=e.event_duration,p=e.id,g=e.message_data;return s.eventStream=c,s.eventStream.value=a,s.eventStream.timescale=u,s.duration=h,s.id=p,s.calculatedPresentationTime=o,s.messageData=g,s.presentationTimeDelta=d,s}catch(e){return null}},getMpd:p,setConfig:function(e){e&&(e.constants&&(a=e.constants),e.cea608parser&&(s=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;S(),r=h(e)},getIsTextTrack:function(e){return t.getIsText(e)},getUTCTimingSources:function(){var e=m();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=r.length>0?r[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var n=p(e);return t.getAvailabilityStartTime(n)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getIsDynamic:function(e){var n=m(e);return t.getIsDynamic(n)},getDuration:function(e){var n=m(e);return t.getDuration(n)},getRegularPeriods:h,getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var n=t.getPatchLocation(e),r=t.getPublishTime(e);if(!n||!r)return null;if(n.hasOwnProperty("ttl")&&r){var i=1e3*parseFloat(n.ttl);if(r.getTime()+i<=(new Date).getTime())return null}return n.__text},getManifestUpdatePeriod:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,n)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return n.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getPeriodById:function(e){if(!e||0===r.length)return null;var t=r.filter((function(t){return t.id===e}));return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,n){i[e]=i[e]||{},i[e][t]=i[e][t]||{},i[e][t]=n},isPatchValid:function(e,r){var i=t.getId(e),a=n.getMpdId(r),o=t.getPublishTime(e),s=n.getPublishTime(r),u=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&o&&u&&o.getTime()==u.getTime()&&s&&o.getTime()1?i[r]=u:1==u.length?i[r]=u[0]:delete i[r+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach((function(e){var n=t.value[e],a=i[e+"_asArray"]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{var u=a.length;u=e==r&&-1!=o?o+(s?0:1)+("replace"==t.action?-1:0):s?0:a.length,a.splice.apply(a,[u,0].concat(n))}i[e+"_asArray"]=a,i[e]=1==a.length?a[0]:a}))}}}))},areMediaInfosEqual:c,reset:g},t=Object(Rn.a)(u).getInstance(),n=Mn(u).getInstance(),g(),e}Pn.__dashjs_factory_name="DashAdapter";var Ln=f.a.getSingletonFactory(Pn);function Fn(e,t){for(var n=0;nr.get().streaming.metrics.maxListDepth&&i[t].shift())}function m(e,t,n){g(e,t,n),h(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete n[e],f(e)},clearAllCurrentMetrics:function(){n={},s()},getMetricsFor:p,addHttpRequest:function e(t,n,r,i,a,o,s,l,c,f,d,h,p,g,y){var E=new v.a;o&&o!==i&&(e(t,null,r,i,a,null,null,l,c,null,null,null,p,null,null),E.actualurl=o),E.tcpid=n,E.type=r,E.url=i,E.range=l,E.trequest=c,E.tresponse=f,E.responsecode=h,E._tfinish=d,E._stream=t,E._mediaduration=p,E._quality=a,E._responseHeaders=g,E._serviceLocation=s,y?y.forEach((function(e){!function(e,t,n,r,i){var a=new v.b;a.s=t,a.d=n,a.b=r,a.t=i,e.trace.push(a),e.interval||(e.interval=0),e.interval+=n}(E,e.s,e.d,e.b,e.t)})):(delete E.interval,delete E.trace),m(t,u.HTTP_REQUEST,E)},addRepresentationSwitch:function(e,t,n,r,i){var a=new Bn;a.t=t,a.mt=n,a.to=r,i?a.lto=i:delete a.lto,m(e,u.TRACK_SWITCH,a)},addBufferLevel:function(e,t,n){var r=new kn;r.t=t,r.level=n,m(e,u.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new Gn;r.target=n,r.state=t,m(e,u.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var i=new jn;i.time=t,i.range=r,i.manifestInfo=n,m(e,u.DVR_INFO,i)},addDroppedFrames:function(e,t){var n=new Yn,r=p(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||m(e,u.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,i,a,o,s,l){var c=new Wn;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=i,c.duration=a,c.quality=o,c.range=s,c.state=l,m(e,u.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var r=new zn;r.loadingRequests=t,r.executedRequests=n,p(e).RequestsQueue=r,h(e,u.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,r,i,o,s,l,c,f){var d=new Kn;d.mediaType=e,d.type=t,d.requestTime=n,d.fetchTime=r,d.availabilityStartTime=i,d.presentationStartTime=o,d.clientTimeOffset=s,d.currentTime=l,d.buffered=c,d.latency=f,g(a.a.STREAM,u.MANIFEST_UPDATE,d),h(e,u.MANIFEST_UPDATE,d)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];d(e.mediaType,u.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,i){if(e){var a=new qn;a.id=t,a.index=n,a.start=r,a.duration=i,e.streamInfo.push(a),d(e.mediaType,u.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,i,a,o,s){if(e&&e.representationInfo){var l=new Vn;l.id=t,l.index=n,l.streamIndex=r,l.mediaType=i,l.startNumber=o,l.fragmentInfoType=s,l.presentationTimeOffset=a,e.representationInfo.push(l),d(e.mediaType,u.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,m(a.a.STREAM,u.PLAY_LIST,e)},addDVBErrors:function(e){m(a.a.STREAM,u.DVB_ERRORS,e)}},n={},t}Xn.__dashjs_factory_name="MetricsModel";var Qn=f.a.getSingletonFactory(Xn),$n=n(14);function Zn(e){e=e||{};var t,n,r,i,o=this.context,s=e.metricsModel;function l(e){var t=s.getMetricsFor(e,!0);if(!t)return null;var n,r=t.HttpList,i=null;if(!r||r.length<=0)return null;for(n=r.length-1;n>=0;){if(r[n].responsecode){i=r[n];break}n--}return i}function c(e){var t=s.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function f(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return f(s.getMetricsFor(e,!0),u.TRACK_SWITCH)},getCurrentBufferState:function(e){return f(s.getMetricsFor(e,!0),u.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=f(s.getMetricsFor(e,!0),u.BUFFER_LEVEL);return t?xn.round10(t.level/1e3,-3):0},getCurrentHttpRequest:l,getHttpRequests:c,getCurrentDroppedFrames:function(){return f(s.getMetricsFor(a.a.VIDEO,!0),u.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return f(s.getMetricsFor(e,!0),u.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return f(e?s.getMetricsFor(e,!0):s.getMetricsFor(a.a.VIDEO,!0)||s.getMetricsFor(a.a.AUDIO,!0),u.DVR_INFO)},getCurrentManifestUpdate:function(){return f(s.getMetricsFor(a.a.STREAM),u.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;var n={},r=l(e);r&&(n=$n.a.parseHttpHeaders(r._responseHeaders));var i=n[t.toLowerCase()];return void 0===i?null:i},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;var t,n,r,i={};for(r=(t=c(a.a.STREAM)).length-1;r>=0;r--)if((n=t[r]).type===v.a.MPD_TYPE){i=$n.a.parseHttpHeaders(n._responseHeaders);break}var o=i[e.toLowerCase()];return void 0===o?null:o},addRepresentationSwitch:function(e,t,n,r,i){s.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){s.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();s.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();s.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();s.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){s.addManifestUpdate(a.a.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i){s.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,r,i)},addSchedulingInfo:function(e,t){s.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){s.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){s.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){s.addBufferState(e,t,n)},addDroppedFrames:function(e){s.addDroppedFrames(a.a.VIDEO,e)},addPlayList:function(){i&&(s.addPlayList(i),i=null)},addDVBErrors:function(e){s.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(i=new B).start=new Date,i.mstart=e,i.starttype=t},createPlaylistTraceMetrics:function(e,t,i){!0===n&&(n=!1,(r=new k).representationid=e,r.start=new Date,r.mstart=t,r.playbackspeed=null!==i?i.toString():null)},updatePlayListTraceMetrics:function(e){if(r)for(var t in r)r[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===n&&i&&r&&r.start){var a=r.start,o=e.getTime()-a.getTime();r.duration=o,r.stopreason=t,i.trace.push(r),n=!0}},clearAllCurrentMetrics:function(){s.clearAllCurrentMetrics()}},s=s||Qn(o).getInstance({settings:e.settings}),n=!0,r=null,i=null,t}Zn.__dashjs_factory_name="DashMetrics";var Jn=f.a.getSingletonFactory(Zn);function er(){var e,t,n,r,i=this.context,s=Object(l.a)(i).getInstance(),u=Object(_.a)(i).getInstance();function f(e){r=e}function d(e,t,n,r){var i,a=t.adaptation.period.mpd,o=a.availabilityStartTime;if(r)i=n&&a.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(o.getTime()+1e3*(e+a.timeShiftBufferDepth)):a.availabilityEndTime;else if(n){var s=t.availabilityTimeOffset;i=new Date(o.getTime()+1e3*(e-s))}else i=o;return i}function p(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*r)/1e3}function g(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function m(e){var n={start:NaN,end:NaN},r=e[0].getAdapter().getRegularPeriods()[0],i=p(new Date,r);if(!e||0===e.length)return{range:n,now:i};e.forEach((function(e){var r=e.getAdapter(),s=r.getMediaInfoForType(e.getStreamInfo(),a.a.VIDEO)||r.getMediaInfoForType(e.getStreamInfo(),a.a.AUDIO),u=r.getVoRepresentations(s)[0],l={start:NaN,end:NaN};if(u)if(u.segmentInfoType===o.a.SEGMENT_TIMELINE)l=function(e){var n,r,i,a,o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],s=t.getRepresentationFor(e.index,o),u=s.SegmentTemplate.SegmentTimeline,l=s.SegmentTemplate.timescale,c=u.S_asArray,f={start:0,end:0},d=0;for(f.start=g(c[0].t/l,e),i=0,a=c.length;il.start)&&(n.start=l.start),!isNaN(l.end)&&(isNaN(n.end)||n.end2&&void 0!==arguments[2]&&arguments[2];try{for(var r=0,i=!1,a=NaN;!i&&r=t)?(a=t,i=!0):!n&&o.start>t&&(isNaN(a)||o.starta)&&(a=o.start+o.duration),r+=1}return a}catch(e){return t}}function v(e){void 0===e.offset||isNaN(e.offset)||f(e.offset/1e3)}function T(){r=0,n=0}function S(){s.off(c.a.UPDATE_TIME_SYNC_OFFSET,v,this),T()}return e={initialize:function(){T(),s.on(c.a.UPDATE_TIME_SYNC_OFFSET,v,this)},getClientTimeOffset:function(){return r},setClientTimeOffset:f,getClientReferenceTime:function(){return Date.now()-1e3*n+1e3*r},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return d(e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return d(e,t,n,!0)},calcPresentationTimeFromWallTime:p,calcPresentationTimeFromMediaTime:g,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcWallTimeForSegment:function(e,t){var n,r,i;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},calcTimeShiftBufferWindow:function(e,t){if(!t)return function(e){var t={start:NaN,end:NaN},n=0,r=NaN;return e.forEach((function(e){var t=e.getStreamInfo();n+=t.duration,(isNaN(r)||t.start0&&(g.spans.push({name:m,line:T,row:c}),T="");var N="style_cea608_"+R.foreground+"_"+R.background;R.underline&&(N+="_underline"),R.italics&&(N+="_italics"),E.hasOwnProperty(N)||(E[N]=JSON.parse(JSON.stringify(R))),S=R,m=N}T+=I.uchar}T.trim().length>0&&g.spans.push({name:m,line:T,row:c}),h=!0,p=A}else h=!1,p=-1,d&&(d.p.push(g),g={start:s,end:u,spans:[]},d.y2=c,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(_.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null)}d&&(d.p.push(g),d.y2=c+1,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(_.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null);var w=[];for(c=0;c<_.length;++c){var C=_[c],D="sub_cea608_"+e++,O=document.createElement("div");O.id=D;var M=n(C);O.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+M;var P=document.createElement("div");P.className="paragraph bodyStyle",P.style.cssText=i(r);var L=document.createElement("div");L.className="cueUniWrapper",L.style.cssText="unicode-bidi: normal; direction: ltr;";for(var F=0;F0){if(0!==f&&U!=B.row){var k=document.createElement("br");k.className="lineBreak",L.appendChild(k)}var G=!1;U===B.row&&(G=!0),U=B.row;var j=E[B.name],Y=document.createElement("span");Y.className="spanPadding "+B.name+" customSpanColor",Y.style.cssText=i(r,j),0!==f&&G?f===x.spans.length-1?Y.textContent=o(B.line):Y.textContent=B.line:x.spans.length>1&&f1&&e.isEmbedded?t=e.id&&e.id===a.a.CC1:1===_.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===_.length&&(t=e.index===s[0].index);return t}(e),t.isFragmented=e.isFragmented,t.isEmbedded=!!e.isEmbedded,t.isTTML=function(e){return e.codec&&e.codec.search(a.a.STPP)>=0||e.mimeType&&e.mimeType.search(a.a.TTML)>=0}(e),t.kind=function(e,t){var n=e.roles&&e.roles.length>0?t[e.roles[0]]:t.caption;return n=n===t.caption||n===t.subtitle?n:t.caption}(e,{subtitle:"subtitles",caption:"captions"}),C.addTextTrack(t)}function k(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&j(t.bytes,t)}function G(e){m=e}function j(e,s){var l=s.mediaInfo,c=l.type,d=l.mimeType,p=l.codec||d;p?-1!==l.codec.indexOf("application/mp4")?function(e,i,s){var l,c;if("InitializationSegment"===i.segmentType)f=!0,h=r.getMediaTimescaleFromMoov(e);else{if(!f)return;c=r.getSamplesInfo(e),(l=c.sampleList).length>0&&(g=l[0].cts-i.start*h),s.search(a.a.STPP)>=0?function(e,r,i){var s,l;for(o=null!==o?o:K(i),s=0;s0&&C.addCaptions(m,0,s)}(e,l)}}(e,s,p):c===a.a.VIDEO?function(e,t){var a,o;if(t.segmentType===v.a.INIT_SEGMENT_TYPE)0===T&&(T=r.getMediaTimescaleFromMoov(e));else if(t.segmentType===v.a.MEDIA_SEGMENT_TYPE){if(0===T)return void n.warn("CEA-608: No timescale for embeddedTextTrack yet");var s=(o=r.getSamplesInfo(e)).lastSequenceNumber;if(A[0]||A[1]||function(){for(var e,t=0;t<_.length;t++){if(-1===(e=C.getTrackIdxForId(_[t].id)))return void n.warn("CEA-608: data before track is ready.");var r=Y(e);A[t]=new i.a.Cea608Parser(t+1,{newCue:r},null)}}(),T){if(null!==S&&s!==S+o.numSequences)for(a=0;a0){o.cts!==u?l=0:l+=1;var h=H();n.fields[d].push([o.cts+h*T,f[d],l]),u=o.cts}return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,o.sampleList),l=0;l=0?t=D:(e.search(a.a.TTML)>=0||e.search(a.a.STPP)>=0)&&(t=O),t}function q(e){_.forEach((function(t){var n=C.getTrackIdxForId(t.id);n>=0&&C.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return t={initialize:function(){F||(_=[],m=null,T=0,A=[],S=null,F=!0,b=pr(P).getInstance(),L.on(c.a.VIDEO_CHUNK_RECEIVED,k,t),L.on(c.a.BUFFER_CLEARED,q,t))},addMediaInfos:function(e,n,r){if(s=s.concat(n),e===a.a.TEXT&&n[0].isFragmented&&!n[0].isEmbedded){u=r,t.buffered=Object(dr.a)(P).create(),p=N.getTracksFor(a.a.TEXT,M.id).filter((function(e){return e.isFragmented}));for(var i=N.getCurrentTrackFor(a.a.TEXT,M.id),o=0;on/r?o=(s=t)/r*n:s=(o=e)/n*r;var u,l,c=0,f=0;return o/s>i?(f=s,c=s*i):(c=o,f=o/i),u=(e-c)/2,l=(t-f)/2,a?{x:u+.1*c,y:l+.1*f,w:.8*c,h:.8*f}:{x:u,y:l,w:c,h:f}}function w(e,t){var n=I.getClientWidth(),r=I.getClientHeight(),i=I.getVideoWidth(),a=I.getVideoHeight(),o=I.getVideoRelativeOffsetTop(),s=I.getVideoRelativeOffsetLeft();if(0!==i&&0!==a){var l=i/a,c=!1;e.isFromCEA608&&(l=3.5/3,c=!0);var d=N.call(this,n,r,i,a,l,c),y=d.w,v=d.h,S=d.x,A=d.y;if(y!=p||v!=g||S!=u||A!=f||t){if(u=S+s,f=A+o,p=y,g=v,m){var R=m.style;R&&(R.left=u+"px",R.top=f+"px",R.width=p+"px",R.height=g+"px",R.zIndex=E&&document[E]||_?T:null,b.trigger(h.a.CAPTION_CONTAINER_RESIZE))}var w=e.activeCues;if(w)for(var C=w.length,D=0;D=0&&i[e]?I.getTextTrack(i[e].kind,i[e].id,i[e].lang,i[e].isTTML,i[e].isEmbedded):null}function P(e){var t=this;if(e!==s){var n=M(s=e);L.call(this,n),y&&(clearInterval(y),y=null),n&&"html"===n.renderingType&&(w.call(this,n,!0),window.ResizeObserver?(S=new window.ResizeObserver((function(){w.call(t,n,!0)}))).observe(I.getElement()):y=setInterval(w.bind(this,n),500))}}function L(e){G.call(this),e&&"html"===e.renderingType?B.call(this):k.call(this)}function F(e,t){if(!e.cues)return!1;for(var n=0;n=t)&&(isNaN(n)||e.endTime<=n)}function U(e,t,n){if(e.cues)for(var r=e.cues,i=r.length-1;i>=0;i--)x(r[i],t,n)&&(r[i].onexit&&r[i].onexit(),e.removeCue(r[i]))}function B(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,r=I.getElement();try{r&&(r.id?t.insertRule("#"+r.id+"::cue {background: transparent}",0):0!==r.classList.length?t.insertRule("."+r.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){n.info(""+e.message)}}}function k(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function G(){if(m)for(;m.firstChild;)m.removeChild(m.firstChild)}return t={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(r=window.VTTCue||window.TextTrackCue,i=[],o=[],s=-1,u=0,f=0,p=0,g=0,m=null,y=null,_=!1,T=2147483647,v=null,void 0!==document.fullscreenElement?E="fullscreenElement":void 0!==document.webkitIsFullScreen?E="webkitIsFullScreen":document.msFullscreenElement?E="msFullscreenElement":document.mozFullScreen&&(E="mozFullScreen"))},getStreamId:function(){return R.id},addTextTrack:function(e){i.push(e)},addCaptions:O,createTracks:function(){i.sort((function(e,t){return e.index-t.index})),m=I.getTTMLRenderingDiv();for(var e,t,n,r,u,l,f=-1,d=0;d=0){b.on(h.a.PLAYBACK_METADATA_LOADED,(function e(){var t=M(f);t&&"html"===t.renderingType&&w.call(this,t,!0),b.off(h.a.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var y=0;y1){var n=e.split(/:/)[1];n&&-1!=n.search(/%/)&&(n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line=n),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n)}})),t}function c(e,t){for(var n,i=t,a="",o="";""!==e[i]&&i1)for(var s=0;s0&&"WEBVTT"!==d&&d.match(r)){var h=u(d),p=h.cuePoints,g=h.styles,m=c(e,f+1),y=s(p[0].replace(i,"")),E=s(p[1].replace(i,""));!isNaN(y)&&!isNaN(E)&&y>=o&&E>y?""!==m?(o=y,l.push({start:y,end:E,data:m,styles:g})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return l}},t=Object(d.a)(o).getInstance().getLogger(e),n=/(?:\r\n|\r|\n)/gm,r=/-->/,i=/(^[\s]+|[\s]+$)/g,a=/\s\b/g,e}vr.__dashjs_factory_name="VTTParser";var Tr=f.a.getSingletonFactory(vr);function Sr(){var e,t,n=this.context,r=Object(l.a)(n).getInstance(),i=0;return e={parse:function(e,n,a,o,s){var u,l,f,d="",p=[],g={},m={},y="",E="",_={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(r.trigger(h.a.CONFORMANCE_VIOLATION,{level:pe.LEVELS.ERROR,event:pe.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void t.warn("smpte-tt imageType != PNG. Discarded");y=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){y&&(m[y]=E.trim()),E="",y=""},onText:function(e){y&&(E+=e)}};if(!e)throw d="no ttml data to parse",new Error(d);g.data=e,r.trigger(c.a.TTML_TO_PARSE,g);var v=Object(yr.fromXML)(g.data,(function(e){d=e}),_);r.trigger(c.a.TTML_PARSED,{ttmlString:g.data,ttmlDoc:v});var T,S=v.getMediaTimeEvents();for(f=0;fo?o:S[f+1]+n)&&p.push({start:u,end:l,type:"html",cueID:(T=void 0,T="cue_TTML_"+i,i++,T),isd:A,images:s,embeddedImages:m})}if(""!==d)throw t.error(d),new Error(d);return p}},t=Object(d.a)(n).getInstance().getLogger(e),e}Sr.__dashjs_factory_name="TTMLParser";var Ar=f.a.getSingletonFactory(Sr);function br(e){var t,n,r,i,o,s,u,f,d,p,g,m,y,E=this.context,_=e.adapter,v=e.errHandler,T=e.manifestModel,S=e.mediaController,A=e.videoModel,b=e.settings;function I(e){var t=e.tracks,r=e.index,i=e.streamId;!1===b.get().streaming.text.defaultEnabled&&!N()||y?w(i,-1):(f&&t.some((function(e,t){if(S.matchSettings(f,e))return w(i,t),r=t,!0})),p=!1),n[i].lastEnabledIndex=r,u.trigger(h.a.TEXT_TRACKS_ADDED,{enabled:N(),index:r,tracks:t,streamId:i}),m=!0}function R(e){if(!d&&e&&e.newMediaInfo){var t=e.newMediaInfo;t.type===a.a.TEXT&&(f={lang:t.lang,role:t.roles[0],index:t.index,codec:t.codec,accessibility:t.accessibility[0]})}}function N(){var e=!0;return p&&!g&&(e=!1),e}function w(e,t){(p=-1===t)&&S&&S.saveTextSettingsDisabled();var n=C(e);if(n!==t&&i[e]){i[e].setModeForTrackIdx(n,a.a.TEXT_HIDDEN),i[e].setCurrentTrackIdx(t),i[e].setModeForTrackIdx(t,a.a.TEXT_SHOWING);var o=i[e].getCurrentTrackInfo();o&&o.isFragmented&&!o.isEmbedded?function(e,t,n){if(!r[e])return;for(var o=r[e].getConfig().fragmentedTracks,s=0;s3&&void 0!==arguments[3]?arguments[3]:null,a=e.id;r[a]&&r[a].addMediaInfos(t,n,i)},reset:function(){D(),u.off(c.a.CURRENT_TRACK_CHANGED,R,t),u.off(c.a.TEXT_TRACKS_QUEUE_INITIALIZED,I,t),Object.keys(r).forEach((function(e){r[e].resetEmbedded(),r[e].reset()}))}},f=null,g=!1,m=!1,d=!1,y=!1,o=Tr(E).getInstance(),s=Ar(E).getInstance(),u=Object(l.a)(E).getInstance(),D(),t}br.__dashjs_factory_name="TextController";var Ir=f.a.getClassFactory(br);function Rr(){var e,t,n,r,s,p,m,T,S,A,b,I,R,N,w,C,D,O,P,U,B,k,G,j,Y,H,K,q,V,W,z,X,Q,$,Z,J,ee="You must first call initialize() and set a source before calling this method",te="You must first call initialize() and set a valid source and view before calling this method",ne="You must first call attachView() to set the video element before calling this method",re=this.context,ie=Object(l.a)(re).getInstance(),oe=Object(_.a)(re).getInstance(),se=Object(d.a)(re).getInstance({settings:oe});function ue(){Ie(null),Te(null),r=null,R&&(R.reset(),R=null),N&&(N.reset(),N=null),oe.reset(),C&&(C.reset(),C=null)}function le(){return!!n&&!!W.getElement()}function ce(){return Object(fn.a)()}function fe(){if(!m)throw te;return H.isPaused()}function de(e){var t=G&&G.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,n=K.getCurrentDVRInfo(t);if(!n)return 0;var r=H.getLiveDelay(),i=n.range.start+e;return i>n.range.end-r&&(i=n.range.end-r),i}function he(e){if(!m)throw te;var t=_e().currentTime;if(void 0!==e)t=G.getTimeRelativeToStreamId(t,e);else if(H.getIsDynamic()){var n=G&&G.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,r=K.getCurrentDVRInfo(n);t=null===r||0===t?0:Math.max(0,t-r.range.start)}return t}function pe(){if(!m)throw te;var e=_e().duration;if(H.getIsDynamic()){var t=G&&G.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,n=K.getCurrentDVRInfo(t);e=n?n.range.end-n.range.start:0}return e}function ge(e){Object(M.b)(e,"boolean"),T=e}function me(){O.restoreDefaultUTCTimingSources()}function ye(){return K}function _e(){if(!W.getElement())throw ne;return W.getElement()}function Te(e){if(!s)throw"MediaPlayer not initialized!";W.setElement(e),e&&(Ce(),function(){if(N)return;var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(re).create();N=t.createMetricsReporting({debug:se,eventBus:ie,mediaElement:_e(),adapter:D,dashMetrics:K,events:c.a,constants:a.a,metricsConstants:u})}}(),function(){if(w)return;var e=dashjs.MssHandler;"function"==typeof e&&(E.a.extend(e.errors),w=e(re).create({eventBus:ie,mediaPlayerModel:O,dashMetrics:K,manifestModel:q,playbackController:H,streamController:G,protectionController:R,baseURLController:U,errHandler:P,events:c.a,constants:a.a,debug:se,initSegmentType:v.a.INIT_SEGMENT_TYPE,BASE64:rr.a,ISOBoxer:ar.a,settings:oe}))}(),G&&G.switchToVideoElement()),m&&Ne(),Me()}function Se(e){if(!p)throw ee;var t=G.getActiveStreamInfo();return t?I.getTracksFor(e,t.id):[]}function be(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function Ie(e){if(!s)throw"MediaPlayer not initialized!";"string"==typeof e&&z.initialize(e),n=e,(p||m)&&Ne(),le()&&Me()}function Re(){if(!p)throw ee;var e=G.getActiveStreamInfo();return e?G.getStreamById(e.id):null}function Ne(){m=!1,p=!1,D.reset(),G.reset(),Y.reset(),H.reset(),S.reset(),I.reset(),Q.reset(),R&&(oe.get().streaming.protection.keepProtectionMediaKeys?R.stop():(R.reset(),R=null,Ce())),j.reset(),V.reset()}function we(){return Ze(re).create({debug:se,errHandler:P,dashMetrics:K,mediaPlayerModel:O,requestModifier:Object(L.a)(re).getInstance(),mssHandler:w,settings:oe})}function Ce(){if(R)return R;var e=dashjs.Protection;if("function"==typeof e){var t=e(re).create();return c.a.extend(e.events),h.a.extend(e.events,{publicOnly:!0}),E.a.extend(e.errors),B||(B=Object(tt.a)(re).getInstance()),(R=t.createProtectionSystem({debug:se,errHandler:P,videoModel:W,capabilities:B,eventBus:ie,events:c.a,BASE64:rr.a,constants:a.a,cmcdModel:V,settings:oe}))&&(R.setLicenseRequestFilters($),R.setLicenseResponseFilters(Z)),R}return null}function De(){if(!s)throw"MediaPlayer not initialized!";if(C)return C;var e=dashjs.OfflineController;if("function"==typeof e){c.a.extend(e.events),h.a.extend(e.events,{publicOnly:!0}),E.a.extend(e.errors);var t=we(),n=ae(re).create();return n.setConfig({manifestModel:q,adapter:D,manifestLoader:t,errHandler:P}),C=e(re).create({debug:se,manifestUpdater:n,baseURLController:U,manifestLoader:t,manifestModel:q,mediaPlayerModel:O,abrController:S,playbackController:H,adapter:D,errHandler:P,dashMetrics:K,timelineConverter:b,segmentBaseController:Q,schemeLoaderFactory:A,eventBus:ie,events:c.a,errors:E.a,constants:a.a,settings:oe,dashConstants:o.a,urlUtils:Object(F.a)(re).getInstance()})}return null}function Oe(e){var t=G&&G.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,n=K.getCurrentDVRInfo(t);return n?e+(n.manifestInfo.availableFrom.getTime()/1e3+n.range.start):0}function Me(){var e;C&&C.resetRecords(),!p&&n&&(p=!0,t.info("Streaming Initialized"),e=we(),G||(G=Ee(re).getInstance()),j||(j=Ir(re).create({errHandler:P,manifestModel:q,adapter:D,mediaController:I,videoModel:W,settings:oe})),k.setConfig({capabilities:B,adapter:D,settings:oe,manifestModel:q,errHandler:P}),k.setCustomCapabilitiesFilters(J),G.setConfig({capabilities:B,capabilitiesFilter:k,manifestLoader:e,manifestModel:q,mediaPlayerModel:O,protectionController:R,textController:j,adapter:D,dashMetrics:K,errHandler:P,timelineConverter:b,videoModel:W,playbackController:H,abrController:S,mediaController:I,settings:oe,baseURLController:U,uriFragmentModel:z,segmentBaseController:Q}),Y.setConfig({settings:oe,playbackController:H,streamController:G,videoModel:W,timelineConverter:b,adapter:D}),H.setConfig({streamController:G,dashMetrics:K,mediaPlayerModel:O,adapter:D,videoModel:W,timelineConverter:b,settings:oe}),S.setConfig({streamController:G,domStorage:X,mediaPlayerModel:O,dashMetrics:K,adapter:D,videoModel:W,settings:oe}),V.setConfig({abrController:S,dashMetrics:K,playbackController:H}),S.initialize(),G.initialize(T,r),j.initialize(),Y.initialize(),V.initialize(),Q.initialize(),"string"==typeof n?G.load(n):G.loadWithManifest(n)),!m&&le()&&(m=!0,t.info("Playback Initialized"))}return e={initialize:function(e,n,r){B||(B=Object(tt.a)(re).getInstance()).setConfig({settings:oe}),P||(P=et(re).getInstance()),B.supportsMediaSource()?(s||(s=!0,b=tr(re).getInstance(),S||(S=tn(re).getInstance()).setConfig({settings:oe}),A||(A=Object(nn.a)(re).getInstance()),H||(H=g(re).getInstance()),I||(I=Ae(re).getInstance()),G||(G=Ee(re).getInstance()),Y||(Y=ve(re).getInstance()),k||(k=rt(re).getInstance()),D=Ln(re).getInstance(),q=ut(re).getInstance(),V=Object(sn.a)(re).getInstance(),K=Jn(re).getInstance({settings:oe}),X=cn(re).getInstance({settings:oe}),D.setConfig({constants:a.a,cea608parser:i.a,errHandler:P,BASE64:rr.a}),U||(U=xe(re).create()),U.setConfig({adapter:D}),Q||(Q=vn(re).getInstance({dashMetrics:K,mediaPlayerModel:O,errHandler:P,baseURLController:U,events:c.a,eventBus:ie,debug:se,boxParser:Object(x.a)(re).getInstance(),requestModifier:Object(L.a)(re).getInstance(),errors:E.a})),I.setConfig({domStorage:X,settings:oe}),me(),ge(void 0===r||r),De()),e&&Te(e),n&&Ie(n),t.info("[dash.js "+ce()+"] MediaPlayer has been initialized")):P.error(new y.a(E.a.CAPABILITY_MEDIASOURCE_ERROR_CODE,E.a.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(B=e.capabilities),e.capabilitiesFilter&&(k=e.capabilitiesFilter),e.streamController&&(G=e.streamController),e.textController&&(j=e.textController),e.gapController&&(Y=e.gapController),e.playbackController&&(H=e.playbackController),e.mediaPlayerModel&&(O=e.mediaPlayerModel),e.abrController&&(S=e.abrController),e.schemeLoaderFactory&&(A=e.schemeLoaderFactory),e.mediaController&&(I=e.mediaController),e.settings&&(oe=e.settings))},on:function(e,t,n,r){ie.on(e,t,n,r)},off:function(e,t,n){ie.off(e,t,n)},extend:function(e,t,n){f.a.extend(e,t,n,re)},attachView:Te,attachSource:Ie,isReady:le,play:function(){if(!m)throw te;(!T||fe()&&m)&&H.play()},isPaused:fe,pause:function(){if(!m)throw te;H.pause()},isSeeking:function(){if(!m)throw te;return H.isSeeking()},isDynamic:function(){if(!m)throw te;return H.getIsDynamic()},seek:function(e){if(!m)throw te;if(Object(M.b)(e,"number"),isNaN(e))throw a.a.BAD_ARGUMENT_ERROR;var t=H.getIsDynamic()?de(e):e;H.seek(t)},setPlaybackRate:function(e){_e().playbackRate=e},getPlaybackRate:function(){return _e().playbackRate},setMute:function(e){Object(M.b)(e,"boolean"),_e().muted=e},isMuted:function(){return _e().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw a.a.BAD_ARGUMENT_ERROR;_e().volume=e},getVolume:function(){return _e().volume},time:he,duration:pe,timeAsUTC:function(){if(!m)throw te;return he()<0?NaN:Oe(he())},durationAsUTC:function(){if(!m)throw te;return Oe(pe())},getActiveStream:Re,getDVRWindowSize:function(){var e=G&&G.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,t=K.getCurrentDVRInfo(e);return t?t.manifestInfo.dvrWindowSize:0},getDVRSeekOffset:de,convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),a=i.toLocaleDateString(t),o=i.toLocaleTimeString(t,{hour12:n});return r?o+" "+a:o},getVersion:ce,getDebug:function(){return se},getBufferLength:function(e){var n=[a.a.VIDEO,a.a.AUDIO,a.a.TEXT];if(e){if(-1!==n.indexOf(e)){var r=ye().getCurrentBufferLevel(e);return r||NaN}return t.warn("getBufferLength requested for invalid type"),NaN}var i=n.map((function(e){return Se(e).length>0?ye().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return i===Number.MAX_VALUE?NaN:i},getTTMLRenderingDiv:function(){return W?W.getTTMLRenderingDiv():null},getVideoElement:_e,getSource:function(){if(!n)throw"You must first call attachSource() with a valid source before calling this method";return n},getCurrentLiveLatency:function(){if(!s)throw"MediaPlayer not initialized!";return m?H.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!p)throw ee;return S.getTopBitrateInfoFor(e)},setAutoPlay:ge,getAutoPlay:function(){return T},getDashMetrics:ye,getQualityFor:function(e){if(!p)throw ee;if(e===a.a.IMAGE){var t=Re();if(!t)return-1;var n=t.getThumbnailController();return n?n.getCurrentTrackIndex():-1}return S.getQualityFor(e)},setQualityFor:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!p)throw ee;if(e===a.a.IMAGE){var r=Re();if(!r)return;var i=r.getThumbnailController();i&&i.setTrackByIndex(t)}S.setPlaybackQuality(e,G.getActiveStreamInfo(),t,{forceReplace:n})},updatePortalSize:function(){S.setElementSize(),S.setWindowResizeEventCalled(!0)},enableText:function(e){var t=G.getActiveStreamInfo();return!(!t||!j)&&j.enableText(t.id,e)},enableForcedTextStreaming:function(e){return!(!G.getActiveStreamInfo()||!j)&&j.enableForcedTextStreaming(e)},isTextEnabled:function(){var e=G.getActiveStreamInfo();return!(!e||!j)&&j.isTextEnabled(e)},setTextTrack:function(e){if(!m)throw te;var t=G.getActiveStreamInfo();t&&j&&j.setTextTrack(t.id,e)},getBitrateInfoListFor:function(e){if(!p)throw ee;var t=Re();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!p)throw ee;return D.getStreamsInfo(e)},getTracksFor:Se,getTracksForTypeFromManifest:function(e,t,n){if(!p)throw ee;return(n=n||D.getStreamsInfo(t,1)[0])?D.getAllMediaInfoForType(n,e,t):[]},getCurrentTrackFor:function(e){if(!p)throw ee;var t=G.getActiveStreamInfo();return I.getCurrentTrackFor(e,t.id)},setInitialMediaSettingsFor:function(e,t){if(!s)throw"MediaPlayer not initialized!";I.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!s)throw"MediaPlayer not initialized!";return I.getInitialSettings(e)},setCurrentTrack:function(e){if(!p)throw ee;I.setTrack(e)},addABRCustomRule:function(e,t,n){O.addABRCustomRule(e,t,n)},removeABRCustomRule:function(e){O.removeABRCustomRule(e)},removeAllABRCustomRule:function(){O.removeABRCustomRule()},getAverageThroughput:function(e){var t=S.getThroughputHistory(),n=H.getIsDynamic();return t?t.getAverageThroughput(e,n):0},retrieveManifest:function(e,t){var n=we(),r=this;ie.on(c.a.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),ie.off(c.a.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),z.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){O.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){O.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){O.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:me,setXHRWithCredentialsForType:function(e,t){O.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return O.getXHRWithCredentialsForType(e)},getProtectionController:function(){return Ce()},attachProtectionController:function(e){R=e},setProtectionData:function(e){r=e,G&&G.setProtectionData(r)},registerLicenseRequestFilter:function(e){$.push(e),R&&R.setLicenseRequestFilters($)},registerLicenseResponseFilter:function(e){Z.push(e),R&&R.setLicenseResponseFilters(Z)},unregisterLicenseRequestFilter:function(e){be($,e),R&&R.setLicenseRequestFilters($)},unregisterLicenseResponseFilter:function(e){be(Z,e),R&&R.setLicenseResponseFilters(Z)},registerCustomCapabilitiesFilter:function(e){J.push(e),k&&k.setCustomCapabilitiesFilters(J)},unregisterCustomCapabilitiesFilter:function(e){be(J,e),k&&k.setCustomCapabilitiesFilters(J)},setCustomInitialTrackSelectionFunction:function(e){I&&I.setCustomInitialTrackSelectionFunction(e)},resetCustomInitialTrackSelectionFunction:function(){I&&I.setCustomInitialTrackSelectionFunction(null)},attachTTMLRenderingDiv:function(e){if(!W.getElement())throw ne;W.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=G.getActiveStreamInfo();if(e&&j)return j.getCurrentTrackIdx(e.id)},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=H.getIsDynamic()?de(e):e,r=G.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i)return i.provide(n,t);t(null)}else t(null)}},getDashAdapter:function(){return D},getOfflineController:function(){return De()},getSettings:function(){return oe.get()},updateSettings:function(e){oe.update(e)},resetSettings:function(){oe.reset()},reset:ue,destroy:function(){ue(),$=[],Z=[],J=[],f.a.deleteSingletonInstances(re)}},t=se.getLogger(e),s=!1,m=!1,p=!1,T=!0,R=null,C=null,r=null,D=null,Q=null,c.a.extend(h.a),O=Kt(re).getInstance(),W=on(re).getInstance(),z=ot(re).getInstance(),$=[],Z=[],J=[],e}Rr.__dashjs_factory_name="MediaPlayer";var Nr=f.a.getClassFactory(Rr);Nr.events=h.a,Nr.errors=E.a,f.a.updateClassFactory(Rr.__dashjs_factory_name,Nr);t.a=Nr},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));function r(){return"4.3.0"}},function(e,t,n){var r,i,o,u,l,c={encode:function(e){for(var t=[],n=0;n>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},decode:function(e){for(var t=[],n=0;n>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push(r.charAt(63&a))}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push("=")):1==e.length-t&&(a=e[t]<<16,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push("==")),n.join("")},o=function(){for(var e=[],t=0;t0&&(e.segments=u);return e}(e,n[1])),(r=e).mediaFinishedInformation=E.getMediaFinishedInformation(r),function(e){if(!S())return;var t,n=d.getCurrentManifestUpdate(),r=!1;if(n){for(var i=0;i=s.length?null:s[e]}function w(e){i=!1,l.trigger(c.DATA_UPDATE_COMPLETED,{data:n,currentRepresentation:u,error:e},{streamId:m.id,mediaType:g})}function C(e){u=e}function D(e){if(e.newDuration){var t=A();if(t&&t.adaptation.period)t.adaptation.period.duration=e.newDuration}}return t={getStreamId:function(){return m.id},getType:v,getData:function(){return n},isUpdating:S,updateData:function(e,t,a,o,u){if(T(),i=!0,s=t,C(N(u)),n=e,a!==r.a.VIDEO&&a!==r.a.AUDIO&&(a!==r.a.TEXT||!o))return w(),Promise.resolve();for(var l=[],c=0,f=s.length;c=0}return!1}),(function(e){return String(e)}))}return n}(l),E=n(1);function _(e){return(_="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})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=A(e);if(t){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return S(this,n)}}function S(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(n,e);var t=T(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){for(var t=[c.a.MIN_BUFFER_TIME,c.a.MEDIA_PRESENTATION_DURATION,c.a.MINIMUM_UPDATE_PERIOD,c.a.TIMESHIFT_BUFFER_DEPTH,c.a.MAX_SEGMENT_DURATION,c.a.MAX_SUBSEGMENT_DURATION,c.a.SUGGESTED_PRESENTATION_DELAY,c.a.START,E.a.START_TIME,c.a.DURATION],n=t.length,r=0;r4)return null;var r=[];for(var i in t){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,n,r,i,a){var o;if(1===i.length)o=[i[0],i[0],i[0],i[0]];else if(2===i.length)o=[i[0],i[1],i[0],i[1]];else if(3===i.length)o=[i[0],i[1],i[2],i[1]];else{if(4!==i.length)return null;o=[i[0],i[1],i[2],i[3]]}var s=r.styleAttrs[e.byName.writingMode.qname];if("lrtb"===s||"lr"===s)o=[o[0],o[3],o[2],o[1]];else if("rltb"===s||"rl"===s)o=[o[0],o[1],o[2],o[3]];else if("tblr"===s)o=[o[3],o[0],o[1],o[2]];else{if("tbrl"!==s&&"tb"!==s)return null;o=[o[3],o[2],o[1],o[0]]}var u=[];for(var l in o)if(0===o[l].value)u[l]=0;else if("%"===o[l].unit)u[l]="0"===l||"2"===l?r.styleAttrs[e.byName.extent.qname].h*o[l].value/100:r.styleAttrs[e.byName.extent.qname].w*o[l].value/100;else if("em"===o[l].unit)u[l]=r.styleAttrs[e.byName.fontSize.qname]*o[l].value;else if("c"===o[l].unit)u[l]=o[l].value/t.cellResolution.h;else{if("px"!==o[l].unit)return null;u[l]="0"===l||"2"===l?o[l].value/t.pxDimensions.h:o[l].value/t.pxDimensions.w}return u})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,n,r,i,a){if("none"===i)return i;var o={};if(null===i.color?o.color=r.styleAttrs[e.byName.color.qname]:o.color=i.color,"%"===i.thickness.unit)o.thickness=r.styleAttrs[e.byName.fontSize.qname]*i.thickness.value/100;else if("em"===i.thickness.unit)o.thickness=r.styleAttrs[e.byName.fontSize.qname]*i.thickness.value;else if("c"===i.thickness.unit)o.thickness=i.thickness.value/t.cellResolution.h;else{if("px"!==i.thickness.unit)return null;o.thickness=i.thickness.value/t.pxDimensions.h}return o})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,n,r,i){return"c"===r.unit?r.value/e.cellResolution.h:null})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?n(47):imscNames,"undefined"==typeof imscUtils?n(65):imscUtils)},function(e,t,n){"use strict";(function(e){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var r=n(77),i=n(78),a=n(66);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return w(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=n;as&&(n=s-u),a=n;a>=0;a--){for(var f=!0,d=0;di&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function R(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&l)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(r,i),c=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":return T(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function L(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function F(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function x(e,t,n,r,a){return a||F(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,a){return a||F(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return x(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return x(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function j(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(21))},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,n)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,a,o,s;if(l(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var l=u.length,c=m(u,l);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(67)).Stream=t,t.Readable=t,t.Writable=n(63),t.Duplex=n(30),t.Transform=n(70),t.PassThrough=n(86)},function(e,t,n){"use strict";(function(t,r,i){var a=n(48);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=E;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;E.WritableState=y;var l=n(42);l.inherits=n(34);var c={deprecate:n(85)},f=n(68),d=n(49).Buffer,h=i.Uint8Array||function(){};var p,g=n(69);function m(){}function y(e,t){s=s||n(30),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(a.nextTick(i,r),a.nextTick(b,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),b(e,t))}(e,n,r,t,i);else{var o=S(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||T(e,n),r?u(v,e,n,o,i):v(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function E(e){if(s=s||n(30),!(p.call(E,this)||this instanceof s))return new E(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function _(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function v(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),b(e,t)}function T(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,_(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,f=n.callback;if(_(e,t,!1,t.objectMode?1:l.length,l,c,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),b(e,t)}))}function b(e,t){var n=S(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(A,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(E,f),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===E&&(e&&e._writableState instanceof y)}})):p=function(e){return e instanceof this},E.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},E.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,s=!i.objectMode&&(r=e,d.isBuffer(r)||r instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=m),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(r,o),i=!1),i}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},E.prototype._writev=null,E.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,b(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(E.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=g.destroy,E.prototype._undestroy=g.undestroy,E.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(26),n(83).setImmediate,n(21))},function(e,t,n){"use strict";var r=n(49).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return i>0&&(e.lastNeed=i-1),i;if(--r=0)return i>0&&(e.lastNeed=i-2),i;if(--r=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,o=null,s=i[e.toLowerCase()];return void 0!==s?o=s:null!==(a=t.exec(e))?o=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),o};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n}}(t)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t,r){var i=n(48);e.exports=_;var a,o=n(66);_.ReadableState=E;n(61).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(68),l=n(49).Buffer,c=t.Uint8Array||function(){};var f=n(42);f.inherits=n(34);var d=n(80),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,g=n(81),m=n(69);f.inherits(_,u);var y=["error","close","destroy","pause","resume"];function E(e,t){e=e||{};var r=t instanceof(a=a||n(30));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n(64).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function _(e){if(a=a||n(30),!(this instanceof _))return new _(e);this._readableState=new E(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function v(e,t,n,r,i){var a,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,A(e)}(e,o)):(i||(a=function(e,t){var n;r=t,l.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):T(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):I(e,o)):T(e,o,t,!1))):r||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(b,e):b(e))}function b(e){h("emit readable"),e.emit("readable"),C(e)}function I(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):A(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e0?D(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:_;function l(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",y),e.removeListener("finish",E),e.removeListener("drain",f),e.removeListener("error",m),e.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",_),n.removeListener("data",g),d=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){h("onend"),e.end()}a.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",l);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,C(e))}}(n);e.on("drain",f);var d=!1;var p=!1;function g(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==P(a.pipes,e))&&!d&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function m(t){h("onerror",t),_(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",E),_()}function E(){h("onfinish"),e.removeListener("close",y),_()}function _(){h("unpipe"),n.unpipe(e)}return n.on("data",g),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",m),e.once("close",y),e.once("finish",E),e.emit("pipe",n),a.flowing||(h("pipe resume"),n.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,n){var r=e.parsePSSHList(n);return t&&r.hasOwnProperty(t.uuid.toLowerCase())?r[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,a,o=void 0,s=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(a=t.getUint8(r))||1===a){r++,r+=3,o="";var u=void 0,l=void 0;for(u=0;u<4;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=4,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<6;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;r+=6,r+=4,n[o=o.toLowerCase()]=t.buffer.slice(s,i),r=i}else r=i;else r=i}return n}},{key:"getLicenseServerUrlFromMediaInfo",value:function(e,t){try{if(!e||0===e.length)return null;for(var n=0,r=null;n0){var o=a.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===t}));if(o&&o.length>0)for(var s=0;s0&&b.setServerCertificate(w.decodeArray(n.serverCertificate).buffer);for(var a=0;a0?t.audioRobustness:c,u=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:c,l=e.sessionType,f=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",d=t&&t.persistentState?t.persistentState:"temporary"===l?"optional":"required";return i.forEach((function(e){e.type===C.AUDIO?n.push(new o(e.codec,a)):e.type===C.VIDEO&&r.push(new o(e.codec,u))})),new s(n,r,f,d,[l])}function Y(e){e.error?I.trigger(R.KEY_STATUSES_CHANGED,{data:null,error:e.error}):n.debug("DRM: key status = "+e.status)}function H(e){n.debug("DRM: onKeyMessage");var t=e.data;I.trigger(R.KEY_MESSAGE,{data:t});var r=t.messageType?t.messageType:"license-request",o=t.message,s=t.sessionToken,u=B(f),l=A.getLicenseServerModelInstance(f,u,r),c={sessionToken:s,messageType:r};if(o&&0!==o.byteLength){if(!l)return n.debug("DRM: License server request not required for this message (type = "+e.data.messageType+"). Session ID = "+s.getSessionId()),void K(c);if(A.isClearKey(f)){var d=A.processClearKeyLicenseRequest(f,u,o);if(d)return n.debug("DRM: ClearKey license request handled by application!"),K(c),void b.updateKeySession(s,d)}!function(e,t,r){var o=e.sessionToken,s=e.messageType?e.messageType:"license-request",u={sessionToken:o,messageType:s},l=f?f.systemString:null,c=function(e,t,n,r,o){var s=null,u=r.message;if(e&&e.serverURL){var l=e.serverURL;"string"==typeof l&&""!==l?s=l:"object"===T(l)&&l.hasOwnProperty(t)&&(s=l[t])}else if(e&&e.laURL&&""!==e.laURL)s=e.laURL;else if(!(s=a.getLicenseServerUrlFromMediaInfo(i,f.schemeIdURI))&&!A.isClearKey(f)){var c=a.getPSSHData(n.initData);(s=f.getLicenseServerURLFromInitData(c))||(s=r.laURL)}return s=o.getServerURLFromMessage(s,u,t)}(r,s,o,e,t);if(!c)return void K(u,new p.a(h.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,h.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE));var d={},N=!1;r&&q(d,r.httpRequestHeaders);var w=e.message,C=f.getRequestHeadersFromMessage(w);q(d,C),Object.keys(d).forEach((function(e){"authorization"===e.toLowerCase()&&(N=!0)})),r&&"boolean"==typeof r.withCredentials&&(N=r.withCredentials);var D=function(e){if(b)if(e.status>=200&&e.status<=299){var n=E.a.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),r=new m(e.responseURL,n,e.response);W(S,r).then((function(){var n=t.getLicenseMessage(r.data,l,s);null!==n?(K(u),b.updateKeySession(o,n)):V(e,u,l,s,t)}))}else V(e,u,l,s,t)},P=function(e){K(u,new p.a(h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+l+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},L=function(e){K(u,new p.a(h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+l+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},F=f.getLicenseRequestFromMessage(w),x=t.getHTTPMethod(s),U=t.getResponseType(l,s),B=r&&!isNaN(r.httpTimeout)?r.httpTimeout:8e3,k=o.getSessionId()||null,G=new g(c,x,U,d,N,s,k,F),j=isNaN(M.get().streaming.retryAttempts[y.a.LICENSE])?3:M.get().streaming.retryAttempts[y.a.LICENSE];W(v,G).then((function(){!function e(t,r,i,a,o,s){var u=new XMLHttpRequest;if(M.get().streaming.cmcd&&M.get().streaming.cmcd.enabled){if(M.get().streaming.cmcd.mode===_.a.CMCD_MODE_QUERY){var l=O.getQueryParameter({url:t.url,type:y.a.LICENSE});l&&(t.url=E.a.addAditionalQueryParameterToUrl(t.url,[l]))}}u.open(t.method,t.url,!0),u.responseType=t.responseType,u.withCredentials=t.withCredentials,i>0&&(u.timeout=i);for(var c in t.headers)u.setRequestHeader(c,t.headers[c]);if(M.get().streaming.cmcd&&M.get().streaming.cmcd.enabled){if(M.get().streaming.cmcd.mode===_.a.CMCD_MODE_HEADER){var f=O.getHeaderParameters({url:t.url,type:y.a.LICENSE});if(f)for(var d in f){var h=f[d];h&&u.setRequestHeader(d,h)}}}var p=function(){r--;var n=isNaN(M.get().streaming.retryIntervals[y.a.LICENSE])?1e3:M.get().streaming.retryIntervals[y.a.LICENSE];setTimeout((function(){e(t,r,i,a,o,s)}),n)};u.onload=function(){this.status>=200&&this.status<=299||r<=0?a(this):(n.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+r),p())},u.ontimeout=u.onerror=function(){r<=0?s(this):(n.warn("License request network request failed . Retrying it... Pending retries: "+r),p())},u.onabort=function(){o(this)},I.trigger(R.LICENSE_REQUEST_SENDING,{url:t.url,headers:t.headers,payload:t.data,sessionId:t.sessionId}),u.send(t.data)}(G,j,B,D,P,L)}))}(t,l,u)}else K(c,new p.a(h.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,h.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function K(e,t){I.trigger(R.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function q(e,t){if(t)for(var n in t)e[n]=t[n]}function V(e,t,n,r,i){var a=e.response?i.getErrorResponse(e.response,n,r):"NONE";K(t,new p.a(h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,h.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+". Response is "+a))}function W(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}function z(e,t){if(!M.get().streaming.protection.ignoreEmeEncryptedEvent){if(n.debug("DRM: onNeedKey"),"cenc"!==e.key.initDataType)return void n.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType);if(0===i.length&&(n.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void D.push(setTimeout((function(){z(e,t)}),500));var r=e.key.initData;if(ArrayBuffer.isView(r)&&(r=r.buffer),f){var o=a.getPSSHForKeySystem(f,r);if(o&&k(o))return}n.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(r)));var s=A.getSupportedKeySystemsFromSegmentPssh(r,u,l);if(0===s.length)return void n.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");L(s,!1)}}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");P(),i.push(e);var t=A.getSupportedKeySystemsFromContentProtection(e.contentProtection,u,l);(t=t.sort((function(e,n){return(u&&u[e.ks.systemString]&&u[e.ks.systemString].priority>=0?u[e.ks.systemString].priority:t.length)-(u&&u[n.ks.systemString]&&u[n.ks.systemString].priority>=0?u[n.ks.systemString].priority:t.length)})))&&t.length>0&&L(t,!0)},clearMediaInfoArray:function(){i=[]},createKeySession:U,loadKeySession:x,removeKeySession:function(e){P(),b.removeKeySession(e)},closeKeySession:function(e){P(),b.closeKeySession(e)},setServerCertificate:function(e){P(),b.setServerCertificate(e)},setMediaElement:G,setSessionType:function(e){l=e},setRobustnessLevel:function(e){c=e},setProtectionData:function(e){u=e,A.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return P(),A.getSupportedKeySystemsFromContentProtection(e,u,l)},getKeySystems:function(){return A?A.getKeySystems():[]},setKeySystems:function(e){A&&A.setKeySystems(e)},setLicenseRequestFilters:function(e){v=e},setLicenseResponseFilters:function(e){S=e},stop:function(){b&&b.stop()},reset:function(){I.off(R.INTERNAL_KEY_MESSAGE,H,t),I.off(R.INTERNAL_KEY_STATUS_CHANGED,Y,t),P(),v=[],S=[],G(null),f=null,d=!1,b&&(b.reset(),b=null),D.forEach((function(e){return clearTimeout(e)})),D=[],i=[],r=[]}},n=N.getLogger(t),r=[],i=[],l="temporary",c="",v=[],S=[],I.on(R.INTERNAL_KEY_MESSAGE,H,t),I.on(R.INTERNAL_KEY_STATUS_CHANGED,Y,t),t}S.__dashjs_factory_name="ProtectionController";var A=v.a.getClassFactory(S);var b=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n};function I(e,t){for(var n=0;n%CUSTOMDATA%'.replace("%CUSTOMDATA%",t),a=[],o=0;o0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function E(e,t){var r={session:e,keyId:t.keyId,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,handleEvent:function(e){switch(e.type){case"keystatuseschange":c.trigger(f.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=y(arguments);switch(e.status){case"expired":c.trigger(f.INTERNAL_KEY_STATUS_CHANGED,{error:new p.a(h.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,h.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)});break;default:c.trigger(f.INTERNAL_KEY_STATUS_CHANGED,e)}}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;c.trigger(f.INTERNAL_KEY_MESSAGE,{data:new ae(this,t,void 0,e.messageType)})}},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){var e=y(arguments);"usable"===e.status&&(t=!0)})),t}};return e.addEventListener("keystatuseschange",r),e.addEventListener("message",r),e.closed.then((function(){m(r),n.debug("DRM: Session closed. SessionID = "+r.getSessionId()),c.trigger(f.KEY_SESSION_CLOSED,{data:r.getSessionId()})})),o.push(r),r}return t={getAllInitData:function(){for(var e=[],t=0;t=1?t():(e=t.bind(this),r.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t0&&(t=o.ksConfiguration.videoCapabilities[0]),null===t&&o.ksConfiguration.audioCapabilities&&o.ksConfiguration.audioCapabilities.length>0&&(t=o.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");var r=t.contentType,s=a.createSession(r,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),l=function(e,t){return{session:e,keyId:t.keyId,initData:t.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case y.error:d.trigger(g.KEY_ERROR,{error:new p.a(h.MEDIA_KEYERR_CODE,"KeyError",this)});break;case y.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;d.trigger(g.INTERNAL_KEY_MESSAGE,{data:new ae(this,t,e.destinationURL)});break;case y.ready:n.debug("DRM: Key added."),d.trigger(g.KEY_ADDED);break;case y.close:n.debug("DRM: Session closed. SessionID = "+this.getSessionId()),d.trigger(g.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(s,e);s.addEventListener(y.error,l),s.addEventListener(y.message,l),s.addEventListener(y.ready,l),s.addEventListener(y.close,l),u.push(l),n.debug("DRM: Session created. SessionID = "+l.getSessionId()),d.trigger(g.KEY_SESSION_CREATED,{data:l})},updateKeySession:function(e,t){var n=e.session;c.isClearKey(i)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t)),d.trigger(g.KEY_SESSION_UPDATED)},closeKeySession:_,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:E,reset:E},n=m.getLogger(t),r=null,i=null,a=null,o=null,u=[],c=$(f).getInstance(),l={handleEvent:function(e){switch(e.type){case y.needkey:if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;d.trigger(g.NEED_KEY,{key:new ie(t,"cenc")})}}}},t}ce.__dashjs_factory_name="ProtectionModel_3Feb2014";var fe=dashjs.FactoryMaker.getClassFactory(ce);function de(e){e=e||{};var t,n,r,i,a,o,u,l,c,f=this.context,d=e.eventBus,g=e.events,m=e.debug,y=e.api,E=e.errHandler;function _(){r&&S();for(var e=0;e0&&(t=o.shift(),u.push(t),t.sessionId=e.sessionId,d.trigger(g.KEY_SESSION_CREATED,{data:t})):o.length>0&&(t=o.shift(),u.push(t),0!==o.length&&E.error(new p.a(h.MEDIA_KEY_MESSAGE_ERROR_CODE,h.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var s=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=s,d.trigger(g.INTERNAL_KEY_MESSAGE,{data:new ae(t,s,e.defaultURL)})}else n.warn("No session token found for key message")}}},t}de.__dashjs_factory_name="ProtectionModel_01b";var he=dashjs.FactoryMaker.getClassFactory(de),pe=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],ge=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function me(){var e,t=this.context;function n(e,t){for(var n=0;n=400||t.responsecode<100||t.responsecode>=600)&&l({errorcode:t.responsecode||i.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}var t}function p(e){var t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=i.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=i.CORRUPT_MEDIA_OTHER;break;default:return}l({errorcode:t})}return t={initialise:function(){r.on(u.MANIFEST_UPDATED,c,t),r.on(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),r.on(u.METRIC_ADDED,h,t),r.on(u.METRIC_UPDATED,h,t),r.on(u.PLAYBACK_ERROR,p,t),r.on(a.a.BECAME_REPORTING_PLAYER,d,t)},reset:function(){r.off(u.MANIFEST_UPDATED,c,t),r.off(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),r.off(u.METRIC_ADDED,h,t),r.off(u.METRIC_UPDATED,h,t),r.off(u.PLAYBACK_ERROR,p,t),r.off(a.a.BECAME_REPORTING_PLAYER,d,t)}}}o.__dashjs_factory_name="DVBErrorsTranslator";var s=dashjs.FactoryMaker.getSingletonFactory(o),u=n(45);function l(e){e=e||{};var t,n,r=!1,i=this.context,a=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,r=t+e.duration;n.add(t,r)})),r=!!e[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){var e,t=n.length;if(!t)return!0;e=r?(new Date).getTime()/1e3:a.currentTime;for(var i=0;i=200&&r.status<300?t&&t():n&&n())};l.push(r);try{r.open("GET",e),r.onloadend=i,r.onerror=i,r.send()}catch(e){r.onerror()}}(r="".concat(o,"?").concat(r),null,(function(){a=!1}))}))},initialize:function(e,t){var n;if(s=t,!(o=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");i||((n=e.dvb_probability)&&(1e3===n||n/1e3>=r.random())&&(a=!0),i=!0)},reset:function(){f()}},n=d(u).getInstance(),r=p(u).getInstance(),f(),t}g.__dashjs_factory_name="DVBReporting";var m=dashjs.FactoryMaker.getClassFactory(g);function y(e){e=e||{};var t,n={"urn:dvb:dash:reporting:2014":m},r=this.context,i=e.debug?e.debug.getLogger(t):{},a=e.metricsConstants;return t={create:function(e,t){var o;try{(o=n[e.schemeIdUri](r).create({metricsConstants:a})).initialize(e,t)}catch(t){o=null,i.error("ReportingFactory: could not create Reporting with schemeIdUri ".concat(e.schemeIdUri," (").concat(t.message,")"))}return o},register:function(e,t){n[e]=t},unregister:function(e){delete n[e]}}}y.__dashjs_factory_name="ReportingFactory";var E=dashjs.FactoryMaker.getSingletonFactory(y);function _(e){var t=[],n=E(this.context).getInstance(e);return{initialize:function(e,r){e.some((function(e){var i=n.create(e,r);if(i)return t.push(i),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}_.__dashjs_factory_name="ReportingController";var v=dashjs.FactoryMaker.getClassFactory(_);function T(){return{reconstructFullMetricName:function(e,t,n){var r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}T.__dashjs_factory_name="HandlerHelpers";var S=dashjs.FactoryMaker.getSingletonFactory(T);function A(e){var t,n,r,i,a;e=e||{};var o=this.context,s=S(o).getInstance(),u=[],l=e.metricsConstants;function c(){var e=function(){try{return Object.keys(u).map((function(e){return u[e]})).reduce((function(e,t){return e.level=c.end)return null;var h="regionID"in c&&""!==c.regionID?c.regionID:l;if(null!==u&&h!==i.id&&(!("contents"in c)||"contents"in c&&0===c.contents.length||""!==h))return null;var p=new a(c);for(var g in c.sets)t=c.sets[g].end||(p.styleAttrs[c.sets[g].qname]=c.sets[g].value);var m,y={};for(var E in p.styleAttrs)if(y[E]=!0,E===n.byName.writingMode.qname&&!(n.byName.direction.qname in p.styleAttrs)){var _=p.styleAttrs[E];"lrtb"===_||"lr"===_?p.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==_&&"rl"!==_||(p.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==u)for(var v in n.all){var T=n.all[v];if(T.qname===n.byName.textDecoration.qname){var S=u.styleAttrs[T.qname],A=p.styleAttrs[T.qname],b=[];void 0===A?b=S:-1===A.indexOf("none")?((-1===A.indexOf("noUnderline")&&-1!==S.indexOf("underline")||-1!==A.indexOf("underline"))&&b.push("underline"),(-1===A.indexOf("noLineThrough")&&-1!==S.indexOf("lineThrough")||-1!==A.indexOf("lineThrough"))&&b.push("lineThrough"),(-1===A.indexOf("noOverline")&&-1!==S.indexOf("overline")||-1!==A.indexOf("overline"))&&b.push("overline")):b.push("none"),p.styleAttrs[T.qname]=b}else T.inherit&&T.qname in u.styleAttrs&&!(T.qname in p.styleAttrs)&&(p.styleAttrs[T.qname]=u.styleAttrs[T.qname])}for(var I in n.all){var R=n.all[I];R.qname in p.styleAttrs||("region"===p.kind||!1===R.inherit&&null!==R.initial)&&(p.styleAttrs[R.qname]=R.parse(R.initial),y[R.qname]=!0)}for(var N in n.all){var w=n.all[N];if(w.qname in y&&null!==w.compute){var C=w.compute(e,u,p,p.styleAttrs[w.qname],d);null!==C?p.styleAttrs[w.qname]=C:o(f,"Style '"+w.qname+"' on element '"+p.kind+"' cannot be computed")}}if("none"===p.styleAttrs[n.byName.display.qname])return null;for(var D in null===u?m=null===s?[]:[s]:"contents"in c&&(m=c.contents),m){var O=r(e,t,i,s,p,h,m[D],f,d);null!==O&&p.contents.push(O.element)}for(var M in p.styleAttrs){-1===n.byQName[M].applies.indexOf(p.kind)&&delete p.styleAttrs[M]}if("span"===p.kind&&p.text&&"default"===p.space){var P=p.text.replace(/\s+/g," ");p.text=P}if("p"===p.kind){var L=[];!function e(t,n){if("contents"in t)for(var r in t.contents)e(t.contents[r],n);else n.push(t)}(p,L);for(var F=0,x="after_br",U=0;;)if("after_br"===x)F>=L.length||"br"===L[F].kind?(x="before_br",U=F,F--):("preserve"!==L[F].space&&(L[F].text=L[F].text.replace(/^\s+/g,"")),L[F].text.length>0?(x="looking_br",F++):L.splice(F,1));else if("before_br"===x)if(F<0||"br"===L[F].kind){if(x="after_br",(F=U+1)>=L.length)break}else if("preserve"!==L[F].space&&(L[F].text=L[F].text.replace(/\s+$/g,"")),L[F].text.length>0){if(x="after_br",(F=U+1)>=L.length)break}else L.splice(F,1),F--;else F>=L.length||"br"===L[F].kind?(x="before_br",U=F,F--):F++;!function e(t){if("br"===t.kind)return!1;if("text"in t)return 0===t.text.length;if("contents"in t){for(var n=t.contents.length;n--;)e(t.contents[n])&&t.contents.splice(n,1);return 0===t.contents.length}}(p)}return"div"===p.kind&&n.byName.backgroundImage.qname in p.styleAttrs||"br"===p.kind||"contents"in p&&p.contents.length>0||"span"===p.kind&&null!==p.text||"region"===p.kind&&"always"===p.styleAttrs[n.byName.showBackground.qname]?{region_id:h,element:p}:null}function i(e){this.contents=[],this.aspectRatio=e.aspectRatio}function a(e){for(var t in this.kind=e.kind||"region",e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)this.styleAttrs[t]=e.styleAttrs[t];"text"in e?this.text=e.text:"br"!==e.kind&&(this.contents=[]),"space"in e&&(this.space=e.space)}function o(e,t){if(e&&e.error&&e.error(t))throw t}e.generateISD=function(e,t,n){var a=new i(e),o={};for(var s in e.head.layout.regions){var u=r(e,t,e.head.layout.regions[s],e.body,null,"",e.head.layout.regions[s],n,o);null!==u&&a.contents.push(u.element)}return a}}(t,"undefined"==typeof imscNames?n(47):imscNames,"undefined"==typeof imscStyles?n(59):imscStyles)},function(e,t,n){!function(e,t,n,r,i){function a(e,t,n,r){var i=r&&"seq"===r.timeContainer,o=0;r&&(o=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+o:o;var s=t.begin,u=null;for(var l in t.sets)a(e,t.sets[l],u,t),s="seq"===t.timeContainer?t.sets[l].end:Math.max(s,t.sets[l].end),u=t.sets[l];if("contents"in t)for(var c in t.contents)a(e,t.contents[c],u,t),s="seq"===t.timeContainer?t.contents[c].end:Math.max(s,t.contents[c].end),u=t.contents[c];else s=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,o+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=o+t.explicit_end:t.end=s,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function o(e){this.node=e}function s(){this.events=[],this.head=null,this.body=null}function u(){this.styling=null,this.layout=null}function l(){this.styles={}}function c(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function f(){this.regions={}}function d(e){this.kind=e}function h(e){this.id=e}function p(e){this.regionID=e}function g(e){this.styleAttrs=e}function m(e){this.sets=e}function y(e){this.contents=e}function E(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function _(){d.call(this,"body")}function v(){d.call(this,"div")}function T(){d.call(this,"p")}function S(){d.call(this,"span")}function A(){d.call(this,"span")}function b(){d.call(this,"br")}function I(){}function R(){}function N(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function w(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function C(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,o=r.byQName[a];if(void 0!==o){var s=o.parse(e.attributes[i].value);null!==s?(n[a]=s,o===r.byName.zIndex&&F(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):x(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function D(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function O(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function M(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(M(e,e.styles[r],n),L(e.styles[r].styleAttrs,t.styleAttrs)):x(n,"Non-existant style id referenced")}}function P(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?L(e.styles[a].styleAttrs,n):x(r,"Non-existant style id referenced")}}function L(e,t){for(var n in e)n in t||(t[n]=e[n])}function F(e,t){if(e&&e.warn&&e.warn(t))throw t}function x(e,t){if(e&&e.error&&e.error(t))throw t}function U(e,t){throw e&&e.fatal&&e.fatal(t),t}function B(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(at))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,r,i){var d=t.parser(!0,{xmlns:!0}),h=[],p=[],g=[],m=0,y=null;d.onclosetag=function(e){if(h[0]instanceof l)for(var t in h[0].styles)M(h[0],h[0].styles[t],r);else if(h[0]instanceof T||h[0]instanceof S){if(h[0].contents.length>1){var a,s=[h[0].contents[0]];for(a=1;a0&&i&&"onCloseTag"in i&&i.onCloseTag());g.shift(),p.shift(),h.shift()},d.ontext=function(e){if(void 0===h[0]);else if(h[0]instanceof S||h[0]instanceof T){var t=new A;t.initFromText(y,h[0],e,g[0],r),h[0].contents.push(t)}else h[0]instanceof o&&m>0&&i&&"onText"in i&&i.onText(e)},d.onopentag=function(e){var t=e.attributes["xml:space"];t?g.unshift(t.value):0===g.length?g.unshift("default"):g.unshift(g[0]);var a=e.attributes["xml:lang"];if(a?p.unshift(a.value):0===p.length?p.unshift(""):p.unshift(p[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==y&&U(r,"Two elements at ("+this.line+","+this.column+")"),(y=new s).initFromNode(e,r),h.unshift(y);else if("head"===e.local)h[0]instanceof s||U(r,"Parent of element is not at ("+this.line+","+this.column+")"),null!==y.head&&U("Second element at ("+this.line+","+this.column+")"),y.head=new u,h.unshift(y.head);else if("styling"===e.local)h[0]instanceof u||U(r,"Parent of element is not at ("+this.line+","+this.column+")"),null!==y.head.styling&&U("Second element at ("+this.line+","+this.column+")"),y.head.styling=new l,h.unshift(y.head.styling);else if("style"===e.local){var d;h[0]instanceof l?((d=new c).initFromNode(e,r),d.id?y.head.styling.styles[d.id]=d:x(r," - -
- -
- - - - diff --git a/server/src/main/resources/web/media.ftl b/server/src/main/resources/web/media.ftl index 5f2cdfd7..6b8263f6 100644 --- a/server/src/main/resources/web/media.ftl +++ b/server/src/main/resources/web/media.ftl @@ -1,33 +1,111 @@ - - - - 多媒体文件预览 - <#include "*/commonHeader.ftl"> - - - + + +
播放容器
+ + - .m { - width: 1024px; - margin: 0 auto; - } - - - -
- -
- - +