video-player: add tap gesture to prevent nav
This commit is contained in:
@@ -123,9 +123,6 @@ struct ImageCarousel: View {
|
|||||||
}
|
}
|
||||||
case .video(let url):
|
case .video(let url):
|
||||||
DamusVideoPlayer(url: url, video_size: $video_size)
|
DamusVideoPlayer(url: url, video_size: $video_size)
|
||||||
.onTapGesture {
|
|
||||||
print("video tap")
|
|
||||||
}
|
|
||||||
.onChange(of: video_size) { size in
|
.onChange(of: video_size) { size in
|
||||||
guard image_fill == nil, let size else {
|
guard image_fill == nil, let size else {
|
||||||
return
|
return
|
||||||
@@ -182,7 +179,7 @@ struct ImageCarousel: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var Medias: some View {
|
var Medias: some View {
|
||||||
TabView {
|
TabView(selection: $selectedIndex) {
|
||||||
ForEach(urls.indices, id: \.self) { index in
|
ForEach(urls.indices, id: \.self) { index in
|
||||||
GeometryReader { geo in
|
GeometryReader { geo in
|
||||||
Media(geo: geo, url: urls[index], index: index)
|
Media(geo: geo, url: urls[index], index: index)
|
||||||
@@ -194,9 +191,6 @@ struct ImageCarousel: View {
|
|||||||
ImageView(urls: urls, disable_animation: state.settings.disable_animation)
|
ImageView(urls: urls, disable_animation: state.settings.disable_animation)
|
||||||
}
|
}
|
||||||
.frame(height: height)
|
.frame(height: height)
|
||||||
.onTapGesture {
|
|
||||||
open_sheet = true
|
|
||||||
}
|
|
||||||
.onChange(of: selectedIndex) { value in
|
.onChange(of: selectedIndex) { value in
|
||||||
selectedIndex = value
|
selectedIndex = value
|
||||||
}
|
}
|
||||||
@@ -206,6 +200,7 @@ struct ImageCarousel: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
Medias
|
Medias
|
||||||
|
.onTapGesture { }
|
||||||
|
|
||||||
// This is our custom carousel image indicator
|
// This is our custom carousel image indicator
|
||||||
CarouselDotsView(urls: urls, selectedIndex: $selectedIndex)
|
CarouselDotsView(urls: urls, selectedIndex: $selectedIndex)
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ struct DamusVideoPlayer: View {
|
|||||||
.foregroundColor(.black)
|
.foregroundColor(.black)
|
||||||
|
|
||||||
Image(systemName: mute_icon)
|
Image(systemName: mute_icon)
|
||||||
.onTapGesture {
|
|
||||||
model.muted = !model.muted
|
|
||||||
}
|
|
||||||
.padding()
|
.padding()
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user