Skip to content

Instantly share code, notes, and snippets.

@thangman22
Created February 11, 2017 12:51
Show Gist options
  • Save thangman22/a2f72017f104b539c96ad989bdd030a7 to your computer and use it in GitHub Desktop.
Save thangman22/a2f72017f104b539c96ad989bdd030a7 to your computer and use it in GitHub Desktop.
if ('mediaSession' in navigator) {
navigator.mediaSession.metadata = new MediaMetadata({
title: 'Big buck bunny',
artist: 'Sacha Goedegebure',
album: 'Big buck bunny',
artwork: [
{ src: 'bbb-splash.png', sizes: '512x512', type: 'image/png' },
]
});
navigator.mediaSession.setActionHandler('play', function() {
});
navigator.mediaSession.setActionHandler('pause', function() {});
navigator.mediaSession.setActionHandler('seekbackward', function() {});
navigator.mediaSession.setActionHandler('seekforward', function() {});
navigator.mediaSession.setActionHandler('previoustrack', function() {});
navigator.mediaSession.setActionHandler('nexttrack', function() {});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment