diff --git a/front/package.json b/front/package.json index 73767d92..d86ddeb3 100644 --- a/front/package.json +++ b/front/package.json @@ -21,34 +21,34 @@ "tsdoc": true }, "dependencies": { - "@emotion/react": "^11.9.3", - "@emotion/styled": "^11.9.3", + "@emotion/react": "^11.10.4", + "@emotion/styled": "^11.10.4", "@jellyfin/libass-wasm": "^4.1.1", - "@mui/icons-material": "^5.8.4", - "@mui/material": "^5.8.7", + "@mui/icons-material": "^5.10.9", + "@mui/material": "^5.10.10", "hls.js": "^1.2.4", - "jotai": "^1.8.4", - "next": "12.2.2", - "next-translate": "^1.5.0", + "jotai": "^1.8.6", + "next": "12.3.1", + "next-translate": "^1.6.0", "react": "18.2.0", "react-dom": "18.2.0", "react-infinite-scroll-component": "^6.1.0", "react-query": "^4.0.0-beta.23", - "superjson": "^1.9.1", - "zod": "^3.18.0" + "superjson": "^1.10.1", + "zod": "^3.19.1" }, "devDependencies": { "@types/chromecast-caf-sender": "^1.0.5", - "@types/node": "18.0.3", - "@types/react": "18.0.15", + "@types/node": "18.11.2", + "@types/react": "18.0.21", "@types/react-dom": "18.0.6", "copy-webpack-plugin": "^11.0.0", - "eslint": "8.19.0", - "eslint-config-next": "12.2.2", + "eslint": "8.25.0", + "eslint-config-next": "12.3.1", "eslint-config-prettier": "^8.5.0", "eslint-plugin-header": "^3.1.1", "prettier": "^2.7.1", - "prettier-plugin-jsdoc": "^0.3.38", - "typescript": "4.7.4" + "prettier-plugin-jsdoc": "^0.4.2", + "typescript": "4.8.4" } } diff --git a/front/src/pages/_app.tsx b/front/src/pages/_app.tsx index 5d21036f..c7f3a776 100755 --- a/front/src/pages/_app.tsx +++ b/front/src/pages/_app.tsx @@ -38,9 +38,8 @@ if (typeof window === "undefined") { const App = ({ Component, pageProps }: AppProps) => { const [queryClient] = useState(() => createQueryClient()); - const { queryState, ...props } = superjson.deserialize(pageProps ?? {}); + const { queryState, ...props } = superjson.deserialize(pageProps ?? { json: {} }); const getLayout = (Component as QueryPage).getLayout ?? ((page) => page); - const castEnabled = true; useMobileHover(); @@ -75,7 +74,7 @@ const App = ({ Component, pageProps }: AppProps) => { {getLayout()} - {castEnabled && } + diff --git a/front/src/player/cast/cast-provider.tsx b/front/src/player/cast/cast-provider.tsx index fda8f74d..0e95c739 100644 --- a/front/src/player/cast/cast-provider.tsx +++ b/front/src/player/cast/cast-provider.tsx @@ -18,10 +18,18 @@ * along with Kyoo. If not, see . */ +import dynamic from "next/dynamic"; import Script from "next/script"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; + +// @ts-ignore +const CastController = dynamic(() => import("./state").then((x) => x.CastController), { + loading: () => null, +}); export const CastProvider = () => { + const [loaded, setLoaded] = useState(false); + useEffect(() => { window.__onGCastApiAvailable = (isAvailable) => { if (!isAvailable) return; @@ -34,9 +42,13 @@ export const CastProvider = () => { }, []); return ( -