Skip to content

🎥 Make videos programmatically with React

1.5 KB
Raw Blame
import type {
	InteractiveBaseProps,
	InteractivePremountProps,
	LogLevel,
	LoopVolumeCurveBehavior,
	VolumeProp,
} from 'remotion';
import type {MediaOnError} from '../on-error';
import type {MediaRequestInit} from '../request-init';

export type FallbackHtml5AudioProps = {
	crossOrigin?: '' | 'anonymous' | 'use-credentials' | undefined;
	onError?: (err: Error) => void;
	useWebAudioApi?: boolean;
	acceptableTimeShiftInSeconds?: number;
	pauseWhenBuffering?: boolean;
	preservePitch?: boolean;
};

export type AudioProps = {
	src: string;
	trimBefore?: number;
	/**
	 * @deprecated Use `durationInFrames` instead. See https://github.com/remotion-dev/remotion/pull/11685
	 */
	trimAfter?: number;
	volume?: VolumeProp;
	loopVolumeCurveBehavior?: LoopVolumeCurveBehavior;
	playbackRate?: number;
	/** Keep the original pitch when changing playback speed. Default: false. */
	preservePitch?: boolean;
	muted?: boolean;
	style?: React.CSSProperties;
	logLevel?: LogLevel;
	loop?: boolean;
	audioStreamIndex?: number;
	_remotionInternalNativeLoopPassed?: boolean;
	fallbackHtml5AudioProps?: FallbackHtml5AudioProps;
	disallowFallbackToHtml5Audio?: boolean;
	toneFrequency?: number;
	delayRenderRetries?: number;
	delayRenderTimeoutInMilliseconds?: number;
	onError?: MediaOnError;
	/**
	 * @deprecated Use `requestInit={{credentials: ...}}` instead. If both are
	 * passed, `requestInit.credentials` wins over this prop.
	 */
	credentials?: RequestCredentials;
	requestInit?: MediaRequestInit;
} & InteractiveBaseProps &
	Pick<InteractivePremountProps, 'premountFor' | 'postmountFor'>;