Coder Social home page Coder Social logo

eapostol / react-vimeo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from berkeleytrue/react-vimeo

0.0 1.0 0.0 210 KB

React component to load video from Vimeo

Home Page: http://freecodecamp.github.io/react-vimeo/

License: Other

JavaScript 89.43% HTML 2.61% CSS 7.96%

react-vimeo's Introduction

React Vimeo

NPM

Usage

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

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

To handle errors, you can pass a function to the onError prop:

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

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

To automatically play the video on page load:

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

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

Behind the Scenes

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 an example live here that you can follow.

For more details, check out the API

API

API

License

MIT

See the License file.

react-vimeo's People

Contributors

berkeleytrue avatar greenkeeperio-bot avatar kyleamathews avatar mosch avatar mozmorris avatar nikolas avatar pedronauck avatar redroot avatar schenkfab avatar tanepiper avatar unmeshpro avatar zwaarcontrast avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.