DroppyNowPlayingPlayer
Droppy's floating player, the real one: the same view, glass, artwork, controls and lyrics button the floating player and the lock screen draw, showing whatever is playing on the Mac.
@MainActor struct DroppyNowPlayingPlayer
Droppy's floating player, the real one: the same view, glass, artwork, controls and lyrics button the floating player and the lock screen draw, showing whatever is playing on the Mac. A droplet that would otherwise draw a now-playing card of its own puts this in its place, so the user sees one player everywhere instead of a look-alike. Since 1.21.0.
The host draws it at the player's own size, size; give it that frame and scale it if your layout needs it smaller:
if let size = DroppyNowPlayingPlayer.size {
DroppyNowPlayingPlayer()
.frame(width: size.width, height: size.height)
} else {
MyOwnNowPlayingCard()
}size is nil wherever the host draws no player: the harness, a preview, a Droppy too old to have one. Fall back to your own view then; the player itself draws nothing there.
A droplet that must keep loading on hosts before 1.21.0 can still use it: import DroppyKit with @_weakLinked, keep kit.minAPI at its old value, and check #_hasSymbol(DroppyNowPlayingPlayer.self) before touching it. droppykit validate counts a weakly imported symbol as optional.
Initializers
init()
@MainActor init()
Type properties
size
@MainActor static var size: CGSize? { get }
The player's size in points, or nil where the host draws none.
Properties
body
@MainActor var body: some View { get }