diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b405c49..640717cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Subtitles no longer stop displaying after shrinking the video to picture-in-picture and restoring it + ## [0.47.0] - 2026-06-18 ### Added diff --git a/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs b/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs index d01fbdf6..745b4a52 100644 --- a/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs +++ b/playlet-lib/src/components/VideoPlayerDev/VideoPlayerDev.bs @@ -937,6 +937,8 @@ function OnFullScreenChange() as void LogDebug("fullscreen ->", fullscreen) ' the SponsorBlock notification rides with the player: hidden while minimized, shown when full. m.sponsorblock.SetVisible(fullscreen) + ' after a PiP restore the OS leaves captions blank while enableUI=false (resizing alone doesn't); suppress on minimize, release on restore to re-engage them. + m.top.suppressCaptions = not fullscreen ' minimized: no player UI at all. Reset any active transport (the bif/glyph clear; the underlying play/pause ' stays as-is) and hide chrome/spinner/pause now. Fires for the minimize button, external minimize, and a ' video that starts minimized. diff --git a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.bs b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.bs index bb62b6c8..40c4272b 100644 --- a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.bs +++ b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.bs @@ -179,6 +179,7 @@ function TestSnapshot() as object autoplay: m.top.autoplayAfterSeek bifVisible: m.bifDisplay.visible chromeShown: (m.chromeMode = ChromeMode.Shown or m.chromeMode = ChromeMode.FadingIn) + suppressCaptions: m.top.suppressCaptions focusTarget: m.focusTarget focusedButton: m.focusedButton nudgeCount: m.top.nudgeCount diff --git a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.xml b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.xml index ca32428d..c264c7b3 100644 --- a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.xml +++ b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevMock.xml @@ -17,6 +17,7 @@ + diff --git a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevSeam.spec.bs b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevSeam.spec.bs index 82f30128..e523ecc3 100644 --- a/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevSeam.spec.bs +++ b/playlet-lib/src/components/VideoPlayerDev/tests/VideoPlayerDevSeam.spec.bs @@ -373,6 +373,19 @@ namespace Tests end for end function + ' PiP captions (regression: subtitles stopped after shrink->grow). With enableUI=false the OS leaves + ' captions blank after a PiP restore; minimize must suppress and restore must release — the + ' suppress->release refresh re-engages OS caption rendering. + @it("PiP minimize suppresses captions; restore releases them") + function _() + container = m.top.container + m.assertFalse(m.Snap().suppressCaptions, "captions shown while fullscreen") + container.fullscreen = false + m.assertTrue(m.Snap().suppressCaptions, "captions suppressed while minimized") + container.fullscreen = true + m.assertFalse(m.Snap().suppressCaptions, "captions released on restore") + end function + ' The PiP-toggle-after-close crash (captured on device): OnClose drops m.sponsorblock, so a leaked ' container observer makes the next fullscreen flip crash OnFullScreenChange (&hf3 on SetVisible). The ' fix is unobserve-on-close + the onCloseCalled guard; a regression CRASHES this test. Kept LAST in the