Start mplayer from inside minetest client

User avatar
aldobr
Member
 
Posts: 316
Joined: Sun Nov 25, 2012 05:46

Start mplayer from inside minetest client

by aldobr » Sat May 25, 2013 02:58

I want to make a true radio mod, so i need a way to start and control an instance o mplayer (or vlc, or whatever) from a lua mod running on the server...
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Sat May 25, 2013 03:02

First of all, the program you want to control must support some protocol (sockets, pipes, command line, ...), then you need to use that protocol.
For example, most media players open the file/URL you pass it on the command line in an already running instance, and some also have a --stop command line switch of some sort.
EDIT: Again, this has portability problems, and will only work in singleplayer (how do you expect to control what program runs in the client machine in the case of multiplayer?).
Last edited by kaeza on Sat May 25, 2013 03:03, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Menche
Member
 
Posts: 994
Joined: Sat Jul 02, 2011 00:43

by Menche » Sat May 25, 2013 03:48

Might be more practical to make a music player right in lua. That would actually be necessary if you want to play sounds from the server on clients.
An innocent kitten dies every time you top-post.
I am on the Voxelands Forums more often than here.
Try Voxelands (forked from Minetest 0.3) by darkrose
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 6 guests

cron