File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -446,12 +446,8 @@ class APlayer {
446446 instances . splice ( instances . indexOf ( this ) , 1 ) ;
447447 this . pause ( ) ;
448448 this . container . innerHTML = '' ;
449- clearInterval ( this . playedTime ) ;
450- for ( const key in this ) {
451- if ( this . hasOwnProperty ( key ) ) {
452- delete this [ key ] ;
453- }
454- }
449+ this . audio . src = '' ;
450+ this . timer . destroy ( ) ;
455451 }
456452
457453 handlePlayPromise ( callback ) {
Original file line number Diff line number Diff line change @@ -21,12 +21,10 @@ class Timer {
2121 }
2222
2323 init ( ) {
24- for ( let i = 0 ; i < this . types . length ; i ++ ) {
25- const type = this . types [ i ] ;
26- if ( type !== 'fps' ) {
27- this [ `init${ type } Checker` ] ( ) ;
28- }
29- }
24+ this . types . map ( ( item ) => {
25+ this [ `init${ item } Checker` ] ( ) ;
26+ return item ;
27+ } ) ;
3028 }
3129
3230 initprogressChecker ( ) {
@@ -79,8 +77,12 @@ class Timer {
7977 this [ `enable${ type } Checker` ] = false ;
8078 }
8179
82- destroy ( type ) {
83- this [ `${ type } Checker` ] && clearInterval ( this [ `${ type } Checker` ] ) ;
80+ destroy ( ) {
81+ this . types . map ( ( item ) => {
82+ this [ `enable${ item } Checker` ] = false ;
83+ this [ `${ item } Checker` ] && clearInterval ( this [ `${ item } Checker` ] ) ;
84+ return item ;
85+ } ) ;
8486 }
8587}
8688
You can’t perform that action at this time.
0 commit comments