ClojureScript + React-Native - Embed Videos

前端 未结 2 1199
遇见更好的自我
遇见更好的自我 2021-01-24 23:38

I am new to ClojureScript. I would like to embed video (Youtube) to the hybrid mobile app using ClojureScript and React Native. I have tried to implement react-native-vi

相关标签:
2条回答
  • 2021-01-25 00:24

    I could embed YouTube video by using ReactNative WebView.

    (def ReactNative (js/require "react-native"))
    (def web-view (r/adapt-react-class (oget ReactNative "WebView")))
    

    The component reference:

    [web-view { :style {
                                :width 400
                                :height 200
                                :zIndex 10}
                          :javaScriptEnabled true
                          :domStorageEnabled true
                          :source {:uri "https://www.youtube.com/embed/M8Fn8SfXw3M"}}]
    

    I think react-native-video is not supporting youtube videos.

    0 讨论(0)
  • 2021-01-25 00:27

    Without knowing what error you're getting and which setup you have, try calling the modules like this instead:

    (def Video (aget (js/require "react-native-video") "default"))
    
    0 讨论(0)
提交回复
热议问题