New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

next-videos

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-videos

Import videos (mp4, webm, ogg, swf, ogv) in Next.js.

latest
Source
npmnpm
Version
1.4.1
Version published
Weekly downloads
10K
8.09%
Maintainers
1
Weekly downloads
 
Created
Source

Next Videos

npm version

Import videos (mp4, webm, mov, ogg, swf, ogv) in Next.js.

Features

  • Load videos from local
  • Load videos from remote (CDN for example) with assetPrefix
  • Adds a content hash to the file name so videos can get cached

Installation

yarn add next-videos -E

Usage

Create a next.config.js in your project

// next.config.js
const withVideos = require('next-videos')

module.exports = withVideos()

And you just import it in your component using require()

export default () => (
  <div>
    <video src={require('./video.mp4')} />
  </div>
)

Options

assetPrefix

You can serve your videos to a remote url by setting assetPrefix option

const withVideos = require('next-videos')

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

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

basePath

You can serve your videos to prefixed path by setting basePath option

const withVideos = require('next-videos')

module.exports = withVideos({
  basePath: '/v2',

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

Keywords

next

FAQs

Package last updated on 08 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts