Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-facebook-player
Advanced tools
Readme
Based on react-youtube, this component makes easier to integrate your React project with Facebook's Embedded Video Player API.
$ npm install react-facebook-player --save
const FacebookPlayer = require('react-facebook-player');
<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={ function } // Returns a player object to be used for controlling
onStartedPlaying={ function }
onPaused={ function }
onFinishedPlaying={ function }
onStartedBuffering={ function }
onFinishedBuffering={ function }
onError={ function }
/>
You can use onReady() to assign the player to a state and then control it (http://bit.ly/29Oxmgm).
import React from 'react';
import ReactDOM from 'react-dom';
import FacebookPlayer from 'react-facebook-player';
class Example extends React.Component {
constructor(props) {
super(props);
this.state = {
player: null,
};
}
onReady = (player) => {
this.setState({
player: player,
});
}
playVideo = () => {
const { player } = this.state;
if (player) player.play();
}
pauseVideo = () => {
const { player } = this.state;
if (player) player.pause();
}
render() {
const { videoId, appId } = this.props;
return (
<div>
<FacebookPlayer
videoId={ videoId }
appId={ appId }
onReady={ this.onReady }
/>
<button onClick={ this.playVideo }>Play</button>
<button onClick={ this.pauseVideo }>Pause</button>
</div>
);
}
}
ReactDOM.render(<Example />, document.getElementById('root'));
MIT
FAQs
React component for Facebook embedded videos API
The npm package react-facebook-player receives a total of 170 weekly downloads. As such, react-facebook-player popularity was classified as not popular.
We found that react-facebook-player demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.