fix(preview): mute button not affecting embedded video audio, ensure topmost video track renders above lower tracksmute button not affecting embedded video audio (#529) (#532)

This commit is contained in:
Justin322322
2025-08-09 23:39:24 +02:00
committed by GitHub
parent 8c205273b7
commit e908bad167
2 changed files with 9 additions and 4 deletions
@@ -234,7 +234,8 @@ export function PreviewPanel() {
const getActiveElements = (): ActiveElement[] => {
const activeElements: ActiveElement[] = [];
tracks.forEach((track) => {
// Iterate tracks from bottom to top so topmost track renders last (on top)
;[...tracks].reverse().forEach((track) => {
track.elements.forEach((element) => {
if (element.hidden) return;
const elementStart = element.startTime;
@@ -311,6 +312,7 @@ export function PreviewPanel() {
trimEnd={element.trimEnd}
clipDuration={element.duration}
className="w-full h-full object-cover"
trackMuted={true}
/>
</div>
);
@@ -434,6 +436,7 @@ export function PreviewPanel() {
trimStart={element.trimStart}
trimEnd={element.trimEnd}
clipDuration={element.duration}
trackMuted={elementData.track.muted}
/>
</div>
);
@@ -459,7 +462,7 @@ export function PreviewPanel() {
// Audio elements (no visual representation)
if (mediaItem.type === "audio") {
return (
<div key={element.id} className="absolute inset-0">
<div key={element.id} className="absolute inset-0" style={{ pointerEvents: "none" }}>
<AudioPlayer
src={mediaItem.url!}
clipStartTime={element.startTime}