Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions audio_service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.18.19

* Fix AudioServicePlugin not reporting playing state to iOS versions >= 13.0 (@marckornberger)

## 0.18.18

* Fix setPlaybackState entitlement issue on iOS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,13 @@ - (void) updateNowPlayingInfo {
updated |= [self updateNowPlayingField:MPNowPlayingInfoPropertyElapsedPlaybackTime value:[NSNumber numberWithDouble:([position doubleValue] / 1000)]];
MPNowPlayingInfoCenter *center = [MPNowPlayingInfoCenter defaultCenter];
#if TARGET_OS_OSX

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think there is no need to keep the macro here ? maybe the old code is fine we just need to remove the macro checking for OSX

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, when I wrote this, Flutter supported older versions of iOS where this would not compile. My understanding is that Flutter now supports only iOS 13 and above which means technically you may be right, and we don't need this #if anymore.

if (@available(iOS 13.0, macOS 10.12.2, *)) {
if (@available(macOS 10.12.2, *)) {
center.playbackState = playing ? MPNowPlayingPlaybackStatePlaying : MPNowPlayingPlaybackStatePaused;
}
#endif
if (@available(iOS 13.0, *)) {
center.playbackState = playing ? MPNowPlayingPlaybackStatePlaying : MPNowPlayingPlaybackStatePaused;
}
if (@available(iOS 10.0, macOS 10.12.2, *)) {
updated |= [self updateNowPlayingField:MPNowPlayingInfoPropertyIsLiveStream value:mediaItem[@"isLive"]];
}
Expand Down