Compare commits

...
Author SHA1 Message Date
Prayag Prajapati e81f4f6c56 Add remove server 2023-07-06 15:33:06 +05:30
Prayag Prajapati fea68f8cab Update packages 2023-07-06 15:19:40 +05:30
Prayag Prajapati ce4b635d78 Complete open sidemenu #11 2023-07-06 15:14:11 +05:30
Prayag Prajapati 83ebd5de7e Create a drawer component #11 2023-07-04 14:03:13 +05:30
dependabot[bot] 3f44e5fc96 chore(package-update) NPM: bump semver from 6.3.0 to 7.5.3 (#108)
Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 7.5.3.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v7.5.3)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-29 12:02:54 +05:30
Prayag Prajapati 39ad113573 Merge branch 'main' of https://github.com/prayag17/JellyPlayer 2023-06-29 11:38:28 +05:30
Prayag Prajapati 9ff7482aea Fix dependabot security alert 2023-06-29 11:38:11 +05:30
dependabot[bot] 36e3d2a7cb chore(package-update) NPM: bump @tanstack/react-query-devtools (#107)
Bumps [@tanstack/react-query-devtools](https://github.com/tanstack/query) from 4.29.12 to 4.29.19.
- [Release notes](https://github.com/tanstack/query/releases)
- [Commits](https://github.com/tanstack/query/compare/v4.29.12...v4.29.19)

---
updated-dependencies:
- dependency-name: "@tanstack/react-query-devtools"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-29 11:28:07 +05:30
dependabot[bot] 691d5e0157 chore(package-update) NPM: bump react-router-dom from 6.12.1 to 6.14.0 (#106)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.12.1 to 6.14.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/react-router-dom@6.14.0/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.14.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-28 17:27:01 +05:30
dependabot[bot] 94986db688 chore(package-update) NPM: bump @types/react-dom from 18.2.4 to 18.2.6 (#105)
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 18.2.4 to 18.2.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

---
updated-dependencies:
- dependency-name: "@types/react-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-28 17:21:29 +05:30
dependabot[bot] 9bf0b25662 chore(package-update) NPM: bump @mui/lab (#101)
Bumps [@mui/lab](https://github.com/mui/material-ui/tree/HEAD/packages/mui-lab) from 5.0.0-alpha.133 to 5.0.0-alpha.134.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/HEAD/packages/mui-lab)

---
updated-dependencies:
- dependency-name: "@mui/lab"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-28 17:06:48 +05:30
dependabot[bot] 42ca912ca7 chore(package-update) NPM: bump @tauri-apps/api from 1.3.0 to 1.4.0 (#99)
Bumps [@tauri-apps/api](https://github.com/tauri-apps/tauri) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/tauri-apps/tauri/releases)
- [Commits](https://github.com/tauri-apps/tauri/compare/api-v1.3...@tauri-apps/api-v1.4)

---
updated-dependencies:
- dependency-name: "@tauri-apps/api"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-28 17:06:39 +05:30
Prayag Prajapati 6ac3383f6e disable play button on series 2023-06-25 00:09:34 +05:30
Prayag Prajapati 922d956565 Display Series info in player #10 2023-06-24 23:59:06 +05:30
dependabot[bot] ca527548d1 chore(package-update) NPM: bump @emotion/react from 11.11.0 to 11.11.1 (#95)
Bumps [@emotion/react](https://github.com/emotion-js/emotion) from 11.11.0 to 11.11.1.
- [Release notes](https://github.com/emotion-js/emotion/releases)
- [Changelog](https://github.com/emotion-js/emotion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/emotion-js/emotion/compare/@emotion/react@11.11.0...@emotion/react@11.11.1)

---
updated-dependencies:
- dependency-name: "@emotion/react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 18:52:09 +05:30
dependabot[bot] e16a6c2415 chore(package-update) NPM: bump @types/react from 18.2.8 to 18.2.11 (#94)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.2.8 to 18.2.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 18:51:55 +05:30
dependabot[bot] c60b1e416e chore(package-update) NPM: bump react-router-dom from 6.11.2 to 6.12.1 (#96)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.11.2 to 6.12.1.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.12.1/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 18:47:30 +05:30
dependabot[bot] df7994b4b2 chore(package-update) NPM: bump sass from 1.62.1 to 1.63.3 (#98)
Bumps [sass](https://github.com/sass/dart-sass) from 1.62.1 to 1.63.3.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.62.1...1.63.3)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 18:47:02 +05:30
dependabot[bot] 03e72d81da chore(package-update) NPM: bump @fontsource/open-sans (#97)
Bumps [@fontsource/open-sans](https://github.com/fontsource/font-files/tree/HEAD/fonts/google/open-sans) from 5.0.2 to 5.0.3.
- [Changelog](https://github.com/fontsource/font-files/blob/main/fonts/google/open-sans/CHANGELOG.md)
- [Commits](https://github.com/fontsource/font-files/commits/HEAD/fonts/google/open-sans)

---
updated-dependencies:
- dependency-name: "@fontsource/open-sans"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 18:46:45 +05:30
Prayag Prajapati c8a7f8a632 Choose subtitle track from title page 2023-06-10 17:49:48 +05:30
Prayag Prajapati d9644f325c Revert "Merge branch 'main' of https://github.com/prayag17/JellyPlayer"
This reverts commit 38dde2a63d, reversing
changes made to 8aef2fc22d.
2023-06-10 11:25:29 +05:30
prayag17 38dde2a63d Merge branch 'main' of https://github.com/prayag17/JellyPlayer 2023-06-10 11:23:07 +05:30
prayag17anddependabot[bot] 8aef2fc22d Revert UI changes in @e4ade56
Update deps (npm)

chore(package-update) NPM: bump @fontsource/open-sans (#92)

Bumps [@fontsource/open-sans](https://github.com/fontsource/font-files/tree/HEAD/fonts/google/open-sans) from 4.5.14 to 5.0.2.
- [Changelog](https://github.com/fontsource/font-files/blob/main/fonts/google/open-sans/CHANGELOG.md)
- [Commits](https://github.com/fontsource/font-files/commits/HEAD/fonts/google/open-sans)

---
updated-dependencies:
- dependency-name: "@fontsource/open-sans"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-10 11:22:44 +05:30
prayag17 458890ba35 Merge branch 'main' of https://github.com/prayag17/JellyPlayer 2023-06-10 11:17:44 +05:30
prayag17 8d9d38fa39 Revert UI changes in @e4ade56 2023-06-10 11:17:38 +05:30
dependabot[bot] 957f9b53bb chore(package-update) NPM: bump @fontsource/open-sans (#92)
Bumps [@fontsource/open-sans](https://github.com/fontsource/font-files/tree/HEAD/fonts/google/open-sans) from 4.5.14 to 5.0.2.
- [Changelog](https://github.com/fontsource/font-files/blob/main/fonts/google/open-sans/CHANGELOG.md)
- [Commits](https://github.com/fontsource/font-files/commits/HEAD/fonts/google/open-sans)

---
updated-dependencies:
- dependency-name: "@fontsource/open-sans"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-06 14:30:33 +05:30
prayag17 02d412a9b6 Update deps (npm) 2023-06-06 14:14:29 +05:30
prayag17 e4ade5659c Update ItemPage ui and more... 2023-06-06 14:04:23 +05:30
prayag17 19ff2af29b More updates to player and fixed some ui stuff 2023-05-26 15:16:30 +05:30
prayag17 3c058928cb Show endsAt and fix mouseOver in player #10 2023-05-16 12:45:51 +05:30
prayag17 25ac859efd Allow changing volume #10 2023-05-15 14:04:35 +05:30
dependabot[bot] 5b2968b5bf chore(package-update) NPM: bump @mui/material from 5.12.3 to 5.13.0 (#81)
Bumps [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) from 5.12.3 to 5.13.0.
- [Release notes](https://github.com/mui/material-ui/releases)
- [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mui/material-ui/commits/v5.13.0/packages/mui-material)

---
updated-dependencies:
- dependency-name: "@mui/material"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-15 09:58:48 +05:30
dependabot[bot] 6cccd12a41 chore(package-update) NPM: bump framer-motion from 10.12.8 to 10.12.10 (#80)
Bumps [framer-motion](https://github.com/framer/motion) from 10.12.8 to 10.12.10.
- [Changelog](https://github.com/framer/motion/blob/main/CHANGELOG.md)
- [Commits](https://github.com/framer/motion/compare/v10.12.8...v10.12.10)

---
updated-dependencies:
- dependency-name: framer-motion
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-15 09:58:40 +05:30
dependabot[bot] 3ea75c8308 chore(package-update) NPM: bump @tauri-apps/cli from 1.3.0 to 1.3.1 (#79)
Bumps [@tauri-apps/cli](https://github.com/tauri-apps/tauri) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/tauri-apps/tauri/releases)
- [Commits](https://github.com/tauri-apps/tauri/compare/api-v1.3...cli.js-v1.3.1)

---
updated-dependencies:
- dependency-name: "@tauri-apps/cli"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-15 09:58:33 +05:30
dependabot[bot] 2ce1cd688d chore(package-update) NPM: bump @tanstack/react-query-devtools (#78)
Bumps [@tanstack/react-query-devtools](https://github.com/tanstack/query) from 4.29.6 to 4.29.7.
- [Release notes](https://github.com/tanstack/query/releases)
- [Commits](https://github.com/tanstack/query/compare/v4.29.6...v4.29.7)

---
updated-dependencies:
- dependency-name: "@tanstack/react-query-devtools"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-15 09:58:24 +05:30
prayag17 756d8d7f4b Allow fullscreen and display time 2023-05-14 18:45:16 +05:30
prayag17 3738d81fab Fix server validation on app startup #74 2023-05-14 17:31:59 +05:30
34 changed files with 1669 additions and 1150 deletions

No files matched your search

+468 -747
View File
File diff suppressed because it is too large. Load diff
+12 -14
View File
@@ -10,21 +10,20 @@
"tauri": "tauri"
},
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.10.5",
"@fontsource/open-sans": "^4.5.13",
"@fontsource/open-sans": "^5.0.3",
"@jellyfin/sdk": "^0.8.2",
"@mdi/js": "^7.2.96",
"@mui/lab": "^5.0.0-alpha.128",
"@mui/material": "^5.11.16",
"@mui/lab": "^5.0.0-alpha.134",
"@mui/material": "^5.13.0",
"@tanstack/react-query": "^4.26.1",
"@tanstack/react-query-devtools": "^4.29.3",
"@tauri-apps/api": "^1.2.0",
"@videojs/http-streaming": "^3.0.2",
"@tanstack/react-query-devtools": "^4.29.19",
"@tauri-apps/api": "^1.4.0",
"axios": "^1.4.0",
"blurhash": "^2.0.5",
"events": "^3.3.0",
"framer-motion": "^10.12.4",
"framer-motion": "^10.12.10",
"notistack": "^3.0.1",
"react": "^18.2.0",
"react-blurhash": "^0.3.0",
@@ -33,19 +32,18 @@
"react-material-ui-carousel": "^3.4.2",
"react-multi-carousel": "^2.8.3",
"react-player": "^2.12.0",
"react-router-dom": "^6.11.0",
"react-router-dom": "^6.14.0",
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store",
"uuid": "^9.0.0",
"vite-plugin-svgr": "^3.2.0",
"zustand": "^4.3.8"
},
"devDependencies": {
"@tauri-apps/cli": "^1.2.2",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.1",
"@tauri-apps/cli": "^1.3.1",
"@types/react": "^18.2.11",
"@types/react-dom": "^18.2.6",
"@vitejs/plugin-react": "^4.0.0",
"sass": "^1.62.1",
"video.js": "^8.3.0",
"sass": "^1.63.3",
"vite": "^4.3.1"
},
"license": "GPL-3.0-only"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 393 KiB

After

Width:  |  Height:  |  Size: 632 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

-5
View File
@@ -90,11 +90,6 @@
transform: scaleX(1) translateX(100%);
transform-origin: left;
}
/* 100% {
transform: scaleX(0) translateX(-100%);
transform-origin: left;
} */
}
</style>
</body>
+1 -1
View File
@@ -17,7 +17,7 @@ tauri-build = { version = "1.2.1", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.2.2", features = ["api-all", "devtools"] }
tauri = { version = "1.2.2", features = ["devtools", "http-all", "process-exit", "process-relaunch", "shell-all", "window-set-fullscreen"] }
tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }
tauri-plugin-localhost = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
portpicker = "0.1" # used in the example to pick a random free port
-41
View File
@@ -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;
}
+12 -20
View File
@@ -1,6 +1,8 @@
/** @format */
import React, { useState } from "react";
import React, { useState, useEffect } from "react";
import { appWindow } from "@tauri-apps/api/window";
import Konami from "react-konami-code";
// @ts-ignore
@@ -68,8 +70,8 @@ import { version as appVer } from "../package.json";
import { v4 as uuidv4 } from "uuid";
import { delServer, getServer } from "./utils/storage/servers.js";
import { delUser, getUser } from "./utils/storage/user.js";
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api.js";
import { useQuery } from "@tanstack/react-query";
import axios from "axios";
const jellyfin = new Jellyfin({
clientInfo: {
@@ -182,6 +184,7 @@ function App() {
enqueueSnackbar("Unable to verfiy server address.", {
variant: "error",
});
console.error(error);
}
};
@@ -243,13 +246,13 @@ function App() {
if (reason && reason == "backdropClick") {
return;
}
let result = await relaunch();
await relaunch();
};
const handleRemoveServer = async () => {
await delServer();
await delUser();
let result = await relaunch();
await relaunch();
};
const location = useLocation();
@@ -271,23 +274,13 @@ function App() {
setEasterEgg(true);
};
useEffect(() => {
appWindow.setFullscreen(false);
}, [location]);
return (
<SnackbarProvider maxSnack={5}>
<ThemeProvider theme={theme}>
{pingServer.isLoading && (
<Box
sx={{
display: "flex",
width: "100%",
height: "100vh",
justifyContent: "center",
alignItems: "center",
}}
>
<CircularProgress />
</Box>
)}
<Kon resetDelay={1000} action={sixtyNine}></Kon>
<Dialog
open={easterEgg}
@@ -404,7 +397,6 @@ function App() {
</Routes>
</div>
</AnimatePresence>
<ReactQueryDevtools />
</ThemeProvider>
</SnackbarProvider>
);
+40 -2
View File
@@ -1,6 +1,8 @@
/** @format */
import { useEffect, useState } from "react";
import { relaunch } from "@tauri-apps/api/process";
import MuiAppBar from "@mui/material/AppBar";
import TextField from "@mui/material/TextField";
import IconButton from "@mui/material/IconButton";
@@ -26,6 +28,11 @@ import { MdiHeartOutline } from "../icons/mdiHeartOutline";
import { MdiArrowLeft } from "../icons/mdiArrowLeft";
import { MdiCog } from "../icons/mdiCog";
import { MdiInformation } from "../icons/mdiInformation";
import { MdiMenu } from "../icons/mdiMenu";
import { useDrawerStore } from "../../utils/store/drawer";
import { delServer } from "../../utils/storage/servers";
import { delUser } from "../../utils/storage/user";
import { MdiDelete } from "../icons/mdiDelete";
export const AppBar = () => {
const navigate = useNavigate();
@@ -59,6 +66,12 @@ export const AppBar = () => {
setAnchorEl(null);
};
const [setDrawerOpen] = useDrawerStore((state) => [state.setOpen]);
const handleDrawerOpen = () => {
setDrawerOpen(true);
};
useEffect(() => {
if (
location.pathname.includes("login") ||
@@ -87,13 +100,18 @@ export const AppBar = () => {
return (
<MuiAppBar
sx={{
width: `calc(100vw - ${theme.spacing(7)})`,
backgroundColor: "transparent",
paddingRight: "0 !important",
}}
className={trigger ? "appBar backdropVisible" : "appBar"}
elevation={0}
>
<Toolbar sx={{ justifyContent: "space-between" }}>
<Toolbar
sx={{
justifyContent: "space-between",
paddingLeft: "12px !important",
}}
>
<Box
sx={{
display: "flex",
@@ -101,6 +119,13 @@ export const AppBar = () => {
alignItems: "center",
}}
>
<IconButton
color="inherit"
aria-label="open drawer"
onClick={handleDrawerOpen}
>
<MdiMenu />
</IconButton>
<IconButton
onClick={() => navigate(-1)}
sx={{
@@ -109,6 +134,7 @@ export const AppBar = () => {
? "scale(1)"
: "scale(0)",
transformOrigin: "left",
ml: 2,
}}
>
<MdiArrowLeft />
@@ -175,6 +201,18 @@ export const AppBar = () => {
</ListItemIcon>
About
</MenuItem>
<MenuItem
onClick={async () => {
await delServer();
await delUser();
await relaunch();
}}
>
<ListItemIcon>
<MdiDelete />
</ListItemIcon>
Remove Server
</MenuItem>
</Menu>
</Box>
</Toolbar>
+4 -4
View File
@@ -31,19 +31,19 @@ export const CardScroller = ({
slidesToSlide: displayCards + 1,
},
desktop: {
breakpoint: { max: 3000, min: 1025 },
breakpoint: { max: 3000, min: 625 },
items: displayCards,
slidesToSlide: displayCards, // optional, default to 1.
},
tablet: {
breakpoint: { max: 1024, min: 464 },
breakpoint: { max: 624, min: 464 },
items: displayCards - 2,
slidesToSlide: displayCards - 2, // optional, default to 1.
},
mobile: {
breakpoint: { max: 464, min: 0 },
items: displayCards - 3,
slidesToSlide: displayCards - 3, // optional, default to 1.
items: displayCards - 5,
slidesToSlide: displayCards - 5, // optional, default to 1.
},
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiBackburger } from "@mdi/js";
export const MdiBackburger = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiBackburger}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiClose } from "@mdi/js";
export const MdiClose = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiClose}></path>
</SvgIcon>
);
};
+12
View File
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiDelete } from "@mdi/js";
export const MdiDelete = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiDelete}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiFullscreen } from "@mdi/js";
export const MdiFullscreen = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiFullscreen}></path>
</SvgIcon>
);
};
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiFullscreenExit } from "@mdi/js";
export const MdiFullscreenExit = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiFullscreenExit}></path>
</SvgIcon>
);
};
@@ -0,0 +1,12 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiPictureInPictureBottomRight } from "@mdi/js";
export const MdiPictureInPictureBottomRight = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiPictureInPictureBottomRight}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiPlaySpeed } from "@mdi/js";
export const MdiPlaySpeed = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiPlaySpeed}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiVolumeHigh } from "@mdi/js";
export const MdiVolumeHigh = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiVolumeHigh}></path>
</SvgIcon>
);
};
+13
View File
@@ -0,0 +1,13 @@
/** @format */
import SvgIcon from "@mui/material/SvgIcon";
import { mdiVolumeOff } from "@mdi/js";
export const MdiVolumeOff = (props) => {
return (
<SvgIcon {...props}>
<path d={mdiVolumeOff}></path>
</SvgIcon>
);
};
@@ -19,8 +19,11 @@ import { Link } from "react-router-dom";
import { useQuery } from "@tanstack/react-query";
import { getItemsApi } from "@jellyfin/sdk/lib/utils/api/items-api";
import { MdiClockOutline } from "../../icons/mdiClockOutline";
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
import { getRuntimeMusic } from "../../../utils/date/time";
import { MdiClockOutline } from "../../icons/mdiClockOutline";
import { MdiHeart } from "../../icons/mdiHeart";
import { MdiHeartOutline } from "../../icons/mdiHeartOutline";
import { MdiAlbum } from "../../icons/mdiAlbum";
@@ -44,12 +47,12 @@ export const ArtistAlbum = ({ user, album, boxProps }) => {
let result;
if (track.UserData.IsFavorite) {
result = await getUserLibraryApi(window.api).unmarkFavoriteItem({
userId: user.data.Id,
userId: user.Id,
itemId: track.Id,
});
} else if (!track.UserData.IsFavorite) {
result = await getUserLibraryApi(window.api).markFavoriteItem({
userId: user.data.Id,
userId: user.Id,
itemId: track.Id,
});
}
+320 -145
View File
@@ -20,8 +20,9 @@ import ListItemButton from "@mui/material/ListItemButton";
import IconButton from "@mui/material/IconButton";
import Divider from "@mui/material/Divider";
import MuiDrawer from "@mui/material/Drawer";
import ListItemText from "@mui/material/ListItemText";
import { MdiMenu } from "../icons/mdiMenu";
import { MdiClose } from "../icons/mdiClose";
import { MdiLogoutVariant } from "../icons/mdiLogoutVariant";
import { MediaCollectionTypeIconCollection } from "../../components/utils/iconsCollection.jsx";
@@ -31,6 +32,7 @@ import { MdiHomeVariantOutline } from "../icons/mdiHomeVariantOutline";
import { EventEmitter as event } from "../../eventEmitter.js";
import "./sidemenu.module.scss";
import { useDrawerStore } from "../../utils/store/drawer";
const drawerWidth = 320;
@@ -78,7 +80,6 @@ export const SideMenu = ({}) => {
enabled: !!user.data,
networkMode: "always",
});
const handleDrawerOpen = () => {};
const handleLogout = async () => {
console.log("Logging out user...");
@@ -102,177 +103,351 @@ export const SideMenu = ({}) => {
}
}, [location]);
const [open, setDrawerOpen] = useDrawerStore((state) => [
state.open,
state.setOpen,
]);
if (!display) {
return <></>;
}
if (display) {
return (
<MiniDrawer
variant="permanent"
open={false}
PaperProps={{
sx: {
backgroundColor: "inherit",
border: "none",
width: `calc(${theme.spacing(7)} + 10px)`,
height: "100vh",
// display: visible ? "block" : "none",
},
}}
sx={{
width: `calc(${theme.spacing(7)} + 10px)`,
background: theme.palette.background.paper,
}}
>
<DrawerHeader
className="Mui-DrawerHeader"
<>
<MiniDrawer
variant="permanent"
open={false}
PaperProps={{
sx: {
backgroundColor: "inherit",
border: "none",
width: `calc(${theme.spacing(7)} + 10px)`,
height: "100vh",
zIndex: "1",
// display: visible ? "block" : "none",
},
}}
sx={{
justifyContent: "center",
width: `calc(${theme.spacing(7)} + 10px)`,
background: theme.palette.background.paper,
}}
>
{/* <div>
<Avatar src={""}/>
<Typography variant="h3">
{user["Name"]}
</Typography>
</div> */}
<IconButton
color="inherit"
aria-label="open drawer"
onClick={handleDrawerOpen}
>
<MdiMenu />
</IconButton>
</DrawerHeader>
<Divider />
{libraries.isLoading ? (
<>
<Skeleton
height="100%"
variant="rounded"
width="calc(100% - 10px )"
sx={{ margin: "5px" }}
></Skeleton>
</>
) : (
<>
<List sx={{ border: "none" }}>
{libraries.data.Items.map(
(library, index) => {
return (
<Tooltip
title={library.Name}
placement="right"
arrow
followCursor
key={index}
>
<ListItem
className="sidemenu-item-container"
disablePadding
<DrawerHeader
className="Mui-DrawerHeader"
sx={{
justifyContent: "center",
}}
></DrawerHeader>
<Divider />
{libraries.isLoading ? (
<>
<Skeleton
height="100%"
variant="rounded"
width="calc(100% - 10px )"
sx={{ margin: "5px" }}
></Skeleton>
</>
) : (
<>
<List sx={{ border: "none" }}>
{libraries.data.Items.map(
(library, index) => {
return (
<Tooltip
title={library.Name}
placement="right"
arrow
followCursor
key={index}
>
<ListItemButton
component={
NavLink
}
to={
"/library/" +
library.Id
}
className="sidemenu-item"
sx={{
minHeight: 48,
justifyContent:
"center",
px: 2.5,
}}
<ListItem
className="sidemenu-item-container"
disablePadding
>
<ListItemIcon
<ListItemButton
component={
NavLink
}
to={
"/library/" +
library.Id
}
className="sidemenu-item"
sx={{
minWidth: 0,
minHeight: 48,
justifyContent:
"center",
px: 2.5,
display: "flex",
flexDirection:
"column",
}}
>
{
MediaCollectionTypeIconCollection[
library
.CollectionType
]
}
</ListItemIcon>
</ListItemButton>
</ListItem>
</Tooltip>
);
},
)}
</List>
<List sx={{ marginTop: "auto" }}>
<Tooltip
title="Home"
placement="right"
followCursor
arrow
>
<ListItem
className="sidemenu-item-container"
disablePadding
<ListItemIcon
sx={{
minWidth: 0,
justifyContent:
"center",
}}
>
{
MediaCollectionTypeIconCollection[
library
.CollectionType
]
}
</ListItemIcon>
</ListItemButton>
</ListItem>
</Tooltip>
);
},
)}
</List>
<List sx={{ marginTop: "auto" }}>
<Divider />
<Tooltip
title="Home"
placement="right"
followCursor
arrow
>
<ListItemButton
component={NavLink}
to="/home"
className="sidemenu-item"
sx={{
minHeight: 48,
justifyContent: "center",
px: 2.5,
}}
<ListItem
className="sidemenu-item-container"
disablePadding
>
<ListItemIcon
<ListItemButton
component={NavLink}
to="/home"
className="sidemenu-item"
sx={{
minWidth: 0,
minHeight: 48,
justifyContent:
"center",
px: 2.5,
display: "flex",
flexDirection:
"column",
}}
>
<MdiHomeVariantOutline />
</ListItemIcon>
</ListItemButton>
</ListItem>
</Tooltip>
<Tooltip
title="Logout"
placement="right"
followCursor
arrow
>
<ListItem disablePadding>
<ListItemButton
sx={{
minHeight: 48,
justifyContent: "center",
px: 2.5,
}}
onClick={handleLogout}
>
<ListItemIcon
<ListItemIcon
sx={{
minWidth: 0,
justifyContent:
"center",
}}
>
<MdiHomeVariantOutline />
</ListItemIcon>
</ListItemButton>
</ListItem>
</Tooltip>
<Tooltip
title="Logout"
placement="right"
followCursor
arrow
>
<ListItem disablePadding>
<ListItemButton
sx={{
minWidth: 0,
minHeight: 48,
justifyContent:
"center",
px: 2.5,
}}
onClick={handleLogout}
>
<ListItemIcon
sx={{
minWidth: 0,
justifyContent:
"center",
}}
>
<MdiLogoutVariant></MdiLogoutVariant>
</ListItemIcon>
</ListItemButton>
</ListItem>
</Tooltip>
</List>
</>
)}
</MiniDrawer>
<MuiDrawer
open={open}
variant="persistent"
onClose={() => setDrawerOpen(false)}
elevation={0}
PaperProps={{
sx: {
background: "rgb(0 0 0 / 0.5)",
backdropFilter: "blur(10px)",
boxShadow: "0 0 15px rgb(0 0 0 / 0.2)",
width: 260,
},
}}
className="sidemenu-open"
>
<DrawerHeader
className="Mui-DrawerHeader"
sx={{
justifyContent: "flex-start",
}}
>
<IconButton onClick={() => setDrawerOpen(false)}>
<MdiClose />
</IconButton>
</DrawerHeader>
<Divider />
{libraries.isLoading ? (
<>
<Skeleton
height="100%"
variant="rounded"
width="calc(100% - 10px )"
sx={{ margin: "5px" }}
></Skeleton>
</>
) : (
<>
<List sx={{ border: "none" }}>
{libraries.data.Items.map(
(library, index) => {
return (
<Tooltip
title={library.Name}
placement="right"
arrow
followCursor
key={index}
>
<ListItem
className="sidemenu-item-container"
disablePadding
>
<ListItemButton
component={
NavLink
}
to={
"/library/" +
library.Id
}
className="sidemenu-item"
sx={{
minHeight: 48,
justifyContent:
"center",
px: 2.5,
}}
>
<ListItemIcon
sx={{
minWidth: 0,
justifyContent:
"center",
mr: 2,
}}
>
{
MediaCollectionTypeIconCollection[
library
.CollectionType
]
}
</ListItemIcon>
<ListItemText>
{
library.Name
}
</ListItemText>
</ListItemButton>
</ListItem>
</Tooltip>
);
},
)}
</List>
<List sx={{ marginTop: "auto" }}>
<Divider />
<Tooltip
title="Home"
placement="right"
followCursor
arrow
>
<ListItem
className="sidemenu-item-container"
disablePadding
>
<ListItemButton
component={NavLink}
to="/home"
className="sidemenu-item"
sx={{
minHeight: 48,
justifyContent:
"center",
px: 2.5,
}}
>
<MdiLogoutVariant></MdiLogoutVariant>
</ListItemIcon>
</ListItemButton>
</ListItem>
</Tooltip>
</List>
</>
)}
</MiniDrawer>
<ListItemIcon
sx={{
minWidth: 0,
justifyContent:
"center",
mr: 2,
}}
>
<MdiHomeVariantOutline />
</ListItemIcon>
<ListItemText>
Home
</ListItemText>
</ListItemButton>
</ListItem>
</Tooltip>
<Tooltip
title="Logout"
placement="right"
followCursor
arrow
>
<ListItem disablePadding>
<ListItemButton
sx={{
minHeight: 48,
justifyContent:
"center",
px: 2.5,
}}
onClick={handleLogout}
>
<ListItemIcon
sx={{
minWidth: 0,
justifyContent:
"center",
mr: 2,
}}
>
<MdiLogoutVariant></MdiLogoutVariant>
</ListItemIcon>
<ListItemText>
Logout
</ListItemText>
</ListItemButton>
</ListItem>
</Tooltip>
</List>
</>
)}
</MuiDrawer>
</>
);
}
};
+8
View File
@@ -26,4 +26,12 @@
transform: translateX(0);
}
}
&-open {
.sidemenu-item::before {
width: 100%;
inset: 0;
border-radius: 0;
z-index: -1;
}
}
}
@@ -9,7 +9,7 @@ export const EmptyNotice = () => {
<Box
sx={{
width: "100%",
height: "100%",
height: "100vh",
display: "flex",
justifyContent: "center",
alignItems: "center",
@@ -9,7 +9,7 @@ export const ErrorNotice = () => {
<Box
sx={{
width: "100%",
height: "100%",
height: "100vh",
display: "flex",
justifyContent: "center",
alignItems: "center",
+2
View File
@@ -61,6 +61,8 @@ export const MediaTypeIconCollection = {
Audio: <MdiMicrophone className="hero-carousel-background-icon" />,
Photo: <MdiImage className="hero-carousel-background-icon" />,
Book: <MdiBook className="hero-carousel-background-icon" />,
MusicAlbum: <MdiAlbum className="hero-carousel-background-icon" />,
AudioBook: <MdiBookMusic className="hero-carousel-background-icon" />,
};
export const TypeIconCollectionCard = {
+1 -1
View File
@@ -84,7 +84,7 @@
-webkit-line-clamp: 2;
margin-bottom: 0.5em;
&-logo {
max-width: 10em;
max-width: 12em;
height: 2em;
object-fit: contain;
object-position: bottom;
+13 -11
View File
@@ -96,7 +96,13 @@ const Home = () => {
{
userId: user.data.Id,
fields: [ItemFields.Overview, ItemFields.ParentId],
includeItemTypes: [
BaseItemKind.Series,
BaseItemKind.Movie,
BaseItemKind.AudioBook,
],
enableUserData: true,
limit: 16,
},
);
return media.data;
@@ -111,7 +117,7 @@ const Home = () => {
const resumeItems = await getItemsApi(window.api).getResumeItems(
{
userId: user.data.Id,
limit: 16,
limit: 10,
mediaTypes: ["Video"],
enableUserData: true,
},
@@ -128,7 +134,7 @@ const Home = () => {
const resumeItems = await getItemsApi(window.api).getResumeItems(
{
userId: user.data.Id,
limit: 16,
limit: 10,
mediaTypes: ["Audio"],
enableUserData: true,
},
@@ -144,7 +150,7 @@ const Home = () => {
queryFn: async () => {
const upNext = await getTvShowsApi(window.api).getNextUp({
userId: user.data.Id,
limit: 16,
limit: 10,
});
return upNext.data;
},
@@ -240,7 +246,7 @@ const Home = () => {
<CarouselSkeleton />
) : (
// <></>
latestMedia.data != null &&
latestMedia.data.length != 0 &&
latestMedia.data.map((item, index) => {
return (
<Paper
@@ -254,12 +260,8 @@ const Home = () => {
>
<div className="hero-carousel-background-container">
{item.Type ==
BaseItemKind.MusicAlbum ||
item.Type ==
BaseItemKind.Episode ? (
item
.ParentBackdropImageTags
.length != 0 && (
BaseItemKind.MusicAlbum ? (
!!item.ParentBackdropItemId && (
<>
<Blurhash
hash={
@@ -339,7 +341,7 @@ const Home = () => {
<div className="hero-carousel-background-icon-container">
{
MediaTypeIconCollection[
item.MediaType
item.Type
]
}
</div>
+140 -86
View File
@@ -34,6 +34,7 @@ import { useParams, useNavigate, Link as RouterLink } from "react-router-dom";
import {
BaseItemKind,
ItemFields,
LocationType,
MediaStreamType,
SortOrder,
} from "@jellyfin/sdk/lib/generated-client";
@@ -66,6 +67,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 { Tooltip } from "@mui/material";
function TabPanel(props) {
const { children, value, index, ...other } = props;
@@ -168,6 +170,7 @@ const ItemDetail = () => {
queryFn: async () => {
const result = await getTvShowsApi(window.api).getSeasons({
seriesId: item.data.Id,
isSpecialSeason: false,
});
return result.data;
},
@@ -200,6 +203,7 @@ const ItemDetail = () => {
userId: user.data.Id,
parentId: seasons.data.Items[currentSeason].Id,
fields: [ItemFields.SeasonUserData, "Overview"],
excludeLocationTypes: [LocationType.Virtual],
});
return result.data;
},
@@ -505,20 +509,29 @@ const ItemDetail = () => {
setAudioTracks(audios);
setSubtitleTracks(subs);
setCurrentVideoTrack(videos[0].DisplayTitle);
setCurrentAudioTrack(audios[0].DisplayTitle);
setCurrentSubTrack(subs[0].DisplayTitle);
setCurrentVideoTrack(videos[0]?.Index);
setCurrentAudioTrack(audios[0]?.Index);
setCurrentSubTrack(subs[0]?.Index);
}
}, [item.isSuccess]);
const [setUrl, setPosition, setItemId, setItemName] = usePlaybackStore(
(state) => [
state.setUrl,
state.setPosition,
state.setItemId,
state.setItemName,
],
);
const [
setUrl,
setPosition,
setDuration,
setItemId,
setItemName,
setSubtitleTracksStore,
setSelectedSubtitleTrack,
] = usePlaybackStore((state) => [
state.setUrl,
state.setPosition,
state.setDuration,
state.setItemId,
state.setItemName,
state.setSubtitleTracks,
state.setSelectedSubtitleTrack,
]);
const [directors, setDirectors] = useState([]);
const [writers, setWriters] = useState([]);
@@ -1004,82 +1017,121 @@ const ItemDetail = () => {
"Music",
) && (
<>
<Button
variant="contained"
size="large"
startIcon={
<MdiPlayOutline />
<Tooltip
title={
item.data
.Type ==
"Series"
? "Work in progress, meanwhile you can play individual episodes by clicking on episode card below"
: ""
}
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,
);
}
navigate(
`/player`,
);
}}
>
{!!item.data
.UserData
.PlayedPercentage &&
item.data.UserData
.PlayedPercentage >
0
? "Resume"
: "Play"}
{!!item.data
.UserData
.PlayedPercentage && (
<LinearProgress
variant="determinate"
value={
<span>
<Button
disabled={
item
.data
.UserData
.PlayedPercentage
.Type ==
"Series"
? true
: false
}
variant="contained"
size="large"
startIcon={
<MdiPlayOutline />
}
color="white"
sx={{
position:
"absolute",
height: "100%",
width: "100%",
background:
"transparent",
zIndex: "0",
opacity: 0.2,
"relative",
overflow:
"hidden",
}}
/>
)}
</Button>
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}&videoStreamIndex=${currentVideoTrack}&audioStreamIndex=${currentAudioTrack}`,
);
setPosition(
item
.data
.UserData
.PlaybackPositionTicks,
);
setItemName(
item
.data
.Type ==
"Episode"
? `${item.data.SeriesName} S${item.data.ParentIndexNumber}:E${item.data.IndexNumber} ${item.data.Name}`
: item
.data
.Name,
);
setItemId(
item
.data
.Id,
);
setDuration(
item
.data
.RunTimeTicks,
);
setSubtitleTracksStore(
subtitleTracks,
);
setSelectedSubtitleTrack(
currentSubTrack,
);
}
navigate(
`/player`,
);
}}
>
{!!item
.data
.UserData
.PlayedPercentage &&
item.data
.UserData
.PlayedPercentage >
0
? "Resume"
: "Play"}
{!!item
.data
.UserData
.PlayedPercentage && (
<LinearProgress
variant="determinate"
value={
item
.data
.UserData
.PlayedPercentage
}
color="white"
sx={{
position:
"absolute",
height: "100%",
width: "100%",
background:
"transparent",
zIndex: "0",
opacity: 0.2,
}}
/>
)}
</Button>
</span>
</Tooltip>
<IconButton
onClick={
@@ -1489,7 +1541,8 @@ const ItemDetail = () => {
item.data.MediaStreams.length !=
0 && (
<>
{videoTracks != [] && (
{videoTracks.length !=
0 && (
<TableRow
sx={{
"& td, & th":
@@ -1549,7 +1602,7 @@ const ItemDetail = () => {
sindex
}
value={
stream.DisplayTitle
stream.Index
}
>
{
@@ -1563,7 +1616,8 @@ const ItemDetail = () => {
</TableCell>
</TableRow>
)}
{audioTracks != [] && (
{audioTracks.length !=
0 && (
<TableRow
sx={{
"& td, & th":
@@ -1619,7 +1673,7 @@ const ItemDetail = () => {
sindex
}
value={
stream.DisplayTitle
stream.Index
}
>
{
@@ -1633,8 +1687,8 @@ const ItemDetail = () => {
</TableCell>
</TableRow>
)}
{subtitleTracks !=
[] && (
{subtitleTracks.length !=
0 && (
<TableRow
sx={{
"& td, & th":
@@ -1690,7 +1744,7 @@ const ItemDetail = () => {
sindex
}
value={
stream.DisplayTitle
stream.Index
}
>
{
+1
View File
@@ -76,6 +76,7 @@
&-title-logo {
filter: drop-shadow(0 0 10px rgb(0 0 0 /0.2));
height: 100%;
max-height: 5em;
width: 45%;
object-fit: contain;
object-position: bottom;
+462 -68
View File
@@ -8,6 +8,13 @@ import Stack from "@mui/material/Stack";
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 Menu from "@mui/material/Menu";
import MenuItem from "@mui/material/MenuItem";
import TextField from "@mui/material/TextField";
import ListItem from "@mui/material/ListItem";
import ListItemText from "@mui/material/ListItemText";
import Backdrop from "@mui/material/Backdrop";
import ReactPlayer from "react-player";
@@ -15,8 +22,8 @@ import { usePlaybackStore } from "../../utils/store/playback";
import { MdiArrowLeft } from "../../components/icons/mdiArrowLeft";
import { MdiPlay } from "../../components/icons/mdiPlay";
import { useNavigate } from "react-router-dom";
import { useRef, useState, useCallback } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import { useRef, useState, useCallback, useEffect } from "react";
import { secToTicks, ticksToSec } from "../../utils/date/time";
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api/playstate-api";
@@ -25,18 +32,66 @@ import "./videoPlayer.module.scss";
import { MdiPause } from "../../components/icons/mdiPause";
import { MdiFastForward } from "../../components/icons/mdiFastForward";
import { MdiRewind } from "../../components/icons/mdiRewind";
import { MdiFullscreen } from "../../components/icons/mdiFullscreen";
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";
import useKeyPress from "../../utils/hooks/useKeyPress";
import { MdiCog } from "../../components/icons/mdiCog";
export const VideoPlayer = () => {
const navigate = useNavigate();
const [settingsMenuEl, setSettingsMenuEl] = useState(null);
const settingsMenuState = Boolean(settingsMenuEl);
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,
subtitleTracksStore,
selectedSubtitleTrack,
] = usePlaybackStore((state) => [
state.url,
state.startPosition,
state.duration,
state.itemId,
state.itemName,
state.subtitleTracks,
state.selectedSubtitleTrack,
]);
const [currentSubtrack, setCurrentSubtrack] = useState(
selectedSubtitleTrack,
);
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);
const [isReady, setIsReady] = useState(false);
const [isPIP, setIsPIP] = useState(false);
const [volume, setVolume] = useState(0.8);
const [showVolume, setShowVolume] = useState(false);
const [duration, setDuration] = useState(0);
const [progress, setProgress] = useState(0);
const [currentTime, setCurrentTime] = useState(0);
const [currentTime, setCurrentTime] = useState(startPosition);
const onReady = useCallback(() => {
if (!isReady) {
@@ -44,65 +99,146 @@ export const VideoPlayer = () => {
playerRef.current.seekTo(timeToStart, "seconds");
setDuration(playerRef.current.getDuration());
setIsReady(true);
const player = playerRef.current.getInternalPlayer();
console.log(player.config);
}
}, [isReady]);
const startTime = new Date(0);
const onProgress = async (e) => {
if (!isSeeking) {
setProgress(e.played);
setCurrentTime(secToTicks(e.playedSeconds));
}
await getPlaystateApi(window.api).reportPlaybackProgress({
playbackProgressInfo: {
ItemId: itemId,
IsMuted: isMuted,
PositionTicks: secToTicks(e.playedSeconds),
PlaybackStartTimeTicks: startPosition,
VolumeLevel: volume * 100,
IsPaused: !isPlaying,
},
});
};
const handleSeeking = useCallback((time, offset) => {
playerRef.current.seekTo(time / 100);
setCurrentTime(time / 100);
const handleDisplayCurrentTime = () => {
let time = ticksToSec(progress * itemDuration);
let hr = Math.floor(time / 3600);
time -= hr * 3600;
let min = Math.floor(time / 60);
time -= min * 60;
return `${hr.toLocaleString([], {
minimumIntegerDigits: 2,
maximumFractionDigits: 0,
})}:${min.toLocaleString([], {
minimumIntegerDigits: 2,
maximumFractionDigits: 0,
})}:${time.toLocaleString([], {
minimumIntegerDigits: 2,
maximumFractionDigits: 0,
})}`;
};
const handleDisplayTime = (ticks) => {
let time = ticksToSec(ticks);
let hr = Math.floor(time / 3600);
time -= hr * 3600;
let min = Math.floor(time / 60);
time -= min * 60;
return `${hr.toLocaleString([], {
minimumIntegerDigits: 2,
maximumFractionDigits: 0,
})}:${min.toLocaleString([], {
minimumIntegerDigits: 2,
maximumFractionDigits: 0,
})}:${time.toLocaleString([], {
minimumIntegerDigits: 2,
maximumFractionDigits: 0,
})}`;
};
const [appFullscreen, setAppFullScreen] = useState(false);
useEffect(() => {
let timeout = null;
if (showControls) {
window.clearTimeout(timeout);
timeout = setTimeout(() => {
setShowControls(false);
}, 5000);
}
}, [showControls]);
const handleKeyPress = useCallback((event) => {
switch (event.key) {
case "ArrowRight":
playerRef.current.seekTo(
playerRef.current.getCurrentTime() + 15,
);
break;
case "ArrowLeft":
playerRef.current.seekTo(
playerRef.current.getCurrentTime() - 15,
);
break;
case "p":
setIsPlaying(!isPlaying);
default:
console.log(event.key);
break;
}
}, []);
const [url, startPosition, itemId, itemName] = usePlaybackStore(
(state) => [
state.url,
state.startPosition,
state.itemId,
state.itemName,
],
);
const [subs, setSubs] = useState([]);
useEffect(() => {
setSubs(
subtitleTracksStore.map((sub, index) => {
return {
kind: "subtitles",
src: `${window.api.basePath}/Videos/${itemId}/${itemId}/Subtitles/${sub.Index}/Stream.vtt?api_key=${window.api.accessToken}`,
srcLang: sub?.Language,
default: false,
mode:
sub.Index == currentSubtrack
? "showing"
: "hidden",
};
}),
);
}, [subtitleTracksStore]);
let timer;
return (
<Box
className="video"
sx={{ background: "black" }}
onMouseMove={(e) => {
let a = "he";
clearTimeout(timer);
e.currentTarget.classList.add("video-osd-visible");
timer = setTimeout(() => {
document
.querySelector(".video")
.classList.remove("video-osd-visible");
}, 2000);
onMouseMove={() => {
setShowControls(true);
}}
>
<Stack
<Box
sx={{
position: "absolute",
inset: 0,
display: "flex",
alignItems: "center",
justifyContent: "center",
opacity: isBuffering ? 1 : 0,
transition: "opacity 250ms",
}}
>
<CircularProgress />
</Box>
<Backdrop
className="video-osd"
sx={{
position: "fixed",
top: 0,
left: 0,
right: 0,
bottom: 0,
display: "flex",
flexDirection: "column",
zIndex: 100000,
justifyContent: "space-between",
background: "transparent",
}}
alignItems="center"
justifyContent="space-between"
direction="column"
zIndex="10000000"
open={showControls}
>
<AppBar
position="static"
@@ -121,50 +257,287 @@ export const VideoPlayer = () => {
</Typography>
</Toolbar>
</AppBar>
<Stack direction="column" padding={2} width="100%">
<Stack width="100%">
<Stack
direction="column"
padding={2}
width="100%"
sx={{
background:
"linear-gradient(to top, rgb(0 0 0 / 0.75), transparent)",
}}
>
<Stack
width="100%"
direction="row"
alignItems="center"
justifyContent="center"
gap={2}
>
<Typography variant="h6">
{handleDisplayCurrentTime()}
</Typography>
<Slider
value={currentTime}
step={0.01}
max={100}
max={itemDuration}
onChange={(e, newVal) => {
playerRef.current.seekTo(
(newVal / 100) *
playerRef.current.getDuration(),
);
setIsSeeking(true);
setCurrentTime(newVal);
}}
onChangeCommitted={(e, newVal) => {
playerRef.current.seekTo(
ticksToSec(newVal),
);
setCurrentTime(newVal);
setIsSeeking(false);
}}
valueLabelDisplay="auto"
valueLabelFormat={(value) =>
handleDisplayTime(value)
}
sx={{
"& .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)",
},
},
}}
/>
<Typography variant="h6">
{handleDisplayTime(itemDuration)}
</Typography>
</Stack>
<Stack direction="row">
<IconButton
onClick={() =>
playerRef.current.seekTo(
playerRef.current.getCurrentTime() -
15,
)
}
<Stack
direction="row"
justifyContent="space-between"
alignItems="center"
>
<Stack
direction="row"
gap={1}
justifyContent="center"
alignItems="center"
>
<MdiRewind />
</IconButton>
<IconButton
onClick={() => setIsPlaying(!isPlaying)}
<IconButton
onClick={() =>
playerRef.current.seekTo(
playerRef.current.getCurrentTime() -
15,
)
}
>
<MdiRewind />
</IconButton>
<IconButton
onClick={() => setIsPlaying(!isPlaying)}
>
{isPlaying ? <MdiPause /> : <MdiPlay />}
</IconButton>
<IconButton
onClick={() =>
playerRef.current.seekTo(
playerRef.current.getCurrentTime() +
15,
)
}
>
<MdiFastForward />
</IconButton>
<Typography variant="subtitle1">
{endsAt(itemDuration - currentTime)}
</Typography>
</Stack>
<Stack
direction="row"
gap={1}
alignItems="center"
justifyContent="center"
>
{isPlaying ? <MdiPause /> : <MdiPlay />}
</IconButton>
<IconButton
onClick={() =>
playerRef.current.seekTo(
playerRef.current.getCurrentTime() +
15,
)
}
>
<MdiFastForward />
</IconButton>
<Box>
<Menu
anchorEl={speedMenuEl}
open={speedMenuState}
onClose={() =>
setSpeedMenuEl(null)
}
MenuListProps={{
"aria-labelledby":
"lock-button",
role: "listbox",
}}
anchorOrigin={{
vertical: "bottom",
horizontal: "center",
}}
transformOrigin={{
vertical: "bottom",
horizontal: "center",
}}
sx={{
mb: 20,
}}
>
{availableSpeeds.map(
(sspeed, index) => {
return (
<MenuItem
key={sspeed}
selected={
index ===
speed
}
onClick={() => {
setSpeed(
index,
);
setSpeedMenuEl(
null,
);
}}
sx={{
width: 160,
}}
>
{sspeed}x
</MenuItem>
);
},
)}
</Menu>
<IconButton
onClick={(e) =>
setSpeedMenuEl(
e.currentTarget,
)
}
>
<MdiPlaySpeed />
</IconButton>
</Box>
<IconButton
sx={{
ml: 0.1,
}}
onClick={() => setIsMuted(!isMuted)}
>
{isMuted ? (
<MdiVolumeOff />
) : (
<MdiVolumeHigh />
)}
</IconButton>
<Slider
value={isMuted ? 0 : volume * 100}
step={1}
max={100}
onChange={(e, newVal) =>
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)",
},
},
}}
/>
<Box>
<Menu
anchorEl={settingsMenuEl}
onClose={() => {
setSettingsMenuEl(null);
}}
open={settingsMenuState}
sx={{ padding: 2 }}
>
<Stack direction="row">
<Typography variant="h6">
Subtitle
</Typography>
</Stack>
</Menu>
<IconButton
onClick={(e) =>
setSettingsMenuEl(
e.currentTarget,
)
}
disabled
>
<MdiCog />
</IconButton>
</Box>
<IconButton
onClick={() => {
setIsPIP(!isPIP);
}}
>
<MdiPictureInPictureBottomRight />
</IconButton>
<IconButton
onClick={async () => {
let fstate =
await appWindow.isFullscreen();
setAppFullScreen(!fstate);
await appWindow.setFullscreen(
!fstate,
);
}}
>
{appFullscreen ? (
<MdiFullscreenExit />
) : (
<MdiFullscreen />
)}
</IconButton>
</Stack>
</Stack>
</Stack>
</Stack>
</Backdrop>
<ReactPlayer
ref={playerRef}
width="100vw"
@@ -174,6 +547,27 @@ export const VideoPlayer = () => {
onProgress={onProgress}
onReady={onReady}
muted={isMuted}
pip={isPIP}
volume={volume}
onBuffer={() => setIsBuffering(true)}
onBufferEnd={() => setIsBuffering(false)}
config={{
file: {
attributes: {
crossOrigin: "true",
},
tracks: [
{
kind: "subtitles",
src: `${window.api.basePath}/Videos/${itemId}/${itemId}/Subtitles/${currentSubtrack}/Stream.vtt?api_key=${window.api.accessToken}`,
srcLang: "",
default: true,
mode: "showing",
},
],
},
}}
playbackRate={availableSpeeds[speed]}
/>
</Box>
);
+13
View File
@@ -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);
}
}
+32
View File
@@ -0,0 +1,32 @@
/** @format */
import { useState, useEffect } from "react";
const useKeyPress = (targetKey) => {
// State for keeping track of whether key is pressed
const [keyPressed, setKeyPressed] = useState(false);
// If pressed key is our target key then set to true
function downHandler({ key }) {
if (key === targetKey) {
setKeyPressed(true);
}
}
// If released key is our target key then set to false
const upHandler = ({ key }) => {
if (key === targetKey) {
setKeyPressed(false);
}
};
// Add event listeners
useEffect(() => {
window.addEventListener("keydown", downHandler);
window.addEventListener("keyup", upHandler);
// Remove event listeners on cleanup
return () => {
window.removeEventListener("keydown", downHandler);
window.removeEventListener("keyup", upHandler);
};
}, []); // Empty array ensures that effect is only run on mount and unmount
return keyPressed;
};
export default useKeyPress;
+8
View File
@@ -0,0 +1,8 @@
/** @format */
import { create } from "zustand";
export const useDrawerStore = create((set) => ({
open: false,
setOpen: (sopen) => set((state) => ({ ...state, open: sopen })),
}));
+11
View File
@@ -5,10 +5,21 @@ import { create } from "zustand";
export const usePlaybackStore = create((set) => ({
url: "",
startPosition: 0,
duration: 0,
itemId: "",
itemName: "",
subtitleTracks: [],
selectedSubtitleTrack: 0,
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: asub,
})),
setSelectedSubtitleTrack: (asub) =>
set((state) => ({ ...state, selectedSubtitleTrack: asub })),
}));