@loaders.gl/video 3.3.0-alpha.5 → 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.
@@ -1,20 +1,15 @@
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 = parseVideo;
9
-
10
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
-
12
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
-
14
10
  function parseVideo(_x) {
15
11
  return _parseVideo.apply(this, arguments);
16
12
  }
17
-
18
13
  function _parseVideo() {
19
14
  _parseVideo = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(arrayBuffer) {
20
15
  var blob, video;
@@ -26,7 +21,6 @@ function _parseVideo() {
26
21
  video = document.createElement('video');
27
22
  video.src = URL.createObjectURL(blob);
28
23
  return _context.abrupt("return", video);
29
-
30
24
  case 4:
31
25
  case "end":
32
26
  return _context.stop();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/parsers/parse-video.ts"],"names":["parseVideo","arrayBuffer","blob","Blob","video","document","createElement","src","URL","createObjectURL"],"mappings":";;;;;;;;;;;;;SAC8BA,U;;;;;0EAAf,iBAA0BC,WAA1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAIPC,YAAAA,IAJO,GAIA,IAAIC,IAAJ,CAAS,CAACF,WAAD,CAAT,CAJA;AAKPG,YAAAA,KALO,GAKCC,QAAQ,CAACC,aAAT,CAAuB,OAAvB,CALD;AAMbF,YAAAA,KAAK,CAACG,GAAN,GAAYC,GAAG,CAACC,eAAJ,CAAoBP,IAApB,CAAZ;AANa,6CAONE,KAPM;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G","sourcesContent":["// Parse to platform defined video type (HTMLVideoElement in browser)\nexport default async function parseVideo(arrayBuffer: ArrayBuffer): Promise<HTMLVideoElement> {\n // TODO It is probably somewhat inefficent to convert a File/Blob to ArrayBuffer and back\n // and could perhaps cause problems for large videos.\n // TODO MIME type is also lost from the File or Response...\n const blob = new Blob([arrayBuffer]);\n const video = document.createElement('video');\n video.src = URL.createObjectURL(blob);\n return video;\n}\n"],"file":"parse-video.js"}
1
+ {"version":3,"file":"parse-video.js","names":["parseVideo","arrayBuffer","blob","Blob","video","document","createElement","src","URL","createObjectURL"],"sources":["../../../../src/lib/parsers/parse-video.ts"],"sourcesContent":["// Parse to platform defined video type (HTMLVideoElement in browser)\nexport default async function parseVideo(arrayBuffer: ArrayBuffer): Promise<HTMLVideoElement> {\n // TODO It is probably somewhat inefficent to convert a File/Blob to ArrayBuffer and back\n // and could perhaps cause problems for large videos.\n // TODO MIME type is also lost from the File or Response...\n const blob = new Blob([arrayBuffer]);\n const video = document.createElement('video');\n video.src = URL.createObjectURL(blob);\n return video;\n}\n"],"mappings":";;;;;;;;;SAC8BA,UAAU;EAAA;AAAA;AAAA;EAAA,wEAAzB,iBAA0BC,WAAwB;IAAA;IAAA;MAAA;QAAA;UAAA;YAIzDC,IAAI,GAAG,IAAIC,IAAI,CAAC,CAACF,WAAW,CAAC,CAAC;YAC9BG,KAAK,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;YAC7CF,KAAK,CAACG,GAAG,GAAGC,GAAG,CAACC,eAAe,CAACP,IAAI,CAAC;YAAC,iCAC/BE,KAAK;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CACb;EAAA;AAAA"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.assert = assert;
7
-
8
7
  function assert(condition, message) {
9
8
  if (!condition) {
10
9
  throw new Error(message);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/utils/assert.ts"],"names":["assert","condition","message","Error"],"mappings":";;;;;;;AAAO,SAASA,MAAT,CAAgBC,SAAhB,EAAoCC,OAApC,EAA2D;AAChE,MAAI,CAACD,SAAL,EAAgB;AACd,UAAM,IAAIE,KAAJ,CAAUD,OAAV,CAAN;AACD;AACF","sourcesContent":["export function assert(condition: unknown, message: string): void {\n if (!condition) {\n throw new Error(message);\n }\n}\n"],"file":"assert.js"}
1
+ {"version":3,"file":"assert.js","names":["assert","condition","message","Error"],"sources":["../../../../src/lib/utils/assert.ts"],"sourcesContent":["export function assert(condition: unknown, message: string): void {\n if (!condition) {\n throw new Error(message);\n }\n}\n"],"mappings":";;;;;;AAAO,SAASA,MAAM,CAACC,SAAkB,EAAEC,OAAe,EAAQ;EAChE,IAAI,CAACD,SAAS,EAAE;IACd,MAAM,IAAIE,KAAK,CAACD,OAAO,CAAC;EAC1B;AACF"}
@@ -1,17 +1,15 @@
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._typecheckVideoLoader = exports.VideoLoader = void 0;
9
-
10
8
  var _parseVideo = _interopRequireDefault(require("./lib/parsers/parse-video"));
11
-
12
- var VERSION = typeof "3.3.0-alpha.5" !== 'undefined' ? "3.3.0-alpha.5" : 'latest';
9
+ var VERSION = typeof "3.3.0-alpha.6" !== 'undefined' ? "3.3.0-alpha.6" : 'latest';
13
10
  var EXTENSIONS = ['mp4'];
14
11
  var MIME_TYPES = ['video/mp4'];
12
+
15
13
  var DEFAULT_LOADER_OPTIONS = {
16
14
  video: {}
17
15
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/video-loader.ts"],"names":["VERSION","EXTENSIONS","MIME_TYPES","DEFAULT_LOADER_OPTIONS","video","VideoLoader","name","id","module","version","extensions","mimeTypes","parse","parseVideo","options","_typecheckVideoLoader"],"mappings":";;;;;;;;;AACA;;AAIA,IAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAEA,IAAMC,UAAU,GAAG,CAAC,KAAD,CAAnB;AACA,IAAMC,UAAU,GAAG,CAAC,WAAD,CAAnB;AAQA,IAAMC,sBAA0C,GAAG;AACjDC,EAAAA,KAAK,EAAE;AAD0C,CAAnD;AAIO,IAAMC,WAAW,GAAG;AACzBC,EAAAA,IAAI,EAAE,OADmB;AAEzBC,EAAAA,EAAE,EAAE,OAFqB;AAGzBC,EAAAA,MAAM,EAAE,OAHiB;AAIzBC,EAAAA,OAAO,EAAET,OAJgB;AAKzBU,EAAAA,UAAU,EAAET,UALa;AAMzBU,EAAAA,SAAS,EAAET,UANc;AAQzBU,EAAAA,KAAK,EAAEC,mBARkB;AAWzBC,EAAAA,OAAO,EAAEX;AAXgB,CAApB;;AAcA,IAAMY,qBAAuC,GAAGV,WAAhD","sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport parseVideo from './lib/parsers/parse-video';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nconst EXTENSIONS = ['mp4'];\nconst MIME_TYPES = ['video/mp4'];\n\n// Loads a platform-specific image type that can be used as input data to WebGL textures\n\nexport type VideoLoaderOptions = LoaderOptions & {\n video: {};\n};\n\nconst DEFAULT_LOADER_OPTIONS: VideoLoaderOptions = {\n video: {}\n};\n\nexport const VideoLoader = {\n name: 'Video',\n id: 'video',\n module: 'video',\n version: VERSION,\n extensions: EXTENSIONS,\n mimeTypes: MIME_TYPES,\n\n parse: parseVideo,\n\n // tests: arrayBuffer => Boolean(getBinaryImageMetadata(new DataView(arrayBuffer))),\n options: DEFAULT_LOADER_OPTIONS\n};\n\nexport const _typecheckVideoLoader: LoaderWithParser = VideoLoader;\n"],"file":"video-loader.js"}
1
+ {"version":3,"file":"video-loader.js","names":["VERSION","EXTENSIONS","MIME_TYPES","DEFAULT_LOADER_OPTIONS","video","VideoLoader","name","id","module","version","extensions","mimeTypes","parse","parseVideo","options","_typecheckVideoLoader"],"sources":["../../src/video-loader.ts"],"sourcesContent":["import type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport parseVideo from './lib/parsers/parse-video';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nconst EXTENSIONS = ['mp4'];\nconst MIME_TYPES = ['video/mp4'];\n\n// Loads a platform-specific image type that can be used as input data to WebGL textures\n\nexport type VideoLoaderOptions = LoaderOptions & {\n video: {};\n};\n\nconst DEFAULT_LOADER_OPTIONS: VideoLoaderOptions = {\n video: {}\n};\n\nexport const VideoLoader = {\n name: 'Video',\n id: 'video',\n module: 'video',\n version: VERSION,\n extensions: EXTENSIONS,\n mimeTypes: MIME_TYPES,\n\n parse: parseVideo,\n\n // tests: arrayBuffer => Boolean(getBinaryImageMetadata(new DataView(arrayBuffer))),\n options: DEFAULT_LOADER_OPTIONS\n};\n\nexport const _typecheckVideoLoader: LoaderWithParser = VideoLoader;\n"],"mappings":";;;;;;;AACA;AAIA,IAAMA,OAAO,GAAG,sBAAkB,KAAK,WAAW,qBAAiB,QAAQ;AAE3E,IAAMC,UAAU,GAAG,CAAC,KAAK,CAAC;AAC1B,IAAMC,UAAU,GAAG,CAAC,WAAW,CAAC;;AAQhC,IAAMC,sBAA0C,GAAG;EACjDC,KAAK,EAAE,CAAC;AACV,CAAC;AAEM,IAAMC,WAAW,GAAG;EACzBC,IAAI,EAAE,OAAO;EACbC,EAAE,EAAE,OAAO;EACXC,MAAM,EAAE,OAAO;EACfC,OAAO,EAAET,OAAO;EAChBU,UAAU,EAAET,UAAU;EACtBU,SAAS,EAAET,UAAU;EAErBU,KAAK,EAAEC,mBAAU;EAGjBC,OAAO,EAAEX;AACX,CAAC;AAAC;AAEK,IAAMY,qBAAuC,GAAGV,WAAW;AAAC"}
@@ -1,5 +1,5 @@
1
- const moduleExports = require('./index');
2
1
 
2
+ const moduleExports = require('./index');
3
3
  globalThis.loaders = globalThis.loaders || {};
4
4
  module.exports = Object.assign(globalThis.loaders, moduleExports);
5
5
  //# sourceMappingURL=bundle.js.map
@@ -1 +1 @@
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"}
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,MAAMA,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"}
@@ -1,24 +1,32 @@
1
+
1
2
  import { assert } from './lib/utils/assert';
2
3
  import gifshot from './lib/gifshot/gifshot';
4
+
3
5
  const GIF_BUILDER_OPTIONS = {
4
6
  source: 'images',
5
7
  width: 200,
6
8
  height: 200,
9
+
7
10
  crossOrigin: 'Anonymous',
11
+
8
12
  progressCallback: captureProgress => {},
9
13
  completeCallback: () => {},
14
+
10
15
  numWorkers: 2,
11
16
  sampleInterval: 10,
12
17
  interval: 0.1,
13
18
  offset: null,
14
19
  numFrames: 10,
15
20
  frameDuration: 1,
21
+
16
22
  filter: '',
23
+
17
24
  waterMark: null,
18
25
  waterMarkHeight: null,
19
26
  waterMarkWidth: null,
20
27
  waterMarkXCoordinate: 1,
21
28
  waterMarkYCoordinate: 1,
29
+
22
30
  text: '',
23
31
  showFrameText: true,
24
32
  fontWeight: 'normal',
@@ -31,12 +39,15 @@ const GIF_BUILDER_OPTIONS = {
31
39
  textBaseline: 'bottom',
32
40
  textXCoordinate: null,
33
41
  textYCoordinate: null,
42
+
34
43
  webcamVideoElement: null,
35
44
  keepCameraOn: false,
36
45
  cameraStream: null,
46
+
37
47
  saveRenderingContexts: false,
38
48
  savedRenderingContexts: []
39
49
  };
50
+
40
51
  export default class GIFBuilder {
41
52
  static get properties() {
42
53
  return {
@@ -48,57 +59,53 @@ export default class GIFBuilder {
48
59
  options: GIF_BUILDER_OPTIONS
49
60
  };
50
61
  }
51
-
52
62
  constructor(options) {
53
- this.options = { ...options
63
+ this.options = {
64
+ ...options
54
65
  };
55
66
  this.source = options.source;
56
67
  delete options.source;
68
+
57
69
  this.files = [];
70
+
58
71
  this.gifshot = gifshot;
59
72
  }
60
-
61
- async initialize(options) {}
62
-
73
+ async initialize(options) {
74
+ }
63
75
  async add(file) {
64
76
  await this.initialize();
65
77
  this.files.push(file);
66
78
  }
67
-
68
79
  async build() {
69
80
  await this.initialize();
70
-
71
81
  this._cleanOptions(this.options);
72
-
73
82
  switch (this.source) {
74
83
  case 'images':
75
84
  this.options.images = this.files;
76
85
  break;
77
-
78
86
  case 'video':
79
87
  this.options.video = this.files;
80
88
  break;
81
-
82
89
  case 'webcam':
83
90
  assert(this.files.length === 0);
84
91
  break;
85
-
86
92
  default:
87
93
  throw new Error('GIFBuilder: invalid source');
88
94
  }
89
-
90
95
  return await this._createGIF();
91
96
  }
92
97
 
93
98
  async _createGIF() {
94
99
  return new Promise((resolve, reject) => {
95
100
  this.gifshot.createGIF(this.options, result => {
101
+
96
102
  if (result.error) {
97
103
  reject(result.errorMsg);
98
104
  return;
99
105
  }
100
106
 
101
107
  resolve(result.image);
108
+
102
109
  });
103
110
  });
104
111
  }
@@ -110,11 +117,11 @@ export default class GIFBuilder {
110
117
 
111
118
  delete options.video;
112
119
  delete options.images;
120
+
113
121
  options.gifWidth = options.width;
114
122
  options.gifHeight = options.height;
115
123
  delete options.width;
116
124
  delete options.height;
117
125
  }
118
-
119
126
  }
120
127
  //# sourceMappingURL=gif-builder.js.map
@@ -1 +1 @@
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;A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B;AAChBH,UAAAA,MAAM,CAACE,MAAM,CAACE,QAAR,CAAN;AACA;AACD;;AAGDL,QAAAA,OAAO,CAACG,MAAM,CAACG,KAAR,CAAP;AAMD,OAtBD;AAuBD,KAxBM,CAAP;AAyBD;;AAGDb,EAAAA,aAAa,CAACR,OAAD,EAAgB;AAC3B,QAAIA,OAAO,CAACU,KAAR,IAAiBV,OAAO,CAACS,MAAzB,IAAmCT,OAAO,CAACsB,QAA3C,IAAuDtB,OAAO,CAACuB,SAAnE,EAA8E;AAC5EC,MAAAA,OAAO,CAACC,IAAR,CAAa,8BAAb;AACD;;AAGD,WAAOzB,OAAO,CAACU,KAAf;AACA,WAAOV,OAAO,CAACS,MAAf;AAGAT,IAAAA,OAAO,CAACsB,QAAR,GAAmBtB,OAAO,CAAC1C,KAA3B;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"}
1
+ {"version":3,"file":"gif-builder.js","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"],"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,SAAQA,MAAM,QAAO,oBAAoB;AACzC,OAAOC,OAAO,MAAM,uBAAuB;;AAG3C,MAAMC,mBAAmB,GAAG;EAC1BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE,GAAG;;EAEXC,WAAW,EAAE,WAAW;;EAGxBC,gBAAgB,EAAGC,eAAe,IAAK,CAAC,CAAC;EACzCC,gBAAgB,EAAE,MAAM,CAAC,CAAC;;EAG1BC,UAAU,EAAE,CAAC;EACbC,cAAc,EAAE,EAAE;EAClBC,QAAQ,EAAE,GAAG;EACbC,MAAM,EAAE,IAAI;EACZC,SAAS,EAAE,EAAE;EAC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ACpB,OAAOV,OAAO,CAACS,MAAM;;IAGrBT,OAAO,CAACsB,QAAQ,GAAGtB,OAAO,CAAC1C,KAAK;IAChC0C,OAAO,CAACuB,SAAS,GAAGvB,OAAO,CAACzC,MAAM;IAClC,OAAOyC,OAAO,CAAC1C,KAAK;IACpB,OAAO0C,OAAO,CAACzC,MAAM;EACvB;AACF"}
@@ -1 +1 @@
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
+ {"version":3,"file":"index.js","names":["VideoLoader","default","GIFBuilder"],"sources":["../../src/index.ts"],"sourcesContent":["export {VideoLoader} from './video-loader';\n\nexport {default as GIFBuilder} from './gif-builder';\n"],"mappings":"AAAA,SAAQA,WAAW,QAAO,gBAAgB;AAE1C,SAAQC,OAAO,IAAIC,UAAU,QAAO,eAAe"}
@@ -1,19 +1,19 @@
1
+
1
2
  import { loadLibrary } from '@loaders.gl/worker-utils';
2
3
  let loadGifshotPromise;
3
- export async function loadGifshotModule(options = {}) {
4
+ export async function loadGifshotModule() {
5
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4
6
  const modules = options.modules || {};
5
-
6
7
  if (modules.gifshot) {
7
8
  return modules.gifshot;
8
9
  }
9
-
10
10
  loadGifshotPromise = loadGifshotPromise || loadGifshot(options);
11
11
  return await loadGifshotPromise;
12
12
  }
13
-
14
13
  async function loadGifshot(options) {
15
14
  options.libraryPath = options.libraryPath || 'libs/';
16
15
  const gifshot = await loadLibrary('gifshot.js', 'gifshot', options);
16
+
17
17
  return gifshot || globalThis.gifshot;
18
18
  }
19
19
  //# sourceMappingURL=gifshot-loader.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"gifshot-loader.js","names":["loadLibrary","loadGifshotPromise","loadGifshotModule","options","modules","gifshot","loadGifshot","libraryPath","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,SAAQA,WAAW,QAAO,0BAA0B;AAEpD,IAAIC,kBAAkB;AAEtB,OAAO,eAAeC,iBAAiB,GAAe;EAAA,IAAdC,OAAO,uEAAG,CAAC,CAAC;EAClD,MAAMC,OAAO,GAAGD,OAAO,CAACC,OAAO,IAAI,CAAC,CAAC;EACrC,IAAIA,OAAO,CAACC,OAAO,EAAE;IACnB,OAAOD,OAAO,CAACC,OAAO;EACxB;EACAJ,kBAAkB,GAAGA,kBAAkB,IAAIK,WAAW,CAACH,OAAO,CAAC;EAC/D,OAAO,MAAMF,kBAAkB;AACjC;AAEA,eAAeK,WAAW,CAACH,OAAO,EAAE;EAClCA,OAAO,CAACI,WAAW,GAAGJ,OAAO,CAACI,WAAW,IAAI,OAAO;EACpD,MAAMF,OAAO,GAAG,MAAML,WAAW,CAAC,YAAY,EAAE,SAAS,EAAEG,OAAO,CAAC;;EAInE,OAAOE,OAAO,IAAIG,UAAU,CAACH,OAAO;AACtC"}