1
0
mirror of https://github.com/yattee/yattee.git synced 2025-01-10 19:40:33 +05:30
yattee/Shared/Player/Controls/ToggleBackendButton.swift
Arkadiusz Fal 42e7ff5307 Hello, mpv! 🎉
2022-05-22 18:46:30 +02:00

24 lines
614 B
Swift

import SwiftUI
struct ToggleBackendButton: View {
@EnvironmentObject<PlayerControlsModel> private var controls
@EnvironmentObject<PlayerModel> private var player
var body: some View {
Button {
player.saveTime {
player.changeActiveBackend(from: player.activeBackend, to: player.activeBackend.next())
controls.resetTimer()
}
} label: {
Text(player.activeBackend.label)
}
}
}
struct ToggleBackendButton_Previews: PreviewProvider {
static var previews: some View {
ToggleBackendButton()
}
}