Skip to content
Commit bd66295a authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Compress and reduce MediaSession updates

Websites typically set all their callbacks (play, pause, nexttrack, previoustrack, etc) in one go,
which would have us send them over from the content script to the extension and to the host, signalling
individual MPRIS property changes. Optimize this by batching subsequent calls.

Furthermore, check if playbackState and metadata actually changed before sending them over.
There's no point in sending the data over to the host which will then find they haven't changed.

The object behind the "mediaSessionsClassName" is turned into a "class" (not ES6 Class for Firefox ESR
compat) and an instance is created. This allows using "this" from within its handlers, cleaning
up the code somewhat.
parent 86276df3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment