Skip to content

Commit

Permalink
feat: add media session (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
remvze committed May 11, 2024
1 parent f79e941 commit fc1bd07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/use-media-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ export function useMediaSession() {
title: 'Moodist - Ambient Sounds',
});

navigator.mediaSession.playbackState = 'playing';

navigator.mediaSession.setActionHandler('play', function () {});
navigator.mediaSession.setActionHandler('pause', function () {});
navigator.mediaSession.setActionHandler('stop', function () {});
} else {
navigator.mediaSession.metadata = null;
navigator.mediaSession.playbackState = 'paused';
console.log('bye');
}
}
Expand Down

0 comments on commit fc1bd07

Please sign in to comment.