3

Maybe it is just late, but I ran into a dead end, hoping someone can help me out.

I have a very simple program which is supposed to work like this: The user can see a list of available streams. The user picks a stream to watch. After picking a stream I then want to launch VLC media player for them and play it.

I have everything in order except from one last thing - I don't know how to make the player play the stream. I assumed it would just be something like this:

System.Diagnostics.Process.Start(pathVLC, streams[choice]);

where
PathVLC is the path to the users player, for example C:\Programs\VLC\vlc.exe
streams is an array of strings, all on the form "http://somerandomstream.m3u8"
choice is the stream the user wanted to see.

While VLC opens successfully, nothing else happens, and I am completely lost on how to actually tell VLC to play the stream. What am I missing?

Edit: Looking at Vaughan Hilts answer I figured it out!

System.Diagnostics.Process VLC = new System.Diagnostics.Process();
            VLC.StartInfo.FileName = pathVLC;
            VLC.StartInfo.Arguments = "-vvv " + streams[choice];
            VLC.Start();
Treeline
  • 475
  • 1
  • 8
  • 23

2 Answers2

1

You'll be required to start it up from the command line like so:

 vlc -vvv http://www.example.org/your_file.mpg

This means you will need to pass in the -vvv flags as well in your array to succesfully start the stream.

Vaughan Hilts
  • 2,839
  • 1
  • 20
  • 39
0

I would start from inspecting supported command-line arguments e.g. here

Borys Generalov
  • 2,255
  • 17
  • 19