Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 1 | Rev 9 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 8
Línea 5... Línea 5...
5
//  Created by Efrain Yanez Recanatini on 4/24/22.
5
//  Created by Efrain Yanez Recanatini on 4/24/22.
6
//
6
//
7
import Foundation
7
import Foundation
8
import SwiftUI
8
import SwiftUI
9
import AVKit
9
import AVKit
-
 
10
import NavigationStack
Línea 10... Línea 11...
10
 
11
 
11
 
-
 
-
 
12
 
12
struct VideoPlayerView: View {
13
struct VideoPlayerView: View {
-
 
14
    
13
    @EnvironmentObject private var appNavigation : AppNavigation
15
    @State private var timerActive : Bool = false
Línea 14... Línea 16...
14
    @State private var timerActive : Bool = false
16
    
Línea 15... Línea 17...
15
    @State private var isCompleted : Bool = false
17
    @State private var isCompleted : Bool = false
Línea 16... Línea 18...
16
    
18
    
Línea 17... Línea 19...
17
    private let appData = AppData.sharedInstance
19
    private let appData = AppData.sharedInstance
18
    
20
    
19
    //@State private var backToGallery : Bool = false
21
    @State private var backToGallery : Bool = false
20
  
22
  
Línea 21... Línea -...
21
    private let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect()
-
 
Línea 22... Línea 23...
22
 
23
    private let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect()
23
    private var playerItem : AVPlayerItem
24
 
24
    private var player : AVPlayer
25
    private var playerItem : AVPlayerItem
25
    private var slideModel : SlideModel
26
    private var player : AVPlayer
Línea 26... Línea 27...
26
    private var slideTitle : String
27
    private var slideModel : SlideModel
27
 
28
    private var slideTitle : String
28
 
29
 
29
    //@State private var goToGallery : Bool = false
30
 
Línea 80... Línea 81...
80
 
81
 
Línea 81... Línea 82...
81
    }
82
    }
82
    
83
    
-
 
84
    var body: some View {
-
 
85
        VStack(spacing: 0) {
-
 
86
            PopView(
-
 
87
                destination: .root,
-
 
88
                isActive: self.$backToGallery,
-
 
89
                label: {
-
 
90
                    Text("")
-
 
91
                    
-
 
92
                }
83
    var body: some View {
93
            ).frame( height: 0)
84
        VStack(spacing: 0) {
94
            
85
            HStack {
95
            HStack {
86
                Button(action: {
96
                Button(action: {
Línea 100... Línea 110...
100
                    AppDelegate.orientationLock = UIInterfaceOrientationMask.portrait
110
                    AppDelegate.orientationLock = UIInterfaceOrientationMask.portrait
101
                    UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
111
                    UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
102
                    UIViewController.attemptRotationToDeviceOrientation()
112
                    UIViewController.attemptRotationToDeviceOrientation()
Línea 103... Línea 113...
103
                    
113
                    
104
 
-
 
105
                    withAnimation {
-
 
-
 
114
 
-
 
115
                    self.backToGallery.toggle()
Línea 106... Línea 116...
106
                        appNavigation.subpageActive = .gallery
116
                    
Línea 107... Línea 117...
107
                    }
117
                    
Línea 176... Línea 186...
176
}
186
}
Línea 177... Línea 187...
177
 
187
 
178
 
188
 
179
struct VideoPlayerView_Previews: PreviewProvider {
189
struct VideoPlayerView_Previews: PreviewProvider {
180
    static var previews: some View {
190
    static var previews: some View {
181
        VideoPlayerView()
191
        VideoPlayerView(slideUuid: "")