Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for isssue #1463 #1466

Closed
wants to merge 1 commit into from
Closed

Conversation

uioporqwerty
Copy link

Fix for Issue, directly accessing NativeModules.UIManager is no longer supported.
Propose to add import to UIManager directly from 'react-native' module on top and change the code from NativeModules.UIManager.RCTVideo.~~~ to UIManager.getViewManagerConfig('RCTVideo').~~~ as suggested from react-native's warning.

Fix for Issue, directly accessing NativeModules.UIManager is no longer supported.
Propose to add import to UIManager directly from 'react-native' module on top and change the code from NativeModules.UIManager.RCTVideo.~~~ to UIManager.getViewManagerConfig('RCTVideo').~~~ as suggested from react-native's warning.
Copy link
Contributor

@n1ru4l n1ru4l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uioporqwerty Thank you for your contribution! Just one small change, afterwards I am going to merge this 😊

@@ -225,13 +225,13 @@ export default class Video extends Component {

let nativeResizeMode;
if (resizeMode === VideoResizeMode.stretch) {
nativeResizeMode = NativeModules.UIManager.RCTVideo.Constants.ScaleToFill;
nativeResizeMode = UIManager.getViewManagerConfig('RCTVideo').Constants.ScaleToFill;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please move this a level higher?

E.g.

let nativeResizeMode;
const RCTVideoInstance = UIManager.getViewManagerConfig('RCTVideo')

if (resizeMode === VideoResizeMode.stretch) {
    nativeResizeMode = RCTVideoInstance.Constants.ScaleToFill;

@tapz
Copy link

tapz commented Mar 8, 2019

Is this already in npm?

@n1ru4l
Copy link
Contributor

n1ru4l commented Mar 8, 2019

Yes included in 4.4.0 https://www.npmjs.com/package/react-native-video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants