@@ -229,7 +229,7 @@ function createCommentCanvas(cmt) {
229229 ctx [ key ] = cmt . canvasStyle [ key ] ;
230230 }
231231 }
232- ctx . textBaseline = 'hanging ' ;
232+ ctx . textBaseline = 'top ' ;
233233 if ( cmt . canvasStyle && cmt . canvasStyle . strokeStyle ) {
234234 ctx . strokeText ( cmt . text , 0 , 0 ) ;
235235 }
@@ -299,13 +299,13 @@ function play() {
299299 if ( ! this . visible || ! this . paused ) {
300300 return this ;
301301 }
302+ this . paused = false ;
302303 var that = this ;
303304 var engine = this . _useCanvas ? canvasEngine : domEngine ;
304305 function frame ( ) {
305306 engine . call ( that ) ;
306307 that . _requestID = raf ( frame ) ;
307308 }
308- this . paused = false ;
309309 this . _requestID = raf ( frame ) ;
310310 return this ;
311311}
@@ -448,6 +448,10 @@ function initMixin(Danmaku) {
448448
449449function emitMixin ( Danmaku ) {
450450 Danmaku . prototype . emit = function ( cmt ) {
451+ if ( ! cmt || Object . prototype . toString . call ( cmt ) !== '[object Object]' ) {
452+ return this ;
453+ }
454+ cmt . text = ( cmt . text || '' ) . toString ( ) ;
451455 cmt . mode = formatMode ( cmt . mode ) ;
452456 cmt . _utc = Date . now ( ) / 1000 ;
453457 if ( this . _hasMedia ) {
@@ -469,6 +473,9 @@ function showMixin(Danmaku) {
469473 return this ;
470474 }
471475 this . visible = true ;
476+ if ( this . _hasMedia && this . media . paused ) {
477+ return this ;
478+ }
472479 seek . call ( this ) ;
473480 play . call ( this ) ;
474481 return this ;
@@ -516,7 +523,10 @@ function speedMixin(Danmaku) {
516523 return this . _speed ;
517524 } ,
518525 set : function ( s ) {
519- if ( s <= 0 ) {
526+ if ( typeof s !== 'number' ||
527+ isNaN ( s ) ||
528+ ! isFinite ( s ) ||
529+ s <= 0 ) {
520530 return this . _speed ;
521531 }
522532 this . _speed = s ;
0 commit comments