The YouTube URL scheme is used to launch the YouTube application or connect to the YouTube website to play the specified video. If your application links to YouTube content, you can use this scheme to play videos from your application.
Unlike some schemes, YouTube URLs do not start with a “youtube” scheme identifier. Instead, they are specified as regular http
links but are targeted at the YouTube server. The following examples show the basic strings you would use in Safari and in an application to show a YouTube video. In each example, you would need to replace the VIDEO_IDENTIFIER
value with the identifier of the video you wanted to display:
HTML links:
<a href="http://www.youtube.com/watch?v=VIDEO_IDENTIFIER">Play Video</a> |
<a href="http://www.youtube.com/v/VIDEO_IDENTIFIER">Play Video</a> |
Native application URL strings:
http://www.youtube.com/watch?v=VIDEO_IDENTIFIER |
http://www.youtube.com/v/VIDEO_IDENTIFIER |
iOS Note: If the YouTube video cannot be viewed on the device, iOS displays an appropriate warning message to the user.
Last updated: 2009-06-17