Skip to content

Commit

Permalink
fix: Add exception handling when seekTo is called with amount value 0 (
Browse files Browse the repository at this point in the history
  • Loading branch information
imjihun authored Feb 19, 2022
1 parent d745951 commit 36da01a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ export default class Player extends Component {

seekTo (amount, type) {
// When seeking before player is ready, store value and seek later
if (!this.isReady && amount !== 0) {
this.seekOnPlay = amount
setTimeout(() => { this.seekOnPlay = null }, SEEK_ON_PLAY_EXPIRY)
if (!this.isReady) {
if (amount !== 0) {
this.seekOnPlay = amount
setTimeout(() => { this.seekOnPlay = null }, SEEK_ON_PLAY_EXPIRY)
}
return
}
const isFraction = !type ? (amount > 0 && amount < 1) : type === 'fraction'
Expand Down

0 comments on commit 36da01a

Please sign in to comment.