Files
shaka-player/lib/text
Karim Laham 27ed71e791 feat(UITextDisplayer): add suspendRenderingWhenHidden config (#10043)
Closes #10042

Adds a `textDisplayer.suspendRenderingWhenHidden` config flag that gates
the IntersectionObserver-based render suspension introduced in #9545.

- Defaults to `true` (existing behavior preserved for browsers/desktop).
- Defaults to `false` on TV devices (detected via
`shaka.device.DeviceFactory.getDevice().getDeviceType() ===
DeviceType.TV`).

Some TV browsers (e.g. older Tizen WebKit) misreport
`IntersectionObserver` visibility for transformed/absolute-positioned
player containers, leading to permanently suspended caption rendering.
Disabling suspension on TVs sidesteps the platform bug at the cost of
running one DOM update per `captionsUpdatePeriod` (default 0.25s) while
the player is off-screen.

Externs updated at `externs/shaka/player.js`. When the flag is `false`,
`applyVisibility_` short-circuits to "always visible" so the IO observer
can never suspend rendering.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2026-05-06 08:51:25 +02:00
..