@remotion/webcodecs 4.0.375 → 4.0.377

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.
Files changed (2) hide show
  1. package/dist/esm/index.mjs +36 -22
  2. package/package.json +5 -5
@@ -22,30 +22,44 @@ var require_register_usage_point = __commonJS((exports) => {
22
22
  exports.registerUsageEvent = exports.HOST = undefined;
23
23
  exports.HOST = "https://www.remotion.pro";
24
24
  var registerUsageEvent = async ({ apiKey, host, succeeded, event }) => {
25
- const res = await fetch(`${exports.HOST}/api/track/register-usage-point`, {
26
- method: "POST",
27
- body: JSON.stringify({
28
- event,
29
- apiKey,
30
- host,
31
- succeeded
32
- }),
33
- headers: {
34
- "Content-Type": "application/json"
25
+ const abortController = new AbortController;
26
+ const timeout = setTimeout(() => {
27
+ abortController.abort();
28
+ }, 1e4);
29
+ try {
30
+ const res = await fetch(`${exports.HOST}/api/track/register-usage-point`, {
31
+ method: "POST",
32
+ body: JSON.stringify({
33
+ event,
34
+ apiKey,
35
+ host,
36
+ succeeded
37
+ }),
38
+ headers: {
39
+ "Content-Type": "application/json"
40
+ },
41
+ signal: abortController.signal
42
+ });
43
+ clearTimeout(timeout);
44
+ const json = await res.json();
45
+ if (json.success) {
46
+ return {
47
+ billable: json.billable,
48
+ classification: json.classification
49
+ };
35
50
  }
36
- });
37
- const json = await res.json();
38
- if (json.success) {
39
- return {
40
- billable: json.billable,
41
- classification: json.classification
42
- };
43
- }
44
- if (!res.ok) {
45
- throw new Error(json.error);
51
+ if (!res.ok) {
52
+ throw new Error(json.error);
53
+ }
54
+ const read = await res.json();
55
+ return read;
56
+ } catch (err) {
57
+ clearTimeout(timeout);
58
+ if (err instanceof Error && err.name === "AbortError") {
59
+ throw new Error("Request timed out after 10 seconds");
60
+ }
61
+ throw err;
46
62
  }
47
- const read = await res.json();
48
- return read;
49
63
  };
50
64
  exports.registerUsageEvent = registerUsageEvent;
51
65
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/webcodecs",
3
- "version": "4.0.375",
3
+ "version": "4.0.377",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/esm/index.mjs",
@@ -27,14 +27,14 @@
27
27
  "author": "Jonny Burger <jonny@remotion.dev>",
28
28
  "license": "Remotion License (See https://remotion.dev/docs/webcodecs#license)",
29
29
  "dependencies": {
30
- "@remotion/media-parser": "4.0.375",
31
- "@remotion/licensing": "4.0.375"
30
+ "@remotion/media-parser": "4.0.377",
31
+ "@remotion/licensing": "4.0.377"
32
32
  },
33
33
  "peerDependencies": {},
34
34
  "devDependencies": {
35
35
  "@types/dom-webcodecs": "0.1.11",
36
- "@remotion/example-videos": "4.0.375",
37
- "@remotion/eslint-config-internal": "4.0.375",
36
+ "@remotion/example-videos": "4.0.377",
37
+ "@remotion/eslint-config-internal": "4.0.377",
38
38
  "playwright": "1.55.1",
39
39
  "vite": "5.4.21",
40
40
  "@playwright/test": "1.55.1",