Skip to content

Commit

Permalink
Add custom control support to Wistia
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-luther committed Nov 22, 2024
1 parent 18f8b85 commit fd3457d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface VimeoConfig {
export interface WistiaConfig {
options?: Object;
playerId?: string;
customControls?: any[];
}

export interface MixcloudConfig {
Expand Down
5 changes: 4 additions & 1 deletion src/players/Wistia.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export default class Wistia extends Component {

load (url) {
const { playing, muted, controls, onReady, config, onError } = this.props
getSDK(SDK_URL, SDK_GLOBAL).then(() => {
getSDK(SDK_URL, SDK_GLOBAL).then(Wistia => {
if (config.customControls) {
config.customControls.forEach(control => Wistia.defineControl(control))
}
window._wq = window._wq || []
window._wq.push({
id: this.playerID,
Expand Down
6 changes: 4 additions & 2 deletions src/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export const propTypes = {
}),
wistia: shape({
options: object,
playerId: string
playerId: string,
customControls: array
}),
mixcloud: shape({
options: object
Expand Down Expand Up @@ -164,7 +165,8 @@ export const defaultProps = {
},
wistia: {
options: {},
playerId: null
playerId: null,
customControls: null
},
mixcloud: {
options: {
Expand Down

0 comments on commit fd3457d

Please sign in to comment.