react-youtube
Based on react-youtube, this component makes easier to integrate your React project with Facebook's Embedded Video Player API.
Installation
$ npm install react-facebook-player --save
Usage
const FacebookPlayer = ; <FacebookPlayer appId= string // (required) Your Facebook App ID. Ref: http://bit.ly/1GNA0AN videoId= string // (required) Video´s ID Ref: http://bit.ly/1ysgVu4 id= string // Element ID. Required if you wanna use more than one video in the same page. className= string // Element class. /* ATTRIBUTES. Ref: http://bit.ly/29OOzWZ */ allowfullscreen= boolean autoplay= boolean width= number showText= boolean showCaptions= boolean /* EVENTS. Ref: http://bit.ly/29JaA7J */ onReady=
You can use onReady() to assign the player to a state and then control it (http://bit.ly/29Oxmgm).
;;; Component { superprops; thisstate = player: null ; } { this; } { const player = thisstate; if player player; } { const player = thisstate; if player player; } { const videoId appId = thisprops; return <div> <FacebookPlayer videoId= videoId appId= appId onReady= thisonReady /> <button onClick= thisplayVideo >Play</button> <button onClick= thispauseVideo >Pause</button> </div> ; } ReactDOM;
License
MIT