diff --git a/src/main/VideoPlayers.tsx b/src/main/VideoPlayers.tsx index 0eb23d6e8..a72986601 100644 --- a/src/main/VideoPlayers.tsx +++ b/src/main/VideoPlayers.tsx @@ -21,6 +21,7 @@ import { setJumpTriggered, selectJumpTriggered, setCurrentlyAt, + selectVideos, } from "../redux/videoSlice"; import ReactPlayer, { Config } from "react-player"; @@ -50,7 +51,9 @@ const VideoPlayers: React.FC<{ maxHeightInPixel = 300, }) => { - const videoURLs = useAppSelector(selectVideoURL); + const videos = useAppSelector(selectVideos); + let primaryIndex = videos.findIndex(e => e.audio_stream.available === true); + primaryIndex = primaryIndex < 0 ? 0 : primaryIndex; const videoCount = useAppSelector(selectVideoCount); const videoPlayerAreaStyle = css({ @@ -71,8 +74,8 @@ const VideoPlayers: React.FC<{