@volcengine/veplayer-plugin 2.4.3-rc.1 → 2.4.5-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.
Files changed (31) hide show
  1. package/esm/index.development.js +530 -1967
  2. package/esm/index.production.js +1 -1
  3. package/esm/veplayer.plugin.abr.development.js +3 -71
  4. package/esm/veplayer.plugin.abr.production.js +1 -1
  5. package/esm/veplayer.plugin.drm.development.js +3 -71
  6. package/esm/veplayer.plugin.drm.production.js +1 -1
  7. package/esm/veplayer.plugin.flv.development.js +196 -727
  8. package/esm/veplayer.plugin.flv.production.js +1 -1
  9. package/esm/veplayer.plugin.hls.development.js +368 -1342
  10. package/esm/veplayer.plugin.hls.production.js +1 -1
  11. package/esm/veplayer.plugin.mp4.development.js +5 -73
  12. package/esm/veplayer.plugin.mp4.production.js +1 -1
  13. package/esm/veplayer.plugin.rtm.development.js +4 -72
  14. package/esm/veplayer.plugin.rtm.production.js +1 -1
  15. package/esm/veplayer.plugin.shaka.development.js +4 -72
  16. package/esm/veplayer.plugin.shaka.production.js +1 -1
  17. package/package.json +1 -1
  18. package/umd/veplayer.plugin.abr.development.js +3 -71
  19. package/umd/veplayer.plugin.abr.production.js +1 -1
  20. package/umd/veplayer.plugin.drm.development.js +3 -71
  21. package/umd/veplayer.plugin.drm.production.js +1 -1
  22. package/umd/veplayer.plugin.flv.development.js +196 -727
  23. package/umd/veplayer.plugin.flv.production.js +1 -1
  24. package/umd/veplayer.plugin.hls.development.js +335 -1309
  25. package/umd/veplayer.plugin.hls.production.js +1 -1
  26. package/umd/veplayer.plugin.mp4.development.js +5 -73
  27. package/umd/veplayer.plugin.mp4.production.js +1 -1
  28. package/umd/veplayer.plugin.rtm.development.js +4 -72
  29. package/umd/veplayer.plugin.rtm.production.js +1 -1
  30. package/umd/veplayer.plugin.shaka.development.js +4 -72
  31. package/umd/veplayer.plugin.shaka.production.js +1 -1
@@ -1016,7 +1016,8 @@ function hook(hookName, handler) {
1016
1016
  }
1017
1017
  if (this.__hooks && this.__hooks[hookName]) {
1018
1018
  try {
1019
- var preRet = runHooks(this, hookName, handler);
1019
+ var _this$__hooks$hookNam;
1020
+ var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
1020
1021
  if (preRet) {
1021
1022
  if (preRet.then) {
1022
1023
  preRet.then(function(isContinue) {
@@ -1041,19 +1042,6 @@ function hook(hookName, handler) {
1041
1042
  }
1042
1043
  }.bind(this);
1043
1044
  }
1044
- function findHookIndex(hookName, handler) {
1045
- var __hooks = this.__hooks;
1046
- if (!__hooks || !Array.isArray(__hooks[hookName])) {
1047
- return -1;
1048
- }
1049
- var hookHandlers = __hooks[hookName];
1050
- for (var i = 0; i < hookHandlers.length; i++) {
1051
- if (hookHandlers[i] === handler) {
1052
- return i;
1053
- }
1054
- }
1055
- return -1;
1056
- }
1057
1045
  function useHooks(hookName, handler) {
1058
1046
  var __hooks = this.__hooks;
1059
1047
  if (!__hooks) {
@@ -1063,12 +1051,7 @@ function useHooks(hookName, handler) {
1063
1051
  console.warn("has no supported hook which name [".concat(hookName, "]"));
1064
1052
  return false;
1065
1053
  }
1066
- if (!Array.isArray(__hooks[hookName])) {
1067
- __hooks[hookName] = [];
1068
- }
1069
- if (findHookIndex.call(this, hookName, handler) === -1) {
1070
- __hooks[hookName].push(handler);
1071
- }
1054
+ __hooks && (__hooks[hookName] = handler);
1072
1055
  return true;
1073
1056
  }
1074
1057
  function removeHooks(hookName, handler) {
@@ -1076,13 +1059,6 @@ function removeHooks(hookName, handler) {
1076
1059
  if (!__hooks) {
1077
1060
  return;
1078
1061
  }
1079
- if (Array.isArray(__hooks[hookName])) {
1080
- var hooks = __hooks[hookName];
1081
- var index = findHookIndex.call(this, hookName, handler);
1082
- if (index !== -1) {
1083
- hooks.splice(index, 1);
1084
- }
1085
- }
1086
1062
  delete __hooks[hookName];
1087
1063
  }
1088
1064
  function hooksDescriptor(instance) {
@@ -1104,38 +1080,6 @@ function hooksDescriptor(instance) {
1104
1080
  function delHooksDescriptor(instance) {
1105
1081
  instance.__hooks = null;
1106
1082
  }
1107
- function runHooks(obj, hookName, handler) {
1108
- for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
1109
- args[_key5 - 3] = arguments[_key5];
1110
- }
1111
- if (obj.__hooks && Array.isArray(obj.__hooks[hookName])) {
1112
- var hooks = obj.__hooks[hookName];
1113
- var index = -1;
1114
- var runHooksRecursive = function runHooksRecursive2(obj2, hookName2, handler2) {
1115
- for (var _len6 = arguments.length, args2 = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
1116
- args2[_key6 - 3] = arguments[_key6];
1117
- }
1118
- index++;
1119
- if (hooks.length === 0 || index === hooks.length) {
1120
- return handler2.call.apply(handler2, [obj2, obj2].concat(args2));
1121
- }
1122
- var hook2 = hooks[index];
1123
- var ret = hook2.call.apply(hook2, [obj2, obj2].concat(args2));
1124
- if (ret && ret.then) {
1125
- return ret.then(function(data) {
1126
- return data === false ? null : runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
1127
- }).catch(function(e) {
1128
- console.warn("[runHooks]".concat(hookName2, " reject"), e.message);
1129
- });
1130
- } else if (ret !== false) {
1131
- return runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
1132
- }
1133
- };
1134
- return runHooksRecursive.apply(void 0, [obj, hookName, handler].concat(args));
1135
- } else {
1136
- return handler.call.apply(handler, [obj, obj].concat(args));
1137
- }
1138
- }
1139
1083
  function showErrorMsg(pluginName, msg) {
1140
1084
  XG_DEBUG.logError("[".concat(pluginName, "] event or callback cant be undefined or null when call ").concat(msg));
1141
1085
  }
@@ -1375,18 +1319,6 @@ var BasePlugin = /* @__PURE__ */ function() {
1375
1319
  }
1376
1320
  }
1377
1321
  }
1378
- }, {
1379
- key: "defineMethod",
1380
- value: function defineMethod(Obj, map) {
1381
- for (var key in map) {
1382
- if (Object.prototype.hasOwnProperty.call(map, key) && typeof map[key] === "function") {
1383
- Object.defineProperty(Obj, key, {
1384
- configurable: true,
1385
- value: map[key]
1386
- });
1387
- }
1388
- }
1389
- }
1390
1322
  }, {
1391
1323
  key: "defaultConfig",
1392
1324
  get: function get() {