Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/random music #13

Merged
merged 11 commits into from
Apr 27, 2022
Merged

Feature/random music #13

merged 11 commits into from
Apr 27, 2022

Conversation

elppaaa
Copy link
Collaborator

@elppaaa elppaaa commented Apr 26, 2022

구현

#8 기능 구현

  • 뷰 수정
  • 로직과 바인딩
  • 오류 일부 수정

장르를 선택하는 장르 영역을 두었습니다.
아래 영상은 시연을 위해 유튜브 뷰를 보여지도록 했으나 원래는 hidden 상태로 동작합니다.

오류

  • 로딩이 시작되었을 때 간헐적으로 로딩이 끝나지 않는 문제
  • 영상 재생 시간이 일관적이지 않은 문제
  • 유튜브 비디오가 간헐적으로 로드되지 않는 문제

흐름

최초 실행 시
  1. 현재 버전을 받아옴.
  2. 셔플 실행.
재생
  1. 재생 / 정지 버튼 클릭 후 액션 방출
  2. isPlaying 상태 변경
  3. 특정 시간초 재생인 경우 일정 시간 뒤에 false
  4. vc에서 상태에 따른 UI 업데이트
셔플
  1. 셔플 버튼 클릭 후 액션 방출
  2. answer, isPlaying 상태 변경
  3. isLoading true 로 변경
  4. vc 에서 ytPlayer.rx.isReady 일때에 playerReady 액션 방출
  5. playerReady 시에 isLoading false 로 변경
  6. vc에서 상태에 따른 UI 업데이트
업데이트
  1. 업데이트 버튼 클릭 후 액션 방출
  2. answer, isPlaying 상태 변경
  3. isLoading true 로 변경
  4. repository 에서 업데이트 수행
  5. 셔플 동작 수행
  6. vc 에서 ytPlayer.rx.isReady 일때에 playerReady 액션 방출
  7. playerReady 시에 isLoading false 로 변경
  8. vc에서 상태에 따른 UI 업데이트

예시

image

ouput.mp4

- Reactor 기능 추가

 2jae6#8
- view 추가
- 장르 선택 영역 추가 (변경 가능성 있음)

 2jae6#8
- view 수정
- state 와 action 바인딩
- Music model float 로 변경

- 음악 재생/중지
- 업데이트, 셔플
- 정답 보기

 # 8
- 홈에서 RandomMusicQuiz 로 이동 가능하도록 추가
- 게임 모드를 enum 으로 변경
- 들여쓰기 4개로 수정
@elppaaa
Copy link
Collaborator Author

elppaaa commented Apr 26, 2022

코드를 리포맷팅한 커밋이 실수로 포함되었네요 ㅠㅠ
번거롭겠지만 커밋을 짚어가면서 보시거나 3bb825d 커밋을 기준으로 봐주시면 될 것 같아요 🙏

@elppaaa
Copy link
Collaborator Author

elppaaa commented Apr 26, 2022

색상은 Color Hunt 를 이용했습니다. :]

Copy link
Owner

@2jae6 2jae6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다. 크게 문제 없는 것 같아요 :) !

LiarGame/Sources/ViewController/HomeViewController.swift Outdated Show resolved Hide resolved
@2jae6
Copy link
Owner

2jae6 commented Apr 26, 2022

코드를 리포맷팅한 커밋이 실수로 포함되었네요 ㅠㅠ 번거롭겠지만 커밋을 짚어가면서 보시거나 3bb825d 커밋을 기준으로 봐주시면 될 것 같아요 🙏

3bb825d 커밋은 HomeViewController에 추가된 내용 뿐인 것 같은데 어떤 커밋 확인하면 될까요???

@2jae6
Copy link
Owner

2jae6 commented Apr 26, 2022

<img src="imge.png" width="200" height="400"/>
형태로 PR 시 이미지 추가하시면 이미지 크기조절 가능해요! :)

@2jae6
Copy link
Owner

2jae6 commented Apr 26, 2022

색상은 Color Hunt 를 이용했습니다. :]

저도 디자인 작업 시 해당 색상 위주로 사용해야겠네요:) 감사합니다.

@elppaaa
Copy link
Collaborator Author

elppaaa commented Apr 26, 2022

코드를 리포맷팅한 커밋이 실수로 포함되었네요 ㅠㅠ 번거롭겠지만 커밋을 짚어가면서 보시거나 3bb825d 커밋을 기준으로 봐주시면 될 것 같아요 🙏

3bb825d 커밋은 HomeViewController에 추가된 내용 뿐인 것 같은데 어떤 커밋 확인하면 될까요???

pr 한거 로컬에서 땡겨서 보실 줄 알고 해당 커밋에 작성된 코드가 아니라 해당 커밋까지의 코드를 얘기한 거였어요.
해당 pr HEAD~1 이요!

  • 3e1e404 : 처음에 로직 (RandomMusicQuizReactor) 작성
  • e157002 : 뷰 작성
  • b9aa116 : VC, Reactor 바인딩 및 로직 수정

@elppaaa
Copy link
Collaborator Author

elppaaa commented Apr 26, 2022

죄송합니다 깃 사용이 익숙치 않아 실수했네요 🙏
reformatting 을 해당 pr 에서 작업하게되면 너무너무 많은 충돌이 생길 것 같아요
#12, #13 모두 머지된 뒤에 따로 작업을 하겠습니다.
해당 커밋은 revert 했어요!!

Copy link
Owner

@2jae6 2jae6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다:] 고생하셨네요!

Copy link
Collaborator Author

@elppaaa elppaaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 읽느라 고생이 많으시네요....

몇몇 부분 재 피드백 부탁드려요 :]
해소된 부분은 Resolve conversation !

Copy link
Owner

@2jae6 2jae6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했어요~

2jae6 and others added 5 commits April 26, 2022 18:40
- 재사용 않는 클래스 final 로 변경
- 모델 파일 분리
- 네이밍 수정
- 무한로딩되던 문제 해결
- ytPlayer 라이브러리에서 delegate 호출이 정상적으로 이루어지지 않아
  발생
- ytPlayer 로의 요청중일 때 막는 방식으로 해결
비디오 재생과정은 아래와 같다.

1. 비디오 로드 // pending
2. 비디오 준비 // ready
3. 비디오 재생 명령 // .startVideo()
4-1. 비디오 버퍼링 // buffering
4-2. 비디오 재생

비디오 재생을 수행 시 버퍼링 과정이 포함되는데, 버퍼링 -> 재생까지의
시각이 매번 달라 YTPlayer 의 state 를 확인하여 재생되는 시점을 확인하고
재생되도록 하였음.

- 다른 state (isReady) 와 같은 state 는 PlayerState 로 관리하도록 수정
- 재생 / 정지 동작을 명령할 state 네이밍 수정

fix 2jae6#8
시간초 재생 후 시작을 눌렀을 때 시간초 재생이 이루어지던 오류 수정
@elppaaa
Copy link
Collaborator Author

elppaaa commented Apr 26, 2022

무한로딩 발생하던 문제

YTPlayerView 에서 빠르게 load 요청시 해당 라이브러리에서 정상적으로 상태가 변경되지 않아 발생했습니다.
로딩중일 때 추가적인 요청이 발생하지 않도록 수정했습니다.

재생 시간이 매번 다르던 문제,

시간초가 포함된 재생시 버퍼링으로 인해 재생 시간이 매번 달랐습니다.
YTPlayerView 의 상태를 확인하여 버퍼링 이후 재생일때 타이머가 수행되도록 수정했습니다.

@2jae6
Copy link
Owner

2jae6 commented Apr 27, 2022

확인했어요 !!! 너무 수고 많으셨습니다 :)

@2jae6 2jae6 merged commit 7e8dd1f into 2jae6:develop Apr 27, 2022
@elppaaa elppaaa deleted the feature/random_music branch April 27, 2022 09:05
@2jae6 2jae6 added 🦴 Refactoring 🦴 기존 소스를 리팩토링 작업 시에 사용합니다. 🚀 feature 🚀 Extra attention is needed 🐸 Help 🐸 2jae6 작업 labels Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feature 🚀 Extra attention is needed 🐸 Help 🐸 2jae6 작업 🦴 Refactoring 🦴 기존 소스를 리팩토링 작업 시에 사용합니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants