Apr 10, 2012 at 7:20 PM
Edited Apr 10, 2012 at 7:20 PM
Based on my understanding the behavior you are experiencing could be related to the fact that your module might not be locating your
MediaElement's video source file.
In my opinion, as a possible approach to achieve this kind of scenarios you could drag the video file into the
ClientBin folder in your web project and set the “Build Action” of the file to “None”. This way this resource file will be available for all your projects.
If so, you could define the element in you module's view for example like this:
<MediaElement Name="MediaElement1" Source="/01.wmv" />
Note the slash ("/") in the string path.
Also, another approach could be setting your file as an Embedded Resource
in your module's project (Highlight the video and verify its “Build Action” is set to “Embedded Resource").
This way you could set your MediaElement using the following methods in your module's view code behind (not setting the
Source property in XAML):
Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ModuleProject.01.wmv");
I hope you find this useful,