Skip to content

Commit

Permalink
Prevent YouTube from playing after seekTo when paused
Browse files Browse the repository at this point in the history
Still not ideal as it will show a spinner if the video hasn't been played yet, but better than nothing
Partially fixes cookpete/react-player#437
  • Loading branch information
albanqoku committed Sep 20, 2018
1 parent e699a9f commit 1c1a226
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/players/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export class YouTube extends Component {
}
seekTo (amount) {
this.callPlayer('seekTo', amount)
if (!this.props.playing) {
this.pause()
}
}
setVolume (fraction) {
this.callPlayer('setVolume', fraction * 100)
Expand Down

0 comments on commit 1c1a226

Please sign in to comment.