Why is this mp3 file not streaming

110 views Asked by At

I am attempting to play this mp3 file using `avPlayer` however I simply get silence when I attempt to play. I do not receive any errors and here is my code

@IBAction func Test(sender: AnyObject) {
    println("Preparing to play")
    let urlString = "http://www.mp3juices.cc/get/3/194751031/x_ambassadors_-_renegades/"

    let url = NSURL(string: urlString)

    var avPlayer = AVPlayer(URL: url)
    avPlayer.play()
}
1

There are 1 answers

0
Leo Dabus On
import AVFoundation

class ViewController: UIViewController {

    // declare your avPlayer here
    var avPlayer: AVPlayer!

    override func viewDidLoad() {
        super.viewDidLoad()
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

    @IBAction func test(sender: AnyObject) {
        println("Preparing to play")
        let url = NSURL(string: "http://www.mp3juices.cc/get/3/194751031/x_ambassadors_-_renegades/")
        avPlayer = AVPlayer(URL: url)
        avPlayer.play()
    }
}