antrancs / maeve

Maeve, a PWA Apple Music web player with Last.fm support. Built with Vue & Typescript
https://maevemusic.app/
GNU Affero General Public License v3.0
228 stars 25 forks source link

Added Next/Previous Track MediaKeys Support #47

Closed Barisukan closed 5 years ago

Barisukan commented 5 years ago

Adds support to the Next/Previous Track MediaKeys which allows the user to go to the next/previous song from their keyboard with ease.

antrancs commented 5 years ago

Hi, thanks for the PR, there are few errors in the build because mediaSession is not supported in all browsers so I made a few comments to fix them.

One more thing is TypeScript does not support mediaSession yet, so you get errors when accessing it. A quick workaround is to add the declaration in the shims-vue.d.ts file

interface Navigator { mediaSession: any; }

That way you get code completion when accessing mediaSession. 😃

Barisukan commented 5 years ago

Completely forgot that this runs on other browsers as well (was writing this using the chrome PWA, woops!) Went ahead and made the requested changes and it seemed to pass!

antrancs commented 5 years ago

Merged. Thanks 👍