Streaming mp3 file from server in Swift 3


I am trying to stream mp3 file from my centOS based server , I have uploaded the file to server and tried opening it in AvPlayer , however it actually downloads it and plays it, when I open the same link in browser it is able to stream the file, it starts playing in 5 seconds around. Is there any solution which can do the same in iOS app using swift ?

In my case, I used php for stream that mean IOS app will play the mp3 file via stream.php:

$filePath = $dirPath . "/songname.mp3";
        'header'=>"Accept-language: en\r\n"
$fpOrigin=fopen($filePath, 'rb', false, $strContext);
header('Content-Disposition: inline; filename="songname.mp3"');
header('Pragma: no-cache');
header('Content-type: audio/mpeg');
header('Content-Length: '.filesize($filePath));
  $buffer=fread($fpOrigin, 4096);
  echo $buffer;

Then I pass the url to swift: http://domain/stream.php