mpv_audio_kit 0.7.0
mpv_audio_kit: ^0.7.0 copied to clipboard
Dart audio player built on mpv v0.41.0, with audio filters, equalizer, visualizer and waveform. For Android, iOS, macOS, Windows, Linux, web, Android TV, tvOS, Tizen and webOS.
// Minimal mpv_audio_kit example
import 'package:flutter/widgets.dart';
import 'package:mpv_audio_kit/mpv_audio_kit.dart';
Future<void> main() async {
// The media session talks to the OS through a platform channel, which
// needs the Flutter binding.
WidgetsFlutterBinding.ensureInitialized();
// Registers the native libmpv backend. Call once before any Player.
MpvAudioKit.ensureInitialized();
// Initiate the player.
final player = Player();
// Publish to the OS media session.
await player.setMediaSession(const MediaSession());
// Open and play.
await player.open(const Media('https://example.com/song.mp3'));
await player.play();
// Call dispose() when you're done with the player for good.
// await player.dispose();
}