CodingTalking to Linux apps from PHP

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Mikee  
 To:  ALL
34831.1 

I've got an application i've been writing which interacts with iTunes, Winamp and windows media player via PHP COM.

 

Is there a way I can do the same kinda thing from linux? I want to interact with a linux media player of some sort.

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mikee     
34831.2 In reply to 34831.1 
I assume the regular PHP exec() and system() functions are not what you're after?
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Peter (BOUGHTONP)     
34831.3 In reply to 34831.2 
I thought that at first. But I think he wants a framework to talk to app that may already be running rather than just to execute commands.

Might be wrong though.

0/0
 Reply   Quote More 

 From:  Mikee  
 To:  Drew (X3N0PH0N)     
34831.4 In reply to 34831.3 

Naw, you are correct.

 

Basically I just need to interact with media players. With itunes I can do stuff like..

 

(this isnt correct code, just typing..)

 

$itunescom = new COM("Application.iTunes");
$currentTracks = $itunescom->CurrentPlaylist->Tracks;
for ($i=0; $i<$currentTracks->items->count; $i++){
echo $currentTracks->items->item($i)->getName()."<br />";
}

 

if (!empty($_GET["skip"])){
$itunescom->next();
}
if (!empty($_GET["volume"])){
$itunescom->setVolume($_GET["volume"]);
}

 

so I can interact with the media player currently open on the server (infact, as soon as you reference Application.iTunes it'll launch itunes anyway).
I can do with same with winamp and windows media player with a bit of messing around, loading plugins into them.

 

This is great on windows, but I want to be able to do it on linux too. If i can even find one media player that I can talk to it'd be great..

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Drew (X3N0PH0N)     
34831.5 In reply to 34831.3 
Seems like the best route is to identify the primary media applications and check out their API docs to see how they can be controlled?
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Mikee     
34831.6 In reply to 34831.4 

Not really to do with your question, but...

 

What is a good media player for Linux?

 

I want something that can store a library at least. Sure whatever comes with ubuntu is just a pile of shit.


0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  ANT_THOMAS     
34831.7 In reply to 34831.6 
xmms is a nice and simple winamp clone.

0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  Drew (X3N0PH0N)     
34831.8 In reply to 34831.7 
Fantastic. I shall try. I seem to like ubuntu quite a lot. I should use it more.

0/0
 Reply   Quote More 

 From:  Mikee  
 To:  ALL
34831.9 
Amarok appears to be something that i could possibly use. i'll have a look into using that
0/0
 Reply   Quote More 

Reply to All    
 

1–9

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats