mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Close overlay with tap outside
This commit is contained in:
parent
e56ab3804e
commit
17aeef9af7
@ -43,14 +43,15 @@ struct FixtureEnvironmentObjectsModifier: ViewModifier {
|
|||||||
private var player: PlayerModel {
|
private var player: PlayerModel {
|
||||||
let player = PlayerModel()
|
let player = PlayerModel()
|
||||||
|
|
||||||
player.currentItem = PlayerQueueItem(Video.fixture)
|
player.currentItem = PlayerQueueItem(Video(videoID: "", title: "", author: "", length: 0, published: "2 days ago", views: 43434, channel: .init(id: "", name: ""), likes: 2332, dislikes: 30))
|
||||||
player.queue = Video.allFixtures.map { PlayerQueueItem($0) }
|
player.queue = Video.allFixtures.map { PlayerQueueItem($0) }
|
||||||
|
player.videoBeingOpened = Video.fixture
|
||||||
|
|
||||||
return player
|
return player
|
||||||
}
|
}
|
||||||
|
|
||||||
private var playerControls: PlayerControlsModel {
|
private var playerControls: PlayerControlsModel {
|
||||||
PlayerControlsModel(presentingControls: true, player: player)
|
PlayerControlsModel(presentingControls: true, presentingControlsOverlay: true, player: player)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var subscriptions: SubscriptionsModel {
|
private var subscriptions: SubscriptionsModel {
|
||||||
|
@ -10,7 +10,15 @@ struct PlayerGestures: View {
|
|||||||
.tapRecognizer(
|
.tapRecognizer(
|
||||||
tapSensitivity: 0.2,
|
tapSensitivity: 0.2,
|
||||||
singleTapAction: {
|
singleTapAction: {
|
||||||
|
if model.presentingControlsOverlay {
|
||||||
|
model.presentingControls = true
|
||||||
|
model.resetTimer()
|
||||||
|
withAnimation {
|
||||||
|
model.presentingControlsOverlay = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
model.toggle()
|
model.toggle()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
doubleTapAction: {
|
doubleTapAction: {
|
||||||
player.backend.seek(relative: .secondsInDefaultTimescale(-10))
|
player.backend.seek(relative: .secondsInDefaultTimescale(-10))
|
||||||
@ -24,7 +32,15 @@ struct PlayerGestures: View {
|
|||||||
.tapRecognizer(
|
.tapRecognizer(
|
||||||
tapSensitivity: 0.2,
|
tapSensitivity: 0.2,
|
||||||
singleTapAction: {
|
singleTapAction: {
|
||||||
|
if model.presentingControlsOverlay {
|
||||||
|
model.presentingControls = true
|
||||||
|
model.resetTimer()
|
||||||
|
withAnimation {
|
||||||
|
model.presentingControlsOverlay = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
model.toggle()
|
model.toggle()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
doubleTapAction: {
|
doubleTapAction: {
|
||||||
player.backend.togglePlay()
|
player.backend.togglePlay()
|
||||||
@ -38,7 +54,15 @@ struct PlayerGestures: View {
|
|||||||
.tapRecognizer(
|
.tapRecognizer(
|
||||||
tapSensitivity: 0.2,
|
tapSensitivity: 0.2,
|
||||||
singleTapAction: {
|
singleTapAction: {
|
||||||
|
if model.presentingControlsOverlay {
|
||||||
|
model.presentingControls = true
|
||||||
|
model.resetTimer()
|
||||||
|
withAnimation {
|
||||||
|
model.presentingControlsOverlay = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
model.toggle()
|
model.toggle()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
doubleTapAction: {
|
doubleTapAction: {
|
||||||
player.backend.seek(relative: .secondsInDefaultTimescale(10))
|
player.backend.seek(relative: .secondsInDefaultTimescale(10))
|
||||||
|
Loading…
Reference in New Issue
Block a user