Created
February 11, 2017 12:51
-
-
Save thangman22/a2f72017f104b539c96ad989bdd030a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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