Questions tagged [mediasession]

The Media Session API enables web developers to show customized media metadata and controls on platform UI, such as in notification areas and on lock screens of mobile devices.

The Media Session API enables web developers to show customized media metadata on platform UI, customize available platform media controls, and access platform media keys such as hardware keys found on keyboards, headsets, remote controls, and software keys found in notification areas and on lock screens of mobile devices.

This API was introduced in Chrome for Android 45 in the year 2015.

References:

53 questions
1
vote
1 answer

Get correct audio stream metadata(album, artist, song) from website to display over bluetooth

This is a bit out of my realm, so I'm hoping for some help. I'm trying to help a friend who has setup an audio stream(via StationPlayList) to play music, and then he as a fairly simple webpage where he broadcasts the stream through an
1
vote
1 answer

Android Wear media control not showing previous/next buttons

I'm developing a media player. Unfortunately I can't use the MediaBrowserService to better support devices connected over bluetooth. But at least I implemented the MediaSession class to broadcast playback information using the AVRCP protocol. When I…
JeCh
  • 980
  • 1
  • 7
  • 14
0
votes
0 answers

Media Session API "nextslide", "previousslide" - Chrome Android not showing controls

Chrome 111 introduced "nextslide" and "previousslide" as action handlers in the Media Session API. Their example (at https://googlechrome.github.io/samples/media-session/slides.html) shows try/catch blocks in Javascript for determining if the…
Daniel
  • 1
0
votes
0 answers

Playing video in an iframe overwrites MediaSession data

We are using the Javascript MediaSession API to set the Media Data: navigator.mediaSession.metadata = new MediaMetadata(opts); This works after playing a video. The cover art and title appear on the device's media UI. Now we have other content…
Zeus
  • 746
  • 4
  • 18
0
votes
0 answers

MediaSession.Callback onPrepareFromMediaId not triggered from android auto

I'm working on an Android project that uses MediaSession and it seems no matter what I do , MediaSession.Callback's onPrepareFromMediaId function is not triggered from the Android Auto. The onGetRoot and onLoadChildren from the media browser service…
0
votes
0 answers

Replace default MediaSession with custom MediaSession object on the website

The mechanism of manipulation with MediaSession described here. But when i try to use methods activate, disactivate or try to create new MediaSession object MediaSession.new() i have got an error - MediaSession have no method... How to replace…
Nikolai Nagornyi
  • 1,312
  • 2
  • 11
  • 26
0
votes
0 answers

macOS Now Playing widget with next \ previous buttons

I‘m currently working on Safari App Extension whitch control the playback of media content on the website. Is there a way to have macOS Now Playing widget with next \ previous buttons with fully configured MediaSession handlers? So. What i mean.…
0
votes
1 answer

Displaying media metadata using Exoplayer MediaSessionConnector using car media app

My media app using Exoplayer's mediasessionconnector to send the mediasession metadata to the Car media App. Car media app supposed to show the title, album and artist of the current track. But it just shows the title with album and artist left…
0
votes
1 answer

MediaSession.setPositionState() and seekto not working

MediaSession.setPositionState() not showing the audio time, also seekbar not showing as expected. const audio= document.querySelector('audio'); function updatePositionState() { if ('setPositionState' in navigator.mediaSession) { …
0
votes
0 answers

Javascript navigator.mediasession cover art not showing in navi

it's me again with my audio player. This is kinda a continuation of my previous question... (link here) Along with my question above, i've been tinkering with the song title/artist/thumbnail metadata, and I've succeeded with the title and artist.…
0
votes
1 answer

Web Audio Session API to trigger method calls in app rather than playing media

I'm having a hard time getting the Web Audio API to do what I want. My goal is to eventually trigger voice recognition in a PWA on mobile, but first I decided to do a test case of incrementing a counter whenever play or pause was pressed. I am using…
Joel Nash
  • 21
  • 1
  • 10
0
votes
1 answer

Event for MediaSession metadata update?

In the browser, we have the MediaSession API. A web page can show what media is playing with some simple code: navigator.mediaSession.metadata = new MediaMetadata({ title: 'Some Tune', artist: 'Somebody', album: 'An Album', }); I'm writing a…
Brad
  • 159,648
  • 54
  • 349
  • 530
0
votes
1 answer

Android MediasessionCompat callback function for physical media player button keeps crashing

I used the code from this link MediaSession onMediaButtonEvent works for a few seconds then quits - Android to capture the keyevents of the remote button and send it to the audio() function where the selection will be played by another…
Main Dsek
  • 1
  • 1
0
votes
1 answer

Notification setStyle not working in sdk30

MediaSessionCompat mediaSessionCompat = new MediaSessionCompat(ctx, "tag"); When I set .style(), notification is not output. Is there anything in the mediaSessionCompat that you need to do other than setting context and tag?
Juro
  • 73
  • 1
  • 7
0
votes
0 answers

MediaSession.SetMetadata doesn't work on bluetooth device

I am developing an application in Xamarin Android to play music in streaming. When setting the metadata, they are updated and displayed correctly in the mobile notification, but when I connect it to a device via bluetooth such as the car, the…