Skip to content

0.4.0: quality on the film sites that embed Playerjs - #7

Merged
kvachikk merged 2 commits into
mainfrom
feat/v0.4.0-playerjs-quality
Aug 8, 2026
Merged

kvachikk merged 2 commits into
mainfrom
feat/v0.4.0-playerjs-quality

Conversation

@kvachikk

@kvachikk kvachikk commented Aug 8, 2026

Copy link
Copy Markdown
Owner

What

Sites that embed Playerjs — a large part of what people actually watch on a phone — now offer their quality ladder in the settings sheet like any other player.

0.3.0 documented this as out of reach: Playerjs keeps its streaming engine inside a closure, so there is no hls.js instance to find. That was true about the engine and too strong about the player. Playerjs answers questions about itself:

  • api('qualities') → the rungs the site built, in the site's own words (480p, 720p, 1080p, Авто)
  • api('quality') → what is playing, as 1080p when pinned or Авто 720p when not
  • api('quality', label) → the same call its own menu makes

Both are reads and calls on an object the page already published. No code is injected, nothing is evaluated from a string, and the privacy check still passes with permissions exactly storage and activeTab.

Also

The rung the viewer picked is now remembered above the adapters instead of inside them. The ladder is looked up again every time the sheet opens, which builds a fresh adapter each time, so the memory was being thrown away — and a player given a rung goes back to reporting whatever its own auto drifted to, which made the chip fall back to Auto a few seconds after a choice. The YouTube adapter carried its own copy of the same workaround and no longer needs one.

Tested on the emulator

AOSP Android 16 / Firefox 153, via web-ext, on a real film page (uaserials.my → hdvbua.pro embed) and on m.youtube.com:

  • the row lists Авто · 1080p · 720p · 480p, auto first then best to worst
  • picking a rung switches the stream, playback continues, the player does not tear down
  • the chip stays on the choice after closing and reopening the sheet
  • the choice survives a page reload, because the site persists it
  • YouTube unchanged: full Auto … 144p ladder, 720p sticks after reopening

Checks

eslint + prettier + web-ext lint + privacy check (28 files, permissions allowlist) + 48 unit tests, all green.

Playerjs keeps the streaming engine it drives inside a closure, so there is
no hls.js instance to find the way there is elsewhere. What it does answer
is its own question: api('qualities') lists the rungs the site built and
api('quality', label) is the call its own menu makes. That is the whole
adapter, and it is what makes the row work on the run of film sites that
embed this player.

The rung the viewer picked is now remembered in one place, above the
adapters, because the ladder is looked up again every time the sheet opens
and a player that has been given a rung goes back to reporting whatever its
own auto has drifted to. The YouTube adapter kept its own copy of that for
the same reason; it no longer needs one.
0.3.0 said a player keeping its engine in a closure was out of reach. It is
out of reach through its engine; it is not out of reach through its own
answers, which is how the quality row now works there.
@kvachikk
kvachikk merged commit 43ec705 into main Aug 8, 2026
2 checks passed
@kvachikk
kvachikk deleted the feat/v0.4.0-playerjs-quality branch August 8, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant