Skip to content

Commit

Permalink
Add wistia player options
Browse files Browse the repository at this point in the history
Closes #198
  • Loading branch information
cookpete committed Jul 13, 2017
1 parent b59d251 commit d447a32
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Prop | Description
`vimeoConfig` | Configuration object for the Vimeo player.<br />Set `iframeParams` to override the [default params](https://developer.vimeo.com/player/embedding#universal-parameters).<br />Set `preload` for [preloading](#preloading).
`youtubeConfig` | Configuration object for the YouTube player.<br />Set `playerVars` to override the [default player vars](https://developers.google.com/youtube/player_parameters?playerVersion=HTML5).<br />Set `preload` for [preloading](#preloading).
`vidmeConfig` | Configuration object for the Vidme player.<br />Set `format` to use a certain quality of video, when available.<br />Possible values: `240p`, `480p`, `720p`, `1080p`, `dash`, `hls`
`wistiaConfig` | Configuration object for the Wistia player.<br />Set `options` to override the [default player options](https://wistia.com/doc/embed-options#options_list)
`dailymotionConfig` | Configuration object for the DailyMotion player.<br />Set `params` to override the [default player vars](https://developer.dailymotion.com/player#player-parameters).<br />Set `preload` for [preloading](#preloading).
`fileConfig` | Configuration object for the file player.<br />Set `attributes` to apply [element attributes](https://developer.mozilla.org/en/docs/Web/HTML/Element/video#Attributes).<br />Set `forceAudio` to always render an `<audio>` element.<br />Set `forceHLS` to use [hls.js](https://github.com/video-dev/hls.js) for HLS streams.<br />Set `forceDASH` to always use [dash.js](https://github.com/Dash-Industry-Forum/dash.js) for DASH streams.
`facebookConfig` | Configuration object for the Facebook player.<br />Set `appId` to your own [Facebook app ID](https://developers.facebook.com/docs/apps/register#app-id).
Expand Down
3 changes: 2 additions & 1 deletion src/players/Wistia.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ export default class Wistia extends Base {
return MATCH_URL.test(url)
}
componentDidMount () {
const { onStart, onPause, onEnded } = this.props
const { onStart, onPause, onEnded, wistiaConfig } = this.props
this.loadingSDK = true
this.getSDK().then(() => {
window._wq = window._wq || []
window._wq.push({
id: this.getID(this.props.url),
options: wistiaConfig.options,
onReady: player => {
this.player = player
this.player.bind('start', onStart)
Expand Down
6 changes: 6 additions & 0 deletions src/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export const propTypes = {
forceHLS: bool,
forceDASH: bool
}),
wistiaConfig: shape({
options: object
}),
onReady: func,
onStart: func,
onPlay: func,
Expand Down Expand Up @@ -92,6 +95,9 @@ export const defaultProps = {
forceHLS: false,
forceDASH: false
},
wistiaConfig: {
options: {}
},
onReady: function () {},
onStart: function () {},
onPlay: function () {},
Expand Down

0 comments on commit d447a32

Please sign in to comment.