Multiple audio files with cordova-plugin-media on ios

I have the following code in my controller ( this project is in ionic 1, and uses the cordova-plugin-media 5.0.3 plugin):

.controller('AudioCtrl', function($scope) {
  console.log('in AudioCtrl');
  let AudioFiles =[
  $scope.MediaFiles = [];


      let tempMediaObject = new Media(val['url'],function(){



  $ = function(index){
    console.log('play this file', $scope.MediaFiles[index]);

  $scope.pause = function(index){

  $scope.stop  = function(index){


and the following code in my page:

    <div class="card">
      <div style="white-space: normal;display: block;">File URL: {{audio.src}}</div>
      <button class="button" ng-click="play($index)">Play</button>
      <button class="button" ng-click="pause($index)">Pause</button>
      <button class="button" ng-click="stop($index)">Stop</button>


The problem is that when I try playback, it always plays the audio file form the first Media object created(sample.aac). As you can see I have consoled logged the file that should be playing when I hit play and that is the correct file as selected, but what actually plays is always the first file. I have also tried this without the $scope.MediaFiles[index].release() call. This works fine on android but not on ios. I am testing on an iPhone X with ios 13.2.3. Anyone had this issue or know any solution ?