How can I set the sanpshot name before I use get/setVariable

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
bobbook
New Cone
New Cone
Posts: 6
Joined: 03 Jan 2007 04:43
Location: Taiwan

How can I set the sanpshot name before I use get/setVariable

Postby bobbook » 03 Jan 2007 05:02

I use VLC in html to play video and make a botton to get snapshot.

VLC version is 0.8.5

It is work to play video and get snapshot file in the "My Picture" folder.

But I have a question about the snapshot image name and type.

Can I set the snapshot image name/type before I create it?????

Thanks for answer my question.

Tappen
Cone that earned his stripes
Cone that earned his stripes
Posts: 150
Joined: 30 Oct 2006 07:55

Postby Tappen » 03 Jan 2007 06:29

If you run VLC outside of the web browser, you can set the format in Preferences (Video main page). This will stay when you are running in html. I don't think you can ever set the filename though, it will either have a timestamp or sequential index in the file name.

bobbook
New Cone
New Cone
Posts: 6
Joined: 03 Jan 2007 04:43
Location: Taiwan

Postby bobbook » 03 Jan 2007 08:48

Thanks for your help.

Now I know how to set the image format and folder.

My code

Code: Select all

<SCRIPT language=JScript> function doGo(targetURL) { var options = new Array(":input-repeat=1"); document.vlc.addTarget(targetURL, options, 4+8, -666); }; doGo(http://127.0.0.1/aaa.wmv'); </SCRIPT> <input type="button" value="SNAPSHOT" onclick='var X = document.vlc.getVariable("key-snapshot"); document.vlc.setVariable("key-pressed", X);'>
But is it possiable to setup image format by Javascript?

If I want to use the same page in another PC, it means I have to setup again.

Tappen
Cone that earned his stripes
Cone that earned his stripes
Posts: 150
Joined: 30 Oct 2006 07:55

Postby Tappen » 03 Jan 2007 17:54

There are 3 options you can put in your options array when you add each item to the playlist.

Video snapshot directory (or filename):
--snapshot-path=<string>

Video snapshot file prefix:
--snapshot-prefix=<string>

Video snapshot format:
--snapshot-format={png,jpg}

So you could say

var options = new Array(":input-repeat=1", "--snapshot-path=c:\documents and settings", "--snapshot-prefix=MyPic", "--snapshot-format=jpg");

I'm pretty sure you can go without quotes inside an option string like I did even though c:\documents and settings has a space in it but if that doesn't work try single or double quotes.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 6 guests