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.
MediaElement can be used in two different modes, depending on what is driving the control: independent mode or clock mode. When used in the independent mode, the MediaElement is analogous to an image, and Source URI can be directly specified. In clock mode, the MediaElement can be thought of as a target for an animation, and thus it will have corresponding Timeline and Clock entries in the timing tree. For more information on media modes, see the Multimedia Overview.
For an example of controlling a MediaElement in independent mode, see How to: Control a MediaElement (Play, Pause, Stop, Volume, and Speed).
Until the MediaOpened event has been raised, the ActualWidth and ActualHeight of the control will report as zero as the media content is used to determine the final size and location of the control. For audio only content, these properties will always be zero.
For a fixed size control, the Width and/or Height properties can be set. However, to preserve the media's aspect ratio, set the Width or Height properties but not both.