collab-project / videojs-wavesurfer

video.js plugin that adds a navigable waveform for audio and video files
https://collab-project.github.io/videojs-wavesurfer
MIT License
363 stars 54 forks source link

Support for Media Session API #25

Open thijstriemstra opened 7 years ago

thijstriemstra commented 7 years ago

With the Media Session API, you can now customize media notifications by providing metadata for the media your web app is playing. It also allows you to handle media related events such as seeking or track changing which may come from notifications or media keys.

I basically want to be able to control a videojs-wavesurfer instance from the notification area of my android phone.

See https://developers.google.com/web/updates/2017/02/media-session

Screenshot

thijstriemstra commented 7 years ago

wavesurfer.js has a media session plugin since 1.3.4 but unfortunately it only works with the MediaElement backend which is incompatible with this plugin. It should work with the regular webaudio backend as soon as browsers add support for media session + webaudio.

From docs:

As the Web Audio API doesn't request Android Audio Focus for historical reasons, the only way to make it work with the Media Session API is to hook up an

Also see https://wicg.github.io/audio-focus/explainer.html