Hi,
I have a number of audio files loaded on page similar to how it is written below:
<ion-item *ngFor="let programme of radioProgrammes" class="radio-file">
<audio controls preload>
<source [src]="programme.radio_file" type="audio/mpeg">
Your device does not support the audio element.
</audio>
</ion-item>
The issue is I want to stop the user from playing more than 1 audio file at a time.
I have already written a function pause all other audio files if they are playing but but I cant figure out how to detect when the file starts playing.
I originally tried adding (click)=“pauseOtherPlayers()” to call the function eg:
<audio (click)="pauseOtherPlayers()" controls preload>
<source [src]="programme.radio_file" type="audio/mpeg">
Your device does not support the audio element.
</audio>
but that didn’t work.
Thanks in advanced to anyone who can help me with this issue.