I want to show the screen from Top To Bottom but When I use HCYouTubeParser In my app, when i click on Done Button then screen move from bottom to top.I can not find the coding of Done Button How can it is possible?
Asked
Active
Viewed 83 times
0
-
When you say "Top To Bottom", are you talking about Orientation? – Droppy Jul 27 '16 at 07:50
-
The Problem is that I can not find the coding where i will change the orientation. – Harimohan Agrawal Jul 27 '16 at 07:57
2 Answers
0
HCYouTubeParser, this library using default MPMoviePlayerController
class of MediaPlayer Framework which is provided by apple.
see this is the code inside HCYouTubeParser->ViewController.m
- (void)playVideo:(id)sender {
if (_urlToLoad) {
MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:_urlToLoad];
[self presentViewController:mp animated:YES completion:NULL];
}
}
So "Done" button is part of that controller. You have to override that "Done" button functionality by adding observer.
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(doneButtonClick:)
name:MPMoviePlayerWillExitFullscreenNotification
object:nil];
-(void)doneButtonClick:(NSNotification*)aNotification{
NSNumber *reason = [notification.userInfo objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];
if ([reason intValue] == MPMovieFinishReasonUserExited) {
// Your done button action here
}
}
Refer this link :Done button event MPMoviePlayerController

Community
- 1
- 1

Bhadresh Mulsaniya
- 2,610
- 1
- 12
- 25
0
First of all, the library you are using is presenting the view controller and by "default" iOS will do presenting from bottom to top. And you cannot find the code which makes the bottom to top.
Second if you want to change this bottom to top you can do the following to change it.
- Make a custom transaction
- Add the view controller as a child view controller and animate it from top to bottom or any other way you like.

Bharath
- 2,064
- 1
- 14
- 39