Skip to content

Commit

Permalink
Add support for passing the 'dnt' player param as a prop (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-p-jones authored Feb 18, 2021
1 parent b79d692 commit 09097d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import Vimeo from '@u-wave/react-vimeo';
| autoplay | bool | false | Automatically start playback of the video. Note that this won’t work on some devices. |
| showByline | bool | true | Show the byline on the video. |
| color | string | | Specify the color of the video controls. Colors may be overridden by the embed settings of the video. _(Ex: "ef2f9f")_ |
| dnt | bool | false | Blocks the player from tracking any session data, including all cookies and analytics |
| controls | bool | true | Hide all elements in the player (play bar, sharing buttons, etc). |
| loop | bool | false | Play the video again when it reaches the end. |
| showPortrait | bool | true | Show the portrait on the video. |
Expand Down
7 changes: 7 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Vimeo extends React.Component {
muted: this.props.muted,
background: this.props.background,
responsive: this.props.responsive,
dnt: this.props.dnt,
};
/* eslint-enable react/destructuring-assignment */
}
Expand Down Expand Up @@ -243,6 +244,11 @@ if (process.env.NODE_ENV !== 'production') {
*/
color: PropTypes.string,

/**
* Blocks the player from tracking any session data, including all cookies and analytics.
*/
dnt: PropTypes.bool,

// Player controls
/**
* Hide all elements in the player (play bar, sharing buttons, etc).
Expand Down Expand Up @@ -364,6 +370,7 @@ Vimeo.defaultProps = {
muted: false,
background: false,
responsive: false,
dnt: false,
};

export default Vimeo;

0 comments on commit 09097d3

Please sign in to comment.