score:0
I've decided to go with uploading the video to Cloudinary, a remote source instead. Thanks for everyone's help.
score:0
This way works for local photos and videos:
import concert from '../../assets/videos/concert.mp4'
render(){
return (
<video controls>
<source src={concert} type="video/mp4"/>
Your browser doesn't support HTML video.
</video>
); }
score:1
This is a fix for me. https://github.com/facebook/create-react-app/issues/6822#issuecomment-483079845
You can use src/react-app-env.d.ts to test it out:
declare module '*.mp4' {
const src: string;
export default src;
}
score:2
This works for local file:
import videos from '../../app/assets/videos/concert.mp4'
render(){
return (
<video loop autoPlay>
<source src={videos} type="video/mp4"/>
</video>
); }
Source: stackoverflow.com
Related Query
- Can't load local video with React
- How to load a local video in React using webpack?
- React local video does not load in production
- load local mp4 file as source for video tag in React Gatsby website
- How can i load local video react application
- import LOCAL .obj to load with Three.js OBJLoader using React
- React won't load local images
- Updating source URL on HTML5 video with React
- Dynamically load a stylesheet with React
- Dealing with local state in react and redux
- How to run production react app in local with local back-end
- How do I use local state along with redux store state in the same react component?
- Dynamically load redux reducers with react router 4
- Cant load a react app after starting server
- React Native local images load slowly
- Cant use Hooks with my React Component Library. Invariant Violation: Invalid hook call
- Symlinking react modules with npm link for local development gives error
- React Native - How to load local image using the uri in Image Component?
- React app with Server-side rendering crashes with load
- React Router doesn't load images properly with nested routes
- How to load tinymce editor in React using local tinymce js
- React Router v4: Cant load page on GitHub pages
- Async Image Load with React and Redux
- Combining React local state with Redux global state
- Can't seek through video from Rails Active Storage with Rails-Webpacker React Frontend
- Deploy React with Nginx failed to load resources
- React Native - Share local image with showShareActionSheetWithOptions
- How to load facebook page plugin with react
- React Select with Async - Failing to load options
- How to load child component with props on first render with React Hooks
More Query from same tag
- Receiving the Progress as a File Uploads
- Object is possibly null react/typescript
- How to get reducer unit test working?
- Accessing map reference using React-google-maps v6+
- React Google Map InfoWindow showing all the info when I click on a single Mark
- Uncaught TypeError: _firebase__WEBPACK_IMPORTED_MODULE_2__.default.collection is not a function
- OwlCarousel navigation for cards in left and right :react js
- Default function value in React component using Typescript
- Does use useState inside useEffect doesn't works?
- Upload Large file (Video) to nodejs server and aws s3 using ReactJs
- Console Log from Props
- How to update modal component with new props
- How I can get post values in edit with React/Redux form in React
- Reactjs to Webapi on ASP.net Core 2.2 fails with error 415 in app but not in Postman
- Persona - onRenderPrimaryText - pass addt'l parameters?
- Having issues connecting my client Heroku app to my Server app
- How to use url params as object imported in file?
- Typescript Errors while converting a React project
- How to deploy browserHistory based React applications to Azure App Service?
- Extract single object from list in React
- How to integrate Youtube Iframe api in reactjs solution
- Incorrect values on Highcharts (compared to input)
- Material UI's Tooltip - Customization Style
- Can't get value of selected option
- Can't seek through video from Rails Active Storage with Rails-Webpacker React Frontend
- How do you test temporary loading text with react testing library?
- npx create-react-app running with old version
- react-router-dom v ^5.2.0 Routes troubleshooting
- Deploying React webpage to Github
- How to access a function in a Webpack bundle from a HTML script