@remotion/media 4.0.470 → 4.0.472

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.
@@ -37,12 +37,13 @@ var __callDispose = (stack, error, hasError) => {
37
37
  };
38
38
 
39
39
  // src/audio/audio.tsx
40
- import { useState as useState3 } from "react";
41
- import { useMemo as useMemo3 } from "react";
40
+ import { useMemo as useMemo3, useState as useState3 } from "react";
42
41
  import {
42
+ Internals as Internals16,
43
+ Sequence,
44
+ useRemotionEnvironment as useRemotionEnvironment2,
43
45
  useVideoConfig as useVideoConfig2
44
46
  } from "remotion";
45
- import { Internals as Internals16, Sequence, useRemotionEnvironment as useRemotionEnvironment2 } from "remotion";
46
47
 
47
48
  // src/show-in-timeline.ts
48
49
  import { Internals } from "remotion";
@@ -4567,14 +4568,17 @@ var audioSchema = {
4567
4568
  max: 20,
4568
4569
  step: 0.01,
4569
4570
  default: 1,
4570
- description: "Volume"
4571
+ description: "Volume",
4572
+ hiddenFromList: false
4571
4573
  },
4572
4574
  playbackRate: {
4573
4575
  type: "number",
4574
4576
  min: 0.1,
4575
4577
  step: 0.01,
4576
4578
  default: 1,
4577
- description: "Playback Rate"
4579
+ description: "Playback Rate",
4580
+ hiddenFromList: false,
4581
+ keyframable: false
4578
4582
  },
4579
4583
  loop: { type: "boolean", default: false, description: "Loop" },
4580
4584
  hidden: Internals16.hiddenField
@@ -4659,11 +4663,15 @@ var AudioInner = (props) => {
4659
4663
  })
4660
4664
  });
4661
4665
  };
4662
- var Audio = Internals16.wrapInSchema(AudioInner, audioSchema);
4666
+ var Audio = Internals16.wrapInSchema({
4667
+ Component: AudioInner,
4668
+ schema: audioSchema,
4669
+ supportsEffects: false
4670
+ });
4663
4671
  Internals16.addSequenceStackTraces(Audio);
4664
4672
 
4665
4673
  // src/video/video.tsx
4666
- import { useMemo as useMemo6, useState as useState6 } from "react";
4674
+ import React6, { useMemo as useMemo6, useState as useState6 } from "react";
4667
4675
  import {
4668
4676
  Internals as Internals20,
4669
4677
  Sequence as Sequence2,
@@ -4673,6 +4681,7 @@ import {
4673
4681
 
4674
4682
  // src/video/video-for-preview.tsx
4675
4683
  import {
4684
+ useCallback,
4676
4685
  useContext as useContext4,
4677
4686
  useEffect as useEffect2,
4678
4687
  useLayoutEffect as useLayoutEffect3,
@@ -4772,7 +4781,9 @@ var VideoForPreviewAssertedShowing = ({
4772
4781
  objectFit: objectFitProp,
4773
4782
  _experimentalInitiallyDrawCachedFrame,
4774
4783
  effects,
4775
- setMediaDurationInSeconds
4784
+ setMediaDurationInSeconds,
4785
+ refForOutline,
4786
+ ...props
4776
4787
  }) => {
4777
4788
  const src = usePreload2(unpreloadedSrc);
4778
4789
  const canvasRef = useRef2(null);
@@ -4789,6 +4800,13 @@ var VideoForPreviewAssertedShowing = ({
4789
4800
  const { playbackRate: globalPlaybackRate } = Internals18.usePlaybackRate();
4790
4801
  const sharedAudioContext = useContext4(SharedAudioContext2);
4791
4802
  const buffer = useBufferState2();
4803
+ const canvasRefCallback = useCallback((canvas) => {
4804
+ canvasRef.current = canvas;
4805
+ refForOutline.current = canvas;
4806
+ }, [refForOutline]);
4807
+ const fallbackVideoRef = useCallback((video) => {
4808
+ refForOutline.current = video;
4809
+ }, [refForOutline]);
4792
4810
  const [mediaMuted] = useMediaMutedState2();
4793
4811
  const [mediaVolume] = useMediaVolumeState2();
4794
4812
  const volumePropFrame = useFrameForVolumeProp2(loopVolumeCurveBehavior);
@@ -4858,8 +4876,8 @@ var VideoForPreviewAssertedShowing = ({
4858
4876
  if (!_experimentalInitiallyDrawCachedFrame) {
4859
4877
  return;
4860
4878
  }
4861
- const canvas = canvasRef.current;
4862
4879
  return () => {
4880
+ const canvas = canvasRef.current;
4863
4881
  if (!canvas || !hasDrawnRealFrameRef.current || isPremountingRef.current) {
4864
4882
  return;
4865
4883
  }
@@ -5063,6 +5081,8 @@ var VideoForPreviewAssertedShowing = ({
5063
5081
  }, [objectFitProp, style]);
5064
5082
  if (shouldFallbackToNativeVideo && !disallowFallbackToOffthreadVideo) {
5065
5083
  return /* @__PURE__ */ jsx4(Html5Video, {
5084
+ ...props,
5085
+ ref: fallbackVideoRef,
5066
5086
  src,
5067
5087
  style: actualStyle,
5068
5088
  className,
@@ -5083,7 +5103,8 @@ var VideoForPreviewAssertedShowing = ({
5083
5103
  return null;
5084
5104
  }
5085
5105
  return /* @__PURE__ */ jsx4("canvas", {
5086
- ref: canvasRef,
5106
+ ...props,
5107
+ ref: canvasRefCallback,
5087
5108
  style: actualStyle,
5088
5109
  className: classNameValue
5089
5110
  });
@@ -5164,7 +5185,8 @@ var VideoForRendering = ({
5164
5185
  credentials,
5165
5186
  requestInit,
5166
5187
  objectFit: objectFitProp,
5167
- effects
5188
+ effects,
5189
+ ...props
5168
5190
  }) => {
5169
5191
  if (!src) {
5170
5192
  throw new TypeError("No `src` was passed to <Video>.");
@@ -5399,6 +5421,7 @@ var VideoForRendering = ({
5399
5421
  }, [objectFitProp, style]);
5400
5422
  if (replaceWithOffthreadVideo) {
5401
5423
  const fallback = /* @__PURE__ */ jsx5(Internals19.InnerOffthreadVideo, {
5424
+ ...props,
5402
5425
  src,
5403
5426
  playbackRate: playbackRate ?? 1,
5404
5427
  muted: muted ?? false,
@@ -5454,6 +5477,7 @@ var VideoForRendering = ({
5454
5477
  return null;
5455
5478
  }
5456
5479
  return /* @__PURE__ */ jsx5("canvas", {
5480
+ ...props,
5457
5481
  ref: canvasRef,
5458
5482
  style: styleWithObjectFit,
5459
5483
  className: classNameValue
@@ -5470,14 +5494,17 @@ var videoSchema = {
5470
5494
  max: 20,
5471
5495
  step: 0.01,
5472
5496
  default: 1,
5473
- description: "Volume"
5497
+ description: "Volume",
5498
+ hiddenFromList: false
5474
5499
  },
5475
5500
  playbackRate: {
5476
5501
  type: "number",
5477
5502
  min: 0.1,
5478
5503
  step: 0.01,
5479
5504
  default: 1,
5480
- description: "Playback Rate"
5505
+ description: "Playback Rate",
5506
+ hiddenFromList: false,
5507
+ keyframable: false
5481
5508
  },
5482
5509
  hidden: {
5483
5510
  type: "boolean",
@@ -5517,7 +5544,9 @@ var InnerVideo = ({
5517
5544
  objectFit,
5518
5545
  _experimentalInitiallyDrawCachedFrame,
5519
5546
  effects,
5520
- setMediaDurationInSeconds
5547
+ setMediaDurationInSeconds,
5548
+ refForOutline,
5549
+ ...props
5521
5550
  }) => {
5522
5551
  const environment = useRemotionEnvironment4();
5523
5552
  if (typeof src !== "string") {
@@ -5538,6 +5567,7 @@ var InnerVideo = ({
5538
5567
  validateMediaProps2({ playbackRate, volume }, "Video");
5539
5568
  if (environment.isRendering) {
5540
5569
  return /* @__PURE__ */ jsx6(VideoForRendering, {
5570
+ ...props,
5541
5571
  audioStreamIndex: audioStreamIndex ?? 0,
5542
5572
  className,
5543
5573
  delayRenderRetries: delayRenderRetries ?? null,
@@ -5566,6 +5596,7 @@ var InnerVideo = ({
5566
5596
  });
5567
5597
  }
5568
5598
  return /* @__PURE__ */ jsx6(VideoForPreview, {
5599
+ ...props,
5569
5600
  setMediaDurationInSeconds,
5570
5601
  audioStreamIndex: audioStreamIndex ?? 0,
5571
5602
  className,
@@ -5592,7 +5623,8 @@ var InnerVideo = ({
5592
5623
  controls,
5593
5624
  objectFit,
5594
5625
  effects,
5595
- _experimentalInitiallyDrawCachedFrame
5626
+ _experimentalInitiallyDrawCachedFrame,
5627
+ refForOutline
5596
5628
  });
5597
5629
  };
5598
5630
  var VideoInner = ({
@@ -5628,7 +5660,8 @@ var VideoInner = ({
5628
5660
  effects,
5629
5661
  durationInFrames,
5630
5662
  from,
5631
- hidden
5663
+ hidden,
5664
+ ...props
5632
5665
  }) => {
5633
5666
  const fallbackLogLevel = Internals20.useLogLevel();
5634
5667
  const [mediaVolume] = Internals20.useMediaVolumeState();
@@ -5675,6 +5708,7 @@ var VideoInner = ({
5675
5708
  overrideId: controls?.overrideId ?? null
5676
5709
  });
5677
5710
  const memoizedEffectDefinitions = Internals20.useMemoizedEffectDefinitions(effects ?? []);
5711
+ const refForOutline = React6.useRef(null);
5678
5712
  if (sequenceDurationInFrames === 0) {
5679
5713
  return null;
5680
5714
  }
@@ -5689,9 +5723,11 @@ var VideoInner = ({
5689
5723
  _experimentalControls: controls,
5690
5724
  _remotionInternalLoopDisplay: loopDisplay,
5691
5725
  _remotionInternalEffects: memoizedEffectDefinitions,
5726
+ _remotionInternalRefForOutline: refForOutline,
5692
5727
  showInTimeline: showInTimeline ?? true,
5693
5728
  hidden,
5694
5729
  children: /* @__PURE__ */ jsx6(InnerVideo, {
5730
+ ...props,
5695
5731
  audioStreamIndex: audioStreamIndex ?? 0,
5696
5732
  className,
5697
5733
  delayRenderRetries: delayRenderRetries ?? null,
@@ -5721,11 +5757,16 @@ var VideoInner = ({
5721
5757
  objectFit: objectFit ?? "contain",
5722
5758
  _experimentalInitiallyDrawCachedFrame: _experimentalInitiallyDrawCachedFrame ?? false,
5723
5759
  effects: memoizedEffects,
5724
- setMediaDurationInSeconds
5760
+ setMediaDurationInSeconds,
5761
+ refForOutline
5725
5762
  })
5726
5763
  });
5727
5764
  };
5728
- var Video = Internals20.wrapInSchema(VideoInner, videoSchema);
5765
+ var Video = Internals20.wrapInSchema({
5766
+ Component: VideoInner,
5767
+ schema: videoSchema,
5768
+ supportsEffects: true
5769
+ });
5729
5770
  Internals20.addSequenceStackTraces(Video);
5730
5771
 
5731
5772
  // src/index.ts
package/dist/index.d.ts CHANGED
@@ -62,7 +62,7 @@ export declare const experimental_Video: import("react").ComponentType<{
62
62
  objectFit: import(".").VideoObjectFit;
63
63
  _experimentalInitiallyDrawCachedFrame: boolean;
64
64
  effects: import("remotion").EffectsProp;
65
- }> & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "hidden" | "name">>;
65
+ }> & Omit<import("react").HTMLAttributes<HTMLElement>, "_experimentalInitiallyDrawCachedFrame" | "audioStreamIndex" | "className" | "credentials" | "debugOverlay" | "delayRenderRetries" | "delayRenderTimeoutInMilliseconds" | "disallowFallbackToOffthreadVideo" | "effects" | "fallbackOffthreadVideoProps" | "headless" | "logLevel" | "loop" | "loopVolumeCurveBehavior" | "muted" | "objectFit" | "onError" | "onVideoFrame" | "playbackRate" | "requestInit" | "showInTimeline" | "src" | "stack" | "style" | "toneFrequency" | "trimAfter" | "trimBefore" | "volume"> & Record<`data-${string}`, string | undefined> & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "hidden" | "name">>;
66
66
  export { AudioForPreview } from './audio/audio-for-preview';
67
67
  export { AudioProps, FallbackHtml5AudioProps } from './audio/props';
68
68
  export { MediaErrorAction } from './on-error';
@@ -1,3 +1,4 @@
1
+ import type React from 'react';
1
2
  import type { EffectDefinitionAndStack, EffectsProp, LogLevel, LoopVolumeCurveBehavior, OnVideoFrame, SequenceProps, VolumeProp } from 'remotion';
2
3
  import type { MediaOnError } from '../on-error';
3
4
  import type { MediaRequestInit } from '../request-init';
@@ -59,8 +60,9 @@ type OptionalVideoProps = {
59
60
  _experimentalInitiallyDrawCachedFrame: boolean;
60
61
  effects: EffectsProp;
61
62
  };
62
- export type InnerVideoProps = MandatoryVideoProps & OuterVideoProps & Omit<OptionalVideoProps, 'effects'> & {
63
+ export type NativeVideoProps = Omit<React.HTMLAttributes<HTMLElement>, keyof MandatoryVideoProps | keyof OuterVideoProps | keyof OptionalVideoProps | 'onError'> & Record<`data-${string}`, string | undefined>;
64
+ export type InnerVideoProps = MandatoryVideoProps & OuterVideoProps & Omit<OptionalVideoProps, 'effects'> & NativeVideoProps & {
63
65
  effects: EffectDefinitionAndStack<unknown>[];
64
66
  };
65
- export type VideoProps = MandatoryVideoProps & Partial<OuterVideoProps> & Partial<OptionalVideoProps> & Pick<SequenceProps, 'durationInFrames' | 'from' | 'name' | 'hidden'>;
67
+ export type VideoProps = MandatoryVideoProps & Partial<OuterVideoProps> & Partial<OptionalVideoProps> & NativeVideoProps & Pick<SequenceProps, 'durationInFrames' | 'from' | 'name' | 'hidden'>;
66
68
  export {};
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import type { EffectDefinitionAndStack, LogLevel, LoopVolumeCurveBehavior, SequenceControls, VolumeProp } from 'remotion';
3
3
  import { type MediaOnError } from '../on-error';
4
4
  import type { MediaRequestInit } from '../request-init';
5
- import type { FallbackOffthreadVideoProps, VideoObjectFit } from './props';
6
- type VideoForPreviewProps = {
5
+ import type { FallbackOffthreadVideoProps, NativeVideoProps, VideoObjectFit } from './props';
6
+ type VideoForPreviewProps = NativeVideoProps & {
7
7
  readonly src: string;
8
8
  readonly style: React.CSSProperties | undefined;
9
9
  readonly playbackRate: number;
@@ -30,6 +30,7 @@ type VideoForPreviewProps = {
30
30
  readonly setMediaDurationInSeconds: (durationInSeconds: number) => void;
31
31
  readonly _experimentalInitiallyDrawCachedFrame: boolean;
32
32
  readonly effects: EffectDefinitionAndStack<unknown>[];
33
+ readonly refForOutline: React.RefObject<HTMLElement | null>;
33
34
  };
34
35
  export declare const VideoForPreview: React.FC<VideoForPreviewProps & {
35
36
  readonly controls: SequenceControls | undefined;
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import type { EffectDefinitionAndStack, LogLevel, LoopVolumeCurveBehavior, OnVideoFrame, VolumeProp } from 'remotion';
3
3
  import { type MediaOnError } from '../on-error';
4
4
  import type { MediaRequestInit } from '../request-init';
5
- import type { FallbackOffthreadVideoProps, VideoObjectFit } from './props';
6
- type InnerVideoProps = {
5
+ import type { FallbackOffthreadVideoProps, NativeVideoProps, VideoObjectFit } from './props';
6
+ type InnerVideoProps = NativeVideoProps & {
7
7
  readonly className: string | undefined;
8
8
  readonly loop: boolean;
9
9
  readonly src: string;
@@ -32,4 +32,4 @@ export declare const Video: React.ComponentType<{
32
32
  objectFit: import("./props").VideoObjectFit;
33
33
  _experimentalInitiallyDrawCachedFrame: boolean;
34
34
  effects: import("remotion").EffectsProp;
35
- }> & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "hidden" | "name">>;
35
+ }> & Omit<React.HTMLAttributes<HTMLElement>, "_experimentalInitiallyDrawCachedFrame" | "audioStreamIndex" | "className" | "credentials" | "debugOverlay" | "delayRenderRetries" | "delayRenderTimeoutInMilliseconds" | "disallowFallbackToOffthreadVideo" | "effects" | "fallbackOffthreadVideoProps" | "headless" | "logLevel" | "loop" | "loopVolumeCurveBehavior" | "muted" | "objectFit" | "onError" | "onVideoFrame" | "playbackRate" | "requestInit" | "showInTimeline" | "src" | "stack" | "style" | "toneFrequency" | "trimAfter" | "trimBefore" | "volume"> & Record<`data-${string}`, string | undefined> & Pick<import("remotion").SequenceProps, "durationInFrames" | "from" | "hidden" | "name">>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/media",
3
- "version": "4.0.470",
3
+ "version": "4.0.472",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "module": "dist/esm/index.mjs",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "mediabunny": "1.45.0",
26
- "remotion": "4.0.470",
26
+ "remotion": "4.0.472",
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.470",
34
+ "@remotion/eslint-config-internal": "4.0.472",
35
35
  "@vitest/browser-webdriverio": "4.0.9",
36
36
  "eslint": "9.19.0",
37
37
  "react": "19.2.3",