mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 13:19:44 +02:00
feat(widgets): add native Android and iOS home screen players
Publish artwork, metadata, and transport state through a shared Dart bridge. Add configurable Android RemoteViews and iOS WidgetKit players with controls and links into the full player. Serialize widget commands and session restoration, and share one headless-capable iOS Flutter engine with the foreground scene. Include native integration tests, Dart bridge tests, and widget setup documentation.
This commit is contained in:
1 parent
64445a09fc
commit
040c328479
34 files changed
+1601
-16
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import AppIntents
|
||||
|
||||
@available(iOS 17.0, *)
|
||||
struct PlayerControlIntent: AudioPlaybackIntent {
|
||||
static var title: LocalizedStringResource = "Control music playback"
|
||||
static var openAppWhenRun = false
|
||||
|
||||
@Parameter(title: "Action") var action: String
|
||||
|
||||
init() { action = "toggle" }
|
||||
init(_ action: String) { self.action = action }
|
||||
|
||||
func perform() async throws -> some IntentResult {
|
||||
#if !PLAYER_WIDGET_EXTENSION
|
||||
_ = await PlayerWidgetBridge.shared.perform(action)
|
||||
#endif
|
||||
return .result()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user