'Playback with AVPlayer produces no sound and no error

I am trying to playback a remote mp3 file by using the following code:

import AVFoundation

let url = NSURL(string: urlString)
let avPlayer = AVPlayer(url: url! as URL)
avPlayer.play()

I get no error and no sound. Any hints and tips?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source