StreamCallContainer.pictureInPictureConfiguration is silently ignored when callContentWidgetBuilder is set

Open
#1,661 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
android, dart, flutter, ios

Research direction

Start by reading StreamCallContainer._buildCallContent and the StreamCallContent implementation, where the issue says the PiP configuration is currently passed only to the default content. Trace how the iOS and Android PiP views are added to the content stack and check the relevant widget tests. Done means custom content honors the container configuration, or the unsupported combination is clearly warned about and documented.

Written by the indexing model from the issue text.

Description

Version: stream_video_flutter 1.6.0 (same code in 1.7.2)

What happens

StreamCallContainer accepts pictureInPictureConfiguration, but _buildCallContent only passes it to the default StreamCallContent:

Widget _buildCallContent() {
  return widget.callContentWidgetBuilder?.call(context, call) ??
      StreamCallContent(
        call: call,
        onBackPressed: widget.onBackPressed,
        onLeaveCallTap: widget.onLeaveCallTap,
        pictureInPictureConfiguration: widget.pictureInPictureConfiguration,
      );
}

When an app supplies callContentWidgetBuilder, the container's PiP setting goes nowhere, so picture-in-picture is off on both iOS and Android. Nothing warns about it, and the field's doc ("Configuration for picture-in-picture mode.") doesn't say it applies only to the default content.

Why it's surprising

Enabling PiP on the container reads as a call-level setting: "this call may go into picture-in-picture". The PiP machinery doesn't depend on how the content is drawn. StreamPictureInPictureUiKitView (iOS) and StreamPictureInPictureAndroidView (Android) are placed next to the participants in StreamCallContent's stack, so the container could place them next to custom content the same way.

Steps to reproduce
  1. Build a call screen with:
    StreamCallContainer(
      call: call,
      pictureInPictureConfiguration: const PictureInPictureConfiguration(
        enablePictureInPicture: true,
      ),
      callContentWidgetBuilder: (context, call) => StreamCallContent(call: call),
    )
    
  2. Join the call and put the app in the background.
  3. No PiP window appears.

Passing the same pictureInPictureConfiguration to the inner StreamCallContent makes PiP work, which confirms the container's setting is the one being dropped.

Expected
Expected

Either of these would prevent the trap:

  • The container honours its PiP setting no matter what content is used, for example by adding the PiP views around the custom content.
  • At minimum, a debug assert. StreamCallContainer's constructor is const, so the check can't go in its initializer list, but the State can run it in initState and didUpdateWidget:
    assert(
      widget.callContentWidgetBuilder == null ||
          !widget.pictureInPictureConfiguration.enablePictureInPicture,
      'pictureInPictureConfiguration has no effect when callContentWidgetBuilder '
      'is set. Pass it to the StreamCallContent you build instead.',
    );
    
    If an assert is too strict for existing apps, a debug-mode warning plus a doc note on the field would do.
Dominant language
Dart
Stars
79
Forks
55
Avg merge
2d 12h
Merged PRs (30d)
142

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GetStream/stream-video-flutter

All issues in GetStream/stream-video-flutter

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.