flexn-io / create

Build apps for web, TVs, desktops, consoles, wearables and more. Developer friendly UI library targeting all form factors platforms. Another notable feature is providing focus management for TVs which very easy to implement using Create.
https://create.flexn.org
MIT License
26 stars 6 forks source link

React native video #76

Closed henrimagoware closed 1 year ago

henrimagoware commented 1 year ago

Hello , I am building a TV app based on Flexn framework , one of the things I am trying to do is installing a library called react-native-video to make a stream playing . When i am trying to do the configurations for Android TV platform , after I set them manually and try it to run the changes i added set to defaults . I have upload a picture of the configurations that i want to be add and to be saved . I think that after the configurations are made the video would play .

Can anyone help with any solution ? Thank you .

image

mihaiblaga89 commented 1 year ago

How did you add the plugin? Manually? If so, please try to undo everything you did and try it with rnv plugin add react-native-video. This should add it and also configure everything that needs configured on the native side.

If you still want to do it manually all you need to do is add this in your renative.json plugins section

"react-native-video": "source:rnv",

An even more advanced example would be adding the next section in plugins instead of the source:rnv, which would allow you to have even more control

"react-native-video": {
            "version": "5.0.2",
            "ios": {
                "podName": "react-native-video"
            },
            "tvos": {
                "podName": "react-native-video"
            },
            "android": {
                "package": "com.brentvatne.react.ReactVideoPackage"
            },
            "androidtv": {
                "package": "com.brentvatne.react.ReactVideoPackage"
            },
            "firetv": {
                "package": "com.brentvatne.react.ReactVideoPackage"
            },
            "webpack": {
                "modulePaths": true
            }
        },

Further reading: https://github.com/renative-org/renative/blob/canary/packages/rnv/pluginTemplates/renative.plugins.json This is the file that manages all the plugins. You can see everything that RNV does with you specify "source:rnv" to a plugin.

henrimagoware commented 1 year ago

Hello , I added the followed instructions as you said and it came with an error as in the photo below .

image image

Do you suggest any solution of this problem . My node js version is 16.16.0.

Thank you !

mihaiblaga89 commented 1 year ago

@henrimagoware please use "source:flexn" instead of "source:rnv" in your renative.json. Also make sure you have @flexn/plugins in your devDepencencies.

"plugins": {
    "react-native-video": "source:flexn"
},

This should fix the issue.

mihaiblaga89 commented 1 year ago

closing this, feel free to reopen if needed