@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
|
@@ -1534,7 +1534,7 @@
|
|
|
1534
1534
|
}
|
|
1535
1535
|
return offsetTime;
|
|
1536
1536
|
};
|
|
1537
|
-
var version = "3.0.
|
|
1537
|
+
var version = "3.0.20-alpha.4";
|
|
1538
1538
|
var ERROR_MAP = {
|
|
1539
1539
|
1: 5101,
|
|
1540
1540
|
2: 5102,
|
|
@@ -1642,8 +1642,7 @@
|
|
|
1642
1642
|
}
|
|
1643
1643
|
if (this.__hooks && this.__hooks[hookName]) {
|
|
1644
1644
|
try {
|
|
1645
|
-
var
|
|
1646
|
-
var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
|
|
1645
|
+
var preRet = runHooks(this, hookName, handler);
|
|
1647
1646
|
if (preRet) {
|
|
1648
1647
|
if (preRet.then) {
|
|
1649
1648
|
preRet.then(function(isContinue) {
|
|
@@ -1668,6 +1667,19 @@
|
|
|
1668
1667
|
}
|
|
1669
1668
|
}.bind(this);
|
|
1670
1669
|
}
|
|
1670
|
+
function findHookIndex(hookName, handler) {
|
|
1671
|
+
var __hooks = this.__hooks;
|
|
1672
|
+
if (!__hooks || !Array.isArray(__hooks[hookName])) {
|
|
1673
|
+
return -1;
|
|
1674
|
+
}
|
|
1675
|
+
var hookHandlers = __hooks[hookName];
|
|
1676
|
+
for (var i = 0; i < hookHandlers.length; i++) {
|
|
1677
|
+
if (hookHandlers[i] === handler) {
|
|
1678
|
+
return i;
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
return -1;
|
|
1682
|
+
}
|
|
1671
1683
|
function useHooks(hookName, handler) {
|
|
1672
1684
|
var __hooks = this.__hooks;
|
|
1673
1685
|
if (!__hooks) {
|
|
@@ -1677,7 +1689,12 @@
|
|
|
1677
1689
|
console.warn("has no supported hook which name [".concat(hookName, "]"));
|
|
1678
1690
|
return false;
|
|
1679
1691
|
}
|
|
1680
|
-
|
|
1692
|
+
if (!Array.isArray(__hooks[hookName])) {
|
|
1693
|
+
__hooks[hookName] = [];
|
|
1694
|
+
}
|
|
1695
|
+
if (findHookIndex.call(this, hookName, handler) === -1) {
|
|
1696
|
+
__hooks[hookName].push(handler);
|
|
1697
|
+
}
|
|
1681
1698
|
return true;
|
|
1682
1699
|
}
|
|
1683
1700
|
function removeHooks(hookName, handler) {
|
|
@@ -1685,6 +1702,13 @@
|
|
|
1685
1702
|
if (!__hooks) {
|
|
1686
1703
|
return;
|
|
1687
1704
|
}
|
|
1705
|
+
if (Array.isArray(__hooks[hookName])) {
|
|
1706
|
+
var hooks = __hooks[hookName];
|
|
1707
|
+
var index = findHookIndex.call(this, hookName, handler);
|
|
1708
|
+
if (index !== -1) {
|
|
1709
|
+
hooks.splice(index, 1);
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1688
1712
|
delete __hooks[hookName];
|
|
1689
1713
|
}
|
|
1690
1714
|
function hooksDescriptor(instance) {
|
|
@@ -1706,6 +1730,38 @@
|
|
|
1706
1730
|
function delHooksDescriptor(instance) {
|
|
1707
1731
|
instance.__hooks = null;
|
|
1708
1732
|
}
|
|
1733
|
+
function runHooks(obj, hookName, handler) {
|
|
1734
|
+
for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
|
1735
|
+
args[_key5 - 3] = arguments[_key5];
|
|
1736
|
+
}
|
|
1737
|
+
if (obj.__hooks && Array.isArray(obj.__hooks[hookName])) {
|
|
1738
|
+
var hooks = obj.__hooks[hookName];
|
|
1739
|
+
var index = -1;
|
|
1740
|
+
var runHooksRecursive = function runHooksRecursive2(obj2, hookName2, handler2) {
|
|
1741
|
+
for (var _len6 = arguments.length, args2 = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
|
|
1742
|
+
args2[_key6 - 3] = arguments[_key6];
|
|
1743
|
+
}
|
|
1744
|
+
index++;
|
|
1745
|
+
if (hooks.length === 0 || index === hooks.length) {
|
|
1746
|
+
return handler2.call.apply(handler2, [obj2, obj2].concat(args2));
|
|
1747
|
+
}
|
|
1748
|
+
var hook2 = hooks[index];
|
|
1749
|
+
var ret = hook2.call.apply(hook2, [obj2, obj2].concat(args2));
|
|
1750
|
+
if (ret && ret.then) {
|
|
1751
|
+
return ret.then(function(data) {
|
|
1752
|
+
return data === false ? null : runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
1753
|
+
}).catch(function(e) {
|
|
1754
|
+
console.warn("[runHooks]".concat(hookName2, " reject"), e.message);
|
|
1755
|
+
});
|
|
1756
|
+
} else if (ret !== false) {
|
|
1757
|
+
return runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
|
|
1758
|
+
}
|
|
1759
|
+
};
|
|
1760
|
+
return runHooksRecursive.apply(void 0, [obj, hookName, handler].concat(args));
|
|
1761
|
+
} else {
|
|
1762
|
+
return handler.call.apply(handler, [obj, obj].concat(args));
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1709
1765
|
function showErrorMsg(pluginName, msg) {
|
|
1710
1766
|
XG_DEBUG.logError("[".concat(pluginName, "] event or callback cant be undefined or null when call ").concat(msg));
|
|
1711
1767
|
}
|
|
@@ -5601,7 +5657,7 @@
|
|
|
5601
5657
|
}, {
|
|
5602
5658
|
key: "version",
|
|
5603
5659
|
get: function get() {
|
|
5604
|
-
return "0.2.1-alpha.
|
|
5660
|
+
return "0.2.1-alpha.0";
|
|
5605
5661
|
}
|
|
5606
5662
|
}, {
|
|
5607
5663
|
key: "beforePlayerInit",
|
|
@@ -5697,14 +5753,8 @@
|
|
|
5697
5753
|
}
|
|
5698
5754
|
player.config.url = backupURL;
|
|
5699
5755
|
if (backupConstruct) {
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
}
|
|
5703
|
-
backupConstruct.forEach(function(construct) {
|
|
5704
|
-
var _newPlugin$beforePlay;
|
|
5705
|
-
var newPlugin = player.registerPlugin(construct);
|
|
5706
|
-
(_newPlugin$beforePlay = newPlugin.beforePlayerInit) === null || _newPlugin$beforePlay === void 0 ? void 0 : _newPlugin$beforePlay.call(newPlugin);
|
|
5707
|
-
});
|
|
5756
|
+
var newPlugin = player.registerPlugin(backupConstruct);
|
|
5757
|
+
newPlugin.beforePlayerInit();
|
|
5708
5758
|
} else {
|
|
5709
5759
|
player.video.src = backupURL;
|
|
5710
5760
|
}
|