Add ability to insert a youtube page address instead of direct url

I've added function checkYoutube that converts youtube video page url to youtube video url, so 'http://www.youtube.com/watch?v=5uslwIp48Bw&t=1m2s' become 'http://youtu.be/5uslwIp48Bw?t=1m2s' 

Function run when the url is inserted and before form submit
Maybe it can be done in other way