mirror of
https://github.com/remvze/moodist.git
synced 2025-12-18 01:14:17 +00:00
feat: add media session (wip)
This commit is contained in:
parent
f79e941527
commit
fc1bd07b7d
1 changed files with 4 additions and 1 deletions
|
|
@ -13,10 +13,13 @@ export function useMediaSession() {
|
||||||
title: 'Moodist - Ambient Sounds',
|
title: 'Moodist - Ambient Sounds',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
navigator.mediaSession.playbackState = 'playing';
|
||||||
|
|
||||||
navigator.mediaSession.setActionHandler('play', function () {});
|
navigator.mediaSession.setActionHandler('play', function () {});
|
||||||
navigator.mediaSession.setActionHandler('pause', function () {});
|
navigator.mediaSession.setActionHandler('pause', function () {});
|
||||||
|
navigator.mediaSession.setActionHandler('stop', function () {});
|
||||||
} else {
|
} else {
|
||||||
navigator.mediaSession.metadata = null;
|
navigator.mediaSession.playbackState = 'paused';
|
||||||
console.log('bye');
|
console.log('bye');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue