1mozplugger(7)          Miscellaneous Information Manual          mozplugger(7)
2
3
4

NAME

6       mozplugger  -  a  multimedia plugin for UNIX Web browsers that supports
7       the mozilla npapi
8
9

DESCRIPTION

11       MozPlugger is a browser plugin which can show many types of  multimedia
12       inside  your Browser. To accomplish this, MozPlugger uses external pro‐
13       grams such as mplayer, xanim, mtv, timidity and tracker.
14
15

CONFIGURE FILE

17       You can configure mozplugger  by  changing  the  mozpluggerrc  file(s).
18       These  can  be located in any of the following directories depending on
19       the browser:
20
21       For mozilla (and chromium) browsers
22
23            $MOZPLUGGER_HOME/
24            $XDG_CONFIG_HOME/mozplugger/
25            $HOME/.config/mozplugger/
26            $HOME/.mozplugger/
27            $HOME/.mozilla/
28            $MOZILLA_HOME/
29            /etc/
30            /usr/etc/
31            /usr/local/mozilla/
32
33       For netscape browsers
34
35            $MOZPLUGGER_HOME/
36            $XDG_CONFIG_HOME/mozplugger/
37            $HOME/.config/mozplugger/
38            $HOME/.mozplugger/
39            $HOME/.netscape/
40            /etc/
41            /usr/etc/
42            /usr/local/netscape/
43
44       For opera browsers
45
46            $MOZPLUGGER_HOME/
47            $XDG_CONFIG_HOME/mozplugger/
48            $HOME/.config/mozplugger/
49            $HOME/.mozplugger/
50            $HOME/.opera/
51            $OPERA_HOME/
52            /etc/
53            /usr/etc/
54
55
56
57       The command mozplugger-update must be run after installation  and  each
58       time  the  configuration  file  changes  or new helper applications are
59       added to the system or old helper applications removed.
60
61       mozplugger-update will use the first mozpluggerrc it finds  and  ignore
62       any  others  for  each  different  browser installed on the system. The
63       search order is from top of the list above,  but  skipping  places  not
64       applicable  to  the  particular browser that the config is being parsed
65       for. mozplugger-update then caches processed results in  files  located
66       at $XDG_CACHE_HOME/mozplugger/
67
68       The  format of mozpluggerrc is very simple. The file is subdivided into
69       sections. Each section starts with a plugin name and version in  square
70       brackets.  This  represents  a class of mozplugger plugin. The name and
71       version will be displayed as a separate plugin when  viewing  installed
72       plugins  in your browser.  Some java script relies on the name and ver‐
73       sion of a plugin matching some value, hence  the  reason  for  seperate
74       sections  in  mozpluggerrc.   Two brackets are required because m4 pro‐
75       cessing needs to escape the brackets. e.g.
76
77       [[multimedia player @ 10.1]]
78
79       Within each section, the general layout is to have one  or  more  lines
80       describing mime types followed by one or more lines describing commands
81       used to handle those mime types. Lines beginning with # are  considered
82       comments and are ignored. Here is a simple example:
83
84            video/mpeg: mpeg: Mpeg video
85            video/quicktime: qt,mov: Mpeg video
86                 : xanim +W$window -Zr +q +Ze +f $file
87
88       Each line describing a mime type has three fields:
89
90
91       mime type : extensions : description
92
93
94       mime type
95              The  mime type is the standardized name for the content type you
96              want MozPlugger to handle. This must be the same type as the web
97              server claims the file to be, or MozPlugger will not be used for
98              that file, regardless of the extension. Note: Some  web  servers
99              incorrectly  report  the  wrong  mime type, blame the web server
100              adminstrator not mozplugger.
101
102       extensions
103              This is a comma separated list  of  extensions  that  should  be
104              associated  with  this  particular mime type. The extensions are
105              only used when a web server does not report what type of file it
106              is, or when loading files directly from disk.
107
108       description
109              This  is  the  description that shows up in about:plugins and in
110              the application preferences section in Mozilla.
111
112
113
114       Lines that describe what command to use for a mime type must begin
115              with a whitespace and have two fields:
116
117
118              flags : command
119
120
121       flags  This is a space separated list of flags associated with the com‐
122              mand  and tells mozplugger how to handle this command. See below
123              for further details.
124
125       command
126              This is a command which is sent to /bin/sh  when  handling  this
127              mime  type.  Mozplugger assumes the command line starts with the
128              name of an application followed by various arguments  passed  to
129              that application.
130
131

USING M4

133       When  running,  mozplugger-update  it  will  pass the mozpluggerrc file
134       through  m4,  a  general  purpose  macro  processor  (assuming  m4   is
135       installed).  This provides the ablity to use macros within mozpluggerrc
136       especially for those  commonly  used  command  lines.  m4  brings  text
137       replacement,  parameter  substitution, file inclusion, string manipula‐
138       tion, conditional evaluation, arthemtic expressions,  etc  to  mozplug‐
139       gerrc. Please see m4 documentation for more details.
140
141

FINDING THE RIGHT COMMAND

143       When  MozPlugger  is  called  from  your  browser, it looks through the
144       cached processed configuration files and finds a matching mime type.
145
146       When a matching mimetype is found, it tries to figure out which command
147       to  use.  Commands  that  have the flags loop, embed, noembed, link and
148       fmatch will be rejected if they do not match what is expected from  the
149       associated HTML code (see later for details).
150
151       In addition for a command to be chosen the application has to be avail‐
152       able. This will have been checked by mozplugger-update which will  have
153       assumed the first word of the command is the name of an application and
154       search $PATH for that application. If that  application  is  not  found
155       mozplugger-update  will  not  have  cached that in the processed config
156       files.  The output from mozplugger-update will indicate  when  applica‐
157       tions have not been found.
158
159       Of  the  commands  that  remain, Mozplugger looks for the first command
160       that has the stream flag set. If there is not such a command line, Moz‐
161       plugger  then downloads the file and picks the first (of the remaining)
162       commands.
163
164

WORKING WITH JAVA SCRIPT

166       Mozplugger supports a JavaScript interface that allows the state of the
167       embedded  object  (i.e. mozplugger) to be queried from JavaScript. Cur‐
168       rently mozplugger supports the following properties.
169
170       isPlaying
171              This property has the value true if the  application  that  moz‐
172              plugger  launched  to  handle the embedded object is running and
173              false if either no application was launched or that  application
174              has now terminated.
175
176

WHEN IT DOESNT WORK

178       If  for  some  reason  the  embedded object fails to be rendered in the
179       browser, this could be a fault with the application as opposed to  Moz‐
180       Plugger.  To  diagnosis  the  fault it is suggested that first you make
181       sure that any output from the application will be  visible  to  you  by
182       removing the noisy flag (if set in mozpluggerrc).
183
184       Next  run  the browser from the shell (xterm or equivalent) passing the
185       appropriate browser command line flag to enable output from stdout  and
186       stderr to be displayed.
187
188       For example, for firefox the command line string is:
189
190
191       firefox -debug
192
193       This  should allow any output from the application to be visible at the
194       shell and hopefully lead to a diagnosis of the fault.
195
196

FLAGS

198       autostart
199              This flag indicates that the command uses the  $autostart  envi‐
200              ronment variable. That is mozplugger will run the command on the
201              assumption that the command/application will check the value  of
202              the $autostart environment variable. If this flag is not present
203              and the HTML code for the embedded object indicates autostart is
204              false,  mozplugger  will  not run the command but instead draw a
205              single start button.
206
207       repeat This flag indicates that the command uses the $repeats  environ‐
208              ment  variable.  That  is mozplugger will run the command on the
209              assumption that the command/application will check the value  of
210              the  $repeats  environment  variable and perform the repeats. If
211              this flag is not set, mozplugger will perform the required  num‐
212              ber of repeats as indicated in the HTML code by calling the com‐
213              mand $repeats times.
214
215       loop   This indicates that the command loops forever. If the HTML  code
216              for  the  embedded  object  indicates  don't loop/repeat forever
217              (e.g. the loop attribute is not present or not set to true), the
218              command on this line will not be used.
219
220       stream This  indicates that this command can take an url. In this case,
221              the environment variable $file contains the URL of the  file  to
222              play  and  the  browser does not download it. It is assumed that
223              the command can handle the URL.  Note: if a username  and  pass‐
224              word is required for this URL, the command/application will have
225              to obtain this as it is not passed to it from the browser.
226
227       ignore_errors
228              This flag tells MozPlugger to ignore the exit status of the com‐
229              mand.   For  example  is mozplugger is repeating the command 'n'
230              times and the command exits with an error,  normally  mozplugger
231              would  terminate  at  this  time. With this flag set, mozplugger
232              continues the repeats.
233
234       noisy  This flag tells MozPlugger to redirect the stdout and stderr  of
235              the command to /dev/null.
236
237       swallow (name)
238              This  flag  tells mozplugger that the command will open a window
239              with the specified name and that Mozplugger will then move  this
240              window  inside  your browser.  If name is prefixed with '=' then
241              mozplugger looks for an exact match with the window name, if the
242              prefix  is  '~'  then  mozplugger  looks  for a case insensitive
243              match, if prefixed with '*' then mozplugger looks for  a  window
244              name that starts with 'name' and is case insensitive. If none of
245              these prefixes then, mozplugger checks if name  occurs  anywhere
246              in  the  window  name,  but  is  case sensitive. Note any spaces
247              between the brackets are counted as part  of  the  window  name.
248              The  window name to use in mozpluggerrc can be obtained by using
249              the utility xprop(). Run the command in  question,  type  "xprop
250              WM_CLASS"  at  a  shell prompt and then click on the application
251              window. In addition any occurance of %f in the name is  replaced
252              with  the  filename  being loaded (without path), %p is replaced
253              with the full filename including path. Some applications do  not
254              like  to  be swallowed and some window managers do not like win‐
255              dows being managed by mozplugger, so  avoid  using  this  option
256              where possible.
257
258
259       fmatch (string)
260              This  flag defines a command that will be used only if the file‐
261              name or url (i.e. $file) contains 'string'. If 'string' is  pre‐
262              fixed  with  '*'  then  mozplugger defines a match when the file
263              starts  with  'string'  (the  check  is  case  insensitive).  If
264              'string'  is  prefixed  with '%' then mozplugger defines a match
265              when the file ends with 'string' (the check is  case  insenstive
266              and   ignores   any  parameters  at  the  end  of  a  url  {i.e.
267              '?xxx=yyy'}). If none of these prefixes then mozplugger  defines
268              a  match  when  the 'string' is found somewhere in the file (but
269              this time match is case sensitive). Note any spaces between  the
270              brackets are counted as part of the 'string'.
271
272       nokill This  flag  tells MozPlugger to not try to kill the command when
273              leaving the page, and to not start the command in a  loop.  This
274              is normally used for applications that are not swallowed and can
275              play multiple files, such as xmms.
276
277       exits  This flag tells MozPlugger that the command will exits  straight
278              away and hence does not need to be killed when leaving the page,
279              and to not start the command in a loop. This  is  normally  used
280              for  applications  that just display an image in the $window and
281              then exit.
282
283       fill   This flag tells MozPlugger to maximize a swallowed window.
284
285       maxaspect
286              This flag tells Mozplugger to maximize a swallowed window  while
287              keeping the width/height ratio constant.
288
289       controls
290              This  flag  tells  MozPlugger  to draw controls and is typically
291              used with audio files to display a controller with  the  buttons
292              play,  pause  and  stop.  Be aware if the embedded object has no
293              sub-window defined within the browser's window (e.g. if the HTML
294              uses the tag hidden = true) then the controls will not appear.
295
296       embed  This  flags  tells  Mozplugger  to  only use this command if the
297              associated HTML refers to an embedded object  that  is  a  small
298              part of a HTML page.
299
300       noembed
301              This  flags  tells  Mozplugger  to  only use this command if the
302              associated HTML refers to a separate window that  only  contains
303              the object.
304
305       links  This  flag  tells  Mozplugger  to display as a button within the
306              browser and when pressed to run the command without embedding in
307              the browser. This can be used when swallow does not work.
308
309       needs_xembed
310              Some  applications  when  embedded requires the Xembed protocol,
311              other applications don't want the Xembed protocol. Add or remove
312              this flag if you find that you cannot move keyboard focus to the
313              embedded window. Currently it  appears  QT4  based  applications
314              require this flag.
315

ENVIRONMENT VARIABLES

317       There are some envirnoment variables that control the behaviour of Moz‐
318       plugger.
319
320       MOZPLUGGER_HOME
321              If MOZPLUGGER_HOME is defined, the  folder  $MOZPLUGGER_HOME  is
322              checked for the configuration file mozpluggerrc and is also used
323              for the base of storing the results of processing mozpluggerrc
324
325       MOZPLUGGER_TMP
326              If MOZPLUGGER_TMP is defined,   then  any  temporary  files  are
327              placed in $MOZPLUGGER_TMP.
328
329       TMPDIR If  MOZPLUGGER_TMP  is  not defined, but TMPDIR is defined, then
330              any temporary files are placed in $TMPDIR/mozplugger-xxx/  where
331              xxx = PID.
332
333       PATH   mozplugger-update uses PATH to look for executables
334
335
336       MozPlugger gives some variables to /bin/sh when running the command,
337              these variables are:
338
339
340       $autostart
341              This  variable  contains 1 or 0. When set to 1 it indicates that
342              the command should start playing/showing the  associated  media.
343              By  default it is 0 if controls flag is present and 1 otherwise,
344              but it  is  overridden  if  the  associated  HTML  contains  the
345              attribute  autostart or autoplay.  Command/applications that use
346              this environment variable should also have  the  autostart  flag
347              set.
348
349       $repeats
350              This variable contains how many times the file should be played.
351              By default it is once, but it is overridden  if  the  associated
352              HTML  contains  the  attribute loop, numloop or playcount.  Com‐
353              mand/applications which use  this  environment  variable  should
354              also have the repeat flag set.
355
356       $window
357              This  is  the X window Mozilla has given the plugin. This can be
358              used with applications  such  as  MPlayer  to  display  graphics
359              inside  the  mozilla window. Be aware if the embedded object has
360              no sub-window defined within the browser's window (e.g.  if  the
361              HTML uses the tag hidden = true) then the variable will have the
362              value zero (null).
363
364       $hexwindow
365              Same as $window except the value is expressed as an  hexidecimal
366              string in the form 0xNNNNNN where NNNNNN is the hexadecimal dig‐
367              its.
368
369       $width This is the horizontal resolution in pixels and  is  taken  from
370              the width attribute in the HTML code.
371
372       $height
373              This  is the vertical resolution in pixels and is taken from the
374              height attribute in the HTML code.
375
376       $file  This is the file to play.  If the command has  the  stream  flag
377              set, this variable contains the URL of the file to play. This is
378              taken from the associated HTML code. The value is  that  of  the
379              attribute  src,  data,  href,  qtsrc,  filename, url or location
380              depending on  which  is  present  and  whether  the  <EMBED>  or
381              <OBJECT>  tag  is  used. If the stream is not set, this variable
382              contains a local temporary file that the browser has created.
383
384       $fragment
385              This is the part of the original URL that appears after the # if
386              it  exists.  Sometimes this contains additional information that
387              could be useful for the application e.g. starting page number in
388              a pdf document
389
390       $mimetype
391              This variable contains the mime type of $file.
392
393       $VAR_<parameter_name>
394              All  the  parameters  of  the  <EMBED> or <OBJECT> tags are made
395              available in mozpluggerrc through  environment  variables.   For
396              example  the  parameter  loop="1"  in an <EMBED> tag defines the
397              variable VAR_loop=1.
398
399

BUGS

401       You have to run mozplugger-update after changing the configuration,  or
402       nothing will happen.
403
404       Netscape  3.x  will not play anything for <EMBED> tags for which height
405       or width are zero. This too is a Netscape bug.
406
407       Occassionally you may notice some  zombie  mozplugger-helper  processes
408       (defunct),  this  is not a bug, this is by design. The zombie processes
409       occur when either the application  exits  or  when  using  nokill  flag
410       (without  exiting the page with the embedded object). The zombie(s) are
411       reaped when closing the web page  containing  the  associated  embedded
412       objects.
413
414       If  using behind a non-transparent HTTP proxy, it may be found that the
415       commands using the stream flag do not work. This is because  the  proxy
416       settings are not passed to the application in the command line. To work
417       around this situation, don't use the stream flag OR edit  the  mozplug‐
418       gerrc file and passed in necessary proxy setiings via the command line.
419
420       It has been found that certain combinations of browser, embedded appli‐
421       cations and window managers do not play nicely with the  swallow  flag.
422       If  this happens to you first try adding or removing the "needs_xembed"
423       flag from the associated command in mozpluggerrc, if this fails  remove
424       the swallow flag and perhaps use the links flag instead.
425
426

AUTHORS

428       Fredrik Hubinette, author of plugger which mozplugger is a fork of.
429       Louis Bavoil
430       Peter Leese
431
432
433
434                                  2014 Apr 09                    mozplugger(7)
Impressum