colby-wp-react-vimeo-player
A WordPress shortcode and React component for displaying autoresizing, lazyloading Vimeo videos with the Vimeo Player API.
Install
npm install colby-wp-react-vimeo-player --save
Usage
Javascript
Simply import the package into your project:
import 'colby-wp-react-vimeo-player';
WordPress
Import this package's index.php:
require_once('node_modules/colby-wp-react-vimeo-player/index.php');
Use the shortcode:
[colby-vimeo-shortcode id="THE_VIMEO_ID"]
Shortcode atts:
Name | Description | Default |
---|---|---|
id | (required) A Vimeo ID -- the string of numbers associated with a particular Vimeo video (found in the URL of the single-video page on vimeo.com) | |
ratio | The video's width divided by its height. | .561 |
HTML only (to bypass the shortcode)
<div data-vimeo-player data-video-id="THE_VIMEO_ID" <!-- The string of numbers associated with a Vimeo video. --> data-ratio="0.561" <!-- Optional. 0.561 is the default. --> ></div>