StreamCallContainer.pictureInPictureConfiguration is silently ignored when callContentWidgetBuilder is set

Abierto
#1,661 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
android, dart, flutter, ios

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Dart
Estrellas
79
Forks
55
Merge medio
2 d 12 h
PR fusionados (30 d)
142

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de GetStream/stream-video-flutter

Todos los issues de GetStream/stream-video-flutter

Issues similares

Más issues de Dart

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.