Open humbkr opened 4 years ago
+1, lmk if I can help with this @E-Kuerschner
@joeyiny I have something working locally! Hoping to get a release out this week cc @humbkr
@joeyiny sorry for the delay! I still have a branch open for this but i ran into some difficulties with the global version of the hook. Will keep posting updates here
@E-Kuerschner got it, let me know if i can help
hey @joeyiny, @humbkr are you able to use the media session if you create the sound with html5
set to true?
const { load } = useAudioPlayer()
load({
src: '/myFile.mp3',
html5: true
})
After doing some research it appears that the media notification will only be set if an audio or video element is present on the page.
pausing work on this for the time being since the Media Session Notification feature will not work with the Web Audio Api which is the default mode of operation for Howler. In order to integrate with the MediaSession the Howl needs to be created with the html5 option set to true.
Describe the bug Chrome and other browsers now ship with a feature to control media directly from the browser using the media session API: https://developer.mozilla.org/en-US/docs/Web/API/Media_Session_API https://techcrunch.com/2020/01/16/chrome-gets-global-media-controls
Problem: when using the Chrome media controls, the playback events like play, pause, ... are not triggered, ie isPlaying is not updated, resulting in an out of sync UI.
To Reproduce Steps to reproduce the behavior:
Expected behavior The useAudioPlayer() state reflects the state of the audio playback.
Environment (please complete the following information):
Related issue: https://github.com/goldfire/howler.js/issues/1262