Skip to content

Commit

Permalink
Merge branch 'fix/insert_skip' into minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanheise committed Jun 21, 2022
2 parents a820b1b + 191f63b commit 1ad3020
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 13 deletions.
12 changes: 12 additions & 0 deletions just_audio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,18 @@ If you wish to connect to non-HTTPS URLS, also add the following attribute to th

If you need access to the player's AudioSession ID, you can listen to `AudioPlayer.androidAudioSessionIdStream`. Note that the AudioSession ID will change whenever you set new AudioAttributes.

If there are multiple plugins in your app that use ExoPlayer to decode media, it is possible to encounter a `Duplicate class` error if those plugins use different versions of ExoPlayer. In this case you may report an issue for each respective plugin to upgrade to the latest version of ExoPlayer, or you may downgrade one or more of your app's plugins until the versions match. In some cases where a plugin uses non-breaking parts of the ExoPlayer API, you can also try forcing all plugins to use the same version of ExoPlayer by editing your own app's `android/app/build.gradle` file and inserting the dependencies for the desired Exoplayer version:

```
dependencies {
def exoplayer_version = "...specify-version-here...."
implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-dash:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-hls:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-smoothstreaming:$exoplayer_version"
}
```

### iOS

Using the default configuration, the App Store will detect that your app uses the AVAudioSession API which includes a microphone API, and for privacy reasons it will ask you to describe your app's usage of the microphone. If your app does indeed use the microphone, you can describe your usage by editing the `Info.plist` file as follows:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ public void onTimelineChanged(Timeline timeline, int reason) {
if (player.getPlaybackState() == Player.STATE_ENDED) {
try {
if (player.getPlayWhenReady()) {
if (player.hasNextMediaItem()) {
player.seekToNextMediaItem();
} else if (lastPlaylistLength == 0 && player.getMediaItemCount() > 0) {
if (lastPlaylistLength == 0 && player.getMediaItemCount() > 0) {
player.seekTo(0, 0L);
} else if (player.hasNextMediaItem()) {
player.seekToNextMediaItem();
}
} else {
if (player.getCurrentMediaItemIndex() < player.getMediaItemCount()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

#include "generated_plugin_registrant.h"

#include <just_audio_windows/just_audio_windows_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
JustAudioWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("JustAudioWindowsPlugin"));
}
1 change: 1 addition & 0 deletions just_audio/example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
just_audio_windows
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
6 changes: 6 additions & 0 deletions just_audio_background/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.0.1-beta.6

* Update documentation/example for Android 12.
* Migrate from pedantic to flutter_lints.
* Support content:// art URIs on Android (@nt4f04uNd).

## 0.0.1-beta.5

* Fix bug in stop.
Expand Down
11 changes: 8 additions & 3 deletions just_audio_background/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ AudioSource.uri(
Make the following changes to your project's `AndroidManifest.xml` file:

```xml
<manifest ...>
<manifest xmlns:tools="http://schemas.android.com/tools" ...>
<!-- ADD THESE TWO PERMISSIONS -->
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
Expand All @@ -70,14 +70,17 @@ Make the following changes to your project's `AndroidManifest.xml` file:
</activity>

<!-- ADD THIS "SERVICE" element -->
<service android:name="com.ryanheise.audioservice.AudioService">
<service android:name="com.ryanheise.audioservice.AudioService"
android:foregroundServiceType="mediaPlayback"
android:exported="true" tools:ignore="Instantiatable">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>

<!-- ADD THIS "RECEIVER" element -->
<receiver android:name="com.ryanheise.audioservice.MediaButtonReceiver" >
<receiver android:name="com.ryanheise.audioservice.MediaButtonReceiver"
android:exported="true" tools:ignore="Instantiatable">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
Expand All @@ -86,6 +89,8 @@ Make the following changes to your project's `AndroidManifest.xml` file:
</manifest>
```

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.

## iOS setup

Insert this in your `Info.plist` file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:usesCleartextTraffic="true"
android:usesCleartextTraffic="true"
android:label="just_audio_example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">

<activity
Expand All @@ -31,13 +32,18 @@
</intent-filter>
</activity>

<service android:name="com.ryanheise.audioservice.AudioService" android:exported="true">
<service
android:name="com.ryanheise.audioservice.AudioService"
android:foregroundServiceType="mediaPlayback"
android:exported="true">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>

<receiver android:name="com.ryanheise.audioservice.MediaButtonReceiver" android:exported="true">
<receiver
android:name="com.ryanheise.audioservice.MediaButtonReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Generated file.
//
// If you wish to remove Flutter's multidex support, delete this entire file.
//
// Modifications to this file should be done in a copy under a different name
// as this file may be regenerated.

package io.flutter.app;

import android.app.Application;
import android.content.Context;
import androidx.annotation.CallSuper;
import androidx.multidex.MultiDex;

/**
* Extension of {@link android.app.Application}, adding multidex support.
*/
public class FlutterMultiDexApplication extends Application {
@Override
@CallSuper
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
2 changes: 1 addition & 1 deletion just_audio_background/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
dependencies:
flutter:
sdk: flutter
audio_session: ^0.1.6+1
audio_session: ^0.1.7
rxdart: ^0.27.2
just_audio:
path: ../../just_audio
Expand Down
6 changes: 3 additions & 3 deletions just_audio_background/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: just_audio_background
description: An add-on for just_audio that supports background playback and media notifications.
homepage: https://github.com/ryanheise/just_audio/tree/master/just_audio_background
version: 0.0.1-beta.5
version: 0.0.1-beta.6

dependencies:
just_audio_platform_interface: ^4.1.0
# just_audio_platform_interface:
# path: ../just_audio_platform_interface
audio_service: ^0.18.4
audio_session: ^0.1.6+1
audio_service: ^0.18.5
audio_session: ^0.1.7
flutter:
sdk: flutter
flutter_web_plugins:
Expand Down

0 comments on commit 1ad3020

Please sign in to comment.