-
-
Save larssondaniel/40e371e7d8ceb9528377c1bca3bf0d9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)panningChangedWithTranslation:(CGPoint)translation | |
{ | |
if (self.playerViewAnimator.isRunning) | |
{ | |
return; | |
} | |
CGFloat translatedY = self.view.center.y + translation.y; | |
CGFloat progress; | |
switch (self.playerState) { | |
case PlayerStateThumbnail: | |
progress = 1 - (translatedY / self.view.center.y); | |
break; | |
case PlayerStateFullscreen: | |
progress = (translatedY / self.view.center.y) - 1; | |
} | |
progress = MAX(0.001, MIN(0.999, progress)); | |
self.playerViewAnimator.fractionComplete = progress; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment