@loaders.gl/video 3.3.0-alpha.4 → 3.3.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/es5/bundle.js +0 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/gif-builder.js +17 -37
- package/dist/es5/gif-builder.js.map +1 -1
- package/dist/es5/index.js +4 -7
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/gifshot/gifshot-loader.js +2 -17
- package/dist/es5/lib/gifshot/gifshot-loader.js.map +1 -1
- package/dist/es5/lib/gifshot/gifshot.js +5 -267
- package/dist/es5/lib/gifshot/gifshot.js.map +1 -1
- package/dist/es5/lib/parsers/parse-video.js +0 -6
- package/dist/es5/lib/parsers/parse-video.js.map +1 -1
- package/dist/es5/lib/utils/assert.js +0 -1
- package/dist/es5/lib/utils/assert.js.map +1 -1
- package/dist/es5/video-loader.js +2 -4
- package/dist/es5/video-loader.js.map +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/gif-builder.js +20 -13
- package/dist/esm/gif-builder.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/gifshot/gifshot-loader.js +4 -4
- package/dist/esm/lib/gifshot/gifshot-loader.js.map +1 -1
- package/dist/esm/lib/gifshot/gifshot.js +6 -267
- package/dist/esm/lib/gifshot/gifshot.js.map +1 -1
- package/dist/esm/lib/parsers/parse-video.js +1 -0
- package/dist/esm/lib/parsers/parse-video.js.map +1 -1
- package/dist/esm/lib/utils/assert.js.map +1 -1
- package/dist/esm/video-loader.js +3 -1
- package/dist/esm/video-loader.js.map +1 -1
- package/package.json +4 -4
package/dist/es5/bundle.js
CHANGED
package/dist/es5/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|
package/dist/es5/gif-builder.js
CHANGED
|
@@ -1,49 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
-
|
|
18
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
-
|
|
20
13
|
var _assert = require("./lib/utils/assert");
|
|
21
|
-
|
|
22
14
|
var _gifshot = _interopRequireDefault(require("./lib/gifshot/gifshot"));
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
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; }
|
|
27
17
|
|
|
28
18
|
var GIF_BUILDER_OPTIONS = {
|
|
29
19
|
source: 'images',
|
|
30
20
|
width: 200,
|
|
31
21
|
height: 200,
|
|
22
|
+
|
|
32
23
|
crossOrigin: 'Anonymous',
|
|
24
|
+
|
|
33
25
|
progressCallback: function progressCallback(captureProgress) {},
|
|
34
26
|
completeCallback: function completeCallback() {},
|
|
27
|
+
|
|
35
28
|
numWorkers: 2,
|
|
36
29
|
sampleInterval: 10,
|
|
37
30
|
interval: 0.1,
|
|
38
31
|
offset: null,
|
|
39
32
|
numFrames: 10,
|
|
40
33
|
frameDuration: 1,
|
|
34
|
+
|
|
41
35
|
filter: '',
|
|
36
|
+
|
|
42
37
|
waterMark: null,
|
|
43
38
|
waterMarkHeight: null,
|
|
44
39
|
waterMarkWidth: null,
|
|
45
40
|
waterMarkXCoordinate: 1,
|
|
46
41
|
waterMarkYCoordinate: 1,
|
|
42
|
+
|
|
47
43
|
text: '',
|
|
48
44
|
showFrameText: true,
|
|
49
45
|
fontWeight: 'normal',
|
|
@@ -56,23 +52,25 @@ var GIF_BUILDER_OPTIONS = {
|
|
|
56
52
|
textBaseline: 'bottom',
|
|
57
53
|
textXCoordinate: null,
|
|
58
54
|
textYCoordinate: null,
|
|
55
|
+
|
|
59
56
|
webcamVideoElement: null,
|
|
60
57
|
keepCameraOn: false,
|
|
61
58
|
cameraStream: null,
|
|
59
|
+
|
|
62
60
|
saveRenderingContexts: false,
|
|
63
61
|
savedRenderingContexts: []
|
|
64
62
|
};
|
|
65
|
-
|
|
66
63
|
var GIFBuilder = function () {
|
|
67
64
|
function GIFBuilder(options) {
|
|
68
65
|
(0, _classCallCheck2.default)(this, GIFBuilder);
|
|
69
66
|
this.options = _objectSpread({}, options);
|
|
70
67
|
this.source = options.source;
|
|
71
68
|
delete options.source;
|
|
69
|
+
|
|
72
70
|
this.files = [];
|
|
71
|
+
|
|
73
72
|
this.gifshot = _gifshot.default;
|
|
74
73
|
}
|
|
75
|
-
|
|
76
74
|
(0, _createClass2.default)(GIFBuilder, [{
|
|
77
75
|
key: "initialize",
|
|
78
76
|
value: function () {
|
|
@@ -87,11 +85,9 @@ var GIFBuilder = function () {
|
|
|
87
85
|
}
|
|
88
86
|
}, _callee);
|
|
89
87
|
}));
|
|
90
|
-
|
|
91
88
|
function initialize(_x) {
|
|
92
89
|
return _initialize.apply(this, arguments);
|
|
93
90
|
}
|
|
94
|
-
|
|
95
91
|
return initialize;
|
|
96
92
|
}()
|
|
97
93
|
}, {
|
|
@@ -104,10 +100,8 @@ var GIFBuilder = function () {
|
|
|
104
100
|
case 0:
|
|
105
101
|
_context2.next = 2;
|
|
106
102
|
return this.initialize();
|
|
107
|
-
|
|
108
103
|
case 2:
|
|
109
104
|
this.files.push(file);
|
|
110
|
-
|
|
111
105
|
case 3:
|
|
112
106
|
case "end":
|
|
113
107
|
return _context2.stop();
|
|
@@ -115,11 +109,9 @@ var GIFBuilder = function () {
|
|
|
115
109
|
}
|
|
116
110
|
}, _callee2, this);
|
|
117
111
|
}));
|
|
118
|
-
|
|
119
112
|
function add(_x2) {
|
|
120
113
|
return _add.apply(this, arguments);
|
|
121
114
|
}
|
|
122
|
-
|
|
123
115
|
return add;
|
|
124
116
|
}()
|
|
125
117
|
}, {
|
|
@@ -132,36 +124,27 @@ var GIFBuilder = function () {
|
|
|
132
124
|
case 0:
|
|
133
125
|
_context3.next = 2;
|
|
134
126
|
return this.initialize();
|
|
135
|
-
|
|
136
127
|
case 2:
|
|
137
128
|
this._cleanOptions(this.options);
|
|
138
|
-
|
|
139
129
|
_context3.t0 = this.source;
|
|
140
130
|
_context3.next = _context3.t0 === 'images' ? 6 : _context3.t0 === 'video' ? 8 : _context3.t0 === 'webcam' ? 10 : 12;
|
|
141
131
|
break;
|
|
142
|
-
|
|
143
132
|
case 6:
|
|
144
133
|
this.options.images = this.files;
|
|
145
134
|
return _context3.abrupt("break", 13);
|
|
146
|
-
|
|
147
135
|
case 8:
|
|
148
136
|
this.options.video = this.files;
|
|
149
137
|
return _context3.abrupt("break", 13);
|
|
150
|
-
|
|
151
138
|
case 10:
|
|
152
139
|
(0, _assert.assert)(this.files.length === 0);
|
|
153
140
|
return _context3.abrupt("break", 13);
|
|
154
|
-
|
|
155
141
|
case 12:
|
|
156
142
|
throw new Error('GIFBuilder: invalid source');
|
|
157
|
-
|
|
158
143
|
case 13:
|
|
159
144
|
_context3.next = 15;
|
|
160
145
|
return this._createGIF();
|
|
161
|
-
|
|
162
146
|
case 15:
|
|
163
147
|
return _context3.abrupt("return", _context3.sent);
|
|
164
|
-
|
|
165
148
|
case 16:
|
|
166
149
|
case "end":
|
|
167
150
|
return _context3.stop();
|
|
@@ -169,11 +152,9 @@ var GIFBuilder = function () {
|
|
|
169
152
|
}
|
|
170
153
|
}, _callee3, this);
|
|
171
154
|
}));
|
|
172
|
-
|
|
173
155
|
function build() {
|
|
174
156
|
return _build.apply(this, arguments);
|
|
175
157
|
}
|
|
176
|
-
|
|
177
158
|
return build;
|
|
178
159
|
}()
|
|
179
160
|
}, {
|
|
@@ -181,22 +162,22 @@ var GIFBuilder = function () {
|
|
|
181
162
|
value: function () {
|
|
182
163
|
var _createGIF2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4() {
|
|
183
164
|
var _this = this;
|
|
184
|
-
|
|
185
165
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
186
166
|
while (1) {
|
|
187
167
|
switch (_context4.prev = _context4.next) {
|
|
188
168
|
case 0:
|
|
189
169
|
return _context4.abrupt("return", new Promise(function (resolve, reject) {
|
|
190
170
|
_this.gifshot.createGIF(_this.options, function (result) {
|
|
171
|
+
|
|
191
172
|
if (result.error) {
|
|
192
173
|
reject(result.errorMsg);
|
|
193
174
|
return;
|
|
194
175
|
}
|
|
195
176
|
|
|
196
177
|
resolve(result.image);
|
|
178
|
+
|
|
197
179
|
});
|
|
198
180
|
}));
|
|
199
|
-
|
|
200
181
|
case 1:
|
|
201
182
|
case "end":
|
|
202
183
|
return _context4.stop();
|
|
@@ -204,22 +185,22 @@ var GIFBuilder = function () {
|
|
|
204
185
|
}
|
|
205
186
|
}, _callee4);
|
|
206
187
|
}));
|
|
207
|
-
|
|
208
188
|
function _createGIF() {
|
|
209
189
|
return _createGIF2.apply(this, arguments);
|
|
210
190
|
}
|
|
211
|
-
|
|
212
191
|
return _createGIF;
|
|
213
192
|
}()
|
|
214
193
|
}, {
|
|
215
194
|
key: "_cleanOptions",
|
|
216
|
-
value:
|
|
195
|
+
value:
|
|
196
|
+
function _cleanOptions(options) {
|
|
217
197
|
if (options.video || options.images || options.gifWidth || options.gifHeight) {
|
|
218
198
|
console.warn('GIFBuilder: ignoring options');
|
|
219
199
|
}
|
|
220
200
|
|
|
221
201
|
delete options.video;
|
|
222
202
|
delete options.images;
|
|
203
|
+
|
|
223
204
|
options.gifWidth = options.width;
|
|
224
205
|
options.gifHeight = options.height;
|
|
225
206
|
delete options.width;
|
|
@@ -240,6 +221,5 @@ var GIFBuilder = function () {
|
|
|
240
221
|
}]);
|
|
241
222
|
return GIFBuilder;
|
|
242
223
|
}();
|
|
243
|
-
|
|
244
224
|
exports.default = GIFBuilder;
|
|
245
225
|
//# sourceMappingURL=gif-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/gif-builder.ts"],"names":["GIF_BUILDER_OPTIONS","source","width","height","crossOrigin","progressCallback","captureProgress","completeCallback","numWorkers","sampleInterval","interval","offset","numFrames","frameDuration","filter","waterMark","waterMarkHeight","waterMarkWidth","waterMarkXCoordinate","waterMarkYCoordinate","text","showFrameText","fontWeight","fontSize","minFontSize","resizeFont","fontFamily","fontColor","textAlign","textBaseline","textXCoordinate","textYCoordinate","webcamVideoElement","keepCameraOn","cameraStream","saveRenderingContexts","savedRenderingContexts","GIFBuilder","options","files","gifshot","file","initialize","push","_cleanOptions","images","video","length","Error","_createGIF","Promise","resolve","reject","createGIF","result","error","errorMsg","image","gifWidth","gifHeight","console","warn","id","name","extensions","mimeTypes","builder"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA;;AACA;;;;;;AAGA,IAAMA,mBAAmB,GAAG;AAC1BC,EAAAA,MAAM,EAAE,QADkB;AAE1BC,EAAAA,KAAK,EAAE,GAFmB;AAG1BC,EAAAA,MAAM,EAAE,GAHkB;AAK1BC,EAAAA,WAAW,EAAE,WALa;AAQ1BC,EAAAA,gBAAgB,EAAE,0BAACC,eAAD,EAAqB,CAAE,CARf;AAS1BC,EAAAA,gBAAgB,EAAE,4BAAM,CAAE,CATA;AAY1BC,EAAAA,UAAU,EAAE,CAZc;AAa1BC,EAAAA,cAAc,EAAE,EAbU;AAc1BC,EAAAA,QAAQ,EAAE,GAdgB;AAe1BC,EAAAA,MAAM,EAAE,IAfkB;AAgB1BC,EAAAA,SAAS,EAAE,EAhBe;AAiB1BC,EAAAA,aAAa,EAAE,CAjBW;AAoB1BC,EAAAA,MAAM,EAAE,EApBkB;AAuB1BC,EAAAA,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AACoB,QAA3C,IAAuDpB,OAAO,CAACqB,SAAnE,EAA8E;AAC5EC,QAAAA,OAAO,CAACC,IAAR,CAAa,8BAAb;AACD;;AAGD,aAAOvB,OAAO,CAACQ,KAAf;AACA,aAAOR,OAAO,CAACO,MAAf;AAGAP,MAAAA,OAAO,CAACoB,QAAR,GAAmBpB,OAAO,CAACpC,KAA3B;AACAoC,MAAAA,OAAO,CAACqB,SAAR,GAAoBrB,OAAO,CAACnC,MAA5B;AACA,aAAOmC,OAAO,CAACpC,KAAf;AACA,aAAOoC,OAAO,CAACnC,MAAf;AACD;;;SAnGD,eAAwB;AACtB,aAAO;AACL2D,QAAAA,EAAE,EAAE,KADC;AAELC,QAAAA,IAAI,EAAE,KAFD;AAGLC,QAAAA,UAAU,EAAE,CAAC,KAAD,CAHP;AAILC,QAAAA,SAAS,EAAE,CAAC,WAAD,CAJN;AAKLC,QAAAA,OAAO,EAAE7B,UALJ;AAMLC,QAAAA,OAAO,EAAEtC;AANJ,OAAP;AAQD","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"],"file":"gif-builder.js"}
|
|
1
|
+
{"version":3,"file":"gif-builder.js","names":["GIF_BUILDER_OPTIONS","source","width","height","crossOrigin","progressCallback","captureProgress","completeCallback","numWorkers","sampleInterval","interval","offset","numFrames","frameDuration","filter","waterMark","waterMarkHeight","waterMarkWidth","waterMarkXCoordinate","waterMarkYCoordinate","text","showFrameText","fontWeight","fontSize","minFontSize","resizeFont","fontFamily","fontColor","textAlign","textBaseline","textXCoordinate","textYCoordinate","webcamVideoElement","keepCameraOn","cameraStream","saveRenderingContexts","savedRenderingContexts","GIFBuilder","options","files","gifshot","file","initialize","push","_cleanOptions","images","video","assert","length","Error","_createGIF","Promise","resolve","reject","createGIF","result","error","errorMsg","image","gifWidth","gifHeight","console","warn","id","name","extensions","mimeTypes","builder"],"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;AACA;AAA4C;AAAA;;AAG5C,IAAMA,mBAAmB,GAAG;EAC1BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE,GAAG;;EAEXC,WAAW,EAAE,WAAW;;EAGxBC,gBAAgB,EAAE,0BAACC,eAAe,EAAK,CAAC,CAAC;EACzCC,gBAAgB,EAAE,4BAAM,CAAC,CAAC;;EAG1BC,UAAU,EAAE,CAAC;EACbC,cAAc,EAAE,EAAE;EAClBC,QAAQ,EAAE,GAAG;EACbC,MAAM,EAAE,IAAI;EACZC,SAAS,EAAE,EAAE;EACbC,aAAa,EAAE,CAAC;;EAGhBC,MAAM,EAAE,EAAE;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,EAAQ;MAC3B,IAAIA,OAAO,CAACQ,KAAK,IAAIR,OAAO,CAACO,MAAM,IAAIP,OAAO,CAACqB,QAAQ,IAAIrB,OAAO,CAACsB,SAAS,EAAE;QAC5EC,OAAO,CAACC,IAAI,CAAC,8BAA8B,CAAC;MAC9C;;MAGA,OAAOxB,OAAO,CAACQ,KAAK;MACpB,OAAOR,OAAO,CAACO,MAAM;;MAGrBP,OAAO,CAACqB,QAAQ,GAAGrB,OAAO,CAACpC,KAAK;MAChCoC,OAAO,CAACsB,SAAS,GAAGtB,OAAO,CAACnC,MAAM;MAClC,OAAOmC,OAAO,CAACpC,KAAK;MACpB,OAAOoC,OAAO,CAACnC,MAAM;IACvB;EAAC;IAAA;IAAA,KAnGD,eAAwB;MACtB,OAAO;QACL4D,EAAE,EAAE,KAAK;QACTC,IAAI,EAAE,KAAK;QACXC,UAAU,EAAE,CAAC,KAAK,CAAC;QACnBC,SAAS,EAAE,CAAC,WAAW,CAAC;QACxBC,OAAO,EAAE9B,UAAU;QACnBC,OAAO,EAAEtC;MACX,CAAC;IACH;EAAC;EAAA;AAAA;AAAA"}
|
package/dist/es5/index.js
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
7
|
+
Object.defineProperty(exports, "GIFBuilder", {
|
|
9
8
|
enumerable: true,
|
|
10
9
|
get: function get() {
|
|
11
|
-
return
|
|
10
|
+
return _gifBuilder.default;
|
|
12
11
|
}
|
|
13
12
|
});
|
|
14
|
-
Object.defineProperty(exports, "
|
|
13
|
+
Object.defineProperty(exports, "VideoLoader", {
|
|
15
14
|
enumerable: true,
|
|
16
15
|
get: function get() {
|
|
17
|
-
return
|
|
16
|
+
return _videoLoader.VideoLoader;
|
|
18
17
|
}
|
|
19
18
|
});
|
|
20
|
-
|
|
21
19
|
var _videoLoader = require("./video-loader");
|
|
22
|
-
|
|
23
20
|
var _gifBuilder = _interopRequireDefault(require("./gif-builder"));
|
|
24
21
|
//# sourceMappingURL=index.js.map
|
package/dist/es5/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export {VideoLoader} from './video-loader';\n\nexport {default as GIFBuilder} from './gif-builder';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAEA"}
|
|
@@ -1,51 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.loadGifshotModule = loadGifshotModule;
|
|
9
|
-
|
|
10
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _workerUtils = require("@loaders.gl/worker-utils");
|
|
15
11
|
|
|
16
12
|
var loadGifshotPromise;
|
|
17
|
-
|
|
18
13
|
function loadGifshotModule() {
|
|
19
14
|
return _loadGifshotModule.apply(this, arguments);
|
|
20
15
|
}
|
|
21
|
-
|
|
22
16
|
function _loadGifshotModule() {
|
|
23
17
|
_loadGifshotModule = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
|
|
24
18
|
var options,
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
modules,
|
|
20
|
+
_args = arguments;
|
|
27
21
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
28
22
|
while (1) {
|
|
29
23
|
switch (_context.prev = _context.next) {
|
|
30
24
|
case 0:
|
|
31
25
|
options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
32
26
|
modules = options.modules || {};
|
|
33
|
-
|
|
34
27
|
if (!modules.gifshot) {
|
|
35
28
|
_context.next = 4;
|
|
36
29
|
break;
|
|
37
30
|
}
|
|
38
|
-
|
|
39
31
|
return _context.abrupt("return", modules.gifshot);
|
|
40
|
-
|
|
41
32
|
case 4:
|
|
42
33
|
loadGifshotPromise = loadGifshotPromise || loadGifshot(options);
|
|
43
34
|
_context.next = 7;
|
|
44
35
|
return loadGifshotPromise;
|
|
45
|
-
|
|
46
36
|
case 7:
|
|
47
37
|
return _context.abrupt("return", _context.sent);
|
|
48
|
-
|
|
49
38
|
case 8:
|
|
50
39
|
case "end":
|
|
51
40
|
return _context.stop();
|
|
@@ -55,11 +44,9 @@ function _loadGifshotModule() {
|
|
|
55
44
|
}));
|
|
56
45
|
return _loadGifshotModule.apply(this, arguments);
|
|
57
46
|
}
|
|
58
|
-
|
|
59
47
|
function loadGifshot(_x) {
|
|
60
48
|
return _loadGifshot.apply(this, arguments);
|
|
61
49
|
}
|
|
62
|
-
|
|
63
50
|
function _loadGifshot() {
|
|
64
51
|
_loadGifshot = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(options) {
|
|
65
52
|
var gifshot;
|
|
@@ -70,11 +57,9 @@ function _loadGifshot() {
|
|
|
70
57
|
options.libraryPath = options.libraryPath || 'libs/';
|
|
71
58
|
_context2.next = 3;
|
|
72
59
|
return (0, _workerUtils.loadLibrary)('gifshot.js', 'gifshot', options);
|
|
73
|
-
|
|
74
60
|
case 3:
|
|
75
61
|
gifshot = _context2.sent;
|
|
76
62
|
return _context2.abrupt("return", gifshot || globalThis.gifshot);
|
|
77
|
-
|
|
78
63
|
case 5:
|
|
79
64
|
case "end":
|
|
80
65
|
return _context2.stop();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"gifshot-loader.js","names":["loadGifshotPromise","loadGifshotModule","options","modules","gifshot","loadGifshot","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;;AAEA,IAAIA,kBAAkB;AAAC,SAEDC,iBAAiB;EAAA;AAAA;AAAA;EAAA,+EAAhC;IAAA;MAAA;MAAA;IAAA;MAAA;QAAA;UAAA;YAAiCC,OAAO,2DAAG,CAAC,CAAC;YAC5CC,OAAO,GAAGD,OAAO,CAACC,OAAO,IAAI,CAAC,CAAC;YAAA,KACjCA,OAAO,CAACC,OAAO;cAAA;cAAA;YAAA;YAAA,iCACVD,OAAO,CAACC,OAAO;UAAA;YAExBJ,kBAAkB,GAAGA,kBAAkB,IAAIK,WAAW,CAACH,OAAO,CAAC;YAAC;YAAA,OACnDF,kBAAkB;UAAA;YAAA;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAChC;EAAA;AAAA;AAAA,SAEcK,WAAW;EAAA;AAAA;AAAA;EAAA,yEAA1B,kBAA2BH,OAAO;IAAA;IAAA;MAAA;QAAA;UAAA;YAChCA,OAAO,CAACI,WAAW,GAAGJ,OAAO,CAACI,WAAW,IAAI,OAAO;YAAC;YAAA,OAC/B,IAAAC,wBAAW,EAAC,YAAY,EAAE,SAAS,EAAEL,OAAO,CAAC;UAAA;YAA7DE,OAAO;YAAA,kCAINA,OAAO,IAAII,UAAU,CAACJ,OAAO;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CACrC;EAAA;AAAA"}
|