@loaders.gl/video 4.0.0-alpha.5 → 4.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +2 -2
- package/dist/dist.min.js +23 -21
- package/dist/es5/bundle.js +6 -0
- package/dist/es5/bundle.js.map +1 -0
- package/dist/es5/gif-builder.js +200 -0
- package/dist/es5/gif-builder.js.map +1 -0
- package/dist/es5/index.js +21 -0
- package/dist/es5/index.js.map +1 -0
- package/dist/es5/lib/gifshot/gifshot-loader.js +67 -0
- package/dist/es5/lib/gifshot/gifshot-loader.js.map +1 -0
- package/dist/es5/lib/gifshot/gifshot.js +1924 -0
- package/dist/es5/lib/gifshot/gifshot.js.map +1 -0
- package/dist/es5/lib/parsers/parse-video.js +31 -0
- package/dist/es5/lib/parsers/parse-video.js.map +1 -0
- package/dist/es5/lib/utils/assert.js +12 -0
- package/dist/es5/lib/utils/assert.js.map +1 -0
- package/dist/es5/video-loader.js +28 -0
- package/dist/es5/video-loader.js.map +1 -0
- package/dist/esm/bundle.js +4 -0
- package/dist/esm/bundle.js.map +1 -0
- package/dist/esm/gif-builder.js +106 -0
- package/dist/esm/gif-builder.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/gifshot/gifshot-loader.js +17 -0
- package/dist/esm/lib/gifshot/gifshot-loader.js.map +1 -0
- package/dist/esm/lib/gifshot/gifshot.js +1915 -0
- package/dist/esm/lib/gifshot/gifshot.js.map +1 -0
- package/dist/esm/lib/parsers/parse-video.js +7 -0
- package/dist/esm/lib/parsers/parse-video.js.map +1 -0
- package/dist/esm/lib/utils/assert.js +6 -0
- package/dist/esm/lib/utils/assert.js.map +1 -0
- package/dist/esm/video-loader.js +19 -0
- package/dist/esm/video-loader.js.map +1 -0
- package/dist/gif-builder.js +136 -114
- package/dist/index.js +10 -3
- package/dist/lib/gifshot/gifshot-loader.js +18 -15
- package/dist/lib/gifshot/gifshot.d.ts.map +1 -1
- package/dist/lib/gifshot/gifshot.js +2344 -2089
- package/dist/lib/parsers/parse-video.js +12 -6
- package/dist/lib/utils/assert.js +8 -5
- package/dist/video-loader.d.ts +1 -1
- package/dist/video-loader.d.ts.map +1 -1
- package/dist/video-loader.js +22 -14
- package/package.json +6 -6
- package/src/lib/gifshot/gifshot.ts +33 -32
- package/dist/bundle.js.map +0 -1
- package/dist/gif-builder.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/gifshot/gifshot-loader.js.map +0 -1
- package/dist/lib/gifshot/gifshot.js.map +0 -1
- package/dist/lib/parsers/parse-video.js.map +0 -1
- package/dist/lib/utils/assert.js.map +0 -1
- package/dist/lib/utils/globals.d.ts +0 -10
- package/dist/lib/utils/globals.d.ts.map +0 -1
- package/dist/lib/utils/globals.js +0 -16
- package/dist/lib/utils/globals.js.map +0 -1
- package/dist/video-loader.js.map +0 -1
- package/src/lib/utils/globals.ts +0 -25
package/dist/bundle.js
CHANGED
package/dist/dist.min.js
CHANGED
|
@@ -479,7 +479,7 @@
|
|
|
479
479
|
function workerCode() {
|
|
480
480
|
const self = this;
|
|
481
481
|
try {
|
|
482
|
-
|
|
482
|
+
globalThis.onmessage = function(ev) {
|
|
483
483
|
const data = ev.data || {};
|
|
484
484
|
let response;
|
|
485
485
|
if (data.gifshot) {
|
|
@@ -763,7 +763,7 @@
|
|
|
763
763
|
let imagesLength = obj.imagesLength;
|
|
764
764
|
const skipObj = {
|
|
765
765
|
getUserMedia: true,
|
|
766
|
-
"
|
|
766
|
+
"globalThis.URL": true
|
|
767
767
|
};
|
|
768
768
|
const errorObj = error.validate(skipObj);
|
|
769
769
|
const loadedImages = [];
|
|
@@ -894,7 +894,7 @@
|
|
|
894
894
|
const options = obj.options;
|
|
895
895
|
const skipObj = {
|
|
896
896
|
getUserMedia: true,
|
|
897
|
-
"
|
|
897
|
+
"globalThis.URL": true
|
|
898
898
|
};
|
|
899
899
|
const errorObj = error.validate(skipObj);
|
|
900
900
|
const loadedImages = 0;
|
|
@@ -1017,12 +1017,14 @@
|
|
|
1017
1017
|
var init_gifshot = __esm({
|
|
1018
1018
|
"src/lib/gifshot/gifshot.ts"() {
|
|
1019
1019
|
utils = {
|
|
1020
|
-
URL:
|
|
1020
|
+
URL: globalThis.URL || globalThis.webkitURL || globalThis.mozURL || globalThis.msURL,
|
|
1021
1021
|
getUserMedia: function() {
|
|
1022
|
-
|
|
1023
|
-
|
|
1022
|
+
if (!globalThis.navigator)
|
|
1023
|
+
return globalThis.navigator;
|
|
1024
|
+
const getUserMedia = globalThis.navigator.getUserMedia || globalThis.navigator.webkitGetUserMedia || globalThis.navigator.mozGetUserMedia || globalThis.navigator.msGetUserMedia;
|
|
1025
|
+
return getUserMedia ? getUserMedia.bind(globalThis.navigator) : getUserMedia;
|
|
1024
1026
|
}(),
|
|
1025
|
-
requestAnimFrame:
|
|
1027
|
+
requestAnimFrame: globalThis.requestAnimationFrame || globalThis.webkitRequestAnimationFrame || globalThis.mozRequestAnimationFrame || globalThis.oRequestAnimationFrame || globalThis.msRequestAnimationFrame,
|
|
1026
1028
|
requestTimeout: function requestTimeout(callback, delay) {
|
|
1027
1029
|
callback = callback || utils.noop;
|
|
1028
1030
|
delay = delay || 0;
|
|
@@ -1040,9 +1042,9 @@
|
|
|
1040
1042
|
handle.value = requestAnimFrame(loop);
|
|
1041
1043
|
return handle;
|
|
1042
1044
|
},
|
|
1043
|
-
Blob:
|
|
1045
|
+
Blob: globalThis.Blob || globalThis.BlobBuilder || globalThis.WebKitBlobBuilder || globalThis.MozBlobBuilder || globalThis.MSBlobBuilder,
|
|
1044
1046
|
btoa: function() {
|
|
1045
|
-
const btoa =
|
|
1047
|
+
const btoa = globalThis.btoa || function(input) {
|
|
1046
1048
|
let output = "";
|
|
1047
1049
|
let i = 0;
|
|
1048
1050
|
const l = input.length;
|
|
@@ -1071,7 +1073,7 @@
|
|
|
1071
1073
|
}
|
|
1072
1074
|
return output;
|
|
1073
1075
|
};
|
|
1074
|
-
return btoa ? btoa.bind(
|
|
1076
|
+
return btoa ? btoa.bind(globalThis) : utils.noop;
|
|
1075
1077
|
}(),
|
|
1076
1078
|
isObject: function isObject(obj) {
|
|
1077
1079
|
return obj && Object.prototype.toString.call(obj) === "[object Object]";
|
|
@@ -1097,16 +1099,16 @@
|
|
|
1097
1099
|
return el && el.getContext && el.getContext("2d");
|
|
1098
1100
|
},
|
|
1099
1101
|
webworkers: function webworkers() {
|
|
1100
|
-
return
|
|
1102
|
+
return globalThis.Worker;
|
|
1101
1103
|
},
|
|
1102
1104
|
blob: function blob() {
|
|
1103
1105
|
return utils.Blob;
|
|
1104
1106
|
},
|
|
1105
1107
|
Uint8Array: function Uint8Array2() {
|
|
1106
|
-
return
|
|
1108
|
+
return globalThis.Uint8Array;
|
|
1107
1109
|
},
|
|
1108
1110
|
Uint32Array: function Uint32Array2() {
|
|
1109
|
-
return
|
|
1111
|
+
return globalThis.Uint32Array;
|
|
1110
1112
|
},
|
|
1111
1113
|
videoCodecs: function() {
|
|
1112
1114
|
const testEl = document.createElement("video");
|
|
@@ -1281,23 +1283,23 @@
|
|
|
1281
1283
|
},
|
|
1282
1284
|
{
|
|
1283
1285
|
condition: utils.isFunction(utils.URL),
|
|
1284
|
-
errorCode: "
|
|
1285
|
-
errorMsg: "The
|
|
1286
|
+
errorCode: "globalThis.URL",
|
|
1287
|
+
errorMsg: "The globalThis.URL API is not supported in your browser"
|
|
1286
1288
|
},
|
|
1287
1289
|
{
|
|
1288
1290
|
condition: utils.isSupported.blob(),
|
|
1289
|
-
errorCode: "
|
|
1290
|
-
errorMsg: "The
|
|
1291
|
+
errorCode: "globalThis.Blob",
|
|
1292
|
+
errorMsg: "The globalThis.Blob File API is not supported in your browser"
|
|
1291
1293
|
},
|
|
1292
1294
|
{
|
|
1293
1295
|
condition: utils.isSupported.Uint8Array(),
|
|
1294
|
-
errorCode: "
|
|
1295
|
-
errorMsg: "The
|
|
1296
|
+
errorCode: "globalThis.Uint8Array",
|
|
1297
|
+
errorMsg: "The globalThis.Uint8Array function constructor is not supported in your browser"
|
|
1296
1298
|
},
|
|
1297
1299
|
{
|
|
1298
1300
|
condition: utils.isSupported.Uint32Array(),
|
|
1299
|
-
errorCode: "
|
|
1300
|
-
errorMsg: "The
|
|
1301
|
+
errorCode: "globalThis.Uint32Array",
|
|
1302
|
+
errorMsg: "The globalThis.Uint32Array function constructor is not supported in your browser"
|
|
1301
1303
|
}
|
|
1302
1304
|
],
|
|
1303
1305
|
messages: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"sources":["../../src/bundle.ts"],"sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"mappings":";;AACA,IAAMA,aAAa,GAAGC,OAAO,CAAC,SAAS,CAAC;AACxCC,UAAU,CAACC,OAAO,GAAGD,UAAU,CAACC,OAAO,IAAI,CAAC,CAAC;AAC7CC,MAAM,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAACL,UAAU,CAACC,OAAO,EAAEH,aAAa,CAAC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
var _assert = require("./lib/utils/assert");
|
|
14
|
+
var _gifshot = _interopRequireDefault(require("./lib/gifshot/gifshot"));
|
|
15
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
+
var GIF_BUILDER_OPTIONS = {
|
|
18
|
+
source: 'images',
|
|
19
|
+
width: 200,
|
|
20
|
+
height: 200,
|
|
21
|
+
crossOrigin: 'Anonymous',
|
|
22
|
+
progressCallback: function progressCallback(captureProgress) {},
|
|
23
|
+
completeCallback: function completeCallback() {},
|
|
24
|
+
numWorkers: 2,
|
|
25
|
+
sampleInterval: 10,
|
|
26
|
+
interval: 0.1,
|
|
27
|
+
offset: null,
|
|
28
|
+
numFrames: 10,
|
|
29
|
+
frameDuration: 1,
|
|
30
|
+
filter: '',
|
|
31
|
+
waterMark: null,
|
|
32
|
+
waterMarkHeight: null,
|
|
33
|
+
waterMarkWidth: null,
|
|
34
|
+
waterMarkXCoordinate: 1,
|
|
35
|
+
waterMarkYCoordinate: 1,
|
|
36
|
+
text: '',
|
|
37
|
+
showFrameText: true,
|
|
38
|
+
fontWeight: 'normal',
|
|
39
|
+
fontSize: '16px',
|
|
40
|
+
minFontSize: '10px',
|
|
41
|
+
resizeFont: false,
|
|
42
|
+
fontFamily: 'sans-serif',
|
|
43
|
+
fontColor: '#ffffff',
|
|
44
|
+
textAlign: 'center',
|
|
45
|
+
textBaseline: 'bottom',
|
|
46
|
+
textXCoordinate: null,
|
|
47
|
+
textYCoordinate: null,
|
|
48
|
+
webcamVideoElement: null,
|
|
49
|
+
keepCameraOn: false,
|
|
50
|
+
cameraStream: null,
|
|
51
|
+
saveRenderingContexts: false,
|
|
52
|
+
savedRenderingContexts: []
|
|
53
|
+
};
|
|
54
|
+
var GIFBuilder = function () {
|
|
55
|
+
function GIFBuilder(options) {
|
|
56
|
+
(0, _classCallCheck2.default)(this, GIFBuilder);
|
|
57
|
+
this.options = _objectSpread({}, options);
|
|
58
|
+
this.source = options.source;
|
|
59
|
+
delete options.source;
|
|
60
|
+
this.files = [];
|
|
61
|
+
this.gifshot = _gifshot.default;
|
|
62
|
+
}
|
|
63
|
+
(0, _createClass2.default)(GIFBuilder, [{
|
|
64
|
+
key: "initialize",
|
|
65
|
+
value: function () {
|
|
66
|
+
var _initialize = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(options) {
|
|
67
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
68
|
+
while (1) switch (_context.prev = _context.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
case "end":
|
|
71
|
+
return _context.stop();
|
|
72
|
+
}
|
|
73
|
+
}, _callee);
|
|
74
|
+
}));
|
|
75
|
+
function initialize(_x) {
|
|
76
|
+
return _initialize.apply(this, arguments);
|
|
77
|
+
}
|
|
78
|
+
return initialize;
|
|
79
|
+
}()
|
|
80
|
+
}, {
|
|
81
|
+
key: "add",
|
|
82
|
+
value: function () {
|
|
83
|
+
var _add = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(file) {
|
|
84
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
85
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
86
|
+
case 0:
|
|
87
|
+
_context2.next = 2;
|
|
88
|
+
return this.initialize();
|
|
89
|
+
case 2:
|
|
90
|
+
this.files.push(file);
|
|
91
|
+
case 3:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context2.stop();
|
|
94
|
+
}
|
|
95
|
+
}, _callee2, this);
|
|
96
|
+
}));
|
|
97
|
+
function add(_x2) {
|
|
98
|
+
return _add.apply(this, arguments);
|
|
99
|
+
}
|
|
100
|
+
return add;
|
|
101
|
+
}()
|
|
102
|
+
}, {
|
|
103
|
+
key: "build",
|
|
104
|
+
value: function () {
|
|
105
|
+
var _build = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3() {
|
|
106
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
107
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
108
|
+
case 0:
|
|
109
|
+
_context3.next = 2;
|
|
110
|
+
return this.initialize();
|
|
111
|
+
case 2:
|
|
112
|
+
this._cleanOptions(this.options);
|
|
113
|
+
_context3.t0 = this.source;
|
|
114
|
+
_context3.next = _context3.t0 === 'images' ? 6 : _context3.t0 === 'video' ? 8 : _context3.t0 === 'webcam' ? 10 : 12;
|
|
115
|
+
break;
|
|
116
|
+
case 6:
|
|
117
|
+
this.options.images = this.files;
|
|
118
|
+
return _context3.abrupt("break", 13);
|
|
119
|
+
case 8:
|
|
120
|
+
this.options.video = this.files;
|
|
121
|
+
return _context3.abrupt("break", 13);
|
|
122
|
+
case 10:
|
|
123
|
+
(0, _assert.assert)(this.files.length === 0);
|
|
124
|
+
return _context3.abrupt("break", 13);
|
|
125
|
+
case 12:
|
|
126
|
+
throw new Error('GIFBuilder: invalid source');
|
|
127
|
+
case 13:
|
|
128
|
+
_context3.next = 15;
|
|
129
|
+
return this._createGIF();
|
|
130
|
+
case 15:
|
|
131
|
+
return _context3.abrupt("return", _context3.sent);
|
|
132
|
+
case 16:
|
|
133
|
+
case "end":
|
|
134
|
+
return _context3.stop();
|
|
135
|
+
}
|
|
136
|
+
}, _callee3, this);
|
|
137
|
+
}));
|
|
138
|
+
function build() {
|
|
139
|
+
return _build.apply(this, arguments);
|
|
140
|
+
}
|
|
141
|
+
return build;
|
|
142
|
+
}()
|
|
143
|
+
}, {
|
|
144
|
+
key: "_createGIF",
|
|
145
|
+
value: function () {
|
|
146
|
+
var _createGIF2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4() {
|
|
147
|
+
var _this = this;
|
|
148
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
149
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
150
|
+
case 0:
|
|
151
|
+
return _context4.abrupt("return", new Promise(function (resolve, reject) {
|
|
152
|
+
_this.gifshot.createGIF(_this.options, function (result) {
|
|
153
|
+
if (result.error) {
|
|
154
|
+
reject(result.errorMsg);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
resolve(result.image);
|
|
158
|
+
});
|
|
159
|
+
}));
|
|
160
|
+
case 1:
|
|
161
|
+
case "end":
|
|
162
|
+
return _context4.stop();
|
|
163
|
+
}
|
|
164
|
+
}, _callee4);
|
|
165
|
+
}));
|
|
166
|
+
function _createGIF() {
|
|
167
|
+
return _createGIF2.apply(this, arguments);
|
|
168
|
+
}
|
|
169
|
+
return _createGIF;
|
|
170
|
+
}()
|
|
171
|
+
}, {
|
|
172
|
+
key: "_cleanOptions",
|
|
173
|
+
value: function _cleanOptions(options) {
|
|
174
|
+
if (options.video || options.images || options.gifWidth || options.gifHeight) {
|
|
175
|
+
console.warn('GIFBuilder: ignoring options');
|
|
176
|
+
}
|
|
177
|
+
delete options.video;
|
|
178
|
+
delete options.images;
|
|
179
|
+
options.gifWidth = options.width;
|
|
180
|
+
options.gifHeight = options.height;
|
|
181
|
+
delete options.width;
|
|
182
|
+
delete options.height;
|
|
183
|
+
}
|
|
184
|
+
}], [{
|
|
185
|
+
key: "properties",
|
|
186
|
+
get: function get() {
|
|
187
|
+
return {
|
|
188
|
+
id: 'gif',
|
|
189
|
+
name: 'GIF',
|
|
190
|
+
extensions: ['gif'],
|
|
191
|
+
mimeTypes: ['image/gif'],
|
|
192
|
+
builder: GIFBuilder,
|
|
193
|
+
options: GIF_BUILDER_OPTIONS
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}]);
|
|
197
|
+
return GIFBuilder;
|
|
198
|
+
}();
|
|
199
|
+
exports.default = GIFBuilder;
|
|
200
|
+
//# sourceMappingURL=gif-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gif-builder.js","names":["_assert","require","_gifshot","_interopRequireDefault","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","GIF_BUILDER_OPTIONS","width","height","crossOrigin","progressCallback","captureProgress","completeCallback","numWorkers","sampleInterval","interval","offset","numFrames","frameDuration","waterMark","waterMarkHeight","waterMarkWidth","waterMarkXCoordinate","waterMarkYCoordinate","text","showFrameText","fontWeight","fontSize","minFontSize","resizeFont","fontFamily","fontColor","textAlign","textBaseline","textXCoordinate","textYCoordinate","webcamVideoElement","keepCameraOn","cameraStream","saveRenderingContexts","savedRenderingContexts","GIFBuilder","options","_classCallCheck2","files","gifshot","_createClass2","value","_initialize","_asyncToGenerator2","_regenerator","mark","_callee","wrap","_callee$","_context","prev","next","stop","initialize","_x","_add","_callee2","file","_callee2$","_context2","add","_x2","_build","_callee3","_callee3$","_context3","_cleanOptions","t0","images","abrupt","video","assert","Error","_createGIF","sent","build","_createGIF2","_callee4","_this","_callee4$","_context4","Promise","resolve","reject","createGIF","result","error","errorMsg","image","gifWidth","gifHeight","console","warn","get","id","name","extensions","mimeTypes","builder","exports"],"sources":["../../src/gif-builder.ts"],"sourcesContent":["// A GIFBuilder based on the gifshot module\n// @ts-nocheck\nimport {assert} from './lib/utils/assert';\nimport gifshot from './lib/gifshot/gifshot'; // TODO - load dynamically to avoid bloating\n\n// These are gifshot module options\nconst GIF_BUILDER_OPTIONS = {\n source: 'images',\n width: 200, // Desired width of the image\n height: 200, // Desired height of the image\n\n crossOrigin: 'Anonymous', // Options are 'Anonymous', 'use-credentials', or a falsy value to not set a CORS attribute.\n\n // CALLBACKS\n progressCallback: (captureProgress) => {}, // Callback that provides the current progress of the current image\n completeCallback: () => {}, // Callback function that is called when the current image is completed\n\n // QUALITY SETTINGS\n numWorkers: 2, // how many web workers to use to process the animated GIF frames. Default is 2.\n sampleInterval: 10, // pixels to skip when creating the palette. Default is 10. Less is better, but slower.\n interval: 0.1, // The amount of time (in seconds) to wait between each frame capture\n offset: null, // The amount of time (in seconds) to start capturing the GIF (only for HTML5 videos)\n numFrames: 10, // The number of frames to use to create the animated GIF. Note: Each frame is captured every 100 milliseconds of a video and every ms for existing images\n frameDuration: 1, // The amount of time (10 = 1s) to stay on each frame\n\n // CSS FILTER OPTIONS\n filter: '', // CSS filter that will be applied to the image (eg. blur(5px))\n\n // WATERMARK OPTIONS\n waterMark: null, // If an image is given here, it will be stamped on top of the GIF frames\n waterMarkHeight: null, // Height of the waterMark\n waterMarkWidth: null, // Height of the waterMark\n waterMarkXCoordinate: 1, // The X (horizontal) Coordinate of the watermark image\n waterMarkYCoordinate: 1, // The Y (vertical) Coordinate of the watermark image\n\n // TEXT OPTIONS\n text: '', // The text that covers the animated GIF\n showFrameText: true, // If frame-specific text is supplied with the image array, you can force to not be displayed\n fontWeight: 'normal', // The font weight of the text that covers the animated GIF\n fontSize: '16px', // The font size of the text that covers the animated GIF\n minFontSize: '10px', // The minimum font size of the text that covers the animated GIF\n resizeFont: false, // Whether or not the animated GIF text will be resized to fit within the GIF container\n fontFamily: 'sans-serif', // The font family of the text that covers the animated GIF\n fontColor: '#ffffff', // The font color of the text that covers the animated GIF\n textAlign: 'center', // The horizontal text alignment of the text that covers the animated GIF\n textBaseline: 'bottom', // The vertical text alignment of the text that covers the animated GIF\n textXCoordinate: null, // The X (horizontal) Coordinate of the text that covers the animated GIF\n textYCoordinate: null, // The Y (vertical) Coordinate of the text that covers the animated GIF\n\n // ADVANCED OPTIONS\n\n // WEBCAM CAPTURE OPTIONS\n webcamVideoElement: null, // You can pass an existing video element to use for the webcam GIF creation process,\n keepCameraOn: false, // Whether or not you would like the user's camera to stay on after the GIF is created\n cameraStream: null, // Expects a cameraStream Media object\n\n // CANVAS OPTIMIZATION OPTIONS\n saveRenderingContexts: false, // Whether or not you would like to save all of the canvas image binary data\n savedRenderingContexts: [] // Array of canvas image data\n};\n\nexport default class GIFBuilder {\n static get properties() {\n return {\n id: 'gif',\n name: 'GIF',\n extensions: ['gif'],\n mimeTypes: ['image/gif'],\n builder: GIFBuilder,\n options: GIF_BUILDER_OPTIONS\n };\n }\n\n constructor(options) {\n this.options = {...options};\n this.source = options.source;\n delete options.source;\n\n // Allow files to be added\n this.files = [];\n\n // Expose the gifshot module so that the full gifshot API is available to apps (Experimental)\n this.gifshot = gifshot;\n }\n\n async initialize(options): Promise<void> {\n // Expose the gifshot module so that the full gifshot API is available to apps (Experimental)\n // this.gifshot = await loadGifshotModule(options);\n }\n\n async add(file): void {\n await this.initialize();\n this.files.push(file);\n }\n\n async build(): Promise<string> {\n await this.initialize();\n this._cleanOptions(this.options);\n\n switch (this.source) {\n case 'images':\n this.options.images = this.files;\n break;\n case 'video':\n this.options.video = this.files;\n break;\n case 'webcam':\n assert(this.files.length === 0);\n break;\n default:\n throw new Error('GIFBuilder: invalid source');\n }\n\n return await this._createGIF();\n }\n\n // PRIVATE\n\n async _createGIF(): Promise<string> {\n return new Promise((resolve, reject) => {\n this.gifshot.createGIF(this.options, (result) => {\n // callback object properties\n // --------------------------\n // image - Base 64 image\n // cameraStream - The webRTC MediaStream object\n // error - Boolean that determines if an error occurred\n // errorCode - Helpful error label\n // errorMsg - Helpful error message\n // savedRenderingContexts - An array of canvas image data (will only be set if the saveRenderingContexts option was used)\n\n if (result.error) {\n reject(result.errorMsg);\n return;\n }\n\n // image - Base 64 image\n resolve(result.image);\n\n // var image = obj.image,\n // animatedImage = document.createElement('img');\n // animatedImage.src = image;\n // document.body.appendChild(animatedImage);\n });\n });\n }\n\n // Remove some gifshot options\n _cleanOptions(options): void {\n if (options.video || options.images || options.gifWidth || options.gifHeight) {\n console.warn('GIFBuilder: ignoring options'); // eslint-disable-line\n }\n\n // We control these through options.source instead\n delete options.video;\n delete options.images;\n\n // Use width/height props (to standardize across builders)\n options.gifWidth = options.width;\n options.gifHeight = options.height;\n delete options.width;\n delete options.height;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA4C,SAAAG,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAAA,QAAAA,CAAA,OAAAf,OAAA,CAAAI,MAAA,CAAAc,MAAA,OAAAC,OAAA,WAAAC,GAAA,QAAAC,gBAAA,CAAAC,OAAA,EAAAR,MAAA,EAAAM,GAAA,EAAAF,MAAA,CAAAE,GAAA,SAAAhB,MAAA,CAAAmB,yBAAA,GAAAnB,MAAA,CAAAoB,gBAAA,CAAAV,MAAA,EAAAV,MAA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9B,OAAO,EAAQ;MAC3B,IAAIA,OAAO,CAACkC,KAAK,IAAIlC,OAAO,CAACgC,MAAM,IAAIhC,OAAO,CAACqD,QAAQ,IAAIrD,OAAO,CAACsD,SAAS,EAAE;QAC5EC,OAAO,CAACC,IAAI,CAAC,8BAA8B,CAAC;MAC9C;MAGA,OAAOxD,OAAO,CAACkC,KAAK;MACpB,OAAOlC,OAAO,CAACgC,MAAM;MAGrBhC,OAAO,CAACqD,QAAQ,GAAGrD,OAAO,CAACnC,KAAK;MAChCmC,OAAO,CAACsD,SAAS,GAAGtD,OAAO,CAAClC,MAAM;MAClC,OAAOkC,OAAO,CAACnC,KAAK;MACpB,OAAOmC,OAAO,CAAClC,MAAM;IACvB;EAAC;IAAAR,GAAA;IAAAmG,GAAA,EAnGD,SAAAA,IAAA,EAAwB;MACtB,OAAO;QACLC,EAAE,EAAE,KAAK;QACTC,IAAI,EAAE,KAAK;QACXC,UAAU,EAAE,CAAC,KAAK,CAAC;QACnBC,SAAS,EAAE,CAAC,WAAW,CAAC;QACxBC,OAAO,EAAE/D,UAAU;QACnBC,OAAO,EAAEpC;MACX,CAAC;IACH;EAAC;EAAA,OAAAmC,UAAA;AAAA;AAAAgE,OAAA,CAAAvG,OAAA,GAAAuC,UAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "GIFBuilder", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _gifBuilder.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "VideoLoader", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _videoLoader.VideoLoader;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var _videoLoader = require("./video-loader");
|
|
20
|
+
var _gifBuilder = _interopRequireDefault(require("./gif-builder"));
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_videoLoader","require","_gifBuilder","_interopRequireDefault"],"sources":["../../src/index.ts"],"sourcesContent":["export {VideoLoader} from './video-loader';\n\nexport {default as GIFBuilder} from './gif-builder';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.loadGifshotModule = loadGifshotModule;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _workerUtils = require("@loaders.gl/worker-utils");
|
|
11
|
+
var loadGifshotPromise;
|
|
12
|
+
function loadGifshotModule() {
|
|
13
|
+
return _loadGifshotModule.apply(this, arguments);
|
|
14
|
+
}
|
|
15
|
+
function _loadGifshotModule() {
|
|
16
|
+
_loadGifshotModule = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
|
|
17
|
+
var options,
|
|
18
|
+
modules,
|
|
19
|
+
_args = arguments;
|
|
20
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
21
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
24
|
+
modules = options.modules || {};
|
|
25
|
+
if (!modules.gifshot) {
|
|
26
|
+
_context.next = 4;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
return _context.abrupt("return", modules.gifshot);
|
|
30
|
+
case 4:
|
|
31
|
+
loadGifshotPromise = loadGifshotPromise || loadGifshot(options);
|
|
32
|
+
_context.next = 7;
|
|
33
|
+
return loadGifshotPromise;
|
|
34
|
+
case 7:
|
|
35
|
+
return _context.abrupt("return", _context.sent);
|
|
36
|
+
case 8:
|
|
37
|
+
case "end":
|
|
38
|
+
return _context.stop();
|
|
39
|
+
}
|
|
40
|
+
}, _callee);
|
|
41
|
+
}));
|
|
42
|
+
return _loadGifshotModule.apply(this, arguments);
|
|
43
|
+
}
|
|
44
|
+
function loadGifshot(_x) {
|
|
45
|
+
return _loadGifshot.apply(this, arguments);
|
|
46
|
+
}
|
|
47
|
+
function _loadGifshot() {
|
|
48
|
+
_loadGifshot = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(options) {
|
|
49
|
+
var gifshot;
|
|
50
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
51
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
options.libraryPath = options.libraryPath || 'libs/';
|
|
54
|
+
_context2.next = 3;
|
|
55
|
+
return (0, _workerUtils.loadLibrary)('gifshot.js', 'gifshot', options);
|
|
56
|
+
case 3:
|
|
57
|
+
gifshot = _context2.sent;
|
|
58
|
+
return _context2.abrupt("return", gifshot || globalThis.gifshot);
|
|
59
|
+
case 5:
|
|
60
|
+
case "end":
|
|
61
|
+
return _context2.stop();
|
|
62
|
+
}
|
|
63
|
+
}, _callee2);
|
|
64
|
+
}));
|
|
65
|
+
return _loadGifshot.apply(this, arguments);
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=gifshot-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gifshot-loader.js","names":["_workerUtils","require","loadGifshotPromise","loadGifshotModule","_loadGifshotModule","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","options","modules","_args","wrap","_callee$","_context","prev","next","length","undefined","gifshot","abrupt","loadGifshot","sent","stop","_x","_loadGifshot","_callee2","_callee2$","_context2","libraryPath","loadLibrary","globalThis"],"sources":["../../../../src/lib/gifshot/gifshot-loader.ts"],"sourcesContent":["// @ts-nocheck\nimport {loadLibrary} from '@loaders.gl/worker-utils';\n\nlet loadGifshotPromise;\n\nexport async function loadGifshotModule(options = {}) {\n const modules = options.modules || {};\n if (modules.gifshot) {\n return modules.gifshot;\n }\n loadGifshotPromise = loadGifshotPromise || loadGifshot(options);\n return await loadGifshotPromise;\n}\n\nasync function loadGifshot(options) {\n options.libraryPath = options.libraryPath || 'libs/';\n const gifshot = await loadLibrary('gifshot.js', 'gifshot', options);\n\n // Depends on how import happened...\n // @ts-ignore TS2339: Property does not exist on type\n return gifshot || globalThis.gifshot;\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAIC,kBAAkB;AAAC,SAEDC,iBAAiBA,CAAA;EAAA,OAAAC,kBAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAAA,SAAAF,mBAAA;EAAAA,kBAAA,OAAAG,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAhC,SAAAC,QAAA;IAAA,IAAAC,OAAA;MAAAC,OAAA;MAAAC,KAAA,GAAAR,SAAA;IAAA,OAAAG,YAAA,CAAAD,OAAA,CAAAO,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAiCP,OAAO,GAAAE,KAAA,CAAAM,MAAA,QAAAN,KAAA,QAAAO,SAAA,GAAAP,KAAA,MAAG,CAAC,CAAC;UAC5CD,OAAO,GAAGD,OAAO,CAACC,OAAO,IAAI,CAAC,CAAC;UAAA,KACjCA,OAAO,CAACS,OAAO;YAAAL,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