diff --git a/package-lock.json b/package-lock.json index ea71299..eed4ea2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,6 @@ "react-dom": "^18.2.0", "react-icons": "4.11.0", "react-wrap-balancer": "1.1.0", - "unmute-ios-audio": "3.3.0", "zustand": "4.4.3" }, "devDependencies": { @@ -15786,25 +15785,6 @@ "node": ">= 10.0.0" } }, - "node_modules/unmute-ios-audio": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/unmute-ios-audio/-/unmute-ios-audio-3.3.0.tgz", - "integrity": "sha512-MmoCOrsS2gn3wLT2tT+hF56Q4V4kksIKn2LHrwAtX6umzQwQHDWSh1slMzH+0WuxTZ62s3w8/wsfIII1FQ7ACg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/untildify": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", diff --git a/package.json b/package.json index c77b278..43d9624 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "react-dom": "^18.2.0", "react-icons": "4.11.0", "react-wrap-balancer": "1.1.0", - "unmute-ios-audio": "3.3.0", "zustand": "4.4.3" }, "devDependencies": { diff --git a/src/components/app/app.tsx b/src/components/app/app.tsx index 4f5285c..e398562 100644 --- a/src/components/app/app.tsx +++ b/src/components/app/app.tsx @@ -2,7 +2,6 @@ import { useMemo, useEffect } from 'react'; import { useShallow } from 'zustand/react/shallow'; import { BiSolidHeart } from 'react-icons/bi/index'; import { Howler } from 'howler'; -import unmuteAudio from 'unmute-ios-audio'; import { useSoundStore } from '@/store'; @@ -23,9 +22,6 @@ export function App() { const categories = useMemo(() => sounds.categories, []); const favorites = useSoundStore(useShallow(state => state.getFavorites())); - const play = useSoundStore(state => state.play); - const pause = useSoundStore(state => state.pause); - const isPlaying = useSoundStore(state => state.isPlaying); const favoriteSounds = useMemo(() => { const favoriteSounds = categories @@ -57,32 +53,6 @@ export function App() { return () => document.removeEventListener('visibilitychange', onChange); }, []); - useEffect(() => { - unmuteAudio(); - }, []); - - useEffect(() => { - try { - navigator.mediaSession.setActionHandler('play', play); - navigator.mediaSession.setActionHandler('pause', pause); - navigator.mediaSession.setActionHandler('stop', pause); - } catch (error) { - console.log('Media session is no supported yet'); - } - }, [play, pause]); - - useEffect(() => { - if (isPlaying) { - navigator.mediaSession.metadata = new MediaMetadata({ - title: 'Moodist', - }); - - navigator.mediaSession.playbackState = 'playing'; - } else { - navigator.mediaSession.playbackState = 'paused'; - } - }, [isPlaying]); - const allCategories = useMemo(() => { const favorites = [];