@remotion/media 4.0.432 → 4.0.433

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { LogLevel, LoopVolumeCurveBehavior, VolumeProp } from 'remotion';
2
+ import type { LogLevel, LoopVolumeCurveBehavior, SequenceControls, VolumeProp } from 'remotion';
3
3
  import { type MediaOnError } from '../on-error';
4
4
  import type { FallbackHtml5AudioProps } from './props';
5
5
  type InnerAudioProps = {
@@ -28,5 +28,7 @@ type InnerAudioProps = {
28
28
  readonly debugAudioScheduling?: boolean;
29
29
  readonly onError?: MediaOnError;
30
30
  };
31
- export declare const AudioForPreview: React.FC<InnerAudioProps>;
31
+ export declare const AudioForPreview: React.FC<InnerAudioProps & {
32
+ readonly controls: SequenceControls | undefined;
33
+ }>;
32
34
  export {};
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { AudioProps } from './props';
3
- export declare const Audio: React.FC<AudioProps>;
3
+ export declare const Audio: React.ComponentType<AudioProps>;
@@ -428,6 +428,17 @@ function makePredecodingIterator(inner) {
428
428
  });
429
429
  };
430
430
  prefetch();
431
+ const _return = () => {
432
+ returned = true;
433
+ buffer.length = 0;
434
+ if (waiter) {
435
+ const w = waiter;
436
+ waiter = null;
437
+ w({ value: undefined, done: true });
438
+ }
439
+ inner.return(undefined);
440
+ return Promise.resolve({ value: undefined, done: true });
441
+ };
431
442
  const iterator = {
432
443
  next() {
433
444
  if (buffer.length > 0) {
@@ -447,17 +458,7 @@ function makePredecodingIterator(inner) {
447
458
  prefetch();
448
459
  });
449
460
  },
450
- return() {
451
- returned = true;
452
- buffer.length = 0;
453
- if (waiter) {
454
- const w = waiter;
455
- waiter = null;
456
- w({ value: undefined, done: true });
457
- }
458
- inner.return(undefined);
459
- return Promise.resolve({ value: undefined, done: true });
460
- },
461
+ return: _return,
461
462
  throw(e) {
462
463
  returned = true;
463
464
  buffer.length = 0;
@@ -1879,7 +1880,7 @@ var useCommonEffects = ({
1879
1880
  };
1880
1881
 
1881
1882
  // src/use-media-in-timeline.ts
1882
- import { useContext as useContext2, useEffect, useState } from "react";
1883
+ import { useContext as useContext2, useState, useEffect } from "react";
1883
1884
  import { Internals as Internals9, useCurrentFrame } from "remotion";
1884
1885
  var useMediaInTimeline = ({
1885
1886
  volume,
@@ -1941,7 +1942,7 @@ var useMediaInTimeline = ({
1941
1942
  displayName: finalDisplayName,
1942
1943
  rootId,
1943
1944
  showInTimeline: true,
1944
- nonce,
1945
+ nonce: nonce.get(),
1945
1946
  loopDisplay,
1946
1947
  stack,
1947
1948
  from: 0,
@@ -1961,7 +1962,7 @@ var useMediaInTimeline = ({
1961
1962
  rootId,
1962
1963
  volume: volumes,
1963
1964
  showInTimeline: true,
1964
- nonce,
1965
+ nonce: nonce.get(),
1965
1966
  startMediaFrom: 0 - startsAt + (trimBefore ?? 0),
1966
1967
  doesVolumeChange,
1967
1968
  loopDisplay: undefined,
@@ -2051,7 +2052,7 @@ var AudioForPreviewAssertedShowing = ({
2051
2052
  const [mediaPlayerReady, setMediaPlayerReady] = useState2(false);
2052
2053
  const [shouldFallbackToNativeAudio, setShouldFallbackToNativeAudio] = useState2(false);
2053
2054
  const [playing] = Timeline.usePlayingState();
2054
- const timelineContext = useContext3(Internals10.TimelineContext);
2055
+ const timelineContext = Internals10.useTimelineContext();
2055
2056
  const globalPlaybackRate = timelineContext.playbackRate;
2056
2057
  const sharedAudioContext = useContext3(SharedAudioContext);
2057
2058
  const buffer = useBufferState();
@@ -2283,33 +2284,15 @@ var AudioForPreviewAssertedShowing = ({
2283
2284
  }
2284
2285
  return null;
2285
2286
  };
2286
- var audioSchema = {
2287
- volume: {
2288
- type: "number",
2289
- min: 0,
2290
- max: 20,
2291
- step: 0.01,
2292
- default: 1,
2293
- description: "Volume"
2294
- },
2295
- playbackRate: {
2296
- type: "number",
2297
- min: 0.1,
2298
- step: 0.01,
2299
- default: 1,
2300
- description: "Playback Rate"
2301
- },
2302
- loop: { type: "boolean", default: false, description: "Loop" }
2303
- };
2304
2287
  var AudioForPreview = ({
2305
- loop: loopProp = false,
2288
+ loop = false,
2306
2289
  src,
2307
2290
  logLevel,
2308
2291
  muted,
2309
2292
  name,
2310
- volume: volumeProp,
2293
+ volume,
2311
2294
  loopVolumeCurveBehavior,
2312
- playbackRate: playbackRateProp = 1,
2295
+ playbackRate = 1,
2313
2296
  trimAfter,
2314
2297
  trimBefore,
2315
2298
  showInTimeline,
@@ -2319,19 +2302,9 @@ var AudioForPreview = ({
2319
2302
  audioStreamIndex,
2320
2303
  fallbackHtml5AudioProps,
2321
2304
  debugAudioScheduling,
2322
- onError
2305
+ onError,
2306
+ controls
2323
2307
  }) => {
2324
- const schemaInput = useMemo2(() => {
2325
- return {
2326
- volume: volumeProp,
2327
- playbackRate: playbackRateProp,
2328
- loop: loopProp
2329
- };
2330
- }, [volumeProp, playbackRateProp, loopProp]);
2331
- const {
2332
- controls,
2333
- values: { volume, playbackRate, loop }
2334
- } = Internals10.useSchema(audioSchema, schemaInput);
2335
2308
  const preloadedSrc = usePreload(src);
2336
2309
  const defaultLogLevel = Internals10.useLogLevel();
2337
2310
  const frame = useCurrentFrame2();
@@ -4438,8 +4411,26 @@ var AudioForRendering = ({
4438
4411
  // src/audio/audio.tsx
4439
4412
  import { jsx as jsx3 } from "react/jsx-runtime";
4440
4413
  var { validateMediaProps } = Internals19;
4441
- var Audio = (props) => {
4442
- const { name, stack, showInTimeline, ...otherProps } = props;
4414
+ var audioSchema = {
4415
+ volume: {
4416
+ type: "number",
4417
+ min: 0,
4418
+ max: 20,
4419
+ step: 0.01,
4420
+ default: 1,
4421
+ description: "Volume"
4422
+ },
4423
+ playbackRate: {
4424
+ type: "number",
4425
+ min: 0.1,
4426
+ step: 0.01,
4427
+ default: 1,
4428
+ description: "Playback Rate"
4429
+ },
4430
+ loop: { type: "boolean", default: false, description: "Loop" }
4431
+ };
4432
+ var AudioInner = (props) => {
4433
+ const { name, stack, showInTimeline, controls, ...otherProps } = props;
4443
4434
  const environment = useRemotionEnvironment2();
4444
4435
  if (typeof props.src !== "string") {
4445
4436
  throw new TypeError(`The \`<Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
@@ -4453,9 +4444,11 @@ var Audio = (props) => {
4453
4444
  return /* @__PURE__ */ jsx3(AudioForPreview, {
4454
4445
  name,
4455
4446
  ...otherProps,
4456
- stack: stack ?? null
4447
+ stack: stack ?? null,
4448
+ controls
4457
4449
  });
4458
4450
  };
4451
+ var Audio = Internals19.wrapInSchema(AudioInner, audioSchema);
4459
4452
  Internals19.addSequenceStackTraces(Audio);
4460
4453
 
4461
4454
  // src/video/video.tsx
@@ -4527,7 +4520,7 @@ var VideoForPreviewAssertedShowing = ({
4527
4520
  const [mediaPlayerReady, setMediaPlayerReady] = useState4(false);
4528
4521
  const [shouldFallbackToNativeVideo, setShouldFallbackToNativeVideo] = useState4(false);
4529
4522
  const [playing] = Timeline2.usePlayingState();
4530
- const timelineContext = useContext5(Internals20.TimelineContext);
4523
+ const timelineContext = Internals20.useTimelineContext();
4531
4524
  const globalPlaybackRate = timelineContext.playbackRate;
4532
4525
  const sharedAudioContext = useContext5(SharedAudioContext2);
4533
4526
  const buffer = useBufferState2();
@@ -4784,44 +4777,15 @@ var VideoForPreviewAssertedShowing = ({
4784
4777
  className: classNameValue
4785
4778
  });
4786
4779
  };
4787
- var videoSchema = {
4788
- volume: {
4789
- type: "number",
4790
- min: 0,
4791
- max: 20,
4792
- step: 0.01,
4793
- default: 1,
4794
- description: "Volume"
4795
- },
4796
- playbackRate: {
4797
- type: "number",
4798
- min: 0.1,
4799
- step: 0.01,
4800
- default: 1,
4801
- description: "Playback Rate"
4802
- },
4803
- loop: { type: "boolean", default: false, description: "Loop" }
4804
- };
4805
4780
  var VideoForPreview = (props) => {
4806
- const schemaInput = useMemo4(() => {
4807
- return {
4808
- volume: props.volume,
4809
- playbackRate: props.playbackRate,
4810
- loop: props.loop
4811
- };
4812
- }, [props.volume, props.playbackRate, props.loop]);
4813
- const {
4814
- controls,
4815
- values: { loop, playbackRate, volume }
4816
- } = Internals20.useSchema(videoSchema, schemaInput);
4817
4781
  const frame = useCurrentFrame4();
4818
4782
  const videoConfig = useVideoConfig3();
4819
4783
  const currentTime = frame / videoConfig.fps;
4820
4784
  const showShow = useMemo4(() => {
4821
4785
  return getTimeInSeconds({
4822
4786
  unloopedTimeInSeconds: currentTime,
4823
- playbackRate,
4824
- loop,
4787
+ playbackRate: props.playbackRate,
4788
+ loop: props.loop,
4825
4789
  trimBefore: props.trimBefore,
4826
4790
  trimAfter: props.trimAfter,
4827
4791
  mediaDurationInSeconds: Infinity,
@@ -4831,8 +4795,8 @@ var VideoForPreview = (props) => {
4831
4795
  }) !== null;
4832
4796
  }, [
4833
4797
  currentTime,
4834
- loop,
4835
- playbackRate,
4798
+ props.loop,
4799
+ props.playbackRate,
4836
4800
  props.src,
4837
4801
  videoConfig.fps,
4838
4802
  props.trimBefore,
@@ -4843,10 +4807,7 @@ var VideoForPreview = (props) => {
4843
4807
  }
4844
4808
  return /* @__PURE__ */ jsx4(VideoForPreviewAssertedShowing, {
4845
4809
  ...props,
4846
- volume: volume ?? 1,
4847
- playbackRate,
4848
- loop,
4849
- controls
4810
+ controls: props.controls
4850
4811
  });
4851
4812
  };
4852
4813
 
@@ -5159,6 +5120,52 @@ var VideoForRendering = ({
5159
5120
  // src/video/video.tsx
5160
5121
  import { jsx as jsx6 } from "react/jsx-runtime";
5161
5122
  var { validateMediaTrimProps, resolveTrimProps, validateMediaProps: validateMediaProps2 } = Internals22;
5123
+ var videoSchema = {
5124
+ volume: {
5125
+ type: "number",
5126
+ min: 0,
5127
+ max: 20,
5128
+ step: 0.01,
5129
+ default: 1,
5130
+ description: "Volume"
5131
+ },
5132
+ playbackRate: {
5133
+ type: "number",
5134
+ min: 0.1,
5135
+ step: 0.01,
5136
+ default: 1,
5137
+ description: "Playback Rate"
5138
+ },
5139
+ loop: { type: "boolean", default: false, description: "Loop" },
5140
+ "style.translate": {
5141
+ type: "translate",
5142
+ step: 1,
5143
+ default: "0px 0px",
5144
+ description: "Position"
5145
+ },
5146
+ "style.scale": {
5147
+ type: "number",
5148
+ min: 0.05,
5149
+ max: 100,
5150
+ step: 0.01,
5151
+ default: 1,
5152
+ description: "Scale"
5153
+ },
5154
+ "style.rotate": {
5155
+ type: "rotation",
5156
+ step: 1,
5157
+ default: "0deg",
5158
+ description: "Rotation"
5159
+ },
5160
+ "style.opacity": {
5161
+ type: "number",
5162
+ min: 0,
5163
+ max: 1,
5164
+ step: 0.01,
5165
+ default: 1,
5166
+ description: "Opacity"
5167
+ }
5168
+ };
5162
5169
  var InnerVideo = ({
5163
5170
  src,
5164
5171
  audioStreamIndex,
@@ -5184,7 +5191,8 @@ var InnerVideo = ({
5184
5191
  debugOverlay,
5185
5192
  debugAudioScheduling,
5186
5193
  headless,
5187
- onError
5194
+ onError,
5195
+ controls
5188
5196
  }) => {
5189
5197
  const environment = useRemotionEnvironment4();
5190
5198
  if (typeof src !== "string") {
@@ -5251,10 +5259,11 @@ var InnerVideo = ({
5251
5259
  debugOverlay: debugOverlay ?? false,
5252
5260
  debugAudioScheduling: debugAudioScheduling ?? false,
5253
5261
  headless: headless ?? false,
5254
- onError
5262
+ onError,
5263
+ controls
5255
5264
  });
5256
5265
  };
5257
- var Video = ({
5266
+ var VideoInner = ({
5258
5267
  src,
5259
5268
  audioStreamIndex,
5260
5269
  className,
@@ -5279,7 +5288,8 @@ var Video = ({
5279
5288
  debugOverlay,
5280
5289
  debugAudioScheduling,
5281
5290
  headless,
5282
- onError
5291
+ onError,
5292
+ controls
5283
5293
  }) => {
5284
5294
  const fallbackLogLevel = Internals22.useLogLevel();
5285
5295
  return /* @__PURE__ */ jsx6(InnerVideo, {
@@ -5307,9 +5317,11 @@ var Video = ({
5307
5317
  debugOverlay: debugOverlay ?? false,
5308
5318
  debugAudioScheduling: debugAudioScheduling ?? false,
5309
5319
  headless: headless ?? false,
5310
- onError
5320
+ onError,
5321
+ controls
5311
5322
  });
5312
5323
  };
5324
+ var Video = Internals22.wrapInSchema(VideoInner, videoSchema);
5313
5325
  Internals22.addSequenceStackTraces(Video);
5314
5326
 
5315
5327
  // src/index.ts
package/dist/index.d.ts CHANGED
@@ -3,11 +3,41 @@ import { Video } from './video/video';
3
3
  /**
4
4
  * @deprecated Now just `Audio`
5
5
  */
6
- export declare const experimental_Audio: import("react").FC<import(".").AudioProps>;
6
+ export declare const experimental_Audio: import("react").ComponentType<import(".").AudioProps>;
7
7
  /**
8
8
  * @deprecated Now just `Video`
9
9
  */
10
- export declare const experimental_Video: import("react").FC<import(".").VideoProps>;
10
+ export declare const experimental_Video: import("react").ComponentType<{
11
+ src: string;
12
+ } & Partial<{
13
+ trimBefore: number | undefined;
14
+ trimAfter: number | undefined;
15
+ }> & Partial<{
16
+ className: string | undefined;
17
+ volume: import("remotion").VolumeProp;
18
+ loopVolumeCurveBehavior: import("remotion").LoopVolumeCurveBehavior;
19
+ name: string | undefined;
20
+ onVideoFrame: import("remotion").OnVideoFrame | undefined;
21
+ playbackRate: number;
22
+ muted: boolean;
23
+ delayRenderRetries: number | null;
24
+ delayRenderTimeoutInMilliseconds: number | null;
25
+ style: import("react").CSSProperties;
26
+ stack: string | undefined;
27
+ logLevel: "error" | "info" | "trace" | "verbose" | "warn";
28
+ loop: boolean;
29
+ audioStreamIndex: number;
30
+ disallowFallbackToOffthreadVideo: boolean;
31
+ fallbackOffthreadVideoProps: import(".").FallbackOffthreadVideoProps;
32
+ trimAfter: number | undefined;
33
+ trimBefore: number | undefined;
34
+ toneFrequency: number;
35
+ showInTimeline: boolean;
36
+ debugOverlay: boolean;
37
+ debugAudioScheduling: boolean;
38
+ headless: boolean;
39
+ onError: import("./on-error").MediaOnError | undefined;
40
+ }>>;
11
41
  export { AudioForPreview } from './audio/audio-for-preview';
12
42
  export { AudioProps, FallbackHtml5AudioProps } from './audio/props';
13
43
  export { MediaErrorAction } from './on-error';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { LogLevel, LoopVolumeCurveBehavior, VolumeProp } from 'remotion';
2
+ import type { LogLevel, LoopVolumeCurveBehavior, SequenceControls, VolumeProp } from 'remotion';
3
3
  import { type MediaOnError } from '../on-error';
4
4
  import type { FallbackOffthreadVideoProps } from './props';
5
5
  type VideoForPreviewProps = {
@@ -26,5 +26,7 @@ type VideoForPreviewProps = {
26
26
  readonly headless: boolean;
27
27
  readonly onError: MediaOnError | undefined;
28
28
  };
29
- export declare const VideoForPreview: React.FC<VideoForPreviewProps>;
29
+ export declare const VideoForPreview: React.FC<VideoForPreviewProps & {
30
+ readonly controls: SequenceControls | undefined;
31
+ }>;
30
32
  export {};
@@ -1,3 +1,32 @@
1
1
  import React from 'react';
2
- import type { VideoProps } from './props';
3
- export declare const Video: React.FC<VideoProps>;
2
+ export declare const Video: React.ComponentType<{
3
+ src: string;
4
+ } & Partial<{
5
+ trimBefore: number | undefined;
6
+ trimAfter: number | undefined;
7
+ }> & Partial<{
8
+ className: string | undefined;
9
+ volume: import("remotion").VolumeProp;
10
+ loopVolumeCurveBehavior: import("remotion").LoopVolumeCurveBehavior;
11
+ name: string | undefined;
12
+ onVideoFrame: import("remotion").OnVideoFrame | undefined;
13
+ playbackRate: number;
14
+ muted: boolean;
15
+ delayRenderRetries: number | null;
16
+ delayRenderTimeoutInMilliseconds: number | null;
17
+ style: React.CSSProperties;
18
+ stack: string | undefined;
19
+ logLevel: "error" | "info" | "trace" | "verbose" | "warn";
20
+ loop: boolean;
21
+ audioStreamIndex: number;
22
+ disallowFallbackToOffthreadVideo: boolean;
23
+ fallbackOffthreadVideoProps: import("./props").FallbackOffthreadVideoProps;
24
+ trimAfter: number | undefined;
25
+ trimBefore: number | undefined;
26
+ toneFrequency: number;
27
+ showInTimeline: boolean;
28
+ debugOverlay: boolean;
29
+ debugAudioScheduling: boolean;
30
+ headless: boolean;
31
+ onError: import("../on-error").MediaOnError | undefined;
32
+ }>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/media",
3
- "version": "4.0.432",
3
+ "version": "4.0.433",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/esm/index.mjs",
@@ -22,8 +22,8 @@
22
22
  "make": "tsgo && bun --env-file=../.env.bundle bundle.ts"
23
23
  },
24
24
  "dependencies": {
25
- "mediabunny": "1.35.1",
26
- "remotion": "4.0.432",
25
+ "mediabunny": "1.37.0",
26
+ "remotion": "4.0.433",
27
27
  "zod": "4.3.6"
28
28
  },
29
29
  "peerDependencies": {
@@ -31,14 +31,14 @@
31
31
  "react-dom": ">=16.8.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@remotion/eslint-config-internal": "4.0.432",
34
+ "@remotion/eslint-config-internal": "4.0.433",
35
35
  "@vitest/browser-webdriverio": "4.0.9",
36
36
  "eslint": "9.19.0",
37
37
  "react": "19.2.3",
38
38
  "react-dom": "19.2.3",
39
39
  "vitest": "4.0.9",
40
40
  "webdriverio": "9.19.2",
41
- "@typescript/native-preview": "7.0.0-dev.20260301.1"
41
+ "@typescript/native-preview": "7.0.0-dev.20260217.1"
42
42
  },
43
43
  "keywords": [],
44
44
  "publishConfig": {