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

small fix for the ios video player ui, so that it positions better on iphone5 and up. #3243

Merged
merged 1 commit into from
Sep 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions examples/ios/moviePlayerExample/src/VideoPlayerControls.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ @interface VideoPlayerControls () {
IBOutlet UILabel * topLabel;
IBOutlet UILabel * bottomLabel;
IBOutlet UILabel * newFrameLabel;
CGRect controlsFrameShow;
CGRect controlsFrameHide;
BOOL bShow;
}

Expand Down Expand Up @@ -73,6 +75,16 @@ - (void)viewDidLoad {
[self setNative:NO];
[self setLoop:NO];

CGRect screenRect = [UIScreen mainScreen].bounds;
self.view.frame = screenRect;

controlsFrameShow = controls.frame;
controlsFrameShow.origin.y = screenRect.size.height - controlsFrameShow.size.height;
controlsFrameHide = controlsFrameShow;
if(screenRect.size.height <= 640) {
controlsFrameHide.origin.y += controlsFrameHide.size.height;
}

UITapGestureRecognizer * tapGesture;
tapGesture = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureRecognised:)] autorelease];
tapGesture.numberOfTapsRequired = 1;
Expand Down Expand Up @@ -243,15 +255,11 @@ - (void)tapGestureRecognised:(id)sender {
bShow = !bShow;
if(bShow) {
[UIView animateWithDuration:0.3 animations:^{
CGRect controlsFrame = controls.frame;
controlsFrame.origin.y = 392;
controls.frame = controlsFrame;
controls.frame = controlsFrameShow;
}];
} else {
[UIView animateWithDuration:0.3 animations:^{
CGRect controlsFrame = controls.frame;
controlsFrame.origin.y = 480;
controls.frame = controlsFrame;
controls.frame = controlsFrameHide;
}];
}
}
Expand Down
Loading