1mozplugger(7) Miscellaneous Information Manual mozplugger(7)
2
3
4
6 mozplugger - a streaming multimedia plugin for UNIX mozilla
7
8
10 MozPlugger is a Mozilla plugin which can show many types of multimedia
11 inside your Mozilla. To accomplish this, MozPlugger uses external pro‐
12 grams such as mplayer, xanim, mtv, timidity and tracker.
13
14
16 You can configure mozplugger by changing the file mozpluggerrc which
17 can be located in any of the following directories:
18
19 $MOZPLUGGER_HOME/
20 $HOME/.mozplugger/
21 $HOME/.netscape/
22 $HOME/.mozilla/
23 $HOME/.opera/
24 $MOZILLA_HOME/
25 $OPERA_HOME/
26 /usr/local/netscape/
27 /etc/
28 /usr/local/mozilla/
29 /usr/local/netscape/
30
31 MozPlugger will use the first mozpluggerrc it finds and ignore any oth‐
32 ers. The search order is from top of the list above.
33
34 The format of mozpluggerrc is very simple. The general layout is to
35 have one or more lines describing mime types followed by one or more
36 lines describing commands used to handle those mime types. Lines begin‐
37 ning with # are considered comments and are ignored. Here is a simple
38 example:
39
40 video/mpeg: mpeg: Mpeg video
41 video/quicktime: qt,mov: Mpeg video
42 : xanim +W$window -Zr +q +Ze +f $file
43
44 Each line describing a mime type has three fields:
45
46 mime type : extensions : description
47
48
49 mime type
50 The mime type is the standardized name for the content type you
51 want MozPlugger to handle. This must be the same type as the web
52 server claims the file to be, or MozPlugger will not be used for
53 that file, regardless of the extension. Note: Some web servers
54 incorrectly report the wrong mime type, blame the web server
55 adminstrator not mozplugger.
56
57 extensions
58 This is a comma separated list of extensions that should be
59 associated with this particular mime type. The extensions are
60 only used when a web server does not report what type of file it
61 is, or when loading files directly from disk.
62
63 description
64 This is the description that shows up in about:plugins and in
65 the application preferences section in Mozilla.
66
67
68
69 Lines that describe what command to use for a mime type must begin
70 with a whitespace and have two fields:
71
72 flags : command
73
74
75 flags This is a space separated list of flags associated with the com‐
76 mand and tells mozplugger how to handle this command. See below
77 for further details.
78
79 command
80 This is a command which is sent to /bin/sh when handling this
81 mime type. Mozplugger assumes the command line starts with the
82 name of an application followed by various arguments passed to
83 that application.
84
85
87 When loading, MozPlugger will pass the mozpluggerrc file through m4, a
88 general purpose macro processor (assuming m4 is installed). This pro‐
89 vides the ablity to use macros within mozpluggerrc especially for those
90 commonly used command lines. m4 brings text replacement, parameter sub‐
91 stitution, file inclusion, string manipulation, conditional evaluation,
92 arthemtic expressions, etc to mozpluggerrc. Please see m4 documentation
93 for more details.
94
95
97 When MozPlugger is called from your browser, it looks through the con‐
98 figuration file and finds a matching mime type.
99
100 When a matching mimetype is found, it tries to figure out which command
101 to use. Commands that have the flags loop, embed, noembed, link and
102 fmatch will be rejected if they do not match what is expected from the
103 associated HTML code (see later for details).
104
105 In addition for a command to be choosen the application has to be
106 available. That is, MozPlugger will assume the first word of the com‐
107 mand is the name of an application and search $PATH for that applica‐
108 tion. If that application is not found MozPlugger will skip that com‐
109 mand line.
110
111 Of the commands that remain, Mozplugger looks for the first command
112 that has the stream flag set. If there is not such a command line, Moz‐
113 plugger then downloads the file and picks the first (of the remaining)
114 commands.
115
116
118 Mozplugger supports a JavaScript interface that allows the state of the
119 embedded object (i.e. mozplugger) to be queried from JavaScript. Cur‐
120 rently mozplugger supports the following properties.
121
122 isPlaying
123 This property has the value true if the application that moz‐
124 plugger launched to handle the embedded object is running and
125 false if either no application was launched or that application
126 has now terminated.
127
128
130 If for some reason the embedded object fails to be rendered in the
131 browser, this could be a fault with the application as opposed to Moz‐
132 Plugger. To diagnosis the fault it is suggested that first you make
133 sure that any output from the application will be visible to you by
134 removing the noisy flag (if set in mozpluggerrc).
135
136 Next run the browser from the shell (xterm or equivalent) passing the
137 appropriate browser command line flag to enable output from stdout and
138 stderr to be displayed.
139
140 For example, for firefox the command line string is:
141
142
143 firefox -debug
144
145 This should allow any output from the application to be visible at the
146 shell and hopefully lead to a diagnosis of the fault.
147
148
150 autostart
151 This flag indicates that the command uses the $autostart envi‐
152 ronment variable. That is mozplugger will run the command on the
153 assumption that the command/application will check the value of
154 the $autostart environment variable. If this flag is not present
155 and the HTML code for the embedded object indicates autostart is
156 false, mozplugger will not run the command but instead draw a
157 single start button.
158
159 repeat This flag indicates that the command uses the $repeats environ‐
160 ment variable. That is mozplugger will run the command on the
161 assumption that the command/application will check the value of
162 the $repeats environment variable and perform the repeats. If
163 this flag is not set, mozplugger will perform the required num‐
164 ber of repeats as indicated in the HTML code by calling the com‐
165 mand $repeats times.
166
167 loop This indicates that the command loops forever. If the HTML code
168 for the embedded object indicates don't loop/repeat forever
169 (e.g. the loop attribute is not present or not set to true), the
170 command on this line will not be used.
171
172 stream This indicates that this command can take an url. In this case,
173 the environment variable $file contains the URL of the file to
174 play and the browser does not download it. It is assumed that
175 the command can handle the URL. Note: if a username and pass‐
176 word is required for this URL, the command/application will have
177 to obtain this as it is not passed to it from the browser.
178
179 ignore_errors
180 This flag tells MozPlugger to ignore the exit status of the com‐
181 mand. For example is mozplugger is repeating the command 'n'
182 times and the command exits with an error, normally mozplugger
183 would terminate at this time. With this flag set, mozplugger
184 continues the repeats.
185
186 noisy This flag tells MozPlugger to redirect the stdout and stderr of
187 the command to /dev/null.
188
189 swallow (name)
190 This flag tells mozplugger that the command will open a window
191 with the specified name and that Mozplugger will then move this
192 window inside your browser. If name is prefixed with '=' then
193 mozplugger looks for an exact match with the window name, if the
194 prefix is '~' then mozplugger looks for a case insensitive
195 match, if prefixed with '*' then mozplugger looks for a window
196 name that starts with 'name' and is case insensitive. If none of
197 these prefixes then, mozplugger checks if name occurs anywhere
198 in the window name, but is case sensitive. Note any spaces
199 between the brackets are counted as part of the window name.
200 The window name to use in mozpluggerrc can be obtained by using
201 the utility xprop(). Run the command in question, type "xprop
202 WM_CLASS" at a shell prompt and then click on the application
203 window. In addition any occurance of %f in the name is replaced
204 with the filename being loaded (without path), %p is replaced
205 with the full filename including path.
206
207
208 fmatch (string)
209 This flag defines a command that will be used only if the file‐
210 name or url (i.e. $file) contains 'string'. If 'string' is pre‐
211 fixed with '*' then mozplugger defines a match when the file
212 starts with 'string' (the check is case insensitive). If
213 'string' is prefixed with '%' then mozplugger defines a match
214 when the file ends with 'string' (the check is case insenstive
215 and ignores any parameters at the end of a url {i.e.
216 '?xxx=yyy'}). If none of these prefixes then mozplugger defines
217 a match when the 'string' is found somewhere in the file (but
218 this time match is case sensitive). Note any spaces between the
219 brackets are counted as part of the 'string'.
220
221 nokill This flag tells MozPlugger to not try to kill the command when
222 leaving the page, and to not start the command in a loop. This
223 is normally used for applications that are not swallowed and can
224 play multiple files, such as xmms.
225
226 exits This flag tells MozPlugger that the command will exits straight
227 away and hence does not need to be killed when leaving the page,
228 and to not start the command in a loop. This is normally used
229 for applications that just display an image in the $window and
230 then exit.
231
232 fill This flag tells MozPlugger to maximize a swallowed window.
233
234 maxaspect
235 This flag tells Mozplugger to maximize a swallowed window while
236 keeping the width/height ratio constant.
237
238 controls
239 This flag tells MozPlugger to draw controls and is typically
240 used with audio files to display a controller with the buttons
241 play, pause and stop. Be aware if the embedded object has no
242 sub-window defined within the browser's window (e.g. if the HTML
243 uses the tag hidden = true) then the controls will not appear.
244
245 embed This flags tells Mozplugger to only use this command if the
246 associated HTML refers to an embedded object that is a small
247 part of a HTML page.
248
249 noembed
250 This flags tells Mozplugger to only use this command if the
251 associated HTML refers to a separate window that only contains
252 the object.
253
254 links This flag tells Mozplugger to only use this command for embedded
255 objects that are really links to external applications (such
256 objects typically use the target and href variables to indicate
257 a clickable link). Embedded Quicktime objects sometimes use this
258 mechanism.
259
260 needs_xembed
261 Some applications when embedded requires the Xembed protocol,
262 other applications dont want the Xembed protocol. Add or remove
263 this flag if you find that you cannot move keyboard focus to the
264 embedded window. Curently it appears QT4 based applications
265 require this flag.
266
268 There are some envirnoment variables that control the behaviour of Moz‐
269 plugger.
270
271 MOZPLUGGER_HOME
272 If MOZPLUGGER_HOME is defined, the folder $MOZPLUGGER_HOME is
273 checked for the configuration file mozpluggerrc
274
275 MOZPLUGGER_TMP
276 If MOZPLUGGER_TMP is defined, then any temporary files are
277 placed in $MOZPLUGGER_TMP.
278
279 TMPDIR If MOZPLUGGER_TMP is not defined, but TMPDIR is defined, then
280 any temporary files are placed in $TMPDIR/mozplugger-xxx/ where
281 xxx = PID.
282
283 PATH Mozplugger uses PATH to look for executables
284
285
286 MozPlugger gives some variables to /bin/sh when running the command,
287 these variables are:
288
289
290 $autostart
291 This variable contains 1 or 0. When set to 1 it indicates that
292 the command should start playing/showing the associated media.
293 By default it is 0 if controls flag is present and 1 otherwise,
294 but it is overridden if the associated HTML contains the
295 attribute autostart or autoplay. Command/applications that use
296 this environment variable should also have the autostart flag
297 set.
298
299 $repeats
300 This variable contains how many times the file should be played.
301 By default it is once, but it is overridden if the associated
302 HTML contains the attribute loop, numloop or playcount. Com‐
303 mand/applications which use this environment variable should
304 also have the repeat flag set.
305
306 $window
307 This is the X window Mozilla has given the plugin. This can be
308 used with applications such as MPlayer to display graphics
309 inside the mozilla window. Be aware if the embedded object has
310 no sub-window defined within the browser's window (e.g. if the
311 HTML uses the tag hidden = true) then the variable will have the
312 value zero (null).
313
314 $hexwindow
315 Same as $window except the value is expressed as an hexidecimal
316 string in the form 0xNNNNNN where NNNNNN is the hexadecimal dig‐
317 its.
318
319 $width This is the horizontal resolution in pixels and is taken from
320 the width attribute in the HTML code.
321
322 $height
323 This is the vertical resolution in pixels and is taken from the
324 height attribute in the HTML code.
325
326 $file This is the file to play. If the command has the stream flag
327 set, this variable contains the URL of the file to play. This is
328 taken from the associated HTML code. The value is that of the
329 attribute src, data, href, qtsrc, filename, url or location
330 depending on which is present and whether the <EMBED> or
331 <OBJECT> tag is used. If the stream is not set, this variable
332 contains a local temporary file that the browser has created.
333
334 $fragment
335 This is the part of the original URL that appears after the # if
336 it exists. Sometimes this contains additional information that
337 could be useful for the application e.g. starting page number in
338 a pdf document
339
340 $mimetype
341 This variable contains the mime type of $file.
342
343 $VAR_<parameter_name>
344 All the parameters of the <EMBED> or <OBJECT> tags are made
345 available in mozpluggerrc through environment variables. For
346 example the parameter loop="1" in an <EMBED> tag defines the
347 variable VAR_loop=1.
348
349
351 You have to remove ~/.netscape/plugin-list or ~/.mozilla/firefox/plug‐
352 inreg.dat after changing the configuration, or nothing will happen.
353 This is a Netscape/Mozilla/Firefox bug, not a MozPlugger bug.
354
355 Netscape 3.x will not play anything for <EMBED> tags for which height
356 or width are zero. This too is a Netscape bug.
357
358 Occassionally you may notice some zombie mozplugger-helper processes
359 (defunct), this is not a bug, this is by design. The zombie processes
360 occur when either the application exits or when using nokill flag
361 (without exiting the page with the embedded object). The zombie(s) are
362 reaped when closing the web page containing the associated embedded
363 objects.
364
365 If using behind a non-transparent HTTP proxy, it may be found that the
366 commands using the stream flag do not work. This is because the proxy
367 settings are not passed to the application in the command line. To work
368 around this situation, dont use the stream flag OR edit the mozplug‐
369 gerrc file and passed in necessary proxy setiings via the command line.
370
371 It has been found that certain combinations of browser and embedded
372 application dont allow keyboard focus in the embedded application, if
373 this happens to you try adding or removing the "needs_xembed" flag from
374 the associated command in mozpluggerrc.
375
376
378 Fredrik Hubinette, hubbe@hubbe.net
379 Louis Bavoil, louis@bavoil.net
380 Peter Leese, peter@leese.net
381
382
383
384 2010 Sept 18 mozplugger(7)