@volcengine/veplayer-plugin 2.4.1-rc.0 → 2.5.0-rc.0
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.d.ts +1 -0
- package/esm/index.development.css +7 -0
- package/esm/index.development.js +31562 -23809
- package/esm/index.production.css +1 -1
- package/esm/index.production.js +13 -4
- package/esm/veplayer.plugin.abr.development.js +59 -3
- package/esm/veplayer.plugin.abr.production.js +1 -1
- package/esm/veplayer.plugin.ad.development.css +7 -0
- package/esm/veplayer.plugin.ad.development.js +9042 -0
- package/esm/veplayer.plugin.ad.production.css +1 -0
- package/esm/veplayer.plugin.ad.production.js +4 -0
- package/esm/veplayer.plugin.drm.development.js +59 -3
- package/esm/veplayer.plugin.drm.production.js +1 -1
- package/esm/veplayer.plugin.flv.development.js +63 -22
- package/esm/veplayer.plugin.flv.production.js +1 -1
- package/esm/veplayer.plugin.hls.development.js +398 -55
- package/esm/veplayer.plugin.hls.production.js +1 -1
- package/esm/veplayer.plugin.mp4.development.js +61 -5
- package/esm/veplayer.plugin.mp4.production.js +1 -1
- package/esm/veplayer.plugin.rtm.development.js +63 -13
- package/esm/veplayer.plugin.rtm.production.js +1 -1
- package/esm/veplayer.plugin.shaka.development.js +60 -4
- package/esm/veplayer.plugin.shaka.production.js +1 -1
- package/package.json +1 -1
- package/umd/index.d.ts +1 -0
- package/umd/veplayer.plugin.abr.development.js +59 -3
- package/umd/veplayer.plugin.abr.production.js +1 -1
- package/umd/veplayer.plugin.ad.development.css +7 -0
- package/umd/veplayer.plugin.ad.development.js +9045 -0
- package/umd/veplayer.plugin.ad.production.css +1 -0
- package/umd/veplayer.plugin.ad.production.js +1 -0
- package/umd/veplayer.plugin.drm.development.js +59 -3
- package/umd/veplayer.plugin.drm.production.js +1 -1
- package/umd/veplayer.plugin.flv.development.js +63 -22
- package/umd/veplayer.plugin.flv.production.js +1 -1
- package/umd/veplayer.plugin.hls.development.js +398 -55
- package/umd/veplayer.plugin.hls.production.js +1 -1
- package/umd/veplayer.plugin.mp4.development.js +61 -5
- package/umd/veplayer.plugin.mp4.production.js +1 -1
- package/umd/veplayer.plugin.rtm.development.js +63 -13
- package/umd/veplayer.plugin.rtm.production.js +1 -1
- package/umd/veplayer.plugin.shaka.development.js +60 -4
- package/umd/veplayer.plugin.shaka.production.js +1 -1
|
@@ -1542,7 +1542,7 @@
|
|
|
1542
1542
|
}
|
|
1543
1543
|
return offsetTime;
|
|
1544
1544
|
};
|
|
1545
|
-
var version = "3.0.
|
|
1545
|
+
var version = "3.0.20-alpha.4";
|
|
1546
1546
|
var ERROR_MAP = {
|
|
1547
1547
|
1: 5101,
|
|
1548
1548
|
2: 5102,
|
|
@@ -1650,8 +1650,7 @@
|
|
|
1650
1650
|
}
|
|
1651
1651
|
if (this.__hooks && this.__hooks[hookName]) {
|
|
1652
1652
|
try {
|
|
1653
|
-
var
|
|
1654
|
-
var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
|
|
1653
|
+
var preRet = runHooks(this, hookName, handler);
|
|
1655
1654
|
if (preRet) {
|
|
1656
1655
|
if (preRet.then) {
|
|
1657
1656
|
preRet.then(function(isContinue) {
|
|
@@ -1676,6 +1675,19 @@
|
|
|
1676
1675
|
}
|
|
1677
1676
|
}.bind(this);
|
|
1678
1677
|
}
|
|
1678
|
+
function findHookIndex(hookName, handler) {
|
|
1679
|
+
var __hooks = this.__hooks;
|
|
1680
|
+
if (!__hooks || !Array.isArray(__hooks[hookName])) {
|
|
1681
|
+
return -1;
|
|
1682
|
+
}
|
|
1683
|
+
var hookHandlers = __hooks[hookName];
|
|
1684
|
+
for (var i = 0; i < hookHandlers.length; i++) {
|
|
1685
|
+
if (hookHandlers[i] === handler) {
|
|
1686
|
+
return i;
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
return -1;
|
|
1690
|
+
}
|
|
1679
1691
|
function useHooks(hookName, handler) {
|
|
1680
1692
|
var __hooks = this.__hooks;
|
|
1681
1693
|
if (!__hooks) {
|
|
@@ -1685,7 +1697,12 @@
|
|
|
1685
1697
|
console.warn("has no supported hook which name [".concat(hookName, "]"));
|
|
1686
1698
|
return false;
|
|
1687
1699
|
}
|
|
1688
|
-
|
|
1700
|
+
if (!Array.isArray(__hooks[hookName])) {
|
|
1701
|
+
__hooks[hookName] = [];
|
|
1702
|
+
}
|
|
1703
|
+
if (findHookIndex.call(this, hookName, handler) === -1) {
|
|
1704
|
+
__hooks[hookName].push(handler);
|
|
1705
|
+
}
|
|
1689
1706
|
return true;
|
|
1690
1707
|
}
|
|
1691
1708
|
function removeHooks(hookName, handler) {
|
|
@@ -1693,6 +1710,13 @@
|
|
|
1693
1710
|
if (!__hooks) {
|
|
1694
1711
|
return;
|
|
1695
1712
|
}
|
|
1713
|
+
if (Array.isArray(__hooks[hookName])) {
|
|
1714
|
+
var hooks = __hooks[hookName];
|
|
1715
|
+
var index = findHookIndex.call(this, hookName, handler);
|
|
1716
|
+
if (index !== -1) {
|
|
1717
|
+
hooks.splice(index, 1);
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1696
1720
|
delete __hooks[hookName];
|
|
1697
1721
|
}
|
|
1698
1722
|
function hooksDescriptor(instance) {
|
|
@@ -1714,6 +1738,38 @@
|
|
|
1714
1738
|
function delHooksDescriptor(instance) {
|
|
1715
1739
|
instance.__hooks = null;
|
|
1716
1740
|
}
|
|
1741
|
+
function runHooks(obj, hookName, handler) {
|
|
1742
|
+
for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
|
1743
|
+
args[_key5 - 3] = arguments[_key5];
|
|
1744
|
+
}
|
|
1745
|
+
if (obj.__hooks && Array.isArray(obj.__hooks[hookName])) {
|
|
1746
|
+
var hooks = obj.__hooks[hookName];
|
|
1747
|
+
var index = -1;
|
|
1748
|
+
var runHooksRecursive = function runHooksRecursive2(obj2, hookName2, handler2) {
|
|
1749
|
+
for (var _len6 = arguments.length, args2 = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
|
|
1750
|
+
args2[_key6 - 3] = arguments[_key6];
|
|
1751
|
+
}
|
|
1752
|
+
index++;
|
|
1753
|
+
if (hooks.length === 0 || index === hooks.length) {
|
|
1754
|
+
return handler2.call.apply(handler2, [obj2, obj2].concat(args2));
|
|
1755
|
+
}
|
|
1756
|
+
var hook2 = hooks[index];
|
|
1757
|
+
var ret = hook2.call.apply(hook2, [obj2, obj2].concat(args2));
|
|
1758
|
+
if (ret && ret.then) {
|
|
1759
|
+
return ret.then(function(data) {
|
|
1760
|
+
return data === false ? null : runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
1761
|
+
}).catch(function(e) {
|
|
1762
|
+
console.warn("[runHooks]".concat(hookName2, " reject"), e.message);
|
|
1763
|
+
});
|
|
1764
|
+
} else if (ret !== false) {
|
|
1765
|
+
return runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1768
|
+
return runHooksRecursive.apply(void 0, [obj, hookName, handler].concat(args));
|
|
1769
|
+
} else {
|
|
1770
|
+
return handler.call.apply(handler, [obj, obj].concat(args));
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1717
1773
|
function showErrorMsg(pluginName, msg) {
|
|
1718
1774
|
XG_DEBUG.logError("[".concat(pluginName, "] event or callback cant be undefined or null when call ").concat(msg));
|
|
1719
1775
|
}
|
|
@@ -2763,21 +2819,6 @@
|
|
|
2763
2819
|
length: Buffer2.totalLength && Buffer2.totalLength(buffers)
|
|
2764
2820
|
};
|
|
2765
2821
|
}
|
|
2766
|
-
}, {
|
|
2767
|
-
key: "isBuffered",
|
|
2768
|
-
value: function isBuffered(media, pos) {
|
|
2769
|
-
if (media) {
|
|
2770
|
-
var buffered = Buffer2.get(media);
|
|
2771
|
-
if (buffered !== null && buffered !== void 0 && buffered.length) {
|
|
2772
|
-
for (var i = 0; i < buffered.length; i++) {
|
|
2773
|
-
if (pos >= buffered.start(i) && pos <= buffered.end(i)) {
|
|
2774
|
-
return true;
|
|
2775
|
-
}
|
|
2776
|
-
}
|
|
2777
|
-
}
|
|
2778
|
-
}
|
|
2779
|
-
return false;
|
|
2780
|
-
}
|
|
2781
2822
|
}]);
|
|
2782
2823
|
return Buffer2;
|
|
2783
2824
|
}();
|
|
@@ -5907,7 +5948,7 @@
|
|
|
5907
5948
|
continue;
|
|
5908
5949
|
}
|
|
5909
5950
|
frameLength = (data[i + 3] & 3) << 11 | data[i + 4] << 3 | (data[i + 5] & 224) >> 5;
|
|
5910
|
-
if (
|
|
5951
|
+
if (len - i < frameLength)
|
|
5911
5952
|
break;
|
|
5912
5953
|
protectionSkipBytes = (~data[i + 1] & 1) * 2;
|
|
5913
5954
|
frames.push({
|
|
@@ -10326,7 +10367,7 @@
|
|
|
10326
10367
|
}
|
|
10327
10368
|
return;
|
|
10328
10369
|
}
|
|
10329
|
-
if (opts.isLive && media.readyState === 4 && bufferEnd
|
|
10370
|
+
if (opts.isLive && media.readyState === 4 && bufferEnd > opts.disconnectTime) {
|
|
10330
10371
|
_this.disconnect();
|
|
10331
10372
|
}
|
|
10332
10373
|
}
|
|
@@ -10498,7 +10539,7 @@
|
|
|
10498
10539
|
_createClass$4(Flv2, [{
|
|
10499
10540
|
key: "version",
|
|
10500
10541
|
get: function get() {
|
|
10501
|
-
return "3.0.19-rc.
|
|
10542
|
+
return "3.0.19-rc.0";
|
|
10502
10543
|
}
|
|
10503
10544
|
}, {
|
|
10504
10545
|
key: "isLive",
|