     public required init(context: UIBaseObject) {
         fatalError("init(context:) has not been implemented")
     }
-
-    open override func layoutSubviews() {
-        if let playerLayer = playerLayer {
-            playerLayer.frame = self.bounds
-        }
-    }
-    
-    open override func play() {
-        if player == nil {
-            setupPlayer()
-        }
+    return CMTimeGetSeconds(player.currentTime())
+  }
+
+  open override var playbackType: PlaybackType {
+    guard let player = player, let duration = player.currentItem?.asset.duration else {
+      return .unknown
+    }
 
         player?.play()
       


        return false;
    }

    open override var isPaused: Bool {
        return currentState == .paused
    }

    open override var isBuffering: Bool {
        return currentState == .buffering
    }

    open override var duration: Double {
        guard playbackType == .vod, let item = player?.currentItem else {
            return 0
        }
        return CMTimeGetSeconds(item.asset.duration)
    }

    open override var position: Double {
        guard playbackType == .vod, let player = self.player else {
            return 0
        }
        return CMTimeGetSeconds(player.currentTime())
    }

    open override var playbackType: PlaybackType {
        guard let player = player, let duration = player.currentItem?.asset.duration else {
            return .unknown
        }

        return duration == kCMTimeIndefinite ? .live : .vod
    }

    open override class func canPlay(_ options: Options) -> Bool {
        var mimeType = ""

        }
        NotificationCenter.default.removeObserver(self)
    }
  }

  fileprivate func getSelectedMediaOptionWithCharacteristic(_ characteristic: String) -> AVMediaSelectionOption? {
    if let group = mediaSelectionGroup(characteristic) {
      return player?.currentItem?.selectedMediaOption(in: group)
    }
    return nil
  }
  
  fileprivate func mediaSelectionGroup(_ characteristic: String) -> AVMediaSelectionGroup? {
    return player?.currentItem?.asset.mediaSelectionGroup(forMediaCharacteristic: characteristic)
  }
  
  deinit {
    removeObservers()
  }
  
  fileprivate func removeObservers() {
    if player != nil {
      player?.removeObserver(self, forKeyPath: "currentItem.status")
      player?.removeObserver(self, forKeyPath: "currentItem.loadedTimeRanges")
      player?.removeObserver(self, forKeyPath: "currentItem.playbackLikelyToKeepUp")
      player?.removeObserver(self, forKeyPath: "currentItem.playbackBufferEmpty")
      player?.removeObserver(self, forKeyPath: "externalPlaybackActive")
    }
    NotificationCenter.default.removeObserver(self)
  }
}
