StreamCallContainer.pictureInPictureConfiguration is silently ignored when callContentWidgetBuilder is set

オープン
#1,661 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
android, dart, flutter, ios

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Dart
スター
79
フォーク
55
平均マージ
2日 12時間
マージ済み PR(30日)
142

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

GetStream/stream-video-flutter のほかの issue

GetStream/stream-video-flutter の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。