mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-30 04:01:02 +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 AVKit
|
||||||
|
import DesignSystem
|
||||||
import Env
|
import Env
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
@ -45,12 +46,22 @@ class VideoPlayerViewModel: ObservableObject {
|
||||||
struct VideoPlayerView: View {
|
struct VideoPlayerView: View {
|
||||||
@Environment(\.scenePhase) private var scenePhase
|
@Environment(\.scenePhase) private var scenePhase
|
||||||
@EnvironmentObject private var preferences: UserPreferences
|
@EnvironmentObject private var preferences: UserPreferences
|
||||||
|
@EnvironmentObject private var theme: Theme
|
||||||
|
|
||||||
@StateObject var viewModel: VideoPlayerViewModel
|
@StateObject var viewModel: VideoPlayerViewModel
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
ZStack {
|
||||||
VideoPlayer(player: viewModel.player)
|
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 {
|
}.onAppear {
|
||||||
viewModel.preparePlayer(autoPlay: preferences.autoPlayVideo)
|
viewModel.preparePlayer(autoPlay: preferences.autoPlayVideo)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue