audio_player_service icon indicating copy to clipboard operation
audio_player_service copied to clipboard

Some improvements

Open DGempler opened this issue 5 years ago • 3 comments

Hi @alexelisenko ! Thanks for creating this package - it's a great starting point for my proof of concept project for a flutter iOS audio player.

While trying to add this to my project I had to tweak a few things to make it work for me, and wanted to see if you're interested in a pull request for some (or all) of these changes:

  • adding the control/command center back
  • removing requirement for image (will show default iOS audio image)
  • getting duration data from audio file (will be overwritten if a duration is passed in)
  • disabling auto-play once audio is ready. This one is a preference that I believe should be left to the flutter client to make once the audio ready event fires.

I'm not an iOS developer, and never thought I'd be writing Objective-C, but had to make things work for my project so had no choice 😄

I manually tested things on xCode's simulator, iOS 10.3 (last version with control center functionality).

Thanks

DGempler avatar Sep 13 '19 15:09 DGempler

Hi,

Any contribution is welcome :)

What did you mean by adding command center back? It should already be supported.

alexelisenko avatar Sep 13 '19 15:09 alexelisenko

initPlayerQueue calls setPlaybackStatusInfo:

https://github.com/alexelisenko/audio_player_service/blob/9d9f9417077244c1c1fa49c3ccfe90002bf30a1b/ios/Classes/AudioPlayer.m#L346-L381

DGempler avatar Sep 13 '19 17:09 DGempler

PR: https://github.com/alexelisenko/audio_player_service/pull/5

DGempler avatar Sep 14 '19 00:09 DGempler