I have a bunch of .wmv files on a local drive (F:/Movies/A.wmv, B.wmv, C.wmv etc). I am working on a project of which I do not yet know if it will ever be realized on to the net. My client wants a plausibility study on a local system. If I try the following line
<telerik:RadMediaItem x:Name="item0" Source="F:/Movies/A.wmv" Title="A"></telerik:RadMediaItem>
and then click on the item0 I get the message "Failed to open media".
My questions are:
- How do I address an absolute path in a local system to the file A.wmv in the xaml file, and
- How can I do that programmatically (C#)?
Thank you for your concern,
Karl
6 Answers, 1 is accepted
Unfortunately you can't open local files or file on share using Silverlight. This is due to Cross-Schema restriction of the plugin. When your silverlight application is running from Http page, you can't access local files - it is consider cross-schema. You can read the full story from msdn here. What you can do is to make this shared folder virtual folder and map it to a web server, and after that you can access these files using normal http protocol or any streaming protocol supported by Silverlight.
If we can be of further help please let us know.
Miro Miroslavov
the Telerik team
Can you give me a link on how to "make shared folder virtual folder and map it to a web server, and after that you can access these files" in Windows 7 or give me an example. I have the movies in a folder F:/Movies
Thanks,
Karl
You may read this learn article about Web Sites and Virtual Directories .
You can also check this.
You should also make sure that you have IIS installed on the machine that will share the videos on the web.
Miro Miroslavov
the Telerik team
Thank you. I've made a virtual directory called it KGFilme. So the directory F:/Filme is now mapped to KGFilme. My question now is how do I address it to get to the movies.
<
telerik:RadMediaItem
x:Name
=
"item0"
Source
=
"http://KGFilme/A.wmv"
Title
=
"A"
></
telerik:RadMediaItem
>
What would be missing in the above code?
Thanks,
Karl
Most probably you will be able to open it with S
ource="http://localhost/KGFilme/A.wmv". But you can also open the IIS Manager application, browse to your virtual directory under the default web site and click on Browse - this will open your virtual directory in a browser, so you will see the exact url to the directory.
Hope this will help you.
Miro Miroslavov
the Telerik team
Karl