XamarinMediaManager icon indicating copy to clipboard operation
XamarinMediaManager copied to clipboard

Music players stops when I start my app Xamarin.ios with media manager

Open DamienDoumer opened this issue 3 years ago • 7 comments

🐛 Bug Report

When I add media manager to my project, and initialize it, then deploy the app on my device. If I play music on a music player like Spotify before launching my app, the player stops playing music. I tried changing the AVAudioSession Category inside the app delegate, before initializing Xamarin media manager as follows; but it didn't work.

AVAudioSession.SharedInstance().SetActive(false); AVAudioSession.SharedInstance().SetCategory(AVAudioSession.CategoryAmbient); AVAudioSession.SharedInstance().SetActive(true); CrossMediaManager.Current.Init();

Expected behavior

When launching a the app, it should stop the media player only when we start playing media in our app, and not at app start.

Reproduction steps

  • install Xamarin Media Manager in your xamarin ios project
  • Initialize in app delegate
  • Deploy to an iOS device
  • Start a music player and launch music on it (Spotify etc)
  • Start our app we deployed earlier
  • As soon as the app launches, the media player's music stops

Configuration

Version: 1.x

Platform:

  • [x] :iphone: iOS
  • [ ] :robot: Android
  • [ ] :checkered_flag: WPF
  • [ ] :earth_americas: UWP
  • [ ] :apple: MacOS
  • [ ] :tv: tvOS
  • [ ] :monkey: Xamarin.Forms

DamienDoumer avatar May 31 '21 16:05 DamienDoumer

I have the same problem with Media Manager on ios.

mtaranovsky avatar Jun 11 '21 13:06 mtaranovsky

Same here

eugene-stanovoy avatar Jun 11 '21 13:06 eugene-stanovoy

Same for me @eugene-stanovoy @mtaranovsky @DamienDoumer do let me know if you have already found solution.

ihassantariq avatar Nov 25 '21 18:11 ihassantariq

same bug encountered. Hope it will be fixed next release

ipon85 avatar Dec 22 '21 17:12 ipon85

Any news?

ipon85 avatar Aug 12 '22 13:08 ipon85

maybe an idea would be to choose if we want to hijack the AudioSession when we call CrossMediaManager.Current.Init(); that causes the issue on iOS - line 106 here: https://github.com/Baseflow/XamarinMediaManager/blob/7056b8ce1f336b27ad20b9a98760e57697bd547d/MediaManager/Platforms/Ios/Player/IosMediaPlayer.cs#L106

narciszait avatar Aug 23 '22 11:08 narciszait

Any news? @martijn00

stavroaudisho avatar Jan 03 '23 13:01 stavroaudisho