support different type of youtube url
style improve
simplify keypress function