All Projects → rxlabz → Audioplayer

rxlabz / Audioplayer

Licence: other
A flutter plugin to play audio files iOS / Android / MacOS / Web ( Swift/Java )

Programming Languages

dart
5743 projects
dartlang
94 projects

Projects that are alternatives of or similar to Audioplayer

audio manager
A flutter plugin for music playback, including notification handling.
Stars: ✭ 94 (-79.61%)
Mutual labels:  audio-player, flutter-plugin
Stereo
A Flutter plugin for playing music on iOS and Android.
Stars: ✭ 66 (-85.68%)
Mutual labels:  audio-player, flutter-plugin
Qmplay2
QMPlay2 is a video and audio player which can play most formats and codecs.
Stars: ✭ 310 (-32.75%)
Mutual labels:  audio-player
Skplayer
🎵 A simple & beautiful HTML5 music player
Stars: ✭ 437 (-5.21%)
Mutual labels:  audio-player
Youtube player flutter
Flutter plugin for playing or streaming YouTube videos inline using the official iFrame Player API. Supports both Android and iOS platforms.
Stars: ✭ 366 (-20.61%)
Mutual labels:  flutter-plugin
React Music Player
🎵 Maybe the best beautiful HTML5 responsive player component for react :)
Stars: ✭ 321 (-30.37%)
Mutual labels:  audio-player
Snapcast
Synchronous multiroom audio player
Stars: ✭ 4,028 (+773.75%)
Mutual labels:  audio-player
Alice
HTTP Inspector for Flutter. Allows checking HTTP connections with UI inspector.
Stars: ✭ 296 (-35.79%)
Mutual labels:  flutter-plugin
Super Simple Raspberry Pi Audio Receiver Install
Super Easy installation to make your Raspberry Pi an Audio Receiver
Stars: ✭ 448 (-2.82%)
Mutual labels:  audio-player
React Music Player
React,TS的音乐播放插件,歌词同步功能,适配PC和移动端;A music player build with react and typescript for mobile and PC
Stars: ✭ 357 (-22.56%)
Mutual labels:  audio-player
Plugins
Flutter plugins created by Rody Davis
Stars: ✭ 424 (-8.03%)
Mutual labels:  flutter-plugin
Dna
dna, dart native access. A lightweight dart to native super channel plugin, You can use it to invoke any native code directly in contextual and chained dart code.
Stars: ✭ 355 (-22.99%)
Mutual labels:  flutter-plugin
Sfbaudioengine
A toolbox of powerful audio functionality for macOS and iOS
Stars: ✭ 333 (-27.77%)
Mutual labels:  audio-player
Flutter facebook login
A Flutter plugin for allowing users to authenticate with native Android & iOS Facebook login SDKs.
Stars: ✭ 387 (-16.05%)
Mutual labels:  flutter-plugin
Flutter page transition
This is Flutter Page Transition Package
Stars: ✭ 314 (-31.89%)
Mutual labels:  flutter-plugin
Flutter bugly
腾讯Bugly flutter应用更新统计及异常上报插件,支持Android、iOS
Stars: ✭ 446 (-3.25%)
Mutual labels:  flutter-plugin
Equinox
Flutter UI library based on Eva Design System ✨
Stars: ✭ 307 (-33.41%)
Mutual labels:  flutter-plugin
Flutter mlkit
A Flutter plugin to use the Firebase ML Kit.
Stars: ✭ 352 (-23.64%)
Mutual labels:  flutter-plugin
Canaree Music Player
Complete music player published in the Play Store. Heavily relies on Dagger, kotlin coroutines and Clean architecture.
Stars: ✭ 371 (-19.52%)
Mutual labels:  audio-player
Flutter easyloading
✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web
Stars: ✭ 455 (-1.3%)
Mutual labels:  flutter-plugin

AudioPlayer

A Flutter audio plugin (Swift/Java) to play remote or local audio files on iOS / Android / MacOS and Web.

Online demo

Features

  • [x] Android / iOS / MacOS / Web
    • [x] play remote file
    • [x] play local file ( not for the web)
    • [x] stop
    • [x] pause
    • [x] onComplete
    • [x] onDuration / onCurrentPosition
    • [x] seek
    • [x] mute

screenshot

Usage

Example

To use this plugin :

  dependencies:
    flutter:
      sdk: flutter
    audioplayer: 0.8.1
    audioplayer_web: 0.7.1
  • Instantiate an AudioPlayer instance
//...
AudioPlayer audioPlugin = AudioPlayer();
//...

Player Controls

audioPlayer.play(url);

audioPlayer.pause();

audioPlayer.stop();

Status and current position

The dart part of the plugin listen for platform calls :

//...
_positionSubscription = audioPlayer.onAudioPositionChanged.listen(
  (p) => setState(() => position = p)
);

_audioPlayerStateSubscription = audioPlayer.onPlayerStateChanged.listen((s) {
  if (s == AudioPlayerState.PLAYING) {
    setState(() => duration = audioPlayer.duration);
  } else if (s == AudioPlayerState.STOPPED) {
    onComplete();
    setState(() {
      position = duration;
    });
  }
}, onError: (msg) {
  setState(() {
    playerState = PlayerState.stopped;
    duration = new Duration(seconds: 0);
    position = new Duration(seconds: 0);
  });
});

Do not forget to cancel all the subscriptions when the widget is disposed.

iOS

⚠️ iOS App Transport Security

By default iOS forbids loading from non-https url. To cancel this restriction edit your .plist and add :

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Background mode

cf. enable background audio

MacOS

Add this to entitlements files ( cf. DebugProfile.entitlements )

    <key>com.apple.security.network.client</key>
    <true/>

cf. Flutter MacOS security

Troubleshooting

  • If you get a MissingPluginException, try to flutter build apk on Android, or flutter build ios

Getting Started with Flutter

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].