xgplayer-mp4-loader 0.0.1 → 3.0.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/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +596 -0
- package/es/cache.js +8 -15
- package/es/config.js +7 -20
- package/es/error.js +5 -8
- package/es/index.js +2 -5
- package/es/loader.d.ts +14 -11
- package/es/loader.js +428 -405
- package/es/utils.d.ts +3 -0
- package/es/utils.js +110 -132
- package/package.json +12 -7
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
function _iterableToArrayLimit(arr, i) {
|
|
2
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3
|
+
if (null != _i) {
|
|
4
|
+
var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
|
|
5
|
+
try {
|
|
6
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
7
|
+
if (Object(_i) !== _i)
|
|
8
|
+
return;
|
|
9
|
+
_n = false;
|
|
10
|
+
} else
|
|
11
|
+
for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = true)
|
|
12
|
+
;
|
|
13
|
+
} catch (err) {
|
|
14
|
+
_d = true, _e = err;
|
|
15
|
+
} finally {
|
|
16
|
+
try {
|
|
17
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
|
|
18
|
+
return;
|
|
19
|
+
} finally {
|
|
20
|
+
if (_d)
|
|
21
|
+
throw _e;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return _arr;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function ownKeys(object, enumerableOnly) {
|
|
28
|
+
var keys = Object.keys(object);
|
|
29
|
+
if (Object.getOwnPropertySymbols) {
|
|
30
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
31
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
32
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
33
|
+
})), keys.push.apply(keys, symbols);
|
|
34
|
+
}
|
|
35
|
+
return keys;
|
|
36
|
+
}
|
|
37
|
+
function _objectSpread2(target) {
|
|
38
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
39
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
40
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
41
|
+
_defineProperty(target, key, source[key]);
|
|
42
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
43
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return target;
|
|
47
|
+
}
|
|
48
|
+
function _regeneratorRuntime() {
|
|
49
|
+
_regeneratorRuntime = function() {
|
|
50
|
+
return exports;
|
|
51
|
+
};
|
|
52
|
+
var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function(obj, key, desc) {
|
|
53
|
+
obj[key] = desc.value;
|
|
54
|
+
}, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
55
|
+
function define(obj, key, value) {
|
|
56
|
+
return Object.defineProperty(obj, key, {
|
|
57
|
+
value,
|
|
58
|
+
enumerable: true,
|
|
59
|
+
configurable: true,
|
|
60
|
+
writable: true
|
|
61
|
+
}), obj[key];
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
define({}, "");
|
|
65
|
+
} catch (err) {
|
|
66
|
+
define = function(obj, key, value) {
|
|
67
|
+
return obj[key] = value;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
71
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []);
|
|
72
|
+
return defineProperty(generator, "_invoke", {
|
|
73
|
+
value: makeInvokeMethod(innerFn, self, context)
|
|
74
|
+
}), generator;
|
|
75
|
+
}
|
|
76
|
+
function tryCatch(fn, obj, arg) {
|
|
77
|
+
try {
|
|
78
|
+
return {
|
|
79
|
+
type: "normal",
|
|
80
|
+
arg: fn.call(obj, arg)
|
|
81
|
+
};
|
|
82
|
+
} catch (err) {
|
|
83
|
+
return {
|
|
84
|
+
type: "throw",
|
|
85
|
+
arg: err
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.wrap = wrap;
|
|
90
|
+
var ContinueSentinel = {};
|
|
91
|
+
function Generator() {
|
|
92
|
+
}
|
|
93
|
+
function GeneratorFunction() {
|
|
94
|
+
}
|
|
95
|
+
function GeneratorFunctionPrototype() {
|
|
96
|
+
}
|
|
97
|
+
var IteratorPrototype = {};
|
|
98
|
+
define(IteratorPrototype, iteratorSymbol, function() {
|
|
99
|
+
return this;
|
|
100
|
+
});
|
|
101
|
+
var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
102
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
103
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
104
|
+
function defineIteratorMethods(prototype) {
|
|
105
|
+
["next", "throw", "return"].forEach(function(method) {
|
|
106
|
+
define(prototype, method, function(arg) {
|
|
107
|
+
return this._invoke(method, arg);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
112
|
+
function invoke(method, arg, resolve, reject) {
|
|
113
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
114
|
+
if ("throw" !== record.type) {
|
|
115
|
+
var result = record.arg, value = result.value;
|
|
116
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
|
|
117
|
+
invoke("next", value2, resolve, reject);
|
|
118
|
+
}, function(err) {
|
|
119
|
+
invoke("throw", err, resolve, reject);
|
|
120
|
+
}) : PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
121
|
+
result.value = unwrapped, resolve(result);
|
|
122
|
+
}, function(error) {
|
|
123
|
+
return invoke("throw", error, resolve, reject);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
reject(record.arg);
|
|
127
|
+
}
|
|
128
|
+
var previousPromise;
|
|
129
|
+
defineProperty(this, "_invoke", {
|
|
130
|
+
value: function(method, arg) {
|
|
131
|
+
function callInvokeWithMethodAndArg() {
|
|
132
|
+
return new PromiseImpl(function(resolve, reject) {
|
|
133
|
+
invoke(method, arg, resolve, reject);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
141
|
+
var state = "suspendedStart";
|
|
142
|
+
return function(method, arg) {
|
|
143
|
+
if ("executing" === state)
|
|
144
|
+
throw new Error("Generator is already running");
|
|
145
|
+
if ("completed" === state) {
|
|
146
|
+
if ("throw" === method)
|
|
147
|
+
throw arg;
|
|
148
|
+
return doneResult();
|
|
149
|
+
}
|
|
150
|
+
for (context.method = method, context.arg = arg; ; ) {
|
|
151
|
+
var delegate = context.delegate;
|
|
152
|
+
if (delegate) {
|
|
153
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
154
|
+
if (delegateResult) {
|
|
155
|
+
if (delegateResult === ContinueSentinel)
|
|
156
|
+
continue;
|
|
157
|
+
return delegateResult;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if ("next" === context.method)
|
|
161
|
+
context.sent = context._sent = context.arg;
|
|
162
|
+
else if ("throw" === context.method) {
|
|
163
|
+
if ("suspendedStart" === state)
|
|
164
|
+
throw state = "completed", context.arg;
|
|
165
|
+
context.dispatchException(context.arg);
|
|
166
|
+
} else
|
|
167
|
+
"return" === context.method && context.abrupt("return", context.arg);
|
|
168
|
+
state = "executing";
|
|
169
|
+
var record = tryCatch(innerFn, self, context);
|
|
170
|
+
if ("normal" === record.type) {
|
|
171
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
|
|
172
|
+
continue;
|
|
173
|
+
return {
|
|
174
|
+
value: record.arg,
|
|
175
|
+
done: context.done
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
183
|
+
var methodName = context.method, method = delegate.iterator[methodName];
|
|
184
|
+
if (void 0 === method)
|
|
185
|
+
return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
186
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
187
|
+
if ("throw" === record.type)
|
|
188
|
+
return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
189
|
+
var info = record.arg;
|
|
190
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
191
|
+
}
|
|
192
|
+
function pushTryEntry(locs) {
|
|
193
|
+
var entry = {
|
|
194
|
+
tryLoc: locs[0]
|
|
195
|
+
};
|
|
196
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
197
|
+
}
|
|
198
|
+
function resetTryEntry(entry) {
|
|
199
|
+
var record = entry.completion || {};
|
|
200
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
201
|
+
}
|
|
202
|
+
function Context(tryLocsList) {
|
|
203
|
+
this.tryEntries = [{
|
|
204
|
+
tryLoc: "root"
|
|
205
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(true);
|
|
206
|
+
}
|
|
207
|
+
function values(iterable) {
|
|
208
|
+
if (iterable) {
|
|
209
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
210
|
+
if (iteratorMethod)
|
|
211
|
+
return iteratorMethod.call(iterable);
|
|
212
|
+
if ("function" == typeof iterable.next)
|
|
213
|
+
return iterable;
|
|
214
|
+
if (!isNaN(iterable.length)) {
|
|
215
|
+
var i = -1, next = function next2() {
|
|
216
|
+
for (; ++i < iterable.length; )
|
|
217
|
+
if (hasOwn.call(iterable, i))
|
|
218
|
+
return next2.value = iterable[i], next2.done = false, next2;
|
|
219
|
+
return next2.value = void 0, next2.done = true, next2;
|
|
220
|
+
};
|
|
221
|
+
return next.next = next;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
next: doneResult
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
function doneResult() {
|
|
229
|
+
return {
|
|
230
|
+
value: void 0,
|
|
231
|
+
done: true
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
235
|
+
value: GeneratorFunctionPrototype,
|
|
236
|
+
configurable: true
|
|
237
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
238
|
+
value: GeneratorFunction,
|
|
239
|
+
configurable: true
|
|
240
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
|
|
241
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
242
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
243
|
+
}, exports.mark = function(genFun) {
|
|
244
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
245
|
+
}, exports.awrap = function(arg) {
|
|
246
|
+
return {
|
|
247
|
+
__await: arg
|
|
248
|
+
};
|
|
249
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
|
|
250
|
+
return this;
|
|
251
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
252
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
253
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
254
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
|
|
255
|
+
return result.done ? result.value : iter.next();
|
|
256
|
+
});
|
|
257
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
|
|
258
|
+
return this;
|
|
259
|
+
}), define(Gp, "toString", function() {
|
|
260
|
+
return "[object Generator]";
|
|
261
|
+
}), exports.keys = function(val) {
|
|
262
|
+
var object = Object(val), keys = [];
|
|
263
|
+
for (var key in object)
|
|
264
|
+
keys.push(key);
|
|
265
|
+
return keys.reverse(), function next() {
|
|
266
|
+
for (; keys.length; ) {
|
|
267
|
+
var key2 = keys.pop();
|
|
268
|
+
if (key2 in object)
|
|
269
|
+
return next.value = key2, next.done = false, next;
|
|
270
|
+
}
|
|
271
|
+
return next.done = true, next;
|
|
272
|
+
};
|
|
273
|
+
}, exports.values = values, Context.prototype = {
|
|
274
|
+
constructor: Context,
|
|
275
|
+
reset: function(skipTempReset) {
|
|
276
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
|
|
277
|
+
for (var name in this)
|
|
278
|
+
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
|
|
279
|
+
},
|
|
280
|
+
stop: function() {
|
|
281
|
+
this.done = true;
|
|
282
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
283
|
+
if ("throw" === rootRecord.type)
|
|
284
|
+
throw rootRecord.arg;
|
|
285
|
+
return this.rval;
|
|
286
|
+
},
|
|
287
|
+
dispatchException: function(exception) {
|
|
288
|
+
if (this.done)
|
|
289
|
+
throw exception;
|
|
290
|
+
var context = this;
|
|
291
|
+
function handle(loc, caught) {
|
|
292
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
|
|
293
|
+
}
|
|
294
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
295
|
+
var entry = this.tryEntries[i], record = entry.completion;
|
|
296
|
+
if ("root" === entry.tryLoc)
|
|
297
|
+
return handle("end");
|
|
298
|
+
if (entry.tryLoc <= this.prev) {
|
|
299
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
300
|
+
if (hasCatch && hasFinally) {
|
|
301
|
+
if (this.prev < entry.catchLoc)
|
|
302
|
+
return handle(entry.catchLoc, true);
|
|
303
|
+
if (this.prev < entry.finallyLoc)
|
|
304
|
+
return handle(entry.finallyLoc);
|
|
305
|
+
} else if (hasCatch) {
|
|
306
|
+
if (this.prev < entry.catchLoc)
|
|
307
|
+
return handle(entry.catchLoc, true);
|
|
308
|
+
} else {
|
|
309
|
+
if (!hasFinally)
|
|
310
|
+
throw new Error("try statement without catch or finally");
|
|
311
|
+
if (this.prev < entry.finallyLoc)
|
|
312
|
+
return handle(entry.finallyLoc);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
abrupt: function(type, arg) {
|
|
318
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
319
|
+
var entry = this.tryEntries[i];
|
|
320
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
321
|
+
var finallyEntry = entry;
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
326
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
327
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
328
|
+
},
|
|
329
|
+
complete: function(record, afterLoc) {
|
|
330
|
+
if ("throw" === record.type)
|
|
331
|
+
throw record.arg;
|
|
332
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
333
|
+
},
|
|
334
|
+
finish: function(finallyLoc) {
|
|
335
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
336
|
+
var entry = this.tryEntries[i];
|
|
337
|
+
if (entry.finallyLoc === finallyLoc)
|
|
338
|
+
return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
catch: function(tryLoc) {
|
|
342
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
343
|
+
var entry = this.tryEntries[i];
|
|
344
|
+
if (entry.tryLoc === tryLoc) {
|
|
345
|
+
var record = entry.completion;
|
|
346
|
+
if ("throw" === record.type) {
|
|
347
|
+
var thrown = record.arg;
|
|
348
|
+
resetTryEntry(entry);
|
|
349
|
+
}
|
|
350
|
+
return thrown;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
throw new Error("illegal catch attempt");
|
|
354
|
+
},
|
|
355
|
+
delegateYield: function(iterable, resultName, nextLoc) {
|
|
356
|
+
return this.delegate = {
|
|
357
|
+
iterator: values(iterable),
|
|
358
|
+
resultName,
|
|
359
|
+
nextLoc
|
|
360
|
+
}, "next" === this.method && (this.arg = void 0), ContinueSentinel;
|
|
361
|
+
}
|
|
362
|
+
}, exports;
|
|
363
|
+
}
|
|
364
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
365
|
+
try {
|
|
366
|
+
var info = gen[key](arg);
|
|
367
|
+
var value = info.value;
|
|
368
|
+
} catch (error) {
|
|
369
|
+
reject(error);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
if (info.done) {
|
|
373
|
+
resolve(value);
|
|
374
|
+
} else {
|
|
375
|
+
Promise.resolve(value).then(_next, _throw);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
function _asyncToGenerator(fn) {
|
|
379
|
+
return function() {
|
|
380
|
+
var self = this, args = arguments;
|
|
381
|
+
return new Promise(function(resolve, reject) {
|
|
382
|
+
var gen = fn.apply(self, args);
|
|
383
|
+
function _next(value) {
|
|
384
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
385
|
+
}
|
|
386
|
+
function _throw(err) {
|
|
387
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
388
|
+
}
|
|
389
|
+
_next(void 0);
|
|
390
|
+
});
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
function _classCallCheck(instance, Constructor) {
|
|
394
|
+
if (!(instance instanceof Constructor)) {
|
|
395
|
+
throw new TypeError("Cannot call a class as a function");
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
function _defineProperties(target, props) {
|
|
399
|
+
for (var i = 0; i < props.length; i++) {
|
|
400
|
+
var descriptor = props[i];
|
|
401
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
402
|
+
descriptor.configurable = true;
|
|
403
|
+
if ("value" in descriptor)
|
|
404
|
+
descriptor.writable = true;
|
|
405
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
409
|
+
if (protoProps)
|
|
410
|
+
_defineProperties(Constructor.prototype, protoProps);
|
|
411
|
+
if (staticProps)
|
|
412
|
+
_defineProperties(Constructor, staticProps);
|
|
413
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
414
|
+
writable: false
|
|
415
|
+
});
|
|
416
|
+
return Constructor;
|
|
417
|
+
}
|
|
418
|
+
function _defineProperty(obj, key, value) {
|
|
419
|
+
key = _toPropertyKey(key);
|
|
420
|
+
if (key in obj) {
|
|
421
|
+
Object.defineProperty(obj, key, {
|
|
422
|
+
value,
|
|
423
|
+
enumerable: true,
|
|
424
|
+
configurable: true,
|
|
425
|
+
writable: true
|
|
426
|
+
});
|
|
427
|
+
} else {
|
|
428
|
+
obj[key] = value;
|
|
429
|
+
}
|
|
430
|
+
return obj;
|
|
431
|
+
}
|
|
432
|
+
function _inherits(subClass, superClass) {
|
|
433
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
434
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
435
|
+
}
|
|
436
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
437
|
+
constructor: {
|
|
438
|
+
value: subClass,
|
|
439
|
+
writable: true,
|
|
440
|
+
configurable: true
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
Object.defineProperty(subClass, "prototype", {
|
|
444
|
+
writable: false
|
|
445
|
+
});
|
|
446
|
+
if (superClass)
|
|
447
|
+
_setPrototypeOf(subClass, superClass);
|
|
448
|
+
}
|
|
449
|
+
function _getPrototypeOf(o) {
|
|
450
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
|
|
451
|
+
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
452
|
+
};
|
|
453
|
+
return _getPrototypeOf(o);
|
|
454
|
+
}
|
|
455
|
+
function _setPrototypeOf(o, p) {
|
|
456
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
|
|
457
|
+
o2.__proto__ = p2;
|
|
458
|
+
return o2;
|
|
459
|
+
};
|
|
460
|
+
return _setPrototypeOf(o, p);
|
|
461
|
+
}
|
|
462
|
+
function _isNativeReflectConstruct() {
|
|
463
|
+
if (typeof Reflect === "undefined" || !Reflect.construct)
|
|
464
|
+
return false;
|
|
465
|
+
if (Reflect.construct.sham)
|
|
466
|
+
return false;
|
|
467
|
+
if (typeof Proxy === "function")
|
|
468
|
+
return true;
|
|
469
|
+
try {
|
|
470
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
471
|
+
}));
|
|
472
|
+
return true;
|
|
473
|
+
} catch (e) {
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
478
|
+
if (source == null)
|
|
479
|
+
return {};
|
|
480
|
+
var target = {};
|
|
481
|
+
var sourceKeys = Object.keys(source);
|
|
482
|
+
var key, i;
|
|
483
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
484
|
+
key = sourceKeys[i];
|
|
485
|
+
if (excluded.indexOf(key) >= 0)
|
|
486
|
+
continue;
|
|
487
|
+
target[key] = source[key];
|
|
488
|
+
}
|
|
489
|
+
return target;
|
|
490
|
+
}
|
|
491
|
+
function _objectWithoutProperties(source, excluded) {
|
|
492
|
+
if (source == null)
|
|
493
|
+
return {};
|
|
494
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
495
|
+
var key, i;
|
|
496
|
+
if (Object.getOwnPropertySymbols) {
|
|
497
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
498
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
499
|
+
key = sourceSymbolKeys[i];
|
|
500
|
+
if (excluded.indexOf(key) >= 0)
|
|
501
|
+
continue;
|
|
502
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
|
503
|
+
continue;
|
|
504
|
+
target[key] = source[key];
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
return target;
|
|
508
|
+
}
|
|
509
|
+
function _assertThisInitialized(self) {
|
|
510
|
+
if (self === void 0) {
|
|
511
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
512
|
+
}
|
|
513
|
+
return self;
|
|
514
|
+
}
|
|
515
|
+
function _possibleConstructorReturn(self, call) {
|
|
516
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
517
|
+
return call;
|
|
518
|
+
} else if (call !== void 0) {
|
|
519
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
520
|
+
}
|
|
521
|
+
return _assertThisInitialized(self);
|
|
522
|
+
}
|
|
523
|
+
function _createSuper(Derived) {
|
|
524
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
525
|
+
return function _createSuperInternal() {
|
|
526
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
527
|
+
if (hasNativeReflectConstruct) {
|
|
528
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
529
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
530
|
+
} else {
|
|
531
|
+
result = Super.apply(this, arguments);
|
|
532
|
+
}
|
|
533
|
+
return _possibleConstructorReturn(this, result);
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
function _slicedToArray(arr, i) {
|
|
537
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
538
|
+
}
|
|
539
|
+
function _toConsumableArray(arr) {
|
|
540
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
541
|
+
}
|
|
542
|
+
function _arrayWithoutHoles(arr) {
|
|
543
|
+
if (Array.isArray(arr))
|
|
544
|
+
return _arrayLikeToArray(arr);
|
|
545
|
+
}
|
|
546
|
+
function _arrayWithHoles(arr) {
|
|
547
|
+
if (Array.isArray(arr))
|
|
548
|
+
return arr;
|
|
549
|
+
}
|
|
550
|
+
function _iterableToArray(iter) {
|
|
551
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
552
|
+
return Array.from(iter);
|
|
553
|
+
}
|
|
554
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
555
|
+
if (!o)
|
|
556
|
+
return;
|
|
557
|
+
if (typeof o === "string")
|
|
558
|
+
return _arrayLikeToArray(o, minLen);
|
|
559
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
560
|
+
if (n === "Object" && o.constructor)
|
|
561
|
+
n = o.constructor.name;
|
|
562
|
+
if (n === "Map" || n === "Set")
|
|
563
|
+
return Array.from(o);
|
|
564
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
565
|
+
return _arrayLikeToArray(o, minLen);
|
|
566
|
+
}
|
|
567
|
+
function _arrayLikeToArray(arr, len) {
|
|
568
|
+
if (len == null || len > arr.length)
|
|
569
|
+
len = arr.length;
|
|
570
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
571
|
+
arr2[i] = arr[i];
|
|
572
|
+
return arr2;
|
|
573
|
+
}
|
|
574
|
+
function _nonIterableSpread() {
|
|
575
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
576
|
+
}
|
|
577
|
+
function _nonIterableRest() {
|
|
578
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
579
|
+
}
|
|
580
|
+
function _toPrimitive(input, hint) {
|
|
581
|
+
if (typeof input !== "object" || input === null)
|
|
582
|
+
return input;
|
|
583
|
+
var prim = input[Symbol.toPrimitive];
|
|
584
|
+
if (prim !== void 0) {
|
|
585
|
+
var res = prim.call(input, hint || "default");
|
|
586
|
+
if (typeof res !== "object")
|
|
587
|
+
return res;
|
|
588
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
589
|
+
}
|
|
590
|
+
return (hint === "string" ? String : Number)(input);
|
|
591
|
+
}
|
|
592
|
+
function _toPropertyKey(arg) {
|
|
593
|
+
var key = _toPrimitive(arg, "string");
|
|
594
|
+
return typeof key === "symbol" ? key : String(key);
|
|
595
|
+
}
|
|
596
|
+
export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _assertThisInitialized as assertThisInitialized, _asyncToGenerator as asyncToGenerator, _classCallCheck as classCallCheck, _createClass as createClass, _createSuper as createSuper, _defineProperty as defineProperty, _getPrototypeOf as getPrototypeOf, _inherits as inherits, _isNativeReflectConstruct as isNativeReflectConstruct, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _possibleConstructorReturn as possibleConstructorReturn, _regeneratorRuntime as regeneratorRuntime, _setPrototypeOf as setPrototypeOf, _slicedToArray as slicedToArray, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _unsupportedIterableToArray as unsupportedIterableToArray };
|
package/es/cache.js
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import _classCallCheck from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function Cache() {
|
|
7
|
-
_classCallCheck(this, Cache);
|
|
8
|
-
|
|
9
|
-
_defineProperty(this, "_data", Object.create(null));
|
|
1
|
+
import { createClass as _createClass, classCallCheck as _classCallCheck, defineProperty as _defineProperty } from "./_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
var Cache = /* @__PURE__ */ function() {
|
|
3
|
+
function Cache2() {
|
|
4
|
+
_classCallCheck(this, Cache2);
|
|
5
|
+
_defineProperty(this, "_data", /* @__PURE__ */ Object.create(null));
|
|
10
6
|
}
|
|
11
|
-
|
|
12
|
-
_createClass(Cache, [{
|
|
7
|
+
_createClass(Cache2, [{
|
|
13
8
|
key: "set",
|
|
14
9
|
value: function set(id, data) {
|
|
15
10
|
this._data[id] = data;
|
|
@@ -22,11 +17,9 @@ var Cache = /*#__PURE__*/function () {
|
|
|
22
17
|
}, {
|
|
23
18
|
key: "clear",
|
|
24
19
|
value: function clear() {
|
|
25
|
-
this._data = Object.create(null);
|
|
20
|
+
this._data = /* @__PURE__ */ Object.create(null);
|
|
26
21
|
}
|
|
27
22
|
}]);
|
|
28
|
-
|
|
29
|
-
return Cache;
|
|
23
|
+
return Cache2;
|
|
30
24
|
}();
|
|
31
|
-
|
|
32
25
|
export { Cache };
|
package/es/config.js
CHANGED
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import 'core-js/modules/es.symbol.js';
|
|
3
|
-
import 'core-js/modules/es.array.filter.js';
|
|
4
|
-
import 'core-js/modules/es.object.get-own-property-descriptor.js';
|
|
5
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
|
6
|
-
import 'core-js/modules/es.object.get-own-property-descriptors.js';
|
|
7
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
8
|
-
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
-
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
12
|
-
|
|
1
|
+
import { objectSpread2 as _objectSpread2 } from "./_virtual/_rollupPluginBabelHelpers.js";
|
|
13
2
|
function getConfig(cfg) {
|
|
14
|
-
return
|
|
15
|
-
vid:
|
|
16
|
-
moovEnd:
|
|
17
|
-
segmentDuration:
|
|
3
|
+
return _objectSpread2({
|
|
4
|
+
vid: "",
|
|
5
|
+
moovEnd: 8e4,
|
|
6
|
+
segmentDuration: 2,
|
|
18
7
|
maxDownloadInfoSize: 30,
|
|
8
|
+
responseType: "arraybuffer",
|
|
19
9
|
cache: null
|
|
20
|
-
}, cfg)
|
|
21
|
-
responseType: 'arraybuffer'
|
|
22
|
-
});
|
|
10
|
+
}, cfg);
|
|
23
11
|
}
|
|
24
|
-
|
|
25
12
|
export { getConfig };
|
package/es/error.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import _classCallCheck from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this.type = 'file';
|
|
1
|
+
import { createClass as _createClass, classCallCheck as _classCallCheck } from "./_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
var MediaError = /* @__PURE__ */ _createClass(function MediaError2(msg, data) {
|
|
3
|
+
_classCallCheck(this, MediaError2);
|
|
4
|
+
this.type = "file";
|
|
7
5
|
this.message = msg;
|
|
8
6
|
this.data = data;
|
|
9
|
-
};
|
|
10
|
-
|
|
7
|
+
});
|
|
11
8
|
export { MediaError };
|
package/es/index.js
CHANGED