File tree Expand file tree Collapse file tree 7 files changed +28
-15
lines changed
Expand file tree Collapse file tree 7 files changed +28
-15
lines changed Original file line number Diff line number Diff line change 11language : node_js
2+ sudo : false
23node_js :
34 - " 0.10"
45before_install :
Original file line number Diff line number Diff line change @@ -824,23 +824,26 @@ var CommentManager = (function() {
824824 } ;
825825 CommentManager . prototype . init = function ( ) {
826826 this . setBounds ( ) ;
827- if ( this . filter == null )
827+ if ( this . filter == null ) {
828828 this . filter = new CommentFilter ( ) ; //Only create a filter if none exist
829+ }
829830 } ;
830831 CommentManager . prototype . time = function ( time ) {
831832 time = time - 1 ;
832833 if ( this . position >= this . timeline . length || Math . abs ( this . lastPos - time ) >= 2000 ) {
833834 this . seek ( time ) ;
834835 this . lastPos = time ;
835- if ( this . timeline . length <= this . position )
836+ if ( this . timeline . length <= this . position ) {
836837 return ;
838+ }
837839 } else {
838840 this . lastPos = time ;
839841 }
840842 for ( ; this . position < this . timeline . length ; this . position ++ ) {
841- if ( this . options . limit > 0 && this . runline . length > this . limiter ) break ;
842843 if ( this . timeline [ this . position ] [ 'stime' ] <= time ) {
843- if ( this . validate ( this . timeline [ this . position ] ) ) {
844+ if ( this . options . limit > 0 && this . runline . length > this . limiter ) {
845+ continue ; // Skip comments but still move the position pointer
846+ } else if ( this . validate ( this . timeline [ this . position ] ) ) {
844847 this . send ( this . timeline [ this . position ] ) ;
845848 }
846849 } else {
Original file line number Diff line number Diff line change @@ -900,9 +900,9 @@ var CCLScripting = function(workerUrl){
900900 cG = Math . floor ( ( filter . params . color % 65536 ) / 256 ) ,
901901 cB = filter . params . color % 256 ;
902902 var cMatrix = [
903- 0 , 0 , 0 , cR , 0 ,
904- 0 , 0 , 0 , cG , 0 ,
905- 0 , 0 , 0 , cB , 0 ,
903+ 0 , 0 , 0 , cR / 256 , 0 ,
904+ 0 , 0 , 0 , cG / 256 , 0 ,
905+ 0 , 0 , 0 , cB / 256 , 0 ,
906906 0 , 0 , 0 , 1 , 0 ,
907907 ] ;
908908 dFilter . appendChild ( __ ( "feColorMatrix" , {
Original file line number Diff line number Diff line change 1919管理器的弹幕是否在运行。` false ` 表示没有在运行,` true ` 表示在运行。可以通过 start/stop 控制。这
2020个参数只反映运行列表里面弹幕的运行状态,而不是视频的。
2121
22+ ### width < ; Number> ;
23+ 舞台的长度像素值,用于计算弹幕位置。此数只有在 init 之后才有效。
24+
25+ ### height < ; Number> ;
26+ 舞台的高度像素值,用于计算弹幕位置。此数只有在 init 之后才有效。
27+
2228## Methods 方法
2329
2430### init()
Original file line number Diff line number Diff line change @@ -159,23 +159,26 @@ var CommentManager = (function() {
159159 } ;
160160 CommentManager . prototype . init = function ( ) {
161161 this . setBounds ( ) ;
162- if ( this . filter == null )
162+ if ( this . filter == null ) {
163163 this . filter = new CommentFilter ( ) ; //Only create a filter if none exist
164+ }
164165 } ;
165166 CommentManager . prototype . time = function ( time ) {
166167 time = time - 1 ;
167168 if ( this . position >= this . timeline . length || Math . abs ( this . lastPos - time ) >= 2000 ) {
168169 this . seek ( time ) ;
169170 this . lastPos = time ;
170- if ( this . timeline . length <= this . position )
171+ if ( this . timeline . length <= this . position ) {
171172 return ;
173+ }
172174 } else {
173175 this . lastPos = time ;
174176 }
175177 for ( ; this . position < this . timeline . length ; this . position ++ ) {
176- if ( this . options . limit > 0 && this . runline . length > this . limiter ) break ;
177178 if ( this . timeline [ this . position ] [ 'stime' ] <= time ) {
178- if ( this . validate ( this . timeline [ this . position ] ) ) {
179+ if ( this . options . limit > 0 && this . runline . length > this . limiter ) {
180+ continue ; // Skip comments but still move the position pointer
181+ } else if ( this . validate ( this . timeline [ this . position ] ) ) {
179182 this . send ( this . timeline [ this . position ] ) ;
180183 }
181184 } else {
Original file line number Diff line number Diff line change 599599 cG = Math . floor ( ( filter . params . color % 65536 ) / 256 ) ,
600600 cB = filter . params . color % 256 ;
601601 var cMatrix = [
602- 0 , 0 , 0 , cR , 0 ,
603- 0 , 0 , 0 , cG , 0 ,
604- 0 , 0 , 0 , cB , 0 ,
602+ 0 , 0 , 0 , cR / 256 , 0 ,
603+ 0 , 0 , 0 , cG / 256 , 0 ,
604+ 0 , 0 , 0 , cB / 256 , 0 ,
605605 0 , 0 , 0 , 1 , 0 ,
606606 ] ;
607607 dFilter . appendChild ( __ ( "feColorMatrix" , {
You can’t perform that action at this time.
0 commit comments