VLC Web interface + Java (seek)

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
rsande
New Cone
New Cone
Posts: 6
Joined: 06 Nov 2006 20:09

VLC Web interface + Java (seek)

Postby rsande » 06 Nov 2006 20:18

Hey guys...I'm trying to make a VLC remote that is laptop as well as PDA friendly. (preview available here)

The only thing I'm lacking at this point is how to seek with the javascript commands. As you can see from that page, the letters D - K are used to seek 60, 10, or 5 seconds forward and back.

However, they are using the old ?control=seek option, rather than a javascript:seek option. The only javascript command I could find in the functions.js page was to seek to a particular time, rather than a relative time.

Does anyone know how to do this? Or how to write a new function to do this?

Thanks

P.S. I'm making this for VLC on Mac and Windows, to be used on Mac, Windows, and WM2003SE (when I figure out js support). Currently running VLC 0.8.5

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 06 Nov 2006 20:54

i think that you can use +<value> or -<value> to do relative seeks.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

rsande
New Cone
New Cone
Posts: 6
Joined: 06 Nov 2006 20:09

Postby rsande » 06 Nov 2006 21:28

as in this?

Code: Select all

javascript:seek(%2B60); javascript:seek(+60);
because I tried that and it did nothing.

I also tried the seek( val, is_relative ) method of:

Code: Select all

javascript:seek(60,true); javascript:seek(60,1);
(I tried both of those)

And I still can't figure this out :(

P.S. I updated my keyboard image on my webpage

rsande
New Cone
New Cone
Posts: 6
Joined: 06 Nov 2006 20:09

Postby rsande » 08 Nov 2006 21:22

Any suggestions or corrections to this? Or maybe a new function to put in my functions.js?

All help is appreciated. If anyone wants a copy of the http interface once it is completed, I'm more than happy to share.

neilfred
New Cone
New Cone
Posts: 7
Joined: 31 Dec 2006 22:17

Postby neilfred » 31 Dec 2006 22:25

I just upgraded to 0.8.6 from 0.8.4 and I like the new javascript http interface, but I miss the relative seeking too. I've figured out how to do it -- you need to double-escape the plus, i.e. use

Code: Select all

javascript:seek('%252B60');
to send '+60'.

Your keyboard interface looks pretty handy -- I'd like to try it out...

rsande
New Cone
New Cone
Posts: 6
Joined: 06 Nov 2006 20:09

Still can't get it

Postby rsande » 12 Jan 2007 05:25

Alright, so I'm back at it again, after nearly losing my code to a windows reinstall, and an update to my mac. Thankfully, I was installing windows to a new HD, so I still had it :)

Edit: Oh, and I tried that "javascript:seek('%252B60');" and it didn't like me... :(

I wrote a couple new JS functions:
function seekUp( pos )

Code: Select all

{ loadXMLDoc( 'requests/status.xml?command=seek&val=%2B"+pos, parse_status ); } function seekDown( pos ) { loadXMLDoc( 'requests/status.xml?command=seek&val=-"+pos, parse_status ); }
I try using these links in my browser: http://myip:8080/requests/status.xml?co ... &val=%2B40 and it works! But...when I try using the javascript:seekUp(5); then it does absolutely nothing, no sign that it even registers.

Any suggestions? Is there some other place I have to declare these functions? Thanks in advance

P.S. Once I get this working, I'll post a copy of my modifications, and the keyboard image, in case anyone wants it :) or if you want to include it in the default interface! :D [/code]

neilfred
New Cone
New Cone
Posts: 7
Joined: 31 Dec 2006 22:17

Postby neilfred » 12 Jan 2007 06:34

Here's what I've added to share/http/dialogs/main and share/http/js/functions.js --

Code: Select all

--- dialogs/main.bak 2006-12-10 04:35:52.000000000 -0800 +++ dialogs/main 2006-12-31 17:25:58.000000000 -0800 @@ -95,6 +95,19 @@ <span class="btn_text">Increase Volume</span> </button> </div> + <div style="margin:5px;"> + <input type="button" value="-10m" onclick="box_seek('-10m');"/> + <input type="button" value="-1m" onclick="box_seek('-1m');"/> + <input type="button" value="-10s" onclick="box_seek('-10s');"/> + <input type="button" value="+10s" onclick="box_seek('+10s');"/> + <input type="button" value="+1m" onclick="box_seek('+1m');"/> + <input type="button" value="+10m" onclick="box_seek('+10m');"/> + </div> + <div style="margin:5px;"> + <input type="text" size="6" id="seek_val" onkeypress="if( event.keyCode == 13 ) box_seek();" /> + <input type="button" value="seek" onclick="box_seek();"/> + <span style="font-size:67%;">( e.g. "-20sec", "12m42s", "01:13:43", "-12%" ... )</span> + </div> <div id="status"> <span id="state">(?)</span> -

Code: Select all

--- js/functions.js.bak 2006-12-10 04:35:52.000000000 -0800 +++ js/functions.js 2007-01-11 21:18:08.000000000 -0800 @@ -1054,3 +1054,10 @@ setTimeout( 'loop_refresh_playlist()', 1 ); } + +function box_seek(seek_val) +{ + if (!seek_val) { seek_val = value('seek_val'); } + seek(seek_val.replace('+','%2B')); +} +
I'm pretty happy with it.

rsande
New Cone
New Cone
Posts: 6
Joined: 06 Nov 2006 20:09

Postby rsande » 12 Jan 2007 09:13

Here's what I've added to share/http/dialogs/main and share/http/js/functions.js --

I'm pretty happy with it.
Well, thanks a lot for the seek_box script, I'm not sure why the seek script itself wouldn't work for me, but I got your's working fine!

As promised, here is a link to my finished code. Sample page, keyboard image.
Key modifications:
1. Adding the images/kbd.png file and including it in index.html
2. Adding extensively borrowed code (thanks mwinter of dynamicdrive.com) to make the keyboard work like the picture shows
3. Adding AREA MAP to keyboard, so clicking does the same (for PDAs)
4. Adding a simple "Add File to Playlist" box

airdrummer
Blank Cone
Blank Cone
Posts: 41
Joined: 01 Dec 2003 17:06
VLC version: 2.1.5,2.1.4
Operating System: osx,linux
Location: no.va, the new dominion;-)

Re: VLC Web interface + Java (seek)

Postby airdrummer » 21 Nov 2007 03:25

i just tried neilfred's hacks, but they don't seem 2 work 4 me (0.8.6d preview)

airdrummer
Blank Cone
Blank Cone
Posts: 41
Joined: 01 Dec 2003 17:06
VLC version: 2.1.5,2.1.4
Operating System: osx,linux
Location: no.va, the new dominion;-)

re: neilfred's not working...

Postby airdrummer » 21 Nov 2007 21:32

not 4 m2t transport streams; it does work 4 mpgs...sure wish i could get vlc to work like virtualDVHS does...

airdrummer
Blank Cone
Blank Cone
Posts: 41
Joined: 01 Dec 2003 17:06
VLC version: 2.1.5,2.1.4
Operating System: osx,linux
Location: no.va, the new dominion;-)

Re:m2t seek

Postby airdrummer » 22 Nov 2007 01:50

ah, +/-% works:-)


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 9 guests