@besovideo/webrtc-player 0.3.7 → 0.4.1

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.
@@ -1 +1 @@
1
- .bvplayer-common-flex-space{display:inline-block;flex:1}.bvplayer-icon{display:inline-block;height:22px;width:100%;vertical-align:middle}.bvplayer-icon svg{height:100%;width:100%}.bvplayer-modal{position:absolute;top:0;left:0;padding:12px 16px;font-size:14px;border:1px solid #2b303b;border-radius:3px;background:rgba(22,27,29,.8);color:#fff;box-shadow:0 0 20px -6px #000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);overflow:hidden;visibility:hidden;opacity:0;transform:scale(0);will-change:transform,opacity;transition:all .3s cubic-bezier(.785,.135,.15,.86)}.bvplayer-modal.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:scale(1)}.bvplayer-modal--center{top:50%;left:50%;margin:auto;transform:translate(-50%,-50%) scale(0)}.bvplayer-modal--center.bvplayer-common-is-visible{transform:translate(-50%,-50%)}.bvplayer-modal_title-bar{display:flex;justify-content:space-between;margin-bottom:8px;font-size:16px}.bvplayer-modal_title-bar_close{cursor:pointer}.bvplayer-modal_body{padding:8px;overflow:hidden;overflow-y:auto;width:280px;min-height:205px;display:flex;justify-content:center}.bvplayer-spinner{position:absolute;top:0;left:0;height:100%;width:100%}.bvplayer-spinner>span{display:inline-block;position:absolute;top:50%;left:50%;margin:-18px 0 0 -18px;height:36px;width:36px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KICAgICB2aWV3Qm94PSIwIDAgMjQgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICAgICAgPHJlY3QgeD0iMCIgeT0iNy42NDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNC43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMHMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iaGVpZ2h0IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iMTA7IDIwOyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8L3JlY3Q+DQogICAgPHJlY3QgeD0iOCIgeT0iNS4xNDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxOS43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJoZWlnaHQiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgMjA7IDEwIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4NCiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjAuMTVzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICA8cmVjdCB4PSIxNiIgeT0iNy4zNTg0IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNS4yODMyIiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIg0KICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyAyMDsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgNTsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICAgIDwvc3ZnPg==);mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KICAgICB2aWV3Qm94PSIwIDAgMjQgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICAgICAgPHJlY3QgeD0iMCIgeT0iNy42NDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNC43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMHMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iaGVpZ2h0IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iMTA7IDIwOyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8L3JlY3Q+DQogICAgPHJlY3QgeD0iOCIgeT0iNS4xNDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxOS43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJoZWlnaHQiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgMjA7IDEwIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4NCiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjAuMTVzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICA8cmVjdCB4PSIxNiIgeT0iNy4zNTg0IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNS4yODMyIiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIg0KICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyAyMDsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgNTsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICAgIDwvc3ZnPg==)}.bvplayer-spinner>span svg{height:100%}.bvplayer-mask{height:100%;width:100%;position:absolute;top:0;left:0;display:grid;align-content:center;justify-content:center;place-content:center;background-color:#000;color:#fff;font-size:14px}.bvplayer-slider{cursor:pointer;position:relative;width:100%;height:3px;line-height:3px;background:#aaa;transition:all .3s ease-in-out}.bvplayer-slider_inner{position:absolute;bottom:0;left:0;height:100%;transition:all .1s ease;background:#fff}.bvplayer-slider_thumb{cursor:pointer;position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;transition:all .3s ease-in-out;background:#fff}.bvplayer-slider_suffix{position:absolute;visibility:visible;display:inline-block;width:calc(100% + 28px);text-align:right;color:#fff;opacity:.8;font-size:12px}.bvplayer-controller{position:absolute;bottom:0;left:0;right:0;width:100%;height:98px;color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden;opacity:0;transform:translateY(100%);will-change:visibility,opacity,transform;transition:all .3s cubic-bezier(.455,.03,.515,.955)}.bvplayer-controller.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:translateY(0)}.bvplayer-controller_mask{position:absolute;bottom:0;height:100%;width:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.bvplayer-controller_inner{position:absolute;bottom:0;left:0;right:0;width:100%;height:41px;padding:0 20px;display:flex;align-items:stretch;justify-content:space-between}.bvplayer-controller_inner_bar{display:block}.bvplayer-controller_inner_bar *{vertical-align:middle}.bvplayer-controller_inner_left{cursor:default}.bvplayer-controller_inner_right{cursor:default}.bvplayer-controller_button{cursor:pointer;display:inline-block;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:36px;height:100%;border:none;outline:none;padding:0;background:none;color:inherit}.bvplayer-controller_button:not(:last-child){margin-right:8px}.bvplayer-controller_button>*{transition:all .2s ease-in-out;opacity:.8}.bvplayer-controller_button:hover>*{opacity:1}.bvplayer-controller_volume{display:inline-block}.bvplayer-controller_volume--active .bvplayer-slider,.bvplayer-controller_volume:hover .bvplayer-slider{width:45px!important}.bvplayer-controller_volume--active .bvplayer-slider_thumb,.bvplayer-controller_volume:hover .bvplayer-slider_thumb{transform:scale(1)!important}.bvplayer-controller_volume--active .bvplayer-slider_suffix,.bvplayer-controller_volume:hover .bvplayer-slider_suffix{visibility:visible}.bvplayer-controller_volume .bvplayer-controller_button{margin-right:5px}.bvplayer-controller_volume .bvplayer-slider{display:inline-block;width:0}.bvplayer-controller_volume .bvplayer-slider_thumb{transform:scale(0)}.bvplayer-controller_volume .bvplayer-slider_suffix{visibility:hidden}.bvplayer-video{display:block;pointer-events:none;box-sizing:border-box;width:100%;height:100%}.bvplayer-player{position:relative;height:100%;width:100%;background-color:#000;overflow:hidden}.bvplayer-player_info-modal_section{margin-bottom:16px}.bvplayer-player_info-modal_section_title{display:inline-block;font-weight:bold;font-size:12px;margin-bottom:8px}.bvplayer-player_info-modal_list{font-size:12px}.bvplayer-player_info-modal_list_item:not(:last-child){margin-bottom:8px}.bvplayer-player_info-modal_list_item_label{display:inline-block;width:90px;margin-right:14px;text-indent:-99em;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:top}.bvplayer-player_info-modal_list_item_value{margin-right:8px;white-space:normal;word-break:break-all}
1
+ .bvplayer-common-flex-space{display:inline-block;flex:1}.bvplayer-icon{display:inline-block;height:22px;width:100%;vertical-align:middle}.bvplayer-icon svg{height:100%;width:100%}.bvplayer-modal{position:absolute;top:0;left:0;padding:12px 16px;font-size:14px;border:1px solid #2b303b;border-radius:3px;background:rgba(22,27,29,.8);color:#fff;box-shadow:0 0 20px -6px #000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);overflow:hidden;visibility:hidden;opacity:0;transform:scale(0);will-change:transform,opacity;transition:all .3s cubic-bezier(.6,-.28,.735,.045)}.bvplayer-modal.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:scale(1);transition:all .2s cubic-bezier(.785,.135,.15,.86)}.bvplayer-modal--center{top:50%;left:50%;margin:auto;transform:translate(-50%,-50%) scale(0)}.bvplayer-modal--center.bvplayer-common-is-visible{transform:translate(-50%,-50%)}.bvplayer-modal_title-bar{display:flex;justify-content:space-between;margin-bottom:8px;font-size:16px}.bvplayer-modal_title-bar_close{cursor:pointer}.bvplayer-modal_body{padding:8px;overflow:hidden;overflow-y:auto}.bvplayer-spinner{position:absolute;top:0;left:0;height:100%;width:100%}.bvplayer-spinner>span{display:inline-block;position:absolute;top:50%;left:50%;margin:-18px 0 0 -18px;height:36px;width:36px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KICAgICB2aWV3Qm94PSIwIDAgMjQgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICAgICAgPHJlY3QgeD0iMCIgeT0iNy42NDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNC43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMHMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iaGVpZ2h0IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iMTA7IDIwOyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8L3JlY3Q+DQogICAgPHJlY3QgeD0iOCIgeT0iNS4xNDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxOS43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJoZWlnaHQiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgMjA7IDEwIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4NCiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjAuMTVzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICA8cmVjdCB4PSIxNiIgeT0iNy4zNTg0IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNS4yODMyIiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIg0KICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyAyMDsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgNTsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICAgIDwvc3ZnPg==);mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KICAgICB2aWV3Qm94PSIwIDAgMjQgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICAgICAgPHJlY3QgeD0iMCIgeT0iNy42NDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNC43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMHMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iaGVpZ2h0IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iMTA7IDIwOyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8L3JlY3Q+DQogICAgPHJlY3QgeD0iOCIgeT0iNS4xNDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxOS43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJoZWlnaHQiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgMjA7IDEwIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4NCiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjAuMTVzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICA8cmVjdCB4PSIxNiIgeT0iNy4zNTg0IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNS4yODMyIiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIg0KICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyAyMDsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgNTsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICAgIDwvc3ZnPg==)}.bvplayer-spinner>span svg{height:100%}.bvplayer-mask{height:100%;width:100%;position:absolute;top:0;left:0;display:grid;align-content:center;justify-content:center;place-content:center;background-color:#000;color:#fff;font-size:14px}.bvplayer-slider{cursor:pointer;position:relative;width:100%;height:3px;line-height:3px;background:#aaa;transition:all .3s ease-in-out}.bvplayer-slider_inner{position:absolute;bottom:0;left:0;height:100%;transition:all .1s ease;background:#fff}.bvplayer-slider_thumb{cursor:pointer;position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;transition:all .3s ease-in-out;background:#fff}.bvplayer-slider_suffix{position:absolute;visibility:visible;display:inline-block;width:calc(100% + 28px);text-align:right;color:#fff;opacity:.8;font-size:12px}.bvplayer-controller{position:absolute;bottom:0;left:0;right:0;width:100%;height:98px;color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden;opacity:0;transform:translateY(100%);will-change:visibility,opacity,transform;transition:all .3s cubic-bezier(.455,.03,.515,.955)}.bvplayer-controller.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:translateY(0)}.bvplayer-controller_mask{position:absolute;bottom:0;height:100%;width:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.bvplayer-controller_inner{position:absolute;bottom:0;left:0;right:0;width:100%;height:41px;padding:0 20px;display:flex;align-items:stretch;justify-content:space-between}.bvplayer-controller_inner_bar{display:block}.bvplayer-controller_inner_bar *{vertical-align:middle}.bvplayer-controller_inner_left{cursor:default}.bvplayer-controller_inner_right{cursor:default}.bvplayer-controller_button{cursor:pointer;display:inline-block;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:36px;height:100%;border:none;outline:none;padding:0;background:none;color:inherit}.bvplayer-controller_button:not(:last-child){margin-right:8px}.bvplayer-controller_button>*{transition:all .2s ease-in-out;opacity:.8}.bvplayer-controller_button:hover>*{opacity:1}.bvplayer-controller_volume{display:inline-block}.bvplayer-controller_volume--active .bvplayer-slider,.bvplayer-controller_volume:hover .bvplayer-slider{width:45px!important}.bvplayer-controller_volume--active .bvplayer-slider_thumb,.bvplayer-controller_volume:hover .bvplayer-slider_thumb{transform:scale(1)!important}.bvplayer-controller_volume--active .bvplayer-slider_suffix,.bvplayer-controller_volume:hover .bvplayer-slider_suffix{visibility:visible}.bvplayer-controller_volume .bvplayer-controller_button{margin-right:5px}.bvplayer-controller_volume .bvplayer-slider{display:inline-block;width:0}.bvplayer-controller_volume .bvplayer-slider_thumb{transform:scale(0)}.bvplayer-controller_volume .bvplayer-slider_suffix{visibility:hidden}.bvplayer-video{position:absolute;display:block;pointer-events:none;box-sizing:border-box;width:100%;height:100%}.bvplayer-player{position:relative;height:100%;width:100%;background-color:#000;overflow:hidden}.bvplayer-player_info-modal .bvplayer-modal_body{width:280px;min-height:205px;display:flex;justify-content:center}.bvplayer-player_info-modal_section{margin-bottom:16px}.bvplayer-player_info-modal_section_title{display:inline-block;font-weight:bold;font-size:12px;margin-bottom:8px}.bvplayer-player_info-modal_list{font-size:12px}.bvplayer-player_info-modal_list_item:not(:last-child){margin-bottom:8px}.bvplayer-player_info-modal_list_item_label{display:inline-block;width:90px;margin-right:14px;text-indent:-99em;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:top}.bvplayer-player_info-modal_list_item_value{margin-right:8px;white-space:normal;word-break:break-all}
@@ -1,4 +1,4 @@
1
- var bvPlayerCore=(()=>{var nt=Object.defineProperty,Zt=Object.defineProperties;var Yt=Object.getOwnPropertyDescriptors;var ot=Object.getOwnPropertySymbols;var jt=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable;var rt=(t,e,n)=>e in t?nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e)=>{for(var n in e||(e={}))jt.call(e,n)&&rt(t,n,e[n]);if(ot)for(var n of ot(e))en.call(e,n)&&rt(t,n,e[n]);return t},U=(t,e)=>Zt(t,Yt(e));var tn=(t,e)=>{for(var n in e)nt(t,n,{get:e[n],enumerable:!0})};var p=(t,e,n)=>new Promise((o,i)=>{var s=c=>{try{f(n.next(c))}catch(m){i(m)}},a=c=>{try{f(n.throw(c))}catch(m){i(m)}},f=c=>c.done?o(c.value):Promise.resolve(c.value).then(s,a);f((n=n.apply(t,e)).next())});var rr={};tn(rr,{Conference:()=>Qt,Intercom:()=>qt,PuPlayer:()=>Gt,RemoteSdpFetcher:()=>se,clearAllDialog:()=>or});var nn="production",on="@besovideo/webrtc-player",rn="0.3.7",d={NODE_ENV:nn,SH_LIB_NAME:on,SH_LIB_VERSION:rn};var sn=Object.defineProperty,ln=Object.defineProperties,an=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable,st=(t,e,n)=>e in t?sn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Q=(t,e)=>{for(var n in e||(e={}))cn.call(e,n)&&st(t,n,e[n]);if(it)for(var n of it(e))dn.call(e,n)&&st(t,n,e[n]);return t},un=(t,e)=>ln(t,an(e)),M;(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"})(M||(M={}));var lt=class{constructor(){this.colors=M,this.shapes={slider:new at}}},at=class{constructor(){}title(t=""){return Z`
1
+ var bvPlayerCore=(()=>{var nt=Object.defineProperty,Yt=Object.defineProperties;var jt=Object.getOwnPropertyDescriptors;var ot=Object.getOwnPropertySymbols;var en=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable;var rt=(t,e,n)=>e in t?nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e)=>{for(var n in e||(e={}))en.call(e,n)&&rt(t,n,e[n]);if(ot)for(var n of ot(e))tn.call(e,n)&&rt(t,n,e[n]);return t},U=(t,e)=>Yt(t,jt(e));var nn=(t,e)=>{for(var n in e)nt(t,n,{get:e[n],enumerable:!0})};var p=(t,e,n)=>new Promise((o,i)=>{var s=c=>{try{f(n.next(c))}catch(m){i(m)}},a=c=>{try{f(n.throw(c))}catch(m){i(m)}},f=c=>c.done?o(c.value):Promise.resolve(c.value).then(s,a);f((n=n.apply(t,e)).next())});var rr={};nn(rr,{Conference:()=>Zt,Intercom:()=>Qt,PuPlayer:()=>Xt,RemoteSdpFetcher:()=>se,clearAllDialog:()=>or});var on="production",rn="@besovideo/webrtc-player",sn="0.4.1",d={NODE_ENV:on,SH_LIB_NAME:rn,SH_LIB_VERSION:sn};var ln=Object.defineProperty,an=Object.defineProperties,cn=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable,st=(t,e,n)=>e in t?ln(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Q=(t,e)=>{for(var n in e||(e={}))dn.call(e,n)&&st(t,n,e[n]);if(it)for(var n of it(e))un.call(e,n)&&st(t,n,e[n]);return t},pn=(t,e)=>an(t,cn(e)),M;(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"})(M||(M={}));var lt=class{constructor(){this.colors=M,this.shapes={slider:new at}}},at=class{constructor(){}title(t=""){return Z`
2
2
  color: ${t};
3
3
  border-left: 3px solid ${t};
4
4
  padding: 2px;
@@ -11,7 +11,7 @@ var bvPlayerCore=(()=>{var nt=Object.defineProperty,Zt=Object.defineProperties;v
11
11
  padding: 2px 5px;
12
12
  border-radius: 3px;
13
13
  text-shadow: 0 0 2px ${n};
14
- `}},Z=(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},J;(function(t){t[t.title=1]="title",t[t.message=2]="message",t[t.message_button=3]="message_button"})(J||(J={}));var ae=({color:t},e=new at,n)=>{switch(n){case 1:return e.title(t);case 2:return e.message(t);case 3:return e.message_button();default:return""}},pn=class{constructor(t){let e={log:window.console.log,enable:!0};this._option=un(Q({},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}},ct=class{constructor(t){let e={enable:!0,log:window.console.log,level:39,shape:new lt().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}},mn=class extends pn{constructor(t){super(t||new ct);this.loggerOption=Q(Q({},new ct),t)}setLoggerOption(t){let e=Q(Q({},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)}},dt;(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"})(dt||(dt={}));var A={debug:{name:"debug",title:" Debug :",color:M.lime,level:3},http:{name:"http",title:" Http :",color:M.weakBlue,level:3},api:{name:"api",title:" Api :",color:M.cyan,level:3},service:{name:"service",title:" Service :",color:M.purple,level:2},interval:{name:"interval",title:" Interval :",color:M.pink,level:1},warn:{name:"warn",title:" WARN :",color:M.orange,level:1},error:{name:"error",title:" ERR :",color:M.red,level:0},key:{name:"key",title:" Key :",color:M.darkPurple,level:0}},Ce=class extends mn{constructor(){super(...arguments);this.error=(t,...e)=>{this.formatShapeLog(A.error,`${t instanceof Error?t.stack:t}
14
+ `}},Z=(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},J;(function(t){t[t.title=1]="title",t[t.message=2]="message",t[t.message_button=3]="message_button"})(J||(J={}));var ae=({color:t},e=new at,n)=>{switch(n){case 1:return e.title(t);case 2:return e.message(t);case 3:return e.message_button();default:return""}},mn=class{constructor(t){let e={log:window.console.log,enable:!0};this._option=pn(Q({},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}},ct=class{constructor(t){let e={enable:!0,log:window.console.log,level:39,shape:new lt().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}},fn=class extends mn{constructor(t){super(t||new ct);this.loggerOption=Q(Q({},new ct),t)}setLoggerOption(t){let e=Q(Q({},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)}},dt;(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"})(dt||(dt={}));var A={debug:{name:"debug",title:" Debug :",color:M.lime,level:3},http:{name:"http",title:" Http :",color:M.weakBlue,level:3},api:{name:"api",title:" Api :",color:M.cyan,level:3},service:{name:"service",title:" Service :",color:M.purple,level:2},interval:{name:"interval",title:" Interval :",color:M.pink,level:1},warn:{name:"warn",title:" WARN :",color:M.orange,level:1},error:{name:"error",title:" ERR :",color:M.red,level:0},key:{name:"key",title:" Key :",color:M.darkPurple,level:0}},Ce=class extends fn{constructor(){super(...arguments);this.error=(t,...e)=>{this.formatShapeLog(A.error,`${t instanceof Error?t.stack:t}
15
15
  `,...e)},this.key=(t,...e)=>{let n=A.key;this.formatLog(n.level,n.title,t.toUpperCase(),ae({color:n.color},this.getLoggerOption().shape,J.title),ae({},this.getLoggerOption().shape,J.message_button),...e)},this.version=(t="",e,...n)=>{this.formatLog(0,t.toUpperCase(),e,Z`
16
16
  background: linear-gradient(to right, #009fff, #ec2f4b);
17
17
  color: white;
@@ -22,5 +22,5 @@ var bvPlayerCore=(()=>{var nt=Object.defineProperty,Zt=Object.defineProperties;v
22
22
  background-color: ${M.darkPurple};
23
23
  color: white;
24
24
  padding: 2px 5px;
25
- `,...n)}}formatShapeLog({level:t,title:e,color:n},o,...i){this.formatLog(t,e,o,ae({color:n},this.getLoggerOption().shape,J.title),ae({color:n},this.getLoggerOption().shape,J.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)}},ar=new lt,fn=new Ce,gn=fn,V=gn;var ut=class extends Ce{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)}}},Pe=new ut;Pe.debug("player-core env:",d);Pe.version(d.SH_LIB_NAME,d.SH_LIB_VERSION||"");var l=Pe;var hn=Array.isArray,vn=t=>t!==t,pt=t=>typeof t=="number",mt=t=>typeof t=="string",yn=t=>pt(t)||mt(t),bn=t=>typeof t=="function",In=t=>typeof t=="undefined",Cn=t=>t?!1:!!(t!=null?t:!0),Pn={isArr:hn,baseIsNaN:vn,isString:mt,isNumber:pt,isText:yn,isFn:bn,isUndefined:In,isNullOrUndefined:Cn},R=Pn;function wn(t,e=[]){let n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function En(t,e,n){let o=n-1,i=t.length;for(;++o<i;)if(t[o]===e)return o;return-1}function _n(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 Sn(t,e,n){return e===e?En(t,e,n):_n(t,R.baseIsNaN,n)}function xn(t,e){let n=-1,o=e.length,i=t;for(t===e&&(e=wn(e));++n<o;){let s=0,a=e[n],f=a;for(;(s=Sn(i,f,s))>-1;)i!==t&&[].splice.call(i,s,1),[].splice.call(t,s,1)}return t}var Tn=t=>t?R.isArr(t)?t:[t]:[],Mn=(t,e)=>!t||!t.length||!e||!e.length?t:xn(t,e),Ln=(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){l.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)})},Rn=(t,e,n)=>Math.max(Math.min(t,n),e),kn={pullAll:Mn,toArray:Tn,screenshot:Ln,restrict:Rn},D=kn;function Fn(t){return t!=null&&t!==!0&&t!==!1}function ft(t,e=[]){return t.forEach(n=>{R.isArr(n)?ft(n,e):Fn(n)&&e.push(R.isText(n)?On(n):n)}),e}function Nn(t={},e){if(!e)return;Object.keys(t).forEach(o=>{if(o==="children")return;let i=t[o];R.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 On(t){return{type:"",props:{nodeValue:String(t)+""}}}function Vn(t,e){return t===""?document.createTextNode(""):e?document.createElementNS(e,t):document.createElement(t)}function Y(t,e,n){let o=e?e(t):t;if(!o)return null;if(R.isArr(o)){let a=document.createDocumentFragment();return o.forEach(f=>{let c=Y(f,e);c&&a.appendChild(c)}),a}let{props:i,type:s}=o;if(!i)return o instanceof Node||o instanceof Text?(l.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):(l.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(R.isString(s)){let a=Vn(s,i.xmlns||n);return Nn(i,a),(i.children||[]).forEach(c=>{let m=Y(c,e,i.xmlns);!m||a.appendChild(m)}),a}if(R.isFn(s)){let a=s(i);return Y(a,e)}return null}function Dn(t,e,...n){return e=e||{},n=ft(D.toArray(e.children||n)),e.children=n,{type:t,props:e}}var Bn=t=>t.children,An={h:Dn,Fragment:Bn},r=An;var we=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)},gt=t=>{let e=typeof t=="number"?t:we(t),n=we();return e-n},Hn=t=>gt(t)>0,Wn={getUTCSecond:we,pastNow:gt,compare:Hn},Ee=Wn;var ht=(t,e,n)=>{let o={value:e,expire:n},i=JSON.stringify(o);return localStorage.setItem(t,i),o},$n=(t,e,n)=>{let i=Ee.getUTCSecond()+n;return ht(t,e,i)},zn=(t,e=!1)=>{let n=localStorage.getItem(t);if(!n)return null;try{let o=JSON.parse(n);return e?o:o.expire?Ee.compare(o.expire)?o.value:null:o.value}catch(o){l.error(o,n,"Storage\u8BFB\u53D6\u6570\u636E\u65F6\uFF0C JSON\u89E3\u6790\u51FA\u9519")}},Un=t=>localStorage.removeItem(t),Jn={set:ht,setTimeout:$n,get:zn,remove:Un},B=Jn;var ce;(function(n){n.GET="GET",n.POST="POST"})(ce||(ce={}));var vt=(t,e)=>p(void 0,null,function*(){let n=new AbortController;if(e.signal&&e.signal.addEventListener("abort",()=>{n.abort()}),e.timeout){let a=setTimeout(()=>{n.abort()},e.timeout);n.signal.addEventListener("abort",()=>{clearTimeout(a)})}let o=e.bodyData,i=o&&(typeof o=="object"?JSON.stringify(o):o),s={credentials:"same-origin",method:e.method,headers:new Headers(L({},e.headers)),signal:n.signal};i&&(s.body=i),l.http("\u53D1\u9001\u8BF7\u6C42\uFF1A",t,U(L({},s),{body:o}));try{let a=yield fetch(t,s);if(l.http("\u8BF7\u6C42\u54CD\u5E94\uFF1A",t,a,yield a.clone().text()),a.ok||a.status>=200&&a.status<300){let f=a.headers.get("content-type")||"";if(/application\/json/i.test(f))return yield a.json()}else throw new Error(`${a.status} ${a.statusText}`)}catch(a){if(a.name==="AbortError"){l.http("\u8BF7\u6C42\u53D6\u6D88\uFF1A",s);return}throw a}}),Kn=(t,e,n)=>p(void 0,null,function*(){let o=e?e.toString():"";return yield vt(t+o,{method:ce.GET,headers:n==null?void 0:n.headers})}),Gn=(t,e,n)=>p(void 0,null,function*(){return yield vt(t,{method:ce.POST,headers:L({"Content-Type":"application/json;charset=UTF-8"},n==null?void 0:n.headers),bodyData:e})}),Xn={get:Kn,post:Gn},de=Xn;var yt={BVCSP_V1:{path:"/bvcsp/v1",prefix:""}},_e=t=>{let e=yt[t];return e.prefix+e.path},qn=(t,e)=>{let n=yt[t];return n.prefix=e||"",_e(t)},j={setApiPrefix:qn,getApiURL:_e,bvscpV1:()=>_e("BVCSP_V1")},ee=t=>{j.setApiPrefix("BVCSP_V1",t)};function Qn(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}function Zn(t,e,n){if(!t)return;let o=document.createDocumentFragment();o.appendChild(t);let i=Qn(e);!i||(i.appendChild(o),n==null||n())}var bt=Zn;var ue=(...t)=>{let e=[];for(let n=0;n<t.length;n++){let o=t[n];if(!o)continue;let i=typeof o;if(R.isText(o))e.push(o);else if(Array.isArray(o)){if(o.length){let s=ue(...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(" ")},It=t=>t?t.replace(/\s*(;|\{|\})+\s*[\n\r]*/g,"$1"):"",Yn=(t,...e)=>{if(!e.length)return It(t[0]);let n="";return e.forEach((o,i)=>{n+=t[i]+o}),n+=t[t.length-1],It(n)},Se="bvplayer-",jn="common-",Ct=t=>new RegExp(Se).test(t),eo=(...t)=>ue(t).split(" ").map(e=>Ct(e)?e:Se+e).join(" "),to=(...t)=>ue(t).split(" ").map(e=>Ct(e)?e:Se+jn+e).join(" ");var no={cls:ue,css:Yn,prefixCls:eo,commonCls:to},te=no;function oo(t){return document.createRange().createContextualFragment(t)}function ro(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function xe(){return document.createDocumentFragment()}function io(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function so(t,...e){if(!t)return;let n=xe();n.append(...e.filter(o=>o)),t.appendChild(n)}function lo(t){if(!!t)if(t instanceof Element){t.innerHTML="";return}else for(;t.firstChild;)t.removeChild(t.firstChild)}function ao(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=xe();o.append(...n),t.parentNode.replaceChild(o,t)}}function co(t){var e;if(!!t)if(t instanceof Element){t.remove();return}else(e=t.parentNode)==null||e.removeChild(t)}function uo(t){if(!t)return 0;let e=t.offsetLeft,n=t.offsetParent;if(n instanceof HTMLElement){let o=document.body.scrollLeft+document.documentElement.scrollLeft;if(!document.fullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement)for(;n!==null;)e+=n.offsetLeft,n=n.offsetParent;else for(;n!==null&&n!==t;)e+=n.offsetLeft,n=n.offsetParent;return e-o}return 0}function po(t){if(!t||!t.props)return t;let{props:e}=t;return e.withCommonNamespace&&(e.className=te.commonCls(e.className),delete e.withCommonNamespace),e.withNamespace&&(e.className=te.prefixCls(e.className),delete e.withNamespace),t}function mo(t){return t?Y(t,po):null}var fo={parseHtml:oo,create:ro,createFragment:xe,createHtmlElement:io,createByJsx:mo,append:so,empty:lo,replace:ao,removeSelf:co,getElementViewLeft:uo},Pt=fo;var go="bvplayerCore",ho=t=>go+t,vo={createPrefixStorageField:ho},wt=vo;var yo={render:bt,style:te,dom:Pt,field:wt},u=yo;var H=u.field.createPrefixStorageField("DialogIds"),bo=(t,e)=>p(void 0,null,function*(){var a;let n={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield de.post(`${j.bvscpV1()}/dialog/device/webrtc`,o,{headers:n});if(l.api("\u8BBE\u5907\u97F3\u89C6\u9891\u6D41 webrtc\u65B9\u5F0F\u6253\u5F00dialog: ",{params:o,resData:i}),!i||i.code!==0||!((a=i.data)==null?void 0:a.dialogid))throw new Error(`\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25\uFF0C ${i.msg}`);let{data:s}=i;if(s.dialogid){let f=B.get(H)||[];f.push(s.dialogid),B.set(H,f)}return{dialogId:s.dialogid,sdp:s.sdp}}),Io=(t,e)=>p(void 0,null,function*(){var f;let n={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield de.post(`${j.bvscpV1()}/dialog/conference/webrtc`,o,{headers:n});if(l.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,a=B.get(H)||[];return a.push(s.dialogid),B.set(H,a),{dialogId:s.dialogid,sdp:s.sdp}}),Co=(t,e)=>p(void 0,null,function*(){if(!t)return;let n={Authorization:e||""};return l.api("\u5173\u95EDdialog\uFF1A",t),yield de.post(`${j.bvscpV1()}/dialog/close/${t}`,{},{headers:n})}),Et=(t,e)=>p(void 0,null,function*(){let n=B.get(H)||[];D.pullAll(n,t),B.set(H,n,0);let i=(yield Promise.allSettled(t.map(s=>Co(s,e)))).filter(s=>s.status==="rejected");i&&i.length>0&&l.error(new Error(`"\u5173\u95ED\u5B58\u50A8\u7684dialog\u65F6\u5931\u8D25\uFF1A", ${i}`))}),Po=t=>p(void 0,null,function*(){let e=B.get(H);!e||e.length<1||(B.remove(H),yield Et(e,t))}),wo={getDeviceWebrtc:bo,getConferenceWebrtc:Io,closeDialogs:Et,closeAllStorageDialog:Po},F=wo;var _t=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 a=o[s];a&&a(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))}},ne=class{constructor(){this._notifier=new _t}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 ne{constructor(e,n,o){super();this.name="";let i=n.trim().toLowerCase(),s=o?o.trim():i,a=u.dom.create(e,u.style.prefixCls(s));this.name=i,this.el=a}empty(){u.dom.empty(this.el)}unmount(){var e;l.debug("unmount",this.el,(e=this.el)==null?void 0:e.parentNode),u.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;l.debug("destroy complete",this)}}getEl(){return this.el}};var St=class extends E{constructor(e){super("div","mask",u.style.cls("mask"));this._visible=!!(e==null?void 0:e.visible),this._text=e==null?void 0:e.text,this._textEl=u.dom.create("span",u.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(){l.debug("mask visible: ",this._visible);let e=this.el;return e.style.display=this._visible?"block":"none",this._textEl.textContent=this._text||"",u.dom.append(e,this._textEl),e}},xt=St;var Tt=class extends E{constructor(e){super("div","spinner",u.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(){l.debug("spinner spin: ",this._spin);let e=this.el;e.style.display=this._spin?"block":"none";let n=u.dom.create("span");return n.style.backgroundColor="#FFF",u.dom.append(e,n),e}},Mt=Tt;var Lt={contain:"contain",fill:"fill"},Rt=class extends E{constructor(e){super("video","video",u.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)||Lt.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 volume(e){let n=this.el;n.volume=Number(e)}get volume(){var e;return Number((e=this.el)==null?void 0:e.volume)}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=Lt[e],this.el.style.objectFit=this._fit}getVideoFit(){return this._fit}init(){l.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=>{l.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 p(this,null,function*(){let e=this.el;try{l.debug("video \u5C1D\u8BD5\u64AD\u653E"),yield e.play()}catch(n){l.error(n,"video \u64AD\u653E \u5931\u8D25")}})}beforeDestroy(){}},kt=Rt;function oe(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=u.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 Te({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}function 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:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z","clip-rule":"evenodd"}))}function 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:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"}))}function Re({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M4 5a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2V7a2 2 0 00-2-2h-1.586a1 1 0 01-.707-.293l-1.121-1.121A2 2 0 0011.172 3H8.828a2 2 0 00-1.414.586L6.293 4.707A1 1 0 015.586 5H4zm6 9a3 3 0 100-6 3 3 0 000 6z","clip-rule":"evenodd"}))}function ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"}))}function Fe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M3 4a1 1 0 011-1h4a1 1 0 010 2H6.414l2.293 2.293a1 1 0 01-1.414 1.414L5 6.414V8a1 1 0 01-2 0V4zm9 1a1 1 0 110-2h4a1 1 0 011 1v4a1 1 0 11-2 0V6.414l-2.293 2.293a1 1 0 11-1.414-1.414L13.586 5H12zm-9 7a1 1 0 112 0v1.586l2.293-2.293a1 1 0 011.414 1.414L6.414 15H8a1 1 0 110 2H4a1 1 0 01-1-1v-4zm13-1a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 110-2h1.586l-2.293-2.293a1 1 0 011.414-1.414L15 13.586V12a1 1 0 011-1z","clip-rule":"evenodd"}))}function Ne({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Oe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"}))}function 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:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}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:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"}))}function Be({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"}))}function Ae({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"}))}function 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:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}))}function We({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z","clip-rule":"evenodd"}))}function $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:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z","clip-rule":"evenodd"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"}))}function ze({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM12.293 7.293a1 1 0 011.414 0L15 8.586l1.293-1.293a1 1 0 111.414 1.414L16.414 10l1.293 1.293a1 1 0 01-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 01-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 010-1.414z","clip-rule":"evenodd"}))}function Ue({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Je({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"}))}function Ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Ge({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"}))}function Xe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 32 33",fill:"currentColor"},r.h("path",{d:"M6.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v4h4c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333zM30.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h4v-4c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM30.667 12c-0.8 0-1.333-0.533-1.333-1.333v-4h-4c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM1.333 12c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-4v4c0 0.8-0.533 1.333-1.333 1.333z"}))}var N=({children:t,className:e})=>{let n=u.style.cls(["icon",e]);return r.h("span",{className:n,withNamespace:!0},t)},Eo=({filled:t})=>r.h(N,null,t?r.h(Me,null):r.h(Te,null)),_o=({filled:t})=>r.h(N,null,t?r.h(Re,null):r.h(Le,null)),So=({filled:t})=>r.h(N,null,t?r.h(Oe,null):r.h(Ne,null)),xo=({filled:t})=>r.h(N,null,t?r.h(Fe,null):r.h(ke,null)),To=({filled:t,circle:e})=>e?r.h(N,null,t?r.h(De,null):r.h(Ve,null)):r.h(N,null,t?r.h(Ae,null):r.h(Be,null)),Mo=({filled:t,off:e})=>e?r.h(N,null,t?r.h(ze,null):r.h($e,null)):r.h(N,null,t?r.h(We,null):r.h(He,null)),Lo=({filled:t,off:e})=>e?r.h(N,null,t?r.h(Ge,null):r.h(Ke,null)):r.h(N,null,t?r.h(Je,null):r.h(Ue,null)),Ro=()=>r.h(N,null,r.h(Xe,null)),ko={Cog:Eo,Camera:_o,Info:So,ArrowsExpand:xo,X:To,Volume:Mo,Play:Lo,Full:Ro};var _=ko;var W="modal",Ft=class extends E{constructor(e){super("div",W,u.style.cls([W,e.className,{[`${W}--center`]:e.center}]));this.container=e.container,this.title=e.title,this._content=e.content||u.dom.create("div","test"),this._center=!!e.center}set content(e){let n=u.dom.createByJsx(e);l.debug("modal update content",n,this._content),u.dom.replace(this._content,n),this._content=n}show(){var e;(e=this.el)==null||e.classList.toggle(u.style.prefixCls(`${W}--center`),!!this._center),u.dom.append(this.container,this.el)}hide(){}clear(){!this.el||(this.el.innerHTML="")}beforeDestroy(){}init(){this.clear(),l.debug("\u6E32\u67D3ModalPlugin \u5F39\u7A97\u5BF9\u8C61",this,this.el);let e=this.el,n=u.dom.createByJsx(r.h(r.Fragment,null,r.h("div",{className:`${W}_title-bar`,onClick:()=>this.dispatch("hide"),withNamespace:!0},r.h("span",{className:`${W}_title-bar_title`,withNamespace:!0},this.title),r.h("span",{className:`${W}_title-bar_close`,withNamespace:!0},r.h(_.X,null))),r.h("div",{className:`${W}_body`,withNamespace:!0},this._content)));return u.dom.append(e,n),e}},Fo=oe(Ft),qe=class extends Fo{},Nt=qe;var Ot="controller_button",Vt=class extends E{constructor(e,n,o){super("button",Ot,u.style.cls([Ot,o]));this._Children=e,this.title=n}set Children(e){!this.el||(this._Children=e,this.empty(),u.dom.append(this.el,u.dom.createByJsx(e)))}beforeDestroy(){}init(){let e=this.el;return e.addEventListener("click",()=>this.dispatch("click")),e.title=this.title||"",u.dom.append(e,u.dom.createByJsx(this._Children)),e}},K=Vt;var re="slider",Dt=class extends E{constructor(e){super("div",re,u.style.cls([re,e]));this._percent=0;this._anyWidth=35}set percent(e){!this.el||(this._percent=D.restrict(e,0,1),!!this._innerEl&&(this._innerEl.style.width=this._percent*100+"%",!!this._suffixEl&&(this._suffixEl.innerHTML=Number(this._percent).toFixed(1))))}get percent(){return this._percent}beforeDestroy(){}init(e){let n=this.el,o=a=>{l.debug("handleThumbMove");let f=(a.clientX-u.dom.getElementViewLeft(this.el)-5.5)/this._anyWidth;this.dispatch("change",{target:this,percent:D.restrict(f,0,1)}),l.debug("slider handleThumbMove",f)},i=()=>{l.debug("handleThumbMoveEnd"),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i),this.dispatch("confirm")},s=()=>{l.debug("handleThumbMoveStart"),document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)};return this._innerEl=u.dom.createByJsx(r.h("div",{className:`${re}_inner`,style:`width: ${this._percent*100+"%"}`,withNamespace:!0},r.h("span",{className:`${re}_thumb`,withNamespace:!0}))),this._suffixEl=u.dom.createByJsx(r.h("span",{className:`${re}_suffix`,withNamespace:!0},this._percent)),u.dom.append(n,this._innerEl,this._suffixEl),n.addEventListener("mousedown",s),n.addEventListener("click",o),n}},Bt=Dt;var ie="controller",At=class extends E{constructor(e){super("div",ie,u.style.cls(ie));this._controls=(e==null?void 0:e.controls)||[],this.PlayButton=new K(r.h(_.Play,null)),this.VolumeButton=new K(r.h(_.Volume,{off:!0}),"volume"),this.VolumeSlider=new Bt,this.VolumeSlider.percent=.3,this.InformationButton=new K(r.h(_.Info,null),"information"),this.ScreenshotButton=new K(r.h(_.Camera,null),"screenshot"),this.FullscreenButton=new K(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"))}activeVolume(){var e;(e=this._volumeEl)==null||e.classList.add(u.style.prefixCls(`${ie}_volume--active`))}hideVolume(){var e;(e=this._volumeEl)==null||e.classList.remove(u.style.prefixCls(`${ie}_volume--active`))}beforeDestroy(){}init(){l.debug("\u6E32\u67D3ControllerPlugin \u64AD\u653E\u63A7\u5236\u5668\u5BF9\u8C61",this,this.el,this._controls);let e=this.el,n=u.style.cls([`${this.name}_inner_bar`,`${this.name}_inner_left`]),o=u.style.cls([`${this.name}_inner_bar`,`${this.name}_inner_right`]);this._volumeEl=u.dom.createByJsx(r.h("div",{className:`${ie}_volume`,withNamespace:!0},this.VolumeButton.init(),this.VolumeSlider.init()));let i=u.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._volumeEl),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 u.dom.append(e,i),this.VolumeSlider.addEventListener("confirm",this.hideVolume.bind(this)),e}},No=oe(At),Qe=class extends No{},Ht=Qe;var Wt=class{constructor(){this._els=[];this.disableAutoHide=!1;this._controller=new Ht}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)}},$t=Wt;var pe=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 p(this,null,function*(){let e=this.getReceiversMap();l.debug("receivers map : ",e);let n=yield Promise.all(e.get("audio").map(i=>p(this,null,function*(){let s={},a=yield i.getStats(),f=[];return a.forEach(c=>{f.push(c),c.type==="codec"&&(s.mimeType=c.mimeType,s.clockRate=c.clockRate,s.channels=c.channels),c.type==="track"&&(s.totalSamplesReceived=c.totalSamplesReceived,s.totalSamplesDuration=c.totalSamplesDuration)}),l.debug("audio stats report: ",f),s}))),o=yield Promise.all(e.get("video").map(i=>p(this,null,function*(){let s={},a=yield i.getStats(),f=[];return a.forEach(c=>{f.push(c),c.type==="codec"&&(s.mimeType=c.mimeType,s.clockRate=c.clockRate),c.type==="inbound-rtp"&&(s.frameWidth=c.frameWidth,s.frameHeight=c.frameHeight,s.framesPerSecond=c.framesPerSecond,s.framesReceived=c.framesReceived,s.framesDecoded=c.framesDecoded,s.totalInterFrameDelay=c.totalInterFrameDelay,s.keyFramesDecoded=c.keyFramesDecoded,s.packetsLost=c.packetsLost,s.lastPacketReceivedTimestamp=c.lastPacketReceivedTimestamp,s.bytesReceived=c.bytesReceived,s.totalDecodeTime=c.totalDecodeTime)}),l.debug("video stats report: ",f),s})));return{audios:n,videos:o}})}};var Oo=(t,e)=>{V.debug(`webrtc my ICE candidate:
26
- ${e.candidate?e.candidate.candidate:"(null)"}`)},Vo=(t,e,n)=>{V.debug("webrtc ICE state change event: ",e),V.debug(`webrtc my ICE state: ${t==null?void 0:t.iceConnectionState}`),t&&t.iceConnectionState==="disconnected"&&n&&n()},Do=(t,e)=>{V.debug("webrtc Connection state change, \u5F53\u524D\u8FDE\u63A5\u72B6\u6001: ",t,t.connectionState)},Bo=(t,e,n)=>{V.debug("webrtc \u5F53\u524D\u7684 stream: ",e.streams[0]);let o=e.streams[0];n(o)},Ao=(t,e)=>p(void 0,null,function*(){let{offerParam:n,productRemoteSdp:o,customerRTCPeerConnection:i,onConnected:s,onConnectedFailed:a,onIceDisconnected:f,onPcEventAdded:c,onLocalDescriptionReady:m}=t,b=!!i&&i instanceof RTCPeerConnection,P={},h=b?i:new RTCPeerConnection(P);if(h.addEventListener("icecandidate",y=>Oo(h,y)),h.addEventListener("iceconnectionstatechange",y=>Vo(h,y,f)),h.addEventListener("connectionstatechange",y=>Do(h,y)),h.addEventListener("track",y=>Bo(h,y,e)),c&&(yield c(h)),b)return new pe(h);try{let y=yield h.createOffer(n);V.debug("\u521B\u5EFAoffer\uFF0C\u53C2\u6570\uFF1A",n,"\uFF0C \u7ED3\u679C\uFF1A",y),yield h.setLocalDescription(y),m&&m(h);let I=yield o(new RTCSessionDescription(y));V.debug("webrtc recv open answer",I);let S=new RTCSessionDescription({type:"answer",sdp:I});yield h.setRemoteDescription(S),V.debug("getTransceivers",h.getTransceivers()),s&&s(h)}catch(y){throw a&&a(h),V.error(new Error(`webrtc Failed to create session description: ${y.toString()}`)),h.close(),y}return new pe(h)}),Ho=t=>{if(!t)return;let{pc:e}=t;e.close()},Wo={connect:Ao,disconnect:Ho},Ze=Wo;var G=document.documentElement,me="requestFullscreen",fe="exitFullscreen",ge="fullscreenElement",he="onfullscreenchange";if("webkitRequestFullScreen"in G)me="webkitRequestFullScreen",fe="webkitExitFullscreen",ge="webkitFullscreenElement",he="onwebkitfullscreenchange";else if("msRequestFullscreen"in G)me="msRequestFullscreen",fe="msExitFullscreen",ge="msFullscreenElement",he="MSFullscreenChange";else if("mozRequestFullScreen"in G)me="mozRequestFullScreen",fe="mozCancelFullScreen",ge="mozFullScreenElement",he="onmozfullscreenchange";else if(!("requestFullscreen"in G))throw"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Fullscreen API !";function $o(t=G,e){return t[me](e)}function zo(){return document[fe]()}function zt(t){return t===document[ge]}function Uo(t=G,e){return zt(t)?zo():$o(t,e)}function Jo(t,e){let n=()=>{t.onfullscreenchange=null},o=i=>{i.target!==null&&e(zt(i.target))};return t[he]=o,{cancel:n}}var Ko={toggle:Uo,watch:Jo},ve=Ko;var Go=({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)),Ut=({list:t,factory:e})=>(t==null?void 0:t.length)?e?r.h(r.Fragment,null,t.map(n=>r.h(Ut,{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(Go,L({},n)))):null,Ye=Ut;var O;(function(o){o.DIRECT="direct",o.PLUGIN="plugin",o.REJECT="reject"})(O||(O={}));var ye;(function(s){s.MP4="MP4",s.FLAC="FLAC",s.OGG="OGG",s.WEBM="WEBM",s.AUTO="AUTO"})(ye||(ye={}));var je;(function(e){e.WEBRTC="WEBRTC"})(je||(je={}));var Jt="player",Kt=class extends E{constructor(e){super("div",Jt);this._lastTotalReceivedBytes=0;var n;this._video=new kt,this._spinner=new Mt({spin:!1}),this._mask=new xt({visible:!1}),this._infoModal=new Nt({container:this.el,title:"Info",center:!0,className:`${Jt}_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),((n=this._playerConfig)==null?void 0:n.enableController)&&(this._panel=new $t),l.debug("PlayerMode",this._mode)}justifyVideoType(e,n){if((e==null?void 0:e.url)&&!e.type)return ye.AUTO;let o="".toUpperCase.call((e==null?void 0:e.type)||Object.keys(n||{})[0]||"");return l.debug("justifyVideoType ",e,o),o}_restrictPlayerMode(e,n){let o=this.justifyVideoType(e,n);if(!o&&!(e==null?void 0:e.url))return O.REJECT;if(!o)return O.DIRECT;let i=Object.keys(ye),s=Object.keys(je);return i.includes(o)?O.DIRECT:s.includes(o)?O.PLUGIN:O.DIRECT}init(){l.debug("\u6E32\u67D3PlayerPlugin",this.el),this.prepare();let e=this._video.init(),n=this._spinner.init(),o=this._mask.init(),i=this._panel?this._panel.init():[],s=this._infoModal.init();return u.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 p(this,null,function*(){this.mute(!0),yield this._video.play(),this.mute(e)})}mute(e){var n;this._video.muted=!!e,l.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 p(this,null,function*(){var n;if(this._mode!==O.PLUGIN)return;l.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 Ze.connect(e,o=>{var s;if(!o)return;(s=this.video.getEl())==null||s.addEventListener("canplay",()=>{l.debug("Video canplay"),this.video.play()}),this._video.srcObject=o;let i=o.getTracks()[0];i.onended=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u5DF2\u7ECF\u7EC8\u6B62",a)},i.onmute=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u6682\u65F6\u65E0\u6CD5\u63D0\u4F9B\u5A92\u4F53",a),this.onMuted()},i.onunmute=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u63D0\u4F9B\u5A92\u4F53",a),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 i,s,a,f,c;(i=this.video.getEl())==null||i.addEventListener("canplay",()=>{this._spinner.spin=!1,this._mask.visible=!1}),(s=this.video.getEl())==null||s.addEventListener("waiting",()=>{l.debug("Video is waiting for more data."),this._spinner.spin=!0});let e=this._panel;if(!e)return;(a=this.el)==null||a.addEventListener("mousemove",()=>{e.showThenHide()}),(f=this.el)==null||f.addEventListener("click",()=>{e.showThenHide()});let n=(m=!1)=>{let b=e.controller.PlayButton;m||(this._video.paused=!this._video.paused),console.log("oalyer,",this._video.paused),this._video.paused?b.Children=r.h(_.Play,null):b.Children=r.h(_.Play,{off:!0})};n(!0),e.controller.addEventListener("play",()=>n()),this._video.addEventListener("play",()=>{l.debug("video play"),e.showThenHide();let m=e.controller.PlayButton;m.Children=r.h(_.Play,{off:!0})}),this._video.addEventListener("pause",()=>{l.debug("video pause"),e.showThenHide();let m=e.controller.PlayButton;m.Children=r.h(_.Play,null)}),e.controller.addEventListener("screenshot",()=>{let m=this._video.getEl();if(!m){l.libError("playerPlugin screenshot videoEl\u4E3A\u7A7A\u503C");return}D.screenshot(m,`screenshot_${Date.now()}`)}),e.controller.addEventListener("fullscreen",()=>{if(!this.el){l.libError("playerPlugin fullscreen playerEL\u4E3A\u7A7A\u503C");return}ve.toggle(this.el)}),(c=this._infoModal)==null||c.addEventListener("hide",()=>{this._infoModal.visible=!1,window.clearInterval(this._timer)}),e.controller.addEventListener("information",()=>p(this,null,function*(){if(!this._video.getEl()){l.libError("playerPlugin information videoEl\u4E3A\u7A7A\u503C");return}this.refreshInfoModal()}));let o=(m=!1)=>{var h;let b=e.controller.VolumeButton,P=(h=this._video.getEl())==null?void 0:h.muted;m||(this._video.muted=!P),P?b.Children=r.h(_.Volume,null):b.Children=r.h(_.Volume,{off:!0})};o(!0),e.controller.addEventListener("volume",()=>o()),e.controller.VolumeSlider.percent=this.video.volume,e.controller.VolumeSlider.addEventListener("change",m=>{e.controller.activeVolume(),console.log(m==null?void 0:m.percent,this.video.volume),this.video.volume=Number(m==null?void 0:m.percent),e.controller.VolumeSlider.percent=this.video.volume})}prepare(){if(l.debug("PlayerPlugin mode: ",this._mode),this.loadPlayerConfig(),this._mode===O.REJECT){l.error(new Error("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u7C7B\u578B"),this._mode,this._videoOption);return}if(this._mode===O.DIRECT){this.prepareDirect();return}if(this._mode===O.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;Ze.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 p(this,null,function*(){if(window.clearInterval(this._timer),!this._webrtcConnect)return;let e=3,n=()=>p(this,null,function*(){if(!this._webrtcConnect)return;let o=yield this._webrtcConnect.getStatsInfos();l.debug("player get result: ",o);let i={mimeType:(c="")=>({label:"Mime Type:",value:c}),totalSamplesReceived:(c=0,m)=>{let b={label:"Sample Rate:",value:""};return!c||!m.totalSamplesDuration||(b.value=Number(c/m.totalSamplesDuration).toFixed(3)+"Hz"),b}},s={mimeType:(c="")=>({label:"Mime Type:",value:c}),framesPerSecond:(c,m)=>({label:"Resolution:",value:`${m.frameWidth} x ${m.frameHeight}@${c}`}),bytesReceived:(c,m)=>{let b=c||0,P=(b-this._lastTotalReceivedBytes)*8/(e*1e3);return this._lastTotalReceivedBytes=b,{label:"Data Received:",value:`${Math.round(P)} kbps , lost ${m.packetsLost}`}}},a=r.h(Ye,{list:o.audios,factory:i}),f=r.h(Ye,{list:o.videos,factory:s});l.debug("audioInfoList",u.dom.createByJsx(a)),!!this._infoModal&&(this._infoModal.content=r.h("div",null,r.h("section",{className:"player_info-modal_section",withNamespace:!0},r.h("span",{className:"player_info-modal_section_title",withNamespace:!0},"Audio"),a),r.h("section",{className:"player_info-modal_section",withNamespace:!0},r.h("span",{className:"player_info-modal_section_title",withNamespace:!0},"Video"),f)),this._infoModal.visible=!0)});n(),this._timer=window.setInterval(n,e*1e3)})}},be=Kt;var Xo=(t,e,n)=>o=>p(void 0,null,function*(){if(o.type==="offer"){l.debug("\u8BF7\u6C42\u8FDC\u7AEFsdp\uFF0C \u8BBE\u5907\u914D\u7F6E\u4FE1\u606F\uFF1A",t,"token: ",e),l.debug("\u672C\u5730sdp",o);try{let{id:i,index:s}=t||{},a=yield F.getDeviceWebrtc({id:i,index:s,sdp:o.sdp},e);return n&&n(a.dialogId),a.sdp}catch(i){throw l.error(i,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`PUPlayer open \u5931\u8D25 , ${i.message}`)}}}),qo=t=>{let{container:e,token:n,puOption:o,defaultMediaOption:i={audio:!0,video:!0},testUrl:s,videoFit:a="fill",muted:f,apiPrefix:c,onConnected:m,onConnectedFailed:b,onDisConnected:P,fullScreenOnDblclick:h=!0,enableController:y=!1}=t||{},I,S=n,$=o,k=e,C=typeof f=="boolean"?f:!i.audio;ee(c);let w=()=>p(void 0,null,function*(){if(!!I&&(l.debug("PuPlayer close",I),g.mask.visible=!0,g.mask.text="Video Closed",g.close(),I))try{yield F.closeDialogs([I],S)}catch(v){throw l.error(v,"PuPlayer close \u5931\u8D25"),new Error(`PuPlayer close \u5931\u8D25 , ${v.message}`)}}),g=new be({video:{url:s},pluginOption:{webrtc:{offerParam:{offerToReceiveAudio:i.audio,offerToReceiveVideo:i.video},productRemoteSdp:v=>p(void 0,null,function*(){return Xo($,S,z=>{I=z})(v)}),onIceDisconnected:()=>{g.mask.visible=!0,g.mask.text="lost connection",g.close(),P&&P()},onConnected:()=>{m&&m()},onConnectedFailed:()=>{b&&b()}}},playerConfig:{autoPlay:!0,enableController:y}});g.addEventListener("init",v=>{l.debug("\u76D1\u542C\u5230\u4E86 player\u5DF2\u7ECF\u521D\u59CB\u5316",v)}),g.mute(C),g.video.fit=a;let x=g.init();h&&(x==null||x.addEventListener("dblclick",()=>{l.debug("\u53CC\u51FBplayer\uFF1A",x),ve.toggle(x)}));let q={instance:{getVideoElement:()=>g.video.getEl(),getPlayerElement:()=>g.getEl(),open:(v=!1)=>p(void 0,null,function*(){l.debug("PuPlayer open"),yield w(),l.debug("PuPlayer close before open"),g.mask.visible=!1,g.mask.text="connecting",g.mute(!!v);try{yield g.prepareWebrtc()}catch(T){throw g.mask.visible=!0,g.mask.text="connect failed",T}if(typeof v=="boolean"&&v){let T=()=>{l.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",C),l.debug("\u6B64\u90E8\u5206\u67E5\u770B\uFF1Ahttps://developers.google.com/web/updates/2017/09/autoplay-policy-changes"),g.mute(C),document.removeEventListener("click",T),document.removeEventListener("touchend",T)};document.addEventListener("click",T),document.addEventListener("touchend",T)}}),play:()=>p(void 0,null,function*(){yield g.play(C)}),mute:(v=!1)=>{C=v,g.mute(v)},hidden:v=>p(void 0,null,function*(){let T=x,z=g.video.getEl();T.style.display="none",document.body.appendChild(T),z.muted=!0;try{typeof v!="undefined"&&(C=v),yield g.play(C)}catch(ir){l.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}l.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",z.paused)}),display:v=>p(void 0,null,function*(){let T=x,z=g.video.getEl();u.render(T,k,()=>p(void 0,null,function*(){T.style.display="block",typeof v!="undefined"&&(C=v),yield g.play(C)})),l.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",z.paused)}),moveTo:v=>{l.debug("\u79FB\u52A8\u81F3\uFF1A",v),k=v,u.render(x,k,()=>p(void 0,null,function*(){}))},getCurrentContainer:()=>k,setPuOption:v=>{$=v},setVideoFit:v=>{l.debug("PuPlayer setVideoFit",v),g.video.fit=v},setToken:v=>{l.debug("PuPlayer setToken",v),S=v},setApiPrefix:ee,close:w,render:g.init,destroy:()=>p(void 0,null,function*(){l.debug("PuPlayer destroy"),yield w(),g.destroy()})},element:x};return k&&(u.render(x,k),q.element=null),q},Gt=qo;var et=class extends ne{constructor(e,n){super();this._plugin=e,this._el=this._plugin.init(),this._currentContainer=n}moveTo(e,n){l.debug("\u79FB\u52A8\u81F3\uFF1A",e),this._currentContainer=e,u.render(this._el,this._currentContainer,n)}getCurrentContainer(){return this._currentContainer}render(){return this._plugin.init()}destroy(){l.debug("destroy",this._plugin),this._plugin.destroy(),this.dispatch("destroy")}};var se=class{constructor(e,n,o,i){this.token="";this.fetchSdpFunc=e,this.token=n||"",this.param=o,this.prefix=i}fetch(e){return p(this,null,function*(){l.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,l.debug(`RemoteSdpFetcher fetch \u83B7\u5F97\u7684remoteSdp ${o}, dialogId: ${i}`),o})}close(){return p(this,null,function*(){l.debug(`remoteSdpFetcher close\uFF0C \u68C0\u67E5dialogId: ${this.dialogId}`),this.dialogId&&(yield F.closeDialogs([this.dialogId]))})}},tt=class extends et{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=>p(this,null,function*(){var o;return(o=this._remoteSdpFetcher)==null?void 0:o.fetch(n)}))}getRemoteSdpFetcher(){return this._remoteSdpFetcher}setVideoFit(e){l.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 p(this,null,function*(){l.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=()=>{l.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",this._muted),l.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 p(this,null,function*(){yield this.player.play(this._muted)})}hidden(e){return p(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){l.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}l.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}display(e){return p(this,null,function*(){let n=this._el,o=this.player.video.getEl();u.render(n,this._currentContainer,()=>p(this,null,function*(){n.style.display="block",typeof e!="undefined"&&(this._muted=e),yield this.player.play(this._muted)})),l.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}close(){return p(this,null,function*(){if(l.debug("BvWebrtcInstance close",`_dialogId: ${this._dialogId}`),this.player.mask.visible=!0,this.player.mask.text="Video Closed",this.player.close(),l.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 l.error(e,"BvWebrtcInstance close \u5931\u8D25"),new Error(`BvWebrtcInstance close \u5931\u8D25 , ${e.message}`)}})}destroy(){l.debug("PuPlayer destroy"),this.close(),this.player.destroy()}};var Qo=t=>{let{container:e,sdpFetcher:n,offerParam:o,videoFit:i,muted:s,autoPlay:a,onConnected:f,onClose:c,onDestroy:m,onConnectedFailed:b,onDisConnected:P,onPcEventAdded:h}=t,y=new be({pluginOption:{webrtc:{offerParam:o,productRemoteSdp:()=>p(void 0,null,function*(){return""}),onIceDisconnected:()=>{y.mask.visible=!0,y.mask.text="lost connection",y.close(),P&&P()},onPcEventAdded:h,onConnected:()=>{y.mask.visible=!1,y.mask.text="connected",f&&f()},onConnectedFailed:()=>{b&&b()}}},playerConfig:{autoPlay:a}}),I=new tt(y,i,s,n,e);I.addEventListener("close",()=>{c&&c()}),I.addEventListener("destroy",()=>{m&&m()});let S={open:()=>p(void 0,null,function*(){l.debug("BvWebrtc open"),yield I.open()}),setOption:C=>{l.debug("BvWebrtc setOption");let w=I.getRemoteSdpFetcher();w&&(w.param=C)},setToken:C=>{l.debug("BvWebrtc setToken",C);let w=I.getRemoteSdpFetcher();w&&(w.token=C)},setApiPrefix:C=>{l.debug("BvWebrtc setApiPrefix",C);let w=I.getRemoteSdpFetcher();w&&(w.prefix=C)},getRemoteSdpFetcher:()=>I.getRemoteSdpFetcher(),close:()=>p(void 0,null,function*(){l.debug("BvWebrtc close"),yield I.close()}),render:()=>(l.debug("BvWebrtc render"),I.render()),destroy:()=>{l.debug("BvWebrtc destroy"),I.destroy()}},$=I.render(),k={instance:S,element:$};return e&&(u.render($,e),k.element=null),k},Xt=Qo;var Zo=()=>p(void 0,null,function*(){l.debug("\u8BF7\u6C42\u9EA6\u514B\u98CE...");let t=yield navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),e=t.getAudioTracks();return l.debug("\u9EA6\u514B\u98CE \u97F3\u9891\u8F68\u9053\uFF1A",e),t}),Yo=t=>{let{container:e,token:n,getRemoteSdpParam:o,apiPrefix:i,getRemoteSdpResult:s,onConnected:a,onClose:f,onDestroy:c,onConnectedFailed:m,onDisConnected:b,onGetUserMediaFailed:P}=t||{},h=(C,w,g,x)=>p(void 0,null,function*(){if(l.debug("audioPlayer productRemoteSdp",{param:{localDescription:C,param:w,token:g,prefix:x}}),C.type==="offer"&&(ee(x),l.debug("\u672C\u5730sdp",C),!!s))try{let{sdp:X,dialogId:q}=yield s(C.sdp,g,w);return{sdp:X,dialogId:q}}catch(X){throw l.error(X,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`productRemoteSdp \u5931\u8D25 , ${X.message}`)}}),y=new se(h,n,o,i),{instance:I,element:S}=Xt({container:e,sdpFetcher:y,offerParam:{offerToReceiveAudio:!0},videoFit:"contain",muted:!1,autoPlay:!0,onConnected:a,onClose:f,onDestroy:c,onConnectedFailed:m,onDisConnected:b,onPcEventAdded:C=>p(void 0,null,function*(){try{let w=yield Zo();w.getTracks().forEach(g=>C.addTrack(g,w))}catch(w){P&&P()}})});return{instance:L({},I),element:S}},Ie=Yo;var jo=(t,e,n)=>p(void 0,null,function*(){let{id:o,index:i}=n||{};return yield F.getDeviceWebrtc({id:o,index:i,sdp:t},e)}),er=t=>{let{container:e,token:n,puOption:o,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}=t||{},{instance:P,element:h}=Ie({container:e,token:n,getRemoteSdpParam:o,getRemoteSdpResult:jo,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}),y=U(L({},P),{setPuOption:S=>P.setOption&&P.setOption(S)});return delete y.setOption,{instance:y,element:h}},qt=er;var tr=(t,e,n)=>p(void 0,null,function*(){let{id:o,index:i}=n||{};return yield F.getConferenceWebrtc({id:o,index:i,sdp:t},e)}),nr=t=>{let{container:e,token:n,confOption:o,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}=t||{},{instance:P,element:h}=Ie({container:e,token:n,getRemoteSdpParam:o,getRemoteSdpResult:tr,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}),y=U(L({},P),{setConfOption:S=>P.setOption&&P.setOption(S)});return delete y.setOption,{instance:y,element:h}},Qt=nr;var or=F.closeAllStorageDialog;return rr;})();
25
+ `,...n)}}formatShapeLog({level:t,title:e,color:n},o,...i){this.formatLog(t,e,o,ae({color:n},this.getLoggerOption().shape,J.title),ae({color:n},this.getLoggerOption().shape,J.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)}},ar=new lt,gn=new Ce,hn=gn,V=hn;var ut=class extends Ce{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)}}},Pe=new ut;Pe.debug("player-core env:",d);Pe.version(d.SH_LIB_NAME,d.SH_LIB_VERSION||"");var l=Pe;var vn=Array.isArray,yn=t=>t!==t,pt=t=>typeof t=="number",mt=t=>typeof t=="string",bn=t=>pt(t)||mt(t),In=t=>typeof t=="function",Cn=t=>typeof t=="undefined",Pn=t=>t?!1:!!(t!=null?t:!0),wn={isArr:vn,baseIsNaN:yn,isString:mt,isNumber:pt,isText:bn,isFn:In,isUndefined:Cn,isNullOrUndefined:Pn},R=wn;function En(t,e=[]){let n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function _n(t,e,n){let o=n-1,i=t.length;for(;++o<i;)if(t[o]===e)return o;return-1}function Sn(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 xn(t,e,n){return e===e?_n(t,e,n):Sn(t,R.baseIsNaN,n)}function Tn(t,e){let n=-1,o=e.length,i=t;for(t===e&&(e=En(e));++n<o;){let s=0,a=e[n],f=a;for(;(s=xn(i,f,s))>-1;)i!==t&&[].splice.call(i,s,1),[].splice.call(t,s,1)}return t}var Mn=t=>t?R.isArr(t)?t:[t]:[],Ln=(t,e)=>!t||!t.length||!e||!e.length?t:Tn(t,e),Rn=(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){l.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)})},kn=(t,e,n)=>Math.max(Math.min(t,n),e),Fn={pullAll:Ln,toArray:Mn,screenshot:Rn,restrict:kn},D=Fn;function Nn(t){return t!=null&&t!==!0&&t!==!1}function ft(t,e=[]){return t.forEach(n=>{R.isArr(n)?ft(n,e):Nn(n)&&e.push(R.isText(n)?Vn(n):n)}),e}function On(t={},e){if(!e)return;Object.keys(t).forEach(o=>{if(o==="children")return;let i=t[o];R.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 Vn(t){return{type:"",props:{nodeValue:String(t)+""}}}function Dn(t,e){return t===""?document.createTextNode(""):e?document.createElementNS(e,t):document.createElement(t)}function Y(t,e,n){let o=e?e(t):t;if(!o)return null;if(R.isArr(o)){let a=document.createDocumentFragment();return o.forEach(f=>{let c=Y(f,e);c&&a.appendChild(c)}),a}let{props:i,type:s}=o;if(!i)return o instanceof Node||o instanceof Text?(l.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):(l.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(R.isString(s)){let a=Dn(s,i.xmlns||n);return On(i,a),(i.children||[]).forEach(c=>{let m=Y(c,e,i.xmlns);!m||a.appendChild(m)}),a}if(R.isFn(s)){let a=s(i);return Y(a,e)}return null}function Bn(t,e,...n){return e=e||{},n=ft(D.toArray(e.children||n)),e.children=n,{type:t,props:e}}var An=t=>t.children,Hn={h:Bn,Fragment:An},r=Hn;var we=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)},gt=t=>{let e=typeof t=="number"?t:we(t),n=we();return e-n},Wn=t=>gt(t)>0,$n={getUTCSecond:we,pastNow:gt,compare:Wn},Ee=$n;var ht=(t,e,n)=>{let o={value:e,expire:n},i=JSON.stringify(o);return localStorage.setItem(t,i),o},zn=(t,e,n)=>{let i=Ee.getUTCSecond()+n;return ht(t,e,i)},Un=(t,e=!1)=>{let n=localStorage.getItem(t);if(!n)return null;try{let o=JSON.parse(n);return e?o:o.expire?Ee.compare(o.expire)?o.value:null:o.value}catch(o){l.error(o,n,"Storage\u8BFB\u53D6\u6570\u636E\u65F6\uFF0C JSON\u89E3\u6790\u51FA\u9519")}},Jn=t=>localStorage.removeItem(t),Kn={set:ht,setTimeout:zn,get:Un,remove:Jn},B=Kn;var ce;(function(n){n.GET="GET",n.POST="POST"})(ce||(ce={}));var vt=(t,e)=>p(void 0,null,function*(){let n=new AbortController;if(e.signal&&e.signal.addEventListener("abort",()=>{n.abort()}),e.timeout){let a=setTimeout(()=>{n.abort()},e.timeout);n.signal.addEventListener("abort",()=>{clearTimeout(a)})}let o=e.bodyData,i=o&&(typeof o=="object"?JSON.stringify(o):o),s={credentials:"same-origin",method:e.method,headers:new Headers(L({},e.headers)),signal:n.signal};i&&(s.body=i),l.http("\u53D1\u9001\u8BF7\u6C42\uFF1A",t,U(L({},s),{body:o}));try{let a=yield fetch(t,s);if(l.http("\u8BF7\u6C42\u54CD\u5E94\uFF1A",t,a,yield a.clone().text()),a.ok||a.status>=200&&a.status<300){let f=a.headers.get("content-type")||"";if(/application\/json/i.test(f))return yield a.json()}else throw new Error(`${a.status} ${a.statusText}`)}catch(a){if(a.name==="AbortError"){l.http("\u8BF7\u6C42\u53D6\u6D88\uFF1A",s);return}throw a}}),Gn=(t,e,n)=>p(void 0,null,function*(){let o=e?e.toString():"";return yield vt(t+o,{method:ce.GET,headers:n==null?void 0:n.headers})}),Xn=(t,e,n)=>p(void 0,null,function*(){return yield vt(t,{method:ce.POST,headers:L({"Content-Type":"application/json;charset=UTF-8"},n==null?void 0:n.headers),bodyData:e})}),qn={get:Gn,post:Xn},de=qn;var yt={BVCSP_V1:{path:"/bvcsp/v1",prefix:""}},_e=t=>{let e=yt[t];return e.prefix+e.path},Qn=(t,e)=>{let n=yt[t];return n.prefix=e||"",_e(t)},j={setApiPrefix:Qn,getApiURL:_e,bvscpV1:()=>_e("BVCSP_V1")},ee=t=>{j.setApiPrefix("BVCSP_V1",t)};function bt(t){if(!t)return null;if(t instanceof Array)return bt(t[0]);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.*").test(o.className)&&e.removeChild(o)}),t}return null}function Zn(t,e,n){if(!t)return;let o=document.createDocumentFragment();o.appendChild(t);let i=bt(e);!i||(i.appendChild(o),n==null||n())}var It=Zn;var ue=(...t)=>{let e=[];for(let n=0;n<t.length;n++){let o=t[n];if(!o)continue;let i=typeof o;if(R.isText(o))e.push(o);else if(Array.isArray(o)){if(o.length){let s=ue(...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(" ")},Ct=t=>t?t.replace(/\s*(;|\{|\})+\s*[\n\r]*/g,"$1"):"",Yn=(t,...e)=>{if(!e.length)return Ct(t[0]);let n="";return e.forEach((o,i)=>{n+=t[i]+o}),n+=t[t.length-1],Ct(n)},Se="bvplayer-",jn="common-",Pt=t=>new RegExp(Se).test(t),eo=(...t)=>ue(t).split(" ").map(e=>Pt(e)?e:Se+e).join(" "),to=(...t)=>ue(t).split(" ").map(e=>Pt(e)?e:Se+jn+e).join(" ");var no={cls:ue,css:Yn,prefixCls:eo,commonCls:to},te=no;function oo(t){return document.createRange().createContextualFragment(t)}function ro(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function xe(){return document.createDocumentFragment()}function io(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function so(t,...e){if(!t)return;let n=xe();n.append(...e.filter(o=>o)),t.appendChild(n)}function lo(t){if(!!t)if(t instanceof Element){t.innerHTML="";return}else for(;t.firstChild;)t.removeChild(t.firstChild)}function ao(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=xe();o.append(...n),t.parentNode.replaceChild(o,t)}}function co(t){var e;if(!!t)if(t instanceof Element){t.remove();return}else(e=t.parentNode)==null||e.removeChild(t)}function uo(t){if(!t)return 0;let e=t.offsetLeft,n=t.offsetParent;if(n instanceof HTMLElement){let o=document.body.scrollLeft+document.documentElement.scrollLeft;if(!document.fullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement)for(;n!==null;)e+=n.offsetLeft,n=n.offsetParent;else for(;n!==null&&n!==t;)e+=n.offsetLeft,n=n.offsetParent;return e-o}return 0}function po(t){if(!t||!t.props)return t;let{props:e}=t;return e.withCommonNamespace&&(e.className=te.commonCls(e.className),delete e.withCommonNamespace),e.withNamespace&&(e.className=te.prefixCls(e.className),delete e.withNamespace),t}function mo(t){return t?Y(t,po):null}var fo={parseHtml:oo,create:ro,createFragment:xe,createHtmlElement:io,createByJsx:mo,append:so,empty:lo,replace:ao,removeSelf:co,getElementViewLeft:uo},wt=fo;var go="bvplayerCore",ho=t=>go+t,vo={createPrefixStorageField:ho},Et=vo;var yo={render:It,style:te,dom:wt,field:Et},u=yo;var H=u.field.createPrefixStorageField("DialogIds"),bo=(t,e)=>p(void 0,null,function*(){var a;let n={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield de.post(`${j.bvscpV1()}/dialog/device/webrtc`,o,{headers:n});if(l.api("\u8BBE\u5907\u97F3\u89C6\u9891\u6D41 webrtc\u65B9\u5F0F\u6253\u5F00dialog: ",{params:o,resData:i}),!i||i.code!==0||!((a=i.data)==null?void 0:a.dialogid))throw new Error(`\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25\uFF0C ${i.msg}`);let{data:s}=i;if(s.dialogid){let f=B.get(H)||[];f.push(s.dialogid),B.set(H,f)}return{dialogId:s.dialogid,sdp:s.sdp}}),Io=(t,e)=>p(void 0,null,function*(){var f;let n={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield de.post(`${j.bvscpV1()}/dialog/conference/webrtc`,o,{headers:n});if(l.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,a=B.get(H)||[];return a.push(s.dialogid),B.set(H,a),{dialogId:s.dialogid,sdp:s.sdp}}),Co=(t,e)=>p(void 0,null,function*(){if(!t)return;let n={Authorization:e||""};return l.api("\u5173\u95EDdialog\uFF1A",t),yield de.post(`${j.bvscpV1()}/dialog/close/${t}`,{},{headers:n})}),_t=(t,e)=>p(void 0,null,function*(){let n=B.get(H)||[];D.pullAll(n,t),B.set(H,n,0);let i=(yield Promise.allSettled(t.map(s=>Co(s,e)))).filter(s=>s.status==="rejected");i&&i.length>0&&l.error(new Error(`"\u5173\u95ED\u5B58\u50A8\u7684dialog\u65F6\u5931\u8D25\uFF1A", ${i}`))}),Po=t=>p(void 0,null,function*(){let e=B.get(H);!e||e.length<1||(B.remove(H),yield _t(e,t))}),wo={getDeviceWebrtc:bo,getConferenceWebrtc:Io,closeDialogs:_t,closeAllStorageDialog:Po},F=wo;var St=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 a=o[s];a&&a(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))}},ne=class{constructor(){this._notifier=new St}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 ne{constructor(e,n,o){super();this.name="";let i=n.trim().toLowerCase(),s=o?o.trim():i,a=u.dom.create(e,u.style.prefixCls(s));this.name=i,this.el=a}empty(){u.dom.empty(this.el)}unmount(){var e;l.debug("unmount",this.el,(e=this.el)==null?void 0:e.parentNode),u.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;l.debug("destroy complete",this)}}getEl(){return this.el}};var xt=class extends E{constructor(e){super("div","mask",u.style.cls("mask"));this._visible=!!(e==null?void 0:e.visible),this._text=e==null?void 0:e.text,this._textEl=u.dom.create("span",u.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(){l.debug("mask visible: ",this._visible);let e=this.el;return e.style.display=this._visible?"block":"none",this._textEl.textContent=this._text||"",u.dom.append(e,this._textEl),e}},Tt=xt;var Mt=class extends E{constructor(e){super("div","spinner",u.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(){l.debug("spinner spin: ",this._spin);let e=this.el;e.style.display=this._spin?"block":"none";let n=u.dom.create("span");return n.style.backgroundColor="#FFF",u.dom.append(e,n),e}},Lt=Mt;var Rt={contain:"contain",fill:"fill"},kt=class extends E{constructor(e){super("video","video",u.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)||Rt.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 volume(e){let n=this.el;n.volume=Number(e)}get volume(){var e;return Number((e=this.el)==null?void 0:e.volume)}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=Rt[e],this.el.style.objectFit=this._fit}getVideoFit(){return this._fit}init(){l.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=>{l.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 p(this,null,function*(){let e=this.el;try{l.debug("video \u5C1D\u8BD5\u64AD\u653E"),yield e.play()}catch(n){l.error(n,"video \u64AD\u653E \u5931\u8D25")}})}beforeDestroy(){}},Ft=kt;function oe(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=u.style.commonCls("is-visible");this._visible?(this.show&&this.show(),this.el.classList.add(o)):(this.hide&&this.hide(),this.el.classList.remove(o))}}}function Te({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}function 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:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z","clip-rule":"evenodd"}))}function 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:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"}))}function Re({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M4 5a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2V7a2 2 0 00-2-2h-1.586a1 1 0 01-.707-.293l-1.121-1.121A2 2 0 0011.172 3H8.828a2 2 0 00-1.414.586L6.293 4.707A1 1 0 015.586 5H4zm6 9a3 3 0 100-6 3 3 0 000 6z","clip-rule":"evenodd"}))}function ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"}))}function Fe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M3 4a1 1 0 011-1h4a1 1 0 010 2H6.414l2.293 2.293a1 1 0 01-1.414 1.414L5 6.414V8a1 1 0 01-2 0V4zm9 1a1 1 0 110-2h4a1 1 0 011 1v4a1 1 0 11-2 0V6.414l-2.293 2.293a1 1 0 11-1.414-1.414L13.586 5H12zm-9 7a1 1 0 112 0v1.586l2.293-2.293a1 1 0 011.414 1.414L6.414 15H8a1 1 0 110 2H4a1 1 0 01-1-1v-4zm13-1a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 110-2h1.586l-2.293-2.293a1 1 0 011.414-1.414L15 13.586V12a1 1 0 011-1z","clip-rule":"evenodd"}))}function Ne({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Oe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"}))}function 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:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}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:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"}))}function Be({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"}))}function Ae({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"}))}function 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:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}))}function We({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z","clip-rule":"evenodd"}))}function $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:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z","clip-rule":"evenodd"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"}))}function ze({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM12.293 7.293a1 1 0 011.414 0L15 8.586l1.293-1.293a1 1 0 111.414 1.414L16.414 10l1.293 1.293a1 1 0 01-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 01-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 010-1.414z","clip-rule":"evenodd"}))}function Ue({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Je({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"}))}function Ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Ge({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"}))}function Xe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 32 33",fill:"currentColor"},r.h("path",{d:"M6.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v4h4c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333zM30.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h4v-4c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM30.667 12c-0.8 0-1.333-0.533-1.333-1.333v-4h-4c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM1.333 12c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-4v4c0 0.8-0.533 1.333-1.333 1.333z"}))}var N=({children:t,className:e})=>{let n=u.style.cls(["icon",e]);return r.h("span",{className:n,withNamespace:!0},t)},Eo=({filled:t})=>r.h(N,null,t?r.h(Me,null):r.h(Te,null)),_o=({filled:t})=>r.h(N,null,t?r.h(Re,null):r.h(Le,null)),So=({filled:t})=>r.h(N,null,t?r.h(Oe,null):r.h(Ne,null)),xo=({filled:t})=>r.h(N,null,t?r.h(Fe,null):r.h(ke,null)),To=({filled:t,circle:e})=>e?r.h(N,null,t?r.h(De,null):r.h(Ve,null)):r.h(N,null,t?r.h(Ae,null):r.h(Be,null)),Mo=({filled:t,off:e})=>e?r.h(N,null,t?r.h(ze,null):r.h($e,null)):r.h(N,null,t?r.h(We,null):r.h(He,null)),Lo=({filled:t,off:e})=>e?r.h(N,null,t?r.h(Ge,null):r.h(Ke,null)):r.h(N,null,t?r.h(Je,null):r.h(Ue,null)),Ro=()=>r.h(N,null,r.h(Xe,null)),ko={Cog:Eo,Camera:_o,Info:So,ArrowsExpand:xo,X:To,Volume:Mo,Play:Lo,Full:Ro};var _=ko;var W="modal",Nt=class extends E{constructor(e){super("div",W,u.style.cls([W,e.className,{[`${W}--center`]:e.center}]));this.container=e.container,this.title=e.title,this._content=e.content||u.dom.create("div","test"),this._center=!!e.center}set content(e){let n=u.dom.createByJsx(e);l.debug("modal update content",n,this._content),u.dom.replace(this._content,n),this._content=n}show(){var e;(e=this.el)==null||e.classList.toggle(u.style.prefixCls(`${W}--center`),!!this._center)}hide(){}clear(){!this.el||(this.el.innerHTML="")}beforeDestroy(){}init(){this.clear(),l.debug("\u6E32\u67D3ModalPlugin \u5F39\u7A97\u5BF9\u8C61",this,this.el);let e=this.el,n=u.dom.createByJsx(r.h(r.Fragment,null,r.h("div",{className:`${W}_title-bar`,onClick:()=>this.dispatch("hide"),withNamespace:!0},r.h("span",{className:`${W}_title-bar_title`,withNamespace:!0},this.title),r.h("span",{className:`${W}_title-bar_close`,withNamespace:!0},r.h(_.X,null))),r.h("div",{className:`${W}_body`,withNamespace:!0},this._content)));return u.dom.append(e,n),e}},Fo=oe(Nt),qe=class extends Fo{},Ot=qe;var Vt="controller_button",Dt=class extends E{constructor(e,n,o){super("button",Vt,u.style.cls([Vt,o]));this._Children=e,this.title=n}set Children(e){!this.el||(this._Children=e,this.empty(),u.dom.append(this.el,u.dom.createByJsx(e)))}beforeDestroy(){}init(){let e=this.el;return e.addEventListener("click",()=>this.dispatch("click")),e.title=this.title||"",u.dom.append(e,u.dom.createByJsx(this._Children)),e}},K=Dt;var re="slider",Bt=class extends E{constructor(e){super("div",re,u.style.cls([re,e]));this._percent=0;this._anyWidth=35}set percent(e){!this.el||(this._percent=D.restrict(e,0,1),!!this._innerEl&&(this._innerEl.style.width=this._percent*100+"%",!!this._suffixEl&&(this._suffixEl.innerHTML=Number(this._percent).toFixed(1))))}get percent(){return this._percent}beforeDestroy(){}init(e){let n=this.el,o=a=>{l.debug("handleThumbMove");let f=(a.clientX-u.dom.getElementViewLeft(this.el)-5.5)/this._anyWidth;this.dispatch("change",{target:this,percent:D.restrict(f,0,1)}),l.debug("slider handleThumbMove",f)},i=()=>{l.debug("handleThumbMoveEnd"),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i),this.dispatch("confirm")},s=()=>{l.debug("handleThumbMoveStart"),document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)};return this._innerEl=u.dom.createByJsx(r.h("div",{className:`${re}_inner`,style:`width: ${this._percent*100+"%"}`,withNamespace:!0},r.h("span",{className:`${re}_thumb`,withNamespace:!0}))),this._suffixEl=u.dom.createByJsx(r.h("span",{className:`${re}_suffix`,withNamespace:!0},this._percent)),u.dom.append(n,this._innerEl,this._suffixEl),n.addEventListener("mousedown",s),n.addEventListener("click",o),n}},At=Bt;var ie="controller",Ht=class extends E{constructor(e){super("div",ie,u.style.cls(ie));this._controls=(e==null?void 0:e.controls)||[],this.PlayButton=new K(r.h(_.Play,null)),this.VolumeButton=new K(r.h(_.Volume,{off:!0}),"volume"),this.VolumeSlider=new At,this.VolumeSlider.percent=.3,this.InformationButton=new K(r.h(_.Info,null),"information"),this.ScreenshotButton=new K(r.h(_.Camera,null),"screenshot"),this.FullscreenButton=new K(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"))}activeVolume(){var e;(e=this._volumeEl)==null||e.classList.add(u.style.prefixCls(`${ie}_volume--active`))}hideVolume(){var e;(e=this._volumeEl)==null||e.classList.remove(u.style.prefixCls(`${ie}_volume--active`))}beforeDestroy(){}init(){l.debug("\u6E32\u67D3ControllerPlugin \u64AD\u653E\u63A7\u5236\u5668\u5BF9\u8C61",this,this.el,this._controls);let e=this.el,n=u.style.cls([`${this.name}_inner_bar`,`${this.name}_inner_left`]),o=u.style.cls([`${this.name}_inner_bar`,`${this.name}_inner_right`]);this._volumeEl=u.dom.createByJsx(r.h("div",{className:`${ie}_volume`,withNamespace:!0},this.VolumeButton.init(),this.VolumeSlider.init()));let i=u.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._volumeEl),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 u.dom.append(e,i),this.VolumeSlider.addEventListener("confirm",this.hideVolume.bind(this)),e}},No=oe(Ht),Qe=class extends No{},Wt=Qe;var $t=class{constructor(){this._els=[];this.disableAutoHide=!1;this._controller=new Wt}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)}},zt=$t;var pe=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 p(this,null,function*(){let e=this.getReceiversMap();l.debug("receivers map : ",e);let n=yield Promise.all(e.get("audio").map(i=>p(this,null,function*(){let s={},a=yield i.getStats(),f=[];return a.forEach(c=>{f.push(c),c.type==="codec"&&(s.mimeType=c.mimeType,s.clockRate=c.clockRate,s.channels=c.channels),c.type==="track"&&(s.totalSamplesReceived=c.totalSamplesReceived,s.totalSamplesDuration=c.totalSamplesDuration)}),l.debug("audio stats report: ",f),s}))),o=yield Promise.all(e.get("video").map(i=>p(this,null,function*(){let s={},a=yield i.getStats(),f=[];return a.forEach(c=>{f.push(c),c.type==="codec"&&(s.mimeType=c.mimeType,s.clockRate=c.clockRate),c.type==="inbound-rtp"&&(s.frameWidth=c.frameWidth,s.frameHeight=c.frameHeight,s.framesPerSecond=c.framesPerSecond,s.framesReceived=c.framesReceived,s.framesDecoded=c.framesDecoded,s.totalInterFrameDelay=c.totalInterFrameDelay,s.keyFramesDecoded=c.keyFramesDecoded,s.packetsLost=c.packetsLost,s.lastPacketReceivedTimestamp=c.lastPacketReceivedTimestamp,s.bytesReceived=c.bytesReceived,s.totalDecodeTime=c.totalDecodeTime)}),l.debug("video stats report: ",f),s})));return{audios:n,videos:o}})}};var Oo=(t,e)=>{V.debug(`webrtc my ICE candidate:
26
+ ${e.candidate?e.candidate.candidate:"(null)"}`)},Vo=(t,e,n)=>{V.debug("webrtc ICE state change event: ",e),V.debug(`webrtc my ICE state: ${t==null?void 0:t.iceConnectionState}`),t&&t.iceConnectionState==="disconnected"&&n&&n()},Do=(t,e)=>{V.debug("webrtc Connection state change, \u5F53\u524D\u8FDE\u63A5\u72B6\u6001: ",t,t.connectionState)},Bo=(t,e,n)=>{V.debug("webrtc \u5F53\u524D\u7684 stream: ",e.streams[0]);let o=e.streams[0];n(o)},Ao=(t,e)=>p(void 0,null,function*(){let{offerParam:n,productRemoteSdp:o,customerRTCPeerConnection:i,onConnected:s,onConnectedFailed:a,onIceDisconnected:f,onPcEventAdded:c,onLocalDescriptionReady:m}=t,b=!!i&&i instanceof RTCPeerConnection,P={},h=b?i:new RTCPeerConnection(P);if(h.addEventListener("icecandidate",y=>Oo(h,y)),h.addEventListener("iceconnectionstatechange",y=>Vo(h,y,f)),h.addEventListener("connectionstatechange",y=>Do(h,y)),h.addEventListener("track",y=>Bo(h,y,e)),c&&(yield c(h)),b)return new pe(h);try{let y=yield h.createOffer(n);V.debug("\u521B\u5EFAoffer\uFF0C\u53C2\u6570\uFF1A",n,"\uFF0C \u7ED3\u679C\uFF1A",y),yield h.setLocalDescription(y),m&&m(h);let I=yield o(new RTCSessionDescription(y));V.debug("webrtc recv open answer",I);let S=new RTCSessionDescription({type:"answer",sdp:I});yield h.setRemoteDescription(S),V.debug("getTransceivers",h.getTransceivers()),s&&s(h)}catch(y){throw a&&a(h),V.error(new Error(`webrtc Failed to create session description: ${y.toString()}`)),h.close(),y}return new pe(h)}),Ho=t=>{if(!t)return;let{pc:e}=t;e.close()},Wo={connect:Ao,disconnect:Ho},Ze=Wo;var G=document.documentElement,me="requestFullscreen",fe="exitFullscreen",ge="fullscreenElement",he="onfullscreenchange";if("webkitRequestFullScreen"in G)me="webkitRequestFullScreen",fe="webkitExitFullscreen",ge="webkitFullscreenElement",he="onwebkitfullscreenchange";else if("msRequestFullscreen"in G)me="msRequestFullscreen",fe="msExitFullscreen",ge="msFullscreenElement",he="MSFullscreenChange";else if("mozRequestFullScreen"in G)me="mozRequestFullScreen",fe="mozCancelFullScreen",ge="mozFullScreenElement",he="onmozfullscreenchange";else if(!("requestFullscreen"in G))throw"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Fullscreen API !";function $o(t=G,e){return t[me](e)}function zo(){return document[fe]()}function Ut(t){return t===document[ge]}function Uo(t=G,e){return Ut(t)?zo():$o(t,e)}function Jo(t,e){let n=()=>{t.onfullscreenchange=null},o=i=>{i.target!==null&&e(Ut(i.target))};return t[he]=o,{cancel:n}}var Ko={toggle:Uo,watch:Jo},ve=Ko;var Go=({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)),Jt=({list:t,factory:e})=>(t==null?void 0:t.length)?e?r.h(r.Fragment,null,t.map(n=>r.h(Jt,{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(Go,L({},n)))):null,Ye=Jt;var O;(function(o){o.DIRECT="direct",o.PLUGIN="plugin",o.REJECT="reject"})(O||(O={}));var ye;(function(s){s.MP4="MP4",s.FLAC="FLAC",s.OGG="OGG",s.WEBM="WEBM",s.AUTO="AUTO"})(ye||(ye={}));var je;(function(e){e.WEBRTC="WEBRTC"})(je||(je={}));var Kt="player",Gt=class extends E{constructor(e){super("div",Kt);this._lastTotalReceivedBytes=0;var n;this._video=new Ft,this._spinner=new Lt({spin:!1}),this._mask=new Tt({visible:!1}),this._infoModal=new Ot({container:this.el,title:"Info",center:!0,className:`${Kt}_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),((n=this._playerConfig)==null?void 0:n.enableController)&&(this._panel=new zt),l.debug("PlayerMode",this._mode)}justifyVideoType(e,n){if((e==null?void 0:e.url)&&!e.type)return ye.AUTO;let o="".toUpperCase.call((e==null?void 0:e.type)||Object.keys(n||{})[0]||"");return l.debug("justifyVideoType ",e,o),o}_restrictPlayerMode(e,n){let o=this.justifyVideoType(e,n);if(!o&&!(e==null?void 0:e.url))return O.REJECT;if(!o)return O.DIRECT;let i=Object.keys(ye),s=Object.keys(je);return i.includes(o)?O.DIRECT:s.includes(o)?O.PLUGIN:O.DIRECT}init(){l.debug("\u6E32\u67D3PlayerPlugin",this.el),this.prepare();let e=this._video.init(),n=this._spinner.init(),o=this._mask.init(),i=this._panel?this._panel.init():[],s=this._infoModal.init();return u.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 p(this,null,function*(){this.mute(!0),yield this._video.play(),this.mute(e)})}mute(e){var n;this._video.muted=!!e,l.debug("player mute: ",(n=this._video.getEl())==null?void 0:n.muted)}record(){}setProductRemoteSdp(e){!this._pluginOption||!this._pluginOption.webrtc||(this._pluginOption.webrtc.productRemoteSdp=e)}prepareWebrtc(){return p(this,null,function*(){var n;if(this._mode!==O.PLUGIN)return;l.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 Ze.connect(e,o=>{var s;if(!o)return;(s=this.video.getEl())==null||s.addEventListener("canplay",()=>{l.debug("Video canplay"),this.video.play()}),this._video.srcObject=o;let i=o.getTracks()[0];i.onended=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u5DF2\u7ECF\u7EC8\u6B62",a)},i.onmute=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u6682\u65F6\u65E0\u6CD5\u63D0\u4F9B\u5A92\u4F53",a),this.onMuted()},i.onunmute=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u63D0\u4F9B\u5A92\u4F53",a),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 i,s,a,f,c;(i=this.video.getEl())==null||i.addEventListener("canplay",()=>{this._spinner.spin=!1,this._mask.visible=!1}),(s=this.video.getEl())==null||s.addEventListener("waiting",()=>{l.debug("Video is waiting for more data."),this._spinner.spin=!0});let e=this._panel;if(!e)return;(a=this.el)==null||a.addEventListener("mousemove",()=>{e.showThenHide()}),(f=this.el)==null||f.addEventListener("click",()=>{e.showThenHide()});let n=(m=!1)=>{let b=e.controller.PlayButton;m||(this._video.paused=!this._video.paused),console.log("oalyer,",this._video.paused),this._video.paused?b.Children=r.h(_.Play,null):b.Children=r.h(_.Play,{off:!0})};n(!0),e.controller.addEventListener("play",()=>n()),this._video.addEventListener("play",()=>{l.debug("video play"),e.showThenHide();let m=e.controller.PlayButton;m.Children=r.h(_.Play,{off:!0})}),this._video.addEventListener("pause",()=>{l.debug("video pause"),e.showThenHide();let m=e.controller.PlayButton;m.Children=r.h(_.Play,null)}),e.controller.addEventListener("screenshot",()=>{let m=this._video.getEl();if(!m){l.libError("playerPlugin screenshot videoEl\u4E3A\u7A7A\u503C");return}D.screenshot(m,`screenshot_${Date.now()}`)}),e.controller.addEventListener("fullscreen",()=>{if(!this.el){l.libError("playerPlugin fullscreen playerEL\u4E3A\u7A7A\u503C");return}ve.toggle(this.el)}),(c=this._infoModal)==null||c.addEventListener("hide",()=>{this._infoModal.visible=!1,window.clearInterval(this._timer)}),e.controller.addEventListener("information",()=>p(this,null,function*(){if(!this._video.getEl()){l.libError("playerPlugin information videoEl\u4E3A\u7A7A\u503C");return}this.refreshInfoModal()}));let o=(m=!1)=>{var h;let b=e.controller.VolumeButton,P=(h=this._video.getEl())==null?void 0:h.muted;m||(this._video.muted=!P),P?b.Children=r.h(_.Volume,null):b.Children=r.h(_.Volume,{off:!0})};o(!0),e.controller.addEventListener("volume",()=>o()),e.controller.VolumeSlider.percent=this.video.volume,e.controller.VolumeSlider.addEventListener("change",m=>{e.controller.activeVolume(),console.log(m==null?void 0:m.percent,this.video.volume),this.video.volume=Number(m==null?void 0:m.percent),e.controller.VolumeSlider.percent=this.video.volume})}prepare(){if(l.debug("PlayerPlugin mode: ",this._mode),this.loadPlayerConfig(),this._mode===O.REJECT){l.error(new Error("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u7C7B\u578B"),this._mode,this._videoOption);return}if(this._mode===O.DIRECT){this.prepareDirect();return}if(this._mode===O.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;Ze.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 p(this,null,function*(){if(window.clearInterval(this._timer),!this._webrtcConnect)return;let e=3,n=()=>p(this,null,function*(){if(!this._webrtcConnect)return;let o=yield this._webrtcConnect.getStatsInfos();l.debug("player get result: ",o);let i={mimeType:(c="")=>({label:"Mime Type:",value:c}),totalSamplesReceived:(c=0,m)=>{let b={label:"Sample Rate:",value:""};return!c||!m.totalSamplesDuration||(b.value=Number(c/m.totalSamplesDuration).toFixed(3)+"Hz"),b}},s={mimeType:(c="")=>({label:"Mime Type:",value:c}),framesPerSecond:(c,m)=>({label:"Resolution:",value:`${m.frameWidth} x ${m.frameHeight}@${c}`}),bytesReceived:(c,m)=>{let b=c||0,P=(b-this._lastTotalReceivedBytes)*8/(e*1e3);return this._lastTotalReceivedBytes=b,{label:"Data Received:",value:`${Math.round(P)} kbps , lost ${m.packetsLost}`}}},a=r.h(Ye,{list:o.audios,factory:i}),f=r.h(Ye,{list:o.videos,factory:s});l.debug("audioInfoList",u.dom.createByJsx(a)),!!this._infoModal&&(this._infoModal.content=r.h("div",null,r.h("section",{className:"player_info-modal_section",withNamespace:!0},r.h("span",{className:"player_info-modal_section_title",withNamespace:!0},"Audio"),a),r.h("section",{className:"player_info-modal_section",withNamespace:!0},r.h("span",{className:"player_info-modal_section_title",withNamespace:!0},"Video"),f)),this._infoModal.visible=!0)});n(),this._timer=window.setInterval(n,e*1e3)})}},be=Gt;var Xo=(t,e,n)=>o=>p(void 0,null,function*(){if(o.type==="offer"){l.debug("\u8BF7\u6C42\u8FDC\u7AEFsdp\uFF0C \u8BBE\u5907\u914D\u7F6E\u4FE1\u606F\uFF1A",t,"token: ",e),l.debug("\u672C\u5730sdp",o);try{let{id:i,index:s}=t||{},a=yield F.getDeviceWebrtc({id:i,index:s,sdp:o.sdp},e);return n&&n(a.dialogId),a.sdp}catch(i){throw l.error(i,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`PUPlayer open \u5931\u8D25 , ${i.message}`)}}}),qo=t=>{let{container:e,token:n,puOption:o,defaultMediaOption:i={audio:!0,video:!0},testUrl:s,videoFit:a="fill",muted:f,apiPrefix:c,onConnected:m,onConnectedFailed:b,onDisConnected:P,fullScreenOnDblclick:h=!0,enableController:y=!1}=t||{},I,S=n,$=o,k=e,C=typeof f=="boolean"?f:!i.audio;ee(c);let w=()=>p(void 0,null,function*(){if(!!I&&(l.debug("PuPlayer close",I),g.mask.visible=!0,g.mask.text="Video Closed",g.close(),I))try{yield F.closeDialogs([I],S)}catch(v){throw l.error(v,"PuPlayer close \u5931\u8D25"),new Error(`PuPlayer close \u5931\u8D25 , ${v.message}`)}}),g=new be({video:{url:s},pluginOption:{webrtc:{offerParam:{offerToReceiveAudio:i.audio,offerToReceiveVideo:i.video},productRemoteSdp:v=>p(void 0,null,function*(){return Xo($,S,z=>{I=z})(v)}),onIceDisconnected:()=>{g.mask.visible=!0,g.mask.text="lost connection",g.close(),P&&P()},onConnected:()=>{m&&m()},onConnectedFailed:()=>{b&&b()}}},playerConfig:{autoPlay:!0,enableController:y}});g.addEventListener("init",v=>{l.debug("\u76D1\u542C\u5230\u4E86 player\u5DF2\u7ECF\u521D\u59CB\u5316",v)}),g.mute(C),g.video.fit=a;let x=g.init();h&&(x==null||x.addEventListener("dblclick",()=>{l.debug("\u53CC\u51FBplayer\uFF1A",x),ve.toggle(x)}));let q={instance:{getVideoElement:()=>g.video.getEl(),getPlayerElement:()=>g.getEl(),open:(v=!1)=>p(void 0,null,function*(){l.debug("PuPlayer open"),yield w(),l.debug("PuPlayer close before open"),g.mask.visible=!1,g.mask.text="connecting",g.mute(!!v);try{yield g.prepareWebrtc()}catch(T){throw g.mask.visible=!0,g.mask.text="connect failed",T}if(typeof v=="boolean"&&v){let T=()=>{l.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",C),l.debug("\u6B64\u90E8\u5206\u67E5\u770B\uFF1Ahttps://developers.google.com/web/updates/2017/09/autoplay-policy-changes"),g.mute(C),document.removeEventListener("click",T),document.removeEventListener("touchend",T)};document.addEventListener("click",T),document.addEventListener("touchend",T)}}),play:()=>p(void 0,null,function*(){yield g.play(C)}),mute:(v=!1)=>{C=v,g.mute(v)},hidden:v=>p(void 0,null,function*(){let T=x,z=g.video.getEl();T.style.display="none",document.body.appendChild(T),z.muted=!0;try{typeof v!="undefined"&&(C=v),yield g.play(C)}catch(ir){l.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}l.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",z.paused)}),display:v=>p(void 0,null,function*(){let T=x,z=g.video.getEl();u.render(T,k,()=>p(void 0,null,function*(){T.style.display="block",typeof v!="undefined"&&(C=v),yield g.play(C)})),l.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",z.paused)}),moveTo:v=>{l.debug("\u79FB\u52A8\u81F3\uFF1A",v),k=v,u.render(x,k,()=>p(void 0,null,function*(){}))},getCurrentContainer:()=>k,setPuOption:v=>{$=v},setVideoFit:v=>{l.debug("PuPlayer setVideoFit",v),g.video.fit=v},setToken:v=>{l.debug("PuPlayer setToken",v),S=v},setApiPrefix:ee,close:w,render:g.init,destroy:()=>p(void 0,null,function*(){l.debug("PuPlayer destroy"),yield w(),g.destroy()})},element:x};return k&&(u.render(x,k),q.element=null),q},Xt=qo;var et=class extends ne{constructor(e,n){super();this._plugin=e,this._el=this._plugin.init(),this._currentContainer=n}moveTo(e,n){l.debug("\u79FB\u52A8\u81F3\uFF1A",e),this._currentContainer=e,u.render(this._el,this._currentContainer,n)}getCurrentContainer(){return this._currentContainer}render(){return this._plugin.init()}destroy(){l.debug("destroy",this._plugin),this._plugin.destroy(),this.dispatch("destroy")}};var se=class{constructor(e,n,o,i){this.token="";this.fetchSdpFunc=e,this.token=n||"",this.param=o,this.prefix=i}fetch(e){return p(this,null,function*(){l.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,l.debug(`RemoteSdpFetcher fetch \u83B7\u5F97\u7684remoteSdp ${o}, dialogId: ${i}`),o})}close(){return p(this,null,function*(){l.debug(`remoteSdpFetcher close\uFF0C \u68C0\u67E5dialogId: ${this.dialogId}`),this.dialogId&&(yield F.closeDialogs([this.dialogId]))})}},tt=class extends et{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=>p(this,null,function*(){var o;return(o=this._remoteSdpFetcher)==null?void 0:o.fetch(n)}))}getRemoteSdpFetcher(){return this._remoteSdpFetcher}setVideoFit(e){l.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 p(this,null,function*(){l.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=()=>{l.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",this._muted),l.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 p(this,null,function*(){yield this.player.play(this._muted)})}hidden(e){return p(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){l.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}l.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}display(e){return p(this,null,function*(){let n=this._el,o=this.player.video.getEl();u.render(n,this._currentContainer,()=>p(this,null,function*(){n.style.display="block",typeof e!="undefined"&&(this._muted=e),yield this.player.play(this._muted)})),l.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}close(){return p(this,null,function*(){if(l.debug("BvWebrtcInstance close",`_dialogId: ${this._dialogId}`),this.player.mask.visible=!0,this.player.mask.text="Video Closed",this.player.close(),l.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 l.error(e,"BvWebrtcInstance close \u5931\u8D25"),new Error(`BvWebrtcInstance close \u5931\u8D25 , ${e.message}`)}})}destroy(){l.debug("PuPlayer destroy"),this.close(),this.player.destroy()}};var Qo=t=>{let{container:e,sdpFetcher:n,offerParam:o,videoFit:i,muted:s,autoPlay:a,onConnected:f,onClose:c,onDestroy:m,onConnectedFailed:b,onDisConnected:P,onPcEventAdded:h}=t,y=new be({pluginOption:{webrtc:{offerParam:o,productRemoteSdp:()=>p(void 0,null,function*(){return""}),onIceDisconnected:()=>{y.mask.visible=!0,y.mask.text="lost connection",y.close(),P&&P()},onPcEventAdded:h,onConnected:()=>{y.mask.visible=!1,y.mask.text="connected",f&&f()},onConnectedFailed:()=>{b&&b()}}},playerConfig:{autoPlay:a}}),I=new tt(y,i,s,n,e);I.addEventListener("close",()=>{c&&c()}),I.addEventListener("destroy",()=>{m&&m()});let S={open:()=>p(void 0,null,function*(){l.debug("BvWebrtc open"),yield I.open()}),setOption:C=>{l.debug("BvWebrtc setOption");let w=I.getRemoteSdpFetcher();w&&(w.param=C)},setToken:C=>{l.debug("BvWebrtc setToken",C);let w=I.getRemoteSdpFetcher();w&&(w.token=C)},setApiPrefix:C=>{l.debug("BvWebrtc setApiPrefix",C);let w=I.getRemoteSdpFetcher();w&&(w.prefix=C)},getRemoteSdpFetcher:()=>I.getRemoteSdpFetcher(),close:()=>p(void 0,null,function*(){l.debug("BvWebrtc close"),yield I.close()}),render:()=>(l.debug("BvWebrtc render"),I.render()),destroy:()=>{l.debug("BvWebrtc destroy"),I.destroy()}},$=I.render(),k={instance:S,element:$};return e&&(u.render($,e),k.element=null),k},qt=Qo;var Zo=()=>p(void 0,null,function*(){l.debug("\u8BF7\u6C42\u9EA6\u514B\u98CE...");let t=yield navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),e=t.getAudioTracks();return l.debug("\u9EA6\u514B\u98CE \u97F3\u9891\u8F68\u9053\uFF1A",e),t}),Yo=t=>{let{container:e,token:n,getRemoteSdpParam:o,apiPrefix:i,getRemoteSdpResult:s,onConnected:a,onClose:f,onDestroy:c,onConnectedFailed:m,onDisConnected:b,onGetUserMediaFailed:P}=t||{},h=(C,w,g,x)=>p(void 0,null,function*(){if(l.debug("audioPlayer productRemoteSdp",{param:{localDescription:C,param:w,token:g,prefix:x}}),C.type==="offer"&&(ee(x),l.debug("\u672C\u5730sdp",C),!!s))try{let{sdp:X,dialogId:q}=yield s(C.sdp,g,w);return{sdp:X,dialogId:q}}catch(X){throw l.error(X,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`productRemoteSdp \u5931\u8D25 , ${X.message}`)}}),y=new se(h,n,o,i),{instance:I,element:S}=qt({container:e,sdpFetcher:y,offerParam:{offerToReceiveAudio:!0},videoFit:"contain",muted:!1,autoPlay:!0,onConnected:a,onClose:f,onDestroy:c,onConnectedFailed:m,onDisConnected:b,onPcEventAdded:C=>p(void 0,null,function*(){try{let w=yield Zo();w.getTracks().forEach(g=>C.addTrack(g,w))}catch(w){P&&P()}})});return{instance:L({},I),element:S}},Ie=Yo;var jo=(t,e,n)=>p(void 0,null,function*(){let{id:o,index:i}=n||{};return yield F.getDeviceWebrtc({id:o,index:i,sdp:t},e)}),er=t=>{let{container:e,token:n,puOption:o,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}=t||{},{instance:P,element:h}=Ie({container:e,token:n,getRemoteSdpParam:o,getRemoteSdpResult:jo,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}),y=U(L({},P),{setPuOption:S=>P.setOption&&P.setOption(S)});return delete y.setOption,{instance:y,element:h}},Qt=er;var tr=(t,e,n)=>p(void 0,null,function*(){let{id:o,index:i}=n||{};return yield F.getConferenceWebrtc({id:o,index:i,sdp:t},e)}),nr=t=>{let{container:e,token:n,confOption:o,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}=t||{},{instance:P,element:h}=Ie({container:e,token:n,getRemoteSdpParam:o,getRemoteSdpResult:tr,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}),y=U(L({},P),{setConfOption:S=>P.setOption&&P.setOption(S)});return delete y.setOption,{instance:y,element:h}},Zt=nr;var or=F.closeAllStorageDialog;return rr;})();
package/dist/main.es.css CHANGED
@@ -1 +1 @@
1
- .bvplayer-common-flex-space{display:inline-block;flex:1}.bvplayer-icon{display:inline-block;height:22px;width:100%;vertical-align:middle}.bvplayer-icon svg{height:100%;width:100%}.bvplayer-modal{position:absolute;top:0;left:0;padding:12px 16px;font-size:14px;border:1px solid #2b303b;border-radius:3px;background:rgba(22,27,29,.8);color:#fff;box-shadow:0 0 20px -6px #000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);overflow:hidden;visibility:hidden;opacity:0;transform:scale(0);will-change:transform,opacity;transition:all .3s cubic-bezier(.785,.135,.15,.86)}.bvplayer-modal.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:scale(1)}.bvplayer-modal--center{top:50%;left:50%;margin:auto;transform:translate(-50%,-50%) scale(0)}.bvplayer-modal--center.bvplayer-common-is-visible{transform:translate(-50%,-50%)}.bvplayer-modal_title-bar{display:flex;justify-content:space-between;margin-bottom:8px;font-size:16px}.bvplayer-modal_title-bar_close{cursor:pointer}.bvplayer-modal_body{padding:8px;overflow:hidden;overflow-y:auto;width:280px;min-height:205px;display:flex;justify-content:center}.bvplayer-spinner{position:absolute;top:0;left:0;height:100%;width:100%}.bvplayer-spinner>span{display:inline-block;position:absolute;top:50%;left:50%;margin:-18px 0 0 -18px;height:36px;width:36px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KICAgICB2aWV3Qm94PSIwIDAgMjQgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICAgICAgPHJlY3QgeD0iMCIgeT0iNy42NDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNC43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMHMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iaGVpZ2h0IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iMTA7IDIwOyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8L3JlY3Q+DQogICAgPHJlY3QgeD0iOCIgeT0iNS4xNDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxOS43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJoZWlnaHQiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgMjA7IDEwIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4NCiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjAuMTVzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICA8cmVjdCB4PSIxNiIgeT0iNy4zNTg0IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNS4yODMyIiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIg0KICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyAyMDsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgNTsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICAgIDwvc3ZnPg==);mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KICAgICB2aWV3Qm94PSIwIDAgMjQgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICAgICAgPHJlY3QgeD0iMCIgeT0iNy42NDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNC43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMHMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iaGVpZ2h0IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iMTA7IDIwOyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8L3JlY3Q+DQogICAgPHJlY3QgeD0iOCIgeT0iNS4xNDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxOS43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJoZWlnaHQiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgMjA7IDEwIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4NCiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjAuMTVzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICA8cmVjdCB4PSIxNiIgeT0iNy4zNTg0IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNS4yODMyIiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIg0KICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyAyMDsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgNTsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICAgIDwvc3ZnPg==)}.bvplayer-spinner>span svg{height:100%}.bvplayer-mask{height:100%;width:100%;position:absolute;top:0;left:0;display:grid;align-content:center;justify-content:center;place-content:center;background-color:#000;color:#fff;font-size:14px}.bvplayer-slider{cursor:pointer;position:relative;width:100%;height:3px;line-height:3px;background:#aaa;transition:all .3s ease-in-out}.bvplayer-slider_inner{position:absolute;bottom:0;left:0;height:100%;transition:all .1s ease;background:#fff}.bvplayer-slider_thumb{cursor:pointer;position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;transition:all .3s ease-in-out;background:#fff}.bvplayer-slider_suffix{position:absolute;visibility:visible;display:inline-block;width:calc(100% + 28px);text-align:right;color:#fff;opacity:.8;font-size:12px}.bvplayer-controller{position:absolute;bottom:0;left:0;right:0;width:100%;height:98px;color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden;opacity:0;transform:translateY(100%);will-change:visibility,opacity,transform;transition:all .3s cubic-bezier(.455,.03,.515,.955)}.bvplayer-controller.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:translateY(0)}.bvplayer-controller_mask{position:absolute;bottom:0;height:100%;width:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.bvplayer-controller_inner{position:absolute;bottom:0;left:0;right:0;width:100%;height:41px;padding:0 20px;display:flex;align-items:stretch;justify-content:space-between}.bvplayer-controller_inner_bar{display:block}.bvplayer-controller_inner_bar *{vertical-align:middle}.bvplayer-controller_inner_left{cursor:default}.bvplayer-controller_inner_right{cursor:default}.bvplayer-controller_button{cursor:pointer;display:inline-block;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:36px;height:100%;border:none;outline:none;padding:0;background:none;color:inherit}.bvplayer-controller_button:not(:last-child){margin-right:8px}.bvplayer-controller_button>*{transition:all .2s ease-in-out;opacity:.8}.bvplayer-controller_button:hover>*{opacity:1}.bvplayer-controller_volume{display:inline-block}.bvplayer-controller_volume--active .bvplayer-slider,.bvplayer-controller_volume:hover .bvplayer-slider{width:45px!important}.bvplayer-controller_volume--active .bvplayer-slider_thumb,.bvplayer-controller_volume:hover .bvplayer-slider_thumb{transform:scale(1)!important}.bvplayer-controller_volume--active .bvplayer-slider_suffix,.bvplayer-controller_volume:hover .bvplayer-slider_suffix{visibility:visible}.bvplayer-controller_volume .bvplayer-controller_button{margin-right:5px}.bvplayer-controller_volume .bvplayer-slider{display:inline-block;width:0}.bvplayer-controller_volume .bvplayer-slider_thumb{transform:scale(0)}.bvplayer-controller_volume .bvplayer-slider_suffix{visibility:hidden}.bvplayer-video{display:block;pointer-events:none;box-sizing:border-box;width:100%;height:100%}.bvplayer-player{position:relative;height:100%;width:100%;background-color:#000;overflow:hidden}.bvplayer-player_info-modal_section{margin-bottom:16px}.bvplayer-player_info-modal_section_title{display:inline-block;font-weight:bold;font-size:12px;margin-bottom:8px}.bvplayer-player_info-modal_list{font-size:12px}.bvplayer-player_info-modal_list_item:not(:last-child){margin-bottom:8px}.bvplayer-player_info-modal_list_item_label{display:inline-block;width:90px;margin-right:14px;text-indent:-99em;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:top}.bvplayer-player_info-modal_list_item_value{margin-right:8px;white-space:normal;word-break:break-all}
1
+ .bvplayer-common-flex-space{display:inline-block;flex:1}.bvplayer-icon{display:inline-block;height:22px;width:100%;vertical-align:middle}.bvplayer-icon svg{height:100%;width:100%}.bvplayer-modal{position:absolute;top:0;left:0;padding:12px 16px;font-size:14px;border:1px solid #2b303b;border-radius:3px;background:rgba(22,27,29,.8);color:#fff;box-shadow:0 0 20px -6px #000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);overflow:hidden;visibility:hidden;opacity:0;transform:scale(0);will-change:transform,opacity;transition:all .3s cubic-bezier(.6,-.28,.735,.045)}.bvplayer-modal.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:scale(1);transition:all .2s cubic-bezier(.785,.135,.15,.86)}.bvplayer-modal--center{top:50%;left:50%;margin:auto;transform:translate(-50%,-50%) scale(0)}.bvplayer-modal--center.bvplayer-common-is-visible{transform:translate(-50%,-50%)}.bvplayer-modal_title-bar{display:flex;justify-content:space-between;margin-bottom:8px;font-size:16px}.bvplayer-modal_title-bar_close{cursor:pointer}.bvplayer-modal_body{padding:8px;overflow:hidden;overflow-y:auto}.bvplayer-spinner{position:absolute;top:0;left:0;height:100%;width:100%}.bvplayer-spinner>span{display:inline-block;position:absolute;top:50%;left:50%;margin:-18px 0 0 -18px;height:36px;width:36px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KICAgICB2aWV3Qm94PSIwIDAgMjQgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICAgICAgPHJlY3QgeD0iMCIgeT0iNy42NDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNC43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMHMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iaGVpZ2h0IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iMTA7IDIwOyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8L3JlY3Q+DQogICAgPHJlY3QgeD0iOCIgeT0iNS4xNDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxOS43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJoZWlnaHQiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgMjA7IDEwIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4NCiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjAuMTVzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICA8cmVjdCB4PSIxNiIgeT0iNy4zNTg0IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNS4yODMyIiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIg0KICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyAyMDsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgNTsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICAgIDwvc3ZnPg==);mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIg0KICAgICB2aWV3Qm94PSIwIDAgMjQgMzAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICAgICAgPHJlY3QgeD0iMCIgeT0iNy42NDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNC43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMHMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iaGVpZ2h0IiBhdHRyaWJ1dGVUeXBlPSJYTUwiIHZhbHVlcz0iMTA7IDIwOyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjBzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8L3JlY3Q+DQogICAgPHJlY3QgeD0iOCIgeT0iNS4xNDE2IiB3aWR0aD0iNCIgaGVpZ2h0PSIxOS43MTY4IiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlPg0KICAgICAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJoZWlnaHQiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgMjA7IDEwIiBiZWdpbj0iMC4xNXMiIGR1cj0iMC42cyINCiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiPjwvYW5pbWF0ZT4NCiAgICAgICAgPGFuaW1hdGUgYXR0cmlidXRlTmFtZT0ieSIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyA1OyAxMCIgYmVnaW49IjAuMTVzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICA8cmVjdCB4PSIxNiIgeT0iNy4zNTg0IiB3aWR0aD0iNCIgaGVpZ2h0PSIxNS4yODMyIiBvcGFjaXR5PSIwLjIiPg0KICAgICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIwLjI7IDE7IC4yIiBiZWdpbj0iMC4zcyIgZHVyPSIwLjZzIg0KICAgICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9ImhlaWdodCIgYXR0cmlidXRlVHlwZT0iWE1MIiB2YWx1ZXM9IjEwOyAyMDsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9InkiIGF0dHJpYnV0ZVR5cGU9IlhNTCIgdmFsdWVzPSIxMDsgNTsgMTAiIGJlZ2luPSIwLjNzIiBkdXI9IjAuNnMiDQogICAgICAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGU+DQogICAgICAgIDwvcmVjdD4NCiAgICAgIDwvc3ZnPg==)}.bvplayer-spinner>span svg{height:100%}.bvplayer-mask{height:100%;width:100%;position:absolute;top:0;left:0;display:grid;align-content:center;justify-content:center;place-content:center;background-color:#000;color:#fff;font-size:14px}.bvplayer-slider{cursor:pointer;position:relative;width:100%;height:3px;line-height:3px;background:#aaa;transition:all .3s ease-in-out}.bvplayer-slider_inner{position:absolute;bottom:0;left:0;height:100%;transition:all .1s ease;background:#fff}.bvplayer-slider_thumb{cursor:pointer;position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;transition:all .3s ease-in-out;background:#fff}.bvplayer-slider_suffix{position:absolute;visibility:visible;display:inline-block;width:calc(100% + 28px);text-align:right;color:#fff;opacity:.8;font-size:12px}.bvplayer-controller{position:absolute;bottom:0;left:0;right:0;width:100%;height:98px;color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;visibility:hidden;opacity:0;transform:translateY(100%);will-change:visibility,opacity,transform;transition:all .3s cubic-bezier(.455,.03,.515,.955)}.bvplayer-controller.bvplayer-common-is-visible{visibility:visible;opacity:1;transform:translateY(0)}.bvplayer-controller_mask{position:absolute;bottom:0;height:100%;width:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom}.bvplayer-controller_inner{position:absolute;bottom:0;left:0;right:0;width:100%;height:41px;padding:0 20px;display:flex;align-items:stretch;justify-content:space-between}.bvplayer-controller_inner_bar{display:block}.bvplayer-controller_inner_bar *{vertical-align:middle}.bvplayer-controller_inner_left{cursor:default}.bvplayer-controller_inner_right{cursor:default}.bvplayer-controller_button{cursor:pointer;display:inline-block;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:36px;height:100%;border:none;outline:none;padding:0;background:none;color:inherit}.bvplayer-controller_button:not(:last-child){margin-right:8px}.bvplayer-controller_button>*{transition:all .2s ease-in-out;opacity:.8}.bvplayer-controller_button:hover>*{opacity:1}.bvplayer-controller_volume{display:inline-block}.bvplayer-controller_volume--active .bvplayer-slider,.bvplayer-controller_volume:hover .bvplayer-slider{width:45px!important}.bvplayer-controller_volume--active .bvplayer-slider_thumb,.bvplayer-controller_volume:hover .bvplayer-slider_thumb{transform:scale(1)!important}.bvplayer-controller_volume--active .bvplayer-slider_suffix,.bvplayer-controller_volume:hover .bvplayer-slider_suffix{visibility:visible}.bvplayer-controller_volume .bvplayer-controller_button{margin-right:5px}.bvplayer-controller_volume .bvplayer-slider{display:inline-block;width:0}.bvplayer-controller_volume .bvplayer-slider_thumb{transform:scale(0)}.bvplayer-controller_volume .bvplayer-slider_suffix{visibility:hidden}.bvplayer-video{position:absolute;display:block;pointer-events:none;box-sizing:border-box;width:100%;height:100%}.bvplayer-player{position:relative;height:100%;width:100%;background-color:#000;overflow:hidden}.bvplayer-player_info-modal .bvplayer-modal_body{width:280px;min-height:205px;display:flex;justify-content:center}.bvplayer-player_info-modal_section{margin-bottom:16px}.bvplayer-player_info-modal_section_title{display:inline-block;font-weight:bold;font-size:12px;margin-bottom:8px}.bvplayer-player_info-modal_list{font-size:12px}.bvplayer-player_info-modal_list_item:not(:last-child){margin-bottom:8px}.bvplayer-player_info-modal_list_item_label{display:inline-block;width:90px;margin-right:14px;text-indent:-99em;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:top}.bvplayer-player_info-modal_list_item_value{margin-right:8px;white-space:normal;word-break:break-all}
package/dist/main.es.js CHANGED
@@ -1,4 +1,4 @@
1
- var Gt=Object.defineProperty,Xt=Object.defineProperties;var qt=Object.getOwnPropertyDescriptors;var nt=Object.getOwnPropertySymbols;var Qt=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable;var ot=(t,e,n)=>e in t?Gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e)=>{for(var n in e||(e={}))Qt.call(e,n)&&ot(t,n,e[n]);if(nt)for(var n of nt(e))Zt.call(e,n)&&ot(t,n,e[n]);return t},U=(t,e)=>Xt(t,qt(e));var p=(t,e,n)=>new Promise((o,i)=>{var s=c=>{try{f(n.next(c))}catch(m){i(m)}},a=c=>{try{f(n.throw(c))}catch(m){i(m)}},f=c=>c.done?o(c.value):Promise.resolve(c.value).then(s,a);f((n=n.apply(t,e)).next())});var Yt="production",jt="@besovideo/webrtc-player",en="0.3.7",d={NODE_ENV:Yt,SH_LIB_NAME:jt,SH_LIB_VERSION:en};var tn=Object.defineProperty,nn=Object.defineProperties,on=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,rn=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,it=(t,e,n)=>e in t?tn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Q=(t,e)=>{for(var n in e||(e={}))rn.call(e,n)&&it(t,n,e[n]);if(rt)for(var n of rt(e))sn.call(e,n)&&it(t,n,e[n]);return t},ln=(t,e)=>nn(t,on(e)),M;(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"})(M||(M={}));var st=class{constructor(){this.colors=M,this.shapes={slider:new lt}}},lt=class{constructor(){}title(t=""){return Z`
1
+ var Xt=Object.defineProperty,qt=Object.defineProperties;var Qt=Object.getOwnPropertyDescriptors;var nt=Object.getOwnPropertySymbols;var Zt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable;var ot=(t,e,n)=>e in t?Xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e)=>{for(var n in e||(e={}))Zt.call(e,n)&&ot(t,n,e[n]);if(nt)for(var n of nt(e))Yt.call(e,n)&&ot(t,n,e[n]);return t},U=(t,e)=>qt(t,Qt(e));var p=(t,e,n)=>new Promise((o,i)=>{var s=c=>{try{f(n.next(c))}catch(m){i(m)}},a=c=>{try{f(n.throw(c))}catch(m){i(m)}},f=c=>c.done?o(c.value):Promise.resolve(c.value).then(s,a);f((n=n.apply(t,e)).next())});var jt="production",en="@besovideo/webrtc-player",tn="0.4.1",d={NODE_ENV:jt,SH_LIB_NAME:en,SH_LIB_VERSION:tn};var nn=Object.defineProperty,on=Object.defineProperties,rn=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,sn=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable,it=(t,e,n)=>e in t?nn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Q=(t,e)=>{for(var n in e||(e={}))sn.call(e,n)&&it(t,n,e[n]);if(rt)for(var n of rt(e))ln.call(e,n)&&it(t,n,e[n]);return t},an=(t,e)=>on(t,rn(e)),M;(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"})(M||(M={}));var st=class{constructor(){this.colors=M,this.shapes={slider:new lt}}},lt=class{constructor(){}title(t=""){return Z`
2
2
  color: ${t};
3
3
  border-left: 3px solid ${t};
4
4
  padding: 2px;
@@ -11,7 +11,7 @@ var Gt=Object.defineProperty,Xt=Object.defineProperties;var qt=Object.getOwnProp
11
11
  padding: 2px 5px;
12
12
  border-radius: 3px;
13
13
  text-shadow: 0 0 2px ${n};
14
- `}},Z=(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},J;(function(t){t[t.title=1]="title",t[t.message=2]="message",t[t.message_button=3]="message_button"})(J||(J={}));var le=({color:t},e=new lt,n)=>{switch(n){case 1:return e.title(t);case 2:return e.message(t);case 3:return e.message_button();default:return""}},an=class{constructor(t){let e={log:window.console.log,enable:!0};this._option=ln(Q({},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}},at=class{constructor(t){let e={enable:!0,log:window.console.log,level:39,shape:new st().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}},cn=class extends an{constructor(t){super(t||new at);this.loggerOption=Q(Q({},new at),t)}setLoggerOption(t){let e=Q(Q({},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)}},ct;(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"})(ct||(ct={}));var A={debug:{name:"debug",title:" Debug :",color:M.lime,level:3},http:{name:"http",title:" Http :",color:M.weakBlue,level:3},api:{name:"api",title:" Api :",color:M.cyan,level:3},service:{name:"service",title:" Service :",color:M.purple,level:2},interval:{name:"interval",title:" Interval :",color:M.pink,level:1},warn:{name:"warn",title:" WARN :",color:M.orange,level:1},error:{name:"error",title:" ERR :",color:M.red,level:0},key:{name:"key",title:" Key :",color:M.darkPurple,level:0}},Ce=class extends cn{constructor(){super(...arguments);this.error=(t,...e)=>{this.formatShapeLog(A.error,`${t instanceof Error?t.stack:t}
14
+ `}},Z=(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},J;(function(t){t[t.title=1]="title",t[t.message=2]="message",t[t.message_button=3]="message_button"})(J||(J={}));var le=({color:t},e=new lt,n)=>{switch(n){case 1:return e.title(t);case 2:return e.message(t);case 3:return e.message_button();default:return""}},cn=class{constructor(t){let e={log:window.console.log,enable:!0};this._option=an(Q({},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}},at=class{constructor(t){let e={enable:!0,log:window.console.log,level:39,shape:new st().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}},dn=class extends cn{constructor(t){super(t||new at);this.loggerOption=Q(Q({},new at),t)}setLoggerOption(t){let e=Q(Q({},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)}},ct;(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"})(ct||(ct={}));var A={debug:{name:"debug",title:" Debug :",color:M.lime,level:3},http:{name:"http",title:" Http :",color:M.weakBlue,level:3},api:{name:"api",title:" Api :",color:M.cyan,level:3},service:{name:"service",title:" Service :",color:M.purple,level:2},interval:{name:"interval",title:" Interval :",color:M.pink,level:1},warn:{name:"warn",title:" WARN :",color:M.orange,level:1},error:{name:"error",title:" ERR :",color:M.red,level:0},key:{name:"key",title:" Key :",color:M.darkPurple,level:0}},Ce=class extends dn{constructor(){super(...arguments);this.error=(t,...e)=>{this.formatShapeLog(A.error,`${t instanceof Error?t.stack:t}
15
15
  `,...e)},this.key=(t,...e)=>{let n=A.key;this.formatLog(n.level,n.title,t.toUpperCase(),le({color:n.color},this.getLoggerOption().shape,J.title),le({},this.getLoggerOption().shape,J.message_button),...e)},this.version=(t="",e,...n)=>{this.formatLog(0,t.toUpperCase(),e,Z`
16
16
  background: linear-gradient(to right, #009fff, #ec2f4b);
17
17
  color: white;
@@ -22,5 +22,5 @@ var Gt=Object.defineProperty,Xt=Object.defineProperties;var qt=Object.getOwnProp
22
22
  background-color: ${M.darkPurple};
23
23
  color: white;
24
24
  padding: 2px 5px;
25
- `,...n)}}formatShapeLog({level:t,title:e,color:n},o,...i){this.formatLog(t,e,o,le({color:n},this.getLoggerOption().shape,J.title),le({color:n},this.getLoggerOption().shape,J.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)}},ir=new st,dn=new Ce,un=dn,V=un;var dt=class extends Ce{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)}}},Pe=new dt;Pe.debug("player-core env:",d);Pe.version(d.SH_LIB_NAME,d.SH_LIB_VERSION||"");var l=Pe;var pn=Array.isArray,mn=t=>t!==t,ut=t=>typeof t=="number",pt=t=>typeof t=="string",fn=t=>ut(t)||pt(t),gn=t=>typeof t=="function",hn=t=>typeof t=="undefined",vn=t=>t?!1:!!(t!=null?t:!0),yn={isArr:pn,baseIsNaN:mn,isString:pt,isNumber:ut,isText:fn,isFn:gn,isUndefined:hn,isNullOrUndefined:vn},R=yn;function bn(t,e=[]){let n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function In(t,e,n){let o=n-1,i=t.length;for(;++o<i;)if(t[o]===e)return o;return-1}function Cn(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 Pn(t,e,n){return e===e?In(t,e,n):Cn(t,R.baseIsNaN,n)}function wn(t,e){let n=-1,o=e.length,i=t;for(t===e&&(e=bn(e));++n<o;){let s=0,a=e[n],f=a;for(;(s=Pn(i,f,s))>-1;)i!==t&&[].splice.call(i,s,1),[].splice.call(t,s,1)}return t}var En=t=>t?R.isArr(t)?t:[t]:[],_n=(t,e)=>!t||!t.length||!e||!e.length?t:wn(t,e),Sn=(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){l.libError("util screenshot canvas\u7684\u8F93\u51FA\u4E3A\u7A7A\u503C");return}let i=URL.createObjectURL(o),s=document.createElement("a");s.href=i,s.download=`${e}.png`,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)})},xn=(t,e,n)=>Math.max(Math.min(t,n),e),Tn={pullAll:_n,toArray:En,screenshot:Sn,restrict:xn},D=Tn;function Mn(t){return t!=null&&t!==!0&&t!==!1}function mt(t,e=[]){return t.forEach(n=>{R.isArr(n)?mt(n,e):Mn(n)&&e.push(R.isText(n)?Rn(n):n)}),e}function Ln(t={},e){if(!e)return;Object.keys(t).forEach(o=>{if(o==="children")return;let i=t[o];R.isNullOrUndefined(i)||(o.startsWith("on")?e.addEventListener(o.substring(2).toLowerCase(),i):e instanceof Element?e.setAttribute(o==="className"?"class":o,i):e[o]=i)})}function Rn(t){return{type:"",props:{nodeValue:String(t)+""}}}function kn(t,e){return t===""?document.createTextNode(""):e?document.createElementNS(e,t):document.createElement(t)}function Y(t,e,n){let o=e?e(t):t;if(!o)return null;if(R.isArr(o)){let a=document.createDocumentFragment();return o.forEach(f=>{let c=Y(f,e);c&&a.appendChild(c)}),a}let{props:i,type:s}=o;if(!i)return o instanceof Node||o instanceof Text?(l.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):(l.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(R.isString(s)){let a=kn(s,i.xmlns||n);return Ln(i,a),(i.children||[]).forEach(c=>{let m=Y(c,e,i.xmlns);!m||a.appendChild(m)}),a}if(R.isFn(s)){let a=s(i);return Y(a,e)}return null}function Fn(t,e,...n){return e=e||{},n=mt(D.toArray(e.children||n)),e.children=n,{type:t,props:e}}var Nn=t=>t.children,On={h:Fn,Fragment:Nn},r=On;var we=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)},ft=t=>{let e=typeof t=="number"?t:we(t),n=we();return e-n},Vn=t=>ft(t)>0,Dn={getUTCSecond:we,pastNow:ft,compare:Vn},Ee=Dn;var gt=(t,e,n)=>{let o={value:e,expire:n},i=JSON.stringify(o);return localStorage.setItem(t,i),o},Bn=(t,e,n)=>{let i=Ee.getUTCSecond()+n;return gt(t,e,i)},An=(t,e=!1)=>{let n=localStorage.getItem(t);if(!n)return null;try{let o=JSON.parse(n);return e?o:o.expire?Ee.compare(o.expire)?o.value:null:o.value}catch(o){l.error(o,n,"Storage\u8BFB\u53D6\u6570\u636E\u65F6\uFF0C JSON\u89E3\u6790\u51FA\u9519")}},Hn=t=>localStorage.removeItem(t),Wn={set:gt,setTimeout:Bn,get:An,remove:Hn},B=Wn;var ae;(function(n){n.GET="GET",n.POST="POST"})(ae||(ae={}));var ht=(t,e)=>p(void 0,null,function*(){let n=new AbortController;if(e.signal&&e.signal.addEventListener("abort",()=>{n.abort()}),e.timeout){let a=setTimeout(()=>{n.abort()},e.timeout);n.signal.addEventListener("abort",()=>{clearTimeout(a)})}let o=e.bodyData,i=o&&(typeof o=="object"?JSON.stringify(o):o),s={credentials:"same-origin",method:e.method,headers:new Headers(L({},e.headers)),signal:n.signal};i&&(s.body=i),l.http("\u53D1\u9001\u8BF7\u6C42\uFF1A",t,U(L({},s),{body:o}));try{let a=yield fetch(t,s);if(l.http("\u8BF7\u6C42\u54CD\u5E94\uFF1A",t,a,yield a.clone().text()),a.ok||a.status>=200&&a.status<300){let f=a.headers.get("content-type")||"";if(/application\/json/i.test(f))return yield a.json()}else throw new Error(`${a.status} ${a.statusText}`)}catch(a){if(a.name==="AbortError"){l.http("\u8BF7\u6C42\u53D6\u6D88\uFF1A",s);return}throw a}}),$n=(t,e,n)=>p(void 0,null,function*(){let o=e?e.toString():"";return yield ht(t+o,{method:ae.GET,headers:n==null?void 0:n.headers})}),zn=(t,e,n)=>p(void 0,null,function*(){return yield ht(t,{method:ae.POST,headers:L({"Content-Type":"application/json;charset=UTF-8"},n==null?void 0:n.headers),bodyData:e})}),Un={get:$n,post:zn},ce=Un;var vt={BVCSP_V1:{path:"/bvcsp/v1",prefix:""}},_e=t=>{let e=vt[t];return e.prefix+e.path},Jn=(t,e)=>{let n=vt[t];return n.prefix=e||"",_e(t)},j={setApiPrefix:Jn,getApiURL:_e,bvscpV1:()=>_e("BVCSP_V1")},ee=t=>{j.setApiPrefix("BVCSP_V1",t)};function Kn(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}function Gn(t,e,n){if(!t)return;let o=document.createDocumentFragment();o.appendChild(t);let i=Kn(e);!i||(i.appendChild(o),n==null||n())}var yt=Gn;var de=(...t)=>{let e=[];for(let n=0;n<t.length;n++){let o=t[n];if(!o)continue;let i=typeof o;if(R.isText(o))e.push(o);else if(Array.isArray(o)){if(o.length){let s=de(...o);s&&e.push(s)}}else if(i==="object")if(o.toString==={}.toString)for(let s in o)({}).hasOwnProperty.call(o,s)&&o[s]&&e.push(s);else e.push(o.toString())}return e.join(" ")},bt=t=>t?t.replace(/\s*(;|\{|\})+\s*[\n\r]*/g,"$1"):"",Xn=(t,...e)=>{if(!e.length)return bt(t[0]);let n="";return e.forEach((o,i)=>{n+=t[i]+o}),n+=t[t.length-1],bt(n)},Se="bvplayer-",qn="common-",It=t=>new RegExp(Se).test(t),Qn=(...t)=>de(t).split(" ").map(e=>It(e)?e:Se+e).join(" "),Zn=(...t)=>de(t).split(" ").map(e=>It(e)?e:Se+qn+e).join(" ");var Yn={cls:de,css:Xn,prefixCls:Qn,commonCls:Zn},te=Yn;function jn(t){return document.createRange().createContextualFragment(t)}function eo(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function xe(){return document.createDocumentFragment()}function to(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function no(t,...e){if(!t)return;let n=xe();n.append(...e.filter(o=>o)),t.appendChild(n)}function oo(t){if(!!t)if(t instanceof Element){t.innerHTML="";return}else for(;t.firstChild;)t.removeChild(t.firstChild)}function ro(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=xe();o.append(...n),t.parentNode.replaceChild(o,t)}}function io(t){var e;if(!!t)if(t instanceof Element){t.remove();return}else(e=t.parentNode)==null||e.removeChild(t)}function so(t){if(!t)return 0;let e=t.offsetLeft,n=t.offsetParent;if(n instanceof HTMLElement){let o=document.body.scrollLeft+document.documentElement.scrollLeft;if(!document.fullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement)for(;n!==null;)e+=n.offsetLeft,n=n.offsetParent;else for(;n!==null&&n!==t;)e+=n.offsetLeft,n=n.offsetParent;return e-o}return 0}function lo(t){if(!t||!t.props)return t;let{props:e}=t;return e.withCommonNamespace&&(e.className=te.commonCls(e.className),delete e.withCommonNamespace),e.withNamespace&&(e.className=te.prefixCls(e.className),delete e.withNamespace),t}function ao(t){return t?Y(t,lo):null}var co={parseHtml:jn,create:eo,createFragment:xe,createHtmlElement:to,createByJsx:ao,append:no,empty:oo,replace:ro,removeSelf:io,getElementViewLeft:so},Ct=co;var uo="bvplayerCore",po=t=>uo+t,mo={createPrefixStorageField:po},Pt=mo;var fo={render:yt,style:te,dom:Ct,field:Pt},u=fo;var H=u.field.createPrefixStorageField("DialogIds"),go=(t,e)=>p(void 0,null,function*(){var a;let n={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield ce.post(`${j.bvscpV1()}/dialog/device/webrtc`,o,{headers:n});if(l.api("\u8BBE\u5907\u97F3\u89C6\u9891\u6D41 webrtc\u65B9\u5F0F\u6253\u5F00dialog: ",{params:o,resData:i}),!i||i.code!==0||!((a=i.data)==null?void 0:a.dialogid))throw new Error(`\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25\uFF0C ${i.msg}`);let{data:s}=i;if(s.dialogid){let f=B.get(H)||[];f.push(s.dialogid),B.set(H,f)}return{dialogId:s.dialogid,sdp:s.sdp}}),ho=(t,e)=>p(void 0,null,function*(){var f;let n={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield ce.post(`${j.bvscpV1()}/dialog/conference/webrtc`,o,{headers:n});if(l.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,a=B.get(H)||[];return a.push(s.dialogid),B.set(H,a),{dialogId:s.dialogid,sdp:s.sdp}}),vo=(t,e)=>p(void 0,null,function*(){if(!t)return;let n={Authorization:e||""};return l.api("\u5173\u95EDdialog\uFF1A",t),yield ce.post(`${j.bvscpV1()}/dialog/close/${t}`,{},{headers:n})}),wt=(t,e)=>p(void 0,null,function*(){let n=B.get(H)||[];D.pullAll(n,t),B.set(H,n,0);let i=(yield Promise.allSettled(t.map(s=>vo(s,e)))).filter(s=>s.status==="rejected");i&&i.length>0&&l.error(new Error(`"\u5173\u95ED\u5B58\u50A8\u7684dialog\u65F6\u5931\u8D25\uFF1A", ${i}`))}),yo=t=>p(void 0,null,function*(){let e=B.get(H);!e||e.length<1||(B.remove(H),yield wt(e,t))}),bo={getDeviceWebrtc:go,getConferenceWebrtc:ho,closeDialogs:wt,closeAllStorageDialog:yo},F=bo;var Et=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 a=o[s];a&&a(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))}},ne=class{constructor(){this._notifier=new Et}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 ne{constructor(e,n,o){super();this.name="";let i=n.trim().toLowerCase(),s=o?o.trim():i,a=u.dom.create(e,u.style.prefixCls(s));this.name=i,this.el=a}empty(){u.dom.empty(this.el)}unmount(){var e;l.debug("unmount",this.el,(e=this.el)==null?void 0:e.parentNode),u.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;l.debug("destroy complete",this)}}getEl(){return this.el}};var _t=class extends E{constructor(e){super("div","mask",u.style.cls("mask"));this._visible=!!(e==null?void 0:e.visible),this._text=e==null?void 0:e.text,this._textEl=u.dom.create("span",u.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(){l.debug("mask visible: ",this._visible);let e=this.el;return e.style.display=this._visible?"block":"none",this._textEl.textContent=this._text||"",u.dom.append(e,this._textEl),e}},St=_t;var xt=class extends E{constructor(e){super("div","spinner",u.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(){l.debug("spinner spin: ",this._spin);let e=this.el;e.style.display=this._spin?"block":"none";let n=u.dom.create("span");return n.style.backgroundColor="#FFF",u.dom.append(e,n),e}},Tt=xt;var Mt={contain:"contain",fill:"fill"},Lt=class extends E{constructor(e){super("video","video",u.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)||Mt.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 volume(e){let n=this.el;n.volume=Number(e)}get volume(){var e;return Number((e=this.el)==null?void 0:e.volume)}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=Mt[e],this.el.style.objectFit=this._fit}getVideoFit(){return this._fit}init(){l.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=>{l.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 p(this,null,function*(){let e=this.el;try{l.debug("video \u5C1D\u8BD5\u64AD\u653E"),yield e.play()}catch(n){l.error(n,"video \u64AD\u653E \u5931\u8D25")}})}beforeDestroy(){}},Rt=Lt;function oe(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=u.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 Te({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}function 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:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z","clip-rule":"evenodd"}))}function 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:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"}))}function Re({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M4 5a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2V7a2 2 0 00-2-2h-1.586a1 1 0 01-.707-.293l-1.121-1.121A2 2 0 0011.172 3H8.828a2 2 0 00-1.414.586L6.293 4.707A1 1 0 015.586 5H4zm6 9a3 3 0 100-6 3 3 0 000 6z","clip-rule":"evenodd"}))}function ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"}))}function Fe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M3 4a1 1 0 011-1h4a1 1 0 010 2H6.414l2.293 2.293a1 1 0 01-1.414 1.414L5 6.414V8a1 1 0 01-2 0V4zm9 1a1 1 0 110-2h4a1 1 0 011 1v4a1 1 0 11-2 0V6.414l-2.293 2.293a1 1 0 11-1.414-1.414L13.586 5H12zm-9 7a1 1 0 112 0v1.586l2.293-2.293a1 1 0 011.414 1.414L6.414 15H8a1 1 0 110 2H4a1 1 0 01-1-1v-4zm13-1a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 110-2h1.586l-2.293-2.293a1 1 0 011.414-1.414L15 13.586V12a1 1 0 011-1z","clip-rule":"evenodd"}))}function Ne({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Oe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"}))}function 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:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}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:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"}))}function Be({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"}))}function Ae({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"}))}function 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:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}))}function We({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z","clip-rule":"evenodd"}))}function $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:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z","clip-rule":"evenodd"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"}))}function ze({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM12.293 7.293a1 1 0 011.414 0L15 8.586l1.293-1.293a1 1 0 111.414 1.414L16.414 10l1.293 1.293a1 1 0 01-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 01-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 010-1.414z","clip-rule":"evenodd"}))}function Ue({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Je({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"}))}function Ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Ge({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"}))}function Xe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 32 33",fill:"currentColor"},r.h("path",{d:"M6.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v4h4c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333zM30.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h4v-4c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM30.667 12c-0.8 0-1.333-0.533-1.333-1.333v-4h-4c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM1.333 12c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-4v4c0 0.8-0.533 1.333-1.333 1.333z"}))}var N=({children:t,className:e})=>{let n=u.style.cls(["icon",e]);return r.h("span",{className:n,withNamespace:!0},t)},Io=({filled:t})=>r.h(N,null,t?r.h(Me,null):r.h(Te,null)),Co=({filled:t})=>r.h(N,null,t?r.h(Re,null):r.h(Le,null)),Po=({filled:t})=>r.h(N,null,t?r.h(Oe,null):r.h(Ne,null)),wo=({filled:t})=>r.h(N,null,t?r.h(Fe,null):r.h(ke,null)),Eo=({filled:t,circle:e})=>e?r.h(N,null,t?r.h(De,null):r.h(Ve,null)):r.h(N,null,t?r.h(Ae,null):r.h(Be,null)),_o=({filled:t,off:e})=>e?r.h(N,null,t?r.h(ze,null):r.h($e,null)):r.h(N,null,t?r.h(We,null):r.h(He,null)),So=({filled:t,off:e})=>e?r.h(N,null,t?r.h(Ge,null):r.h(Ke,null)):r.h(N,null,t?r.h(Je,null):r.h(Ue,null)),xo=()=>r.h(N,null,r.h(Xe,null)),To={Cog:Io,Camera:Co,Info:Po,ArrowsExpand:wo,X:Eo,Volume:_o,Play:So,Full:xo};var _=To;var W="modal",kt=class extends E{constructor(e){super("div",W,u.style.cls([W,e.className,{[`${W}--center`]:e.center}]));this.container=e.container,this.title=e.title,this._content=e.content||u.dom.create("div","test"),this._center=!!e.center}set content(e){let n=u.dom.createByJsx(e);l.debug("modal update content",n,this._content),u.dom.replace(this._content,n),this._content=n}show(){var e;(e=this.el)==null||e.classList.toggle(u.style.prefixCls(`${W}--center`),!!this._center),u.dom.append(this.container,this.el)}hide(){}clear(){!this.el||(this.el.innerHTML="")}beforeDestroy(){}init(){this.clear(),l.debug("\u6E32\u67D3ModalPlugin \u5F39\u7A97\u5BF9\u8C61",this,this.el);let e=this.el,n=u.dom.createByJsx(r.h(r.Fragment,null,r.h("div",{className:`${W}_title-bar`,onClick:()=>this.dispatch("hide"),withNamespace:!0},r.h("span",{className:`${W}_title-bar_title`,withNamespace:!0},this.title),r.h("span",{className:`${W}_title-bar_close`,withNamespace:!0},r.h(_.X,null))),r.h("div",{className:`${W}_body`,withNamespace:!0},this._content)));return u.dom.append(e,n),e}},Mo=oe(kt),qe=class extends Mo{},Ft=qe;var Nt="controller_button",Ot=class extends E{constructor(e,n,o){super("button",Nt,u.style.cls([Nt,o]));this._Children=e,this.title=n}set Children(e){!this.el||(this._Children=e,this.empty(),u.dom.append(this.el,u.dom.createByJsx(e)))}beforeDestroy(){}init(){let e=this.el;return e.addEventListener("click",()=>this.dispatch("click")),e.title=this.title||"",u.dom.append(e,u.dom.createByJsx(this._Children)),e}},K=Ot;var re="slider",Vt=class extends E{constructor(e){super("div",re,u.style.cls([re,e]));this._percent=0;this._anyWidth=35}set percent(e){!this.el||(this._percent=D.restrict(e,0,1),!!this._innerEl&&(this._innerEl.style.width=this._percent*100+"%",!!this._suffixEl&&(this._suffixEl.innerHTML=Number(this._percent).toFixed(1))))}get percent(){return this._percent}beforeDestroy(){}init(e){let n=this.el,o=a=>{l.debug("handleThumbMove");let f=(a.clientX-u.dom.getElementViewLeft(this.el)-5.5)/this._anyWidth;this.dispatch("change",{target:this,percent:D.restrict(f,0,1)}),l.debug("slider handleThumbMove",f)},i=()=>{l.debug("handleThumbMoveEnd"),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i),this.dispatch("confirm")},s=()=>{l.debug("handleThumbMoveStart"),document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)};return this._innerEl=u.dom.createByJsx(r.h("div",{className:`${re}_inner`,style:`width: ${this._percent*100+"%"}`,withNamespace:!0},r.h("span",{className:`${re}_thumb`,withNamespace:!0}))),this._suffixEl=u.dom.createByJsx(r.h("span",{className:`${re}_suffix`,withNamespace:!0},this._percent)),u.dom.append(n,this._innerEl,this._suffixEl),n.addEventListener("mousedown",s),n.addEventListener("click",o),n}},Dt=Vt;var ie="controller",Bt=class extends E{constructor(e){super("div",ie,u.style.cls(ie));this._controls=(e==null?void 0:e.controls)||[],this.PlayButton=new K(r.h(_.Play,null)),this.VolumeButton=new K(r.h(_.Volume,{off:!0}),"volume"),this.VolumeSlider=new Dt,this.VolumeSlider.percent=.3,this.InformationButton=new K(r.h(_.Info,null),"information"),this.ScreenshotButton=new K(r.h(_.Camera,null),"screenshot"),this.FullscreenButton=new K(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"))}activeVolume(){var e;(e=this._volumeEl)==null||e.classList.add(u.style.prefixCls(`${ie}_volume--active`))}hideVolume(){var e;(e=this._volumeEl)==null||e.classList.remove(u.style.prefixCls(`${ie}_volume--active`))}beforeDestroy(){}init(){l.debug("\u6E32\u67D3ControllerPlugin \u64AD\u653E\u63A7\u5236\u5668\u5BF9\u8C61",this,this.el,this._controls);let e=this.el,n=u.style.cls([`${this.name}_inner_bar`,`${this.name}_inner_left`]),o=u.style.cls([`${this.name}_inner_bar`,`${this.name}_inner_right`]);this._volumeEl=u.dom.createByJsx(r.h("div",{className:`${ie}_volume`,withNamespace:!0},this.VolumeButton.init(),this.VolumeSlider.init()));let i=u.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._volumeEl),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 u.dom.append(e,i),this.VolumeSlider.addEventListener("confirm",this.hideVolume.bind(this)),e}},Lo=oe(Bt),Qe=class extends Lo{},At=Qe;var Ht=class{constructor(){this._els=[];this.disableAutoHide=!1;this._controller=new At}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)}},Wt=Ht;var ue=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 p(this,null,function*(){let e=this.getReceiversMap();l.debug("receivers map : ",e);let n=yield Promise.all(e.get("audio").map(i=>p(this,null,function*(){let s={},a=yield i.getStats(),f=[];return a.forEach(c=>{f.push(c),c.type==="codec"&&(s.mimeType=c.mimeType,s.clockRate=c.clockRate,s.channels=c.channels),c.type==="track"&&(s.totalSamplesReceived=c.totalSamplesReceived,s.totalSamplesDuration=c.totalSamplesDuration)}),l.debug("audio stats report: ",f),s}))),o=yield Promise.all(e.get("video").map(i=>p(this,null,function*(){let s={},a=yield i.getStats(),f=[];return a.forEach(c=>{f.push(c),c.type==="codec"&&(s.mimeType=c.mimeType,s.clockRate=c.clockRate),c.type==="inbound-rtp"&&(s.frameWidth=c.frameWidth,s.frameHeight=c.frameHeight,s.framesPerSecond=c.framesPerSecond,s.framesReceived=c.framesReceived,s.framesDecoded=c.framesDecoded,s.totalInterFrameDelay=c.totalInterFrameDelay,s.keyFramesDecoded=c.keyFramesDecoded,s.packetsLost=c.packetsLost,s.lastPacketReceivedTimestamp=c.lastPacketReceivedTimestamp,s.bytesReceived=c.bytesReceived,s.totalDecodeTime=c.totalDecodeTime)}),l.debug("video stats report: ",f),s})));return{audios:n,videos:o}})}};var Ro=(t,e)=>{V.debug(`webrtc my ICE candidate:
26
- ${e.candidate?e.candidate.candidate:"(null)"}`)},ko=(t,e,n)=>{V.debug("webrtc ICE state change event: ",e),V.debug(`webrtc my ICE state: ${t==null?void 0:t.iceConnectionState}`),t&&t.iceConnectionState==="disconnected"&&n&&n()},Fo=(t,e)=>{V.debug("webrtc Connection state change, \u5F53\u524D\u8FDE\u63A5\u72B6\u6001: ",t,t.connectionState)},No=(t,e,n)=>{V.debug("webrtc \u5F53\u524D\u7684 stream: ",e.streams[0]);let o=e.streams[0];n(o)},Oo=(t,e)=>p(void 0,null,function*(){let{offerParam:n,productRemoteSdp:o,customerRTCPeerConnection:i,onConnected:s,onConnectedFailed:a,onIceDisconnected:f,onPcEventAdded:c,onLocalDescriptionReady:m}=t,b=!!i&&i instanceof RTCPeerConnection,P={},h=b?i:new RTCPeerConnection(P);if(h.addEventListener("icecandidate",y=>Ro(h,y)),h.addEventListener("iceconnectionstatechange",y=>ko(h,y,f)),h.addEventListener("connectionstatechange",y=>Fo(h,y)),h.addEventListener("track",y=>No(h,y,e)),c&&(yield c(h)),b)return new ue(h);try{let y=yield h.createOffer(n);V.debug("\u521B\u5EFAoffer\uFF0C\u53C2\u6570\uFF1A",n,"\uFF0C \u7ED3\u679C\uFF1A",y),yield h.setLocalDescription(y),m&&m(h);let I=yield o(new RTCSessionDescription(y));V.debug("webrtc recv open answer",I);let S=new RTCSessionDescription({type:"answer",sdp:I});yield h.setRemoteDescription(S),V.debug("getTransceivers",h.getTransceivers()),s&&s(h)}catch(y){throw a&&a(h),V.error(new Error(`webrtc Failed to create session description: ${y.toString()}`)),h.close(),y}return new ue(h)}),Vo=t=>{if(!t)return;let{pc:e}=t;e.close()},Do={connect:Oo,disconnect:Vo},Ze=Do;var G=document.documentElement,pe="requestFullscreen",me="exitFullscreen",fe="fullscreenElement",ge="onfullscreenchange";if("webkitRequestFullScreen"in G)pe="webkitRequestFullScreen",me="webkitExitFullscreen",fe="webkitFullscreenElement",ge="onwebkitfullscreenchange";else if("msRequestFullscreen"in G)pe="msRequestFullscreen",me="msExitFullscreen",fe="msFullscreenElement",ge="MSFullscreenChange";else if("mozRequestFullScreen"in G)pe="mozRequestFullScreen",me="mozCancelFullScreen",fe="mozFullScreenElement",ge="onmozfullscreenchange";else if(!("requestFullscreen"in G))throw"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Fullscreen API !";function Bo(t=G,e){return t[pe](e)}function Ao(){return document[me]()}function $t(t){return t===document[fe]}function Ho(t=G,e){return $t(t)?Ao():Bo(t,e)}function Wo(t,e){let n=()=>{t.onfullscreenchange=null},o=i=>{i.target!==null&&e($t(i.target))};return t[ge]=o,{cancel:n}}var $o={toggle:Ho,watch:Wo},he=$o;var zo=({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)),zt=({list:t,factory:e})=>(t==null?void 0:t.length)?e?r.h(r.Fragment,null,t.map(n=>r.h(zt,{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(zo,L({},n)))):null,Ye=zt;var O;(function(o){o.DIRECT="direct",o.PLUGIN="plugin",o.REJECT="reject"})(O||(O={}));var ve;(function(s){s.MP4="MP4",s.FLAC="FLAC",s.OGG="OGG",s.WEBM="WEBM",s.AUTO="AUTO"})(ve||(ve={}));var je;(function(e){e.WEBRTC="WEBRTC"})(je||(je={}));var Ut="player",Jt=class extends E{constructor(e){super("div",Ut);this._lastTotalReceivedBytes=0;var n;this._video=new Rt,this._spinner=new Tt({spin:!1}),this._mask=new St({visible:!1}),this._infoModal=new Ft({container:this.el,title:"Info",center:!0,className:`${Ut}_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),((n=this._playerConfig)==null?void 0:n.enableController)&&(this._panel=new Wt),l.debug("PlayerMode",this._mode)}justifyVideoType(e,n){if((e==null?void 0:e.url)&&!e.type)return ve.AUTO;let o="".toUpperCase.call((e==null?void 0:e.type)||Object.keys(n||{})[0]||"");return l.debug("justifyVideoType ",e,o),o}_restrictPlayerMode(e,n){let o=this.justifyVideoType(e,n);if(!o&&!(e==null?void 0:e.url))return O.REJECT;if(!o)return O.DIRECT;let i=Object.keys(ve),s=Object.keys(je);return i.includes(o)?O.DIRECT:s.includes(o)?O.PLUGIN:O.DIRECT}init(){l.debug("\u6E32\u67D3PlayerPlugin",this.el),this.prepare();let e=this._video.init(),n=this._spinner.init(),o=this._mask.init(),i=this._panel?this._panel.init():[],s=this._infoModal.init();return u.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 p(this,null,function*(){this.mute(!0),yield this._video.play(),this.mute(e)})}mute(e){var n;this._video.muted=!!e,l.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 p(this,null,function*(){var n;if(this._mode!==O.PLUGIN)return;l.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 Ze.connect(e,o=>{var s;if(!o)return;(s=this.video.getEl())==null||s.addEventListener("canplay",()=>{l.debug("Video canplay"),this.video.play()}),this._video.srcObject=o;let i=o.getTracks()[0];i.onended=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u5DF2\u7ECF\u7EC8\u6B62",a)},i.onmute=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u6682\u65F6\u65E0\u6CD5\u63D0\u4F9B\u5A92\u4F53",a),this.onMuted()},i.onunmute=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u63D0\u4F9B\u5A92\u4F53",a),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 i,s,a,f,c;(i=this.video.getEl())==null||i.addEventListener("canplay",()=>{this._spinner.spin=!1,this._mask.visible=!1}),(s=this.video.getEl())==null||s.addEventListener("waiting",()=>{l.debug("Video is waiting for more data."),this._spinner.spin=!0});let e=this._panel;if(!e)return;(a=this.el)==null||a.addEventListener("mousemove",()=>{e.showThenHide()}),(f=this.el)==null||f.addEventListener("click",()=>{e.showThenHide()});let n=(m=!1)=>{let b=e.controller.PlayButton;m||(this._video.paused=!this._video.paused),console.log("oalyer,",this._video.paused),this._video.paused?b.Children=r.h(_.Play,null):b.Children=r.h(_.Play,{off:!0})};n(!0),e.controller.addEventListener("play",()=>n()),this._video.addEventListener("play",()=>{l.debug("video play"),e.showThenHide();let m=e.controller.PlayButton;m.Children=r.h(_.Play,{off:!0})}),this._video.addEventListener("pause",()=>{l.debug("video pause"),e.showThenHide();let m=e.controller.PlayButton;m.Children=r.h(_.Play,null)}),e.controller.addEventListener("screenshot",()=>{let m=this._video.getEl();if(!m){l.libError("playerPlugin screenshot videoEl\u4E3A\u7A7A\u503C");return}D.screenshot(m,`screenshot_${Date.now()}`)}),e.controller.addEventListener("fullscreen",()=>{if(!this.el){l.libError("playerPlugin fullscreen playerEL\u4E3A\u7A7A\u503C");return}he.toggle(this.el)}),(c=this._infoModal)==null||c.addEventListener("hide",()=>{this._infoModal.visible=!1,window.clearInterval(this._timer)}),e.controller.addEventListener("information",()=>p(this,null,function*(){if(!this._video.getEl()){l.libError("playerPlugin information videoEl\u4E3A\u7A7A\u503C");return}this.refreshInfoModal()}));let o=(m=!1)=>{var h;let b=e.controller.VolumeButton,P=(h=this._video.getEl())==null?void 0:h.muted;m||(this._video.muted=!P),P?b.Children=r.h(_.Volume,null):b.Children=r.h(_.Volume,{off:!0})};o(!0),e.controller.addEventListener("volume",()=>o()),e.controller.VolumeSlider.percent=this.video.volume,e.controller.VolumeSlider.addEventListener("change",m=>{e.controller.activeVolume(),console.log(m==null?void 0:m.percent,this.video.volume),this.video.volume=Number(m==null?void 0:m.percent),e.controller.VolumeSlider.percent=this.video.volume})}prepare(){if(l.debug("PlayerPlugin mode: ",this._mode),this.loadPlayerConfig(),this._mode===O.REJECT){l.error(new Error("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u7C7B\u578B"),this._mode,this._videoOption);return}if(this._mode===O.DIRECT){this.prepareDirect();return}if(this._mode===O.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;Ze.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 p(this,null,function*(){if(window.clearInterval(this._timer),!this._webrtcConnect)return;let e=3,n=()=>p(this,null,function*(){if(!this._webrtcConnect)return;let o=yield this._webrtcConnect.getStatsInfos();l.debug("player get result: ",o);let i={mimeType:(c="")=>({label:"Mime Type:",value:c}),totalSamplesReceived:(c=0,m)=>{let b={label:"Sample Rate:",value:""};return!c||!m.totalSamplesDuration||(b.value=Number(c/m.totalSamplesDuration).toFixed(3)+"Hz"),b}},s={mimeType:(c="")=>({label:"Mime Type:",value:c}),framesPerSecond:(c,m)=>({label:"Resolution:",value:`${m.frameWidth} x ${m.frameHeight}@${c}`}),bytesReceived:(c,m)=>{let b=c||0,P=(b-this._lastTotalReceivedBytes)*8/(e*1e3);return this._lastTotalReceivedBytes=b,{label:"Data Received:",value:`${Math.round(P)} kbps , lost ${m.packetsLost}`}}},a=r.h(Ye,{list:o.audios,factory:i}),f=r.h(Ye,{list:o.videos,factory:s});l.debug("audioInfoList",u.dom.createByJsx(a)),!!this._infoModal&&(this._infoModal.content=r.h("div",null,r.h("section",{className:"player_info-modal_section",withNamespace:!0},r.h("span",{className:"player_info-modal_section_title",withNamespace:!0},"Audio"),a),r.h("section",{className:"player_info-modal_section",withNamespace:!0},r.h("span",{className:"player_info-modal_section_title",withNamespace:!0},"Video"),f)),this._infoModal.visible=!0)});n(),this._timer=window.setInterval(n,e*1e3)})}},ye=Jt;var Uo=(t,e,n)=>o=>p(void 0,null,function*(){if(o.type==="offer"){l.debug("\u8BF7\u6C42\u8FDC\u7AEFsdp\uFF0C \u8BBE\u5907\u914D\u7F6E\u4FE1\u606F\uFF1A",t,"token: ",e),l.debug("\u672C\u5730sdp",o);try{let{id:i,index:s}=t||{},a=yield F.getDeviceWebrtc({id:i,index:s,sdp:o.sdp},e);return n&&n(a.dialogId),a.sdp}catch(i){throw l.error(i,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`PUPlayer open \u5931\u8D25 , ${i.message}`)}}}),Jo=t=>{let{container:e,token:n,puOption:o,defaultMediaOption:i={audio:!0,video:!0},testUrl:s,videoFit:a="fill",muted:f,apiPrefix:c,onConnected:m,onConnectedFailed:b,onDisConnected:P,fullScreenOnDblclick:h=!0,enableController:y=!1}=t||{},I,S=n,$=o,k=e,C=typeof f=="boolean"?f:!i.audio;ee(c);let w=()=>p(void 0,null,function*(){if(!!I&&(l.debug("PuPlayer close",I),g.mask.visible=!0,g.mask.text="Video Closed",g.close(),I))try{yield F.closeDialogs([I],S)}catch(v){throw l.error(v,"PuPlayer close \u5931\u8D25"),new Error(`PuPlayer close \u5931\u8D25 , ${v.message}`)}}),g=new ye({video:{url:s},pluginOption:{webrtc:{offerParam:{offerToReceiveAudio:i.audio,offerToReceiveVideo:i.video},productRemoteSdp:v=>p(void 0,null,function*(){return Uo($,S,z=>{I=z})(v)}),onIceDisconnected:()=>{g.mask.visible=!0,g.mask.text="lost connection",g.close(),P&&P()},onConnected:()=>{m&&m()},onConnectedFailed:()=>{b&&b()}}},playerConfig:{autoPlay:!0,enableController:y}});g.addEventListener("init",v=>{l.debug("\u76D1\u542C\u5230\u4E86 player\u5DF2\u7ECF\u521D\u59CB\u5316",v)}),g.mute(C),g.video.fit=a;let x=g.init();h&&(x==null||x.addEventListener("dblclick",()=>{l.debug("\u53CC\u51FBplayer\uFF1A",x),he.toggle(x)}));let q={instance:{getVideoElement:()=>g.video.getEl(),getPlayerElement:()=>g.getEl(),open:(v=!1)=>p(void 0,null,function*(){l.debug("PuPlayer open"),yield w(),l.debug("PuPlayer close before open"),g.mask.visible=!1,g.mask.text="connecting",g.mute(!!v);try{yield g.prepareWebrtc()}catch(T){throw g.mask.visible=!0,g.mask.text="connect failed",T}if(typeof v=="boolean"&&v){let T=()=>{l.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",C),l.debug("\u6B64\u90E8\u5206\u67E5\u770B\uFF1Ahttps://developers.google.com/web/updates/2017/09/autoplay-policy-changes"),g.mute(C),document.removeEventListener("click",T),document.removeEventListener("touchend",T)};document.addEventListener("click",T),document.addEventListener("touchend",T)}}),play:()=>p(void 0,null,function*(){yield g.play(C)}),mute:(v=!1)=>{C=v,g.mute(v)},hidden:v=>p(void 0,null,function*(){let T=x,z=g.video.getEl();T.style.display="none",document.body.appendChild(T),z.muted=!0;try{typeof v!="undefined"&&(C=v),yield g.play(C)}catch(nr){l.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}l.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",z.paused)}),display:v=>p(void 0,null,function*(){let T=x,z=g.video.getEl();u.render(T,k,()=>p(void 0,null,function*(){T.style.display="block",typeof v!="undefined"&&(C=v),yield g.play(C)})),l.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",z.paused)}),moveTo:v=>{l.debug("\u79FB\u52A8\u81F3\uFF1A",v),k=v,u.render(x,k,()=>p(void 0,null,function*(){}))},getCurrentContainer:()=>k,setPuOption:v=>{$=v},setVideoFit:v=>{l.debug("PuPlayer setVideoFit",v),g.video.fit=v},setToken:v=>{l.debug("PuPlayer setToken",v),S=v},setApiPrefix:ee,close:w,render:g.init,destroy:()=>p(void 0,null,function*(){l.debug("PuPlayer destroy"),yield w(),g.destroy()})},element:x};return k&&(u.render(x,k),q.element=null),q},Ko=Jo;var et=class extends ne{constructor(e,n){super();this._plugin=e,this._el=this._plugin.init(),this._currentContainer=n}moveTo(e,n){l.debug("\u79FB\u52A8\u81F3\uFF1A",e),this._currentContainer=e,u.render(this._el,this._currentContainer,n)}getCurrentContainer(){return this._currentContainer}render(){return this._plugin.init()}destroy(){l.debug("destroy",this._plugin),this._plugin.destroy(),this.dispatch("destroy")}};var be=class{constructor(e,n,o,i){this.token="";this.fetchSdpFunc=e,this.token=n||"",this.param=o,this.prefix=i}fetch(e){return p(this,null,function*(){l.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,l.debug(`RemoteSdpFetcher fetch \u83B7\u5F97\u7684remoteSdp ${o}, dialogId: ${i}`),o})}close(){return p(this,null,function*(){l.debug(`remoteSdpFetcher close\uFF0C \u68C0\u67E5dialogId: ${this.dialogId}`),this.dialogId&&(yield F.closeDialogs([this.dialogId]))})}},tt=class extends et{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=>p(this,null,function*(){var o;return(o=this._remoteSdpFetcher)==null?void 0:o.fetch(n)}))}getRemoteSdpFetcher(){return this._remoteSdpFetcher}setVideoFit(e){l.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 p(this,null,function*(){l.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=()=>{l.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",this._muted),l.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 p(this,null,function*(){yield this.player.play(this._muted)})}hidden(e){return p(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){l.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}l.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}display(e){return p(this,null,function*(){let n=this._el,o=this.player.video.getEl();u.render(n,this._currentContainer,()=>p(this,null,function*(){n.style.display="block",typeof e!="undefined"&&(this._muted=e),yield this.player.play(this._muted)})),l.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}close(){return p(this,null,function*(){if(l.debug("BvWebrtcInstance close",`_dialogId: ${this._dialogId}`),this.player.mask.visible=!0,this.player.mask.text="Video Closed",this.player.close(),l.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 l.error(e,"BvWebrtcInstance close \u5931\u8D25"),new Error(`BvWebrtcInstance close \u5931\u8D25 , ${e.message}`)}})}destroy(){l.debug("PuPlayer destroy"),this.close(),this.player.destroy()}};var Go=t=>{let{container:e,sdpFetcher:n,offerParam:o,videoFit:i,muted:s,autoPlay:a,onConnected:f,onClose:c,onDestroy:m,onConnectedFailed:b,onDisConnected:P,onPcEventAdded:h}=t,y=new ye({pluginOption:{webrtc:{offerParam:o,productRemoteSdp:()=>p(void 0,null,function*(){return""}),onIceDisconnected:()=>{y.mask.visible=!0,y.mask.text="lost connection",y.close(),P&&P()},onPcEventAdded:h,onConnected:()=>{y.mask.visible=!1,y.mask.text="connected",f&&f()},onConnectedFailed:()=>{b&&b()}}},playerConfig:{autoPlay:a}}),I=new tt(y,i,s,n,e);I.addEventListener("close",()=>{c&&c()}),I.addEventListener("destroy",()=>{m&&m()});let S={open:()=>p(void 0,null,function*(){l.debug("BvWebrtc open"),yield I.open()}),setOption:C=>{l.debug("BvWebrtc setOption");let w=I.getRemoteSdpFetcher();w&&(w.param=C)},setToken:C=>{l.debug("BvWebrtc setToken",C);let w=I.getRemoteSdpFetcher();w&&(w.token=C)},setApiPrefix:C=>{l.debug("BvWebrtc setApiPrefix",C);let w=I.getRemoteSdpFetcher();w&&(w.prefix=C)},getRemoteSdpFetcher:()=>I.getRemoteSdpFetcher(),close:()=>p(void 0,null,function*(){l.debug("BvWebrtc close"),yield I.close()}),render:()=>(l.debug("BvWebrtc render"),I.render()),destroy:()=>{l.debug("BvWebrtc destroy"),I.destroy()}},$=I.render(),k={instance:S,element:$};return e&&(u.render($,e),k.element=null),k},Kt=Go;var Xo=()=>p(void 0,null,function*(){l.debug("\u8BF7\u6C42\u9EA6\u514B\u98CE...");let t=yield navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),e=t.getAudioTracks();return l.debug("\u9EA6\u514B\u98CE \u97F3\u9891\u8F68\u9053\uFF1A",e),t}),qo=t=>{let{container:e,token:n,getRemoteSdpParam:o,apiPrefix:i,getRemoteSdpResult:s,onConnected:a,onClose:f,onDestroy:c,onConnectedFailed:m,onDisConnected:b,onGetUserMediaFailed:P}=t||{},h=(C,w,g,x)=>p(void 0,null,function*(){if(l.debug("audioPlayer productRemoteSdp",{param:{localDescription:C,param:w,token:g,prefix:x}}),C.type==="offer"&&(ee(x),l.debug("\u672C\u5730sdp",C),!!s))try{let{sdp:X,dialogId:q}=yield s(C.sdp,g,w);return{sdp:X,dialogId:q}}catch(X){throw l.error(X,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`productRemoteSdp \u5931\u8D25 , ${X.message}`)}}),y=new be(h,n,o,i),{instance:I,element:S}=Kt({container:e,sdpFetcher:y,offerParam:{offerToReceiveAudio:!0},videoFit:"contain",muted:!1,autoPlay:!0,onConnected:a,onClose:f,onDestroy:c,onConnectedFailed:m,onDisConnected:b,onPcEventAdded:C=>p(void 0,null,function*(){try{let w=yield Xo();w.getTracks().forEach(g=>C.addTrack(g,w))}catch(w){P&&P()}})});return{instance:L({},I),element:S}},Ie=qo;var Qo=(t,e,n)=>p(void 0,null,function*(){let{id:o,index:i}=n||{};return yield F.getDeviceWebrtc({id:o,index:i,sdp:t},e)}),Zo=t=>{let{container:e,token:n,puOption:o,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}=t||{},{instance:P,element:h}=Ie({container:e,token:n,getRemoteSdpParam:o,getRemoteSdpResult:Qo,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}),y=U(L({},P),{setPuOption:S=>P.setOption&&P.setOption(S)});return delete y.setOption,{instance:y,element:h}},Yo=Zo;var jo=(t,e,n)=>p(void 0,null,function*(){let{id:o,index:i}=n||{};return yield F.getConferenceWebrtc({id:o,index:i,sdp:t},e)}),er=t=>{let{container:e,token:n,confOption:o,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}=t||{},{instance:P,element:h}=Ie({container:e,token:n,getRemoteSdpParam:o,getRemoteSdpResult:jo,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}),y=U(L({},P),{setConfOption:S=>P.setOption&&P.setOption(S)});return delete y.setOption,{instance:y,element:h}},tr=er;var sa=F.closeAllStorageDialog;export{tr as Conference,Yo as Intercom,Ko as PuPlayer,be as RemoteSdpFetcher,sa as clearAllDialog};
25
+ `,...n)}}formatShapeLog({level:t,title:e,color:n},o,...i){this.formatLog(t,e,o,le({color:n},this.getLoggerOption().shape,J.title),le({color:n},this.getLoggerOption().shape,J.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)}},ir=new st,un=new Ce,pn=un,V=pn;var dt=class extends Ce{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)}}},Pe=new dt;Pe.debug("player-core env:",d);Pe.version(d.SH_LIB_NAME,d.SH_LIB_VERSION||"");var l=Pe;var mn=Array.isArray,fn=t=>t!==t,ut=t=>typeof t=="number",pt=t=>typeof t=="string",gn=t=>ut(t)||pt(t),hn=t=>typeof t=="function",vn=t=>typeof t=="undefined",yn=t=>t?!1:!!(t!=null?t:!0),bn={isArr:mn,baseIsNaN:fn,isString:pt,isNumber:ut,isText:gn,isFn:hn,isUndefined:vn,isNullOrUndefined:yn},R=bn;function In(t,e=[]){let n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function Cn(t,e,n){let o=n-1,i=t.length;for(;++o<i;)if(t[o]===e)return o;return-1}function Pn(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 wn(t,e,n){return e===e?Cn(t,e,n):Pn(t,R.baseIsNaN,n)}function En(t,e){let n=-1,o=e.length,i=t;for(t===e&&(e=In(e));++n<o;){let s=0,a=e[n],f=a;for(;(s=wn(i,f,s))>-1;)i!==t&&[].splice.call(i,s,1),[].splice.call(t,s,1)}return t}var _n=t=>t?R.isArr(t)?t:[t]:[],Sn=(t,e)=>!t||!t.length||!e||!e.length?t:En(t,e),xn=(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){l.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)})},Tn=(t,e,n)=>Math.max(Math.min(t,n),e),Mn={pullAll:Sn,toArray:_n,screenshot:xn,restrict:Tn},D=Mn;function Ln(t){return t!=null&&t!==!0&&t!==!1}function mt(t,e=[]){return t.forEach(n=>{R.isArr(n)?mt(n,e):Ln(n)&&e.push(R.isText(n)?kn(n):n)}),e}function Rn(t={},e){if(!e)return;Object.keys(t).forEach(o=>{if(o==="children")return;let i=t[o];R.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 kn(t){return{type:"",props:{nodeValue:String(t)+""}}}function Fn(t,e){return t===""?document.createTextNode(""):e?document.createElementNS(e,t):document.createElement(t)}function Y(t,e,n){let o=e?e(t):t;if(!o)return null;if(R.isArr(o)){let a=document.createDocumentFragment();return o.forEach(f=>{let c=Y(f,e);c&&a.appendChild(c)}),a}let{props:i,type:s}=o;if(!i)return o instanceof Node||o instanceof Text?(l.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):(l.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(R.isString(s)){let a=Fn(s,i.xmlns||n);return Rn(i,a),(i.children||[]).forEach(c=>{let m=Y(c,e,i.xmlns);!m||a.appendChild(m)}),a}if(R.isFn(s)){let a=s(i);return Y(a,e)}return null}function Nn(t,e,...n){return e=e||{},n=mt(D.toArray(e.children||n)),e.children=n,{type:t,props:e}}var On=t=>t.children,Vn={h:Nn,Fragment:On},r=Vn;var we=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)},ft=t=>{let e=typeof t=="number"?t:we(t),n=we();return e-n},Dn=t=>ft(t)>0,Bn={getUTCSecond:we,pastNow:ft,compare:Dn},Ee=Bn;var gt=(t,e,n)=>{let o={value:e,expire:n},i=JSON.stringify(o);return localStorage.setItem(t,i),o},An=(t,e,n)=>{let i=Ee.getUTCSecond()+n;return gt(t,e,i)},Hn=(t,e=!1)=>{let n=localStorage.getItem(t);if(!n)return null;try{let o=JSON.parse(n);return e?o:o.expire?Ee.compare(o.expire)?o.value:null:o.value}catch(o){l.error(o,n,"Storage\u8BFB\u53D6\u6570\u636E\u65F6\uFF0C JSON\u89E3\u6790\u51FA\u9519")}},Wn=t=>localStorage.removeItem(t),$n={set:gt,setTimeout:An,get:Hn,remove:Wn},B=$n;var ae;(function(n){n.GET="GET",n.POST="POST"})(ae||(ae={}));var ht=(t,e)=>p(void 0,null,function*(){let n=new AbortController;if(e.signal&&e.signal.addEventListener("abort",()=>{n.abort()}),e.timeout){let a=setTimeout(()=>{n.abort()},e.timeout);n.signal.addEventListener("abort",()=>{clearTimeout(a)})}let o=e.bodyData,i=o&&(typeof o=="object"?JSON.stringify(o):o),s={credentials:"same-origin",method:e.method,headers:new Headers(L({},e.headers)),signal:n.signal};i&&(s.body=i),l.http("\u53D1\u9001\u8BF7\u6C42\uFF1A",t,U(L({},s),{body:o}));try{let a=yield fetch(t,s);if(l.http("\u8BF7\u6C42\u54CD\u5E94\uFF1A",t,a,yield a.clone().text()),a.ok||a.status>=200&&a.status<300){let f=a.headers.get("content-type")||"";if(/application\/json/i.test(f))return yield a.json()}else throw new Error(`${a.status} ${a.statusText}`)}catch(a){if(a.name==="AbortError"){l.http("\u8BF7\u6C42\u53D6\u6D88\uFF1A",s);return}throw a}}),zn=(t,e,n)=>p(void 0,null,function*(){let o=e?e.toString():"";return yield ht(t+o,{method:ae.GET,headers:n==null?void 0:n.headers})}),Un=(t,e,n)=>p(void 0,null,function*(){return yield ht(t,{method:ae.POST,headers:L({"Content-Type":"application/json;charset=UTF-8"},n==null?void 0:n.headers),bodyData:e})}),Jn={get:zn,post:Un},ce=Jn;var vt={BVCSP_V1:{path:"/bvcsp/v1",prefix:""}},_e=t=>{let e=vt[t];return e.prefix+e.path},Kn=(t,e)=>{let n=vt[t];return n.prefix=e||"",_e(t)},j={setApiPrefix:Kn,getApiURL:_e,bvscpV1:()=>_e("BVCSP_V1")},ee=t=>{j.setApiPrefix("BVCSP_V1",t)};function yt(t){if(!t)return null;if(t instanceof Array)return yt(t[0]);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.*").test(o.className)&&e.removeChild(o)}),t}return null}function Gn(t,e,n){if(!t)return;let o=document.createDocumentFragment();o.appendChild(t);let i=yt(e);!i||(i.appendChild(o),n==null||n())}var bt=Gn;var de=(...t)=>{let e=[];for(let n=0;n<t.length;n++){let o=t[n];if(!o)continue;let i=typeof o;if(R.isText(o))e.push(o);else if(Array.isArray(o)){if(o.length){let s=de(...o);s&&e.push(s)}}else if(i==="object")if(o.toString==={}.toString)for(let s in o)({}).hasOwnProperty.call(o,s)&&o[s]&&e.push(s);else e.push(o.toString())}return e.join(" ")},It=t=>t?t.replace(/\s*(;|\{|\})+\s*[\n\r]*/g,"$1"):"",Xn=(t,...e)=>{if(!e.length)return It(t[0]);let n="";return e.forEach((o,i)=>{n+=t[i]+o}),n+=t[t.length-1],It(n)},Se="bvplayer-",qn="common-",Ct=t=>new RegExp(Se).test(t),Qn=(...t)=>de(t).split(" ").map(e=>Ct(e)?e:Se+e).join(" "),Zn=(...t)=>de(t).split(" ").map(e=>Ct(e)?e:Se+qn+e).join(" ");var Yn={cls:de,css:Xn,prefixCls:Qn,commonCls:Zn},te=Yn;function jn(t){return document.createRange().createContextualFragment(t)}function eo(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function xe(){return document.createDocumentFragment()}function to(t,e){let n=document.createElement(t);return e&&(n.className=e),n}function no(t,...e){if(!t)return;let n=xe();n.append(...e.filter(o=>o)),t.appendChild(n)}function oo(t){if(!!t)if(t instanceof Element){t.innerHTML="";return}else for(;t.firstChild;)t.removeChild(t.firstChild)}function ro(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=xe();o.append(...n),t.parentNode.replaceChild(o,t)}}function io(t){var e;if(!!t)if(t instanceof Element){t.remove();return}else(e=t.parentNode)==null||e.removeChild(t)}function so(t){if(!t)return 0;let e=t.offsetLeft,n=t.offsetParent;if(n instanceof HTMLElement){let o=document.body.scrollLeft+document.documentElement.scrollLeft;if(!document.fullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement)for(;n!==null;)e+=n.offsetLeft,n=n.offsetParent;else for(;n!==null&&n!==t;)e+=n.offsetLeft,n=n.offsetParent;return e-o}return 0}function lo(t){if(!t||!t.props)return t;let{props:e}=t;return e.withCommonNamespace&&(e.className=te.commonCls(e.className),delete e.withCommonNamespace),e.withNamespace&&(e.className=te.prefixCls(e.className),delete e.withNamespace),t}function ao(t){return t?Y(t,lo):null}var co={parseHtml:jn,create:eo,createFragment:xe,createHtmlElement:to,createByJsx:ao,append:no,empty:oo,replace:ro,removeSelf:io,getElementViewLeft:so},Pt=co;var uo="bvplayerCore",po=t=>uo+t,mo={createPrefixStorageField:po},wt=mo;var fo={render:bt,style:te,dom:Pt,field:wt},u=fo;var H=u.field.createPrefixStorageField("DialogIds"),go=(t,e)=>p(void 0,null,function*(){var a;let n={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield ce.post(`${j.bvscpV1()}/dialog/device/webrtc`,o,{headers:n});if(l.api("\u8BBE\u5907\u97F3\u89C6\u9891\u6D41 webrtc\u65B9\u5F0F\u6253\u5F00dialog: ",{params:o,resData:i}),!i||i.code!==0||!((a=i.data)==null?void 0:a.dialogid))throw new Error(`\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25\uFF0C ${i.msg}`);let{data:s}=i;if(s.dialogid){let f=B.get(H)||[];f.push(s.dialogid),B.set(H,f)}return{dialogId:s.dialogid,sdp:s.sdp}}),ho=(t,e)=>p(void 0,null,function*(){var f;let n={Authorization:e||""},o={id:t.id,index:t.index,sdp:t.sdp},i=yield ce.post(`${j.bvscpV1()}/dialog/conference/webrtc`,o,{headers:n});if(l.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,a=B.get(H)||[];return a.push(s.dialogid),B.set(H,a),{dialogId:s.dialogid,sdp:s.sdp}}),vo=(t,e)=>p(void 0,null,function*(){if(!t)return;let n={Authorization:e||""};return l.api("\u5173\u95EDdialog\uFF1A",t),yield ce.post(`${j.bvscpV1()}/dialog/close/${t}`,{},{headers:n})}),Et=(t,e)=>p(void 0,null,function*(){let n=B.get(H)||[];D.pullAll(n,t),B.set(H,n,0);let i=(yield Promise.allSettled(t.map(s=>vo(s,e)))).filter(s=>s.status==="rejected");i&&i.length>0&&l.error(new Error(`"\u5173\u95ED\u5B58\u50A8\u7684dialog\u65F6\u5931\u8D25\uFF1A", ${i}`))}),yo=t=>p(void 0,null,function*(){let e=B.get(H);!e||e.length<1||(B.remove(H),yield Et(e,t))}),bo={getDeviceWebrtc:go,getConferenceWebrtc:ho,closeDialogs:Et,closeAllStorageDialog:yo},F=bo;var _t=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 a=o[s];a&&a(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))}},ne=class{constructor(){this._notifier=new _t}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 ne{constructor(e,n,o){super();this.name="";let i=n.trim().toLowerCase(),s=o?o.trim():i,a=u.dom.create(e,u.style.prefixCls(s));this.name=i,this.el=a}empty(){u.dom.empty(this.el)}unmount(){var e;l.debug("unmount",this.el,(e=this.el)==null?void 0:e.parentNode),u.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;l.debug("destroy complete",this)}}getEl(){return this.el}};var St=class extends E{constructor(e){super("div","mask",u.style.cls("mask"));this._visible=!!(e==null?void 0:e.visible),this._text=e==null?void 0:e.text,this._textEl=u.dom.create("span",u.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(){l.debug("mask visible: ",this._visible);let e=this.el;return e.style.display=this._visible?"block":"none",this._textEl.textContent=this._text||"",u.dom.append(e,this._textEl),e}},xt=St;var Tt=class extends E{constructor(e){super("div","spinner",u.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(){l.debug("spinner spin: ",this._spin);let e=this.el;e.style.display=this._spin?"block":"none";let n=u.dom.create("span");return n.style.backgroundColor="#FFF",u.dom.append(e,n),e}},Mt=Tt;var Lt={contain:"contain",fill:"fill"},Rt=class extends E{constructor(e){super("video","video",u.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)||Lt.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 volume(e){let n=this.el;n.volume=Number(e)}get volume(){var e;return Number((e=this.el)==null?void 0:e.volume)}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=Lt[e],this.el.style.objectFit=this._fit}getVideoFit(){return this._fit}init(){l.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=>{l.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 p(this,null,function*(){let e=this.el;try{l.debug("video \u5C1D\u8BD5\u64AD\u653E"),yield e.play()}catch(n){l.error(n,"video \u64AD\u653E \u5931\u8D25")}})}beforeDestroy(){}},kt=Rt;function oe(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=u.style.commonCls("is-visible");this._visible?(this.show&&this.show(),this.el.classList.add(o)):(this.hide&&this.hide(),this.el.classList.remove(o))}}}function Te({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}function 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:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z","clip-rule":"evenodd"}))}function 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:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 13a3 3 0 11-6 0 3 3 0 016 0z"}))}function Re({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M4 5a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2V7a2 2 0 00-2-2h-1.586a1 1 0 01-.707-.293l-1.121-1.121A2 2 0 0011.172 3H8.828a2 2 0 00-1.414.586L6.293 4.707A1 1 0 015.586 5H4zm6 9a3 3 0 100-6 3 3 0 000 6z","clip-rule":"evenodd"}))}function ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"}))}function Fe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M3 4a1 1 0 011-1h4a1 1 0 010 2H6.414l2.293 2.293a1 1 0 01-1.414 1.414L5 6.414V8a1 1 0 01-2 0V4zm9 1a1 1 0 110-2h4a1 1 0 011 1v4a1 1 0 11-2 0V6.414l-2.293 2.293a1 1 0 11-1.414-1.414L13.586 5H12zm-9 7a1 1 0 112 0v1.586l2.293-2.293a1 1 0 011.414 1.414L6.414 15H8a1 1 0 110 2H4a1 1 0 01-1-1v-4zm13-1a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 110-2h1.586l-2.293-2.293a1 1 0 011.414-1.414L15 13.586V12a1 1 0 011-1z","clip-rule":"evenodd"}))}function Ne({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Oe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"}))}function 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:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}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:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"}))}function Be({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"}))}function Ae({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"}))}function 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:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"}))}function We({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z","clip-rule":"evenodd"}))}function $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:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z","clip-rule":"evenodd"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"}))}function ze({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM12.293 7.293a1 1 0 011.414 0L15 8.586l1.293-1.293a1 1 0 111.414 1.414L16.414 10l1.293 1.293a1 1 0 01-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 01-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 010-1.414z","clip-rule":"evenodd"}))}function Ue({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Je({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z","clip-rule":"evenodd"}))}function Ke({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},r.h("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"}))}function Ge({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},r.h("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM7 8a1 1 0 012 0v4a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v4a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"}))}function Xe({className:t}){return r.h("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 32 33",fill:"currentColor"},r.h("path",{d:"M6.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v4h4c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333zM30.667 28h-5.333c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h4v-4c0-0.8 0.533-1.333 1.333-1.333s1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM30.667 12c-0.8 0-1.333-0.533-1.333-1.333v-4h-4c-0.8 0-1.333-0.533-1.333-1.333s0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333v5.333c0 0.8-0.533 1.333-1.333 1.333zM1.333 12c-0.8 0-1.333-0.533-1.333-1.333v-5.333c0-0.8 0.533-1.333 1.333-1.333h5.333c0.8 0 1.333 0.533 1.333 1.333s-0.533 1.333-1.333 1.333h-4v4c0 0.8-0.533 1.333-1.333 1.333z"}))}var N=({children:t,className:e})=>{let n=u.style.cls(["icon",e]);return r.h("span",{className:n,withNamespace:!0},t)},Io=({filled:t})=>r.h(N,null,t?r.h(Me,null):r.h(Te,null)),Co=({filled:t})=>r.h(N,null,t?r.h(Re,null):r.h(Le,null)),Po=({filled:t})=>r.h(N,null,t?r.h(Oe,null):r.h(Ne,null)),wo=({filled:t})=>r.h(N,null,t?r.h(Fe,null):r.h(ke,null)),Eo=({filled:t,circle:e})=>e?r.h(N,null,t?r.h(De,null):r.h(Ve,null)):r.h(N,null,t?r.h(Ae,null):r.h(Be,null)),_o=({filled:t,off:e})=>e?r.h(N,null,t?r.h(ze,null):r.h($e,null)):r.h(N,null,t?r.h(We,null):r.h(He,null)),So=({filled:t,off:e})=>e?r.h(N,null,t?r.h(Ge,null):r.h(Ke,null)):r.h(N,null,t?r.h(Je,null):r.h(Ue,null)),xo=()=>r.h(N,null,r.h(Xe,null)),To={Cog:Io,Camera:Co,Info:Po,ArrowsExpand:wo,X:Eo,Volume:_o,Play:So,Full:xo};var _=To;var W="modal",Ft=class extends E{constructor(e){super("div",W,u.style.cls([W,e.className,{[`${W}--center`]:e.center}]));this.container=e.container,this.title=e.title,this._content=e.content||u.dom.create("div","test"),this._center=!!e.center}set content(e){let n=u.dom.createByJsx(e);l.debug("modal update content",n,this._content),u.dom.replace(this._content,n),this._content=n}show(){var e;(e=this.el)==null||e.classList.toggle(u.style.prefixCls(`${W}--center`),!!this._center)}hide(){}clear(){!this.el||(this.el.innerHTML="")}beforeDestroy(){}init(){this.clear(),l.debug("\u6E32\u67D3ModalPlugin \u5F39\u7A97\u5BF9\u8C61",this,this.el);let e=this.el,n=u.dom.createByJsx(r.h(r.Fragment,null,r.h("div",{className:`${W}_title-bar`,onClick:()=>this.dispatch("hide"),withNamespace:!0},r.h("span",{className:`${W}_title-bar_title`,withNamespace:!0},this.title),r.h("span",{className:`${W}_title-bar_close`,withNamespace:!0},r.h(_.X,null))),r.h("div",{className:`${W}_body`,withNamespace:!0},this._content)));return u.dom.append(e,n),e}},Mo=oe(Ft),qe=class extends Mo{},Nt=qe;var Ot="controller_button",Vt=class extends E{constructor(e,n,o){super("button",Ot,u.style.cls([Ot,o]));this._Children=e,this.title=n}set Children(e){!this.el||(this._Children=e,this.empty(),u.dom.append(this.el,u.dom.createByJsx(e)))}beforeDestroy(){}init(){let e=this.el;return e.addEventListener("click",()=>this.dispatch("click")),e.title=this.title||"",u.dom.append(e,u.dom.createByJsx(this._Children)),e}},K=Vt;var re="slider",Dt=class extends E{constructor(e){super("div",re,u.style.cls([re,e]));this._percent=0;this._anyWidth=35}set percent(e){!this.el||(this._percent=D.restrict(e,0,1),!!this._innerEl&&(this._innerEl.style.width=this._percent*100+"%",!!this._suffixEl&&(this._suffixEl.innerHTML=Number(this._percent).toFixed(1))))}get percent(){return this._percent}beforeDestroy(){}init(e){let n=this.el,o=a=>{l.debug("handleThumbMove");let f=(a.clientX-u.dom.getElementViewLeft(this.el)-5.5)/this._anyWidth;this.dispatch("change",{target:this,percent:D.restrict(f,0,1)}),l.debug("slider handleThumbMove",f)},i=()=>{l.debug("handleThumbMoveEnd"),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i),this.dispatch("confirm")},s=()=>{l.debug("handleThumbMoveStart"),document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)};return this._innerEl=u.dom.createByJsx(r.h("div",{className:`${re}_inner`,style:`width: ${this._percent*100+"%"}`,withNamespace:!0},r.h("span",{className:`${re}_thumb`,withNamespace:!0}))),this._suffixEl=u.dom.createByJsx(r.h("span",{className:`${re}_suffix`,withNamespace:!0},this._percent)),u.dom.append(n,this._innerEl,this._suffixEl),n.addEventListener("mousedown",s),n.addEventListener("click",o),n}},Bt=Dt;var ie="controller",At=class extends E{constructor(e){super("div",ie,u.style.cls(ie));this._controls=(e==null?void 0:e.controls)||[],this.PlayButton=new K(r.h(_.Play,null)),this.VolumeButton=new K(r.h(_.Volume,{off:!0}),"volume"),this.VolumeSlider=new Bt,this.VolumeSlider.percent=.3,this.InformationButton=new K(r.h(_.Info,null),"information"),this.ScreenshotButton=new K(r.h(_.Camera,null),"screenshot"),this.FullscreenButton=new K(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"))}activeVolume(){var e;(e=this._volumeEl)==null||e.classList.add(u.style.prefixCls(`${ie}_volume--active`))}hideVolume(){var e;(e=this._volumeEl)==null||e.classList.remove(u.style.prefixCls(`${ie}_volume--active`))}beforeDestroy(){}init(){l.debug("\u6E32\u67D3ControllerPlugin \u64AD\u653E\u63A7\u5236\u5668\u5BF9\u8C61",this,this.el,this._controls);let e=this.el,n=u.style.cls([`${this.name}_inner_bar`,`${this.name}_inner_left`]),o=u.style.cls([`${this.name}_inner_bar`,`${this.name}_inner_right`]);this._volumeEl=u.dom.createByJsx(r.h("div",{className:`${ie}_volume`,withNamespace:!0},this.VolumeButton.init(),this.VolumeSlider.init()));let i=u.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._volumeEl),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 u.dom.append(e,i),this.VolumeSlider.addEventListener("confirm",this.hideVolume.bind(this)),e}},Lo=oe(At),Qe=class extends Lo{},Ht=Qe;var Wt=class{constructor(){this._els=[];this.disableAutoHide=!1;this._controller=new Ht}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)}},$t=Wt;var ue=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 p(this,null,function*(){let e=this.getReceiversMap();l.debug("receivers map : ",e);let n=yield Promise.all(e.get("audio").map(i=>p(this,null,function*(){let s={},a=yield i.getStats(),f=[];return a.forEach(c=>{f.push(c),c.type==="codec"&&(s.mimeType=c.mimeType,s.clockRate=c.clockRate,s.channels=c.channels),c.type==="track"&&(s.totalSamplesReceived=c.totalSamplesReceived,s.totalSamplesDuration=c.totalSamplesDuration)}),l.debug("audio stats report: ",f),s}))),o=yield Promise.all(e.get("video").map(i=>p(this,null,function*(){let s={},a=yield i.getStats(),f=[];return a.forEach(c=>{f.push(c),c.type==="codec"&&(s.mimeType=c.mimeType,s.clockRate=c.clockRate),c.type==="inbound-rtp"&&(s.frameWidth=c.frameWidth,s.frameHeight=c.frameHeight,s.framesPerSecond=c.framesPerSecond,s.framesReceived=c.framesReceived,s.framesDecoded=c.framesDecoded,s.totalInterFrameDelay=c.totalInterFrameDelay,s.keyFramesDecoded=c.keyFramesDecoded,s.packetsLost=c.packetsLost,s.lastPacketReceivedTimestamp=c.lastPacketReceivedTimestamp,s.bytesReceived=c.bytesReceived,s.totalDecodeTime=c.totalDecodeTime)}),l.debug("video stats report: ",f),s})));return{audios:n,videos:o}})}};var Ro=(t,e)=>{V.debug(`webrtc my ICE candidate:
26
+ ${e.candidate?e.candidate.candidate:"(null)"}`)},ko=(t,e,n)=>{V.debug("webrtc ICE state change event: ",e),V.debug(`webrtc my ICE state: ${t==null?void 0:t.iceConnectionState}`),t&&t.iceConnectionState==="disconnected"&&n&&n()},Fo=(t,e)=>{V.debug("webrtc Connection state change, \u5F53\u524D\u8FDE\u63A5\u72B6\u6001: ",t,t.connectionState)},No=(t,e,n)=>{V.debug("webrtc \u5F53\u524D\u7684 stream: ",e.streams[0]);let o=e.streams[0];n(o)},Oo=(t,e)=>p(void 0,null,function*(){let{offerParam:n,productRemoteSdp:o,customerRTCPeerConnection:i,onConnected:s,onConnectedFailed:a,onIceDisconnected:f,onPcEventAdded:c,onLocalDescriptionReady:m}=t,b=!!i&&i instanceof RTCPeerConnection,P={},h=b?i:new RTCPeerConnection(P);if(h.addEventListener("icecandidate",y=>Ro(h,y)),h.addEventListener("iceconnectionstatechange",y=>ko(h,y,f)),h.addEventListener("connectionstatechange",y=>Fo(h,y)),h.addEventListener("track",y=>No(h,y,e)),c&&(yield c(h)),b)return new ue(h);try{let y=yield h.createOffer(n);V.debug("\u521B\u5EFAoffer\uFF0C\u53C2\u6570\uFF1A",n,"\uFF0C \u7ED3\u679C\uFF1A",y),yield h.setLocalDescription(y),m&&m(h);let I=yield o(new RTCSessionDescription(y));V.debug("webrtc recv open answer",I);let S=new RTCSessionDescription({type:"answer",sdp:I});yield h.setRemoteDescription(S),V.debug("getTransceivers",h.getTransceivers()),s&&s(h)}catch(y){throw a&&a(h),V.error(new Error(`webrtc Failed to create session description: ${y.toString()}`)),h.close(),y}return new ue(h)}),Vo=t=>{if(!t)return;let{pc:e}=t;e.close()},Do={connect:Oo,disconnect:Vo},Ze=Do;var G=document.documentElement,pe="requestFullscreen",me="exitFullscreen",fe="fullscreenElement",ge="onfullscreenchange";if("webkitRequestFullScreen"in G)pe="webkitRequestFullScreen",me="webkitExitFullscreen",fe="webkitFullscreenElement",ge="onwebkitfullscreenchange";else if("msRequestFullscreen"in G)pe="msRequestFullscreen",me="msExitFullscreen",fe="msFullscreenElement",ge="MSFullscreenChange";else if("mozRequestFullScreen"in G)pe="mozRequestFullScreen",me="mozCancelFullScreen",fe="mozFullScreenElement",ge="onmozfullscreenchange";else if(!("requestFullscreen"in G))throw"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Fullscreen API !";function Bo(t=G,e){return t[pe](e)}function Ao(){return document[me]()}function zt(t){return t===document[fe]}function Ho(t=G,e){return zt(t)?Ao():Bo(t,e)}function Wo(t,e){let n=()=>{t.onfullscreenchange=null},o=i=>{i.target!==null&&e(zt(i.target))};return t[ge]=o,{cancel:n}}var $o={toggle:Ho,watch:Wo},he=$o;var zo=({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)),Ut=({list:t,factory:e})=>(t==null?void 0:t.length)?e?r.h(r.Fragment,null,t.map(n=>r.h(Ut,{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(zo,L({},n)))):null,Ye=Ut;var O;(function(o){o.DIRECT="direct",o.PLUGIN="plugin",o.REJECT="reject"})(O||(O={}));var ve;(function(s){s.MP4="MP4",s.FLAC="FLAC",s.OGG="OGG",s.WEBM="WEBM",s.AUTO="AUTO"})(ve||(ve={}));var je;(function(e){e.WEBRTC="WEBRTC"})(je||(je={}));var Jt="player",Kt=class extends E{constructor(e){super("div",Jt);this._lastTotalReceivedBytes=0;var n;this._video=new kt,this._spinner=new Mt({spin:!1}),this._mask=new xt({visible:!1}),this._infoModal=new Nt({container:this.el,title:"Info",center:!0,className:`${Jt}_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),((n=this._playerConfig)==null?void 0:n.enableController)&&(this._panel=new $t),l.debug("PlayerMode",this._mode)}justifyVideoType(e,n){if((e==null?void 0:e.url)&&!e.type)return ve.AUTO;let o="".toUpperCase.call((e==null?void 0:e.type)||Object.keys(n||{})[0]||"");return l.debug("justifyVideoType ",e,o),o}_restrictPlayerMode(e,n){let o=this.justifyVideoType(e,n);if(!o&&!(e==null?void 0:e.url))return O.REJECT;if(!o)return O.DIRECT;let i=Object.keys(ve),s=Object.keys(je);return i.includes(o)?O.DIRECT:s.includes(o)?O.PLUGIN:O.DIRECT}init(){l.debug("\u6E32\u67D3PlayerPlugin",this.el),this.prepare();let e=this._video.init(),n=this._spinner.init(),o=this._mask.init(),i=this._panel?this._panel.init():[],s=this._infoModal.init();return u.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 p(this,null,function*(){this.mute(!0),yield this._video.play(),this.mute(e)})}mute(e){var n;this._video.muted=!!e,l.debug("player mute: ",(n=this._video.getEl())==null?void 0:n.muted)}record(){}setProductRemoteSdp(e){!this._pluginOption||!this._pluginOption.webrtc||(this._pluginOption.webrtc.productRemoteSdp=e)}prepareWebrtc(){return p(this,null,function*(){var n;if(this._mode!==O.PLUGIN)return;l.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 Ze.connect(e,o=>{var s;if(!o)return;(s=this.video.getEl())==null||s.addEventListener("canplay",()=>{l.debug("Video canplay"),this.video.play()}),this._video.srcObject=o;let i=o.getTracks()[0];i.onended=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u5DF2\u7ECF\u7EC8\u6B62",a)},i.onmute=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u6682\u65F6\u65E0\u6CD5\u63D0\u4F9B\u5A92\u4F53",a),this.onMuted()},i.onunmute=a=>{l.debug("\u6D41\u89C6\u9891\u8F68\u9053\u63D0\u4F9B\u5A92\u4F53",a),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 i,s,a,f,c;(i=this.video.getEl())==null||i.addEventListener("canplay",()=>{this._spinner.spin=!1,this._mask.visible=!1}),(s=this.video.getEl())==null||s.addEventListener("waiting",()=>{l.debug("Video is waiting for more data."),this._spinner.spin=!0});let e=this._panel;if(!e)return;(a=this.el)==null||a.addEventListener("mousemove",()=>{e.showThenHide()}),(f=this.el)==null||f.addEventListener("click",()=>{e.showThenHide()});let n=(m=!1)=>{let b=e.controller.PlayButton;m||(this._video.paused=!this._video.paused),console.log("oalyer,",this._video.paused),this._video.paused?b.Children=r.h(_.Play,null):b.Children=r.h(_.Play,{off:!0})};n(!0),e.controller.addEventListener("play",()=>n()),this._video.addEventListener("play",()=>{l.debug("video play"),e.showThenHide();let m=e.controller.PlayButton;m.Children=r.h(_.Play,{off:!0})}),this._video.addEventListener("pause",()=>{l.debug("video pause"),e.showThenHide();let m=e.controller.PlayButton;m.Children=r.h(_.Play,null)}),e.controller.addEventListener("screenshot",()=>{let m=this._video.getEl();if(!m){l.libError("playerPlugin screenshot videoEl\u4E3A\u7A7A\u503C");return}D.screenshot(m,`screenshot_${Date.now()}`)}),e.controller.addEventListener("fullscreen",()=>{if(!this.el){l.libError("playerPlugin fullscreen playerEL\u4E3A\u7A7A\u503C");return}he.toggle(this.el)}),(c=this._infoModal)==null||c.addEventListener("hide",()=>{this._infoModal.visible=!1,window.clearInterval(this._timer)}),e.controller.addEventListener("information",()=>p(this,null,function*(){if(!this._video.getEl()){l.libError("playerPlugin information videoEl\u4E3A\u7A7A\u503C");return}this.refreshInfoModal()}));let o=(m=!1)=>{var h;let b=e.controller.VolumeButton,P=(h=this._video.getEl())==null?void 0:h.muted;m||(this._video.muted=!P),P?b.Children=r.h(_.Volume,null):b.Children=r.h(_.Volume,{off:!0})};o(!0),e.controller.addEventListener("volume",()=>o()),e.controller.VolumeSlider.percent=this.video.volume,e.controller.VolumeSlider.addEventListener("change",m=>{e.controller.activeVolume(),console.log(m==null?void 0:m.percent,this.video.volume),this.video.volume=Number(m==null?void 0:m.percent),e.controller.VolumeSlider.percent=this.video.volume})}prepare(){if(l.debug("PlayerPlugin mode: ",this._mode),this.loadPlayerConfig(),this._mode===O.REJECT){l.error(new Error("\u4E0D\u652F\u6301\u7684\u89C6\u9891\u7C7B\u578B"),this._mode,this._videoOption);return}if(this._mode===O.DIRECT){this.prepareDirect();return}if(this._mode===O.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;Ze.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 p(this,null,function*(){if(window.clearInterval(this._timer),!this._webrtcConnect)return;let e=3,n=()=>p(this,null,function*(){if(!this._webrtcConnect)return;let o=yield this._webrtcConnect.getStatsInfos();l.debug("player get result: ",o);let i={mimeType:(c="")=>({label:"Mime Type:",value:c}),totalSamplesReceived:(c=0,m)=>{let b={label:"Sample Rate:",value:""};return!c||!m.totalSamplesDuration||(b.value=Number(c/m.totalSamplesDuration).toFixed(3)+"Hz"),b}},s={mimeType:(c="")=>({label:"Mime Type:",value:c}),framesPerSecond:(c,m)=>({label:"Resolution:",value:`${m.frameWidth} x ${m.frameHeight}@${c}`}),bytesReceived:(c,m)=>{let b=c||0,P=(b-this._lastTotalReceivedBytes)*8/(e*1e3);return this._lastTotalReceivedBytes=b,{label:"Data Received:",value:`${Math.round(P)} kbps , lost ${m.packetsLost}`}}},a=r.h(Ye,{list:o.audios,factory:i}),f=r.h(Ye,{list:o.videos,factory:s});l.debug("audioInfoList",u.dom.createByJsx(a)),!!this._infoModal&&(this._infoModal.content=r.h("div",null,r.h("section",{className:"player_info-modal_section",withNamespace:!0},r.h("span",{className:"player_info-modal_section_title",withNamespace:!0},"Audio"),a),r.h("section",{className:"player_info-modal_section",withNamespace:!0},r.h("span",{className:"player_info-modal_section_title",withNamespace:!0},"Video"),f)),this._infoModal.visible=!0)});n(),this._timer=window.setInterval(n,e*1e3)})}},ye=Kt;var Uo=(t,e,n)=>o=>p(void 0,null,function*(){if(o.type==="offer"){l.debug("\u8BF7\u6C42\u8FDC\u7AEFsdp\uFF0C \u8BBE\u5907\u914D\u7F6E\u4FE1\u606F\uFF1A",t,"token: ",e),l.debug("\u672C\u5730sdp",o);try{let{id:i,index:s}=t||{},a=yield F.getDeviceWebrtc({id:i,index:s,sdp:o.sdp},e);return n&&n(a.dialogId),a.sdp}catch(i){throw l.error(i,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`PUPlayer open \u5931\u8D25 , ${i.message}`)}}}),Jo=t=>{let{container:e,token:n,puOption:o,defaultMediaOption:i={audio:!0,video:!0},testUrl:s,videoFit:a="fill",muted:f,apiPrefix:c,onConnected:m,onConnectedFailed:b,onDisConnected:P,fullScreenOnDblclick:h=!0,enableController:y=!1}=t||{},I,S=n,$=o,k=e,C=typeof f=="boolean"?f:!i.audio;ee(c);let w=()=>p(void 0,null,function*(){if(!!I&&(l.debug("PuPlayer close",I),g.mask.visible=!0,g.mask.text="Video Closed",g.close(),I))try{yield F.closeDialogs([I],S)}catch(v){throw l.error(v,"PuPlayer close \u5931\u8D25"),new Error(`PuPlayer close \u5931\u8D25 , ${v.message}`)}}),g=new ye({video:{url:s},pluginOption:{webrtc:{offerParam:{offerToReceiveAudio:i.audio,offerToReceiveVideo:i.video},productRemoteSdp:v=>p(void 0,null,function*(){return Uo($,S,z=>{I=z})(v)}),onIceDisconnected:()=>{g.mask.visible=!0,g.mask.text="lost connection",g.close(),P&&P()},onConnected:()=>{m&&m()},onConnectedFailed:()=>{b&&b()}}},playerConfig:{autoPlay:!0,enableController:y}});g.addEventListener("init",v=>{l.debug("\u76D1\u542C\u5230\u4E86 player\u5DF2\u7ECF\u521D\u59CB\u5316",v)}),g.mute(C),g.video.fit=a;let x=g.init();h&&(x==null||x.addEventListener("dblclick",()=>{l.debug("\u53CC\u51FBplayer\uFF1A",x),he.toggle(x)}));let q={instance:{getVideoElement:()=>g.video.getEl(),getPlayerElement:()=>g.getEl(),open:(v=!1)=>p(void 0,null,function*(){l.debug("PuPlayer open"),yield w(),l.debug("PuPlayer close before open"),g.mask.visible=!1,g.mask.text="connecting",g.mute(!!v);try{yield g.prepareWebrtc()}catch(T){throw g.mask.visible=!0,g.mask.text="connect failed",T}if(typeof v=="boolean"&&v){let T=()=>{l.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",C),l.debug("\u6B64\u90E8\u5206\u67E5\u770B\uFF1Ahttps://developers.google.com/web/updates/2017/09/autoplay-policy-changes"),g.mute(C),document.removeEventListener("click",T),document.removeEventListener("touchend",T)};document.addEventListener("click",T),document.addEventListener("touchend",T)}}),play:()=>p(void 0,null,function*(){yield g.play(C)}),mute:(v=!1)=>{C=v,g.mute(v)},hidden:v=>p(void 0,null,function*(){let T=x,z=g.video.getEl();T.style.display="none",document.body.appendChild(T),z.muted=!0;try{typeof v!="undefined"&&(C=v),yield g.play(C)}catch(nr){l.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}l.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",z.paused)}),display:v=>p(void 0,null,function*(){let T=x,z=g.video.getEl();u.render(T,k,()=>p(void 0,null,function*(){T.style.display="block",typeof v!="undefined"&&(C=v),yield g.play(C)})),l.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",z.paused)}),moveTo:v=>{l.debug("\u79FB\u52A8\u81F3\uFF1A",v),k=v,u.render(x,k,()=>p(void 0,null,function*(){}))},getCurrentContainer:()=>k,setPuOption:v=>{$=v},setVideoFit:v=>{l.debug("PuPlayer setVideoFit",v),g.video.fit=v},setToken:v=>{l.debug("PuPlayer setToken",v),S=v},setApiPrefix:ee,close:w,render:g.init,destroy:()=>p(void 0,null,function*(){l.debug("PuPlayer destroy"),yield w(),g.destroy()})},element:x};return k&&(u.render(x,k),q.element=null),q},Ko=Jo;var et=class extends ne{constructor(e,n){super();this._plugin=e,this._el=this._plugin.init(),this._currentContainer=n}moveTo(e,n){l.debug("\u79FB\u52A8\u81F3\uFF1A",e),this._currentContainer=e,u.render(this._el,this._currentContainer,n)}getCurrentContainer(){return this._currentContainer}render(){return this._plugin.init()}destroy(){l.debug("destroy",this._plugin),this._plugin.destroy(),this.dispatch("destroy")}};var be=class{constructor(e,n,o,i){this.token="";this.fetchSdpFunc=e,this.token=n||"",this.param=o,this.prefix=i}fetch(e){return p(this,null,function*(){l.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,l.debug(`RemoteSdpFetcher fetch \u83B7\u5F97\u7684remoteSdp ${o}, dialogId: ${i}`),o})}close(){return p(this,null,function*(){l.debug(`remoteSdpFetcher close\uFF0C \u68C0\u67E5dialogId: ${this.dialogId}`),this.dialogId&&(yield F.closeDialogs([this.dialogId]))})}},tt=class extends et{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=>p(this,null,function*(){var o;return(o=this._remoteSdpFetcher)==null?void 0:o.fetch(n)}))}getRemoteSdpFetcher(){return this._remoteSdpFetcher}setVideoFit(e){l.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 p(this,null,function*(){l.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=()=>{l.debug("\u76D1\u542C\u5230\u7528\u6237\u6709click tap\u4EA4\u4E92\uFF0C \u6539\u53D8\u9759\u97F3\uFF0C muted\uFF1A",this._muted),l.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 p(this,null,function*(){yield this.player.play(this._muted)})}hidden(e){return p(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){l.debug("player.play() \u64AD\u653E\u672A\u6210\u529F")}l.debug("\u6DFB\u52A0\u5230body\u5E76\u9690\u85CF\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}display(e){return p(this,null,function*(){let n=this._el,o=this.player.video.getEl();u.render(n,this._currentContainer,()=>p(this,null,function*(){n.style.display="block",typeof e!="undefined"&&(this._muted=e),yield this.player.play(this._muted)})),l.debug("\u663E\u793A\u5230\u5F53\u524D\u5BB9\u5668\uFF0C \u8C03\u7528play\u540E\u7684\u6682\u505C\u72B6\u6001\uFF1A",o.paused)})}close(){return p(this,null,function*(){if(l.debug("BvWebrtcInstance close",`_dialogId: ${this._dialogId}`),this.player.mask.visible=!0,this.player.mask.text="Video Closed",this.player.close(),l.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 l.error(e,"BvWebrtcInstance close \u5931\u8D25"),new Error(`BvWebrtcInstance close \u5931\u8D25 , ${e.message}`)}})}destroy(){l.debug("PuPlayer destroy"),this.close(),this.player.destroy()}};var Go=t=>{let{container:e,sdpFetcher:n,offerParam:o,videoFit:i,muted:s,autoPlay:a,onConnected:f,onClose:c,onDestroy:m,onConnectedFailed:b,onDisConnected:P,onPcEventAdded:h}=t,y=new ye({pluginOption:{webrtc:{offerParam:o,productRemoteSdp:()=>p(void 0,null,function*(){return""}),onIceDisconnected:()=>{y.mask.visible=!0,y.mask.text="lost connection",y.close(),P&&P()},onPcEventAdded:h,onConnected:()=>{y.mask.visible=!1,y.mask.text="connected",f&&f()},onConnectedFailed:()=>{b&&b()}}},playerConfig:{autoPlay:a}}),I=new tt(y,i,s,n,e);I.addEventListener("close",()=>{c&&c()}),I.addEventListener("destroy",()=>{m&&m()});let S={open:()=>p(void 0,null,function*(){l.debug("BvWebrtc open"),yield I.open()}),setOption:C=>{l.debug("BvWebrtc setOption");let w=I.getRemoteSdpFetcher();w&&(w.param=C)},setToken:C=>{l.debug("BvWebrtc setToken",C);let w=I.getRemoteSdpFetcher();w&&(w.token=C)},setApiPrefix:C=>{l.debug("BvWebrtc setApiPrefix",C);let w=I.getRemoteSdpFetcher();w&&(w.prefix=C)},getRemoteSdpFetcher:()=>I.getRemoteSdpFetcher(),close:()=>p(void 0,null,function*(){l.debug("BvWebrtc close"),yield I.close()}),render:()=>(l.debug("BvWebrtc render"),I.render()),destroy:()=>{l.debug("BvWebrtc destroy"),I.destroy()}},$=I.render(),k={instance:S,element:$};return e&&(u.render($,e),k.element=null),k},Gt=Go;var Xo=()=>p(void 0,null,function*(){l.debug("\u8BF7\u6C42\u9EA6\u514B\u98CE...");let t=yield navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),e=t.getAudioTracks();return l.debug("\u9EA6\u514B\u98CE \u97F3\u9891\u8F68\u9053\uFF1A",e),t}),qo=t=>{let{container:e,token:n,getRemoteSdpParam:o,apiPrefix:i,getRemoteSdpResult:s,onConnected:a,onClose:f,onDestroy:c,onConnectedFailed:m,onDisConnected:b,onGetUserMediaFailed:P}=t||{},h=(C,w,g,x)=>p(void 0,null,function*(){if(l.debug("audioPlayer productRemoteSdp",{param:{localDescription:C,param:w,token:g,prefix:x}}),C.type==="offer"&&(ee(x),l.debug("\u672C\u5730sdp",C),!!s))try{let{sdp:X,dialogId:q}=yield s(C.sdp,g,w);return{sdp:X,dialogId:q}}catch(X){throw l.error(X,"\u8BF7\u6C42\u8FDC\u7AEFsdp\u65F6\u51FA\u9519"),new Error(`productRemoteSdp \u5931\u8D25 , ${X.message}`)}}),y=new be(h,n,o,i),{instance:I,element:S}=Gt({container:e,sdpFetcher:y,offerParam:{offerToReceiveAudio:!0},videoFit:"contain",muted:!1,autoPlay:!0,onConnected:a,onClose:f,onDestroy:c,onConnectedFailed:m,onDisConnected:b,onPcEventAdded:C=>p(void 0,null,function*(){try{let w=yield Xo();w.getTracks().forEach(g=>C.addTrack(g,w))}catch(w){P&&P()}})});return{instance:L({},I),element:S}},Ie=qo;var Qo=(t,e,n)=>p(void 0,null,function*(){let{id:o,index:i}=n||{};return yield F.getDeviceWebrtc({id:o,index:i,sdp:t},e)}),Zo=t=>{let{container:e,token:n,puOption:o,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}=t||{},{instance:P,element:h}=Ie({container:e,token:n,getRemoteSdpParam:o,getRemoteSdpResult:Qo,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}),y=U(L({},P),{setPuOption:S=>P.setOption&&P.setOption(S)});return delete y.setOption,{instance:y,element:h}},Yo=Zo;var jo=(t,e,n)=>p(void 0,null,function*(){let{id:o,index:i}=n||{};return yield F.getConferenceWebrtc({id:o,index:i,sdp:t},e)}),er=t=>{let{container:e,token:n,confOption:o,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}=t||{},{instance:P,element:h}=Ie({container:e,token:n,getRemoteSdpParam:o,getRemoteSdpResult:jo,apiPrefix:i,onConnected:s,onClose:a,onDestroy:f,onConnectedFailed:c,onDisConnected:m,onGetUserMediaFailed:b}),y=U(L({},P),{setConfOption:S=>P.setOption&&P.setOption(S)});return delete y.setOption,{instance:y,element:h}},tr=er;var sa=F.closeAllStorageDialog;export{tr as Conference,Yo as Intercom,Ko as PuPlayer,be as RemoteSdpFetcher,sa as clearAllDialog};
@@ -1,4 +0,0 @@
1
- declare const customElement: {
2
- define: (_tag: string) => void;
3
- };
4
- export default customElement;
@@ -59,6 +59,7 @@ declare class PlayerPlugin extends Plugin<HTMLDivElement, IPlayerPluginEventMap>
59
59
  get mask(): MaskPlugin;
60
60
  play(muted?: boolean): Promise<void>;
61
61
  mute(muted?: boolean): void;
62
+ record(): void;
62
63
  setProductRemoteSdp(productRemoteSdp: (localDescription: RTCSessionDescription) => Promise<string | undefined>): void;
63
64
  prepareWebrtc(): Promise<void>;
64
65
  close(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besovideo/webrtc-player",
3
- "version": "0.3.7",
3
+ "version": "0.4.1",
4
4
  "description": "@besovideo/webrtc-player desc",
5
5
  "type": "module",
6
6
  "types": "./dist/types/main.d.ts",