Fixed Conflict in CHANGELOG.md
This commit is contained in:
commit
0152db8f5a
@ -15,6 +15,8 @@
|
|||||||
* Add fullscreenOrientation option for iOS [#1215](https://github.com/react-native-community/react-native-video/pull/1215)
|
* Add fullscreenOrientation option for iOS [#1215](https://github.com/react-native-community/react-native-video/pull/1215)
|
||||||
* Update to ExoPlayer 2.9.0 [#1285](https://github.com/react-native-community/react-native-video/pull/1285)
|
* Update to ExoPlayer 2.9.0 [#1285](https://github.com/react-native-community/react-native-video/pull/1285)
|
||||||
* Switch useTextureView to default to `true` [#1286](https://github.com/react-native-community/react-native-video/pull/1286)
|
* Switch useTextureView to default to `true` [#1286](https://github.com/react-native-community/react-native-video/pull/1286)
|
||||||
|
* Re-add fullscreenAutorotate prop [#1303](https://github.com/react-native-community/react-native-video/pull/1303)
|
||||||
|
* Make seek throw a useful error for NaN values [#1283](https://github.com/react-native-community/react-native-video/pull/1283)
|
||||||
* Video Filters and Save Video [#1306](https://github.com/react-native-community/react-native-video/pull/1306)
|
* Video Filters and Save Video [#1306](https://github.com/react-native-community/react-native-video/pull/1306)
|
||||||
|
|
||||||
### Version 3.2.0
|
### Version 3.2.0
|
||||||
|
@ -261,6 +261,7 @@ var styles = StyleSheet.create({
|
|||||||
* [controls](#controls)
|
* [controls](#controls)
|
||||||
* [filter](#filter)
|
* [filter](#filter)
|
||||||
* [fullscreen](#fullscreen)
|
* [fullscreen](#fullscreen)
|
||||||
|
* [fullscreenAutorotate](#fullscreenautorotate)
|
||||||
* [fullscreenOrientation](#fullscreenorientation)
|
* [fullscreenOrientation](#fullscreenorientation)
|
||||||
* [headers](#headers)
|
* [headers](#headers)
|
||||||
* [id](#id)
|
* [id](#id)
|
||||||
@ -383,6 +384,11 @@ Controls whether the player enters fullscreen on play.
|
|||||||
|
|
||||||
Platforms: iOS
|
Platforms: iOS
|
||||||
|
|
||||||
|
#### fullscreenAutorotate
|
||||||
|
If a preferred [fullscreenOrientation](#fullscreenorientation) is set, causes the video to rotate to that orientation but permits rotation of the screen to orientation held by user. Defaults to TRUE.
|
||||||
|
|
||||||
|
Platforms: iOS
|
||||||
|
|
||||||
#### fullscreenOrientation
|
#### fullscreenOrientation
|
||||||
|
|
||||||
* **all (default)** -
|
* **all (default)** -
|
||||||
|
3
Video.js
3
Video.js
@ -52,6 +52,8 @@ export default class Video extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
seek = (time, tolerance = 100) => {
|
seek = (time, tolerance = 100) => {
|
||||||
|
if (isNaN(time)) throw new Error('Specified time is not a number');
|
||||||
|
|
||||||
if (Platform.OS === 'ios') {
|
if (Platform.OS === 'ios') {
|
||||||
this.setNativeProps({
|
this.setNativeProps({
|
||||||
seek: {
|
seek: {
|
||||||
@ -377,6 +379,7 @@ Video.propTypes = {
|
|||||||
controls: PropTypes.bool,
|
controls: PropTypes.bool,
|
||||||
audioOnly: PropTypes.bool,
|
audioOnly: PropTypes.bool,
|
||||||
currentTime: PropTypes.number,
|
currentTime: PropTypes.number,
|
||||||
|
fullscreenAutorotate: PropTypes.bool,
|
||||||
fullscreenOrientation: PropTypes.oneOf(['all','landscape','portrait']),
|
fullscreenOrientation: PropTypes.oneOf(['all','landscape','portrait']),
|
||||||
progressUpdateInterval: PropTypes.number,
|
progressUpdateInterval: PropTypes.number,
|
||||||
useTextureView: PropTypes.bool,
|
useTextureView: PropTypes.bool,
|
||||||
|
@ -64,6 +64,7 @@ static int const RCTVideoUnset = -1;
|
|||||||
NSString * _ignoreSilentSwitch;
|
NSString * _ignoreSilentSwitch;
|
||||||
NSString * _resizeMode;
|
NSString * _resizeMode;
|
||||||
BOOL _fullscreen;
|
BOOL _fullscreen;
|
||||||
|
BOOL _fullscreenAutorotate;
|
||||||
NSString * _fullscreenOrientation;
|
NSString * _fullscreenOrientation;
|
||||||
BOOL _fullscreenPlayerPresented;
|
BOOL _fullscreenPlayerPresented;
|
||||||
NSString *_filterName;
|
NSString *_filterName;
|
||||||
@ -84,6 +85,7 @@ static int const RCTVideoUnset = -1;
|
|||||||
_rate = 1.0;
|
_rate = 1.0;
|
||||||
_volume = 1.0;
|
_volume = 1.0;
|
||||||
_resizeMode = @"AVLayerVideoGravityResizeAspectFill";
|
_resizeMode = @"AVLayerVideoGravityResizeAspectFill";
|
||||||
|
_fullscreenAutorotate = YES;
|
||||||
_fullscreenOrientation = @"all";
|
_fullscreenOrientation = @"all";
|
||||||
_pendingSeek = false;
|
_pendingSeek = false;
|
||||||
_pendingSeekTime = 0.0f;
|
_pendingSeekTime = 0.0f;
|
||||||
@ -1138,6 +1140,7 @@ static int const RCTVideoUnset = -1;
|
|||||||
[viewController presentViewController:_playerViewController animated:true completion:^{
|
[viewController presentViewController:_playerViewController animated:true completion:^{
|
||||||
_playerViewController.showsPlaybackControls = YES;
|
_playerViewController.showsPlaybackControls = YES;
|
||||||
_fullscreenPlayerPresented = fullscreen;
|
_fullscreenPlayerPresented = fullscreen;
|
||||||
|
_playerViewController.autorotate = _fullscreenAutorotate;
|
||||||
if(self.onVideoFullscreenPlayerDidPresent) {
|
if(self.onVideoFullscreenPlayerDidPresent) {
|
||||||
self.onVideoFullscreenPlayerDidPresent(@{@"target": self.reactTag});
|
self.onVideoFullscreenPlayerDidPresent(@{@"target": self.reactTag});
|
||||||
}
|
}
|
||||||
@ -1153,6 +1156,13 @@ static int const RCTVideoUnset = -1;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setFullscreenAutorotate:(BOOL)autorotate {
|
||||||
|
_fullscreenAutorotate = autorotate;
|
||||||
|
if (_fullscreenPlayerPresented) {
|
||||||
|
_playerViewController.autorotate = autorotate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setFullscreenOrientation:(NSString *)orientation {
|
- (void)setFullscreenOrientation:(NSString *)orientation {
|
||||||
_fullscreenOrientation = orientation;
|
_fullscreenOrientation = orientation;
|
||||||
if (_fullscreenPlayerPresented) {
|
if (_fullscreenPlayerPresented) {
|
||||||
|
@ -36,6 +36,7 @@ RCT_EXPORT_VIEW_PROPERTY(rate, float);
|
|||||||
RCT_EXPORT_VIEW_PROPERTY(seek, NSDictionary);
|
RCT_EXPORT_VIEW_PROPERTY(seek, NSDictionary);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(currentTime, float);
|
RCT_EXPORT_VIEW_PROPERTY(currentTime, float);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(fullscreen, BOOL);
|
RCT_EXPORT_VIEW_PROPERTY(fullscreen, BOOL);
|
||||||
|
RCT_EXPORT_VIEW_PROPERTY(fullscreenAutorotate, BOOL);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(fullscreenOrientation, NSString);
|
RCT_EXPORT_VIEW_PROPERTY(fullscreenOrientation, NSString);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(filter, NSString);
|
RCT_EXPORT_VIEW_PROPERTY(filter, NSString);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(progressUpdateInterval, float);
|
RCT_EXPORT_VIEW_PROPERTY(progressUpdateInterval, float);
|
||||||
|
@ -15,5 +15,6 @@
|
|||||||
|
|
||||||
// Optional paramters
|
// Optional paramters
|
||||||
@property (nonatomic, weak) NSString* preferredOrientation;
|
@property (nonatomic, weak) NSString* preferredOrientation;
|
||||||
|
@property (nonatomic) BOOL autorotate;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
@implementation RCTVideoPlayerViewController
|
@implementation RCTVideoPlayerViewController
|
||||||
|
|
||||||
- (BOOL)shouldAutorotate {
|
- (BOOL)shouldAutorotate {
|
||||||
if (self.preferredOrientation.lowercaseString == nil || [self.preferredOrientation.lowercaseString isEqualToString:@"all"])
|
|
||||||
|
if (self.autorotate || self.preferredOrientation.lowercaseString == nil || [self.preferredOrientation.lowercaseString isEqualToString:@"all"])
|
||||||
return YES;
|
return YES;
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
|
Loading…
Reference in New Issue
Block a user