@loaders.gl/video 4.0.0-beta.3 → 4.0.0-beta.5
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/dist.dev.js +1 -53
- package/package.json +4 -4
package/dist/dist.dev.js
CHANGED
|
@@ -54,7 +54,6 @@ var __exports__ = (() => {
|
|
|
54
54
|
extensions: EXTENSIONS,
|
|
55
55
|
mimeTypes: MIME_TYPES,
|
|
56
56
|
parse: parseVideo,
|
|
57
|
-
// tests: arrayBuffer => Boolean(getBinaryImageMetadata(new DataView(arrayBuffer))),
|
|
58
57
|
options: DEFAULT_LOADER_OPTIONS
|
|
59
58
|
};
|
|
60
59
|
|
|
@@ -842,7 +841,6 @@ var __exports__ = (() => {
|
|
|
842
841
|
}
|
|
843
842
|
return paletteArray;
|
|
844
843
|
},
|
|
845
|
-
// This is the "traditional" Animated_GIF style of going from RGBA to indexed color frames
|
|
846
844
|
processFrameWithQuantizer: function processFrameWithQuantizer(imageData, width, height, sampleInterval) {
|
|
847
845
|
const rgbComponents = this.dataToRGB(imageData, width, height);
|
|
848
846
|
const nq = new NeuQuant(rgbComponents, rgbComponents.length, sampleInterval);
|
|
@@ -900,8 +898,7 @@ var __exports__ = (() => {
|
|
|
900
898
|
buf[p++] = width >> 8 & 255;
|
|
901
899
|
buf[p++] = height & 255;
|
|
902
900
|
buf[p++] = height >> 8 & 255;
|
|
903
|
-
buf[p++] = (global_palette !== null ? 128 : 0) |
|
|
904
|
-
gp_num_colors_pow2;
|
|
901
|
+
buf[p++] = (global_palette !== null ? 128 : 0) | gp_num_colors_pow2;
|
|
905
902
|
buf[p++] = background;
|
|
906
903
|
buf[p++] = 0;
|
|
907
904
|
if (loop_count !== null) {
|
|
@@ -1125,11 +1122,9 @@ var __exports__ = (() => {
|
|
|
1125
1122
|
this.ctx = this.canvas.getContext("2d");
|
|
1126
1123
|
this.frames = [];
|
|
1127
1124
|
},
|
|
1128
|
-
// Return a worker for processing a frame
|
|
1129
1125
|
getWorker: function getWorker() {
|
|
1130
1126
|
return this.availableWorkers.pop();
|
|
1131
1127
|
},
|
|
1132
|
-
// Restores a worker to the pool
|
|
1133
1128
|
freeWorker: function freeWorker(worker) {
|
|
1134
1129
|
this.availableWorkers.push(worker);
|
|
1135
1130
|
},
|
|
@@ -1229,8 +1224,6 @@ var __exports__ = (() => {
|
|
|
1229
1224
|
this.processFrame(position);
|
|
1230
1225
|
}
|
|
1231
1226
|
},
|
|
1232
|
-
// Takes the already processed data in frames and feeds it to a new
|
|
1233
|
-
// GifWriter instance in order to get the binary GIF file
|
|
1234
1227
|
generateGIF: function generateGIF(frames, callback) {
|
|
1235
1228
|
const buffer = [];
|
|
1236
1229
|
const gifOptions = {
|
|
@@ -1269,7 +1262,6 @@ var __exports__ = (() => {
|
|
|
1269
1262
|
callback(gif);
|
|
1270
1263
|
}
|
|
1271
1264
|
},
|
|
1272
|
-
// From GIF: 0 = loop forever, null = not looping, n > 0 = loop n times and stop
|
|
1273
1265
|
setRepeat: function setRepeat(r) {
|
|
1274
1266
|
this.repeat = r;
|
|
1275
1267
|
},
|
|
@@ -2012,83 +2004,41 @@ var __exports__ = (() => {
|
|
|
2012
2004
|
var GIF_BUILDER_OPTIONS = {
|
|
2013
2005
|
source: "images",
|
|
2014
2006
|
width: 200,
|
|
2015
|
-
// Desired width of the image
|
|
2016
2007
|
height: 200,
|
|
2017
|
-
// Desired height of the image
|
|
2018
2008
|
crossOrigin: "Anonymous",
|
|
2019
|
-
// Options are 'Anonymous', 'use-credentials', or a falsy value to not set a CORS attribute.
|
|
2020
|
-
// CALLBACKS
|
|
2021
2009
|
progressCallback: (captureProgress) => {
|
|
2022
2010
|
},
|
|
2023
|
-
// Callback that provides the current progress of the current image
|
|
2024
2011
|
completeCallback: () => {
|
|
2025
2012
|
},
|
|
2026
|
-
// Callback function that is called when the current image is completed
|
|
2027
|
-
// QUALITY SETTINGS
|
|
2028
2013
|
numWorkers: 2,
|
|
2029
|
-
// how many web workers to use to process the animated GIF frames. Default is 2.
|
|
2030
2014
|
sampleInterval: 10,
|
|
2031
|
-
// pixels to skip when creating the palette. Default is 10. Less is better, but slower.
|
|
2032
2015
|
interval: 0.1,
|
|
2033
|
-
// The amount of time (in seconds) to wait between each frame capture
|
|
2034
2016
|
offset: null,
|
|
2035
|
-
// The amount of time (in seconds) to start capturing the GIF (only for HTML5 videos)
|
|
2036
2017
|
numFrames: 10,
|
|
2037
|
-
// 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
|
|
2038
2018
|
frameDuration: 1,
|
|
2039
|
-
// The amount of time (10 = 1s) to stay on each frame
|
|
2040
|
-
// CSS FILTER OPTIONS
|
|
2041
2019
|
filter: "",
|
|
2042
|
-
// CSS filter that will be applied to the image (eg. blur(5px))
|
|
2043
|
-
// WATERMARK OPTIONS
|
|
2044
2020
|
waterMark: null,
|
|
2045
|
-
// If an image is given here, it will be stamped on top of the GIF frames
|
|
2046
2021
|
waterMarkHeight: null,
|
|
2047
|
-
// Height of the waterMark
|
|
2048
2022
|
waterMarkWidth: null,
|
|
2049
|
-
// Height of the waterMark
|
|
2050
2023
|
waterMarkXCoordinate: 1,
|
|
2051
|
-
// The X (horizontal) Coordinate of the watermark image
|
|
2052
2024
|
waterMarkYCoordinate: 1,
|
|
2053
|
-
// The Y (vertical) Coordinate of the watermark image
|
|
2054
|
-
// TEXT OPTIONS
|
|
2055
2025
|
text: "",
|
|
2056
|
-
// The text that covers the animated GIF
|
|
2057
2026
|
showFrameText: true,
|
|
2058
|
-
// If frame-specific text is supplied with the image array, you can force to not be displayed
|
|
2059
2027
|
fontWeight: "normal",
|
|
2060
|
-
// The font weight of the text that covers the animated GIF
|
|
2061
2028
|
fontSize: "16px",
|
|
2062
|
-
// The font size of the text that covers the animated GIF
|
|
2063
2029
|
minFontSize: "10px",
|
|
2064
|
-
// The minimum font size of the text that covers the animated GIF
|
|
2065
2030
|
resizeFont: false,
|
|
2066
|
-
// Whether or not the animated GIF text will be resized to fit within the GIF container
|
|
2067
2031
|
fontFamily: "sans-serif",
|
|
2068
|
-
// The font family of the text that covers the animated GIF
|
|
2069
2032
|
fontColor: "#ffffff",
|
|
2070
|
-
// The font color of the text that covers the animated GIF
|
|
2071
2033
|
textAlign: "center",
|
|
2072
|
-
// The horizontal text alignment of the text that covers the animated GIF
|
|
2073
2034
|
textBaseline: "bottom",
|
|
2074
|
-
// The vertical text alignment of the text that covers the animated GIF
|
|
2075
2035
|
textXCoordinate: null,
|
|
2076
|
-
// The X (horizontal) Coordinate of the text that covers the animated GIF
|
|
2077
2036
|
textYCoordinate: null,
|
|
2078
|
-
// The Y (vertical) Coordinate of the text that covers the animated GIF
|
|
2079
|
-
// ADVANCED OPTIONS
|
|
2080
|
-
// WEBCAM CAPTURE OPTIONS
|
|
2081
2037
|
webcamVideoElement: null,
|
|
2082
|
-
// You can pass an existing video element to use for the webcam GIF creation process,
|
|
2083
2038
|
keepCameraOn: false,
|
|
2084
|
-
// Whether or not you would like the user's camera to stay on after the GIF is created
|
|
2085
2039
|
cameraStream: null,
|
|
2086
|
-
// Expects a cameraStream Media object
|
|
2087
|
-
// CANVAS OPTIMIZATION OPTIONS
|
|
2088
2040
|
saveRenderingContexts: false,
|
|
2089
|
-
// Whether or not you would like to save all of the canvas image binary data
|
|
2090
2041
|
savedRenderingContexts: []
|
|
2091
|
-
// Array of canvas image data
|
|
2092
2042
|
};
|
|
2093
2043
|
var GIFBuilder = class {
|
|
2094
2044
|
static get properties() {
|
|
@@ -2134,7 +2084,6 @@ var __exports__ = (() => {
|
|
|
2134
2084
|
}
|
|
2135
2085
|
return await this._createGIF();
|
|
2136
2086
|
}
|
|
2137
|
-
// PRIVATE
|
|
2138
2087
|
async _createGIF() {
|
|
2139
2088
|
return new Promise((resolve, reject) => {
|
|
2140
2089
|
this.gifshot.createGIF(this.options, (result) => {
|
|
@@ -2146,7 +2095,6 @@ var __exports__ = (() => {
|
|
|
2146
2095
|
});
|
|
2147
2096
|
});
|
|
2148
2097
|
}
|
|
2149
|
-
// Remove some gifshot options
|
|
2150
2098
|
_cleanOptions(options) {
|
|
2151
2099
|
if (options.video || options.images || options.gifWidth || options.gifHeight) {
|
|
2152
2100
|
console.warn("GIFBuilder: ignoring options");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/video",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.5",
|
|
4
4
|
"description": "Framework-independent loaders and writers for video (MP4, WEBM, ...)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"build-bundle": "ocular-bundle ./src/index.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@loaders.gl/loader-utils": "4.0.0-beta.
|
|
44
|
-
"@loaders.gl/worker-utils": "4.0.0-beta.
|
|
43
|
+
"@loaders.gl/loader-utils": "4.0.0-beta.5",
|
|
44
|
+
"@loaders.gl/worker-utils": "4.0.0-beta.5",
|
|
45
45
|
"gifshot": "^0.4.5"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "a6f5a0d1a316cc22396e5a4d480c14329d1ef146"
|
|
48
48
|
}
|