Skip to content

Commit

Permalink
Merge pull request #1385 from JulianKniephoff/nitpicks
Browse files Browse the repository at this point in the history
Some stylistic nitpicks
  • Loading branch information
Arnei authored Jun 21, 2024
2 parents 055966f + a2a4e2a commit ddeb5db
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/main/VideoPlayers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ export const VideoPlayer = React.forwardRef<VideoPlayerForwardRef, VideoPlayerPr
};

/**
* Workaround for subtitles not appearing in Firefox (or only appearing on inital mount, then disappearing
* when changed). Removes old tracks and readds them, because letting React to it does not seem
* to work properly.
* Fairly hacky, currently only works for a page with only one video
* https://github.com/CookPete/react-player/issues/490
*/
* Workaround for subtitles not appearing in Firefox (or only appearing on inital mount, then disappearing
* when changed). Removes old tracks and readds them, because letting React to it does not seem
* to work properly.
* Fairly hacky, currently only works for a page with only one video
* https://github.com/CookPete/react-player/issues/490
*/
function reAddTrack() {
const video = document.querySelector("video");

Expand Down Expand Up @@ -393,10 +393,14 @@ export const VideoPlayer = React.forwardRef<VideoPlayerForwardRef, VideoPlayerPr
aspectRatio: "16 / 9", // Hard-coded for now because there are problems with updating this value at runtime

overflow: "hidden", // Required for borderRadius to show
...(first) && { borderTopLeftRadius: "5px" },
...(first) && { borderBottomLeftRadius: "5px" },
...(last) && { borderTopRightRadius: "5px" },
...(last) && { borderBottomRightRadius: "5px" },
...first && {
borderTopLeftRadius: "5px",
borderBottomLeftRadius: "5px",
},
...last && {
borderTopLeftRadius: "5px",
borderBottomRightRadius: "5px",
},
});

const videoPlayerWrapperStyles = css({
Expand Down

0 comments on commit ddeb5db

Please sign in to comment.