 
         let xCenterConstraint = NSLayoutConstraint(item: self, attribute: .centerX,
                                                    relatedBy: .equal, toItem: container, attribute: .centerX, multiplier: 1, constant: 0)
-        container.addConstraint(xCenterConstraint)
+        container?.addConstraint(xCenterConstraint)
 
         let yCenterConstraint = NSLayoutConstraint(item: self, attribute: .centerY,
                                                    relatedBy: .equal, toItem: container, attribute: .centerY, multiplier: 1, constant: 0)
-        container.addConstraint(yCenterConstraint)
+        container?.addConstraint(yCenterConstraint)
     }
 
     private func bindPlaybackEvents() {
-        if let playback = container.playback {
+        if let playback = container?.playback {
             listenTo(playback, eventName: Event.playing.rawValue) { [weak self] (info: EventUserInfo) in self?.stopAnimating(info) }
             listenTo(playback, eventName: Event.stalled.rawValue) { [weak self] (info: EventUserInfo) in self?.startAnimating(info) }
             listenTo(playback, eventName: Event.error.rawValue) { [weak self] (info: EventUserInfo) in self?.stopAnimating(info) }

        spinningWheel.stopAnimating()
        Logger.logDebug("stoped animating spinning wheel", scope: pluginName)
    }
}

    }

    private func bindDidChangePlayback() {
        if let container = self.container {
            listenTo(container, eventName: InternalEvent.didChangePlayback.rawValue) { [weak self] (info: EventUserInfo) in self?.didChangePlayback(info) }
        }
    }

