src/widgets/Annotation.js
branchnew-model
changeset 922 096c06aea8b5
parent 916 ec6849bbbdcc
child 923 b3ee7d1b472a
equal deleted inserted replaced
921:d4dc652bf050 922:096c06aea8b5
    53     this.onTimeupdate();
    53     this.onTimeupdate();
    54 }
    54 }
    55 
    55 
    56 IriSP.Widgets.Annotation.prototype.onTimeupdate = function() {
    56 IriSP.Widgets.Annotation.prototype.onTimeupdate = function() {
    57     var _time = Math.floor(this.player.popcorn.currentTime() * 1000),
    57     var _time = Math.floor(this.player.popcorn.currentTime() * 1000),
    58         _list = this.getWidgetAnnotations().filter(function(_annotation) {
    58         _list = this.getWidgetAnnotationsAtTime();
    59             return _annotation.begin <= _time && _annotation.end > _time;
       
    60         });
       
    61     if (_list.length) {
    59     if (_list.length) {
    62         if (_list[0].id !== this.lastAnnotation) {
    60         if (_list[0].id !== this.lastAnnotation) {
    63             this.drawAnnotation(_list[0]);
    61             this.drawAnnotation(_list[0]);
    64             this.player.popcorn.trigger("IriSP.Annotation.boundsChanged",[ _list[0].begin.valueOf(), _list[0].end.valueOf() ]);
    62             this.player.popcorn.trigger("IriSP.Annotation.boundsChanged",[ _list[0].begin.valueOf(), _list[0].end.valueOf() ]);
    65         }
    63         }