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
webmiraclepro committed Jan 20, 2016
1 parent 3a4c823 commit c9424ff
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 c9424ff

Please sign in to comment.