@byteplus/veplayer-plugin 2.9.0 → 2.9.2
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/esm/index.development.js +45 -2
- package/esm/index.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +45 -2
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/package.json +1 -1
- package/umd/veplayer.plugin.rtm.development.js +45 -2
- package/umd/veplayer.plugin.rtm.production.js +1 -1
package/package.json
CHANGED
|
@@ -6759,6 +6759,16 @@
|
|
|
6759
6759
|
}]);
|
|
6760
6760
|
return NetworkQuality2;
|
|
6761
6761
|
}();
|
|
6762
|
+
function changeNumberInRange(source, min, max, delta) {
|
|
6763
|
+
var target = source + delta;
|
|
6764
|
+
if (target > max) {
|
|
6765
|
+
target = source - delta;
|
|
6766
|
+
}
|
|
6767
|
+
return [source, target];
|
|
6768
|
+
}
|
|
6769
|
+
function isHarmonyOS() {
|
|
6770
|
+
return /(HarmonyOS|OpenHarmony|ArkWeb)/i.test(navigator.userAgent);
|
|
6771
|
+
}
|
|
6762
6772
|
var logger = new Logger("rts");
|
|
6763
6773
|
var Rts = /* @__PURE__ */ function(_EventEmitter) {
|
|
6764
6774
|
_inherits$1(Rts2, _EventEmitter);
|
|
@@ -7052,6 +7062,7 @@
|
|
|
7052
7062
|
}));
|
|
7053
7063
|
_this._retry = _this._opts.retryCount;
|
|
7054
7064
|
_this._bindMediaEvent();
|
|
7065
|
+
_this._changeVolumeInHarmonyWorkaround();
|
|
7055
7066
|
if (_this._opts.mediaStream && _this._opts.seamlesslyReload) {
|
|
7056
7067
|
_this._lastMediaStream = _this._opts.mediaStream;
|
|
7057
7068
|
}
|
|
@@ -7646,6 +7657,7 @@
|
|
|
7646
7657
|
this._pc.close();
|
|
7647
7658
|
if (this._media) {
|
|
7648
7659
|
this._media.srcObject = null;
|
|
7660
|
+
this._media.removeAttribute("src");
|
|
7649
7661
|
}
|
|
7650
7662
|
}
|
|
7651
7663
|
}
|
|
@@ -7675,11 +7687,42 @@
|
|
|
7675
7687
|
}
|
|
7676
7688
|
return _createEmptyPeer;
|
|
7677
7689
|
}()
|
|
7690
|
+
}, {
|
|
7691
|
+
key: "_changeVolumeInHarmonyWorkaround",
|
|
7692
|
+
value: function _changeVolumeInHarmonyWorkaround() {
|
|
7693
|
+
var _this8 = this;
|
|
7694
|
+
if (isHarmonyOS()) {
|
|
7695
|
+
var originalDescriptor = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "muted");
|
|
7696
|
+
if (this._media && originalDescriptor) {
|
|
7697
|
+
logger.log("apply HarmonyOS muted workaround");
|
|
7698
|
+
Object.defineProperty(this._media, "muted", {
|
|
7699
|
+
configurable: true,
|
|
7700
|
+
enumerable: true,
|
|
7701
|
+
get: originalDescriptor.get,
|
|
7702
|
+
set: function set(val) {
|
|
7703
|
+
originalDescriptor.set.call(this, val);
|
|
7704
|
+
var _changeNumberInRange = changeNumberInRange(this.volume, 0, 1, 0.01), _changeNumberInRange2 = _slicedToArray(_changeNumberInRange, 2), sourceVolume = _changeNumberInRange2[0], targetVolume = _changeNumberInRange2[1];
|
|
7705
|
+
this.volume = targetVolume;
|
|
7706
|
+
this.volume = sourceVolume;
|
|
7707
|
+
logger.log("HarmonyOS muted workaround. set muted =", val, "volume:", targetVolume, "->", sourceVolume);
|
|
7708
|
+
}
|
|
7709
|
+
});
|
|
7710
|
+
this._revertVolumeWorkaround = function() {
|
|
7711
|
+
logger.log("revert HarmonyOS muted workaround. video dom:", _this8._media);
|
|
7712
|
+
if (_this8._media) {
|
|
7713
|
+
Object.defineProperty(_this8._media, "muted", originalDescriptor);
|
|
7714
|
+
}
|
|
7715
|
+
};
|
|
7716
|
+
}
|
|
7717
|
+
}
|
|
7718
|
+
}
|
|
7678
7719
|
}, {
|
|
7679
7720
|
key: "destroy",
|
|
7680
7721
|
value: function destroy(keepClearMediaStream) {
|
|
7681
|
-
var _this$_media2;
|
|
7722
|
+
var _this$_revertVolumeWo, _this$_media2;
|
|
7682
7723
|
this._disconnect();
|
|
7724
|
+
(_this$_revertVolumeWo = this._revertVolumeWorkaround) === null || _this$_revertVolumeWo === void 0 ? void 0 : _this$_revertVolumeWo.call(this);
|
|
7725
|
+
delete this._revertVolumeWorkaround;
|
|
7683
7726
|
(_this$_media2 = this._media) === null || _this$_media2 === void 0 ? void 0 : _this$_media2.removeEventListener("timeupdate", this._mockWaitingByTimeupdate);
|
|
7684
7727
|
if (this._media && !keepClearMediaStream) {
|
|
7685
7728
|
this._media.srcObject = null;
|
|
@@ -7815,7 +7858,7 @@
|
|
|
7815
7858
|
}, {
|
|
7816
7859
|
key: "version",
|
|
7817
7860
|
get: function get() {
|
|
7818
|
-
return "0.2.1-alpha.
|
|
7861
|
+
return "0.2.1-alpha.45";
|
|
7819
7862
|
}
|
|
7820
7863
|
}, {
|
|
7821
7864
|
key: "beforePlayerInit",
|