Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unique wistia player id to have possibility to have multiple players with the same url on one page #905

Merged

Conversation

MariyaNizovtsova
Copy link
Contributor

Fix the issue #623
Tested on the page with two Wistia players with the same URL and they don't affect each other anymore.

@@ -24,7 +26,7 @@ export default class Wistia extends Component {
getSDK(SDK_URL, SDK_GLOBAL).then(() => {
window._wq = window._wq || []
window._wq.push({
id: this.getID(url),
id: this.playerID,
Copy link
Contributor

Choose a reason for hiding this comment

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

can we do something like this here:
id: this.props.id || this.playerID

@@ -111,7 +113,7 @@ export default class Wistia extends Component {
height: '100%'
}
return (
<div key={id} className={className} style={style} />
<div id={this.playerID} key={id} className={className} style={style} />
Copy link
Contributor

Choose a reason for hiding this comment

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

same goes here:
id={this.props.id || this.playerID}

@cookpete cookpete force-pushed the multiple-videos-with-same-url branch from 7559098 to 916fd85 Compare June 11, 2020 19:36
@cookpete cookpete merged commit f7e2524 into cookpete:master Jun 11, 2020
@cookpete
Copy link
Owner

I've added a config.wistia.playerId prop (similar to facebook and twitch) to let you pass in your own playerId if you want.

@afzaalahmad
Copy link
Contributor

@cookpete appreciated 👍

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.

None yet

4 participants