Skip to content

Commit

Permalink
Pass instance through to onReady callback
Browse files Browse the repository at this point in the history
Fixes #407
  • Loading branch information
cookpete committed May 27, 2018
1 parent 7364be4 commit a660811
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ReactPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ export default class ReactPlayer extends Component {
if (!this.player) return null
this.player.seekTo(fraction)
}
onReady = () => {
this.props.onReady(this)
}
getActivePlayer (url) {
for (let Player of [ ...customPlayers, ...players ]) {
if (Player.canPlay(url)) {
Expand All @@ -87,6 +90,7 @@ export default class ReactPlayer extends Component {
ref={this.activePlayerRef}
config={this.config}
activePlayer={activePlayer}
onReady={this.onReady}
/>
)
}
Expand Down

0 comments on commit a660811

Please sign in to comment.