Skip to content

Commit

Permalink
Only ready up YouTube player if url prop hasn't changed
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Jan 2, 2016
1 parent f862add commit 5e2463d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/players/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ export default class YouTube extends Base {
...this.props.youtubeConfig.playerVars
},
events: {
onReady: this.onReady,
onReady: () => {
// Only ready up if url hasn't changed
if (url === this.props.url) this.onReady()
},
onStateChange: this.onStateChange,
onError: this.props.onError
}
Expand Down

0 comments on commit 5e2463d

Please sign in to comment.