Page 1 of 1

How to select a word in the current displayed subtitle?

Posted: 29 Dec 2012 23:46
by pierre_doleans
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!

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

Posted: 29 Dec 2012 23:59
by Jean-Baptiste Kempf
So far, this is not possible.

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

Posted: 30 Dec 2012 15:43
by mederi
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.

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

Posted: 21 Jan 2013 23:06
by mederi
Nice solution in a new VLC Extension: Show Me the Meaning