9

I have an element:

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

and I have a stream video:

Stream stream = obj.GetFileStream();

I want to use stream object to source of MediaElement, but default MediaElement use source attribute.

Parag
  • 543
  • 1
  • 8
  • 18
  • you can't set a stream directly. Check out this thread for possible workarounds: http://stackoverflow.com/questions/7117589/using-mediaelement-to-play-video-from-stream – Alex Gelman Jul 21 '12 at 10:39
  • thanks, your're link recommended use BoxedApp – Nguyễn Văn Thắng Jul 21 '12 at 11:03
  • You cannot do it with WPF MediaElement. Have a look here http://stackoverflow.com/questions/7117589/using-mediaelement-to-play-video-from-stream – NoWar Feb 06 '13 at 11:53

2 Answers2

0

The wonderful Vlc.DotNet library helps with this - more overhead but integrates VLC stream capabilities with WPF to achieve your goal. There are other options as well for most project types.

Check it out here

user685590
  • 2,464
  • 5
  • 30
  • 42
0

Currently Vlc.Dotnet support for libvlc 4 is not planned (ref.). You can use Videolan.LibVLC Libraries from this nuget.org library or their code repository.