react-embed-video
v0.2.2
Published
An easy to slot in component that renders a video embed of popular streaming services.
Downloads
7
Maintainers
Readme
react-embed-video
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 | :x: | Allows feature policies to be defined for an iframe. Documentation for this is here.|
| disableURLProcessing | boolean | :x: 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 | :x: Default: 300 | Height of iframe embed.
| lazy | boolean | :x: 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 | :x: | Fills title
attribute, useful for accessibility.
| url | string | :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
.
| width | number | :x: Default: 500 | Width of iframe embed.