Spaces:
Running
Running
Update js/js.php
Browse files
js/js.php
CHANGED
@@ -5,6 +5,7 @@
|
|
5 |
/* https://childes.talkbank.org/browser/index.php?url=Eng-UK/MPI-EVA-Manchester/Eleanor/020006b.cha */
|
6 |
/*-----------------------------*/
|
7 |
$(function (){
|
|
|
8 |
// Add "timeupdate" listener to "#speakera".
|
9 |
var vid = document.getElementById("speakera");
|
10 |
vid.addEventListener("timeupdate", function(){
|
@@ -19,6 +20,10 @@ $(function (){
|
|
19 |
});
|
20 |
|
21 |
|
|
|
|
|
|
|
|
|
22 |
|
23 |
|
24 |
// Click on the little 'play' character at end of utterance line.
|
@@ -29,16 +34,15 @@ $(function (){
|
|
29 |
|
30 |
|
31 |
// If user clicked "stop" on a playing line, pause video, remove ".playing", change icon to "play".
|
32 |
-
if($(this).children(".movControl").hasClass('playing')) {
|
|
|
33 |
vid.pause();
|
34 |
}
|
|
|
35 |
else {
|
36 |
var newTime = $(this).attr("beg");
|
37 |
vid.currentTime = newTime / 1000;
|
38 |
-
|
39 |
vid.play();
|
40 |
-
$(this).children(".movControl").addClass("playing");
|
41 |
-
// ** i added that last line. be care ful of it. work in progress. **
|
42 |
}
|
43 |
|
44 |
|
|
|
5 |
/* https://childes.talkbank.org/browser/index.php?url=Eng-UK/MPI-EVA-Manchester/Eleanor/020006b.cha */
|
6 |
/*-----------------------------*/
|
7 |
$(function (){
|
8 |
+
|
9 |
// Add "timeupdate" listener to "#speakera".
|
10 |
var vid = document.getElementById("speakera");
|
11 |
vid.addEventListener("timeupdate", function(){
|
|
|
20 |
});
|
21 |
|
22 |
|
23 |
+
// Listen for user to play video. ** i added this
|
24 |
+
vid.addEventListener("play", function(){
|
25 |
+
$( '.movControl' ).html("■"); // Change all bullets to "stop".
|
26 |
+
});
|
27 |
|
28 |
|
29 |
// Click on the little 'play' character at end of utterance line.
|
|
|
34 |
|
35 |
|
36 |
// If user clicked "stop" on a playing line, pause video, remove ".playing", change icon to "play".
|
37 |
+
// if($(this).children(".movControl").hasClass('playing')) {
|
38 |
+
if(!vid.paused) {
|
39 |
vid.pause();
|
40 |
}
|
41 |
+
|
42 |
else {
|
43 |
var newTime = $(this).attr("beg");
|
44 |
vid.currentTime = newTime / 1000;
|
|
|
45 |
vid.play();
|
|
|
|
|
46 |
}
|
47 |
|
48 |
|