summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/player.container.js
diff options
context:
space:
mode:
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)
}
}