Skip to content

Commit

Permalink
Mention fragment activities in README.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanheise committed Dec 30, 2022
1 parent 546cd3d commit bc96322
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions just_audio_background/README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

This package plugs into [just_audio](https://pub.dev/packages/just_audio) to add background playback support and remote controls (notification, lock screen, headset buttons, smart watches, Android Auto and CarPlay). It supports the simple use case where an app has a single `AudioPlayer` instance.

If your app has more complex requirements, it is recommended that you instead use the [audio_service](https://pub.dev/packages/audio_service) package directly.
If your app has more complex requirements, it is recommended that you instead use the [audio_service](https://pub.dev/packages/audio_service) package directly (which just_audio_background is internally built on). This will give you greater control over which buttons to display in the notification and how you want them to behave, while also allowing you to use multiple audio player instances.

## Setup

@@ -15,7 +15,7 @@ dependencies:

```

Then add the following initialization code to your app's `main` method:
Then add the following initialization code to your app's `main` method (refer to the API documentation for the complete set of options):

```dart
Future<void> main() async {
@@ -91,6 +91,8 @@ Make the following changes to your project's `AndroidManifest.xml` file:

Note: when targeting Android 12 or above, you must set `android:exported` on each component that has an intent filter (the main activity, the service and the receiver). If the manifest merging process causes `"Instantiable"` lint warnings, use `tools:ignore="Instantiable"` (as above) to suppress them.

If your app has a requirement to use a FragmentActivity, you can replace `AudioServiceActivity` above with `AudioServiceFragmentActivity`. If your app needs to use a custom activity, you can also make your own activity class a subclass of either `AudioServiceActivity` or `AudioServiceFragmentActivity`. For more details on this and other options, refer to the [audio_service setup instructions](https://pub.dev/packages/audio_service).

## iOS setup

Insert this in your `Info.plist` file:

0 comments on commit bc96322

Please sign in to comment.