Skip to content

Add config support to wistia-video-element#215

Open
comanzanares wants to merge 1 commit intomuxinc:mainfrom
comanzanares:wistia-config-params
Open

Add config support to wistia-video-element#215
comanzanares wants to merge 1 commit intomuxinc:mainfrom
comanzanares:wistia-config-params

Conversation

@comanzanares
Copy link
Copy Markdown

Adds a config property to to pass Wistia embed options via _wq.push({ options }), consistent with other elements like Vimeo, HLS, etc.
Merges config into Wistia options with user config taking precedence over attribute-derived defaults.
Added params based on Wistia embed options docs.
Updates the example to demonstrate passing config to Wistia works.
Adds a test to ensure config is forwarded into Wistia options.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 27, 2026

@comanzanares is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Feb 27, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Copy Markdown
Contributor

@ronald-urbina ronald-urbina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Thanks for putting this together. We really appreciate the time and effort you put into it. The work looks great overall, I just left a couple of small comments with minor changes before we can approve it. Let me know if anything is unclear!

export type WistiaPluginConfig = Record<string, unknown>;

export type WistiaEmbedOptions = {
autoPlay?: boolean;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
autoPlay?: boolean;
autoPlay?: boolean;
chromeless?: boolean;

can you add this since is being used by the component and tests but was missing from the type

fakeFullscreen?: boolean;
fitStrategy?: 'contain' | 'cover' | 'fill' | 'none';
fullscreenButton?: boolean;
muted?: boolean;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
muted?: boolean;
muted?: boolean;
keyMoments?: boolean;

can you add this one since is present in the official documentation

const id = this.src.match(MATCH_SRC)[1];

const options = {
autoPlay: this.autoplay,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
autoPlay: this.autoplay,
silentAutoPlay: this.autoplay ? 'allow' : undefined,

Added silentAutoPlay: this.autoplay ? 'allow' : undefined to enable Wistia's auto-mute fallback for autoplay on mobile

autoPlay: this.autoplay,
preload: this.preload ?? 'metadata',
playsinline: this.playsInline,
endVideoBehavior: this.loop && 'loop',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
endVideoBehavior: this.loop ? 'loop' : undefined,

this.loop && 'loop' evaluates to false when loop is not set, which passes endVideoBehavior: false, an invalid value (Wistia only accepts 'default' | 'reset' | 'loop'). Changed to a ternary so the key is omitted entirely when loop is off, which is what Wistia expects.

as={WistiaVideo}
src="https://wesleyluyten.wistia.com/medias/oifkgmxnkb"
config={{
playerColor: '#f5f6f7',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
playerColor: '#f5f6f7',
playerColor: '#afe5a4',

Consider using a more vibrant color here to improve control visibility, the current shade may be too subtle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants