Comments (8)
Hmm, just a quick thought off the top of my head right now... could you try adding the following override method into the view controller that you launch the video from (assuming you don't already have this):
- (BOOL)prefersStatusBarHidden {
return NO;
}
I'm not sure if that will fix it or not but it's the only thing I can think of right now. If it doesn't, I will try and look into this more later.
from cjpadcontroller.
I tried that method and it didn't work, sorry
from cjpadcontroller.
Hey, I just tried some basic code to play a video within the demo app of CJPAdController. I have set it up as you described; launch video fullscreen, play video, click the done button or wait until it's finished. Tried it on both the iPhone and iPad 7.1 Simulators, and it seems to work fine - the status bar is still there when returning to the view.
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"nameOfVideoFile" ofType:@"mov"]];
_moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
_moviePlayer.controlStyle = MPMovieControlStyleDefault;
_moviePlayer.shouldAutoplay = YES;
_moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[self.view addSubview:_moviePlayer.view];
[_moviePlayer setFullscreen:YES animated:YES];
[_moviePlayer play];
If you're using different code can you let me know what it looks like as it seems I'm unable to reproduce this bug at the moment!?
from cjpadcontroller.
I use a lib wrapper for youtube videos called LBYouTubePlayerController that use MPMoviePlayerController internally, so I think it should be the same, but here's the code that I'm using.
Other thing that I didn't mention is that I'm using CJPAdController with a tabbar which has a navigation controller on the views inside the tabbar items.
the .h file
@interface videoController : UIViewController<LBYouTubePlayerControllerDelegate>{
LBYouTubePlayerController* controller;
}
@property (nonatomic, strong) LBYouTubePlayerController* controller;
the .m file
- (void)viewDidAppear:(BOOL)animated{
if (controller.playbackState != MPMoviePlaybackStatePlaying && controller.playbackState != MPMoviePlaybackStatePaused) {
controller = [[LBYouTubePlayerController alloc] initWithYouTubeURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.youtube.com/watch?v=%@", url_video]] quality:LBYouTubeVideoQualityLarge];
controller.delegate = self;
controller.repeatMode = MPMovieRepeatModeNone;
//controller.controlStyle = MPMovieControlStyleEmbedded;
CGRect f = self.view.frame;
controller.view.frame = CGRectMake(0,0,f.size.width, f.size.height);
[self.view addSubview:controller.view];
controller.allowsAirPlay = YES;
}
}
from cjpadcontroller.
Just a quick update, this issue is only on iOS 7, with iOS 6 the status bar is displayed correctly
from cjpadcontroller.
I temporary fix it by adding the key "View controller-based status bar appearance" = NO on info.plist, but I suppose this is not a permanent fix for the tool
from cjpadcontroller.
Oh I totally forgot about that plist entry and that it's not in there by default. Sorry it completely slipped my mind! But you will need it.
If you set that plist key to YES and then use the prefersStatusBarHidden method that I posted earlier in the view controller it should work. Doing it this way is preferred as you can then easily control which view controllers should have the status bar hidden and which should show it.
If that doesn't work you it may be because it's not getting called automatically for some reason, so you might need to force it to be called with [self setNeedsStatusBarAppearanceUpdate]
. Assuming you have a notification sent when the video has finished playing, you should call it then.
Let me know if this works. If it does I'll add a note to the readme about that plist key when making use of those view controller based overrides so other people don't get this problem.
from cjpadcontroller.
Yes, that worked fine! Setting the plist key to YES and calling prefersStatusBarHidden seems to do the trick. Thanks!
from cjpadcontroller.
Related Issues (20)
- Using Different Admob Ad Unit IDs? HOT 1
- ...init adController directly in viewcontroller? HOT 2
- iAd resize problem HOT 7
- iPad iOS 7 wrong device orientation HOT 10
- AdMob targeting issue HOT 2
- No visible @interface for 'GADrequest' ... HOT 4
- Ad not shown when custom UIViewController is really a UINavigationController HOT 3
- Removed banner still shows up if canceled before initialDelay time passed HOT 1
- Compilation error HOT 19
- Status bar and Banner on top HOT 5
- Status Bar disappears when playing fullscreen video HOT 1
- 3. Set up your navigation controller as usual, help me fix this step
- Hidding the banner in one screen HOT 1
- Problem with Layout in Swift implementation HOT 1
- Can't install when using use_frameworks HOT 1
- Keep Ad Banner on presenting modal view?
- Status Bar Style default HOT 1
- Compatibility with pod "Google/AdMob" HOT 1
- Status bar being hidden
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cjpadcontroller.