Page 1 of 1

libVLC in asp.net application

Posted: 05 May 2009 11:21
by gosalyn
hi everyone,

i want to use libVLC dll in an asp.net 3.5 web application in order to show video over a web browser. is this possible somehow? and can you guys point me to the main steps to do this?

thanks in advance..

Re: libVLC in asp.net application

Posted: 05 May 2009 13:41
by gosalyn
i need your ideas on this because if using libvlc in asp.net is not likely then i need to think of something else. i don't want to use the activex control for certain reasons and i dont want to use the javascript api because writing this in c# will help me in reusability.

thanks again...

Re: libVLC in asp.net application

Posted: 05 May 2009 15:45
by Jean-Baptiste Kempf
YOu can see around 4 bindings to C# on this very forum...

Re: libVLC in asp.net application

Posted: 05 May 2009 15:51
by gosalyn
sorry but i couldn't get what you mean.

Re: libVLC in asp.net application

Posted: 07 May 2009 08:42
by tamiro44
Here 3 out of the 4 bindings:

Marx libvlc Wrapper for 0.9.0 version 0.0.2 (Alpha Release)
viewtopic.php?f=32&t=47385
http://www.2shared.com/file/3586524/6c4 ... apper.html

VideoLan.Interop a .Net libvlc 0.9.x wrapper
viewtopic.php?f=32&t=52021
http://meedios.svn.sourceforge.net/view ... n%200.9.0/

libvlcnet - .NET library based on libvlc
viewtopic.php?f=32&t=58438

Good luck.

Re: libVLC in asp.net application

Posted: 07 May 2009 08:59
by gosalyn
hi tamiro,

I had used the .net wrapper in my c# desktop application and everything works fine. but my requirement is to display a live stream on the web browser. and i tried somethings like using the "vlcusercontrol" inside from a web user control in asp.net. but although i can get the sound, nothing is displayed on the browser. And i'm sure it's not a codec problem since in my desktop application I can get both the sound and the display.

so i was wondering if anyone has somehow used these .net wrappers in an asp.net web page. If i can't get to render the display on the web browser then i'm gonna have to use the activex plugin with javascript in asp.net. And I'm not willing to do so because this will make my application dependent on IE.

thanks again..

Re: libVLC in asp.net application

Posted: 07 May 2009 09:23
by tamiro44
Write here:
1. The string that you give VLC in order to play the stream.
2. VLC's messages.

Maybe someone could help you..

Re: libVLC in asp.net application

Posted: 07 May 2009 09:43
by gosalyn
In my desktop application where everything works fine, i wrote:

VLanControl.VlcUserControl vlcUC = new VLanControl.VlcUserControl();
//here i added vlcUC to the panel on the form
vlcUC.AddToPlayList(@"udp://@239.15.15.1:1234", null, null);
vlcUC.Play();


but when i use these lines inside of a webcontrol in asp.net, i get no exceptions from the .net wrapper code. i debugged it line by line and the code flows as it does in my desktop app. no errors, no exceptions. however i cant get to see the stream on the browser, i just hear it.

Re: libVLC in asp.net application

Posted: 07 May 2009 09:58
by tamiro44
I don't know if this helps you, but you can open IE and play the stream there by
getting the handle like that (Taken from http://www.codeproject.com/KB/audio-vid ... Video.aspx):

Code: Select all

bool bFound = false; IntPtr hwnd = System.IntPtr.Zero; if (!bIELauncheded) { bIELauncheded = true; SHDocVw.ShellWindows SWs = new ShellWindows(); IE = new InternetExplorer(); IE.Visible = true; object o = new object(); IE.Navigate("about:blank", ref o, ref o, ref o, ref o); } IEnumerator windows = new SHDocVw.ShellWindowsClass().GetEnumerator(); while (!bFound && windows.MoveNext()) { if ((windows.Current is SHDocVw.IWebBrowser2) && ((windows.Current as SHDocVw.IWebBrowser2).HWND == IE.HWND)) { ((windows.Current as SHDocVw.IWebBrowser2).Document as IOleWindow).GetWindow(out hwnd); if (IsWindowVisible(hwnd)) { bFound = true; vHandle = hwnd.ToInt32(); break; } } } if (!bFound) { Point pie = new Point(350, 350); IntPtr hIE = Win32.WindowFromPoint(pie); vHandle = hIE.ToInt32(); }

Re: libVLC in asp.net application

Posted: 07 May 2009 13:41
by gosalyn
yeah I know that liquid video project, i did examine it too. but my application needs to be an asp.net web application because displaying video over the browser is just one aspect of the project and there are some other concepts too. so i thought that displaying the video over a browser like liquid video does (like creating an IE page and getting its handle), would be inappropriate on an asp.net project.
thanks again for your help tamiro..