2012-07-21 496 views
8

我有一个元素:WPF中的MediaElement播放视频流?

<MediaElement x:Name="bgvideo" Width="800" Height="600" /> 

,我有一个流视频:

Stream stream = obj.GetFileStream(); 

我想用流对象的MediaElement来源,但默认MediaElement使用source属性。

+0

您不能直接设置流。看看这个线程的可能的解决方法:http://stackoverflow.com/questions/7117589/using-mediaelement-to-play-video-from-stream – 2012-07-21 10:39:51

+0

谢谢,your're链接推荐使用BoxedApp – 2012-07-21 11:03:01

+0

你不能这样做与WPF MediaElement的。看看这里http://stackoverflow.com/questions/7117589/using-mediaelement-to-play-video-from-stream – 2013-02-06 11:53:01

回答

0

美妙的Vlc.DotNet库有助于此 - 更多的开销,但集成了VLC流功能与WPF来实现您的目标。对于大多数项目类型还有其他选项。

Check it out here