         }
     }
 
-    var fillMode: String {
-        get {
-            return self.playerLayer.videoGravity.rawValue
+    var fillMode: PlayerFillMode {
+        get {
+            return self.playerLayer.videoGravity
         }
         set {
-            self.playerLayer.videoGravity = AVLayerVideoGravity(rawValue: newValue)
+            self.playerLayer.videoGravity = newValue
         }
     }
     

/// - resize: Stretch to fill.
/// - resizeAspectFill: Preserve aspect ratio, filling bounds.
/// - resizeAspectFit: Preserve aspect ratio, fill within bounds.
public enum PlayerFillMode {
    case resize
    case resizeAspectFill
    case resizeAspectFit // default
    
    public var avFoundationType: String {
        get {
            switch self {
            case .resize:
                return AVLayerVideoGravity.resize.rawValue
            case .resizeAspectFill:
                return AVLayerVideoGravity.resizeAspectFill.rawValue
            case .resizeAspectFit:
                return AVLayerVideoGravity.resizeAspect.rawValue
            }
        }
    }
}

/// Asset playback states.
public enum PlaybackState: Int, CustomStringConvertible {

    override init(frame: CGRect) {
        super.init(frame: frame)
        self.playerLayer.backgroundColor = UIColor.black.cgColor
        self.playerLayer.videoGravity = PlayerFillMode.resizeAspect
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.playerLayer.backgroundColor = UIColor.black.cgColor
        self.playerLayer.videoGravity = PlayerFillMode.resizeAspect
    }

    deinit {
