Page 1 of 1

Mozilla plugin seek() function

Posted: 24 Jan 2008 12:05
by cs02rm0
Seek doesn't seem to be working in the Mozilla plugin for me?

This is a test case:

Code: Select all

<html> <head> <script type="text/javascript"> function play() { var vlc = document.getElementById('vlc'); vlc.style.display = "block"; setTimeout(function () { vlc.clear_playlist(); vlc.add_item('file:///X:/toby/bbc1.ts'); vlc.play(); }, 0); } function seek() { var vlc = document.getElementById('vlc'); vlc.seek(30, false); } </script> </head> <body> <a href="javascript:play();">play</a><br/> <a href="javascript:seek();">forward</a> <br/><br/> <embed type="application/x-vlc-plugin" width="400" height="300" flex="1" id="vlc" style="display: none"/> </body> </html>
It seems to be calling the function correctly because nothing appears in the error console and the video seems to freeze for a second but no seeking happens.

This is in firefox on Windows XP.

Any suggestions? Thanks.

Re: Mozilla plugin seek() function

Posted: 24 Jan 2008 15:10
by revolunet
seek works for me on mozilla/activex

an exemple (try a local file or mov) : http://vc.revolunet.com

Re: Mozilla plugin seek() function

Posted: 24 Jan 2008 16:24
by cs02rm0
Hmmn. No, seeking with the bar on that page didn't work either. Play/pause/stop were absolutely fine.

I can seek with the test files I have using the VLC desktop application though.

Re: Mozilla plugin seek() function

Posted: 24 Jan 2008 16:29
by revolunet
strange, it works for me with the default .mov in the inputbox at the bottom of the page (batman) no ?

Re: Mozilla plugin seek() function

Posted: 24 Jan 2008 17:00
by cs02rm0
That one doesn't even play for me, that might be the company firewall though.

Re: Mozilla plugin seek() function

Posted: 24 Jan 2008 17:03
by revolunet
i can seek in this file too : http://code.revolunet.com/VLCjs/rambo.mpg

Re: Mozilla plugin seek() function

Posted: 25 Jan 2008 16:53
by cs02rm0
Thanks, that file did work on the test page, but still didn't work in my code. I dug a little deeper and found that the script on the test page didn't use the seek() function but set [vlc object].input.time to a new value - this didn't work on my code until I added the attribute:

Code: Select all

version="VideoLAN.VLCPlugin.2"
Now it works with your test file but not with mine, so I guess it's now a file specific issue and at least my code's correct.

Thanks.

Re: Mozilla plugin seek() function

Posted: 25 Jan 2008 16:56
by revolunet
great news

you should use the new plugin API :
http://wiki.videolan.org/Documentation: ... d_above.29