@atlaskit/media-card 74.7.3 → 74.7.4
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/CHANGELOG.md +9 -0
- package/dist/cjs/card/card.js +99 -108
- package/dist/cjs/card/cardLoader.js +3 -3
- package/dist/cjs/card/cardView.js +6 -7
- package/dist/cjs/card/getCardPreview/helpers.js +108 -117
- package/dist/cjs/card/getCardPreview/index.js +99 -104
- package/dist/cjs/card/inlinePlayer.js +92 -97
- package/dist/cjs/card/inlinePlayerLazy.js +19 -20
- package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/cjs/card/ui/common.js +4 -4
- package/dist/cjs/inline/loader.js +50 -52
- package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +59 -9
- package/dist/cjs/types.js +4 -4
- package/dist/cjs/utils/cardActions/cardActionIconButton.js +2 -3
- package/dist/cjs/utils/cardActions/styles.js +4 -4
- package/dist/cjs/utils/ufoExperiences.js +1 -1
- package/dist/cjs/utils/videoSnapshot.js +41 -44
- package/dist/cjs/utils/viewportDetector.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/card/card.js +6 -7
- package/dist/es2019/card/cardView.js +2 -3
- package/dist/es2019/card/inlinePlayer.js +1 -3
- package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/es2019/card/ui/common.js +3 -3
- package/dist/es2019/inline/loader.js +3 -1
- package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +60 -7
- package/dist/es2019/types.js +3 -3
- package/dist/es2019/utils/cardActions/cardActionIconButton.js +2 -3
- package/dist/es2019/utils/cardActions/styles.js +3 -3
- package/dist/es2019/utils/ufoExperiences.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/card/card.js +99 -109
- package/dist/esm/card/cardView.js +6 -7
- package/dist/esm/card/getCardPreview/helpers.js +108 -117
- package/dist/esm/card/getCardPreview/index.js +99 -104
- package/dist/esm/card/inlinePlayer.js +92 -98
- package/dist/esm/card/inlinePlayerLazy.js +17 -20
- package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
- package/dist/esm/card/ui/common.js +3 -3
- package/dist/esm/inline/loader.js +44 -47
- package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +59 -9
- package/dist/esm/types.js +3 -3
- package/dist/esm/utils/cardActions/cardActionIconButton.js +2 -3
- package/dist/esm/utils/cardActions/styles.js +3 -3
- package/dist/esm/utils/ufoExperiences.js +1 -1
- package/dist/esm/utils/videoSnapshot.js +41 -44
- package/dist/esm/utils/viewportDetector.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/inline/loader.d.ts +1 -0
- package/dist/types/inline/mediaInlineAnalyticsErrorBoundary.d.ts +1 -0
- package/package.json +4 -4
- package/report.api.md +1 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
6
|
import { isPreviewableFileState, addFileAttrsToUrl } from '@atlaskit/media-client';
|
|
@@ -66,95 +65,93 @@ var extendAndCachePreview = function extendAndCachePreview(id, mode, preview, me
|
|
|
66
65
|
* hence the use of the optional callback onLocalPreviewError
|
|
67
66
|
*/
|
|
68
67
|
export var getCardPreview = /*#__PURE__*/function () {
|
|
69
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
68
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
70
69
|
var mediaClient, id, _ref$dimensions, dimensions, filePreview, onLocalPreviewError, isRemotePreviewReady, imageUrlParams, mediaBlobUrlAttrs, createAnalyticsEvent, featureFlags, traceContext, mode, cachedPreview, dimensionsAreBigger, localPreview, remotePreview;
|
|
71
|
-
return _regeneratorRuntime
|
|
72
|
-
while (1) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
70
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
71
|
+
while (1) switch (_context.prev = _context.next) {
|
|
72
|
+
case 0:
|
|
73
|
+
mediaClient = _ref.mediaClient, id = _ref.id, _ref$dimensions = _ref.dimensions, dimensions = _ref$dimensions === void 0 ? {} : _ref$dimensions, filePreview = _ref.filePreview, onLocalPreviewError = _ref.onLocalPreviewError, isRemotePreviewReady = _ref.isRemotePreviewReady, imageUrlParams = _ref.imageUrlParams, mediaBlobUrlAttrs = _ref.mediaBlobUrlAttrs, createAnalyticsEvent = _ref.createAnalyticsEvent, featureFlags = _ref.featureFlags, traceContext = _ref.traceContext;
|
|
74
|
+
mode = imageUrlParams.mode;
|
|
75
|
+
cachedPreview = cardPreviewCache.get(id, mode);
|
|
76
|
+
dimensionsAreBigger = isBigger(cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions, dimensions);
|
|
77
|
+
if (!(cachedPreview && !dimensionsAreBigger)) {
|
|
78
|
+
_context.next = 7;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
if (getMediaFeatureFlag('memoryCacheLogging', featureFlags)) {
|
|
82
|
+
createAnalyticsEvent && fireImageFetchingOperationalEvent(createAnalyticsEvent, 'cache-hit', {
|
|
83
|
+
fileId: id,
|
|
84
|
+
prevDimensions: cachedPreview.dimensions,
|
|
85
|
+
currentDimensions: dimensions,
|
|
86
|
+
source: cachedPreview.source
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return _context.abrupt("return", cachedPreview);
|
|
90
|
+
case 7:
|
|
91
|
+
_context.prev = 7;
|
|
92
|
+
if (!filePreview) {
|
|
93
|
+
_context.next = 13;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
_context.next = 11;
|
|
97
|
+
return getCardPreviewFromFilePreview(filePreview);
|
|
98
|
+
case 11:
|
|
99
|
+
localPreview = _context.sent;
|
|
100
|
+
return _context.abrupt("return", extendAndCachePreview(id, mode, _objectSpread(_objectSpread({}, localPreview), {}, {
|
|
101
|
+
dimensions: dimensions
|
|
102
|
+
}), mediaBlobUrlAttrs));
|
|
103
|
+
case 13:
|
|
104
|
+
_context.next = 20;
|
|
105
|
+
break;
|
|
106
|
+
case 15:
|
|
107
|
+
_context.prev = 15;
|
|
108
|
+
_context.t0 = _context["catch"](7);
|
|
109
|
+
/**
|
|
110
|
+
* We report the error if:
|
|
111
|
+
* - local preview is supported and fails
|
|
112
|
+
* - local preview is unsupported and remote preview is NOT READY
|
|
113
|
+
* i.e. the function was called for "no reason".
|
|
114
|
+
* We DON'T report the error if:
|
|
115
|
+
* - local preview is unsupported and remote preview IS READY
|
|
116
|
+
* i.e. local preview is available and not supported,
|
|
117
|
+
* but we are after the remote preview instead.
|
|
118
|
+
*/
|
|
119
|
+
if (!isUnsupportedLocalPreviewError(_context.t0) || isUnsupportedLocalPreviewError(_context.t0) && !isRemotePreviewReady) {
|
|
120
|
+
onLocalPreviewError && onLocalPreviewError(_context.t0);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* No matter the reason why the local preview failed, we break the process
|
|
124
|
+
* if there is no remote preview available
|
|
125
|
+
*/
|
|
126
|
+
if (isRemotePreviewReady) {
|
|
106
127
|
_context.next = 20;
|
|
107
128
|
break;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (isRemotePreviewReady) {
|
|
135
|
-
_context.next = 22;
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
throw new MediaCardError('remote-preview-not-ready');
|
|
139
|
-
case 22:
|
|
140
|
-
_context.next = 24;
|
|
141
|
-
return fetchAndCacheRemotePreview(mediaClient, id, dimensions, imageUrlParams, mediaBlobUrlAttrs, traceContext);
|
|
142
|
-
case 24:
|
|
143
|
-
remotePreview = _context.sent;
|
|
144
|
-
if (getMediaFeatureFlag('memoryCacheLogging', featureFlags)) {
|
|
145
|
-
createAnalyticsEvent && fireImageFetchingOperationalEvent(createAnalyticsEvent, 'remote-success', {
|
|
146
|
-
fileId: id,
|
|
147
|
-
prevDimensions: cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions,
|
|
148
|
-
currentDimensions: dimensions,
|
|
149
|
-
dimensionsPercentageDiff: calculatePercentageDifference(cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions, dimensions),
|
|
150
|
-
source: remotePreview.source
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
return _context.abrupt("return", remotePreview);
|
|
154
|
-
case 27:
|
|
155
|
-
case "end":
|
|
156
|
-
return _context.stop();
|
|
157
|
-
}
|
|
129
|
+
}
|
|
130
|
+
throw _context.t0;
|
|
131
|
+
case 20:
|
|
132
|
+
if (isRemotePreviewReady) {
|
|
133
|
+
_context.next = 22;
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
throw new MediaCardError('remote-preview-not-ready');
|
|
137
|
+
case 22:
|
|
138
|
+
_context.next = 24;
|
|
139
|
+
return fetchAndCacheRemotePreview(mediaClient, id, dimensions, imageUrlParams, mediaBlobUrlAttrs, traceContext);
|
|
140
|
+
case 24:
|
|
141
|
+
remotePreview = _context.sent;
|
|
142
|
+
if (getMediaFeatureFlag('memoryCacheLogging', featureFlags)) {
|
|
143
|
+
createAnalyticsEvent && fireImageFetchingOperationalEvent(createAnalyticsEvent, 'remote-success', {
|
|
144
|
+
fileId: id,
|
|
145
|
+
prevDimensions: cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions,
|
|
146
|
+
currentDimensions: dimensions,
|
|
147
|
+
dimensionsPercentageDiff: calculatePercentageDifference(cachedPreview === null || cachedPreview === void 0 ? void 0 : cachedPreview.dimensions, dimensions),
|
|
148
|
+
source: remotePreview.source
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return _context.abrupt("return", remotePreview);
|
|
152
|
+
case 27:
|
|
153
|
+
case "end":
|
|
154
|
+
return _context.stop();
|
|
158
155
|
}
|
|
159
156
|
}, _callee, null, [[7, 15]]);
|
|
160
157
|
}));
|
|
@@ -214,23 +211,21 @@ export var isSSRDataPreview = function isSSRDataPreview(preview) {
|
|
|
214
211
|
return preview.source === 'ssr-data';
|
|
215
212
|
};
|
|
216
213
|
export var fetchAndCacheRemotePreview = /*#__PURE__*/function () {
|
|
217
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
214
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(mediaClient, id, dimensions, params, mediaBlobUrlAttrs, traceContext) {
|
|
218
215
|
var remotePreview;
|
|
219
|
-
return _regeneratorRuntime
|
|
220
|
-
while (1) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
return _context2.stop();
|
|
233
|
-
}
|
|
216
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
217
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
218
|
+
case 0:
|
|
219
|
+
_context2.next = 2;
|
|
220
|
+
return getCardPreviewFromBackend(mediaClient, id, params, traceContext);
|
|
221
|
+
case 2:
|
|
222
|
+
remotePreview = _context2.sent;
|
|
223
|
+
return _context2.abrupt("return", extendAndCachePreview(id, params.mode, _objectSpread(_objectSpread({}, remotePreview), {}, {
|
|
224
|
+
dimensions: dimensions
|
|
225
|
+
}), mediaBlobUrlAttrs));
|
|
226
|
+
case 4:
|
|
227
|
+
case "end":
|
|
228
|
+
return _context2.stop();
|
|
234
229
|
}
|
|
235
230
|
}, _callee2);
|
|
236
231
|
}));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -8,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
9
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
10
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
12
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
13
|
import React from 'react';
|
|
@@ -49,32 +48,31 @@ export var InlinePlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
49
48
|
fileSrc: fileSrc
|
|
50
49
|
});
|
|
51
50
|
});
|
|
52
|
-
|
|
51
|
+
// Tries to use the binary artifact to provide something to play while the video is still processing
|
|
52
|
+
_defineProperty(_assertThisInitialized(_this), "setBinaryURL", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
53
53
|
var _this$props, mediaClient, identifier, onError, id, collectionName, fileSrc;
|
|
54
|
-
return _regeneratorRuntime
|
|
55
|
-
while (1) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return _context.stop();
|
|
77
|
-
}
|
|
54
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
55
|
+
while (1) switch (_context.prev = _context.next) {
|
|
56
|
+
case 0:
|
|
57
|
+
_this$props = _this.props, mediaClient = _this$props.mediaClient, identifier = _this$props.identifier, onError = _this$props.onError;
|
|
58
|
+
id = identifier.id, collectionName = identifier.collectionName;
|
|
59
|
+
_context.prev = 2;
|
|
60
|
+
_context.next = 5;
|
|
61
|
+
return mediaClient.file.getFileBinaryURL(id, collectionName);
|
|
62
|
+
case 5:
|
|
63
|
+
fileSrc = _context.sent;
|
|
64
|
+
_this.setFileSrc(fileSrc);
|
|
65
|
+
_context.next = 12;
|
|
66
|
+
break;
|
|
67
|
+
case 9:
|
|
68
|
+
_context.prev = 9;
|
|
69
|
+
_context.t0 = _context["catch"](2);
|
|
70
|
+
if (onError && _context.t0 instanceof Error) {
|
|
71
|
+
onError(_context.t0);
|
|
72
|
+
}
|
|
73
|
+
case 12:
|
|
74
|
+
case "end":
|
|
75
|
+
return _context.stop();
|
|
78
76
|
}
|
|
79
77
|
}, _callee, null, [[2, 9]]);
|
|
80
78
|
})));
|
|
@@ -135,78 +133,76 @@ export var InlinePlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
135
133
|
collectionName: collectionName
|
|
136
134
|
}).subscribe({
|
|
137
135
|
next: function () {
|
|
138
|
-
var _next = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
136
|
+
var _next = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(fileState) {
|
|
139
137
|
var existingFileSrc, _yield$fileState$prev, value, fileSrc, artifactName, artifacts, _fileSrc, onError;
|
|
140
|
-
return _regeneratorRuntime
|
|
141
|
-
while (1) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (!(fileState.status === 'processed' || fileState.status === 'processing')) {
|
|
179
|
-
_context2.next = 30;
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
artifactName = getPreferredVideoArtifact(fileState);
|
|
183
|
-
artifacts = fileState.artifacts;
|
|
184
|
-
if (!(!artifactName || !artifacts)) {
|
|
185
|
-
_context2.next = 19;
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
_this2.setBinaryURL();
|
|
189
|
-
return _context2.abrupt("return");
|
|
190
|
-
case 19:
|
|
191
|
-
_context2.prev = 19;
|
|
192
|
-
_context2.next = 22;
|
|
193
|
-
return mediaClient.file.getArtifactURL(artifacts, artifactName, collectionName);
|
|
194
|
-
case 22:
|
|
195
|
-
_fileSrc = _context2.sent;
|
|
196
|
-
_this2.setFileSrc(_fileSrc);
|
|
138
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
139
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
140
|
+
case 0:
|
|
141
|
+
if (fileState.status === 'uploading') {
|
|
142
|
+
_this2.setState({
|
|
143
|
+
isUploading: true,
|
|
144
|
+
progress: fileState.progress
|
|
145
|
+
});
|
|
146
|
+
} else {
|
|
147
|
+
_this2.setState({
|
|
148
|
+
isUploading: false
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
existingFileSrc = _this2.state.fileSrc; // we want to reuse the existing fileSrc to prevent re renders
|
|
152
|
+
if (!existingFileSrc) {
|
|
153
|
+
_context2.next = 4;
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
return _context2.abrupt("return");
|
|
157
|
+
case 4:
|
|
158
|
+
if (!(fileState.status !== 'error' && fileState.preview)) {
|
|
159
|
+
_context2.next = 13;
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
_context2.next = 7;
|
|
163
|
+
return fileState.preview;
|
|
164
|
+
case 7:
|
|
165
|
+
_yield$fileState$prev = _context2.sent;
|
|
166
|
+
value = _yield$fileState$prev.value;
|
|
167
|
+
if (!(value instanceof Blob && value.type.indexOf('video/') === 0)) {
|
|
168
|
+
_context2.next = 13;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
fileSrc = URL.createObjectURL(value);
|
|
172
|
+
_this2.setFileSrc(fileSrc);
|
|
173
|
+
return _context2.abrupt("return");
|
|
174
|
+
case 13:
|
|
175
|
+
if (!(fileState.status === 'processed' || fileState.status === 'processing')) {
|
|
197
176
|
_context2.next = 30;
|
|
198
177
|
break;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
178
|
+
}
|
|
179
|
+
artifactName = getPreferredVideoArtifact(fileState);
|
|
180
|
+
artifacts = fileState.artifacts;
|
|
181
|
+
if (!(!artifactName || !artifacts)) {
|
|
182
|
+
_context2.next = 19;
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
_this2.setBinaryURL();
|
|
186
|
+
return _context2.abrupt("return");
|
|
187
|
+
case 19:
|
|
188
|
+
_context2.prev = 19;
|
|
189
|
+
_context2.next = 22;
|
|
190
|
+
return mediaClient.file.getArtifactURL(artifacts, artifactName, collectionName);
|
|
191
|
+
case 22:
|
|
192
|
+
_fileSrc = _context2.sent;
|
|
193
|
+
_this2.setFileSrc(_fileSrc);
|
|
194
|
+
_context2.next = 30;
|
|
195
|
+
break;
|
|
196
|
+
case 26:
|
|
197
|
+
_context2.prev = 26;
|
|
198
|
+
_context2.t0 = _context2["catch"](19);
|
|
199
|
+
onError = _this2.props.onError;
|
|
200
|
+
if (onError && _context2.t0 instanceof Error) {
|
|
201
|
+
onError(_context2.t0);
|
|
202
|
+
}
|
|
203
|
+
case 30:
|
|
204
|
+
case "end":
|
|
205
|
+
return _context2.stop();
|
|
210
206
|
}
|
|
211
207
|
}, _callee2, null, [[19, 26]]);
|
|
212
208
|
}));
|
|
@@ -217,8 +213,6 @@ export var InlinePlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
217
213
|
}()
|
|
218
214
|
});
|
|
219
215
|
}
|
|
220
|
-
|
|
221
|
-
// Tries to use the binary artifact to provide something to play while the video is still processing
|
|
222
216
|
}, {
|
|
223
217
|
key: "componentWillUnmount",
|
|
224
218
|
value: function componentWillUnmount() {
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
3
|
import { lazy } from 'react';
|
|
5
|
-
export var InlinePlayerLazy = /*#__PURE__*/lazy( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
4
|
+
export var InlinePlayerLazy = /*#__PURE__*/lazy( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
6
5
|
var _yield$import, InlinePlayer;
|
|
7
|
-
return _regeneratorRuntime
|
|
8
|
-
while (1) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return _context.stop();
|
|
23
|
-
}
|
|
6
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8
|
+
case 0:
|
|
9
|
+
_context.next = 2;
|
|
10
|
+
return import( /* webpackChunkName: "@atlaskit-internal_media-card-inlineplayer" */
|
|
11
|
+
'./inlinePlayer');
|
|
12
|
+
case 2:
|
|
13
|
+
_yield$import = _context.sent;
|
|
14
|
+
InlinePlayer = _yield$import.InlinePlayer;
|
|
15
|
+
return _context.abrupt("return", {
|
|
16
|
+
default: InlinePlayer
|
|
17
|
+
});
|
|
18
|
+
case 5:
|
|
19
|
+
case "end":
|
|
20
|
+
return _context.stop();
|
|
24
21
|
}
|
|
25
22
|
}, _callee);
|
|
26
23
|
})));
|
|
@@ -83,7 +83,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
|
|
|
83
83
|
}(React.Component);
|
|
84
84
|
_defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
|
|
85
85
|
var packageName = "@atlaskit/media-card";
|
|
86
|
-
var packageVersion = "74.7.
|
|
86
|
+
var packageVersion = "74.7.4";
|
|
87
87
|
var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
|
|
88
88
|
packageVersion: packageVersion,
|
|
89
89
|
packageName: packageName,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
var _responsiveSettings;
|
|
3
|
-
export var Breakpoint
|
|
4
|
-
(function (Breakpoint) {
|
|
3
|
+
export var Breakpoint = /*#__PURE__*/function (Breakpoint) {
|
|
5
4
|
Breakpoint["SMALL"] = "small";
|
|
6
5
|
Breakpoint["LARGE"] = "large";
|
|
7
|
-
|
|
6
|
+
return Breakpoint;
|
|
7
|
+
}({});
|
|
8
8
|
export var responsiveSettings = (_responsiveSettings = {}, _defineProperty(_responsiveSettings, Breakpoint.SMALL, {
|
|
9
9
|
fontSize: 11,
|
|
10
10
|
lineHeight: 14,
|