mirror of
https://github.com/mehotkhan/BandersnatchInteractive.git
synced 2025-07-27 17:23:22 +00:00
assets/scripts.js: Fix recording of breadcrumbs after jumps
This commit is contained in:
parent
9df4416b2b
commit
9ea55f3c02
1 changed files with 3 additions and 1 deletions
|
@ -247,6 +247,7 @@ var timerId = 0;
|
|||
var lastMs = 0;
|
||||
var currentSegment;
|
||||
var lastSegment = null;
|
||||
var prevSegment = null; // for breadcrumbs
|
||||
var segmentTransition = false;
|
||||
var lastMoments = [];
|
||||
|
||||
|
@ -272,6 +273,7 @@ function ontimeupdate(evt) {
|
|||
// Handle segment change
|
||||
if (lastSegment != currentSegment) {
|
||||
console.log('ontimeupdate', lastSegment, '->', currentSegment, ms, msToString(ms), seeked);
|
||||
prevSegment = lastSegment;
|
||||
lastSegment = currentSegment;
|
||||
if (!seeked) {
|
||||
if (playNextSegment()) {
|
||||
|
@ -365,7 +367,7 @@ function playNextSegment() {
|
|||
|
||||
let breadcrumb = 'breadcrumb_' + nextSegment;
|
||||
if (!(breadcrumb in ls))
|
||||
ls[breadcrumb] = lastSegment;
|
||||
ls[breadcrumb] = prevSegment;
|
||||
|
||||
segmentTransition = true;
|
||||
let segmentId = nextSegment;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue