@besovideo/webrtc-player 0.8.52 → 0.8.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.browser.js +72 -26
- package/dist/main.es.js +72 -26
- package/dist/types/components/bvWebrtc/index.d.ts +1 -1
- package/dist/types/components/subComponent/mikeButton.d.ts +1 -0
- package/dist/types/templates/icons.d.ts +1 -0
- package/package.json +1 -1
- package/dist/types/utils/logger.d.ts +0 -12
package/dist/main.browser.js
CHANGED
|
@@ -105,7 +105,7 @@ var bvPlayerCore = (() => {
|
|
|
105
105
|
var define_processenv_default;
|
|
106
106
|
var init_define_processenv = __esm({
|
|
107
107
|
"<define:processenv>"() {
|
|
108
|
-
define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.
|
|
108
|
+
define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.54", PROJECT_NAMESPACE: "bvplayer" };
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
|
|
@@ -11168,6 +11168,7 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
|
|
|
11168
11168
|
}
|
|
11169
11169
|
|
|
11170
11170
|
// src/templates/icons.tsx
|
|
11171
|
+
init_jsx();
|
|
11171
11172
|
var Icon = ({ children, className, style: style2 }) => {
|
|
11172
11173
|
const clsName = core_default.style.cls(["icon", className]);
|
|
11173
11174
|
return /* @__PURE__ */ jsx.h("span", { className: clsName, style: style2, withNamespace: true }, children);
|
|
@@ -11203,6 +11204,7 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
|
|
|
11203
11204
|
var PtzControl = () => /* @__PURE__ */ jsx.h(Icon, null, /* @__PURE__ */ jsx.h(SvgElementbvPlayerCorePtzControl, null));
|
|
11204
11205
|
var MikeOn = () => /* @__PURE__ */ jsx.h(Icon, null, /* @__PURE__ */ jsx.h(SvgElementbvPlayerCoreMikeOn, null));
|
|
11205
11206
|
var MikeOff = () => /* @__PURE__ */ jsx.h(Icon, null, /* @__PURE__ */ jsx.h(SvgElementbvPlayerCoreMikeOff, null));
|
|
11207
|
+
var MikeDoing = () => /* @__PURE__ */ jsx.h(Icon, null, /* @__PURE__ */ jsx.h("span", { style: `display: inline-block; --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='18' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.67' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.33' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='6' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='0' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3C!-- 1702453639037 --%3E%3C/svg%3E"); width: 20px; height: 20px; background-color: currentcolor; mask-image: var(--svg); mask-repeat: no-repeat; mask-size: 100% 100%;` }));
|
|
11206
11208
|
var directionDeg = {
|
|
11207
11209
|
top: {
|
|
11208
11210
|
value: 0,
|
|
@@ -11270,7 +11272,8 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
|
|
|
11270
11272
|
Direction,
|
|
11271
11273
|
Operator,
|
|
11272
11274
|
MikeOn,
|
|
11273
|
-
MikeOff
|
|
11275
|
+
MikeOff,
|
|
11276
|
+
MikeDoing
|
|
11274
11277
|
};
|
|
11275
11278
|
var icons_default = Icons;
|
|
11276
11279
|
|
|
@@ -11479,7 +11482,8 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
|
|
|
11479
11482
|
// src/components/subComponent/mikeButton.tsx
|
|
11480
11483
|
init_define_processenv();
|
|
11481
11484
|
init_jsx_shim();
|
|
11482
|
-
|
|
11485
|
+
init_jsx();
|
|
11486
|
+
var _onIcon, _offIcon, _doingIcon, _isBusy, _talk, _intercom, _type, _onTalkStart, onTalkStart_fn, _onTalkEnd, onTalkEnd_fn;
|
|
11483
11487
|
var MikeButton = class extends HTMLElement {
|
|
11484
11488
|
constructor() {
|
|
11485
11489
|
super();
|
|
@@ -11488,13 +11492,19 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
|
|
|
11488
11492
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields weakmep实现的私有变量
|
|
11489
11493
|
__privateAdd(this, _onIcon, core_default.dom.createByJsx(/* @__PURE__ */ jsx.h(icons_default.MikeOn, null)));
|
|
11490
11494
|
__privateAdd(this, _offIcon, core_default.dom.createByJsx(/* @__PURE__ */ jsx.h(icons_default.MikeOff, null)));
|
|
11495
|
+
__privateAdd(this, _doingIcon, core_default.dom.createByJsx(/* @__PURE__ */ jsx.h(icons_default.MikeDoing, null)));
|
|
11496
|
+
__privateAdd(this, _isBusy, false);
|
|
11491
11497
|
//是否正在喊话
|
|
11492
11498
|
__privateAdd(this, _talk, false);
|
|
11493
11499
|
// 麦克风实例
|
|
11494
11500
|
__privateAdd(this, _intercom, void 0);
|
|
11501
|
+
// 协议类型
|
|
11502
|
+
__privateAdd(this, _type, void 0);
|
|
11495
11503
|
this.attachShadow({ mode: "open" });
|
|
11496
11504
|
this.addEventListener("click", () => {
|
|
11497
|
-
this
|
|
11505
|
+
if (!__privateGet(this, _isBusy)) {
|
|
11506
|
+
this.talking = !this.talking;
|
|
11507
|
+
}
|
|
11498
11508
|
});
|
|
11499
11509
|
this.talking = false;
|
|
11500
11510
|
}
|
|
@@ -11504,16 +11514,26 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
|
|
|
11504
11514
|
set talking(state) {
|
|
11505
11515
|
if (__privateGet(this, _talk) === state)
|
|
11506
11516
|
return;
|
|
11507
|
-
|
|
11508
|
-
|
|
11509
|
-
|
|
11510
|
-
|
|
11511
|
-
|
|
11517
|
+
if (!__privateGet(this, _isBusy)) {
|
|
11518
|
+
__privateSet(this, _isBusy, true);
|
|
11519
|
+
let pm;
|
|
11520
|
+
pm = state ? __privateMethod(this, _onTalkStart, onTalkStart_fn).call(this) : __privateMethod(this, _onTalkEnd, onTalkEnd_fn).call(this);
|
|
11521
|
+
pm.then(() => {
|
|
11522
|
+
__privateSet(this, _talk, state);
|
|
11523
|
+
}).catch((e) => {
|
|
11524
|
+
__privateGet(this, _doingIcon).replaceWith(__privateGet(this, _offIcon));
|
|
11525
|
+
});
|
|
11526
|
+
pm.finally(() => {
|
|
11527
|
+
__privateSet(this, _isBusy, false);
|
|
11528
|
+
});
|
|
11512
11529
|
}
|
|
11513
11530
|
}
|
|
11514
11531
|
set intercom(ins) {
|
|
11515
11532
|
__privateSet(this, _intercom, ins);
|
|
11516
11533
|
}
|
|
11534
|
+
set type(type) {
|
|
11535
|
+
__privateSet(this, _type, type);
|
|
11536
|
+
}
|
|
11517
11537
|
connectedCallback() {
|
|
11518
11538
|
this.render();
|
|
11519
11539
|
}
|
|
@@ -11525,21 +11545,30 @@ If you want to allow non-zero first timestamps, set firstTimestampBehavior: 'per
|
|
|
11525
11545
|
};
|
|
11526
11546
|
_onIcon = new WeakMap();
|
|
11527
11547
|
_offIcon = new WeakMap();
|
|
11548
|
+
_doingIcon = new WeakMap();
|
|
11549
|
+
_isBusy = new WeakMap();
|
|
11528
11550
|
_talk = new WeakMap();
|
|
11529
11551
|
_intercom = new WeakMap();
|
|
11552
|
+
_type = new WeakMap();
|
|
11530
11553
|
_onTalkStart = new WeakSet();
|
|
11531
11554
|
onTalkStart_fn = function() {
|
|
11532
|
-
|
|
11533
|
-
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11555
|
+
return __async(this, null, function* () {
|
|
11556
|
+
var _a;
|
|
11557
|
+
if (!__privateGet(this, _intercom))
|
|
11558
|
+
return;
|
|
11559
|
+
__privateGet(this, _offIcon).replaceWith(__privateGet(this, _doingIcon));
|
|
11560
|
+
yield (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.open(void 0, __privateGet(this, _type));
|
|
11561
|
+
__privateGet(this, _doingIcon).replaceWith(__privateGet(this, _onIcon));
|
|
11562
|
+
});
|
|
11537
11563
|
};
|
|
11538
11564
|
_onTalkEnd = new WeakSet();
|
|
11539
11565
|
onTalkEnd_fn = function() {
|
|
11540
|
-
|
|
11541
|
-
|
|
11542
|
-
|
|
11566
|
+
return __async(this, null, function* () {
|
|
11567
|
+
var _a;
|
|
11568
|
+
__privateGet(this, _onIcon).replaceWith(__privateGet(this, _doingIcon));
|
|
11569
|
+
yield (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.close();
|
|
11570
|
+
__privateGet(this, _doingIcon).replaceWith(__privateGet(this, _offIcon));
|
|
11571
|
+
});
|
|
11543
11572
|
};
|
|
11544
11573
|
customElements.define("mike-button", MikeButton);
|
|
11545
11574
|
|
|
@@ -17689,8 +17718,10 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
|
|
|
17689
17718
|
enableController: false
|
|
17690
17719
|
});
|
|
17691
17720
|
const instance2 = __spreadProps(__spreadValues({}, bvWebrtcComponentInstance), {
|
|
17692
|
-
open: (..._0) => __async(void 0, [..._0], function* (protocol = type) {
|
|
17721
|
+
open: (..._0) => __async(void 0, [..._0], function* (protocol = type, mikeButtonType) {
|
|
17693
17722
|
var _a, _b, _c;
|
|
17723
|
+
if (mikeButtonType)
|
|
17724
|
+
protocol = mikeButtonType;
|
|
17694
17725
|
const player = bvWebrtcComponentInstance.__dangerGetPlayer();
|
|
17695
17726
|
let hplayer = null;
|
|
17696
17727
|
try {
|
|
@@ -17776,15 +17807,17 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
|
|
|
17776
17807
|
}
|
|
17777
17808
|
};
|
|
17778
17809
|
player.spinner.spin = false;
|
|
17779
|
-
|
|
17810
|
+
const closeHandle = () => __async(void 0, null, function* () {
|
|
17780
17811
|
if (!hplayer)
|
|
17781
17812
|
return;
|
|
17813
|
+
player.removeEventListener("close", closeHandle);
|
|
17782
17814
|
hplayer.close();
|
|
17783
17815
|
yield dialog_default.closeDialogs(
|
|
17784
17816
|
[hplayer.getDialogID()],
|
|
17785
17817
|
sdpFetcher.token
|
|
17786
17818
|
);
|
|
17787
|
-
})
|
|
17819
|
+
});
|
|
17820
|
+
player.addEventListener("close", closeHandle);
|
|
17788
17821
|
} catch (e2) {
|
|
17789
17822
|
console.error("\u51FA\u9519", e2);
|
|
17790
17823
|
player.mask.visible = true;
|
|
@@ -18275,6 +18308,7 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
|
|
|
18275
18308
|
};
|
|
18276
18309
|
|
|
18277
18310
|
// src/components/puPlayer.tsx
|
|
18311
|
+
init_jsx();
|
|
18278
18312
|
var createProductRemoteSdp = (puOption, tempToken, callBack) => (localDescription) => __async(void 0, null, function* () {
|
|
18279
18313
|
if (localDescription.type !== "offer")
|
|
18280
18314
|
return void 0;
|
|
@@ -18604,8 +18638,10 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
|
|
|
18604
18638
|
audioWaveShow.setMediaStream(player.video.srcObject);
|
|
18605
18639
|
audioWaveShow.setEle(playerEl);
|
|
18606
18640
|
}
|
|
18607
|
-
if (player.mikeBtn)
|
|
18641
|
+
if (player.mikeBtn) {
|
|
18608
18642
|
player.mikeBtn.intercom = intercom == null ? void 0 : intercom.instance;
|
|
18643
|
+
player.mikeBtn.type = this.protocol;
|
|
18644
|
+
}
|
|
18609
18645
|
} catch (e) {
|
|
18610
18646
|
try {
|
|
18611
18647
|
let DisplayVolumn2 = function(volume) {
|
|
@@ -18694,9 +18730,13 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
|
|
|
18694
18730
|
});
|
|
18695
18731
|
};
|
|
18696
18732
|
player.spinner.spin = false;
|
|
18697
|
-
|
|
18733
|
+
const closeHandle = () => __async(this, null, function* () {
|
|
18698
18734
|
var _a3;
|
|
18699
|
-
|
|
18735
|
+
player.removeEventListener("close", closeHandle);
|
|
18736
|
+
(_a3 = player.panel) == null ? void 0 : _a3.controller.removeEventListener(
|
|
18737
|
+
"volume",
|
|
18738
|
+
updateVolumeWrapper
|
|
18739
|
+
);
|
|
18700
18740
|
player.clearEventListener("recordStart");
|
|
18701
18741
|
player.clearEventListener("recordStop");
|
|
18702
18742
|
player.clearEventListener("screenshot");
|
|
@@ -18708,7 +18748,8 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
|
|
|
18708
18748
|
yield new Promise((r) => {
|
|
18709
18749
|
setTimeout(r, 100);
|
|
18710
18750
|
});
|
|
18711
|
-
})
|
|
18751
|
+
});
|
|
18752
|
+
player.addEventListener("close", closeHandle);
|
|
18712
18753
|
onConnected && onConnected();
|
|
18713
18754
|
reconnectMgr == null ? void 0 : reconnectMgr.cancelReconnect();
|
|
18714
18755
|
dialog_default.closeDialogs([dialogId || ""], tempToken || "");
|
|
@@ -18803,7 +18844,10 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
|
|
|
18803
18844
|
let updateVolumeWrapper = () => {
|
|
18804
18845
|
updateVolumeButton();
|
|
18805
18846
|
};
|
|
18806
|
-
player.panel.controller.addEventListener(
|
|
18847
|
+
player.panel.controller.addEventListener(
|
|
18848
|
+
"volume",
|
|
18849
|
+
updateVolumeWrapper
|
|
18850
|
+
);
|
|
18807
18851
|
const volumeSlider = player.panel.controller.VolumeSlider;
|
|
18808
18852
|
if (volumeSlider) {
|
|
18809
18853
|
volumeSlider.percent = hplayer.getVolume();
|
|
@@ -18817,8 +18861,10 @@ ${event.candidate ? event.candidate.candidate : "(null)"}`
|
|
|
18817
18861
|
DisplayVolumn2(Number(e2 == null ? void 0 : e2.percent));
|
|
18818
18862
|
});
|
|
18819
18863
|
}
|
|
18820
|
-
if (player.mikeBtn)
|
|
18864
|
+
if (player.mikeBtn) {
|
|
18821
18865
|
player.mikeBtn.intercom = intercom == null ? void 0 : intercom.instance;
|
|
18866
|
+
player.mikeBtn.type = this.protocol;
|
|
18867
|
+
}
|
|
18822
18868
|
} catch (e2) {
|
|
18823
18869
|
player.mask.visible = true;
|
|
18824
18870
|
player.mask.text = t("connect-failed");
|
package/dist/main.es.js
CHANGED
|
@@ -99,7 +99,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
99
99
|
var define_processenv_default;
|
|
100
100
|
var init_define_processenv = __esm({
|
|
101
101
|
"<define:processenv>"() {
|
|
102
|
-
define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.
|
|
102
|
+
define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.54", PROJECT_NAMESPACE: "bvplayer" };
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
|
|
@@ -11154,6 +11154,7 @@ function SvgElementbvPlayerCoreMikeOff({ className }) {
|
|
|
11154
11154
|
}
|
|
11155
11155
|
|
|
11156
11156
|
// src/templates/icons.tsx
|
|
11157
|
+
init_jsx();
|
|
11157
11158
|
var Icon = ({ children, className, style: style2 }) => {
|
|
11158
11159
|
const clsName = core_default.style.cls(["icon", className]);
|
|
11159
11160
|
return /* @__PURE__ */ jsx.h("span", { className: clsName, style: style2, withNamespace: true }, children);
|
|
@@ -11189,6 +11190,7 @@ var Rotate = () => /* @__PURE__ */ jsx.h(Icon, null, /* @__PURE__ */ jsx.h(SvgEl
|
|
|
11189
11190
|
var PtzControl = () => /* @__PURE__ */ jsx.h(Icon, null, /* @__PURE__ */ jsx.h(SvgElementbvPlayerCorePtzControl, null));
|
|
11190
11191
|
var MikeOn = () => /* @__PURE__ */ jsx.h(Icon, null, /* @__PURE__ */ jsx.h(SvgElementbvPlayerCoreMikeOn, null));
|
|
11191
11192
|
var MikeOff = () => /* @__PURE__ */ jsx.h(Icon, null, /* @__PURE__ */ jsx.h(SvgElementbvPlayerCoreMikeOff, null));
|
|
11193
|
+
var MikeDoing = () => /* @__PURE__ */ jsx.h(Icon, null, /* @__PURE__ */ jsx.h("span", { style: `display: inline-block; --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='18' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.67' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='.33' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3Ccircle cx='6' cy='12' r='0' fill='currentColor'%3E%3Canimate attributeName='r' begin='0' calcMode='spline' dur='1.5s' keySplines='0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8' repeatCount='indefinite' values='0;2;0;0'/%3E%3C/circle%3E%3C!-- 1702453639037 --%3E%3C/svg%3E"); width: 20px; height: 20px; background-color: currentcolor; mask-image: var(--svg); mask-repeat: no-repeat; mask-size: 100% 100%;` }));
|
|
11192
11194
|
var directionDeg = {
|
|
11193
11195
|
top: {
|
|
11194
11196
|
value: 0,
|
|
@@ -11256,7 +11258,8 @@ var Icons = {
|
|
|
11256
11258
|
Direction,
|
|
11257
11259
|
Operator,
|
|
11258
11260
|
MikeOn,
|
|
11259
|
-
MikeOff
|
|
11261
|
+
MikeOff,
|
|
11262
|
+
MikeDoing
|
|
11260
11263
|
};
|
|
11261
11264
|
var icons_default = Icons;
|
|
11262
11265
|
|
|
@@ -11465,7 +11468,8 @@ init_logger();
|
|
|
11465
11468
|
// src/components/subComponent/mikeButton.tsx
|
|
11466
11469
|
init_define_processenv();
|
|
11467
11470
|
init_jsx_shim();
|
|
11468
|
-
|
|
11471
|
+
init_jsx();
|
|
11472
|
+
var _onIcon, _offIcon, _doingIcon, _isBusy, _talk, _intercom, _type, _onTalkStart, onTalkStart_fn, _onTalkEnd, onTalkEnd_fn;
|
|
11469
11473
|
var MikeButton = class extends HTMLElement {
|
|
11470
11474
|
constructor() {
|
|
11471
11475
|
super();
|
|
@@ -11474,13 +11478,19 @@ var MikeButton = class extends HTMLElement {
|
|
|
11474
11478
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields weakmep实现的私有变量
|
|
11475
11479
|
__privateAdd(this, _onIcon, core_default.dom.createByJsx(/* @__PURE__ */ jsx.h(icons_default.MikeOn, null)));
|
|
11476
11480
|
__privateAdd(this, _offIcon, core_default.dom.createByJsx(/* @__PURE__ */ jsx.h(icons_default.MikeOff, null)));
|
|
11481
|
+
__privateAdd(this, _doingIcon, core_default.dom.createByJsx(/* @__PURE__ */ jsx.h(icons_default.MikeDoing, null)));
|
|
11482
|
+
__privateAdd(this, _isBusy, false);
|
|
11477
11483
|
//是否正在喊话
|
|
11478
11484
|
__privateAdd(this, _talk, false);
|
|
11479
11485
|
// 麦克风实例
|
|
11480
11486
|
__privateAdd(this, _intercom, void 0);
|
|
11487
|
+
// 协议类型
|
|
11488
|
+
__privateAdd(this, _type, void 0);
|
|
11481
11489
|
this.attachShadow({ mode: "open" });
|
|
11482
11490
|
this.addEventListener("click", () => {
|
|
11483
|
-
this
|
|
11491
|
+
if (!__privateGet(this, _isBusy)) {
|
|
11492
|
+
this.talking = !this.talking;
|
|
11493
|
+
}
|
|
11484
11494
|
});
|
|
11485
11495
|
this.talking = false;
|
|
11486
11496
|
}
|
|
@@ -11490,16 +11500,26 @@ var MikeButton = class extends HTMLElement {
|
|
|
11490
11500
|
set talking(state) {
|
|
11491
11501
|
if (__privateGet(this, _talk) === state)
|
|
11492
11502
|
return;
|
|
11493
|
-
|
|
11494
|
-
|
|
11495
|
-
|
|
11496
|
-
|
|
11497
|
-
|
|
11503
|
+
if (!__privateGet(this, _isBusy)) {
|
|
11504
|
+
__privateSet(this, _isBusy, true);
|
|
11505
|
+
let pm;
|
|
11506
|
+
pm = state ? __privateMethod(this, _onTalkStart, onTalkStart_fn).call(this) : __privateMethod(this, _onTalkEnd, onTalkEnd_fn).call(this);
|
|
11507
|
+
pm.then(() => {
|
|
11508
|
+
__privateSet(this, _talk, state);
|
|
11509
|
+
}).catch((e) => {
|
|
11510
|
+
__privateGet(this, _doingIcon).replaceWith(__privateGet(this, _offIcon));
|
|
11511
|
+
});
|
|
11512
|
+
pm.finally(() => {
|
|
11513
|
+
__privateSet(this, _isBusy, false);
|
|
11514
|
+
});
|
|
11498
11515
|
}
|
|
11499
11516
|
}
|
|
11500
11517
|
set intercom(ins) {
|
|
11501
11518
|
__privateSet(this, _intercom, ins);
|
|
11502
11519
|
}
|
|
11520
|
+
set type(type) {
|
|
11521
|
+
__privateSet(this, _type, type);
|
|
11522
|
+
}
|
|
11503
11523
|
connectedCallback() {
|
|
11504
11524
|
this.render();
|
|
11505
11525
|
}
|
|
@@ -11511,21 +11531,30 @@ var MikeButton = class extends HTMLElement {
|
|
|
11511
11531
|
};
|
|
11512
11532
|
_onIcon = new WeakMap();
|
|
11513
11533
|
_offIcon = new WeakMap();
|
|
11534
|
+
_doingIcon = new WeakMap();
|
|
11535
|
+
_isBusy = new WeakMap();
|
|
11514
11536
|
_talk = new WeakMap();
|
|
11515
11537
|
_intercom = new WeakMap();
|
|
11538
|
+
_type = new WeakMap();
|
|
11516
11539
|
_onTalkStart = new WeakSet();
|
|
11517
11540
|
onTalkStart_fn = function() {
|
|
11518
|
-
|
|
11519
|
-
|
|
11520
|
-
|
|
11521
|
-
|
|
11522
|
-
|
|
11541
|
+
return __async(this, null, function* () {
|
|
11542
|
+
var _a;
|
|
11543
|
+
if (!__privateGet(this, _intercom))
|
|
11544
|
+
return;
|
|
11545
|
+
__privateGet(this, _offIcon).replaceWith(__privateGet(this, _doingIcon));
|
|
11546
|
+
yield (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.open(void 0, __privateGet(this, _type));
|
|
11547
|
+
__privateGet(this, _doingIcon).replaceWith(__privateGet(this, _onIcon));
|
|
11548
|
+
});
|
|
11523
11549
|
};
|
|
11524
11550
|
_onTalkEnd = new WeakSet();
|
|
11525
11551
|
onTalkEnd_fn = function() {
|
|
11526
|
-
|
|
11527
|
-
|
|
11528
|
-
|
|
11552
|
+
return __async(this, null, function* () {
|
|
11553
|
+
var _a;
|
|
11554
|
+
__privateGet(this, _onIcon).replaceWith(__privateGet(this, _doingIcon));
|
|
11555
|
+
yield (_a = __privateGet(this, _intercom)) == null ? void 0 : _a.close();
|
|
11556
|
+
__privateGet(this, _doingIcon).replaceWith(__privateGet(this, _offIcon));
|
|
11557
|
+
});
|
|
11529
11558
|
};
|
|
11530
11559
|
customElements.define("mike-button", MikeButton);
|
|
11531
11560
|
|
|
@@ -17675,8 +17704,10 @@ var AudioPlayer = (props) => {
|
|
|
17675
17704
|
enableController: false
|
|
17676
17705
|
});
|
|
17677
17706
|
const instance2 = __spreadProps(__spreadValues({}, bvWebrtcComponentInstance), {
|
|
17678
|
-
open: (..._0) => __async(void 0, [..._0], function* (protocol = type) {
|
|
17707
|
+
open: (..._0) => __async(void 0, [..._0], function* (protocol = type, mikeButtonType) {
|
|
17679
17708
|
var _a, _b, _c;
|
|
17709
|
+
if (mikeButtonType)
|
|
17710
|
+
protocol = mikeButtonType;
|
|
17680
17711
|
const player = bvWebrtcComponentInstance.__dangerGetPlayer();
|
|
17681
17712
|
let hplayer = null;
|
|
17682
17713
|
try {
|
|
@@ -17762,15 +17793,17 @@ var AudioPlayer = (props) => {
|
|
|
17762
17793
|
}
|
|
17763
17794
|
};
|
|
17764
17795
|
player.spinner.spin = false;
|
|
17765
|
-
|
|
17796
|
+
const closeHandle = () => __async(void 0, null, function* () {
|
|
17766
17797
|
if (!hplayer)
|
|
17767
17798
|
return;
|
|
17799
|
+
player.removeEventListener("close", closeHandle);
|
|
17768
17800
|
hplayer.close();
|
|
17769
17801
|
yield dialog_default.closeDialogs(
|
|
17770
17802
|
[hplayer.getDialogID()],
|
|
17771
17803
|
sdpFetcher.token
|
|
17772
17804
|
);
|
|
17773
|
-
})
|
|
17805
|
+
});
|
|
17806
|
+
player.addEventListener("close", closeHandle);
|
|
17774
17807
|
} catch (e2) {
|
|
17775
17808
|
console.error("\u51FA\u9519", e2);
|
|
17776
17809
|
player.mask.visible = true;
|
|
@@ -18261,6 +18294,7 @@ var MediaStreamAudioWaveShowBVRtc = class {
|
|
|
18261
18294
|
};
|
|
18262
18295
|
|
|
18263
18296
|
// src/components/puPlayer.tsx
|
|
18297
|
+
init_jsx();
|
|
18264
18298
|
var createProductRemoteSdp = (puOption, tempToken, callBack) => (localDescription) => __async(void 0, null, function* () {
|
|
18265
18299
|
if (localDescription.type !== "offer")
|
|
18266
18300
|
return void 0;
|
|
@@ -18590,8 +18624,10 @@ var PuPlayer = (props) => {
|
|
|
18590
18624
|
audioWaveShow.setMediaStream(player.video.srcObject);
|
|
18591
18625
|
audioWaveShow.setEle(playerEl);
|
|
18592
18626
|
}
|
|
18593
|
-
if (player.mikeBtn)
|
|
18627
|
+
if (player.mikeBtn) {
|
|
18594
18628
|
player.mikeBtn.intercom = intercom == null ? void 0 : intercom.instance;
|
|
18629
|
+
player.mikeBtn.type = this.protocol;
|
|
18630
|
+
}
|
|
18595
18631
|
} catch (e) {
|
|
18596
18632
|
try {
|
|
18597
18633
|
let DisplayVolumn2 = function(volume) {
|
|
@@ -18680,9 +18716,13 @@ var PuPlayer = (props) => {
|
|
|
18680
18716
|
});
|
|
18681
18717
|
};
|
|
18682
18718
|
player.spinner.spin = false;
|
|
18683
|
-
|
|
18719
|
+
const closeHandle = () => __async(this, null, function* () {
|
|
18684
18720
|
var _a3;
|
|
18685
|
-
|
|
18721
|
+
player.removeEventListener("close", closeHandle);
|
|
18722
|
+
(_a3 = player.panel) == null ? void 0 : _a3.controller.removeEventListener(
|
|
18723
|
+
"volume",
|
|
18724
|
+
updateVolumeWrapper
|
|
18725
|
+
);
|
|
18686
18726
|
player.clearEventListener("recordStart");
|
|
18687
18727
|
player.clearEventListener("recordStop");
|
|
18688
18728
|
player.clearEventListener("screenshot");
|
|
@@ -18694,7 +18734,8 @@ var PuPlayer = (props) => {
|
|
|
18694
18734
|
yield new Promise((r) => {
|
|
18695
18735
|
setTimeout(r, 100);
|
|
18696
18736
|
});
|
|
18697
|
-
})
|
|
18737
|
+
});
|
|
18738
|
+
player.addEventListener("close", closeHandle);
|
|
18698
18739
|
onConnected && onConnected();
|
|
18699
18740
|
reconnectMgr == null ? void 0 : reconnectMgr.cancelReconnect();
|
|
18700
18741
|
dialog_default.closeDialogs([dialogId || ""], tempToken || "");
|
|
@@ -18789,7 +18830,10 @@ var PuPlayer = (props) => {
|
|
|
18789
18830
|
let updateVolumeWrapper = () => {
|
|
18790
18831
|
updateVolumeButton();
|
|
18791
18832
|
};
|
|
18792
|
-
player.panel.controller.addEventListener(
|
|
18833
|
+
player.panel.controller.addEventListener(
|
|
18834
|
+
"volume",
|
|
18835
|
+
updateVolumeWrapper
|
|
18836
|
+
);
|
|
18793
18837
|
const volumeSlider = player.panel.controller.VolumeSlider;
|
|
18794
18838
|
if (volumeSlider) {
|
|
18795
18839
|
volumeSlider.percent = hplayer.getVolume();
|
|
@@ -18803,8 +18847,10 @@ var PuPlayer = (props) => {
|
|
|
18803
18847
|
DisplayVolumn2(Number(e2 == null ? void 0 : e2.percent));
|
|
18804
18848
|
});
|
|
18805
18849
|
}
|
|
18806
|
-
if (player.mikeBtn)
|
|
18850
|
+
if (player.mikeBtn) {
|
|
18807
18851
|
player.mikeBtn.intercom = intercom == null ? void 0 : intercom.instance;
|
|
18852
|
+
player.mikeBtn.type = this.protocol;
|
|
18853
|
+
}
|
|
18808
18854
|
} catch (e2) {
|
|
18809
18855
|
player.mask.visible = true;
|
|
18810
18856
|
player.mask.text = t("connect-failed");
|
|
@@ -16,7 +16,7 @@ export interface IBvWebrtcComponentProps extends Props {
|
|
|
16
16
|
enableController?: boolean;
|
|
17
17
|
}
|
|
18
18
|
export interface IBvWebrtcComponentInstance extends IComponentInstance {
|
|
19
|
-
open(protocol?: "auto" | "webrtc" | "ws-bvrtc"): Promise<any>;
|
|
19
|
+
open(protocol?: "auto" | "webrtc" | "ws-bvrtc", mikeButtonType?: "auto" | "webrtc" | "ws-bvrtc"): Promise<any>;
|
|
20
20
|
close(): Promise<any>;
|
|
21
21
|
destroy(): void;
|
|
22
22
|
setOption?(option: any): void;
|
|
@@ -5,6 +5,7 @@ export declare class MikeButton extends HTMLElement {
|
|
|
5
5
|
get talking(): boolean;
|
|
6
6
|
set talking(state: boolean);
|
|
7
7
|
set intercom(ins: IIntercomInstance | undefined);
|
|
8
|
+
set type(type: "auto" | "webrtc" | "ws-bvrtc" | undefined);
|
|
8
9
|
connectedCallback(): void;
|
|
9
10
|
render(): void;
|
|
10
11
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ShLogger } from "@shirtiny/logger";
|
|
2
|
-
declare class EmbedLogger extends ShLogger {
|
|
3
|
-
http(_message: string, ..._data: any[]): void;
|
|
4
|
-
info: (message: string, ...data: any[]) => void;
|
|
5
|
-
debug: (message: string, ...data: any[]) => void;
|
|
6
|
-
test: (message: string, ...data: any[]) => void;
|
|
7
|
-
gc: (message: string, ...data: any[]) => void;
|
|
8
|
-
libWarn: (message: string, ...data: any[]) => void;
|
|
9
|
-
libError: (message: string, ...data: any[]) => void;
|
|
10
|
-
}
|
|
11
|
-
declare const logger: EmbedLogger;
|
|
12
|
-
export default logger;
|