AudioHardware.cpp:1200:AudioObjectRemovePropertyListener:AudioObjectRemovePropertyListener:没有给定ID为0的对象 [英] AudioHardware.cpp:1200:AudioObjectRemovePropertyListener: AudioObjectRemovePropertyListener: no object with given ID 0
问题描述
在swift中处理一个项目,我正在尝试启动AVPlayer,由于某种原因,它让我异常说
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:没有给定ID为0的对象。
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)
}
推荐答案
Xcode过于繁琐。您只需编辑您的Scheme(Product> Scheme> Edit Scheme)并创建一个新的环境变量OS_ACTIVITY_MODE并将其值设置为disable。
Xcode is overly chatty. You just need edit your Scheme (Product > Scheme > Edit Scheme) and create a new Environment Variable OS_ACTIVITY_MODE and set its value to disable.
这篇关于AudioHardware.cpp:1200:AudioObjectRemovePropertyListener:AudioObjectRemovePropertyListener:没有给定ID为0的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!