File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ function CodeKeyframes(args){
88 this . label = args . label
99 this . autoplay = args . autoplay || false
1010 this . onCanPlay = args . onCanPlay || function ( ) { }
11+ this . onPause = args . onPause || function ( ) { }
12+ this . onPlay = args . onPlay || function ( ) { }
1113
1214 this . activeRegion = null
1315 this . skipLength = 1
@@ -502,6 +504,16 @@ function CodeKeyframes(args){
502504
503505 this . wavesurfer . load ( this . audioPath )
504506
507+ // run function passed to codekeyframes on init
508+ this . wavesurfer . on ( 'pause' , ( ) => {
509+ this . onPause ( )
510+ } )
511+
512+ // run function passed to codekeyframes on init
513+ this . wavesurfer . on ( 'play' , ( ) => {
514+ this . onPlay ( )
515+ } )
516+
505517 this . wavesurfer . on ( 'ready' , ( e ) => {
506518 this . wavesurfer . zoom ( this . zoom )
507519
@@ -546,4 +558,5 @@ function CodeKeyframes(args){
546558
547559 }
548560 } )
561+
549562}
You can’t perform that action at this time.
0 commit comments