diff -r 14022f1d49ab -r d9da52e20f7f src/widgets/MediaList.js --- a/src/widgets/MediaList.js Mon May 14 16:59:07 2012 +0200 +++ b/src/widgets/MediaList.js Tue May 15 15:50:19 2012 +0200 @@ -30,8 +30,8 @@ + '
' + '
' + '

' - + '

' - + '


'; + + '

' + + '


'; IriSP.Widgets.MediaList.prototype.mediaTemplate = '
  • ' @@ -58,8 +58,7 @@ this.redraw(); }; -IriSP.Widgets.MediaList.prototype.redraw = function() { - var _media = this.lastMedia ? this.source.getElement(this.lastMedia) : undefined; +IriSP.Widgets.MediaList.prototype.redraw = function(_media) { if (typeof _media !== "undefined") { this.$.find('.Ldt-MediaList-Other h2').html(this.l10n.other_media); this.$.find('.Ldt-MediaList-NowPlaying').show(); @@ -76,8 +75,8 @@ this.$.find('.Ldt-MediaList-NowPlaying').hide(); } var _this = this, - _otherlist = this.source.getMedias().filter(function(_media) { - return (_media.id !== _this.lastMedia) + _otherlist = this.source.getMedias().filter(function(_m) { + return (_m.id !== _this.lastMedia) }); if (_otherlist.length) { this.$.find('.Ldt-MediaList-Other').show(); @@ -99,15 +98,12 @@ }; IriSP.Widgets.MediaList.prototype.onTimeupdate = function() { - var _time = Math.floor(this.player.popcorn.currentTime() * 1000), - _list = this.getWidgetAnnotations().filter(function(_annotation) { - return _annotation.begin <= _time && _annotation.end > _time; - }); - if (_list.length) { - var _media = _list[0].getMedia(); - if (_media.id !== this.lastMedia) { - this.lastMedia = _media.id; - this.redraw(); - } + var _media = this.source.currentMedia; + if (_media.elementType === "mashup") { + _media = _media.getMediaAtTime(this.player.popcorn.currentTime() * 1000); + } + if (typeof _media !== "undefined" && _media.id !== this.lastMedia) { + this.lastMedia = _media.id; + this.redraw(_media); } }