Add macOS AirPlay Selector - #1723
Conversation
The AirPlay route picker only rendered on iOS because flutter_to_airplay ships no macOS implementation, so the desktop app showed an Only iOS is supported placeholder instead of a working button. Add a native AVRoutePickerView platform view for macOS and a shared Dart wrapper so the output menu and lyrics screen show a real picker on both platforms. The macOS deployment target moves to 10.15 for AVRoutePickerView.
|
I'm wondering if most of these changes would make more sense as a pull request/fork of flutter_to_airplay instead of directly embedding into finamp. |
The macOS AirPlay picker was implemented directly in MainFlutterWindow.swift because the flutter_to_airplay package was iOS only. That native AVRoutePickerView view now lives in the package itself, so Finamp can consume it like any other platform. This points the dependency at the fork that adds macOS support and removes the embedded factory, leaving the package to register the airplay_route_picker_view type on both iOS and macOS. Upstream PR: MrJai/flutter_to_airplay#40
|
Yeah, thought about it and you're right, it needed doing. Moved the macOS picker into the package instead of embedding it here. The native AVRoutePickerView now lives in flutter_to_airplay, so this branch just points the dependency at a fork that adds macOS support and deletes the embedded factory from MainFlutterWindow.swift. Net change is about +14 / -109 lines. Upstream PR: MrJai/flutter_to_airplay#40 Pointed at the fork via a git ref for now since that repo has PRs open since 2023, so this can ship without waiting on a release. Can switch back to the hosted version once it merges. |
| child: Consumer( | ||
| builder: (context, ref, child) { | ||
| return AirPlayRoutePickerView( | ||
| return AirPlayRoutePicker( |
There was a problem hiding this comment.
Shouldn't we be able to just use AirPlayRoutePickerView instead of building our own widget now?
There was a problem hiding this comment.
Yep, done. Both call sites now use the package's AirPlayRoutePickerView directly and I removed the custom wrapper.
| flutter_to_airplay: | ||
| git: | ||
| url: https://github.com/obiwantoby/flutter_to_airplay.git | ||
| ref: feat/macos-support |
There was a problem hiding this comment.
I prefer using full commit hashes instead of branches for all forks we point at.
There was a problem hiding this comment.
Done, pinned to the full commit hash (2d09182f60fe95529446ee50cc54340827895af9).
Addresses review feedback on the macOS AirPlay PR. Now that flutter_to_airplay renders the native picker on macOS as well as iOS, the custom AirPlayRoutePicker wrapper is redundant, so both call sites use the package widget directly and the wrapper is removed. Also pins the fork dependency to a full commit hash instead of a branch ref.
|
@obiwantoby are you fine with us moving your repo into the finamp-app org when we merge this? Just to keep all forks in one place. |
No issue there at all. |

Summary
The AirPlay route picker only worked on iOS because flutter_to_airplay has no macOS implementation, so the desktop app showed an “Only iOS is supported” placeholder.
This change adds a native AVRoutePickerView platform view for macOS and a shared Dart wrapper (AirPlayRoutePicker) so the output menu and lyrics screen show a real picker on both platforms. The macOS deployment target is raised to 10.15 for AVRoutePickerView.
Startup queue restore is also bounded with a timeout so a stalled fetch can no longer leave the player stuck on “Restoring queue” forever; on timeout it falls into the existing tap-to-retry state.
Test plan
macOS: Picker lists AirPlay outputs and switches correctly
iOS: Behavior unchanged
Non-Apple platforms: Renders nothing (no placeholder/crash)
Queue restore: Stalled fetch times out and shows tap-to-retry