nl_tokens: @file buffer . js @module buffer Compute the percentage of the media that has been buffered .
pl_tokens: function bufferedPercent ( buffered , duration ) { var bufferedDuration = 0 ; var start = void 0 ; var end = void 0 ; if ( ! duration ) { return 0 ; } if ( ! buffered || ! buffered . length ) { buffered = createTimeRanges ( 0 , 0 ) ; } for ( var i = 0 ; i < buffered . length ; i ++ ) { start = buffered . start ( i ) ; end = buffered . end ( i ) ; // buffered end can be bigger than duration by a very small fraction if ( <mask> > duration ) { end = duration ; } bufferedDuration += end - start ; } return bufferedDuration / duration ; }