Skip to content

Commit

Permalink
Use createMediaMetadataPayload()
Browse files Browse the repository at this point in the history
  • Loading branch information
rtshkmr committed Aug 1, 2024
1 parent 15d2d62 commit 91106e5
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions assets/js/hooks/audio_player.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,21 @@ AudioPlayer = {
console.log("new metadata payload", {playback, payload})
// navigator.mediaSession.metadata = new MediaMetadata(payload)

navigator.mediaSession.metadata = new MediaMetadata({
"title": "Hanuman Chalisa",
"album": "Shree Hanuman Chalisa - Hanuman Ashtak",
artwork: playback?.meta?.artwork,
// "artwork": [
// {
// "type": "image/jpeg",
// "src": "https://i.ytimg.com/vi/AETFvQonfV8/hqdefault.jpg",
// "sizes": "480x360"
// }
// ],
"artist": "Hariharan, Gulshan Kumar",
"extraKey": "foo"
});
navigator.mediaSession.metadata = new MediaMetadata(payload)
// navigator.mediaSession.metadata = new MediaMetadata({
// "title": "Hanuman Chalisa",
// "album": "Shree Hanuman Chalisa - Hanuman Ashtak",
// artwork: playback?.meta?.artwork,
// // "artwork": [
// // {
// // "type": "image/jpeg",
// // "src": "https://i.ytimg.com/vi/AETFvQonfV8/hqdefault.jpg",
// // "sizes": "480x360"
// // }
// // ],
// "artist": "Hariharan, Gulshan Kumar",
// "extraKey": "foo"
// });

// TODO: register action handlers
},
Expand Down

0 comments on commit 91106e5

Please sign in to comment.