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

Example on how to load a video from remote #10

Open
jenlai1345 opened this issue Nov 20, 2020 · 3 comments
Open

Example on how to load a video from remote #10

jenlai1345 opened this issue Nov 20, 2020 · 3 comments

Comments

@jenlai1345
Copy link

Suppose my video file is hosted on https://www.example.com/video.mp4
Can you provide an example on how to load it?

in my next.config.js I have properly set up the assetPrefix,

const withVideos = require('next-videos')

module.exports = withVideos({
  assetPrefix: 'https://example.com',

  webpack(config, options) {
    return config
  }
})

However, in my component, how can I load it?
(Below doesn't work)

export default () => (
  <div>
    <video src="video.mp4" />
  </div>
)

Thank you in advance

@CedYF
Copy link

CedYF commented Mar 21, 2021

Yea I still can't get it to work...

@nonoumasy
Copy link

same here. Can someone pls add an example.

@vleung-into
Copy link

According to the code, the full file path is ${prefix}/_next/static/videos/, so make sure the video is in that folder structure.

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

4 participants