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>
); }

Related Query

More Query from same tag