src/js/model.js
branchnew-model
changeset 903 d9da52e20f7f
parent 902 14022f1d49ab
child 904 510ebab76fa3
equal deleted inserted replaced
902:14022f1d49ab 903:d9da52e20f7f
   571     } else {
   571     } else {
   572         return new IriSP.Model.List(this.source.directory)
   572         return new IriSP.Model.List(this.source.directory)
   573     }
   573     }
   574 }
   574 }
   575 
   575 
       
   576 IriSP.Model.Mashup.prototype.getAnnotationAtTime = function(_time) {
       
   577     var _list = this.segments.filter(function(_annotation) {
       
   578         return _annotation.begin <= _time && _annotation.end > _time;
       
   579     });
       
   580     if (_list.length) {
       
   581         return _list[0];
       
   582     } else {
       
   583         return undefined;
       
   584     }
       
   585 }
       
   586 
       
   587 IriSP.Model.Mashup.prototype.getMediaAtTime = function(_time) {
       
   588     var _annotation = this.getAnnotationAtTime(_time);
       
   589     if (typeof _annotation !== "undefined") {
       
   590         return _annotation.getMedia();
       
   591     } else {
       
   592         return undefined;
       
   593     }
       
   594 }
       
   595 
   576 /* */
   596 /* */
   577 
   597 
   578 IriSP.Model.Source = function(_config) {
   598 IriSP.Model.Source = function(_config) {
   579     this.status = IriSP.Model._SOURCE_STATUS_EMPTY;
   599     this.status = IriSP.Model._SOURCE_STATUS_EMPTY;
   580     if (typeof _config !== "undefined") {
   600     if (typeof _config !== "undefined") {