@loaders.gl/video 4.0.0-alpha.5 → 4.0.0-alpha.7
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 +2322 -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 -54
- 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
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Parse to platform defined video type (HTMLVideoElement in browser)
|
|
4
|
+
async function parseVideo(arrayBuffer) {
|
|
5
|
+
// TODO It is probably somewhat inefficent to convert a File/Blob to ArrayBuffer and back
|
|
6
|
+
// and could perhaps cause problems for large videos.
|
|
7
|
+
// TODO MIME type is also lost from the File or Response...
|
|
8
|
+
const blob = new Blob([arrayBuffer]);
|
|
9
|
+
const video = document.createElement('video');
|
|
10
|
+
video.src = URL.createObjectURL(blob);
|
|
11
|
+
return video;
|
|
6
12
|
}
|
|
7
|
-
|
|
13
|
+
exports.default = parseVideo;
|
package/dist/lib/utils/assert.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assert = void 0;
|
|
4
|
+
function assert(condition, message) {
|
|
5
|
+
if (!condition) {
|
|
6
|
+
throw new Error(message);
|
|
7
|
+
}
|
|
5
8
|
}
|
|
6
|
-
|
|
9
|
+
exports.assert = assert;
|
package/dist/video-loader.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LoaderWithParser, LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
2
|
import parseVideo from './lib/parsers/parse-video';
|
|
3
|
-
export
|
|
3
|
+
export type VideoLoaderOptions = LoaderOptions & {
|
|
4
4
|
video: {};
|
|
5
5
|
};
|
|
6
6
|
export declare const VideoLoader: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-loader.d.ts","sourceRoot":"","sources":["../src/video-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,UAAU,MAAM,2BAA2B,CAAC;AAWnD,
|
|
1
|
+
{"version":3,"file":"video-loader.d.ts","sourceRoot":"","sources":["../src/video-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,UAAU,MAAM,2BAA2B,CAAC;AAWnD,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,KAAK,EAAE,EAAE,CAAC;CACX,CAAC;AAMF,eAAO,MAAM,WAAW;;;;;;;;;CAYvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,gBAA8B,CAAC"}
|
package/dist/video-loader.js
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports._typecheckVideoLoader = exports.VideoLoader = void 0;
|
|
7
|
+
const parse_video_1 = __importDefault(require("./lib/parsers/parse-video"));
|
|
8
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
9
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
10
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
3
11
|
const EXTENSIONS = ['mp4'];
|
|
4
12
|
const MIME_TYPES = ['video/mp4'];
|
|
5
13
|
const DEFAULT_LOADER_OPTIONS = {
|
|
6
|
-
|
|
14
|
+
video: {}
|
|
7
15
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
exports.VideoLoader = {
|
|
17
|
+
name: 'Video',
|
|
18
|
+
id: 'video',
|
|
19
|
+
module: 'video',
|
|
20
|
+
version: VERSION,
|
|
21
|
+
extensions: EXTENSIONS,
|
|
22
|
+
mimeTypes: MIME_TYPES,
|
|
23
|
+
parse: parse_video_1.default,
|
|
24
|
+
// tests: arrayBuffer => Boolean(getBinaryImageMetadata(new DataView(arrayBuffer))),
|
|
25
|
+
options: DEFAULT_LOADER_OPTIONS
|
|
17
26
|
};
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=video-loader.js.map
|
|
27
|
+
exports._typecheckVideoLoader = exports.VideoLoader;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/video",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.7",
|
|
4
4
|
"description": "Framework-independent loaders and writers for video (MP4, WEBM, ...)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"PLY"
|
|
20
20
|
],
|
|
21
21
|
"types": "dist/index.d.ts",
|
|
22
|
-
"main": "dist/index.js",
|
|
23
|
-
"module": "dist/index.js",
|
|
22
|
+
"main": "dist/es5/index.js",
|
|
23
|
+
"module": "dist/esm/index.js",
|
|
24
24
|
"sideEffects": false,
|
|
25
25
|
"files": [
|
|
26
26
|
"src",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/dist.min.js"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@loaders.gl/loader-utils": "4.0.0-alpha.
|
|
36
|
-
"@loaders.gl/worker-utils": "4.0.0-alpha.
|
|
35
|
+
"@loaders.gl/loader-utils": "4.0.0-alpha.7",
|
|
36
|
+
"@loaders.gl/worker-utils": "4.0.0-alpha.7",
|
|
37
37
|
"gifshot": "^0.4.5"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "afb59c4d8e5d8ebb9c28f111cb0c96c5527d0ffd"
|
|
40
40
|
}
|
|
@@ -10,27 +10,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
10
10
|
*/
|
|
11
11
|
/*
|
|
12
12
|
utils.js
|
|
13
|
-
========
|
|
14
13
|
*/
|
|
15
14
|
/* Copyright 2017 Yahoo Inc.
|
|
16
15
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
17
16
|
*/
|
|
18
17
|
var utils = {
|
|
19
|
-
URL:
|
|
18
|
+
URL: globalThis.URL || globalThis.webkitURL || globalThis.mozURL || globalThis.msURL,
|
|
20
19
|
getUserMedia: (function () {
|
|
20
|
+
if (!globalThis.navigator) return globalThis.navigator;
|
|
21
21
|
const getUserMedia =
|
|
22
|
-
navigator.getUserMedia ||
|
|
23
|
-
navigator.webkitGetUserMedia ||
|
|
24
|
-
navigator.mozGetUserMedia ||
|
|
25
|
-
navigator.msGetUserMedia;
|
|
26
|
-
return getUserMedia ? getUserMedia.bind(navigator) : getUserMedia;
|
|
22
|
+
globalThis.navigator.getUserMedia ||
|
|
23
|
+
globalThis.navigator.webkitGetUserMedia ||
|
|
24
|
+
globalThis.navigator.mozGetUserMedia ||
|
|
25
|
+
globalThis.navigator.msGetUserMedia;
|
|
26
|
+
return getUserMedia ? getUserMedia.bind(globalThis.navigator) : getUserMedia;
|
|
27
27
|
})(),
|
|
28
28
|
requestAnimFrame:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
globalThis.requestAnimationFrame ||
|
|
30
|
+
globalThis.webkitRequestAnimationFrame ||
|
|
31
|
+
globalThis.mozRequestAnimationFrame ||
|
|
32
|
+
globalThis.oRequestAnimationFrame ||
|
|
33
|
+
globalThis.msRequestAnimationFrame,
|
|
34
34
|
requestTimeout: function requestTimeout(callback, delay) {
|
|
35
35
|
callback = callback || utils.noop;
|
|
36
36
|
delay = delay || 0;
|
|
@@ -49,14 +49,14 @@ var utils = {
|
|
|
49
49
|
return handle;
|
|
50
50
|
},
|
|
51
51
|
Blob:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
globalThis.Blob ||
|
|
53
|
+
globalThis.BlobBuilder ||
|
|
54
|
+
globalThis.WebKitBlobBuilder ||
|
|
55
|
+
globalThis.MozBlobBuilder ||
|
|
56
|
+
globalThis.MSBlobBuilder,
|
|
57
57
|
btoa: (function () {
|
|
58
58
|
const btoa =
|
|
59
|
-
|
|
59
|
+
globalThis.btoa ||
|
|
60
60
|
function (input) {
|
|
61
61
|
let output = '';
|
|
62
62
|
let i = 0;
|
|
@@ -87,7 +87,7 @@ var utils = {
|
|
|
87
87
|
}
|
|
88
88
|
return output;
|
|
89
89
|
};
|
|
90
|
-
return btoa ? btoa.bind(
|
|
90
|
+
return btoa ? btoa.bind(globalThis) : utils.noop;
|
|
91
91
|
})(),
|
|
92
92
|
isObject: function isObject(obj) {
|
|
93
93
|
return obj && Object.prototype.toString.call(obj) === '[object Object]';
|
|
@@ -113,16 +113,16 @@ var utils = {
|
|
|
113
113
|
return el && el.getContext && el.getContext('2d');
|
|
114
114
|
},
|
|
115
115
|
webworkers: function webworkers() {
|
|
116
|
-
return
|
|
116
|
+
return globalThis.Worker;
|
|
117
117
|
},
|
|
118
118
|
blob: function blob() {
|
|
119
119
|
return utils.Blob;
|
|
120
120
|
},
|
|
121
121
|
Uint8Array: function Uint8Array() {
|
|
122
|
-
return
|
|
122
|
+
return globalThis.Uint8Array;
|
|
123
123
|
},
|
|
124
124
|
Uint32Array: function Uint32Array() {
|
|
125
|
-
return
|
|
125
|
+
return globalThis.Uint32Array;
|
|
126
126
|
},
|
|
127
127
|
videoCodecs: (function () {
|
|
128
128
|
const testEl = document.createElement('video');
|
|
@@ -266,7 +266,6 @@ const utils$2 = Object.freeze({
|
|
|
266
266
|
});
|
|
267
267
|
/*
|
|
268
268
|
error.js
|
|
269
|
-
========
|
|
270
269
|
*/
|
|
271
270
|
/* Copyright 2017 Yahoo Inc.
|
|
272
271
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -310,23 +309,23 @@ var error = {
|
|
|
310
309
|
},
|
|
311
310
|
{
|
|
312
311
|
condition: utils.isFunction(utils.URL),
|
|
313
|
-
errorCode: '
|
|
314
|
-
errorMsg: 'The
|
|
312
|
+
errorCode: 'globalThis.URL',
|
|
313
|
+
errorMsg: 'The globalThis.URL API is not supported in your browser'
|
|
315
314
|
},
|
|
316
315
|
{
|
|
317
316
|
condition: utils.isSupported.blob(),
|
|
318
|
-
errorCode: '
|
|
319
|
-
errorMsg: 'The
|
|
317
|
+
errorCode: 'globalThis.Blob',
|
|
318
|
+
errorMsg: 'The globalThis.Blob File API is not supported in your browser'
|
|
320
319
|
},
|
|
321
320
|
{
|
|
322
321
|
condition: utils.isSupported.Uint8Array(),
|
|
323
|
-
errorCode: '
|
|
324
|
-
errorMsg: 'The
|
|
322
|
+
errorCode: 'globalThis.Uint8Array',
|
|
323
|
+
errorMsg: 'The globalThis.Uint8Array function constructor is not supported in your browser'
|
|
325
324
|
},
|
|
326
325
|
{
|
|
327
326
|
condition: utils.isSupported.Uint32Array(),
|
|
328
|
-
errorCode: '
|
|
329
|
-
errorMsg: 'The
|
|
327
|
+
errorCode: 'globalThis.Uint32Array',
|
|
328
|
+
errorMsg: 'The globalThis.Uint32Array function constructor is not supported in your browser'
|
|
330
329
|
}
|
|
331
330
|
],
|
|
332
331
|
messages: {
|
|
@@ -341,7 +340,6 @@ const error$2 = Object.freeze({
|
|
|
341
340
|
});
|
|
342
341
|
/*
|
|
343
342
|
defaultOptions.js
|
|
344
|
-
=================
|
|
345
343
|
*/
|
|
346
344
|
/* Copyright 2017 Yahoo Inc.
|
|
347
345
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -384,7 +382,6 @@ const defaultOptions$2 = Object.freeze({
|
|
|
384
382
|
});
|
|
385
383
|
/*
|
|
386
384
|
isSupported.js
|
|
387
|
-
==============
|
|
388
385
|
*/
|
|
389
386
|
/* Copyright 2017 Yahoo Inc.
|
|
390
387
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -395,7 +392,6 @@ function isSupported() {
|
|
|
395
392
|
}
|
|
396
393
|
/*
|
|
397
394
|
isWebCamGIFSupported.js
|
|
398
|
-
=======================
|
|
399
395
|
*/
|
|
400
396
|
/* Copyright 2017 Yahoo Inc.
|
|
401
397
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -405,7 +401,6 @@ function isWebCamGIFSupported() {
|
|
|
405
401
|
}
|
|
406
402
|
/*
|
|
407
403
|
isSupported.js
|
|
408
|
-
==============
|
|
409
404
|
*/
|
|
410
405
|
/* Copyright 2017 Yahoo Inc.
|
|
411
406
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -419,7 +414,6 @@ function isSupported$1() {
|
|
|
419
414
|
}
|
|
420
415
|
/*
|
|
421
416
|
isExistingVideoGIFSupported.js
|
|
422
|
-
==============================
|
|
423
417
|
*/
|
|
424
418
|
/* Copyright 2017 Yahoo Inc.
|
|
425
419
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -447,7 +441,6 @@ function isExistingVideoGIFSupported(codecs) {
|
|
|
447
441
|
}
|
|
448
442
|
/*
|
|
449
443
|
NeuQuant.js
|
|
450
|
-
===========
|
|
451
444
|
*/
|
|
452
445
|
/*
|
|
453
446
|
* NeuQuant Neural-Net Quantization Algorithm
|
|
@@ -899,7 +892,6 @@ function NeuQuant() {
|
|
|
899
892
|
}
|
|
900
893
|
/*
|
|
901
894
|
processFrameWorker.js
|
|
902
|
-
=====================
|
|
903
895
|
*/
|
|
904
896
|
/* Copyright 2017 Yahoo Inc.
|
|
905
897
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -907,7 +899,7 @@ function NeuQuant() {
|
|
|
907
899
|
function workerCode() {
|
|
908
900
|
const self = this;
|
|
909
901
|
try {
|
|
910
|
-
|
|
902
|
+
globalThis.onmessage = function (ev) {
|
|
911
903
|
const data = ev.data || {};
|
|
912
904
|
let response;
|
|
913
905
|
if (data.gifshot) {
|
|
@@ -980,7 +972,6 @@ function workerCode() {
|
|
|
980
972
|
}
|
|
981
973
|
/*
|
|
982
974
|
gifWriter.js
|
|
983
|
-
============
|
|
984
975
|
*/
|
|
985
976
|
// (c) Dean McNamee <dean@gmail.com>, 2013.
|
|
986
977
|
//
|
|
@@ -1302,7 +1293,6 @@ function gifWriter(buf, width, height, gopts) {
|
|
|
1302
1293
|
}
|
|
1303
1294
|
/*
|
|
1304
1295
|
animatedGIF.js
|
|
1305
|
-
==============
|
|
1306
1296
|
*/
|
|
1307
1297
|
/* Copyright 2017 Yahoo Inc.
|
|
1308
1298
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -1611,7 +1601,6 @@ AnimatedGIF.prototype = {
|
|
|
1611
1601
|
};
|
|
1612
1602
|
/*
|
|
1613
1603
|
getBase64GIF.js
|
|
1614
|
-
===============
|
|
1615
1604
|
*/
|
|
1616
1605
|
/* Copyright 2017 Yahoo Inc.
|
|
1617
1606
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -1629,7 +1618,6 @@ function getBase64GIF(animatedGifInstance, callback) {
|
|
|
1629
1618
|
}
|
|
1630
1619
|
/*
|
|
1631
1620
|
existingImages.js
|
|
1632
|
-
=================
|
|
1633
1621
|
*/
|
|
1634
1622
|
/* Copyright 2017 Yahoo Inc.
|
|
1635
1623
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -1643,7 +1631,7 @@ function existingImages() {
|
|
|
1643
1631
|
let imagesLength = obj.imagesLength;
|
|
1644
1632
|
const skipObj = {
|
|
1645
1633
|
getUserMedia: true,
|
|
1646
|
-
'
|
|
1634
|
+
'globalThis.URL': true
|
|
1647
1635
|
};
|
|
1648
1636
|
const errorObj = error.validate(skipObj);
|
|
1649
1637
|
const loadedImages = [];
|
|
@@ -1726,7 +1714,6 @@ function existingImages() {
|
|
|
1726
1714
|
}
|
|
1727
1715
|
/*
|
|
1728
1716
|
screenShot.js
|
|
1729
|
-
=============
|
|
1730
1717
|
*/
|
|
1731
1718
|
/* Copyright 2017 Yahoo Inc.
|
|
1732
1719
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -1915,7 +1902,6 @@ const screenShot = {
|
|
|
1915
1902
|
};
|
|
1916
1903
|
/*
|
|
1917
1904
|
videoStream.js
|
|
1918
|
-
==============
|
|
1919
1905
|
*/
|
|
1920
1906
|
/* Copyright 2017 Yahoo Inc.
|
|
1921
1907
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -2165,7 +2151,6 @@ var videoStream = {
|
|
|
2165
2151
|
};
|
|
2166
2152
|
/*
|
|
2167
2153
|
stopVideoStreaming.js
|
|
2168
|
-
=====================
|
|
2169
2154
|
*/
|
|
2170
2155
|
/* Copyright 2017 Yahoo Inc.
|
|
2171
2156
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -2176,7 +2161,6 @@ function stopVideoStreaming(options) {
|
|
|
2176
2161
|
}
|
|
2177
2162
|
/*
|
|
2178
2163
|
createAndGetGIF.js
|
|
2179
|
-
==================
|
|
2180
2164
|
*/
|
|
2181
2165
|
/* Copyright 2017 Yahoo Inc.
|
|
2182
2166
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -2229,7 +2213,6 @@ function createAndGetGIF(obj, callback) {
|
|
|
2229
2213
|
}
|
|
2230
2214
|
/*
|
|
2231
2215
|
existingVideo.js
|
|
2232
|
-
================
|
|
2233
2216
|
*/
|
|
2234
2217
|
/* Copyright 2017 Yahoo Inc.
|
|
2235
2218
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -2242,7 +2225,7 @@ function existingVideo() {
|
|
|
2242
2225
|
const options = obj.options;
|
|
2243
2226
|
const skipObj = {
|
|
2244
2227
|
getUserMedia: true,
|
|
2245
|
-
'
|
|
2228
|
+
'globalThis.URL': true
|
|
2246
2229
|
};
|
|
2247
2230
|
const errorObj = error.validate(skipObj);
|
|
2248
2231
|
const loadedImages = 0;
|
|
@@ -2284,7 +2267,6 @@ function existingVideo() {
|
|
|
2284
2267
|
}
|
|
2285
2268
|
/*
|
|
2286
2269
|
existingWebcam.js
|
|
2287
|
-
=================
|
|
2288
2270
|
*/
|
|
2289
2271
|
/* Copyright 2017 Yahoo Inc.
|
|
2290
2272
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -2321,7 +2303,6 @@ function existingWebcam() {
|
|
|
2321
2303
|
}
|
|
2322
2304
|
/*
|
|
2323
2305
|
createGIF.js
|
|
2324
|
-
============
|
|
2325
2306
|
*/
|
|
2326
2307
|
/* Copyright 2017 Yahoo Inc.
|
|
2327
2308
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -2370,7 +2351,6 @@ function createGIF(userOptions, callback) {
|
|
|
2370
2351
|
}
|
|
2371
2352
|
/*
|
|
2372
2353
|
takeSnapShot.js
|
|
2373
|
-
===============
|
|
2374
2354
|
*/
|
|
2375
2355
|
/* Copyright 2017 Yahoo Inc.
|
|
2376
2356
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
@@ -2392,7 +2372,6 @@ function takeSnapShot(userOptions, callback) {
|
|
|
2392
2372
|
}
|
|
2393
2373
|
/*
|
|
2394
2374
|
API.js
|
|
2395
|
-
======
|
|
2396
2375
|
*/
|
|
2397
2376
|
/* Copyright 2017 Yahoo Inc.
|
|
2398
2377
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
package/dist/bundle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bundle.ts"],"names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"mappings":"AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AACAC,UAAU,CAACC,OAAX,GAAqBD,UAAU,CAACC,OAAX,IAAsB,EAA3C;AACAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcL,UAAU,CAACC,OAAzB,EAAkCH,aAAlC,CAAjB","sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"file":"bundle.js"}
|
package/dist/gif-builder.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/gif-builder.ts"],"names":["assert","gifshot","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","properties","id","name","extensions","mimeTypes","builder","options","constructor","files","initialize","add","file","push","build","_cleanOptions","images","video","length","Error","_createGIF","Promise","resolve","reject","createGIF","result","error","errorMsg","image","gifWidth","gifHeight","console","warn"],"mappings":"AAEA,SAAQA,MAAR,QAAqB,oBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AAGA,MAAMC,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,EAAGC,eAAD,IAAqB,CAAE,CARf;AAS1BC,EAAAA,gBAAgB,EAAE,MAAM,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,SAAS,EAAE,IAvBe;AAwB1BC,EAAAA,eAAe,EAAE,IAxBS;AAyB1BC,EAAAA,cAAc,EAAE,IAzBU;AA0B1BC,EAAAA,oBAAoB,EAAE,CA1BI;AA2B1BC,EAAAA,oBAAoB,EAAE,CA3BI;AA8B1BC,EAAAA,IAAI,EAAE,EA9BoB;AA+B1BC,EAAAA,aAAa,EAAE,I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A3B;AACA0C,IAAAA,OAAO,CAACuB,SAAR,GAAoBvB,OAAO,CAACzC,MAA5B;AACA,WAAOyC,OAAO,CAAC1C,KAAf;AACA,WAAO0C,OAAO,CAACzC,MAAf;AACD;;AApG6B","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"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["VideoLoader","default","GIFBuilder"],"mappings":"AAAA,SAAQA,WAAR,QAA0B,gBAA1B;AAEA,SAAQC,OAAO,IAAIC,UAAnB,QAAoC,eAApC","sourcesContent":["export {VideoLoader} from './video-loader';\n\nexport {default as GIFBuilder} from './gif-builder';\n"],"file":"index.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/gifshot/gifshot-loader.ts"],"names":["loadLibrary","loadGifshotPromise","loadGifshotModule","options","modules","gifshot","loadGifshot","libraryPath","globalThis"],"mappings":"AACA,SAAQA,WAAR,QAA0B,0BAA1B;AAEA,IAAIC,kBAAJ;AAEA,OAAO,eAAeC,iBAAf,CAAiCC,OAAO,GAAG,EAA3C,EAA+C;AACpD,QAAMC,OAAO,GAAGD,OAAO,CAACC,OAAR,IAAmB,EAAnC;;AACA,MAAIA,OAAO,CAACC,OAAZ,EAAqB;AACnB,WAAOD,OAAO,CAACC,OAAf;AACD;;AACDJ,EAAAA,kBAAkB,GAAGA,kBAAkB,IAAIK,WAAW,CAACH,OAAD,CAAtD;AACA,SAAO,MAAMF,kBAAb;AACD;;AAED,eAAeK,WAAf,CAA2BH,OAA3B,EAAoC;AAClCA,EAAAA,OAAO,CAACI,WAAR,GAAsBJ,OAAO,CAACI,WAAR,IAAuB,OAA7C;AACA,QAAMF,OAAO,GAAG,MAAML,WAAW,CAAC,YAAD,EAAe,SAAf,EAA0BG,OAA1B,CAAjC;AAIA,SAAOE,OAAO,IAAIG,UAAU,CAACH,OAA7B;AACD","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"],"file":"gifshot-loader.js"}
|