搜尋套件、儲存庫與 APP 分類

套件詳情v1.3.3

flutter_video_info

一個 Flutter 外掛,用於取得影片檔案的基本元資料資訊。

AndroidiOS
近 30 天下載
1.7萬
喜歡數
73
Pub 分數
150

安裝套件

flutter pub add flutter_video_info

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

flutter_video_info 是一個 Flutter 插件,可從 Android 和 iOS 裝置上的影片檔案中提取基本的元資料。它提供持續時間、解析度、影格速率和檔案大小等基本資訊,無需外部相依性。此插件輕量且專為需要快速存取影片屬性的媒體應用而設計。它與 Flutter 生態系統無縫整合,並透過原生程式碼橋接支援兩個平台。非常適合開發影片播放器、媒體圖書館或內容管理工具的開發者。

適用情境

  • 提取影片時長以用於播放控制
  • 在媒體預覽中顯示影片解析度
  • 下載前檢查檔案大小
  • 在處理前驗證影片格式
  • 建構媒體庫元數據顯示

主要特色

  • 支援 Android 和 iOS
  • 獲取持續時間、解析度、幀速率和大小
  • 輕便且快速
  • 無外部依賴
  • 用於元數據提取的簡單 API

適合對象

  • 媒體播放器應用
  • 影片上傳格式化
  • 內容管理系統
  • 媒體庫介面
  • 跨平台視頻工具

使用建議

  • 需要平台特定的檔案存取權限
  • 僅限基本元數據(無音頻詳細資訊)
  • 不支援串流URL
  • 元數據準確性取決於來源檔案的完整性
  • 可能無法與加密或損壞的影片檔案一起使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

pub package pub package

flutter_video_info 1.3.3

This plugin uses MediaMetadataRetriever class of native android to get basic meta information of a video file.

The following info can be extracted by this plugin:

title path author mimetype height width filesize duration orientation date framerate location

Installation & Uses

Add flutter_video_info as a dependency in your pubspec.yaml file (what?).

dependencies:
    flutter_video_info: <current version>

Import FlutterVideoInfo in your dart file.

import 'package:flutter_video_info/flutter_video_info.dart';

final videoInfo = FlutterVideoInfo();

String videoFilePath = "your_video_file_path";
var info = await videoInfo.getVideoInfo(videoFilePath);

//String title = info.title;   to get title of video
//similarly path,author,mimetype,height,width,filesize,duration,orientation,date,framerate,location can be extracted.

for iOS

If you select a video from your photo library, Add the following keys to your Info.plist file, located in /ios/Runner/Info.plist:

NSPhotoLibraryUsageDescription - describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor.

Troubleshooting

Checkout here

PR is welcomed

Anyone can pr for these issues

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案