パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.7.5

flutter_in_app_pip

Flutterアプリケーションでインアプリピップを簡単に実装するためのFlutterパッケージ。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2560
いいね数
62
Pub ポイント
160

パッケージをインストール

flutter pub add flutter_in_app_pip

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutterアプリケーション内でのピクチャインピクチャ(PiP)モードの実装を簡素化するFlutterパッケージです。ユーザーはアプリ内の他の部分をナビゲートしたり、別のアプリに切り替えたりしても、小さな浮きウィンドウで動画コンテンツを継続的に視聴できます。このパッケージはAndroid、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、デバイス間で一貫したPiP体験を提供します。動画プレイヤー、ライブストリーミング、ビデオ会議ツールなどのメディア重視アプリに最適です。

用途

  • バックグラウンドでの動画再生
  • PiPによるライブストリーミング
  • ビデオ会議アプリ
  • マルチタスクを必要とするメディアアプリ
  • 動画コンテンツを備えた教育アプリ

主な機能

  • クロスプラットフォームのピクチャインピクチャ対応
  • シンプルなAPI統合
  • 浮遊型ビデオウィンドウ
  • 自動ピップ状態管理
  • Android、iOS、Web、macOS、Windows、Linux をサポート

適している対象

  • メディアアプリケーション開発者
  • 動画ストリーミングプラットフォーム
  • インタラクティブな学習アプリ
  • バックグラウンド動画再生を必要とするアプリ
  • 複数のプラットフォームをターゲットにする開発者

注意事項

  • プラットフォーム固有の権限が必要です
  • 一部のウェブブラウザでのPiP動作が制限されています
  • iOS PiP には追加の構成が必要な場合があります
  • すべてのデバイスがPiPモードをサポートしているわけではありません
  • Web 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

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト