     
     // MARK: Player controls
     
+    /// by default, the youtube player will not play inline on iPhone until iOS10
+    /// setting this to true will force it to play inline
+    open var playInline : Bool {
+        get {
+            if let playsinline = playerVars["playsinline"] as? String {
+                return playsinline == "1"
+            }
+            return false
+        }
+        set {
+            playerVars["playsinline"] = "\(newValue ? 1 : 0)" as AnyObject
+            webView.allowsInlineMediaPlayback = newValue
+        }
+    }
+    
+    open var showRelatedVideos : Bool {
+        get {
+            if let rel = playerVars["rel"] as? String {
+                return rel == "1"
+            }
+            return false
+        }
+        set {
+            playerVars["rel"] = "\(newValue ? 1 : 0)" as AnyObject
+        }
+    }
+    
+    open var controls: VideoControlsState {
+        get {
+            if let controls = playerVars["controls"] as? String {
+                return VideoControlsState(rawValue: controls) ?? .Unknown
+            }
+            return .DisplayImmediately // This is the default
+        }
+        set {
+            playerVars["controls"] = newValue.rawValue as AnyObject
+        }
+    }
+    
+    open var showInfo : Bool {
+        get {
+            if let rel = playerVars["showinfo"] as? String {
+                return rel == "1"
+            }
+            return false
+        }
+        set {
+            playerVars["showinfo"] = "\(newValue ? 1 : 0)" as AnyObject
+        }
+    }
+    
     open func mute() {
         evaluatePlayerCommand("mute()")
     }


import UIKit

public enum YouTubePlayerState: String {
    case Unstarted = "-1"
    case Ended = "0"

        evaluatePlayerCommand("nextVideo()")
    }
    
    @discardableResult fileprivate func evaluatePlayerCommand(_ command: String) -> String? {
        let fullCommand = "player." + command + ";"
        return webView.stringByEvaluatingJavaScript(from: fullCommand)
    }
