libwinmedia.dart

Flutter bindings to libwinmedia.



Install

dependencies:
  ...
  libwinmedia: ^0.0.3

Example

A very simple example can be as follows.

import 'package:libwinmedia/libwinmedia.dart';

void main() {
  LWM.initialize();
  runApp(MyApp());
}

void demo() {
  var player = Player(id: 0);
  player.streams.medias.listen((List<Media> medias) {});
  player.streams.isPlaying.listen((bool isPlaying) {});
  player.streams.isBuffering.listen((bool isBuffering) {});
  player.streams.isCompleted.listen((bool isCompleted) {});
  player.streams.position.listen((Duration position) {});
  player.streams.duration.listen((Duration duration) {});
  player.streams.index.listen((int index) {});
  player.open([
    Media(uri: 'https://www.example.com/media/music.mp3'),
    Media(uri: 'file://C:/documents/video.mp4'),
  ]);
  player.play();
  player.seek(Duration(seconds: 20));
  player.nativeControls.update(
    album: 'Fine Line',
    albumArtist: 'Harry Styles',
    trackCount: 12,
    artist: 'Harry Styles',
    title: 'Lights Up',
    trackNumber: 1,
    thumbnail: File('album_art.png'),
  );
}

Checkout the other APIs & docstrings within the project, for more detailed information. Those are the most updated source of documentation.

Support

Consider supporting the project by starring the repository or buying me a coffee.

Thanks a lot for your support.

Contributions

Contributions to the project are welcomed, either it be API improvements or documentation changes. Let's make it better.

License

MIT

Copyright © 2021, Hitesh Kumar Saini <saini123hitesh@gmail.com>

Libraries

generated/bindings
libwinmedia
libwinmedia.dart