AudioHardware.cpp: 1200: AudioObjectRemovePropertyListener: AudioObjectRemovePropertyListener: no object with given ID 0

Work on a project in swift, where I try to run AVPlayer, and for some reason it throws me an exception saying

AudioHardware.cpp: 1200: AudioObjectRemovePropertyListener: AudioObjectRemovePropertyListener: no object with the given identifier 0.

I think the problem 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)
}
+6
source share
1 answer

Xcode is too chat. You just need to edit your schema (Product> Schema> Editing Scheme) and create a new environment variable OS_ACTIVITY_MODE and set its value to disable.

+1

All Articles