EO|RU|EN

GenReS 0.7

Plug-in for Mozilla/Firefox

Requirements

gcc
gxx
gmake
mozilla-dev

Compile

make genres.so

Install

Copy genres.so into a directory plug-ins/.mozilla/plugins/;
Create a subdirectory /.mozilla/genres/slaves/video/;
Place there one of the scripts from slaves/video directory with name corresponding mime-type, "mpeg" for example;
Make symlinks for service of others mime-types;
Restart a browser.

Technical details

The plug-in uses a XEmbed window and in any way does not process events from keyboard and mouse, they simply go directly to a browser. All necessary possible to do through javascript, using standard opportunities which already are in mozilla for elements of HTML documents.
Use NPObject allows to have unlimited number of variables and functions of EMBED object not informing about them in advance.
Depending on mime-type the script "~/.mozilla/genres / <mime-type>" is started.
The plug-in transfers data from a browser to the control script.  The script interprets them, runs a player and transfers to it.
Data from the player through the script are transferred back to the plug-in.
Data between the plug-in and the script are transferred in a format: var=value\n.
Today to the external program are transfered: all parameters of EMBED tag, the identifier of a window for embedding and URL of the document for transformation of relative references to absolute.
When all is ready for display "run=1" is sent to the script.
On a command "run=0" the script should to stop a player and come to the end .
The control script for mplayer is written on perl and as alternative on shell.
The Perl-script demands threads (may be switched off in some linux distribution kits).
Before command "run=1" the script receives values of all parameters of EMBED or OBJECT tag.
Now it understands:
Static parameters
href - url a file or a stream
lowres - parameter for accelerated DCT with low resolution (0-3) .
width - width of a window
loop - repetition of playing (0 or not specified - is infinitely)
fps - frames per second
src - alias for href
Dynamic variables
pause=1 or play=0 - pause playing
pause=0 or play=1 - continue playing
run=1 - run player again if it is terminated (an error or end of file occured)
run=0 - exit mplayer
save - start mencoder instead of mplayer:
save=ask - start recording, plugin will ask user about filename for recording
save=auto - start recording, plugin can ask user only once
When data comes from a player it trasmitted to javascript object properties. If in this moment object method with corresponded name "on<variable-name>" is defined it will be called.

In the directory "example" is a html-document showing video 2048x1536 with scrolling by scrollbars and picture dragging .
It reqires a videofile 'default.avi' or to replace URL in the HTML.

Browser requests a list of accepted mime-types only in the first start after installation of a plug-in, therefore after change of the directory tree with control scripts it is necessary to reinstall the script (to remove genres.so to restart a browser to restore genres.so and again to restart a browser).

TODO

Use mozilla streams with "src" parameter

We can to get data from browser and to tranfer it through a pipe instead to give the url to player