diff options
| author | Factiven <[email protected]> | 2023-08-08 13:16:55 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-08-08 13:16:55 +0700 |
| commit | 35f50ea6ba56ceb839ff96eb289df53771e23a61 (patch) | |
| tree | 2fb5101a4bf6a3fd01d58037b5156b602d186e41 /components/anime/watch/primarySide.js | |
| parent | Dockerfile for building moopa (#34) (diff) | |
| download | moopa-35f50ea6ba56ceb839ff96eb289df53771e23a61.tar.xz moopa-35f50ea6ba56ceb839ff96eb289df53771e23a61.zip | |
Update v3.8.7 - Merged Beta to Main (#39)
* Update v3.8.6
> Minor update for Android 13 user
* Update v3.8.7
> Added prev and next button to mediaSession
Diffstat (limited to 'components/anime/watch/primarySide.js')
| -rw-r--r-- | components/anime/watch/primarySide.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/components/anime/watch/primarySide.js b/components/anime/watch/primarySide.js index 49bb1b6..fa12711 100644 --- a/components/anime/watch/primarySide.js +++ b/components/anime/watch/primarySide.js @@ -74,6 +74,29 @@ export default function PrimarySide({ fetchData(); }, [providerId, watchId, info]); + useEffect(() => { + const mediaSession = navigator.mediaSession; + if (!mediaSession) return; + + const now = navigation?.playing; + const poster = now?.image || info?.bannerImage; + const title = now?.title || info?.title?.romaji; + + const artwork = poster + ? [{ src: poster, sizes: "512x512", type: "image/jpeg" }] + : undefined; + + mediaSession.metadata = new MediaMetadata({ + title: title, + artist: `Moopa ${ + title === info?.title?.romaji + ? "- Episode " + epiNumber + : `- ${info?.title?.romaji || info?.title?.english}` + }`, + artwork, + }); + }, [navigation, info, epiNumber]); + function handleOpen() { setOpen(true); document.body.style.overflow = "hidden"; @@ -118,6 +141,7 @@ export default function PrimarySide({ skip={skip} proxy={proxy} aniId={info.id} + track={navigation} /> ) ) : ( |