mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Use artist in media session for android
This commit is contained in:
parent
e6f4f51aea
commit
660175f4ed
@ -146,7 +146,7 @@ export const Player = ({
|
||||
<Video
|
||||
metadata={{
|
||||
title: title ?? t("show.episodeNoMetadata"),
|
||||
subtitle: subtitle ?? undefined,
|
||||
artist: subtitle ?? undefined,
|
||||
description: data?.overview ?? undefined,
|
||||
imageUri: image?.medium,
|
||||
next: next,
|
||||
|
@ -27,12 +27,14 @@ import { durationAtom, playAtom, progressAtom } from "./state";
|
||||
export const MediaSessionManager = ({
|
||||
title,
|
||||
subtitle,
|
||||
artist,
|
||||
imageUri,
|
||||
previous,
|
||||
next,
|
||||
}: {
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
artist?: string;
|
||||
imageUri?: string | null;
|
||||
previous?: string;
|
||||
next?: string;
|
||||
@ -48,9 +50,10 @@ export const MediaSessionManager = ({
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
title: title,
|
||||
album: subtitle,
|
||||
artist: artist,
|
||||
artwork: imageUri ? [{ src: imageUri }] : undefined,
|
||||
});
|
||||
}, [title, subtitle, imageUri]);
|
||||
}, [title, subtitle, artist, imageUri]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!("mediaSession" in navigator)) return;
|
||||
|
@ -33,7 +33,7 @@ import {
|
||||
} from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Platform } from "react-native";
|
||||
import NativeVideo, { canPlay, type VideoProps } from "./video";
|
||||
import NativeVideo, { canPlay, VideoMetadata, type VideoProps } from "./video";
|
||||
|
||||
export const playAtom = atom(true);
|
||||
export const loadAtom = atom(false);
|
||||
@ -114,14 +114,7 @@ export const Video = memo(function Video({
|
||||
setError: (error: string | undefined) => void;
|
||||
fonts?: string[];
|
||||
startTime?: number | null;
|
||||
metadata: {
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
description?: string;
|
||||
imageUri?: string;
|
||||
previous?: string;
|
||||
next?: string;
|
||||
};
|
||||
metadata: VideoMetadata & { next?: string; previous?: string };
|
||||
} & Partial<VideoProps>) {
|
||||
const ref = useRef<ElementRef<typeof NativeVideo> | null>(null);
|
||||
const [isPlaying, setPlay] = useAtom(playAtom);
|
||||
|
Loading…
x
Reference in New Issue
Block a user