Skip to content

An easy to slot in component that renders a video embed of popular streaming services.

License

Notifications You must be signed in to change notification settings

NathanAlkurdi/react-embed-video

Repository files navigation

react-embed-video

NPM version npm-typescript License

An easy to slot in component that renders a video embed of popular streaming services.

Currently supports the following services:

  • YouTube
  • Vimeo

Definition of support means a service's URL is recognized, transformed to an embed URL (if not already), and passed to a basic iframe amongst other configurations. Extended embed support from services such as advanced Twitch iframes, require additional .js libraries to be loaded. Apart from that, any service's url can be used if URL processing is disabled.

Prop Type Required Description
allow string Allows feature policies to be defined for an iframe. Documentation for this is here.
disableURLProcessing boolean
Default: false
When true, allows the implementer to force the use of the url prop provided to be the src of the iframe, skipping all URL processing.
height number
Default: 300
Height of iframe embed.
lazy boolean
Default: false
Appends experimental loading attribute to iframe, allowing it to load only when within a determined distance from the user's visible viewport. Documentation for this is here.
title string Fills title attribute, useful for accessibility.
url string ✔️ Corresponding URL to be feed to the iframe src. Normally will be transformed to a valid embed URL if it is from a supported service. If the URL is invalid or unsupported, EmbedVideo will render null.
width number
Default: 500
Width of iframe embed.

About

An easy to slot in component that renders a video embed of popular streaming services.

Resources

License

Stars

Watchers

Forks

Packages

No packages published