Repository navigation
v1.6.4 — shared players, pause without a view, PiP fixes, Android surface over the app
Fixes for shared players, pausing a player whose view is gone, Picture-in-Picture, and an Android video that kept drawing over the app after scrolling away. The Dart API is unchanged.
Behavior change: controllers with the same id share one native player. Disposing one of them no longer pauses or releases the player while another one still uses it, so the video on the other screen keeps playing.
Fixed
- The same video on two screens keeps playing when one of them closes.
Controllers with the sameidshare one native player. Disposing one of
them paused and released that player, so the other screen's video stopped
or went black. The player is now left to the remaining controller, and the
last controller with the ID releases it. pause()reaches the player when its view is gone. The native player
keeps playing without a view: the engine disposes a platform view before
the widget'sdispose()runs, and an app may keep a controller after its
view is unmounted. The pause failed withNO_VIEWand the audio played on.
It now pauses the controller's player by its ID, and the controller
reportspaused.- Android: a playing video that scrolled out of view no longer draws over
the app. Flutter hides a hybrid-composition platform view that left the
viewport, but the video'sSurfaceViewdoes not follow its parents'
visibility, so it kept showing the video at its last position, for
example over a bottom navigation bar. The surface is now hidden with its
view, and shown again (playing or on the paused frame) when the view
returns. - Android: expanding the Picture-in-Picture window back into the app no
longer pauses the video. The app staysinactiveuntil its window
regains focus, which on some devices only happens on the next touch; the
plugin waited forresumedand paused when it did not arrive. It now only
pauses when the PiP window was really closed (the app went to the
background). - iOS:
enterPictureInPicture()reports whether PiP really started. It
answeredtrueas soon as it asked AVKit, so a start that AVKit refused
read as success. It now waits for AVKit's answer and fails with
PIP_FAILEDand AVKit's reason. A failed start no longer leaves the
player's own PiP and automatic PiP switched off. - iOS: control listeners get each PiP change once.
pipStartedand
pipStoppedarrived twice (on the view's channel and the controller's),
and a view that attached sent apipStoppedalthough nothing changed.