Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

129
Views
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 browser extension. Is there an event or other way to be notified when the metadata is updated? Currently, I'm using polling, but I'd rather do it the right way if there is such an event or method to watch for new metadata.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Maybe something like this.

const obj = {};
Object.defineProperty(obj, 'title', {
    set(newValue) {
        console.log('new value for title: ', newValue);
        this.value = newValue;
        navigator.mediaSession.metadata.title = newValue;
    }
});

obj.title = 'Some tune';
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!