@loaders.gl/video 3.4.10 → 3.4.12

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.
@@ -6,7 +6,7 @@ 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.10" !== 'undefined' ? "3.4.10" : 'latest';
9
+ var VERSION = typeof "3.4.12" !== 'undefined' ? "3.4.12" : 'latest';
10
10
  var EXTENSIONS = ['mp4'];
11
11
  var MIME_TYPES = ['video/mp4'];
12
12
  var DEFAULT_LOADER_OPTIONS = {
@@ -1,5 +1,5 @@
1
1
  import parseVideo from './lib/parsers/parse-video';
2
- const VERSION = typeof "3.4.10" !== 'undefined' ? "3.4.10" : 'latest';
2
+ const VERSION = typeof "3.4.12" !== 'undefined' ? "3.4.12" : 'latest';
3
3
  const EXTENSIONS = ['mp4'];
4
4
  const MIME_TYPES = ['video/mp4'];
5
5
  const DEFAULT_LOADER_OPTIONS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/video",
3
- "version": "3.4.10",
3
+ "version": "3.4.12",
4
4
  "description": "Framework-independent loaders and writers for video (MP4, WEBM, ...)",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -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": "3.4.10",
36
- "@loaders.gl/worker-utils": "3.4.10",
35
+ "@loaders.gl/loader-utils": "3.4.12",
36
+ "@loaders.gl/worker-utils": "3.4.12",
37
37
  "gifshot": "^0.4.5"
38
38
  },
39
- "gitHead": "4568459c96eaf0480a50ab77cace355307f61f04"
39
+ "gitHead": "85254762ae3082f608a863291deef09f2b40c6cf"
40
40
  }
package/dist/bundle.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- const moduleExports = require('./index');
4
- globalThis.loaders = globalThis.loaders || {};
5
- module.exports = Object.assign(globalThis.loaders, moduleExports);
@@ -1,142 +0,0 @@
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
- // A GIFBuilder based on the gifshot module
7
- // @ts-nocheck
8
- const assert_1 = require("./lib/utils/assert");
9
- const gifshot_1 = __importDefault(require("./lib/gifshot/gifshot")); // TODO - load dynamically to avoid bloating
10
- // These are gifshot module options
11
- const GIF_BUILDER_OPTIONS = {
12
- source: 'images',
13
- width: 200,
14
- height: 200,
15
- crossOrigin: 'Anonymous',
16
- // CALLBACKS
17
- progressCallback: (captureProgress) => { },
18
- completeCallback: () => { },
19
- // QUALITY SETTINGS
20
- numWorkers: 2,
21
- sampleInterval: 10,
22
- interval: 0.1,
23
- offset: null,
24
- numFrames: 10,
25
- frameDuration: 1,
26
- // CSS FILTER OPTIONS
27
- filter: '',
28
- // WATERMARK OPTIONS
29
- waterMark: null,
30
- waterMarkHeight: null,
31
- waterMarkWidth: null,
32
- waterMarkXCoordinate: 1,
33
- waterMarkYCoordinate: 1,
34
- // TEXT OPTIONS
35
- text: '',
36
- showFrameText: true,
37
- fontWeight: 'normal',
38
- fontSize: '16px',
39
- minFontSize: '10px',
40
- resizeFont: false,
41
- fontFamily: 'sans-serif',
42
- fontColor: '#ffffff',
43
- textAlign: 'center',
44
- textBaseline: 'bottom',
45
- textXCoordinate: null,
46
- textYCoordinate: null,
47
- // ADVANCED OPTIONS
48
- // WEBCAM CAPTURE OPTIONS
49
- webcamVideoElement: null,
50
- keepCameraOn: false,
51
- cameraStream: null,
52
- // CANVAS OPTIMIZATION OPTIONS
53
- saveRenderingContexts: false,
54
- savedRenderingContexts: [] // Array of canvas image data
55
- };
56
- class GIFBuilder {
57
- static get properties() {
58
- return {
59
- id: 'gif',
60
- name: 'GIF',
61
- extensions: ['gif'],
62
- mimeTypes: ['image/gif'],
63
- builder: GIFBuilder,
64
- options: GIF_BUILDER_OPTIONS
65
- };
66
- }
67
- constructor(options) {
68
- this.options = { ...options };
69
- this.source = options.source;
70
- delete options.source;
71
- // Allow files to be added
72
- this.files = [];
73
- // Expose the gifshot module so that the full gifshot API is available to apps (Experimental)
74
- this.gifshot = gifshot_1.default;
75
- }
76
- async initialize(options) {
77
- // Expose the gifshot module so that the full gifshot API is available to apps (Experimental)
78
- // this.gifshot = await loadGifshotModule(options);
79
- }
80
- async add(file) {
81
- await this.initialize();
82
- this.files.push(file);
83
- }
84
- async build() {
85
- await this.initialize();
86
- this._cleanOptions(this.options);
87
- switch (this.source) {
88
- case 'images':
89
- this.options.images = this.files;
90
- break;
91
- case 'video':
92
- this.options.video = this.files;
93
- break;
94
- case 'webcam':
95
- (0, assert_1.assert)(this.files.length === 0);
96
- break;
97
- default:
98
- throw new Error('GIFBuilder: invalid source');
99
- }
100
- return await this._createGIF();
101
- }
102
- // PRIVATE
103
- async _createGIF() {
104
- return new Promise((resolve, reject) => {
105
- this.gifshot.createGIF(this.options, (result) => {
106
- // callback object properties
107
- // --------------------------
108
- // image - Base 64 image
109
- // cameraStream - The webRTC MediaStream object
110
- // error - Boolean that determines if an error occurred
111
- // errorCode - Helpful error label
112
- // errorMsg - Helpful error message
113
- // savedRenderingContexts - An array of canvas image data (will only be set if the saveRenderingContexts option was used)
114
- if (result.error) {
115
- reject(result.errorMsg);
116
- return;
117
- }
118
- // image - Base 64 image
119
- resolve(result.image);
120
- // var image = obj.image,
121
- // animatedImage = document.createElement('img');
122
- // animatedImage.src = image;
123
- // document.body.appendChild(animatedImage);
124
- });
125
- });
126
- }
127
- // Remove some gifshot options
128
- _cleanOptions(options) {
129
- if (options.video || options.images || options.gifWidth || options.gifHeight) {
130
- console.warn('GIFBuilder: ignoring options'); // eslint-disable-line
131
- }
132
- // We control these through options.source instead
133
- delete options.video;
134
- delete options.images;
135
- // Use width/height props (to standardize across builders)
136
- options.gifWidth = options.width;
137
- options.gifHeight = options.height;
138
- delete options.width;
139
- delete options.height;
140
- }
141
- }
142
- exports.default = GIFBuilder;
package/dist/index.js DELETED
@@ -1,10 +0,0 @@
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.GIFBuilder = exports.VideoLoader = void 0;
7
- var video_loader_1 = require("./video-loader");
8
- Object.defineProperty(exports, "VideoLoader", { enumerable: true, get: function () { return video_loader_1.VideoLoader; } });
9
- var gif_builder_1 = require("./gif-builder");
10
- Object.defineProperty(exports, "GIFBuilder", { enumerable: true, get: function () { return __importDefault(gif_builder_1).default; } });
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadGifshotModule = void 0;
4
- // @ts-nocheck
5
- const worker_utils_1 = require("@loaders.gl/worker-utils");
6
- let loadGifshotPromise;
7
- async function loadGifshotModule(options = {}) {
8
- const modules = options.modules || {};
9
- if (modules.gifshot) {
10
- return modules.gifshot;
11
- }
12
- loadGifshotPromise = loadGifshotPromise || loadGifshot(options);
13
- return await loadGifshotPromise;
14
- }
15
- exports.loadGifshotModule = loadGifshotModule;
16
- async function loadGifshot(options) {
17
- options.libraryPath = options.libraryPath || 'libs/';
18
- const gifshot = await (0, worker_utils_1.loadLibrary)('gifshot.js', 'gifshot', options);
19
- // Depends on how import happened...
20
- // @ts-ignore TS2339: Property does not exist on type
21
- return gifshot || globalThis.gifshot;
22
- }