native_audio 0.0.20 copy "native_audio: ^0.0.20" to clipboard
native_audio: ^0.0.20 copied to clipboard

outdated

An audio plugin for Flutter which makes use of the native Android and iOS audio players, handling playback, notifications and external controls.

Native Audio #

An audio plugin for Flutter which makes use of the native Android and iOS audio players, handling playback, notifications and external controls (such as bluetooth).

Getting Started #

This plugin works on both Android and iOS, however the following setup is required for each platform.

Android #

Prerequisite

1. Application

Create or modify the Application class as follows:

import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.GeneratedPluginRegistrant
import com.danielgauci.native_audio.NativeAudioPlugin

class Application : FlutterApplication(), PluginRegistry.PluginRegistrantCallback {

    override fun onCreate() {
        super.onCreate()
        NativeAudioPlugin.setPluginRegistrantCallback(this)
    }

    override fun registerWith(registry: PluginRegistry) {
        GeneratedPluginRegistrant.registerWith(registry)
    }
}

This must be reflected in the application's AndroidManifest.xml. E.g.:

    <application
        android:name=".Application"
        ...

Note: Not calling NativeAudioPlugin.setPluginRegistrant will result in an exception being thrown when audio is played.

iOS #

Prerequisite

  • Flutter Project minimum iOS 10
  • Flutter Project minimum build Swift 4.2

No additional setup is required for iOS 🍏

9
likes
0
points
39
downloads

Publisher

verified publisherdanielgauci.com

Weekly Downloads

An audio plugin for Flutter which makes use of the native Android and iOS audio players, handling playback, notifications and external controls.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on native_audio