Skip to content

Commit

Permalink
Proposed fix for chaptersView not loading correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidKosub committed May 3, 2013
1 parent ea41a9b commit 8c06a35
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions kWidget/onPagePlugins/chapters/chaptersView.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,10 @@ kWidget.addReadyCallback( function( playerId ){
});
},
checkMediaReady:function( callback ){
if( this.getAttr( 'playerStatusProxy.kdpStatus' ) == 'ready'
&&
this.getAttr( 'mediaProxy.entry.width' )
){
if ( this.isReady ){
callback();
} else {
this.kdp.kBind('mediaReady', callback );
this.mediaReady = callback;
}
},
updateActiveChapter: function( time ){
Expand Down Expand Up @@ -751,8 +748,15 @@ kWidget.addReadyCallback( function( playerId ){
* Application initialization
****************************************************************/
// We start build out at chaneMedia time, will clear out old chapters
// in cases for playlists with entries without chapters.
// in cases for playlists with entries without chapters.
var instance;
kdp.kBind( 'changeMedia', function(){
new chaptersView( kdp );
instance = new chaptersView( kdp );
});
kdp.kBind( 'mediaReady', function(){
if( instance.mediaReady ){
instance.mediaReady();
}
instance.isReady = true;
});
});
});

0 comments on commit 8c06a35

Please sign in to comment.