搜索插件、代码仓与 APP 分类

插件详情v1.1.0

flutter_vap

一个用于播放 alpha 视频动画的原生插件

AndroidiOS
近 30 天下载
66
喜欢数
11
Pub 分数
125

安装插件

flutter pub add flutter_vap

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

flutter_vap 是一个原生插件,可在 Flutter 应用中播放 alpha 视频动画。它允许开发者在 Android 和 iOS 平台上无缝集成透明或半透明视频内容,例如带有 alpha 通道的动画标志或 UI 元素。该插件利用原生功能实现高效渲染和流畅性能。特别适用于创建具有高质量动画视觉效果的丰富动态用户界面。

适合场景

  • 在应用界面中播放 alpha 通道视频
  • 创建动画启动画面
  • 通过透明动画增强游戏界面
  • 集成品牌动画资源
  • 为过渡添加细微的动态效果

主要特点

  • 支持透明度视频播放
  • Android 和 iOS 上的原生性能
  • 透明度下的平滑渲染
  • 通过 Flutter pub 实现轻松集成
  • 兼容标准视频格式

适合对象

  • 开发视觉丰富的 Flutter 应用的开发者
  • 实现动画UI组件的设计师
  • 需要透明视频叠加的 App
  • 游戏和娱乐应用
  • 品牌数字体验

使用建议

  • 需要原生平台设置才能实现完整功能
  • 仅限支持的视频编解码器
  • 由于原生依赖项,可能导致应用体积增大
  • 性能取决于设备硬件
  • Alpha 视频文件必须正确编码

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

中文文档

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

所属分类

源码仓库

使用此插件的项目

暂无相关数据。