             
             registerPlayerEvent()
             
-            if playerItem.status == .ReadyToPlay {
+            if playerItem!.status == .ReadyToPlay {
                 readyToPlay()
             } else {
                 startPending()

    #if os(iOS)
        
    func appResignActive(notification: NSNotification) {
        playerstate.lastplay = player!.isPlaying()
        
        if !isAirplaying() {
            player!.pause()
        }
        
        cpmoduleManager.appResign()

        cpi = 0
        self.cpus = cpus
        playerstate.state = .ItemReady
        playerAsset = AVURLAsset.urlAssetWithURL(cpu().url, userAgent: cpu().ua) as? AVURLAsset
        playerItem = CPPlayerItem(asset: playerAsset)
        
        registerPlayerItemEvent()
        
        player = CPPlayer(playerItem: playerItem! as AVPlayerItem)
        player!.actionAtItemEnd = .Pause
        #if os(iOS)
        player!.allowsExternalPlayback = allowAirPlay
