스플래시 변경
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 SwiftUI | ||||||
| import FirebaseRemoteConfig | import FirebaseRemoteConfig | ||||||
|  |  | ||||||
|  | import AVKit | ||||||
|  |  | ||||||
| struct SplashView: View { | struct SplashView: View { | ||||||
|      |     @State private var player: AVPlayer? | ||||||
|     @State private var isShowForcedUpdatePopup = false |     @State private var isShowForcedUpdatePopup = false | ||||||
|     @State private var isShowUpdatePopup = false |     @State private var isShowUpdatePopup = false | ||||||
|      |      | ||||||
| @@ -17,19 +19,22 @@ struct SplashView: View { | |||||||
|      |      | ||||||
|     var body: some View { |     var body: some View { | ||||||
|         ZStack(alignment: .top) { |         ZStack(alignment: .top) { | ||||||
|             Image("splash_bg") |             VStack { | ||||||
|                 .resizable() |                 if let player = player { | ||||||
|                 .scaledToFill() |                     VideoPlayer(player: player) | ||||||
|                 .edgesIgnoringSafeArea(.all) |                         .ignoresSafeArea(.all) | ||||||
|              |                         .onAppear { | ||||||
|             VStack(spacing: 0) { |                             player.play() | ||||||
|                 Image("splash_text") |                         } | ||||||
|                     .padding(.top, 130) |                         .onDisappear { | ||||||
|                  |                             player.pause() | ||||||
|                 Spacer() |                         } | ||||||
|                  |                 } else { | ||||||
|                 Image("splash_logo") |                     Color(hex: "#ecedf3") | ||||||
|                     .padding(.bottom, 50) |                 } | ||||||
|  |             } | ||||||
|  |             .onAppear { | ||||||
|  |                 loadVideo() | ||||||
|             } |             } | ||||||
|              |              | ||||||
|             if isShowUpdatePopup { |             if isShowUpdatePopup { | ||||||
| @@ -59,11 +64,20 @@ struct SplashView: View { | |||||||
|                     } |                     } | ||||||
|                 ) |                 ) | ||||||
|             } |             } | ||||||
|              |  | ||||||
|         } |         } | ||||||
|         .onAppear { |     } | ||||||
|  |      | ||||||
|  |     private func loadVideo() { | ||||||
|  |         guard let url = Bundle.main.url(forResource: "video", withExtension: "mp4") else { | ||||||
|             fetchLastestVersion() |             fetchLastestVersion() | ||||||
|  |             return | ||||||
|         } |         } | ||||||
|  |          | ||||||
|  |         player = AVPlayer(url: url) | ||||||
|  |         NotificationCenter.default | ||||||
|  |             .addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: player?.currentItem, queue: .main) { _ in | ||||||
|  |                 fetchLastestVersion() | ||||||
|  |             } | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     private func fetchLastestVersion() { |     private func fetchLastestVersion() { | ||||||
| @@ -78,18 +92,14 @@ struct SplashView: View { | |||||||
|                     checkAppVersion(latestVersion: remoteConfig["ios_latest_version"].stringValue) |                     checkAppVersion(latestVersion: remoteConfig["ios_latest_version"].stringValue) | ||||||
|                 } |                 } | ||||||
|             } else { |             } else { | ||||||
|                 DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) { |                 if AppState.shared.pushRoomId > 0 { | ||||||
|                     withAnimation { |                     liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId) | ||||||
|                         if AppState.shared.pushRoomId > 0 { |                 } else if AppState.shared.pushChannelId > 0 { | ||||||
|                             liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId) |                     AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId)) | ||||||
|                         } else if AppState.shared.pushChannelId > 0 { |                 } else if AppState.shared.pushAudioContentId > 0 { | ||||||
|                             AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId)) |                     AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId)) | ||||||
|                         } else if AppState.shared.pushAudioContentId > 0 { |                 } else { | ||||||
|                             AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId)) |                     AppState.shared.setAppStep(step: .main) | ||||||
|                         } else { |  | ||||||
|                             AppState.shared.setAppStep(step: .main) |  | ||||||
|                         } |  | ||||||
|                     } |  | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| @@ -115,33 +125,25 @@ struct SplashView: View { | |||||||
|             } else if latestMajor == major && latestMinor == minor && latestPatch > patch { |             } else if latestMajor == major && latestMinor == minor && latestPatch > patch { | ||||||
|                 self.isShowUpdatePopup = true |                 self.isShowUpdatePopup = true | ||||||
|             } else { |             } else { | ||||||
|                 DispatchQueue.main.asyncAfter(deadline: .now() + 1) { |                 if AppState.shared.pushRoomId > 0 { | ||||||
|                     withAnimation { |                     liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId) | ||||||
|                         if AppState.shared.pushRoomId > 0 { |                 } else if AppState.shared.pushChannelId > 0 { | ||||||
|                             liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId) |                     AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId)) | ||||||
|                         } else if AppState.shared.pushChannelId > 0 { |                 } else if AppState.shared.pushAudioContentId > 0 { | ||||||
|                             AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId)) |                     AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId)) | ||||||
|                         } else if AppState.shared.pushAudioContentId > 0 { |                 } else { | ||||||
|                             AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId)) |                     AppState.shared.setAppStep(step: .main) | ||||||
|                         } else { |  | ||||||
|                             AppState.shared.setAppStep(step: .main) |  | ||||||
|                         } |  | ||||||
|                     } |  | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } else { |         } else { | ||||||
|             DispatchQueue.main.asyncAfter(deadline: .now() + 1) { |             if AppState.shared.pushRoomId > 0 { | ||||||
|                 withAnimation { |                 liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId) | ||||||
|                     if AppState.shared.pushRoomId > 0 { |             } else if AppState.shared.pushChannelId > 0 { | ||||||
|                         liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId) |                 AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId)) | ||||||
|                     } else if AppState.shared.pushChannelId > 0 { |             } else if AppState.shared.pushAudioContentId > 0 { | ||||||
|                         AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId)) |                 AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId)) | ||||||
|                     } else if AppState.shared.pushAudioContentId > 0 { |             } else { | ||||||
|                         AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId)) |                 AppState.shared.setAppStep(step: .main) | ||||||
|                     } else { |  | ||||||
|                         AppState.shared.setAppStep(step: .main) |  | ||||||
|                     } |  | ||||||
|                 } |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Yu Sung
					Yu Sung