@besovideo/webrtc-player 0.2.9 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.browser.css +1 -1
- package/dist/main.browser.js +10 -10
- package/dist/main.es.css +1 -1
- package/dist/main.es.js +10 -10
- package/dist/types/app.d.ts +2 -4
- package/dist/types/components/puPlayer.d.ts +1 -1
- package/dist/types/core/customElement.d.ts +4 -0
- package/dist/types/core/dom.d.ts +22 -0
- package/dist/types/core/events.d.ts +15 -5
- package/dist/types/core/field.d.ts +4 -0
- package/dist/types/core/index.d.ts +20 -3
- package/dist/types/core/jsx.d.ts +8 -0
- package/dist/types/core/style.d.ts +10 -0
- package/dist/types/core/types.d.ts +7 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/main.d.ts +1 -1
- package/dist/types/plugins/controller/button.d.ts +13 -0
- package/dist/types/plugins/controller/event.d.ts +13 -0
- package/dist/types/plugins/controller/index.d.ts +22 -0
- package/dist/types/plugins/decorators.d.ts +2 -0
- package/dist/types/plugins/mixins/visible.d.ts +13 -0
- package/dist/types/plugins/modal.d.ts +33 -0
- package/dist/types/plugins/player/event.d.ts +11 -6
- package/dist/types/plugins/player/index.d.ts +17 -5
- package/dist/types/plugins/player/infoList.d.ts +14 -0
- package/dist/types/plugins/player/panel.d.ts +15 -0
- package/dist/types/plugins/player/reducers/types.d.ts +36 -0
- package/dist/types/plugins/types.d.ts +13 -14
- package/dist/types/plugins/video.d.ts +12 -2
- package/dist/types/templates/button.d.ts +8 -0
- package/dist/types/templates/icons.d.ts +18 -0
- package/dist/types/templates/type.d.ts +0 -0
- package/dist/types/utils/dev.d.ts +4 -0
- package/dist/types/utils/lang.d.ts +11 -0
- package/dist/types/utils/logger.d.ts +2 -0
- package/dist/types/utils/util.d.ts +2 -2
- package/dist/types/z_test/puPlayer.d.ts +1 -1
- package/dist/types/z_unuse/index.d.ts +5 -0
- package/package.json +69 -58
- package/dist/types/core/classes.d.ts +0 -2
package/dist/main.browser.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.bvplayer-
|
|
1
|
+
.bvplayer-common-flex-space{display:inline-block;flex:1}.bvplayer-icon{display:inline-block;height:22px;width:100%;vertical-align:middle}.bvplayer-icon svg{height:100%;width:100%}.bvplayer-modal{position:absolute;top:0;left:0;padding:12px 16px;font-size:14px;border:1px solid #2b303b;border-radius:3px;background:rgba(22,27,29,.8);color:#e8e8fd;box-shadow:0 0 20px -6px #000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);overflow:hidden;visibility:hidden;opacity:0;transform:scale(0);will-change:transform,opacity;transition:all .3s cubic-bezier(.785,.135,.15,.86)}.bvplayer-modal.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:scale(1)}.bvplayer-modal--center{top:50%;left:50%;margin:auto;transform:translate(-50%,-50%) scale(0)}.bvplayer-modal--center.bvplayer-common-is-visible{transform:translate(-50%,-50%)}.bvplayer-modal_title-bar{display:flex;justify-content:space-between;margin-bottom:8px;font-size:16px}.bvplayer-modal_title-bar_close{cursor:pointer}.bvplayer-modal_body{padding:8px;overflow:hidden;overflow-y:auto}.bvplayer-spinner{position:absolute;top:0;left:0;height:100%;width:100%}.bvplayer-spinner>span{display:inline-block;position:absolute;top:50%;left:50%;margin:-18px 0 0 -18px;height:36px;width:36px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KICAgICB2aWV3Qm94PSIwIDAgMjQgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICAgICAgPHJlY3QgeD0iMCIgeT0iNy42ND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GU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyAyMDsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgNTsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICAgIDwvc3ZnPg==)}.bvplayer-spinner>span svg{height:100%}.bvplayer-mask{height:100%;width:100%;position:absolute;top:0;left:0;display:grid;align-content:center;justify-content:center;place-content:center;background-color:#000;color:#fff;font-size:14px}.bvplayer-controller{position:absolute;bottom:0;left:0;right:0;width:100%;height:98px;color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden;opacity:0;transform:translateY(100%);will-change:visibility,opacity,transform;transition:all .3s cubic-bezier(.455,.03,.515,.955)}.bvplayer-controller.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:translateY(0)}.bvplayer-controller_mask{position:absolute;bottom:0;height:100%;width:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.bvplayer-controller_inner{position:absolute;bottom:0;left:0;right:0;width:100%;height:41px;padding:0 20px;display:flex;align-items:stretch;justify-content:space-between}.bvplayer-controller_inner_bar{display:block}.bvplayer-controller_inner_left{cursor:default}.bvplayer-controller_inner_right{cursor:default}.bvplayer-controller_button{cursor:pointer;display:inline-block;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:36px;height:100%;border:none;outline:none;padding:0;background:none;color:inherit}.bvplayer-controller_button:not(:last-child){margin-right:8px}.bvplayer-controller_button>*{transition:all .2s ease-in-out;opacity:.8}.bvplayer-controller_button:hover>*{opacity:1}.bvplayer-video{display:block;pointer-events:none;box-sizing:border-box;width:100%;height:100%}.bvplayer-player{position:relative;height:100%;width:100%;background-color:#000;overflow:hidden}.bvplayer-player_info-modal{width:60%;height:70%}.bvplayer-player_info-modal_section{margin-bottom:16px}.bvplayer-player_info-modal_section_title{display:inline-block;font-weight:bold;font-size:12px;margin-bottom:8px}.bvplayer-player_info-modal_list{color:#e8e8fdd9;font-size:12px}.bvplayer-player_info-modal_list_item:not(:last-child){margin-bottom:8px}.bvplayer-player_info-modal_list_item_label{display:inline-block;width:90px;margin-right:14px;text-indent:-99em;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:top}.bvplayer-player_info-modal_list_item_value{margin-right:8px;white-space:normal;word-break:break-all}
|
package/dist/main.browser.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var bv_webrtc_player=(()=>{var he=Object.defineProperty,Ye=Object.defineProperties;var et=Object.getOwnPropertyDescriptors;var be=Object.getOwnPropertySymbols;var tt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable;var ye=(t,e,r)=>e in t?he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e||(e={}))tt.call(e,r)&&ye(t,r,e[r]);if(be)for(var r of be(e))nt.call(e,r)&&ye(t,r,e[r]);return t},N=(t,e)=>Ye(t,et(e));var rt=(t,e)=>{for(var r in e)he(t,r,{get:e[r],enumerable:!0})};var l=(t,e,r)=>new Promise((o,i)=>{var s=h=>{try{f(r.next(h))}catch(y){i(y)}},c=h=>{try{f(r.throw(h))}catch(y){i(y)}},f=h=>h.done?o(h.value):Promise.resolve(h.value).then(s,c);f((r=r.apply(t,e)).next())});var Gs={};rt(Gs,{Conference:()=>Ze,Intercom:()=>Qe,PuPlayer:()=>Je,RemoteSdpFetcher:()=>q,clearAllDialog:()=>Ks});var ot="C:\\ProgramData",it="C:\\Users\\Administrator\\AppData\\Roaming",st="False",at="C:\\ProgramData\\chocolatey",lt="132633801270330519",ct="\\\\.\\pipe\\crashpad_21148_VHNUKAEAMAGUXMPD",dt="truecolor",pt="C:\\Program Files\\Common Files",ut="C:\\Program Files (x86)\\Common Files",mt="C:\\Program Files\\Common Files",gt="DESKTOP-0PI1EL3",ft="C:\\Windows\\system32\\cmd.exe",ht="C:\\Windows\\System32\\Drivers\\DriverData",bt="C:\\ProgramData\\scoop\\apps\\git\\2.31.1.windows.1\\gbash",yt="Internet Explorer",vt="Default",It="d:\\software\\Microsoft VS Code Insiders\\resources\\app\\extensions\\git\\dist\\askpass.sh",Pt="C:\\ProgramData\\scoop\\apps\\git\\current",Ct="C:\\Users\\Administrator\\go",xt="C:\\Users\\Administrator\\scoop\\apps\\go\\current",Et="C:\\Users\\Administrator",_t="C:",wt="\\Users\\Administrator",Ft="C:\\dev\\bvwebclient\\packages\\components\\player-core",St="D:\\software\\IntelliJ IDEA 2021.1.1\\bin;",Rt="zh_CN.UTF-8",Ot="C:\\Users\\Administrator\\AppData\\Local",kt="\\\\DESKTOP-0PI1EL3",Tt="",Dt="1",Mt="CONOUT$",Lt="CONOUT$",Wt="",At="MINGW64",Vt="haha",Nt="D:\\software\\node\\node.exe",Bt="production",Ht="",jt="",$t="",Ut="",Kt='{"remain":[],"cooked":["run","build"],"original":["run","build"]}',Gt="true",qt="low",zt="legacy",Jt="",Xt="true",Qt="",Zt="",Yt="C:\\Users\\Administrator\\AppData\\Roaming\\npm-cache",en="10",tn="60000",nn="10000",rn="Infinity",on="10",sn="",an="",ln="",cn="true",dn="true",pn="Infinity",un="true",mn="",gn="",fn="notepad.exe",hn="",bn="2",yn="10",vn="60000",In="10000",Pn="",Cn="true",xn="true",En="git",_n="true",wn="",Fn="C:\\Users\\Administrator\\AppData\\Roaming\\npm\\etc\\npmrc",Sn="C:\\Users\\Administrator\\AppData\\Roaming\\npm\\etc\\npmignore",Rn="",On="",kn="",Tn="npm",Dn="",Mn="",Ln="",Wn="",An="",Vn="Shirtiny",Nn="",Bn="ISC",Hn="C:\\Users\\Administrator\\.npm-init.js",jn="1.0.0",$n="",Un="",Kn="",Gn="",qn="",zn="notice",Jn="10",Xn="",Qn="50",Zn="%s",Yn="https://registry.npmjs.org/",er="D:\\software\\node\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js",tr="",nr="14.16.1",rr="",or="",ir="",sr="",ar="true",lr="",cr="true",dr="",pr="",ur="",mr="",gr="C:\\Users\\Administrator\\AppData\\Roaming\\npm",fr="",hr="",br="true",yr="",vr="",Ir="true",Pr="https://registry.npmjs.org/",Cr="true",xr="true",Er="",_r="",wr="",Fr="",Sr="^",Rr="",Or="",kr="warn-only",Tr="",Dr="",Mr="20",Lr="",Wr="900",Ar="",Vr="C:\\Windows\\system32\\cmd.exe",Nr="true",Br="",Hr="",jr="500",$r="oauth",Ur="true",Kr="latest",Gr="v",qr="",zr="C:\\Users\\ADMINI~1\\AppData\\Local\\Temp",Jr="0000",Xr="",Qr="true",Zr="true",Yr="",eo="",to="C:\\Users\\Administrator\\.npmrc",no="npm/6.14.12 node/v14.16.1 win32 x64",ro="",oo="",io="browser",so="D:\\software\\node\\node_modules\\npm\\bin\\npm-cli.js",ao="build",lo="npm run clean && dotenv -c production node .node/builder.js",co="D:\\software\\node\\node.exe",po="^2.1.8",uo="@besovideo/webrtc-player desc",mo="^10.2.6",go="^4.1.1",fo="^4.0.0",ho="0.12.5",bo="^1.4.8",yo="^7.28.0",vo="^8.3.0",Io="^3.4.0",Po="^27.2.2",Co="^8.2.0",xo="^8.3.5",Eo="^6.7.0",_o="^2.3.0",wo="^0.3.3",Fo="^27.0.5",So="10.0.0",Ro="^4.3.3",Oo="^4.27.0",ko="^4.27.0",To="26.0.23",Do="15.6.1",Mo="./dist/main.es.css",Lo="./dist/main.es.js",Wo="dist",Ao="ts-jest",Vo="bvwebclient",No="besovideo",Bo="./dist/main.es.js",Ho="./dist/main.es.js",jo="@besovideo/webrtc-player",$o="README.md",Uo="npm run clean && dotenv -c production node .node/builder.js",Ko="shx rm -rf dist",Go="eslint --max-warnings 0 . --ext .ts",qo="dotenv -c development node .node/server.js",zo="jest",Jo="ts-node",Xo="./dist/types/main.d.ts",Qo="0.2.9",Zo="4",Yo="C:\\Users\\Administrator\\OneDrive",ei="C:\\Users\\Administrator\\OneDrive",ti="undefined",ni="Windows_NT",ri="D:\\software\\node\\node_modules\\npm\\node_modules\\npm-lifecycle\\node-gyp-bin;C:\\dev\\bvwebclient\\packages\\components\\player-core\\node_modules\\.bin;C:\\ProgramData\\scoop\\apps\\git\\2.31.1.windows.1\\mingw64\\bin;C:\\ProgramData\\scoop\\apps\\git\\2.31.1.windows.1\\usr\\bin;C:\\Users\\Administrator\\bin;C:\\Users\\Administrator\\scoop\\apps\\go\\current\\bin;C:\\ProgramData\\scoop\\shims;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;D:\\software\\node;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\dotnet;C:\\Program Files\\TortoiseGit\\bin;C:\\Program Files\\TortoiseSVN\\bin;C:\\Users\\Administrator\\go\\bin;C:\\Users\\Administrator\\scoop\\shims;C:\\Users\\Administrator\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files\\Bandizip;C:\\Users\\Administrator\\AppData\\Roaming\\npm;D:\\software\\Microsoft VS Code Insiders\\bin;D:\\software\\IntelliJ IDEA 2021.1.1\\bin;C:\\Users\\Administrator\\.dotnet\\tools;C:\\ProgramData\\scoop\\apps\\git\\current\\gbash;C:\\Users\\Administrator\\scoop\\apps\\python\\current\\Scripts;D:\\software\\hyper\\resources\\bin",oi="D:\\software\\node\\node_modules\\npm\\node_modules\\npm-lifecycle\\node-gyp-bin;C:\\dev\\bvwebclient\\packages\\components\\player-core\\node_modules\\.bin;C:\\ProgramData\\scoop\\apps\\git\\2.31.1.windows.1\\mingw64\\bin;C:\\ProgramData\\scoop\\apps\\git\\2.31.1.windows.1\\usr\\bin;C:\\Users\\Administrator\\bin;C:\\Users\\Administrator\\scoop\\apps\\go\\current\\bin;C:\\ProgramData\\scoop\\shims;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0;C:\\Windows\\System32\\OpenSSH;D:\\software\\node;C:\\ProgramData\\chocolatey\\bin;C:\\Program Files\\dotnet;C:\\Program Files\\TortoiseGit\\bin;C:\\Program Files\\TortoiseSVN\\bin;C:\\Users\\Administrator\\go\\bin;C:\\Users\\Administrator\\scoop\\shims;C:\\Users\\Administrator\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files\\Bandizip;C:\\Users\\Administrator\\AppData\\Roaming\\npm;D:\\software\\Microsoft VS Code Insiders\\bin;D:\\software\\IntelliJ IDEA 2021.1.1\\bin;C:\\Users\\Administrator\\.dotnet\\tools;C:\\ProgramData\\scoop\\apps\\git\\current\\gbash;C:\\Users\\Administrator\\scoop\\apps\\python\\current\\Scripts;D:\\software\\hyper\\resources\\bin",ii=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JSE;.WSF;.WSH;.MSC;.CPL",si="ssh",ai=" [93m[[39m[96mmaster[39m[96m \u2261[39m[31m +0[39m[31m ~6[39m[31m -0[39m[31m ![39m[93m][39m",li="AMD64",ci="Intel64 Family 6 Model 158 Stepping 11, GenuineIntel",di="6",pi="9e0b",ui="C:\\ProgramData",mi="C:\\Program Files",gi="C:\\Program Files (x86)",fi="C:\\Program Files",hi="$P$G",bi="C:\\Users\\Administrator\\Documents\\WindowsPowerShell\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules",yi="C:\\Users\\Public",vi="C:/dev/bvwebclient/packages/components/player-core",Ii="Console",Pi="3",Ci="bvplayer-core-",xi="@besovideo/webrtc-player",Ei="0.2.9",_i="bvplayerCore",wi="C:",Fi="C:\\Windows",Si="C:\\Users\\ADMINI~1\\AppData\\Local\\Temp",Ri="xterm-256color",Oi="vscode",ki="1.61.0-insider",Ti="C:\\Users\\ADMINI~1\\AppData\\Local\\Temp",Di="DESKTOP-0PI1EL3",Mi="DESKTOP-0PI1EL3",Li="Administrator",Wi="C:\\Users\\Administrator",Ai="d:\\software\\Microsoft VS Code Insiders\\resources\\app\\extensions\\git\\dist\\askpass-main.js",Vi="D:\\software\\Microsoft VS Code Insiders\\Code - Insiders.exe",Ni="\\\\.\\pipe\\vscode-git-eee3851946-sock",Bi="C:\\Windows",Hi="1",ji="D:/software/node/node.exe",m={ALLUSERSPROFILE:ot,APPDATA:it,AZ_ENABLED:st,ChocolateyInstall:at,ChocolateyLastPathUpdate:lt,CHROME_CRASHPAD_PIPE_NAME:ct,COLORTERM:dt,COMMONPROGRAMFILES:pt,"CommonProgramFiles(x86)":ut,CommonProgramW6432:mt,COMPUTERNAME:gt,COMSPEC:ft,DriverData:ht,EXEPATH:bt,FPS_BROWSER_APP_PROFILE_STRING:yt,FPS_BROWSER_USER_PROFILE_STRING:vt,GIT_ASKPASS:It,GIT_INSTALL_ROOT:Pt,GOPATH:Ct,GOROOT:xt,HOME:Et,HOMEDRIVE:_t,HOMEPATH:wt,INIT_CWD:Ft,"IntelliJ IDEA":St,LANG:Rt,LOCALAPPDATA:Ot,LOGONSERVER:kt,MAKEFLAGS:Tt,MAKELEVEL:Dt,MAKE_TERMERR:Mt,MAKE_TERMOUT:Lt,MFLAGS:Wt,MSYSTEM:At,MY_ENV:Vt,NODE:Nt,NODE_ENV:Bt,npm_config_access:Ht,npm_config_allow_same_version:jt,npm_config_also:$t,npm_config_always_auth:Ut,npm_config_argv:Kt,npm_config_audit:Gt,npm_config_audit_level:qt,npm_config_auth_type:zt,npm_config_before:Jt,npm_config_bin_links:Xt,npm_config_browser:Qt,npm_config_ca:Zt,npm_config_cache:Yt,npm_config_cache_lock_retries:en,npm_config_cache_lock_stale:tn,npm_config_cache_lock_wait:nn,npm_config_cache_max:rn,npm_config_cache_min:on,npm_config_cafile:sn,npm_config_cert:an,npm_config_cidr:ln,npm_config_color:cn,npm_config_commit_hooks:dn,npm_config_depth:pn,npm_config_description:un,npm_config_dev:mn,npm_config_dry_run:gn,npm_config_editor:fn,npm_config_engine_strict:hn,npm_config_fetch_retries:bn,npm_config_fetch_retry_factor:yn,npm_config_fetch_retry_maxtimeout:vn,npm_config_fetch_retry_mintimeout:In,npm_config_force:Pn,npm_config_format_package_lock:Cn,npm_config_fund:xn,npm_config_git:En,npm_config_git_tag_version:_n,npm_config_global:wn,npm_config_globalconfig:Fn,npm_config_globalignorefile:Sn,npm_config_global_style:Rn,npm_config_group:On,npm_config_ham_it_up:kn,npm_config_heading:Tn,npm_config_https_proxy:Dn,npm_config_if_present:Mn,npm_config_ignore_prepublish:Ln,npm_config_ignore_scripts:Wn,npm_config_init_author_email:An,npm_config_init_author_name:Vn,npm_config_init_author_url:Nn,npm_config_init_license:Bn,npm_config_init_module:Hn,npm_config_init_version:jn,npm_config_json:$n,npm_config_key:Un,npm_config_legacy_bundling:Kn,npm_config_link:Gn,npm_config_local_address:qn,npm_config_loglevel:zn,npm_config_logs_max:Jn,npm_config_long:Xn,npm_config_maxsockets:Qn,npm_config_message:Zn,npm_config_metrics_registry:Yn,npm_config_node_gyp:er,npm_config_node_options:tr,npm_config_node_version:nr,npm_config_noproxy:rr,npm_config_offline:or,npm_config_onload_script:ir,npm_config_only:sr,npm_config_optional:ar,npm_config_otp:lr,npm_config_package_lock:cr,npm_config_package_lock_only:dr,npm_config_parseable:pr,npm_config_prefer_offline:ur,npm_config_prefer_online:mr,npm_config_prefix:gr,npm_config_preid:fr,npm_config_production:hr,npm_config_progress:br,npm_config_proxy:yr,npm_config_read_only:vr,npm_config_rebuild_bundle:Ir,npm_config_registry:Pr,npm_config_rollback:Cr,npm_config_save:xr,npm_config_save_bundle:Er,npm_config_save_dev:_r,npm_config_save_exact:wr,npm_config_save_optional:Fr,npm_config_save_prefix:Sr,npm_config_save_prod:Rr,npm_config_scope:Or,npm_config_scripts_prepend_node_path:kr,npm_config_script_shell:Tr,npm_config_searchexclude:Dr,npm_config_searchlimit:Mr,npm_config_searchopts:Lr,npm_config_searchstaleness:Wr,npm_config_send_metrics:Ar,npm_config_shell:Vr,npm_config_shrinkwrap:Nr,npm_config_sign_git_commit:Br,npm_config_sign_git_tag:Hr,npm_config_sso_poll_frequency:jr,npm_config_sso_type:$r,npm_config_strict_ssl:Ur,npm_config_tag:Kr,npm_config_tag_version_prefix:Gr,npm_config_timing:qr,npm_config_tmp:zr,npm_config_umask:Jr,npm_config_unicode:Xr,npm_config_unsafe_perm:Qr,npm_config_update_notifier:Zr,npm_config_usage:Yr,npm_config_user:eo,npm_config_userconfig:to,npm_config_user_agent:no,npm_config_version:ro,npm_config_versions:oo,npm_config_viewer:io,npm_execpath:so,npm_lifecycle_event:ao,npm_lifecycle_script:lo,npm_node_execpath:co,npm_package_dependencies__shirtiny_logger:po,npm_package_description:uo,npm_package_devDependencies_autoprefixer:mo,npm_package_devDependencies_chalk:go,npm_package_devDependencies_dotenv_cli:fo,npm_package_devDependencies_esbuild:ho,npm_package_devDependencies_esbuild_sass_plugin:bo,npm_package_devDependencies_eslint:yo,npm_package_devDependencies_eslint_config_prettier:vo,npm_package_devDependencies_eslint_plugin_prettier:Io,npm_package_devDependencies_jest:Po,npm_package_devDependencies_open:Co,npm_package_devDependencies_postcss:xo,npm_package_devDependencies_postcss_preset_env:Eo,npm_package_devDependencies_prettier:_o,npm_package_devDependencies_shx:wo,npm_package_devDependencies_ts_jest:Fo,npm_package_devDependencies_ts_node:So,npm_package_devDependencies_typescript:Ro,npm_package_devDependencies__typescript_eslint_eslint_plugin:Oo,npm_package_devDependencies__typescript_eslint_parser:ko,npm_package_devDependencies__types_jest:To,npm_package_devDependencies__types_node:Do,npm_package_exports___dist_main_es_css:Mo,npm_package_exports___import:Lo,npm_package_files_0:Wo,npm_package_jest_preset:Ao,npm_package_keywords_0:Vo,npm_package_keywords_1:No,npm_package_main:Bo,npm_package_module:Ho,npm_package_name:jo,npm_package_readmeFilename:$o,npm_package_scripts_build:Uo,npm_package_scripts_clean:Ko,npm_package_scripts_lint:Go,npm_package_scripts_start:qo,npm_package_scripts_test:zo,npm_package_scripts_ts_node:Jo,npm_package_types:Xo,npm_package_version:Qo,NUMBER_OF_PROCESSORS:Zo,OneDrive:Yo,OneDriveConsumer:ei,ORIGINAL_XDG_CURRENT_DESKTOP:ti,OS:ni,Path:ri,PATH:oi,PATHEXT:ii,PLINK_PROTOCOL:si,POSH_GIT_STATUS:ai,PROCESSOR_ARCHITECTURE:li,PROCESSOR_IDENTIFIER:ci,PROCESSOR_LEVEL:di,PROCESSOR_REVISION:pi,ProgramData:ui,PROGRAMFILES:mi,"ProgramFiles(x86)":gi,ProgramW6432:fi,PROMPT:hi,PSModulePath:bi,PUBLIC:yi,PWD:vi,SESSIONNAME:Ii,SHLVL:Pi,SH_CSS_CLASS_PREFIX:Ci,SH_LIB_NAME:xi,SH_LIB_VERSION:Ei,SH_STORAGE_FIELD_PREFIX:_i,SYSTEMDRIVE:wi,SYSTEMROOT:Fi,TEMP:Si,TERM:Ri,TERM_PROGRAM:Oi,TERM_PROGRAM_VERSION:ki,TMP:Ti,USERDOMAIN:Di,USERDOMAIN_ROAMINGPROFILE:Mi,USERNAME:Li,USERPROFILE:Wi,VSCODE_GIT_ASKPASS_MAIN:Ai,VSCODE_GIT_ASKPASS_NODE:Vi,VSCODE_GIT_IPC_HANDLE:Ni,WINDIR:Bi,ZES_ENABLE_SYSMAN:Hi,_:ji};var se=t=>{let e;return t?e=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()):e=Date.now(),Math.floor(e/1e3)},ve=t=>{let e=typeof t=="number"?t:se(t),r=se();return e-r},$i=t=>ve(t)>0,Ui={getUTCSecond:se,pastNow:ve,compare:$i},ae=Ui;var Ki=Object.defineProperty,Gi=Object.defineProperties,qi=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,zi=Object.prototype.hasOwnProperty,Ji=Object.prototype.propertyIsEnumerable,Pe=(t,e,r)=>e in t?Ki(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e||(e={}))zi.call(e,r)&&Pe(t,r,e[r]);if(Ie)for(var r of Ie(e))Ji.call(e,r)&&Pe(t,r,e[r]);return t},Xi=(t,e)=>Gi(t,qi(e)),w;(function(t){t.red="#e72528",t.blue="#2a79af",t.weakBlue="#6eb6f4",t.geekblue="#85a5ff",t.gold="#ffd666",t.orange="#ffa940",t.cyan="#13c2c2",t.green="#52c41a",t.volcano="#fa541c",t.lime="#389e0d",t.pink="#eb2f96",t.purple="#722ed1",t.darkPurple="#292F4C",t.gray="#8c8c8c"})(w||(w={}));var Ce=class{constructor(){this.colors=w,this.shapes={slider:new xe}}},xe=class{constructor(){}title(t=""){return $`
|
|
1
|
+
var bvPlayerCore=(()=>{var je=Object.defineProperty,Jt=Object.defineProperties;var Gt=Object.getOwnPropertyDescriptors;var et=Object.getOwnPropertySymbols;var Xt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable;var tt=(t,e,n)=>e in t?je(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,k=(t,e)=>{for(var n in e||(e={}))Xt.call(e,n)&&tt(t,n,e[n]);if(et)for(var n of et(e))qt.call(e,n)&&tt(t,n,e[n]);return t},z=(t,e)=>Jt(t,Gt(e));var Qt=(t,e)=>{for(var n in e)je(t,n,{get:e[n],enumerable:!0})};var u=(t,e,n)=>new Promise((o,i)=>{var s=l=>{try{g(n.next(l))}catch(f){i(f)}},c=l=>{try{g(n.throw(l))}catch(f){i(f)}},g=l=>l.done?o(l.value):Promise.resolve(l.value).then(s,c);g((n=n.apply(t,e)).next())});var Yo={};Qt(Yo,{Conference:()=>Kt,Intercom:()=>Ut,PuPlayer:()=>$t,RemoteSdpFetcher:()=>ne,clearAllDialog:()=>Zo});var Zt="production",Yt="@besovideo/webrtc-player",jt="0.3.3",d={NODE_ENV:Zt,SH_LIB_NAME:Yt,SH_LIB_VERSION:jt};var en=Object.defineProperty,tn=Object.defineProperties,nn=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,rn=Object.prototype.propertyIsEnumerable,ot=(t,e,n)=>e in t?en(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,X=(t,e)=>{for(var n in e||(e={}))on.call(e,n)&&ot(t,n,e[n]);if(nt)for(var n of nt(e))rn.call(e,n)&&ot(t,n,e[n]);return t},sn=(t,e)=>tn(t,nn(e)),T;(function(t){t.red="#e72528",t.blue="#2a79af",t.weakBlue="#6eb6f4",t.geekblue="#85a5ff",t.gold="#ffd666",t.orange="#ffa940",t.cyan="#13c2c2",t.green="#52c41a",t.volcano="#fa541c",t.lime="#389e0d",t.pink="#eb2f96",t.purple="#722ed1",t.darkPurple="#292F4C",t.gray="#8c8c8c"})(T||(T={}));var rt=class{constructor(){this.colors=T,this.shapes={slider:new it}}},it=class{constructor(){}title(t=""){return q`
|
|
2
2
|
color: ${t};
|
|
3
3
|
border-left: 3px solid ${t};
|
|
4
4
|
padding: 2px;
|
|
5
5
|
font-weight: 600;
|
|
6
|
-
`}message(t=""){return
|
|
6
|
+
`}message(t=""){return q`
|
|
7
7
|
color: ${t};
|
|
8
|
-
`}message_button(t="#eee",e=
|
|
8
|
+
`}message_button(t="#eee",e=T.darkPurple,n="#fff"){return q`
|
|
9
9
|
background-color: ${e};
|
|
10
10
|
color: ${t};
|
|
11
11
|
padding: 2px 5px;
|
|
12
12
|
border-radius: 3px;
|
|
13
|
-
text-shadow: 0 0 2px ${
|
|
14
|
-
`}}
|
|
15
|
-
`,...e)},this.key=(t,...e)=>{let
|
|
13
|
+
text-shadow: 0 0 2px ${n};
|
|
14
|
+
`}},q=(t,...e)=>{if(e.length===0)return t[0];let n="";return e.forEach((o,i)=>{n+=t[i]+o}),n+=t[t.length-1],n},U;(function(t){t[t.title=1]="title",t[t.message=2]="message",t[t.message_button=3]="message_button"})(U||(U={}));var re=({color:t},e=new it,n)=>{switch(n){case 1:return e.title(t);case 2:return e.message(t);case 3:return e.message_button();default:return""}},an=class{constructor(t){let e={log:window.console.log,enable:!0};this._option=sn(X({},e),{enable:typeof(t==null?void 0:t.enable)=="boolean"?t.enable:e.enable,log:(t==null?void 0:t.log)||e.log})}log(...t){let{enable:e,log:n}=this._option;e&&n&&n(...t)}set baseOption(t){this._option=t}get baseOption(){return this._option}setEnable(t){this._option.enable=!!t}},st=class{constructor(t){let e={enable:!0,log:window.console.log,level:39,shape:new rt().shapes.slider};this.enable=t&&typeof t.enable=="boolean"?t.enable:e.enable,this.log=t&&t.log||e.log,this.level=t&&typeof t.level=="number"?t.level:e.level,this.shape=t&&t.shape?t.shape:e.shape}},ln=class extends an{constructor(t){super(t||new st);this.loggerOption=X(X({},new st),t)}setLoggerOption(t){let e=X(X({},this.loggerOption),t);this.loggerOption=e,super.baseOption={enable:e.enable,log:e.log}}getLoggerOption(){return this.loggerOption}setLevel(t){typeof t=="number"&&(this.loggerOption.level=t)}formatLog(t,e,n,o,i,...s){!this.loggerOption.level&&this.loggerOption.level!==0||this.loggerOption.level<t||super.log(`%c${e}%c${n}`,o,i,...s)}},at;(function(t){t[t.log=0]="log",t[t.version=0]="version",t[t.error=0]="error",t[t.key=0]="key",t[t.warn=1]="warn",t[t.interval=1]="interval",t[t.service=2]="service",t[t.api=3]="api",t[t.http=3]="http",t[t.debug=3]="debug"})(at||(at={}));var A={debug:{name:"debug",title:" Debug :",color:T.lime,level:3},http:{name:"http",title:" Http :",color:T.weakBlue,level:3},api:{name:"api",title:" Api :",color:T.cyan,level:3},service:{name:"service",title:" Service :",color:T.purple,level:2},interval:{name:"interval",title:" Interval :",color:T.pink,level:1},warn:{name:"warn",title:" WARN :",color:T.orange,level:1},error:{name:"error",title:" ERR :",color:T.red,level:0},key:{name:"key",title:" Key :",color:T.darkPurple,level:0}},ye=class extends ln{constructor(){super(...arguments);this.error=(t,...e)=>{this.formatShapeLog(A.error,`${t instanceof Error?t.stack:t}
|
|
15
|
+
`,...e)},this.key=(t,...e)=>{let n=A.key;this.formatLog(n.level,n.title,t.toUpperCase(),re({color:n.color},this.getLoggerOption().shape,U.title),re({},this.getLoggerOption().shape,U.message_button),...e)},this.version=(t="",e,...n)=>{this.formatLog(0,t.toUpperCase(),e,q`
|
|
16
16
|
background: linear-gradient(to right, #009fff, #ec2f4b);
|
|
17
17
|
color: white;
|
|
18
18
|
padding: 2px 5px;
|
|
19
19
|
border-top-left-radius: 3px;
|
|
20
20
|
border-bottom-left-radius: 3px;
|
|
21
|
-
|
|
22
|
-
background-color: ${
|
|
21
|
+
`,q`
|
|
22
|
+
background-color: ${T.darkPurple};
|
|
23
23
|
color: white;
|
|
24
24
|
padding: 2px 5px;
|
|
25
|
-
`,...r)}}formatLogWrapper(t,e,...r){!t||this.formatLog(t.level,t.title,e,z({color:t.color},this.getLoggerOption().shape,B.title),z({color:t.color},this.getLoggerOption().shape,B.message),...r)}debug(t,...e){this.formatLogWrapper(W.debug,t,...e)}http(t,...e){this.formatLogWrapper(W.http,t,...e)}api(t,...e){this.formatLogWrapper(W.api,t,...e)}service(t,...e){this.formatLogWrapper(W.service,t,...e)}interval(t,...e){this.formatLogWrapper(W.interval,t,...e)}warn(t,...e){this.formatLogWrapper(W.warn,t,...e)}},ce=new Ce,Yi=new le,es=Yi,T=es;var we=class extends le{constructor(){super(...arguments);this.test=(e,...r)=>{let o=4;this.formatLog(o," Test ",e,ce.shapes.slider.title("#3f6600"),ce.shapes.slider.message("#999"),...r)}}},de=new we;de.debug("player-core env:",m);de.version(m.SH_LIB_NAME,m.SH_LIB_VERSION||"");var a=de;var Fe=(t,e,r)=>{let o={value:e,expire:r},i=JSON.stringify(o);return localStorage.setItem(t,i),o},ts=(t,e,r)=>{let i=ae.getUTCSecond()+r;return Fe(t,e,i)},ns=(t,e=!1)=>{let r=localStorage.getItem(t);if(!r)return null;try{let o=JSON.parse(r);return e?o:o.expire?ae.compare(o.expire)?o.value:null:o.value}catch(o){a.error(o,r,"Storage\u8BFB\u53D6\u6570\u636E\u65F6\uFF0C JSON\u89E3\u6790\u51FA\u9519")}},rs=t=>localStorage.removeItem(t),os={set:Fe,setTimeout:ts,get:ns,remove:rs},D=os;var J;(function(r){r.GET="GET",r.POST="POST"})(J||(J={}));var Se=(t,e)=>l(void 0,null,function*(){let r=new AbortController;if(e.signal&&e.signal.addEventListener("abort",()=>{r.abort()}),e.timeout){let c=setTimeout(()=>{r.abort()},e.timeout);r.signal.addEventListener("abort",()=>{clearTimeout(c)})}let o=e.bodyData,i=o&&(typeof o=="object"?JSON.stringify(o):o),s={credentials:"same-origin",method:e.method,headers:new Headers(k({},e.headers)),signal:r.signal};i&&(s.body=i),a.http("\u53D1\u9001\u8BF7\u6C42\uFF1A",t,N(k({},s),{body:o}));try{let c=yield fetch(t,s);if(a.http("\u8BF7\u6C42\u54CD\u5E94\uFF1A",t,c,yield c.clone().text()),c.ok||c.status>=200&&c.status<300){let f=c.headers.get("content-type")||"";if(/application\/json/i.test(f))return yield c.json()}else throw new Error(`${c.status} ${c.statusText}`)}catch(c){if(c.name==="AbortError"){a.http("\u8BF7\u6C42\u53D6\u6D88\uFF1A",s);return}throw c}}),is=(t,e,r)=>l(void 0,null,function*(){let o=e?e.toString():"";return yield Se(t+o,{method:J.GET,headers:r==null?void 0:r.headers})}),ss=(t,e,r)=>l(void 0,null,function*(){return yield Se(t,{method:J.POST,headers:k({"Content-Type":"application/json;charset=UTF-8"},r==null?void 0:r.headers),bodyData:e})}),as={get:is,post:ss},X=as;function Re(t){return t!==t}function ls(t,e=[]){let r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}function cs(t,e,r){let o=r-1,i=t.length;for(;++o<i;)if(t[o]===e)return o;return-1}function ds(t,e,r,o=!1){let i=t.length,s=r+(o?1:-1);for(;o?s--:++s<i;)if(e(t[s],s,t))return s;return-1}function ps(t,e,r){return e===e?cs(t,e,r):ds(t,Re,r)}function us(t,e){let r=-1,o=e.length,i=t;for(t===e&&(e=ls(e));++r<o;){let s=0,c=e[r],f=c;for(;(s=ps(i,f,s))>-1;)i!==t&&[].splice.call(i,s,1),[].splice.call(t,s,1)}return t}var ms=(t,e)=>!t||!t.length||!e||!e.length?t:us(t,e),gs={pullAll:ms,baseIsNaN:Re},Oe=gs;var ke={BVCSP_V1:{path:"/bvcsp/v1",prefix:""}},pe=t=>{let e=ke[t];return e.prefix+e.path},fs=(t,e)=>{let r=ke[t];return r.prefix=e||"",pe(t)},U={setApiPrefix:fs,getApiURL:pe,bvscpV1:()=>pe("BVCSP_V1")},K=t=>{U.setApiPrefix("BVCSP_V1",t)};var hs=t=>{if(!t)return null;if(t.nodeType===Node.DOCUMENT_NODE)return t.documentElement;if(t.nodeType===Node.ELEMENT_NODE){let e=t;return e.hasChildNodes()&&e.childNodes.forEach(r=>{let o=r;o.className&&new RegExp(".*bvplayer-core-player.*").test(o.className)&&e.removeChild(o)}),t}return null},bs=(t,e,r)=>{if(!t)return;let o=document.createDocumentFragment();o.appendChild(t);let i=hs(e);!i||(i.appendChild(o),r==null||r())},Te=bs;var De=(...t)=>{let e=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o)continue;let i=typeof o;if(i==="string"||i==="number")e.push(o);else if(Array.isArray(o)){if(o.length){let s=De(...o);s&&e.push(s)}}else if(i==="object")if(o.toString==={}.toString)for(let s in o)({}).hasOwnProperty.call(o,s)&&o[s]&&e.push(s);else e.push(o.toString())}return e.join(" ")},Q=De;var ys={render:Te,cls:Q},Me=m.SH_CSS_CLASS_PREFIX,Le=m.SH_STORAGE_FIELD_PREFIX,P=ys;var A=`${Le}DialogIds`,vs=(t,e)=>l(void 0,null,function*(){var c;let r={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield X.post(`${U.bvscpV1()}/dialog/device/webrtc`,o,{headers:r});if(a.api("\u8BBE\u5907\u97F3\u89C6\u9891\u6D41 webrtc\u65B9\u5F0F\u6253\u5F00dialog: ",{params:o,resData:i}),!i||i.code!==0||!((c=i.data)==null?void 0:c.dialogid))throw new Error(`\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25\uFF0C ${i.msg}`);let{data:s}=i;if(s.dialogid){let f=D.get(A)||[];f.push(s.dialogid),D.set(A,f)}return{dialogId:s.dialogid,sdp:s.sdp}}),Is=(t,e)=>l(void 0,null,function*(){var f;let r={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield X.post(`${U.bvscpV1()}/dialog/conference/webrtc`,o,{headers:r});if(a.api("\u4F1A\u8BAE\u97F3\u89C6\u9891\u6D41 webrtc\u65B9\u5F0F\u6253\u5F00dialog: ",{params:o,resData:i}),!i||i.code!==0||!((f=i.data)==null?void 0:f.dialogid))throw new Error(`\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25\uFF0C ${i==null?void 0:i.msg}`);let{data:s}=i,c=D.get(A)||[];return c.push(s.dialogid),D.set(A,c),{dialogId:s.dialogid,sdp:s.sdp}}),Ps=(t,e)=>l(void 0,null,function*(){if(!t)return;let r={Authorization:e||""};return a.api("\u5173\u95EDdialog\uFF1A",t),yield X.post(`${U.bvscpV1()}/dialog/close/${t}`,{},{headers:r})}),We=(t,e)=>l(void 0,null,function*(){let r=D.get(A)||[];Oe.pullAll(r,t),D.set(A,r,0);let i=(yield Promise.allSettled(t.map(s=>Ps(s,e)))).filter(s=>s.status==="rejected");i&&i.length>0&&a.error(new Error(`"\u5173\u95ED\u5B58\u50A8\u7684dialog\u65F6\u5931\u8D25\uFF1A", ${i}`))}),Cs=t=>l(void 0,null,function*(){let e=D.get(A);!e||e.length<1||(D.remove(A),yield We(e,t))}),xs={getDeviceWebrtc:vs,getConferenceWebrtc:Is,closeDialogs:We,closeAllStorageDialog:Cs},S=xs;var Ae=class{constructor(){this._map=new Map}findExecutor(e,r){let o=this._map.get(e);return{index:o?o.findIndex(s=>Object.is(r,s)):-1,que:o}}publish(e,r){let o=this._map.get(e)||[],i=o.length;for(let s=0;s<i;s++){let c=o[s];c&&c(r)}}subscribe(e,r){let{index:o,que:i=[]}=this.findExecutor(e,r);return o>=0?i[o]=r:i.push(r),this._map.set(e,i),{unSubscribe:()=>{this.unSubscribe(e,r)}}}unSubscribe(e,r){let{index:o,que:i=[]}=this.findExecutor(e,r);o<0||(i.splice(o,1),this._map.set(e,i))}},G=class{constructor(){this._notifier=new Ae}addEventListener(e,r){this._notifier.subscribe(e,r)}removeEventListener(e,r){this._notifier.unSubscribe(e,r)}dispatch(e,r){this._notifier.publish(e,r)}};var M=class extends G{constructor(e,r){super();let o=document.createElement(e);o.className=Me+r.trim(),this.el=o}unmount(){var e,r,o,i;return a.debug("unmount",this.el,(e=this.el)==null?void 0:e.parentNode),(o=(r=this.el)==null?void 0:r.parentNode)==null||o.removeChild(this.el),(i=this.el)==null?void 0:i.parentNode}destroy(){this.beforeDestroy(),this.unmount(),a.debug("destroy",this.el),this.el=null,this.dispatch("destroy")}getEl(){return this.el}};var Ve=class extends M{constructor(e){super("div",P.cls("mask"));this._visible=!!(e==null?void 0:e.visible),this._text=e==null?void 0:e.text,this._textEl=document.createElement("span"),this._textEl.className=Q("text")}set visible(e){this._visible=e,this.el.style.display=this._visible?"grid":"none"}set text(e){this._text=e,this._textEl.textContent=e}beforeDestroy(){}init(){a.debug("mask visible: ",this._visible);let e=this.el;e.style.display=this._visible?"block":"none";let r=document.createDocumentFragment();return this._textEl.textContent=this._text||"",r.appendChild(this._textEl),e.appendChild(r),e}},Ne=Ve;var Be=class extends M{constructor(e){super("div",P.cls("spinner"));this._spin=!!(e==null?void 0:e.spin)}set spin(e){this._spin=e,this.el.style.display=this._spin?"block":"none"}beforeDestroy(){}init(){a.debug("spinner spin: ",this._spin);let e=this.el;e.style.display=this._spin?"block":"none";let r=document.createDocumentFragment(),o=document.createElement("span");return o.style.backgroundColor="#FFF",r.appendChild(o),e.appendChild(r),e}},He=Be;var je={contain:"contain",fill:"fill"},$e=class extends M{constructor(e){super("video",P.cls("video"));this._url=e==null?void 0:e.url,this._srcObject=(e==null?void 0:e.srcObject)||null,this._fit=(e==null?void 0:e.fit)||je.contain,this._autoPlay=!!(e==null?void 0:e.autoPlay),this._muted=!!(e==null?void 0:e.muted)}set url(e){typeof this._url!="undefined"&&(this.el.src=this._url),this._url=e}set srcObject(e){this._srcObject=e||null,this.el.srcObject=this._srcObject}set muted(e){if(e===this._muted)return;let r=this.el;this._muted=e,r.muted=e}set autoPlay(e){if(!e!==this._autoPlay)return;this._autoPlay=e,this.muted=e;let r=this.el;r.autoplay=this._autoPlay}set fit(e){this._fit=je[e],this.el.style.objectFit=this._fit}getVideoFit(){return this._fit}init(){a.debug("\u6E32\u67D3VideoPlugin\u89C6\u9891\u5BF9\u8C61",this,this.el);let e=this.el;return typeof this._url!="undefined"&&(e.src=this._url),e.srcObject=this._srcObject,e.autoplay=this._autoPlay,e.muted=this._muted,e.style.objectFit=this._fit,e.playsInline=!0,e}play(){return l(this,null,function*(){let e=this.el;try{a.debug("video \u5C1D\u8BD5\u64AD\u653E"),yield e.play()}catch(r){a.error(r,"video \u64AD\u653E \u5931\u8D25")}})}beforeDestroy(){}},Ue=$e;var Es=(t,e)=>{T.debug(`webrtc my ICE candidate:
|
|
26
|
-
${e.candidate?e.candidate.candidate:"(null)"}`)},_s=(t,e,r)=>{T.debug("webrtc ICE state change event: ",e),T.debug(`webrtc my ICE state: ${t==null?void 0:t.iceConnectionState}`),t&&t.iceConnectionState==="disconnected"&&r&&r()},ws=(t,e)=>{T.debug("webrtc Connection state change, \u5F53\u524D\u8FDE\u63A5\u72B6\u6001: ",t,t.connectionState)},Fs=(t,e,r)=>{T.debug("webrtc \u5F53\u524D\u7684 stream: ",e.streams[0]);let o=e.streams[0];r(o)},Ss=(t,e)=>l(void 0,null,function*(){let{offerParam:r,productRemoteSdp:o,customerRTCPeerConnection:i,onConnected:s,onConnectedFailed:c,onIceDisconnected:f,onPcEventAdded:h,onLocalDescriptionReady:y}=t,x=!!i&&i instanceof RTCPeerConnection,v={},g=x?i:new RTCPeerConnection(v);if(g.addEventListener("icecandidate",p=>Es(g,p)),g.addEventListener("iceconnectionstatechange",p=>_s(g,p,f)),g.addEventListener("connectionstatechange",p=>ws(g,p)),g.addEventListener("track",p=>Fs(g,p,e)),h&&(yield h(g)),x)return{pc:g};try{let p=yield g.createOffer(r);T.debug("\u521B\u5EFAoffer\uFF0C\u53C2\u6570\uFF1A",r,"\uFF0C \u7ED3\u679C\uFF1A",p),yield g.setLocalDescription(p),y&&y(g);let b=yield o(new RTCSessionDescription(p));T.debug("webrtc recv open answer",b);let F=new RTCSessionDescription({type:"answer",sdp:b});yield g.setRemoteDescription(F),T.debug("getTransceivers",g.getTransceivers()),s&&s(g)}catch(p){throw c&&c(g),T.error(new Error(`webrtc Failed to create session description: ${p.toString()}`)),g.close(),p}return{pc:g}}),Rs=t=>{if(!t)return;let{pc:e}=t;e.close()},Os={connect:Ss,disconnect:Rs},ue=Os;var R;(function(o){o.DIRECT="direct",o.PLUGIN="plugin",o.REJECT="reject"})(R||(R={}));var Z;(function(s){s.MP4="mp4",s.FLAC="flac",s.OGG="Ogg",s.WEBM="webm",s.AUTO="auto"})(Z||(Z={}));var me;(function(e){e.WEBRTC="webrtc"})(me||(me={}));var Ke;(function(r){r[r.DIRECT_SUPORT_TYPES=0]="DIRECT_SUPORT_TYPES",r[r.PLUGIN_SUPORT_TYPES=1]="PLUGIN_SUPORT_TYPES"})(Ke||(Ke={}));var Ge=class extends M{constructor(e){super("div",P.cls("player"));this._video=new Ue,this._spinner=new He({spin:!1}),this._mask=new Ne({visible:!1}),this._videoOption=e==null?void 0:e.video,this._pluginOption=e==null?void 0:e.pluginOption,this._playerConfig=e==null?void 0:e.playerConfig,this._mode=this._restrictPlayerMode(e==null?void 0:e.video,e==null?void 0:e.pluginOption)}justifyVideoType(e,r){return(e==null?void 0:e.url)&&!e.type?Z.AUTO:(e==null?void 0:e.type)||Object.keys(r||{})[0]}_restrictPlayerMode(e,r){let o=this.justifyVideoType(e,r);if(!o&&!(e==null?void 0:e.url))return R.REJECT;if(!o)return R.DIRECT;let i=Object.values(Z),s=Object.values(me);return i.includes(o)?R.DIRECT:s.includes(o)?R.PLUGIN:R.DIRECT}init(){var s;a.debug("\u6E32\u67D3PlayerPlugin",this.el),this.prepare();let e=document.createDocumentFragment(),r=this._video.init(),o=this._spinner.init(),i=this._mask.init();return e.appendChild(r),e.appendChild(o),e.appendChild(i),(s=this.el)==null||s.appendChild(e),this.dispatch("init",{mode:this._mode}),this.el}get video(){return this._video}get spinner(){return this._spinner}get mask(){return this._mask}play(e){return l(this,null,function*(){this.mute(!0),yield this._video.play(),this.mute(e)})}mute(e){var r;this._video.muted=!!e,a.debug("player mute: ",(r=this._video.getEl())==null?void 0:r.muted)}setProductRemoteSdp(e){!this._pluginOption||!this._pluginOption.webrtc||(this._pluginOption.webrtc.productRemoteSdp=e)}prepareWebrtc(){return l(this,null,function*(){var r;if(this._mode!==R.PLUGIN)return;a.debug("PuPlayer Plugin prepareWebrtc");let e=(r=this._pluginOption)==null?void 0:r.webrtc;!e||(this._video.autoPlay=!0,this._spinner.spin=!0,this._webrtcConnect=yield ue.connect(e,o=>{var s;if(!o)return;(s=this.video.getEl())==null||s.addEventListener("canplay",()=>{console.log("Video canplay"),this.video.play()}),this._video.srcObject=o;let i=o.getTracks()[0];i.onended=c=>{console.log("\u6D41\u89C6\u9891\u8F68\u9053\u5DF2\u7ECF\u7EC8\u6B62",c)},i.onmute=c=>{console.log("\u6D41\u89C6\u9891\u8F68\u9053\u6682\u65F6\u65E0\u6CD5\u63D0\u4F9B\u5A92\u4F53",c),this.onMuted()},i.onunmute=c=>{console.log("\u6D41\u89C6\u9891\u8F68\u9053\u63D0\u4F9B\u5A92\u4F53",c),this.onUnMuted()}}))})}close(){this.closeWebrtc()}beforeDestroy(){this.close()}onMuted(){}onUnMuted(){}loadPlayerConfig(){var e,r,o;this.video.autoPlay=!!((e=this._playerConfig)==null?void 0:e.autoPlay),(r=this.video.getEl())==null||r.addEventListener("canplay",()=>{console.log("Video canplay"),this._spinner.spin=!1,this._mask.visible=!1}),(o=this.video.getEl())==null||o.addEventListener("waiting",()=>{console.log("Video is waiting for more data."),this._spinner.spin=!0})}prepare(){if(a.debug("PlayerPlugin mode: ",this._mode),this.loadPlayerConfig(),this._mode===R.REJECT){a.error(new Error("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u7C7B\u578B"),this._mode,this._videoOption);return}if(this._mode===R.DIRECT){this.prepareDirect();return}if(this._mode===R.PLUGIN){switch(this.justifyVideoType(this._videoOption,this._pluginOption)){case"webrtc":break;default:break}return}}prepareDirect(){var e;this._video.url=((e=this._videoOption)==null?void 0:e.url)||"",setTimeout(()=>{this.play()},300)}closeWebrtc(){var e;ue.disconnect(this._webrtcConnect),this.dispatch("closeWebrtc",{peerConnection:(e=this._webrtcConnect)==null?void 0:e.pc}),this._webrtcConnect=null,this._video.srcObject=null}},Y=Ge;var H=document.documentElement,ee="requestFullscreen",te="exitFullscreen",ne="fullscreenElement",re="onfullscreenchange";if("webkitRequestFullScreen"in H)ee="webkitRequestFullScreen",te="webkitExitFullscreen",ne="webkitFullscreenElement",re="onwebkitfullscreenchange";else if("msRequestFullscreen"in H)ee="msRequestFullscreen",te="msExitFullscreen",ne="msFullscreenElement",re="MSFullscreenChange";else if("mozRequestFullScreen"in H)ee="mozRequestFullScreen",te="mozCancelFullScreen",ne="mozFullScreenElement",re="onmozfullscreenchange";else if(!("requestFullscreen"in H))throw"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Fullscreen API !";function ks(t=H,e){return t[ee](e)}function Ts(){return document[te]()}function qe(t){return t===document[ne]}function Ds(t=H,e){return qe(t)?Ts():ks(t,e)}function Ms(t,e){let r=()=>{t.onfullscreenchange=null},o=i=>{i.target!==null&&e(qe(i.target))};return t[re]=o,{cancel:r}}var Ls={toggle:Ds,watch:Ms},ze=Ls;var Ws=(t,e,r)=>o=>l(void 0,null,function*(){if(o.type==="offer"){a.debug("\u8BF7\u6C42\u8FDC\u7AEFsdp\uFF0C \u8BBE\u5907\u914D\u7F6E\u4FE1\u606F\uFF1A",t,"token: ",e),a.debug("\u672C\u5730sdp",o);try{let{id:i,index:s}=t||{},c=yield S.getDeviceWebrtc({id:i,index:s,sdp:o.sdp},e);return r&&r(c.dialogId),c.sdp}catch(i){throw a.error(i,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`PUPlayer open \u5931\u8D25 , ${i.message}`)}}}),As=t=>{let{container:e,token:r,puOption:o,defaultMediaOption:i={audio:!0,video:!0},testUrl:s,videoFit:c="fill",muted:f,apiPrefix:h,onConnected:y,onConnectedFailed:x,onDisConnected:v,fullScreenOnDblclick:g=!0}=t||{},p,b=r,F=o,O=e,E=typeof f=="boolean"?f:!i.audio;K(h);let I=()=>l(void 0,null,function*(){if(!!p&&(a.debug("PuPlayer close",p),d.mask.visible=!0,d.mask.text="Video Closed",d.close(),p))try{yield S.closeDialogs([p],b)}catch(u){throw a.error(u,"PuPlayer close \u5931\u8D25"),new Error(`PuPlayer close \u5931\u8D25 , ${u.message}`)}}),d=new Y({video:{url:s},pluginOption:{webrtc:{offerParam:{offerToReceiveAudio:i.audio,offerToReceiveVideo:i.video},productRemoteSdp:u=>l(void 0,null,function*(){return Ws(F,b,V=>{p=V})(u)}),onIceDisconnected:()=>{d.mask.visible=!0,d.mask.text="lost connection",d.close(),v&&v()},onConnected:()=>{y&&y()},onConnectedFailed:()=>{x&&x()}}},playerConfig:{autoPlay:!0}});d.addEventListener("init",u=>{a.debug("\u76D1\u542C\u5230\u4E86 player\u5DF2\u7ECF\u521D\u59CB\u5316",u)}),d.mute(E),d.video.fit=c;let C=d.init();g&&(C==null||C.addEventListener("dblclick",()=>{a.debug("\u53CC\u51FBplayer\uFF1A",C),ze.toggle(C)}));let L={instance:{getVideoElement:()=>d.video.getEl(),getPlayerElement:()=>d.getEl(),open:(u=!1)=>l(void 0,null,function*(){a.debug("PuPlayer open"),yield I(),d.mask.visible=!1,d.mask.text="connecting",d.mute(!!u);try{yield d.prepareWebrtc()}catch(_){throw d.mask.visible=!0,d.mask.text="connect failed",_}if(typeof u=="boolean"&&u){let _=()=>{a.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",E),a.debug("\u6B64\u90E8\u5206\u67E5\u770B\uFF1Ahttps://developers.google.com/web/updates/2017/09/autoplay-policy-changes"),d.mute(E),document.removeEventListener("click",_),document.removeEventListener("touchend",_)};document.addEventListener("click",_),document.addEventListener("touchend",_)}}),play:()=>l(void 0,null,function*(){yield d.play(E)}),mute:(u=!1)=>{E=u,d.mute(u)},hidden:u=>l(void 0,null,function*(){let _=C,V=d.video.getEl();_.style.display="none",document.body.appendChild(_),V.muted=!0;try{typeof u!="undefined"&&(E=u),yield d.play(E)}catch(qs){a.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}a.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",V.paused)}),display:u=>l(void 0,null,function*(){let _=C,V=d.video.getEl();P.render(_,O,()=>l(void 0,null,function*(){_.style.display="block",typeof u!="undefined"&&(E=u),yield d.play(E)})),a.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",V.paused)}),moveTo:u=>{a.debug("\u79FB\u52A8\u81F3\uFF1A",u),O=u,P.render(C,O,()=>l(void 0,null,function*(){}))},getCurrentContainer:()=>O,setPuOption:u=>{F=u},setVideoFit:u=>{a.debug("PuPlayer setVideoFit",u),d.video.fit=u},setToken:u=>{a.debug("PuPlayer setToken",u),b=u},setApiPrefix:K,close:I,render:d.init,destroy:()=>l(void 0,null,function*(){a.debug("PuPlayer destroy"),yield I(),d.destroy()})},element:C};return O&&(P.render(C,O),L.element=null),L},Je=As;var ge=class extends G{constructor(e,r){super();this._plugin=e,this._el=this._plugin.init(),this._currentContainer=r}moveTo(e,r){a.debug("\u79FB\u52A8\u81F3\uFF1A",e),this._currentContainer=e,P.render(this._el,this._currentContainer,r)}getCurrentContainer(){return this._currentContainer}render(){return this._plugin.init()}destroy(){a.debug("destroy",this._plugin),this._plugin.destroy(),this.dispatch("destroy")}};var q=class{constructor(e,r,o,i){this.token="";this.fetchSdpFunc=e,this.token=r||"",this.param=o,this.prefix=i}fetch(e){return l(this,null,function*(){a.debug("RemoteSdpFetcher fetch \u8BF7\u6C42\u8FDC\u7AEFsdp\uFF0C param\uFF1A",this.param,"token: ",this.token);let r=yield this.fetchSdpFunc(e,this.param,this.token,this.prefix),{sdp:o,dialogId:i}=r||{};return this.dialogId=i,a.debug(`RemoteSdpFetcher fetch \u83B7\u5F97\u7684remoteSdp ${o}, dialogId: ${i}`),o})}close(){return l(this,null,function*(){a.debug(`remoteSdpFetcher close\uFF0C \u68C0\u67E5dialogId: ${this.dialogId}`),this.dialogId&&(yield S.closeDialogs([this.dialogId]))})}},fe=class extends ge{constructor(e,r,o,i,s){super(e,s);this._muted=!1;this._videoFit="contain";this.setRemoteSdpFetcher(i),this.setVideoFit(r),this.setMuted(o)}get player(){return this._plugin}getPlayerElement(){return this.player.getEl()}getVideoElement(){return console.log(this._plugin),console.log(this.player),this.player.video.getEl()}setRemoteSdpFetcher(e){this._remoteSdpFetcher=e,this._plugin.setProductRemoteSdp(r=>l(this,null,function*(){var o;return(o=this._remoteSdpFetcher)==null?void 0:o.fetch(r)}))}getRemoteSdpFetcher(){return this._remoteSdpFetcher}setVideoFit(e){a.debug("BvWebrtcInstance setVideoFit",e),this._videoFit=e,this.player.video.fit=e}getVideoFit(){return this._videoFit}setMuted(e=!1){this._muted=e,this.player.mute(e)}getMuted(){return this._muted}mute(e=!1){return this.setMuted(e)}open(e=!1){return l(this,null,function*(){a.debug("PuPlayer open"),yield this.close(),this.player.mask.visible=!1,this.player.mask.text="connecting",this.player.mute(!!e);try{yield this.player.prepareWebrtc()}catch(r){throw this.player.mask.visible=!0,this.player.mask.text="connect failed",r}if(e){let r=()=>{a.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",this._muted),a.debug("\u6B64\u90E8\u5206\u67E5\u770B\uFF1Ahttps://developers.google.com/web/updates/2017/09/autoplay-policy-changes"),this.player.mute(this._muted),document.removeEventListener("click",r),document.removeEventListener("touchend",r)};document.addEventListener("click",r),document.addEventListener("touchend",r)}})}play(){return l(this,null,function*(){yield this.player.play(this._muted)})}hidden(e){return l(this,null,function*(){let r=this._el,o=this.player.video.getEl();r.style.display="none",document.body.appendChild(r),o.muted=!0;try{typeof e!="undefined"&&(this._muted=e),yield this.player.play(this._muted)}catch(i){a.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}a.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}display(e){return l(this,null,function*(){let r=this._el,o=this.player.video.getEl();P.render(r,this._currentContainer,()=>l(this,null,function*(){r.style.display="block",typeof e!="undefined"&&(this._muted=e),yield this.player.play(this._muted)})),a.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}close(){return l(this,null,function*(){if(a.debug("BvWebrtcInstance close",`_dialogId: ${this._dialogId}`),this.player.mask.visible=!0,this.player.mask.text="Video Closed",this.player.close(),a.debug("BvWebrtcInstance close\uFF0C player closed\uFF0C\u68C0\u67E5 remoteSdpFetcher: ",this._remoteSdpFetcher),this.dispatch("close"),this._remoteSdpFetcher)try{yield this._remoteSdpFetcher.close()}catch(e){throw a.error(e,"BvWebrtcInstance close \u5931\u8D25"),new Error(`BvWebrtcInstance close \u5931\u8D25 , ${e.message}`)}})}destroy(){a.debug("PuPlayer destroy"),this.close(),this.player.destroy()}};var Vs=t=>{let{container:e,sdpFetcher:r,offerParam:o,videoFit:i,muted:s,autoPlay:c,onConnected:f,onClose:h,onDestroy:y,onConnectedFailed:x,onDisConnected:v,onPcEventAdded:g}=t,p=new Y({pluginOption:{webrtc:{offerParam:o,productRemoteSdp:()=>l(void 0,null,function*(){return""}),onIceDisconnected:()=>{p.mask.visible=!0,p.mask.text="lost connection",p.close(),v&&v()},onPcEventAdded:g,onConnected:()=>{p.mask.visible=!1,p.mask.text="connected",f&&f()},onConnectedFailed:()=>{x&&x()}}},playerConfig:{autoPlay:c}}),b=new fe(p,i,s,r,e);b.addEventListener("close",()=>{h&&h()}),b.addEventListener("destroy",()=>{y&&y()});let F={open:()=>l(void 0,null,function*(){a.debug("BvWebrtc open"),yield b.open()}),setOption:I=>{a.debug("BvWebrtc setOption");let d=b.getRemoteSdpFetcher();d&&(d.param=I)},setToken:I=>{a.debug("BvWebrtc setToken",I);let d=b.getRemoteSdpFetcher();d&&(d.token=I)},setApiPrefix:I=>{a.debug("BvWebrtc setApiPrefix",I);let d=b.getRemoteSdpFetcher();d&&(d.prefix=I)},getRemoteSdpFetcher:()=>b.getRemoteSdpFetcher(),close:()=>l(void 0,null,function*(){a.debug("BvWebrtc close"),yield b.close()}),render:()=>(a.debug("BvWebrtc render"),b.render()),destroy:()=>{a.debug("BvWebrtc destroy"),b.destroy()}},O=b.render(),E={instance:F,element:O};return e&&(P.render(O,e),E.element=null),E},Xe=Vs;var Ns=()=>l(void 0,null,function*(){a.debug("\u8BF7\u6C42\u9EA6\u514B\u98CE...");let t=yield navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),e=t.getAudioTracks();return a.debug("\u9EA6\u514B\u98CE \u97F3\u9891\u8F68\u9053\uFF1A",e),t}),Bs=t=>{let{container:e,token:r,getRemoteSdpParam:o,apiPrefix:i,getRemoteSdpResult:s,onConnected:c,onClose:f,onDestroy:h,onConnectedFailed:y,onDisConnected:x,onGetUserMediaFailed:v}=t||{},g=(I,d,C,ie)=>l(void 0,null,function*(){if(a.debug("audioPlayer productRemoteSdp",{param:{localDescription:I,param:d,token:C,prefix:ie}}),I.type==="offer"&&(K(ie),a.debug("\u672C\u5730sdp",I),!!s))try{let{sdp:L,dialogId:u}=yield s(I.sdp,C,d);return{sdp:L,dialogId:u}}catch(L){throw a.error(L,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`productRemoteSdp \u5931\u8D25 , ${L.message}`)}}),p=new q(g,r,o,i),{instance:b,element:F}=Xe({container:e,sdpFetcher:p,offerParam:{offerToReceiveAudio:!0},videoFit:"contain",muted:!1,autoPlay:!0,onConnected:c,onClose:f,onDestroy:h,onConnectedFailed:y,onDisConnected:x,onPcEventAdded:I=>l(void 0,null,function*(){try{let d=yield Ns();d.getTracks().forEach(C=>I.addTrack(C,d))}catch(d){v&&v()}})});return{instance:k({},b),element:F}},oe=Bs;var Hs=(t,e,r)=>l(void 0,null,function*(){let{id:o,index:i}=r||{};return yield S.getDeviceWebrtc({id:o,index:i,sdp:t},e)}),js=t=>{let{container:e,token:r,puOption:o,apiPrefix:i,onConnected:s,onClose:c,onDestroy:f,onConnectedFailed:h,onDisConnected:y,onGetUserMediaFailed:x}=t||{},{instance:v,element:g}=oe({container:e,token:r,getRemoteSdpParam:o,getRemoteSdpResult:Hs,apiPrefix:i,onConnected:s,onClose:c,onDestroy:f,onConnectedFailed:h,onDisConnected:y,onGetUserMediaFailed:x}),p=N(k({},v),{setPuOption:F=>v.setOption&&v.setOption(F)});return delete p.setOption,{instance:p,element:g}},Qe=js;var $s=(t,e,r)=>l(void 0,null,function*(){let{id:o,index:i}=r||{};return yield S.getConferenceWebrtc({id:o,index:i,sdp:t},e)}),Us=t=>{let{container:e,token:r,confOption:o,apiPrefix:i,onConnected:s,onClose:c,onDestroy:f,onConnectedFailed:h,onDisConnected:y,onGetUserMediaFailed:x}=t||{},{instance:v,element:g}=oe({container:e,token:r,getRemoteSdpParam:o,getRemoteSdpResult:$s,apiPrefix:i,onConnected:s,onClose:c,onDestroy:f,onConnectedFailed:h,onDisConnected:y,onGetUserMediaFailed:x}),p=N(k({},v),{setConfOption:F=>v.setOption&&v.setOption(F)});return delete p.setOption,{instance:p,element:g}},Ze=Us;var Ks=S.closeAllStorageDialog;return Gs;})();
|
|
25
|
+
`,...n)}}formatShapeLog({level:t,title:e,color:n},o,...i){this.formatLog(t,e,o,re({color:n},this.getLoggerOption().shape,U.title),re({color:n},this.getLoggerOption().shape,U.message),...i)}debug(t,...e){this.formatShapeLog(A.debug,t,...e)}http(t,...e){this.formatShapeLog(A.http,t,...e)}api(t,...e){this.formatShapeLog(A.api,t,...e)}service(t,...e){this.formatShapeLog(A.service,t,...e)}interval(t,...e){this.formatShapeLog(A.interval,t,...e)}warn(t,...e){this.formatShapeLog(A.warn,t,...e)}},nr=new rt,cn=new ye,dn=cn,D=dn;var lt=class extends ye{constructor(){super(...arguments);this.test=(e,...n)=>{let o=4;this.formatShapeLog({level:o,title:" Test ",color:"#3f6600"},e,...n)};this.libWarn=(e,...n)=>{this.warn("bvplayer-core ",e,...n),console.warn(new Error().stack)};this.libError=(e,...n)=>{this.error(new Error(`bvplayer-core ${e}`),...n)}}},be=new lt;be.debug("player-core env:",d);be.version(d.SH_LIB_NAME,d.SH_LIB_VERSION||"");var a=be;var un=Array.isArray,pn=t=>t!==t,ct=t=>typeof t=="number",dt=t=>typeof t=="string",mn=t=>ct(t)||dt(t),gn=t=>typeof t=="function",fn=t=>typeof t=="undefined",hn=t=>t?!1:!!(t!=null?t:!0),vn={isArr:un,baseIsNaN:pn,isString:dt,isNumber:ct,isText:mn,isFn:gn,isUndefined:fn,isNullOrUndefined:hn},M=vn;function yn(t,e=[]){let n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function bn(t,e,n){let o=n-1,i=t.length;for(;++o<i;)if(t[o]===e)return o;return-1}function In(t,e,n,o=!1){let i=t.length,s=n+(o?1:-1);for(;o?s--:++s<i;)if(e(t[s],s,t))return s;return-1}function Cn(t,e,n){return e===e?bn(t,e,n):In(t,M.baseIsNaN,n)}function Pn(t,e){let n=-1,o=e.length,i=t;for(t===e&&(e=yn(e));++n<o;){let s=0,c=e[n],g=c;for(;(s=Cn(i,g,s))>-1;)i!==t&&[].splice.call(i,s,1),[].splice.call(t,s,1)}return t}var wn=t=>t?M.isArr(t)?t:[t]:[],En=(t,e)=>!t||!t.length||!e||!e.length?t:Pn(t,e),_n=(t,e="")=>{let n=document.createElement("canvas");n.width=t.videoWidth,n.height=t.videoHeight,n.getContext("2d").drawImage(t,0,0,n.width,n.height),n.toBlob(o=>{if(!o){a.libError("util screenshot canvas\u7684\u8F93\u51FA\u4E3A\u7A7A\u503C");return}let i=URL.createObjectURL(o),s=document.createElement("a");s.href=i,s.download=`${e}.png`,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)})},xn={pullAll:En,toArray:wn,screenshot:_n},K=xn;function Sn(t){return t!=null&&t!==!0&&t!==!1}function ut(t,e=[]){return t.forEach(n=>{M.isArr(n)?ut(n,e):Sn(n)&&e.push(M.isText(n)?Rn(n):n)}),e}function Tn(t={},e){if(!e)return;Object.keys(t).forEach(o=>{if(o==="children")return;let i=t[o];M.isNullOrUndefined(i)||(o.startsWith("on")?e.addEventListener(o.substring(2).toLowerCase(),i):e instanceof Element?e.setAttribute(o==="className"?"class":o,i):e[o]=i)})}function Rn(t){return{type:"",props:{nodeValue:String(t)+""}}}function kn(t,e){return t===""?document.createTextNode(""):e?document.createElementNS(e,t):document.createElement(t)}function Q(t,e,n){let o=e?e(t):t;if(!o)return null;if(M.isArr(o)){let c=document.createDocumentFragment();return o.forEach(g=>{let l=Q(g,e);l&&c.appendChild(l)}),c}let{props:i,type:s}=o;if(!i)return o instanceof Node||o instanceof Text?(a.libWarn("jsx grow","\u63D0\u793A",o,"\u5E76\u4E0D\u662F\u6709\u6548\u7684jsx element \u5DF2\u7ECF\u539F\u6837\u8F93\u51FA\uFF0C\u4E0D\u5F71\u54CDui \u4F46\u5C3D\u91CF\u5C11\u6DF7\u7528jsx\u548Cdom"),o):(a.libWarn("jsx grow","\u672A\u89E3\u6790",o,"\u56E0\u4E3A\u5B83\u4E0D\u662F\u6709\u6548\u7684jsx element\uFF0C\u5E76\u4E14\u4E5F\u4E0D\u662FRenderTarget\u7C7B\u578B"),null);if(M.isString(s)){let c=kn(s,i.xmlns||n);return Tn(i,c),(i.children||[]).forEach(l=>{let f=Q(l,e,i.xmlns);!f||c.appendChild(f)}),c}if(M.isFn(s)){let c=s(i);return Q(c,e)}return null}function Mn(t,e,...n){return e=e||{},n=ut(K.toArray(e.children||n)),e.children=n,{type:t,props:e}}var Fn=t=>t.children,Ln={h:Mn,Fragment:Fn},r=Ln;var Ie=t=>{let e;return t?e=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()):e=Date.now(),Math.floor(e/1e3)},pt=t=>{let e=typeof t=="number"?t:Ie(t),n=Ie();return e-n},Nn=t=>pt(t)>0,On={getUTCSecond:Ie,pastNow:pt,compare:Nn},Ce=On;var mt=(t,e,n)=>{let o={value:e,expire:n},i=JSON.stringify(o);return localStorage.setItem(t,i),o},Dn=(t,e,n)=>{let i=Ce.getUTCSecond()+n;return mt(t,e,i)},Vn=(t,e=!1)=>{let n=localStorage.getItem(t);if(!n)return null;try{let o=JSON.parse(n);return e?o:o.expire?Ce.compare(o.expire)?o.value:null:o.value}catch(o){a.error(o,n,"Storage\u8BFB\u53D6\u6570\u636E\u65F6\uFF0C JSON\u89E3\u6790\u51FA\u9519")}},Bn=t=>localStorage.removeItem(t),An={set:mt,setTimeout:Dn,get:Vn,remove:Bn},V=An;var ie;(function(n){n.GET="GET",n.POST="POST"})(ie||(ie={}));var gt=(t,e)=>u(void 0,null,function*(){let n=new AbortController;if(e.signal&&e.signal.addEventListener("abort",()=>{n.abort()}),e.timeout){let c=setTimeout(()=>{n.abort()},e.timeout);n.signal.addEventListener("abort",()=>{clearTimeout(c)})}let o=e.bodyData,i=o&&(typeof o=="object"?JSON.stringify(o):o),s={credentials:"same-origin",method:e.method,headers:new Headers(k({},e.headers)),signal:n.signal};i&&(s.body=i),a.http("\u53D1\u9001\u8BF7\u6C42\uFF1A",t,z(k({},s),{body:o}));try{let c=yield fetch(t,s);if(a.http("\u8BF7\u6C42\u54CD\u5E94\uFF1A",t,c,yield c.clone().text()),c.ok||c.status>=200&&c.status<300){let g=c.headers.get("content-type")||"";if(/application\/json/i.test(g))return yield c.json()}else throw new Error(`${c.status} ${c.statusText}`)}catch(c){if(c.name==="AbortError"){a.http("\u8BF7\u6C42\u53D6\u6D88\uFF1A",s);return}throw c}}),Wn=(t,e,n)=>u(void 0,null,function*(){let o=e?e.toString():"";return yield gt(t+o,{method:ie.GET,headers:n==null?void 0:n.headers})}),Hn=(t,e,n)=>u(void 0,null,function*(){return yield gt(t,{method:ie.POST,headers:k({"Content-Type":"application/json;charset=UTF-8"},n==null?void 0:n.headers),bodyData:e})}),$n={get:Wn,post:Hn},se=$n;var ft={BVCSP_V1:{path:"/bvcsp/v1",prefix:""}},Pe=t=>{let e=ft[t];return e.prefix+e.path},zn=(t,e)=>{let n=ft[t];return n.prefix=e||"",Pe(t)},Z={setApiPrefix:zn,getApiURL:Pe,bvscpV1:()=>Pe("BVCSP_V1")},Y=t=>{Z.setApiPrefix("BVCSP_V1",t)};var Un=t=>{if(!t)return null;if(t.nodeType===Node.DOCUMENT_NODE)return t.documentElement;if(t.nodeType===Node.ELEMENT_NODE){let e=t;return e.hasChildNodes()&&e.childNodes.forEach(n=>{let o=n;o.className&&new RegExp(".*bvplayer-core-player.*").test(o.className)&&e.removeChild(o)}),t}return null},Kn=(t,e,n)=>{if(!t)return;let o=document.createDocumentFragment();o.appendChild(t);let i=Un(e);!i||(i.appendChild(o),n==null||n())},ht=Kn;var ae=(...t)=>{let e=[];for(let n=0;n<t.length;n++){let o=t[n];if(!o)continue;let i=typeof o;if(M.isText(o))e.push(o);else if(Array.isArray(o)){if(o.length){let s=ae(...o);s&&e.push(s)}}else if(i==="object")if(o.toString==={}.toString)for(let s in o)({}).hasOwnProperty.call(o,s)&&o[s]&&e.push(s);else e.push(o.toString())}return e.join(" ")},vt=t=>t?t.replace(/\s*(;|\{|\})+\s*[\n\r]*/g,"$1"):"",Jn=(t,...e)=>{if(!e.length)return vt(t[0]);let n="";return e.forEach((o,i)=>{n+=t[i]+o}),n+=t[t.length-1],vt(n)},we="bvplayer-",Gn="common-",yt=t=>new RegExp(we).test(t),Xn=(...t)=>ae(t).split(" ").map(e=>yt(e)?e:we+e).join(" "),qn=(...t)=>ae(t).split(" ").map(e=>yt(e)?e:we+Gn+e).join(" ");var Qn={cls:ae,css:Jn,prefixCls:Xn,commonCls:qn},j=Qn;function Zn(t){return document.createRange().createContextualFragment(t)}function Yn(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function Ee(){return document.createDocumentFragment()}function jn(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function eo(t,...e){if(!t)return;let n=Ee();n.append(...e.filter(o=>o)),t.appendChild(n)}function to(t){if(!!t)if(t instanceof Element){t.innerHTML="";return}else for(;t.firstChild;)t.removeChild(t.firstChild)}function no(t,...e){if(!e.length||!(t==null?void 0:t.parentNode))return;let n=e.filter(o=>o);if(t instanceof Element)t.replaceWith(...n);else{let o=Ee();o.append(...n),t.parentNode.replaceChild(o,t)}}function oo(t){var e;if(!!t)if(t instanceof Element){t.remove();return}else(e=t.parentNode)==null||e.removeChild(t)}function ro(t){if(!t||!t.props)return t;let{props:e}=t;return e.withCommonNamespace&&(e.className=j.commonCls(e.className),delete e.withCommonNamespace),e.withNamespace&&(e.className=j.prefixCls(e.className),delete e.withNamespace),t}function io(t){return t?Q(t,ro):null}var so={parseHtml:Zn,create:Yn,createFragment:Ee,createHtmlElement:jn,createByJsx:io,append:eo,empty:to,replace:no,removeSelf:oo},bt=so;var ao="bvplayerCore",lo=t=>ao+t,co={createPrefixStorageField:lo},It=co;var uo={render:ht,style:j,dom:bt,field:It},p=uo;var W=p.field.createPrefixStorageField("DialogIds"),po=(t,e)=>u(void 0,null,function*(){var c;let n={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield se.post(`${Z.bvscpV1()}/dialog/device/webrtc`,o,{headers:n});if(a.api("\u8BBE\u5907\u97F3\u89C6\u9891\u6D41 webrtc\u65B9\u5F0F\u6253\u5F00dialog: ",{params:o,resData:i}),!i||i.code!==0||!((c=i.data)==null?void 0:c.dialogid))throw new Error(`\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25\uFF0C ${i.msg}`);let{data:s}=i;if(s.dialogid){let g=V.get(W)||[];g.push(s.dialogid),V.set(W,g)}return{dialogId:s.dialogid,sdp:s.sdp}}),mo=(t,e)=>u(void 0,null,function*(){var g;let n={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield se.post(`${Z.bvscpV1()}/dialog/conference/webrtc`,o,{headers:n});if(a.api("\u4F1A\u8BAE\u97F3\u89C6\u9891\u6D41 webrtc\u65B9\u5F0F\u6253\u5F00dialog: ",{params:o,resData:i}),!i||i.code!==0||!((g=i.data)==null?void 0:g.dialogid))throw new Error(`\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25\uFF0C ${i==null?void 0:i.msg}`);let{data:s}=i,c=V.get(W)||[];return c.push(s.dialogid),V.set(W,c),{dialogId:s.dialogid,sdp:s.sdp}}),go=(t,e)=>u(void 0,null,function*(){if(!t)return;let n={Authorization:e||""};return a.api("\u5173\u95EDdialog\uFF1A",t),yield se.post(`${Z.bvscpV1()}/dialog/close/${t}`,{},{headers:n})}),Ct=(t,e)=>u(void 0,null,function*(){let n=V.get(W)||[];K.pullAll(n,t),V.set(W,n,0);let i=(yield Promise.allSettled(t.map(s=>go(s,e)))).filter(s=>s.status==="rejected");i&&i.length>0&&a.error(new Error(`"\u5173\u95ED\u5B58\u50A8\u7684dialog\u65F6\u5931\u8D25\uFF1A", ${i}`))}),fo=t=>u(void 0,null,function*(){let e=V.get(W);!e||e.length<1||(V.remove(W),yield Ct(e,t))}),ho={getDeviceWebrtc:po,getConferenceWebrtc:mo,closeDialogs:Ct,closeAllStorageDialog:fo},F=ho;var Pt=class{constructor(){this._map=new Map}findExecutor(e,n){let o=this._map.get(e);return{index:o?o.findIndex(s=>Object.is(n,s)):-1,que:o}}publish(e,n){let o=this._map.get(e)||[],i=o.length;for(let s=0;s<i;s++){let c=o[s];c&&c(n)}}subscribe(e,n){let{index:o,que:i=[]}=this.findExecutor(e,n);return o>=0?i[o]=n:i.push(n),this._map.set(e,i),{unSubscribe:()=>{this.unSubscribe(e,n)}}}unSubscribe(e,n){let{index:o,que:i=[]}=this.findExecutor(e,n);o<0||(i.splice(o,1),this._map.set(e,i))}},ee=class{constructor(){this._notifier=new Pt}addEventListener(e,n){this._notifier.subscribe(e,n)}removeEventListener(e,n){this._notifier.unSubscribe(e,n)}dispatch(e,n){this._notifier.publish(e,n)}};var E=class extends ee{constructor(e,n,o){super();this.name="";let i=n.trim().toLowerCase(),s=o?o.trim():i,c=p.dom.create(e,p.style.prefixCls(s));this.name=i,this.el=c}empty(){p.dom.empty(this.el)}unmount(){var e;a.debug("unmount",this.el,(e=this.el)==null?void 0:e.parentNode),p.dom.removeSelf(this.el)}destroy(){if(this.beforeDestroy(),this.empty(),this.unmount(),this.el=null,this.dispatch("destroy"),!!this){for(let e in this)this[e]=void 0;a.debug("destroy complete",this)}}getEl(){return this.el}};var wt=class extends E{constructor(e){super("div","mask",p.style.cls("mask"));this._visible=!!(e==null?void 0:e.visible),this._text=e==null?void 0:e.text,this._textEl=p.dom.create("span",p.style.cls("text"))}set visible(e){this._visible=e,this.el.style.display=this._visible?"grid":"none"}set text(e){this._text=e,this._textEl.textContent=e}beforeDestroy(){}init(){a.debug("mask visible: ",this._visible);let e=this.el;return e.style.display=this._visible?"block":"none",this._textEl.textContent=this._text||"",p.dom.append(e,this._textEl),e}},Et=wt;var _t=class extends E{constructor(e){super("div","spinner",p.style.cls("spinner"));this._spin=!!(e==null?void 0:e.spin)}set spin(e){this._spin=e,this.el.style.display=this._spin?"block":"none"}beforeDestroy(){}init(){a.debug("spinner spin: ",this._spin);let e=this.el;e.style.display=this._spin?"block":"none";let n=p.dom.create("span");return n.style.backgroundColor="#FFF",p.dom.append(e,n),e}},xt=_t;var St={contain:"contain",fill:"fill"},Tt=class extends E{constructor(e){super("video","video",p.style.cls("video"));this._url=e==null?void 0:e.url,this._srcObject=(e==null?void 0:e.srcObject)||null,this._fit=(e==null?void 0:e.fit)||St.contain,this._autoPlay=!!(e==null?void 0:e.autoPlay),this._muted=!!(e==null?void 0:e.muted)}set url(e){typeof this._url!="undefined"&&(this.el.src=this._url),this._url=e}set srcObject(e){this._srcObject=e||null,this.el.srcObject=this._srcObject}set muted(e){let n=this.el;this._muted=e,n.muted=e}set paused(e){let n=this.el;e?n.pause():n.play()}get paused(){var e;return!!((e=this.el)==null?void 0:e.paused)}set autoPlay(e){if(!e!==this._autoPlay)return;this._autoPlay=e,this.muted=e;let n=this.el;n.autoplay=this._autoPlay}set fit(e){this._fit=St[e],this.el.style.objectFit=this._fit}getVideoFit(){return this._fit}init(){a.debug("\u6E32\u67D3VideoPlugin\u89C6\u9891\u5BF9\u8C61dom\u7684children",this,this.el);let e=this.el;return e.addEventListener("play",()=>this.dispatch("play",{target:this})),e.addEventListener("pause",()=>this.dispatch("pause",{target:this})),e.addEventListener("loadedmetadata",n=>{a.debug("video loadedmetadata",n),this.dispatch("loadedmetadata",{target:this})}),typeof this._url!="undefined"&&(e.src=this._url),e.srcObject=this._srcObject,e.autoplay=this._autoPlay,e.muted=this._muted,e.style.objectFit=this._fit,e.playsInline=!0,e}play(){return u(this,null,function*(){let e=this.el;try{a.debug("video \u5C1D\u8BD5\u64AD\u653E"),yield e.play()}catch(n){a.error(n,"video \u64AD\u653E \u5931\u8D25")}})}beforeDestroy(){}},Rt=Tt;function te(t){return class extends t{constructor(...e){super(...e);this._visible=!1}get visible(){return this._visible}set visible(e){let n=!!e;if(this._visible===n)return;this._visible=n;let o=p.style.commonCls("is-visible");this._visible?(this.show&&this.show(),this.el.setAttribute("aria-hidden","false"),this.el.classList.add(o)):(this.hide&&this.hide(),this.el.setAttribute("aria-hidden","true"),this.el.classList.remove(o))}}}function _e({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}function xe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z","clip-rule":"evenodd"}))}function Se({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"}))}function Te({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M4 5a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2V7a2 2 0 00-2-2h-1.586a1 1 0 01-.707-.293l-1.121-1.121A2 2 0 0011.172 3H8.828a2 2 0 00-1.414.586L6.293 4.707A1 1 0 015.586 5H4zm6 9a3 3 0 100-6 3 3 0 000 6z","clip-rule":"evenodd"}))}function Re({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"}))}function ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M3 4a1 1 0 011-1h4a1 1 0 010 2H6.414l2.293 2.293a1 1 0 01-1.414 1.414L5 6.414V8a1 1 0 01-2 0V4zm9 1a1 1 0 110-2h4a1 1 0 011 1v4a1 1 0 11-2 0V6.414l-2.293 2.293a1 1 0 11-1.414-1.414L13.586 5H12zm-9 7a1 1 0 112 0v1.586l2.293-2.293a1 1 0 011.414 1.414L6.414 15H8a1 1 0 110 2H4a1 1 0 01-1-1v-4zm13-1a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 110-2h1.586l-2.293-2.293a1 1 0 011.414-1.414L15 13.586V12a1 1 0 011-1z","clip-rule":"evenodd"}))}function Me({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Fe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"}))}function Le({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Ne({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"}))}function Oe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"}))}function De({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"}))}function Ve({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}))}function Be({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z","clip-rule":"evenodd"}))}function Ae({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z","clip-rule":"evenodd"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"}))}function We({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM12.293 7.293a1 1 0 011.414 0L15 8.586l1.293-1.293a1 1 0 111.414 1.414L16.414 10l1.293 1.293a1 1 0 01-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 01-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 010-1.414z","clip-rule":"evenodd"}))}function He({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}function $e({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"}))}function ze({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Ue({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"}))}function Ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 32 33",fill:"currentColor"},r.h("path",{d:"M6.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v4h4c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333zM30.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h4v-4c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM30.667 12c-0.8 0-1.333-0.533-1.333-1.333v-4h-4c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM1.333 12c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-4v4c0 0.8-0.533 1.333-1.333 1.333z"}))}var L=({children:t,className:e})=>{let n=p.style.cls(["icon",e]);return r.h("span",{className:n,withNamespace:!0},t)},vo=({filled:t})=>r.h(L,null,t?r.h(xe,null):r.h(_e,null)),yo=({filled:t})=>r.h(L,null,t?r.h(Te,null):r.h(Se,null)),bo=({filled:t})=>r.h(L,null,t?r.h(Fe,null):r.h(Me,null)),Io=({filled:t})=>r.h(L,null,t?r.h(ke,null):r.h(Re,null)),Co=({filled:t,circle:e})=>e?r.h(L,null,t?r.h(Ne,null):r.h(Le,null)):r.h(L,null,t?r.h(De,null):r.h(Oe,null)),Po=({filled:t,off:e})=>e?r.h(L,null,t?r.h(We,null):r.h(Ae,null)):r.h(L,null,t?r.h(Be,null):r.h(Ve,null)),wo=({filled:t,off:e})=>e?r.h(L,null,t?r.h(Ue,null):r.h(ze,null)):r.h(L,null,t?r.h($e,null):r.h(He,null)),Eo=()=>r.h(L,null,r.h(Ke,null)),_o={Cog:vo,Camera:yo,Info:bo,ArrowsExpand:Io,X:Co,Volume:Po,Play:wo,Full:Eo};var _=_o;var H="modal",kt=class extends E{constructor(e){super("div",H,p.style.cls([H,e.className,{[`${H}--center`]:e.center}]));this.container=e.container,this.title=e.title,this._content=e.content||p.dom.create("div","test"),this._center=!!e.center}set content(e){let n=p.dom.createByJsx(e);a.debug("modal update content",n,this._content),p.dom.replace(this._content,n),this._content=n}show(){var e;(e=this.el)==null||e.classList.toggle(p.style.prefixCls(`${H}--center`),!!this._center),p.dom.append(this.container,this.el)}hide(){}clear(){!this.el||(this.el.innerHTML="")}beforeDestroy(){}init(){this.clear(),a.debug("\u6E32\u67D3ModalPlugin \u5F39\u7A97\u5BF9\u8C61",this,this.el);let e=this.el,n=p.dom.createByJsx(r.h(r.Fragment,null,r.h("div",{className:`${H}_title-bar`,onClick:()=>this.dispatch("hide"),withNamespace:!0},r.h("span",{className:`${H}_title-bar_title`,withNamespace:!0},this.title),r.h("span",{className:`${H}_title-bar_close`,withNamespace:!0},r.h(_.X,null))),r.h("div",{className:`${H}_body`,withNamespace:!0},this._content)));return p.dom.append(e,n),e}},xo=te(kt),Je=class extends xo{},Mt=Je;var So="controller_button",Ft=class extends E{constructor(e,n){super("button",So);this._Children=e,this.title=n}set Children(e){!this.el||(this._Children=e,this.empty(),p.dom.append(this.el,p.dom.createByJsx(e)))}beforeDestroy(){}init(){let e=this.el;return e.addEventListener("click",()=>this.dispatch("click")),e.title=this.title||"",p.dom.append(e,p.dom.createByJsx(this._Children)),e}},J=Ft;var Lt="controller",Nt=class extends E{constructor(e){super("div",Lt,p.style.cls(Lt));this._controls=(e==null?void 0:e.controls)||[],this.PlayButton=new J(r.h(_.Play,null)),this.VolumeButton=new J(r.h(_.Volume,{off:!0}),"volume"),this.InformationButton=new J(r.h(_.Info,null),"information"),this.ScreenshotButton=new J(r.h(_.Camera,null),"screenshot"),this.FullscreenButton=new J(r.h(_.ArrowsExpand,null),"fullscreen"),this.PlayButton.addEventListener("click",()=>{this.dispatch("play")}),this.VolumeButton.addEventListener("click",()=>{this.dispatch("volume")}),this.InformationButton.addEventListener("click",()=>this.dispatch("information")),this.ScreenshotButton.addEventListener("click",()=>this.dispatch("screenshot")),this.FullscreenButton.addEventListener("click",()=>this.dispatch("fullscreen"))}beforeDestroy(){}init(){a.debug("\u6E32\u67D3ControllerPlugin \u64AD\u653E\u63A7\u5236\u5668\u5BF9\u8C61",this,this.el,this._controls);let e=this.el,n=p.style.cls([`${this.name}_inner_bar`,`${this.name}_inner_left`]),o=p.style.cls([`${this.name}_inner_bar`,`${this.name}_inner_right`]),i=p.dom.createByJsx(r.h(r.Fragment,null,r.h("div",{className:`${this.name}_mask`,withNamespace:!0}),r.h("div",{className:`${this.name}_inner`,withNamespace:!0},r.h("div",{className:n,withNamespace:!0},this.PlayButton.init(),this.VolumeButton.init()),r.h("div",{className:"flex-space",withCommonNamespace:!0}),r.h("div",{className:o,withNamespace:!0},this.InformationButton.init(),this.ScreenshotButton.init(),this.FullscreenButton.init()))));return p.dom.append(e,i),e}},To=te(Nt),Ge=class extends To{},Ot=Ge;var Dt=class{constructor(){this._els=[];this.disableAutoHide=!1;this._controller=new Ot}init(){let e=this._controller.init();return this._els.push(e),this._els}get els(){return this._els}get controller(){return this._controller}show(){this._controller.visible=!0}hide(){window.clearTimeout(this._autoHideTimeout),this._controller.visible=!1}showThenHide(){this.show(),window.clearTimeout(this._autoHideTimeout),this._autoHideTimeout=window.setTimeout(()=>{this.disableAutoHide||this.hide()},3e3)}},Vt=Dt;var le=class{constructor(e){this.pc=e}getReceiversMap(){let e=new Map([["audio",[]],["video",[]]]),n=this.pc.getReceivers();return(n==null?void 0:n.length)&&n.forEach(o=>{let{kind:i}=o.track,s=e.get(i)||[];s.push(o),e.set(i,s)}),e}getStatsInfos(){return u(this,null,function*(){let e=this.getReceiversMap();a.debug("receivers map : ",e);let n=yield Promise.all(e.get("audio").map(i=>u(this,null,function*(){let s={},c=yield i.getStats(),g=[];return c.forEach(l=>{g.push(l),l.type==="codec"&&(s.mimeType=l.mimeType,s.clockRate=l.clockRate,s.channels=l.channels),l.type==="track"&&(s.totalSamplesReceived=l.totalSamplesReceived,s.totalSamplesDuration=l.totalSamplesDuration)}),a.debug("audio stats report: ",g),s}))),o=yield Promise.all(e.get("video").map(i=>u(this,null,function*(){let s={},c=yield i.getStats(),g=[];return c.forEach(l=>{g.push(l),l.type==="codec"&&(s.mimeType=l.mimeType,s.clockRate=l.clockRate),l.type==="inbound-rtp"&&(s.frameWidth=l.frameWidth,s.frameHeight=l.frameHeight,s.framesPerSecond=l.framesPerSecond,s.framesReceived=l.framesReceived,s.framesDecoded=l.framesDecoded,s.totalInterFrameDelay=l.totalInterFrameDelay,s.keyFramesDecoded=l.keyFramesDecoded,s.packetsLost=l.packetsLost,s.lastPacketReceivedTimestamp=l.lastPacketReceivedTimestamp,s.bytesReceived=l.bytesReceived,s.totalDecodeTime=l.totalDecodeTime)}),a.debug("video stats report: ",g),s})));return{audios:n,videos:o}})}};var Ro=(t,e)=>{D.debug(`webrtc my ICE candidate:
|
|
26
|
+
${e.candidate?e.candidate.candidate:"(null)"}`)},ko=(t,e,n)=>{D.debug("webrtc ICE state change event: ",e),D.debug(`webrtc my ICE state: ${t==null?void 0:t.iceConnectionState}`),t&&t.iceConnectionState==="disconnected"&&n&&n()},Mo=(t,e)=>{D.debug("webrtc Connection state change, \u5F53\u524D\u8FDE\u63A5\u72B6\u6001: ",t,t.connectionState)},Fo=(t,e,n)=>{D.debug("webrtc \u5F53\u524D\u7684 stream: ",e.streams[0]);let o=e.streams[0];n(o)},Lo=(t,e)=>u(void 0,null,function*(){let{offerParam:n,productRemoteSdp:o,customerRTCPeerConnection:i,onConnected:s,onConnectedFailed:c,onIceDisconnected:g,onPcEventAdded:l,onLocalDescriptionReady:f}=t,b=!!i&&i instanceof RTCPeerConnection,I={},y=b?i:new RTCPeerConnection(I);if(y.addEventListener("icecandidate",h=>Ro(y,h)),y.addEventListener("iceconnectionstatechange",h=>ko(y,h,g)),y.addEventListener("connectionstatechange",h=>Mo(y,h)),y.addEventListener("track",h=>Fo(y,h,e)),l&&(yield l(y)),b)return new le(y);try{let h=yield y.createOffer(n);D.debug("\u521B\u5EFAoffer\uFF0C\u53C2\u6570\uFF1A",n,"\uFF0C \u7ED3\u679C\uFF1A",h),yield y.setLocalDescription(h),f&&f(y);let C=yield o(new RTCSessionDescription(h));D.debug("webrtc recv open answer",C);let R=new RTCSessionDescription({type:"answer",sdp:C});yield y.setRemoteDescription(R),D.debug("getTransceivers",y.getTransceivers()),s&&s(y)}catch(h){throw c&&c(y),D.error(new Error(`webrtc Failed to create session description: ${h.toString()}`)),y.close(),h}return new le(y)}),No=t=>{if(!t)return;let{pc:e}=t;e.close()},Oo={connect:Lo,disconnect:No},Xe=Oo;var G=document.documentElement,ce="requestFullscreen",de="exitFullscreen",ue="fullscreenElement",pe="onfullscreenchange";if("webkitRequestFullScreen"in G)ce="webkitRequestFullScreen",de="webkitExitFullscreen",ue="webkitFullscreenElement",pe="onwebkitfullscreenchange";else if("msRequestFullscreen"in G)ce="msRequestFullscreen",de="msExitFullscreen",ue="msFullscreenElement",pe="MSFullscreenChange";else if("mozRequestFullScreen"in G)ce="mozRequestFullScreen",de="mozCancelFullScreen",ue="mozFullScreenElement",pe="onmozfullscreenchange";else if(!("requestFullscreen"in G))throw"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Fullscreen API !";function Do(t=G,e){return t[ce](e)}function Vo(){return document[de]()}function Bt(t){return t===document[ue]}function Bo(t=G,e){return Bt(t)?Vo():Do(t,e)}function Ao(t,e){let n=()=>{t.onfullscreenchange=null},o=i=>{i.target!==null&&e(Bt(i.target))};return t[pe]=o,{cancel:n}}var Wo={toggle:Bo,watch:Ao},me=Wo;var Ho=({label:t,value:e,suffix:n})=>r.h("div",{className:"player_info-modal_list_item",withNamespace:!0},r.h("span",{className:"player_info-modal_list_item_label",withNamespace:!0},t),r.h("span",{className:"player_info-modal_list_item_value",withNamespace:!0},e),r.h("span",{className:"player_info-modal_list_item_suffix",withNamespace:!0},n)),At=({list:t,factory:e})=>(t==null?void 0:t.length)?e?r.h(r.Fragment,null,t.map(n=>r.h(At,{list:Object.keys(n).map(o=>e[o]?e[o](n[o],n):!1).filter(o=>o!==!1)}))):r.h("div",{className:"player_info-modal_list",withNamespace:!0},t.map(n=>r.h(Ho,k({},n)))):null,qe=At;var N;(function(o){o.DIRECT="direct",o.PLUGIN="plugin",o.REJECT="reject"})(N||(N={}));var ge;(function(s){s.MP4="MP4",s.FLAC="FLAC",s.OGG="OGG",s.WEBM="WEBM",s.AUTO="AUTO"})(ge||(ge={}));var Qe;(function(e){e.WEBRTC="WEBRTC"})(Qe||(Qe={}));var Wt="player",Ht=class extends E{constructor(e){super("div",Wt);this._lastTotalReceivedBytes=0;this._video=new Rt,this._spinner=new xt({spin:!1}),this._mask=new Et({visible:!1}),this._panel=new Vt,this._infoModal=new Mt({container:this.el,title:"Info",center:!0,className:`${Wt}_info-modal`}),this._videoOption=e==null?void 0:e.video,this._pluginOption=e==null?void 0:e.pluginOption,this._playerConfig=e==null?void 0:e.playerConfig,this._mode=this._restrictPlayerMode(e==null?void 0:e.video,e==null?void 0:e.pluginOption),a.debug("PlayerMode",this._mode)}justifyVideoType(e,n){if((e==null?void 0:e.url)&&!e.type)return ge.AUTO;let o="".toUpperCase.call((e==null?void 0:e.type)||Object.keys(n||{})[0]||"");return a.debug("justifyVideoType ",e,o),o}_restrictPlayerMode(e,n){let o=this.justifyVideoType(e,n);if(!o&&!(e==null?void 0:e.url))return N.REJECT;if(!o)return N.DIRECT;let i=Object.keys(ge),s=Object.keys(Qe);return i.includes(o)?N.DIRECT:s.includes(o)?N.PLUGIN:N.DIRECT}init(){a.debug("\u6E32\u67D3PlayerPlugin",this.el),this.prepare();let e=this._video.init(),n=this._spinner.init(),o=this._mask.init(),i=this._panel.init(),s=this._infoModal.init();return p.dom.append(this.el,e,n,o,...i,s),this.initEvents(),this.dispatch("init",{name:"initEvent",target:this,mode:this._mode}),this.el}get video(){return this._video}get spinner(){return this._spinner}get mask(){return this._mask}play(e){return u(this,null,function*(){this.mute(!0),yield this._video.play(),this.mute(e)})}mute(e){var n;this._video.muted=!!e,a.debug("player mute: ",(n=this._video.getEl())==null?void 0:n.muted)}setProductRemoteSdp(e){!this._pluginOption||!this._pluginOption.webrtc||(this._pluginOption.webrtc.productRemoteSdp=e)}prepareWebrtc(){return u(this,null,function*(){var n;if(this._mode!==N.PLUGIN)return;a.debug("PuPlayer Plugin prepareWebrtc");let e=(n=this._pluginOption)==null?void 0:n.webrtc;!e||(this._video.autoPlay=!0,this._spinner.spin=!0,this._webrtcConnect=yield Xe.connect(e,o=>{var s;if(!o)return;(s=this.video.getEl())==null||s.addEventListener("canplay",()=>{a.debug("Video canplay"),this.video.play()}),this._video.srcObject=o;let i=o.getTracks()[0];i.onended=c=>{a.debug("\u6D41\u89C6\u9891\u8F68\u9053\u5DF2\u7ECF\u7EC8\u6B62",c)},i.onmute=c=>{a.debug("\u6D41\u89C6\u9891\u8F68\u9053\u6682\u65F6\u65E0\u6CD5\u63D0\u4F9B\u5A92\u4F53",c),this.onMuted()},i.onunmute=c=>{a.debug("\u6D41\u89C6\u9891\u8F68\u9053\u63D0\u4F9B\u5A92\u4F53",c),this.onUnMuted()}}))})}close(){this.closeWebrtc()}beforeDestroy(){this.close()}onMuted(){}onUnMuted(){}loadPlayerConfig(){var e;this.video.autoPlay=!!((e=this._playerConfig)==null?void 0:e.autoPlay)}initEvents(){var o,i,s,c,g;(o=this.video.getEl())==null||o.addEventListener("canplay",()=>{this._spinner.spin=!1,this._mask.visible=!1}),(i=this.video.getEl())==null||i.addEventListener("waiting",()=>{a.debug("Video is waiting for more data."),this._spinner.spin=!0}),(s=this.el)==null||s.addEventListener("mousemove",()=>{this._panel.showThenHide()}),(c=this.el)==null||c.addEventListener("click",()=>{this._panel.showThenHide()});let e=(l=!1)=>{let f=this._panel.controller.PlayButton;l||(this._video.paused=!this._video.paused),console.log("oalyer,",this._video.paused),this._video.paused?f.Children=r.h(_.Play,null):f.Children=r.h(_.Play,{off:!0})};e(!0),this._panel.controller.addEventListener("play",()=>e()),this._video.addEventListener("play",()=>{a.debug("video play"),this._panel.showThenHide();let l=this._panel.controller.PlayButton;l.Children=r.h(_.Play,{off:!0})}),this._video.addEventListener("pause",()=>{a.debug("video pause"),this._panel.showThenHide();let l=this._panel.controller.PlayButton;l.Children=r.h(_.Play,null)}),this._panel.controller.addEventListener("screenshot",()=>{let l=this._video.getEl();if(!l){a.libError("playerPlugin screenshot videoEl\u4E3A\u7A7A\u503C");return}K.screenshot(l,`screenshot_${Date.now()}`)}),this._panel.controller.addEventListener("fullscreen",()=>{if(!this.el){a.libError("playerPlugin fullscreen playerEL\u4E3A\u7A7A\u503C");return}me.toggle(this.el)}),(g=this._infoModal)==null||g.addEventListener("hide",()=>{this._infoModal.visible=!1,window.clearInterval(this._timer)}),this._panel.controller.addEventListener("information",()=>u(this,null,function*(){if(!this._video.getEl()){a.libError("playerPlugin information videoEl\u4E3A\u7A7A\u503C");return}this.refreshInfoModal()}));let n=(l=!1)=>{var I;let f=this._panel.controller.VolumeButton,b=(I=this._video.getEl())==null?void 0:I.muted;l||(this._video.muted=!b),b?f.Children=r.h(_.Volume,null):f.Children=r.h(_.Volume,{off:!0})};n(!0),this._panel.controller.addEventListener("volume",()=>n())}prepare(){if(a.debug("PlayerPlugin mode: ",this._mode),this.loadPlayerConfig(),this._mode===N.REJECT){a.error(new Error("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u7C7B\u578B"),this._mode,this._videoOption);return}if(this._mode===N.DIRECT){this.prepareDirect();return}if(this._mode===N.PLUGIN){switch(this.justifyVideoType(this._videoOption,this._pluginOption)){case"webrtc":break;default:break}return}}prepareDirect(){var e;this._video.url=((e=this._videoOption)==null?void 0:e.url)||"",setTimeout(()=>{this.play()},300)}closeWebrtc(){var e;Xe.disconnect(this._webrtcConnect),this.dispatch("closeWebrtc",{name:"closeWebrtcEvent",target:this,peerConnection:(e=this._webrtcConnect)==null?void 0:e.pc}),this._webrtcConnect=null,this._video.srcObject=null}refreshInfoModal(){return u(this,null,function*(){if(window.clearInterval(this._timer),!this._webrtcConnect)return;let e=3,n=()=>u(this,null,function*(){if(!this._webrtcConnect)return;let o=yield this._webrtcConnect.getStatsInfos();a.debug("player get result: ",o);let i={mimeType:(l="")=>({label:"Mime Type:",value:l}),totalSamplesReceived:(l=0,f)=>{let b={label:"Sample Rate:",value:""};return!l||!f.totalSamplesDuration||(b.value=Number(l/f.totalSamplesDuration).toFixed(3)+"Hz"),b}},s={mimeType:(l="")=>({label:"Mime Type:",value:l}),framesPerSecond:(l,f)=>({label:"Resolution:",value:`${f.frameWidth} x ${f.frameHeight}@${l}`}),bytesReceived:(l,f)=>{let b=l||0,I=(b-this._lastTotalReceivedBytes)*8/(e*1e3);return this._lastTotalReceivedBytes=b,{label:"Data Received:",value:`${Math.round(I)} kbps , lost ${f.packetsLost}`}}},c=r.h(qe,{list:o.audios,factory:i}),g=r.h(qe,{list:o.videos,factory:s});a.debug("audioInfoList",p.dom.createByJsx(c)),!!this._infoModal&&(this._infoModal.content=r.h("div",{style:"padding-left: 24px;"},r.h("section",{className:"player_info-modal_section",withNamespace:!0},r.h("span",{className:"player_info-modal_section_title",withNamespace:!0},"Audio"),c),r.h("section",{className:"player_info-modal_section",withNamespace:!0},r.h("span",{className:"player_info-modal_section_title",withNamespace:!0},"Video"),g)),this._infoModal.visible=!0)});n(),this._timer=window.setInterval(n,e*1e3)})}},fe=Ht;var $o=(t,e,n)=>o=>u(void 0,null,function*(){if(o.type==="offer"){a.debug("\u8BF7\u6C42\u8FDC\u7AEFsdp\uFF0C \u8BBE\u5907\u914D\u7F6E\u4FE1\u606F\uFF1A",t,"token: ",e),a.debug("\u672C\u5730sdp",o);try{let{id:i,index:s}=t||{},c=yield F.getDeviceWebrtc({id:i,index:s,sdp:o.sdp},e);return n&&n(c.dialogId),c.sdp}catch(i){throw a.error(i,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`PUPlayer open \u5931\u8D25 , ${i.message}`)}}}),zo=t=>{let{container:e,token:n,puOption:o,defaultMediaOption:i={audio:!0,video:!0},testUrl:s,videoFit:c="fill",muted:g,apiPrefix:l,onConnected:f,onConnectedFailed:b,onDisConnected:I,fullScreenOnDblclick:y=!0}=t||{},h,C=n,R=o,O=e,x=typeof g=="boolean"?g:!i.audio;Y(l);let P=()=>u(void 0,null,function*(){if(!!h&&(a.debug("PuPlayer close",h),m.mask.visible=!0,m.mask.text="Video Closed",m.close(),h))try{yield F.closeDialogs([h],C)}catch(v){throw a.error(v,"PuPlayer close \u5931\u8D25"),new Error(`PuPlayer close \u5931\u8D25 , ${v.message}`)}}),m=new fe({video:{url:s},pluginOption:{webrtc:{offerParam:{offerToReceiveAudio:i.audio,offerToReceiveVideo:i.video},productRemoteSdp:v=>u(void 0,null,function*(){return $o(R,C,$=>{h=$})(v)}),onIceDisconnected:()=>{m.mask.visible=!0,m.mask.text="lost connection",m.close(),I&&I()},onConnected:()=>{f&&f()},onConnectedFailed:()=>{b&&b()}}},playerConfig:{autoPlay:!0}});m.addEventListener("init",v=>{a.debug("\u76D1\u542C\u5230\u4E86 player\u5DF2\u7ECF\u521D\u59CB\u5316",v)}),m.mute(x),m.video.fit=c;let w=m.init();y&&(w==null||w.addEventListener("dblclick",()=>{a.debug("\u53CC\u51FBplayer\uFF1A",w),me.toggle(w)}));let B={instance:{getVideoElement:()=>m.video.getEl(),getPlayerElement:()=>m.getEl(),open:(v=!1)=>u(void 0,null,function*(){a.debug("PuPlayer open"),yield P(),a.debug("PuPlayer close before open"),m.mask.visible=!1,m.mask.text="connecting",m.mute(!!v);try{yield m.prepareWebrtc()}catch(S){throw m.mask.visible=!0,m.mask.text="connect failed",S}if(typeof v=="boolean"&&v){let S=()=>{a.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",x),a.debug("\u6B64\u90E8\u5206\u67E5\u770B\uFF1Ahttps://developers.google.com/web/updates/2017/09/autoplay-policy-changes"),m.mute(x),document.removeEventListener("click",S),document.removeEventListener("touchend",S)};document.addEventListener("click",S),document.addEventListener("touchend",S)}}),play:()=>u(void 0,null,function*(){yield m.play(x)}),mute:(v=!1)=>{x=v,m.mute(v)},hidden:v=>u(void 0,null,function*(){let S=w,$=m.video.getEl();S.style.display="none",document.body.appendChild(S),$.muted=!0;try{typeof v!="undefined"&&(x=v),yield m.play(x)}catch(jo){a.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}a.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",$.paused)}),display:v=>u(void 0,null,function*(){let S=w,$=m.video.getEl();p.render(S,O,()=>u(void 0,null,function*(){S.style.display="block",typeof v!="undefined"&&(x=v),yield m.play(x)})),a.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",$.paused)}),moveTo:v=>{a.debug("\u79FB\u52A8\u81F3\uFF1A",v),O=v,p.render(w,O,()=>u(void 0,null,function*(){}))},getCurrentContainer:()=>O,setPuOption:v=>{R=v},setVideoFit:v=>{a.debug("PuPlayer setVideoFit",v),m.video.fit=v},setToken:v=>{a.debug("PuPlayer setToken",v),C=v},setApiPrefix:Y,close:P,render:m.init,destroy:()=>u(void 0,null,function*(){a.debug("PuPlayer destroy"),yield P(),m.destroy()})},element:w};return O&&(p.render(w,O),B.element=null),B},$t=zo;var Ze=class extends ee{constructor(e,n){super();this._plugin=e,this._el=this._plugin.init(),this._currentContainer=n}moveTo(e,n){a.debug("\u79FB\u52A8\u81F3\uFF1A",e),this._currentContainer=e,p.render(this._el,this._currentContainer,n)}getCurrentContainer(){return this._currentContainer}render(){return this._plugin.init()}destroy(){a.debug("destroy",this._plugin),this._plugin.destroy(),this.dispatch("destroy")}};var ne=class{constructor(e,n,o,i){this.token="";this.fetchSdpFunc=e,this.token=n||"",this.param=o,this.prefix=i}fetch(e){return u(this,null,function*(){a.debug("RemoteSdpFetcher fetch \u8BF7\u6C42\u8FDC\u7AEFsdp\uFF0C param\uFF1A",this.param,"token: ",this.token);let n=yield this.fetchSdpFunc(e,this.param,this.token,this.prefix),{sdp:o,dialogId:i}=n||{};return this.dialogId=i,a.debug(`RemoteSdpFetcher fetch \u83B7\u5F97\u7684remoteSdp ${o}, dialogId: ${i}`),o})}close(){return u(this,null,function*(){a.debug(`remoteSdpFetcher close\uFF0C \u68C0\u67E5dialogId: ${this.dialogId}`),this.dialogId&&(yield F.closeDialogs([this.dialogId]))})}},Ye=class extends Ze{constructor(e,n,o,i,s){super(e,s);this._muted=!1;this._videoFit="contain";this.setRemoteSdpFetcher(i),this.setVideoFit(n),this.setMuted(o)}get player(){return this._plugin}getPlayerElement(){return this.player.getEl()}getVideoElement(){return this.player.video.getEl()}setRemoteSdpFetcher(e){this._remoteSdpFetcher=e,this._plugin.setProductRemoteSdp(n=>u(this,null,function*(){var o;return(o=this._remoteSdpFetcher)==null?void 0:o.fetch(n)}))}getRemoteSdpFetcher(){return this._remoteSdpFetcher}setVideoFit(e){a.debug("BvWebrtcInstance setVideoFit",e),this._videoFit=e,this.player.video.fit=e}getVideoFit(){return this._videoFit}setMuted(e=!1){this._muted=e,this.player.mute(e)}getMuted(){return this._muted}mute(e=!1){return this.setMuted(e)}open(e=!1){return u(this,null,function*(){a.debug("BvWebrtc open"),yield this.close(),this.player.mask.visible=!1,this.player.mask.text="connecting",this.player.mute(!!e);try{yield this.player.prepareWebrtc()}catch(n){throw this.player.mask.visible=!0,this.player.mask.text="connect failed",n}if(e){let n=()=>{a.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",this._muted),a.debug("\u6B64\u90E8\u5206\u67E5\u770B\uFF1Ahttps://developers.google.com/web/updates/2017/09/autoplay-policy-changes"),this.player.mute(this._muted),document.removeEventListener("click",n),document.removeEventListener("touchend",n)};document.addEventListener("click",n),document.addEventListener("touchend",n)}})}play(){return u(this,null,function*(){yield this.player.play(this._muted)})}hidden(e){return u(this,null,function*(){let n=this._el,o=this.player.video.getEl();n.style.display="none",document.body.appendChild(n),o.muted=!0;try{typeof e!="undefined"&&(this._muted=e),yield this.player.play(this._muted)}catch(i){a.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}a.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}display(e){return u(this,null,function*(){let n=this._el,o=this.player.video.getEl();p.render(n,this._currentContainer,()=>u(this,null,function*(){n.style.display="block",typeof e!="undefined"&&(this._muted=e),yield this.player.play(this._muted)})),a.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}close(){return u(this,null,function*(){if(a.debug("BvWebrtcInstance close",`_dialogId: ${this._dialogId}`),this.player.mask.visible=!0,this.player.mask.text="Video Closed",this.player.close(),a.debug("BvWebrtcInstance close\uFF0C player closed\uFF0C\u68C0\u67E5 remoteSdpFetcher: ",this._remoteSdpFetcher),this.dispatch("close"),this._remoteSdpFetcher)try{yield this._remoteSdpFetcher.close()}catch(e){throw a.error(e,"BvWebrtcInstance close \u5931\u8D25"),new Error(`BvWebrtcInstance close \u5931\u8D25 , ${e.message}`)}})}destroy(){a.debug("PuPlayer destroy"),this.close(),this.player.destroy()}};var Uo=t=>{let{container:e,sdpFetcher:n,offerParam:o,videoFit:i,muted:s,autoPlay:c,onConnected:g,onClose:l,onDestroy:f,onConnectedFailed:b,onDisConnected:I,onPcEventAdded:y}=t,h=new fe({pluginOption:{webrtc:{offerParam:o,productRemoteSdp:()=>u(void 0,null,function*(){return""}),onIceDisconnected:()=>{h.mask.visible=!0,h.mask.text="lost connection",h.close(),I&&I()},onPcEventAdded:y,onConnected:()=>{h.mask.visible=!1,h.mask.text="connected",g&&g()},onConnectedFailed:()=>{b&&b()}}},playerConfig:{autoPlay:c}}),C=new Ye(h,i,s,n,e);C.addEventListener("close",()=>{l&&l()}),C.addEventListener("destroy",()=>{f&&f()});let R={open:()=>u(void 0,null,function*(){a.debug("BvWebrtc open"),yield C.open()}),setOption:P=>{a.debug("BvWebrtc setOption");let m=C.getRemoteSdpFetcher();m&&(m.param=P)},setToken:P=>{a.debug("BvWebrtc setToken",P);let m=C.getRemoteSdpFetcher();m&&(m.token=P)},setApiPrefix:P=>{a.debug("BvWebrtc setApiPrefix",P);let m=C.getRemoteSdpFetcher();m&&(m.prefix=P)},getRemoteSdpFetcher:()=>C.getRemoteSdpFetcher(),close:()=>u(void 0,null,function*(){a.debug("BvWebrtc close"),yield C.close()}),render:()=>(a.debug("BvWebrtc render"),C.render()),destroy:()=>{a.debug("BvWebrtc destroy"),C.destroy()}},O=C.render(),x={instance:R,element:O};return e&&(p.render(O,e),x.element=null),x},zt=Uo;var Ko=()=>u(void 0,null,function*(){a.debug("\u8BF7\u6C42\u9EA6\u514B\u98CE...");let t=yield navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),e=t.getAudioTracks();return a.debug("\u9EA6\u514B\u98CE \u97F3\u9891\u8F68\u9053\uFF1A",e),t}),Jo=t=>{let{container:e,token:n,getRemoteSdpParam:o,apiPrefix:i,getRemoteSdpResult:s,onConnected:c,onClose:g,onDestroy:l,onConnectedFailed:f,onDisConnected:b,onGetUserMediaFailed:I}=t||{},y=(P,m,w,ve)=>u(void 0,null,function*(){if(a.debug("audioPlayer productRemoteSdp",{param:{localDescription:P,param:m,token:w,prefix:ve}}),P.type==="offer"&&(Y(ve),a.debug("\u672C\u5730sdp",P),!!s))try{let{sdp:B,dialogId:v}=yield s(P.sdp,w,m);return{sdp:B,dialogId:v}}catch(B){throw a.error(B,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`productRemoteSdp \u5931\u8D25 , ${B.message}`)}}),h=new ne(y,n,o,i),{instance:C,element:R}=zt({container:e,sdpFetcher:h,offerParam:{offerToReceiveAudio:!0},videoFit:"contain",muted:!1,autoPlay:!0,onConnected:c,onClose:g,onDestroy:l,onConnectedFailed:f,onDisConnected:b,onPcEventAdded:P=>u(void 0,null,function*(){try{let m=yield Ko();m.getTracks().forEach(w=>P.addTrack(w,m))}catch(m){I&&I()}})});return{instance:k({},C),element:R}},he=Jo;var Go=(t,e,n)=>u(void 0,null,function*(){let{id:o,index:i}=n||{};return yield F.getDeviceWebrtc({id:o,index:i,sdp:t},e)}),Xo=t=>{let{container:e,token:n,puOption:o,apiPrefix:i,onConnected:s,onClose:c,onDestroy:g,onConnectedFailed:l,onDisConnected:f,onGetUserMediaFailed:b}=t||{},{instance:I,element:y}=he({container:e,token:n,getRemoteSdpParam:o,getRemoteSdpResult:Go,apiPrefix:i,onConnected:s,onClose:c,onDestroy:g,onConnectedFailed:l,onDisConnected:f,onGetUserMediaFailed:b}),h=z(k({},I),{setPuOption:R=>I.setOption&&I.setOption(R)});return delete h.setOption,{instance:h,element:y}},Ut=Xo;var qo=(t,e,n)=>u(void 0,null,function*(){let{id:o,index:i}=n||{};return yield F.getConferenceWebrtc({id:o,index:i,sdp:t},e)}),Qo=t=>{let{container:e,token:n,confOption:o,apiPrefix:i,onConnected:s,onClose:c,onDestroy:g,onConnectedFailed:l,onDisConnected:f,onGetUserMediaFailed:b}=t||{},{instance:I,element:y}=he({container:e,token:n,getRemoteSdpParam:o,getRemoteSdpResult:qo,apiPrefix:i,onConnected:s,onClose:c,onDestroy:g,onConnectedFailed:l,onDisConnected:f,onGetUserMediaFailed:b}),h=z(k({},I),{setConfOption:R=>I.setOption&&I.setOption(R)});return delete h.setOption,{instance:h,element:y}},Kt=Qo;var Zo=F.closeAllStorageDialog;return Yo;})();
|
package/dist/main.es.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.bvplayer-
|
|
1
|
+
.bvplayer-common-flex-space{display:inline-block;flex:1}.bvplayer-icon{display:inline-block;height:22px;width:100%;vertical-align:middle}.bvplayer-icon svg{height:100%;width:100%}.bvplayer-modal{position:absolute;top:0;left:0;padding:12px 16px;font-size:14px;border:1px solid #2b303b;border-radius:3px;background:rgba(22,27,29,.8);color:#e8e8fd;box-shadow:0 0 20px -6px #000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);overflow:hidden;visibility:hidden;opacity:0;transform:scale(0);will-change:transform,opacity;transition:all .3s cubic-bezier(.785,.135,.15,.86)}.bvplayer-modal.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:scale(1)}.bvplayer-modal--center{top:50%;left:50%;margin:auto;transform:translate(-50%,-50%) scale(0)}.bvplayer-modal--center.bvplayer-common-is-visible{transform:translate(-50%,-50%)}.bvplayer-modal_title-bar{display:flex;justify-content:space-between;margin-bottom:8px;font-size:16px}.bvplayer-modal_title-bar_close{cursor:pointer}.bvplayer-modal_body{padding:8px;overflow:hidden;overflow-y:auto}.bvplayer-spinner{position:absolute;top:0;left:0;height:100%;width:100%}.bvplayer-spinner>span{display:inline-block;position:absolute;top:50%;left:50%;margin:-18px 0 0 -18px;height:36px;width:36px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWx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2h0PSIxNS4yODMyIiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIg0KICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyAyMDsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgNTsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICAgIDwvc3ZnPg==)}.bvplayer-spinner>span svg{height:100%}.bvplayer-mask{height:100%;width:100%;position:absolute;top:0;left:0;display:grid;align-content:center;justify-content:center;place-content:center;background-color:#000;color:#fff;font-size:14px}.bvplayer-controller{position:absolute;bottom:0;left:0;right:0;width:100%;height:98px;color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden;opacity:0;transform:translateY(100%);will-change:visibility,opacity,transform;transition:all .3s cubic-bezier(.455,.03,.515,.955)}.bvplayer-controller.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:translateY(0)}.bvplayer-controller_mask{position:absolute;bottom:0;height:100%;width:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.bvplayer-controller_inner{position:absolute;bottom:0;left:0;right:0;width:100%;height:41px;padding:0 20px;display:flex;align-items:stretch;justify-content:space-between}.bvplayer-controller_inner_bar{display:block}.bvplayer-controller_inner_left{cursor:default}.bvplayer-controller_inner_right{cursor:default}.bvplayer-controller_button{cursor:pointer;display:inline-block;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:36px;height:100%;border:none;outline:none;padding:0;background:none;color:inherit}.bvplayer-controller_button:not(:last-child){margin-right:8px}.bvplayer-controller_button>*{transition:all .2s ease-in-out;opacity:.8}.bvplayer-controller_button:hover>*{opacity:1}.bvplayer-video{display:block;pointer-events:none;box-sizing:border-box;width:100%;height:100%}.bvplayer-player{position:relative;height:100%;width:100%;background-color:#000;overflow:hidden}.bvplayer-player_info-modal{width:60%;height:70%}.bvplayer-player_info-modal_section{margin-bottom:16px}.bvplayer-player_info-modal_section_title{display:inline-block;font-weight:bold;font-size:12px;margin-bottom:8px}.bvplayer-player_info-modal_list{color:#e8e8fdd9;font-size:12px}.bvplayer-player_info-modal_list_item:not(:last-child){margin-bottom:8px}.bvplayer-player_info-modal_list_item_label{display:inline-block;width:90px;margin-right:14px;text-indent:-99em;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:top}.bvplayer-player_info-modal_list_item_value{margin-right:8px;white-space:normal;word-break:break-all}
|