kplayer 0.1.16 kplayer: ^0.1.16 copied to clipboard
audio player that support all platforms.
kplayer #
Flutter player (currently only audio)
sopport #
- windows,linux -> dart_vlc
- web, ios, android, macos -> just_audio
this package is just wrapper for just_audio and dart_vlc to support all platformsthis packege is just wrapper forjust_audio
and dart_vlc
to support all platforms
Getting Started #
for specific platform configuration visit just_audio
and dart_vlc
main.dart
void main() {
Player.boot(); //add this line
runApp(MyApp());
}
Play from assets:
var player = Player.asset("/assets/sound.mp3")
player..play();
Play from network:
var player = Player.network("[/assets/sound.mp3](https://example.com/sound.mp3)")
player..play();
or:
var player = Player.create(asset: PlayerMedia.asset("/assets/sound.mp3"), autoPlay: true, once: true)
..init()
..play();
you have also:
var palyer = Player.create(asset: PlayerMedia.asset("/assets/sound.mp3"),autoPlay: true, once: true)..init();
// callback
palyer.callback = (PlayerEvent event){
// just example
setState((){});
};
// info
var package = player.package; // "just_audio" or "dart_vlc"
var position = player.position; // setter an getter like seek()
var duration = player.duration; // getter
var status = player.status; //
var loop = player.loop; // bool
var playing = player.playing;
...
// streams
player.streams.playing.stream;
player.streams.position.stream;
player.streams.status.stream;
player.streams.volume.stream;
player.streams.speed.stream;
player.streams.loop.stream;
// control
player.play();
player.pause();
player.toggle();
player.stop();
player.seek(newPosition);
player.volume = 0.8; // setter getter
player.speed = 1.2; // Rate
player.loop = true; // looping
//other
player.dispose();
player.player; // the package player instance for more option
// mixins
PlayerMixin
Source code #
check the repository on github (https://github.com/physia/kflutter/tree/main/kplayer/kplayer)
Support ☺️ #
you can buy me a coffee.
E n g o j :)
next plan: sopport video...