Skip to content

Commit

Permalink
Fix onProgress for infinite duration streams
Browse files Browse the repository at this point in the history
  • Loading branch information
albanqoku committed Jun 13, 2019
1 parent 571b88f commit 21454a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ export default class Player extends Component {
progress.loaded = loadedSeconds / duration
}
// Only call onProgress if values have changed
if (progress.played !== this.prevPlayed || progress.loaded !== this.prevLoaded) {
if (progress.playedSeconds !== this.prevPlayed || progress.loadedSeconds !== this.prevLoaded) {
this.props.onProgress(progress)
}
this.prevPlayed = progress.played
this.prevLoaded = progress.loaded
this.prevPlayed = progress.playedSeconds
this.prevLoaded = progress.loadedSeconds
}
}
this.progressTimeout = setTimeout(this.progress, this.props.progressFrequency || this.props.progressInterval)
Expand Down

0 comments on commit 21454a1

Please sign in to comment.