# Flash in Midori browser?



## paulfxh (Feb 1, 2011)

I'm running 8.2 RC2 on a Dell E520.
Getting Flash to work in Opera 11 was very easy by merely following the steps in this post.
However, I have not had the same success with the Midori browser.
What I have done is essentially to follow step #2 in this post.
So, after installing flashplugin-mozilla from ports, I ran this command in a terminal:

```
export MOZ_PLUGIN_PATH="/usr/local/lib/browser_plugins/flashplugin-mozilla/"
```
.
Then I launched Midori from the same terminal and it worked fine, until I tried to launch a Youtube video.
This caused Midori to crash and the following was output on the terminal:


```
NP_Initialize
** (midori:9864): DEBUG: NP_Initialize
** (midori:9864): DEBUG: NP_Initialize succeeded
NP_Initialize
New
SetWindow
SetWindow
SetWindow
The program 'midori' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 26 error_code 3 request_code 3 minor_code 0)
```

OK, as flash works fine in Opera for me, I decided to try Midori with the same flashplayer that works well in Opera.
So, I ran the following command:

```
export MOZ_PLUGIN_PATH="/usr/local/lib/npapi/symlinks/linux-opera"
```
I then launched Midori from the same terminal and tried Youtube again.
However, Midori again crashed with the following output:

```
NP_Initialize
** (midori:25600): DEBUG: NP_Initialize
** (midori:25600): DEBUG: NP_Initialize succeeded
New
SetWindow
SetWindow
The program 'midori' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 24 error_code 3 request_code 3 minor_code 0)
```
Now, the Midori xfce FAQ includes this:


> Q.  Flash is crashing all the time
> A.  Try searching for a package named nspluginwrapper or similar in your distribution repositories. It implements plugins in their own process so they can't drag down the whole browser.


However, in the first link above, the Opera guy states that "nspluginwrapper is not needed to run Flash in Opera".
Is it , however, necessary for Midori?
I have seen one post to this forum where a user claimed to be using Midori with "configured flash". However, no details are presented.
Any clues?


----------



## wblock@ (Feb 1, 2011)

Flash works in Midori for me.  I did nothing extra to set it up, just had it working in Firefox as per the Handbook procedure first.  No shell variables.

Also, your first shell variable is not for the correct plugin anyway.


----------



## paulfxh (Feb 1, 2011)

Thanks for the reply.
I don't normally use Firefox but, after your post, I installed it and went through the flashplayer installation as detailed in the handook.
Certainly the flashplayer is listed in AboutPlugins.
However, when I try to play Youtube videos in Firefox 3.6, I get messages of the following type:

```
LoadPlugin: failed to initialize shared library /usr/home/paul/.mozilla/plugins/libflashplayer.so [Shared object "libm.so.6" not found, 
required by "libflashplayer.so"]
```
All of the so-called missing libraries are actually present in /usr/compat/linux/lib and I have been able to overcome each individual missing library by symlinking the existing library to /usr/local/lib/ such as

```
# ln -s /usr/compat/linux/lib/libm.so.6 /usr/local/lib/
```
Then I fire up firefox again and get a simlar error but for a different library.
Seems there's a PATH problem but, if so, I'm surprised it's not mentioned in the handbook.
Can you see where else I might be slipping up?


----------



## wblock@ (Feb 1, 2011)

paulfxh said:
			
		

> I don't normally use Firefox but, after your post, I installed it and went through the flashplayer installation as detailed in the handook.
> Certainly the flashplayer is listed in AboutPlugins.
> However, when I try to play Youtube videos in Firefox 3.6, I get messages of the following type:
> 
> ...



Do you have Linux emulation enabled in /etc/rc.conf and linproc mounted in /etc/fstab?



> and I have been able to overcome each individual missing library by symlinking the existing library to /usr/local/lib/ such as



Likely that's not a good idea.


----------



## DutchDaemon (Feb 2, 2011)

You should really not link into or out of a compat library directory to/from the 'host system'.


----------



## paulfxh (Feb 2, 2011)

Thank you for the replies and comments/advice.
Yes, I have linux emulation enabled and linprocfs is mounted from /etc/fstab.
I've been reading the handbook about Linux emulation and have tried to follow what it recommends when library problems occur.
I also have Ubuntu installed on the same Dell E520 where I have FreeBSD, so I looked at the output from "ldd libflashplayer.so" in Ubuntu.
However, when I tried the same command in FreeBSD, this is the output I got:

```
ldd: /usr/home/paul/.mozilla/plugins/libflashplayer.so: not a FreeBSD ELF shared object
```
What does this mean and how do I get around it?
Nevertheless, when I "manually" compare the dependency requirements of Flash in Linux with what's available in /usr/compat/linux/lib or /usr/compat/linux/usr/lib/ in FreeBSD, everything seems to be available, but, for some reason, it seems that a small number of libraries (perhaps six out of a total of 50-60) are not being found.
Perhaps they are corrupted although I admit that doesn't seem very likely.
Nevertheless, I intend to copy the equivalent files over from Ubuntu into FreeBSD before trying again.
I'd welcome any comments as I'm sailing in uncharted territory here.


----------



## DutchDaemon (Feb 2, 2011)

The Linux layer is Fedora, not Ubuntu, so it's probably not a good idea to 'copy things over' just like that. Maybe run a recursive force-install of the flashplayer port? Your Linux emulation/compat layer looks screwed.


----------



## wblock@ (Feb 2, 2011)

paulfxh said:
			
		

> ```
> ldd: /usr/home/paul/.mozilla/plugins/libflashplayer.so: not a FreeBSD ELF shared object
> ```
> What does this mean and how do I get around it?



It may mean you haven't used nspluginwrapper, and possibly also that you have the ancient www/flashplugin-mozilla installed, which should not be used and interferes with the correct www/linux-f10-flashplugin10.


```
% ls .mozilla/plugins
npwrapper.libflashplayer.so
```


----------



## paulfxh (Feb 2, 2011)

Thank you for both replies.

Yes, it seems like moving those libs over from Ubuntu (13 from /usr/lib/ and 2 from /lib) to /usr/compat/linux/usr/lib/ or /usr/compat/linux/lib was not a good idea as Firefox and Midori still refuse to show flash videos. Not only that but Opera, which was working fine with flash, now won't open at all.

From a terminal it gives this message:


```
/usr/local/lib/linux-opera/opera: /lib/libc.so.6: version `GLIBC_2.11' not found (required by /usr/lib/libfreetype.so.6)
```

I tried to re-install the shared linux libraries as outlined here in the handbook, but this section seems to be very outdated so it was of no use to me.

I am very willing, indeed anxious, to "run a recursive force-install of the flashplayer port" as was suggested. However, I can find nothing in man install that refers to either "recursive" or "force". Would be grateful for a few hints on how to do this.

I did install nspluginwrapper as I followed the instructions on this handbook page to get flash working in Firefox 3.6. However, for reasons I don't quite remember, I did also install flashplugin-mozilla.

So, although I did have npwrapper.libflashplayer.so installed it was located in /usr/local/lib/browser_plugins rather than in ~/.mozilla/plugins. However, even when I copied from one location to this latter, Firefox still cannot use flash and gives the following terminal output when I try to open a Youtube video:


```
LoadPlugin: failed to initialize shared library /usr/home/paul/.mozilla/plugins/libflashplayer.so [Shared object "libfreetype.so.6" not found, 
required by "libflashplayer.so"]
/usr/local/lib/nspluginwrapper/i386/linux/npviewer.bin: /lib/libc.so.6: version `GLIBC_2.11' not found (required by /usr/lib/libfreetype.so.6)
```

I think this just confirms again that my Linux compat libraries are truly messed up. Next step may be to use the recursive force-install suggested above or to just remove the /usr/compat/ directory  and reinstall everything.


----------



## wblock@ (Feb 2, 2011)

paulfxh said:
			
		

> I did install nspluginwrapper as I followed the instructions on this handbook page to get flash working in Firefox 3.6.
> However, for reasons I don't quite remember, I did also install flashplugin-mozilla.



Remove flashplugin-mozilla, it's worse than useless.



> So, although I did have npwrapper.libflashplayer.so installed it was located in /usr/local/lib/browser_plugins rather than in ~/.mozilla/plugins
> However, even when I copied from one location to this latter,



Please, stop copying things.  There should not be one in browser_plugins unless you ran nspluginwrapper as root.  Don't do that.



> I think this just confirms again that my Linux compat libraries are truly messed up.



It's worse than that, all those Linux libraries are symlinked in as FreeBSD libraries.  You need to remove all of those links, and undo anything else that wasn't done as the Handbook Flash procedure shows.  Then it may be necessary to delete all the linux-f10 packages and reinstall them.  Then rebuild linux-f10-flashplugin10, then finally, run nspluginwrapper as your normal user.


----------



## paulfxh (Feb 2, 2011)

Thank you again.
Well, I did exactly as you outlined in the last post and things are looking better...but not perfect.
Linux-opera is now working perfectly again with Flash.
Firefox runs without any library-related errors when I call up a Youtube video, but the video doesn't run and advises upgrading the flashplayer.
Now, there is no npwrapper.libflashplayer.so anwhere although I did run nspluginwrapper.
Here's the output I got when I ran it (as user):

```
$ nspluginwrapper -v -a -i
Auto-install plugins from /usr/local/lib/browser_plugins
Looking for plugins in /usr/local/lib/browser_plugins
Install plugin /usr/local/lib/browser_plugins/libflashplayer.so
Auto-install plugins from /home/paul/.mozilla/plugins
Looking for plugins in /home/paul/.mozilla/plugins
```
Seems, it was looking for stuff in ~/.mozilla/plugins/ but didn't find anything it was interested in.
Although there is no flashplayer plugin in there, I do have libjavaplugin_oji.so.
Additionally, aboutplugins shows no plugins at all other than the default plugin.
So, I'm at a loss to know what I've left out as I've checked it many times.


----------



## wblock@ (Feb 2, 2011)

/usr/local/lib/browser_plugins should have

```
libflashplayer.so -> /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so
```
A Java plugin may be there also, but doesn't matter to Flash.

In your user's .mozilla/plugins/:

```
npwrapper.libflashplayer.so
```

Under 32-bit 8.2, mine is 97276 bytes.  You can remove and re-create the nspluginwrapper file:
`% nspluginwrapper -a -r`
`% nspluginwrapper -a -i`

Beyond that, I think it all just depends on the linux_base stuff.  Make sure you don't have any Linux libraries symlinked anywhere outside of /compat/linux.


----------



## paulfxh (Feb 3, 2011)

Thanks for the reply.
I tried your suggestions but still no flash in Firefox or Midori.
Strangely, nspluginwrapper as user does NOT produce any npwrapper.libflashplayer.so anywhere.
The only way, I could create it was to run nsplugin wrapper as root.
However, even then, it forms only in /usr/local/lib/browser_plugins/ and no symlinks are created.
Now, I tried to manually produce a symlink to ~/.mozilla/plugins from /usr/local/lib/browser_plugins/npwrapper.libflashplayer.so. Indeed, a link was formed but proved to be broken although I have no idea why.
Actually, the java symlink in the same location was also broken.
It seems that Firefox, and possibly more, has been mortally wounded. I have therefore deinstalled both it and all of the flash related stuff and I'm now in the process of rebuidling everything.
If this doesn't solve the problem, I'll do a clean install of the 8.2 Release when it becomes available.
Thanks for your help and comments. Even though I didn't solve the problem, I learnt a lot.

Edit: No improvement after reinstalling firefox and all the associated flash and linux-f10 stuff. Looks like I have some infrastructural issues that I'll take care of with a clean install whenever the release becomes available.
In the meantime, everything is working fine including Opera + Flash, the only exception being flash in Firefox and Midori

Edit#2: I actually got flash working fine in both Firefox and Midori by --yes, I know you don't like me copying things--  copying npwrapper.libflashplayer.so from /usr/local/lib/browser_plugins/ to ~/.mozilla/plugins.
Once copied, it showed up in aboutplugins and flash works fine.


----------

