Skip to content

bdrazhzhov/audio-player-gst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

audio_player_gst

A Flutter plugin allowing play audio (local or from web) on linux using gstreamer libs.

Dependencies

libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-bad

Quick start

import 'package:audio_player_gst/audio_player_gst.dart';

final player = AudioPlayerGst();                // Create player
await player.setUrl(                            // Load a URL
  'https://example.com/song.mp3');              // Schemes: (https: | file:)
await player.play();                            // Start playing
await player.pause();                           // Pause currently playing media
await player.seek(Duration(second: 10));        // Jump to the 10 second position
await player.setRate(2.0);                      // Double playing speed
await player.setVolume(0.5);                    // Half playing speed

Working with events stream

AudioPlayerGst.eventsStream().listen((EventBase event) {
  switch(event.runtimeType) {
    case DurationEvent: ...
    case PlayingStateEvent: ...
    case PositionEvent: ...
    case BufferingEvent: ...
    case PlayingCompletedEvent: ...
  }
});

There is no ability to create multiple GStreamer player instances for now.

About

Flutter audio player for linux that usses GSteamer libs for playback implementation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors