Skip to content

Commit

Permalink
Add config.facebook.attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Webmaster1116 committed Nov 15, 2020
1 parent 397099d commit da26b2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Settings for each player live under different keys:
Key | Options
--- | -------
`youtube` | `playerVars`: Override the [default player vars](https://developers.google.com/youtube/player_parameters?playerVersion=HTML5)<br />`embedOptions`: Override the [default embed options](https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player)<br />`onUnstarted`: Called when state changes to `unstarted` (usually when video fails to autoplay)
`facebook` | `appId`: Your own [Facebook app ID](https://developers.facebook.com/docs/apps/register#app-id)<br />`version`: Facebook SDK version<br />`playerId`: Override player ID for consistent server-side rendering (use with [`react-uid`](https://github.com/thearnica/react-uid))
`facebook` | `appId`: Your own [Facebook app ID](https://developers.facebook.com/docs/apps/register#app-id)<br />`version`: Facebook SDK version<br />`playerId`: Override player ID for consistent server-side rendering (use with [`react-uid`](https://github.com/thearnica/react-uid))<br />`attributes`: Extra data attributes to pass to the `fb-video` element
`soundcloud` | `options`: Override the [default player options](https://developers.soundcloud.com/docs/api/html5-widget#params)
`vimeo` | `playerOptions`: Override the [default params](https://developer.vimeo.com/player/sdk/embed)
`wistia` | `options`: Override the [default player options](https://wistia.com/doc/embed-options#options_list)<br />`playerId`: Override player ID for consistent server-side rendering (use with [`react-uid`](https://github.com/thearnica/react-uid))
Expand Down
2 changes: 2 additions & 0 deletions src/players/Facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export default class Facebook extends Component {
}

render () {
const { attributes } = this.props.config
const style = {
width: '100%',
height: '100%'
Expand All @@ -112,6 +113,7 @@ export default class Facebook extends Component {
data-autoplay={this.props.playing ? 'true' : 'false'}
data-allowfullscreen='true'
data-controls={this.props.controls ? 'true' : 'false'}
{...attributes}
/>
)
}
Expand Down
6 changes: 4 additions & 2 deletions src/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export const propTypes = {
facebook: shape({
appId: string,
version: string,
playerId: string
playerId: string,
attributes: object
}),
dailymotion: shape({
params: object
Expand Down Expand Up @@ -131,7 +132,8 @@ export const defaultProps = {
facebook: {
appId: '1309697205772819',
version: 'v3.3',
playerId: null
playerId: null,
attributes: {}
},
dailymotion: {
params: {
Expand Down

0 comments on commit da26b2d

Please sign in to comment.