21 lines
712 B
Swift
21 lines
712 B
Swift
import AVKit
|
|
import SwiftUI
|
|
|
|
struct HermesVideoPlayerView: View {
|
|
@ObservedObject var coordinator: PlayerCoordinator
|
|
var cornerRadius: CGFloat = HermesTheme.cornerRadius
|
|
var fixedHeight: CGFloat? = 224
|
|
|
|
var body: some View {
|
|
VideoPlayer(player: coordinator.player)
|
|
.frame(maxWidth: .infinity)
|
|
.frame(height: fixedHeight)
|
|
.clipShape(RoundedRectangle(cornerRadius: cornerRadius, style: .continuous))
|
|
.overlay(
|
|
RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
|
|
.stroke(HermesTheme.accent.opacity(0.12), lineWidth: 1)
|
|
)
|
|
.background(HermesTheme.surfaceElevated)
|
|
}
|
|
}
|