스플래시 변경
This commit is contained in:
		| @@ -1,21 +0,0 @@ | ||||
| { | ||||
|   "images" : [ | ||||
|     { | ||||
|       "idiom" : "universal", | ||||
|       "scale" : "1x" | ||||
|     }, | ||||
|     { | ||||
|       "idiom" : "universal", | ||||
|       "scale" : "2x" | ||||
|     }, | ||||
|     { | ||||
|       "filename" : "splash_bg.jpg", | ||||
|       "idiom" : "universal", | ||||
|       "scale" : "3x" | ||||
|     } | ||||
|   ], | ||||
|   "info" : { | ||||
|     "author" : "xcode", | ||||
|     "version" : 1 | ||||
|   } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 1.9 MiB | 
| @@ -1,21 +0,0 @@ | ||||
| { | ||||
|   "images" : [ | ||||
|     { | ||||
|       "idiom" : "universal", | ||||
|       "scale" : "1x" | ||||
|     }, | ||||
|     { | ||||
|       "idiom" : "universal", | ||||
|       "scale" : "2x" | ||||
|     }, | ||||
|     { | ||||
|       "filename" : "splash_logo.png", | ||||
|       "idiom" : "universal", | ||||
|       "scale" : "3x" | ||||
|     } | ||||
|   ], | ||||
|   "info" : { | ||||
|     "author" : "xcode", | ||||
|     "version" : 1 | ||||
|   } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 4.0 KiB | 
| @@ -1,21 +0,0 @@ | ||||
| { | ||||
|   "images" : [ | ||||
|     { | ||||
|       "idiom" : "universal", | ||||
|       "scale" : "1x" | ||||
|     }, | ||||
|     { | ||||
|       "idiom" : "universal", | ||||
|       "scale" : "2x" | ||||
|     }, | ||||
|     { | ||||
|       "filename" : "splash_text.png", | ||||
|       "idiom" : "universal", | ||||
|       "scale" : "3x" | ||||
|     } | ||||
|   ], | ||||
|   "info" : { | ||||
|     "author" : "xcode", | ||||
|     "version" : 1 | ||||
|   } | ||||
| } | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 106 KiB | 
							
								
								
									
										
											BIN
										
									
								
								SodaLive/Resources/video.mp4
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								SodaLive/Resources/video.mp4
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -8,8 +8,10 @@ | ||||
| import SwiftUI | ||||
| import FirebaseRemoteConfig | ||||
|  | ||||
| struct SplashView: View { | ||||
| import AVKit | ||||
|  | ||||
| struct SplashView: View { | ||||
|     @State private var player: AVPlayer? | ||||
|     @State private var isShowForcedUpdatePopup = false | ||||
|     @State private var isShowUpdatePopup = false | ||||
|      | ||||
| @@ -17,19 +19,22 @@ struct SplashView: View { | ||||
|      | ||||
|     var body: some View { | ||||
|         ZStack(alignment: .top) { | ||||
|             Image("splash_bg") | ||||
|                 .resizable() | ||||
|                 .scaledToFill() | ||||
|                 .edgesIgnoringSafeArea(.all) | ||||
|              | ||||
|             VStack(spacing: 0) { | ||||
|                 Image("splash_text") | ||||
|                     .padding(.top, 130) | ||||
|                  | ||||
|                 Spacer() | ||||
|                  | ||||
|                 Image("splash_logo") | ||||
|                     .padding(.bottom, 50) | ||||
|             VStack { | ||||
|                 if let player = player { | ||||
|                     VideoPlayer(player: player) | ||||
|                         .ignoresSafeArea(.all) | ||||
|                         .onAppear { | ||||
|                             player.play() | ||||
|                         } | ||||
|                         .onDisappear { | ||||
|                             player.pause() | ||||
|                         } | ||||
|                 } else { | ||||
|                     Color(hex: "#ecedf3") | ||||
|                 } | ||||
|             } | ||||
|             .onAppear { | ||||
|                 loadVideo() | ||||
|             } | ||||
|              | ||||
|             if isShowUpdatePopup { | ||||
| @@ -59,9 +64,18 @@ struct SplashView: View { | ||||
|                     } | ||||
|                 ) | ||||
|             } | ||||
|              | ||||
|         } | ||||
|         .onAppear { | ||||
|     } | ||||
|      | ||||
|     private func loadVideo() { | ||||
|         guard let url = Bundle.main.url(forResource: "video", withExtension: "mp4") else { | ||||
|             fetchLastestVersion() | ||||
|             return | ||||
|         } | ||||
|          | ||||
|         player = AVPlayer(url: url) | ||||
|         NotificationCenter.default | ||||
|             .addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: player?.currentItem, queue: .main) { _ in | ||||
|                 fetchLastestVersion() | ||||
|             } | ||||
|     } | ||||
| @@ -78,8 +92,6 @@ struct SplashView: View { | ||||
|                     checkAppVersion(latestVersion: remoteConfig["ios_latest_version"].stringValue) | ||||
|                 } | ||||
|             } else { | ||||
|                 DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) { | ||||
|                     withAnimation { | ||||
|                 if AppState.shared.pushRoomId > 0 { | ||||
|                     liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId) | ||||
|                 } else if AppState.shared.pushChannelId > 0 { | ||||
| @@ -92,8 +104,6 @@ struct SplashView: View { | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|         } | ||||
|     } | ||||
|      | ||||
|     private func checkAppVersion(latestVersion: String?) { | ||||
|         let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String | ||||
| @@ -115,8 +125,6 @@ struct SplashView: View { | ||||
|             } else if latestMajor == major && latestMinor == minor && latestPatch > patch { | ||||
|                 self.isShowUpdatePopup = true | ||||
|             } else { | ||||
|                 DispatchQueue.main.asyncAfter(deadline: .now() + 1) { | ||||
|                     withAnimation { | ||||
|                 if AppState.shared.pushRoomId > 0 { | ||||
|                     liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId) | ||||
|                 } else if AppState.shared.pushChannelId > 0 { | ||||
| @@ -127,11 +135,7 @@ struct SplashView: View { | ||||
|                     AppState.shared.setAppStep(step: .main) | ||||
|                 } | ||||
|             } | ||||
|                 } | ||||
|             } | ||||
|         } else { | ||||
|             DispatchQueue.main.asyncAfter(deadline: .now() + 1) { | ||||
|                 withAnimation { | ||||
|             if AppState.shared.pushRoomId > 0 { | ||||
|                 liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId) | ||||
|             } else if AppState.shared.pushChannelId > 0 { | ||||
| @@ -144,8 +148,6 @@ struct SplashView: View { | ||||
|         } | ||||
|     } | ||||
| } | ||||
|     } | ||||
| } | ||||
|  | ||||
| struct SplashView_Previews: PreviewProvider { | ||||
|     static var previews: some View { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yu Sung
					Yu Sung