Hi all,
I’m having a bit of a struggle with this one, as it’s working in my android build, but not on iOS.
I have an audio player in my app, that displays the location of where the audio file is up to playing via an “ion-range”. This works fine and is updated correctly.
What I’m trying to do, is make it so I can click on the ion-range bar, and have the audio play-head skip to that location and continue playing the audio at the new play point.
This works on Android, but no on my iOS device.
<ion-range min="0" max="100" tappable #seeker (on-tap)="positionPress($event, seeker.value)" (click)="positionPress($event, seeker.value)" [(ngModel)]="positionbar"> <!-- [disabled]="is_in_play && is_playing" -->
<ion-label range-left>{{ position*1000 | date:'mm:ss' }}</ion-label>
<!-- <ion-label range-left>{{ positionbar*1000 | date:'mm:ss' }}</ion-label> -->
<ion-label range-right *ngIf="duration == -1" >--:--</ion-label>
<ion-label range-right *ngIf="duration != -1">{{ duration*1000 | date:'mm:ss' }}</ion-label>
</ion-range>
As you can see, I’ve tried (also) adding tapper and (on-tap)=“positionPress($event, seeker.value)”, but these two methods haven’t worked.
What it’s meant to do, is call this function:
positionPress(ev: any, seeker)
{
console.log ('Steve touched the bar:', ev);
var audiofileplayer = this.globalsvals.AudioFile;
var positionbar = this.position;
var self = this;
var newTime = (seeker * audiofileplayer.duration) / 100;
audiofileplayer.currentTime = newTime;
}
But, in iOS, it doesn’t get this this function.
I’m currently on ionic 4, using Angluar.
Cheers,
Steve