equal
deleted
inserted
replaced
27 IriSP.ArrowWidget.prototype.timeUpdateHandler = function(percents) { |
27 IriSP.ArrowWidget.prototype.timeUpdateHandler = function(percents) { |
28 if (this._blockArrow) |
28 if (this._blockArrow) |
29 return; |
29 return; |
30 |
30 |
31 var currentTime = this._Popcorn.currentTime(); |
31 var currentTime = this._Popcorn.currentTime(); |
32 var currentAnnotation = this._serializer.currentAnnotations(currentTime)[0]; // FIXME : use the others ? |
32 var currentAnnotation = this._serializer.currentChapitre(currentTime); |
|
33 if (IriSP.null_or_undefined(currentAnnotation)) |
|
34 var currentAnnotation = this._serializer.currentAnnotation(currentTime)[0]; // FIXME : use the others ? |
33 |
35 |
34 /* move the arrow only if the current annotation changes */ |
36 /* move the arrow only if the current annotation changes */ |
35 if (currentAnnotation != this._oldAnnotation) { |
37 if (currentAnnotation != this._oldAnnotation) { |
36 var begin = (+ currentAnnotation.begin) / 1000; |
38 var begin = (+ currentAnnotation.begin) / 1000; |
37 var end = (+ currentAnnotation.end) / 1000; |
39 var end = (+ currentAnnotation.end) / 1000; |
41 var percents = middle_time / duration; |
43 var percents = middle_time / duration; |
42 |
44 |
43 // we need to apply a fix because the arrow has a certain length |
45 // we need to apply a fix because the arrow has a certain length |
44 // it's half the length of the arrow (27 / 2). We need to convert |
46 // it's half the length of the arrow (27 / 2). We need to convert |
45 // it in percents though. |
47 // it in percents though. |
46 var totalWidth = this.selector.width(); |
48 var totalWidth = this.selector.width(); |
47 var pixels = percents * totalWidth; |
49 var pixels = percents * totalWidth; |
48 var correction = (27 / 2); |
50 var correction = (27 / 2); |
49 var corrected_pixels = pixels - correction; |
51 var corrected_pixels = pixels - correction; |
50 |
52 |
51 /* make sure that the arrow is aligned with the pattern |
53 /* make sure that the arrow is aligned with the pattern |