File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed
Sources/StreamChatSwiftUI/ChatChannel Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,13 @@ public struct VideoPlayerView: View {
39
39
)
40
40
VideoPlayer ( player: avPlayer)
41
41
Spacer ( )
42
+ HStack {
43
+ ShareButtonView ( content: [ attachment. payload. videoURL] )
44
+ . standardPadding ( )
45
+
46
+ Spacer ( )
47
+ }
48
+ . foregroundColor ( Color ( colors. text) )
42
49
}
43
50
. onAppear {
44
51
avPlayer. play ( )
Original file line number Diff line number Diff line change @@ -288,16 +288,21 @@ struct LazyLoadingImage: View {
288
288
var body : some View {
289
289
ZStack {
290
290
if let image = image {
291
+ imageView ( for: image)
291
292
if let imageTapped = imageTapped {
292
- imageView ( for: image, allowsHitTesting: true )
293
+ // NOTE: needed because of bug with SwiftUI.
294
+ // The click area expands outside the image view (although not visible).
295
+ Rectangle ( )
296
+ . opacity ( 0.000001 )
297
+ . frame ( width: width)
298
+ . clipped ( )
299
+ . allowsHitTesting ( true )
293
300
. highPriorityGesture (
294
301
TapGesture ( )
295
302
. onEnded { _ in
296
303
imageTapped ( index ?? 0 )
297
304
}
298
305
)
299
- } else {
300
- imageView ( for: image, allowsHitTesting: false )
301
306
}
302
307
} else if error != nil {
303
308
Color ( . secondarySystemBackground)
@@ -332,16 +337,13 @@ struct LazyLoadingImage: View {
332
337
. clipped ( )
333
338
}
334
339
335
- func imageView(
336
- for image: UIImage ,
337
- allowsHitTesting: Bool
338
- ) -> some View {
340
+ func imageView( for image: UIImage ) -> some View {
339
341
Image ( uiImage: image)
340
342
. resizable ( )
341
343
. scaledToFill ( )
342
344
. aspectRatio ( contentMode: . fill)
343
345
. clipped ( )
344
- . allowsHitTesting ( allowsHitTesting )
346
+ . allowsHitTesting ( false )
345
347
}
346
348
}
347
349
You can’t perform that action at this time.
0 commit comments