diff --git a/index.html b/index.html
index 2070c9e..0c3a051 100644
--- a/index.html
+++ b/index.html
@@ -5,7 +5,6 @@
-
Jellyplayer
diff --git a/public/assetsStatic/SocialMediaBanner.png b/public/assetsStatic/SocialMediaBanner.png
index 3c5f559..88006ef 100644
Binary files a/public/assetsStatic/SocialMediaBanner.png and b/public/assetsStatic/SocialMediaBanner.png differ
diff --git a/public/assetsStatic/icon.png b/public/assetsStatic/icon.png
new file mode 100644
index 0000000..d5a134e
Binary files /dev/null and b/public/assetsStatic/icon.png differ
diff --git a/src/App.css b/src/App.css
deleted file mode 100644
index 2c5e2ef..0000000
--- a/src/App.css
+++ /dev/null
@@ -1,41 +0,0 @@
-#root {
- max-width: 1280px;
- margin: 0 auto;
- padding: 2rem;
- text-align: center;
-}
-
-.logo {
- height: 6em;
- padding: 1.5em;
- will-change: filter;
-}
-.logo:hover {
- filter: drop-shadow(0 0 2em #646cffaa);
-}
-.logo.react:hover {
- filter: drop-shadow(0 0 2em #61dafbaa);
-}
-
-@keyframes logo-spin {
- from {
- transform: rotate(0deg);
- }
- to {
- transform: rotate(360deg);
- }
-}
-
-@media (prefers-reduced-motion: no-preference) {
- a:nth-of-type(2) .logo {
- animation: logo-spin infinite 20s linear;
- }
-}
-
-.card {
- padding: 2em;
-}
-
-.read-the-docs {
- color: #888;
-}
diff --git a/src/App.jsx b/src/App.jsx
index ce10953..901d1e8 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -40,7 +40,7 @@ import DialogContentText from "@mui/material/DialogContentText";
import DialogTitle from "@mui/material/DialogTitle";
import Button from "@mui/material/Button";
import Box from "@mui/material/Box";
-import CircularProgress from "@mui/material/CircularProgress";
+import Stack from "@mui/material/Stack";
// Routes
import { ServerSetup, ServerList } from "./routes/setup/server";
@@ -72,6 +72,9 @@ import { delServer, getServer } from "./utils/storage/servers.js";
import { delUser, getUser } from "./utils/storage/user.js";
import axios from "axios";
+import { Blurhash } from "react-blurhash";
+import zIndex from "@mui/material/styles/zIndex.js";
+import { useBackdropStore } from "./utils/store/backdrop.js";
const jellyfin = new Jellyfin({
clientInfo: {
@@ -121,6 +124,9 @@ const AnimationWrapper = () => {
transition={{
duration: 0.35,
}}
+ style={{
+ width: "100%",
+ }}
>
@@ -278,9 +284,33 @@ function App() {
appWindow.setFullscreen(false);
}, [location]);
+ const [hash] = useBackdropStore((state) => [state.hash]);
+
return (
+
+
+
-
-
-
-
+
+
+
);
diff --git a/src/components/appBar/appBar.jsx b/src/components/appBar/appBar.jsx
index 2369925..4d877db 100644
--- a/src/components/appBar/appBar.jsx
+++ b/src/components/appBar/appBar.jsx
@@ -87,11 +87,11 @@ export const AppBar = () => {
return (
{
+ return (
+
+
+
+ );
+};
diff --git a/src/components/menu/sidemenu.jsx b/src/components/menu/sidemenu.jsx
index e8f9ca5..db5b060 100644
--- a/src/components/menu/sidemenu.jsx
+++ b/src/components/menu/sidemenu.jsx
@@ -113,39 +113,18 @@ export const SideMenu = ({}) => {
open={false}
PaperProps={{
sx: {
- backgroundColor: "inherit",
+ backgroundColor: "transparent",
border: "none",
width: `calc(${theme.spacing(7)} + 10px)`,
- height: "100vh",
- // display: visible ? "block" : "none",
+ height: "100%",
+ position: "inherit",
},
}}
sx={{
width: `calc(${theme.spacing(7)} + 10px)`,
- background: theme.palette.background.paper,
+ background: "transparent",
}}
>
-
- {/* */}
-
-
-
-
-
{libraries.isLoading ? (
<>
{
className="scrollY"
sx={{
flexGrow: 1,
- pt: 11,
- px: 3,
- pb: 3,
position: "relative",
}}
>
diff --git a/src/routes/home/index.jsx b/src/routes/home/index.jsx
index 6898a75..0baf1aa 100644
--- a/src/routes/home/index.jsx
+++ b/src/routes/home/index.jsx
@@ -204,9 +204,6 @@ const Home = () => {
className="scrollY"
sx={{
flexGrow: 1,
- pt: 11,
- px: 3,
- pb: 3,
position: "relative",
}}
>
diff --git a/src/routes/item/index.jsx b/src/routes/item/index.jsx
index 4538a75..14d3347 100644
--- a/src/routes/item/index.jsx
+++ b/src/routes/item/index.jsx
@@ -66,6 +66,7 @@ import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
import { ArtistAlbum } from "../../components/layouts/artist/artistAlbum";
import { MdiMusic } from "../../components/icons/mdiMusic";
import { usePlaybackStore } from "../../utils/store/playback";
+import { useBackdropStore } from "../../utils/store/backdrop";
function TabPanel(props) {
const { children, value, index, ...other } = props;
@@ -518,8 +519,12 @@ const ItemDetail = () => {
state.setDuration,
state.setItemId,
state.setItemName,
+ state.setItemName,
+ ,
]);
+ const [setHash] = useBackdropStore((state) => [state.setHash]);
+
const [directors, setDirectors] = useState([]);
const [writers, setWriters] = useState([]);
useEffect(() => {
@@ -532,9 +537,31 @@ const ItemDetail = () => {
(itm) => itm.Type == "Writer",
);
setWriters(writeTp);
+
+ if (!!item.data.ParentBackdropImageTags) {
+ setHash(
+ item.data.ImageBlurHashes.Backdrop[
+ item.data.ParentBackdropImageTags[0]
+ ],
+ );
+ } else if (item.data.BackdropImageTags.length != 0) {
+ setHash(
+ item.data.ImageBlurHashes.Backdrop[
+ item.data.BackdropImageTags[0]
+ ],
+ );
+ } else {
+ setHash("LGJCbc|t1s1}1{JU|y,uAo=3,s$Q");
+ }
}
}, [item.isSuccess]);
+ const [crew, setCrew] = useState([]);
+
+ useEffect(() => {
+ setCrew(directors.concat(...writers));
+ }, [writers, directors]);
+
if (item.isLoading || similarItems.isLoading) {
return (
{
if (item.isSuccess && similarItems.isSuccess) {
return (
<>
-
- {item.data.BackdropImageTags.length != 0 && (
-
- )}
- {!!item.data.ParentBackdropImageTags &&
- item.data.ParentBackdropImageTags.length != 0 && (
-
- )}
-
{
-
+ {/*
{item.data.Type != BaseItemKind.MusicAlbum &&
item.data.Type != BaseItemKind.Episode
? item.data.BackdropImageTags.length !=
@@ -691,7 +670,7 @@ const ItemDetail = () => {
>
{TypeIconCollectionCard[item.data.Type]}
-
+ */}
{
item.data.Type ===
BaseItemKind.Episode
? "center !important"
- : "flex-end",
+ : "flex-start",
justifyContent: "flex-start",
width: "100%",
}}
@@ -788,351 +767,420 @@ const ItemDetail = () => {
}
-
- {item.data.Type ===
- BaseItemKind.Episode && (
-
- {!!item.data
- .ParentLogoItemId ? (
-
- ) : (
- item.data.SeriesName
- )}
-
- )}
- {item.data.Type ===
- BaseItemKind.Episode ? (
-
- {`S${item.data.ParentIndexNumber}:E${item.data.IndexNumber} - ${item.data.Name}`}
-
- ) : (
-
- {!!item.data.ImageTags
- .Logo ? (
-
- ) : (
- item.data.Name
- )}
-
- )}
-
- {item.data.OriginalTitle}
-
- {!!item.data.AlbumArtists && (
-
- ,
-
- }
- >
- {item.data.AlbumArtists.map(
- (
- artist,
- aindex,
- ) => {
- return (
-
- {
- artist.Name
- }
-
- );
- },
- )}
-
- )}
-
-
- }
sx={{
- alignItems: "center",
- width: "100%",
+ display: "flex",
+ flexDirection: "column",
}}
>
- {item.data.Type != "MusicArtist" &&
- item.data.ProductionYear && (
-
- {
- item.data
- .ProductionYear
+
+ {item.data.Type ===
+ BaseItemKind.Episode && (
+
+ {!!item.data
+ .ParentLogoItemId ? (
+
+ ) : (
+ item.data
+ .SeriesName
+ )}
+
+ )}
+ {item.data.Type ===
+ BaseItemKind.Episode ? (
+
+ {`S${item.data.ParentIndexNumber}:E${item.data.IndexNumber} - ${item.data.Name}`}
+
+ ) : (
+
+ {!!item.data
+ .ImageTags
+ .Logo ? (
+
+ ) : (
+ item.data.Name
+ )}
)}
- {item.data.Type !=
- "MusicArtist" && (
-
- )}
- {item.data.Type !=
- "MusicArtist" && (
-
- {!!item.data
- .CommunityRating ? (
- <>
-
-
- {Math.round(
- item
- .data
- .CommunityRating *
- 10,
- ) / 10}
+ {item.data.OriginalTitle}
+
+ {!!item.data.AlbumArtists && (
+
+ ,
- >
- ) : (
-
- No Community
- Rating
+ }
+ >
+ {item.data.AlbumArtists.map(
+ (
+ artist,
+ aindex,
+ ) => {
+ return (
+
+ {
+ artist.Name
+ }
+
+ );
+ },
+ )}
+
+ )}
+
+
+ }
+ sx={{
+ alignItems: "center",
+ width: "100%",
+ }}
+ >
+ {item.data.Type !=
+ "MusicArtist" &&
+ item.data
+ .ProductionYear && (
+
+ {
+ item.data
+ .ProductionYear
+ }
)}
-
- )}
- {!!item.data.RunTimeTicks && (
-
- {getRuntimeFull(
- item.data
- .RunTimeTicks,
- )}
-
- )}
- {!!item.data.RunTimeTicks && (
-
- {endsAt(
- item.data
- .RunTimeTicks,
- )}
-
- )}
-
-
-
- {item.data.Type != "Person" &&
- !item.data.Type.includes(
- "Music",
- ) && (
- <>
-
+ {item.data.Type !=
+ "MusicArtist" && (
+
+ )}
+ {item.data.Type !=
+ "MusicArtist" && (
+ {
- if (
- !!item
- .data
- .VideoType
- ) {
- setUrl(
- `${window.api.basePath}/Videos/${item.data.Id}/stream.${item.data.MediaSources[0].Container}?Static=true&mediaSourceId=${item.data.Id}&deviceId=${window.api.deviceInfo.id}&api_key=${window.api.accessToken}&Tag=${item.data.MediaSources[0].ETag}`,
- );
- setPosition(
- item
- .data
- .UserData
- .PlaybackPositionTicks,
- );
- setItemName(
- item
- .data
- .Name,
- );
- setItemId(
- item
- .data
- .Id,
- );
- setDuration(
- item
- .data
- .RunTimeTicks,
- );
- }
- navigate(
- `/player`,
- );
+ display: "flex",
+ gap: "0.25em",
+ alignItems:
+ "center",
}}
+ className="item-detail-info-rating"
>
{!!item.data
- .UserData
- .PlayedPercentage &&
- item.data.UserData
- .PlayedPercentage >
- 0
- ? "Resume"
- : "Play"}
- {!!item.data
- .UserData
- .PlayedPercentage && (
-
+
+
+ {Math.round(
+ item
+ .data
+ .CommunityRating *
+ 10,
+ ) /
+ 10}
+
+ >
+ ) : (
+
+ No
+ Community
+ Rating
+
+ )}
+
+ )}
+ {!!item.data.RunTimeTicks && (
+
+ {getRuntimeFull(
+ item.data
+ .RunTimeTicks,
+ )}
+
+ )}
+ {!!item.data.RunTimeTicks && (
+
+ {endsAt(
+ item.data
+ .RunTimeTicks,
+ )}
+
+ )}
+
+
+
+
+ {item.data.Taglines[0]}
+
+
+ {item.data.Genres.length != 0 && (
+
+ {item.data.Genres.map(
+ (genre, index) => {
+ return (
+
+ );
+ },
+ )}
+
+ )}
+ {!!item.data.Overview && (
+
+
+ {item.data.Overview}
+
+
+ )}
+
+ {item.data.Type != "Person" &&
+ !item.data.Type.includes(
+ "Music",
+ ) && (
+ <>
+
+ }
+ sx={{
+ position:
+ "relative",
+ overflow:
+ "hidden",
+ }}
+ onClick={() => {
+ if (
+ !!item
+ .data
+ .VideoType
+ ) {
+ setUrl(
+ `${window.api.basePath}/Videos/${item.data.Id}/stream.${item.data.MediaSources[0].Container}?Static=true&mediaSourceId=${item.data.Id}&deviceId=${window.api.deviceInfo.id}&api_key=${window.api.accessToken}&Tag=${item.data.MediaSources[0].ETag}`,
+ );
+ setPosition(
+ item
+ .data
+ .UserData
+ .PlaybackPositionTicks,
+ );
+ setItemName(
+ item
+ .data
+ .Name,
+ );
+ setItemId(
+ item
+ .data
+ .Id,
+ );
+ setDuration(
+ item
+ .data
+ .RunTimeTicks,
+ );
+ if (
+ subtitleTracks.length !=
+ 0
+ ) {
+ // setSubtitleTracks(
+ // {
+ // kind: "subtitles",
+ // src: `http://localhost:8096/Videos/e2d0ae00-f458-d4d4-7e09-1768ca0f485c/e2d0ae00f458d4d47e091768ca0f485c/Subtitles/0/0/Stream.vtt?api_key=${window.api.accessToken}`,
+ // srcLang: "en",
+ // default: true,
+ // },
+ // );
+ setSubtitleTracks();
+ }
+ }
+ navigate(
+ `/player`,
+ );
+ }}
+ >
+ {!!item.data
+ .UserData
+ .PlayedPercentage &&
+ item.data
+ .UserData
+ .PlayedPercentage >
+ 0
+ ? "Resume"
+ : "Play"}
+ {!!item.data
+ .UserData
+ .PlayedPercentage && (
+
+ )}
+
+
+
+
- )}
-
-
-
-
-
- >
- )}
-
- {item.data.UserData.IsFavorite ? (
-
- ) : (
-
- )}
-
+
+ >
+ )}
+
+ {item.data.UserData
+ .IsFavorite ? (
+
+ ) : (
+
+ )}
+
+
-
-
-
- {item.data.Taglines[0]}
-
-
- {item.data.Genres != 0 && (
+ {/* {item.data.Genres != 0 && (
{
- )}
+ )} */}
{item.data.ExternalUrls.length != 0 && (
{
- {!!item.data.Overview && (
-
-
- Overview
-
-
- {item.data.Overview}
-
-
- )}
{item.data.Type == BaseItemKind.MusicAlbum && (
{
label={
episodes.isLoading ? (
) : (
episodes.data
@@ -2753,7 +2789,7 @@ const ItemDetail = () => {
duration: 0.35,
delay:
mindex *
- 0.1,
+ 0.03,
}}
>
{
variant: "h5",
fontSize: "1.8em",
}}
- displayCards={8}
+ displayCards={12}
title="Cast"
disableDecoration
boxProps={{
diff --git a/src/routes/item/item.module.scss b/src/routes/item/item.module.scss
index 6d24093..1222a47 100644
--- a/src/routes/item/item.module.scss
+++ b/src/routes/item/item.module.scss
@@ -17,7 +17,7 @@
display: flex;
gap: 1em;
justify-content: flex-start;
- align-items: flex-end;
+ align-items: flex-start;
position: relative;
flex-wrap: wrap;
&-backdrop {
@@ -30,11 +30,11 @@
left: -24px;
z-index: -2;
filter: brightness(0.6);
- mask-image: linear-gradient(0deg, transparent, black 75%);
+ mask-image: linear-gradient(to bottom, black 75%, transparent);
-webkit-mask-image: linear-gradient(
- 0deg,
- transparent,
- black 75%
+ to bottom,
+ black 75%,
+ transparent
);
}
}
@@ -49,7 +49,7 @@
z-index: -1;
}
&-container {
- width: 15%;
+ width: 20%;
flex-shrink: 0;
position: relative;
border-radius: $border-radius-default;
diff --git a/src/routes/library/index.jsx b/src/routes/library/index.jsx
index a497a75..dbe8b66 100644
--- a/src/routes/library/index.jsx
+++ b/src/routes/library/index.jsx
@@ -452,144 +452,193 @@ const LibraryView = () => {
-
-
-
-
-
-
- {currentLib.isLoading ? (
-
+ />
+
+
+
+ {currentLib.isLoading ? (
+
+ ) : (
+ currentLib.data.Items[0].Name
+ )}
+
+
) : (
- currentLib.data.Items[0].Name
- )}
-
-
- ) : (
- items.data.TotalRecordCount
- )
- }
- />
-
+ items.data.TotalRecordCount
+ )
+ }
+ />
+
- {/*
+ {/*
Age
*/}
-
- }
- >
- {currentLib.isSuccess &&
- allowedFilterViews.includes(
- currentLib.data.Items[0]
- .CollectionType,
- ) && (
- <>
-
- }
- endIcon={
-
- }
- onClick={openFiltersMenu}
- color="white"
- // sx={{ p: 1 }}
- // size="small"
- >
- Filter
-
-
>
)}
- {viewType.length != 0 &&
- currentViewType != undefined && (
-
- {viewType.map(
- (item, index) => {
- return (
-
- );
- },
- )}
-
- )}
-
-
-
- {items.isLoading || items.isFetching ? (
-
-
+ {sortByData != undefined &&
+ sortBy != undefined && (
+ <>
+
+ }
+ checkedIcon={
+
+ }
+ sx={{
+ color: "white !important",
+ }}
+ color="white"
+ onChange={
+ handleSortChange
+ }
+ checked={
+ sortAscending
+ }
+ />
+
+ {sortByData.map(
+ (
+ item,
+ index,
+ ) => {
+ return (
+
+ );
+ },
+ )}
+
+ >
+ )}
+ >
+ )}
+ {viewType.length != 0 &&
+ currentViewType != undefined && (
+
+ {viewType.map((item, index) => {
+ return (
+
+ );
+ })}
+
+ )}
+
+
+
+
+
+ {items.isLoading || items.isFetching ? (
+
-
- ) : items.data.TotalRecordCount == 0 ? (
-
- ) : currentViewType != BaseItemKind.Audio ? (
-
- {items.data.Items.map((item, index) => {
- return (
-
-
+
+
+ ) : items.data.TotalRecordCount == 0 ? (
+
+ ) : currentViewType != BaseItemKind.Audio ? (
+
+ {items.data.Items.map((item, index) => {
+ return (
+
+
-
- );
- })}
-
- ) : (
-
-
-
- {items.data.Items.map((item, index) => {
- return (
-
-
-
- {!!item
- .ImageTags
- .Primary && (
-
- )}
-
-
-
-
-
-
-
- {item.Name}
-
-
- ,
-
+ }
+ currentUser={user.data}
+ favourite={
+ item.UserData
+ ?.IsFavorite
+ }
+ >
+
+ );
+ })}
+
+ ) : (
+
+
+
+ {items.data.Items.map(
+ (item, index) => {
+ return (
+
- {item.Artists.map(
- (
- artist,
- aindex,
- ) => {
- return (
+
+
+ {!!item
+ .ImageTags
+ .Primary && (
+
+ )}
+
+
+
+
+
+
+
+ {
+ item.Name
+ }
+
+
- {
- artist
- }
+ ,
- );
- },
- )}
-
-
-
-
- {getRuntimeMusic(
- item.RunTimeTicks,
- )}
-
-
-
- {
- handleLiking(
- item,
- );
- }}
- >
- {item.UserData
- .IsFavorite ? (
-
- ) : (
-
- )}
-
-
-
- );
- })}
-
-
-
- )}
-
- {!items.isFetching &&
- !disablePaginationViews.includes(currentViewType) &&
- items.isSuccess &&
- items.data.TotalRecordCount > maxDisplayItems && (
-
-
- {maxDisplayItems * (page - 1)} -{" "}
- {items.data.TotalRecordCount <=
- maxDisplayItems * page
- ? items.data.TotalRecordCount
- : maxDisplayItems * page}{" "}
- of {items.data.TotalRecordCount}
-
- {
- setPage(val);
- }}
- count={Math.ceil(
- items.data.TotalRecordCount /
- maxDisplayItems,
- )}
- sx={{
- width: "fit-content",
- }}
- />
-
+ }
+ >
+ {item.Artists.map(
+ (
+ artist,
+ aindex,
+ ) => {
+ return (
+
+ {
+ artist
+ }
+
+ );
+ },
+ )}
+
+
+
+
+ {getRuntimeMusic(
+ item.RunTimeTicks,
+ )}
+
+
+
+ {
+ handleLiking(
+ item,
+ );
+ }}
+ >
+ {item
+ .UserData
+ .IsFavorite ? (
+
+ ) : (
+
+ )}
+
+
+
+ );
+ },
+ )}
+
+
+
)}
- {items.isError && }
+ {!items.isFetching &&
+ !disablePaginationViews.includes(
+ currentViewType,
+ ) &&
+ items.isSuccess &&
+ items.data.TotalRecordCount > maxDisplayItems && (
+
+
+ {maxDisplayItems * (page - 1)} -{" "}
+ {items.data.TotalRecordCount <=
+ maxDisplayItems * page
+ ? items.data.TotalRecordCount
+ : maxDisplayItems * page}{" "}
+ of {items.data.TotalRecordCount}
+
+ {
+ setPage(val);
+ }}
+ count={Math.ceil(
+ items.data.TotalRecordCount /
+ maxDisplayItems,
+ )}
+ sx={{
+ width: "fit-content",
+ }}
+ />
+
+ )}
+
+ {items.isError && }
+
);
diff --git a/src/routes/player/videoPlayer.jsx b/src/routes/player/videoPlayer.jsx
index 48d5cc6..3b33f78 100644
--- a/src/routes/player/videoPlayer.jsx
+++ b/src/routes/player/videoPlayer.jsx
@@ -9,7 +9,11 @@ import IconButton from "@mui/material/IconButton";
import Typography from "@mui/material/Typography";
import Slider from "@mui/material/Slider";
import CircularProgress from "@mui/material/CircularProgress";
-import Grow from "@mui/material/Grow";
+import Menu from "@mui/material/Menu";
+import MenuItem from "@mui/material/MenuItem";
+import List from "@mui/material/List";
+import ListItem from "@mui/material/ListItem";
+import ListItemText from "@mui/material/ListItemText";
import Backdrop from "@mui/material/Backdrop";
import ReactPlayer from "react-player";
@@ -33,6 +37,7 @@ import { MdiFullscreenExit } from "../../components/icons/mdiFullscreenExit";
import { MdiPictureInPictureBottomRight } from "../../components/icons/mdiPictureInPictureBottomRight";
import { MdiVolumeHigh } from "../../components/icons/mdiVolumeHigh";
import { MdiVolumeOff } from "../../components/icons/mdiVolumeOff";
+import { MdiPlaySpeed } from "../../components/icons/mdiPlaySpeed";
import { endsAt } from "../../utils/date/time";
@@ -40,18 +45,34 @@ import useKeyPress from "../../utils/hooks/useKeyPress";
export const VideoPlayer = () => {
const navigate = useNavigate();
- const [url, startPosition, itemDuration, itemId, itemName] =
- usePlaybackStore((state) => [
- state.url,
- state.startPosition,
- state.duration,
- state.itemId,
- state.itemName,
- ]);
+
+ const [speedMenuEl, setSpeedMenuEl] = useState(null);
+ const [speed, setSpeed] = useState(3);
+ const speedMenuState = Boolean(speedMenuEl);
+ const availableSpeeds = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
+
+ const [
+ url,
+ startPosition,
+ itemDuration,
+ itemId,
+ itemName,
+ subtitleTracks,
+ ] = usePlaybackStore((state) => [
+ state.url,
+ state.startPosition,
+ state.duration,
+ state.itemId,
+ state.itemName,
+ state.subtitleTracks,
+ ]);
+
+ var mySubtitle_arr = [];
const [showControls, setShowControls] = useState(false);
const playerRef = useRef();
+ const [isSeeking, setIsSeeking] = useState(false);
const [isBuffering, setIsBuffering] = useState(true);
const [isPlaying, setIsPlaying] = useState(true);
const [isMuted, setIsMuted] = useState(false);
@@ -75,8 +96,10 @@ export const VideoPlayer = () => {
}, [isReady]);
const onProgress = async (e) => {
- setProgress(e.played);
- setCurrentTime(secToTicks(e.playedSeconds));
+ if (!isSeeking) {
+ setProgress(e.played);
+ setCurrentTime(secToTicks(e.playedSeconds));
+ }
await getPlaystateApi(window.api).reportPlaybackProgress({
playbackProgressInfo: {
ItemId: itemId,
@@ -84,6 +107,7 @@ export const VideoPlayer = () => {
PositionTicks: secToTicks(e.playedSeconds),
PlaybackStartTimeTicks: startPosition,
VolumeLevel: volume * 100,
+ IsPaused: !isPlaying,
},
});
};
@@ -136,6 +160,10 @@ export const VideoPlayer = () => {
}
}, [showControls]);
+ useEffect(() => {
+ console.log(subtitleTracks);
+ }, [mySubtitle_arr]);
+
const handleKeyPress = useCallback((event) => {
switch (event.key) {
case "ArrowRight":
@@ -229,6 +257,7 @@ export const VideoPlayer = () => {
step={0.01}
max={itemDuration}
onChange={(e, newVal) => {
+ setIsSeeking(true);
setCurrentTime(newVal);
}}
onChangeCommitted={(e, newVal) => {
@@ -236,6 +265,7 @@ export const VideoPlayer = () => {
ticksToSec(newVal),
);
setCurrentTime(newVal);
+ setIsSeeking(false);
}}
valueLabelDisplay="auto"
valueLabelFormat={(value) =>
@@ -315,90 +345,123 @@ export const VideoPlayer = () => {
alignItems="center"
justifyContent="center"
>
- setShowVolume(true)}
- onMouseOut={() => setShowVolume(false)}
- padding="0.25em 1em"
- >
-
+
-
- setIsMuted(!isMuted)
+ >
+ {availableSpeeds.map(
+ (sspeed, index) => {
+ return (
+
+ );
+ },
+ )}
+
+
+ setSpeedMenuEl(
+ e.currentTarget,
+ )
}
>
- {isMuted ? (
-
- ) : (
-
- )}
+
-
+
+ setIsMuted(!isMuted)}
+ >
+ {isMuted ? (
+
+ ) : (
+
+ )}
+
+
+ setVolume(newVal / 100)
+ }
+ valueLabelDisplay="auto"
+ valueLabelFormat={(value) =>
+ Math.floor(value)
+ }
+ sx={{
+ mr: 1,
+ ml: 1,
+ width: "10em",
+ "& .MuiSlider-valueLabel": {
+ lineHeight: 1.2,
+ fontSize: 24,
+ background:
+ "rgb(0 0 0 / 0.5)",
+ backdropFilter: "blur(5px)",
+ padding: 1,
+ borderRadius: "10px",
+ border: "1px solid rgb(255 255 255 / 0.15)",
+ boxShadow:
+ "0 0 10px rgb(0 0 0 / 0.4) ",
+ transform:
+ "translatey(-120%) scale(0)",
+ "&:before": {
+ display: "none",
+ },
+ "&.MuiSlider-valueLabelOpen":
+ {
+ transform:
+ "translateY(-120%) scale(1)",
+ },
+ "& > *": {
+ transform:
+ "rotate(0deg)",
+ },
+ },
+ }}
+ />
+
{
setIsPIP(!isPIP);
@@ -439,6 +502,22 @@ export const VideoPlayer = () => {
volume={volume}
onBuffer={() => setIsBuffering(true)}
onBufferEnd={() => setIsBuffering(false)}
+ config={{
+ file: {
+ attributes: {
+ crossOrigin: "true",
+ },
+ tracks: [
+ {
+ kind: "subtitles",
+ src: `http://localhost:8096/Videos/${itemId}/${itemId}/Subtitles/0/0/Stream.vtt?api_key=${window.api.accessToken}`,
+ srcLang: "en",
+ default: true,
+ },
+ ],
+ },
+ }}
+ playbackRate={availableSpeeds[speed]}
/>
);
diff --git a/src/routes/player/videoPlayer.module.scss b/src/routes/player/videoPlayer.module.scss
index ead8b2c..cda8d47 100644
--- a/src/routes/player/videoPlayer.module.scss
+++ b/src/routes/player/videoPlayer.module.scss
@@ -9,3 +9,16 @@
opacity: 1;
}
}
+
+video {
+ &::-webkit-media-text-track-display {
+ overflow: visible !important;
+ }
+ &::cue {
+ text-shadow: 0 2px 10px rgb(0 0 0 / 0.8);
+ background: transparent;
+ }
+ &::cue(i) {
+ text-shadow: 0 2px 10px rgb(0 0 0 / 0.8);
+ }
+}
diff --git a/src/styles/global.scss b/src/styles/global.scss
index f041c22..1336c5d 100644
--- a/src/styles/global.scss
+++ b/src/styles/global.scss
@@ -41,14 +41,18 @@ body {
overflow-y: overlay;
}
-#root,
+#root {
+ display: flex;
+ flex-direction: column;
+ height: 100vh;
+ width: 100vw;
+}
+
.root-page {
- height: fit-content;
- width: 100%;
- position: relative;
- overflow-y: hidden;
overflow-x: hidden;
- min-height: 100vh;
+ height: 100%;
+ margin-bottom: 12vh;
+ overflow-y: auto;
}
.centered {
@@ -96,13 +100,17 @@ h1 {
color: white !important;
}
+.scrollContainer {
+ position: relative;
+ flex-grow: 1;
+}
+
.scrollY {
overflow-x: hidden;
- overflow-y: visible;
- height: fit-content;
+ overflow-y: auto;
width: inherit;
box-sizing: border-box;
- min-height: 100vh;
+ padding: 1.5em;
}
.empty {
diff --git a/src/utils/store/backdrop.js b/src/utils/store/backdrop.js
new file mode 100644
index 0000000..84bb3ae
--- /dev/null
+++ b/src/utils/store/backdrop.js
@@ -0,0 +1,8 @@
+/** @format */
+
+import { create } from "zustand";
+
+export const useBackdropStore = create((set) => ({
+ hash: "LGJCbc|t1s1}1{JU|y,uAo=3,s$Q",
+ setHash: (ahash) => set((state) => ({ hash: ahash })),
+}));
diff --git a/src/utils/store/playback.js b/src/utils/store/playback.js
index 8dd11a1..9b74859 100644
--- a/src/utils/store/playback.js
+++ b/src/utils/store/playback.js
@@ -8,9 +8,22 @@ export const usePlaybackStore = create((set) => ({
duration: 0,
itemId: "",
itemName: "",
+ subtitleTracks: [],
setUrl: (aurl) => set((state) => ({ ...state, url: aurl })),
setPosition: (apos) => set((state) => ({ ...state, startPosition: apos })),
setDuration: (adur) => set((state) => ({ ...state, duration: adur })),
setItemId: (aid) => set((state) => ({ ...state, itemId: aid })),
setItemName: (anm) => set((state) => ({ ...state, itemName: anm })),
+ setSubtitleTracks: (asub) =>
+ set((state) => ({
+ ...state,
+ subtitleTracks: [
+ {
+ kind: "subtitles",
+ src: `http://localhost:8096/Videos/e2d0ae00-f458-d4d4-7e09-1768ca0f485c/e2d0ae00f458d4d47e091768ca0f485c/Subtitles/0/0/Stream.vtt?api_key=${window.api.accessToken}`,
+ srcLang: "en",
+ default: true,
+ },
+ ],
+ })),
}));