mirror of
https://github.com/remvze/moodist.git
synced 2026-02-28 00:53:13 +08:00
feat: add media session (wip)
This commit is contained in:
@@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user