Am 09.06.2017 16:49, schrieb James Pearson:
Also, although about:plugins gives the Path as in a user profile
directory (as .../gmp-gmpopenh264/system-installed), it isn't actually
there ... but symlinking or copying the the
'gmp-gmpopenh26/system-installed' contents to the Path given in
about:plugins - and then it does work ...

Found a solution to use also use a system wide directory without having to symlink it into the user profile. The following extended code will add your directory as an additional path where GMP plugins are searched for before setting the preferences:

  Components.utils.import("resource://gre/modules/FileUtils.jsm");
var gmpService = Components.classes["@mozilla.org/gecko-media-plugin-service;1"].getService(Components.interfaces.mozIGeckoMediaPluginChromeService); gmpService.addPluginDirectory(FileUtils.getDir("GreD", ["browser", "plugins", "gmp-gmpopenh264", "system-installed"]).path);
  lockPref("media.gmp-gmpopenh264.autoupdate", false);
  defaultPref("media.gmp-gmpopenh264.enabled", true);
  lockPref("media.gmp-gmpopenh264.version", "system-installed");

Any number of directories can be added via gmpService.addPluginDirectory, and they don't necessarily have to exist. For the files to be found the second last directory name has to match a plugin name and the last directory name has to match the fake version number ("system-installed" in your example).

This also seems to work for the Widevine plugin, but it requires an additional setting:

  lockPref("media.gmp-widevinecdm.autoupdate", false);
  defaultPref("media.gmp-widevinecdm.enabled", true);
  lockPref("media.gmp-widevinecdm.version", "system-installed");
if (! Services.prefs.getBranch("").prefHasUserValue("media.eme.enabled")) {
    pref("media.eme.enabled", true);
  }

Reason: It seems the "media.eme.enabled" preference cannot be a defaultPref, but has to exist in user context (probably because the default value is overwritten later in the Firefox startup) or must be locked.

Now the only remaining question is whether it's legal to redistribute the Widevine plugin that way ;-)


Regards,
--

Ignaz Forster

Landeshauptstadt München
it@M - Dienstleister für Informations- und Telekommunikationstechnik

Geschäftsbereich Werkzeuge und Infrastruktur
Servicebereich Städtische Arbeitsplätze
Serviceteam Limux-Arbeitsplatz
Entwicklung

Büro: Agnes-Pockels-Bogen 21, Raum A2.054, 80992 München
Postanschrift: Agnes-Pockels-Bogen 21, 80992 München

Telefon:   +49 89 233 782218
Fax: +49 89 233 989 782218
E-Mail: [email protected]

Bitte denken Sie an die Umwelt, bevor Sie diese E-Mail ausdrucken. Pro Blatt sparen Sie durchschnittlich 15g Holz, 260ml Wasser, 0,05kWh Strom und 5g CO2.
_______________________________________________
Enterprise mailing list
[email protected]
https://mail.mozilla.org/listinfo/enterprise

To unsubscribe from this list, please visit https://mail.mozilla.org/listinfo/enterprise 
or send an email to [email protected] with a subject of 
"unsubscribe"

Reply via email to