{"id":13820870,"url":"https://github.com/rxlabz/audioplayer","last_synced_at":"2025-10-03T16:31:37.300Z","repository":{"id":44725887,"uuid":"92396311","full_name":"rxlabz/audioplayer","owner":"rxlabz","description":"A flutter plugin to play audio files iOS / Android / MacOS / Web ( Swift/Java )","archived":true,"fork":false,"pushed_at":"2023-01-13T22:02:32.000Z","size":13178,"stargazers_count":492,"open_issues_count":103,"forks_count":188,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-01-18T02:51:48.298Z","etag":null,"topics":["android","audio-player","dartlang","flutter","flutter-plugin"],"latest_commit_sha":null,"homepage":"https://pub.dartlang.org/packages/audioplayer","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rxlabz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-25T11:20:37.000Z","updated_at":"2024-10-21T21:18:59.000Z","dependencies_parsed_at":"2023-02-09T17:16:06.358Z","dependency_job_id":null,"html_url":"https://github.com/rxlabz/audioplayer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxlabz%2Faudioplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxlabz%2Faudioplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxlabz%2Faudioplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxlabz%2Faudioplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rxlabz","download_url":"https://codeload.github.com/rxlabz/audioplayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235155997,"owners_count":18944824,"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":["android","audio-player","dartlang","flutter","flutter-plugin"],"created_at":"2024-08-04T08:01:10.709Z","updated_at":"2025-10-03T16:31:36.771Z","avatar_url":"https://github.com/rxlabz.png","language":"Dart","funding_links":[],"categories":["Dart","Components"],"sub_categories":["Media"],"readme":"# :warning: DEPRECATED\n\nCheck out \n\n- [audioplayers](https://pub.dev/packages/audioplayers)\n- [just_audio](https://pub.dev/packages/just_audio)\n___ \n# AudioPlayer\n\nA Flutter audio plugin (Swift/Java) to play remote or local audio files on iOS / Android / MacOS and Web.\n\n[Online demo](https://rxlabz.github.io/audioplayer/)\n\n## Features\n\n- [x] Android / iOS / MacOS / Web\n  - [x] play remote file \n  - [x] play local file ( not for the web)  \n  - [x] stop\n  - [x] pause\n  - [x] onComplete\n  - [x] onDuration / onCurrentPosition\n  - [x] seek\n  - [x] mute\n\n![screenshot](https://rxlabz.github.io/audioplayer/audioplayer.png)\n\n## Usage\n\n[Example](https://github.com/rxlabz/audioplayer/blob/master/example/lib/main.dart)\n\nTo use this plugin :\n\n- Add the dependency to your [pubspec.yaml](https://github.com/rxlabz/audioplayer/blob/master/example/pubspec.yaml) file.\n\n```yaml\n  dependencies:\n    flutter:\n      sdk: flutter\n    audioplayer: 0.8.1\n    audioplayer_web: 0.7.1\n```\n\n- Instantiate an AudioPlayer instance\n\n```dart\n//...\nAudioPlayer audioPlugin = AudioPlayer();\n//...\n```\n\n### Player Controls\n\n```dart\naudioPlayer.play(url);\n\naudioPlayer.pause();\n\naudioPlayer.stop();\n```\n\n### Status and current position\n\nThe dart part of the plugin listen for platform calls :\n\n```dart\n//...\n_positionSubscription = audioPlayer.onAudioPositionChanged.listen(\n  (p) =\u003e setState(() =\u003e position = p)\n);\n\n_audioPlayerStateSubscription = audioPlayer.onPlayerStateChanged.listen((s) {\n  if (s == AudioPlayerState.PLAYING) {\n    setState(() =\u003e duration = audioPlayer.duration);\n  } else if (s == AudioPlayerState.STOPPED) {\n    onComplete();\n    setState(() {\n      position = duration;\n    });\n  }\n}, onError: (msg) {\n  setState(() {\n    playerState = PlayerState.stopped;\n    duration = new Duration(seconds: 0);\n    position = new Duration(seconds: 0);\n  });\n});\n```\n\nDo not forget to cancel all the subscriptions when the widget is disposed.\n\n\n## iOS\n\n### :warning: iOS App Transport Security\n\nBy default iOS forbids loading from non-https url. To cancel this restriction edit your .plist and add :\n\n```xml\n\u003ckey\u003eNSAppTransportSecurity\u003c/key\u003e\n\u003cdict\u003e\n    \u003ckey\u003eNSAllowsArbitraryLoads\u003c/key\u003e\n    \u003ctrue/\u003e\n\u003c/dict\u003e\n```\n\n### Background mode\n\ncf. [enable background audio](https://developer.apple.com/documentation/avfoundation/media_assets_playback_and_editing/creating_a_basic_video_player_ios_and_tvos/enabling_background_audio)\n\n## MacOS\n\nAdd this to entitlements files ( cf. [DebugProfile.entitlements](example/macos/Runner/DebugProfile.entitlements) )\n```xml\n    \u003ckey\u003ecom.apple.security.network.client\u003c/key\u003e\n    \u003ctrue/\u003e\n```\n\ncf. [Flutter MacOS security](https://github.com/google/flutter-desktop-embedding/blob/master/macOS-Security.md)\n\n## Troubleshooting\n\n- If you get a MissingPluginException, try to `flutter build apk` on Android, or `flutter build ios`\n\n## Getting Started with Flutter\n\nFor help getting started with Flutter, view our online\n[documentation](http://flutter.io/).\n\nFor help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxlabz%2Faudioplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frxlabz%2Faudioplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxlabz%2Faudioplayer/lists"}