Skip to content
Merged
10 changes: 5 additions & 5 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ The **package name** for each folder is `@remotion/[folder-name]`, except for th

## Build instructions

- `pnpm` is the package manager for the project.
- To build the project after you made changes, run `bunx turbo make --filter="[package-name]"` and only include the package you are working on. Refer to package naming convention above. For example, the command to build the package in `packages/shapes` is `bunx turbo make --filter="@remotion/shapes"`.

## Documentation

Any new features or settings should be documented in the `pacakges/docs` folder.
Any new features or settings should be documented in the `packages/docs` folder.

- Add new pages to the sidebar: `packages/docs/sidebars.js`.
- When creating a new page, don't add the `image:` tag to the frontmatter. It will be added later.
- Generate og:images when creating new documentation pages by running `cd package/docs && bun render-cards.mjs`. Commit the created image and the changed frontmatter.
- When creating a new page or duplicating an existing page, don't add the `image:` tag to the frontmatter at first. Instead, run `cd package/docs && bun render-cards.mjs` afterwards to generate and automatically add the `image:` tag. Commit the created image and the changed frontmatter.
- Usually, there is a TableOfContents.tsx file in the folder of the documentaiton for the package. Add it there as well if there is a table of contents.

## Committing
## Commit messages

- Use the commit message format "`[package-name]: [commit-message]`". Use the package name from the package naming convention above.
- Use the commit message format "`[package-name]: [commit-message]`". Use the package name from the package naming convention above, for example "`@remotion/shapes: Add heart shape`".
6 changes: 4 additions & 2 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ jobs:
- uses: oven-sh/setup-bun@v2.0.1
with:
bun-version: 1.2.10
- name: Install
run: pnpm i --frozen-lockfile
- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Install
run: pnpm i --frozen-lockfile
- name: Build
run: pnpm run build
17 changes: 1 addition & 16 deletions packages/core/src/buffer-until-first-frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ const isSafariWebkit = () => {
return isSafari;
};

const isDesktopChrome = () => {
const isChrome = /chrome/i.test(window.navigator.userAgent);
const isDesktop = !/mobile/i.test(window.navigator.userAgent);
return isChrome && isDesktop;
};

export const useBufferUntilFirstFrame = ({
mediaRef,
mediaType,
Expand Down Expand Up @@ -50,16 +44,7 @@ export const useBufferUntilFirstFrame = ({
return;
}

if (
current.readyState >= current.HAVE_FUTURE_DATA &&
!isSafariWebkit() &&
// In Desktop Chrome, the video might switch to playing
// but does not play due to Bluetooth headphones

// Enabling back this flag for Chrome without extensive testing
// because we never had big problems on Chrome
!isDesktopChrome()
) {
if (current.readyState >= current.HAVE_FUTURE_DATA && !isSafariWebkit()) {
playbackLogging({
logLevel,
message: `Not using buffer until first frame, because readyState is ${current.readyState} and is not Safari or Desktop Chrome`,
Expand Down
4 changes: 4 additions & 0 deletions packages/docs/docs/get-audio-duration-in-seconds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ id: get-audio-duration-in-seconds
crumb: '@remotion/media-utils'
---

:::warning Deprecated
This function has been deprecated. Use [`parseMedia()`](/docs/media-parser/parse-media) instead, which is faster and supports more formats.
:::

_Part of the `@remotion/media-utils` package of helper functions._

_Previously called `getAudioDuration()`._
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/docs/get-video-metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ crumb: '@remotion/media-utils'
_Part of the `@remotion/media-utils` package of helper functions._

:::note
Does not support H.265 videos on Linux and also fails on some other formats. Soon to be deprecated.
Suggestion: Use [`parseMedia()`](/docs/media-parser/parse-media) to get video metadata instead.
Deprecated: Does not support H.265 videos on Linux and also fails on some other formats.
Use [`parseMedia()`](/docs/media-parser/parse-media) to get video metadata instead, which is faster and supports more formats.
:::

:::note
Expand Down
3 changes: 2 additions & 1 deletion packages/media-utils/src/get-audio-duration-in-seconds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ const fn = (src: string): Promise<number> => {
});
};

/*
/**
* @description Gets the duration in seconds of an audio source by creating an invisible `<audio>` tag, loading the audio, and returning the duration.
* @see [Documentation](https://remotion.dev/docs/get-audio-duration-in-seconds)
* @deprecated Use `parseMedia()` instead: https://www.remotion.dev/docs/media-parser/parse-media
*/
export const getAudioDurationInSeconds = (src: string) => {
return limit(fn, src);
Expand Down
Loading