Skip to content

Issues with audio playback timing and stopping behavior in Sequences using premountFor #5327

Closed
@cofenster-lukasz

Description

@cofenster-lukasz

Bug Report 🐛

  1. Audio Starts prematurely when using premountFor
    The Audio element inside a Sequence with premountFor set starts playing before the sequence actually becomes visible. In the example below, the audio is expected to start at frame 30. However, due to premountFor being set to 30, the audio begins playback from frame 0 instead.
  2. Audio playback continues even after player stops
    When the player is started and then stopped before reaching frame 30, the audio never stops playing as expected. This results in the audio continuing in the background, even though playback has been halted.
const container: React.CSSProperties = {
  backgroundColor: "white",
};

export const Main = ({ title }: z.infer<typeof CompositionProps>) => {
  const { durationInFrames } = useVideoConfig();

  return (
    <AbsoluteFill style={container}>
       <Sequence from={0} durationInFrames={durationInFrames}>
          <div>test</div>
        </Sequence>
       <Sequence from={30} durationInFrames={100} premountFor={30}>
          <Audio src="https://sampleaudio.url  />
       </Sequence>
    </AbsoluteFill>
  );
};

Tested on version 4.0.311 and 4.0.267

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions