Repository navigation
Conversation
👋 Hi Rene, still cooking? 🍳I'm Jeffery, Stream's review agent. I look for bugs, regressions, missing tests and slow paths, and I only post findings I've checked against the code. 📝 This PR is a draft, so I'll keep my hands off for now. Mark it Ready for review and a ✅ box to start my review shows up right here. Can't wait? Comment |
On Android, the HLS branch of the livestream UI hosts the picture-in-picture view with the HLS video as the window's content. `StreamHlsVideoRenderer` reports its video size under an HLS id, which the view uses on HLS, so the window takes the stream's shape and animates in from where it is drawn. On iOS, `StreamHlsVideoRenderer(enablePictureInPicture: true)`, which the livestream UI passes from its picture-in-picture configuration, adds a player layer on the same AVPlayer to the key window and starts an AVPictureInPictureController from it when the app goes to the background. iOS simulators do not support picture in picture, so this is not verified yet; the example's test skips there. `package:stream_video_flutter/hls.dart` exports what stream_video_hls needs for this. Picture in picture on web waits for the web work in #1763. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Count the renderers that ask for picture in picture, and withdraw a renderer's request when it is disposed, so the window no longer opens for a player no screen shows, and two renderers on one player share it. - Set picture in picture up once a window becomes key when there is none yet, instead of dropping the request. - Answer `pip_unsupported` on a device without picture in picture, which the renderer logs, and log a window that fails to start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
renefloor
force-pushed
the
feat/hls-pip
branch
from
December 6, 2026 10:58
3147c75 to
28c5d1b
Compare
renefloor
force-pushed
the
feat/hls-ui
branch
from
December 6, 2026 10:58
3db4844 to
00b781f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Goal
Step 8 of HLS_PLAN.md (FLU-1266): picture in picture for HLS livestreams on Android and iOS. Web PiP waits until it can line up with #1763. Stacked on #1795.
🛠 Implementation details
LivestreamHlsContenthostsStreamPictureInPictureAndroidViewand uses the HLS video builder as the window's content. An app's owncallPictureInPictureWidgetBuilderstill takes precedence.StreamHlsVideoRendererreports its video size toRenderedVideoSizesunderhlsVideoTrackId(callCid), and the PiP view uses that id on HLS. The window takes the stream's shape and animates in from where the video is drawn.package:stream_video_flutter/hls.dartexports both forstream_video_hls.LivestreamHlsVideoProperties.enablePictureInPictureis passed toStreamHlsVideoRenderer(enablePictureInPicture:), which callssetPictureInPictureEnabledover the channel.AVPlayerLayeron the sameAVPlayerto the key window at 1 pt, since the controller needs a layer in the window hierarchy.AVPictureInPictureControllerwithrequiresLinearPlayback, set to start automatically from inline playback.pip_unsupportedon devices without PiP and logs a start that fails.audiobackground mode.🧪 Testing
isPictureInPictureSupported() == false(checked on the iPhone Duo and iPhone 17 Pro simulators), so the example's PiP test skips there. It needs a check on a physical device: play, then background the app.🤖 Generated with Claude Code