eligius 1.0.1 → 1.0.2
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 +5 -0
- package/dist/action/endable-action.d.ts +1 -1
- package/dist/configuration/types.d.ts +1 -1
- package/dist/controllers/metadata/{EventListenerController.d.ts → event-listener-controller.d.ts} +1 -1
- package/dist/controllers/metadata/index.d.ts +7 -0
- package/dist/controllers/metadata/{LabelController.d.ts → label-controller.d.ts} +1 -1
- package/dist/controllers/metadata/{LottieController.d.ts → lottie-controller.d.ts} +1 -1
- package/dist/controllers/metadata/{NavigationController.d.ts → navigation-controller.d.ts} +1 -1
- package/dist/controllers/metadata/{ProgressbarController.d.ts → progressbar-controller.d.ts} +1 -1
- package/dist/controllers/metadata/{RoutingController.d.ts → routing-controller.d.ts} +1 -1
- package/dist/controllers/metadata/{SubtitlesController.d.ts → subtitles-controller.d.ts} +1 -1
- package/dist/eligius.cjs.development.js +1231 -1087
- package/dist/eligius.cjs.development.js.map +1 -1
- package/dist/eligius.cjs.production.min.js +1 -1
- package/dist/eligius.cjs.production.min.js.map +1 -1
- package/dist/eligius.esm.js +1212 -1071
- package/dist/eligius.esm.js.map +1 -1
- package/dist/operation/add-class.d.ts +6 -0
- package/dist/operation/add-controller-to-element.d.ts +6 -1
- package/dist/operation/add-globals-to-operation.d.ts +7 -0
- package/dist/operation/animate-with-class.d.ts +8 -0
- package/dist/operation/animate.d.ts +7 -0
- package/dist/operation/broadcast-event.d.ts +7 -0
- package/dist/operation/clear-element.d.ts +3 -0
- package/dist/operation/clear-operation-data.d.ts +4 -0
- package/dist/operation/create-element.d.ts +8 -0
- package/dist/operation/custom-function.d.ts +7 -0
- package/dist/operation/end-action.d.ts +6 -0
- package/dist/operation/end-loop.d.ts +8 -1
- package/dist/operation/extend-controller.d.ts +3 -0
- package/dist/operation/get-controller-from-element.d.ts +6 -0
- package/dist/operation/get-controller-instance.d.ts +8 -0
- package/dist/operation/get-element-dimensions.d.ts +19 -1
- package/dist/operation/get-import.d.ts +8 -1
- package/dist/operation/helper/merge-operation-data.d.ts +1 -1
- package/dist/operation/helper/modify-dimensions.d.ts +15 -0
- package/dist/operation/load-json.d.ts +10 -0
- package/dist/operation/log.d.ts +6 -0
- package/dist/operation/remove-class.d.ts +6 -0
- package/dist/operation/remove-controller-from-element.d.ts +6 -0
- package/dist/operation/remove-element.d.ts +6 -0
- package/dist/operation/remove-properties-from-operation-data.d.ts +6 -0
- package/dist/operation/reparent-element.d.ts +7 -0
- package/dist/operation/request-action.d.ts +7 -0
- package/dist/operation/resize-action.d.ts +6 -0
- package/dist/operation/select-element.d.ts +10 -0
- package/dist/operation/set-element-attributes.d.ts +7 -1
- package/dist/operation/set-element-content.d.ts +13 -1
- package/dist/operation/set-operation-data.d.ts +7 -0
- package/dist/operation/set-style.d.ts +9 -2
- package/dist/operation/start-action.d.ts +10 -0
- package/dist/operation/start-loop.d.ts +10 -0
- package/dist/operation/toggle-class.d.ts +6 -0
- package/dist/operation/toggle-element.d.ts +6 -0
- package/dist/operation/types.d.ts +1 -1
- package/dist/operation/wait.d.ts +6 -0
- package/dist/timelineproviders/index.d.ts +0 -1
- package/package.json +47 -46
package/dist/eligius.esm.js
CHANGED
|
@@ -3,7 +3,6 @@ import lottie from 'lottie-web';
|
|
|
3
3
|
import $ from 'jquery';
|
|
4
4
|
import Mousetrap from 'mousetrap';
|
|
5
5
|
import { v4 } from 'uuid';
|
|
6
|
-
import 'mediaelement';
|
|
7
6
|
|
|
8
7
|
function deepCopy(original) {
|
|
9
8
|
if (isDefined(original)) {
|
|
@@ -19,10 +18,13 @@ function isPromise(obj) {
|
|
|
19
18
|
|
|
20
19
|
var Action = /*#__PURE__*/function () {
|
|
21
20
|
function Action(name, startOperations, eventbus) {
|
|
21
|
+
this.name = void 0;
|
|
22
|
+
this.startOperations = void 0;
|
|
23
|
+
this.eventbus = void 0;
|
|
24
|
+
this.id = '';
|
|
22
25
|
this.name = name;
|
|
23
26
|
this.startOperations = startOperations;
|
|
24
27
|
this.eventbus = eventbus;
|
|
25
|
-
this.id = '';
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
var _proto = Action.prototype;
|
|
@@ -166,6 +168,7 @@ var EndableAction = /*#__PURE__*/function (_Action) {
|
|
|
166
168
|
var _this;
|
|
167
169
|
|
|
168
170
|
_this = _Action.call(this, name, startOperations, eventBus) || this;
|
|
171
|
+
_this.endOperations = void 0;
|
|
169
172
|
_this.endOperations = endOperations;
|
|
170
173
|
return _this;
|
|
171
174
|
}
|
|
@@ -204,8 +207,9 @@ var TimelineAction = /*#__PURE__*/function (_EndableAction) {
|
|
|
204
207
|
var _this;
|
|
205
208
|
|
|
206
209
|
_this = _EndableAction.call(this, name, startOperations, endOperations, eventBus) || this;
|
|
207
|
-
_this.duration =
|
|
210
|
+
_this.duration = void 0;
|
|
208
211
|
_this.active = false;
|
|
212
|
+
_this.duration = duration;
|
|
209
213
|
return _this;
|
|
210
214
|
}
|
|
211
215
|
|
|
@@ -263,6 +267,8 @@ function getNestedPropertyValue(propertyChain, sourceObject) {
|
|
|
263
267
|
|
|
264
268
|
var ConfigurationResolver = /*#__PURE__*/function () {
|
|
265
269
|
function ConfigurationResolver(importer, eventbus) {
|
|
270
|
+
this.importer = void 0;
|
|
271
|
+
this.eventbus = void 0;
|
|
266
272
|
this.importer = importer;
|
|
267
273
|
this.eventbus = eventbus;
|
|
268
274
|
}
|
|
@@ -423,11 +429,8 @@ function resolvePlaceholder(key, config, rootConfig, importer) {
|
|
|
423
429
|
}
|
|
424
430
|
}
|
|
425
431
|
|
|
426
|
-
|
|
427
|
-
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
428
|
-
}
|
|
432
|
+
var runtime = {exports: {}};
|
|
429
433
|
|
|
430
|
-
var runtime_1 = createCommonjsModule(function (module) {
|
|
431
434
|
/**
|
|
432
435
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
433
436
|
*
|
|
@@ -435,6 +438,7 @@ var runtime_1 = createCommonjsModule(function (module) {
|
|
|
435
438
|
* LICENSE file in the root directory of this source tree.
|
|
436
439
|
*/
|
|
437
440
|
|
|
441
|
+
(function (module) {
|
|
438
442
|
var runtime = (function (exports) {
|
|
439
443
|
|
|
440
444
|
var Op = Object.prototype;
|
|
@@ -515,9 +519,9 @@ var runtime = (function (exports) {
|
|
|
515
519
|
// This is a polyfill for %IteratorPrototype% for environments that
|
|
516
520
|
// don't natively support it.
|
|
517
521
|
var IteratorPrototype = {};
|
|
518
|
-
IteratorPrototype
|
|
522
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
519
523
|
return this;
|
|
520
|
-
};
|
|
524
|
+
});
|
|
521
525
|
|
|
522
526
|
var getProto = Object.getPrototypeOf;
|
|
523
527
|
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
@@ -531,8 +535,9 @@ var runtime = (function (exports) {
|
|
|
531
535
|
|
|
532
536
|
var Gp = GeneratorFunctionPrototype.prototype =
|
|
533
537
|
Generator.prototype = Object.create(IteratorPrototype);
|
|
534
|
-
GeneratorFunction.prototype =
|
|
535
|
-
|
|
538
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
539
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
540
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
536
541
|
GeneratorFunction.displayName = define(
|
|
537
542
|
GeneratorFunctionPrototype,
|
|
538
543
|
toStringTagSymbol,
|
|
@@ -646,9 +651,9 @@ var runtime = (function (exports) {
|
|
|
646
651
|
}
|
|
647
652
|
|
|
648
653
|
defineIteratorMethods(AsyncIterator.prototype);
|
|
649
|
-
AsyncIterator.prototype
|
|
654
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
650
655
|
return this;
|
|
651
|
-
};
|
|
656
|
+
});
|
|
652
657
|
exports.AsyncIterator = AsyncIterator;
|
|
653
658
|
|
|
654
659
|
// Note that simple async functions are implemented on top of
|
|
@@ -841,13 +846,13 @@ var runtime = (function (exports) {
|
|
|
841
846
|
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
842
847
|
// object to not be returned from this call. This ensures that doesn't happen.
|
|
843
848
|
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
844
|
-
Gp
|
|
849
|
+
define(Gp, iteratorSymbol, function() {
|
|
845
850
|
return this;
|
|
846
|
-
};
|
|
851
|
+
});
|
|
847
852
|
|
|
848
|
-
Gp
|
|
853
|
+
define(Gp, "toString", function() {
|
|
849
854
|
return "[object Generator]";
|
|
850
|
-
};
|
|
855
|
+
});
|
|
851
856
|
|
|
852
857
|
function pushTryEntry(locs) {
|
|
853
858
|
var entry = { tryLoc: locs[0] };
|
|
@@ -1158,7 +1163,7 @@ var runtime = (function (exports) {
|
|
|
1158
1163
|
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
1159
1164
|
// object. Either way, the resulting object will be used to initialize
|
|
1160
1165
|
// the regeneratorRuntime variable at the top of this file.
|
|
1161
|
-
|
|
1166
|
+
module.exports
|
|
1162
1167
|
));
|
|
1163
1168
|
|
|
1164
1169
|
try {
|
|
@@ -1166,19 +1171,25 @@ try {
|
|
|
1166
1171
|
} catch (accidentalStrictMode) {
|
|
1167
1172
|
// This module should not be running in strict mode, so the above
|
|
1168
1173
|
// assignment should always work unless something is misconfigured. Just
|
|
1169
|
-
// in case runtime.js accidentally runs in strict mode,
|
|
1174
|
+
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
1175
|
+
// we can explicitly access globalThis. In older engines we can escape
|
|
1170
1176
|
// strict mode using a global Function call. This could conceivably fail
|
|
1171
1177
|
// if a Content Security Policy forbids using Function, but in that case
|
|
1172
1178
|
// the proper solution is to fix the accidental strict mode problem. If
|
|
1173
1179
|
// you've misconfigured your bundler to force strict mode and applied a
|
|
1174
1180
|
// CSP to forbid Function, and you're not willing to fix either of those
|
|
1175
1181
|
// problems, please detail your unique predicament in a GitHub issue.
|
|
1176
|
-
|
|
1182
|
+
if (typeof globalThis === "object") {
|
|
1183
|
+
globalThis.regeneratorRuntime = runtime;
|
|
1184
|
+
} else {
|
|
1185
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
1186
|
+
}
|
|
1177
1187
|
}
|
|
1178
|
-
});
|
|
1188
|
+
}(runtime));
|
|
1179
1189
|
|
|
1180
|
-
var
|
|
1190
|
+
var _regeneratorRuntime = runtime.exports;
|
|
1181
1191
|
|
|
1192
|
+
var TimelineEventNames = function TimelineEventNames() {};
|
|
1182
1193
|
TimelineEventNames.PLAY_TOGGLE_REQUEST = 'timeline-play-toggle-request';
|
|
1183
1194
|
TimelineEventNames.PLAY_REQUEST = 'timeline-play-request';
|
|
1184
1195
|
TimelineEventNames.STOP_REQUEST = 'timeline-stop-request';
|
|
@@ -1187,8 +1198,7 @@ TimelineEventNames.SEEK_REQUEST = 'timeline-seek-request';
|
|
|
1187
1198
|
TimelineEventNames.RESIZE_REQUEST = 'timeline-resize-request';
|
|
1188
1199
|
TimelineEventNames.CONTAINER_REQUEST = 'timeline-container-request';
|
|
1189
1200
|
TimelineEventNames.DURATION_REQUEST = 'timeline-duration-request';
|
|
1190
|
-
TimelineEventNames.REQUEST_CURRENT_TIMELINE = 'timeline-request-current-timeline';
|
|
1191
|
-
|
|
1201
|
+
TimelineEventNames.REQUEST_CURRENT_TIMELINE = 'timeline-request-current-timeline';
|
|
1192
1202
|
TimelineEventNames.DURATION = 'timeline-duration';
|
|
1193
1203
|
TimelineEventNames.TIME = 'timeline-time';
|
|
1194
1204
|
TimelineEventNames.SEEKED = 'timeline-seeked';
|
|
@@ -1201,8 +1211,7 @@ TimelineEventNames.RESIZE = 'timeline-resize';
|
|
|
1201
1211
|
TimelineEventNames.POSITION_UPDATE = 'timeline-position-update';
|
|
1202
1212
|
TimelineEventNames.TIME_UPDATE = 'timeline-time-update';
|
|
1203
1213
|
TimelineEventNames.CURRENT_TIMELINE_CHANGE = 'timeline-current-timeline-change';
|
|
1204
|
-
TimelineEventNames.FIRST_FRAME = 'timeline-firstframe';
|
|
1205
|
-
|
|
1214
|
+
TimelineEventNames.FIRST_FRAME = 'timeline-firstframe';
|
|
1206
1215
|
TimelineEventNames.REQUEST_INSTANCE = 'request-instance';
|
|
1207
1216
|
TimelineEventNames.REQUEST_ACTION = 'request-action';
|
|
1208
1217
|
TimelineEventNames.REQUEST_FUNCTION = 'request-function';
|
|
@@ -1212,8 +1221,7 @@ TimelineEventNames.REQUEST_ENGINE_ROOT = 'request-engine-root';
|
|
|
1212
1221
|
TimelineEventNames.REQUEST_CURRENT_TIMELINE_POSITION = 'request-current-timeline-position';
|
|
1213
1222
|
TimelineEventNames.REQUEST_TIMELINE_CLEANUP = 'request-timeline-cleanup';
|
|
1214
1223
|
TimelineEventNames.EXECUTE_TIMELINEACTION = 'execute-timelineaction';
|
|
1215
|
-
TimelineEventNames.RESIZE_TIMELINEACTION = 'resize-timelineaction';
|
|
1216
|
-
|
|
1224
|
+
TimelineEventNames.RESIZE_TIMELINEACTION = 'resize-timelineaction';
|
|
1217
1225
|
TimelineEventNames.REQUEST_LABEL_COLLECTION = 'request-label-collection';
|
|
1218
1226
|
TimelineEventNames.REQUEST_LABEL_COLLECTIONS = 'request-label-collections';
|
|
1219
1227
|
TimelineEventNames.REQUEST_CURRENT_LANGUAGE = 'request-current-language';
|
|
@@ -1221,6 +1229,8 @@ TimelineEventNames.LANGUAGE_CHANGE = 'language-change';
|
|
|
1221
1229
|
|
|
1222
1230
|
var EventListenerController = /*#__PURE__*/function () {
|
|
1223
1231
|
function EventListenerController() {
|
|
1232
|
+
this.operationData = void 0;
|
|
1233
|
+
this.actionInstanceInfos = void 0;
|
|
1224
1234
|
this.name = 'EventListenerController';
|
|
1225
1235
|
}
|
|
1226
1236
|
|
|
@@ -1297,9 +1307,9 @@ var EventListenerController = /*#__PURE__*/function () {
|
|
|
1297
1307
|
};
|
|
1298
1308
|
|
|
1299
1309
|
_proto._executeAction = /*#__PURE__*/function () {
|
|
1300
|
-
var _executeAction2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
1310
|
+
var _executeAction2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(actions, operationData, idx) {
|
|
1301
1311
|
var actionInfo, action, method, resultOperationData;
|
|
1302
|
-
return
|
|
1312
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1303
1313
|
while (1) {
|
|
1304
1314
|
switch (_context.prev = _context.next) {
|
|
1305
1315
|
case 0:
|
|
@@ -1563,7 +1573,7 @@ var LottieController = /*#__PURE__*/function () {
|
|
|
1563
1573
|
};
|
|
1564
1574
|
|
|
1565
1575
|
_proto.isIE = function isIE() {
|
|
1566
|
-
var isIE =
|
|
1576
|
+
var isIE = !!window.document['documentMode']; // Edge 20+
|
|
1567
1577
|
|
|
1568
1578
|
var isEdge = !isIE && !!window['StyleMedia'];
|
|
1569
1579
|
return isEdge || isIE;
|
|
@@ -2140,8 +2150,6 @@ var SubtitlesController = /*#__PURE__*/function () {
|
|
|
2140
2150
|
return SubtitlesController;
|
|
2141
2151
|
}();
|
|
2142
2152
|
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
2153
|
var ctrls = {
|
|
2146
2154
|
__proto__: null,
|
|
2147
2155
|
EventListenerController: EventListenerController,
|
|
@@ -2161,15 +2169,19 @@ var ctrls = {
|
|
|
2161
2169
|
|
|
2162
2170
|
var EligiusEngine = /*#__PURE__*/function () {
|
|
2163
2171
|
function EligiusEngine(configuration, eventbus, timelineProviders, _languageManager) {
|
|
2164
|
-
this.configuration =
|
|
2165
|
-
this.eventbus =
|
|
2166
|
-
this.timelineProviders =
|
|
2167
|
-
this._languageManager =
|
|
2172
|
+
this.configuration = void 0;
|
|
2173
|
+
this.eventbus = void 0;
|
|
2174
|
+
this.timelineProviders = void 0;
|
|
2175
|
+
this._languageManager = void 0;
|
|
2168
2176
|
this._timeLineActionsLookup = {};
|
|
2169
2177
|
this._eventbusListeners = [];
|
|
2170
2178
|
this._currentTimelineUri = '';
|
|
2171
2179
|
this._activeTimelineProvider = undefined;
|
|
2172
2180
|
this._lastPosition = -1;
|
|
2181
|
+
this.configuration = configuration;
|
|
2182
|
+
this.eventbus = eventbus;
|
|
2183
|
+
this.timelineProviders = timelineProviders;
|
|
2184
|
+
this._languageManager = _languageManager;
|
|
2173
2185
|
}
|
|
2174
2186
|
|
|
2175
2187
|
var _proto = EligiusEngine.prototype;
|
|
@@ -2229,8 +2241,8 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2229
2241
|
|
|
2230
2242
|
this._activeTimelineProvider = providerSettings.provider;
|
|
2231
2243
|
return new Promise( /*#__PURE__*/function () {
|
|
2232
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/
|
|
2233
|
-
return
|
|
2244
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve) {
|
|
2245
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2234
2246
|
while (1) {
|
|
2235
2247
|
switch (_context.prev = _context.next) {
|
|
2236
2248
|
case 0:
|
|
@@ -2269,8 +2281,8 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2269
2281
|
};
|
|
2270
2282
|
|
|
2271
2283
|
_proto._cleanUp = /*#__PURE__*/function () {
|
|
2272
|
-
var _cleanUp2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
2273
|
-
return
|
|
2284
|
+
var _cleanUp2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
2285
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
2274
2286
|
while (1) {
|
|
2275
2287
|
switch (_context2.prev = _context2.next) {
|
|
2276
2288
|
case 0:
|
|
@@ -2297,8 +2309,8 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2297
2309
|
}();
|
|
2298
2310
|
|
|
2299
2311
|
_proto.destroy = /*#__PURE__*/function () {
|
|
2300
|
-
var _destroy = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
2301
|
-
return
|
|
2312
|
+
var _destroy = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
2313
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
2302
2314
|
while (1) {
|
|
2303
2315
|
switch (_context3.prev = _context3.next) {
|
|
2304
2316
|
case 0:
|
|
@@ -2414,9 +2426,9 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2414
2426
|
};
|
|
2415
2427
|
|
|
2416
2428
|
_proto._executeActions = /*#__PURE__*/function () {
|
|
2417
|
-
var _executeActions2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
2429
|
+
var _executeActions2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(actions, methodName, idx) {
|
|
2418
2430
|
var action;
|
|
2419
|
-
return
|
|
2431
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
2420
2432
|
while (1) {
|
|
2421
2433
|
switch (_context4.prev = _context4.next) {
|
|
2422
2434
|
case 0:
|
|
@@ -2461,12 +2473,12 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2461
2473
|
};
|
|
2462
2474
|
|
|
2463
2475
|
_proto._handleRequestTimelineUri = /*#__PURE__*/function () {
|
|
2464
|
-
var _handleRequestTimelineUri2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
2476
|
+
var _handleRequestTimelineUri2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(uri, position, previousVideoPosition) {
|
|
2465
2477
|
var _position,
|
|
2466
2478
|
_this3 = this;
|
|
2467
2479
|
|
|
2468
2480
|
var timelineConfig, newProviderSettings;
|
|
2469
|
-
return
|
|
2481
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
2470
2482
|
while (1) {
|
|
2471
2483
|
switch (_context5.prev = _context5.next) {
|
|
2472
2484
|
case 0:
|
|
@@ -2610,9 +2622,9 @@ var EligiusEngine = /*#__PURE__*/function () {
|
|
|
2610
2622
|
}
|
|
2611
2623
|
};
|
|
2612
2624
|
|
|
2613
|
-
_proto._resizeTimelineAction = function
|
|
2614
|
-
|
|
2615
|
-
{
|
|
2625
|
+
_proto._resizeTimelineAction = function
|
|
2626
|
+
/*uri: string, index: number*/
|
|
2627
|
+
_resizeTimelineAction() {
|
|
2616
2628
|
console.error('no resizing implemented');
|
|
2617
2629
|
};
|
|
2618
2630
|
|
|
@@ -2873,6 +2885,7 @@ var Eventbus = /*#__PURE__*/function () {
|
|
|
2873
2885
|
|
|
2874
2886
|
var RequestVideoUriInterceptor = /*#__PURE__*/function () {
|
|
2875
2887
|
function RequestVideoUriInterceptor(eventbus) {
|
|
2888
|
+
this.eventbus = void 0;
|
|
2876
2889
|
this.eventbus = eventbus;
|
|
2877
2890
|
}
|
|
2878
2891
|
|
|
@@ -2886,8 +2899,6 @@ var RequestVideoUriInterceptor = /*#__PURE__*/function () {
|
|
|
2886
2899
|
return RequestVideoUriInterceptor;
|
|
2887
2900
|
}();
|
|
2888
2901
|
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
2902
|
var evtb = {
|
|
2892
2903
|
__proto__: null,
|
|
2893
2904
|
ActionRegistryEventbusListener: ActionRegistryEventbusListener,
|
|
@@ -2897,10 +2908,12 @@ var evtb = {
|
|
|
2897
2908
|
|
|
2898
2909
|
var LanguageManager = /*#__PURE__*/function () {
|
|
2899
2910
|
function LanguageManager(_currentLanguage, labels, _eventbus) {
|
|
2900
|
-
this._currentLanguage =
|
|
2901
|
-
this._eventbus =
|
|
2911
|
+
this._currentLanguage = void 0;
|
|
2912
|
+
this._eventbus = void 0;
|
|
2902
2913
|
this._labelLookup = {};
|
|
2903
2914
|
this._eventbusListeners = [];
|
|
2915
|
+
this._currentLanguage = _currentLanguage;
|
|
2916
|
+
this._eventbus = _eventbus;
|
|
2904
2917
|
|
|
2905
2918
|
if (!_currentLanguage || !_currentLanguage.length) {
|
|
2906
2919
|
throw new Error('language ctor arg cannot be null or have zero length');
|
|
@@ -2995,6 +3008,8 @@ var EngineFactory = /*#__PURE__*/function () {
|
|
|
2995
3008
|
function EngineFactory(importer, windowRef, eventbus) {
|
|
2996
3009
|
this.resizeTimeout = -1;
|
|
2997
3010
|
this.actionsLookup = {};
|
|
3011
|
+
this.importer = void 0;
|
|
3012
|
+
this.eventbus = void 0;
|
|
2998
3013
|
this.importer = importer;
|
|
2999
3014
|
this.eventbus = eventbus || new Eventbus();
|
|
3000
3015
|
this.eventbus.on(TimelineEventNames.REQUEST_INSTANCE, this._requestInstanceHandler.bind(this));
|
|
@@ -3117,6 +3132,12 @@ var EngineFactory = /*#__PURE__*/function () {
|
|
|
3117
3132
|
return EngineFactory;
|
|
3118
3133
|
}();
|
|
3119
3134
|
|
|
3135
|
+
/**
|
|
3136
|
+
* This operation adds the specified class name to the specified selected element.
|
|
3137
|
+
*
|
|
3138
|
+
* @param operationData
|
|
3139
|
+
* @returns
|
|
3140
|
+
*/
|
|
3120
3141
|
var addClass = function addClass(operationData) {
|
|
3121
3142
|
var selectedElement = operationData.selectedElement,
|
|
3122
3143
|
className = operationData.className;
|
|
@@ -3142,6 +3163,7 @@ function attachControllerToElement(element, controller) {
|
|
|
3142
3163
|
}
|
|
3143
3164
|
|
|
3144
3165
|
function mergeOperationData(operationData, newOperationData) {
|
|
3166
|
+
//return { ...(operationData as any), ...newOperationData } as K;
|
|
3145
3167
|
return Object.assign(operationData, newOperationData);
|
|
3146
3168
|
}
|
|
3147
3169
|
|
|
@@ -3153,6 +3175,13 @@ function internalResolve(resolve, operationData, newOperationData) {
|
|
|
3153
3175
|
}
|
|
3154
3176
|
}
|
|
3155
3177
|
|
|
3178
|
+
/**
|
|
3179
|
+
* This operation adds the specified controller instance to the specified selected element.
|
|
3180
|
+
*
|
|
3181
|
+
* @param operationData
|
|
3182
|
+
* @returns
|
|
3183
|
+
*/
|
|
3184
|
+
|
|
3156
3185
|
var addControllerToElement = function addControllerToElement(operationData) {
|
|
3157
3186
|
var selectedElement = operationData.selectedElement,
|
|
3158
3187
|
controllerInstance = operationData.controllerInstance;
|
|
@@ -3171,6 +3200,14 @@ var addControllerToElement = function addControllerToElement(operationData) {
|
|
|
3171
3200
|
}
|
|
3172
3201
|
};
|
|
3173
3202
|
|
|
3203
|
+
/**
|
|
3204
|
+
* This operation animates the specified selected element with the given jQuery animation settings.
|
|
3205
|
+
* It resolves after the animation completes.
|
|
3206
|
+
*
|
|
3207
|
+
* @param operationData
|
|
3208
|
+
* @returns
|
|
3209
|
+
*/
|
|
3210
|
+
|
|
3174
3211
|
var animate = function animate(operationData) {
|
|
3175
3212
|
var animationEasing = operationData.animationEasing,
|
|
3176
3213
|
selectedElement = operationData.selectedElement,
|
|
@@ -3194,6 +3231,15 @@ var animate = function animate(operationData) {
|
|
|
3194
3231
|
return promise;
|
|
3195
3232
|
};
|
|
3196
3233
|
|
|
3234
|
+
/**
|
|
3235
|
+
* This operation adds the specified class name to the specified selected element and assumes that this
|
|
3236
|
+
* class triggers and animation on the selected element. It then waits for this animation to complete
|
|
3237
|
+
* until it resolves.
|
|
3238
|
+
*
|
|
3239
|
+
* @param operationData
|
|
3240
|
+
* @returns
|
|
3241
|
+
*/
|
|
3242
|
+
|
|
3197
3243
|
var animateWithClass = function animateWithClass(operationData) {
|
|
3198
3244
|
var selectedElement = operationData.selectedElement,
|
|
3199
3245
|
className = operationData.className,
|
|
@@ -3241,6 +3287,14 @@ function resolveEventArguments(operationData, eventArgs) {
|
|
|
3241
3287
|
return eventArgs.map(extract);
|
|
3242
3288
|
}
|
|
3243
3289
|
|
|
3290
|
+
/**
|
|
3291
|
+
* This operation broadcasts the given event through the eventbus, along with the
|
|
3292
|
+
* event argumetns and optional event topic.
|
|
3293
|
+
*
|
|
3294
|
+
* @param operationData
|
|
3295
|
+
* @returns
|
|
3296
|
+
*/
|
|
3297
|
+
|
|
3244
3298
|
var broadcastEvent = function broadcastEvent(operationData) {
|
|
3245
3299
|
var eventArgs = operationData.eventArgs,
|
|
3246
3300
|
eventTopic = operationData.eventTopic,
|
|
@@ -3257,12 +3311,19 @@ var broadcastEvent = function broadcastEvent(operationData) {
|
|
|
3257
3311
|
return operationData;
|
|
3258
3312
|
};
|
|
3259
3313
|
|
|
3314
|
+
/**
|
|
3315
|
+
* This operation removes all of the children from the specified selected element.
|
|
3316
|
+
*/
|
|
3260
3317
|
var clearElement = function clearElement(operationData) {
|
|
3261
3318
|
var selectedElement = operationData.selectedElement;
|
|
3262
3319
|
selectedElement.empty();
|
|
3263
3320
|
return operationData;
|
|
3264
3321
|
};
|
|
3265
3322
|
|
|
3323
|
+
/**
|
|
3324
|
+
* This operation removes all of the properties on the current operation date.
|
|
3325
|
+
* Or, if the properties property is set only removes the properties defined by that list.
|
|
3326
|
+
*/
|
|
3266
3327
|
var clearOperationData = function clearOperationData(operationData) {
|
|
3267
3328
|
var properties = operationData.properties;
|
|
3268
3329
|
|
|
@@ -3321,6 +3382,15 @@ function resolveProperties(properties, copy, extract) {
|
|
|
3321
3382
|
}
|
|
3322
3383
|
}
|
|
3323
3384
|
|
|
3385
|
+
/**
|
|
3386
|
+
* This operation creates the DOM element defined by the given properties and assigns
|
|
3387
|
+
* the instance to the give property name on the current operation data.
|
|
3388
|
+
* The property name defaults to 'template'.
|
|
3389
|
+
*
|
|
3390
|
+
* @param operationData
|
|
3391
|
+
* @returns
|
|
3392
|
+
*/
|
|
3393
|
+
|
|
3324
3394
|
var createElement = function createElement(operationData) {
|
|
3325
3395
|
operationData = resolvePropertyValues(operationData, operationData);
|
|
3326
3396
|
var _operationData = operationData,
|
|
@@ -3340,1278 +3410,1349 @@ var createElement = function createElement(operationData) {
|
|
|
3340
3410
|
return operationData;
|
|
3341
3411
|
};
|
|
3342
3412
|
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
this._eventbusListeners = [];
|
|
3351
|
-
this._playlist = [];
|
|
3352
|
-
this._videoElementId = v4();
|
|
3353
|
-
this.loop = false;
|
|
3354
|
-
|
|
3355
|
-
this._addEventListeners();
|
|
3356
|
-
}
|
|
3357
|
-
|
|
3358
|
-
var _proto = JwPlayerTimelineProvider.prototype;
|
|
3413
|
+
/**
|
|
3414
|
+
* This operation retrieves a custom function defined by the specified system name
|
|
3415
|
+
* and invokes it with the current operation data and eventbus.
|
|
3416
|
+
*
|
|
3417
|
+
* @param operationData
|
|
3418
|
+
* @returns
|
|
3419
|
+
*/
|
|
3359
3420
|
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
return timeline.type === 'mediaplayer';
|
|
3363
|
-
}).map(function (timeline) {
|
|
3364
|
-
return timeline.uri;
|
|
3365
|
-
});
|
|
3366
|
-
return urls;
|
|
3367
|
-
};
|
|
3421
|
+
var customFunction = function customFunction(operationData) {
|
|
3422
|
+
var _this = this;
|
|
3368
3423
|
|
|
3369
|
-
|
|
3370
|
-
|
|
3424
|
+
var systemName = operationData.systemName;
|
|
3425
|
+
return new Promise(function (resolve, reject) {
|
|
3426
|
+
var resultCallback = function resultCallback(func) {
|
|
3427
|
+
var promise = func(operationData, _this.eventbus);
|
|
3371
3428
|
|
|
3372
|
-
|
|
3429
|
+
if (promise) {
|
|
3430
|
+
promise.then(function () {
|
|
3431
|
+
internalResolve(resolve, {}, operationData);
|
|
3432
|
+
}, reject);
|
|
3433
|
+
} else {
|
|
3434
|
+
internalResolve(resolve, {}, operationData);
|
|
3435
|
+
}
|
|
3436
|
+
};
|
|
3373
3437
|
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3438
|
+
_this.eventbus.broadcast(TimelineEventNames.REQUEST_FUNCTION, [systemName, resultCallback]);
|
|
3439
|
+
});
|
|
3440
|
+
};
|
|
3377
3441
|
|
|
3378
|
-
|
|
3442
|
+
/**
|
|
3443
|
+
* This operation invokes the end() method on the specified action instance.
|
|
3444
|
+
*
|
|
3445
|
+
* @param operationData
|
|
3446
|
+
* @returns
|
|
3447
|
+
*/
|
|
3379
3448
|
|
|
3380
|
-
|
|
3449
|
+
var endAction = function endAction(operationData) {
|
|
3450
|
+
var _operationData = operationData,
|
|
3451
|
+
actionInstance = _operationData.actionInstance,
|
|
3452
|
+
actionOperationData = _operationData.actionOperationData;
|
|
3453
|
+
delete operationData.actionOperationData;
|
|
3454
|
+
return new Promise(function (resolve, reject) {
|
|
3455
|
+
operationData = mergeOperationData(operationData, actionOperationData);
|
|
3456
|
+
actionInstance.end(operationData).then(function () {
|
|
3457
|
+
Object.keys(actionOperationData).forEach(function (key) {
|
|
3458
|
+
delete operationData[key];
|
|
3459
|
+
});
|
|
3460
|
+
internalResolve(resolve, operationData);
|
|
3461
|
+
}, reject);
|
|
3462
|
+
});
|
|
3463
|
+
};
|
|
3381
3464
|
|
|
3382
|
-
|
|
3383
|
-
|
|
3465
|
+
/**
|
|
3466
|
+
* This operation checks if the current loop should end or start the next iteration.
|
|
3467
|
+
*
|
|
3468
|
+
* @param operationData
|
|
3469
|
+
* @returns
|
|
3470
|
+
*/
|
|
3471
|
+
var endLoop = function endLoop(operationData) {
|
|
3472
|
+
var context = this;
|
|
3384
3473
|
|
|
3385
|
-
|
|
3386
|
-
|
|
3474
|
+
if (!context.skipNextOperation) {
|
|
3475
|
+
if (context.loopIndex !== undefined && context.loopLength !== undefined && context.loopIndex < context.loopLength) {
|
|
3476
|
+
context.loopIndex = context.loopIndex + 1;
|
|
3477
|
+
context.newIndex = context.startIndex;
|
|
3478
|
+
} else {
|
|
3479
|
+
delete context.loopIndex;
|
|
3480
|
+
delete context.loopLength;
|
|
3481
|
+
delete context.startIndex;
|
|
3482
|
+
delete context.newIndex;
|
|
3387
3483
|
}
|
|
3484
|
+
} else {
|
|
3485
|
+
delete context.skipNextOperation;
|
|
3486
|
+
}
|
|
3388
3487
|
|
|
3389
|
-
|
|
3390
|
-
|
|
3488
|
+
return operationData;
|
|
3489
|
+
};
|
|
3391
3490
|
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3491
|
+
var extendController = function extendController(operationData) {
|
|
3492
|
+
var controllerInstance = operationData.controllerInstance,
|
|
3493
|
+
controllerExtension = operationData.controllerExtension;
|
|
3494
|
+
operationData.controllerInstance = Object.assign(controllerInstance, controllerExtension);
|
|
3495
|
+
return operationData;
|
|
3496
|
+
};
|
|
3395
3497
|
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3498
|
+
/**
|
|
3499
|
+
* This operation retrieves the controller instance with the specified name from the specified selected element.
|
|
3500
|
+
*
|
|
3501
|
+
* @param operationData
|
|
3502
|
+
* @returns
|
|
3503
|
+
*/
|
|
3399
3504
|
|
|
3400
|
-
|
|
3505
|
+
var getControllerFromElement = function getControllerFromElement(operationData) {
|
|
3506
|
+
var selectedElement = operationData.selectedElement,
|
|
3507
|
+
controllerName = operationData.controllerName;
|
|
3508
|
+
var controllers = getElementControllers(selectedElement);
|
|
3509
|
+
var controller = controllers.find(function (ctrl) {
|
|
3510
|
+
return ctrl.name === controllerName;
|
|
3511
|
+
});
|
|
3401
3512
|
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
height: h,
|
|
3406
|
-
width: w,
|
|
3407
|
-
controls: true,
|
|
3408
|
-
autostart: false,
|
|
3409
|
-
displaytitle: false,
|
|
3410
|
-
displaydescription: false,
|
|
3411
|
-
nextUpDisplay: false,
|
|
3412
|
-
abouttext: 'Eligius',
|
|
3413
|
-
aboutlink: 'http://www.google.com',
|
|
3414
|
-
stretching: 'fill',
|
|
3415
|
-
repeat: false
|
|
3416
|
-
});
|
|
3513
|
+
if (!controller) {
|
|
3514
|
+
console.warn("controller for name '" + controllerName + "' was not found on the given element");
|
|
3515
|
+
}
|
|
3417
3516
|
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
file: url,
|
|
3422
|
-
title: url,
|
|
3423
|
-
image: settings.poster
|
|
3424
|
-
};
|
|
3517
|
+
operationData.controllerInstance = controller;
|
|
3518
|
+
return operationData;
|
|
3519
|
+
};
|
|
3425
3520
|
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3521
|
+
/**
|
|
3522
|
+
* This operation retrieves an instance of the given controller name.
|
|
3523
|
+
* It assigns this instance to the property on the current operation data
|
|
3524
|
+
* defined by the propertyName property which defaults to 'controllerInstance'.
|
|
3525
|
+
*
|
|
3526
|
+
* @param operationData
|
|
3527
|
+
* @returns
|
|
3528
|
+
*/
|
|
3432
3529
|
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3530
|
+
var getControllerInstance = function getControllerInstance(operationData) {
|
|
3531
|
+
var systemName = operationData.systemName,
|
|
3532
|
+
_operationData$proper = operationData.propertyName,
|
|
3533
|
+
propertyName = _operationData$proper === void 0 ? 'controllerInstance' : _operationData$proper;
|
|
3534
|
+
operationData[propertyName] = null;
|
|
3535
|
+
|
|
3536
|
+
var resultCallback = function resultCallback(instance) {
|
|
3537
|
+
operationData[propertyName] = instance;
|
|
3436
3538
|
};
|
|
3437
3539
|
|
|
3438
|
-
|
|
3439
|
-
|
|
3540
|
+
this.eventbus.broadcast(TimelineEventNames.REQUEST_INSTANCE, [systemName, resultCallback]);
|
|
3541
|
+
delete operationData.propertyName;
|
|
3542
|
+
return operationData;
|
|
3543
|
+
};
|
|
3440
3544
|
|
|
3441
|
-
|
|
3442
|
-
|
|
3545
|
+
function modifyDimensionsByRatio(ratioModifier, dimensions) {
|
|
3546
|
+
//h[ar=8-1]
|
|
3547
|
+
var prefix = ratioModifier.substring(0, 1);
|
|
3548
|
+
var ratio = ratioModifier.substring(ratioModifier.indexOf('[') + 1, ratioModifier.indexOf(']') - ratioModifier.indexOf('[') - 1);
|
|
3549
|
+
var ratios = ratio.split('=')[1].split('-');
|
|
3443
3550
|
|
|
3444
|
-
|
|
3551
|
+
if (prefix === 'h') {
|
|
3552
|
+
dimensions.height = dimensions.width / +ratios[0] * +ratios[1];
|
|
3553
|
+
} else if (prefix === 'w') {
|
|
3554
|
+
dimensions.width = dimensions.height / +ratios[1] * +ratios[0];
|
|
3555
|
+
}
|
|
3556
|
+
}
|
|
3445
3557
|
|
|
3446
|
-
|
|
3447
|
-
|
|
3558
|
+
function getModifierSuffix(modifier) {
|
|
3559
|
+
var endIdx = 1;
|
|
3560
|
+
var suffix = modifier.substring(modifier.length - 1, 1);
|
|
3448
3561
|
|
|
3449
|
-
|
|
3562
|
+
if (suffix !== 'h' && suffix !== 'w' && suffix !== '%') {
|
|
3563
|
+
suffix = null;
|
|
3564
|
+
}
|
|
3450
3565
|
|
|
3451
|
-
|
|
3566
|
+
var isPercent = suffix === '%';
|
|
3452
3567
|
|
|
3453
|
-
|
|
3568
|
+
if (isPercent) {
|
|
3569
|
+
endIdx = 2;
|
|
3570
|
+
suffix = modifier.substring(modifier.length - endIdx, 1);
|
|
3454
3571
|
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3572
|
+
if (suffix !== 'h' && suffix !== 'w') {
|
|
3573
|
+
suffix = null;
|
|
3574
|
+
endIdx = 1;
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3459
3577
|
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
this.stop();
|
|
3463
|
-
this.eventbus.broadcast(TimelineEventNames.COMPLETE, [this._player.getPlaylistIndex()]);
|
|
3464
|
-
}
|
|
3465
|
-
};
|
|
3466
|
-
|
|
3467
|
-
_proto._seekedHandler = function _seekedHandler() {
|
|
3468
|
-
this.eventbus.broadcast(TimelineEventNames.SEEKED, [this.getPosition(), this.getDuration()]);
|
|
3469
|
-
};
|
|
3578
|
+
return [suffix, endIdx, isPercent];
|
|
3579
|
+
}
|
|
3470
3580
|
|
|
3471
|
-
|
|
3472
|
-
|
|
3581
|
+
function _modifyDimensions(dimensions, prefix, suffix, widthModifier, heightModifier) {
|
|
3582
|
+
switch (prefix) {
|
|
3583
|
+
case '+':
|
|
3584
|
+
switch (suffix) {
|
|
3585
|
+
case 'h':
|
|
3586
|
+
dimensions.height += heightModifier;
|
|
3587
|
+
break;
|
|
3473
3588
|
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
};
|
|
3589
|
+
case 'w':
|
|
3590
|
+
dimensions.width += widthModifier;
|
|
3591
|
+
break;
|
|
3478
3592
|
|
|
3479
|
-
|
|
3480
|
-
|
|
3593
|
+
default:
|
|
3594
|
+
dimensions.height += heightModifier;
|
|
3595
|
+
dimensions.width += widthModifier;
|
|
3596
|
+
}
|
|
3481
3597
|
|
|
3482
|
-
|
|
3483
|
-
this.seek(0);
|
|
3484
|
-
}
|
|
3485
|
-
};
|
|
3598
|
+
break;
|
|
3486
3599
|
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3600
|
+
case '-':
|
|
3601
|
+
switch (suffix) {
|
|
3602
|
+
case 'h':
|
|
3603
|
+
dimensions.height -= heightModifier;
|
|
3604
|
+
break;
|
|
3492
3605
|
|
|
3493
|
-
|
|
3494
|
-
|
|
3606
|
+
case 'w':
|
|
3607
|
+
dimensions.width -= widthModifier;
|
|
3608
|
+
break;
|
|
3495
3609
|
|
|
3496
|
-
|
|
3610
|
+
default:
|
|
3611
|
+
dimensions.height -= heightModifier;
|
|
3612
|
+
dimensions.width -= widthModifier;
|
|
3613
|
+
}
|
|
3497
3614
|
|
|
3498
|
-
|
|
3615
|
+
break;
|
|
3499
3616
|
|
|
3500
|
-
|
|
3617
|
+
case '/':
|
|
3618
|
+
switch (suffix) {
|
|
3619
|
+
case 'h':
|
|
3620
|
+
dimensions.height /= heightModifier;
|
|
3621
|
+
break;
|
|
3501
3622
|
|
|
3502
|
-
|
|
3623
|
+
case 'w':
|
|
3624
|
+
dimensions.width /= widthModifier;
|
|
3625
|
+
break;
|
|
3503
3626
|
|
|
3504
|
-
|
|
3627
|
+
default:
|
|
3628
|
+
dimensions.height /= heightModifier;
|
|
3629
|
+
dimensions.width /= widthModifier;
|
|
3630
|
+
}
|
|
3505
3631
|
|
|
3506
|
-
|
|
3632
|
+
break;
|
|
3507
3633
|
|
|
3508
|
-
|
|
3509
|
-
|
|
3634
|
+
case '*':
|
|
3635
|
+
switch (suffix) {
|
|
3636
|
+
case 'h':
|
|
3637
|
+
dimensions.height *= heightModifier;
|
|
3638
|
+
break;
|
|
3510
3639
|
|
|
3511
|
-
|
|
3512
|
-
|
|
3640
|
+
case 'w':
|
|
3641
|
+
dimensions.width *= widthModifier;
|
|
3642
|
+
break;
|
|
3513
3643
|
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3644
|
+
default:
|
|
3645
|
+
dimensions.height *= heightModifier;
|
|
3646
|
+
dimensions.width *= widthModifier;
|
|
3647
|
+
}
|
|
3517
3648
|
|
|
3518
|
-
|
|
3519
|
-
resultCallback(container);
|
|
3520
|
-
};
|
|
3649
|
+
break;
|
|
3521
3650
|
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
} else {
|
|
3526
|
-
this.pause();
|
|
3527
|
-
}
|
|
3528
|
-
};
|
|
3651
|
+
default:
|
|
3652
|
+
console.error("Unknown operator found: " + prefix);
|
|
3653
|
+
}
|
|
3529
3654
|
|
|
3530
|
-
|
|
3531
|
-
|
|
3655
|
+
return dimensions;
|
|
3656
|
+
}
|
|
3657
|
+
/**
|
|
3658
|
+
* Modifies the given dimensions using the given modifier string.
|
|
3659
|
+
* The modifier string is formatted in the following way:
|
|
3660
|
+
*
|
|
3661
|
+
* <operator><amount><optional-side><optional-precentage>|<ratio-definition>
|
|
3662
|
+
*
|
|
3663
|
+
* Where the ratio modifier is formatted in the following way:
|
|
3664
|
+
* <side>[ar=<ratio-left>-<ratio-right>]
|
|
3665
|
+
*
|
|
3666
|
+
* For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:
|
|
3667
|
+
* it will add a value of 100 to the height and modify the width by a ration of 8 to 1 relative to the height.
|
|
3668
|
+
*
|
|
3669
|
+
* @param dimensions
|
|
3670
|
+
* @param modifier
|
|
3671
|
+
*/
|
|
3532
3672
|
|
|
3533
|
-
this._player.play();
|
|
3534
3673
|
|
|
3535
|
-
|
|
3536
|
-
|
|
3674
|
+
function modifyDimensions(dimensions, modifier) {
|
|
3675
|
+
var ratioModifier = null;
|
|
3537
3676
|
|
|
3538
|
-
|
|
3539
|
-
|
|
3677
|
+
if (modifier.indexOf('|') > -1) {
|
|
3678
|
+
var _modifier$split = modifier.split('|');
|
|
3540
3679
|
|
|
3541
|
-
|
|
3680
|
+
modifier = _modifier$split[0];
|
|
3681
|
+
ratioModifier = _modifier$split[1];
|
|
3682
|
+
}
|
|
3542
3683
|
|
|
3543
|
-
|
|
3544
|
-
};
|
|
3684
|
+
var prefix = modifier.substring(0, 1);
|
|
3545
3685
|
|
|
3546
|
-
|
|
3547
|
-
|
|
3686
|
+
var _getModifierSuffix = getModifierSuffix(modifier),
|
|
3687
|
+
suffix = _getModifierSuffix[0],
|
|
3688
|
+
endIdx = _getModifierSuffix[1],
|
|
3689
|
+
isPercent = _getModifierSuffix[2];
|
|
3548
3690
|
|
|
3549
|
-
|
|
3691
|
+
var value = parseInt(suffix !== null ? modifier.substring(1, modifier.length - endIdx - 1) : modifier.substring(1, modifier.length), 10);
|
|
3692
|
+
var widthModifier = value;
|
|
3693
|
+
var heightModifier = value;
|
|
3550
3694
|
|
|
3551
|
-
|
|
3552
|
-
|
|
3695
|
+
if (isPercent) {
|
|
3696
|
+
widthModifier = dimensions.width / 100 * value;
|
|
3697
|
+
heightModifier = dimensions.height / 100 * value;
|
|
3698
|
+
}
|
|
3553
3699
|
|
|
3554
|
-
|
|
3555
|
-
var currentPosition = this._player.getPosition();
|
|
3700
|
+
dimensions = _modifyDimensions(dimensions, prefix, suffix, widthModifier, heightModifier);
|
|
3556
3701
|
|
|
3557
|
-
|
|
3702
|
+
if (ratioModifier) {
|
|
3703
|
+
modifyDimensionsByRatio(ratioModifier, dimensions);
|
|
3704
|
+
}
|
|
3705
|
+
}
|
|
3558
3706
|
|
|
3559
|
-
|
|
3560
|
-
|
|
3707
|
+
/**
|
|
3708
|
+
* This operation calculates the width and height of the specified selected element.
|
|
3709
|
+
* It assigns this struct to the dimensions property on the current operation data.
|
|
3710
|
+
* Optionally the width and height can be tweaked using the given modifier string.
|
|
3711
|
+
*
|
|
3712
|
+
* The modifier string is formatted in the following way:
|
|
3713
|
+
*
|
|
3714
|
+
* <operator><amount><optional-side><optional-precentage>|<ratio-definition>
|
|
3715
|
+
*
|
|
3716
|
+
* Where the ratio modifier is formatted in the following way:
|
|
3717
|
+
* <side>[ar=<ratio-left>-<ratio-right>]
|
|
3718
|
+
*
|
|
3719
|
+
* For example, this modifier '+100h|w[ar=8-1]' will modifiy the dimensions like this:
|
|
3720
|
+
* it will add a value of 100 to the height and modify the width by a ration of 8 to 1 relative to the height.
|
|
3721
|
+
*
|
|
3722
|
+
* @param operationData
|
|
3723
|
+
* @returns
|
|
3724
|
+
*/
|
|
3561
3725
|
|
|
3562
|
-
|
|
3563
|
-
|
|
3726
|
+
var getElementDimensions = function getElementDimensions(operationData) {
|
|
3727
|
+
var _selectedElement$inne, _selectedElement$inne2;
|
|
3564
3728
|
|
|
3565
|
-
|
|
3729
|
+
var selectedElement = operationData.selectedElement,
|
|
3730
|
+
modifier = operationData.modifier;
|
|
3731
|
+
var dimensions = {
|
|
3732
|
+
width: (_selectedElement$inne = selectedElement.innerWidth()) != null ? _selectedElement$inne : 0,
|
|
3733
|
+
height: (_selectedElement$inne2 = selectedElement.innerHeight()) != null ? _selectedElement$inne2 : 0
|
|
3566
3734
|
};
|
|
3567
3735
|
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
}
|
|
3736
|
+
if (dimensions.height === 0) {
|
|
3737
|
+
dimensions.height = dimensions.width;
|
|
3738
|
+
}
|
|
3571
3739
|
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
});
|
|
3740
|
+
if (modifier) {
|
|
3741
|
+
modifyDimensions(dimensions, modifier);
|
|
3742
|
+
}
|
|
3576
3743
|
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
};
|
|
3744
|
+
operationData.dimensions = dimensions;
|
|
3745
|
+
return operationData;
|
|
3746
|
+
};
|
|
3581
3747
|
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3748
|
+
/**
|
|
3749
|
+
* This operation retrieves the import specified by the given system name and
|
|
3750
|
+
* assigns it to the importedInstance property on the current operaton date.
|
|
3751
|
+
*
|
|
3752
|
+
* @param operationData
|
|
3753
|
+
* @returns
|
|
3754
|
+
*/
|
|
3585
3755
|
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
};
|
|
3756
|
+
var getImport = function getImport(operationData) {
|
|
3757
|
+
var systemName = operationData.systemName;
|
|
3589
3758
|
|
|
3590
|
-
|
|
3591
|
-
|
|
3759
|
+
var callBack = function callBack(instance) {
|
|
3760
|
+
operationData.importedInstance = instance;
|
|
3592
3761
|
};
|
|
3593
3762
|
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3763
|
+
this.eventbus.broadcast(TimelineEventNames.REQUEST_FUNCTION, [systemName, callBack]);
|
|
3764
|
+
delete operationData.systemName;
|
|
3765
|
+
return operationData;
|
|
3766
|
+
};
|
|
3597
3767
|
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3768
|
+
var jsonCache = {};
|
|
3769
|
+
var addToCache = function addToCache(key, value) {
|
|
3770
|
+
jsonCache[key] = value;
|
|
3771
|
+
};
|
|
3772
|
+
/**
|
|
3773
|
+
* This operation loads a JSON file from the specified url and assigns it to the specified
|
|
3774
|
+
* property name on the current operation data. The property name defaults to 'json'.
|
|
3775
|
+
*
|
|
3776
|
+
* If the cache property is set to true and a cached value already exists, this is assigned
|
|
3777
|
+
* instead of re-retrieving it from the url.
|
|
3778
|
+
*
|
|
3779
|
+
* @param operationData
|
|
3780
|
+
* @returns
|
|
3781
|
+
*/
|
|
3601
3782
|
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3783
|
+
var loadJSON = function loadJSON(operationData) {
|
|
3784
|
+
var url = operationData.url,
|
|
3785
|
+
cache = operationData.cache,
|
|
3786
|
+
_operationData$proper = operationData.propertyName,
|
|
3787
|
+
propertyName = _operationData$proper === void 0 ? 'json' : _operationData$proper;
|
|
3605
3788
|
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3789
|
+
if (cache && jsonCache[url]) {
|
|
3790
|
+
operationData[propertyName] = jsonCache[url];
|
|
3791
|
+
delete operationData.propertyName;
|
|
3792
|
+
return operationData;
|
|
3793
|
+
}
|
|
3609
3794
|
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3795
|
+
return new Promise(function (resolve, reject) {
|
|
3796
|
+
fetch(url).then( /*#__PURE__*/function () {
|
|
3797
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
|
|
3798
|
+
var json, cacheValue;
|
|
3799
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3800
|
+
while (1) {
|
|
3801
|
+
switch (_context.prev = _context.next) {
|
|
3802
|
+
case 0:
|
|
3803
|
+
_context.next = 2;
|
|
3804
|
+
return response.json();
|
|
3613
3805
|
|
|
3614
|
-
|
|
3615
|
-
|
|
3806
|
+
case 2:
|
|
3807
|
+
json = _context.sent;
|
|
3808
|
+
cacheValue = operationData[propertyName] = json;
|
|
3809
|
+
delete operationData.propertyName;
|
|
3810
|
+
addToCache(url, cacheValue);
|
|
3811
|
+
resolve(operationData);
|
|
3616
3812
|
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
this._eventbusListeners = [];
|
|
3625
|
-
this._playlist = [];
|
|
3626
|
-
this._length = 0;
|
|
3627
|
-
this._urls = [];
|
|
3628
|
-
this.loop = false;
|
|
3629
|
-
|
|
3630
|
-
this._addEventListeners();
|
|
3631
|
-
}
|
|
3632
|
-
|
|
3633
|
-
var _proto = MediaElementTimelineProvider.prototype;
|
|
3634
|
-
|
|
3635
|
-
_proto._addEventListeners = function _addEventListeners() {
|
|
3636
|
-
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.PLAY_REQUEST, this.start.bind(this)));
|
|
3637
|
-
|
|
3638
|
-
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.STOP_REQUEST, this.stop.bind(this)));
|
|
3813
|
+
case 7:
|
|
3814
|
+
case "end":
|
|
3815
|
+
return _context.stop();
|
|
3816
|
+
}
|
|
3817
|
+
}
|
|
3818
|
+
}, _callee);
|
|
3819
|
+
}));
|
|
3639
3820
|
|
|
3640
|
-
|
|
3821
|
+
return function (_x) {
|
|
3822
|
+
return _ref.apply(this, arguments);
|
|
3823
|
+
};
|
|
3824
|
+
}())["catch"](reject);
|
|
3825
|
+
});
|
|
3826
|
+
};
|
|
3641
3827
|
|
|
3642
|
-
|
|
3828
|
+
/**
|
|
3829
|
+
* This operation logs the current operation data and context.
|
|
3830
|
+
*
|
|
3831
|
+
* @param operationData
|
|
3832
|
+
* @returns
|
|
3833
|
+
*/
|
|
3834
|
+
var log = function log(operationData) {
|
|
3835
|
+
console.group('Operation info');
|
|
3836
|
+
console.dir({
|
|
3837
|
+
context: this
|
|
3838
|
+
});
|
|
3839
|
+
console.dir({
|
|
3840
|
+
operationData: operationData
|
|
3841
|
+
});
|
|
3842
|
+
console.groupEnd();
|
|
3843
|
+
return operationData;
|
|
3844
|
+
};
|
|
3643
3845
|
|
|
3644
|
-
|
|
3846
|
+
/**
|
|
3847
|
+
* This operation removes the spcified class name from the specified selected element.
|
|
3848
|
+
*
|
|
3849
|
+
* @param operationData
|
|
3850
|
+
* @returns
|
|
3851
|
+
*/
|
|
3852
|
+
var removeClass = function removeClass(operationData) {
|
|
3853
|
+
var selectedElement = operationData.selectedElement,
|
|
3854
|
+
className = operationData.className;
|
|
3855
|
+
selectedElement.removeClass(className);
|
|
3856
|
+
return operationData;
|
|
3857
|
+
};
|
|
3645
3858
|
|
|
3646
|
-
|
|
3859
|
+
/**
|
|
3860
|
+
* This operation removes the controller with the specified name from the specified selected element.
|
|
3861
|
+
*
|
|
3862
|
+
* @param operationData
|
|
3863
|
+
* @returns
|
|
3864
|
+
*/
|
|
3647
3865
|
|
|
3648
|
-
|
|
3649
|
-
|
|
3866
|
+
var removeControllerFromElement = function removeControllerFromElement(operationData) {
|
|
3867
|
+
var selectedElement = operationData.selectedElement,
|
|
3868
|
+
controllerName = operationData.controllerName;
|
|
3869
|
+
var controllers = getElementControllers(selectedElement);
|
|
3870
|
+
var controller = controllers == null ? void 0 : controllers.find(function (ctrl) {
|
|
3871
|
+
return ctrl.name === controllerName;
|
|
3872
|
+
});
|
|
3650
3873
|
|
|
3651
|
-
|
|
3652
|
-
var
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
});
|
|
3657
|
-
return urls;
|
|
3658
|
-
};
|
|
3874
|
+
if (controller) {
|
|
3875
|
+
var idx = controllers.indexOf(controller);
|
|
3876
|
+
controllers.splice(idx, 1);
|
|
3877
|
+
controller.detach(this.eventbus);
|
|
3878
|
+
}
|
|
3659
3879
|
|
|
3660
|
-
|
|
3661
|
-
|
|
3880
|
+
return operationData;
|
|
3881
|
+
};
|
|
3662
3882
|
|
|
3663
|
-
|
|
3664
|
-
|
|
3883
|
+
/**
|
|
3884
|
+
* This operation removes the specified selected element from the DOM.
|
|
3885
|
+
*
|
|
3886
|
+
* @param operationData
|
|
3887
|
+
* @returns
|
|
3888
|
+
*/
|
|
3889
|
+
var removeElement = function removeElement(operationData) {
|
|
3890
|
+
var selectedElement = operationData.selectedElement;
|
|
3891
|
+
selectedElement.remove();
|
|
3892
|
+
return operationData;
|
|
3893
|
+
};
|
|
3665
3894
|
|
|
3666
|
-
|
|
3895
|
+
/**
|
|
3896
|
+
* This operation removes the given list of properties from the current operation data.
|
|
3897
|
+
*
|
|
3898
|
+
* @param operationData
|
|
3899
|
+
* @returns
|
|
3900
|
+
*/
|
|
3901
|
+
var removePropertiesFromOperationData = function removePropertiesFromOperationData(operationData) {
|
|
3902
|
+
var propertyNames = operationData.propertyNames;
|
|
3903
|
+
propertyNames.forEach(function (name) {
|
|
3904
|
+
delete operationData[name];
|
|
3905
|
+
});
|
|
3906
|
+
delete operationData.propertyNames;
|
|
3907
|
+
return operationData;
|
|
3908
|
+
};
|
|
3667
3909
|
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
return promise;
|
|
3682
|
-
};
|
|
3910
|
+
/**
|
|
3911
|
+
* This operation moves the specified selected element to the new parent that is defined
|
|
3912
|
+
* by the specified selector.
|
|
3913
|
+
*
|
|
3914
|
+
* @param operationData
|
|
3915
|
+
* @returns
|
|
3916
|
+
*/
|
|
3917
|
+
var reparentElement = function reparentElement(operationData) {
|
|
3918
|
+
var selectedElement = operationData.selectedElement,
|
|
3919
|
+
newParentSelector = operationData.newParentSelector;
|
|
3920
|
+
selectedElement.remove().appendTo(newParentSelector);
|
|
3921
|
+
return operationData;
|
|
3922
|
+
};
|
|
3683
3923
|
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
duration: this.player.duration
|
|
3692
|
-
}]);
|
|
3693
|
-
}
|
|
3694
|
-
};
|
|
3924
|
+
/**
|
|
3925
|
+
* This operation requests an action instance with the specified name and assigns it
|
|
3926
|
+
* to the actionInstance property on the current operation data.
|
|
3927
|
+
*
|
|
3928
|
+
* @param operationData
|
|
3929
|
+
* @returns
|
|
3930
|
+
*/
|
|
3695
3931
|
|
|
3696
|
-
|
|
3697
|
-
|
|
3932
|
+
var requestAction = function requestAction(operationData) {
|
|
3933
|
+
var systemName = operationData.systemName;
|
|
3698
3934
|
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
videoElm.push("<source src='" + url + "' type='" + _this2._extractFileType(url) + "'/>");
|
|
3702
|
-
});
|
|
3703
|
-
videoElm.push('</video>');
|
|
3704
|
-
$(selector).append(videoElm.join(''));
|
|
3935
|
+
var resultCallback = function resultCallback(action) {
|
|
3936
|
+
operationData.actionInstance = action;
|
|
3705
3937
|
};
|
|
3706
3938
|
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
};
|
|
3939
|
+
this.eventbus.broadcast(TimelineEventNames.REQUEST_ACTION, [systemName, resultCallback]);
|
|
3940
|
+
return operationData;
|
|
3941
|
+
};
|
|
3711
3942
|
|
|
3712
|
-
|
|
3713
|
-
|
|
3943
|
+
/**
|
|
3944
|
+
* @deprecated
|
|
3945
|
+
*
|
|
3946
|
+
* @param operationData
|
|
3947
|
+
* @returns
|
|
3948
|
+
*/
|
|
3714
3949
|
|
|
3715
|
-
|
|
3716
|
-
|
|
3950
|
+
var resizeAction = function resizeAction(operationData) {
|
|
3951
|
+
var _operationData = operationData,
|
|
3952
|
+
actionInstance = _operationData.actionInstance,
|
|
3953
|
+
actionOperationData = _operationData.actionOperationData;
|
|
3954
|
+
operationData = mergeOperationData(operationData, actionOperationData);
|
|
3717
3955
|
|
|
3718
|
-
|
|
3719
|
-
|
|
3956
|
+
if (actionInstance.resize) {
|
|
3957
|
+
return actionInstance.resize(operationData);
|
|
3958
|
+
}
|
|
3720
3959
|
|
|
3721
|
-
|
|
3722
|
-
|
|
3960
|
+
return operationData;
|
|
3961
|
+
};
|
|
3723
3962
|
|
|
3724
|
-
|
|
3725
|
-
|
|
3963
|
+
function findElementBySelector(root, selector, operationData, propertyName) {
|
|
3964
|
+
var element = root.find(selector);
|
|
3726
3965
|
|
|
3727
|
-
|
|
3728
|
-
|
|
3966
|
+
if (!element.length) {
|
|
3967
|
+
console.warn("selector '" + selector + "' wasn't found!");
|
|
3968
|
+
}
|
|
3729
3969
|
|
|
3730
|
-
|
|
3731
|
-
var _this$player4, _this$player6;
|
|
3970
|
+
operationData[propertyName] = element;
|
|
3732
3971
|
|
|
3733
|
-
|
|
3734
|
-
|
|
3972
|
+
if (operationData.hasOwnProperty('propertyName')) {
|
|
3973
|
+
delete operationData.propertyName;
|
|
3974
|
+
}
|
|
3975
|
+
}
|
|
3976
|
+
/**
|
|
3977
|
+
* This operation selects one or more elements using the specified selector.
|
|
3978
|
+
*
|
|
3979
|
+
* If useSelectedElementAsRoot is set to true and a valid DOM element is assigned
|
|
3980
|
+
* to the current operation data defined by the given property name (defaults to 'selectedElement')
|
|
3981
|
+
* then the element will be looked for only in the child elements of this DOM element.
|
|
3982
|
+
*
|
|
3983
|
+
* @param operationData
|
|
3984
|
+
* @returns
|
|
3985
|
+
*/
|
|
3735
3986
|
|
|
3736
|
-
(_this$player5 = this.player) == null ? void 0 : _this$player5.pause();
|
|
3737
|
-
}
|
|
3738
3987
|
|
|
3739
|
-
|
|
3740
|
-
|
|
3988
|
+
var selectElement = function selectElement(operationData) {
|
|
3989
|
+
var selector = operationData.selector,
|
|
3990
|
+
_operationData$proper = operationData.propertyName,
|
|
3991
|
+
propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper,
|
|
3992
|
+
_operationData$useSel = operationData.useSelectedElementAsRoot,
|
|
3993
|
+
useSelectedElementAsRoot = _operationData$useSel === void 0 ? false : _operationData$useSel;
|
|
3741
3994
|
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
};
|
|
3995
|
+
if (!selector) {
|
|
3996
|
+
throw new Error('selector is undefined!');
|
|
3997
|
+
}
|
|
3746
3998
|
|
|
3747
|
-
|
|
3748
|
-
var
|
|
3999
|
+
if (useSelectedElementAsRoot && operationData[propertyName]) {
|
|
4000
|
+
var currentRoot = operationData[propertyName];
|
|
4001
|
+
findElementBySelector(currentRoot, selector, operationData, propertyName);
|
|
4002
|
+
return operationData;
|
|
4003
|
+
}
|
|
3749
4004
|
|
|
3750
|
-
|
|
4005
|
+
var rootCallback = function rootCallback(root) {
|
|
4006
|
+
findElementBySelector(root, selector, operationData, propertyName);
|
|
3751
4007
|
};
|
|
3752
4008
|
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
(_this$player8 = this.player) == null ? void 0 : _this$player8.setCurrentTime(position);
|
|
3757
|
-
};
|
|
4009
|
+
this.eventbus.broadcast(TimelineEventNames.REQUEST_ENGINE_ROOT, [rootCallback]);
|
|
4010
|
+
return operationData;
|
|
4011
|
+
};
|
|
3758
4012
|
|
|
3759
|
-
|
|
4013
|
+
/**
|
|
4014
|
+
* This operation sets the given set of attributes on the specified selected element.
|
|
4015
|
+
*
|
|
4016
|
+
* @param operationData
|
|
4017
|
+
* @returns
|
|
4018
|
+
*/
|
|
4019
|
+
var setElementAttributes = function setElementAttributes(operationData) {
|
|
4020
|
+
var attributes = operationData.attributes,
|
|
4021
|
+
selectedElement = operationData.selectedElement;
|
|
4022
|
+
Object.entries(attributes).forEach(function (_ref) {
|
|
4023
|
+
var attrName = _ref[0],
|
|
4024
|
+
attrValue = _ref[1];
|
|
4025
|
+
selectedElement.attr(attrName, attrValue);
|
|
4026
|
+
});
|
|
4027
|
+
return operationData;
|
|
4028
|
+
};
|
|
3760
4029
|
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
4030
|
+
/**
|
|
4031
|
+
* This operation sets the specified content defined by the value assigned to the template property
|
|
4032
|
+
* to the specified selected element.
|
|
4033
|
+
*
|
|
4034
|
+
* When the insertionType is set to 'overwrite' the contents of the selected element are replaced
|
|
4035
|
+
* by the given template.
|
|
4036
|
+
* When set to 'append' the new content will be inserted after the current content.
|
|
4037
|
+
* When set to 'prepend' the new content will be inserted before the current content.
|
|
4038
|
+
*
|
|
4039
|
+
* @param operationData
|
|
4040
|
+
* @returns
|
|
4041
|
+
*/
|
|
4042
|
+
var setElementContent = function setElementContent(operationData) {
|
|
4043
|
+
var _operationData$insert = operationData.insertionType,
|
|
4044
|
+
insertionType = _operationData$insert === void 0 ? 'overwrite' : _operationData$insert,
|
|
4045
|
+
selectedElement = operationData.selectedElement,
|
|
4046
|
+
template = operationData.template;
|
|
3764
4047
|
|
|
3765
|
-
|
|
3766
|
-
|
|
4048
|
+
switch (true) {
|
|
4049
|
+
case insertionType === 'overwrite':
|
|
4050
|
+
selectedElement.html(template);
|
|
4051
|
+
break;
|
|
3767
4052
|
|
|
3768
|
-
|
|
3769
|
-
|
|
4053
|
+
case insertionType === 'append':
|
|
4054
|
+
selectedElement.append(template);
|
|
4055
|
+
break;
|
|
3770
4056
|
|
|
3771
|
-
|
|
3772
|
-
|
|
4057
|
+
case insertionType === 'prepend':
|
|
4058
|
+
selectedElement.prepend(template);
|
|
4059
|
+
break;
|
|
4060
|
+
}
|
|
3773
4061
|
|
|
3774
|
-
|
|
3775
|
-
|
|
4062
|
+
delete operationData.insertionType;
|
|
4063
|
+
return operationData;
|
|
4064
|
+
};
|
|
3776
4065
|
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
4066
|
+
/**
|
|
4067
|
+
* This operation assigns the specified properties to the current operation data.
|
|
4068
|
+
* When override is set to true the properties replace the current operation data entirely.
|
|
4069
|
+
*
|
|
4070
|
+
* @param operationData
|
|
4071
|
+
* @returns
|
|
4072
|
+
*/
|
|
3780
4073
|
|
|
3781
|
-
|
|
3782
|
-
|
|
4074
|
+
var setOperationData = function setOperationData(operationData) {
|
|
4075
|
+
var _operationData = operationData,
|
|
4076
|
+
_operationData$overri = _operationData.override,
|
|
4077
|
+
override = _operationData$overri === void 0 ? false : _operationData$overri,
|
|
4078
|
+
properties = _operationData.properties;
|
|
4079
|
+
delete operationData.properties;
|
|
4080
|
+
delete operationData.override;
|
|
4081
|
+
var resolvedProperties = resolvePropertyValues(operationData, properties);
|
|
3783
4082
|
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
this._requestID = -1;
|
|
3789
|
-
this._last = 0;
|
|
3790
|
-
this._currentPosition = 0;
|
|
3791
|
-
this._updateBound = this._update.bind(this);
|
|
3792
|
-
this._eventbusListeners = [];
|
|
3793
|
-
this._firstFrame = true;
|
|
3794
|
-
this._granularity = 1000;
|
|
3795
|
-
this.playState = 'stopped';
|
|
3796
|
-
this.loop = false;
|
|
3797
|
-
this.eventbus = eventbus;
|
|
3798
|
-
this.config = config;
|
|
3799
|
-
this._playlist = this._extractPlaylist(config);
|
|
3800
|
-
this._currentPlaylistItem = this._playlist[0];
|
|
4083
|
+
if (override) {
|
|
4084
|
+
operationData = resolvedProperties;
|
|
4085
|
+
} else {
|
|
4086
|
+
operationData = Object.assign(operationData, resolvedProperties);
|
|
3801
4087
|
}
|
|
3802
4088
|
|
|
3803
|
-
|
|
4089
|
+
return operationData;
|
|
4090
|
+
};
|
|
3804
4091
|
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
return;
|
|
3815
|
-
}
|
|
4092
|
+
/**
|
|
4093
|
+
* This operation assigns the specified CSS style properties to the
|
|
4094
|
+
* specified selected element. The selected element is assigned to
|
|
4095
|
+
* the property defined by the propertyName property which defaults
|
|
4096
|
+
* to 'selectedElement'.
|
|
4097
|
+
*
|
|
4098
|
+
* @param operationData
|
|
4099
|
+
* @returns
|
|
4100
|
+
*/
|
|
3816
4101
|
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
4102
|
+
var setStyle = function setStyle(operationData) {
|
|
4103
|
+
var _operationData$proper = operationData.propertyName,
|
|
4104
|
+
propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper;
|
|
4105
|
+
var properties = resolvePropertyValues(operationData, operationData.properties);
|
|
4106
|
+
operationData[propertyName].css(properties);
|
|
4107
|
+
delete operationData.propertyName;
|
|
4108
|
+
return operationData;
|
|
4109
|
+
};
|
|
3820
4110
|
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
4111
|
+
/**
|
|
4112
|
+
* This operation starts the specified action instance using the specified action operation data.
|
|
4113
|
+
*
|
|
4114
|
+
* The action operation data is first merged with the current operation data before it is
|
|
4115
|
+
* passed on to the action. After the action has completed the action operation data properties
|
|
4116
|
+
* are removed from the current operation data.
|
|
4117
|
+
*
|
|
4118
|
+
* @param operationData
|
|
4119
|
+
* @returns
|
|
4120
|
+
*/
|
|
3824
4121
|
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
4122
|
+
var startAction = function startAction(operationData) {
|
|
4123
|
+
var _operationData = operationData,
|
|
4124
|
+
actionInstance = _operationData.actionInstance,
|
|
4125
|
+
actionOperationData = _operationData.actionOperationData;
|
|
4126
|
+
delete operationData.actionOperationData;
|
|
4127
|
+
return new Promise(function (resolve, reject) {
|
|
4128
|
+
operationData = mergeOperationData(operationData, actionOperationData);
|
|
4129
|
+
actionInstance.start(operationData).then(function () {
|
|
4130
|
+
Object.keys(actionOperationData).forEach(function (key) {
|
|
4131
|
+
delete operationData[key];
|
|
4132
|
+
});
|
|
4133
|
+
internalResolve(resolve, operationData);
|
|
4134
|
+
}, reject);
|
|
4135
|
+
});
|
|
4136
|
+
};
|
|
3828
4137
|
|
|
3829
|
-
|
|
3830
|
-
|
|
4138
|
+
/**
|
|
4139
|
+
* This operation starts a loop using the given collection.
|
|
4140
|
+
*
|
|
4141
|
+
* Each iteration the current item from the specified collection is
|
|
4142
|
+
* assigned to the property on the current operation data specified
|
|
4143
|
+
* by the propertyName property which defaults to 'currentItem'.
|
|
4144
|
+
*
|
|
4145
|
+
* @param operationData
|
|
4146
|
+
* @returns
|
|
4147
|
+
*/
|
|
4148
|
+
var startLoop = function startLoop(operationData) {
|
|
4149
|
+
var context = this;
|
|
4150
|
+
var collection = operationData.collection,
|
|
4151
|
+
_operationData$proper = operationData.propertyName,
|
|
4152
|
+
propertyName = _operationData$proper === void 0 ? 'currentItem' : _operationData$proper;
|
|
3831
4153
|
|
|
3832
|
-
|
|
4154
|
+
if (typeof collection === 'string') {
|
|
4155
|
+
throw new Error('Expected collection to be array type, string value was probably not resolved correctly');
|
|
4156
|
+
}
|
|
3833
4157
|
|
|
3834
|
-
|
|
4158
|
+
if (context.loopIndex === undefined) {
|
|
4159
|
+
if (collection != null && collection.length) {
|
|
4160
|
+
context.loopIndex = 0;
|
|
4161
|
+
context.loopLength = collection.length - 1;
|
|
4162
|
+
context.startIndex = context.currentIndex;
|
|
4163
|
+
} else {
|
|
4164
|
+
context.skipNextOperation = true;
|
|
4165
|
+
}
|
|
4166
|
+
}
|
|
3835
4167
|
|
|
3836
|
-
|
|
4168
|
+
if (collection != null && collection.length && context.loopIndex !== undefined) {
|
|
4169
|
+
operationData[propertyName] = collection[context.loopIndex];
|
|
4170
|
+
}
|
|
3837
4171
|
|
|
3838
|
-
|
|
4172
|
+
delete operationData.propertyName;
|
|
4173
|
+
return operationData;
|
|
4174
|
+
};
|
|
3839
4175
|
|
|
3840
|
-
|
|
4176
|
+
/**
|
|
4177
|
+
* This operation toggles the specfied class name on the specified selected element.
|
|
4178
|
+
*
|
|
4179
|
+
* @param operationData
|
|
4180
|
+
* @returns
|
|
4181
|
+
*/
|
|
4182
|
+
var toggleClass = function toggleClass(operationData) {
|
|
4183
|
+
var selectedElement = operationData.selectedElement,
|
|
4184
|
+
className = operationData.className;
|
|
4185
|
+
selectedElement.toggleClass(className);
|
|
4186
|
+
return operationData;
|
|
4187
|
+
};
|
|
3841
4188
|
|
|
3842
|
-
|
|
4189
|
+
/**
|
|
4190
|
+
* This operation toggles the visibility of the specified selected element
|
|
4191
|
+
*
|
|
4192
|
+
* @param operationData
|
|
4193
|
+
* @returns
|
|
4194
|
+
*/
|
|
4195
|
+
var toggleElement = function toggleElement(operationData) {
|
|
4196
|
+
operationData.selectedElement.toggle();
|
|
4197
|
+
return operationData;
|
|
4198
|
+
};
|
|
3843
4199
|
|
|
3844
|
-
|
|
3845
|
-
|
|
4200
|
+
/**
|
|
4201
|
+
* This operation waits for the specified amount of milliseconds.
|
|
4202
|
+
*
|
|
4203
|
+
* @param operationData
|
|
4204
|
+
* @returns
|
|
4205
|
+
*/
|
|
3846
4206
|
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
4207
|
+
var wait = function wait(operationData) {
|
|
4208
|
+
var milliseconds = operationData.milliseconds;
|
|
4209
|
+
return new Promise(function (resolve) {
|
|
4210
|
+
setTimeout(function () {
|
|
4211
|
+
internalResolve(resolve, operationData);
|
|
4212
|
+
}, milliseconds);
|
|
4213
|
+
});
|
|
4214
|
+
};
|
|
3851
4215
|
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
4216
|
+
var ops = {
|
|
4217
|
+
__proto__: null,
|
|
4218
|
+
addClass: addClass,
|
|
4219
|
+
addControllerToElement: addControllerToElement,
|
|
4220
|
+
animate: animate,
|
|
4221
|
+
animateWithClass: animateWithClass,
|
|
4222
|
+
broadcastEvent: broadcastEvent,
|
|
4223
|
+
clearElement: clearElement,
|
|
4224
|
+
clearOperationData: clearOperationData,
|
|
4225
|
+
createElement: createElement,
|
|
4226
|
+
customFunction: customFunction,
|
|
4227
|
+
endAction: endAction,
|
|
4228
|
+
endLoop: endLoop,
|
|
4229
|
+
extendController: extendController,
|
|
4230
|
+
getControllerFromElement: getControllerFromElement,
|
|
4231
|
+
getControllerInstance: getControllerInstance,
|
|
4232
|
+
getElementDimensions: getElementDimensions,
|
|
4233
|
+
getImport: getImport,
|
|
4234
|
+
loadJSON: loadJSON,
|
|
4235
|
+
log: log,
|
|
4236
|
+
removeClass: removeClass,
|
|
4237
|
+
removeControllerFromElement: removeControllerFromElement,
|
|
4238
|
+
removeElement: removeElement,
|
|
4239
|
+
removePropertiesFromOperationData: removePropertiesFromOperationData,
|
|
4240
|
+
reparentElement: reparentElement,
|
|
4241
|
+
requestAction: requestAction,
|
|
4242
|
+
resizeAction: resizeAction,
|
|
4243
|
+
selectElement: selectElement,
|
|
4244
|
+
setElementAttributes: setElementAttributes,
|
|
4245
|
+
setElementContent: setElementContent,
|
|
4246
|
+
setOperationData: setOperationData,
|
|
4247
|
+
setStyle: setStyle,
|
|
4248
|
+
startAction: startAction,
|
|
4249
|
+
startLoop: startLoop,
|
|
4250
|
+
toggleClass: toggleClass,
|
|
4251
|
+
toggleElement: toggleElement,
|
|
4252
|
+
wait: wait
|
|
4253
|
+
};
|
|
3857
4254
|
|
|
3858
|
-
|
|
3859
|
-
|
|
4255
|
+
var JwPlayerTimelineProvider = /*#__PURE__*/function () {
|
|
4256
|
+
function JwPlayerTimelineProvider(eventbus, config) {
|
|
4257
|
+
this.eventbus = void 0;
|
|
4258
|
+
this.config = void 0;
|
|
4259
|
+
this._paused = false;
|
|
4260
|
+
this._player = null;
|
|
4261
|
+
this._currentLoopHandler = null;
|
|
4262
|
+
this._eventbusListeners = [];
|
|
4263
|
+
this._playlist = [];
|
|
4264
|
+
this._videoElementId = v4();
|
|
4265
|
+
this.loop = false;
|
|
4266
|
+
this.eventbus = eventbus;
|
|
4267
|
+
this.config = config;
|
|
3860
4268
|
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
this._reset();
|
|
3864
|
-
} else {
|
|
3865
|
-
this.stop();
|
|
3866
|
-
this.eventbus.broadcast(TimelineEventNames.COMPLETE);
|
|
3867
|
-
return;
|
|
3868
|
-
}
|
|
3869
|
-
}
|
|
4269
|
+
this._addEventListeners();
|
|
4270
|
+
}
|
|
3870
4271
|
|
|
3871
|
-
|
|
3872
|
-
position: this._currentPosition
|
|
3873
|
-
}]);
|
|
3874
|
-
this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [{
|
|
3875
|
-
position: this._currentPosition,
|
|
3876
|
-
duration: this._currentPlaylistItem.duration
|
|
3877
|
-
}]);
|
|
3878
|
-
}
|
|
4272
|
+
var _proto = JwPlayerTimelineProvider.prototype;
|
|
3879
4273
|
|
|
3880
|
-
|
|
4274
|
+
_proto._extractUrls = function _extractUrls(configuration) {
|
|
4275
|
+
var urls = configuration.timelines.filter(function (timeline) {
|
|
4276
|
+
return timeline.type === 'mediaplayer';
|
|
4277
|
+
}).map(function (timeline) {
|
|
4278
|
+
return timeline.uri;
|
|
4279
|
+
});
|
|
4280
|
+
return urls;
|
|
3881
4281
|
};
|
|
3882
4282
|
|
|
3883
|
-
_proto.
|
|
3884
|
-
|
|
3885
|
-
return;
|
|
3886
|
-
}
|
|
4283
|
+
_proto.init = function init() {
|
|
4284
|
+
var _this = this;
|
|
3887
4285
|
|
|
3888
|
-
|
|
3889
|
-
this._requestID = requestAnimationFrame(this._updateBound);
|
|
3890
|
-
};
|
|
4286
|
+
var settings = this.config.timelineProviderSettings['mediaplayer'];
|
|
3891
4287
|
|
|
3892
|
-
|
|
3893
|
-
|
|
4288
|
+
if (!settings) {
|
|
4289
|
+
throw new Error("No settings found for 'mediaplayer' timeline provider");
|
|
4290
|
+
}
|
|
3894
4291
|
|
|
3895
|
-
|
|
3896
|
-
this._currentPosition = 0;
|
|
3897
|
-
};
|
|
4292
|
+
var selector = settings.selector;
|
|
3898
4293
|
|
|
3899
|
-
|
|
3900
|
-
console.error('Not implemented yet');
|
|
3901
|
-
};
|
|
4294
|
+
var urls = this._extractUrls(this.config);
|
|
3902
4295
|
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
};
|
|
4296
|
+
var jwp = window.jwplayer;
|
|
4297
|
+
var p = $("#" + selector);
|
|
3906
4298
|
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
cancelAnimationFrame(this._requestID);
|
|
3910
|
-
this._requestID = -1;
|
|
3911
|
-
this._last = 0;
|
|
3912
|
-
this._currentPosition = 0;
|
|
4299
|
+
if (!p.length) {
|
|
4300
|
+
throw new Error("videoplayer selector '" + selector + "' not found");
|
|
3913
4301
|
}
|
|
3914
|
-
};
|
|
3915
|
-
|
|
3916
|
-
_proto.init = function init() {
|
|
3917
|
-
this._addEventListeners();
|
|
3918
4302
|
|
|
3919
|
-
|
|
3920
|
-
|
|
4303
|
+
var w = p.innerWidth();
|
|
4304
|
+
var h = p.innerHeight();
|
|
3921
4305
|
|
|
3922
|
-
if (
|
|
3923
|
-
|
|
4306
|
+
if (w === 0) {
|
|
4307
|
+
w = 100;
|
|
3924
4308
|
}
|
|
3925
4309
|
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
}
|
|
3929
|
-
return promise;
|
|
3930
|
-
};
|
|
3931
|
-
|
|
3932
|
-
_proto.destroy = function destroy() {
|
|
3933
|
-
this.stop();
|
|
4310
|
+
if (h === 0) {
|
|
4311
|
+
h = 300;
|
|
4312
|
+
}
|
|
3934
4313
|
|
|
3935
|
-
this.
|
|
3936
|
-
return func();
|
|
3937
|
-
});
|
|
4314
|
+
this._player = jwp(selector);
|
|
3938
4315
|
|
|
3939
|
-
this.
|
|
3940
|
-
|
|
4316
|
+
this._player.setup({
|
|
4317
|
+
file: urls[0],
|
|
4318
|
+
image: settings.poster,
|
|
4319
|
+
height: h,
|
|
4320
|
+
width: w,
|
|
4321
|
+
controls: true,
|
|
4322
|
+
autostart: false,
|
|
4323
|
+
displaytitle: false,
|
|
4324
|
+
displaydescription: false,
|
|
4325
|
+
nextUpDisplay: false,
|
|
4326
|
+
abouttext: 'Eligius',
|
|
4327
|
+
aboutlink: 'http://www.google.com',
|
|
4328
|
+
stretching: 'fill',
|
|
4329
|
+
repeat: false
|
|
4330
|
+
});
|
|
3941
4331
|
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
4332
|
+
this._playlist.length = 0;
|
|
4333
|
+
urls.forEach(function (url) {
|
|
4334
|
+
var item = {
|
|
4335
|
+
file: url,
|
|
4336
|
+
title: url,
|
|
4337
|
+
image: settings.poster
|
|
4338
|
+
};
|
|
3949
4339
|
|
|
3950
|
-
|
|
3951
|
-
|
|
4340
|
+
_this._playlist.push(item);
|
|
4341
|
+
});
|
|
4342
|
+
var promise = new Promise(function (resolve) {
|
|
4343
|
+
_this._player.once('ready', function () {
|
|
4344
|
+
_this._handlePlayerReady(resolve);
|
|
4345
|
+
});
|
|
3952
4346
|
|
|
3953
|
-
|
|
4347
|
+
_this._player.load(_this._playlist);
|
|
4348
|
+
});
|
|
4349
|
+
return promise;
|
|
3954
4350
|
};
|
|
3955
4351
|
|
|
3956
|
-
_proto.
|
|
3957
|
-
this
|
|
4352
|
+
_proto._handlePlayerReady = function _handlePlayerReady(resolve) {
|
|
4353
|
+
var _this2 = this;
|
|
3958
4354
|
|
|
3959
|
-
this.
|
|
3960
|
-
|
|
3961
|
-
};
|
|
4355
|
+
this._player.once('firstFrame', function () {
|
|
4356
|
+
_this2._player.pause();
|
|
3962
4357
|
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
4358
|
+
_this2.eventbus.broadcast(TimelineEventNames.DURATION, [_this2.getDuration()]);
|
|
4359
|
+
|
|
4360
|
+
resolve(_this2);
|
|
4361
|
+
});
|
|
4362
|
+
|
|
4363
|
+
this._player.on(TimelineEventNames.TIME, this._loopHandler.bind(this, Math.floor));
|
|
4364
|
+
|
|
4365
|
+
this._player.on(TimelineEventNames.SEEKED, this._seekedHandler.bind(this));
|
|
4366
|
+
|
|
4367
|
+
this._player.on(TimelineEventNames.COMPLETE, this._handlePlayerComplete.bind(this));
|
|
4368
|
+
|
|
4369
|
+
setTimeout(function () {
|
|
4370
|
+
_this2._player.play();
|
|
4371
|
+
}, 10);
|
|
3966
4372
|
};
|
|
3967
4373
|
|
|
3968
|
-
_proto.
|
|
3969
|
-
if (
|
|
3970
|
-
|
|
4374
|
+
_proto._handlePlayerComplete = function _handlePlayerComplete() {
|
|
4375
|
+
if (!this.loop) {
|
|
4376
|
+
this.stop();
|
|
4377
|
+
this.eventbus.broadcast(TimelineEventNames.COMPLETE, [this._player.getPlaylistIndex()]);
|
|
3971
4378
|
}
|
|
4379
|
+
};
|
|
3972
4380
|
|
|
3973
|
-
|
|
3974
|
-
this.
|
|
3975
|
-
this.eventbus.broadcast(TimelineEventNames.SEEKED, [this._currentPosition, this.getDuration()]);
|
|
3976
|
-
this.eventbus.broadcast(TimelineEventNames.TIME, [{
|
|
3977
|
-
position: this.getPosition()
|
|
3978
|
-
}]);
|
|
3979
|
-
this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [{
|
|
3980
|
-
position: this._currentPosition,
|
|
3981
|
-
duration: this._currentPlaylistItem.duration
|
|
3982
|
-
}]);
|
|
4381
|
+
_proto._seekedHandler = function _seekedHandler() {
|
|
4382
|
+
this.eventbus.broadcast(TimelineEventNames.SEEKED, [this.getPosition(), this.getDuration()]);
|
|
3983
4383
|
};
|
|
3984
4384
|
|
|
3985
|
-
_proto.
|
|
3986
|
-
|
|
4385
|
+
_proto.destroy = function destroy() {
|
|
4386
|
+
this._player.remove();
|
|
4387
|
+
|
|
4388
|
+
this._eventbusListeners.forEach(function (func) {
|
|
4389
|
+
return func();
|
|
4390
|
+
});
|
|
3987
4391
|
};
|
|
3988
4392
|
|
|
3989
|
-
_proto.
|
|
3990
|
-
|
|
4393
|
+
_proto._loopHandler = function _loopHandler(floor, jwplayerEvent) {
|
|
4394
|
+
var pos = floor(jwplayerEvent.position);
|
|
4395
|
+
|
|
4396
|
+
if (this.loop && pos === floor(this._player.getDuration() - 1)) {
|
|
4397
|
+
this.seek(0);
|
|
4398
|
+
}
|
|
3991
4399
|
};
|
|
3992
4400
|
|
|
3993
|
-
_proto.
|
|
3994
|
-
|
|
4401
|
+
_proto._timeResetLoopHandler = function _timeResetLoopHandler() {
|
|
4402
|
+
if (this.loop) {
|
|
4403
|
+
this.seek(0);
|
|
4404
|
+
}
|
|
3995
4405
|
};
|
|
3996
4406
|
|
|
3997
|
-
|
|
3998
|
-
|
|
4407
|
+
_proto._addEventListeners = function _addEventListeners() {
|
|
4408
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.PLAY_TOGGLE_REQUEST, this.toggleplay.bind(this)));
|
|
3999
4409
|
|
|
4410
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.PLAY_REQUEST, this.start.bind(this)));
|
|
4000
4411
|
|
|
4412
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.STOP_REQUEST, this.stop.bind(this)));
|
|
4001
4413
|
|
|
4002
|
-
|
|
4003
|
-
__proto__: null,
|
|
4004
|
-
JwPlayerTimelineProvider: JwPlayerTimelineProvider,
|
|
4005
|
-
MediaElementTimelineProvider: MediaElementTimelineProvider,
|
|
4006
|
-
RequestAnimationFrameTimelineProvider: RequestAnimationFrameTimelineProvider
|
|
4007
|
-
};
|
|
4414
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.PAUSE_REQUEST, this.pause.bind(this)));
|
|
4008
4415
|
|
|
4009
|
-
|
|
4010
|
-
var _this = this;
|
|
4416
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.SEEK_REQUEST, this.seek.bind(this)));
|
|
4011
4417
|
|
|
4012
|
-
|
|
4013
|
-
return new Promise(function (resolve, reject) {
|
|
4014
|
-
var resultCallback = function resultCallback(func) {
|
|
4015
|
-
var promise = func(operationData, _this.eventbus);
|
|
4418
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.RESIZE_REQUEST, this.resize.bind(this)));
|
|
4016
4419
|
|
|
4017
|
-
|
|
4018
|
-
promise.then(function () {
|
|
4019
|
-
internalResolve(resolve, {}, operationData);
|
|
4020
|
-
}, reject);
|
|
4021
|
-
} else {
|
|
4022
|
-
internalResolve(resolve, {}, operationData);
|
|
4023
|
-
}
|
|
4024
|
-
};
|
|
4420
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.CONTAINER_REQUEST, this._container.bind(this)));
|
|
4025
4421
|
|
|
4026
|
-
|
|
4027
|
-
}
|
|
4028
|
-
};
|
|
4422
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.DURATION_REQUEST, this.duration.bind(this)));
|
|
4423
|
+
};
|
|
4029
4424
|
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
actionInstance = _operationData.actionInstance,
|
|
4033
|
-
actionOperationData = _operationData.actionOperationData;
|
|
4034
|
-
delete operationData.actionOperationData;
|
|
4035
|
-
return new Promise(function (resolve, reject) {
|
|
4036
|
-
operationData = mergeOperationData(operationData, actionOperationData);
|
|
4037
|
-
actionInstance.end(operationData).then(function () {
|
|
4038
|
-
Object.keys(actionOperationData).forEach(function (key) {
|
|
4039
|
-
delete operationData[key];
|
|
4040
|
-
});
|
|
4041
|
-
internalResolve(resolve, operationData);
|
|
4042
|
-
}, reject);
|
|
4043
|
-
});
|
|
4044
|
-
};
|
|
4425
|
+
_proto._container = function _container(resultCallback) {
|
|
4426
|
+
var suffix = '';
|
|
4045
4427
|
|
|
4046
|
-
|
|
4047
|
-
|
|
4428
|
+
if (this._player.getProvider().name !== 'html5') {
|
|
4429
|
+
suffix = '_wrapper';
|
|
4430
|
+
}
|
|
4048
4431
|
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4432
|
+
var container = $("#" + this._videoElementId + suffix);
|
|
4433
|
+
resultCallback(container);
|
|
4434
|
+
};
|
|
4435
|
+
|
|
4436
|
+
_proto.toggleplay = function toggleplay() {
|
|
4437
|
+
if (this._paused) {
|
|
4438
|
+
this.start();
|
|
4053
4439
|
} else {
|
|
4054
|
-
|
|
4055
|
-
delete context.loopLength;
|
|
4056
|
-
delete context.startIndex;
|
|
4057
|
-
delete context.newIndex;
|
|
4440
|
+
this.pause();
|
|
4058
4441
|
}
|
|
4059
|
-
}
|
|
4060
|
-
delete context.skipNextOperation;
|
|
4061
|
-
}
|
|
4062
|
-
|
|
4063
|
-
return operationData;
|
|
4064
|
-
};
|
|
4442
|
+
};
|
|
4065
4443
|
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
controllerExtension = operationData.controllerExtension;
|
|
4069
|
-
operationData.controllerInstance = Object.assign(controllerInstance, controllerExtension);
|
|
4070
|
-
return operationData;
|
|
4071
|
-
};
|
|
4444
|
+
_proto.start = function start() {
|
|
4445
|
+
this._paused = false;
|
|
4072
4446
|
|
|
4073
|
-
|
|
4074
|
-
var selectedElement = operationData.selectedElement,
|
|
4075
|
-
controllerName = operationData.controllerName;
|
|
4076
|
-
var controllers = getElementControllers(selectedElement);
|
|
4077
|
-
var controller = controllers.find(function (ctrl) {
|
|
4078
|
-
return ctrl.name === controllerName;
|
|
4079
|
-
});
|
|
4447
|
+
this._player.play();
|
|
4080
4448
|
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
}
|
|
4449
|
+
this.eventbus.broadcast(TimelineEventNames.PLAY);
|
|
4450
|
+
};
|
|
4084
4451
|
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
};
|
|
4452
|
+
_proto.stop = function stop() {
|
|
4453
|
+
this._paused = false;
|
|
4088
4454
|
|
|
4089
|
-
|
|
4090
|
-
var systemName = operationData.systemName,
|
|
4091
|
-
_operationData$proper = operationData.propertyName,
|
|
4092
|
-
propertyName = _operationData$proper === void 0 ? 'controllerInstance' : _operationData$proper;
|
|
4093
|
-
operationData[propertyName] = null;
|
|
4455
|
+
this._player.stop();
|
|
4094
4456
|
|
|
4095
|
-
|
|
4096
|
-
operationData[propertyName] = instance;
|
|
4457
|
+
this.eventbus.broadcast(TimelineEventNames.STOP);
|
|
4097
4458
|
};
|
|
4098
4459
|
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
return operationData;
|
|
4102
|
-
};
|
|
4103
|
-
|
|
4104
|
-
function modifyDimensionsByRatio(ratioModifier, dimensions) {
|
|
4105
|
-
//h[ar=8-1]
|
|
4106
|
-
var prefix = ratioModifier.substr(0, 1);
|
|
4107
|
-
var ratio = ratioModifier.substr(ratioModifier.indexOf('[') + 1, ratioModifier.indexOf(']') - ratioModifier.indexOf('[') - 1);
|
|
4108
|
-
var ratios = ratio.split('=')[1].split('-');
|
|
4460
|
+
_proto.pause = function pause() {
|
|
4461
|
+
this._paused = true;
|
|
4109
4462
|
|
|
4110
|
-
|
|
4111
|
-
dimensions.height = dimensions.width / +ratios[0] * +ratios[1];
|
|
4112
|
-
} else if (prefix === 'w') {
|
|
4113
|
-
dimensions.width = dimensions.height / +ratios[1] * +ratios[0];
|
|
4114
|
-
}
|
|
4115
|
-
}
|
|
4463
|
+
this._player.pause();
|
|
4116
4464
|
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
var suffix = modifier.substr(modifier.length - 1, 1);
|
|
4465
|
+
this.eventbus.broadcast(TimelineEventNames.PAUSE);
|
|
4466
|
+
};
|
|
4120
4467
|
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
}
|
|
4468
|
+
_proto.seek = function seek(position) {
|
|
4469
|
+
var currentPosition = this._player.getPosition();
|
|
4124
4470
|
|
|
4125
|
-
|
|
4471
|
+
this._player.seek(position);
|
|
4126
4472
|
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
suffix = modifier.substr(modifier.length - endIdx, 1);
|
|
4473
|
+
this.eventbus.broadcast(TimelineEventNames.SEEK, [position, currentPosition, this._player.getDuration()]);
|
|
4474
|
+
};
|
|
4130
4475
|
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4476
|
+
_proto.resize = function resize(width, height) {
|
|
4477
|
+
this._player.resize(width, height);
|
|
4478
|
+
|
|
4479
|
+
this.eventbus.broadcast(TimelineEventNames.RESIZE, [width, height]);
|
|
4480
|
+
};
|
|
4481
|
+
|
|
4482
|
+
_proto.duration = function duration(resultCallback) {
|
|
4483
|
+
resultCallback(Math.floor(this.getDuration()));
|
|
4484
|
+
};
|
|
4485
|
+
|
|
4486
|
+
_proto.playlistItem = function playlistItem(uri) {
|
|
4487
|
+
var index = this._playlist.findIndex(function (item) {
|
|
4488
|
+
return item.file === uri;
|
|
4489
|
+
});
|
|
4490
|
+
|
|
4491
|
+
if (index > -1) {
|
|
4492
|
+
this._player.playlistItem(index);
|
|
4134
4493
|
}
|
|
4135
|
-
}
|
|
4494
|
+
};
|
|
4136
4495
|
|
|
4137
|
-
|
|
4138
|
-
|
|
4496
|
+
_proto.getPosition = function getPosition() {
|
|
4497
|
+
return this._player.getPosition();
|
|
4498
|
+
};
|
|
4139
4499
|
|
|
4140
|
-
function
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
switch (suffix) {
|
|
4144
|
-
case 'h':
|
|
4145
|
-
dimensions.height += heightModifier;
|
|
4146
|
-
break;
|
|
4500
|
+
_proto.getPlaylistIndex = function getPlaylistIndex() {
|
|
4501
|
+
return this._player.getPlaylistIndex();
|
|
4502
|
+
};
|
|
4147
4503
|
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4504
|
+
_proto.getState = function getState() {
|
|
4505
|
+
return this._player.getState();
|
|
4506
|
+
};
|
|
4151
4507
|
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
}
|
|
4508
|
+
_proto.getDuration = function getDuration() {
|
|
4509
|
+
return this._player.getDuration();
|
|
4510
|
+
};
|
|
4156
4511
|
|
|
4157
|
-
|
|
4512
|
+
_proto.getMute = function getMute() {
|
|
4513
|
+
return this._player.getMute();
|
|
4514
|
+
};
|
|
4158
4515
|
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
dimensions.height -= heightModifier;
|
|
4163
|
-
break;
|
|
4516
|
+
_proto.getVolume = function getVolume() {
|
|
4517
|
+
return this._player.getVolume();
|
|
4518
|
+
};
|
|
4164
4519
|
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4520
|
+
_proto.setMute = function setMute(state) {
|
|
4521
|
+
this._player.setMute(state);
|
|
4522
|
+
};
|
|
4168
4523
|
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
}
|
|
4524
|
+
_proto.setVolume = function setVolume(volume) {
|
|
4525
|
+
this._player.setVolume(volume);
|
|
4526
|
+
};
|
|
4173
4527
|
|
|
4174
|
-
|
|
4528
|
+
return JwPlayerTimelineProvider;
|
|
4529
|
+
}();
|
|
4175
4530
|
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4531
|
+
var RequestAnimationFrameTimelineProvider = /*#__PURE__*/function () {
|
|
4532
|
+
function RequestAnimationFrameTimelineProvider(eventbus, config) {
|
|
4533
|
+
this.eventbus = void 0;
|
|
4534
|
+
this.config = void 0;
|
|
4535
|
+
this._requestID = -1;
|
|
4536
|
+
this._last = 0;
|
|
4537
|
+
this._currentPosition = 0;
|
|
4538
|
+
this._updateBound = this._update.bind(this);
|
|
4539
|
+
this._eventbusListeners = [];
|
|
4540
|
+
this._firstFrame = true;
|
|
4541
|
+
this._currentPlaylistItem = void 0;
|
|
4542
|
+
this._granularity = 1000;
|
|
4543
|
+
this._playlist = void 0;
|
|
4544
|
+
this._containerElement = void 0;
|
|
4545
|
+
this.playState = 'stopped';
|
|
4546
|
+
this.loop = false;
|
|
4547
|
+
this.eventbus = eventbus;
|
|
4548
|
+
this.config = config;
|
|
4549
|
+
this.eventbus = eventbus;
|
|
4550
|
+
this.config = config;
|
|
4551
|
+
this._playlist = this._extractPlaylist(config);
|
|
4552
|
+
this._currentPlaylistItem = this._playlist[0];
|
|
4553
|
+
}
|
|
4181
4554
|
|
|
4182
|
-
|
|
4183
|
-
dimensions.width /= widthModifier;
|
|
4184
|
-
break;
|
|
4555
|
+
var _proto = RequestAnimationFrameTimelineProvider.prototype;
|
|
4185
4556
|
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4557
|
+
_proto._extractPlaylist = function _extractPlaylist(configuration) {
|
|
4558
|
+
var playlist = configuration.timelines.filter(function (timeline) {
|
|
4559
|
+
return timeline.type === 'animation';
|
|
4560
|
+
});
|
|
4561
|
+
return playlist;
|
|
4562
|
+
};
|
|
4190
4563
|
|
|
4191
|
-
|
|
4564
|
+
_proto.playlistItem = function playlistItem(uri) {
|
|
4565
|
+
if (uri === null || !uri.length || this._playlist.length === 0) {
|
|
4566
|
+
return;
|
|
4567
|
+
}
|
|
4192
4568
|
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
dimensions.height *= heightModifier;
|
|
4197
|
-
break;
|
|
4569
|
+
var item = this._playlist.find(function (item) {
|
|
4570
|
+
return item.uri === uri;
|
|
4571
|
+
});
|
|
4198
4572
|
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4573
|
+
if (!item) {
|
|
4574
|
+
throw new Error("Unknown playlist uri: " + uri);
|
|
4575
|
+
}
|
|
4202
4576
|
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
}
|
|
4577
|
+
this._currentPlaylistItem = item;
|
|
4578
|
+
this._firstFrame = true;
|
|
4579
|
+
};
|
|
4207
4580
|
|
|
4208
|
-
|
|
4581
|
+
_proto._addEventListeners = function _addEventListeners() {
|
|
4582
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.PLAY_TOGGLE_REQUEST, this.toggleplay.bind(this)));
|
|
4209
4583
|
|
|
4210
|
-
|
|
4211
|
-
console.error("Unknown operator found: " + prefix);
|
|
4212
|
-
}
|
|
4584
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.PLAY_REQUEST, this.start.bind(this)));
|
|
4213
4585
|
|
|
4214
|
-
|
|
4215
|
-
}
|
|
4586
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.STOP_REQUEST, this.stop.bind(this)));
|
|
4216
4587
|
|
|
4217
|
-
|
|
4218
|
-
var ratioModifier = null;
|
|
4588
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.PAUSE_REQUEST, this.pause.bind(this)));
|
|
4219
4589
|
|
|
4220
|
-
|
|
4221
|
-
var _modifier$split = modifier.split('|');
|
|
4590
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.SEEK_REQUEST, this.seek.bind(this)));
|
|
4222
4591
|
|
|
4223
|
-
|
|
4224
|
-
ratioModifier = _modifier$split[1];
|
|
4225
|
-
}
|
|
4592
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.RESIZE_REQUEST, this._resize.bind(this)));
|
|
4226
4593
|
|
|
4227
|
-
|
|
4594
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.CONTAINER_REQUEST, this._container.bind(this)));
|
|
4228
4595
|
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
endIdx = _getModifierSuffix[1],
|
|
4232
|
-
isPercent = _getModifierSuffix[2];
|
|
4596
|
+
this._eventbusListeners.push(this.eventbus.on(TimelineEventNames.DURATION_REQUEST, this.requestDurationHandler.bind(this)));
|
|
4597
|
+
};
|
|
4233
4598
|
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4599
|
+
_proto._update = function _update(now) {
|
|
4600
|
+
if (this.playState !== 'running') {
|
|
4601
|
+
return;
|
|
4602
|
+
}
|
|
4237
4603
|
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4604
|
+
if (!this._last || now - this._last >= this._granularity) {
|
|
4605
|
+
if (!this._last && this._firstFrame) {
|
|
4606
|
+
this._firstFrame = false;
|
|
4607
|
+
this.eventbus.broadcast(TimelineEventNames.FIRST_FRAME);
|
|
4608
|
+
}
|
|
4242
4609
|
|
|
4243
|
-
|
|
4610
|
+
this._last = now;
|
|
4611
|
+
this._currentPosition++;
|
|
4244
4612
|
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
}
|
|
4613
|
+
if (this._currentPosition > this._currentPlaylistItem.duration) {
|
|
4614
|
+
if (this.loop) {
|
|
4615
|
+
this._reset();
|
|
4616
|
+
} else {
|
|
4617
|
+
this.stop();
|
|
4618
|
+
this.eventbus.broadcast(TimelineEventNames.COMPLETE);
|
|
4619
|
+
return;
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4249
4622
|
|
|
4250
|
-
|
|
4251
|
-
|
|
4623
|
+
this.eventbus.broadcast(TimelineEventNames.TIME, [{
|
|
4624
|
+
position: this._currentPosition
|
|
4625
|
+
}]);
|
|
4626
|
+
this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [{
|
|
4627
|
+
position: this._currentPosition,
|
|
4628
|
+
duration: this._currentPlaylistItem.duration
|
|
4629
|
+
}]);
|
|
4630
|
+
}
|
|
4252
4631
|
|
|
4253
|
-
|
|
4254
|
-
modifier = operationData.modifier;
|
|
4255
|
-
var dimensions = {
|
|
4256
|
-
width: (_selectedElement$inne = selectedElement.innerWidth()) != null ? _selectedElement$inne : 0,
|
|
4257
|
-
height: (_selectedElement$inne2 = selectedElement.innerHeight()) != null ? _selectedElement$inne2 : 0
|
|
4632
|
+
this._requestID = requestAnimationFrame(this._updateBound);
|
|
4258
4633
|
};
|
|
4259
4634
|
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4635
|
+
_proto._start = function _start() {
|
|
4636
|
+
if (this._requestID && this.playState === 'running') {
|
|
4637
|
+
return;
|
|
4638
|
+
}
|
|
4263
4639
|
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
}
|
|
4640
|
+
this.playState = 'running';
|
|
4641
|
+
this._requestID = requestAnimationFrame(this._updateBound);
|
|
4642
|
+
};
|
|
4267
4643
|
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
};
|
|
4644
|
+
_proto._reset = function _reset() {
|
|
4645
|
+
this._cancelAnimationFrame();
|
|
4271
4646
|
|
|
4272
|
-
|
|
4273
|
-
|
|
4647
|
+
this._last = 0;
|
|
4648
|
+
this._currentPosition = 0;
|
|
4649
|
+
};
|
|
4274
4650
|
|
|
4275
|
-
|
|
4276
|
-
|
|
4651
|
+
_proto._resize = function _resize() {
|
|
4652
|
+
console.error('Not implemented yet');
|
|
4277
4653
|
};
|
|
4278
4654
|
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
};
|
|
4655
|
+
_proto._container = function _container(callBack) {
|
|
4656
|
+
callBack(this._containerElement);
|
|
4657
|
+
};
|
|
4283
4658
|
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
_operationData$proper = operationData.propertyName,
|
|
4292
|
-
propertyName = _operationData$proper === void 0 ? 'json' : _operationData$proper;
|
|
4293
|
-
|
|
4294
|
-
if (cache && jsonCache[url]) {
|
|
4295
|
-
operationData[propertyName] = jsonCache[url];
|
|
4296
|
-
delete operationData.propertyName;
|
|
4297
|
-
return operationData;
|
|
4298
|
-
}
|
|
4299
|
-
|
|
4300
|
-
return new Promise(function (resolve, reject) {
|
|
4301
|
-
fetch(url).then( /*#__PURE__*/function () {
|
|
4302
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(response) {
|
|
4303
|
-
var json, cacheValue;
|
|
4304
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
4305
|
-
while (1) {
|
|
4306
|
-
switch (_context.prev = _context.next) {
|
|
4307
|
-
case 0:
|
|
4308
|
-
_context.next = 2;
|
|
4309
|
-
return response.json();
|
|
4310
|
-
|
|
4311
|
-
case 2:
|
|
4312
|
-
json = _context.sent;
|
|
4313
|
-
cacheValue = operationData[propertyName] = json;
|
|
4314
|
-
delete operationData.propertyName;
|
|
4315
|
-
addToCache(url, cacheValue);
|
|
4316
|
-
resolve(operationData);
|
|
4317
|
-
|
|
4318
|
-
case 7:
|
|
4319
|
-
case "end":
|
|
4320
|
-
return _context.stop();
|
|
4321
|
-
}
|
|
4322
|
-
}
|
|
4323
|
-
}, _callee);
|
|
4324
|
-
}));
|
|
4325
|
-
|
|
4326
|
-
return function (_x) {
|
|
4327
|
-
return _ref.apply(this, arguments);
|
|
4328
|
-
};
|
|
4329
|
-
}())["catch"](reject);
|
|
4330
|
-
});
|
|
4331
|
-
};
|
|
4332
|
-
|
|
4333
|
-
var log = function log(operationData) {
|
|
4334
|
-
console.group('Operation info');
|
|
4335
|
-
console.dir({
|
|
4336
|
-
context: this
|
|
4337
|
-
});
|
|
4338
|
-
console.dir({
|
|
4339
|
-
operationData: operationData
|
|
4340
|
-
});
|
|
4341
|
-
console.groupEnd();
|
|
4342
|
-
return operationData;
|
|
4343
|
-
};
|
|
4344
|
-
|
|
4345
|
-
var removeClass = function removeClass(operationData) {
|
|
4346
|
-
var selectedElement = operationData.selectedElement,
|
|
4347
|
-
className = operationData.className;
|
|
4348
|
-
selectedElement.removeClass(className);
|
|
4349
|
-
return operationData;
|
|
4350
|
-
};
|
|
4351
|
-
|
|
4352
|
-
var removeControllerFromElement = function removeControllerFromElement(operationData) {
|
|
4353
|
-
var selectedElement = operationData.selectedElement,
|
|
4354
|
-
controllerName = operationData.controllerName;
|
|
4355
|
-
var controllers = getElementControllers(selectedElement);
|
|
4356
|
-
var controller = controllers == null ? void 0 : controllers.find(function (ctrl) {
|
|
4357
|
-
return ctrl.name === controllerName;
|
|
4358
|
-
});
|
|
4359
|
-
|
|
4360
|
-
if (controller) {
|
|
4361
|
-
var idx = controllers.indexOf(controller);
|
|
4362
|
-
controllers.splice(idx, 1);
|
|
4363
|
-
controller.detach(this.eventbus);
|
|
4364
|
-
}
|
|
4365
|
-
|
|
4366
|
-
return operationData;
|
|
4367
|
-
};
|
|
4368
|
-
|
|
4369
|
-
var removeElement = function removeElement(operationData) {
|
|
4370
|
-
var selectedElement = operationData.selectedElement;
|
|
4371
|
-
selectedElement.remove();
|
|
4372
|
-
return operationData;
|
|
4373
|
-
};
|
|
4374
|
-
|
|
4375
|
-
var removePropertiesFromOperationData = function removePropertiesFromOperationData(operationData) {
|
|
4376
|
-
var propertyNames = operationData.propertyNames;
|
|
4377
|
-
propertyNames.forEach(function (name) {
|
|
4378
|
-
delete operationData[name];
|
|
4379
|
-
});
|
|
4380
|
-
delete operationData.propertyNames;
|
|
4381
|
-
return operationData;
|
|
4382
|
-
};
|
|
4383
|
-
|
|
4384
|
-
var reparentElement = function reparentElement(operationData) {
|
|
4385
|
-
var selectedElement = operationData.selectedElement,
|
|
4386
|
-
newParentSelector = operationData.newParentSelector;
|
|
4387
|
-
selectedElement.remove().appendTo(newParentSelector);
|
|
4388
|
-
return operationData;
|
|
4389
|
-
};
|
|
4390
|
-
|
|
4391
|
-
var requestAction = function requestAction(operationData) {
|
|
4392
|
-
var systemName = operationData.systemName;
|
|
4393
|
-
|
|
4394
|
-
var resultCallback = function resultCallback(action) {
|
|
4395
|
-
operationData.actionInstance = action;
|
|
4659
|
+
_proto._cancelAnimationFrame = function _cancelAnimationFrame() {
|
|
4660
|
+
if (this._requestID) {
|
|
4661
|
+
cancelAnimationFrame(this._requestID);
|
|
4662
|
+
this._requestID = -1;
|
|
4663
|
+
this._last = 0;
|
|
4664
|
+
this._currentPosition = 0;
|
|
4665
|
+
}
|
|
4396
4666
|
};
|
|
4397
4667
|
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
};
|
|
4401
|
-
|
|
4402
|
-
var resizeAction = function resizeAction(operationData) {
|
|
4403
|
-
var _operationData = operationData,
|
|
4404
|
-
actionInstance = _operationData.actionInstance,
|
|
4405
|
-
actionOperationData = _operationData.actionOperationData;
|
|
4406
|
-
operationData = mergeOperationData(operationData, actionOperationData);
|
|
4407
|
-
|
|
4408
|
-
if (actionInstance.resize) {
|
|
4409
|
-
return actionInstance.resize(operationData);
|
|
4410
|
-
}
|
|
4411
|
-
|
|
4412
|
-
return operationData;
|
|
4413
|
-
};
|
|
4414
|
-
|
|
4415
|
-
function findElementBySelector(root, selector, operationData, propertyName) {
|
|
4416
|
-
var element = root.find(selector);
|
|
4417
|
-
|
|
4418
|
-
if (!element.length) {
|
|
4419
|
-
console.warn("selector '" + selector + "' wasn't found!");
|
|
4420
|
-
}
|
|
4421
|
-
|
|
4422
|
-
operationData[propertyName] = element;
|
|
4423
|
-
|
|
4424
|
-
if (operationData.hasOwnProperty('propertyName')) {
|
|
4425
|
-
delete operationData.propertyName;
|
|
4426
|
-
}
|
|
4427
|
-
}
|
|
4428
|
-
|
|
4429
|
-
var selectElement = function selectElement(operationData) {
|
|
4430
|
-
var selector = operationData.selector,
|
|
4431
|
-
_operationData$proper = operationData.propertyName,
|
|
4432
|
-
propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper,
|
|
4433
|
-
_operationData$useSel = operationData.useSelectedElementAsRoot,
|
|
4434
|
-
useSelectedElementAsRoot = _operationData$useSel === void 0 ? false : _operationData$useSel;
|
|
4668
|
+
_proto.init = function init() {
|
|
4669
|
+
this._addEventListeners();
|
|
4435
4670
|
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
}
|
|
4671
|
+
this._currentPlaylistItem = this._playlist[0];
|
|
4672
|
+
this._containerElement = $(this._currentPlaylistItem.selector);
|
|
4439
4673
|
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
return operationData;
|
|
4444
|
-
}
|
|
4674
|
+
if (!this._containerElement.length) {
|
|
4675
|
+
throw new Error("timeline selector '" + this._currentPlaylistItem.selector + "' not found");
|
|
4676
|
+
}
|
|
4445
4677
|
|
|
4446
|
-
|
|
4447
|
-
|
|
4678
|
+
var promise = new Promise(function (resolve) {
|
|
4679
|
+
resolve();
|
|
4680
|
+
});
|
|
4681
|
+
return promise;
|
|
4448
4682
|
};
|
|
4449
4683
|
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
};
|
|
4453
|
-
|
|
4454
|
-
var setElementAttributes = function setElementAttributes(operationData) {
|
|
4455
|
-
var attributes = operationData.attributes,
|
|
4456
|
-
selectedElement = operationData.selectedElement;
|
|
4457
|
-
Object.keys(attributes).forEach(function (attrName) {
|
|
4458
|
-
selectedElement.attr(attrName, attributes[attrName]);
|
|
4459
|
-
});
|
|
4460
|
-
return operationData;
|
|
4461
|
-
};
|
|
4462
|
-
|
|
4463
|
-
var setElementContent = function setElementContent(operationData) {
|
|
4464
|
-
var insertionType = operationData.insertionType,
|
|
4465
|
-
selectedElement = operationData.selectedElement,
|
|
4466
|
-
template = operationData.template;
|
|
4467
|
-
|
|
4468
|
-
switch (true) {
|
|
4469
|
-
case insertionType === undefined:
|
|
4470
|
-
selectedElement.html(template);
|
|
4471
|
-
break;
|
|
4472
|
-
|
|
4473
|
-
case insertionType === 'append':
|
|
4474
|
-
selectedElement.append(template);
|
|
4475
|
-
break;
|
|
4476
|
-
|
|
4477
|
-
case insertionType === 'prepend':
|
|
4478
|
-
selectedElement.prepend(template);
|
|
4479
|
-
break;
|
|
4480
|
-
}
|
|
4684
|
+
_proto.destroy = function destroy() {
|
|
4685
|
+
this.stop();
|
|
4481
4686
|
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
};
|
|
4687
|
+
this._eventbusListeners.forEach(function (func) {
|
|
4688
|
+
return func();
|
|
4689
|
+
});
|
|
4485
4690
|
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
override = _operationData.override,
|
|
4489
|
-
properties = _operationData.properties;
|
|
4490
|
-
var resolvedProperties = resolvePropertyValues(operationData, properties);
|
|
4491
|
-
delete operationData.properties;
|
|
4691
|
+
this._containerElement = undefined;
|
|
4692
|
+
};
|
|
4492
4693
|
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4694
|
+
_proto.toggleplay = function toggleplay() {
|
|
4695
|
+
if (this.playState !== 'running') {
|
|
4696
|
+
this.start();
|
|
4697
|
+
} else {
|
|
4698
|
+
this.pause();
|
|
4699
|
+
}
|
|
4700
|
+
};
|
|
4498
4701
|
|
|
4499
|
-
|
|
4500
|
-
|
|
4702
|
+
_proto.start = function start() {
|
|
4703
|
+
this._start();
|
|
4501
4704
|
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
propertyName = _operationData$proper === void 0 ? 'selectedElement' : _operationData$proper;
|
|
4505
|
-
var properties = resolvePropertyValues(operationData, operationData.properties);
|
|
4506
|
-
operationData[propertyName].css(properties);
|
|
4507
|
-
delete operationData.propertyName;
|
|
4508
|
-
return operationData;
|
|
4509
|
-
};
|
|
4705
|
+
this.eventbus.broadcast(TimelineEventNames.PLAY);
|
|
4706
|
+
};
|
|
4510
4707
|
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
actionInstance = _operationData.actionInstance,
|
|
4514
|
-
actionOperationData = _operationData.actionOperationData;
|
|
4515
|
-
delete operationData.actionOperationData;
|
|
4516
|
-
return new Promise(function (resolve, reject) {
|
|
4517
|
-
operationData = mergeOperationData(operationData, actionOperationData);
|
|
4518
|
-
actionInstance.start(operationData).then(function () {
|
|
4519
|
-
Object.keys(actionOperationData).forEach(function (key) {
|
|
4520
|
-
delete operationData[key];
|
|
4521
|
-
});
|
|
4522
|
-
internalResolve(resolve, operationData);
|
|
4523
|
-
}, reject);
|
|
4524
|
-
});
|
|
4525
|
-
};
|
|
4708
|
+
_proto.stop = function stop() {
|
|
4709
|
+
this._cancelAnimationFrame();
|
|
4526
4710
|
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
_operationData$proper = operationData.propertyName,
|
|
4531
|
-
propertyName = _operationData$proper === void 0 ? 'currentItem' : _operationData$proper;
|
|
4711
|
+
this.playState = 'stopped';
|
|
4712
|
+
this.eventbus.broadcast(TimelineEventNames.STOP);
|
|
4713
|
+
};
|
|
4532
4714
|
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4715
|
+
_proto.pause = function pause() {
|
|
4716
|
+
this.playState = 'paused';
|
|
4717
|
+
this.eventbus.broadcast(TimelineEventNames.PAUSE);
|
|
4718
|
+
};
|
|
4536
4719
|
|
|
4537
|
-
|
|
4538
|
-
if (
|
|
4539
|
-
|
|
4540
|
-
context.loopLength = collection.length - 1;
|
|
4541
|
-
context.startIndex = context.currentIndex;
|
|
4542
|
-
} else {
|
|
4543
|
-
context.skipNextOperation = true;
|
|
4720
|
+
_proto.seek = function seek(position) {
|
|
4721
|
+
if (position < 0 || position > this._currentPlaylistItem.duration) {
|
|
4722
|
+
return;
|
|
4544
4723
|
}
|
|
4545
|
-
}
|
|
4546
|
-
|
|
4547
|
-
if (collection != null && collection.length && context.loopIndex !== undefined) {
|
|
4548
|
-
operationData[propertyName] = collection[context.loopIndex];
|
|
4549
|
-
}
|
|
4550
|
-
|
|
4551
|
-
delete operationData.propertyName;
|
|
4552
|
-
return operationData;
|
|
4553
|
-
};
|
|
4554
4724
|
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
};
|
|
4725
|
+
this.eventbus.broadcast(TimelineEventNames.SEEK, [position, this._currentPosition, this.getDuration()]);
|
|
4726
|
+
this._currentPosition = position;
|
|
4727
|
+
this.eventbus.broadcast(TimelineEventNames.SEEKED, [this._currentPosition, this.getDuration()]);
|
|
4728
|
+
this.eventbus.broadcast(TimelineEventNames.TIME, [{
|
|
4729
|
+
position: this.getPosition()
|
|
4730
|
+
}]);
|
|
4731
|
+
this.eventbus.broadcast(TimelineEventNames.POSITION_UPDATE, [{
|
|
4732
|
+
position: this._currentPosition,
|
|
4733
|
+
duration: this._currentPlaylistItem.duration
|
|
4734
|
+
}]);
|
|
4735
|
+
};
|
|
4561
4736
|
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
};
|
|
4737
|
+
_proto.getPosition = function getPosition() {
|
|
4738
|
+
return this._currentPosition;
|
|
4739
|
+
};
|
|
4566
4740
|
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
setTimeout(function () {
|
|
4571
|
-
internalResolve(resolve, operationData);
|
|
4572
|
-
}, milliseconds);
|
|
4573
|
-
});
|
|
4574
|
-
};
|
|
4741
|
+
_proto.getDuration = function getDuration() {
|
|
4742
|
+
return this._currentPlaylistItem.duration;
|
|
4743
|
+
};
|
|
4575
4744
|
|
|
4745
|
+
_proto.requestDurationHandler = function requestDurationHandler(callBack) {
|
|
4746
|
+
callBack(this._currentPlaylistItem.duration);
|
|
4747
|
+
};
|
|
4576
4748
|
|
|
4749
|
+
return RequestAnimationFrameTimelineProvider;
|
|
4750
|
+
}();
|
|
4577
4751
|
|
|
4578
|
-
var
|
|
4752
|
+
var prvdrs = {
|
|
4579
4753
|
__proto__: null,
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
animate: animate,
|
|
4583
|
-
animateWithClass: animateWithClass,
|
|
4584
|
-
broadcastEvent: broadcastEvent,
|
|
4585
|
-
clearElement: clearElement,
|
|
4586
|
-
clearOperationData: clearOperationData,
|
|
4587
|
-
createElement: createElement,
|
|
4588
|
-
customFunction: customFunction,
|
|
4589
|
-
endAction: endAction,
|
|
4590
|
-
endLoop: endLoop,
|
|
4591
|
-
extendController: extendController,
|
|
4592
|
-
getControllerFromElement: getControllerFromElement,
|
|
4593
|
-
getControllerInstance: getControllerInstance,
|
|
4594
|
-
getElementDimensions: getElementDimensions,
|
|
4595
|
-
getImport: getImport,
|
|
4596
|
-
loadJSON: loadJSON,
|
|
4597
|
-
log: log,
|
|
4598
|
-
removeClass: removeClass,
|
|
4599
|
-
removeControllerFromElement: removeControllerFromElement,
|
|
4600
|
-
removeElement: removeElement,
|
|
4601
|
-
removePropertiesFromOperationData: removePropertiesFromOperationData,
|
|
4602
|
-
reparentElement: reparentElement,
|
|
4603
|
-
requestAction: requestAction,
|
|
4604
|
-
resizeAction: resizeAction,
|
|
4605
|
-
selectElement: selectElement,
|
|
4606
|
-
setElementAttributes: setElementAttributes,
|
|
4607
|
-
setElementContent: setElementContent,
|
|
4608
|
-
setOperationData: setOperationData,
|
|
4609
|
-
setStyle: setStyle,
|
|
4610
|
-
startAction: startAction,
|
|
4611
|
-
startLoop: startLoop,
|
|
4612
|
-
toggleClass: toggleClass,
|
|
4613
|
-
toggleElement: toggleElement,
|
|
4614
|
-
wait: wait
|
|
4754
|
+
JwPlayerTimelineProvider: JwPlayerTimelineProvider,
|
|
4755
|
+
RequestAnimationFrameTimelineProvider: RequestAnimationFrameTimelineProvider
|
|
4615
4756
|
};
|
|
4616
4757
|
|
|
4617
4758
|
var operations = ops;
|
|
@@ -4648,5 +4789,5 @@ var WebpackResourceImporter = /*#__PURE__*/function () {
|
|
|
4648
4789
|
return WebpackResourceImporter;
|
|
4649
4790
|
}();
|
|
4650
4791
|
|
|
4651
|
-
export { Action, ActionRegistryEventbusListener, ConfigurationResolver, EligiusEngine, EndableAction, EngineFactory, EventListenerController, Eventbus, JwPlayerTimelineProvider, LabelController, LanguageManager, LottieController,
|
|
4792
|
+
export { Action, ActionRegistryEventbusListener, ConfigurationResolver, EligiusEngine, EndableAction, EngineFactory, EventListenerController, Eventbus, JwPlayerTimelineProvider, LabelController, LanguageManager, LottieController, NavigationController, ProgressbarController, RequestAnimationFrameTimelineProvider, RequestVideoUriInterceptor, RoutingController, SubtitlesController, TimelineAction, TimelineEventNames, WebpackResourceImporter, addClass, addControllerToElement, animate, animateWithClass, broadcastEvent, clearElement, clearOperationData, createElement, customFunction, endAction, endLoop, extendController, getControllerFromElement, getControllerInstance, getElementDimensions, getImport, loadJSON, log, removeClass, removeControllerFromElement, removeElement, removePropertiesFromOperationData, reparentElement, requestAction, resizeAction, selectElement, setElementAttributes, setElementContent, setOperationData, setStyle, startAction, startLoop, toggleClass, toggleElement, wait };
|
|
4652
4793
|
//# sourceMappingURL=eligius.esm.js.map
|