In the earlier post, we saw the "Dynamic Data Website" shipped with ASP.NET 3.5 Extensions Preview that can be used for rapid application development of data driven websites using Visual Studio 2008.
The ASP.NET 3.5 Extensions Preview can be installed from here Once you install the same, you get a few things. One, is that you get the 'Dynamic Data Website' template I talked about earlier. The other thing is that you get the "ASP.NET 3.5 Extensions Website" template that allows you to create an ASP.NET 3.5 Website with the Extensions Preview features.
I know its confusing at this moment. If you read back, we released ASP.NET 3.5 and Visual Studio 2008 during the fag end of 2007. Along with that we also released an ASP.NET 3.5 Extensions Preview, a build that is currently a CTP where we are testing some of the new features that could be integrated as a part of SP1 for .NET 3.5 (and subsequently ASP.NET 3.5)
One of the features of the ASP.NET 3.5 Extensions is the Dynamic Data Controls that allows you to create Data Driven Websites using the LINQ to SQL and Dynamic Data Controls. The other feature is the ASP.NET 3.5 Extensions Website that allows you to create ASP.NET Website where you can use all the controls / features that are currently in preview.
So, once you create this ASP.NET 3.5 Extensions Website, the first thing you would notice is that, the version of AJAX (System.Web.Extensions.DLL) is 188.8.131.52 as opposed to 184.108.40.206. that would be in the case of a normal ASP.NET 3.5 Web Site (File - New - Website - ASP.NET Website in Visual Studio 2008). Also you must be able to see a new tab in the toolbox reading "ASP.NET 3.5 Extensions". Some of the controls that would be present in this tab are the ListView, DataPager, UpdatePanel, UpdateProgress, Timer and the ScriptManager, ScriptManagerProxy controls. The version however, for these controls is again 220.127.116.11. which means that they would be the newer versions currently under preview. The other things that you would notice is the Dynamic Data Controls like DynamicListView, DynamicDetailsView, DynamicGridView and DynamicFormView. We will see about these controls in a later post.
The third set of controls you would notice are Silverlight and MediaPlayer controls which are very handy controls. The MediaPlayer controls allows you to play videos on your ASP.NET Pages without the need to do much work.
Lets start examining this. Open Visual Studio 2008, select "File - New - Website" andchose the "ASP.NET 3.5 Extensions Website"
Once you create the website, open the Default.aspx page and also expand the ASP.NET 3.5 Extensions Toolbox tab. Drag and Drop the MediaPlayer control to your webpage.
Next is that we need to add a Video to our site. Go to the root of the website and create a folder named "Videos" (We could do without this, but just a logical grouping). Add an existing video that you can pick up from your machine. By default, Windows Vista and Windows XP ships the Butterlfy.wmv and a couple of videos that you can use, in case you dont have any video on your machine. These files (Butterfly.wmv etc.,) are usually located in C:\users\<username>\videos\Sample Videos in case of Windows Vista and at C:\Documents and Settings\<user name>\My Documents\My Videos in case of Windows XP.
So you can add these videos or any other video that you have in your machine to the 'Videos' folder that we created in the root of the website.
Now, switch to design view of the Default.aspx page and select the MediaPlayer Control. You should see a "Silverlight" logo which indicates that the video would be hosted by Silverlight for the end users. Click on the smart tag that shows up next to the MediaPlayer control where you can set the MediaPlayer Tasks. Click on the browse button next to the Media Source TextBox to chose the video file. It currently supports File formats. You can chose a video of this file format from the 'Videos' folder that we created. You can alWMV, MP3, WMA and ASX so set it to Mute or AutoPlay and change other properties using the properties window.
Thats it! You are good to go and play Videos in your web page. The great advantage is that, this doesnt require the end users to have Windows Media Player to be installed since this would be powered by Silverlight. The end users just need ot install Silverlight runtime for the first time and with the flood of Silverlight applications that we are witnessing these days, there are more than likely chances that your end users have already Silverlight running in their machines. This means that you can play Videos on your ASP.NET Web pages without having any additional client installation.
For more information on further exploring MediaPlayer and creating chapters, check http://quickstarts.asp.net/3-5-extensions/silverlight/MediaPlayerControl.aspx