Skip to content

Latest commit

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ll-vimeo-player

A simple Vimeo player component built with React hooks

Better documentation coming soon!

Accepted Props

Currently this Vimeo player accepts the following props:

  • id: number (video id from vimeo)
  • width: string (defaults to '500px')
  • height: string (defaults to '')
  • controls: boolean (whether to display Vimeo controls; defaults to false)
  • autoplay: boolean (whether to autoplay; defaults to false)
  • muted: boolean (whether to initialize on mute defaults to false)
  • play: boolean (set to true to play video; set to false to pause the video; defaults to false)
  • getTime: boolean (set to true to get timestamp; defaults to false)
  • setTime: function (your function for handling the timestamp after getting it from Vimeo)

Example

importReact,{useState,useCallback}from'react'importPlayerfrom'll-vimeo-player'exportdefaultfunctionExample(){const[isPlaying,setIsPlaying]=useState(false)const[getTime,setGetTime]=useState(false)const[time,setTime]=useState(null)constgetTimestamp=useCallback((secs)=>{setTime(secs)setGetTime(false)console.log(time)},[time])return(<div><Playerid={371234010}play={play}getTime={getTime}setTime={getTimestamp}/><buttononClick={()=>setPlay(true)}>play</button><buttononClick={()=>setPlay(false)}>pause</button><buttononClick={()=>setGetTime(true)}>get timestamp</button></div>)}

About

A simple Vimeo player component built with React hooks

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages