Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-vimeo

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-vimeo

React component to load video from Vimeo

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-26.33%
Maintainers
1
Weekly downloads
 
Created
Source

React Vimeo

Git release

Usage

  var Vimeo = require('react-vimeo');

  React.render(
    <Vimeo videoId={ videoId } />,
    $mountNode
  );

To handle errors when something happens, like your video can't be loaded, you can pass a callback with a prop onError in the component:

  function onError(err) {
    console.log(err);
  };

  React.render(
    <Video onError={ onError } videoId={ videoId } />
    document.querySelector('#your-div')
  );

If you decide to use just Javascript without any module loader, you can get the global variable window.ReactVimeo (or just ReactVimeo):

Behind the Scene

There are some things that you should know about the component. The first one is the structure created inside by the component if you wish to stylize it.

So, the semantic HTML structure will be something like this:

  <div class='vimeo'>
    <div class='vimeo-loading'>
      <svg>...</svg>
    </div>
    <div class='vimeo-image'>
      <button type='button' class='vimeo-play-button'>
        <svg>...</svg>
      </button>
    </div>
    <div class='video-embed'>
      <iframe>...</iframe>
    </div>
  </div>

This is a very simple structure to stylize however you want. So, if you are lost, don't panic, there is a real functional example that you can follow.

For more details, check out the API below.

Component API

<Video> component:

PropertyTypeDefaultRequiredDescription
videoIdStringnoneyesThe video ID
onErrorFunctionnoopnoCallback function if the video can't be loaded

License

MIT

See the License file.

Keywords

FAQs

Package last updated on 10 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc