How to select a word in the current displayed subtitle?

Discuss your Lua playlist, album art and interface scripts.
pierre_doleans
New Cone
New Cone
Posts: 1
Joined: 29 Dec 2012 23:17
Location: Paris

How to select a word in the current displayed subtitle?

Postby pierre_doleans » 29 Dec 2012 23:46

Hi there,

I wish to write a small extension which would allow the user to get the definition of a word in a subtitle.

If you're not a native english speaker but you're displaying the english subtitle to learn, you can sometimes miss some words, the idea is to be able to get the definition right away to improve your vocabulary while watching your favourite movies!

So basically, the workflow could be :

1 - User pause the movie
2 - User select a word in the current displayed subtitle sentence (with arrows, selection underlined)
3 - User trigger a function by pressing Enter key for example
4 - The function will get the word and look for a definition (for example in a dict file)
5 - Function display the definition on screen
6 - User know a new word (cool!) resume the play, definition disappear

I can figure all the steps except the 2, "user select a word". Is it currently possible to do that with VLC ? If yes what should be the function?

Thanks for your insight!

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How to select a word in the current displayed subtitle?

Postby Jean-Baptiste Kempf » 29 Dec 2012 23:59

So far, this is not possible.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: How to select a word in the current displayed subtitle?

Postby mederi » 30 Dec 2012 15:43

If you can use Subtitler (lite) to play your subtitles, then an actual subtitle is available in subtitle[3] variable. Then just parse the text to locate appropriate word, mark it with html tags "<u>word</u>" (dialog box supports html/css1) or just something like "[ word ]" and put it back in subtitle[3] variable.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: How to select a word in the current displayed subtitle?

Postby mederi » 21 Jan 2013 23:06

Nice solution in a new VLC Extension: Show Me the Meaning


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 10 guests