How can I achieve this? [closed]

-6

What happens is that I create a site where I show videos or music, and I want to show video or audio information in the notification bar, something like this

I would like to show the video image and video information that, just like youtube does.

What tags or javascript code is needed.

On Google I found this, I do not know what it's for:

<card type="TYPE_WEBSITE">
<action target="/" title="Title" type="TYPE_EXTERNAL"/>
<placement hide_in_drawer="true" show_in_cta="true"/>
<website_card headline="..." description="description">
<icon image_url="urlImage"/>
</website_card>
</card>
    
asked by Eddy Otsutsuki 15.08.2017 в 00:40
source

1 answer

1

Thanks to the api MediaMetadata of javascript I could solve it. Here is the API documentation

if ('mediaSession' in navigator){
navigator.mediaSession.metadata = new MediaMetadata({
title: "Podcast Episode Title",
artist: "Podcast Host",
album: "Podcast Name",
artwork: [{src: "podcast.jpg"}]
});
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() {}); }
    
answered by 15.08.2017 / 01:44
source