     }
     
     func registerToAllEvents() {
-        
-        
-        self.messageBus?.addObserver(self, events: [PlayerEvents.ended.self], block: { (info) in
+        PKLog.trace("Register to all events")
+        guard let messageBus = self.messageBus else {
+            PKLog.error("messageBus is nil !")
+            return
+        }
+
+        messageBus.addObserver(self, events: [PlayerEvents.ended.self], block: { (info) in
             PKLog.trace("ended info: \(info)")
             self.stopTimer()
             self.delegate?.pluginManagerDidSendAnalyticsEvent(action: .finish)
         })
         
-        self.messageBus?.addObserver(self, events: [PlayerEvents.error.self], block: { (info) in
+        messageBus.addObserver(self, events: [PlayerEvents.error.self], block: { (info) in
             PKLog.trace("error info: \(info)")
             self.delegate?.pluginManagerDidSendAnalyticsEvent(action: .error)
         })
         
-        self.messageBus?.addObserver(self, events: [PlayerEvents.pause.self], block: { (info) in
+        messageBus.addObserver(self, events: [PlayerEvents.pause.self], block: { (info) in
             PKLog.trace("pause info: \(info)")
             self.delegate?.pluginManagerDidSendAnalyticsEvent(action: .pause)
         })
         
-        self.messageBus?.addObserver(self, events: [PlayerEvents.loadedMetadata.self], block: { (info) in
+        messageBus.addObserver(self, events: [PlayerEvents.loadedMetadata.self], block: { (info) in
             PKLog.trace("loadedMetadata info: \(info)")
             self.delegate?.pluginManagerDidSendAnalyticsEvent(action: .load)
         })
         
-        self.messageBus?.addObserver(self, events: [PlayerEvents.loadedMetadata.self], block: { (info) in
+        messageBus.addObserver(self, events: [PlayerEvents.playing.self], block: { (info) in
             PKLog.trace("play info: \(info)")
             
             if !self.intervalOn {

            } else {
                self.delegate?.pluginManagerDidSendAnalyticsEvent(action: .play);
            }
            
            
        })
        
    }
    
    private func createTimer() {

    func pluginManagerDidSendAnalyticsEvent(action: PhoenixAnalyticsType)
}

final class KalturaPluginManager {

    public var delegate: KalturaPluginManagerDelegate?
    
