Browse Source

Merge pull request #33 from QortalSeth/main

Layout of VideoContent.tsx and PlaylistContent.tsx changed to maximize Video Player size while maintaining aspect ratio.
pull/35/head^2
Qortal Dev 2 months ago committed by GitHub
parent
commit
95e132f641
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      src/components/Playlists/Playlists.tsx
  2. 14
      src/pages/ContentPages/PlaylistContent/PlaylistContent.tsx
  3. 11
      src/pages/ContentPages/VideoContent/VideoContent.tsx

2
src/components/Playlists/Playlists.tsx

@ -21,7 +21,7 @@ export const Playlists = ({
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
width: "100%", width: "100%",
maxWidth: "25vw", maxHeight: "30.94vw",
}} }}
> >
<CardContentContainerComment <CardContentContainerComment

14
src/pages/ContentPages/PlaylistContent/PlaylistContent.tsx

@ -447,12 +447,17 @@ export const PlaylistContent = () => {
<Box <Box
sx={{ sx={{
display: "grid", display: "grid",
gridTemplateColumns: "55vw 30vw", gridTemplateColumns: "55vw 35vw",
width: "100vw", width: "100vw",
gap: "5vw", gap: "3vw",
}} }}
> >
{videoReference && ( {videoReference && (
<Box
sx={{
aspectRatio: "16/9",
}}
>
<VideoPlayer <VideoPlayer
name={videoReference?.name} name={videoReference?.name}
service={videoReference?.service} service={videoReference?.service}
@ -464,7 +469,12 @@ export const PlaylistContent = () => {
onEnd={onEndVideo} onEnd={onEndVideo}
autoPlay={doAutoPlay} autoPlay={doAutoPlay}
ref={containerRef} ref={containerRef}
videoStyles={{
videoContainer: { aspectRatio: "16 / 9" },
video: { aspectRatio: "16 / 9" },
}}
/> />
</Box>
)} )}
{playlistData && ( {playlistData && (
<Playlists <Playlists

11
src/pages/ContentPages/VideoContent/VideoContent.tsx

@ -402,9 +402,15 @@ export const VideoContent = () => {
<VideoPlayerContainer <VideoPlayerContainer
sx={{ sx={{
width: "55vw", width: "55vw",
aspectRatio: "16/9",
}} }}
> >
{videoReference ? ( {videoReference ? (
<Box
sx={{
aspectRatio: "16/9",
}}
>
<VideoPlayer <VideoPlayer
name={videoReference?.name} name={videoReference?.name}
service={videoReference?.service} service={videoReference?.service}
@ -413,7 +419,12 @@ export const VideoContent = () => {
jsonId={id} jsonId={id}
poster={videoCover || ""} poster={videoCover || ""}
ref={containerRef} ref={containerRef}
videoStyles={{
videoContainer: { aspectRatio: "16 / 9" },
video: { aspectRatio: "16 / 9" },
}}
/> />
</Box>
) : ( ) : (
<img src={DeletedVideo} width={"100%"} height={"100%"} /> <img src={DeletedVideo} width={"100%"} height={"100%"} />
)} )}

Loading…
Cancel
Save