0.0.18 • Published 4 years ago

gatsby-source-vimeo-all v0.0.18

Weekly downloads
184
License
ISC
Repository
github
Last release
4 years ago

Installation

  1. npm i gatsby-source-vimeo-all
  2. Register an app on vimeo. You will need a clientId, a clientSecret and an accessToken. Access tokens can be generated on the vimeo app page.
  3. Add config to gatsby-config.js
// gatsby-config.js
module.exports = {
  plugins: [
    //... Other plugins
    {
      resolve: 'gatsby-source-vimeo-all',
      options: {
        clientId: 'YOUR_CLIENT_ID',
        clientSecret: 'YOUR_CLIENT_SECRET',
        accessToken: 'YOUR_ACCESS_TOKEN'
      }
    }
  ]
}

Example usage

Bare bones example to get you started.

import React from 'react'
import { graphql, useStaticQuery } from 'gatsby'

const query = graphql`
  {
    vimeo(link: { eq: "https://vimeo.com/315401283/dfd80bf8c1" }) {
      name
      description
      duration
      link
      aspectRatio
      width
      height
      srcset {
        ...GatsbyVimeoSrcSet
      }
      pictures {
        uri
      }
      user {
        name
      }
    }
  }
`

const Video = () => {
  const { vimeo } = useStaticQuery(query)
  return <video src={vimeo.srcset[0].link} controls autoPlay loop />
}

export default Video

Fragments

GatsbyVimeoSrcSet
Gives you all of the srcset properties. This is probably the one you're going to use the most.

0.0.17

4 years ago

0.0.18

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.1.0

5 years ago