I recently needed to dynamically display a list of YouTube video’s from a specific YouTube account.
If you plan to output the list of video’s straight from the YouTube’s RSS feed into your .NET application don’t bother. The RSS feed is not structured in a nice enough format to output all the information you may need with ease. For example, video ratings, time, etc are all in the same XML block.
As you can see from the screenshot below, the ASP.NET page I created outputs all the information that you will probably want to show (if it doesn’t then it should give you a good starting point).
Before creating your own custom YouTube .NET application you will need to carry out two things:
- Go to the YouTube API Tools website and download the “Google Data API SDK”. Once you have installed this on your computer. You will need to copy three dll’s from one of the sample projects:
These dll's can be copied to your new project.
- Register a Developer Key. This is important! Without the developer key, your custom YouTube application will not work.
To create the page (above), copy the following code:
This is just the beginning on what the YouTube API has to offer. For more information, visit the YouTube API website (http://code.google.com/apis/youtube/2.0/developers_guide_dotnet.html).