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
How to Run a .Net 4.5 App on Xp
Remove File Extension from a File Name String
Sharing Data Between Appdomains
Launching a Process in User's Session from a Service
Get Error Message If Modelstate.Isvalid Fails
Best Way to Split String into Lines
Mock Httpcontext for Unit Testing a .Net Core MVC Controller
Should I Use Appdomain.Currentdomain.Basedirectory or System.Environment.Currentdirectory
ASP.NET MVC Dropdown List from Selectlist
C# Native Host with Chrome Native Messaging
What's a Good Threadsafe Singleton Generic Template Pattern in C#
String.Replace() VS. Stringbuilder.Replace()
Adding Images into Excel Using Epplus
Is It Secure to Store Passwords in Cookies
Open File Dialog and Select a File Using Wpf Controls and C#