Git Product home page Git Product logo

florent37 / flutter-assetsaudioplayer Goto Github PK

View Code? Open in Web Editor NEW
749.0 16.0 340.0 96.26 MB

Play simultaneously music/audio from assets/network/file directly from Flutter, compatible with android / ios / web / macos, displays notifications

Home Page: https://pub.dartlang.org/packages/assets_audio_player

License: Apache License 2.0

Kotlin 27.51% Ruby 1.26% Swift 13.77% Objective-C 0.17% Dart 56.92% Shell 0.10% HTML 0.27%
dart kotlin flutter swift android ios media player mp3 audio

flutter-assetsaudioplayer's Introduction

๐ŸŽง assets_audio_player ๐Ÿ”Š

pub package Awesome Flutter

Codemagic build status CodeFactor

Play music/audio stored in assets files (simultaneously) directly from Flutter (android / ios / web / macos).

You can also use play audio files from network using their url, radios/livestream and local files

Notification can be displayed on Android & iOS, and bluetooth actions are handled

flutter:
  assets:
    - assets/audios/
AssetsAudioPlayer.newPlayer().open(
    Audio("assets/audios/song1.mp3"),
    autoStart: true,
    showNotification: true,
);

sample1 sample1

๐Ÿ“ฅ Import

dependencies:
  assets_audio_player: ^3.0.8

Works with flutter: ">=3.3.0", be sure to upgrade your sdk

You like the package ? buy me a kofi :)

Buy Me a Coffee at ko-fi.com

Audio Source Android iOS Web MacOS
๐Ÿ—„๏ธ Asset file (asset path) โœ… โœ… โœ… โœ…
๐ŸŒ Network file (url) โœ… โœ… โœ… โœ…
๐Ÿ“ Local file (path) โœ… โœ… โœ… โœ…
๐Ÿ“ป Network LiveStream / radio (url)
(Default, HLS, Dash, SmoothStream)
โœ… โœ… โœ… โœ…
Feature Android iOS Web MacOS
๐ŸŽถ Multiple players โœ… โœ… โœ… โœ…
๐Ÿ’ฝ Open Playlist โœ… โœ… โœ… โœ…
๐Ÿ’ฌSystem notification โœ… โœ… ๐Ÿšซ ๐Ÿšซ
๐ŸŽง Bluetooth actions โœ… โœ… ๐Ÿšซ ๐Ÿšซ
๐Ÿ”• Respect System silent mode โœ… โœ… ๐Ÿšซ ๐Ÿšซ
๐Ÿ“ž Pause on phone call โœ… โœ… ๐Ÿšซ ๐Ÿšซ
Commands Android iOS Web MacOS
โ–ถ Play โœ… โœ… โœ… โœ…
โธ Pause โœ… โœ… โœ… โœ…
โน Stop โœ… โœ… โœ… โœ…
โฉ Seek(position) โœ… โœ… โœ… โœ…
โชโฉ SeekBy(position) โœ… โœ… โœ… โœ…
โฉ Forward(speed) โœ… โœ… โœ… โœ…
โช Rewind(speed) โœ… โœ… โœ… โœ…
โญ Next โœ… โœ… โœ… โœ…
โฎ Prev โœ… โœ… โœ… โœ…
Widgets Android iOS Web MacOS
๐Ÿฆ Audio Widget โœ… โœ… โœ… โœ…
๐Ÿฆ Widget Builders โœ… โœ… โœ… โœ…
๐Ÿฆ AudioPlayer Builders Extension โœ… โœ… โœ… โœ…
Properties Android iOS Web MacOS
๐Ÿ” Loop โœ… โœ… โœ… โœ…
๐Ÿ”€ Shuffle โœ… โœ… โœ… โœ…
๐Ÿ”Š get/set Volume โœ… โœ… โœ… โœ…
โฉ get/set Play Speed โœ… โœ… โœ… โœ…
โฉ get/set Pitch โœ… ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
Listeners Android iOS Web MacOS
๐Ÿฆป Listener onReady(completeDuration) โœ… โœ… โœ… โœ…
๐Ÿฆป Listener currentPosition โœ… โœ… โœ… โœ…
๐Ÿฆป Listener finished โœ… โœ… โœ… โœ…
๐Ÿฆป Listener buffering โœ… โœ… โœ… โœ…
๐Ÿฆป Listener volume โœ… โœ… โœ… โœ…
๐ŸฆปListener Play Speed โœ… โœ… โœ… โœ…
๐ŸฆปListener Pitch โœ… ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ

๐Ÿ“ Import assets files

No needed to copy songs to a media cache, with assets_audio_player you can open them directly from the assets.

  1. Create an audio directory in your assets (not necessary named "audios")
  2. Declare it inside your pubspec.yaml
flutter:
  assets:
    - assets/audios/

๐Ÿ› ๏ธ Getting Started

final assetsAudioPlayer = AssetsAudioPlayer();

assetsAudioPlayer.open(
    Audio("assets/audios/song1.mp3"),
);

You can also play network songs from url

final assetsAudioPlayer = AssetsAudioPlayer();

try {
    await assetsAudioPlayer.open(
        Audio.network("http://www.mysite.com/myMp3file.mp3"),
    );
} catch (t) {
    //mp3 unreachable
}

LiveStream / Radio from url

The main difference with network, if you pause/play, on livestream it will resume to present duration

final assetsAudioPlayer = AssetsAudioPlayer();

try {
    await assetsAudioPlayer.open(
        Audio.liveStream(MY_LIVESTREAM_URL),
    );
} catch (t) {
    //stream unreachable
}

And play songs from file

//create a new player
final assetsAudioPlayer = AssetsAudioPlayer();

assetsAudioPlayer.open(
    Audio.file(FILE_URI),
);

for file uri, please look at https://pub.dev/packages/path_provider

assetsAudioPlayer.playOrPause();
assetsAudioPlayer.play();
assetsAudioPlayer.pause();
assetsAudioPlayer.seek(Duration to);
assetsAudioPlayer.seekBy(Duration by);
assetsAudioPlayer.forwardRewind(double speed);
//if positive, forward, if negative, rewind
assetsAudioPlayer.stop();

Notifications

notification

notification

on iOS, it will use MPNowPlayingInfoCenter

  1. Add metas inside your audio
final audio = Audio.network("/assets/audio/country.mp3",
    metas: Metas(
            title:  "Country",
            artist: "Florent Champigny",
            album: "CountryAlbum",
            image: MetasImage.asset("assets/images/country.jpg"), //can be MetasImage.network
          ),
   );
  1. open with showNotification: true
_player.open(audio, showNotification: true)

Custom notification

Custom icon (android only)

By ResourceName

Make sure you added those icons inside your android/res/drawable !!! not on flutter assets !!!!

await _assetsAudioPlayer.open(
        myAudio,
        showNotification: true,
        notificationSettings: NotificationSettings(
            customStopIcon: AndroidResDrawable(name: "ic_stop_custom"),
            customPauseIcon: AndroidResDrawable(name:"ic_pause_custom"),
            customPlayIcon: AndroidResDrawable(name:"ic_play_custom"),
            customPrevIcon: AndroidResDrawable(name:"ic_prev_custom"),
            customNextIcon: AndroidResDrawable(name:"ic_next_custom"),
        )

And don't forget tell proguard to keep those resources for release mode

(part Keeping Resources)

https://sites.google.com/a/android.com/tools/tech-docs/new-build-system/resource-shrinking

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/ic_next_custom, @drawable/ic_prev_custom, @drawable/ic_pause_custom, @drawable/ic_play_custom, @drawable/ic_stop_custom"/>

By Manifest

  1. Add your icon into your android's res folder (android/app/src/main/res)

  2. Reference this icon into your AndroidManifest (android/app/src/main/AndroidManifest.xml)

<meta-data
     android:name="assets.audio.player.notification.icon"
     android:resource="@drawable/ic_music_custom"/>

You can also change actions icons

<meta-data
    android:name="assets.audio.player.notification.icon.play"
    android:resource="@drawable/ic_play_custom"/>
<meta-data
    android:name="assets.audio.player.notification.icon.pause"
    android:resource="@drawable/ic_pause_custom"/>
<meta-data
    android:name="assets.audio.player.notification.icon.stop"
    android:resource="@drawable/ic_stop_custom"/>
<meta-data
    android:name="assets.audio.player.notification.icon.next"
    android:resource="@drawable/ic_next_custom"/>
<meta-data
    android:name="assets.audio.player.notification.icon.prev"
    android:resource="@drawable/ic_prev_custom"/>

Handle notification click (android)

Add in main

AssetsAudioPlayer.setupNotificationsOpenAction((notification) {
    //custom action
    return true; //true : handled, does not notify others listeners
                 //false : enable others listeners to handle it
});

Then if you want a custom action on widget

AssetsAudioPlayer.addNotificationOpenAction((notification) {
   //custom action
   return false; //true : handled, does not notify others listeners
                 //false : enable others listeners to handle it
});

Custom actions

You can enable/disable a notification action

open(AUDIO,
   showNotification: true,
   notificationSettings: NotificationSettings(
       prevEnabled: false, //disable the previous button

       //and have a custom next action (will disable the default action)
       customNextAction: (player) {
         print("next");
       }
   )

)

Update audio's metas / notification content

After your audio creation, just call

audio.updateMetas(
       player: _assetsAudioPlayer, //add the player if the audio is actually played
       title: "My new title",
       artist: "My new artist",
       //if I not provide a new album, it keep the old one
       image: MetasImage.network(
         //my new image url
       ),
);

Bluetooth Actions

You have to enable notification to make them work

Available remote commands :

  • Play / Pause
  • Next
  • Prev
  • Stop

HeadPhone Strategy

(Only for Android for now)

while opening a song/playlist, add a strategy

assetsAudioPlayer.open(
   ...
  headPhoneStrategy: HeadPhoneStrategy.pauseOnUnplug,
  //headPhoneStrategy: HeadPhoneStrategy.none, //default
  //headPhoneStrategy: HeadPhoneStrategy.pauseOnUnplugPlayOnPlug,
)

If you want to make it work on bluetooth too, you'll have to add the BLUETOOTH permission inside your AndroidManifest.xml

<uses-permission android:name="android.permission.BLUETOOTH" />

โ›“ Play in parallel / simultaneously

You can create new AssetsAudioPlayer using AssetsAudioPlayer.newPlayer(), which will play songs in a different native Media Player

This will enable to play two songs simultaneously

You can have as many player as you want !

///play 3 songs in parallel
AssetsAudioPlayer.newPlayer().open(
    Audio("assets/audios/song1.mp3")
);
AssetsAudioPlayer.newPlayer().open(
    Audio("assets/audios/song2.mp3")
);

//another way, with create, open, play & dispose the player on finish
AssetsAudioPlayer.playAndForget(
    Audio("assets/audios/song3.mp3")
);

Each player has an unique generated id, you can retrieve or create them manually using

final player = AssetsAudioPlayer.withId(id: "MY_UNIQUE_ID");

๐Ÿ—„๏ธ Playlist

assetsAudioPlayer.open(
  Playlist(
    audios: [
      Audio("assets/audios/song1.mp3"),
      Audio("assets/audios/song2.mp3")
    ]
  ),
  loopMode: LoopMode.playlist //loop the full playlist
);

assetsAudioPlayer.next();
assetsAudioPlayer.prev();
assetsAudioPlayer.playlistPlayAtIndex(1);

Audio Widget

If you want a more flutter way to play audio, try the AudioWidget !

sample

//inside a stateful widget

bool _play = false;

@override
Widget build(BuildContext context) {
  return AudioWidget.assets(
     path: "assets/audios/country.mp3",
     play: _play,
     child: RaisedButton(
           child: Text(
               _play ? "pause" : "play",
           ),
           onPressed: () {
               setState(() {
                 _play = !_play;
               });
           }
      ),
      onReadyToPlay: (duration) {
          //onReadyToPlay
      },
      onPositionChanged: (current, duration) {
          //onPositionChanged
      },
  );
}

How to ๐Ÿ›‘ stop ๐Ÿ›‘ the AudioWidget ?

Just remove the Audio from the tree ! Or simply keep play: false

๐ŸŽง Listeners

All listeners exposes Streams Using RxDart, AssetsAudioPlayer exposes some listeners as ValueObservable (Observable that provides synchronous access to the last emitted item);

๐ŸŽต Current song

//The current playing audio, filled with the total song duration
assetsAudioPlayer.current //ValueObservable<PlayingAudio>

//Retrieve directly the current played asset
final PlayingAudio playing = assetsAudioPlayer.current.value;

//Listen to the current playing song
assetsAudioPlayer.current.listen((playingAudio){
    final asset = playingAudio.assetAudio;
    final songDuration = playingAudio.duration;
})

โŒ› Current song duration

//Listen to the current playing song
final duration = assetsAudioPlayer.current.value.duration;

โณ Current position (in seconds)

assetsAudioPlayer.currentPosition //ValueObservable<Duration>

//retrieve directly the current song position
final Duration position = assetsAudioPlayer.currentPosition.value;

return StreamBuilder(
    stream: assetsAudioPlayer.currentPosition,
    builder: (context, asyncSnapshot) {
        final Duration duration = asyncSnapshot.data;
        return Text(duration.toString());
    }),

or use a PlayerBuilder !

PlayerBuilder.currentPosition(
     player: _assetsAudioPlayer,
     builder: (context, duration) {
       return Text(duration.toString());
     }
)

or Player Builder Extension

_assetsAudioPlayer.builderCurrentPosition(
     builder: (context, duration) {
       return Text(duration.toString());
     }
)

โ–ถ IsPlaying

boolean observable representing the current mediaplayer playing state

assetsAudioPlayer.isPlaying // ValueObservable<bool>

//retrieve directly the current player state
final bool playing = assetsAudioPlayer.isPlaying.value;

//will follow the AssetsAudioPlayer playing state
return StreamBuilder(
    stream: assetsAudioPlayer.isPlaying,
    builder: (context, asyncSnapshot) {
        final bool isPlaying = asyncSnapshot.data;
        return Text(isPlaying ? "Pause" : "Play");
    }),

or use a PlayerBuilder !

PlayerBuilder.isPlaying(
     player: _assetsAudioPlayer,
     builder: (context, isPlaying) {
       return Text(isPlaying ? "Pause" : "Play");
     }
)

or Player Builder Extension

_assetsAudioPlayer.builderIsPlaying(
     builder: (context, isPlaying) {
       return Text(isPlaying ? "Pause" : "Play");
     }
)

๐Ÿ”Š Volume

Change the volume (between 0.0 & 1.0)

assetsAudioPlayer.setVolume(0.5);

The media player can follow the system "volume mode" (vibrate, muted, normal) Simply set the respectSilentMode optional parameter as true

_player.open(PLAYABLE, respectSilentMode: true);

https://developer.android.com/reference/android/media/AudioManager.html?hl=fr#getRingerMode()

https://developer.apple.com/documentation/avfoundation/avaudiosessioncategorysoloambient

Listen the volume

return StreamBuilder(
    stream: assetsAudioPlayer.volume,
    builder: (context, asyncSnapshot) {
        final double volume = asyncSnapshot.data;
        return Text("volume : $volume");
    }),

or use a PlayerBuilder !

PlayerBuilder.volume(
     player: _assetsAudioPlayer,
     builder: (context, volume) {
       return Text("volume : $volume");
     }
)

โœ‹ Finished

Called when the current song has finished to play,

it gives the Playing audio that just finished

assetsAudioPlayer.playlistAudioFinished //ValueObservable<Playing>

assetsAudioPlayer.playlistAudioFinished.listen((Playing playing){

})

Called when the complete playlist has finished to play

assetsAudioPlayer.playlistFinished //ValueObservable<bool>

assetsAudioPlayer.playlistFinished.listen((finished){

})

๐Ÿ” Looping

final LoopMode loopMode = assetsAudioPlayer.loop;
// possible values
// LoopMode.none : not looping
// LoopMode.single : looping a single audio
// LoopMode.playlist : looping the fyll playlist

assetsAudioPlayer.setLoopMode(LoopMode.single);

assetsAudioPlayer.loopMode.listen((loopMode){
    //listen to loop
})

assetsAudioPlayer.toggleLoop(); //toggle the value of looping

๐Ÿƒ Play Speed

assetsAudioPlayer.setPlaySpeed(1.5);

assetsAudioPlayer.playSpeed.listen((playSpeed){
    //listen to playSpeed
})

//change play speed for a particular Audio

Audio audio = Audio.network(
    url,
    playSpeed: 1.5
);
assetsAudioPlayer.open(audio);

๐ŸŽ™๏ธ Pitch

assetsAudioPlayer.setPitch(1.2);

assetsAudioPlayer.pitch.listen((pitch){
    //listen to pitch
})

//change pitch for a particular Audio

Audio audio = Audio.network(
    url,
    pitch: 1.2
);
assetsAudioPlayer.open(audio);

Error Handling

By default, on playing error, it stop the audio

BUT you can add a custom behavior

_player.onErrorDo = (handler){
  handler.player.stop();
};

Open another audio

_player.onErrorDo = (handler){
  handler.player.open(ANOTHER_AUDIO);
};

Try to open again on same position

_player.onErrorDo = (handler){
  handler.player.open(
      handler.playlist.copyWith(
        startIndex: handler.playlistIndex
      ),
      seek: handler.currentPosition
  );
};

Network Policies (android/iOS/macOS)

Android only allow HTTPS calls, you will have an error if you're using HTTP, don't forget to add INTERNET permission and seet usesCleartextTraffic="true" in your AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        ...
        android:usesCleartextTraffic="true"
        ...>
        ...
    </application>
</manifest>

iOS only allow HTTPS calls, you will have an error if you're using HTTP, don't forget to edit your info.plist and set NSAppTransportSecurity to NSAllowsArbitraryLoads

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

To enable http calls on macOs, you have to add input/output calls capabilities into info.plist

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
<key>UIBackgroundModes</key>
<array>
    <string>audio</string>
    <string>fetch</string>
</array>
<key>com.apple.security.network.client</key>
<true/>

and in your

Runner/DebugProfile.entitlements

add

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

Complete Runner/DebugProfile.entitlements

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.security.app-sandbox</key>
	<true/>
	<key>com.apple.security.cs.allow-jit</key>
	<true/>
	<key>com.apple.security.network.server</key>
	<true/>
	<key>com.apple.security.network.client</key>
	<true/>
</dict>
</plist>

๐ŸŽถ Musics

All musics used in the samples came from https://www.freemusicarchive.org/

flutter-assetsaudioplayer's People

Contributors

ahmedabogameel avatar alexmercerind avatar alichter avatar asmengistu avatar byteszero avatar campcoxconsultants avatar florent37 avatar fyt7943tyf avatar jaichangpark avatar jeremiahseun avatar kalismeras61 avatar luis901101 avatar markst avatar mayb3nots avatar nikitadol avatar nohli avatar offline-first avatar preetjdp avatar rishiagrawal2609 avatar sahharyoucef avatar shadyboshra2012 avatar siddharth-cmd avatar simon-hypecast avatar sumitkakshapati avatar tinusneethling avatar vbuberen avatar vipulasri avatar xni06 avatar zbutwialypiernik avatar zerobytesx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter-assetsaudioplayer's Issues

1ใ€Resource acquisition problem๏ผŒ2ใ€Pod problem

project is oc
1ใ€
guard let urlo = Bundle.main.url(forResource: asset, withExtension: "", subdirectory: "flutter_assets/"+folder) else {
log("resource not found "+asset)
result("")
return
}

The file path may not be available

2ใ€pod
[!] Unable to determine Swift version for the following pods:

  • assets_audio_player does not specify a Swift version and none of the targets (Runner) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

IOS build - invalid redeclaration of 'SwiftAssetsAudioPlayerPlugin'

    ** BUILD FAILED **
Xcode's output:
โ†ณ
    /Users/neto/.flutter-sdk/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.3.0/ios/Classes/AssetsAudioPlayer.swift:5:14: error: invalid redeclaration of 'SwiftAssetsAudioPlayerPlugin'
    public class SwiftAssetsAudioPlayerPlugin: NSObject, FlutterPlugin {

iOS App crashes - Segmentation fault: 11

Problem

I use AssetsAudioPlayer to play some very short sound effects in my app.
The app crashes usually after the sound is played 10~20 times.
If I comment out the line with AssetsAudioPlayer.open() the app won't crash any more.

AssetsAudioPlayer Version
1.3.9+2

Flutter/Dart Version

Flutter 1.17.0-3.2.pre โ€ข channel beta โ€ข https://github.com/flutter/flutter.git
Framework โ€ข revision 2a7bc389f2 (5 days ago) โ€ข 2020-04-21 20:34:20 -0700
Engine โ€ข revision 4c8c31f591
Tools โ€ข Dart 2.8.0 (build 2.8.0-dev.20.10)

Code

class _GameState extends State<GameWidget> {
  final _mainAudioPlayer = AssetsAudioPlayer.withId("main");
  
  bool onDisabledObjectTapped() {
    _mainAudioPlayer.open(Audio("sounds/noselect.wav"));
  }

Crash log

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [80793]

Application Specific Information:
CoreSimulator 704.12.1 - Device: iPad Air (3rd generation) (D5D16276-A3AB-4712-BD62-428FDD5D06AB) - Runtime: iOS 13.4 (17E8260) - DeviceType: iPad Air (3rd generation)

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               	0x00007fff50ad65f1 object_isClass + 8
1   com.apple.Foundation          	0x00007fff258e1295 KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED + 54
2   com.apple.Foundation          	0x00007fff258dd6a3 NSKeyValueWillChangeWithPerThreadPendingNotifications + 240
3   com.apple.avfoundation        	0x00007fff2095e5f2 -[AVPlayer setAutomaticallyWaitsToMinimizeStalling:] + 81
4   com.apple.avfoundation        	0x00007fff209570b0 -[AVPlayer init] + 1106
5   com.apple.avfoundation        	0x00007fff20956ad8 -[AVPlayer initWithPlayerItem:] + 34
6   org.cocoapods.assets-audio-player	0x000000010303b26f @nonobjc AVPlayer.init(playerItem:) + 31
7   org.cocoapods.assets-audio-player	0x000000010303b247 AVPlayer.__allocating_init(playerItem:) + 39
8   org.cocoapods.assets-audio-player	0x000000010303a4df Player.open(assetPath:audioType:autoStart:volume:seek:respectSilentMode:result:) + 1967 (AssetsAudioPlayer.swift:94)
9   org.cocoapods.assets-audio-player	0x0000000103044087 closure #1 in Music.start() + 18711 (AssetsAudioPlayer.swift:312)
10  org.cocoapods.assets-audio-player	0x0000000103044240 thunk for @escaping @callee_guaranteed (@guaranteed FlutterMethodCall, @unowned @callee_guaranteed (@in_guaranteed Any?) -> ()) -> () + 64
11  org.cocoapods.assets-audio-player	0x00000001030442f3 thunk for @escaping @callee_guaranteed (@guaranteed FlutterMethodCall, @guaranteed @escaping @callee_guaranteed (@in_guaranteed Any?) -> ()) -> () + 147
12  io.flutter.flutter            	0x0000000100ee5b5f __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 104
13  io.flutter.flutter            	0x0000000100e747a2 flutter::PlatformMessageRouter::HandlePlatformMessage(fml::RefPtr<flutter::PlatformMessage>) const + 166
14  io.flutter.flutter            	0x0000000100e788fa flutter::PlatformViewIOS::HandlePlatformMessage(fml::RefPtr<flutter::PlatformMessage>) + 38
15  io.flutter.flutter            	0x0000000100edf83b std::__1::__function::__func<flutter::Shell::OnEngineHandlePlatformMessage(fml::RefPtr<flutter::PlatformMessage>)::$_32, std::__1::allocator<flutter::Shell::OnEngineHandlePlatformMessage(fml::RefPtr<flutter::PlatformMessage>)::$_32>, void ()>::operator()() + 57
16  io.flutter.flutter            	0x0000000100e893e7 fml::MessageLoopImpl::FlushTasks(fml::FlushType) + 117
17  io.flutter.flutter            	0x0000000100e8e334 fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*) + 26
18  com.apple.CoreFoundation      	0x00007fff23d9e634 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
19  com.apple.CoreFoundation      	0x00007fff23d9e2ce __CFRunLoopDoTimer + 1038
20  com.apple.CoreFoundation      	0x00007fff23d9d92a __CFRunLoopDoTimers + 282
21  com.apple.CoreFoundation      	0x00007fff23d9857e __CFRunLoopRun + 1950
22  com.apple.CoreFoundation      	0x00007fff23d97ac4 CFRunLoopRunSpecific + 404
23  com.apple.GeoServices         	0x00007fff38b2fc1a GSEventRunModal + 139
24  com.apple.UIKitCore           	0x00007fff48bc7f80 UIApplicationMain + 1605
25  com.ubertao.FlutterJungle     	0x0000000100d9d1ab main + 75 (AppDelegate.swift:5)
26  libdyld.dylib                 	0x00007fff519521fd start + 1

Respect Silence

Is there anyway to respect silence of the mute switch?

I like this library better than other audioplayers but its missing that key feature

ambiguous reference to member 'setCategory'

`Failed to build iOS app
Error output from Xcode build:
โ†ณ
** BUILD FAILED **

Xcode's output:
โ†ณ
/Users/fltdev/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.0.1/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:110:32: error: ambiguous reference to member 'setCategory'
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, with: .mixWithOthers)
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
AVFoundation.AVAudioSession:22:15: note: found this candidate
open func setCategory(_ category: AVAudioSession.Category) throws
^
AVFoundation.AVAudioSession:24:15: note: found this candidate
open func setCategory(_ category: AVAudioSession.Category, options: AVAudioSession.CategoryOptions = []) throws
^
AVFoundation.AVAudioSession:27:15: note: found this candidate
open func setCategory(_ category: AVAudioSession.Category, withOptions options: AVAudioSession.CategoryOptions = []) throws
^
AVFoundation.AVAudioSession:29:15: note: found this candidate
open func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions = []) throws
^
AVFoundation.AVAudioSession:31:15: note: found this candidate
open func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, policy: AVAudioSession.RouteSharingPolicy, options: AVAudioSession.CategoryOptions = []) throws
^
AVFoundation.AVAudioSession:34:15: note: found this candidate
open func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, routeSharingPolicy policy: AVAudioSession.RouteSharingPolicy, options: AVAudioSession.CategoryOptions = []) throws
^
note: Using new build system
note: Planning build
note: Constructing build description`

Rare behaviour with time

This is a minor issue, but when the audio file is opened for the first time, you can see that time goes from 0 to 1 seconds, then goes back to 0 and then the audio file starts normally. This only happens sometimes.

Loop Bug

When setting the loop to true.
If I change the volume, it resets on restarting the song

IOS build - error: type 'AVAudioSession.Category' (aka 'NSString') has no member 'playback'

    ** BUILD FAILED **
Xcode's output:
โ†ณ
    /Users/neto/.flutter-sdk/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.3.0/ios/Classes/AssetsAudioPlayer.swift:44:93: error: type 'AVAudioSession.Category' (aka 'NSString') has no member 'playback'
                        try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: AVAudioSession.Mode.default, options: [])

Play (short) audios simultaneously

TL;DR I want to play different short audios without blocking each other if any of them is played before the last one finishes. Down below i explained what i did in more detail.


I have different play buttons on the same screen and each have different AssetAudioPlayer instance. Each button has different instance because i load the audios(_assetAudioPlayer.open(_assetAudio)) on my 'Loading' page to prevent delays while playing. Unfortunately, all the buttons play the same audio which loaded last. Also i can't play again before the last audio finishes.

I realized that _assetAudioPlayer.open(_assetAudio) happens very quickly so i can repeat it at every play event. But this time it stops other play events if there is any.

Is it possible to achieve playing non-blocking audios without trading off performance?

Compatibily with rxdart

Does not work with current version of rxdart (0.22)
Can you please update the plugin ?

Because bloc 0.13.0 depends on rxdart ^0.22.0 and no versions of bloc match >0.13.0 <0.14.0, bloc ^0.13.0 requires rxdart ^0.22.0.
And because every version of assets_audio_player depends on rxdart ^0.20.0, assets_audio_player is incompatible with bloc ^0.13.0.
And because flutter_bloc 0.13.0 depends on bloc ^0.13.0 and no versions of flutter_bloc match >0.13.0 <0.14.0, assets_audio_player is incompatible with flutter_bloc ^0.13.0.
So, because tibe depends on both flutter_bloc ^0.13.0 and assets_audio_player ^1.0.1, version solving failed.

iOS Issues related to import_js_library

I can't run this on iOS because the cocoapods installer runs into an issue:

[!] No podspec found for `import_js_library` in `.symlinks/plugins/import_js_library/ios`

The App stop work while another app has sound

Hello, we have a problem for the last update. It is working for phone calling but when i open another app like youtube or default music player that start to play any sound my App stop working. (it crushes and doesn't go on until i close and reopen again. ) Can you check it please?

Error on IOS Device

Hello, I am trying to run this plugin on IOS device but not work.

you can see console log.
I think this plugin and sqflite plugin give error. Because i removed AssetsAudioPlayer then I tried, that is work.
sorry my bad english.

IOS version : 12.1
XCODE version : 10

***Console Log
`Launching lib/GameStartPage.dart on iPhone 8 in debug mode...
Running pod install...
Starting Xcode build...
Xcode build done. 5.6s
Failed to build iOS app
Error output from Xcode build:
โ†ณ
** BUILD FAILED **

Xcode's output:
โ†ณ
=== BUILD TARGET sqflite OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/onur/Documents/src/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.0.1/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:110:49: error: 'setCategory(:with:)' is unavailable in Swift
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, with: .mixWithOthers)
^~~~~~~~~~~
AVFoundation.AVAudioSession:26:15: note: 'setCategory(
:with:)' has been explicitly marked unavailable here
open func setCategory(_ category: AVAudioSession.Category, with options: AVAudioSession.CategoryOptions = []) throws
^
/Users/onur/Documents/src/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.0.1/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:110:61: error: 'AVAudioSessionCategoryPlayback' has been renamed to 'AVAudioSession.Category.playback'
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, with: .mixWithOthers)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AVAudioSession.Category.playback
AVFoundation.AVAudioSessionCategoryPlayback:3:12: note: 'AVAudioSessionCategoryPlayback' was obsoleted in Swift 3
public let AVAudioSessionCategoryPlayback: AVAudioSession.Category
^

Could not build the application for the simulator.
Error launching application on iPhone 8.
`

Volume control

could this be supported or is it too complicated to implement yet?

build errors

when I try to build the app that is what I get :

Running "flutter packages get" in adliss...                         1,5s
Launching lib\main.dart on PGN528 in debug mode...
Initializing gradle...
Resolving dependencies...
Finished with error: Please review your Gradle project setup in the android/ folder.
* Error running Gradle:
ProcessException: Process "D:\codeLabs\adliss\android\gradlew.bat" exited abnormally:

> Configure project :app
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.


FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
The following dependencies do not satisfy the required version:
project ':assets_audio_player' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
  Command: D:\codeLabs\adliss\android\gradlew.bat app:properties

Xcode build failed

I saw that there are already issues about this but i tried 'flutter clean' and i still get:
/Users/erolasan/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.3.0/ios/Classes/Asset sAudioPlayer.swift:5:14: error: invalid redeclaration of 'SwiftAssetsAudioPlayerPlugin' public class SwiftAssetsAudioPlayerPlugin: NSObject, FlutterPlugin { /Users/erolasan/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.3.0/ios/Classes/Swift AssetsAudioPlayerPlugin.swift:4:14: note: 'SwiftAssetsAudioPlayerPlugin' previously declared here public class SwiftAssetsAudioPlayerPlugin: NSObject, FlutterPlugin {

I tried deleting Pods folder -> pod install -> flutter clean - xcode build and i still get the same error

Example code pubspec.yaml gives error code 66

Good morning. When I run the example code included on the github,and I attempt to run the pubspec.yaml file,this occurs.

Could not find a file named "pubspec.yaml" in "C:\Users\Skelly\Documents\offline code". pub get failed (66) exit code 66

How can I fix this?

Loop Feature or play again

hi..., is there any chance to make sound loop ?

Also i have no idea audioPlayer.finished.listen never called even the music is already end. here is the log of the end of music.

V/MediaPlayer-JNI(18285): getCurrentPosition: 138001 (msec)
V/MediaPlayer-JNI(18285): getCurrentPosition: 138304 (msec)
V/MediaPlayer-JNI(18285): getCurrentPosition: 138607 (msec)
V/MediaPlayerNative(18285): message received msg=2, ext1=0, ext2=0
V/MediaPlayerNative(18285): playback complete
V/MediaPlayerNative(18285): callback application
V/MediaPlayerNative(18285): back from callback
V/MediaPlayerNative(18285): message received msg=211, ext1=0, ext2=0
V/MediaPlayerNative(18285): unrecognized message: (211, 0, 0)
V/MediaPlayerNative(18285): callback application
V/MediaPlayerNative(18285): back from callback
V/MediaPlayer-JNI(18285): getCurrentPosition: 138767 (msec)
I/chatty  (18285): uid=10277(com.teamcoret.findpairs.findpairs) identical 1 line
V/MediaPlayer-JNI(18285): getCurrentPosition: 138767 (msec)
V/MediaPlayer-JNI(18285): getCurrentPosition: 138767 (msec)
I/chatty  (18285): uid=10277(com.teamcoret.findpairs.findpairs) identical 1 line
V/MediaPlayer-JNI(18285): getCurrentPosition: 138767 (msec)
V/MediaPlayer-JNI(18285): getCurrentPosition: 138767 (msec)

and the log currentPosition always loop.

Bug in Android release mode even after Flutter clean

I am having this issue in release mode even after i do flutter clean. I tried the version of the gradle but another error is shown

Gabriels-MacBook-Pro:lyric_hero jumpbotron$ flutter clean
Cleaning Xcode workspace...                                         9.4s
Deleting build...                                                1,082ms
Deleting .dart_tool...                                               2ms
Deleting Generated.xcconfig...                                       2ms
Deleting flutter_export_environment.sh...                            1ms
Gabriels-MacBook-Pro:lyric_hero jumpbotron$ Minimum supported Gradle version is 4.10.1.
bash: Minimum: command not found
Gabriels-MacBook-Pro:lyric_hero jumpbotron$ flutter run -d ba2b9fba2ef7 --release
Launching lib/main.dart on Mi A3 in release mode...
Note: /Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.3+1/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.                    
Note: /Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.13.0+1/android/src/main/java/io/flutter/plugins/firebase/cloudfirestore/CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.                      
Note: /Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_database-3.1.1/android/src/main/java/io/flutter/plugins/firebase/database/FirebaseDatabasePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.                    
/Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage-3.1.1/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java:60: warning: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated
        binding.getApplicationContext(), binding.getFlutterEngine().getDartExecutor());
                                                ^                       
1 warning                                                               
Note: Some input files use or override a deprecated API.                
Note: Recompile with -Xlint:deprecation for details.                    
Note: /Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/webview_media-0.1.1+3/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebView.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.                      
/Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.6+1/android/src/main/java/io/flutter/plugins/sharedpreferences/SharedPreferencesPlugin.java:25: warning: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated
    setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext());
                        ^                                               
1 warning                                                               
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Execution failed for task ':clipboard_manager:verifyReleaseResources'.  
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed                                    
     /Users/jumpbotron/.gradle/caches/transforms-2/files-2.1/1128c5e807499d6aa189b07ac586a9bf/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
                                                                        
     /Users/jumpbotron/.gradle/caches/transforms-2/files-2.1/1128c5e807499d6aa189b07ac586a9bf/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
                                                                        
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                        
* Get more help at https://help.gradle.org                              
                                                                        
BUILD FAILED in 58s                                                     
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      59.4s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the
incompatibility.
Building plugin assets_audio_player...
Running Gradle task 'assembleAarRelease'...                             
Running Gradle task 'assembleAarRelease'... Done                    1.1s


FAILURE: Build failed with an exception.

* Where:
Build file '/Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.3.0/android/build.gradle' line: 24

* What went wrong:
A problem occurred evaluating root project 'assets_audio_player'.
> Failed to apply plugin [id 'com.android.library']
   > Minimum supported Gradle version is 4.10.1. Current version is 4.6. If using the gradle wrapper, try editing the distributionUrl in /Users/jumpbotron/Documents/programming/installations/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.3.0/android/gradle/wrapper/gradle-wrapper.properties to gradle-4.10.1-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s


The plugin assets_audio_player could not be built due to the issue above.

Can not build on iOS devices


           2020-02-29 18:06:02.704 xcodebuild[14409:311592]  DTDeviceKit: deviceType from 1394652bb7fc960ff7fbc21ce6f000aa2289e4f1 was NULL
[   +4 ms] Failed to build iOS app
[        ] Error output from Xcode build:
           โ†ณ
[        ]     2020-02-29 18:05:58.332 xcodebuild[14387:311248]  DTDeviceKit: deviceType from a5a68d8f8f628f8e7c8ac56b2889580522c21d31 was NULL
               2020-02-29 18:05:58.424 xcodebuild[14387:311244]  DTDeviceKit: deviceType from a5a68d8f8f628f8e7c8ac56b2889580522c21d31 was NULL
               2020-02-29 18:05:58.775 xcodebuild[14387:311320]  DTDeviceKit: deviceType from 1394652bb7fc960ff7fbc21ce6f000aa2289e4f1 was NULL
               ** BUILD FAILED **


[        ] Xcode's output:
           โ†ณ
[        ]     /Users/truonghuy/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.2.3/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:114:65: error: 'AVAudioSessionCategoryPlayback' has been renamed to 'AVAudioSession.Category.playback'
                               try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, mode: AVAudioSessionModeDefault, options: [])
                                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                               AVAudioSession.Category.playback
               AVFoundation.AVAudioSessionCategoryPlayback:3:12: note: 'AVAudioSessionCategoryPlayback' was obsoleted in Swift 3
               public let AVAudioSessionCategoryPlayback: AVAudioSession.Category
                          ^
               /Users/truonghuy/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.2.3/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:114:103: error: 'AVAudioSessionModeDefault' has been renamed to 'AVAudioSession.Mode.default'
                               try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, mode: AVAudioSessionModeDefault, options: [])
                                                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                     AVAudioSession.Mode.default
               AVFoundation.AVAudioSessionModeDefault:3:12: note: 'AVAudioSessionModeDefault' was obsoleted in Swift 3
               public let AVAudioSessionModeDefault: AVAudioSession.Mode
                          ^
               /Users/truonghuy/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.2.3/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:116:36: error: ambiguous reference to member 'setCategory'
                               try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, with: .mixWithOthers)
                                   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
               AVFoundation.AVAudioSession:22:15: note: found this candidate
                   open func setCategory(_ category: AVAudioSession.Category) throws
                             ^
               AVFoundation.AVAudioSession:24:15: note: found this candidate
                   open func setCategory(_ category: AVAudioSession.Category, options: AVAudioSession.CategoryOptions = []) throws
                             ^
               AVFoundation.AVAudioSession:27:15: note: found this candidate
                   open func setCategory(_ category: AVAudioSession.Category, withOptions options: AVAudioSession.CategoryOptions = []) throws
                             ^
               AVFoundation.AVAudioSession:29:15: note: found this candidate
                   open func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, options: AVAudioSession.CategoryOptions = []) throws
                             ^
               AVFoundation.AVAudioSession:31:15: note: found this candidate
                   open func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, policy: AVAudioSession.RouteSharingPolicy, options: AVAudioSession.CategoryOptions = []) throws
                             ^
               AVFoundation.AVAudioSession:34:15: note: found this candidate
                   open func setCategory(_ category: AVAudioSession.Category, mode: AVAudioSession.Mode, routeSharingPolicy policy: AVAudioSession.RouteSharingPolicy, options: AVAudioSession.CategoryOptions = []) throws
                             ^
               note: Using new build system
               note: Planning build
               note: Constructing build description

[   +3 ms] Could not build the precompiled application for the device.

Could not find assets_audio_player-Swift.h

I am using version ^1.2.3, it works on Windows using android, but I am getting this error when trying to build it on a mac.

=== BUILD TARGET assets_audio_player OF PROJECT Pods WITH CONFIGURATION Debug ===
    /Users/tobbe/development/flutter/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.2.3/ios/Classes/AssetsAudioPlayerPlugin.m:2:9: fatal error:
    'assets_audio_player/assets_audio_player-Swift.h' file not found
    #import <assets_audio_player/assets_audio_player-Swift.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

Support for Swift 4

When using Xcode 10.2, flutter run returns the error:

Xcode's output:
โ†ณ
  === BUILD TARGET assets_audio_player OF PROJECT Pods WITH CONFIGURATION Debug ===
    
 The โ€œSwift Language Versionโ€ (SWIFT_VERSION) build setting must be set to a supported value for
 targets which use Swift. Supported values are: 4.0, 4.2, 5.0. This setting can be set in the
 build settings editor.

And when using Xcode to open the project, the error message is:

Unsupported Swift Version

The target โ€œassets_audio_playerโ€ contains source code developed with Swift 3.x. This version of Xcode does not support building or migrating Swift 3.x targets.

Use Xcode 10.1 to migrate the code to Swift 4.

It seems migration to Swift 4 is necessary to catch up with the iOS platform.

onAudioFocusChange problem

I am using, your plugin, but i am also using Speech Recognition. When i held down for activating speech recognition, sounds automaticly paused. But i dont want this i just want to set volume low instead of pause. Music in the background should continue, I just need to slowly lower the volume.

Is there any way handle this?

AVAudioUnitEffect

Hi, any plans implementing AVAudioUnitEffect? I'm especially interested in AVAudioUnitReverb.

New Feature

is an option to fast forward and rewind audio?

sample does not work....

sample does not work....
I just build sample in /sample.

I pushed button but log: resource not log appeared.

flutter: log: resource not found song1.mp3
flutter: log: openOptional({
    file = "song2.mp3";
    folder = "assets/audios";
})
flutter: log: resource not found song2.mp3
flutter: log: openOptional({
    file = "song3.mp3";
    folder = "assets/audios";
})
flutter: log: resource not found song3.mp3
flutter: log: playnil
flutter: log: openOptional({
    file = "song2.mp3";
    folder = "assets/audios";
})
flutter: log: resource not found song2.mp3
flutter: log: openOptional({
    file = "song2.mp3";
    folder = "assets/audios";
})

Execution failed for task ':assets_audio_player:compileDebugKotlin ON 1.4.0

Launching lib\main.dart on HD1903 in debug mode...
Running Gradle task 'assembleDebug'...
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (14, 14): Conflicting declarations: internal val METHOD_POSITION: String, internal val METHOD_POSITION: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (15, 14): Conflicting declarations: internal val METHOD_VOLUME: String, internal val METHOD_VOLUME: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (16, 14): Conflicting declarations: internal val METHOD_FINISHED: String, internal val METHOD_FINISHED: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (17, 14): Conflicting declarations: internal val METHOD_IS_PLAYING: String, internal val METHOD_IS_PLAYING: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (18, 14): Conflicting declarations: internal val METHOD_CURRENT: String, internal val METHOD_CURRENT: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (19, 14): Conflicting declarations: internal val METHOD_NEXT: String, internal val METHOD_NEXT: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (20, 14): Conflicting declarations: internal val METHOD_PREV: String, internal val METHOD_PREV: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (22, 7): Redeclaration: Player
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (40, 42): Overload resolution ambiguity:
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (74, 34): Overload resolution ambiguity:
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (86, 38): Overload resolution ambiguity:
internal val METHOD_CURRENT: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_CURRENT: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (101, 34): Overload resolution ambiguity:
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (111, 34): Overload resolution ambiguity:
internal val METHOD_FINISHED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_FINISHED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (125, 34): Overload resolution ambiguity:
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (130, 34): Overload resolution ambiguity:
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (149, 34): Overload resolution ambiguity:
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (157, 34): Overload resolution ambiguity:
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (164, 34): Overload resolution ambiguity:
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (171, 34): Overload resolution ambiguity:
internal val METHOD_VOLUME: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_VOLUME: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.3.8+1\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (176, 7): Redeclaration: AssetsAudioPlayerPlugin
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (11, 14): Conflicting declarations: internal val METHOD_POSITION: String, internal val METHOD_POSITION: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (12, 14): Conflicting declarations: internal val METHOD_VOLUME: String, internal val METHOD_VOLUME: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (13, 14): Conflicting declarations: internal val METHOD_FINISHED: String, internal val METHOD_FINISHED: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (14, 14): Conflicting declarations: internal val METHOD_IS_PLAYING: String, internal val METHOD_IS_PLAYING: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (15, 14): Conflicting declarations: internal val METHOD_CURRENT: String, internal val METHOD_CURRENT: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (16, 14): Conflicting declarations: internal val METHOD_NEXT: String, internal val METHOD_NEXT: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (17, 14): Conflicting declarations: internal val METHOD_PREV: String, internal val METHOD_PREV: String
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (20, 7): Redeclaration: AssetsAudioPlayerPlugin
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (35, 40): No value passed for parameter 'channel'
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (37, 17): Unresolved reference: onVolumeChanged
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (37, 37): Cannot infer a type for this parameter. Please specify it explicitly.
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (38, 42): Overload resolution ambiguity:
internal val METHOD_VOLUME: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_VOLUME: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (40, 17): Unresolved reference: onPositionChanged
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (40, 39): Cannot infer a type for this parameter. Please specify it explicitly.
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (41, 42): Overload resolution ambiguity:
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (43, 17): Unresolved reference: onReadyToPlay
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (43, 35): Cannot infer a type for this parameter. Please specify it explicitly.
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (44, 42): Overload resolution ambiguity:
internal val METHOD_CURRENT: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_CURRENT: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (44, 58): Type inference failed: Not enough information to infer parameter V in fun <K, V> mapOf(pair: Pair<K, V>): Map<K, V>
Please specify it explicitly.

e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (48, 17): Unresolved reference: onPlaying
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (49, 42): Overload resolution ambiguity:
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (49, 61): Unresolved reference: it
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (51, 17): Unresolved reference: onFinished
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (52, 42): Overload resolution ambiguity:
internal val METHOD_FINISHED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_FINISHED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (177, 29): Type mismatch: inferred type is Boolean but MethodChannel.Result was expected
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (178, 29): Type mismatch: inferred type is MethodChannel.Result but Context was expected
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (179, 29): Too many arguments for public final fun open(assetAudioPath: String?, audioType: String, autoStart: Boolean, volume: Double, seek: Int?, result: MethodChannel.Result, context: Context): Unit defined in com.github.florent37.assets_audio_player.Player
e: C:\Tools\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.0\android\src\main\kotlin\com\github\florent37\assets_audio_player\Player.kt: (10, 7): Redeclaration: Player

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':assets_audio_player:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 18s
Finished with error: Gradle task assembleDebug failed with exit code 1

Kotlin Version Error

  • What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
    The following dependencies do not satisfy the required version:
    project ':assets_audio_player' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BU๏ฟฝLD FAILED in 4s
Finished with error: Gradle task assembleDebug failed with exit code 1

IOS compile failed

Getting below error when compiling for IOS

/Users/runner/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.2.3/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:114:103: error: 'AVAudioSessionModeDefault' has been renamed to 'AVAudioSession.Mode.default'
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, mode: AVAudioSessionModeDefault, options: [])
^~~~~~~~~~~~~~~~~~~~~~~~~
AVAudioSession.Mode.default
AVFoundation.AVAudioSessionModeDefault:3:12: note: 'AVAudioSessionModeDefault' was obsoleted in Swift 3
public let AVAudioSessionModeDefault: AVAudioSession.Mode
^
/Users/runner/.pub-cache/hosted/pub.dartlang.org/assets_audio_player-1.2.3/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:116:36: error: ambiguous reference to member 'setCategory'
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, with: .mixWithOthers)
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~

Can't find assets in iOS

When running on Android no problem. Running on iOS. I keep getting assets not found. Checked out example project. Same problem. Changed to other Flutter build. Same problem. Recopied audio files and still having same problem.
I also tried Xcode 10.3, 11.0, 11.1, 11.2

[โœ“] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15 19A583, locale en-NL)

[โœ“] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[โœ“] Xcode - develop for iOS and macOS (Xcode 11.1)
[โœ“] Android Studio (version 3.5)
[โœ“] VS Code (version 1.39.2)
[โœ“] Connected device (1 available)

Other assets in folder can be found. Like jpg and png files.

Shuffle

How can i shuffle more than audio and make it play automatic when one finished another one starts? and thank you..

Errors when trying to build iOS project

On Android it works fine, but I can't build my project in XCode due to the following errors:

assets_audio_player-1.2.3/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:114:65: 'AVAudioSessionCategoryPlayback' has been renamed to 'AVAudioSession.Category.playback'

assets_audio_player-1.2.3/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:114:65: 'AVAudioSessionCategoryPlayback' was obsoleted in Swift 3 (AVFoundation.AVAudioSessionCategoryPlayback)

assets_audio_player-1.2.3/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:114:103: 'AVAudioSessionModeDefault' has been renamed to 'AVAudioSession.Mode.default'

assets_audio_player-1.2.3/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:114:103: 'AVAudioSessionModeDefault' was obsoleted in Swift 3 (AVFoundation.AVAudioSessionModeDefault)

assets_audio_player-1.2.3/ios/Classes/SwiftAssetsAudioPlayerPlugin.swift:116:36: Ambiguous reference to member 'setCategory'

Lock screen controls

Will the player support lock screen controls? For example, as the music plays on the background and the phone goes to sleep from the lock screen the user needs to be able to pause the audio or skip or stop.

Thanks

rxdart problem

`Because XXXX depends on assets_audio_player 1.0.1 which depends on rxdart ^0.20.0, rxdart ^0.20.0 is required.

So, because XXXX depends on rxdart 0.22.0, version solving failed.`

I must downgrade rxdart from 0.22.0 to 0.20.0

bug in newer version!

the package was running fine but after upgrading to 1.26 and newer verisons my application can't run and it shows this

e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (14, 14): Conflicting declarations: internal val METHOD_FINISHED: String, internal val METHOD_FINISHED: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (15, 14): Conflicting declarations: internal val METHOD_IS_PLAYING: String, internal val METHOD_IS_PLAYING: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (16, 14): Conflicting declarations: internal val METHOD_CURRENT: String, internal val METHOD_CURRENT: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (17, 14): Conflicting declarations: internal val METHOD_NEXT: String, internal val METHOD_NEXT: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (18, 14): Conflicting declarations: internal val METHOD_PREV: String, internal val METHOD_PREV: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (20, 7): Redeclaration: AssetsAudioPlayerPlugin
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (47, 42): Overload resolution ambiguity: 
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (103, 34): Overload resolution ambiguity: 
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (107, 34): Overload resolution ambiguity: 
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (137, 34): Overload resolution ambiguity: 
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (149, 34): Overload resolution ambiguity: 
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (159, 34): Overload resolution ambiguity: 
internal val METHOD_FINISHED: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_FINISHED: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (160, 34): Overload resolution ambiguity: 
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (163, 30): Overload resolution ambiguity: 
internal val METHOD_CURRENT: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_CURRENT: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (182, 34): Overload resolution ambiguity: 
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (190, 34): Overload resolution ambiguity: 
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.5\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (197, 34): Overload resolution ambiguity: 
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (14, 14): Conflicting declarations: internal val METHOD_POSITION: String, internal val METHOD_POSITION: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (16, 14): Conflicting declarations: internal val METHOD_FINISHED: String, internal val METHOD_FINISHED: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (17, 14): Conflicting declarations: internal val METHOD_IS_PLAYING: String, internal val METHOD_IS_PLAYING: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (18, 14): Conflicting declarations: internal val METHOD_CURRENT: String, internal val METHOD_CURRENT: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (19, 14): Conflicting declarations: internal val METHOD_NEXT: String, internal val METHOD_NEXT: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (20, 14): Conflicting declarations: internal val METHOD_PREV: String, internal val METHOD_PREV: String
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (40, 42): Overload resolution ambiguity: 
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (76, 34): Overload resolution ambiguity: 
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (90, 34): Overload resolution ambiguity: 
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (100, 34): Overload resolution ambiguity: 
internal val METHOD_FINISHED: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_FINISHED: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (104, 30): Overload resolution ambiguity: 
internal val METHOD_CURRENT: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_CURRENT: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (118, 34): Overload resolution ambiguity: 
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (123, 34): Overload resolution ambiguity: 
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (142, 34): Overload resolution ambiguity: 
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (150, 34): Overload resolution ambiguity: 
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (157, 34): Overload resolution ambiguity: 
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assetsaudioplayer in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (169, 7): Redeclaration: AssetsAudioPlayerPlugin
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (175, 87): Type mismatch: inferred type is BinaryMessenger! but MethodChannel was expected
e: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.2.8\android\src\main\kotlin\com\github\florent37\assetsaudioplayer\AssetsAudioPlayerPlugin.kt: (175, 110): Too many arguments for public constructor AssetsAudioPlayerPlugin(context: Context, channel: MethodChannel) defined in com.github.florent37.assetsaudioplayer.AssetsAudioPlayerPlugin

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':assets_audio_player:compileDebugKotlin'.

Execution failed for task ':assets_audio_player:compileDebugKotlin'

Hello, after i update to version ^1.4.3+3 , i cant 'Run' my code. I paste error messages below:

Launching lib\main.dart on Xiaomi Redmi Note 7 in debug mode...
Running Gradle task 'assembleDebug'...
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (15, 14): Conflicting declarations: internal val METHOD_POSITION: String, internal val METHOD_POSITION: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (16, 14): Conflicting declarations: internal val METHOD_VOLUME: String, internal val METHOD_VOLUME: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (17, 14): Conflicting declarations: internal val METHOD_FORWARD_REWIND_SPEED: String, internal val METHOD_FORWARD_REWIND_SPEED: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (18, 14): Conflicting declarations: internal val METHOD_PLAY_SPEED: String, internal val METHOD_PLAY_SPEED: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (19, 14): Conflicting declarations: internal val METHOD_FINISHED: String, internal val METHOD_FINISHED: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (20, 14): Conflicting declarations: internal val METHOD_IS_PLAYING: String, internal val METHOD_IS_PLAYING: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (21, 14): Conflicting declarations: internal val METHOD_CURRENT: String, internal val METHOD_CURRENT: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (22, 14): Conflicting declarations: internal val METHOD_NEXT: String, internal val METHOD_NEXT: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (23, 14): Conflicting declarations: internal val METHOD_PREV: String, internal val METHOD_PREV: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (25, 7): Redeclaration: AssetsAudioPlayerPlugin
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (42, 7): Redeclaration: AssetsAudioPlayer
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (80, 42): Overload resolution ambiguity:
internal val METHOD_VOLUME: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_VOLUME: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (83, 42): Overload resolution ambiguity:
internal val METHOD_FORWARD_REWIND_SPEED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_FORWARD_REWIND_SPEED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (86, 42): Overload resolution ambiguity:
internal val METHOD_PLAY_SPEED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_PLAY_SPEED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (89, 42): Overload resolution ambiguity:
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (92, 42): Overload resolution ambiguity:
internal val METHOD_CURRENT: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_CURRENT: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (97, 42): Overload resolution ambiguity:
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (100, 42): Overload resolution ambiguity:
internal val METHOD_FINISHED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_FINISHED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\Player.kt: (25, 7): Redeclaration: Player
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+2\android\src\main\kotlin\com\github\florent37\assets_audio_player\Player.kt: (310, 7): Redeclaration: ForwardHandler
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (15, 14): Conflicting declarations: internal val METHOD_POSITION: String, internal val METHOD_POSITION: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (16, 14): Conflicting declarations: internal val METHOD_VOLUME: String, internal val METHOD_VOLUME: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (17, 14): Conflicting declarations: internal val METHOD_FORWARD_REWIND_SPEED: String, internal val METHOD_FORWARD_REWIND_SPEED: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (18, 14): Conflicting declarations: internal val METHOD_PLAY_SPEED: String, internal val METHOD_PLAY_SPEED: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (19, 14): Conflicting declarations: internal val METHOD_FINISHED: String, internal val METHOD_FINISHED: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (20, 14): Conflicting declarations: internal val METHOD_IS_PLAYING: String, internal val METHOD_IS_PLAYING: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (21, 14): Conflicting declarations: internal val METHOD_CURRENT: String, internal val METHOD_CURRENT: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (22, 14): Conflicting declarations: internal val METHOD_NEXT: String, internal val METHOD_NEXT: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (23, 14): Conflicting declarations: internal val METHOD_PREV: String, internal val METHOD_PREV: String
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (25, 7): Redeclaration: AssetsAudioPlayerPlugin
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (42, 7): Redeclaration: AssetsAudioPlayer
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (80, 42): Overload resolution ambiguity:
internal val METHOD_VOLUME: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_VOLUME: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (83, 42): Overload resolution ambiguity:
internal val METHOD_FORWARD_REWIND_SPEED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_FORWARD_REWIND_SPEED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (86, 42): Overload resolution ambiguity:
internal val METHOD_PLAY_SPEED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_PLAY_SPEED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (89, 42): Overload resolution ambiguity:
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_POSITION: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (92, 42): Overload resolution ambiguity:
internal val METHOD_CURRENT: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_CURRENT: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (97, 42): Overload resolution ambiguity:
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_IS_PLAYING: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (100, 42): Overload resolution ambiguity:
internal val METHOD_FINISHED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
internal val METHOD_FINISHED: String defined in com.github.florent37.assets_audio_player in file AssetsAudioPlayerPlugin.kt
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (264, 29): Type mismatch: inferred type is Double but MethodChannel.Result was expected
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (265, 29): Type mismatch: inferred type is MethodChannel.Result but Context was expected
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\AssetsAudioPlayerPlugin.kt: (266, 29): Too many arguments for public f๏ฟฝnal fun open(assetAudioPath: String?, audioType: String, autoStart: Boolean, volume: Double, seek: Int?, respectSilentMode: Boolean, result: MethodChannel.Result, context: Context): Unit defined in com.github.florent37.assets_audio_player.Player
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\Player.kt: (25, 7): Redeclaration: Player
e: C:\src\flutter.pub-cache\hosted\pub.dartlang.org\assets_audio_player-1.4.3+3\android\src\main\kotlin\com\github\florent37\assets_audio_player\Player.kt: (312, 7): Redeclaration: ForwardHandler

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':assets_audio_player:compileDebugKotlin'.

Compilation error. See log for more details

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BU๏ฟฝLD FAILED in 39s
Exception: Gradle task assembleDebug failed with exit code 1

Bug about finished

I find a small bug.
ValueObservable<bool> get finished => _isPlaying.stream;
Feel free to update it.

For iOS i am getting this error

assets_audio_player does not specify a Swift version and none of the targets (Runner) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

image

Duck Others option?

In iOS you can lower the volume from a playing music, eg. Spotify, while the App is playing the audio file.
Is this feature included for this package or is it planned to be included at some point?

Thanks

Local files on iOS, yes/no/maybe?

It is not clear whether one should expect this plugin to work on iOS when playing local files (for example downloaded to some path) is working. on the description (and also https://pub.dev/packages/assets_audio_player) there is only an apple icon for that row but no mention anywhere.
would appreciate it if this is made clear as I tried and it does not work (bug file will follow if you want to make it work).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.