play movie with vlc

Just starting out? Need help? Post your questions and find answers here.
jak64
Enthusiast
Enthusiast
Posts: 625
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

play movie with vlc

Post by jak64 »

Hello,
I would like to automatically start playing a movie with VLC by clicking on the movie title displayed in a ListViewGadget.

Is it possible?

Thank you for your help
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Re: play movie with vlc

Post by RASHAD »

Use VLC Command Line with Runprogram()
Google for vlc command line
Egypt my love
jak64
Enthusiast
Enthusiast
Posts: 625
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: play movie with vlc

Post by jak64 »

Thank you,
I know how to launch the VLC program but I don't know how to pass the title of the film to it !
KianV
User
User
Posts: 16
Joined: Thu Dec 26, 2019 3:31 pm

Re: play movie with vlc

Post by KianV »

The 'RunProgram' command is what you need.
Something of the form:
RunProgram("vlc","path to filename","")

This works as on my Linux setup as is, but you may have to adjust things for another OS.
For example, if VLC is not included in your PATH, you may have to provide the full path to the executable.
Last edited by KianV on Wed Feb 09, 2022 3:12 pm, edited 1 time in total.
infratec
Always Here
Always Here
Posts: 7618
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: play movie with vlc

Post by infratec »

jak64
Enthusiast
Enthusiast
Posts: 625
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: play movie with vlc

Post by jak64 »

Thank you,
It works if there is no space in the title

Code: Select all

RunProgram("vlc","D:\test\Alice.avi","")
But it doesn't work with this title, there are error messages

Code: Select all

RunProgram("vlc","D:\test\Alice 1.avi","")
Of course I changed the title of the movie on disk D from "Alice.avi" to "Alice 1.avi"
infratec
Always Here
Always Here
Posts: 7618
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: play movie with vlc

Post by infratec »

Maybe this works:

Code: Select all

RunProgram("vlc", #DQUOTE$ + "D:\test\Alice 1.avi" + #DQUOTE$,"")
jak64
Enthusiast
Enthusiast
Posts: 625
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: play movie with vlc

Post by jak64 »

SUPER !
It's OK

Thank you very much
Post Reply