src/js/widgets.js
branchnew-model
changeset 922 096c06aea8b5
parent 916 ec6849bbbdcc
child 924 64c2eaafe5e2
equal deleted inserted replaced
921:d4dc652bf050 922:096c06aea8b5
   111 IriSP.Widgets.Widget.prototype.getWidgetAnnotations = function() {
   111 IriSP.Widgets.Widget.prototype.getWidgetAnnotations = function() {
   112     var _curmedia = this.source.currentMedia;
   112     var _curmedia = this.source.currentMedia;
   113     return typeof this.annotation_type !== "undefined" && this.annotation_type ? _curmedia.getAnnotationsByTypeTitle(this.annotation_type) : _curmedia.getAnnotations();
   113     return typeof this.annotation_type !== "undefined" && this.annotation_type ? _curmedia.getAnnotationsByTypeTitle(this.annotation_type) : _curmedia.getAnnotations();
   114 }
   114 }
   115 
   115 
       
   116 IriSP.Widgets.Widget.prototype.getWidgetAnnotationsAtTime = function() {
       
   117     var _time = Math.floor(this.player.popcorn.currentTime() * 1000);
       
   118     return this.getWidgetAnnotations().filter(function(_annotation) {
       
   119         return _annotation.begin <= _time && _annotation.end > _time;
       
   120     });
       
   121 }
       
   122 
   116 /**
   123 /**
   117  * This method responsible of drawing a widget on screen.
   124  * This method responsible of drawing a widget on screen.
   118  */
   125  */
   119 IriSP.Widgets.Widget.prototype.draw = function() {
   126 IriSP.Widgets.Widget.prototype.draw = function() {
   120     /* implemented by "sub-classes" */
   127     /* implemented by "sub-classes" */