@besovideo/webrtc-player 0.2.8 → 0.3.2

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.
Files changed (44) hide show
  1. package/dist/main.browser.css +1 -1
  2. package/dist/main.browser.js +10 -10
  3. package/dist/main.es.css +1 -1
  4. package/dist/main.es.js +10 -10
  5. package/dist/types/app.d.ts +2 -4
  6. package/dist/types/components/bvWebrtc/index.d.ts +2 -0
  7. package/dist/types/components/puPlayer.d.ts +1 -1
  8. package/dist/types/components/types.d.ts +2 -0
  9. package/dist/types/core/customElement.d.ts +4 -0
  10. package/dist/types/core/dom.d.ts +22 -0
  11. package/dist/types/core/events.d.ts +21 -8
  12. package/dist/types/core/field.d.ts +4 -0
  13. package/dist/types/core/index.d.ts +20 -3
  14. package/dist/types/core/jsx.d.ts +8 -0
  15. package/dist/types/core/style.d.ts +10 -0
  16. package/dist/types/core/types.d.ts +7 -1
  17. package/dist/types/index.d.ts +1 -1
  18. package/dist/types/instances/bvWebrtc.d.ts +8 -2
  19. package/dist/types/instances/common.d.ts +7 -1
  20. package/dist/types/main.d.ts +1 -1
  21. package/dist/types/plugins/controller/button.d.ts +13 -0
  22. package/dist/types/plugins/controller/event.d.ts +13 -0
  23. package/dist/types/plugins/controller/index.d.ts +22 -0
  24. package/dist/types/plugins/decorators.d.ts +2 -0
  25. package/dist/types/plugins/mixins/visible.d.ts +13 -0
  26. package/dist/types/plugins/modal.d.ts +33 -0
  27. package/dist/types/plugins/player/event.d.ts +18 -0
  28. package/dist/types/plugins/player/index.d.ts +25 -7
  29. package/dist/types/plugins/player/infoList.d.ts +14 -0
  30. package/dist/types/plugins/player/panel.d.ts +15 -0
  31. package/dist/types/plugins/player/reducers/types.d.ts +36 -0
  32. package/dist/types/plugins/types.d.ts +16 -23
  33. package/dist/types/plugins/video.d.ts +12 -2
  34. package/dist/types/templates/button.d.ts +8 -0
  35. package/dist/types/templates/icons.d.ts +18 -0
  36. package/dist/types/templates/type.d.ts +0 -0
  37. package/dist/types/utils/dev.d.ts +4 -0
  38. package/dist/types/utils/lang.d.ts +11 -0
  39. package/dist/types/utils/logger.d.ts +2 -0
  40. package/dist/types/utils/util.d.ts +2 -2
  41. package/dist/types/z_test/puPlayer.d.ts +1 -1
  42. package/dist/types/z_unuse/index.d.ts +5 -0
  43. package/package.json +68 -58
  44. package/dist/types/core/classes.d.ts +0 -2
package/dist/main.es.js CHANGED
@@ -1,26 +1,26 @@
1
- var ze=Object.defineProperty,Je=Object.defineProperties;var Ke=Object.getOwnPropertyDescriptors;var fe=Object.getOwnPropertySymbols;var Xe=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable;var he=(t,e,r)=>e in t?ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S=(t,e)=>{for(var r in e||(e={}))Xe.call(e,r)&&he(t,r,e[r]);if(fe)for(var r of fe(e))Qe.call(e,r)&&he(t,r,e[r]);return t},V=(t,e)=>Je(t,Ke(e));var l=(t,e,r)=>new Promise((o,i)=>{var s=y=>{try{f(r.next(y))}catch(I){i(I)}},c=y=>{try{f(r.throw(y))}catch(I){i(I)}},f=y=>y.done?o(y.value):Promise.resolve(y.value).then(s,c);f((r=r.apply(t,e)).next())});var Ze="C:\\ProgramData",Ye="C:\\Users\\Administrator\\AppData\\Roaming",et="False",tt="C:\\ProgramData\\chocolatey",nt="132633801270330519",rt="\\\\.\\pipe\\crashpad_7796_AWQEYAIORKYSWPWD",ot="truecolor",it="C:\\Program Files\\Common Files",st="C:\\Program Files (x86)\\Common Files",at="C:\\Program Files\\Common Files",lt="DESKTOP-0PI1EL3",ct="C:\\Windows\\system32\\cmd.exe",dt="C:\\Windows\\System32\\Drivers\\DriverData",pt="C:\\ProgramData\\scoop\\apps\\git\\2.31.1.windows.1\\gbash",ut="Internet Explorer",mt="Default",gt="d:\\software\\Microsoft VS Code Insiders\\resources\\app\\extensions\\git\\dist\\askpass.sh",ft="C:\\ProgramData\\scoop\\apps\\git\\current",ht="C:\\Users\\Administrator\\go",bt="C:\\Users\\Administrator\\scoop\\apps\\go\\current",yt="C:\\Users\\Administrator",vt="C:",It="\\Users\\Administrator",Pt="C:\\dev\\bvwebclient\\packages\\components\\player-core",Ct="D:\\software\\IntelliJ IDEA 2021.1.1\\bin;",xt="zh_CN.UTF-8",Et="C:\\Users\\Administrator\\AppData\\Local",wt="\\\\DESKTOP-0PI1EL3",Ft="",_t="1",Rt="CONOUT$",St="CONOUT$",Ot="",Tt="MINGW64",kt="haha",Dt="D:\\software\\node\\node.exe",Lt="production",Mt="",Wt="",At="",Vt="",Bt='{"remain":[],"cooked":["run","build"],"original":["run","build"]}',Nt="true",Ht="low",jt="legacy",$t="",Ut="true",Gt="",qt="",zt="C:\\Users\\Administrator\\AppData\\Roaming\\npm-cache",Jt="10",Kt="60000",Xt="10000",Qt="Infinity",Zt="10",Yt="",en="",tn="",nn="true",rn="true",on="Infinity",sn="true",an="",ln="",cn="notepad.exe",dn="",pn="2",un="10",mn="60000",gn="10000",fn="",hn="true",bn="true",yn="git",vn="true",In="",Pn="C:\\Users\\Administrator\\AppData\\Roaming\\npm\\etc\\npmrc",Cn="C:\\Users\\Administrator\\AppData\\Roaming\\npm\\etc\\npmignore",xn="",En="",wn="",Fn="npm",_n="",Rn="",Sn="",On="",Tn="",kn="Shirtiny",Dn="",Ln="ISC",Mn="C:\\Users\\Administrator\\.npm-init.js",Wn="1.0.0",An="",Vn="",Bn="",Nn="",Hn="",jn="notice",$n="10",Un="",Gn="50",qn="%s",zn="https://registry.npmjs.org/",Jn="D:\\software\\node\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js",Kn="",Xn="14.16.1",Qn="",Zn="",Yn="",er="",tr="true",nr="",rr="true",or="",ir="",sr="",ar="",lr="C:\\Users\\Administrator\\AppData\\Roaming\\npm",cr="",dr="",pr="true",ur="",mr="",gr="true",fr="https://registry.npmjs.org/",hr="true",br="true",yr="",vr="",Ir="",Pr="",Cr="^",xr="",Er="",wr="warn-only",Fr="",_r="",Rr="20",Sr="",Or="900",Tr="",kr="C:\\Windows\\system32\\cmd.exe",Dr="true",Lr="",Mr="",Wr="500",Ar="oauth",Vr="true",Br="latest",Nr="v",Hr="",jr="C:\\Users\\ADMINI~1\\AppData\\Local\\Temp",$r="0000",Ur="",Gr="true",qr="true",zr="",Jr="",Kr="C:\\Users\\Administrator\\.npmrc",Xr="npm/6.14.12 node/v14.16.1 win32 x64",Qr="",Zr="",Yr="browser",eo="D:\\software\\node\\node_modules\\npm\\bin\\npm-cli.js",to="build",no="npm run clean && dotenv -c production node .node/builder.js",ro="D:\\software\\node\\node.exe",oo="^2.1.8",io="@besovideo/webrtc-player desc",so="^10.2.6",ao="^4.1.1",lo="^4.0.0",co="0.12.5",po="^1.4.8",uo="^7.28.0",mo="^8.3.0",go="^3.4.0",fo="^27.2.2",ho="^8.2.0",bo="^8.3.5",yo="^6.7.0",vo="^2.3.0",Io="^0.3.3",Po="^27.0.5",Co="10.0.0",xo="^4.3.3",Eo="^4.27.0",wo="^4.27.0",Fo="26.0.23",_o="15.6.1",Ro="./dist/main.es.css",So="./dist/main.es.js",Oo="dist",To="ts-jest",ko="bvwebclient",Do="besovideo",Lo="./dist/main.es.js",Mo="./dist/main.es.js",Wo="@besovideo/webrtc-player",Ao="README.md",Vo="npm run clean && dotenv -c production node .node/builder.js",Bo="shx rm -rf dist",No="eslint --max-warnings 0 . --ext .ts",Ho="dotenv -c development node .node/server.js",jo="jest",$o="ts-node",Uo="./dist/types/main.d.ts",Go="0.2.8",qo="4",zo="C:\\Users\\Administrator\\OneDrive",Jo="C:\\Users\\Administrator\\OneDrive",Ko="undefined",Xo="Windows_NT",Qo="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",Zo="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",Yo=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JSE;.WSF;.WSH;.MSC;.CPL",ei="ssh",ti=" [master \u21911 +4 ~47 -0 !]",ni="AMD64",ri="Intel64 Family 6 Model 158 Stepping 11, GenuineIntel",oi="6",ii="9e0b",si="C:\\ProgramData",ai="C:\\Program Files",li="C:\\Program Files (x86)",ci="C:\\Program Files",di="$P$G",pi="C:\\Users\\Administrator\\Documents\\WindowsPowerShell\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules",ui="C:\\Users\\Public",mi="C:/dev/bvwebclient/packages/components/player-core",gi="Console",fi="3",hi="bvplayer-core-",bi="@besovideo/webrtc-player",yi="0.2.8",vi="bvplayerCore",Ii="C:",Pi="C:\\Windows",Ci="C:\\Users\\ADMINI~1\\AppData\\Local\\Temp",xi="xterm-256color",Ei="vscode",wi="1.61.0-insider",Fi="C:\\Users\\ADMINI~1\\AppData\\Local\\Temp",_i="DESKTOP-0PI1EL3",Ri="DESKTOP-0PI1EL3",Si="Administrator",Oi="C:\\Users\\Administrator",Ti="d:\\software\\Microsoft VS Code Insiders\\resources\\app\\extensions\\git\\dist\\askpass-main.js",ki="D:\\software\\Microsoft VS Code Insiders\\Code - Insiders.exe",Di="\\\\.\\pipe\\vscode-git-eee3851946-sock",Li="C:\\Windows",Mi="1",Wi="D:/software/node/node.exe",p={ALLUSERSPROFILE:Ze,APPDATA:Ye,AZ_ENABLED:et,ChocolateyInstall:tt,ChocolateyLastPathUpdate:nt,CHROME_CRASHPAD_PIPE_NAME:rt,COLORTERM:ot,COMMONPROGRAMFILES:it,"CommonProgramFiles(x86)":st,CommonProgramW6432:at,COMPUTERNAME:lt,COMSPEC:ct,DriverData:dt,EXEPATH:pt,FPS_BROWSER_APP_PROFILE_STRING:ut,FPS_BROWSER_USER_PROFILE_STRING:mt,GIT_ASKPASS:gt,GIT_INSTALL_ROOT:ft,GOPATH:ht,GOROOT:bt,HOME:yt,HOMEDRIVE:vt,HOMEPATH:It,INIT_CWD:Pt,"IntelliJ IDEA":Ct,LANG:xt,LOCALAPPDATA:Et,LOGONSERVER:wt,MAKEFLAGS:Ft,MAKELEVEL:_t,MAKE_TERMERR:Rt,MAKE_TERMOUT:St,MFLAGS:Ot,MSYSTEM:Tt,MY_ENV:kt,NODE:Dt,NODE_ENV:Lt,npm_config_access:Mt,npm_config_allow_same_version:Wt,npm_config_also:At,npm_config_always_auth:Vt,npm_config_argv:Bt,npm_config_audit:Nt,npm_config_audit_level:Ht,npm_config_auth_type:jt,npm_config_before:$t,npm_config_bin_links:Ut,npm_config_browser:Gt,npm_config_ca:qt,npm_config_cache:zt,npm_config_cache_lock_retries:Jt,npm_config_cache_lock_stale:Kt,npm_config_cache_lock_wait:Xt,npm_config_cache_max:Qt,npm_config_cache_min:Zt,npm_config_cafile:Yt,npm_config_cert:en,npm_config_cidr:tn,npm_config_color:nn,npm_config_commit_hooks:rn,npm_config_depth:on,npm_config_description:sn,npm_config_dev:an,npm_config_dry_run:ln,npm_config_editor:cn,npm_config_engine_strict:dn,npm_config_fetch_retries:pn,npm_config_fetch_retry_factor:un,npm_config_fetch_retry_maxtimeout:mn,npm_config_fetch_retry_mintimeout:gn,npm_config_force:fn,npm_config_format_package_lock:hn,npm_config_fund:bn,npm_config_git:yn,npm_config_git_tag_version:vn,npm_config_global:In,npm_config_globalconfig:Pn,npm_config_globalignorefile:Cn,npm_config_global_style:xn,npm_config_group:En,npm_config_ham_it_up:wn,npm_config_heading:Fn,npm_config_https_proxy:_n,npm_config_if_present:Rn,npm_config_ignore_prepublish:Sn,npm_config_ignore_scripts:On,npm_config_init_author_email:Tn,npm_config_init_author_name:kn,npm_config_init_author_url:Dn,npm_config_init_license:Ln,npm_config_init_module:Mn,npm_config_init_version:Wn,npm_config_json:An,npm_config_key:Vn,npm_config_legacy_bundling:Bn,npm_config_link:Nn,npm_config_local_address:Hn,npm_config_loglevel:jn,npm_config_logs_max:$n,npm_config_long:Un,npm_config_maxsockets:Gn,npm_config_message:qn,npm_config_metrics_registry:zn,npm_config_node_gyp:Jn,npm_config_node_options:Kn,npm_config_node_version:Xn,npm_config_noproxy:Qn,npm_config_offline:Zn,npm_config_onload_script:Yn,npm_config_only:er,npm_config_optional:tr,npm_config_otp:nr,npm_config_package_lock:rr,npm_config_package_lock_only:or,npm_config_parseable:ir,npm_config_prefer_offline:sr,npm_config_prefer_online:ar,npm_config_prefix:lr,npm_config_preid:cr,npm_config_production:dr,npm_config_progress:pr,npm_config_proxy:ur,npm_config_read_only:mr,npm_config_rebuild_bundle:gr,npm_config_registry:fr,npm_config_rollback:hr,npm_config_save:br,npm_config_save_bundle:yr,npm_config_save_dev:vr,npm_config_save_exact:Ir,npm_config_save_optional:Pr,npm_config_save_prefix:Cr,npm_config_save_prod:xr,npm_config_scope:Er,npm_config_scripts_prepend_node_path:wr,npm_config_script_shell:Fr,npm_config_searchexclude:_r,npm_config_searchlimit:Rr,npm_config_searchopts:Sr,npm_config_searchstaleness:Or,npm_config_send_metrics:Tr,npm_config_shell:kr,npm_config_shrinkwrap:Dr,npm_config_sign_git_commit:Lr,npm_config_sign_git_tag:Mr,npm_config_sso_poll_frequency:Wr,npm_config_sso_type:Ar,npm_config_strict_ssl:Vr,npm_config_tag:Br,npm_config_tag_version_prefix:Nr,npm_config_timing:Hr,npm_config_tmp:jr,npm_config_umask:$r,npm_config_unicode:Ur,npm_config_unsafe_perm:Gr,npm_config_update_notifier:qr,npm_config_usage:zr,npm_config_user:Jr,npm_config_userconfig:Kr,npm_config_user_agent:Xr,npm_config_version:Qr,npm_config_versions:Zr,npm_config_viewer:Yr,npm_execpath:eo,npm_lifecycle_event:to,npm_lifecycle_script:no,npm_node_execpath:ro,npm_package_dependencies__shirtiny_logger:oo,npm_package_description:io,npm_package_devDependencies_autoprefixer:so,npm_package_devDependencies_chalk:ao,npm_package_devDependencies_dotenv_cli:lo,npm_package_devDependencies_esbuild:co,npm_package_devDependencies_esbuild_sass_plugin:po,npm_package_devDependencies_eslint:uo,npm_package_devDependencies_eslint_config_prettier:mo,npm_package_devDependencies_eslint_plugin_prettier:go,npm_package_devDependencies_jest:fo,npm_package_devDependencies_open:ho,npm_package_devDependencies_postcss:bo,npm_package_devDependencies_postcss_preset_env:yo,npm_package_devDependencies_prettier:vo,npm_package_devDependencies_shx:Io,npm_package_devDependencies_ts_jest:Po,npm_package_devDependencies_ts_node:Co,npm_package_devDependencies_typescript:xo,npm_package_devDependencies__typescript_eslint_eslint_plugin:Eo,npm_package_devDependencies__typescript_eslint_parser:wo,npm_package_devDependencies__types_jest:Fo,npm_package_devDependencies__types_node:_o,npm_package_exports___dist_main_es_css:Ro,npm_package_exports___import:So,npm_package_files_0:Oo,npm_package_jest_preset:To,npm_package_keywords_0:ko,npm_package_keywords_1:Do,npm_package_main:Lo,npm_package_module:Mo,npm_package_name:Wo,npm_package_readmeFilename:Ao,npm_package_scripts_build:Vo,npm_package_scripts_clean:Bo,npm_package_scripts_lint:No,npm_package_scripts_start:Ho,npm_package_scripts_test:jo,npm_package_scripts_ts_node:$o,npm_package_types:Uo,npm_package_version:Go,NUMBER_OF_PROCESSORS:qo,OneDrive:zo,OneDriveConsumer:Jo,ORIGINAL_XDG_CURRENT_DESKTOP:Ko,OS:Xo,Path:Qo,PATH:Zo,PATHEXT:Yo,PLINK_PROTOCOL:ei,POSH_GIT_STATUS:ti,PROCESSOR_ARCHITECTURE:ni,PROCESSOR_IDENTIFIER:ri,PROCESSOR_LEVEL:oi,PROCESSOR_REVISION:ii,ProgramData:si,PROGRAMFILES:ai,"ProgramFiles(x86)":li,ProgramW6432:ci,PROMPT:di,PSModulePath:pi,PUBLIC:ui,PWD:mi,SESSIONNAME:gi,SHLVL:fi,SH_CSS_CLASS_PREFIX:hi,SH_LIB_NAME:bi,SH_LIB_VERSION:yi,SH_STORAGE_FIELD_PREFIX:vi,SYSTEMDRIVE:Ii,SYSTEMROOT:Pi,TEMP:Ci,TERM:xi,TERM_PROGRAM:Ei,TERM_PROGRAM_VERSION:wi,TMP:Fi,USERDOMAIN:_i,USERDOMAIN_ROAMINGPROFILE:Ri,USERNAME:Si,USERPROFILE:Oi,VSCODE_GIT_ASKPASS_MAIN:Ti,VSCODE_GIT_ASKPASS_NODE:ki,VSCODE_GIT_IPC_HANDLE:Di,WINDIR:Li,ZES_ENABLE_SYSMAN:Mi,_:Wi};var oe=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)},be=t=>{let e=typeof t=="number"?t:oe(t),r=oe();return e-r},Ai=t=>be(t)>0,Vi={getUTCSecond:oe,pastNow:be,compare:Ai},ie=Vi;var Bi=Object.defineProperty,Ni=Object.defineProperties,Hi=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,ji=Object.prototype.hasOwnProperty,$i=Object.prototype.propertyIsEnumerable,ve=(t,e,r)=>e in t?Bi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,H=(t,e)=>{for(var r in e||(e={}))ji.call(e,r)&&ve(t,r,e[r]);if(ye)for(var r of ye(e))$i.call(e,r)&&ve(t,r,e[r]);return t},Ui=(t,e)=>Ni(t,Hi(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 Ie=class{constructor(){this.colors=w,this.shapes={slider:new Pe}}},Pe=class{constructor(){}title(t=""){return j`
1
+ var $t=Object.defineProperty,zt=Object.defineProperties;var Ut=Object.getOwnPropertyDescriptors;var je=Object.getOwnPropertySymbols;var Kt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable;var et=(t,e,n)=>e in t?$t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,k=(t,e)=>{for(var n in e||(e={}))Kt.call(e,n)&&et(t,n,e[n]);if(je)for(var n of je(e))Jt.call(e,n)&&et(t,n,e[n]);return t},z=(t,e)=>zt(t,Ut(e));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 Gt="production",Xt="@besovideo/webrtc-player",qt="0.3.2",d={NODE_ENV:Gt,SH_LIB_NAME:Xt,SH_LIB_VERSION:qt};var Qt=Object.defineProperty,Zt=Object.defineProperties,Yt=Object.getOwnPropertyDescriptors,tt=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable,nt=(t,e,n)=>e in t?Qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,X=(t,e)=>{for(var n in e||(e={}))jt.call(e,n)&&nt(t,n,e[n]);if(tt)for(var n of tt(e))en.call(e,n)&&nt(t,n,e[n]);return t},tn=(t,e)=>Zt(t,Yt(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 ot=class{constructor(){this.colors=T,this.shapes={slider:new rt}}},rt=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 j`
6
+ `}message(t=""){return q`
7
7
  color: ${t};
8
- `}message_button(t="#eee",e=w.darkPurple,r="#fff"){return j`
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 ${r};
14
- `}},j=(t,...e)=>{if(e.length===0)return t[0];let r="";return e.forEach((o,i)=>{r+=t[i]+o}),r+=t[t.length-1],r},B;(function(t){t[t.title=1]="title",t[t.message=2]="message",t[t.message_button=3]="message_button"})(B||(B={}));var G=({color:t},e=new Pe,r)=>{switch(r){case 1:return e.title(t);case 2:return e.message(t);case 3:return e.message_button();default:return""}},Gi=class{constructor(t){let e={log:window.console.log,enable:!0};this._option=Ui(H({},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:r}=this._option;e&&r&&r(...t)}set baseOption(t){this._option=t}get baseOption(){return this._option}setEnable(t){this._option.enable=!!t}},Ce=class{constructor(t){let e={enable:!0,log:window.console.log,level:39,shape:new Ie().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}},qi=class extends Gi{constructor(t){super(t||new Ce);this.loggerOption=H(H({},new Ce),t)}setLoggerOption(t){let e=H(H({},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,r,o,i,...s){!this.loggerOption.level&&this.loggerOption.level!==0||this.loggerOption.level<t||super.log(`%c${e}%c${r}`,o,i,...s)}},xe;(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"})(xe||(xe={}));var M={debug:{name:"debug",title:" Debug :",color:w.lime,level:3},http:{name:"http",title:" Http :",color:w.weakBlue,level:3},api:{name:"api",title:" Api :",color:w.cyan,level:3},service:{name:"service",title:" Service :",color:w.purple,level:2},interval:{name:"interval",title:" Interval :",color:w.pink,level:1},warn:{name:"warn",title:" WARN :",color:w.orange,level:1},error:{name:"error",title:" ERR :",color:w.red,level:0},key:{name:"key",title:" Key :",color:w.darkPurple,level:0}},se=class extends qi{constructor(){super(...arguments);this.error=(t,...e)=>{this.formatLogWrapper(M.error,`${t.stack}
15
- `,...e)},this.key=(t,...e)=>{let r=M.key;this.formatLog(r.level,r.title,t.toUpperCase(),G({color:r.color},this.getLoggerOption().shape,B.title),G({},this.getLoggerOption().shape,B.message_button),...e)},this.version=(t="",e,...r)=>{this.formatLog(0,t.toUpperCase(),e,j`
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 oe=({color:t},e=new rt,n)=>{switch(n){case 1:return e.title(t);case 2:return e.message(t);case 3:return e.message_button();default:return""}},nn=class{constructor(t){let e={log:window.console.log,enable:!0};this._option=tn(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}},it=class{constructor(t){let e={enable:!0,log:window.console.log,level:39,shape:new ot().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}},on=class extends nn{constructor(t){super(t||new it);this.loggerOption=X(X({},new it),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)}},st;(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"})(st||(st={}));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 on{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(),oe({color:n.color},this.getLoggerOption().shape,U.title),oe({},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
- `,j`
22
- background-color: ${w.darkPurple};
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,G({color:t.color},this.getLoggerOption().shape,B.title),G({color:t.color},this.getLoggerOption().shape,B.message),...r)}debug(t,...e){this.formatLogWrapper(M.debug,t,...e)}http(t,...e){this.formatLogWrapper(M.http,t,...e)}api(t,...e){this.formatLogWrapper(M.api,t,...e)}service(t,...e){this.formatLogWrapper(M.service,t,...e)}interval(t,...e){this.formatLogWrapper(M.interval,t,...e)}warn(t,...e){this.formatLogWrapper(M.warn,t,...e)}},ae=new Ie,zi=new se,Ji=zi,O=Ji;var Ee=class extends se{constructor(){super(...arguments);this.test=(e,...r)=>{let o=4;this.formatLog(o," Test ",e,ae.shapes.slider.title("#3f6600"),ae.shapes.slider.message("#999"),...r)}}},le=new Ee;le.debug("player-core env:",p);le.version(p.SH_LIB_NAME,p.SH_LIB_VERSION||"");var a=le;var we=(t,e,r)=>{let o={value:e,expire:r},i=JSON.stringify(o);return localStorage.setItem(t,i),o},Ki=(t,e,r)=>{let i=ie.getUTCSecond()+r;return we(t,e,i)},Xi=(t,e=!1)=>{let r=localStorage.getItem(t);if(!r)return null;try{let o=JSON.parse(r);return e?o:o.expire?ie.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")}},Qi=t=>localStorage.removeItem(t),Zi={set:we,setTimeout:Ki,get:Xi,remove:Qi},k=Zi;var q;(function(r){r.GET="GET",r.POST="POST"})(q||(q={}));var Fe=(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(S({},e.headers)),signal:r.signal};i&&(s.body=i),a.http("\u53D1\u9001\u8BF7\u6C42\uFF1A",t,V(S({},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}}),Yi=(t,e,r)=>l(void 0,null,function*(){let o=e?e.toString():"";return yield Fe(t+o,{method:q.GET,headers:r==null?void 0:r.headers})}),es=(t,e,r)=>l(void 0,null,function*(){return yield Fe(t,{method:q.POST,headers:S({"Content-Type":"application/json;charset=UTF-8"},r==null?void 0:r.headers),bodyData:e})}),ts={get:Yi,post:es},z=ts;function _e(t){return t!==t}function ns(t,e=[]){let r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}function rs(t,e,r){let o=r-1,i=t.length;for(;++o<i;)if(t[o]===e)return o;return-1}function os(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 is(t,e,r){return e===e?rs(t,e,r):os(t,_e,r)}function ss(t,e){let r=-1,o=e.length,i=t;for(t===e&&(e=ns(e));++r<o;){let s=0,c=e[r],f=c;for(;(s=is(i,f,s))>-1;)i!==t&&[].splice.call(i,s,1),[].splice.call(t,s,1)}return t}var as=(t,e)=>!t||!t.length||!e||!e.length?t:ss(t,e),ls={pullAll:as,baseIsNaN:_e},Re=ls;var Se={BVCSP_V1:{path:"/bvcsp/v1",prefix:""}},ce=t=>{let e=Se[t];return e.prefix+e.path},cs=(t,e)=>{let r=Se[t];return r.prefix=e||"",ce(t)},$={setApiPrefix:cs,getApiURL:ce,bvscpV1:()=>ce("BVCSP_V1")},U=t=>{$.setApiPrefix("BVCSP_V1",t)};var ds=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},ps=(t,e,r)=>{if(!t)return;let o=document.createDocumentFragment();o.appendChild(t);let i=ds(e);!i||(i.appendChild(o),r==null||r())},Oe=ps;var Te=(...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=Te(...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(" ")},J=Te;var us={render:Oe,cls:J},ke=p.SH_CSS_CLASS_PREFIX,De=p.SH_STORAGE_FIELD_PREFIX,P=us;var W=`${De}DialogIds`,ms=(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 z.post(`${$.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=k.get(W)||[];f.push(s.dialogid),k.set(W,f)}return{dialogId:s.dialogid,sdp:s.sdp}}),gs=(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 z.post(`${$.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=k.get(W)||[];return c.push(s.dialogid),k.set(W,c),{dialogId:s.dialogid,sdp:s.sdp}}),fs=(t,e)=>l(void 0,null,function*(){if(!t)return;let r={Authorization:e||""};return a.api("\u5173\u95EDdialog\uFF1A",t),yield z.post(`${$.bvscpV1()}/dialog/close/${t}`,{},{headers:r})}),Le=(t,e)=>l(void 0,null,function*(){let r=k.get(W)||[];Re.pullAll(r,t),k.set(W,r,0);let i=(yield Promise.allSettled(t.map(s=>fs(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}`))}),hs=t=>l(void 0,null,function*(){let e=k.get(W);!e||e.length<1||(k.remove(W),yield Le(e,t))}),bs={getDeviceWebrtc:ms,getConferenceWebrtc:gs,closeDialogs:Le,closeAllStorageDialog:hs},F=bs;var D=class{constructor(e,r){let o=document.createElement(e);o.className=ke+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}getEl(){return this.el}};var Me=class extends D{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=J("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}},We=Me;var Ae=class extends D{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}},Ve=Ae;var Be={contain:"contain",fill:"fill"},Ne=class extends D{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)||Be.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=Be[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(){}},He=Ne;var ys=(t,e)=>{O.debug(`webrtc my ICE candidate:
26
- ${e.candidate?e.candidate.candidate:"(null)"}`)},vs=(t,e,r)=>{O.debug("webrtc ICE state change event: ",e),O.debug(`webrtc my ICE state: ${t==null?void 0:t.iceConnectionState}`),t&&t.iceConnectionState==="disconnected"&&r&&r()},Is=(t,e)=>{O.debug("webrtc Connection state change, \u5F53\u524D\u8FDE\u63A5\u72B6\u6001: ",t,t.connectionState)},Ps=(t,e,r)=>{O.debug("webrtc \u5F53\u524D\u7684 stream: ",e.streams[0]);let o=e.streams[0];r(o)},Cs=(t,e)=>l(void 0,null,function*(){let{offerParam:r,productRemoteSdp:o,customerRTCPeerConnection:i,onConnected:s,onConnectedFailed:c,onIceDisconnected:f,onPcEventAdded:y,onLocalDescriptionReady:I}=t,x=!!i&&i instanceof RTCPeerConnection,b={},d=x?i:new RTCPeerConnection(b);if(d.addEventListener("icecandidate",g=>ys(d,g)),d.addEventListener("iceconnectionstatechange",g=>vs(d,g,f)),d.addEventListener("connectionstatechange",g=>Is(d,g)),d.addEventListener("track",g=>Ps(d,g,e)),y&&(yield y(d)),x)return{pc:d};try{let g=yield d.createOffer(r);O.debug("\u521B\u5EFAoffer\uFF0C\u53C2\u6570\uFF1A",r,"\uFF0C \u7ED3\u679C\uFF1A",g),yield d.setLocalDescription(g),I&&I(d);let R=yield o(new RTCSessionDescription(g));O.debug("webrtc recv open answer",R);let T=new RTCSessionDescription({type:"answer",sdp:R});yield d.setRemoteDescription(T),O.debug("getTransceivers",d.getTransceivers()),s&&s(d)}catch(g){throw c&&c(d),O.error(new Error(`webrtc Failed to create session description: ${g.toString()}`)),d.close(),g}return{pc:d}}),xs=t=>{if(!t)return;let{pc:e}=t;e.close()},Es={connect:Cs,disconnect:xs},de=Es;var _;(function(o){o.DIRECT="direct",o.PLUGIN="plugin",o.REJECT="reject"})(_||(_={}));var K;(function(s){s.MP4="mp4",s.FLAC="flac",s.OGG="Ogg",s.WEBM="webm",s.AUTO="auto"})(K||(K={}));var pe;(function(e){e.WEBRTC="webrtc"})(pe||(pe={}));var je;(function(r){r[r.DIRECT_SUPORT_TYPES=0]="DIRECT_SUPORT_TYPES",r[r.PLUGIN_SUPORT_TYPES=1]="PLUGIN_SUPORT_TYPES"})(je||(je={}));var $e=class extends D{constructor(e){super("div",P.cls("player"));this._video=new He,this._spinner=new Ve({spin:!1}),this._mask=new We({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?K.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 _.REJECT;if(!o)return _.DIRECT;let i=Object.values(K),s=Object.values(pe);return i.includes(o)?_.DIRECT:s.includes(o)?_.PLUGIN:_.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.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!==_.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 de.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===_.REJECT){a.error(new Error("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u7C7B\u578B"),this._mode,this._videoOption);return}if(this._mode===_.DIRECT){this.prepareDirect();return}if(this._mode===_.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(){de.disconnect(this._webrtcConnect),this._webrtcConnect=null,this._video.srcObject=null}},X=$e;var N=document.documentElement,Q="requestFullscreen",Z="exitFullscreen",Y="fullscreenElement",ee="onfullscreenchange";if("webkitRequestFullScreen"in N)Q="webkitRequestFullScreen",Z="webkitExitFullscreen",Y="webkitFullscreenElement",ee="onwebkitfullscreenchange";else if("msRequestFullscreen"in N)Q="msRequestFullscreen",Z="msExitFullscreen",Y="msFullscreenElement",ee="MSFullscreenChange";else if("mozRequestFullScreen"in N)Q="mozRequestFullScreen",Z="mozCancelFullScreen",Y="mozFullScreenElement",ee="onmozfullscreenchange";else if(!("requestFullscreen"in N))throw"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Fullscreen API !";function ws(t=N,e){return t[Q](e)}function Fs(){return document[Z]()}function Ue(t){return t===document[Y]}function _s(t=N,e){return Ue(t)?Fs():ws(t,e)}function Rs(t,e){let r=()=>{t.onfullscreenchange=null},o=i=>{i.target!==null&&e(Ue(i.target))};return t[ee]=o,{cancel:r}}var Ss={toggle:_s,watch:Rs},Ge=Ss;var Os=(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 F.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}`)}}}),Ts=t=>{let{container:e,token:r,puOption:o,defaultMediaOption:i={audio:!0,video:!0},testUrl:s,videoFit:c="fill",muted:f,apiPrefix:y,onConnected:I,onConnectedFailed:x,onDisConnected:b,fullScreenOnDblclick:d=!0}=t||{},g,R=r,T=o,v=e,h=typeof f=="boolean"?f:!i.audio;U(y);let L=()=>l(void 0,null,function*(){if(!!g&&(a.debug("PuPlayer close",g),u.mask.visible=!0,u.mask.text="Video Closed",u.close(),g))try{yield F.closeDialogs([g],R)}catch(m){throw a.error(m,"PuPlayer close \u5931\u8D25"),new Error(`PuPlayer close \u5931\u8D25 , ${m.message}`)}}),u=new X({video:{url:s},pluginOption:{webrtc:{offerParam:{offerToReceiveAudio:i.audio,offerToReceiveVideo:i.video},productRemoteSdp:m=>l(void 0,null,function*(){return Os(T,R,A=>{g=A})(m)}),onIceDisconnected:()=>{u.mask.visible=!0,u.mask.text="lost connection",u.close(),b&&b()},onConnected:()=>{I&&I()},onConnectedFailed:()=>{x&&x()}}},playerConfig:{autoPlay:!0}});u.mute(h),u.video.fit=c;let C=u.init();d&&(C==null||C.addEventListener("dblclick",()=>{a.debug("\u53CC\u51FBplayer\uFF1A",C),Ge.toggle(C)}));let re={instance:{getVideoElement:()=>u.video.getEl(),getPlayerElement:()=>u.getEl(),open:(m=!1)=>l(void 0,null,function*(){a.debug("PuPlayer open"),yield L(),u.mask.visible=!1,u.mask.text="connecting",u.mute(!!m);try{yield u.prepareWebrtc()}catch(E){throw u.mask.visible=!0,u.mask.text="connect failed",E}if(typeof m=="boolean"&&m){let E=()=>{a.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",h),a.debug("\u6B64\u90E8\u5206\u67E5\u770B\uFF1Ahttps://developers.google.com/web/updates/2017/09/autoplay-policy-changes"),u.mute(h),document.removeEventListener("click",E),document.removeEventListener("touchend",E)};document.addEventListener("click",E),document.addEventListener("touchend",E)}}),play:()=>l(void 0,null,function*(){yield u.play(h)}),mute:(m=!1)=>{h=m,u.mute(m)},hidden:m=>l(void 0,null,function*(){let E=C,A=u.video.getEl();E.style.display="none",document.body.appendChild(E),A.muted=!0;try{typeof m!="undefined"&&(h=m),yield u.play(h)}catch(js){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",A.paused)}),display:m=>l(void 0,null,function*(){let E=C,A=u.video.getEl();P.render(E,v,()=>l(void 0,null,function*(){E.style.display="block",typeof m!="undefined"&&(h=m),yield u.play(h)})),a.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",A.paused)}),moveTo:m=>{a.debug("\u79FB\u52A8\u81F3\uFF1A",m),v=m,P.render(C,v,()=>l(void 0,null,function*(){}))},getCurrentContainer:()=>v,setPuOption:m=>{T=m},setVideoFit:m=>{a.debug("PuPlayer setVideoFit",m),u.video.fit=m},setToken:m=>{a.debug("PuPlayer setToken",m),R=m},setApiPrefix:U,close:L,render:u.init,destroy:()=>l(void 0,null,function*(){a.debug("PuPlayer destroy"),yield L(),u.destroy()})},element:C};return v&&(P.render(C,v),re.element=null),re},ks=Ts;var ue=class{constructor(e,r){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()}};var te=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 F.closeDialogs([this.dialogId]))})}},me=class extends ue{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._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 Ds=t=>{let{container:e,sdpFetcher:r,offerParam:o,videoFit:i,muted:s,autoPlay:c,onConnected:f,onConnectedFailed:y,onDisConnected:I,onPcEventAdded:x}=t,b=new X({pluginOption:{webrtc:{offerParam:o,productRemoteSdp:()=>l(void 0,null,function*(){return""}),onIceDisconnected:()=>{b.mask.visible=!0,b.mask.text="lost connection",b.close(),I&&I()},onPcEventAdded:x,onConnected:()=>{b.mask.visible=!1,b.mask.text="connected",f&&f()},onConnectedFailed:()=>{y&&y()}}},playerConfig:{autoPlay:c}}),d=new me(b,i,s,r,e),g={open:()=>l(void 0,null,function*(){a.debug("BvWebrtc open"),yield d.open()}),setOption:v=>{a.debug("BvWebrtc setOption");let h=d.getRemoteSdpFetcher();h&&(h.param=v)},setToken:v=>{a.debug("BvWebrtc setToken",v);let h=d.getRemoteSdpFetcher();h&&(h.token=v)},setApiPrefix:v=>{a.debug("BvWebrtc setApiPrefix",v);let h=d.getRemoteSdpFetcher();h&&(h.prefix=v)},getRemoteSdpFetcher:()=>d.getRemoteSdpFetcher(),close:()=>l(void 0,null,function*(){a.debug("BvWebrtc close"),yield d.close()}),render:()=>(a.debug("BvWebrtc render"),d.render()),destroy:()=>{a.debug("BvWebrtc destroy"),d.destroy()}},R=d.render(),T={instance:g,element:R};return e&&(P.render(R,e),T.element=null),T},qe=Ds;var Ls=()=>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}),Ms=t=>{let{container:e,token:r,getRemoteSdpParam:o,apiPrefix:i,getRemoteSdpResult:s,onConnected:c,onConnectedFailed:f,onDisConnected:y,onGetUserMediaFailed:I}=t||{},x=(v,h,L,u)=>l(void 0,null,function*(){if(a.debug("audioPlayer productRemoteSdp",{param:{localDescription:v,param:h,token:L,prefix:u}}),v.type==="offer"&&(U(u),a.debug("\u672C\u5730sdp",v),!!s))try{let{sdp:C,dialogId:ge}=yield s(v.sdp,L,h);return{sdp:C,dialogId:ge}}catch(C){throw a.error(C,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`productRemoteSdp \u5931\u8D25 , ${C.message}`)}}),b=new te(x,r,o,i),{instance:d,element:g}=qe({container:e,sdpFetcher:b,offerParam:{offerToReceiveAudio:!0},videoFit:"contain",muted:!1,autoPlay:!0,onConnected:c,onConnectedFailed:f,onDisConnected:y,onPcEventAdded:v=>l(void 0,null,function*(){try{let h=yield Ls();h.getTracks().forEach(L=>v.addTrack(L,h))}catch(h){I&&I()}})});return{instance:S({},d),element:g}},ne=Ms;var Ws=(t,e,r)=>l(void 0,null,function*(){let{id:o,index:i}=r||{};return yield F.getDeviceWebrtc({id:o,index:i,sdp:t},e)}),As=t=>{let{container:e,token:r,puOption:o,apiPrefix:i,onConnected:s,onConnectedFailed:c,onDisConnected:f,onGetUserMediaFailed:y}=t||{},{instance:I,element:x}=ne({container:e,token:r,getRemoteSdpParam:o,getRemoteSdpResult:Ws,apiPrefix:i,onConnected:s,onConnectedFailed:c,onDisConnected:f,onGetUserMediaFailed:y}),b=V(S({},I),{setPuOption:g=>b.setOption&&b.setOption(g)});return delete b.setOption,{instance:b,element:x}},Vs=As;var Bs=(t,e,r)=>l(void 0,null,function*(){let{id:o,index:i}=r||{};return yield F.getConferenceWebrtc({id:o,index:i,sdp:t},e)}),Ns=t=>{let{container:e,token:r,confOption:o,apiPrefix:i,onConnected:s,onConnectedFailed:c,onDisConnected:f,onGetUserMediaFailed:y}=t||{},{instance:I,element:x}=ne({container:e,token:r,getRemoteSdpParam:o,getRemoteSdpResult:Bs,apiPrefix:i,onConnected:s,onConnectedFailed:c,onDisConnected:f,onGetUserMediaFailed:y}),b=V(S({},I),{setConfOption:g=>b.setOption&&b.setOption(g)});return delete b.setOption,{instance:b,element:x}},Hs=Ns;var Vl=F.closeAllStorageDialog;export{Hs as Conference,Vs as Intercom,ks as PuPlayer,te as RemoteSdpFetcher,Vl as clearAllDialog};
25
+ `,...n)}}formatShapeLog({level:t,title:e,color:n},o,...i){this.formatLog(t,e,o,oe({color:n},this.getLoggerOption().shape,U.title),oe({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)}},jo=new ot,rn=new ye,sn=rn,D=sn;var at=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 at;be.debug("player-core env:",d);be.version(d.SH_LIB_NAME,d.SH_LIB_VERSION||"");var a=be;var an=Array.isArray,ln=t=>t!==t,lt=t=>typeof t=="number",ct=t=>typeof t=="string",cn=t=>lt(t)||ct(t),dn=t=>typeof t=="function",un=t=>typeof t=="undefined",pn=t=>t?!1:!!(t!=null?t:!0),mn={isArr:an,baseIsNaN:ln,isString:ct,isNumber:lt,isText:cn,isFn:dn,isUndefined:un,isNullOrUndefined:pn},F=mn;function gn(t,e=[]){let n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function fn(t,e,n){let o=n-1,i=t.length;for(;++o<i;)if(t[o]===e)return o;return-1}function hn(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 vn(t,e,n){return e===e?fn(t,e,n):hn(t,F.baseIsNaN,n)}function yn(t,e){let n=-1,o=e.length,i=t;for(t===e&&(e=gn(e));++n<o;){let s=0,c=e[n],g=c;for(;(s=vn(i,g,s))>-1;)i!==t&&[].splice.call(i,s,1),[].splice.call(t,s,1)}return t}var bn=t=>t?F.isArr(t)?t:[t]:[],In=(t,e)=>!t||!t.length||!e||!e.length?t:yn(t,e),Cn=(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)})},Pn={pullAll:In,toArray:bn,screenshot:Cn},K=Pn;function wn(t){return t!=null&&t!==!0&&t!==!1}function dt(t,e=[]){return t.forEach(n=>{F.isArr(n)?dt(n,e):wn(n)&&e.push(F.isText(n)?_n(n):n)}),e}function En(t={},e){if(!e)return;Object.keys(t).forEach(o=>{if(o==="children")return;let i=t[o];F.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 _n(t){return{type:"",props:{nodeValue:String(t)+""}}}function xn(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(F.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(F.isString(s)){let c=xn(s,i.xmlns||n);return En(i,c),(i.children||[]).forEach(l=>{let f=Q(l,e,i.xmlns);!f||c.appendChild(f)}),c}if(F.isFn(s)){let c=s(i);return Q(c,e)}return null}function Sn(t,e,...n){return e=e||{},n=dt(K.toArray(e.children||n)),e.children=n,{type:t,props:e}}var Tn=t=>t.children,Rn={h:Sn,Fragment:Tn},r=Rn;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)},ut=t=>{let e=typeof t=="number"?t:Ie(t),n=Ie();return e-n},kn=t=>ut(t)>0,Fn={getUTCSecond:Ie,pastNow:ut,compare:kn},Ce=Fn;var pt=(t,e,n)=>{let o={value:e,expire:n},i=JSON.stringify(o);return localStorage.setItem(t,i),o},Mn=(t,e,n)=>{let i=Ce.getUTCSecond()+n;return pt(t,e,i)},Ln=(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")}},Nn=t=>localStorage.removeItem(t),On={set:pt,setTimeout:Mn,get:Ln,remove:Nn},V=On;var re;(function(n){n.GET="GET",n.POST="POST"})(re||(re={}));var mt=(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}}),Dn=(t,e,n)=>u(void 0,null,function*(){let o=e?e.toString():"";return yield mt(t+o,{method:re.GET,headers:n==null?void 0:n.headers})}),Vn=(t,e,n)=>u(void 0,null,function*(){return yield mt(t,{method:re.POST,headers:k({"Content-Type":"application/json;charset=UTF-8"},n==null?void 0:n.headers),bodyData:e})}),Bn={get:Dn,post:Vn},ie=Bn;var gt={BVCSP_V1:{path:"/bvcsp/v1",prefix:""}},Pe=t=>{let e=gt[t];return e.prefix+e.path},An=(t,e)=>{let n=gt[t];return n.prefix=e||"",Pe(t)},Z={setApiPrefix:An,getApiURL:Pe,bvscpV1:()=>Pe("BVCSP_V1")},Y=t=>{Z.setApiPrefix("BVCSP_V1",t)};var Wn=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},Hn=(t,e,n)=>{if(!t)return;let o=document.createDocumentFragment();o.appendChild(t);let i=Wn(e);!i||(i.appendChild(o),n==null||n())},ft=Hn;var se=(...t)=>{let e=[];for(let n=0;n<t.length;n++){let o=t[n];if(!o)continue;let i=typeof o;if(F.isText(o))e.push(o);else if(Array.isArray(o)){if(o.length){let s=se(...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(" ")},ht=t=>t?t.replace(/\s*(;|\{|\})+\s*[\n\r]*/g,"$1"):"",$n=(t,...e)=>{if(!e.length)return ht(t[0]);let n="";return e.forEach((o,i)=>{n+=t[i]+o}),n+=t[t.length-1],ht(n)},we="bvplayer-",zn="common-",vt=t=>new RegExp(we).test(t),Un=(...t)=>se(t).split(" ").map(e=>vt(e)?e:we+e).join(" "),Kn=(...t)=>se(t).split(" ").map(e=>vt(e)?e:we+zn+e).join(" ");var Jn={cls:se,css:$n,prefixCls:Un,commonCls:Kn},j=Jn;function Gn(t){return document.createRange().createContextualFragment(t)}function Xn(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function Ee(){return document.createDocumentFragment()}function qn(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function Qn(t,...e){if(!t)return;let n=Ee();n.append(...e.filter(o=>o)),t.appendChild(n)}function Zn(t){if(!!t)if(t instanceof Element){t.innerHTML="";return}else for(;t.firstChild;)t.removeChild(t.firstChild)}function Yn(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 jn(t){var e;if(!!t)if(t instanceof Element){t.remove();return}else(e=t.parentNode)==null||e.removeChild(t)}function eo(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 to(t){return t?Q(t,eo):null}var no={parseHtml:Gn,create:Xn,createFragment:Ee,createHtmlElement:qn,createByJsx:to,append:Qn,empty:Zn,replace:Yn,removeSelf:jn},yt=no;var oo="bvplayerCore",ro=t=>oo+t,io={createPrefixStorageField:ro},bt=io;var so={render:ft,style:j,dom:yt,field:bt},p=so;var W=p.field.createPrefixStorageField("DialogIds"),ao=(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 ie.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}}),lo=(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 ie.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}}),co=(t,e)=>u(void 0,null,function*(){if(!t)return;let n={Authorization:e||""};return a.api("\u5173\u95EDdialog\uFF1A",t),yield ie.post(`${Z.bvscpV1()}/dialog/close/${t}`,{},{headers:n})}),It=(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=>co(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}`))}),uo=t=>u(void 0,null,function*(){let e=V.get(W);!e||e.length<1||(V.remove(W),yield It(e,t))}),po={getDeviceWebrtc:ao,getConferenceWebrtc:lo,closeDialogs:It,closeAllStorageDialog:uo},M=po;var Ct=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 Ct}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 Pt=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}},wt=Pt;var Et=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}},_t=Et;var xt={contain:"contain",fill:"fill"},St=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)||xt.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=xt[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(){}},Tt=St;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 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.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 1 1-6 0 3 3 0 0 1 6 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 0 1-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 0 1 .947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 0 1 2.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 0 1 2.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 0 1 .947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 0 1-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 0 1-2.287-.947zM10 13a3 3 0 1 0 0-6 3 3 0 0 0 0 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 0 1 2-2h.93a2 2 0 0 0 1.664-.89l.812-1.22A2 2 0 0 1 10.07 4h3.86a2 2 0 0 1 1.664.89l.812 1.22A2 2 0 0 0 18.07 7H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 1 1-6 0 3 3 0 0 1 6 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 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-1.586a1 1 0 0 1-.707-.293l-1.121-1.121A2 2 0 0 0 11.172 3H8.828a2 2 0 0 0-1.414.586L6.293 4.707A1 1 0 0 1 5.586 5H4zm6 9a3 3 0 1 0 0-6 3 3 0 0 0 0 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 0-5 5M4 16v4m0 0h4m-4 0 5-5m11 5-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 0 1 1-1h4a1 1 0 0 1 0 2H6.414l2.293 2.293a1 1 0 0 1-1.414 1.414L5 6.414V8a1 1 0 0 1-2 0V4zm9 1a1 1 0 1 1 0-2h4a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V6.414l-2.293 2.293a1 1 0 1 1-1.414-1.414L13.586 5H12zm-9 7a1 1 0 1 1 2 0v1.586l2.293-2.293a1 1 0 0 1 1.414 1.414L6.414 15H8a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1v-4zm13-1a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 1 1 0-2h1.586l-2.293-2.293a1 1 0 0 1 1.414-1.414L15 13.586V12a1 1 0 0 1 1-1z","clip-rule":"evenodd"}))}function Fe({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 1 1-18 0 9 9 0 0 1 18 0z"}))}function Me({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 1 1-16 0 8 8 0 0 1 16 0zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM9 9a1 1 0 0 0 0 2v3a1 1 0 0 0 1 1h1a1 1 0 1 0 0-2v-3a1 1 0 0 0-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 14 2-2m0 0 2-2m-2 2-2-2m2 2 2 2m7-2a9 9 0 1 1-18 0 9 9 0 0 1 18 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 1 0 0-16 8 8 0 0 0 0 16zM8.707 7.293a1 1 0 0 0-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 1 0 1.414 1.414L10 11.414l1.293 1.293a1 1 0 0 0 1.414-1.414L11.414 10l1.293-1.293a1 1 0 0 0-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 18 18 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 0 1 1.414 0L10 8.586l4.293-4.293a1 1 0 1 1 1.414 1.414L11.414 10l4.293 4.293a1 1 0 0 1-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 0 1-1.414-1.414L8.586 10 4.293 5.707a1 1 0 0 1 0-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 0 1 0 7.072m2.828-9.9a9 9 0 0 1 0 12.728M5.586 15H4a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-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 0 1 10 4v12a1 1 0 0 1-1.707.707L4.586 13H2a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h2.586l3.707-3.707a1 1 0 0 1 1.09-.217zm5.274-.147a1 1 0 0 1 1.414 0A9.972 9.972 0 0 1 19 10a9.972 9.972 0 0 1-2.929 7.071 1 1 0 0 1-1.414-1.414A7.971 7.971 0 0 0 17 10a7.97 7.97 0 0 0-2.343-5.657 1 1 0 0 1 0-1.414zm-2.829 2.828a1 1 0 0 1 1.415 0A5.983 5.983 0 0 1 15 10a5.984 5.984 0 0 1-1.757 4.243 1 1 0 0 1-1.415-1.415A3.984 3.984 0 0 0 13 10a3.983 3.983 0 0 0-1.172-2.828 1 1 0 0 1 0-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 0 1-1-1v-4a1 1 0 0 1 1-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 14 2-2m0 0 2-2m-2 2-2-2m2 2 2 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 0 1 10 4v12a1 1 0 0 1-1.707.707L4.586 13H2a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h2.586l3.707-3.707a1 1 0 0 1 1.09-.217zm2.91 4.217a1 1 0 0 1 1.414 0L15 8.586l1.293-1.293a1 1 0 1 1 1.414 1.414L16.414 10l1.293 1.293a1 1 0 0 1-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 0 1-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 0 1 0-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.168-3.197-2.132A1 1 0 0 0 10 9.87v4.263a1 1 0 0 0 1.555.832l3.197-2.132a1 1 0 0 0 0-1.664z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 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 1 0 0-16 8 8 0 0 0 0 16zM9.555 7.168A1 1 0 0 0 8 8v4a1 1 0 0 0 1.555.832l3-2a1 1 0 0 0 0-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 1 1-18 0 9 9 0 0 1 18 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 1 1-16 0 8 8 0 0 1 16 0zM7 8a1 1 0 0 1 2 0v4a1 1 0 1 1-2 0V8zm5-1a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0V8a1 1 0 0 0-1-1z","clip-rule":"evenodd"}))}function Ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 33",fill:"currentColor"},r.h("path",{d:"M6.667 28H1.334c-.8 0-1.333-.533-1.333-1.333v-5.333c0-.8.533-1.333 1.333-1.333s1.333.533 1.333 1.333v4h4c.8 0 1.333.533 1.333 1.333S7.467 28 6.667 28zm24 0h-5.333c-.8 0-1.333-.533-1.333-1.333s.533-1.333 1.333-1.333h4v-4c0-.8.533-1.333 1.333-1.333S32 20.534 32 21.334v5.333c0 .8-.533 1.333-1.333 1.333zm0-16c-.8 0-1.333-.533-1.333-1.333v-4h-4c-.8 0-1.333-.533-1.333-1.333s.533-1.333 1.333-1.333h5.333c.8 0 1.333.533 1.333 1.333v5.333c0 .8-.533 1.333-1.333 1.333zM1.333 12C.533 12 0 11.467 0 10.667V5.334c0-.8.533-1.333 1.333-1.333h5.333c.8 0 1.333.533 1.333 1.333s-.533 1.333-1.333 1.333h-4v4c0 .8-.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)},mo=({filled:t})=>r.h(L,null,t?r.h(xe,null):r.h(_e,null)),go=({filled:t})=>r.h(L,null,t?r.h(Te,null):r.h(Se,null)),fo=({filled:t})=>r.h(L,null,t?r.h(Me,null):r.h(Fe,null)),ho=({filled:t})=>r.h(L,null,t?r.h(ke,null):r.h(Re,null)),vo=({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)),yo=({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)),bo=({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)),Io=()=>r.h(L,null,r.h(Ke,null)),Co={Cog:mo,Camera:go,Info:fo,ArrowsExpand:ho,X:vo,Volume:yo,Play:bo,Full:Io};var _=Co;var H="modal",Rt=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}},Po=te(Rt),Je=class extends Po{},kt=Je;var wo="controller_button",Ft=class extends E{constructor(e,n){super("button",wo);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 Mt="controller",Lt=class extends E{constructor(e){super("div",Mt,p.style.cls(Mt));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}},Eo=te(Lt),Ge=class extends Eo{},Nt=Ge;var Ot=class{constructor(){this._els=[];this.disableAutoHide=!1;this._controller=new Nt}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)}},Dt=Ot;var ae=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 _o=(t,e)=>{D.debug(`webrtc my ICE candidate:
26
+ ${e.candidate?e.candidate.candidate:"(null)"}`)},xo=(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()},So=(t,e)=>{D.debug("webrtc Connection state change, \u5F53\u524D\u8FDE\u63A5\u72B6\u6001: ",t,t.connectionState)},To=(t,e,n)=>{D.debug("webrtc \u5F53\u524D\u7684 stream: ",e.streams[0]);let o=e.streams[0];n(o)},Ro=(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=>_o(y,h)),y.addEventListener("iceconnectionstatechange",h=>xo(y,h,g)),y.addEventListener("connectionstatechange",h=>So(y,h)),y.addEventListener("track",h=>To(y,h,e)),l&&(yield l(y)),b)return new ae(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 ae(y)}),ko=t=>{if(!t)return;let{pc:e}=t;e.close()},Fo={connect:Ro,disconnect:ko},Xe=Fo;var G=document.documentElement,le="requestFullscreen",ce="exitFullscreen",de="fullscreenElement",ue="onfullscreenchange";if("webkitRequestFullScreen"in G)le="webkitRequestFullScreen",ce="webkitExitFullscreen",de="webkitFullscreenElement",ue="onwebkitfullscreenchange";else if("msRequestFullscreen"in G)le="msRequestFullscreen",ce="msExitFullscreen",de="msFullscreenElement",ue="MSFullscreenChange";else if("mozRequestFullScreen"in G)le="mozRequestFullScreen",ce="mozCancelFullScreen",de="mozFullScreenElement",ue="onmozfullscreenchange";else if(!("requestFullscreen"in G))throw"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Fullscreen API !";function Mo(t=G,e){return t[le](e)}function Lo(){return document[ce]()}function Vt(t){return t===document[de]}function No(t=G,e){return Vt(t)?Lo():Mo(t,e)}function Oo(t,e){let n=()=>{t.onfullscreenchange=null},o=i=>{i.target!==null&&e(Vt(i.target))};return t[ue]=o,{cancel:n}}var Do={toggle:No,watch:Oo},pe=Do;var Vo=({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)),Bt=({list:t,factory:e})=>(t==null?void 0:t.length)?e?r.h(r.Fragment,null,t.map(n=>r.h(Bt,{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(Vo,k({},n)))):null,qe=Bt;var N;(function(o){o.DIRECT="direct",o.PLUGIN="plugin",o.REJECT="reject"})(N||(N={}));var me;(function(s){s.MP4="MP4",s.FLAC="FLAC",s.OGG="OGG",s.WEBM="WEBM",s.AUTO="AUTO"})(me||(me={}));var Qe;(function(e){e.WEBRTC="WEBRTC"})(Qe||(Qe={}));var At="player",Wt=class extends E{constructor(e){super("div",At);this._lastTotalReceivedBytes=0;this._video=new Tt,this._spinner=new _t({spin:!1}),this._mask=new wt({visible:!1}),this._panel=new Dt,this._infoModal=new kt({container:this.el,title:"Info",center:!0,className:`${At}_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 me.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(me),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}pe.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)})}},ge=Wt;var Bo=(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 M.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}`)}}}),Ao=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 M.closeDialogs([h],C)}catch(v){throw a.error(v,"PuPlayer close \u5931\u8D25"),new Error(`PuPlayer close \u5931\u8D25 , ${v.message}`)}}),m=new ge({video:{url:s},pluginOption:{webrtc:{offerParam:{offerToReceiveAudio:i.audio,offerToReceiveVideo:i.video},productRemoteSdp:v=>u(void 0,null,function*(){return Bo(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),pe.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(Qo){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},Wo=Ao;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 fe=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 M.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 Ho=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 ge({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},Ht=Ho;var $o=()=>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}),zo=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 fe(y,n,o,i),{instance:C,element:R}=Ht({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 $o();m.getTracks().forEach(w=>P.addTrack(w,m))}catch(m){I&&I()}})});return{instance:k({},C),element:R}},he=zo;var Uo=(t,e,n)=>u(void 0,null,function*(){let{id:o,index:i}=n||{};return yield M.getDeviceWebrtc({id:o,index:i,sdp:t},e)}),Ko=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:Uo,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}},Jo=Ko;var Go=(t,e,n)=>u(void 0,null,function*(){let{id:o,index:i}=n||{};return yield M.getConferenceWebrtc({id:o,index:i,sdp:t},e)}),Xo=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:Go,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}},qo=Xo;var Ja=M.closeAllStorageDialog;export{qo as Conference,Jo as Intercom,Wo as PuPlayer,fe as RemoteSdpFetcher,Ja as clearAllDialog};
@@ -1,7 +1,5 @@
1
- import { IComponentInstance, Props, SFC } from "./core/types";
1
+ import { EmptyComponentInstance, Props, SFC } from "./core/types";
2
2
  export interface IAppProps extends Props {
3
3
  }
4
- export interface IAppInstace extends IComponentInstance {
5
- }
6
- declare const App: SFC<IAppProps, IAppInstace>;
4
+ declare const App: SFC<IAppProps, EmptyComponentInstance>;
7
5
  export default App;
@@ -9,6 +9,8 @@ export interface IBvWebrtcComponentProps extends Props {
9
9
  muted: boolean;
10
10
  autoPlay: boolean;
11
11
  onConnected?(): any;
12
+ onClose?(): any;
13
+ onDestroy?(): any;
12
14
  onConnectedFailed?(): any;
13
15
  onDisConnected?(): any;
14
16
  onPcEventAdded?(pc: RTCPeerConnection): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { IComponentInstance, Props, RenderTarget, SFC } from "../core/types";
2
- import { IVideoFits } from "./../plugins/video";
2
+ import { IVideoFits } from "../plugins/video";
3
3
  import { IPuOption } from "./types";
4
4
  export interface IPuPlayerProps extends Props {
5
5
  container?: RenderTarget;
@@ -12,6 +12,8 @@ export interface IBvWebrtcCommonProps extends Props {
12
12
  token?: string;
13
13
  apiPrefix?: string;
14
14
  onConnected?(): any;
15
+ onClose?(): any;
16
+ onDestroy?(): any;
15
17
  onConnectedFailed?(): any;
16
18
  onDisConnected?(): any;
17
19
  }
@@ -0,0 +1,4 @@
1
+ declare const customElement: {
2
+ define: (_tag: string) => void;
3
+ };
4
+ export default customElement;
@@ -0,0 +1,22 @@
1
+ import { RenderTarget } from "./types";
2
+ declare function parseHtml(htmlString: string): DocumentFragment;
3
+ declare function create<K extends keyof HTMLElementTagNameMap>(tag: K, className?: string): HTMLElementTagNameMap[K];
4
+ declare function createFragment(): DocumentFragment;
5
+ declare function createHtmlElement(tag: string, className?: string): HTMLElement;
6
+ declare function append<N extends Node>(parent?: N | null, ...children: (N | null)[]): void;
7
+ declare function empty<N extends Node>(parent?: N | null): void;
8
+ declare function replace<N extends Node>(oldNode: N | null, ...newNodes: (N | null)[]): void;
9
+ declare function removeSelf<N extends Node>(el?: N | null): void;
10
+ declare function createByJsx(element: JSX.Element | null): RenderTarget;
11
+ declare const dom: {
12
+ parseHtml: typeof parseHtml;
13
+ create: typeof create;
14
+ createFragment: typeof createFragment;
15
+ createHtmlElement: typeof createHtmlElement;
16
+ createByJsx: typeof createByJsx;
17
+ append: typeof append;
18
+ empty: typeof empty;
19
+ replace: typeof replace;
20
+ removeSelf: typeof removeSelf;
21
+ };
22
+ export default dom;
@@ -1,12 +1,25 @@
1
- import { RenderTarget } from "./types";
1
+ interface INotifierExecutor<P = any> {
2
+ (param?: P): any;
3
+ }
4
+ interface INotifierSubscription<K, P> {
5
+ unSubscribe(name: K, executor: INotifierExecutor<P>): void;
6
+ }
7
+ interface INotifier<K, P = any> {
8
+ publish(name: K, params?: P): void;
9
+ subscribe(name: K, executor: INotifierExecutor<P>): INotifierSubscription<K, P>;
10
+ unSubscribe(name: K, executor: INotifierExecutor<P>): void;
11
+ }
2
12
  export interface IEvent {
3
- readonly name: string;
4
- readonly target: RenderTarget;
13
+ readonly name?: string;
14
+ readonly target?: any;
5
15
  }
6
- export interface IEventHandler<M, K extends keyof M> {
7
- (e: M[K]): any;
16
+ export interface IEventMap {
8
17
  }
9
- export interface IEvents<M> {
10
- on<K extends keyof M>(name: K, handler: IEventHandler<M, K>): void;
11
- trigger<K extends keyof M>(name: K, param: any): void;
18
+ export declare class Events<M extends IEventMap> {
19
+ protected _notifier: INotifier<any, any>;
20
+ constructor();
21
+ addEventListener<K extends keyof M>(name: K, callBack: (event?: M[K]) => any): void;
22
+ removeEventListener<K extends keyof M>(name: K, callBack: (event?: M[K]) => any): void;
23
+ protected dispatch<K extends keyof M>(name: K, event?: M[K]): void;
12
24
  }
25
+ export {};
@@ -0,0 +1,4 @@
1
+ declare const field: {
2
+ createPrefixStorageField: (field: string) => string;
3
+ };
4
+ export default field;
@@ -1,7 +1,24 @@
1
1
  declare const core: {
2
2
  render: (node: import("./types").RenderTarget, container?: import("./types").RenderTarget | undefined, _callBack?: (() => any) | undefined) => void;
3
- cls: (...args: any[]) => string;
3
+ style: {
4
+ cls: (...args: any[]) => string;
5
+ css: (literals: TemplateStringsArray, ...values: (string | number)[]) => string;
6
+ prefixCls: (...args: any[]) => string;
7
+ commonCls: (...args: any[]) => string;
8
+ };
9
+ dom: {
10
+ parseHtml: (htmlString: string) => DocumentFragment;
11
+ create: <K extends keyof HTMLElementTagNameMap>(tag: K, className?: string | undefined) => HTMLElementTagNameMap[K];
12
+ createFragment: () => DocumentFragment;
13
+ createHtmlElement: (tag: string, className?: string | undefined) => HTMLElement;
14
+ createByJsx: (element: JSX.Element<any> | null) => import("./types").RenderTarget;
15
+ append: <N extends Node>(parent?: N | null | undefined, ...children: (N | null)[]) => void;
16
+ empty: <N_1 extends Node>(parent?: N_1 | null | undefined) => void;
17
+ replace: <N_2 extends Node>(oldNode: N_2 | null, ...newNodes: (N_2 | null)[]) => void;
18
+ removeSelf: <N_3 extends Node>(el?: N_3 | null | undefined) => void;
19
+ };
20
+ field: {
21
+ createPrefixStorageField: (field: string) => string;
22
+ };
4
23
  };
5
- export declare const CSS_CLASS_PREFIX: string | undefined;
6
- export declare const STORAGE_FIELD_PREFIX: string | undefined;
7
24
  export default core;
@@ -0,0 +1,8 @@
1
+ import { RenderTarget } from "./types";
2
+ export declare function grow(element: JSX.Element | null, elementFactory?: (element: JSX.Element | null) => JSX.Element | null, xmlns?: string): RenderTarget;
3
+ declare function h<K extends keyof HTMLElementTagNameMap>(type: K | string, elementProps: any, ...childElements: any[]): JSX.Element;
4
+ declare const jsx: {
5
+ h: typeof h;
6
+ Fragment: (props: IJsxProps) => any[] | undefined;
7
+ };
8
+ export default jsx;
@@ -0,0 +1,10 @@
1
+ declare type Text = string | number;
2
+ declare const css: (literals: TemplateStringsArray, ...values: Text[]) => string;
3
+ export { css };
4
+ declare const style: {
5
+ cls: (...args: any[]) => string;
6
+ css: (literals: TemplateStringsArray, ...values: Text[]) => string;
7
+ prefixCls: (...args: any[]) => string;
8
+ commonCls: (...args: any[]) => string;
9
+ };
10
+ export default style;
@@ -1,4 +1,4 @@
1
- export declare type RenderTarget = Element | DocumentFragment | null;
1
+ export declare type RenderTarget = HTMLElement | SVGElement | Text | DocumentFragment | null;
2
2
  export interface Props {
3
3
  children?: RenderTarget;
4
4
  }
@@ -6,6 +6,10 @@ export interface IComponentInstance {
6
6
  render(): RenderTarget;
7
7
  destroy(): void;
8
8
  }
9
+ export declare class EmptyComponentInstance implements IComponentInstance {
10
+ render(): RenderTarget;
11
+ destroy(): void;
12
+ }
9
13
  export declare type ComponetsResult<I> = {
10
14
  instance: I;
11
15
  element: RenderTarget;
@@ -13,3 +17,5 @@ export declare type ComponetsResult<I> = {
13
17
  export interface SFC<T extends Props, I extends IComponentInstance | null> {
14
18
  (props?: T): ComponetsResult<I>;
15
19
  }
20
+ export declare type Constructor<T> = new (...args: any[]) => T;
21
+ export declare type AbstractConstructor<T = object> = abstract new (...args: any[]) => T;
@@ -1 +1 @@
1
- import "./styles/index.scss";
1
+ import "./styles/_index.scss";
@@ -1,4 +1,4 @@
1
- import { CommonInstance } from "./common";
1
+ import { CommonInstance, ICommonInstanceEventMap } from "./common";
2
2
  import { RenderTarget } from "../core/types";
3
3
  import { IDialog } from "../api/dialog";
4
4
  import PlayerPlugin from "../plugins/player";
@@ -13,7 +13,12 @@ export declare class RemoteSdpFetcher<P = any> {
13
13
  fetch(localDescription: RTCSessionDescription): Promise<any>;
14
14
  close(): Promise<void>;
15
15
  }
16
- export declare class BvWebrtcInstance extends CommonInstance<PlayerPlugin> {
16
+ interface ICloseEvent {
17
+ }
18
+ interface IBvWebrtcInstanceEventMap extends ICommonInstanceEventMap {
19
+ close: ICloseEvent;
20
+ }
21
+ export declare class BvWebrtcInstance extends CommonInstance<PlayerPlugin, IBvWebrtcInstanceEventMap> {
17
22
  private _muted;
18
23
  private _videoFit;
19
24
  private _remoteSdpFetcher?;
@@ -36,3 +41,4 @@ export declare class BvWebrtcInstance extends CommonInstance<PlayerPlugin> {
36
41
  close(): Promise<void>;
37
42
  destroy(): void;
38
43
  }
44
+ export {};
@@ -1,10 +1,16 @@
1
+ import { IEvent, Events, IEventMap } from "../core/events";
1
2
  import { IComponentInstance, RenderTarget } from "../core/types";
2
3
  import { IPlugin } from "../plugins/types";
3
4
  export interface ICommonInstance extends IComponentInstance {
4
5
  moveTo(container: RenderTarget, callBack?: () => any): void;
5
6
  getCurrentContainer(): RenderTarget | undefined;
6
7
  }
7
- export declare class CommonInstance<P extends IPlugin> implements ICommonInstance {
8
+ export interface ICommonInstanceDestroyEvent extends IEvent {
9
+ }
10
+ export interface ICommonInstanceEventMap extends IEventMap {
11
+ destroy: ICommonInstanceDestroyEvent;
12
+ }
13
+ export declare class CommonInstance<P extends IPlugin, M extends ICommonInstanceEventMap = any> extends Events<M> implements ICommonInstance {
8
14
  protected _plugin: P;
9
15
  protected _el: RenderTarget;
10
16
  protected _currentContainer?: RenderTarget;
@@ -4,5 +4,5 @@ import Conference, { IConferenceProps, IConferenceInstance } from "./components/
4
4
  import { RemoteSdpFetcher } from './instances/bvWebrtc';
5
5
  import { IPuOption, IConfOption } from "./components/types";
6
6
  declare const clearAllDialog: (token?: string | undefined) => Promise<void>;
7
- import "./styles/index.scss";
7
+ import "./styles/main.scss";
8
8
  export { PuPlayer, Intercom, Conference, IPuPlayerProps, IPuPlayerInstance, IIntercomProps, IIntercomInstance, IConferenceProps, IConferenceInstance, IPuOption, IConfOption, RemoteSdpFetcher, clearAllDialog, };
@@ -0,0 +1,13 @@
1
+ import { IPluginEventMap, Plugin } from "../types";
2
+ interface IControllerButtonPluginEventMap extends IPluginEventMap {
3
+ click: undefined;
4
+ }
5
+ declare class ControllerButtonPlugin extends Plugin<HTMLButtonElement, IControllerButtonPluginEventMap> {
6
+ private _Children;
7
+ title?: string;
8
+ constructor(Children: JSX.Element, title?: string);
9
+ set Children(v: JSX.Element);
10
+ protected beforeDestroy(): void;
11
+ init(): HTMLButtonElement;
12
+ }
13
+ export default ControllerButtonPlugin;
@@ -0,0 +1,13 @@
1
+ import ControllerPlugin from ".";
2
+ import { IPluginEvent, IPluginEventMap } from "../../plugins/types";
3
+ interface IControllerEvent extends IPluginEvent {
4
+ target: ControllerPlugin;
5
+ }
6
+ export interface IControllerPluginEventMap extends IPluginEventMap {
7
+ screenshot: IControllerEvent;
8
+ fullscreen: IControllerEvent;
9
+ information: IControllerEvent;
10
+ volume: IControllerEvent;
11
+ play: IControllerEvent;
12
+ }
13
+ export {};
@@ -0,0 +1,22 @@
1
+ import { Plugin } from "../types";
2
+ import { IControllerPluginEventMap } from "./event";
3
+ import { CanVisibleCtor } from "../mixins/visible";
4
+ import ControllerButtonPlugin from "./button";
5
+ interface IControllerPluginOptions {
6
+ controls?: string[];
7
+ }
8
+ declare class ControllerPluginBase extends Plugin<HTMLDivElement, IControllerPluginEventMap> {
9
+ private _controls;
10
+ PlayButton: ControllerButtonPlugin;
11
+ VolumeButton: ControllerButtonPlugin;
12
+ InformationButton: ControllerButtonPlugin;
13
+ ScreenshotButton: ControllerButtonPlugin;
14
+ FullscreenButton: ControllerButtonPlugin;
15
+ constructor(options?: IControllerPluginOptions);
16
+ protected beforeDestroy(): void;
17
+ init(): HTMLDivElement;
18
+ }
19
+ declare const _mixinsControllerPluginBase: CanVisibleCtor & typeof ControllerPluginBase;
20
+ export default class ControllerPlugin extends _mixinsControllerPluginBase {
21
+ }
22
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function hello(target: any): void;
2
+ export declare function plugin(args?: any[]): (constructor: any) => any;
@@ -0,0 +1,13 @@
1
+ import { Constructor, AbstractConstructor } from "../../core/types";
2
+ interface SimilarPlugin {
3
+ name: string;
4
+ el?: HTMLElement | null;
5
+ show?(): any;
6
+ hide?(): any;
7
+ }
8
+ interface CanVisible {
9
+ visible: boolean;
10
+ }
11
+ export declare type CanVisibleCtor = Constructor<CanVisible> & AbstractConstructor<CanVisible>;
12
+ export default function mixinVisible<T extends Constructor<SimilarPlugin>>(base: T): CanVisibleCtor & T;
13
+ export {};