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({
|
||||
id,
|
||||
isPreviewChannel,
|
||||
}: {
|
||||
id: number;
|
||||
isPreviewChannel: boolean;
|
||||
}) {
|
||||
export function Player({ id }: { id: number }) {
|
||||
// Define time remaining (secs) when the play icon should flash.
|
||||
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.
|
||||
const playerState = useSelector(
|
||||
(state: RootState) => state.mixer.players[id],
|
||||
|
@ -620,7 +616,7 @@ export function PflPlayer() {
|
|||
<span className="mx-1 hover-label always-show">
|
||||
Preview Player (Headphones Only)
|
||||
</span>
|
||||
<Player id={PLAYER_ID_PREVIEW} isPreviewChannel={true} />
|
||||
<Player id={PLAYER_ID_PREVIEW} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ function Channel({ id, data }: { id: number; data: PlanItem[] }) {
|
|||
</div>
|
||||
)}
|
||||
</Droppable>
|
||||
<Player id={id} isPreviewChannel={false} />
|
||||
<Player id={id} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue