@remotion/media 4.0.461 → 4.0.463

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.
@@ -20,4 +20,4 @@ export declare const Audio: React.ComponentType<{
20
20
  delayRenderTimeoutInMilliseconds?: number | undefined;
21
21
  onError?: import("../on-error").MediaOnError | undefined;
22
22
  credentials?: RequestCredentials | undefined;
23
- } & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "name" | "showInTimeline">>;
23
+ } & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "hidden" | "name" | "showInTimeline">>;
@@ -6,6 +6,7 @@ export type FallbackHtml5AudioProps = {
6
6
  useWebAudioApi?: boolean;
7
7
  acceptableTimeShiftInSeconds?: number;
8
8
  pauseWhenBuffering?: boolean;
9
+ preservePitch?: boolean;
9
10
  };
10
11
  export type AudioProps = {
11
12
  src: string;
@@ -31,4 +32,4 @@ export type AudioProps = {
31
32
  delayRenderTimeoutInMilliseconds?: number;
32
33
  onError?: MediaOnError;
33
34
  credentials?: RequestCredentials;
34
- } & Pick<SequenceProps, 'from' | 'durationInFrames' | 'name' | 'showInTimeline'>;
35
+ } & Pick<SequenceProps, 'from' | 'durationInFrames' | 'name' | 'showInTimeline' | 'hidden'>;
@@ -1120,8 +1120,7 @@ var videoIteratorManager = async ({
1120
1120
  getStartTime,
1121
1121
  getIsLooping,
1122
1122
  getEffects,
1123
- getEffectChainState,
1124
- getCurrentFrame
1123
+ getEffectChainState
1125
1124
  }) => {
1126
1125
  let videoIteratorsCreated = 0;
1127
1126
  let videoFrameIterator = null;
@@ -1151,7 +1150,6 @@ var videoIteratorManager = async ({
1151
1150
  source: frame.canvas,
1152
1151
  effects,
1153
1152
  output: canvas,
1154
- frame: getCurrentFrame(),
1155
1153
  width: canvas.width,
1156
1154
  height: canvas.height
1157
1155
  });
@@ -1265,7 +1263,6 @@ class MediaPlayer {
1265
1263
  onVideoFrameCallback = null;
1266
1264
  getEffects;
1267
1265
  getEffectChainState;
1268
- getCurrentFrame;
1269
1266
  initializationPromise = null;
1270
1267
  bufferState;
1271
1268
  isPremounting;
@@ -1294,8 +1291,7 @@ class MediaPlayer {
1294
1291
  credentials,
1295
1292
  tagType,
1296
1293
  getEffects,
1297
- getEffectChainState,
1298
- getCurrentFrame
1294
+ getEffectChainState
1299
1295
  }) {
1300
1296
  this.canvas = canvas ?? null;
1301
1297
  this.src = src;
@@ -1326,7 +1322,6 @@ class MediaPlayer {
1326
1322
  this.tagType = tagType;
1327
1323
  this.getEffects = getEffects;
1328
1324
  this.getEffectChainState = getEffectChainState;
1329
- this.getCurrentFrame = getCurrentFrame;
1330
1325
  if (canvas) {
1331
1326
  const context = canvas.getContext("2d", {
1332
1327
  alpha: true,
@@ -1436,8 +1431,7 @@ class MediaPlayer {
1436
1431
  getStartTime: () => this.getStartTime(),
1437
1432
  getIsLooping: () => this.loop,
1438
1433
  getEffects: this.getEffects,
1439
- getEffectChainState: this.getEffectChainState,
1440
- getCurrentFrame: this.getCurrentFrame
1434
+ getEffectChainState: this.getEffectChainState
1441
1435
  });
1442
1436
  }
1443
1437
  const startTime = this.getTrimmedTime(startTimeUnresolved);
@@ -2093,8 +2087,7 @@ var AudioForPreviewAssertedShowing = ({
2093
2087
  credentials,
2094
2088
  tagType: "audio",
2095
2089
  getEffects: () => [],
2096
- getEffectChainState: () => null,
2097
- getCurrentFrame: () => 0
2090
+ getEffectChainState: () => null
2098
2091
  });
2099
2092
  mediaPlayerRef.current = player;
2100
2093
  player.initialize(currentTimeRef.current, initialMuted.current).then((result) => {
@@ -4363,6 +4356,7 @@ var AudioForRendering = ({
4363
4356
  onError: fallbackHtml5AudioProps?.onError,
4364
4357
  toneFrequency,
4365
4358
  acceptableTimeShiftInSeconds: fallbackHtml5AudioProps?.acceptableTimeShiftInSeconds,
4359
+ preservePitch: fallbackHtml5AudioProps?.preservePitch ?? true,
4366
4360
  name,
4367
4361
  showInTimeline
4368
4362
  });
@@ -4389,7 +4383,8 @@ var audioSchema = {
4389
4383
  default: 1,
4390
4384
  description: "Playback Rate"
4391
4385
  },
4392
- loop: { type: "boolean", default: false, description: "Loop" }
4386
+ loop: { type: "boolean", default: false, description: "Loop" },
4387
+ hidden: Internals16.hiddenField
4393
4388
  };
4394
4389
  var AudioInner = (props) => {
4395
4390
  const {
@@ -4399,6 +4394,7 @@ var AudioInner = (props) => {
4399
4394
  _experimentalControls: controls,
4400
4395
  from,
4401
4396
  durationInFrames,
4397
+ hidden,
4402
4398
  ...otherProps
4403
4399
  } = props;
4404
4400
  const environment = useRemotionEnvironment2();
@@ -4458,6 +4454,7 @@ var AudioInner = (props) => {
4458
4454
  _experimentalControls: controls,
4459
4455
  _remotionInternalLoopDisplay: loopDisplay,
4460
4456
  showInTimeline: showInTimeline ?? true,
4457
+ hidden,
4461
4458
  children: environment.isRendering ? /* @__PURE__ */ jsx3(AudioForRendering, {
4462
4459
  ...otherProps
4463
4460
  }) : /* @__PURE__ */ jsx3(AudioForPreview, {
@@ -4611,8 +4608,6 @@ var VideoForPreviewAssertedShowing = ({
4611
4608
  experimentalEffectsRef.current = _experimentalEffects;
4612
4609
  const effectChainStateRef = useRef2(effectChainState);
4613
4610
  effectChainStateRef.current = effectChainState;
4614
- const frameRef = useRef2(frame);
4615
- frameRef.current = frame;
4616
4611
  const parentSequence = useContext4(SequenceContext2);
4617
4612
  const isPremounting = Boolean(parentSequence?.premounting);
4618
4613
  const isPostmounting = Boolean(parentSequence?.postmounting);
@@ -4718,8 +4713,7 @@ var VideoForPreviewAssertedShowing = ({
4718
4713
  credentials,
4719
4714
  tagType: "video",
4720
4715
  getEffects: () => experimentalEffectsRef.current,
4721
- getEffectChainState: (width, height) => effectChainStateRef.current?.get(width, height),
4722
- getCurrentFrame: () => frameRef.current
4716
+ getEffectChainState: (width, height) => effectChainStateRef.current?.get(width, height)
4723
4717
  });
4724
4718
  mediaPlayerRef.current = player;
4725
4719
  player.initialize(currentTimeRef.current, initialMuted.current).then((result) => {
@@ -5202,6 +5196,7 @@ var VideoForRendering = ({
5202
5196
  trimAfter: trimAfterValue,
5203
5197
  trimBefore: trimBeforeValue,
5204
5198
  useWebAudioApi: fallbackOffthreadVideoProps?.useWebAudioApi ?? false,
5199
+ preservePitch: fallbackOffthreadVideoProps?.preservePitch ?? true,
5205
5200
  startFrom: undefined,
5206
5201
  endAt: undefined,
5207
5202
  stack,
@@ -5255,6 +5250,11 @@ var videoSchema = {
5255
5250
  default: 1,
5256
5251
  description: "Playback Rate"
5257
5252
  },
5253
+ hidden: {
5254
+ type: "boolean",
5255
+ default: false,
5256
+ description: "Hidden"
5257
+ },
5258
5258
  loop: { type: "boolean", default: false, description: "Loop" },
5259
5259
  ...Internals20.sequenceStyleSchema
5260
5260
  };
@@ -5393,7 +5393,8 @@ var VideoInner = ({
5393
5393
  _experimentalInitiallyDrawCachedFrame,
5394
5394
  _experimentalEffects,
5395
5395
  durationInFrames,
5396
- from
5396
+ from,
5397
+ hidden
5397
5398
  }) => {
5398
5399
  const fallbackLogLevel = Internals20.useLogLevel();
5399
5400
  const [mediaVolume] = Internals20.useMediaVolumeState();
@@ -5435,7 +5436,11 @@ var VideoInner = ({
5435
5436
  type: "video",
5436
5437
  data: basicInfo
5437
5438
  }), [basicInfo]);
5438
- const memoizedEffects = Internals20.useMemoizedEffects(Internals20.flattenEffects(_experimentalEffects ?? []));
5439
+ const memoizedEffects = Internals20.useMemoizedEffects({
5440
+ effects: _experimentalEffects ?? [],
5441
+ overrideId: controls?.overrideId ?? null
5442
+ });
5443
+ const memoizedEffectDefinitions = Internals20.useMemoizedEffectDefinitions(_experimentalEffects ?? []);
5439
5444
  if (sequenceDurationInFrames === 0) {
5440
5445
  return null;
5441
5446
  }
@@ -5448,8 +5453,9 @@ var VideoInner = ({
5448
5453
  name: name ?? "<Video>",
5449
5454
  _experimentalControls: controls,
5450
5455
  _remotionInternalLoopDisplay: loopDisplay,
5451
- _experimentalEffects: memoizedEffects,
5456
+ _experimentalEffects: memoizedEffectDefinitions,
5452
5457
  showInTimeline: showInTimeline ?? true,
5458
+ hidden,
5453
5459
  children: /* @__PURE__ */ jsx6(InnerVideo, {
5454
5460
  audioStreamIndex: audioStreamIndex ?? 0,
5455
5461
  className,
package/dist/index.d.ts CHANGED
@@ -24,7 +24,7 @@ export declare const experimental_Audio: import("react").ComponentType<{
24
24
  delayRenderTimeoutInMilliseconds?: number | undefined;
25
25
  onError?: import("./on-error").MediaOnError | undefined;
26
26
  credentials?: RequestCredentials | undefined;
27
- } & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "name" | "showInTimeline">>;
27
+ } & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "hidden" | "name" | "showInTimeline">>;
28
28
  /**
29
29
  * @deprecated Now just `Video`
30
30
  */
@@ -59,8 +59,8 @@ export declare const experimental_Video: import("react").ComponentType<{
59
59
  credentials: RequestCredentials | undefined;
60
60
  objectFit: import(".").VideoObjectFit;
61
61
  _experimentalInitiallyDrawCachedFrame: boolean;
62
- _experimentalEffects: import("remotion").EffectDescriptor<unknown>[];
63
- }> & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "name">>;
62
+ _experimentalEffects: import("remotion").EffectsProp;
63
+ }> & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "hidden" | "name">>;
64
64
  export { AudioForPreview } from './audio/audio-for-preview';
65
65
  export { AudioProps, FallbackHtml5AudioProps } from './audio/props';
66
66
  export { MediaErrorAction } from './on-error';
@@ -42,13 +42,12 @@ export declare class MediaPlayer {
42
42
  private onVideoFrameCallback;
43
43
  private getEffects;
44
44
  private getEffectChainState;
45
- private getCurrentFrame;
46
45
  private initializationPromise;
47
46
  private bufferState;
48
47
  private isPremounting;
49
48
  private isPostmounting;
50
49
  private seekPromiseChain;
51
- constructor({ canvas, src, logLevel, sharedAudioContext, loop, trimBefore, trimAfter, playbackRate, globalPlaybackRate, audioStreamIndex, fps, debugOverlay, bufferState, isPremounting, isPostmounting, durationInFrames, onVideoFrameCallback, playing, sequenceOffset, credentials, tagType, getEffects, getEffectChainState, getCurrentFrame }: {
50
+ constructor({ canvas, src, logLevel, sharedAudioContext, loop, trimBefore, trimAfter, playbackRate, globalPlaybackRate, audioStreamIndex, fps, debugOverlay, bufferState, isPremounting, isPostmounting, durationInFrames, onVideoFrameCallback, playing, sequenceOffset, credentials, tagType, getEffects, getEffectChainState }: {
52
51
  canvas: HTMLCanvasElement | OffscreenCanvas | null;
53
52
  src: string;
54
53
  logLevel: LogLevel;
@@ -72,7 +71,6 @@ export declare class MediaPlayer {
72
71
  tagType: 'audio' | 'video';
73
72
  getEffects: () => EffectDefinitionAndStack<unknown>[];
74
73
  getEffectChainState: (width: number, height: number) => EffectChainState | null;
75
- getCurrentFrame: () => number;
76
74
  });
77
75
  private input;
78
76
  private isDisposalError;
@@ -1,4 +1,4 @@
1
- import type { EffectDefinitionAndStack, EffectDescriptor, LogLevel, LoopVolumeCurveBehavior, OnVideoFrame, SequenceProps, VolumeProp } from 'remotion';
1
+ import type { EffectDefinitionAndStack, EffectsProp, LogLevel, LoopVolumeCurveBehavior, OnVideoFrame, SequenceProps, VolumeProp } from 'remotion';
2
2
  import type { MediaOnError } from '../on-error';
3
3
  export type MediaErrorEvent = {
4
4
  error: Error;
@@ -13,6 +13,7 @@ export type FallbackOffthreadVideoProps = {
13
13
  useWebAudioApi?: boolean;
14
14
  pauseWhenBuffering?: boolean;
15
15
  onAutoPlayError?: null | (() => void);
16
+ preservePitch?: boolean;
16
17
  };
17
18
  type MandatoryVideoProps = {
18
19
  src: string;
@@ -50,10 +51,10 @@ type OptionalVideoProps = {
50
51
  credentials: RequestCredentials | undefined;
51
52
  objectFit: VideoObjectFit;
52
53
  _experimentalInitiallyDrawCachedFrame: boolean;
53
- _experimentalEffects: EffectDescriptor<unknown>[];
54
+ _experimentalEffects: EffectsProp;
54
55
  };
55
56
  export type InnerVideoProps = MandatoryVideoProps & OuterVideoProps & Omit<OptionalVideoProps, '_experimentalEffects'> & {
56
57
  _experimentalEffects: EffectDefinitionAndStack<unknown>[];
57
58
  };
58
- export type VideoProps = MandatoryVideoProps & Partial<OuterVideoProps> & Partial<OptionalVideoProps> & Pick<SequenceProps, 'durationInFrames' | 'from' | 'name'>;
59
+ export type VideoProps = MandatoryVideoProps & Partial<OuterVideoProps> & Partial<OptionalVideoProps> & Pick<SequenceProps, 'durationInFrames' | 'from' | 'name' | 'hidden'>;
59
60
  export {};
@@ -30,5 +30,5 @@ export declare const Video: React.ComponentType<{
30
30
  credentials: RequestCredentials | undefined;
31
31
  objectFit: import("./props").VideoObjectFit;
32
32
  _experimentalInitiallyDrawCachedFrame: boolean;
33
- _experimentalEffects: import("remotion").EffectDescriptor<unknown>[];
34
- }> & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "name">>;
33
+ _experimentalEffects: import("remotion").EffectsProp;
34
+ }> & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "hidden" | "name">>;
@@ -2,7 +2,7 @@ import type { InputVideoTrack, WrappedCanvas } from 'mediabunny';
2
2
  import type { EffectChainState, EffectDefinitionAndStack } from 'remotion';
3
3
  import type { DelayPlaybackIfNotPremounting } from './delay-playback-if-not-premounting';
4
4
  import type { Nonce } from './nonce-manager';
5
- export declare const videoIteratorManager: ({ delayPlaybackHandleIfNotPremounting, canvas, context, drawDebugOverlay, logLevel, getOnVideoFrameCallback, videoTrack, getLoopSegmentMediaEndTimestamp, getStartTime, getIsLooping, getEffects, getEffectChainState, getCurrentFrame, }: {
5
+ export declare const videoIteratorManager: ({ delayPlaybackHandleIfNotPremounting, canvas, context, drawDebugOverlay, logLevel, getOnVideoFrameCallback, videoTrack, getLoopSegmentMediaEndTimestamp, getStartTime, getIsLooping, getEffects, getEffectChainState, }: {
6
6
  videoTrack: InputVideoTrack;
7
7
  delayPlaybackHandleIfNotPremounting: () => DelayPlaybackIfNotPremounting;
8
8
  context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D | null;
@@ -15,7 +15,6 @@ export declare const videoIteratorManager: ({ delayPlaybackHandleIfNotPremountin
15
15
  getIsLooping: () => boolean;
16
16
  getEffects: () => EffectDefinitionAndStack<unknown>[];
17
17
  getEffectChainState: (width: number, height: number) => EffectChainState | null;
18
- getCurrentFrame: () => number;
19
18
  }) => Promise<{
20
19
  startVideoIterator: (timeToSeek: number, nonce: Nonce) => Promise<void>;
21
20
  getVideoIteratorsCreated: () => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/media",
3
- "version": "4.0.461",
3
+ "version": "4.0.463",
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.42.0",
26
- "remotion": "4.0.461",
25
+ "mediabunny": "1.45.0",
26
+ "remotion": "4.0.463",
27
27
  "zod": "4.3.6"
28
28
  },
29
29
  "peerDependencies": {
@@ -31,7 +31,7 @@
31
31
  "react-dom": ">=16.8.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@remotion/eslint-config-internal": "4.0.461",
34
+ "@remotion/eslint-config-internal": "4.0.463",
35
35
  "@vitest/browser-webdriverio": "4.0.9",
36
36
  "eslint": "9.19.0",
37
37
  "react": "19.2.3",
@@ -1,21 +0,0 @@
1
- import type { EffectDefinitionAndStack, LoopDisplay, SequenceControls } from 'remotion';
2
- import { type VolumeProp } from 'remotion';
3
- export declare const useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, stack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, trimBefore, trimAfter, controls, _experimentalEffects, }: {
4
- volume: VolumeProp | undefined;
5
- mediaVolume: number;
6
- src: string | undefined;
7
- mediaType: "audio" | "video";
8
- playbackRate: number;
9
- displayName: string | null;
10
- stack: string | null;
11
- showInTimeline: boolean;
12
- premountDisplay: number | null;
13
- postmountDisplay: number | null;
14
- loopDisplay: LoopDisplay | undefined;
15
- trimBefore: number | undefined;
16
- trimAfter: number | undefined;
17
- controls: SequenceControls | undefined;
18
- _experimentalEffects: EffectDefinitionAndStack<unknown>[];
19
- }) => {
20
- id: string;
21
- };