Missing Codecs in Firefox to Play Video in Gallery2

Every once in awhile, I’ll hit a video on my gallery that requires me to download a codec, but telling it to download fails to find a codec that’ll work. If I copy and paste the URL into IE, the video plays fine. I started searching the Gallery forums.

I found this thread: Combination Gallery 2/AVI/Firefox does not display video, and it appears a lot of people are hitting this issue:

When adding an AVI file to my gallery it is recognized and ffmpeg creates a thumbnail for it. Viewing the item with Internet Explorer will result in the video being displayed.

However this does not work with Firefox. For some reason it seems that the Windows Media Player plugin in firefox does not recognize the video/x-msvideo MIME-type. Check about:plugins and scroll to Windows Media Player to confirm this.

Technically this is not a Gallery problem, but a bug by Microsoft in there Firefox support. However since Microsoft is not very likely to fix this it would be nice if someone could provide a work-around and integrate this into Gallery.

Before, I would just tell every video to use mime type: video/x-ms-wmv, however, Gallery2 supports a wider range of mime types, so I decided to let it do its own thing.

It turns out, to fix this problem, you need to associate video/x-msvideo in Firefox. Instructions provided by: Avi in firefox.

To do this, open the following file in notepad:
%APPDATA%\Mozilla\Firefox\pluginreg.dat

Search for “Windows Media Player Plug-in Dynamic Link Library” and add the bolded lines:

Windows Media Player Plug-in Dynamic Link Library|$
10
0|application/asx|Media Files|*|$
1|video/x-ms-asf-plugin|Media Files|*|$
2|application/x-mplayer2|Media Files|*|$
3|video/x-ms-asf|Media Files|asf,asx,*|$
4|video/x-ms-wm|Media Files|wm,*|$
5|audio/x-ms-wma|Media Files|wma,*|$
6|audio/x-ms-wax|Media Files|wax,*|$
7|video/x-ms-wmv|Media Files|wmv,*|$
8|video/x-ms-wvx|Media Files|wvx,*|$
9|video/x-msvideo|Media Files|avi,*|$

Increasing 9 to 10 tells it that there’s 10 mime types you should associate this plug-in with. Adding the video/x-msvideo line tells it to associate mime types of that with Windows Media Player. Afterwards, all my avi files began to play fine.

After saving this file, restart Firefox and video with the mime type of x-msvideo should play fine.

23 Responses to “Missing Codecs in Firefox to Play Video in Gallery2”

  1. tsaavik Says:

    Actually you’ll want to open this in wordpad, notepad makes it a mess

  2. Raskull Says:

    Worked great, thanks!

  3. kiwi Says:

    This is a problem that I’ve had with firefox for a while.

    I tried following your instructions, but I don’t have %APPDATA%\Mozilla\Firefox\pluginreg.dat on my computer? I don’t have a folder just called “mozilla”. It’s just called “mozilla firefox”. I tried searching for pluginreg.dat, but it’s not there either? I have firefox version 2.0.0.7 :( Please help

  4. Krunk Says:

    The folder you’re actually looking for is hidden. I suggest you try this:

    • Click Start
    • Click Run
    • Enter: %APPDATA%\Mozilla\Firefox\
    • Click OK

    The “Mozilla Firefox” folder is usually located in C:\Program Files\, while the “Mozilla” folder is usually located in C:\Documents and Settings\username\Application Data\

    I hope this helps!

  5. kiwi Says:

    Thanks a lot for replying, but now i’ve got another problem (_ _)

    I don’t have the dynamic link section in the pluginreg.dat file. I only have:

    MicrosoftR Windows Media Player Firefox Plugin|$
    10

    I mean, I have the wmp plugin installed…I just checked a couple seconds ago X_x

  6. Krunk Says:

    Interesting… If you want, you can email me your pluginreg.dat, and I can take a look at it.

    Or you can try incrementing that 10 in your file to 11 and adding that line to see if it works. My file doesn’t have the “MicrosoftR Windows Media Player Firefox Plugin” registered.

  7. kiwi Says:

    It actually worked! Thanks a lot Krunk!!

  8. Ed J. Says:

    Try this Firefox extension out. Worked like a charm for me, and keeps things embedded in the page.

    Media Wrap
    https://addons.mozilla.org/en-US/firefox/addon/1879

    or If you want the media to open outside the browser window in Media Player, you can use this one.

    MediaPlayerConnectivity
    https://addons.mozilla.org/en-US/firefox/addon/446

    enjoy,

    Ed

  9. Nathan96 Says:

    Like Kiwi said my file reads

    Microsoft® Windows Media Player Firefox Plugin|$
    10
    0|application/x-ms-wmp|np-mswmp|*|$
    1|application/asx||*|$
    2|video/x-ms-asf-plugin||*|$
    3|application/x-mplayer2||*|$
    4|video/x-ms-asf||asf,asx,*|$
    5|video/x-ms-wm||wm,*|$
    6|audio/x-ms-wma||wma,*|$
    7|audio/x-ms-wax||wax,*|$
    8|video/x-ms-wmv||wmv,*|$
    9|video/x-ms-wvx||wvx,*|$

    What do i need to change it to. I tried cutting out the above and pasting in what you have posted. but that caused problems. any ideas?

  10. Krunk Says:

    try updating the 1st line’s 10 to 11

    and appending this line to the end:

    10|video/x-msvideo|Media Files|avi,*|$

  11. Krunk4Ever! » Blog Archive » Weekly Top Posts (11/18/2007 to 11/24/2007) Says:

    [...] Missing Codecs in Firefox to Play Video in Gallery2 (Last week: #7) [...]

  12. Krunk4Ever! » Blog Archive » Weekly Top Posts (11/11/2007 to 11/17/2007) Says:

    [...] Missing Codecs in Firefox to Play Video in Gallery2 [...]

  13. Russ McClay Says:

    Amazing Krunk! That fix worked for me. Encountered this problem using G2 Gallery and was surprised that my google searches weren’t returning any relevant info…until I found your post which references the only other info I found (the post on the Gallery site).

    Thank you!

  14. Krunk Says:

    Glad I was able to help. :)

  15. Krunk4Ever! » Blog Archive » Weekly Top Posts (12/30/2007 to 1/5/2008) Says:

    [...] Missing Codecs in Firefox to Play Video in Gallery2 [...]

  16. Ardee Says:

    Wow, nice tip! I can now embed AVI files in firefox, worked like a charm. Thanks Krunk!

    ========================
    http://claustrophobic.blogspot.com

  17. Krunk4Ever! » Blog Archive » Weekly Top Posts (2/17/2008 to 2/23/2008) Says:

    [...] Missing Codecs in Firefox to Play Video in Gallery2 [...]

  18. Krunk4Ever! » Blog Archive » Weekly Top Posts (3/2/2008 to 3/8/2008) Says:

    [...] Missing Codecs in Firefox to Play Video in Gallery2 [...]

  19. Pawel Says:

    I tried to add line 10 to my pluginreg.dat, but after saving and restart Firefox I cannot see avi movie and when I check pluginreg.dat after restart FF my added line does not exist anymore .

    What to do to save it permanently?

    thanks

  20. Pawel Says:

    I got it .

    I forgot to change 9 to 10 after “Microsoft® Windows Media Player Firefox Plugin|$”

    Now it is saved and works

    thanks

  21. Holly Zell Says:

    I had this same problem with the .avi files appearing in my html pages as broken links. The avi display fine in IE.
    I made the changes you recommended to my %APPDATA%\Mozilla\Firefox\pluginreg.dat file but my avi’s still don’t load or play.
    I verified the changes are still present.

    0|application/x-drm|Network Interface Plugin|nip|$
    C:\Program Files\Windows Media Player\npdsplay.dll|$
    |$
    1133299626000|1|5|$
    Npdsplay dll|$
    Windows Media Player Plug-in Dynamic Link Library|$
    10
    0|application/asx|Media Files|*|$
    1|video/x-ms-asf-plugin|Media Files|*|$
    2|application/x-mplayer2|Media Files|*|$
    3|video/x-ms-asf|Media Files|asf,asx,*|$
    4|video/x-ms-wm|Media Files|wm,*|$
    5|audio/x-ms-wma|Media Files|wma,*|$
    6|audio/x-ms-wax|Media Files|wax,*|$
    7|video/x-ms-wmv|Media Files|wmv,*|$
    8|video/x-ms-wvx|Media Files|wvx,*|$
    9|video/x-msvideo|Media Files|avi,*|$
    C:\Program Files\Java\jre1.6.0_03\bin\npjpi160_03.dll|$
    |$

    Please take a look at page http://www.hollyzell.com/anime.htm
    The cells with the blue backgrounds are the animated ones.
    The other cells link to another page containing jpgs and avi’s.
    These avi’s were created many years ago use truspace3 and are loaded in the html page via <img dynsrc= …

    I would greatly appreciate your assistance as I’m using my site to provide examples for my current job hunt.
    Sincerely, Holly Zell

  22. Krunk Says:

    I’m not exactly sure if you problem is related to the one I blogged about since you don’t exactly define video/x-msvideo in your source.

    I wasn’t able to get your videos to play in either IE or Firefox and looking at your code, you appear to be using something called dynsrc inside an img tag, which I’m not familiar with myself. Personally, I didn’t think it was possible or correct to define a video inside an img tag.

  23. Krunk4Ever! » Blog Archive » Tri-Weekly Top Posts (4/20/2008 to 5/10/2008) Says:

    [...] Missing Codecs in Firefox to Play Video in Gallery2 [...]

Leave a Reply

You may also log in to bypass filling the user info.