mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-16 03:54:17 -04:00
Update from pacakges & make android seek better to use (#594)
This commit is contained in:
commit
195ed11c62
@ -11,8 +11,8 @@ COPY packages/models/package.json packages/models/package.json
|
|||||||
RUN yarn --immutable
|
RUN yarn --immutable
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV=production
|
||||||
RUN yarn build:web
|
RUN yarn build:web
|
||||||
|
|
||||||
|
|
||||||
@ -25,8 +25,8 @@ COPY --from=builder /app/apps/web/.next/static ./.next/static/
|
|||||||
COPY --from=builder /app/apps/web/public ./public
|
COPY --from=builder /app/apps/web/public ./public
|
||||||
|
|
||||||
EXPOSE 8901
|
EXPOSE 8901
|
||||||
ENV PORT 8901
|
ENV PORT=8901
|
||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV=production
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
|
@ -11,7 +11,7 @@ COPY packages/primitives/package.json packages/primitives/package.json
|
|||||||
COPY packages/models/package.json packages/models/package.json
|
COPY packages/models/package.json packages/models/package.json
|
||||||
RUN yarn --immutable
|
RUN yarn --immutable
|
||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
EXPOSE 8081
|
EXPOSE 8081
|
||||||
ENTRYPOINT ["yarn", "dev"]
|
ENTRYPOINT ["yarn", "dev"]
|
||||||
|
@ -56,10 +56,6 @@ const config: ExpoConfig = {
|
|||||||
backgroundColor: "#eff1f5",
|
backgroundColor: "#eff1f5",
|
||||||
},
|
},
|
||||||
splash,
|
splash,
|
||||||
permissions: [
|
|
||||||
"android.permission.FOREGROUND_SERVICE",
|
|
||||||
"android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
updates: {
|
updates: {
|
||||||
url: "https://u.expo.dev/55de6b52-c649-4a15-9a45-569ff5ed036c",
|
url: "https://u.expo.dev/55de6b52-c649-4a15-9a45-569ff5ed036c",
|
||||||
@ -73,27 +69,16 @@ const config: ExpoConfig = {
|
|||||||
projectId: "55de6b52-c649-4a15-9a45-569ff5ed036c",
|
projectId: "55de6b52-c649-4a15-9a45-569ff5ed036c",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: ["expo-build-properties", "expo-localization"],
|
plugins: [
|
||||||
};
|
"expo-build-properties",
|
||||||
|
"expo-localization",
|
||||||
const withForegroundService = (c: ExpoConfig): ExpoConfig => {
|
[
|
||||||
return withAndroidManifest(c, async (config) => {
|
"react-native-video",
|
||||||
const manifest = config.modResults.manifest;
|
|
||||||
manifest.application![0].service ??= [];
|
|
||||||
manifest.application![0].service.push({
|
|
||||||
$: {
|
|
||||||
"android:name": "com.brentvatne.exoplayer.VideoPlaybackService",
|
|
||||||
"android:exported": "false",
|
|
||||||
"android:foregroundServiceType": "mediaPlayback",
|
|
||||||
},
|
|
||||||
"intent-filter": [
|
|
||||||
{
|
{
|
||||||
action: [{ $: { "android:name": "androidx.media3.session.MediaSessionService" } }],
|
enableNotificationControls: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
],
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withForegroundService(config);
|
export default config;
|
||||||
|
@ -40,6 +40,8 @@ export default function SignGuard() {
|
|||||||
<Stack
|
<Stack
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
navigationBarColor: "transparent",
|
navigationBarColor: "transparent",
|
||||||
|
// @ts-expect-error Not yet available. Waiting for expo-router update.
|
||||||
|
navigationBarTranslucent: true,
|
||||||
headerTitle: () => <NavbarTitle />,
|
headerTitle: () => <NavbarTitle />,
|
||||||
headerRight: () => <NavbarRight />,
|
headerRight: () => <NavbarRight />,
|
||||||
contentStyle: {
|
contentStyle: {
|
||||||
|
@ -18,54 +18,53 @@
|
|||||||
"@formatjs/intl-displaynames": "^6.6.8",
|
"@formatjs/intl-displaynames": "^6.6.8",
|
||||||
"@formatjs/intl-locale": "^4.0.0",
|
"@formatjs/intl-locale": "^4.0.0",
|
||||||
"@gorhom/portal": "^1.0.14",
|
"@gorhom/portal": "^1.0.14",
|
||||||
"@kesha-antonov/react-native-background-downloader": "^3.1.3",
|
"@kesha-antonov/react-native-background-downloader": "^3.2.0",
|
||||||
"@kyoo/ui": "workspace:^",
|
"@kyoo/ui": "workspace:^",
|
||||||
"@material-symbols/svg-400": "^0.18.0",
|
"@material-symbols/svg-400": "^0.22.0",
|
||||||
"@react-native-community/netinfo": "11.3.1",
|
"@react-native-community/netinfo": "11.3.2",
|
||||||
"@shopify/flash-list": "1.6.4",
|
"@shopify/flash-list": "1.7.1",
|
||||||
"@tanstack/query-sync-storage-persister": "^5.38.0",
|
"@tanstack/query-sync-storage-persister": "^5.51.21",
|
||||||
"@tanstack/react-query": "^5.39.0",
|
"@tanstack/react-query": "^5.51.23",
|
||||||
"@tanstack/react-query-persist-client": "^5.39.0",
|
"@tanstack/react-query-persist-client": "^5.51.23",
|
||||||
"array-shuffle": "^3.0.0",
|
"array-shuffle": "^3.0.0",
|
||||||
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
|
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
|
||||||
"expo": "^51.0.8",
|
"expo": "^51.0.26",
|
||||||
"expo-build-properties": "~0.12.1",
|
"expo-build-properties": "~0.12.5",
|
||||||
"expo-constants": "~16.0.1",
|
"expo-constants": "~16.0.2",
|
||||||
"expo-dev-client": "~4.0.14",
|
"expo-dev-client": "~4.0.22",
|
||||||
"expo-file-system": "~17.0.1",
|
"expo-file-system": "~17.0.1",
|
||||||
"expo-font": "~12.0.5",
|
"expo-font": "~12.0.9",
|
||||||
"expo-image-picker": "~15.0.5",
|
"expo-image-picker": "~15.0.7",
|
||||||
"expo-linear-gradient": "~13.0.2",
|
"expo-linear-gradient": "~13.0.2",
|
||||||
"expo-linking": "~6.3.1",
|
"expo-linking": "~6.3.1",
|
||||||
"expo-localization": "~15.0.3",
|
"expo-localization": "~15.0.3",
|
||||||
"expo-navigation-bar": "~3.0.4",
|
"expo-navigation-bar": "~3.0.7",
|
||||||
"expo-router": "3.5.14",
|
"expo-router": "3.5.21",
|
||||||
"expo-screen-orientation": "~7.0.5",
|
"expo-screen-orientation": "~7.0.5",
|
||||||
"expo-secure-store": "~13.0.1",
|
"expo-secure-store": "~13.0.2",
|
||||||
"expo-status-bar": "~1.12.1",
|
"expo-status-bar": "~1.12.1",
|
||||||
"expo-updates": "~0.25.14",
|
"expo-updates": "~0.25.22",
|
||||||
"i18next": "^23.11.5",
|
"i18next": "^23.12.2",
|
||||||
"intl-pluralrules": "^2.0.1",
|
"intl-pluralrules": "^2.0.1",
|
||||||
"moti": "^0.29.0",
|
"moti": "^0.29.0",
|
||||||
"react": "18.2.0",
|
"react": "18.3.1",
|
||||||
"react-dom": "18.2.0",
|
"react-i18next": "^15.0.1",
|
||||||
"react-i18next": "^14.1.2",
|
"react-native": "0.74.5",
|
||||||
"react-native": "0.74.1",
|
|
||||||
"react-native-blurhash": "^2.0.3",
|
"react-native-blurhash": "^2.0.3",
|
||||||
"react-native-fast-image": "^8.6.3",
|
"react-native-fast-image": "^8.6.3",
|
||||||
"react-native-mmkv": "^2.12.2",
|
"react-native-mmkv": "^2.12.2",
|
||||||
"react-native-reanimated": "~3.10.1",
|
"react-native-reanimated": "~3.15.0",
|
||||||
"react-native-safe-area-context": "4.10.1",
|
"react-native-safe-area-context": "4.10.8",
|
||||||
"react-native-screens": "~3.31.1",
|
"react-native-screens": "3.34.0",
|
||||||
"react-native-svg": "15.2.0",
|
"react-native-svg": "15.2.0",
|
||||||
"react-native-uuid": "^2.0.2",
|
"react-native-uuid": "^2.0.2",
|
||||||
"react-native-video": "^6.1.2",
|
"react-native-video": "^6.4.3",
|
||||||
"yoshiki": "1.2.14"
|
"yoshiki": "1.2.14"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.24.6",
|
"@babel/core": "^7.25.2",
|
||||||
"react-native-svg-transformer": "^1.4.0",
|
"react-native-svg-transformer": "^1.5.0",
|
||||||
"typescript": "~5.3.3"
|
"typescript": "~5.5.4"
|
||||||
},
|
},
|
||||||
"installConfig": {
|
"installConfig": {
|
||||||
"hoistingLimits": "workspaces"
|
"hoistingLimits": "workspaces"
|
||||||
|
@ -51,8 +51,14 @@ const nextConfig = {
|
|||||||
alias: {
|
alias: {
|
||||||
...config.resolve.alias,
|
...config.resolve.alias,
|
||||||
"react-native$": "react-native-web",
|
"react-native$": "react-native-web",
|
||||||
"react-native/Libraries/Image/AssetRegistry$":
|
// "react-native/Libraries/Image/AssetRegistry$":
|
||||||
"react-native-web/dist/modules/AssetRegistry",
|
// "react-native-web/dist/modules/AssetRegistry",
|
||||||
|
"react-native/Libraries/EventEmitter/RCTDeviceEventEmitter$":
|
||||||
|
"react-native-web/dist/vendor/react-native/NativeEventEmitter/RCTDeviceEventEmitter",
|
||||||
|
"react-native/Libraries/vendor/emitter/EventEmitter$":
|
||||||
|
"react-native-web/dist/vendor/react-native/emitter/EventEmitter",
|
||||||
|
"react-native/Libraries/EventEmitter/NativeEventEmitter$":
|
||||||
|
"react-native-web/dist/vendor/react-native/NativeEventEmitter",
|
||||||
},
|
},
|
||||||
extensions: [".web.ts", ".web.tsx", ".web.js", ".web.jsx", ...config.resolve.extensions],
|
extensions: [".web.ts", ".web.tsx", ".web.js", ".web.jsx", ...config.resolve.extensions],
|
||||||
};
|
};
|
||||||
@ -94,6 +100,7 @@ const nextConfig = {
|
|||||||
"@kyoo/ui",
|
"@kyoo/ui",
|
||||||
"@kyoo/primitives",
|
"@kyoo/primitives",
|
||||||
"@kyoo/models",
|
"@kyoo/models",
|
||||||
|
"@react-native/assets-registry",
|
||||||
"solito",
|
"solito",
|
||||||
"react-native",
|
"react-native",
|
||||||
"react-native-web",
|
"react-native-web",
|
||||||
|
@ -16,45 +16,45 @@
|
|||||||
"@kyoo/models": "workspace:^",
|
"@kyoo/models": "workspace:^",
|
||||||
"@kyoo/primitives": "workspace:^",
|
"@kyoo/primitives": "workspace:^",
|
||||||
"@kyoo/ui": "workspace:^",
|
"@kyoo/ui": "workspace:^",
|
||||||
"@material-symbols/svg-400": "^0.18.0",
|
"@material-symbols/svg-400": "^0.22.0",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
"@radix-ui/react-dropdown-menu": "^2.1.1",
|
||||||
"@radix-ui/react-select": "^2.0.0",
|
"@radix-ui/react-select": "^2.1.1",
|
||||||
"@tanstack/react-query": "^5.39.0",
|
"@tanstack/react-query": "^5.51.23",
|
||||||
"@tanstack/react-query-devtools": "^5.39.0",
|
"@tanstack/react-query-devtools": "^5.51.23",
|
||||||
"array-shuffle": "^3.0.0",
|
"array-shuffle": "^3.0.0",
|
||||||
"expo-image-picker": "~15.0.5",
|
"expo-image-picker": "~15.0.7",
|
||||||
"expo-linear-gradient": "^13.0.2",
|
"expo-linear-gradient": "^13.0.2",
|
||||||
"expo-modules-core": "^1.12.11",
|
"expo-modules-core": "^1.12.20",
|
||||||
"hls.js": "^1.5.8",
|
"hls.js": "^1.5.14",
|
||||||
"i18next": "^23.11.5",
|
"i18next": "^23.12.2",
|
||||||
"jassub": "^1.7.15",
|
"jassub": "1.7.15",
|
||||||
"jotai": "^2.8.1",
|
"jotai": "^2.9.2",
|
||||||
"moti": "^0.29.0",
|
"moti": "^0.29.0",
|
||||||
"next": "14.2.3",
|
"next": "14.2.5",
|
||||||
"next-translate": "^2.6.2",
|
"next-translate": "^2.6.2",
|
||||||
"raf": "^3.4.1",
|
"raf": "^3.4.1",
|
||||||
"react": "18.2.0",
|
"react": "18.3.1",
|
||||||
"react-dom": "18.3.1",
|
"react-dom": "18.3.1",
|
||||||
"react-i18next": "^14.1.2",
|
"react-i18next": "^15.0.1",
|
||||||
"react-native-reanimated": "3.11.0",
|
"react-native-reanimated": "3.15.0",
|
||||||
"react-native-svg": "15.3.0",
|
"react-native-svg": "15.2.0",
|
||||||
"react-native-video": "^6.1.2",
|
"react-native-video": "^6.4.3",
|
||||||
"react-native-web": "0.19.12",
|
"react-native-web": "0.19.12",
|
||||||
"react-tooltip": "^5.26.4",
|
"react-tooltip": "^5.28.0",
|
||||||
"solito": "^4.2.2",
|
"solito": "^4.2.2",
|
||||||
"srt-webvtt": "zoriya/srt-webvtt#build",
|
"srt-webvtt": "zoriya/srt-webvtt#build",
|
||||||
"superjson": "^2.2.1",
|
"superjson": "^2.2.1",
|
||||||
"sweetalert2": "^11.11.0",
|
"sweetalert2": "^11.12.4",
|
||||||
"yoshiki": "1.2.14",
|
"yoshiki": "1.2.14",
|
||||||
"zod": "^3.23.8"
|
"zod": "^3.23.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@svgr/webpack": "^8.1.0",
|
"@svgr/webpack": "^8.1.0",
|
||||||
"@types/node": "20.12.12",
|
"@types/node": "22.2.0",
|
||||||
"@types/react-dom": "18.3.0",
|
"@types/react-dom": "18.3.0",
|
||||||
"copy-webpack-plugin": "^12.0.2",
|
"copy-webpack-plugin": "^12.0.2",
|
||||||
"react-native": "0.74.1",
|
"react-native": "0.74.5",
|
||||||
"typescript": "^5.4.5",
|
"typescript": "^5.5.4",
|
||||||
"webpack": "^5.91.0"
|
"webpack": "^5.93.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
},
|
},
|
||||||
"workspaces": ["apps/*", "packages/*"],
|
"workspaces": ["apps/*", "packages/*"],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.7.3",
|
"@biomejs/biome": "1.8.3",
|
||||||
"typescript": "5.4.5"
|
"typescript": "5.5.4"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@3.2.4"
|
"packageManager": "yarn@3.2.4"
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"packageManager": "yarn@3.2.4",
|
"packageManager": "yarn@3.2.4",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"react-native-mmkv": "^2.12.2",
|
"react-native-mmkv": "^2.12.2",
|
||||||
"typescript": "^5.4.5"
|
"typescript": "^5.5.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tanstack/react-query": "*",
|
"@tanstack/react-query": "*",
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"packageManager": "yarn@3.2.4",
|
"packageManager": "yarn@3.2.4",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gorhom/portal": "^1.0.14",
|
"@gorhom/portal": "^1.0.14",
|
||||||
"typescript": "^5.4.5"
|
"typescript": "^5.5.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@gorhom/portal": "*",
|
"@gorhom/portal": "*",
|
||||||
@ -53,14 +53,14 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/html-elements": "^0.10.1",
|
"@expo/html-elements": "^0.10.1",
|
||||||
"@tanstack/react-query": "^5.39.0",
|
"@tanstack/react-query": "^5.51.23",
|
||||||
"solito": "^4.2.2"
|
"solito": "^4.2.2"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@radix-ui/react-select": "^2.0.0",
|
"@radix-ui/react-select": "^2.1.1",
|
||||||
"blurhash": "^2.0.5",
|
"blurhash": "^2.0.5",
|
||||||
"react-native-blurhash": "^2.0.3",
|
"react-native-blurhash": "^2.0.3",
|
||||||
"react-native-fast-image": "^8.6.3",
|
"react-native-fast-image": "^8.6.3",
|
||||||
"react-native-safe-area-context": "4.10.1"
|
"react-native-safe-area-context": "4.10.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,10 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gorhom/portal": "^1.0.14",
|
"@gorhom/portal": "^1.0.14",
|
||||||
"@shopify/flash-list": "^1.6.4",
|
"@shopify/flash-list": "^1.7.1",
|
||||||
"@types/langmap": "^0.0.3",
|
"@types/langmap": "^0.0.3",
|
||||||
"react-native-uuid": "^2.0.2",
|
"react-native-uuid": "^2.0.2",
|
||||||
"typescript": "^5.4.5"
|
"typescript": "^5.5.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@gorhom/portal": "*",
|
"@gorhom/portal": "*",
|
||||||
@ -35,9 +35,9 @@
|
|||||||
"yoshiki": "*"
|
"yoshiki": "*"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@kesha-antonov/react-native-background-downloader": "^3.1.3",
|
"@kesha-antonov/react-native-background-downloader": "^3.2.0",
|
||||||
"expo-file-system": "^17.0.1",
|
"expo-file-system": "^17.0.1",
|
||||||
"expo-router": "^3.5.14"
|
"expo-router": "^3.5.21"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"@kesha-antonov/react-native-background-downloader": {
|
"@kesha-antonov/react-native-background-downloader": {
|
||||||
|
@ -40,7 +40,7 @@ import { FlashList } from "@shopify/flash-list";
|
|||||||
import { useRouter } from "expo-router";
|
import { useRouter } from "expo-router";
|
||||||
import { type Atom, useAtomValue } from "jotai";
|
import { type Atom, useAtomValue } from "jotai";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { type ImageStyle, View } from "react-native";
|
import { View } from "react-native";
|
||||||
import { percent, useYoshiki } from "yoshiki/native";
|
import { percent, useYoshiki } from "yoshiki/native";
|
||||||
import { EpisodeLine, displayRuntime, episodeDisplayNumber } from "../details/episode";
|
import { EpisodeLine, displayRuntime, episodeDisplayNumber } from "../details/episode";
|
||||||
import { EmptyView } from "../fetch";
|
import { EmptyView } from "../fetch";
|
||||||
|
@ -71,9 +71,9 @@ export const RightButtons = ({
|
|||||||
selected={!selectedSubtitle}
|
selected={!selectedSubtitle}
|
||||||
onSelect={() => setSubtitle(null)}
|
onSelect={() => setSubtitle(null)}
|
||||||
/>
|
/>
|
||||||
{subtitles.map((x) => (
|
{subtitles.map((x, i) => (
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
key={x.index}
|
key={x.index ?? i}
|
||||||
label={x.link ? getDisplayName(x) : `${getDisplayName(x)} (${x.codec})`}
|
label={x.link ? getDisplayName(x) : `${getDisplayName(x)} (${x.codec})`}
|
||||||
selected={selectedSubtitle === x}
|
selected={selectedSubtitle === x}
|
||||||
disabled={!x.link}
|
disabled={!x.link}
|
||||||
|
@ -146,7 +146,7 @@ export const Player = ({
|
|||||||
<Video
|
<Video
|
||||||
metadata={{
|
metadata={{
|
||||||
title: title ?? t("show.episodeNoMetadata"),
|
title: title ?? t("show.episodeNoMetadata"),
|
||||||
subtitle: subtitle ?? undefined,
|
artist: subtitle ?? undefined,
|
||||||
description: data?.overview ?? undefined,
|
description: data?.overview ?? undefined,
|
||||||
imageUri: image?.medium,
|
imageUri: image?.medium,
|
||||||
next: next,
|
next: next,
|
||||||
|
@ -27,12 +27,14 @@ import { durationAtom, playAtom, progressAtom } from "./state";
|
|||||||
export const MediaSessionManager = ({
|
export const MediaSessionManager = ({
|
||||||
title,
|
title,
|
||||||
subtitle,
|
subtitle,
|
||||||
|
artist,
|
||||||
imageUri,
|
imageUri,
|
||||||
previous,
|
previous,
|
||||||
next,
|
next,
|
||||||
}: {
|
}: {
|
||||||
title?: string;
|
title?: string;
|
||||||
subtitle?: string;
|
subtitle?: string;
|
||||||
|
artist?: string;
|
||||||
imageUri?: string | null;
|
imageUri?: string | null;
|
||||||
previous?: string;
|
previous?: string;
|
||||||
next?: string;
|
next?: string;
|
||||||
@ -48,9 +50,10 @@ export const MediaSessionManager = ({
|
|||||||
navigator.mediaSession.metadata = new MediaMetadata({
|
navigator.mediaSession.metadata = new MediaMetadata({
|
||||||
title: title,
|
title: title,
|
||||||
album: subtitle,
|
album: subtitle,
|
||||||
|
artist: artist,
|
||||||
artwork: imageUri ? [{ src: imageUri }] : undefined,
|
artwork: imageUri ? [{ src: imageUri }] : undefined,
|
||||||
});
|
});
|
||||||
}, [title, subtitle, imageUri]);
|
}, [title, subtitle, artist, imageUri]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!("mediaSession" in navigator)) return;
|
if (!("mediaSession" in navigator)) return;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
import { type Audio, type Episode, type Subtitle, getLocalSetting, useAccount } from "@kyoo/models";
|
import { type Audio, type Episode, type Subtitle, getLocalSetting, useAccount } from "@kyoo/models";
|
||||||
import { useSnackbar } from "@kyoo/primitives";
|
import { useSnackbar } from "@kyoo/primitives";
|
||||||
import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
import { atom, getDefaultStore, useAtom, useAtomValue, useSetAtom } from "jotai";
|
||||||
import { useAtomCallback } from "jotai/utils";
|
import { useAtomCallback } from "jotai/utils";
|
||||||
import {
|
import {
|
||||||
type ElementRef,
|
type ElementRef,
|
||||||
@ -33,7 +33,7 @@ import {
|
|||||||
} from "react";
|
} from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Platform } from "react-native";
|
import { Platform } from "react-native";
|
||||||
import NativeVideo, { canPlay, type VideoProps } from "./video";
|
import NativeVideo, { canPlay, type VideoMetadata, type VideoProps } from "./video";
|
||||||
|
|
||||||
export const playAtom = atom(true);
|
export const playAtom = atom(true);
|
||||||
export const loadAtom = atom(false);
|
export const loadAtom = atom(false);
|
||||||
@ -114,14 +114,7 @@ export const Video = memo(function Video({
|
|||||||
setError: (error: string | undefined) => void;
|
setError: (error: string | undefined) => void;
|
||||||
fonts?: string[];
|
fonts?: string[];
|
||||||
startTime?: number | null;
|
startTime?: number | null;
|
||||||
metadata: {
|
metadata: VideoMetadata & { next?: string; previous?: string };
|
||||||
title?: string;
|
|
||||||
subtitle?: string;
|
|
||||||
description?: string;
|
|
||||||
imageUri?: string;
|
|
||||||
previous?: string;
|
|
||||||
next?: string;
|
|
||||||
};
|
|
||||||
} & Partial<VideoProps>) {
|
} & Partial<VideoProps>) {
|
||||||
const ref = useRef<ElementRef<typeof NativeVideo> | null>(null);
|
const ref = useRef<ElementRef<typeof NativeVideo> | null>(null);
|
||||||
const [isPlaying, setPlay] = useAtom(playAtom);
|
const [isPlaying, setPlay] = useAtom(playAtom);
|
||||||
@ -239,6 +232,7 @@ export const Video = memo(function Video({
|
|||||||
showNotificationControls
|
showNotificationControls
|
||||||
playInBackground
|
playInBackground
|
||||||
playWhenInactive
|
playWhenInactive
|
||||||
|
disableDisconnectError
|
||||||
paused={!isPlaying}
|
paused={!isPlaying}
|
||||||
muted={isMuted}
|
muted={isMuted}
|
||||||
volume={volume}
|
volume={volume}
|
||||||
@ -252,7 +246,10 @@ export const Video = memo(function Video({
|
|||||||
setPrivateProgress(progress.currentTime);
|
setPrivateProgress(progress.currentTime);
|
||||||
setBuffered(progress.playableDuration);
|
setBuffered(progress.playableDuration);
|
||||||
}}
|
}}
|
||||||
onPlaybackStateChanged={(state) => setPlay(state.isPlaying)}
|
onPlaybackStateChanged={(state) => {
|
||||||
|
if (state.isSeeking || getDefaultStore().get(loadAtom)) return;
|
||||||
|
setPlay(state.isPlaying);
|
||||||
|
}}
|
||||||
fonts={fonts}
|
fonts={fonts}
|
||||||
subtitles={subtitles}
|
subtitles={subtitles}
|
||||||
onMediaUnsupported={() => {
|
onMediaUnsupported={() => {
|
||||||
|
@ -246,8 +246,8 @@ const Video = forwardRef<{ seek: (value: number) => void }, VideoProps>(function
|
|||||||
onLoadedMetadata={() => {
|
onLoadedMetadata={() => {
|
||||||
if (source.startPosition) setProgress(source.startPosition / 1000);
|
if (source.startPosition) setProgress(source.startPosition / 1000);
|
||||||
}}
|
}}
|
||||||
onPlay={() => onPlaybackStateChanged?.({ isPlaying: true })}
|
onPlay={() => onPlaybackStateChanged?.({ isPlaying: true, isSeeking: false })}
|
||||||
onPause={() => onPlaybackStateChanged?.({ isPlaying: false })}
|
onPause={() => onPlaybackStateChanged?.({ isPlaying: false, isSeeking: false })}
|
||||||
onEnded={onEnd}
|
onEnded={onEnd}
|
||||||
{...css({ width: "100%", height: "100%", objectFit: "contain" })}
|
{...css({ width: "100%", height: "100%", objectFit: "contain" })}
|
||||||
/>
|
/>
|
||||||
|
6512
front/yarn.lock
6512
front/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user