ionic-audio icon indicating copy to clipboard operation
ionic-audio copied to clipboard

Pause while fast-forwarding

Open betatools opened this issue 7 years ago • 2 comments

Oops, sorry about the typo in the headline. The enter key posted way before I was finished :)

Anyway, thanks for this nice plugin. I have one thing that though. Is it possible to pause the audio automatic while fast-forwarding? It seems the knob jumps around trying to figure out where my finger is and where the audio is currently at. Pausing the audio manually first solves this.

Thanks in advance

betatools avatar Aug 15 '17 18:08 betatools

To answer my own question this seems to do what I want

In view

<div item-content style="width:100%;" (touchstart)="touchstart($event) (touchend)="touchend($event)">
    <audio-track-progress-bar duration progress [audioTrack]="track"></audio-track-progress-bar>
</div>

In component

public touchstart($event)
{
   let track = this._audioProvider.tracks[this._audioProvider.current];
   if ( track )
   {
       track.pause();
    }
}

public touchend($event)
{
    let track = this._audioProvider.tracks[this._audioProvider.current];
    if ( track )
    {
        track.play();
    }
}

betatools avatar Aug 17 '17 11:08 betatools

Hi @betatools Great that you figured that out! I would have never guessed that one 😃

arielfaur avatar Aug 18 '17 14:08 arielfaur