http request

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

http request

Postby CurrySven » 14 Apr 2008 14:43

Hi everybody,

i try to control vlc via http... http://ip:port/requests/status.xml?command=pl_pause

than the vlc is stopping.. thats correct... but the xml file open´s ... what should i have to do, that this not happens...

only the command should be done...

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: http request

Postby revolunet » 14 Apr 2008 15:28

The xml file is the response for your command so it is normal;

if you dont want to have any answer, use a command line 'browser' like wget or w3m
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 15:36

Oh, okay.... then the link or command has to look like????

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: http request

Postby revolunet » 14 Apr 2008 15:43

just use :

Code: Select all

wget http://ip:port/requests/status.xml?command=pl_pause
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 16:07

i thinks its an linux command... so, i use win... I don`t have any ideas... i have to import the content dynamic... the best way is to use a php script.. but i have no ideas....

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: http request

Postby revolunet » 14 Apr 2008 16:10

if you want PHP :

Code: Select all

include("http://ip:port/requests/status.xml?command=pl_pause")

but you can also use wget under windows ;) --> http://pages.interlog.com/~tcharron/wgetwin.html
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 16:14

Yes, but i think the php version is much easier... so, how can i drop a link? for the function pause???

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: http request

Postby revolunet » 14 Apr 2008 16:20

you want the user to click in the interface on a pause button ?

you dont need PHP for that... heres a hint :

Code: Select all

<iframe width=1 height=1 id=VIRTUAL src="about:blank" ></iframe> <button onclick="document.getElementById('VIRTUAL').location='http://ip:port/requests/status.xml?command=pl_pause';">pause</button>
this way the xml is opened in an hidden iframe. you could also use xmlhttprequest
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 16:30

So, i took the code.. but nothing happen... if i type the link manually in the brower, the vlc stop/pause.... where is the problem...

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 16:34

the vlc is running on a different pc

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: http request

Postby revolunet » 14 Apr 2008 16:46

increase iframe width and height to see whats happening and USE FIREBUG

also, there may be a caching issue with firefox, you may need to change :

document.getElementById('VIRTUAL').location='http://ip:port/requests/status.xml?command=pl_pause';

to document.getElementById('VIRTUAL').location='http://ip:port/requests/status.xml?command=pl_pause&r=' + Math.random();
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 17:03

in the iframe does nothing appears.... and firebug is without any mistake.....

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: http request

Postby revolunet » 14 Apr 2008 17:05

check the requests if they are the same that work in the browser directly and then debug
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 17:11

What do you mean... another function???

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 17:12

I also tried another function... if i put the link into the browser... everythink is okay...

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 17:19

At the status window of the vlc does nothing appear....

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: http request

Postby revolunet » 14 Apr 2008 17:25

another way to do it :

add name="VIRTUAL" to the iframe

then try if this works : <a href="http://ip:port/requests/status.xml?command=pl_pause">test</a>

if it works then just add target="VIRTUAL" to the link, this way the link will open in the hidden iframe
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 17:28

So, this works ;-) if i have another question... can i ask you??? Thanks thanks... thanks...

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: http request

Postby revolunet » 14 Apr 2008 17:37

of course you can, but dont forget to think then test then modify then test then think then modify again ;)

documentation and intensive testing is the best to find out solutions ;)
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

CurrySven
Blank Cone
Blank Cone
Posts: 13
Joined: 08 Apr 2008 17:03

Re: http request

Postby CurrySven » 14 Apr 2008 17:44

Yes.. this is a easy way---- but i didn´t think about it


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 3 guests