   }
 
   deinit {
-    NSNotificationCenter.defaultCenter().removeObserver(
-      self,
-      name: AVPlayerItemDidPlayToEndTimeNotification,
-      object: nil
-    )
+    for notification in playerItemNotifications {
+      NSNotificationCenter.defaultCenter().removeObserver(self, name: notification, object: nil)
+    }
   }
 
   // MARK: - UIViewController

      return
    }

    NSNotificationCenter.defaultCenter().addObserver(
      self,
      selector: #selector(handlePlayerItemDidPlayToEndTime(_:)),
      name: AVPlayerItemDidPlayToEndTimeNotification,
      object: playerItem
    )

    player = AVPlayer(playerItem: playerItem)
    player?.play()
  }

}

  override func viewWillDisappear(animated: Bool) {
    super.viewWillDisappear(animated)
    player?.pause()

    if let playerItem = player?.currentItem {
      let duration: NSTimeInterval = CMTimeGetSeconds(playerItem.duration)
      let currentTime: NSTimeInterval = CMTimeGetSeconds(playerItem.currentTime())

      Tracker.track(Event(name: "Played Video", details: [
        "Duration": currentTime,
        "Fraction": currentTime / duration
      ]))
    }
  }

  // MARK: - Trackable
