title: AVPlayer streaming how to play the next mp3 is folder
body: <p>I have written code in ruby (similar to objective c) which plays an mp3 file from amazon s3 using AVPlayer. I want to be able to play all mp3 file stored in the directory instead of just the one who will i go about doing this?? 
  the code i wrote is </p>
  
  <pre><code>def buttonIsTapped
  p "Button was tapped"
  
  if (@audio_player == nil)
    Dispatch::Queue.concurrent.async do 
      mainBundle = NSBundle.mainBundle
      url = NSURL.URLWithString("https://s3-eu-west-1.amazonaws.com/mytrackzmusic/music/Nines+-+Loyal+To+The+Soil/", ofType:"mp3")
      #@audio_player = AVAudioPlayer.alloc.initWithData(fileData, error:error)
      @audio_player = AVPlayer.alloc.initWithURL(url)
      @audio_player.play
  
      @playerIsPlaying = true
    end
  else 
    if @playerIsPlaying == true
      @audio_player.pause
      @playerIsPlaying = false
    else
      @audio_player.play
      @playerIsPlaying = true
    end
  </code></pre>