fix: preserve background music when original video audio is muted - #1582
Abhishek2005-ard wants to merge 13 commits into
Conversation
|
@Abhishek2005-ard is attempting to deploy a commit to the magic-peach1's projects Team on Vercel. A member of the Team first needs to authorize it. |
✅ PR Format Check Passed — @Abhishek2005-ardBasic format checks passed. A maintainer will review your code changes. This does not mean the PR is approved — it just means the format is correct. |
👋 Thanks for your PR, @Abhishek2005-ard!Welcome to Reframe — a browser-based video editor built for everyone 🎬 What happens next
Quick checklist
Useful links
Happy coding! 🎉 |
|
Thanks for opening this! This PR has picked up merge conflicts with |
Description
This PR resolves a frustrating UX bug where muting the original video audio (by toggling
keepAudioto false) would accidentally completely discard any custom background music the user had uploaded.Previously, the detection for a background music track strictly required
recipe.keepAudioto betrue, causing the entire audio pipeline to be shut down during export if the video was muted.Changes Made
hasMusicTrackfromrecipe.keepAudioso the editor correctly detects background music regardless of the video's mute state.shouldKeepAudioaggregate check inbuildArgumentsto evaluate to true if either the original audio is kept or a background music track is present:(recipe.keepAudio && hasOriginalAudio) || hasMusicTrack.hasOriginalAudioconditions inside thefilter_complexbuilder to explicitly verifyrecipe.keepAudio. IfkeepAudiois false, it routes to theelseblock and processes the background music as the sole audio output stream.Impact
Users can now confidently mute their noisy original video footage while retaining their uploaded background music track, resulting in a clean, perfectly mixed final export.
Testing
keepAudio: false) and background music enabled (successfully exported with only background music).npm test.close #1759