                     videoPlayer.play()
                 } else {
                     let videoPlayer = AVPlayer(playerItem: playerItem)
-                    let backgroundVideoLayer = AVPlayerLayer(player: videoPlayer)
-                    backgroundVideoLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
-                    backgroundVideoLayer.frame = self.view.bounds
+                    backgroundVideoLayer = AVPlayerLayer(player: videoPlayer)
+                    backgroundVideoLayer!.videoGravity = AVLayerVideoGravityResizeAspectFill
+                    backgroundVideoLayer!.frame = self.view.bounds
                     backgroundVideoView?.frame = self.view.bounds
-                    backgroundVideoView?.layer.addSublayer(backgroundVideoLayer)
+                    backgroundVideoView?.layer.addSublayer(backgroundVideoLayer!)
                     
                     if backgroundVideoFadeInViews?.count > 0 {
                         backgroundVideoTimeObserver = videoPlayer.addPeriodicTimeObserverForInterval(CMTimeMakeWithSeconds(0.55, Int32(NSEC_PER_SEC)), queue: dispatch_get_main_queue(), usingBlock: { [weak self] (time) in

                    
                    backgroundVideoPlayer = videoPlayer
                    backgroundImageView?.removeFromSuperview()
                }
            } else if let backgroundImageURL = appearance.backgroundImageURL {
                backgroundImageView?.setImageWithURL(backgroundImageURL, completion: nil)
                backgroundVideoView?.removeFromSuperview()
            }
        }
    }
    

    @IBOutlet weak private var exitButton: UIButton!
    @IBOutlet weak private var backgroundImageView: UIImageView?
    @IBOutlet weak private var backgroundVideoView: UIView?
    private var backgroundVideoLayer: AVPlayerLayer?
    private var backgroundVideoPlayer: AVPlayer?
    private var backgroundBaseSize = CGSizeZero
    
    private var mainExperience: NGDMMainExperience!
    private var buttonOverlayView: UIView!
    private var playButton: UIButton!
    private var extrasButton: UIButton!
    
    private var didFinishPlayingObserver: NSObjectProtocol?
    
    private var backgroundVideoFadeInViews: [UIView]?
    private var backgroundVideoTimeObserver: AnyObject?
    private var interfaceCreated = false
    
    private var nodeStyle: NGDMNodeStyle? {
        return mainExperience.getNodeStyle(UIApplication.sharedApplication().statusBarOrientation)
    }
    
    private var playButtonImage: NGDMImage? {
        return nodeStyle?.getButtonImage("Play")
    }
    
    private var extrasButtonImage: NGDMImage? {
        return nodeStyle?.getButtonImage("Extras")
    }
    
    private var playButtonImageURL: NSURL? {
        return playButtonImage?.url
    }
    
    private var extrasButtonImageURL: NSURL? {
        return extrasButtonImage?.url
    }
    
    private var buttonOverlaySize: CGSize {
        return nodeStyle?.buttonOverlaySize ?? CGSizeMake(CGRectGetWidth(self.view.frame), 100)
    }
    
    private var buttonOverlayBottomLeft: CGPoint {
        return nodeStyle?.buttonOverlayBottomLeft ?? CGPointMake(0, 100)
    }
    
    private var playButtonSize: CGSize {
        return playButtonImage?.size ?? CGSizeMake(250, 50)
    }
    
    private var extrasButtonSize: CGSize {
        return extrasButtonImage?.size ?? CGSizeMake(175, 35)
    }
    
    deinit {
        unloadBackground()
