         let url = request.URL
 
         // Check if ytplayer event and, if so, pass to handleJSEvent
-        if url.scheme == "ytplayer" { handleJSEvent(url) }
+        if url!.scheme == "ytplayer" { handleJSEvent(url!) }
 
         return true
     }

        }

        // Success, return JSON string
        return NSString(data: jsonData!, encoding: NSUTF8StringEncoding)
    }



    public var delegate: YouTubePlayerDelegate?

    // MARK: Various methods for initialization
/*
    public init() {
        super.init()
        self.buildWebView(playerParameters())
    }
*/
    override public init(frame: CGRect) {
        super.init(frame: frame)
        buildWebView(playerParameters())
