Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video isn't being loaded during production. #41

Open
elebumm opened this issue Mar 4, 2020 · 3 comments
Open

Video isn't being loaded during production. #41

elebumm opened this issue Mar 4, 2020 · 3 comments

Comments

@elebumm
Copy link

elebumm commented Mar 4, 2020

Describe the bug
I have a video in my HTML using a <video> tag. I have an mp4 file but when I do a production build, it doesn't get translated over.

To Reproduce
Steps to reproduce the behavior:

  1. Insert a video tag with an mp4 file linked.
  2. Run a production build or deploy to netlify.
  3. Look at the video, it will result in a 404.

Expected behavior
The video should be loaded in.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Mac OS Catalina
  • Browser Chrome
  • Version [e.g. 22]

Additional context
I see that there is an attempt to load the videos over. in the loaders file.

@elebumm
Copy link
Author

elebumm commented Mar 5, 2020

Here is how I solved my issue.

I first had to import the file in my scripts:

import '../images/housedrone.mp4';

Then the webpack build would add a hash to the file name which would cause it to not be read under the source of the video. So in the loaders.js file, i replaced the video section with this:

const videos = {
  test: /\.(mp4|webm)$/,
  use: [
    {
      loader: 'file-loader',
      query: {
        name: '[name].[ext]',
        outputPath: 'images/',
      },
    },
  ],
};

Now it works, but I don't know if this is the best solution, just one that works for me now.

@truongoi
Copy link

The mentioned

@umer4ik
Copy link

umer4ik commented Oct 16, 2020

Updating html-loader up to the 1.3.2 version worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants