mike arthur dot co dot you kay

the internet is leaking

Konqueror with latest Adobe Flash HOWTO

I agree with Lubos. Flash sucks. However, most of us have or want to use it for things like YouTube or watching badgers.

As you may be aware the latest versions of Flash depend on XEmbed support which Konqueror lacks without various patches to KDELibs and KDEBase which haven’t been applied by my distribution and I couldn’t get working even when I manually patched the necessary parts of KDE myself. I was using the older versions but it appears they have outstanding and actively exploited security holes that they have only fixed in the XEmbed-supporting versions.

Mike needs his YouTube fix without haxors running rife on his box. Who can save him?

KMPlayer to the rescue!

KMPlayer is my media player of choice as it allows you to trivially switch between XINE, MPlayer and GStreamer backends and, as of version 0.10.0, has a nifty backend that allows you to use XEmbed-supporting plugins, including Adobe’s Flash plugin, which can then be embedded in Konqueror to allow Flash to work trivially.

HOWTO:

  1. Install KMPlayer (version 0.10.0c or higher). It is included in all the major distributions I’ve ever used. Ensure it is installed/compiled with the “NPP” backend enabled which allows the playback of Netscape XEmbed plugins (this depends on your distribution).
  2. Run KMPlayer so it creates its config file. Close it. (This step probably isn’t necessary but it won’t do any harm)
  3. Run the following commands:

    kwriteconfig --file kmplayerrc --group "application/x-shockwave-flash" --key player npp
    kwriteconfig --file kmplayerrc --group "application/x-shockwave-flash" --key plugin /usr/lib/flashplugin-nonfree/libflashplayer.so

  4. Change the “libflashplayer.so” section depending on where the Adobe Flash plugin was installed on your distribution. The above example is where it is installed on Gentoo. (People have replied below with where it is stored on various systems. If you can’t find yours, you probably have a locate program installed so trying running “locate libflashplayer.so” for an idea.).
  5. Open Konqueror and click “Settings > Configure Konqueror…”. In the new window navigate to “File Associations” in the left-hand panel and select “application/x-shockwave-flash“. Click the “Embedding” tab and click “Add..“. Select “Embedded MPlayer for KDE” from the new window. If it is not there then you may need to restart KDE or run “kbuildsycoca” from a terminal. Close all the opened windows.
  6. Enjoy a working Flash in Konqueror!

What is wrong? You’re running a x86_64 machine (like me) so the above doesn’t work? Never fear! If you manage to get a 32-bit version of “knpplayer” (the small program that runs the plugins) and install that in your $PATH before the 64-bit version then it will all just work like magic! Note that you’ll need 32-bit versions of the various dependent libraries also (it seems just to be GTK, Cairo, X11 and DBus stuff).

Posted in Software Development

63 Comments »

I tried this little howto, but I don’t have a application/xshockwave file assosiation. I added it manually, but after running kbuildsycoca and restarting konq it’s gone again.

Also running Gentoo here.

Comment by Emil Jacobs — Sunday 30th December, 2007 @ 5:33 pm

Thank you, Mike. :-)

Comment by Marcel — Sunday 30th December, 2007 @ 5:37 pm

Hi Mike,
great to read this. I have tried, it does not seem to work with kubuntu. May be this npp-backend you mentioned is not compiled in. But how to I know this? Is there any way to check?

Comment by Mark — Sunday 30th December, 2007 @ 5:46 pm

tested on sidux and it really works fine!!! Installation path is /usr/lib/mozilla/plugins/
Thank you !!!

Comment by belze — Sunday 30th December, 2007 @ 6:52 pm

kubuntu gutsy:
/usr/lib/flashplugin-nonfree/libflashplayer.so

Comment by Karl Nilsson — Sunday 30th December, 2007 @ 6:56 pm

I don’t have a solution for Konqueror with the latest flash, but I’ve got a link to previous flash versions. http://www.adobe.com/go/tn_14266
Here you will find a 68MB-zip with all previous versions of flash 9 - including the versions for Mac OS and Windows, that is the reason for the big size. You just have to open it, decompress the version you want and install it via the included installer script.

Comment by blueget — Sunday 30th December, 2007 @ 6:57 pm

I’m on Gentoo too, and with the latest nsplugins(3.5.8-r1) and kdelibs(3.5.8-r2) Flash in Konqueror works again.

Comment by Mirko Stocker — Sunday 30th December, 2007 @ 7:11 pm

Hello, I read the same article on why flash sucks. I used this occasion to digg for alternatives and found a GPL’ed java applet that plays ogg vorbis and theora files. I wrote a blog article on how to used this applet:
http://www.unix-ag.uni-kl.de/~fischer/blog/20071230_Ogg_Theora_Applet_instead_of_Flash/

Comment by Thomas F. — Sunday 30th December, 2007 @ 8:46 pm

and where to get “knpplayer”

thx

Comment by Miha — Sunday 30th December, 2007 @ 8:47 pm

It works great, thanks!

In my distribution (Crux) the plugins are installed in /usr/lib/firefox/plugins.

I noticed there is a bug in the file association dialog: the quicksearch textbox doesn’t always work! I typed in shockwave, x-shockwave, flash, and it just doesn’t find anything, but I could find it manually.

Comment by Alan — Sunday 30th December, 2007 @ 8:54 pm

Mark: if the knpplayer backend is installed then “Ice Ape” will show up in the right-click “Play with..” menu.

blueget: I think you didn’t read the post properly, the previous versions have a SERIOUS security flaw so I seriously recommend not installing them.

Thomas: Or you could just directly embed the video and let the media player handle it like is done with WMV or Quicktime videos. You don’t need a silly Java Applet to do that.

Miha: knpplayer is in KMPlayer.

Comment by Mike — Sunday 30th December, 2007 @ 9:44 pm

Kubuntu Gutsy does not seem to have the npp-backend compiled in :-(.

Comment by Claus — Sunday 30th December, 2007 @ 10:23 pm

Doesn’t work for me. First, on kubuntu, the mime type is not application/xshockwave but application/x-shockwave-flash.

Furthermore, the kmplayer simply refuses to play the file, with no error message. I tried this with youtube.

Also, why is this text box so small?

Comment by Level 1 — Sunday 30th December, 2007 @ 11:06 pm

this quick search box searches only for file endings not for the file type

so type in “swf” and it should work ;)

Comment by hunt0r — Sunday 30th December, 2007 @ 11:23 pm

Yeah! Thank you so much! I must admit that I have been using Firefox mostly to sate my YouTube cravings. Now I don’t have to!

Thanks again!

Comment by Rene Horn — Sunday 30th December, 2007 @ 11:44 pm

On ArchLinux the location is /opt/mozilla/lib/plugins/libflashplayer.so
Works perfectly here, thank you so much for this HowTo!

Comment by Army — Monday 31st December, 2007 @ 12:25 am

Thanks for the how-to. But before I did anything Flash works without a glitch in my Konky. I m using Debian Lenny.

Comment by Sid — Monday 31st December, 2007 @ 3:39 am

Hello, thank you, Konqueror works now very well with flash :)

Comment by JAVH — Monday 31st December, 2007 @ 3:48 am

Finally!! Thaank you! It worked like a charm and I can finally get rid of firefox-bin!

I’m a Gentoo user myself, so if you can’t find the xshockwave association, try searching for x-shockwave.

A 32 bit version of knpplayer can be found in a Mandriva 2008 rpm, download one from http://rpm.pbone.net/index.php3/stat/4/idpl/5166082/com/kmplayer-npplayer-0.10.0-0.pre2mdv2008.0.i586.rpm.html . Use anything you want to extract the binary from the rpm (fx, use mc), and you can even replace your distro’s 64bit knpplayer with the 32bit version. It runs just as well on my system (Gentoo x86_64).

Happy New Year everyone!

Comment by Alex — Monday 31st December, 2007 @ 12:26 pm

I’ve tried to use this trick on AMD64 through nspluginwrapper and it doesn’t work. I only get ~1/4 of the animation displayed (the northwestern section)

Comment by Andrei — Monday 31st December, 2007 @ 12:58 pm

Andrei: You can’t use nspluginwrapper, it doesn’t work with this method. You instead need a 32-bit version of KMPlayer’s knpplayer (as mentioned above).

Comment by Mike — Monday 31st December, 2007 @ 1:56 pm

Just to clarify, /usr/lib/mozilla/plugins/libflashplayer.so is just a symb link to /usr/lib/flashplugin-nonfree/libflashplayer.so in sidux, like Karl Nilsson said for kubuntu. I’m guessing Debian has the same

Comment by OP4 Latino — Monday 31st December, 2007 @ 8:12 pm

Does anyone know where I can get a copy of kmplayer with nnp compiled in?

Darn you Ubuntu!

Comment by Level 1 — Monday 31st December, 2007 @ 9:11 pm

To get knpplayer in kubuntu (hardy) I did this:

sudo apt-get build-dep kmplayer
apt-get source kmplayer

cd kmplayer-0.10.0c
vim debian/kmplayer.install
Added the line usr/bin/knpplayer

Compiled the package with the command: debuild -i -us -uc -b

cd ..
sudo dpkg -i kmplayer_0.10.0c-0ubuntu1_i386.deb

Hope this helps!

Comment by Børre Gaup — Monday 31st December, 2007 @ 10:47 pm

Hi there. Happy New Year! :) I executed your instruction exactly, but it still doesn’t work. Embedded mplayer stops at 8% fill of cache.
.xsession-errors shows:
[anesth@maxdata ~]$ mplayer -wid 48452825 -slave -vo xv,sdl,x11 -ao alsa,oss,sdl,arts -framedrop -contrast 0 -brightness 0 -hue 0 -saturation 0 -cache 384 ‘http://youtube.com/player2.swf?v=1′ -identify
MPlayer 1.0rc1-3.4.6 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Celeron(R) CPU 2.53GHz (Family: 15, Model: 4, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.

Playing http://youtube.com/player2.swf?v=1.
Resolving youtube.com for AF_INET6…
Couldn’t resolve name for AF_INET6: youtube.com
Resolving youtube.com for AF_INET…
Connecting to server youtube.com[208.65.153.253]: 80…
Cache size set to 384 KBytes
Cache fill: 9.44% (37105 bytes)
Win32 LoadLibrary failed to load: avisynth.dll, /usr/local/lib/win32/avisynth.dll, /usr/lib/win32/avisynth.dll
libavformat file format detected.
[swf @ 0x861a100]Compressed SWF format not supported
LAVF_header: av_open_input_stream() failed
Found plugin: libcdaudio.so (CD Audio Player 1.2.10).
Found plugin: libtonegen.so (Tone Generator 1.2.10).
Found plugin: libwav.so (Wave Player 1.2.10).
Found plugin: libmikmod.so (MikMod Player 1.2.10).
Found plugin: libwma.so (WMA Player v.1.0.5).
Closing plugin: /usr/local/lib/xmms/Input/libwma.so.
Closing plugin: /usr/local/lib/xmms/Input/libmikmod.so.
Closing plugin: /usr/local/lib/xmms/Input/libwav.so.
Closing plugin: /usr/local/lib/xmms/Input/libtonegen.so.
Closing plugin: /usr/local/lib/xmms/Input/libcdaudio.so.

What’s I am doing wrong?

Comment by anesth — Tuesday 1st January, 2008 @ 1:23 am

If it is trying to use MPlayer you either don’t have KNPPlayer installed (does Ice Ape show up under the “Play With” menu?) or the lines I specified weren’t added to the configuration file correctly, check them again.

Comment by Mike — Tuesday 1st January, 2008 @ 1:53 pm

Just to note, it seems that some flash sites do not work (noticeably flash-game.net).

It seems that the more interactivity a site requires from flash, the less likely it is to work with this workaround.

Comment by Rene Horn — Tuesday 1st January, 2008 @ 11:58 pm

Rene: I just lost several from various dictators on that site, but the keys worked for me. Did have to click on the flash beforehand. Can you give some concrete cases that don’t work?

Comment by Koos Vriezen — Wednesday 2nd January, 2008 @ 7:28 pm

Koos: My favorite game that was featured on that website: http://www.flash-game.net/game/2699/spiderman-city-raid.html

That said, I haven’t really used it extensively.

Comment by Rene Horn — Saturday 5th January, 2008 @ 6:37 am

Yay!
I have flash working in Ubuntu running KDE4! It works even better than Firefox!

Comment by Xtreme Kommander — Saturday 5th January, 2008 @ 3:03 pm

Hmm.. just tried on a fresh kdemod install on arch linux… have flashplugin, konqueror
from kdemod 3.5.8 and kmplayer from arch repos installed…

when i open a youtube page i see the embed kmplayer plugin, but nothing happens….

I can see xine, mplayer, gstreamer and Iceape as playback methods, but all of them
dont seem to work…

Comment by Rasi — Sunday 13th January, 2008 @ 2:08 pm

knpplayer isn’t in my Kubuntu install (its sorta halfway between hardy and gutsy, havn’t finished the dload)

Comment by g2g591 — Monday 14th January, 2008 @ 10:44 pm

Rasi: What architecture? Did you setup the config file?
g2g591: It is part of KMPlayer but I don’t know if Kubuntu compiles it in. If not, there are instructions above to sort that out.

Comment by Mike — Wednesday 16th January, 2008 @ 12:02 am

thank you!

Comment by kirstin — Wednesday 16th January, 2008 @ 11:39 pm

Amazing! The latest Flash plugin in Konq on my amd64 Gentoo! The Mandriva 32-bit binary of knpplayer didn’t work for me (was missing some dynamic libraries) but the one from Debian works. I put it in my /usr/local/bin so that it gets found before the 64-bit one that Portage put in /usr/bin. Marvelous!

Comment by Matt W. — Thursday 17th January, 2008 @ 7:06 am

it works on arch linux.
/opt/mozilla/lib/plugins/libflashplayer.so is the dir for it. one must have the flashplugin package installed. :)

Comment by sveakex — Friday 18th January, 2008 @ 1:09 am

any idea if this is necessary on kde 4?

Comment by g2g591 — Monday 21st January, 2008 @ 11:27 pm

Kubuntu’s packages indeed, do not have the needed backend compiled in. see Borre’s comment about halfway up as a guide

Comment by g2g591 — Tuesday 22nd January, 2008 @ 12:55 am

Did anyone try to use this with an opensource Flash engine e.g. Swfdec or Gnash? That would be more interesting to me, since a) it would be all native 64bit and open.

Comment by Matija "hook" Å uklje — Saturday 26th January, 2008 @ 10:36 pm

Worked great on my Arch Linux installation, using the normal KDE packages.

Thanks a bunch Mike.

Comment by Shahar — Friday 1st February, 2008 @ 8:52 am

Works fine! Thank you very much.

Comment by anderston — Friday 1st February, 2008 @ 6:54 pm

Thanks man! Great to have youtube in konqueror again.

Comment by trupi — Thursday 7th February, 2008 @ 12:10 pm

It looks like this solution will only work for Hardy Heron or later, and those running the actual stable version of Ubuntu are totally stuck until Hardy comes out. SInce the new version flashplugin was just pushed out in an Ubuntu update this morning, I think everyone is royally screwed until Hardy comes of age.

I’m pretty annoyed at this :)

Comment by dbs — Friday 8th February, 2008 @ 5:22 pm

Others seem to have got it working on pre-Hardy. Read up.

Comment by Mike — Friday 8th February, 2008 @ 7:58 pm

Me again :) In Archlinux the patch changed to /usr/lib/mozilla/plugins/libflashplayer.so

Comment by Army — Saturday 9th February, 2008 @ 5:08 pm

Thanks Mike! Tried this solution on a freshly updated Archlinux with KDEMod and it worked perfectly.

-Andrew

Comment by Andrew — Monday 11th February, 2008 @ 5:03 pm

Has anyone figured out how to unbind the single-letter keyboard shortcuts in knpplayer? I want to be able to type in Flash apps in Konqueror, but every time I hit ‘F’, knpplayer goes full screen, and I can find no way to make it go back; I just have to kill the Konqueror tab with Ctrl+W. I have tried “Configured Shortcuts” in KMPlayer, but that doesn’t seem to affect knpplayer.

Comment by Matt W. — Monday 25th February, 2008 @ 3:13 am

Hi @ll:
Like Rasi above, I also see the kmplayer embeded but nothing happens. I can get this message from kmplayer console:

Win32 LoadLibrary failed to load: avisynth.dll, /usr/lib/codecs/avisynth.dll
It seems a mplayer problem, but it`s not well documented, or i haven`t found anything that fix the problem.
Plugins in /usr/lib/browser-plugins/
Any idea?
Running on OpenSuSe 10.2 and KDE 3.5.9
Thx

Comment by ag_z — Wednesday 27th February, 2008 @ 11:34 pm

Hi again:
First of all, thanks to Mike for giving a tip how to solve this.
The matter is that with the kmplayer embeded could find a problem with the mplayer swf visualization, off topic this (something about with codecs). Now i`m working on it.
But with this tip, I`ve found the way to wath swf embeded like kmplayer but using the nsplugin (netscape visualization plugin). Making the same as described in the article above, but using the nsplugin now i can watch swf files in my konqueror.
Thanks again.

Comment by ag_z — Monday 3rd March, 2008 @ 9:42 pm

Hi, in ArchLinux, the location is:

plugin=/usr/lib/mozilla/plugins/libflashplayer.so

Thanks for the information. Now I’ll just use Firefox for gmail. :)

Comment by Denis — Tuesday 4th March, 2008 @ 4:25 am

Thank you very much for the information ^^

Comment by Raist — Saturday 8th March, 2008 @ 11:56 pm

[...] Fuente : mike arthur dot co dot you kay [...]

Pingback by KDE : Flash en Konqueror | Eternal Prisoner — Sunday 9th March, 2008 @ 4:14 pm

Thank you very much for this how-to.
Didn’t work for me at first because I’m using a x64 system , but managed to fix it using a really simple method.
As you pointed out in your original post , x64 require some ia32 libs and the 32bit version of knpplayer.
It’s way easier (in Debian/sid that is) to download the 32bit packages from packages.debian.org and force install them to get the desired result.

What I did:
Download these 2 packages from here:
http://ftp.de.debian.org/debian/pool/main/k/kmplayer/kmplayer-common_0.10.0c-1_i386.deb
http://ftp.de.debian.org/debian/pool/main/k/kmplayer/kmplayer-plugin_0.10.0c-1_i386.deb

Did not bother with kmplayer gui since I use smplayer and kaffeine mostly.

In a terminal as root:
apt-get remove –purge kmplayer*

Go to the directory you downloaded the files and again as root in a terminal window:
dpkg -i –force-all kmplayer*.deb

The rest of mike’s how-to stand as is.

Thank you again mike really appreciated.

Comment by Laz — Friday 21st March, 2008 @ 8:21 am

Thanks man, finally my Debian Etch desktops (with and without etch-backports) have flash again!

badger, badger, badger…

Comment by Martin — Saturday 5th April, 2008 @ 6:23 pm

Thanks for a great Howto. Konqueror truly rocks!

Unfortunately some flash on some websites still doesn’t work. Playing flash on last.fm for example.

Comment by Firas — Thursday 10th April, 2008 @ 9:48 pm

I am using Kubuntu Hardy. When I open the webpage with flash (e.g.youtube) , I get an embedded kmplayer window which won’t play the file. I can choose “play with “Iceape”" from the menu, but to no effect. Has anyone been able to get flash through KMP on Hardy? How?

Thanks!

Comment by Max — Monday 28th April, 2008 @ 8:34 am

That’s wierd… I have got media-video/kmplayer-0.10.0c with “arts cairo gstreamer mplayer npp xine” flags enabled, kde-3.5.9, net-www/netscape-flash-9.0.124.0. I do have Ice Ape in “Play with” menue, but I get nothing but a blanc embedded screen. Flash in Firefox works, however.

Comment by Erik — Monday 12th May, 2008 @ 7:08 pm

If I switch to console, I get followings:

entering gtk_main
windowCreatedEvent
windowCreatedEvent 0×8079cc8
using service org.kde.kmplayer.npplayer-14129 was ‘:1.20′
call /npplayer11.running()
dbusFilter :1.2 org.kde.kmplayer.backend
quit

Comment by Erik — Monday 12th May, 2008 @ 11:00 pm

Thankx bro.. Now my konqueror working for playing Youtube.

Comment by Penjol — Wednesday 28th May, 2008 @ 9:29 pm

A note to all 64-bit users: kmplayer method works for me with konqueror-4.1.2, netscape-flash-9.0.124.0, kmplayer-0.11.0_rc4 and nspluginwrapper-1.0.0. You have to do “nspluginwrapper -v -a -i” first and use npwrapper.libflashplayer.so (in my case it was /usr/lib64/nsbrowser/plugins/npwrapper.libflashplayer.so).
Don’t know if the above works for kde 3.5 with 0.10.0 kmplayer though.

Comment by Erik — Saturday 4th October, 2008 @ 2:09 pm

It worked fine in Slackware 12.1.
Thanks for the nice tutorial.

Comment by n3y — Saturday 11th October, 2008 @ 3:37 pm

In reply to Erik’s comment on 4 October…

You don’t need nspluginwrapper if you put a 32-bit knpplayer in your PATH ahead of the 64-bit one.

I have Flash 10.0.12.36 working in Konqueror 4.1.2 with only KMPlayer 0.11.0_rc4 installed but no nspluginwrapper. Search rpmfind.net for knpplayer, extract the knpplayer binary out of one of the i586 RPMs, and put it in /usr/local/bin, assuming /usr/local/bin is before ${KDEDIR}/bin on your ${PATH}.

Comment by Matt Whitlock — Thursday 16th October, 2008 @ 6:48 pm

Works great with kde4.1.3.
The only downside is that Flash movies that use SSL connections don’t work. At least not for sites with self-signed certificates.
Firefox pops-up the ‘do you accept’ question, where Konqueror doesn’t and fails the connection.

Comment by Henk — Wednesday 3rd December, 2008 @ 10:30 am

Leave a comment

If this is your first comment I will need to manually authorise you. Please be patient and thanks for reading!

Valid XHTML 1.0 Strict Valid CSS 3