Reuse PLAYER_ID_PREVIEW for preview player templating
This commit is contained in:
parent
2be7c2bb04
commit
2dff76a146
2 changed files with 5 additions and 9 deletions
|
@ -345,16 +345,12 @@ function LoadedTrackInfo({ id }: { id: number }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Player({
|
export function Player({ id }: { id: number }) {
|
||||||
id,
|
|
||||||
isPreviewChannel,
|
|
||||||
}: {
|
|
||||||
id: number;
|
|
||||||
isPreviewChannel: boolean;
|
|
||||||
}) {
|
|
||||||
// Define time remaining (secs) when the play icon should flash.
|
// Define time remaining (secs) when the play icon should flash.
|
||||||
const SECS_REMAINING_WARNING = 20;
|
const SECS_REMAINING_WARNING = 20;
|
||||||
|
|
||||||
|
const isPreviewChannel = id === PLAYER_ID_PREVIEW;
|
||||||
|
|
||||||
// We want to force update the selector when we pass the SECS_REMAINING_WARNING barrier.
|
// We want to force update the selector when we pass the SECS_REMAINING_WARNING barrier.
|
||||||
const playerState = useSelector(
|
const playerState = useSelector(
|
||||||
(state: RootState) => state.mixer.players[id],
|
(state: RootState) => state.mixer.players[id],
|
||||||
|
@ -620,7 +616,7 @@ export function PflPlayer() {
|
||||||
<span className="mx-1 hover-label always-show">
|
<span className="mx-1 hover-label always-show">
|
||||||
Preview Player (Headphones Only)
|
Preview Player (Headphones Only)
|
||||||
</span>
|
</span>
|
||||||
<Player id={PLAYER_ID_PREVIEW} isPreviewChannel={true} />
|
<Player id={PLAYER_ID_PREVIEW} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ function Channel({ id, data }: { id: number; data: PlanItem[] }) {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Droppable>
|
</Droppable>
|
||||||
<Player id={id} isPreviewChannel={false} />
|
<Player id={id} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue