diff --git a/package.json b/package.json index a6cd20d792..c003065642 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "testwebcodecs": "turbo run testwebcodecs --no-update-notifier", "testlambda": "turbo run testlambda --concurrency=1 --no-update-notifier", "ci": "turbo run make test --concurrency=1 --no-update-notifier", - "watch": "turbo watch make --concurrency=2 --experimental-write-cache --ui=tui", + "watch": "turbo watch make --concurrency=2 --experimental-write-cache", "makewhisperweb": "turbo run make --filter='@remotion/whisper-web'", "watchwhisperweb": "turbo watch make --experimental-write-cache --filter='@remotion/whisper-web'", "makewebcodecs": "turbo run make --filter='@remotion/media-parser' --filter='@remotion/webcodecs'", diff --git a/packages/core/src/CompositionManager.tsx b/packages/core/src/CompositionManager.tsx index 0b1eda8d85..baf53744db 100644 --- a/packages/core/src/CompositionManager.tsx +++ b/packages/core/src/CompositionManager.tsx @@ -136,6 +136,17 @@ export type AudioOrVideoAsset = { audioStreamIndex: number; }; +export type InlineAudioAsset = { + type: 'inline-audio'; + id: string; + audio: number[]; + frame: number; + sampleRate: number; + numberOfChannels: number; + timestamp: number; + duration: number; +}; + type DiscriminatedArtifact = | { contentType: 'binary'; @@ -157,7 +168,7 @@ export type ArtifactAsset = { downloadBehavior: DownloadBehavior | null; } & DiscriminatedArtifact; -export type TRenderAsset = AudioOrVideoAsset | ArtifactAsset; +export type TRenderAsset = AudioOrVideoAsset | ArtifactAsset | InlineAudioAsset; export const compositionsRef = React.createRef<{ getCompositions: () => AnyComposition[]; diff --git a/packages/core/src/no-react.ts b/packages/core/src/no-react.ts index 6f19d6776d..d540618a79 100644 --- a/packages/core/src/no-react.ts +++ b/packages/core/src/no-react.ts @@ -1,6 +1,7 @@ export type { ArtifactAsset, AudioOrVideoAsset, + InlineAudioAsset, TRenderAsset, } from './CompositionManager'; export {DownloadBehavior} from './download-behavior'; diff --git a/packages/docs/docs/new-video/index.mdx b/packages/docs/docs/new-video/index.mdx index dfaeb81869..a6b3057a29 100644 --- a/packages/docs/docs/new-video/index.mdx +++ b/packages/docs/docs/new-video/index.mdx @@ -5,7 +5,7 @@ crumb: 'API' --- :::warning -**Very experimental**: This component is in a very early stage and **slower** than OffthreadVideo. +**Very experimental**: This component is in a very early stage and does not support some basic features such as volume or playback rate or CSS styling. The current focus is on correctness, not on performance. We recommend that you use [``](/docs/offthreadvideo) for now. @@ -49,7 +49,7 @@ export const MyComposition = () => { The URL of the video to be rendered. Can be a remote URL or a local file referenced with [`staticFile()`](/docs/staticfile). -### `trimBefore?` +### `trimBefore?` Will remove a portion of the video at the beginning (left side). @@ -76,107 +76,29 @@ export const MyComposition = () => { }; ``` -### `trimAfter?` +### `trimAfter?` Removes a portion of the video at the end (right side). See [`trimBefore`](/docs/video#trimbefore) for an explanation. ### `volume?` -Allows you to control the volume for the whole track or change it on a per-frame basis. Refer to the [using audio](/docs/audio/volume) guide to learn how to use it. +**Currently not supported!** -```tsx twoslash title="Example using static volume" -import {AbsoluteFill, staticFile} from 'remotion'; -import {experimental_NewVideo as NewVideo} from '@remotion/video'; - -// ---cut--- -export const MyComposition = () => { - return ( - - - - ); -}; -``` +### `loopVolumeCurveBehavior?` -```tsx twoslash title="Example of a ramp up over 100 frames" -import {AbsoluteFill, interpolate, staticFile} from 'remotion'; -import {experimental_NewVideo as NewVideo} from '@remotion/video'; +**Currently not supported!** -// ---cut--- -export const MyComposition = () => { - return ( - - interpolate(f, [0, 100], [0, 1], {extrapolateLeft: 'clamp'})} src={staticFile('video.webm')} /> - - ); -}; -``` - -By default, volumes between 0 and 1 are supported, where in iOS Safari, the volume is always 1. -See [Volume Limitations](/docs/audio/volume#limitations) for more information. - -### `loopVolumeCurveBehavior?` - -Controls the `frame` which is returned when using the [`volume`](#volume) callback function and wrapping `OffthreadVideo` in a [``](/docs/loop). - -Can be either `"repeat"` (default, start from 0 on each iteration) or `"extend"` (keep increasing frames). - -### `style?` - -You can pass any style you can pass to a native HTML element. Keep in mind that during rendering, `` renders a `canvas` tag, but a `