Working on autorotation of video player
This commit is contained in:
parent
3c0323fbb0
commit
3ba26eb45a
@ -61,6 +61,7 @@ static int const RCTVideoUnset = -1;
|
|||||||
BOOL _playWhenInactive;
|
BOOL _playWhenInactive;
|
||||||
NSString * _ignoreSilentSwitch;
|
NSString * _ignoreSilentSwitch;
|
||||||
NSString * _resizeMode;
|
NSString * _resizeMode;
|
||||||
|
BOOL _fullscreen;
|
||||||
BOOL _fullscreenPlayerPresented;
|
BOOL _fullscreenPlayerPresented;
|
||||||
UIViewController * _presentingViewController;
|
UIViewController * _presentingViewController;
|
||||||
#if __has_include(<react-native-video/RCTVideoCache.h>)
|
#if __has_include(<react-native-video/RCTVideoCache.h>)
|
||||||
@ -342,6 +343,8 @@ static int const RCTVideoUnset = -1;
|
|||||||
|
|
||||||
[self addPlayerTimeObserver];
|
[self addPlayerTimeObserver];
|
||||||
|
|
||||||
|
[self setFullscreen:_fullscreen];
|
||||||
|
|
||||||
//Perform on next run loop, otherwise onVideoLoadStart is nil
|
//Perform on next run loop, otherwise onVideoLoadStart is nil
|
||||||
if (self.onVideoLoadStart) {
|
if (self.onVideoLoadStart) {
|
||||||
id uri = [source objectForKey:@"uri"];
|
id uri = [source objectForKey:@"uri"];
|
||||||
@ -1085,10 +1088,8 @@ static int const RCTVideoUnset = -1;
|
|||||||
|
|
||||||
- (void)setFullscreen:(BOOL)fullscreen
|
- (void)setFullscreen:(BOOL)fullscreen
|
||||||
{
|
{
|
||||||
if( fullscreen && !_fullscreenPlayerPresented )
|
_fullscreen = fullscreen;
|
||||||
{
|
if( fullscreen && !_fullscreenPlayerPresented && _player )
|
||||||
// Ensure player view controller is not null
|
|
||||||
if( !_playerViewController )
|
|
||||||
{
|
{
|
||||||
[self usePlayerViewController];
|
[self usePlayerViewController];
|
||||||
}
|
}
|
||||||
|
@ -13,4 +13,18 @@
|
|||||||
[_rctDelegate videoPlayerViewControllerDidDismiss:self];
|
[_rctDelegate videoPlayerViewControllerDidDismiss:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)shouldAutorotate {
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
|
||||||
|
|
||||||
|
return UIInterfaceOrientationMaskLandscape;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
|
||||||
|
|
||||||
|
return UIInterfaceOrientationLandscapeLeft;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Loading…
Reference in New Issue
Block a user