@besovideo/webrtc-player 0.9.86 → 0.9.88
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
CHANGED
|
@@ -117,7 +117,7 @@ var bvPlayerCore = (() => {
|
|
|
117
117
|
var define_processenv_default;
|
|
118
118
|
var init_define_processenv = __esm({
|
|
119
119
|
"<define:processenv>"() {
|
|
120
|
-
define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.9.
|
|
120
|
+
define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.9.88", PROJECT_NAMESPACE: "bvplayer" };
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
|
|
@@ -22108,7 +22108,8 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
22108
22108
|
"lian-jie-yi-wai-guan-bi": "Unexpected closure",
|
|
22109
22109
|
"da-kai-chuan-shu-tong-dao-shi-bai": "Failed to open transmission channel",
|
|
22110
22110
|
"hui-fang-wen-jian-bu-cun-zai": "File Not Found",
|
|
22111
|
-
"shi-pin-jie-ma-shi-bai": "Video decode fail"
|
|
22111
|
+
"shi-pin-jie-ma-shi-bai": "Video decode fail",
|
|
22112
|
+
"hui-fang-chu-xian-wen-ti": "There is a problem with playback:"
|
|
22112
22113
|
};
|
|
22113
22114
|
|
|
22114
22115
|
// src/locales/zh.json
|
|
@@ -22168,7 +22169,8 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
22168
22169
|
"lian-jie-yi-wai-guan-bi": "\u8FDE\u63A5\u610F\u5916\u5173\u95ED",
|
|
22169
22170
|
"da-kai-chuan-shu-tong-dao-shi-bai": "\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25",
|
|
22170
22171
|
"hui-fang-wen-jian-bu-cun-zai": "\u56DE\u653E\u6587\u4EF6\u4E0D\u5B58\u5728",
|
|
22171
|
-
"shi-pin-jie-ma-shi-bai": "\u89C6\u9891\u89E3\u7801\u5931\u8D25"
|
|
22172
|
+
"shi-pin-jie-ma-shi-bai": "\u89C6\u9891\u89E3\u7801\u5931\u8D25",
|
|
22173
|
+
"hui-fang-chu-xian-wen-ti": "\u56DE\u653E\u51FA\u73B0\u95EE\u9898\uFF1A"
|
|
22172
22174
|
};
|
|
22173
22175
|
|
|
22174
22176
|
// src/locales/i18n.ts
|
|
@@ -24441,6 +24443,14 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
24441
24443
|
svgLoading.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><g fill="none" stroke="black" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity="0.3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg>`;
|
|
24442
24444
|
return svgLoading;
|
|
24443
24445
|
}
|
|
24446
|
+
function CreateLoadingSvgWhite() {
|
|
24447
|
+
const svgLoading = document.createElement("div");
|
|
24448
|
+
svgLoading.style.position = "absolute";
|
|
24449
|
+
svgLoading.style.top = "calc(50% - 48px)";
|
|
24450
|
+
svgLoading.style.left = "calc(50% - 48px)";
|
|
24451
|
+
svgLoading.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><rect width="24" height="24" fill="none"/><g fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path stroke-dasharray="16" stroke-dashoffset="16" d="M12 3c4.97 0 9 4.03 9 9"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="16;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path><path stroke-dasharray="64" stroke-dashoffset="64" stroke-opacity="0.45" d="M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.2s" values="64;0"/></path></g></svg>`;
|
|
24452
|
+
return svgLoading;
|
|
24453
|
+
}
|
|
24444
24454
|
var PlaybackBar = class extends Plugin {
|
|
24445
24455
|
constructor() {
|
|
24446
24456
|
super(PLUGIN_NAME_PLAYBAR, "div", core_default.style.cls("blaybackbar"));
|
|
@@ -24451,6 +24461,7 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
24451
24461
|
this.isShowControls = true;
|
|
24452
24462
|
this.svgPause = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, /* @__PURE__ */ jsx_default.h("path", { fill: "currentColor", d: "M6 5h2v14H6zm10 0h2v14h-2z" })));
|
|
24453
24463
|
this.svgPlay = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 32 32" }, /* @__PURE__ */ jsx_default.h("path", { fill: "white", d: "M6.684 25.682L24.316 15.5L6.684 5.318z" })));
|
|
24464
|
+
this.svgLoadingWhite = CreateLoadingSvgWhite();
|
|
24454
24465
|
this.svgLoading = CreateLoadingSvg();
|
|
24455
24466
|
this.volumeCurrent = 100;
|
|
24456
24467
|
this.svgSoundZero = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", onclick: () => {
|
|
@@ -24601,6 +24612,16 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
24601
24612
|
});
|
|
24602
24613
|
}
|
|
24603
24614
|
}
|
|
24615
|
+
showInitLoading(isShow) {
|
|
24616
|
+
var _a;
|
|
24617
|
+
if (isShow) {
|
|
24618
|
+
core_default.dom.append(this._container, this.svgLoadingWhite);
|
|
24619
|
+
} else {
|
|
24620
|
+
if ((_a = this.svgLoadingWhite) == null ? void 0 : _a.parentNode) {
|
|
24621
|
+
core_default.dom.removeSelf(this.svgLoadingWhite);
|
|
24622
|
+
}
|
|
24623
|
+
}
|
|
24624
|
+
}
|
|
24604
24625
|
showLoading(isShow) {
|
|
24605
24626
|
var _a;
|
|
24606
24627
|
if (isShow) {
|
|
@@ -25333,14 +25354,17 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
25333
25354
|
let hplayer = void 0;
|
|
25334
25355
|
const handle2 = {};
|
|
25335
25356
|
let type = type1;
|
|
25357
|
+
let onOpenHandleOver = null;
|
|
25336
25358
|
const instance2 = {
|
|
25359
|
+
inBusy: false,
|
|
25337
25360
|
videoFit: "contain",
|
|
25338
25361
|
open() {
|
|
25339
25362
|
return __async(this, null, function* () {
|
|
25340
25363
|
var _a2, _b;
|
|
25341
|
-
if (
|
|
25364
|
+
if (instance2.inBusy) {
|
|
25342
25365
|
return;
|
|
25343
25366
|
}
|
|
25367
|
+
instance2.inBusy = true;
|
|
25344
25368
|
const audioWaveShow = new MediaStreamAudioWavePlaybackShow();
|
|
25345
25369
|
const markerHandle = new MarkerHandle({
|
|
25346
25370
|
token,
|
|
@@ -25393,6 +25417,11 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
25393
25417
|
handle2.setVideoFit = (fit) => {
|
|
25394
25418
|
player.setVideoFit(fit);
|
|
25395
25419
|
};
|
|
25420
|
+
if (apiPrefix) {
|
|
25421
|
+
setBvcspV1ApiPrefix(apiPrefix);
|
|
25422
|
+
} else {
|
|
25423
|
+
setBvcspV1ApiPrefix("");
|
|
25424
|
+
}
|
|
25396
25425
|
barHandle.addEventListener("download", () => {
|
|
25397
25426
|
const filePath = playbackUrl ? playbackUrl : dialog_default.getPlaybackFilePath({ fileId: fileID, puid: puOption == null ? void 0 : puOption.puId }, token);
|
|
25398
25427
|
const aEle = document.createElement("a");
|
|
@@ -25408,7 +25437,7 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
25408
25437
|
const webHandle = () => {
|
|
25409
25438
|
return new Promise((r) => __async(this, null, function* () {
|
|
25410
25439
|
const videoEle = player.video.getVideoEl();
|
|
25411
|
-
const srcFile = playbackUrl ? playbackUrl : dialog_default.getPlaybackFilePath({ fileId: fileID, puid: puOption == null ? void 0 : puOption.puId }, token)
|
|
25440
|
+
const srcFile = playbackUrl ? playbackUrl : `${dialog_default.getPlaybackFilePath({ fileId: fileID, puid: puOption == null ? void 0 : puOption.puId }, token)}`;
|
|
25412
25441
|
const fileInfo = yield IsContainterHasVideoTrack({ path: srcFile });
|
|
25413
25442
|
const removeHooks = [];
|
|
25414
25443
|
removeHooks.push(() => {
|
|
@@ -25436,6 +25465,21 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
25436
25465
|
player.mask.visible = true;
|
|
25437
25466
|
return r(false);
|
|
25438
25467
|
}
|
|
25468
|
+
videoEle.onerror = () => __async(this, null, function* () {
|
|
25469
|
+
var _a3;
|
|
25470
|
+
player.mask.text = t("hui-fang-chu-xian-wen-ti") + ((_a3 = videoEle.error) == null ? void 0 : _a3.code);
|
|
25471
|
+
player.mask.visible = true;
|
|
25472
|
+
if (instance2.protocol == "auto") {
|
|
25473
|
+
instance2.inBusy = true;
|
|
25474
|
+
barHandle.showInitLoading(true);
|
|
25475
|
+
yield RunHandle("ws-bvrtc");
|
|
25476
|
+
barHandle.showInitLoading(false);
|
|
25477
|
+
instance2.inBusy = false;
|
|
25478
|
+
}
|
|
25479
|
+
});
|
|
25480
|
+
removeHooks.push(() => {
|
|
25481
|
+
videoEle.onerror = null;
|
|
25482
|
+
});
|
|
25439
25483
|
videoEle.src = srcFile;
|
|
25440
25484
|
videoEle.controls = false;
|
|
25441
25485
|
removeHooks.push(
|
|
@@ -25690,6 +25734,7 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
25690
25734
|
}
|
|
25691
25735
|
return false;
|
|
25692
25736
|
}
|
|
25737
|
+
barHandle.showInitLoading(true);
|
|
25693
25738
|
if (this.protocol == "auto") {
|
|
25694
25739
|
if (!(yield RunHandle("web"))) {
|
|
25695
25740
|
yield RunHandle("ws-bvrtc");
|
|
@@ -25697,12 +25742,30 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
25697
25742
|
} else {
|
|
25698
25743
|
yield RunHandle(this.protocol);
|
|
25699
25744
|
}
|
|
25745
|
+
barHandle.showInitLoading(false);
|
|
25746
|
+
instance2.inBusy = false;
|
|
25700
25747
|
});
|
|
25701
25748
|
},
|
|
25702
25749
|
close() {
|
|
25703
25750
|
return __async(this, null, function* () {
|
|
25704
25751
|
var _a2;
|
|
25705
|
-
(
|
|
25752
|
+
if (!instance2.inBusy) {
|
|
25753
|
+
(_a2 = handle2.close) == null ? void 0 : _a2.call(handle2);
|
|
25754
|
+
} else if (instance2.inBusy) {
|
|
25755
|
+
yield new Promise((r) => {
|
|
25756
|
+
const oriOnOpenHandleOver = onOpenHandleOver;
|
|
25757
|
+
onOpenHandleOver = () => {
|
|
25758
|
+
var _a3;
|
|
25759
|
+
onOpenHandleOver = null;
|
|
25760
|
+
try {
|
|
25761
|
+
oriOnOpenHandleOver == null ? void 0 : oriOnOpenHandleOver();
|
|
25762
|
+
(_a3 = handle2.close) == null ? void 0 : _a3.call(handle2);
|
|
25763
|
+
} catch (e) {
|
|
25764
|
+
}
|
|
25765
|
+
r();
|
|
25766
|
+
};
|
|
25767
|
+
});
|
|
25768
|
+
}
|
|
25706
25769
|
});
|
|
25707
25770
|
},
|
|
25708
25771
|
pause() {
|
|
@@ -25731,6 +25794,9 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
|
|
|
25731
25794
|
this.videoFit = fit;
|
|
25732
25795
|
},
|
|
25733
25796
|
setProtocol: function(protocol) {
|
|
25797
|
+
if (this.protocol == protocol || this.inBusy) {
|
|
25798
|
+
return;
|
|
25799
|
+
}
|
|
25734
25800
|
this.close();
|
|
25735
25801
|
this.protocol = (puOption == null ? void 0 : puOption.puId) ? protocol : protocol;
|
|
25736
25802
|
this.open();
|
package/dist/main.es.js
CHANGED
|
@@ -111,7 +111,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
111
111
|
var define_processenv_default;
|
|
112
112
|
var init_define_processenv = __esm({
|
|
113
113
|
"<define:processenv>"() {
|
|
114
|
-
define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.9.
|
|
114
|
+
define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.9.88", PROJECT_NAMESPACE: "bvplayer" };
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
|
|
@@ -22092,7 +22092,8 @@ var en_default = {
|
|
|
22092
22092
|
"lian-jie-yi-wai-guan-bi": "Unexpected closure",
|
|
22093
22093
|
"da-kai-chuan-shu-tong-dao-shi-bai": "Failed to open transmission channel",
|
|
22094
22094
|
"hui-fang-wen-jian-bu-cun-zai": "File Not Found",
|
|
22095
|
-
"shi-pin-jie-ma-shi-bai": "Video decode fail"
|
|
22095
|
+
"shi-pin-jie-ma-shi-bai": "Video decode fail",
|
|
22096
|
+
"hui-fang-chu-xian-wen-ti": "There is a problem with playback:"
|
|
22096
22097
|
};
|
|
22097
22098
|
|
|
22098
22099
|
// src/locales/zh.json
|
|
@@ -22152,7 +22153,8 @@ var zh_default = {
|
|
|
22152
22153
|
"lian-jie-yi-wai-guan-bi": "\u8FDE\u63A5\u610F\u5916\u5173\u95ED",
|
|
22153
22154
|
"da-kai-chuan-shu-tong-dao-shi-bai": "\u6253\u5F00\u4F20\u8F93\u901A\u9053\u5931\u8D25",
|
|
22154
22155
|
"hui-fang-wen-jian-bu-cun-zai": "\u56DE\u653E\u6587\u4EF6\u4E0D\u5B58\u5728",
|
|
22155
|
-
"shi-pin-jie-ma-shi-bai": "\u89C6\u9891\u89E3\u7801\u5931\u8D25"
|
|
22156
|
+
"shi-pin-jie-ma-shi-bai": "\u89C6\u9891\u89E3\u7801\u5931\u8D25",
|
|
22157
|
+
"hui-fang-chu-xian-wen-ti": "\u56DE\u653E\u51FA\u73B0\u95EE\u9898\uFF1A"
|
|
22156
22158
|
};
|
|
22157
22159
|
|
|
22158
22160
|
// src/locales/i18n.ts
|
|
@@ -24425,6 +24427,14 @@ function CreateLoadingSvg() {
|
|
|
24425
24427
|
svgLoading.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><g fill="none" stroke="black" stroke-linecap="round" stroke-width="2"><path stroke-dasharray="60" stroke-dashoffset="60" stroke-opacity="0.3" d="M12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.3s" values="60;0"/></path><path stroke-dasharray="15" stroke-dashoffset="15" d="M12 3C16.9706 3 21 7.02944 21 12"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="15;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></g></svg>`;
|
|
24426
24428
|
return svgLoading;
|
|
24427
24429
|
}
|
|
24430
|
+
function CreateLoadingSvgWhite() {
|
|
24431
|
+
const svgLoading = document.createElement("div");
|
|
24432
|
+
svgLoading.style.position = "absolute";
|
|
24433
|
+
svgLoading.style.top = "calc(50% - 48px)";
|
|
24434
|
+
svgLoading.style.left = "calc(50% - 48px)";
|
|
24435
|
+
svgLoading.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><rect width="24" height="24" fill="none"/><g fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path stroke-dasharray="16" stroke-dashoffset="16" d="M12 3c4.97 0 9 4.03 9 9"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="16;0"/><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path><path stroke-dasharray="64" stroke-dashoffset="64" stroke-opacity="0.45" d="M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.2s" values="64;0"/></path></g></svg>`;
|
|
24436
|
+
return svgLoading;
|
|
24437
|
+
}
|
|
24428
24438
|
var PlaybackBar = class extends Plugin {
|
|
24429
24439
|
constructor() {
|
|
24430
24440
|
super(PLUGIN_NAME_PLAYBAR, "div", core_default.style.cls("blaybackbar"));
|
|
@@ -24435,6 +24445,7 @@ var PlaybackBar = class extends Plugin {
|
|
|
24435
24445
|
this.isShowControls = true;
|
|
24436
24446
|
this.svgPause = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, /* @__PURE__ */ jsx_default.h("path", { fill: "currentColor", d: "M6 5h2v14H6zm10 0h2v14h-2z" })));
|
|
24437
24447
|
this.svgPlay = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 32 32" }, /* @__PURE__ */ jsx_default.h("path", { fill: "white", d: "M6.684 25.682L24.316 15.5L6.684 5.318z" })));
|
|
24448
|
+
this.svgLoadingWhite = CreateLoadingSvgWhite();
|
|
24438
24449
|
this.svgLoading = CreateLoadingSvg();
|
|
24439
24450
|
this.volumeCurrent = 100;
|
|
24440
24451
|
this.svgSoundZero = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", onclick: () => {
|
|
@@ -24585,6 +24596,16 @@ var PlaybackBar = class extends Plugin {
|
|
|
24585
24596
|
});
|
|
24586
24597
|
}
|
|
24587
24598
|
}
|
|
24599
|
+
showInitLoading(isShow) {
|
|
24600
|
+
var _a;
|
|
24601
|
+
if (isShow) {
|
|
24602
|
+
core_default.dom.append(this._container, this.svgLoadingWhite);
|
|
24603
|
+
} else {
|
|
24604
|
+
if ((_a = this.svgLoadingWhite) == null ? void 0 : _a.parentNode) {
|
|
24605
|
+
core_default.dom.removeSelf(this.svgLoadingWhite);
|
|
24606
|
+
}
|
|
24607
|
+
}
|
|
24608
|
+
}
|
|
24588
24609
|
showLoading(isShow) {
|
|
24589
24610
|
var _a;
|
|
24590
24611
|
if (isShow) {
|
|
@@ -25317,14 +25338,17 @@ var PlayBack = (props) => {
|
|
|
25317
25338
|
let hplayer = void 0;
|
|
25318
25339
|
const handle2 = {};
|
|
25319
25340
|
let type = type1;
|
|
25341
|
+
let onOpenHandleOver = null;
|
|
25320
25342
|
const instance2 = {
|
|
25343
|
+
inBusy: false,
|
|
25321
25344
|
videoFit: "contain",
|
|
25322
25345
|
open() {
|
|
25323
25346
|
return __async(this, null, function* () {
|
|
25324
25347
|
var _a2, _b;
|
|
25325
|
-
if (
|
|
25348
|
+
if (instance2.inBusy) {
|
|
25326
25349
|
return;
|
|
25327
25350
|
}
|
|
25351
|
+
instance2.inBusy = true;
|
|
25328
25352
|
const audioWaveShow = new MediaStreamAudioWavePlaybackShow();
|
|
25329
25353
|
const markerHandle = new MarkerHandle({
|
|
25330
25354
|
token,
|
|
@@ -25377,6 +25401,11 @@ var PlayBack = (props) => {
|
|
|
25377
25401
|
handle2.setVideoFit = (fit) => {
|
|
25378
25402
|
player.setVideoFit(fit);
|
|
25379
25403
|
};
|
|
25404
|
+
if (apiPrefix) {
|
|
25405
|
+
setBvcspV1ApiPrefix(apiPrefix);
|
|
25406
|
+
} else {
|
|
25407
|
+
setBvcspV1ApiPrefix("");
|
|
25408
|
+
}
|
|
25380
25409
|
barHandle.addEventListener("download", () => {
|
|
25381
25410
|
const filePath = playbackUrl ? playbackUrl : dialog_default.getPlaybackFilePath({ fileId: fileID, puid: puOption == null ? void 0 : puOption.puId }, token);
|
|
25382
25411
|
const aEle = document.createElement("a");
|
|
@@ -25392,7 +25421,7 @@ var PlayBack = (props) => {
|
|
|
25392
25421
|
const webHandle = () => {
|
|
25393
25422
|
return new Promise((r) => __async(this, null, function* () {
|
|
25394
25423
|
const videoEle = player.video.getVideoEl();
|
|
25395
|
-
const srcFile = playbackUrl ? playbackUrl : dialog_default.getPlaybackFilePath({ fileId: fileID, puid: puOption == null ? void 0 : puOption.puId }, token)
|
|
25424
|
+
const srcFile = playbackUrl ? playbackUrl : `${dialog_default.getPlaybackFilePath({ fileId: fileID, puid: puOption == null ? void 0 : puOption.puId }, token)}`;
|
|
25396
25425
|
const fileInfo = yield IsContainterHasVideoTrack({ path: srcFile });
|
|
25397
25426
|
const removeHooks = [];
|
|
25398
25427
|
removeHooks.push(() => {
|
|
@@ -25420,6 +25449,21 @@ var PlayBack = (props) => {
|
|
|
25420
25449
|
player.mask.visible = true;
|
|
25421
25450
|
return r(false);
|
|
25422
25451
|
}
|
|
25452
|
+
videoEle.onerror = () => __async(this, null, function* () {
|
|
25453
|
+
var _a3;
|
|
25454
|
+
player.mask.text = t("hui-fang-chu-xian-wen-ti") + ((_a3 = videoEle.error) == null ? void 0 : _a3.code);
|
|
25455
|
+
player.mask.visible = true;
|
|
25456
|
+
if (instance2.protocol == "auto") {
|
|
25457
|
+
instance2.inBusy = true;
|
|
25458
|
+
barHandle.showInitLoading(true);
|
|
25459
|
+
yield RunHandle("ws-bvrtc");
|
|
25460
|
+
barHandle.showInitLoading(false);
|
|
25461
|
+
instance2.inBusy = false;
|
|
25462
|
+
}
|
|
25463
|
+
});
|
|
25464
|
+
removeHooks.push(() => {
|
|
25465
|
+
videoEle.onerror = null;
|
|
25466
|
+
});
|
|
25423
25467
|
videoEle.src = srcFile;
|
|
25424
25468
|
videoEle.controls = false;
|
|
25425
25469
|
removeHooks.push(
|
|
@@ -25674,6 +25718,7 @@ var PlayBack = (props) => {
|
|
|
25674
25718
|
}
|
|
25675
25719
|
return false;
|
|
25676
25720
|
}
|
|
25721
|
+
barHandle.showInitLoading(true);
|
|
25677
25722
|
if (this.protocol == "auto") {
|
|
25678
25723
|
if (!(yield RunHandle("web"))) {
|
|
25679
25724
|
yield RunHandle("ws-bvrtc");
|
|
@@ -25681,12 +25726,30 @@ var PlayBack = (props) => {
|
|
|
25681
25726
|
} else {
|
|
25682
25727
|
yield RunHandle(this.protocol);
|
|
25683
25728
|
}
|
|
25729
|
+
barHandle.showInitLoading(false);
|
|
25730
|
+
instance2.inBusy = false;
|
|
25684
25731
|
});
|
|
25685
25732
|
},
|
|
25686
25733
|
close() {
|
|
25687
25734
|
return __async(this, null, function* () {
|
|
25688
25735
|
var _a2;
|
|
25689
|
-
(
|
|
25736
|
+
if (!instance2.inBusy) {
|
|
25737
|
+
(_a2 = handle2.close) == null ? void 0 : _a2.call(handle2);
|
|
25738
|
+
} else if (instance2.inBusy) {
|
|
25739
|
+
yield new Promise((r) => {
|
|
25740
|
+
const oriOnOpenHandleOver = onOpenHandleOver;
|
|
25741
|
+
onOpenHandleOver = () => {
|
|
25742
|
+
var _a3;
|
|
25743
|
+
onOpenHandleOver = null;
|
|
25744
|
+
try {
|
|
25745
|
+
oriOnOpenHandleOver == null ? void 0 : oriOnOpenHandleOver();
|
|
25746
|
+
(_a3 = handle2.close) == null ? void 0 : _a3.call(handle2);
|
|
25747
|
+
} catch (e) {
|
|
25748
|
+
}
|
|
25749
|
+
r();
|
|
25750
|
+
};
|
|
25751
|
+
});
|
|
25752
|
+
}
|
|
25690
25753
|
});
|
|
25691
25754
|
},
|
|
25692
25755
|
pause() {
|
|
@@ -25715,6 +25778,9 @@ var PlayBack = (props) => {
|
|
|
25715
25778
|
this.videoFit = fit;
|
|
25716
25779
|
},
|
|
25717
25780
|
setProtocol: function(protocol) {
|
|
25781
|
+
if (this.protocol == protocol || this.inBusy) {
|
|
25782
|
+
return;
|
|
25783
|
+
}
|
|
25718
25784
|
this.close();
|
|
25719
25785
|
this.protocol = (puOption == null ? void 0 : puOption.puId) ? protocol : protocol;
|
|
25720
25786
|
this.open();
|
|
@@ -36,6 +36,7 @@ interface IPlaybackInstance extends IComponentInstance {
|
|
|
36
36
|
setProtocol: (protocol: IPlaybackPlayType) => void;
|
|
37
37
|
videoFit: keyof IVideoFits;
|
|
38
38
|
protocol: IPlaybackPlayType;
|
|
39
|
+
inBusy: boolean;
|
|
39
40
|
}
|
|
40
41
|
declare type helperFunc = {
|
|
41
42
|
getDefaultProps: () => Partial<IPlaybackProps>;
|
|
@@ -40,8 +40,10 @@ declare class PlaybackBar extends Plugin<HTMLDivElement, IPlaybackBarEventMap> {
|
|
|
40
40
|
private onClickJump;
|
|
41
41
|
private svgPause;
|
|
42
42
|
private svgPlay;
|
|
43
|
+
private svgLoadingWhite;
|
|
44
|
+
showInitLoading(isShow: boolean): void;
|
|
43
45
|
private svgLoading;
|
|
44
|
-
|
|
46
|
+
showLoading(isShow: boolean): void;
|
|
45
47
|
jumpToTargetSeconds(params: IJumpEventParams): void;
|
|
46
48
|
private onSooundClick;
|
|
47
49
|
private onVolumeChange;
|