remotion 4.0.396 → 4.0.398

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.
@@ -26,6 +26,9 @@ const AudioRefForwardingFunction = (props, ref) => {
26
26
  const { loop, ...propsOtherThanLoop } = props;
27
27
  const { fps } = (0, use_video_config_js_1.useVideoConfig)();
28
28
  const environment = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
29
+ if (environment.isClientSideRendering) {
30
+ throw new Error('<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations');
31
+ }
29
32
  const { durations, setDurations } = (0, react_1.useContext)(duration_state_js_1.DurationsContext);
30
33
  if (typeof props.src !== 'string') {
31
34
  throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
@@ -1,3 +1,3 @@
1
- export declare const injectCSS: (css: string) => void;
1
+ export declare const injectCSS: (css: string) => (() => void);
2
2
  export declare const OBJECTFIT_CONTAIN_CLASS_NAME = "__remotion_objectfitcontain";
3
3
  export declare const makeDefaultPreviewCSS: (scope: string | null, backgroundColor: string) => string;
@@ -5,16 +5,25 @@ const injected = {};
5
5
  const injectCSS = (css) => {
6
6
  // Skip in node
7
7
  if (typeof document === 'undefined') {
8
- return;
8
+ return () => { };
9
9
  }
10
10
  if (injected[css]) {
11
- return;
11
+ return () => { };
12
12
  }
13
13
  const head = document.head || document.getElementsByTagName('head')[0];
14
14
  const style = document.createElement('style');
15
15
  style.appendChild(document.createTextNode(css));
16
16
  head.prepend(style);
17
- injected[css] = true;
17
+ injected[css] = style;
18
+ return () => {
19
+ const styleElement = injected[css];
20
+ if (styleElement) {
21
+ if (styleElement.parentNode) {
22
+ styleElement.parentNode.removeChild(styleElement);
23
+ }
24
+ delete injected[css];
25
+ }
26
+ };
18
27
  };
19
28
  exports.injectCSS = injectCSS;
20
29
  // make object-fit: contain low priority, so it can be overridden by another class name
@@ -3,4 +3,4 @@
3
3
  * @see [Documentation](https://remotion.dev/docs/version)
4
4
  * @returns {string} The current version of the remotion package
5
5
  */
6
- export declare const VERSION = "4.0.396";
6
+ export declare const VERSION = "4.0.398";
@@ -7,4 +7,4 @@ exports.VERSION = void 0;
7
7
  * @see [Documentation](https://remotion.dev/docs/version)
8
8
  * @returns {string} The current version of the remotion package
9
9
  */
10
- exports.VERSION = '4.0.396';
10
+ exports.VERSION = '4.0.398';
@@ -15,6 +15,9 @@ const InnerOffthreadVideo = (props) => {
15
15
  // rest gets drilled down
16
16
  const { startFrom, endAt, trimBefore, trimAfter, name, pauseWhenBuffering, stack, showInTimeline, ...otherProps } = props;
17
17
  const environment = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
18
+ if (environment.isClientSideRendering) {
19
+ throw new Error('<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations');
20
+ }
18
21
  const onDuration = (0, react_1.useCallback)(() => undefined, []);
19
22
  if (typeof props.src !== 'string') {
20
23
  throw new TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
@@ -23,6 +23,9 @@ const VideoForwardingFunction = (props, ref) => {
23
23
  const { loop, ...propsOtherThanLoop } = props;
24
24
  const { fps } = (0, use_video_config_js_1.useVideoConfig)();
25
25
  const environment = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
26
+ if (environment.isClientSideRendering) {
27
+ throw new Error('<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations');
28
+ }
26
29
  const { durations, setDurations } = (0, react_1.useContext)(duration_state_js_1.DurationsContext);
27
30
  if (typeof ref === 'string') {
28
31
  throw new Error('string refs are not supported');
@@ -110,7 +110,7 @@ function truthy(value) {
110
110
  }
111
111
 
112
112
  // src/version.ts
113
- var VERSION = "4.0.396";
113
+ var VERSION = "4.0.398";
114
114
 
115
115
  // src/multiple-versions-warning.ts
116
116
  var checkMultipleRemotionVersions = () => {
@@ -5093,6 +5093,9 @@ var AudioRefForwardingFunction = (props, ref) => {
5093
5093
  const { loop, ...propsOtherThanLoop } = props;
5094
5094
  const { fps } = useVideoConfig();
5095
5095
  const environment = useRemotionEnvironment();
5096
+ if (environment.isClientSideRendering) {
5097
+ throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
5098
+ }
5096
5099
  const { durations, setDurations } = useContext27(DurationsContext);
5097
5100
  if (typeof props.src !== "string") {
5098
5101
  throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
@@ -6043,16 +6046,25 @@ __export(exports_default_css, {
6043
6046
  var injected = {};
6044
6047
  var injectCSS = (css) => {
6045
6048
  if (typeof document === "undefined") {
6046
- return;
6049
+ return () => {};
6047
6050
  }
6048
6051
  if (injected[css]) {
6049
- return;
6052
+ return () => {};
6050
6053
  }
6051
6054
  const head = document.head || document.getElementsByTagName("head")[0];
6052
6055
  const style = document.createElement("style");
6053
6056
  style.appendChild(document.createTextNode(css));
6054
6057
  head.prepend(style);
6055
- injected[css] = true;
6058
+ injected[css] = style;
6059
+ return () => {
6060
+ const styleElement = injected[css];
6061
+ if (styleElement) {
6062
+ if (styleElement.parentNode) {
6063
+ styleElement.parentNode.removeChild(styleElement);
6064
+ }
6065
+ delete injected[css];
6066
+ }
6067
+ };
6056
6068
  };
6057
6069
  var OBJECTFIT_CONTAIN_CLASS_NAME = "__remotion_objectfitcontain";
6058
6070
  var makeDefaultPreviewCSS = (scope, backgroundColor) => {
@@ -6816,6 +6828,9 @@ var InnerOffthreadVideo = (props2) => {
6816
6828
  ...otherProps
6817
6829
  } = props2;
6818
6830
  const environment = useRemotionEnvironment();
6831
+ if (environment.isClientSideRendering) {
6832
+ throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
6833
+ }
6819
6834
  const onDuration = useCallback16(() => {
6820
6835
  return;
6821
6836
  }, []);
@@ -8369,6 +8384,9 @@ var VideoForwardingFunction = (props2, ref) => {
8369
8384
  const { loop, ...propsOtherThanLoop } = props2;
8370
8385
  const { fps } = useVideoConfig();
8371
8386
  const environment = useRemotionEnvironment();
8387
+ if (environment.isClientSideRendering) {
8388
+ throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
8389
+ }
8372
8390
  const { durations, setDurations } = useContext35(DurationsContext);
8373
8391
  if (typeof ref === "string") {
8374
8392
  throw new Error("string refs are not supported");
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "4.0.396";
2
+ var VERSION = "4.0.398";
3
3
  export {
4
4
  VERSION
5
5
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
4
4
  },
5
5
  "name": "remotion",
6
- "version": "4.0.396",
6
+ "version": "4.0.398",
7
7
  "description": "Make videos programmatically",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -34,7 +34,7 @@
34
34
  "react-dom": "19.2.3",
35
35
  "webpack": "5.96.1",
36
36
  "zod": "3.22.3",
37
- "@remotion/eslint-config-internal": "4.0.396",
37
+ "@remotion/eslint-config-internal": "4.0.398",
38
38
  "eslint": "9.19.0"
39
39
  },
40
40
  "keywords": [