Search packages, repositories and app categories

Package detailsv1.1.0

flutter_vap

Is a native plugin for playing alpha video animation

AndroidiOS
30-day downloads
66
Likes
11
Pub points
125

Install package

flutter pub add flutter_vap

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

flutter_vap is a native plugin that enables playback of alpha video animations in Flutter applications. It allows developers to seamlessly integrate transparent or semi-transparent video content, such as animated logos or UI elements with alpha channels, directly into their apps on both Android and iOS platforms. The plugin leverages native capabilities for efficient rendering and smooth performance. It's particularly useful for creating rich, dynamic user interfaces with high-quality animated visuals.

Use cases

  • Playing alpha channel videos in app UIs
  • Creating animated splash screens
  • Enhancing game interfaces with transparent animations
  • Integrating branded animated assets
  • Adding subtle motion effects to transitions

Key features

  • Supports alpha video playback
  • Native performance on Android and iOS
  • Smooth rendering with transparency
  • Easy integration via Flutter pub
  • Compatible with standard video formats

Suitable for

  • Developers building visually rich Flutter apps
  • Designers implementing animated UI components
  • Apps requiring transparent video overlays
  • Game and entertainment applications
  • Branded digital experiences

Considerations

  • Requires native platform setup for full functionality
  • Limited to supported video codecs
  • May increase app size due to native dependencies
  • Performance depends on device hardware
  • Alpha video files must be properly encoded

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

中文文档

Backdrop

Transparent video animation is currently one of the more popular implementations of animation. Major manufacturers have also open sourced their own frameworks. In the end, we chose Tencent vap, which supports Android, IOS, and Web, and provides natural convenience for us to encapsulate flutter_vap. Provides a tool to generate a video with an alpha channel from a frame picture, which is simply awesome.

VAP(Video Animation Player)is developed by Penguin E-sports and is used to play cool animations.

  • Compared with Webp and Apng animation solutions, it has the advantages of high compression rate (smaller material) and hardware decoding (faster decoding)
  • Compared with Lottie, it can achieve more complex animation effects (such as particle effects)
Preview

image

video for youtube

video for qiniu

apk download

Setup
flutter_vap: ${last_version}
How to use
import 'package:flutter_vap/flutter_vap.dart';

IgnorePointer(
  // VapView can set the width and height through the outer package Container() to limit the width and height of the pop-up video
  child: VapView(),
),
  1. Play local video
  import 'package:flutter_vap/flutter_vap.dart';

  /// return: play error:       {"status": "failure", "errorMsg": ""}
  ///         play complete:    {"status": "complete"}
  Future<Map<dynamic, dynamic>> _playFile(String path) async {
    if (path == null) {
      return null;
    }
    var res = await VapController.playPath(path);
    if (res["status"] == "failure") {
      showToast(res["errorMsg"]);
    }
    return res;
  }
  1. Play asset video
  Future<Map<dynamic, dynamic>> _playAsset(String asset) async {
    if (asset == null) {
      return null;
    }
    var res = await VapController.playAsset(asset);
    if (res["status"] == "failure") {
      showToast(res["errorMsg"]);
    }
    return res;
  }
  1. Stop play
  VapController.stop()
  1. Queue play
  _queuePlay() async {。
    // Simultaneously call playback in multiple places, making the queue perform playback.
    QueueUtil.get("vapQueue").addTask(() => VapController.playPath(downloadPathList[0]));
    QueueUtil.get("vapQueue").addTask(() => VapController.playPath(downloadPathList[1]));
  }
  1. Cancel queue playback
  QueueUtil.get("vapQueue").cancelTask();

Example

github

Categories

Source repository

Projects using this package

No data available yet.