O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Media Content

MediaElement has a SetSource method just like BitmapSource’s method seen in Chapter 11, so you can easily initialize it with an IRandomAccessStream that comes from a variety of sources, such as a file that a user retrieves from the file picker or files that you programmatically retrieve from the user’s Videos library. However, MediaElement’s SetSource method also requires you to pass the relevant MIME type (as a string) in order to determine the format of the media file. For a video stream, this would be a string such as video/mp4, video/x-ms-asf, or video/x-ms-wmv. For an audio stream, this would be a string such as audio/mp3 or audio/x-ms-wma. Fortunately, every StorageFile exposes its MIME type via its ContentType property. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required