Using Mediaelement to Play Video from Stream

Using MediaElement to play video from Stream

IF you can make the WCF deliver the Media Object via a http-URL (GET) then you can just assign that URL to the MediaElement.Source property - see http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.source.aspx.

For cases where such URL is not available/possible:

Assigning a Stream is currently not possible - although there are some hacks to make that happen, for a DirectShow-based example see http://social.msdn.microsoft.com/forums/en-US/wpf/thread/6191ef1a-0010-4294-a5b4-451bbadca33a/ and http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/15/WPF-Hackery-Part-I.aspx .

Another option would be to somehow host the Silverlight MediaElement and use the SetSource method which can take a stream and play it... see http://silverlightviewport.codeplex.com/SourceControl/list/changesets and http://msdn.microsoft.com/en-us/library/cc190669%28v=vs.95%29.aspx

Play video from UDP/RTSP using MediaElement?

After A LOT of research, it seems that what I am attempting to do may not be possible. The WPF MediaElement control (and Windows Media Player) appear to support playing videos over a network, but not from a stream. See the following thread on MSDN: https://social.msdn.microsoft.com/Forums/vstudio/en-US/e90b7e73-62b2-40b2-a725-4b60e02d65a1/play-video-stream-in-wpf?forum=wpf

I'm still on the lookout for a WPF control that will play video from a stream, but I haven't found anything.



Related Topics



Leave a reply



Submit