Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 19, 2009 08:18 PM by AndyMoireASP
Jan 17, 2009 02:47 PM|LINK
Hi I am fairly new to ASP.Net, but I have been asked to develop a web site for a customer that needs to have Windows Media Player embedded into it to play some media files. I am using Visual Studio 2008, .Net Framework 3.5 and Visual Basic.
Whilst I am able to use the Object and Param tags to show visual studio, where I am struggling is how to pass the filepath to the media player. The object is that the customer clicks on a linkbutton from the girdview to select their media file, which will
Can only help me out as it is rather urgent??!!
Jan 17, 2009 07:00 PM|LINK
<object id="VIDEO" width="320" height="240" style="position: absolute; left: 0; top: 0;"
<param name="URL" runat="server" id="paramMediaPath" />
<param name="SendPlayStateChangeEvents" value="False" />
<param name="AutoStart" value="True" />
<param name="uiMode" value="none" />
<param name="PlayCount" value="9999" />
<param name="Volume" value="9999" />
Then in your code behind, you can do this:
Hope this helps.
Jan 18, 2009 10:36 AM|LINK
Thanks for your reply, but the code you have given me behind the page is in C#. Unfortunately, I am using VB.Net, and therefore, could you give me the Visual Basic equilvalent, please?
Jan 18, 2009 12:34 PM|LINK
It's not very different:
BTW- this online utility can convert between c# and VB.NET. HTH.
Jan 18, 2009 02:05 PM|LINK
Yes, I did try using Me. before emailing you, but the id of the param for the url did not appear in the list of objects to add the filepath. Is there something else I need to do, or is there something else I need to add to my code, i.e. COM, etc?
Jan 18, 2009 03:40 PM|LINK
If you added the runat=server attribute as in the above example, it should appear. What version of ASP.NET are you using?
Jan 18, 2009 08:00 PM|LINK
Thanks for your reply! Sorry, yes, I clearly forget that. I can see it now I have added the runat="server" attribute. Unfortunately, when I add the line of code, and click play, it says "connecting to media", then goes back to "ready". I have two test files
- a wav and wmv, do you have to add an onload on the param tag, or do you add something else to another tag?
Thanks for all your help!
Jan 18, 2009 09:26 PM|LINK
There is a free Windows Media Player ASP.NET custom control, which may make the process of embedding the media in the page a little easier-
you can download it from here. HTH
Jan 19, 2009 08:18 PM|LINK
I managed to get to work now without looking at the other website you have sent me! Thank you for all your help, you have been kind and helpful to me!