# [Howto, sortof] How I got mplayerplug-in working with opera

## Sloden

It took me a couple of hours of eager googling and tinkering to succeed at getting mplayerplug-in working with opera, but hopefully it will help you getting there faster.

Initially I had the following emerged:

```
     www-client/opera-8.50

      net-www/mplayerplug-in-2.80

      www-client/mozilla-launcher-1.42

      net-libs/gecko-sdk-1.7.12-r1
```

Then I went to the mplayerplug-in sourcecode...  

```
#cd /urs/portage/distfiles 

#ls mplayerplug-in* 

mplayerplug-in-2.80.tar.gz 
```

If you at this point can't seem to find the tar-file, do an "emerge mplayerplug-in -avf" to fetch the sources.  

```
#tar -xzvf mplayerplug-in-2.80.tar.gz 

#cd mplayerplug-in/plugingate 

#vim np_entry.cpp
```

Look up lines 108 and 109 - the ones looking like this:  

```
if(aNPNFuncs->size < sizeof(NPNetscapeFuncs))         

      return NPERR_INVALID_FUNCTABLE_ERROR; 
```

These lines more or less tell the plug-in to not work unless the browser is of type mozilla.  You comment them by inserting // in front of each line:  

```
// if(aNPNFuncs->size < sizeof(NPNetscapeFuncs)) 

//   return NPERR_INVALID_FUNCTABLE_ERROR; 
```

It's time to make the new, modified plugin. Exit your editor, and exit the directory:  

```
#cd .. 

#./configure --enable-x --with-gecko-sdk=/usr/lib/gecko-sdk 

#make 

... 

#cp mplayerplug-in.so /opt/opera/lib/opera/plugin/ 

#ln -s /usr/lib/gecko-sdk/lib/libxpcom.so /usr/lib/

```

From terminal run a:

```
$opera -debugplugin

...

opera: [plugin failed ] /opt/opera/lib/opera/plugins/mplayerplug-in.so, libnspr4.so: ...

...

$locate libnspr4.so

/usr/lib/gecko-sdk/lib/libnspr4.so

```

We have found the file we needed, Next we symlink to somewhere opera will find it:

```
#ln -s /usr/lib/gecko-sdk/lib/libnspr4.so /usr/lib/

```

Again I did a:

```
$opera -debugplugin

```

This time opera ended up not finding libplds4.so, so I repeated my previous procedure:

```
ln -s /usr/lib/gecko-sdk/lib/libplds4.so /usr/lib

```

This time it worked.  :Smile:  And I hope it does for you all!

----------

## rwf

Nice post -- thanks for summarizing everything.  Your sequence also works w/ mplayerplug-in-3.11 (one of the Opera developers/testers confirmed this on the opera.linux newsgroup).

----------

## EASYdoor

thanx man, this  was killing me for weeks  :Wink: 

nice and it workd with mplayerplug-in 3.15 also

----------

## pamplemousse

Hello,

I have modified the source and compiled Mplayer plugin. I have made all that Sloden explains. Root can now play videos of Apple trailers in Opera. But a normal user cannot play video. I have looked for permissions of libraries, but there are all executable for normal users. 

Does anybody see where my problem is?

Thanks.

----------

## supie

Hello, I am not a gentoo user yet (I use Ubuntu) but I hope it does not matter. I tried to follow this tutorial, but it somehow fails. I compiled the plugins with sdk 1.7 using gtk2, mplayerplugins3.17 (could this be the problem, should I use the --enable-x option instead - just tried that and it does not work either), removed lines that shoul be removed. It ocmpiled, I moved them to /usr/lib/opera/plugins/ started opera with -debugplugin option, but it did not say anything, so I went to preferences>advanced>content>plugin, hit the find new plugins and opera found all the mplayer plugins and they asociated with many filetypes. However, when I tried to watch same trailers on www.apple.com/trailers, it did not work. There is just a big white rectangle insted of the trailer (with no text "plugin-content" like when no plugins were installed). I do not have mplayer installed, but it should not be a problem, I hope?

----------

## rwf

The plugin invokes mplayer to show/play the video.  Install mplayer on your system.

----------

## supie

Hm, I installed mplayer and it still did not work, so I recompiled mplayer and also installed Merlin - technical preview for Opera 9.0 and it started to work, to my surprise.  But I do not know if it is related to Merlin or recompilation of mplayer.

----------

## Dirkson

I tried the fix, but I get the following:

opera: [plugin failed ] /opt/netscape/plugins/mplayerplug-in.so, /opt/netscape/plugins/mplayerplug-in.so: cannot open shared object file: No such file or directory

I checked, and /opt/netscape/plugins/mplayerplug-in.so is a valid file, so it sounds like the classic "That file is in 64 bits and I don't want to deal with it!" complaint. Any ideas on how to fix this? I'd love an mplayerplug-in-bin, but that doesn't seem to be happening... 

(Pardon if this should be in the amd64 forum. As it's mostly related to this thread, I figured it would make more sense here. I'll move it if need be.)

----------

## pamplemousse

Hello,

I have seen that 3.15 version of MPlayerplug-in is ready for Opera. No more need to link libraries in /usr/lib. But for me, users can still not play videos.

If you install Mplayerplug-in 3.15, don't forget to remove /o/opt/opera/lib/opera/plugin/mplayerplug-in.so before emerging, or you could end with segmentation fault when viewing videos with Opera.

----------

## codergeek42

Moved from Desktop Environments to DT&T.

----------

## Anon5710

Thanks for that guide  :Smile: 

it worked like a charm:)

----------

## zorth

thanks a lot sloden  :Smile: 

thanks to your post, i can finally play videos browsing with opera  :Wink: 

regards.

----------

## gyaresu

 *Dirkson wrote:*   

> I tried the fix, but I get the following:
> 
> opera: [plugin failed ] /opt/netscape/plugins/mplayerplug-in.so, /opt/netscape/plugins/mplayerplug-in.so: cannot open shared object file: No such file or directory
> 
> I checked, and /opt/netscape/plugins/mplayerplug-in.so is a valid file, so it sounds like the classic "That file is in 64 bits and I don't want to deal with it!" complaint. Any ideas on how to fix this? I'd love an mplayerplug-in-bin, but that doesn't seem to be happening... 
> ...

 

Ditto. amd64 here also. path is correct, file is there. opera won't use it.

----------

## rwf

 *gyaresu wrote:*   

> 
> 
> Ditto. amd64 here also. path is correct, file is there. opera won't use it.

 

When you manually compiled it, what were your CFLAGS and CXXFLAGS setting? I suspect it was compiled for your default system. 

```

~% objdump -a /opt/netscape/plugins/mplayerplug-in.so 

/opt/netscape/plugins/mplayerplug-in.so:     file format elf32-i386

/opt/netscape/plugins/mplayerplug-in.so

```

will tell ya.

Maybe try setting CFLAGS (and CXXFLAGS) to -march=i386 when you compile it.

Just a guess.

----------

## Slegge

For AMD64 you need to download the gecko-sdk manualy and extract it to /emul/linux/x86/usr/lib and then compile the plugin using this command

```

./configure --enable-x --with-gecko-sdk=/emul/linux/x86/usr/lib/gecko-sdk/ --enable-x86_64 --x-libraries=/emul/linux/x86/usr/lib32/ 

make       

```

After that you can follow the original post and it should work.

----------

## Riddick

brilliant! Thanks a lot!

----------

