src/js/widgets/segmentsWidget.js
branchpopcorn-port
changeset 214 50c4609e50f4
parent 212 3a6e4089eef0
child 217 ec3e6d34462c
equal deleted inserted replaced
213:d65dafb9273d 214:50c4609e50f4
    15 IriSP.SegmentsWidget.prototype.draw = function() {
    15 IriSP.SegmentsWidget.prototype.draw = function() {
    16 
    16 
    17   var self = this;
    17   var self = this;
    18   var annotations = this._serializer._data.annotations;
    18   var annotations = this._serializer._data.annotations;
    19 
    19 
       
    20   this.positionMarker = this.selector.append("<div style='position: absolute; z-index: 100; width: 1px; height: 20px; background-color: black;'></div>");
       
    21   this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.positionUpdater));
    20   
    22   
    21   this.selector.after("<div class='cleaner'></div>"); // we need to do this because the segments are floated                                                      
    23   this.selector.after("<div class='cleaner'></div>"); // we need to do this because the segments are floated                                                      
    22   
    24   
    23   var i = 0;
    25   var i = 0;
    24   var totalWidth = this.selector.width();
    26   var totalWidth = this.selector.width();
   120 };
   122 };
   121 
   123 
   122 IriSP.SegmentsWidget.prototype.searchFieldClosedHandler = function() {
   124 IriSP.SegmentsWidget.prototype.searchFieldClosedHandler = function() {
   123   this.clear();
   125   this.clear();
   124 };
   126 };
       
   127 
       
   128 IriSP.SegmentsWidget.prototype.positionUpdater = function() {  
       
   129   var duration = this._serializer.currentMedia().meta["dc:duration"] / 1000;
       
   130   var time = this._Popcorn.currentTime();
       
   131   var position 	= IriSP.timeToPourcent(begin, duration);
       
   132   
       
   133   this.positionMarker.css("left", position);
       
   134 };