{"id":13529378,"url":"https://github.com/alexmercerind/dart_vlc","last_synced_at":"2025-05-16T06:02:29.375Z","repository":{"id":37080879,"uuid":"346656517","full_name":"alexmercerind/dart_vlc","owner":"alexmercerind","description":"Flutter bindings to libVLC.","archived":false,"fork":false,"pushed_at":"2024-06-14T08:39:52.000Z","size":70826,"stargazers_count":521,"open_issues_count":53,"forks_count":136,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-10T20:47:43.637Z","etag":null,"topics":["audio","audio-player","broadcast","chromecast","dart","equalizer","flutter","flutter-desktop","hacktoberfest","libvlc","linux","playback","record","video","video-player","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexmercerind.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-11T10:02:05.000Z","updated_at":"2025-05-08T08:58:11.000Z","dependencies_parsed_at":"2024-01-03T02:25:52.910Z","dependency_job_id":"a38c97b8-cb52-4568-97ac-25ee8e915bc2","html_url":"https://github.com/alexmercerind/dart_vlc","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmercerind%2Fdart_vlc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmercerind%2Fdart_vlc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmercerind%2Fdart_vlc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexmercerind%2Fdart_vlc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexmercerind","download_url":"https://codeload.github.com/alexmercerind/dart_vlc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478160,"owners_count":22077675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","audio-player","broadcast","chromecast","dart","equalizer","flutter","flutter-desktop","hacktoberfest","libvlc","linux","playback","record","video","video-player","windows"],"created_at":"2024-08-01T07:00:35.817Z","updated_at":"2025-05-16T06:02:24.351Z","avatar_url":"https://github.com/alexmercerind.png","language":"C++","funding_links":["https://paypal.me/alexmercerind","https://patreon.com/harmonoid","https://github.com/sponsors/alexmercerind"],"categories":["C++","Packages","Bindings"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003ca href=\"https://github.com/alexmercerind/dart_vlc\"\u003edart_vlc\u003c/a\u003e\u003c/h1\u003e\n\u003cp align=\"center\"\u003eFlutter audio / video playback, broadcast \u0026 recording library for Windows \u0026 Linux.\u003c/p\u003e\n\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eSponsored with 💖 by\u003c/strong\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://getstream.io/chat/sdk/flutter/?utm_source=alexmercerind_dart\u0026utm_medium=Github_Repo_Content_Ad\u0026utm_content=Developer\u0026utm_campaign=alexmercerind_December2022_FlutterSDK_klmh22\" target=\"_blank\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://user-images.githubusercontent.com/28951144/204903234-4a64b63c-2fc2-4eef-be44-d287d27021e5.svg\"\u003e\n      \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://user-images.githubusercontent.com/28951144/204903022-bbaa49ca-74c2-4a8f-a05d-af8314bfd2cc.svg\"\u003e\n      \u003cimg alt=\"Stream Chat\" width=\"350\" height=\"auto\" src=\"https://user-images.githubusercontent.com/28951144/204903022-bbaa49ca-74c2-4a8f-a05d-af8314bfd2cc.svg\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n    \u003ch5 align=\"center\"\u003e\n      Rapidly ship in-app messaging with Stream's highly reliable chat infrastructure and feature-rich SDKs, including Flutter!\n    \u003c/h5\u003e\n  \u003ch4 align=\"center\"\u003e\n    \u003ca href=\"https://getstream.io/chat/sdk/flutter/?utm_source=alexmercerind_dart\u0026utm_medium=Github_Repo_Content_Ad\u0026utm_content=Developer\u0026utm_campaign=alexmercerind_December2022_FlutterSDK_klmh22\" target=\"_blank\"\u003e\n    Try the Flutter Chat tutorial\n    \u003c/a\u003e\n  \u003c/h4\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n\u003cimg src='https://alexmercerind.github.io/img/dart_vlc/0.webp'\u003e\u003c/img\u003e\n\u003cimg src='https://alexmercerind.github.io/img/dart_vlc/1.webp'\u003e\u003c/img\u003e\n\n## Installation\n\n_pub.dev_\n\n```yaml\ndependencies:\n  ...\n  dart_vlc: ^0.1.9\n```\n\n_GitHub_\n\n```yaml\ndependencies:\n  dart_vlc:\n    git:\n      url: https://github.com/alexmercerind/dart_vlc.git\n      ref: master\n\ndependency_overrides:\n  dart_vlc_ffi:\n    git:\n      url: https://github.com/alexmercerind/dart_vlc.git\n      ref: master\n      path: ffi\n```\n\nFeel free to open a [new issue](https://github.com/alexmercerind/dart_vlc/issues) or [discussion](https://github.com/alexmercerind/dart_vlc/discussions), if you found a bug or need assistance.\n\n## Documentation\n\nCheckout [Setup](#setup) section to configure plugin on your platform.\n\n#### Initialize the library.\n\n```dart\nvoid main() {\n  DartVLC.initialize();\n  runApp(MyApp());\n}\n```\n\n#### Create a new player instance.\n\n```dart\nfinal player = Player(id: 69420);\n```\n\nFor passing VLC CLI arguments, use `commandlineArguments` argument.\n\n```dart\nfinal player = Player(\n  id: 69420,\n  commandlineArguments: ['--no-video'],\n);\n```\n\n#### Create a media for playback.\n\n```dart\nfinal file = Media.file(File('C:/music.mp3'));\nfinal asset = Media.asset('assets/audio/example.mp3');\nfinal network = Media.network('https://www.example.com/music.aac');\n\n// Clip [Media] playback duration.\nfinal media2 = Media.network(\n  'https://www.example.com/music.aac',\n  startTime: Duration(seconds: 20),\n  stopTime: Duration(seconds: 60),\n);\n```\n\n#### Create a list of medias using playlist.\n\n```dart\nfinal playlist = Playlist(\n  medias: [\n    Media.file(File('C:/music.mp3')),\n    Media.file(File('C:/audio.mp3')),\n    Media.asset('assets/audio/example.mp3'),\n    Media.network('https://www.example.com/music.aac'),\n  ],\n);\n```\n\n#### Open a media or playlist into a player.\n\n```dart\nplayer.open(\n  Media.file(File('C:/music0.mp3')),\n  autoStart: true, // default\n);\n```\n\n```dart\nplayer.open(\n  Playlist(\n    medias: [\n      Media.file(File('C:/music0.mp3')),\n      Media.file(File('C:/music1.mp3')),\n      Media.file(File('C:/music2.mp3')),\n    ],\n  ),\n  autoStart: false,\n);\n```\n\n#### Control playback.\n\n```dart\nplayer.play();\n\nplayer.seek(Duration(seconds: 30));\n\nplayer.pause();\n\nplayer.playOrPause();\n\nplayer.stop();\n```\n\n#### Controls the playlist.\n\n```dart\nplayer.next();\n\nplayer.previous();\n\nplayer.jumpToIndex(10);\n```\n\n#### Manipulate an already playing playlist.\n\n```dart\nplayer.add(\n  Media.file(File('C:/music0.mp3')),\n);\n\nplayer.remove(4);\n\nplayer.insert(\n  2,\n  Media.file(File('C:/music0.mp3')),\n);\n\nplayer.move(0, 4);\n```\n\n#### Set playback volume \u0026 rate.\n\n```dart\nplayer.setVolume(0.5);\n\nplayer.setRate(1.25);\n```\n\n#### Get \u0026 change playback device.\n\n```dart\nList\u003cDevice\u003e devices = Devices.all;\n\nplayer.setDevice(devices[0]);\n```\n\n#### Save the video screenshot\n\n```dart\nplayer.takeSnapshot(file, 1920, 1080);\n```\n\n#### Show the video inside widget tree.\n\nShow `Video` in the `Widget` tree.\n\n```dart\nclass _MyAppState extends State\u003cMyApp\u003e {\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      body: Video(\n        player: player,\n        height: 1920.0,\n        width: 1080.0,\n        scale: 1.0, // default\n        showControls: false, // default\n      ),\n    );\n  }\n}\n```\n\nBy default, `Video` widget's frame size will adapt to the currently playing video.\nTo override this \u0026 define custom video frame size, pass `videoDimensions` argument while instanciating `Player` class as follows.\n\n```dart\nPlayer player = Player(\n  id: 69420,\n  videoDimensions: const VideoDimensions(640, 360),\n);\n```\n\n#### Change user agent.\n\n```dart\nplayer.setUserAgent(userAgent);\n```\n\n#### Retrieve metadata of media.\n\n```dart\nMedia media = Media.network(\n  'https://www.example.com/media.mp3',\n  parse: true,\n  timeout: Duration(seconds: 10),\n);\n\nMap\u003cString, String\u003e metas = media.metas;\n```\n\n#### Listen to playback events.\n\n(Same can be retrieved directly from `Player` instance without having to rely on stream).\n\nListen to currently loaded media \u0026 playlist index changes.\n\n```dart\nplayer.currentStream.listen((CurrentState state) {\n  state.index;\n  state.media;\n  state.medias;\n  state.isPlaylist;\n});\n```\n\nListen to playback position \u0026 media duration.\n\n```dart\nplayer.positionStream.listen((PositionState state) {\n  state.position;\n  state.duration;\n});\n```\n\nListen to playback states.\n\n```dart\nplayer.playbackStream.listen((PlaybackState state) {\n  state.isPlaying;\n  state.isSeekable;\n  state.isCompleted;\n});\n```\n\nListen to volume \u0026 rate of the `Player`.\n\n```dart\nplayer.generalStream.listen((GeneralState state) {\n  state.volume;\n  state.rate;\n});\n```\n\nListen to dimensions of currently playing `Video`.\n\n```dart\nplayer.videoDimensionsStream.listen((VideoDimensions video) {\n  video.width;\n  video.height;\n});\n```\n\nListen to buffering progress of the playing `Media`.\n\n```dart\nplayer.bufferingProgressStream.listen(\n  (double event) {\n    this.setState(() {\n      this.bufferingProgress = event;\n    });\n  },\n);\n```\n\n#### Set an equalizer.\n\nCreate using preset.\n\n```dart\nEqualizer equalizer = Equalizer.createMode(EqualizerMode.party);\nplayer.setEqualizer(equalizer);\n```\n\nCreate custom equalizer.\n\n```dart\nEqualizer equalizer = Equalizer.createEmpty();\nequalizer.setPreAmp(10.0);\nequalizer.setBandAmp(31.25, -10.0);\nequalizer.setBandAmp(100.0, -10.0);\nplayer.setEqualizer(equalizer);\n```\n\nGet equalizer state.\n\n```dart\nequalizer.preAmp;\nequalizer.bandAmps;\n```\n\n#### Broadcast a media.\n\nBroadcasting to localhost.\n\n```dart\nfinal broadcast = Broadcast.create(\n  id: 0,\n  media: Media.file(File('C:/video.mp4')),\n  configuration: BroadcastConfiguration(\n    access: 'http',\n    mux: 'mpeg1',\n    dst: '127.0.0.1:8080',\n    vcodec: 'mp1v',\n    vb: 1024,\n    acodec: 'mpga',\n    ab: 128,\n  ),\n);\nbroadcast.start();\n```\n\nDispose the `Broadcast` instance to release resources.\n\n```dart\nbroadcast.dispose();\n```\n\n#### Record a media.\n\n```dart\nfinal record = Record.create(\n  id: 205,\n  media: Media.network('https://www.example.com/streaming-media.MP3'),\n  pathFile: '/home/alexmercerind/recording.MP3',\n);\nrecord.start();\n```\n\n## Setup\n\n### Windows\n\nEverything is already set up.\n\n\u003c!--\n\n### macOS\n\nTo run on macOS, install CMake through [Homebrew](https://brew.sh):\n\n```bash\nbrew install cmake\n```\n\nIf you encounter the error `cmake: command not found` during archiving:\n\n1. Download [CMake](https://cmake.org/download/) and move it to the `Applications` Folder.\n2. Run:\n\n```bash\nsudo \"/Applications/CMake.app/Contents/bin/cmake-gui\" --install\n```\n\n--\u003e\n\n### Linux\n\nFor using this plugin on Linux, you must have [VLC](https://www.videolan.org) \u0026 [libVLC](https://www.videolan.org/vlc/libvlc.html) installed.\n\n**On Ubuntu/Debian:**\n\n```bash\nsudo apt-get install vlc\n```\n\n```bash\nsudo apt-get install libvlc-dev\n```\n\n**On Fedora:**\n\n```bash\nsudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm\n```\n\n```bash\nsudo dnf install vlc\n```\n\n```bash\nsudo dnf install vlc-devel\n```\n\n\u003c!--\n\n### iOS [WIP]\n\nDisable bitcode generation for the whole project for MobileVLC to work.\nAdd the following to the `post_install` function living in the `Podfile` of your iOS Flutter project. For reference look at the `Podfile` in the example project.\n\n```ruby\ntarget.build_configurations.each do |config|\n    config.build_settings['ENABLE_BITCODE'] = 'NO'\nend\n```\n\nFor the example project to work you need to configure a real device in the xcode project, or comment out the build script `Build Device lib` in in `ios/dart_vlc.podspec`.\n\n--\u003e\n\n## Support\n\nConsider sponsoring this project. Maintenance of open-source software \u0026 libraries is severely under-paid or not paid at all.\n\nWriting C++ \u0026 native code is a very tedious process.\n\n- [PayPal](https://paypal.me/alexmercerind)\n- [Patreon](https://patreon.com/harmonoid)\n- [GitHub Sponsors](https://github.com/sponsors/alexmercerind)\n\n## Acknowledgements\n\n- BIG thanks to [@jnschulze](https://github.com/jnschulze) for his awesome contributions to this project \u0026 to the Flutter engine itself like adding texture support \u0026 adding macOS support here. I have learnt a lot about modern C++ \u0026 good-practices when writing code from you, thanks a lot for your guidances, reviews, work \u0026 donation. I'm really really thankful to you.\n- BIG thanks to [@DomingoMG](https://github.com/DomingoMG) for adding `Record` and `Chromecast` classes. Also, thanks a lot for donation to the project \u0026 giving me motivation to start building this. I would've never attempted this if you didn't motivate me. And now that it started, `dart_vlc` has grown a lot.\n- Thanks to [@tomassasovsky](https://github.com/tomassasovsky) for adding visual controls to `Video` widget.\n\n- Thanks to following members of libVLC community (irrespective of the order) for giving general ideas about libVLC APIs:\n  - [@jeremyVignelles](https://github.com/jeremyVignelles)\n  - [@chouquette](https://github.com/chouquette)\n  - [@mfkl](https://github.com/mfkl)\n  - [@caprica](https://github.com/caprica)\n- Finally, thanks to the [VideoLAN](https://www.videolan.org) team for creating [libVLC](https://github.com/videolan/vlc) \u0026 [libVLC++](https://github.com/videolan/libvlcpp). Really great guys really great at their work.\n\n## Contributions\n\nThe code in the project is nicely arranged and follows the clean architecture.\n\nContributions to the project are open, it will be appreciated if you discuss the bug-fix/feature-addition in the issues first.\n\n## License\n\nCopyright (C) 2021, Hitesh Kumar Saini \u003csaini123hitesh@gmail.com\u003e.\n\nThis library \u0026 work under this repository is licensed under GNU Lesser General Public License v2.1.\n\n## Vision\n\nThere aren't any media (audio or video) playback libraries for Flutter or Dart on Windows/Linux yet. So, this project is all about that.\nAs one might be already aware, VLC is one of the best media playback tools out there.\n\nSo, now you can use it to play audio or video files from Flutter or Dart apps.\n\nAs the project has grown, awesome people from community have added support for iOS \u0026 macOS aswell.\n\n## Example\n\nYou can see an example project [here](https://github.com/alexmercerind/dart_vlc/blob/master/example/lib/main.dart).\n\n![](https://github.com/alexmercerind/dart_vlc/blob/assets/dart_vlc_6.png?raw=true)\n\n`dart_vlc` running on Ubuntu Linux.\n\n## Features\n\nDone\n\n- `Media` playback from `File`.\n- `Media` playback from network.\n- `Media` playback from assets.\n- `play`/`pause`/`playOrPause`/`stop`.\n- Multiple `Player` instances.\n- `Playlist`.\n- `next`/`back`/`jump` for playlists.\n- `setVolume`.\n- `setRate`.\n- `seek`.\n- Event streams.\n- `add`/`insert`/`remove`/`move` `Media` inside `Playlist` during playback with no interruption.\n- Device enumeration \u0026 changing.\n- Retrieving metadata/tags of a `Media`.\n- Embedding `Video` inside the Flutter window (using texture or natively).\n- Supporting live streaming links.\n- `Broadcast` class for broadcasting `Media`.\n- `Record` class for recording `Media`.\n- `Chromecast` class.\n- `Equalizer` configuration \u0026 presets.\n- Changing user agent.\n- Changing `Video`'s frame size according to video.\n- Saving screenshot of the video.\n- Changing/retrieving audio track.\n- Media clipping.\n- Support for Windows, Linux or macOS.\n\nUnder progress or planned features (irrespective of order)...\n\n- Bringing project on Android and iOS.\n- Removing [libVLC++](https://github.com/videolan/libvlcpp) dependency.\n- Subtitle control.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmercerind%2Fdart_vlc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexmercerind%2Fdart_vlc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexmercerind%2Fdart_vlc/lists"}