Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

130
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda