@loaders.gl/video 3.4.0-alpha.1 → 3.4.0-alpha.3

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.
@@ -14,17 +14,15 @@ function _parseVideo() {
14
14
  _parseVideo = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(arrayBuffer) {
15
15
  var blob, video;
16
16
  return _regenerator.default.wrap(function _callee$(_context) {
17
- while (1) {
18
- switch (_context.prev = _context.next) {
19
- case 0:
20
- blob = new Blob([arrayBuffer]);
21
- video = document.createElement('video');
22
- video.src = URL.createObjectURL(blob);
23
- return _context.abrupt("return", video);
24
- case 4:
25
- case "end":
26
- return _context.stop();
27
- }
17
+ while (1) switch (_context.prev = _context.next) {
18
+ case 0:
19
+ blob = new Blob([arrayBuffer]);
20
+ video = document.createElement('video');
21
+ video.src = URL.createObjectURL(blob);
22
+ return _context.abrupt("return", video);
23
+ case 4:
24
+ case "end":
25
+ return _context.stop();
28
26
  }
29
27
  }, _callee);
30
28
  }));
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"parse-video.js","names":["parseVideo","_x","_parseVideo","apply","arguments","_asyncToGenerator2","default","_regenerator","mark","_callee","arrayBuffer","blob","video","wrap","_callee$","_context","prev","next","Blob","document","createElement","src","URL","createObjectURL","abrupt","stop"],"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,UAAUA,CAAAC,EAAA;EAAA,OAAAC,WAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAAA,SAAAF,YAAA;EAAAA,WAAA,OAAAG,kBAAA,CAAAC,OAAA,EAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAzB,SAAAC,QAA0BC,WAAwB;IAAA,IAAAC,IAAA,EAAAC,KAAA;IAAA,OAAAL,YAAA,CAAAD,OAAA,CAAAO,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAIzDN,IAAI,GAAG,IAAIO,IAAI,CAAC,CAACR,WAAW,CAAC,CAAC;UAC9BE,KAAK,GAAGO,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;UAC7CR,KAAK,CAACS,GAAG,GAAGC,GAAG,CAACC,eAAe,CAACZ,IAAI,CAAC;UAAC,OAAAI,QAAA,CAAAS,MAAA,WAC/BZ,KAAK;QAAA;QAAA;UAAA,OAAAG,QAAA,CAAAU,IAAA;MAAA;IAAA,GAAAhB,OAAA;EAAA,CACb;EAAA,OAAAP,WAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"}
@@ -1 +1 @@
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
+ {"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,MAAMA,CAACC,SAAkB,EAAEC,OAAe,EAAQ;EAChE,IAAI,CAACD,SAAS,EAAE;IACd,MAAM,IAAIE,KAAK,CAACD,OAAO,CAAC;EAC1B;AACF"}
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports._typecheckVideoLoader = exports.VideoLoader = void 0;
8
8
  var _parseVideo = _interopRequireDefault(require("./lib/parsers/parse-video"));
9
- var VERSION = typeof "3.4.0-alpha.1" !== 'undefined' ? "3.4.0-alpha.1" : 'latest';
9
+ var VERSION = typeof "3.4.0-alpha.3" !== 'undefined' ? "3.4.0-alpha.3" : 'latest';
10
10
  var EXTENSIONS = ['mp4'];
11
11
  var MIME_TYPES = ['video/mp4'];
12
-
13
12
  var DEFAULT_LOADER_OPTIONS = {
14
13
  video: {}
15
14
  };
@@ -1 +1 @@
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
+ {"version":3,"file":"video-loader.js","names":["_parseVideo","_interopRequireDefault","require","VERSION","EXTENSIONS","MIME_TYPES","DEFAULT_LOADER_OPTIONS","video","VideoLoader","name","id","module","version","extensions","mimeTypes","parse","parseVideo","options","exports","_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,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAMC,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;AAACY,OAAA,CAAAV,WAAA,GAAAA,WAAA;AAEK,IAAMW,qBAAuC,GAAGX,WAAW;AAACU,OAAA,CAAAC,qBAAA,GAAAA,qBAAA"}
@@ -1,4 +1,3 @@
1
-
2
1
  const moduleExports = require('./index');
3
2
  globalThis.loaders = globalThis.loaders || {};
4
3
  module.exports = Object.assign(globalThis.loaders, moduleExports);
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.js","names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"sources":["../../src/bundle.ts"],"sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"mappings":";AACA,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
+ {"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,32 +1,24 @@
1
-
2
1
  import { assert } from './lib/utils/assert';
3
2
  import gifshot from './lib/gifshot/gifshot';
4
-
5
3
  const GIF_BUILDER_OPTIONS = {
6
4
  source: 'images',
7
5
  width: 200,
8
6
  height: 200,
9
-
10
7
  crossOrigin: 'Anonymous',
11
-
12
8
  progressCallback: captureProgress => {},
13
9
  completeCallback: () => {},
14
-
15
10
  numWorkers: 2,
16
11
  sampleInterval: 10,
17
12
  interval: 0.1,
18
13
  offset: null,
19
14
  numFrames: 10,
20
15
  frameDuration: 1,
21
-
22
16
  filter: '',
23
-
24
17
  waterMark: null,
25
18
  waterMarkHeight: null,
26
19
  waterMarkWidth: null,
27
20
  waterMarkXCoordinate: 1,
28
21
  waterMarkYCoordinate: 1,
29
-
30
22
  text: '',
31
23
  showFrameText: true,
32
24
  fontWeight: 'normal',
@@ -39,15 +31,12 @@ const GIF_BUILDER_OPTIONS = {
39
31
  textBaseline: 'bottom',
40
32
  textXCoordinate: null,
41
33
  textYCoordinate: null,
42
-
43
34
  webcamVideoElement: null,
44
35
  keepCameraOn: false,
45
36
  cameraStream: null,
46
-
47
37
  saveRenderingContexts: false,
48
38
  savedRenderingContexts: []
49
39
  };
50
-
51
40
  export default class GIFBuilder {
52
41
  static get properties() {
53
42
  return {
@@ -65,13 +54,10 @@ export default class GIFBuilder {
65
54
  };
66
55
  this.source = options.source;
67
56
  delete options.source;
68
-
69
57
  this.files = [];
70
-
71
58
  this.gifshot = gifshot;
72
59
  }
73
- async initialize(options) {
74
- }
60
+ async initialize(options) {}
75
61
  async add(file) {
76
62
  await this.initialize();
77
63
  this.files.push(file);
@@ -94,30 +80,23 @@ export default class GIFBuilder {
94
80
  }
95
81
  return await this._createGIF();
96
82
  }
97
-
98
83
  async _createGIF() {
99
84
  return new Promise((resolve, reject) => {
100
85
  this.gifshot.createGIF(this.options, result => {
101
-
102
86
  if (result.error) {
103
87
  reject(result.errorMsg);
104
88
  return;
105
89
  }
106
-
107
90
  resolve(result.image);
108
-
109
91
  });
110
92
  });
111
93
  }
112
-
113
94
  _cleanOptions(options) {
114
95
  if (options.video || options.images || options.gifWidth || options.gifHeight) {
115
96
  console.warn('GIFBuilder: ignoring options');
116
97
  }
117
-
118
98
  delete options.video;
119
99
  delete options.images;
120
-
121
100
  options.gifWidth = options.width;
122
101
  options.gifHeight = options.height;
123
102
  delete options.width;
@@ -1 +1 @@
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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AAQ,CAAC;UACvB;QACF;;QAGAL,OAAO,CAACG,MAAM,CAACG,KAAK,CAAC;;MAMvB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;;EAGAb,aAAa,CAACR,OAAO,EAAQ;IAC3B,IAAIA,OAAO,CAACU,KAAK,IAAIV,OAAO,CAACS,MAAM,IAAIT,OAAO,CAACsB,QAAQ,IAAItB,OAAO,CAACuB,SAAS,EAAE;MAC5EC,OAAO,CAACC,IAAI,CAAC,8BAA8B,CAAC;IAC9C;;IAGA,OAAOzB,OAAO,CAACU,KAAK;IACpB,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
+ {"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,EAAEA,CAAA,KAAM,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;EAGVC,SAAS,EAAE,IAAI;EACfC,eAAe,EAAE,IAAI;EACrBC,cAAc,EAAE,IAAI;EACpBC,oBAAoB,EAAE,CAAC;EACvBC,oBAAoB,EAAE,CAAC;EAGvBC,IAAI,EAAE,EAAE;EACRC,aAAa,EAAE,IAAI;EACnBC,UAAU,EAAE,QAAQ;EACpBC,QAAQ,EAAE,MAAM;EAChBC,WAAW,EAAE,MAAM;EACnBC,UAAU,EAAE,KAAK;EACjBC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,SAAS;EACpBC,SAAS,EAAE,QAAQ;EACnBC,YAAY,EAAE,QAAQ;EACtBC,eAAe,EAAE,IAAI;EACrBC,eAAe,EAAE,IAAI;EAKrBC,kBAAkB,EAAE,IAAI;EACxBC,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AAC;QAC/B;MACF;QACE,MAAM,IAAIC,KAAK,CAAC,4BAA4B,CAAC;IAAC;IAGlD,OAAO,MAAM,IAAI,CAACC,UAAU,EAAE;EAChC;EAIA,MAAMA,UAAUA,CAAA,EAAoB;IAClC,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;MACtC,IAAI,CAAC7D,OAAO,CAAC8D,SAAS,CAAC,IAAI,CAACjB,OAAO,EAAGkB,MAAM,IAAK;QAU/C,IAAIA,MAAM,CAACC,KAAK,EAAE;UAChBH,MAAM,CAACE,MAAM,CAACE,QAAQ,CAAC;UACvB;QACF;QAGAL,OAAO,CAACG,MAAM,CAACG,KAAK,CAAC;MAMvB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;EAGAb,aAAaA,CAACR,OAAO,EAAQ;IAC3B,IAAIA,OAAO,CAACU,KAAK,IAAIV,OAAO,CAACS,MAAM,IAAIT,OAAO,CAACsB,QAAQ,IAAItB,OAAO,CAACuB,SAAS,EAAE;MAC5EC,OAAO,CAACC,IAAI,CAAC,8BAA8B,CAAC;IAC9C;IAGA,OAAOzB,OAAO,CAACU,KAAK;IACpB,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,4 +1,3 @@
1
-
2
1
  import { loadLibrary } from '@loaders.gl/worker-utils';
3
2
  let loadGifshotPromise;
4
3
  export async function loadGifshotModule() {
@@ -13,7 +12,6 @@ export async function loadGifshotModule() {
13
12
  async function loadGifshot(options) {
14
13
  options.libraryPath = options.libraryPath || 'libs/';
15
14
  const gifshot = await loadLibrary('gifshot.js', 'gifshot', options);
16
-
17
15
  return gifshot || globalThis.gifshot;
18
16
  }
19
17
  //# sourceMappingURL=gifshot-loader.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"gifshot-loader.js","names":["loadLibrary","loadGifshotPromise","loadGifshotModule","options","arguments","length","undefined","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,iBAAiBA,CAAA,EAAe;EAAA,IAAdC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAClD,MAAMG,OAAO,GAAGJ,OAAO,CAACI,OAAO,IAAI,CAAC,CAAC;EACrC,IAAIA,OAAO,CAACC,OAAO,EAAE;IACnB,OAAOD,OAAO,CAACC,OAAO;EACxB;EACAP,kBAAkB,GAAGA,kBAAkB,IAAIQ,WAAW,CAACN,OAAO,CAAC;EAC/D,OAAO,MAAMF,kBAAkB;AACjC;AAEA,eAAeQ,WAAWA,CAACN,OAAO,EAAE;EAClCA,OAAO,CAACO,WAAW,GAAGP,OAAO,CAACO,WAAW,IAAI,OAAO;EACpD,MAAMF,OAAO,GAAG,MAAMR,WAAW,CAAC,YAAY,EAAE,SAAS,EAAEG,OAAO,CAAC;EAInE,OAAOK,OAAO,IAAIG,UAAU,CAACH,OAAO;AACtC"}
@@ -1,5 +1,3 @@
1
-
2
-
3
1
  var utils = {
4
2
  URL: globalThis.URL || globalThis.webkitURL || globalThis.mozURL || globalThis.msURL,
5
3
  getUserMedia: function () {
@@ -441,7 +439,6 @@ function NeuQuant() {
441
439
  smallval = q[1];
442
440
  }
443
441
  }
444
-
445
442
  q = network[smallpos];
446
443
  if (i != smallpos) {
447
444
  j = q[0];
@@ -757,7 +754,6 @@ function workerCode() {
757
754
  rgb.push(data[i++]);
758
755
  i++;
759
756
  }
760
-
761
757
  return rgb;
762
758
  },
763
759
  componentizedPaletteToArray: function componentizedPaletteToArray(paletteRGB) {
@@ -826,8 +822,7 @@ function gifWriter(buf, width, height, gopts) {
826
822
  buf[p++] = width >> 8 & 0xff;
827
823
  buf[p++] = height & 0xff;
828
824
  buf[p++] = height >> 8 & 0xff;
829
- buf[p++] = (global_palette !== null ? 0x80 : 0) |
830
- gp_num_colors_pow2;
825
+ buf[p++] = (global_palette !== null ? 0x80 : 0) | gp_num_colors_pow2;
831
826
  buf[p++] = background;
832
827
  buf[p++] = 0;
833
828
  if (loop_count !== null) {
@@ -852,7 +847,6 @@ function gifWriter(buf, width, height, gopts) {
852
847
  buf[p++] = loop_count >> 8 & 0xff;
853
848
  buf[p++] = 0x00;
854
849
  }
855
-
856
850
  let ended = false;
857
851
  this.addFrame = function (x, y, w, h, indexed_pixels, opts) {
858
852
  if (ended === true) {
@@ -878,8 +872,7 @@ function gifWriter(buf, width, height, gopts) {
878
872
  num_colors = 1 << min_code_size;
879
873
  const delay = opts.delay === undefined ? 0 : opts.delay;
880
874
  const disposal = opts.disposal === undefined ? 0 : opts.disposal;
881
- if (disposal < 0 || disposal > 3)
882
- throw 'Disposal out of range.';
875
+ if (disposal < 0 || disposal > 3) throw 'Disposal out of range.';
883
876
  let use_transparency = false;
884
877
  let transparent_index = 0;
885
878
  if (opts.transparent !== undefined && opts.transparent !== null) {
@@ -978,13 +971,11 @@ function gifWriter(buf, width, height, gopts) {
978
971
  if (next_code >= 1 << cur_code_size) ++cur_code_size;
979
972
  code_table[cur_key] = next_code++;
980
973
  }
981
-
982
974
  ib_code = k;
983
975
  } else {
984
976
  ib_code = cur_code;
985
977
  }
986
978
  }
987
-
988
979
  emit_code(ib_code);
989
980
  emit_code(eoi_code);
990
981
  emit_bytes_to_buffer(1);