搜尋套件、儲存庫與 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

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。