Skip to content

Commit

Permalink
Use UIManager.getViewManagerConfig (shahen94#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
superandrew213 authored and shahen94 committed Sep 26, 2019
1 parent 61fbe20 commit a4f3249
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/VideoPlayer/VideoPlayer.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from 'react-native';
import { getActualSource } from '../utils';

const ProcessingUI = UIManager.RNVideoProcessing;
const ProcessingUI = UIManager.getViewManagerConfig('RNVideoProcessing');

export class VideoPlayer extends Component {
static Constants = {
Expand Down
12 changes: 7 additions & 5 deletions lib/VideoPlayer/VideoPlayer.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const PLAYER_COMPONENT_NAME = 'RNVideoProcessing';

const { RNVideoTrimmer } = NativeModules;

const ProcessingUI = UIManager.getViewManagerConfig('RNVideoProcessing');

export class VideoPlayer extends Component {
static propTypes = {
source: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
Expand All @@ -28,7 +30,7 @@ export class VideoPlayer extends Component {
play: false,
replay: false,
rotate: false,
resizeMode: UIManager.RNVideoProcessing.Constants.ScaleNone,
resizeMode: ProcessingUI.Constants.ScaleNone,
volume: 0.0,
currentTime: 0,
startTime: 0,
Expand All @@ -47,10 +49,10 @@ export class VideoPlayer extends Component {
QUALITY_PASS_THROUGH: 'passthrough', // does not change quality
},
resizeMode: {
CONTAIN: UIManager.RNVideoProcessing.Constants.ScaleAspectFit,
COVER: UIManager.RNVideoProcessing.Constants.ScaleAspectFill,
STRETCH: UIManager.RNVideoProcessing.Constants.ScaleToFill,
NONE: UIManager.RNVideoProcessing.Constants.ScaleNone
CONTAIN: ProcessingUI.Constants.ScaleAspectFit,
COVER: ProcessingUI.Constants.ScaleAspectFill,
STRETCH: ProcessingUI.Constants.ScaleToFill,
NONE: ProcessingUI.Constants.ScaleNone
}
};

Expand Down

0 comments on commit a4f3249

Please sign in to comment.