@besovideo/webrtc-player 0.10.4 → 0.10.6

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.
@@ -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.10.4", PROJECT_NAMESPACE: "bvplayer" };
120
+ define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.10.6", PROJECT_NAMESPACE: "bvplayer" };
121
121
  }
122
122
  });
123
123
 
@@ -22192,7 +22192,14 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
22192
22192
  "tui-song-ben-di-mei-ti-shi-bai": "Pushing local media failed",
22193
22193
  "da-kai-yuan-cheng-shi-pin-shi-bai": "Failed to open remote video",
22194
22194
  "deng-dai-yuan-cheng-ying-da-shi-bai": "Waiting for remote reply failed",
22195
- "huo-qu-ben-di-mei-ti-shi-bai": "Failed to get local media"
22195
+ "huo-qu-ben-di-mei-ti-shi-bai": "Failed to get local media",
22196
+ "dataname-jie-shu-le-tong-hua": "over",
22197
+ "hu-jiao-qing-qiu": "is calling",
22198
+ "jie-ting": "Answer",
22199
+ "ju-jue": "Refuse",
22200
+ "yi-ju-jue": "Refused",
22201
+ "shou-dao": "Here",
22202
+ miao: "seconds"
22196
22203
  };
22197
22204
 
22198
22205
  // src/locales/zh.json
@@ -22258,7 +22265,14 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
22258
22265
  "tui-song-ben-di-mei-ti-shi-bai": "\u63A8\u9001\u672C\u5730\u5A92\u4F53\u5931\u8D25",
22259
22266
  "da-kai-yuan-cheng-shi-pin-shi-bai": "\u6253\u5F00\u8FDC\u7A0B\u89C6\u9891\u5931\u8D25",
22260
22267
  "deng-dai-yuan-cheng-ying-da-shi-bai": "\u7B49\u5F85\u8FDC\u7A0B\u5E94\u7B54\u5931\u8D25",
22261
- "huo-qu-ben-di-mei-ti-shi-bai": "\u83B7\u53D6\u672C\u5730\u5A92\u4F53\u5931\u8D25"
22268
+ "huo-qu-ben-di-mei-ti-shi-bai": "\u83B7\u53D6\u672C\u5730\u5A92\u4F53\u5931\u8D25",
22269
+ "shou-dao": "\u6536\u5230",
22270
+ "hu-jiao-qing-qiu": "\u547C\u53EB\u8BF7\u6C42",
22271
+ "jie-ting": "\u63A5\u542C",
22272
+ "ju-jue": "\u62D2\u7EDD",
22273
+ "dataname-jie-shu-le-tong-hua": "\u7ED3\u675F\u4E86\u901A\u8BDD",
22274
+ miao: "\u79D2",
22275
+ "yi-ju-jue": "\u5DF2\u62D2\u7EDD"
22262
22276
  };
22263
22277
 
22264
22278
  // src/locales/i18n.ts
@@ -24695,7 +24709,7 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
24695
24709
  rc.data = result;
24696
24710
  } else {
24697
24711
  if ((result == null ? void 0 : result.status) == 7 /* REFUSE */) {
24698
- throw `\u5DF2\u62D2\u7EDD`;
24712
+ throw t("yi-ju-jue");
24699
24713
  }
24700
24714
  throw `error ${result == null ? void 0 : result.status}`;
24701
24715
  }
@@ -25159,7 +25173,7 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
25159
25173
  core_default.dom.removeSelf(divTemp);
25160
25174
  resolve(false);
25161
25175
  };
25162
- const ele = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h(jsx_default.Fragment, null, /* @__PURE__ */ jsx_default.h("div", { className: "popInvite" }, /* @__PURE__ */ jsx_default.h("div", { className: "callContent" }, /* @__PURE__ */ jsx_default.h("div", null, "\u6536\u5230 ", avCall2.name, " \u547C\u53EB\u8BF7\u6C42"), /* @__PURE__ */ jsx_default.h("div", null, timeSpan)), /* @__PURE__ */ jsx_default.h("div", { className: "btnLine" }, /* @__PURE__ */ jsx_default.h("button", { className: "btnAgree", onclick: onApply }, "\u63A5\u542C"), /* @__PURE__ */ jsx_default.h("button", { className: "btnRefuse", onclick: onRefuse }, "\u62D2\u7EDD")))));
25176
+ const ele = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h(jsx_default.Fragment, null, /* @__PURE__ */ jsx_default.h("div", { className: "popInvite" }, /* @__PURE__ */ jsx_default.h("div", { className: "callContent" }, /* @__PURE__ */ jsx_default.h("div", null, t("shou-dao"), " ", avCall2.name, " ", t("hu-jiao-qing-qiu")), /* @__PURE__ */ jsx_default.h("div", null, timeSpan)), /* @__PURE__ */ jsx_default.h("div", { className: "btnLine" }, /* @__PURE__ */ jsx_default.h("button", { className: "btnAgree", onclick: onApply }, t("jie-ting")), /* @__PURE__ */ jsx_default.h("button", { className: "btnRefuse", onclick: onRefuse }, t("ju-jue"))))));
25163
25177
  const divTemp = core_default.dom.create("div");
25164
25178
  core_default.dom.append(divTemp, ele);
25165
25179
  if (typeof params.zIndex === "number") {
@@ -25183,7 +25197,7 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
25183
25197
  if (instanceCall) {
25184
25198
  if (currentCallid == data.callId) {
25185
25199
  if (data.status == 6 /* END */) {
25186
- instanceCall.close(`${data.name} \u7ED3\u675F\u4E86\u901A\u8BDD`);
25200
+ instanceCall.close(`${data.name} ${t("dataname-jie-shu-le-tong-hua")}`);
25187
25201
  }
25188
25202
  currentCallid = "";
25189
25203
  } else {
@@ -25349,12 +25363,12 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
25349
25363
  function showMessageForSeconds(message) {
25350
25364
  return __async(this, null, function* () {
25351
25365
  if (message) {
25352
- dialogPanelHandle.setStatus(`${message} 3\u79D2`);
25366
+ dialogPanelHandle.setStatus(`${message} 3 ${t("miao")}`);
25353
25367
  const now = Date.now();
25354
25368
  const { promise, resolve } = Promise.withResolvers();
25355
25369
  const intervalToken = setInterval(() => {
25356
25370
  const pastTime = 3 - Math.floor((Date.now() - now) / 1e3);
25357
- dialogPanelHandle.setStatus(`${message} ${pastTime}\u79D2`);
25371
+ dialogPanelHandle.setStatus(`${message} ${pastTime}${t("miao")}`);
25358
25372
  if (pastTime <= 0) {
25359
25373
  clearInterval(intervalToken);
25360
25374
  resolve();
@@ -25449,6 +25463,9 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
25449
25463
  this.svgSound = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("span", { class: "svg-sound" }, /* @__PURE__ */ jsx_default.h("input", { type: "range", className: "range-input", value: this.volumeCurrent, oninput: (e) => {
25450
25464
  this.onVolumeChange(e.target.value);
25451
25465
  } })));
25466
+ this.svgSnapshot = core_default.dom.createByJsx(
25467
+ /* @__PURE__ */ jsx_default.h("svg", { onclick: () => this.dispatch("snapshot"), style: "margin-left: 20px; cursor: pointer", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 256 256" }, /* @__PURE__ */ jsx_default.h("rect", { width: "256", height: "256", fill: "none" }), /* @__PURE__ */ jsx_default.h("path", { fill: "#fff", d: "M208 58h-28.79L165 36.67a6 6 0 0 0-5-2.67H96a6 6 0 0 0-5 2.67L76.78 58H48a22 22 0 0 0-22 22v112a22 22 0 0 0 22 22h160a22 22 0 0 0 22-22V80a22 22 0 0 0-22-22m10 134a10 10 0 0 1-10 10H48a10 10 0 0 1-10-10V80a10 10 0 0 1 10-10h32a6 6 0 0 0 5-2.67L99.21 46h57.57L171 67.33a6 6 0 0 0 5 2.67h32a10 10 0 0 1 10 10ZM128 90a42 42 0 1 0 42 42a42 42 0 0 0-42-42m0 72a30 30 0 1 1 30-30a30 30 0 0 1-30 30", "stroke-width": "6.5", stroke: "#fff" }))
25468
+ );
25452
25469
  this.svgFullscreen = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { onclick: () => {
25453
25470
  this.dispatch("fullscreen");
25454
25471
  }, style: "margin-left: 30px; cursor: pointer", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, /* @__PURE__ */ jsx_default.h("path", { fill: "white", d: "M4 4h6v2H6v4H4zm10 0h6v6h-2V6h-4zM6 14v4h4v2H4v-6zm14 0v6h-6v-2h4v-4z" })));
@@ -25725,7 +25742,7 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
25725
25742
  const rightPanel = this.controls.rightControls ? this.controls.rightControls : (() => {
25726
25743
  this.controls.rightControls = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("span", { class: "right-options" }));
25727
25744
  core_default.dom.append(this.svgSound, this.svgSound100);
25728
- core_default.dom.append(this.controls.rightControls, this.svgSound, this.playSpeed, this.svgFullscreen, this.svgOptions, this.optionsContent);
25745
+ core_default.dom.append(this.controls.rightControls, this.svgSound, this.playSpeed, this.svgSnapshot, this.svgFullscreen, this.optionsContent);
25729
25746
  return this.controls.rightControls;
25730
25747
  })();
25731
25748
  const barContent = this.controls.barContent ? this.controls.barContent : this.controls.barContent = core_default.dom.createByJsx(
@@ -26385,6 +26402,10 @@ registerProcessor('bv-audio-processor', BVAudioProcessor);
26385
26402
  barHandle.addEventListener("fullscreen", () => {
26386
26403
  fullscreen_default.toggle(markerHandle.GetPlayArea());
26387
26404
  });
26405
+ barHandle.addEventListener("snapshot", () => __async(this, null, function* () {
26406
+ const snapshotHandle = yield player.video.screenshot();
26407
+ snapshotHandle == null ? void 0 : snapshotHandle.download();
26408
+ }));
26388
26409
  markerHandle.addEventListener("jump", (params) => {
26389
26410
  barHandle.jumpToTargetSeconds(params);
26390
26411
  });
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.10.4", PROJECT_NAMESPACE: "bvplayer" };
114
+ define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.10.6", PROJECT_NAMESPACE: "bvplayer" };
115
115
  }
116
116
  });
117
117
 
@@ -22175,7 +22175,14 @@ var en_default = {
22175
22175
  "tui-song-ben-di-mei-ti-shi-bai": "Pushing local media failed",
22176
22176
  "da-kai-yuan-cheng-shi-pin-shi-bai": "Failed to open remote video",
22177
22177
  "deng-dai-yuan-cheng-ying-da-shi-bai": "Waiting for remote reply failed",
22178
- "huo-qu-ben-di-mei-ti-shi-bai": "Failed to get local media"
22178
+ "huo-qu-ben-di-mei-ti-shi-bai": "Failed to get local media",
22179
+ "dataname-jie-shu-le-tong-hua": "over",
22180
+ "hu-jiao-qing-qiu": "is calling",
22181
+ "jie-ting": "Answer",
22182
+ "ju-jue": "Refuse",
22183
+ "yi-ju-jue": "Refused",
22184
+ "shou-dao": "Here",
22185
+ miao: "seconds"
22179
22186
  };
22180
22187
 
22181
22188
  // src/locales/zh.json
@@ -22241,7 +22248,14 @@ var zh_default = {
22241
22248
  "tui-song-ben-di-mei-ti-shi-bai": "\u63A8\u9001\u672C\u5730\u5A92\u4F53\u5931\u8D25",
22242
22249
  "da-kai-yuan-cheng-shi-pin-shi-bai": "\u6253\u5F00\u8FDC\u7A0B\u89C6\u9891\u5931\u8D25",
22243
22250
  "deng-dai-yuan-cheng-ying-da-shi-bai": "\u7B49\u5F85\u8FDC\u7A0B\u5E94\u7B54\u5931\u8D25",
22244
- "huo-qu-ben-di-mei-ti-shi-bai": "\u83B7\u53D6\u672C\u5730\u5A92\u4F53\u5931\u8D25"
22251
+ "huo-qu-ben-di-mei-ti-shi-bai": "\u83B7\u53D6\u672C\u5730\u5A92\u4F53\u5931\u8D25",
22252
+ "shou-dao": "\u6536\u5230",
22253
+ "hu-jiao-qing-qiu": "\u547C\u53EB\u8BF7\u6C42",
22254
+ "jie-ting": "\u63A5\u542C",
22255
+ "ju-jue": "\u62D2\u7EDD",
22256
+ "dataname-jie-shu-le-tong-hua": "\u7ED3\u675F\u4E86\u901A\u8BDD",
22257
+ miao: "\u79D2",
22258
+ "yi-ju-jue": "\u5DF2\u62D2\u7EDD"
22245
22259
  };
22246
22260
 
22247
22261
  // src/locales/i18n.ts
@@ -24678,7 +24692,7 @@ function CreateCallConnectionManager(params) {
24678
24692
  rc.data = result;
24679
24693
  } else {
24680
24694
  if ((result == null ? void 0 : result.status) == 7 /* REFUSE */) {
24681
- throw `\u5DF2\u62D2\u7EDD`;
24695
+ throw t("yi-ju-jue");
24682
24696
  }
24683
24697
  throw `error ${result == null ? void 0 : result.status}`;
24684
24698
  }
@@ -25142,7 +25156,7 @@ function runPopInvite(avCall2, params) {
25142
25156
  core_default.dom.removeSelf(divTemp);
25143
25157
  resolve(false);
25144
25158
  };
25145
- const ele = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h(jsx_default.Fragment, null, /* @__PURE__ */ jsx_default.h("div", { className: "popInvite" }, /* @__PURE__ */ jsx_default.h("div", { className: "callContent" }, /* @__PURE__ */ jsx_default.h("div", null, "\u6536\u5230 ", avCall2.name, " \u547C\u53EB\u8BF7\u6C42"), /* @__PURE__ */ jsx_default.h("div", null, timeSpan)), /* @__PURE__ */ jsx_default.h("div", { className: "btnLine" }, /* @__PURE__ */ jsx_default.h("button", { className: "btnAgree", onclick: onApply }, "\u63A5\u542C"), /* @__PURE__ */ jsx_default.h("button", { className: "btnRefuse", onclick: onRefuse }, "\u62D2\u7EDD")))));
25159
+ const ele = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h(jsx_default.Fragment, null, /* @__PURE__ */ jsx_default.h("div", { className: "popInvite" }, /* @__PURE__ */ jsx_default.h("div", { className: "callContent" }, /* @__PURE__ */ jsx_default.h("div", null, t("shou-dao"), " ", avCall2.name, " ", t("hu-jiao-qing-qiu")), /* @__PURE__ */ jsx_default.h("div", null, timeSpan)), /* @__PURE__ */ jsx_default.h("div", { className: "btnLine" }, /* @__PURE__ */ jsx_default.h("button", { className: "btnAgree", onclick: onApply }, t("jie-ting")), /* @__PURE__ */ jsx_default.h("button", { className: "btnRefuse", onclick: onRefuse }, t("ju-jue"))))));
25146
25160
  const divTemp = core_default.dom.create("div");
25147
25161
  core_default.dom.append(divTemp, ele);
25148
25162
  if (typeof params.zIndex === "number") {
@@ -25166,7 +25180,7 @@ function CreateCallEndPoint(createParams) {
25166
25180
  if (instanceCall) {
25167
25181
  if (currentCallid == data.callId) {
25168
25182
  if (data.status == 6 /* END */) {
25169
- instanceCall.close(`${data.name} \u7ED3\u675F\u4E86\u901A\u8BDD`);
25183
+ instanceCall.close(`${data.name} ${t("dataname-jie-shu-le-tong-hua")}`);
25170
25184
  }
25171
25185
  currentCallid = "";
25172
25186
  } else {
@@ -25332,12 +25346,12 @@ function CreateCallEndPoint(createParams) {
25332
25346
  function showMessageForSeconds(message) {
25333
25347
  return __async(this, null, function* () {
25334
25348
  if (message) {
25335
- dialogPanelHandle.setStatus(`${message} 3\u79D2`);
25349
+ dialogPanelHandle.setStatus(`${message} 3 ${t("miao")}`);
25336
25350
  const now = Date.now();
25337
25351
  const { promise, resolve } = Promise.withResolvers();
25338
25352
  const intervalToken = setInterval(() => {
25339
25353
  const pastTime = 3 - Math.floor((Date.now() - now) / 1e3);
25340
- dialogPanelHandle.setStatus(`${message} ${pastTime}\u79D2`);
25354
+ dialogPanelHandle.setStatus(`${message} ${pastTime}${t("miao")}`);
25341
25355
  if (pastTime <= 0) {
25342
25356
  clearInterval(intervalToken);
25343
25357
  resolve();
@@ -25432,6 +25446,9 @@ var PlaybackBar = class extends Plugin {
25432
25446
  this.svgSound = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("span", { class: "svg-sound" }, /* @__PURE__ */ jsx_default.h("input", { type: "range", className: "range-input", value: this.volumeCurrent, oninput: (e) => {
25433
25447
  this.onVolumeChange(e.target.value);
25434
25448
  } })));
25449
+ this.svgSnapshot = core_default.dom.createByJsx(
25450
+ /* @__PURE__ */ jsx_default.h("svg", { onclick: () => this.dispatch("snapshot"), style: "margin-left: 20px; cursor: pointer", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 256 256" }, /* @__PURE__ */ jsx_default.h("rect", { width: "256", height: "256", fill: "none" }), /* @__PURE__ */ jsx_default.h("path", { fill: "#fff", d: "M208 58h-28.79L165 36.67a6 6 0 0 0-5-2.67H96a6 6 0 0 0-5 2.67L76.78 58H48a22 22 0 0 0-22 22v112a22 22 0 0 0 22 22h160a22 22 0 0 0 22-22V80a22 22 0 0 0-22-22m10 134a10 10 0 0 1-10 10H48a10 10 0 0 1-10-10V80a10 10 0 0 1 10-10h32a6 6 0 0 0 5-2.67L99.21 46h57.57L171 67.33a6 6 0 0 0 5 2.67h32a10 10 0 0 1 10 10ZM128 90a42 42 0 1 0 42 42a42 42 0 0 0-42-42m0 72a30 30 0 1 1 30-30a30 30 0 0 1-30 30", "stroke-width": "6.5", stroke: "#fff" }))
25451
+ );
25435
25452
  this.svgFullscreen = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("svg", { onclick: () => {
25436
25453
  this.dispatch("fullscreen");
25437
25454
  }, style: "margin-left: 30px; cursor: pointer", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24" }, /* @__PURE__ */ jsx_default.h("path", { fill: "white", d: "M4 4h6v2H6v4H4zm10 0h6v6h-2V6h-4zM6 14v4h4v2H4v-6zm14 0v6h-6v-2h4v-4z" })));
@@ -25708,7 +25725,7 @@ var PlaybackBar = class extends Plugin {
25708
25725
  const rightPanel = this.controls.rightControls ? this.controls.rightControls : (() => {
25709
25726
  this.controls.rightControls = core_default.dom.createByJsx(/* @__PURE__ */ jsx_default.h("span", { class: "right-options" }));
25710
25727
  core_default.dom.append(this.svgSound, this.svgSound100);
25711
- core_default.dom.append(this.controls.rightControls, this.svgSound, this.playSpeed, this.svgFullscreen, this.svgOptions, this.optionsContent);
25728
+ core_default.dom.append(this.controls.rightControls, this.svgSound, this.playSpeed, this.svgSnapshot, this.svgFullscreen, this.optionsContent);
25712
25729
  return this.controls.rightControls;
25713
25730
  })();
25714
25731
  const barContent = this.controls.barContent ? this.controls.barContent : this.controls.barContent = core_default.dom.createByJsx(
@@ -26368,6 +26385,10 @@ var PlayBack = (props) => {
26368
26385
  barHandle.addEventListener("fullscreen", () => {
26369
26386
  fullscreen_default.toggle(markerHandle.GetPlayArea());
26370
26387
  });
26388
+ barHandle.addEventListener("snapshot", () => __async(this, null, function* () {
26389
+ const snapshotHandle = yield player.video.screenshot();
26390
+ snapshotHandle == null ? void 0 : snapshotHandle.download();
26391
+ }));
26371
26392
  markerHandle.addEventListener("jump", (params) => {
26372
26393
  barHandle.jumpToTargetSeconds(params);
26373
26394
  });
@@ -14,6 +14,7 @@ interface IPlaybackBarEventMap extends IPluginEventMap {
14
14
  playSpeedChange: {
15
15
  speed: number;
16
16
  };
17
+ snapshot: {};
17
18
  }
18
19
  declare class PlaybackBar extends Plugin<HTMLDivElement, IPlaybackBarEventMap> {
19
20
  private content;
@@ -52,6 +53,7 @@ declare class PlaybackBar extends Plugin<HTMLDivElement, IPlaybackBarEventMap> {
52
53
  private svgSoundZero;
53
54
  private svgSound100;
54
55
  private svgSound;
56
+ private svgSnapshot;
55
57
  private svgFullscreen;
56
58
  private optionsValues;
57
59
  private currenSpeed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besovideo/webrtc-player",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
4
4
  "description": "@besovideo/webrtc-player desc",
5
5
  "type": "module",
6
6
  "types": "./dist/types/main.d.ts",