Using MediaElement to play video from Stream

rafale picture rafale · Aug 19, 2011 · Viewed 58.8k times · Source

Is it possible to use the WPF MediaElement to play streaming video from a System.IO.Stream object? The Stream object is being retrieved from a WCF service that stores the media files.

Answer

Robert picture Robert · Nov 8, 2011

Before anyone wastes hours finding this out for themselves: it is impossible to host the Silverlight MediaElement in a WPF application. The reason for this is that it is one of a number of types that appear in PresentationFramework.dll (unavoidable for WPF) and System.Windows.dll (Silverlight versions) that have the same names and the same namespaces, but are different types. (Someone should explain why we have namespaces to microsoft!)