Reputation:
How to change size of MPMoviePlayerController views. Now it is covering full screen in landscape mode. Can we resize to half size or other size? I want display only half screen and other video related info display in remaining screen? Is it possible?
Upvotes: 0
Views: 2252
Reputation: 11
Actually, you can change the size of the player. Before you create the movie object, attach a selector, like this:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyWindowChanged:) name:UIWindowDidBecomeKeyNotification object:nil];
This way, when the new window of the player appears, you can grab it and change its size to fit your needs.
You can also add the Overlay:
\- (void) keyWindowChanged: (NSNotification *) aNot {
if([[[UIApplication sharedApplication] windows] count] > 1)
{
NSArray *windows = [[UIApplication sharedApplication] windows];
UIWindow * tmp = [windows objectAtIndex:1];//[aNot object];
movOverlay = [[UIView alloc] initWithFrame:CGRectMake(10, 40, 30, 40)];
movOverlay.backgroundColor = [UIColor purpleColor];
[tmp addSubview:movOverlay];
...
}
}
Upvotes: 1
Reputation: 112857
MPMoviePlayerController take the entire screen. The only option for is to use a 3rd party video viewer library.
Upvotes: 0