summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/player.container.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-11-05 19:05:57 +0100
committerJules Laplace <julescarbon@gmail.com>2020-11-05 19:05:57 +0100
commitf86e92add6484af080db4e51a35d66aefe851590 (patch)
tree0e547291e35f73cd15938251ee3bbe5927c0f66b /animism-align/frontend/app/views/viewer/player/player.container.js
parent8028a1052e8471bb8915847cd43da9217e92f8a3 (diff)
fix weird end-of-section bug
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player/player.container.js')
-rw-r--r--animism-align/frontend/app/views/viewer/player/player.container.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/animism-align/frontend/app/views/viewer/player/player.container.js b/animism-align/frontend/app/views/viewer/player/player.container.js
index 8972386..26697f9 100644
--- a/animism-align/frontend/app/views/viewer/player/player.container.js
+++ b/animism-align/frontend/app/views/viewer/player/player.container.js
@@ -71,20 +71,27 @@ class PlayerContainer extends Component {
componentDidUpdate(prevProps) {
if (this.props.audio.play_ts === prevProps.audio.play_ts) return
- this.setCurrentSection()
+ this.handleTimeUpdate()
}
- setCurrentSection() {
+ handleTimeUpdate() {
const { audio, currentSection, autoAdvance } = this.props
- const { play_ts, seek_ts } = audio
- const didSeek = floatEQ(play_ts, seek_ts)
+ const { play_ts } = audio
+ // const { play_ts, seek_ts } = audio
+ // const didSeek = floatEQ(play_ts, seek_ts)
+ const inCurrentSection = floatInRange(currentSection.start_ts, play_ts, currentSection.end_ts)
+ // console.log('inCurrentSection?', inCurrentSection)
// console.log('didSeek?', didSeek)
- if (!didSeek || floatInRange(currentSection.start_ts, play_ts, currentSection.end_ts)) {
+ // if the current TS isn't in the same section as the current one...
+ if (inCurrentSection) {
return
}
+ // at end of section ()
if (autoAdvance) {
actions.viewer.setSectionFromTimestamp(play_ts)
- } else {
+ }
+ else {
+ console.log(">> Reached end of section")
actions.viewer.reachedEndOfSection(currentSection)
}
}