if (self.videoViewMode == kBookPageContentViewControllerVideoViewModeCircle) {
self.videoViewMode = kBookPageContentViewControllerVideoViewModeFullScreen;
self.videoViewPlaceholderWidth.constant = self.view.width;
self.videoViewPlaceholderHeight.constant = self.view.height;
self.videoViewPlaceHolderXOffset.constant = 0;
self.videoViewPlaceHolderYOffset.constant = 0;
[UIView animateWithDuration:1 animations:^{
self.moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
self.videoView.layer.cornerRadius = 0;
self.videoView.clipsToBounds = NO;
[self.view layoutIfNeeded];
}];
} else {
self.videoViewMode = kBookPageContentViewControllerVideoViewModeCircle;
self.videoViewPlaceholderHeight.constant = kVideoViewHeightWidth;
self.videoViewPlaceholderWidth.constant = kVideoViewHeightWidth;
self.videoViewPlaceHolderXOffset.constant = arc4random_uniform(self.view.width * 0.2) - kVideoViewHeightWidth;
self.videoViewPlaceHolderYOffset.constant = kVideoViewHeightWidth - arc4random_uniform(self.view.height * 0.2);
[UIView animateWithDuration:1 animations:^{
self.moviePlayer.scalingMode = MPMovieScalingModeAspectFill;
self.videoView.layer.cornerRadius = kVideoViewHeightWidth * 0.5;
self.videoView.clipsToBounds = YES;
[self.view layoutIfNeeded];
}];
}
}
近期评论