Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I am trying to control a vlc player from a C# application. The end goal is to stream live TV through a vlc player embeded in a WPF app, however right now I will settle for being able to even open and play it at all. I found the AxAXVLC.AxVLCPlugin2 plugin and have tried using the following code to play a file:

MIDL
axVLCPlugin21.BeginInit();
                axVLCPlugin21.playlist.add(@"C:test.mp4", null, null);
                axVLCPlugin21.playlist.add(@"C:test2.mp4", null, null);
                axVLCPlugin21.playlist.playItem(0);


This does absolutely nothing. If I set the playItem value to 1 it comes up with an error saying vlc needs to shut down. I have tried to find docomentation on the functions but there doesn't seem to be any available. Any help will be appreciated, ideally code examples but pointing me to any websites that will help would be great too.

I just realised I was setting the file paths wrong my bad :) it now plays files i just need to figure out how to stream video live.
Posted
Updated 23-Nov-10 4:08am
v2
Comments
Henry Minute 23-Nov-10 8:26am    
Ah. OK, but you did say that you would settle for 'being able to open and play it at all'. :)

Rather than embedding an ActiveX version, maybe take a look at http://vlcdotnet.codeplex.com/[^] and see if it will suit your needs better.


"Vlc.DotNet libraries provide the audio/video control of VideoLan on WinForm (.Net 2.0) or Windows Presentation Foundation (.Net 3.5)"
 
Share this answer
 
Comments
GenJerDan 26-Apr-11 13:55pm    
%$$^&%$#! This is from last NOVEMBER? Either it has already been solved, or he found something else to do by now.
I think the best option to control any binary component is by using COM. Try to get the Binary object and using the playlist interface, you can do this very easily. :-)

axvlc.dll is the COM dll you must look for.
--
CHEERS!!!
 
Share this answer
 
v2
Have you tried using the Process Class[^]?
 
Share this answer
 
Comments
Neil Cross 23-Nov-10 8:24am    
This doesn't provide methods for controlling vlc player, like pausing and rewinding or choosing a video from the playlist. Also the end goal is to embed it in the player.
Neil Cross 23-Nov-10 8:40am    
Yeah I wasn't clear what I meant was open and play a file specified programatically I dont think just opening it automatically plays it I appreciate your help.
NuttingCDEF 26-Apr-11 8:44am    
VLC has plenty of command line options that I would expect to be sufficient to get it to play from any source, including streaming data - though that probably won't get the pause / rewind control etc.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900