Skip to content

feat(diagnostics): report QtWebEngine media codecs (#907) - #1028

Open
CookieCaptainD wants to merge 2 commits into
rafatosta:mainfrom
CookieCaptainD:feat/907-media-codec-diagnostics
Open

CookieCaptainD wants to merge 2 commits into
rafatosta:mainfrom
CookieCaptainD:feat/907-media-codec-diagnostics

Conversation

@CookieCaptainD

@CookieCaptainD CookieCaptainD commented Nov 13, 2026 •

Copy link
Copy Markdown

Relates to #907.

Summary

  • Codec evidence at runtime. A read-only probe runs once per loaded page and asks HTMLMediaElement.canPlayType and MediaSource.isTypeSupported for H.264/AAC against a fixed allowlist. It reads no page content, media, network or storage, and changes no playback or flags. The result appears as media_codecs in the runtime diagnostics, the manual problem report and its Markdown preview, with measured: false plus a reason until a page loads. The report notes the limit: advertised support does not prove that a specific file decodes.
  • Package documentation. The README explains that codec availability depends on the Qt WebEngine build: Flatpak and AppImage bundle one with H.264/AAC; Debian's python3-pyqt6.qtwebengine ships without proprietary codecs, so the .deb cannot play chat video or voice notes; RPM/COPR/Snap depend on the distribution build. It points to Settings → Report a problem → Runtime information and notes that ARM64 software decoding can stutter without missing codecs.
  • Global mute visibility. While global mute is active, a persistent notice above the account pages offers one explicit Unmute action, so silent videos and voice notes do not look like a codec failure. It follows the persisted state at startup and on every toggle, and unmutes explicitly instead of toggling a stale value. Translated for pt_BR, pt_PT, it and tr; this fills the missing Unmute entries in pt_BR/pt_PT/it.

Evidence for the aarch64/Flatpak half of the report

Verified on Asahi Fedora Remix 45 (aarch64), ZapZap Flatpak 7.5.1, Qt WebEngine 6.11.2, KDE Plasma/Wayland:

  • canPlayType for H.264 and AAC → probably; MediaSource.isTypeSupported → true for both.
  • A 720p H.264 High + AAC sample played: 75 presented frames, AAC decoded, and a PulseAudio stream on the Asahi speaker chain.
  • The "video always without sound" symptom there came from the persisted global mute (system/audio_muted=true; the tray action read "Unmute").

The Debian .deb limitation reported in #907 is real and does not reproduce in the aarch64 Flatpak.

Testing

  • flatpak_python -m unittest discover -s tests -q: 802 tests, 22 failures and 4 errors. The same 22/4 fail on unmodified main in a separate worktree (zh_CN catalog, macOS packaging, dictionary UI, account context menu), so no new failures.
  • New: tests/test_media_codec_probe.py (12 tests, including a real WebEngine run) and two global-mute notice tests in test_global_mute.py.
  • tests/test_documentation_structure.py -v, tests/check_unused_code.py --packages-only, compileall, git diff --check.
  • msgfmt --check --check-format on the changed pt_BR, pt_PT, it and tr catalogs.
  • The probe and sample playback above ran inside the installed Flatpak sandbox on aarch64.

Not included

  • No startup dialog when codecs are missing: the data is already in Runtime information and in manual reports, and a dismissible dialog is a product decision. It would be an easy follow-up if wanted.
  • No Chromium flag or decoding changes.

Commits

  1. feat(diagnostics): report QtWebEngine media codec support
  2. feat(browser): surface the global mute above the account pages

Add MediaCodecProbe, a read-only probe that runs once per loaded page and
asks HTMLMediaElement.canPlayType plus MediaSource.isTypeSupported for
H.264/AAC. It keeps only a fixed allowlist, never reads page content,
media, network or storage, and never changes playback, flags or lifecycle.

Expose the result as media_codecs in the runtime diagnostics, the manual
problem report and its Markdown preview. Until a page loads, or when it is
gone, the block stays measured=false with an explicit reason instead of
inferring support. Document the evidence limit: advertised support does not
prove that a specific file decodes or renders.

Document package codec coverage: Flatpak and AppImage bundle a Qt WebEngine
with proprietary codecs, while Debian's build does not, so the .deb cannot
play chat videos or voice notes. Note that ARM64 Linux usually decodes in
software, so high-resolution playback may stutter without meaning a missing
codec (rafatosta#907).

Tests:
- flatpak_python tests/test_media_codec_probe.py -v (12 tests)
- flatpak_python -m unittest discover -s tests -q (802 tests; the 22
  failures and 4 errors are identical to the unmodified HEAD baseline,
  verified in a separate worktree)
- flatpak_python tests/test_documentation_structure.py -v
- flatpak_python tests/check_unused_code.py --packages-only
- flatpak_python -m compileall -q zapzap tests tools run.py
- git diff --check
- Probe executed inside the installed aarch64 Flatpak (Qt 6.11.2): H.264
  and AAC reported as "probably", MSE true, and a 720p H.264/AAC sample
  presented frames while creating a PulseAudio stream.
Show a persistent notice with one explicit "Unmute" action while the global
mute is active, so videos and voice messages playing silently are not
mistaken for a codec or playback failure. The state was previously visible
only as a toolbar, tray or floating-panel icon. The notice follows the
persisted state at startup and every toggle, and its action unmutes instead
of toggling a stale value.

Translate the notice for Brazilian Portuguese, European Portuguese, Italian
and Turkish, and fill the missing "Unmute" entries in the first three
catalogs.

Tests:
- flatpak_python tests/test_global_mute.py -v
- flatpak_python -m unittest discover -s tests -q (same 22 failures and 4
  errors as the unmodified HEAD baseline)
- msgfmt --check --check-format on pt_BR, pt_PT, it and tr
- Offscreen render of the muted window in pt_PT to confirm the notice text
  and the "Ativar som" action

This branch has not been deployed

No deployments
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