I was disappointed to see that the YouTube extension for BlogEngine was no longer available for download, so I decided to create my own.
I had recently installed Sean Blakemore’s Silverlight Extension, and since I have never coded an extension for BlogEngine I figured I’d learn from a similar application. Thanks for the head start, Sean! I really used the base of his code and modified it to work for YouTube videos instead.
UPDATE 01.13.2011: Version 1.3 Released. Fixes compatibility issues with BlogEngine.NET 2.0. Should now work just fine!
UPDATE 05.11.2010: Version 1.2 Released. Includes heavily-requested feature to add YouTube videos to BlogEngine.NET “Pages” (as well as Blog Posts)! Thanks to Dobin Fernandes for the updated code! Now if we can just get him to figure out how to apply this to RSS feeds, we’ll be all set!
UPDATE 10.28.2008: Version 1.1 Released. Instructions modified.
Version history at end of this post.
So, installation is quite easy:
- Take this ZIP file – YouTube Player 1.3 – BlogEngine Extension – and extract the YouTubePlayer.cs file into your /App_Code/Extensions folder within the root of your BlogEngine installation.
- Log into the “Extensions” portion of your admin panel, you should see the YouTubePlayer extension.
- Click the Edit link to change settings. NOTE: You do not need to modify these settings if you don’t want, you can skip to step 4.
- Width and Height are set to the default YouTube size, you can change them if you wish but I don’t believe it will change the size of the video.
- Show Border is nice if you want to blend the video border into the color scheme of your website. By default this is turned off (0). Turn it on by changing the setting to “1”.
- Primary and Secondary colors are used for the border and need to be entered in Hexidecimal value. The example below uses 709397 for the secondary (the aqua in this site) and 000000 (black) for the primary. You can see how it looks below.
- Create a new entry and add this code to your blog to insert a YouTube video: [ youtube:YourVideoCodeGoesHere ] (without the spaces).
- Note that the “YourVideoCodeGoesHere” part is typically random characters and letters. You can see them in the URL of your YouTube video.
That being said, the code entered for this is [ youtube:Ddn4MGaS3N4 ](minus the spaces)
The video looks like this:
YouTube Player 1.3 – BlogEngine Extension
Fix: Compatibility issues with BlogEngine.NET 2.0 resolved.
YouTube Player 1.2 – BlogEngine Extension
Change: System now allows for YouTube Videos to be posted to BlogEngine.NET “Pages” as well as just the “Posts”. Thanks Dobin Fernandes!
YouTube Player 1.1 – BlogEngine Extension
Change: Code used within [ youtube: ] tag is no longer the entire URL (i.e. http://www.youtube.com/v/Ddn4MGaS3N4). On occasion, if the WYSIWYG editor set the URL as a hyperlink, the rendering of the video would fail. Now, it’s only required that the random video code is entered (i.e. Ddn4MGaS3N4)
Version 1.0, first release
YouTube Player 1.0 – BlogEngine Extension