File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 11( function ( global , factory ) {
22 typeof exports === 'object' && typeof module !== 'undefined' ? module . exports = factory ( ) :
33 typeof define === 'function' && define . amd ? define ( factory ) :
4- ( global . Danmaku = factory ( ) ) ;
5- } ( this , ( function ( ) { 'use strict' ;
4+ ( global = global || self , global . Danmaku = factory ( ) ) ;
5+ } ( this , function ( ) { 'use strict' ;
66
77 /* eslint no-invalid-this: 0 */
88 function allocate ( cmt ) {
130130 if ( cmtt >= ct ) {
131131 break ;
132132 }
133+ if ( ct - cmtt > this . duration ) {
134+ ++ this . position ;
135+ continue ;
136+ }
133137 if ( this . _hasMedia ) {
134138 cmt . _utc = dn - ( this . media . currentTime - cmt . time ) ;
135139 }
177181 }
178182 var height = 12 ;
179183 // eslint-disable-next-line max-len
180- var regex = / ^ ( \d + (?: \. \d + ) ? ) ( p x | % | e m | r e m ) (?: \s * \/ \s * ( \d + (?: \. \d + ) ? ) ( p x | % | e m | r e m ) ? ) ? / ;
184+ var regex = / ( \d + (?: \. \d + ) ? ) ( p x | % | e m | r e m ) (?: \s * \/ \s * ( \d + (?: \. \d + ) ? ) ( p x | % | e m | r e m ) ? ) ? / ;
181185 var p = font . match ( regex ) ;
182186 if ( p ) {
183187 var fs = p [ 1 ] * 1 || 10 ;
268272 if ( cmtt >= ct ) {
269273 break ;
270274 }
275+ if ( ct - cmtt > this . duration ) {
276+ ++ this . position ;
277+ continue ;
278+ }
271279 if ( this . _hasMedia ) {
272280 cmt . _utc = dn - ( this . media . currentTime - cmt . time ) ;
273281 }
696704
697705 return Danmaku ;
698706
699- } ) ) ) ;
707+ } ) ) ;
You can’t perform that action at this time.
0 commit comments