0.2.2 • Published 1 year ago

react-embed-video v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-embed-video

NPM version npm-typescriptLicense]github-license-url

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.

PropTypeRequiredDescription
allowstring:x:Allows feature policies to be defined for an iframe. Documentation for this is here.
disableURLProcessingboolean:x: Default: falseWhen true, allows the implementer to force the use of the url prop provided to be the src of the iframe, skipping all URL processing.
heightnumber:x: Default: 300Height of iframe embed.
lazyboolean:x: Default: falseAppends 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.
titlestring:x:Fills title attribute, useful for accessibility.
urlstring:heavy_check_mark: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.
widthnumber:x: Default: 500Width of iframe embed.