@besovideo/webrtc-player 0.8.75 → 0.8.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.es.js +34 -22
  2. package/package.json +1 -1
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.8.75", PROJECT_NAMESPACE: "bvplayer" };
114
+ define_processenv_default = { NODE_ENV: "production", SH_LIB_NAME: "@besovideo/webrtc-player", SH_LIB_VERSION: "0.8.77", PROJECT_NAMESPACE: "bvplayer" };
115
115
  }
116
116
  });
117
117
 
@@ -8796,27 +8796,35 @@ var WebRTCConnect = class {
8796
8796
  })
8797
8797
  } : void 0;
8798
8798
  if (rvl == null ? void 0 : rvl.rtp.now) {
8799
+ let hasTrackStat = false;
8799
8800
  report == null ? void 0 : report.forEach((item) => {
8800
- const statsType = item.type;
8801
- if (statsType == "track") {
8802
- const track = item;
8803
- if (track) {
8804
- if (trackType == "video") {
8805
- rvl.rtp.now.frameHeight = track == null ? void 0 : track.frameHeight;
8806
- rvl.rtp.now.frameWidth = track == null ? void 0 : track.frameWidth;
8807
- rvl.rtp.now.framesReceived = track == null ? void 0 : track.framesDecoded;
8808
- } else {
8809
- rvl.rtp.now.totalSamplesReceived = track.totalSamplesReceived;
8810
- }
8811
- rvl.rtp.now.totalSamplesDuration = videoEle.currentTime;
8812
- rvl.rtp.now.totalInterFrameDelay = videoEle.currentTime;
8813
- }
8814
- }
8815
- if (statsType == "transport") {
8816
- const transport = item;
8817
- rvl.rtp.now.bytesReceived = transport.bytesReceived;
8801
+ if (item.type == "track") {
8802
+ hasTrackStat = true;
8818
8803
  }
8819
8804
  });
8805
+ if (hasTrackStat) {
8806
+ report == null ? void 0 : report.forEach((item) => {
8807
+ const statsType = item.type;
8808
+ if (statsType == "track") {
8809
+ const track = item;
8810
+ if (track) {
8811
+ if (trackType == "video") {
8812
+ rvl.rtp.now.frameHeight = track == null ? void 0 : track.frameHeight;
8813
+ rvl.rtp.now.frameWidth = track == null ? void 0 : track.frameWidth;
8814
+ rvl.rtp.now.framesReceived = track == null ? void 0 : track.framesDecoded;
8815
+ } else {
8816
+ rvl.rtp.now.totalSamplesReceived = track.totalSamplesReceived;
8817
+ }
8818
+ rvl.rtp.now.totalSamplesDuration = videoEle.currentTime;
8819
+ rvl.rtp.now.totalInterFrameDelay = videoEle.currentTime;
8820
+ }
8821
+ }
8822
+ if (statsType == "transport") {
8823
+ const transport = item;
8824
+ rvl.rtp.now.bytesReceived = transport.bytesReceived;
8825
+ }
8826
+ });
8827
+ }
8820
8828
  }
8821
8829
  return rvl;
8822
8830
  });
@@ -16714,6 +16722,9 @@ var PlaybackBar = class extends Plugin {
16714
16722
  if (this.controls.currentTime == this.playbackInfo.current) {
16715
16723
  return;
16716
16724
  }
16725
+ if (this.playbackInfo.current > this.playbackInfo.total) {
16726
+ this.playbackInfo.current = this.playbackInfo.total;
16727
+ }
16717
16728
  this.controls.currentTime = this.playbackInfo.current;
16718
16729
  const iTotal = this.playbackInfo.total;
16719
16730
  const iCurrent = this.playbackInfo.current > iTotal ? iTotal : this.playbackInfo.current;
@@ -17184,7 +17195,7 @@ var PlayBack = (props) => {
17184
17195
  i18n_default(locale);
17185
17196
  let hplayer = void 0;
17186
17197
  const handle2 = {};
17187
- let type = (puOption == null ? void 0 : puOption.puId) && type1 == "ws-bvrtc" ? "web" : type1;
17198
+ let type = (puOption == null ? void 0 : puOption.puId) && type1 == "ws-bvrtc" ? type1 : type1;
17188
17199
  const instance2 = {
17189
17200
  videoFit: "contain",
17190
17201
  open() {
@@ -17297,6 +17308,7 @@ var PlayBack = (props) => {
17297
17308
  }
17298
17309
  };
17299
17310
  handle2.close = () => {
17311
+ videoEle.src = "";
17300
17312
  markerHandle.destroy();
17301
17313
  player.close();
17302
17314
  barHandle.destroy();
@@ -17377,7 +17389,7 @@ var PlayBack = (props) => {
17377
17389
  jumpHandle = (data) => __async(this, null, function* () {
17378
17390
  if (data && playbackInfo.data) {
17379
17391
  yield hplayer == null ? void 0 : hplayer.playbackStop();
17380
- const seekInfo = yield playbackController.seek({ range: [data == null ? void 0 : data.targetSeconds, playbackInfo.data.range[1]] });
17392
+ yield playbackController.seek({ range: [Number(data == null ? void 0 : data.targetSeconds.toFixed(4)), playbackInfo.data.range[1]] });
17381
17393
  yield hplayer == null ? void 0 : hplayer.playbackStart();
17382
17394
  barHandle.pausePlayStateChange("play");
17383
17395
  }
@@ -17469,7 +17481,7 @@ var PlayBack = (props) => {
17469
17481
  },
17470
17482
  setProtocol: function(protocol) {
17471
17483
  this.close();
17472
- this.protocol = (puOption == null ? void 0 : puOption.puId) ? "web" : protocol;
17484
+ this.protocol = (puOption == null ? void 0 : puOption.puId) ? protocol : protocol;
17473
17485
  this.open();
17474
17486
  },
17475
17487
  protocol: "web"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besovideo/webrtc-player",
3
- "version": "0.8.75",
3
+ "version": "0.8.77",
4
4
  "description": "@besovideo/webrtc-player desc",
5
5
  "type": "module",
6
6
  "types": "./dist/types/main.d.ts",