Skip to content

Commit

Permalink
🐛 버그 픽스 및 옵저버 주기 조절
Browse files Browse the repository at this point in the history
  • Loading branch information
chopmozzi committed Dec 14, 2023
1 parent 1d71c4a commit 3a25446
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions iOS/Layover/Layover/Scenes/Playback/PlaybackInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ protocol PlaybackBusinessLogic {
func playInitialPlaybackCell(with request: PlaybackModels.DisplayPlaybackVideo.Request)
func playVideo(with request: PlaybackModels.DisplayPlaybackVideo.Request)
func playTeleportVideo(with request: PlaybackModels.DisplayPlaybackVideo.Request)
func playTeleportVideoOnlyOneCell(with request: PlaybackModels.DisplayPlaybackVideo.Request)
func careVideoLoading(with request: PlaybackModels.DisplayPlaybackVideo.Request)
func moveVideo(with request: PlaybackModels.DisplayPlaybackVideo.Request)
func resetVideo()
Expand Down Expand Up @@ -177,6 +178,12 @@ final class PlaybackInteractor: PlaybackBusinessLogic, PlaybackDataStore {
}
}

func playTeleportVideoOnlyOneCell(with request: PlaybackModels.DisplayPlaybackVideo.Request) {
if let isTeleport, isTeleport == true, playbackVideoInfos.count == 3 {
presenter?.presentMoveCellNext(with: Models.DisplayPlaybackVideo.Response(previousCell: previousCell, currentCell: previousCell))
}
}

func resumePlaybackView() {
if let previousCell {
let response: Models.DisplayPlaybackVideo.Response = Models.DisplayPlaybackVideo.Response(previousCell: nil, currentCell: previousCell)
Expand Down
2 changes: 1 addition & 1 deletion iOS/Layover/Layover/Scenes/Playback/PlaybackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ final class PlaybackView: UIView {
}

func setPlayerSlider() {
let interval: CMTime = CMTimeMakeWithSeconds(1, preferredTimescale: Int32(NSEC_PER_SEC))
let interval: CMTime = CMTimeMakeWithSeconds(0.2, preferredTimescale: Int32(NSEC_PER_SEC))
timeObserverToken = playerView.player?.addPeriodicTimeObserver(forInterval: interval, queue: .main, using: { [weak self] currentTime in
self?.updateSlider(currentTime: currentTime)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,15 @@ extension PlaybackViewController: UICollectionViewDelegate {
interactor?.careVideoLoading(with: request)
}

func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
guard let currentPlaybackCell: PlaybackCell = cell as? PlaybackCell else {
return
}

let request: Models.DisplayPlaybackVideo.Request = Models.DisplayPlaybackVideo.Request(indexPathRow: indexPath.row, currentCell: currentPlaybackCell)
interactor?.playTeleportVideoOnlyOneCell(with: request)
}

func scrollViewWillBeginDecelerating(_ scrollView: UIScrollView) {
let currentOffset = scrollView.contentOffset.y
let maximumOffset = scrollView.contentSize.height - scrollView.frame.size.height
Expand Down

0 comments on commit 3a25446

Please sign in to comment.