Skip to content

Commit

Permalink
Move onDuration callback from onReady to onPlay
Browse files Browse the repository at this point in the history
Because YouTube doesn't load metadata until video is played
Fixes cookpete/react-player#31
  • Loading branch information
albanqoku committed Jan 21, 2016
1 parent 4dc37cf commit 3416026
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/players/Base.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default class Base extends Component {
this.seekTo(this.seekOnReady)
this.seekOnReady = null
}
this.props.onDuration(this.getDuration())
};
onReady = () => {
this.isReady = true
Expand All @@ -61,6 +62,5 @@ export default class Base extends Component {
this.play()
}
}
this.props.onDuration(this.getDuration())
};
}

0 comments on commit 3416026

Please sign in to comment.