Skip to content

Commit

Permalink
Do not call onEnded when looping
Browse files Browse the repository at this point in the history
It doesn't make sense, as the video doesn't technically "end"
Closes cookpete/react-player#496
  • Loading branch information
Webmaster1116 committed Nov 17, 2018
1 parent 81c7dcd commit 1b9a233
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Prop | Description
`onPause` | Called when media is paused
`onBuffer` | Called when media starts buffering
`onSeek` | Called when media seeks with `seconds` parameter
`onEnded` | Called when media finishes playing
`onEnded` | Called when media finishes playing<br />&nbsp;&nbsp;Does not fire when `loop` is set to `true`
`onError` | Called when an error occurs whilst attempting to play media
`onEnablePIP` | Called when picture-in-picture mode is enabled
`onDisablePIP` | Called when picture-in-picture mode is disabled
Expand Down
2 changes: 1 addition & 1 deletion src/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ export default class Player extends Component {
}
if (!loop) {
this.isPlaying = false
onEnded()
}
onEnded()
}
onDurationCheck = () => {
clearTimeout(this.durationCheckTimeout)
Expand Down

0 comments on commit 1b9a233

Please sign in to comment.