Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ℹ️❤️🖥
Explorable-Podcast-Proof-of-Concept
Commits
9d5fa494
Commit
9d5fa494
authored
Sep 13, 2017
by
i❤computers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the ability to click anywhere within the article to start from that point
parent
f3139bda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
script.js
script.js
+16
-3
No files found.
script.js
View file @
9d5fa494
...
...
@@ -16,7 +16,21 @@ document.addEventListener('DOMContentLoaded', function initializePage() {
}
});
$
(
'
article
'
).
on
(
'
click
'
,
function
playAudio
()
{
$
(
'
article
'
).
on
(
'
click
'
,
function
playFromCue
(
event
)
{
var
target
=
event
.
target
;
var
cuePositionName
=
target
.
dataset
.
cuePosition
;
if
(
cuePositionName
)
{
playAudio
(
transcriptCuesTrack
.
filter
(
function
(
cueTrack
)
{
return
cueTrack
.
cuePositionName
.
localeCompare
(
cuePositionName
)
===
0
;
})[
0
].
cueTime
);
}
});
audio
.
on
(
'
ended
'
,
resetPlayer
);
function
playAudio
(
startTime
)
{
if
(
startTime
)
{
audio
.
currentTime
=
startTime
;
}
if
(
audio
.
paused
||
audio
.
ended
)
{
audio
.
play
().
then
(
function
()
{
requestAnimationFrame
(
updateHighlight
);
...
...
@@ -25,8 +39,7 @@ document.addEventListener('DOMContentLoaded', function initializePage() {
audio
.
pause
();
resetPlayer
();
}
});
audio
.
on
(
'
ended
'
,
resetPlayer
);
}
var
currentTranscriptIndex
=
0
;
var
HIGHLIGHTED_CLASS
=
"
highlighted
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment