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

227
Vistas
Is it possible to create a browser based html/javascript audio player, that handles most of the MPRIS commands?

I am trying to create a music player, that can handle most of the MPRIS commands.

During youtube is playing, playerctl list the firefox player (firefox.instance{id}), and if it has playlist then I can skip to previous / next item using $ playerctl -p firefox.instance{id} next. This works in chrome too.

I want to implement the same behavior in a React.js application, but first I'm looking for a html/javascript based solution.

One of my guesses that this is impossible (without using a browser add-on), because firefox implements this manually for each supported website.

Maybe I did something wrong, but no matter what I search for I couldn't find any information about this.

Thanks for reading / commenting!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Media Session API seems to solve this problem pretty well: https://developer.mozilla.org/en-US/docs/Web/API/Media_Session_API

This event listener runs every time $ playerctl -p firefox.instance{id} next is run (or when any other MPRIS client calls 'next', like KDE connect on android):

  navigator.mediaSession.setActionHandler('previoustrack', function() { /* Code excerpted. */ });

It even works in chrome (except the skipad event). More information can be found on the MDN Web Docs 'Media Session API' page I linked above.

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