@helpscout/vcr

0.0.6 • Public • Published

📼 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

Readme

Keywords

none

Package Sidebar

Install

npm i @helpscout/vcr

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

25.6 kB

Total Files

10

Last publish

Collaborators

  • helpscout