@volcengine/veplayer-plugin 2.4.3-rc.0 → 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 +499 -1891
  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 +304 -1233
  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 +304 -1233
  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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volcengine/veplayer-plugin",
3
- "version": "2.4.3-rc.0",
3
+ "version": "2.4.5-rc.0",
4
4
  "main": "./umd/index.production.js",
5
5
  "module": "./esm/index.production.js",
6
6
  "browser": "./umd/index.production.js",
@@ -1020,7 +1020,8 @@
1020
1020
  }
1021
1021
  if (this.__hooks && this.__hooks[hookName]) {
1022
1022
  try {
1023
- var preRet = runHooks(this, hookName, handler);
1023
+ var _this$__hooks$hookNam;
1024
+ var preRet = (_this$__hooks$hookNam = this.__hooks[hookName]).call.apply(_this$__hooks$hookNam, [this, this].concat(Array.prototype.slice.call(arguments)));
1024
1025
  if (preRet) {
1025
1026
  if (preRet.then) {
1026
1027
  preRet.then(function(isContinue) {
@@ -1045,19 +1046,6 @@
1045
1046
  }
1046
1047
  }.bind(this);
1047
1048
  }
1048
- function findHookIndex(hookName, handler) {
1049
- var __hooks = this.__hooks;
1050
- if (!__hooks || !Array.isArray(__hooks[hookName])) {
1051
- return -1;
1052
- }
1053
- var hookHandlers = __hooks[hookName];
1054
- for (var i = 0; i < hookHandlers.length; i++) {
1055
- if (hookHandlers[i] === handler) {
1056
- return i;
1057
- }
1058
- }
1059
- return -1;
1060
- }
1061
1049
  function useHooks(hookName, handler) {
1062
1050
  var __hooks = this.__hooks;
1063
1051
  if (!__hooks) {
@@ -1067,12 +1055,7 @@
1067
1055
  console.warn("has no supported hook which name [".concat(hookName, "]"));
1068
1056
  return false;
1069
1057
  }
1070
- if (!Array.isArray(__hooks[hookName])) {
1071
- __hooks[hookName] = [];
1072
- }
1073
- if (findHookIndex.call(this, hookName, handler) === -1) {
1074
- __hooks[hookName].push(handler);
1075
- }
1058
+ __hooks && (__hooks[hookName] = handler);
1076
1059
  return true;
1077
1060
  }
1078
1061
  function removeHooks(hookName, handler) {
@@ -1080,13 +1063,6 @@
1080
1063
  if (!__hooks) {
1081
1064
  return;
1082
1065
  }
1083
- if (Array.isArray(__hooks[hookName])) {
1084
- var hooks = __hooks[hookName];
1085
- var index = findHookIndex.call(this, hookName, handler);
1086
- if (index !== -1) {
1087
- hooks.splice(index, 1);
1088
- }
1089
- }
1090
1066
  delete __hooks[hookName];
1091
1067
  }
1092
1068
  function hooksDescriptor(instance) {
@@ -1108,38 +1084,6 @@
1108
1084
  function delHooksDescriptor(instance) {
1109
1085
  instance.__hooks = null;
1110
1086
  }
1111
- function runHooks(obj, hookName, handler) {
1112
- for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
1113
- args[_key5 - 3] = arguments[_key5];
1114
- }
1115
- if (obj.__hooks && Array.isArray(obj.__hooks[hookName])) {
1116
- var hooks = obj.__hooks[hookName];
1117
- var index = -1;
1118
- var runHooksRecursive = function runHooksRecursive2(obj2, hookName2, handler2) {
1119
- for (var _len6 = arguments.length, args2 = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
1120
- args2[_key6 - 3] = arguments[_key6];
1121
- }
1122
- index++;
1123
- if (hooks.length === 0 || index === hooks.length) {
1124
- return handler2.call.apply(handler2, [obj2, obj2].concat(args2));
1125
- }
1126
- var hook2 = hooks[index];
1127
- var ret = hook2.call.apply(hook2, [obj2, obj2].concat(args2));
1128
- if (ret && ret.then) {
1129
- return ret.then(function(data) {
1130
- return data === false ? null : runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
1131
- }).catch(function(e) {
1132
- console.warn("[runHooks]".concat(hookName2, " reject"), e.message);
1133
- });
1134
- } else if (ret !== false) {
1135
- return runHooksRecursive2.apply(void 0, [obj2, hookName2, handler2].concat(args2));
1136
- }
1137
- };
1138
- return runHooksRecursive.apply(void 0, [obj, hookName, handler].concat(args));
1139
- } else {
1140
- return handler.call.apply(handler, [obj, obj].concat(args));
1141
- }
1142
- }
1143
1087
  function showErrorMsg(pluginName, msg) {
1144
1088
  XG_DEBUG.logError("[".concat(pluginName, "] event or callback cant be undefined or null when call ").concat(msg));
1145
1089
  }
@@ -1379,18 +1323,6 @@
1379
1323
  }
1380
1324
  }
1381
1325
  }
1382
- }, {
1383
- key: "defineMethod",
1384
- value: function defineMethod(Obj, map) {
1385
- for (var key in map) {
1386
- if (Object.prototype.hasOwnProperty.call(map, key) && typeof map[key] === "function") {
1387
- Object.defineProperty(Obj, key, {
1388
- configurable: true,
1389
- value: map[key]
1390
- });
1391
- }
1392
- }
1393
- }
1394
1326
  }, {
1395
1327
  key: "defaultConfig",
1396
1328
  get: function get() {