@helpscout/vcr

VCR: A tiny React component to handle video embeds

Stats

StarsIssuesVersionUpdatedCreatedSize
@helpscout/vcr
0.0.63 years ago3 years agoMinified + gzip package size for @helpscout/vcr in KB

Readme

📼 VCR npm version Build Status Coverage Status

A tiny React component to handle video embeds

  • Tiny, at less than 2KB Gzipped
  • Performant
  • Multiple video rendering support (including Wistia!)

Table of contents

🔧 Installation

npm install --save @helpscout/vcr

🕹 Usage

Here's a quick example of how to (not-so) dangerously render video embeds with VCR:

import React from 'react'
import VCR from '@helpscout/vcr'

// Your markup which many contain fancy video embeds
const html = `
<script src="//fast.wistia.com/assets/external/E-v1.js" async></script>
<div class="wistia_embed wistia_async_abcde12345" style="width:640px;height:360px;"></div>
`

// Pass it into VCR via the html prop
const App = props => (
  return (
    <VCR html={html} />
  )
)

That's it! VCR will take care of parsing and rendering the video embeds as it "dangerously" sets the innerHTML to render out the rest of your HTML.

🙌 Supported Embeds

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.