패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.7.5

flutter_in_app_pip

Flutter 애플리케이션에서 인앱 피피를 쉽게 구현할 수 있는 Flutter 패키지입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2.6천
좋아요
62
Pub 점수
160

패키지 설치

flutter pub add flutter_in_app_pip

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flutter 앱 내에서 피처 인 피처(PiP) 모드를 구현하는 것을 간편하게 만들어주는 플러터 패키지입니다. 사용자는 앱의 다른 부분을 탐색하거나 다른 앱으로 전환해도 작은 부유형 창에서 동영상 콘텐츠를 계속 시청할 수 있습니다. 이 패키지는 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스 등 여러 플랫폼을 지원하며 기기 간에 일관된 PiP 경험을 제공합니다. 비디오 플레이어, 라이브 스트리밍, 비디오 회의 도구와 같은 미디어 중심 앱에 적합합니다.

사용 사례

  • 백그라운드에서의 비디오 재생
  • PiP로 라이브 스트리밍
  • 비디오 회의 앱
  • 다중 작업이 필요한 미디어 앱
  • 비디오 콘텐츠를 갖춘 교육 앱

주요 기능

  • 크로스 플랫폼 피피 지원
  • 간단한 API 통합
  • 부유형 비디오 창
  • 자동 피피 상태 관리
  • Android, iOS, Web, macOS, Windows 및 Linux를 지원

적합한 대상

  • 미디어 애플리케이션 개발자
  • 비디오 스트리밍 플랫폼
  • 인터랙티브 학습 앱
  • 백그라운드 비디오 재생이 필요한 앱
  • 다중 플랫폼을 대상으로 하는 개발자

고려 사항

  • 플랫폼별 권한이 필요합니다
  • 일부 웹 브라우저에서 PiP 기능이 제한됨
  • iOS PiP는 추가 구성이 필요할 수 있습니다
  • 모든 기기가 PiP 모드를 지원하는 것은 아닙니다
  • 웹 피피 지원은 브라우저에 따라 다릅니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

In App PiP for Flutter

A Flutter Package to help easily implement in-app PiP(Picture in Picture) in a flutter application. Written completely in dart.

Features

  • Easily Implement PiP(Picture in Picture) in app.

  • Navigatable PiP Widget which allows navigation inside the PiP Window.

  • Automatically Handle showing different widgets in the original view when in pip and when not in pip.

  • Provides the ability to update the size of the pip widget later after starting pip.

  • Provides the ability to set the borders to which pip can be dragged.

  • Provides the ability to make the window resizable(pinch-in/out).

  • Provides the ability to make the window non-movable.

  • Provides the ability to set the initial corner of the PIP window.

  • Provides the ability to set minimum and maximum size of the PIP window, if resizable.

Getting started

  • Import the package.

  • Replace your MaterialApp with PiPMaterialApp (If using MaterialApp.router, you can replace it with PiPMaterialApp.router).

  • Optionally provide the pip parameters. These correspond to various parameters such as height and width of your pip widget.

Usage

After replacing your MaterialApp with PiPMaterialApp, use

 PictureInPicture.startPiP(pipWidget: MyPiPWidget());

to start PiP view in your app.

When you wish to stop PiP, use

PictureInPicture.stopPiP();

Use PiPWidget for additional functionalities like handling events on close of pip e.g.

PictureInPicture.startPiP(
    pipWidget:PiPWidget(
      child: ChildWidget(),
      onPiPClose: (){
      //Handle closing events e.g. dispose controllers.
      
      },
      elevation: 10,        //Optional
      pipBorderRadius: 10,  //Optional
      )
);

Use NavigatablePiPWidget for Navigation inside the PiP Window e.g.

PictureInPicture.startPiP(
    pipWidget:NavigatablePiPWidget(
      child: ChildWidget(),
      onPiPClose: (){
      //Handle closing events e.g. dispose controllers.
      
      },
      elevation: 10,        //Optional
      pipBorderRadius: 10,  //Optional
      )
);

Additionally, you can also use PiPCapableWidget to handle the view changes in case of PiP start and stop e.g.

PiPCapableWidget(
    whileNotInPip: ChildToShowWhileNotInPiP(),
    whileInPip: ChildToShowWhileInPiP(),      //Optional
);

Update the parameters of the pip view like below:

PictureInPicture.updatePiPParams(
                    pipParams: PiPParams(
                        pipWindowHeight: 144,
                        pipWindowWidth: 256,
                        bottomSpace: 64,
                        leftSpace: 64,
                        rightSpace: 64,
                        topSpace: 64,
                        maxSize: Size(256, 144),
                        minSize: Size(144, 108),
                        movable: true,
                        resizable: false,
                        initialCorner: PIPViewCorner.bottomRight,
                        ),
                  );

Note

That's it. Enjoy! Also, this package is 100% compatible with my other flutter plugin android_pip

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트