Open thecodinglinguist opened 2 years ago
Anyone got anything on this issue by now ?
I think there is a pull request addressing this, I'll check when I'm back at my computer. But from memory the solution in that pull request didn't produce the desired behaviour even though it got rid of the warning.
I was getting this error, and the control center wasn't appearing on a real iOS device, only simulator. I thought the two were related. However, I simply had to use audio_session to configure the session for music
session.configure(AudioSessionConfiguration.music());
After doing this, the controls appeared within iOS media center and lock screen fine.
Given this, does anybody know what the implications of this error are?
Thanks @Colton127 for sharing that audio_session resolves the issue.
Regarding the error/warning, it has been discussed on the following pull request: #900 . Contributions welcome.
@Colton127's solution did not work for me. Facing same issue on iOS when seeking new position in track.
Having the same issue for play/pause and skipToNext/skipToPrevious
[NowPlaying] [MRNowPlaying] Ignoring setPlaybackState because application does not contain entitlement com.apple.mediaremote.set-playback-state for platform
same here @leonidlist . Did you find a solution?
@ryanheise any update? https://github.com/ryanheise/just_audio/issues/1001
I'm also experiencing this warning message while using a physical iOS device plugged in to my Macbook
Same here, how can we help?
Same Here. Any Solution So Far...??? I am using this: https://pub.dev/packages/just_audio_background
Same here using audio_session combined with audioplayers
UPDATE: kinda false alarm here. Issue can be solved one time only, and for the second audio playback and sesion configuration it's still there. Any help appreciated. And even calling await session?.setActive(false);
method before configuring audio session does not help.
I was facing the same issue and fixed it by leaving only ONE option to configure audio_session. Didn't figure it out to the end, but looks like it was some options that conflict as described here.
Full error log from Flutter was:
[as_client] AVAudioSession_iOS.mm:2386 Failed to set category, error: -50
Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"
[NowPlaying] [MRNowPlaying] Ignoring setPlaybackState because application does not contain entitlement com.apple.mediaremote.set-playback-state for platform
The final code that works was:
try {
await _session?.configure(
AudioSessionConfiguration(
avAudioSessionCategory: AVAudioSessionCategory.playback,
// The following lines was commented as they produced an error
// avAudioSessionRouteSharingPolicy:
// AVAudioSessionRouteSharingPolicy.defaultPolicy,
// avAudioSessionCategoryOptions:
// AVAudioSessionCategoryOptions.duckOthers,
// avAudioSessionMode: AVAudioSessionMode.defaultMode,
// avAudioSessionSetActiveOptions: AVAudioSessionSetActiveOptions.none,
androidAudioAttributes: const AndroidAudioAttributes(
contentType: AndroidAudioContentType.movie,
flags: AndroidAudioFlags.none,
usage: AndroidAudioUsage.media,
),
androidAudioFocusGainType:
AndroidAudioFocusGainType.gainTransientMayDuck,
androidWillPauseWhenDucked: isAndroidWillPauseWhenDucked,
),
);
session?.setActive(true);
} on PlatformException catch (e) {
debugPrint('AUDIO MANAGER AUDIOSESSION CONFIGURE ERROR: ${e.toString()}');
}
It STILL generates an error in logs, but at least it works now in the real app and not only in the emulator.
I was using audio_service 0.18.12 and upgrading it to actual from 0.18.9 didn't solve the problem.
I am facing the same issue, did someone find a workaround?
Hello @ryanheise Sorry, I don't have any understanding of the iOS implementation. But there seems to be a possible solution from JonMercer in this thread. He suggests not to assign the MPNowPlayingInfoCenter.default().playbackState on iOS because this property only applies to macOS. Here's the assignment in audio_service: https://github.com/ryanheise/audio_service/blob/544e2f8d2d28203a74d3cbda709889b3c9cce1a2/audio_service/darwin/Classes/AudioServicePlugin.m#L292C8-L292C8 Can you please consider if it's a viable solution for this issue? Thank you.
@ryanheise hey bro, do you have any time to check this ? greatlu appreaciated
There's a pr in #900 but it needs some changes as described in the discussion on that page, if someone would like to help. It would make a good first issue for a new contributor.
As it is, the warning itself should not actually cause problems but it would be nice to clean it up.
thanks for the response but actually my issue is this one MSVEntitlementUtilities - Process Harmonie PID[28383] - Group: (null) - Entitlement: com.apple.mediaremote.external-artwork-validation - Entitled: NO - Error: (null) i am also using just audio background and just audio, and this seems to be only happening on ipad, do you know anuything about this error ?
I'm sorry, I didn't realise you were posting an off topic comment. I will hide your comment and my comment as off topic. Please keep this in mind for future comments.
Documented behavior
Not part of the documentation
Actual behavior
Warning logs when interacting with player pause/play.
Runtime error
Minimal reproduction project
Official example: main.dart
Reproduction steps
The entitlement warning will appear with each click.
Output of flutter doctor