VLC Web interface + Java (seek)

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions

VLC Web interface + Java (seek)

Postby rsande on Mon Nov 06, 2006 9:18 pm

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
rsande
New Cone
New Cone
 
Posts: 6
Joined: Mon Nov 06, 2006 9:09 pm

Postby dionoea on Mon Nov 06, 2006 9:54 pm

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)
dionoea
Developer
Developer
 
Posts: 5158
Joined: Thu Dec 04, 2003 12:09 am
Location: Paris, France

Postby rsande on Mon Nov 06, 2006 10:28 pm

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: Mon Nov 06, 2006 9:09 pm

Postby rsande on Wed Nov 08, 2006 10:22 pm

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.
rsande
New Cone
New Cone
 
Posts: 6
Joined: Mon Nov 06, 2006 9:09 pm

Postby neilfred on Sun Dec 31, 2006 11:25 pm

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...
neilfred
New Cone
New Cone
 
Posts: 7
Joined: Sun Dec 31, 2006 11:17 pm

Still can't get it

Postby rsande on Fri Jan 12, 2007 6:25 am

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]
rsande
New Cone
New Cone
 
Posts: 6
Joined: Mon Nov 06, 2006 9:09 pm

Postby neilfred on Fri Jan 12, 2007 7:34 am

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.
neilfred
New Cone
New Cone
 
Posts: 7
Joined: Sun Dec 31, 2006 11:17 pm

Postby rsande on Fri Jan 12, 2007 10:13 am

neilfred wrote: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
rsande
New Cone
New Cone
 
Posts: 6
Joined: Mon Nov 06, 2006 9:09 pm

Re: VLC Web interface + Java (seek)

Postby airdrummer on Wed Nov 21, 2007 4:25 am

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: 19
Joined: Mon Dec 01, 2003 6:06 pm
Location: no.va, the new dominion;-)

re: neilfred's not working...

Postby airdrummer on Wed Nov 21, 2007 10:32 pm

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: 19
Joined: Mon Dec 01, 2003 6:06 pm
Location: no.va, the new dominion;-)

Re:m2t seek

Postby airdrummer on Thu Nov 22, 2007 2:50 am

ah, +/-% works:-)
airdrummer
Blank Cone
Blank Cone
 
Posts: 19
Joined: Mon Dec 01, 2003 6:06 pm
Location: no.va, the new dominion;-)

Re: VLC Web interface + Java (seek)

Postby fred333 on Tue Nov 27, 2007 8:05 pm

Great thread I was looking for the same type of solution. Thanks to everyone.
Love using wireless headphones with my media player!
fred333
New Cone
New Cone
 
Posts: 8
Joined: Wed Nov 21, 2007 12:19 am


Return to Web and scripting

Who is online

Users browsing this forum: No registered users and 5 guests