Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how do i play mov videos in resources? i know how to play a video my code is

XML
<MediaElement Name="VideoControl" Source="INTRO_TechXSoftware" Stretch="Fill" VerticalAlignment="Stretch" Margin="0,0,0,29" LoadedBehavior="Manual" UnloadedBehavior="Manual">
        </MediaElement>


and my error is

MSIL
Warning 1   The file 'INTRO_TechXSoftware' is not part of the project or its 'Build Action' property is not set to 'Resource'.  C:\Users\Kyle\documents\visual studio 2010\Projects\DaysUntill\DaysUntill\VideoTutorial.xaml    7   43  DaysUntill


and i don't know why its now letting me play and i don't know how to fix it. INTRO_TechXSoftware is in my resources
Posted

1 solution

First line in the "Remarks" section of the MediaElement docs: "When distributing media with your application, you cannot use a media file as a project resource. In your project file, you must instead set the media type to Content and set CopyToOutputDirectory to PreserveNewest or Always."

I don't know why it's letting you play from a resource if it is...I can't play from a resource but can using Content/CopyToOutputDirectory=Always.
 
Share this answer
 
v2
Comments
[no name] 25-Jun-11 2:09am    
I don't understand, i can find what your talking about
Mark Salsbery 25-Jun-11 2:26am    
You can't play video from a resource. You can play a file attached to a project as content.
[no name] 25-Jun-11 2:42am    
how do i do that?
Mark Salsbery 25-Jun-11 2:48am    
Add a media file to your project. Highlight it, press F4 key to get properties, set Build Action to Content and set Copy to Output Directory to Copy Always or Copy if Newer. If you add a folder to project, for example called "Media", and place the media file in that folder, then the source URI for your MediaElement will be something like "Media/mediafilename.ext".
[no name] 25-Jun-11 5:21am    
I tried /DaysUntill/Resources/INTRO TechXSoftware , nothings happening

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900