Skip to content

Commit c7d6566

Browse files
committed
Add stopgap to prevent transcript click from firing twice
1 parent 36d8b54 commit c7d6566

6 files changed

Lines changed: 35 additions & 8 deletions

File tree

build/ableplayer.dist.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9257,7 +9257,16 @@
92579257
var spanStart = parseFloat($(this).attr('data-start'));
92589258
// Add a tiny amount so that we're inside the span.
92599259
spanStart += .01;
9260-
thisObj.seekTo(spanStart);
9260+
// Each click within the transcript triggers two click events (not sure why)
9261+
// this.seekingFromTranscript is a stopgab to prevent two calls to SeekTo()
9262+
if (!this.seekingFromTranscript) {
9263+
this.seekingFromTranscript = true;
9264+
thisObj.seekTo(spanStart);
9265+
}
9266+
else {
9267+
// don't seek a second time, but do reset var
9268+
thisObj.seekingFromTranscript = false;
9269+
}
92619270
});
92629271
}
92639272
};

build/ableplayer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9257,7 +9257,16 @@ console.log('resizeYouTubePlayer at POS Y1');
92579257
var spanStart = parseFloat($(this).attr('data-start'));
92589258
// Add a tiny amount so that we're inside the span.
92599259
spanStart += .01;
9260-
thisObj.seekTo(spanStart);
9260+
// Each click within the transcript triggers two click events (not sure why)
9261+
// this.seekingFromTranscript is a stopgab to prevent two calls to SeekTo()
9262+
if (!this.seekingFromTranscript) {
9263+
this.seekingFromTranscript = true;
9264+
thisObj.seekTo(spanStart);
9265+
}
9266+
else {
9267+
// don't seek a second time, but do reset var
9268+
thisObj.seekingFromTranscript = false;
9269+
}
92619270
});
92629271
}
92639272
};

build/ableplayer.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/ableplayer.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ableplayer",
3-
"version": "3.0.28",
3+
"version": "3.0.29",
44
"description": "fully accessible HTML5 media player",
55
"homepage": "http://ableplayer.github.io/ableplayer",
66
"bugs": "https://github.com/ableplayer/ableplayer/issues",

scripts/transcript.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,16 @@
216216
var spanStart = parseFloat($(this).attr('data-start'));
217217
// Add a tiny amount so that we're inside the span.
218218
spanStart += .01;
219-
thisObj.seekTo(spanStart);
219+
// Each click within the transcript triggers two click events (not sure why)
220+
// this.seekingFromTranscript is a stopgab to prevent two calls to SeekTo()
221+
if (!this.seekingFromTranscript) {
222+
this.seekingFromTranscript = true;
223+
thisObj.seekTo(spanStart);
224+
}
225+
else {
226+
// don't seek a second time, but do reset var
227+
thisObj.seekingFromTranscript = false;
228+
}
220229
});
221230
}
222231
};

0 commit comments

Comments
 (0)