Skip to content

Playback events are not triggered by media session API #37

@humbkr

Description

@humbkr

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:

  1. Using Chrome, start playing an audio file via an html button
  2. Use the browser media controls to pause the playback
  3. The audio is paused but the isPlaying variable is not updated

Expected behavior
The useAudioPlayer() state reflects the state of the audio playback.

Environment (please complete the following information):

  • Browser/ browser version: Chrome
  • Library version: 0.0.18
  • React version: 16.3.1
  • Node version: 10.15.0

Related issue: goldfire/howler.js#1262

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions