has_audio 0.0.2 copy "has_audio: ^0.0.2" to clipboard
has_audio: ^0.0.2 copied to clipboard

A Flutter plugin for checking if a video file contains an audio track. This plugin provides a simple method to quickly determine the presence of audio in a video file on both Android and iOS platforms.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:has_audio/has_audio.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool hasAudio = false;
  @override
  void initState() {
    super.initState();
    initPlatformState();
  }
  Future<void> initPlatformState() async {
    bool check;

      check = await HasAudio.check("path/to/video.mp4");

    if (!mounted) return;

    setState(() {
      hasAudio = check;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Check video has audio'),
        ),
        body: Center(
          child: Text('has audio: $hasAudio\n'),
        ),
      ),
    );
  }
}
4
likes
0
points
39
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for checking if a video file contains an audio track. This plugin provides a simple method to quickly determine the presence of audio in a video file on both Android and iOS platforms.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on has_audio