Skip to content

Commit

Permalink
Merge pull request #870 from roflcoopter/feature/live-button-nan-check
Browse files Browse the repository at this point in the history
check for nan value when clicking the LIVE button
  • Loading branch information
roflcoopter authored Dec 31, 2024
2 parents ad898dc + 7462d8f commit c185162
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/components/events/EventPlayerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,11 @@ const usePlayerCardCallbacks = () => {
const handleLiveClick = useCallback(() => {
hlsRefs.forEach((player) => {
if (player) {
player.current!.media!.currentTime =
player.current!.media!.duration - LIVE_EDGE_DELAY;
const currentTime = player.current!.media!.duration - LIVE_EDGE_DELAY;
if (!Number.isNaN(currentTime)) {
player.current!.media!.currentTime =
player.current!.media!.duration - LIVE_EDGE_DELAY;
}
}
});
showControlsTemporarily();
Expand Down

0 comments on commit c185162

Please sign in to comment.