mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-23 00:40:59 +00:00
Added a tip that it's a video, and not an image when autoplay is off (#939)
* Added a tip that it's a video, and not an image when autoplay is off * Centered - bigger version of the video tip
This commit is contained in:
parent
6a03e06d3a
commit
dd2ebe5506
1 changed files with 12 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
import AVKit
|
||||
import DesignSystem
|
||||
import Env
|
||||
import SwiftUI
|
||||
|
||||
|
@ -45,12 +46,22 @@ class VideoPlayerViewModel: ObservableObject {
|
|||
struct VideoPlayerView: View {
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
@EnvironmentObject private var preferences: UserPreferences
|
||||
@EnvironmentObject private var theme: Theme
|
||||
|
||||
@StateObject var viewModel: VideoPlayerViewModel
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
ZStack {
|
||||
VideoPlayer(player: viewModel.player)
|
||||
|
||||
if !preferences.autoPlayVideo {
|
||||
Image(systemName: "play.fill")
|
||||
.font(.largeTitle)
|
||||
.foregroundColor(theme.tintColor)
|
||||
.padding()
|
||||
.background(Circle().fill(.thinMaterial))
|
||||
.padding(theme.statusDisplayStyle == .compact ? 0 : 10)
|
||||
}
|
||||
}.onAppear {
|
||||
viewModel.preparePlayer(autoPlay: preferences.autoPlayVideo)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue