i-rinat / freshplayerplugin

ppapi2npapi compatibility layer
MIT License
727 stars 52 forks source link

chromium-widevinecdm-plugin #311

Closed nerijus closed 8 years ago

nerijus commented 8 years ago

Is it possible to use with chromium-widevinecdm-plugin (needed for Netflix) instead of flash plugin? I tried a quick diff:

diff --git a/src/config_pepperflash.c b/src/config_pepperflash.c
index 98a7a98..c82e4fc 100644
--- a/src/config_pepperflash.c
+++ b/src/config_pepperflash.c
@@ -36,7 +36,7 @@ const char *pepperflash_path_list[] = {
     "/usr/lib64/chromium-browser/PepperFlash",  // chrome-binary-plugins (Gentoo/Sabayon)
     "/usr/lib/adobe-flashplugin",               // adobe-flashplugin (Ubuntu)
     "/usr/lib/chromium/PepperFlash",            // chromium-pepper-flash (Old Build) (CentOS/Read Hat/Fedora)
-    "/usr/lib64/chromium/PepperFlash",          // chromium-pepper-flash (Old Build) (CentOS/Read Hat/Fedora)
+    "/usr/lib64/chromium",          // chromium-pepper-flash (Old Build) (CentOS/Read Hat/Fedora)
     "/opt/chromium/PepperFlash",                // chromium-pepper-flash (New Build) (CentOS/Read Hat/Fedora)
     "/usr/lib/pepflashplugin-installer",        // pepflashplugin-installer (Ubuntu)
     NULL,
@@ -51,26 +51,25 @@ fpp_config_get_plugin_path_list(void)
 const char *
 fpp_config_get_default_plugin_version(void)
 {
-    return "13.1.2.3";
+    return "1.4.8.824";
 }

 const char *
 fpp_config_get_plugin_name(void)
 {
-    return "Shockwave Flash";
+    return "Widevine Content Decryption Module";
 }

 const char *
 fpp_config_get_default_plugin_descr(void)
 {
-    return "Shockwave Flash 13.1 r2";
+    return "Widevine Content Decryption Module 1.4.8.824";
 }

 const char *
 fpp_config_get_plugin_mime_type(void)
 {
-    return "application/x-shockwave-flash:swf:Shockwave Flash;"
-           "application/futuresplash:spl:FutureSplash Player";
+    return "application/x-ppapi-widevine-cdm::Widevine Content Decryption Module";
 }

 char *
@@ -82,7 +81,7 @@ fpp_config_get_plugin_path(void)
 const char *
 fpp_config_get_plugin_file_name(void)
 {
-    return "libpepflashplayer.so";
+    return "libwidevinecdmadapter.so";
 }

 uintptr_t

Firefox now sees "Widevine Content Decryption Module", but netflix still does not work and complains about WidevineCdm problem.

i-rinat commented 8 years ago

(related issue: #167)

i-rinat commented 8 years ago

It doesn't work that way. HTML5 Encrypted Media Extensions don't use the same plugin interface as Flash does. So even if you add appropriate wrappers for PPB_ContentDecryptor API which libwidevinecdmadapter.so exposes, they are of no use.

Instead, Gecko Media Plugins interface should be used. And there is also no need of PPAPI adapters at all. Another type of adapter is still required, since Firefox and Chrome have different content decryption modules (CDMs) format. But they are similar enough to make it: https://github.com/i-rinat/gmp-widevine

Note, that you'll have to use sufficiently recent Firefox version, patch it, and compile from source. Current approach is to hardcode allowed CDM schemes, so you won't be able to load arbitrary module into mainline Firefox version.

i-rinat commented 8 years ago

As it cannot be implemented in freshplayerplugin at all, I'm putting "wontfix" here.

nerijus commented 8 years ago

Just FYI, https://github.com/i-rinat/gmp-widevine works with FF 45 beta.