Is there any solutions for playing video in React-Native-Web
React-Native-Web: https://github.com/necolas/react-native-web
React-Native-Video: https://github.com/react-native-community/react-native-video
Is there any solutions for playing video in React-Native-Web
React-Native-Web: https://github.com/necolas/react-native-web
React-Native-Video: https://github.com/react-native-community/react-native-video
I don't know how viable this solution is but since you are targeting web, you could use and abuse the createElementfrom react-native-web to create a video element.
For example you could create a stateless component like this:
import { createElement } from "react-native-web"; const Video = (props) => { const attrs = { src: props.source, poster: props.poster, controls: "controls" } return createElement("video", attrs) } export default Video And then use it in your app like this:
<Video source={require("./stock_video.mp4")} poster={'https://www.fillmurray.com/480/300'} /> Here's a little demo how it would work.
createElement no longer exists and is replaced by unstable_createElement. necolas.github.io/react-native-web/docs/unstable-apisYou can go with the expo av to show the video in react native web. the expo video directly supported for the web.
import { Video } from 'expo-av'; <Video ref={/* ref for the player */} style={/* style for the video player */} source={{ uri: '', // URI to render the video }} /> Reference: https://docs.expo.dev/versions/latest/sdk/video-av/