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

패키지 상세v0.0.1+2

pip_plugin

모든 플랫폼에서 피처인피처 모드에서 사용자 정의 텍스트 오버레이를 표시하는 Flutter 플러그인입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
6
좋아요
21
Pub 점수
130

패키지 설치

flutter pub add pip_plugin

패키지 개요

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

pip_plugin은 Android, iOS, Web, macOS, Windows, Linux에서 피처 인 피처(PiP) 모드 내에서 사용자 정의 텍스트 오버레이를 표시할 수 있는 Flutter 패키지입니다. 주석, 타이머 또는 상태 표시기와 같은 용도로 유용한 PiP 창 위에 부유하는 텍스트 레이어를 일관된 API로 표시합니다. Flutter의 플랫폼 독립 아키텍처와 원활하게 통합되며 동적 콘텐츠 업데이트를 지원합니다. 비디오 재생 또는 멀티태스킹 시나리오 중 지속적인 시각적 피드백이 필요한 앱을 위해 설계되었습니다.

사용 사례

  • 화면 레이블이 있는 실시간 비디오 스트리밍
  • 실시간 주석이 있는 교육용 앱
  • 참가자 상태 오버레이가 있는 비디오 회의
  • 지속적인 UI 힌트가 필요한 멀티태스킹 앱
  • 안내 지침이 포함된 인터랙티브 튜토리얼

주요 기능

  • 크로스 플랫폼 PiP 텍스트 오버레이
  • 사용자 정의 텍스트 스타일 및 위치
  • 재시작 없이 동적 콘텐츠 업데이트
  • 모든 주요 데스크톱 및 모바일 플랫폼을 지원합니다
  • Flutter pub를 통한 간단한 통합
  • 실시간 오버레이 렌더링

적합한 대상

  • 미디어가 풍부한 Flutter 앱을 개발하는 개발자
  • PiP에서 지속적인 화면 정보가 필요한 앱
  • 교육 또는 훈련 응용 프로그램
  • 스트리밍 또는 라이브 이벤트 플랫폼
  • 다중 창 또는 멀티태스킹 인터페이스

고려 사항

  • 대상 플랫폼에서 PiP 모드 지원이 필요합니다
  • 다양한 화면 크기에서 텍스트의 가시성은 달라질 수 있습니다
  • 자주 업데이트할 때의 성능 영향
  • 텍스트만 오버레이 가능 (이미지나 복잡한 위젯 불가)
  • 플랫폼별 PiP 동작은 레이아웃에 영향을 줄 수 있습니다

원본 README

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

pip_plugin

⚠️ Experimental
A Flutter plugin that enables a customizable Picture-in-Picture window displaying text.


Table of Contents


Introduction

pip_plugin is an experimental Flutter plugin that lets you display text overlays in Picture-in-Picture mode on Android, iOS, Web, and Desktop. It exposes a simple Dart API to configure the PiP window’s appearance and control its lifecycle.


Preview

ios macos web


Installation

Add the plugin to your pubspec:

dependencies:
  pip_plugin: ^<latest_version>

Then run:

flutter pub get

Platform-specific Setup

Android
  1. In your AndroidManifest.xml, enable PiP support:

    <application
        android:supportsPictureInPicture="true"
        …>
        …
    </application>
    
  2. Enable PiP callbacks there are two approaches:

1. Activity Wrapper (Recommended)

Wrap your main activity with the provided helper—this is the simplest integration.

  • Kotlin

    import cl.puntito.simple_pip_mode.PipCallbackHelperActivityWrapper
    
    class MainActivity: PipCallbackHelperActivityWrapper() {
        // No additional code needed
    }
    
  • Java

    import cl.puntito.simple_pip_mode.PipCallbackHelperActivityWrapper;
    
    public class MainActivity extends PipCallbackHelperActivityWrapper {
        // No additional code needed
    }
    

Once inherited, PiP callbacks and the PiP widget become available automatically.

2. Callback Helper

If you prefer not to subclass your activity, you can manually wire up the callbacks:

  • Kotlin

    import cl.puntito.simple_pip_mode.PipCallbackHelper
    import io.flutter.embedding.engine.FlutterEngine
    import io.flutter.embedding.android.FlutterActivity
    import android.content.res.Configuration
    
    class MainActivity: FlutterActivity() {
      private val pipHelper = PipCallbackHelper()
    
      override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
        super.configureFlutterEngine(flutterEngine)
        pipHelper.configureFlutterEngine(flutterEngine)
      }
    
      override fun onPictureInPictureModeChanged(
        isInPipMode: Boolean,
        newConfig: Configuration?
      ) {
        super.onPictureInPictureModeChanged(isInPipMode, newConfig)
        pipHelper.onPictureInPictureModeChanged(isInPipMode)
      }
    }
    
  • Java

    import cl.puntito.simple_pip_mode.PipCallbackHelper;
    import io.flutter.embedding.engine.FlutterEngine;
    import io.flutter.embedding.android.FlutterActivity;
    import android.content.res.Configuration;
    
    public class MainActivity extends FlutterActivity {
        private final PipCallbackHelper pipHelper = new PipCallbackHelper();
    
        @Override
        public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
            super.configureFlutterEngine(flutterEngine);
            pipHelper.configureFlutterEngine(flutterEngine);
        }
    
        @Override
        public void onPictureInPictureModeChanged(
          boolean isInPipMode,
          Configuration newConfig
        ) {
            super.onPictureInPictureModeChanged(isInPipMode, newConfig);
            pipHelper.onPictureInPictureModeChanged(isInPipMode);
        }
    }
    

iOS

In your Info.plist, add PiP to the background modes:

<key>UIBackgroundModes</key>
<array>
  <string>audio</string>
  <string>airplay</string>
  <string>picture-in-picture</string>
</array>

Other Platforms
  • Web and Desktop: No extra configuration.

Usage

Plugin API

Import the main plugin class and manage PiP mode:
⚠️ Initialize first: call setupPip(...) before using other PiP methods.


/// Prepares PiP with an optional title and configuration.
Future<bool> setupPip({
  /// On desktop platforms, you can optionally set a `windowTitle`.
  String? windowTitle,
  PipConfiguration? configuration,
});

/// Enters Picture-in-Picture mode.
Future<bool> startPip();

/// Exits Picture-in-Picture mode.
/// (On Android this is a no-op, as PiP closes automatically.)
Future<bool> stopPip();

/// Returns whether PiP is supported on the current platform.
Future<bool> isPipSupported();

/// Dynamically updates the PiP window’s appearance:
/// - backgroundColor, textColor, textSize, textAlign, ratio
Future<bool> update({
  Color? backgroundColor,
  Color? textColor,
  double? textSize,
  /// Only `left`, `right`, and `center` are supported.
  TextAlign? textAlign,
  /// ignored on Web platforms.
  (int, int)? ratio,
});

/// Changes the displayed text in PiP.
Future<bool> updateText(String text);

/// Emits `true`/`false` whenever PiP becomes active/inactive.
Stream<bool> get pipActiveStream;

/// Whether the plugin has been initialized.
bool get isInitialized;

/// Releases any resources held by the plugin.
void dispose();

Showing Text in PiP
  • Android: Wrap your UI with the built-in TextPipWidget to render the PiP text overlay, then drive it with the plugin API.
  • All other platforms: No widget required—just invoke the PipPlugin methods directly.
Android Example
import 'package:flutter/material.dart';
import 'package:pip_plugin/pip_plugin.dart';
import 'package:pip_plugin/text_pip_widget.dart';

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final pip = PipPlugin();

  @override
  void initState() {
    super.initState();
    _initPlugin();
  }

  void _initPlugin() async {
    final supported = await pip.isPipSupported();
    if (supported) {
      await pip.setupPip();
      await pip.updateText('inside PiP');
    }
  }

  @override
  Widget build(BuildContext context) {
    return TextPipWidget(
      child: Scaffold(
        body: const Center(child: Text('outside PiP')),
        floatingActionButton: FloatingActionButton(
          onPressed: () async {
            await pip.startPip();            
          },
          child: const Icon(Icons.picture_in_picture),
        ),
      ),
    );
  }
}

Platform Support

Platform Minimum Version / Notes
Android API 26+
iOS iOS 15+ (for Simulator testing, use an iPad simulator)
Web Follows the Document Picture-in-Picture API.
Desktop All major versions (macOS, Windows, Linux)

카테고리

의존성

의존성 목록 3 개

소스 저장소

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

아직 데이터가 없습니다.