Skip to content

Commit

Permalink
Pass instance through to onReady callback
Browse files Browse the repository at this point in the history
  • Loading branch information
webmiraclepro committed May 23, 2018
1 parent 1f675ca commit 27cd455
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 27cd455

Please sign in to comment.