Working on a project in swift, where I'm trying to initiate the AVPlayer, and for some reason it trows me an exception saying
AudioHardware.cpp:1200:AudioObjectRemovePropertyListener: AudioObjectRemovePropertyListener: no object with given ID 0.
I guess the issue is with my URL. Here is my code
func initPlayer() {
let url:NSURL = NSURL(string:"https://purelight1-163000.appspot.com/api/user/v2/media/track/60/sample")!
self.playerItem = AVPlayerItem(url: url as URL)
self.player=AVPlayer(playerItem: self.playerItem!)
let playerLayer=AVPlayerLayer(player: self.player!)
playerLayer.frame = CGRect(x: 0, y: 0, width: 10, height: 50) // actually this player layer is not visible
self.view.layer.addSublayer(playerLayer)
}
NSURL
and then cast it toURL
? You should just simply dolet url= URL(string:"https://purelight1-163000.appspot.com/api/user/v2/media/track/60/sample")!
– Televiewno device with given ID
. This seems to only happen to me when I'm using the Simulator as @Envisage said. I was able to get it to stop by selecting my Simulator window, then going toHardware -> Audio Output
and changing it off of the system default (Note: this might still be the same output source) – Wachter