src/js/widgets.js
branchnew-model
changeset 922 096c06aea8b5
parent 916 ec6849bbbdcc
child 924 64c2eaafe5e2
--- a/src/js/widgets.js	Wed Jun 27 19:03:18 2012 +0200
+++ b/src/js/widgets.js	Wed Jun 27 19:03:37 2012 +0200
@@ -113,6 +113,13 @@
     return typeof this.annotation_type !== "undefined" && this.annotation_type ? _curmedia.getAnnotationsByTypeTitle(this.annotation_type) : _curmedia.getAnnotations();
 }
 
+IriSP.Widgets.Widget.prototype.getWidgetAnnotationsAtTime = function() {
+    var _time = Math.floor(this.player.popcorn.currentTime() * 1000);
+    return this.getWidgetAnnotations().filter(function(_annotation) {
+        return _annotation.begin <= _time && _annotation.end > _time;
+    });
+}
+
 /**
  * This method responsible of drawing a widget on screen.
  */