How do I have audio file not display URL or Page Title on Android notification bar?

43 Views Asked by At

I have a site that has a list of audio files and I use the audio tag to display them on my site Example:

<audio controls style="width: 100%;">
 <source src="../audio/9am/message/9am.02.11.24_josh24.19-20.mp3" type="audio/mp3">
 <a href="../audio/9am/9am_12_11_22_josh15_42-47.mp3">
 <source src="../audio/9am/9am_12_18_22_josh15_48-60.mp3" type="audio/mp3">
 </a></audio>

And then below that I have a text link to play another audio file

Example

<a href="../audio/9am/offertory/9am.02.11.24_offertory.mp3" title="Offertory">OFFERTORY</a>

But when you click the audio tag one, it displays the page title name in the notification bar of an android and the text link displays the url.

Audio Tag Picture

URL Picture

Is there a way to customize each one to display a title I assign it?

1

There are 1 best solutions below

0
chrisguttandin On

I think you're looking for the Media Session API. It can for example be used to set the title of the currently playing media.

navigator.mediaSession.metadata = new MediaMetadata({ title: 'My title' });