From 62d00163a858fa078dff5a99a4aed5951500c5da Mon Sep 17 00:00:00 2001 From: michal1106 Date: Mon, 25 Apr 2016 16:45:56 +0300 Subject: [PATCH 1/2] Update using-pepper-flash-plugin.md --- docs/tutorial/using-pepper-flash-plugin.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/tutorial/using-pepper-flash-plugin.md b/docs/tutorial/using-pepper-flash-plugin.md index a9918b220ac0..cdb4d04ad082 100644 --- a/docs/tutorial/using-pepper-flash-plugin.md +++ b/docs/tutorial/using-pepper-flash-plugin.md @@ -11,6 +11,9 @@ navigating to `chrome://plugins` in the Chrome browser. Its location and version are useful for Electron's Pepper Flash support. You can also copy it to another location. +_**Attention:** On windows, Pepper Flash plugin is win32 and it won't work with Electron x64 version. +
Get win32 version from [Electron Releases](https://github.com/electron/electron/releases)_ + ## Add Electron Switch You can directly add `--ppapi-flash-path` and `ppapi-flash-version` to the @@ -20,19 +23,20 @@ For example: ```javascript // Specify flash path. -// On Windows, it might be /path/to/pepflashplayer.dll +// On Windows, it might be /path/to/pepflashplayer.dll or just pepflashplayer.dll if it resides main.js // On OS X, /path/to/PepperFlashPlayer.plugin // On Linux, /path/to/libpepflashplayer.so app.commandLine.appendSwitch('ppapi-flash-path', '/path/to/libpepflashplayer.so'); -// Specify flash version, for example, v17.0.0.169 +// Optional: Specify flash version, for example, v17.0.0.169 app.commandLine.appendSwitch('ppapi-flash-version', '17.0.0.169'); app.on('ready', function() { mainWindow = new BrowserWindow({ 'width': 800, 'height': 600, - 'web-preferences': { + // web-preferences is deprecated. Use webPreferences instead. + 'webPreferences': { 'plugins': true } }); @@ -41,6 +45,8 @@ app.on('ready', function() { }); ``` +_**Attention:** You can check if Flash dll was loaded by running `navigator.plugins` on the Console (although you can't know if the plugin's path is correct)_ + ## Enable Flash Plugin in a `` Tag Add `plugins` attribute to `` tag. From a0c14eed046f9a4c4813be28da4512ccdc49687a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 26 Apr 2016 10:24:43 +0900 Subject: [PATCH 2/2] Revise the using-pepper-flash-plugin.md --- docs/tutorial/using-pepper-flash-plugin.md | 28 ++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/docs/tutorial/using-pepper-flash-plugin.md b/docs/tutorial/using-pepper-flash-plugin.md index cdb4d04ad082..de7c7001cf36 100644 --- a/docs/tutorial/using-pepper-flash-plugin.md +++ b/docs/tutorial/using-pepper-flash-plugin.md @@ -1,6 +1,6 @@ # Using Pepper Flash Plugin -Electron now supports the Pepper Flash plugin. To use the Pepper Flash plugin in +Electron supports the Pepper Flash plugin. To use the Pepper Flash plugin in Electron, you should manually specify the location of the Pepper Flash plugin and then enable it in your application. @@ -11,14 +11,11 @@ navigating to `chrome://plugins` in the Chrome browser. Its location and version are useful for Electron's Pepper Flash support. You can also copy it to another location. -_**Attention:** On windows, Pepper Flash plugin is win32 and it won't work with Electron x64 version. -
Get win32 version from [Electron Releases](https://github.com/electron/electron/releases)_ - ## Add Electron Switch You can directly add `--ppapi-flash-path` and `ppapi-flash-version` to the Electron command line or by using the `app.commandLine.appendSwitch` method -before the app ready event. Also, add the `plugins` switch of `browser-window`. +before the app ready event. Also, turn on `plugins` option of `BrowserWindow`. For example: ```javascript @@ -33,11 +30,10 @@ app.commandLine.appendSwitch('ppapi-flash-version', '17.0.0.169'); app.on('ready', function() { mainWindow = new BrowserWindow({ - 'width': 800, - 'height': 600, - // web-preferences is deprecated. Use webPreferences instead. - 'webPreferences': { - 'plugins': true + width: 800, + height: 600, + webPreferences: { + plugins: true } }); mainWindow.loadURL('file://' + __dirname + '/index.html'); @@ -45,8 +41,6 @@ app.on('ready', function() { }); ``` -_**Attention:** You can check if Flash dll was loaded by running `navigator.plugins` on the Console (although you can't know if the plugin's path is correct)_ - ## Enable Flash Plugin in a `` Tag Add `plugins` attribute to `` tag. @@ -54,3 +48,13 @@ Add `plugins` attribute to `` tag. ```html ``` + +## Troubleshooting + +You can check if Pepper Flash plugin was loaded by inspecting +`navigator.plugins` in the console of devtools (although you can't know if the +plugin's path is correct). + +The architecture of Pepper Flash plugin has to match Electron's one. On Windows, +a common error is to use 32bit version of Flash plugin against 64bit version of +Electron.