@tsparticles/plugin-export-video 4.0.0-alpha.5 → 4.0.0-beta.0
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/737.min.js +1 -0
- package/74.min.js +1 -0
- package/browser/ExportVideoPlugin.js +1 -3
- package/browser/ExportVideoPluginInstance.js +23 -22
- package/browser/index.js +1 -1
- package/cjs/ExportVideoPlugin.js +1 -3
- package/cjs/ExportVideoPluginInstance.js +23 -22
- package/cjs/index.js +1 -1
- package/dist_browser_ExportVideoPluginInstance_js.js +2 -2
- package/dist_browser_ExportVideoPlugin_js.js +2 -2
- package/esm/ExportVideoPlugin.js +1 -3
- package/esm/ExportVideoPluginInstance.js +23 -22
- package/esm/index.js +1 -1
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.plugin.export.video.js +31 -19
- package/tsparticles.plugin.export.video.min.js +2 -2
- package/types/ExportVideoPlugin.d.ts +1 -2
- package/umd/ExportVideoPlugin.js +1 -3
- package/umd/ExportVideoPluginInstance.js +23 -22
- package/umd/index.js +1 -1
- package/46.min.js +0 -2
- package/46.min.js.LICENSE.txt +0 -1
- package/77.min.js +0 -2
- package/77.min.js.LICENSE.txt +0 -1
- package/tsparticles.plugin.export.video.min.js.LICENSE.txt +0 -1
package/737.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_plugin_export_video=this.webpackChunk_tsparticles_plugin_export_video||[]).push([[737],{737(e,t,i){i.d(t,{ExportVideoPlugin:()=>n});class n{id="export-video";async getPlugin(e){let{ExportVideoPluginInstance:t}=await i.e(74).then(i.bind(i,74));return new t(e)}loadOptions(){}needsPlugin(){return!0}}}}]);
|
package/74.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_plugin_export_video=this.webpackChunk_tsparticles_plugin_export_video||[]).push([[74],{74(e,t,p){p.d(t,{ExportVideoPluginInstance:()=>a});var s=p(303);let o=["webm","ogg","mp4","x-matroska"],r=["vp9","vp9.0","vp8","vp8.0","avc1","av1","h265","h.265","h264","h.264","opus","pcm","aac","mpeg","mp4a"];class a{_container;_supportedTypes=[];constructor(e){this._container=e,this._supportedTypes=function(){let e=[];return o.forEach(t=>{let p=`video/${t}`;r.forEach(t=>{[`${p};codecs=${t}`,`${p};codecs=${t.toUpperCase()}`].forEach(t=>{MediaRecorder.isTypeSupported(t)&&e.push(t)})}),MediaRecorder.isTypeSupported(p)&&e.push(p)}),e}()}async export(e,t){let p={supported:!1};return"video"===e&&(p.supported=!0,p.blob=await this._exportVideo(t)),p}_exportVideo=async e=>{let t=this._container.canvas.element;if(t)return new Promise(p=>{let o=t.captureStream(e.fps??this._container.actualOptions.fpsLimit),r=e.mimeType??this._supportedTypes[0],a=new MediaRecorder(o,{mimeType:r}),i=[];a.addEventListener("dataavailable",e=>{i.push(e.data)}),a.addEventListener("stop",()=>{p(new Blob(i,{type:r}))}),a.start(),setTimeout(()=>{a.stop()},e.duration??5*s.millisecondsToSeconds)})}}}}]);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export class ExportVideoPlugin {
|
|
2
|
-
|
|
3
|
-
this.id = "export-video";
|
|
4
|
-
}
|
|
2
|
+
id = "export-video";
|
|
5
3
|
async getPlugin(container) {
|
|
6
4
|
const { ExportVideoPluginInstance } = await import("./ExportVideoPluginInstance.js");
|
|
7
5
|
return new ExportVideoPluginInstance(container);
|
|
@@ -37,29 +37,9 @@ function getVideoSupportedMimeTypes() {
|
|
|
37
37
|
return supported;
|
|
38
38
|
}
|
|
39
39
|
export class ExportVideoPluginInstance {
|
|
40
|
+
_container;
|
|
41
|
+
_supportedTypes = [];
|
|
40
42
|
constructor(container) {
|
|
41
|
-
this._supportedTypes = [];
|
|
42
|
-
this._exportVideo = async (data) => {
|
|
43
|
-
const element = this._container.canvas.element;
|
|
44
|
-
if (!element) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
return new Promise(resolve => {
|
|
48
|
-
const stream = element.captureStream(data.fps ?? this._container.actualOptions.fpsLimit), firstIndex = 0, mimeType = data.mimeType ?? this._supportedTypes[firstIndex], recorder = new MediaRecorder(stream, {
|
|
49
|
-
mimeType,
|
|
50
|
-
}), chunks = [], defaultDuration = 5;
|
|
51
|
-
recorder.addEventListener("dataavailable", (event) => {
|
|
52
|
-
chunks.push(event.data);
|
|
53
|
-
});
|
|
54
|
-
recorder.addEventListener("stop", () => {
|
|
55
|
-
resolve(new Blob(chunks, { type: mimeType }));
|
|
56
|
-
});
|
|
57
|
-
recorder.start();
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
recorder.stop();
|
|
60
|
-
}, data.duration ?? defaultDuration * millisecondsToSeconds);
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
43
|
this._container = container;
|
|
64
44
|
this._supportedTypes = getVideoSupportedMimeTypes();
|
|
65
45
|
}
|
|
@@ -75,4 +55,25 @@ export class ExportVideoPluginInstance {
|
|
|
75
55
|
}
|
|
76
56
|
return res;
|
|
77
57
|
}
|
|
58
|
+
_exportVideo = async (data) => {
|
|
59
|
+
const element = this._container.canvas.element;
|
|
60
|
+
if (!element) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
return new Promise(resolve => {
|
|
64
|
+
const stream = element.captureStream(data.fps ?? this._container.actualOptions.fpsLimit), firstIndex = 0, mimeType = data.mimeType ?? this._supportedTypes[firstIndex], recorder = new MediaRecorder(stream, {
|
|
65
|
+
mimeType,
|
|
66
|
+
}), chunks = [], defaultDuration = 5;
|
|
67
|
+
recorder.addEventListener("dataavailable", (event) => {
|
|
68
|
+
chunks.push(event.data);
|
|
69
|
+
});
|
|
70
|
+
recorder.addEventListener("stop", () => {
|
|
71
|
+
resolve(new Blob(chunks, { type: mimeType }));
|
|
72
|
+
});
|
|
73
|
+
recorder.start();
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
recorder.stop();
|
|
76
|
+
}, data.duration ?? defaultDuration * millisecondsToSeconds);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
78
79
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExportVideoPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
4
|
const { ExportVideoPlugin } = await import("./ExportVideoPlugin.js");
|
|
5
5
|
e.addPlugin(new ExportVideoPlugin());
|
package/cjs/ExportVideoPlugin.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export class ExportVideoPlugin {
|
|
2
|
-
|
|
3
|
-
this.id = "export-video";
|
|
4
|
-
}
|
|
2
|
+
id = "export-video";
|
|
5
3
|
async getPlugin(container) {
|
|
6
4
|
const { ExportVideoPluginInstance } = await import("./ExportVideoPluginInstance.js");
|
|
7
5
|
return new ExportVideoPluginInstance(container);
|
|
@@ -37,29 +37,9 @@ function getVideoSupportedMimeTypes() {
|
|
|
37
37
|
return supported;
|
|
38
38
|
}
|
|
39
39
|
export class ExportVideoPluginInstance {
|
|
40
|
+
_container;
|
|
41
|
+
_supportedTypes = [];
|
|
40
42
|
constructor(container) {
|
|
41
|
-
this._supportedTypes = [];
|
|
42
|
-
this._exportVideo = async (data) => {
|
|
43
|
-
const element = this._container.canvas.element;
|
|
44
|
-
if (!element) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
return new Promise(resolve => {
|
|
48
|
-
const stream = element.captureStream(data.fps ?? this._container.actualOptions.fpsLimit), firstIndex = 0, mimeType = data.mimeType ?? this._supportedTypes[firstIndex], recorder = new MediaRecorder(stream, {
|
|
49
|
-
mimeType,
|
|
50
|
-
}), chunks = [], defaultDuration = 5;
|
|
51
|
-
recorder.addEventListener("dataavailable", (event) => {
|
|
52
|
-
chunks.push(event.data);
|
|
53
|
-
});
|
|
54
|
-
recorder.addEventListener("stop", () => {
|
|
55
|
-
resolve(new Blob(chunks, { type: mimeType }));
|
|
56
|
-
});
|
|
57
|
-
recorder.start();
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
recorder.stop();
|
|
60
|
-
}, data.duration ?? defaultDuration * millisecondsToSeconds);
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
43
|
this._container = container;
|
|
64
44
|
this._supportedTypes = getVideoSupportedMimeTypes();
|
|
65
45
|
}
|
|
@@ -75,4 +55,25 @@ export class ExportVideoPluginInstance {
|
|
|
75
55
|
}
|
|
76
56
|
return res;
|
|
77
57
|
}
|
|
58
|
+
_exportVideo = async (data) => {
|
|
59
|
+
const element = this._container.canvas.element;
|
|
60
|
+
if (!element) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
return new Promise(resolve => {
|
|
64
|
+
const stream = element.captureStream(data.fps ?? this._container.actualOptions.fpsLimit), firstIndex = 0, mimeType = data.mimeType ?? this._supportedTypes[firstIndex], recorder = new MediaRecorder(stream, {
|
|
65
|
+
mimeType,
|
|
66
|
+
}), chunks = [], defaultDuration = 5;
|
|
67
|
+
recorder.addEventListener("dataavailable", (event) => {
|
|
68
|
+
chunks.push(event.data);
|
|
69
|
+
});
|
|
70
|
+
recorder.addEventListener("stop", () => {
|
|
71
|
+
resolve(new Blob(chunks, { type: mimeType }));
|
|
72
|
+
});
|
|
73
|
+
recorder.start();
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
recorder.stop();
|
|
76
|
+
}, data.duration ?? defaultDuration * millisecondsToSeconds);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
78
79
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExportVideoPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
4
|
const { ExportVideoPlugin } = await import("./ExportVideoPlugin.js");
|
|
5
5
|
e.addPlugin(new ExportVideoPlugin());
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\***************************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExportVideoPluginInstance: () => (/* binding */ ExportVideoPluginInstance)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst videoTypes = [\"webm\"
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExportVideoPluginInstance: () => (/* binding */ ExportVideoPluginInstance)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst videoTypes = [\n \"webm\",\n \"ogg\",\n \"mp4\",\n \"x-matroska\"\n], codecs = [\n \"vp9\",\n \"vp9.0\",\n \"vp8\",\n \"vp8.0\",\n \"avc1\",\n \"av1\",\n \"h265\",\n \"h.265\",\n \"h264\",\n \"h.264\",\n \"opus\",\n \"pcm\",\n \"aac\",\n \"mpeg\",\n \"mp4a\"\n];\nfunction getVideoSupportedMimeTypes() {\n const isSupported = (type)=>MediaRecorder.isTypeSupported(type), supported = [];\n videoTypes.forEach((type)=>{\n const mimeType = `video/${type}`;\n codecs.forEach((codec)=>{\n [\n `${mimeType};codecs=${codec}`,\n `${mimeType};codecs=${codec.toUpperCase()}`\n ].forEach((variation)=>{\n if (isSupported(variation)) {\n supported.push(variation);\n }\n });\n });\n if (isSupported(mimeType)) {\n supported.push(mimeType);\n }\n });\n return supported;\n}\nclass ExportVideoPluginInstance {\n _container;\n _supportedTypes = [];\n constructor(container){\n this._container = container;\n this._supportedTypes = getVideoSupportedMimeTypes();\n }\n async export(type, data) {\n const res = {\n supported: false\n };\n switch(type){\n case \"video\":\n res.supported = true;\n res.blob = await this._exportVideo(data);\n break;\n }\n return res;\n }\n _exportVideo = async (data)=>{\n const element = this._container.canvas.element;\n if (!element) {\n return;\n }\n return new Promise((resolve)=>{\n const stream = element.captureStream(data.fps ?? this._container.actualOptions.fpsLimit), firstIndex = 0, mimeType = data.mimeType ?? this._supportedTypes[firstIndex], recorder = new MediaRecorder(stream, {\n mimeType\n }), chunks = [], defaultDuration = 5;\n recorder.addEventListener(\"dataavailable\", (event)=>{\n chunks.push(event.data);\n });\n recorder.addEventListener(\"stop\", ()=>{\n resolve(new Blob(chunks, {\n type: mimeType\n }));\n });\n recorder.start();\n setTimeout(()=>{\n recorder.stop();\n }, data.duration ?? defaultDuration * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds);\n });\n };\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-export-video/./dist/browser/ExportVideoPluginInstance.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\*******************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExportVideoPlugin: () => (/* binding */ ExportVideoPlugin)\n/* harmony export */ });\nclass ExportVideoPlugin {\n
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExportVideoPlugin: () => (/* binding */ ExportVideoPlugin)\n/* harmony export */ });\nclass ExportVideoPlugin {\n id = \"export-video\";\n async getPlugin(container) {\n const { ExportVideoPluginInstance } = await __webpack_require__.e(/*! import() */ \"dist_browser_ExportVideoPluginInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ExportVideoPluginInstance.js */ \"./dist/browser/ExportVideoPluginInstance.js\"));\n return new ExportVideoPluginInstance(container);\n }\n loadOptions() {}\n needsPlugin() {\n return true;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-export-video/./dist/browser/ExportVideoPlugin.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
package/esm/ExportVideoPlugin.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export class ExportVideoPlugin {
|
|
2
|
-
|
|
3
|
-
this.id = "export-video";
|
|
4
|
-
}
|
|
2
|
+
id = "export-video";
|
|
5
3
|
async getPlugin(container) {
|
|
6
4
|
const { ExportVideoPluginInstance } = await import("./ExportVideoPluginInstance.js");
|
|
7
5
|
return new ExportVideoPluginInstance(container);
|
|
@@ -37,29 +37,9 @@ function getVideoSupportedMimeTypes() {
|
|
|
37
37
|
return supported;
|
|
38
38
|
}
|
|
39
39
|
export class ExportVideoPluginInstance {
|
|
40
|
+
_container;
|
|
41
|
+
_supportedTypes = [];
|
|
40
42
|
constructor(container) {
|
|
41
|
-
this._supportedTypes = [];
|
|
42
|
-
this._exportVideo = async (data) => {
|
|
43
|
-
const element = this._container.canvas.element;
|
|
44
|
-
if (!element) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
return new Promise(resolve => {
|
|
48
|
-
const stream = element.captureStream(data.fps ?? this._container.actualOptions.fpsLimit), firstIndex = 0, mimeType = data.mimeType ?? this._supportedTypes[firstIndex], recorder = new MediaRecorder(stream, {
|
|
49
|
-
mimeType,
|
|
50
|
-
}), chunks = [], defaultDuration = 5;
|
|
51
|
-
recorder.addEventListener("dataavailable", (event) => {
|
|
52
|
-
chunks.push(event.data);
|
|
53
|
-
});
|
|
54
|
-
recorder.addEventListener("stop", () => {
|
|
55
|
-
resolve(new Blob(chunks, { type: mimeType }));
|
|
56
|
-
});
|
|
57
|
-
recorder.start();
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
recorder.stop();
|
|
60
|
-
}, data.duration ?? defaultDuration * millisecondsToSeconds);
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
43
|
this._container = container;
|
|
64
44
|
this._supportedTypes = getVideoSupportedMimeTypes();
|
|
65
45
|
}
|
|
@@ -75,4 +55,25 @@ export class ExportVideoPluginInstance {
|
|
|
75
55
|
}
|
|
76
56
|
return res;
|
|
77
57
|
}
|
|
58
|
+
_exportVideo = async (data) => {
|
|
59
|
+
const element = this._container.canvas.element;
|
|
60
|
+
if (!element) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
return new Promise(resolve => {
|
|
64
|
+
const stream = element.captureStream(data.fps ?? this._container.actualOptions.fpsLimit), firstIndex = 0, mimeType = data.mimeType ?? this._supportedTypes[firstIndex], recorder = new MediaRecorder(stream, {
|
|
65
|
+
mimeType,
|
|
66
|
+
}), chunks = [], defaultDuration = 5;
|
|
67
|
+
recorder.addEventListener("dataavailable", (event) => {
|
|
68
|
+
chunks.push(event.data);
|
|
69
|
+
});
|
|
70
|
+
recorder.addEventListener("stop", () => {
|
|
71
|
+
resolve(new Blob(chunks, { type: mimeType }));
|
|
72
|
+
});
|
|
73
|
+
recorder.start();
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
recorder.stop();
|
|
76
|
+
}, data.duration ?? defaultDuration * millisecondsToSeconds);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
78
79
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadExportVideoPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
4
|
const { ExportVideoPlugin } = await import("./ExportVideoPlugin.js");
|
|
5
5
|
e.addPlugin(new ExportVideoPlugin());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-export-video",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
4
4
|
"description": "tsParticles export video plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"./package.json": "./package.json"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@tsparticles/engine": "4.0.0-
|
|
103
|
+
"@tsparticles/engine": "4.0.0-beta.0"
|
|
104
104
|
},
|
|
105
105
|
"publishConfig": {
|
|
106
106
|
"access": "public"
|