I am using jPlayer with jQuery to play audio files.
http://www.jplayer.org/
http://jquery.com/
In FireFox 5 (Win 7 & Win XP), the audio will not play on:
http://www.disk-edits.com.au/files/female_voice_artists.php
(I know they are all the same song, I'm just testing)
But the exact same page works perfectly on my localhost, even when accessed online:
http://richard-walsh.dyndns-free.com/disk-edits/files/female_voice_artists.php
(If this is no longer online then I mu开发者_JAVA百科st have turned my computer off, but I will leave it on for a while)
I've tried using both relative and absolute paths but nothing has changed. I'm using mp3 and oga. Both links work fine on all other current browsers (Chrome, Opera, IE, Safari); it's only FF5 having a problem with the first link. It doesn't show any errors. Any ideas?
The online server is running an older version of apache/php/etc. Also the online server is running linux, where as my computer is running windows. I don't know if that is relevant but I can't see any other differences.
EDIT: I have now tried with plain HTML5 audio tags (using only oga). It still does not work in FF5, but works fine in Chrome. So it appears to be something to do with the Server, AND FireFox.
The problem was that the server was sending the wrong MIME types to go with the .oga files. To fix this you just create a .htaccess file in your main directory that associates the MIME types correctly.
Here is an example that updates lots, with the important ones for OGG down the bottom.
# CSS
AddType text/css .css
# XHTML
AddType application/xhtml+xml .xhtml
# XML
AddType text/xml .xml
# XUL
AddType application/vnd.mozilla.xul+xml .xul
# Add-ons
AddType application/x-xpinstall .xpi
# SVG
AddType image/svg+xml .svg .svgz
AddEncoding x-gzip .svgz
# HTML
# Server Side Includes (SSI)
AddType text/html .shtml
# Active Server Pages
AddType text/html .asp
# Favicons
AddType image/vnd.microsoft.icon .ico
# Macromedia
AddType application/x-shockwave-flash .swf
AddType application/x-director .dir .dcr .dxr .fgd
AddType application/x-authorware-map .aam
AddType application/x-authorware-seg .aas
AddType application/x-authorware-bin .aab
AddType image/x-freehand .fh4 .fh5 .fh7 .fhc .fh
# Adobe PDF
AddType application/pdf .pdf
# Real
AddType application/vnd.rn-realmedia .rm
AddType audio/vnd.rn-realaudio .ra .ram
AddType video/vnd.rn-realvideo .rv
AddType audio/x-pn-realaudio-plugin .rpm
# Microsoft multimedia
AddType video/x-ms-asf .asf .asx
AddType audio/x-ms-wma .wma
AddType audio/x-ms-wax .wax
AddType video/x-ms-wmv .wmv
AddType video/x-ms-wvx .wvx
AddType video/x-ms-wm .wm
AddType video/x-ms-wmx .wmx
AddType application/x-ms-wmz .wmz
AddType application/x-ms-wmd .wmd
# MPEG
AddType audio/x-mpegurl .m3u
# Binary Compressed files and archives
AddType application/zip .zip
AddType application/x-gzip .gz
AddType application/x-gtar .gtar
AddType application/x-rar-compressed .rar
AddType application/octet-stream .dmg
# Java
AddType application/x-java-applet .class
# Quicktime movies
AddType video/quicktime .mov .qt
# XBM files
AddType image/x-xbitmap .xbm
# WAV files
AddType audio/x-wav .wav
# Bittorrent
AddType application/x-bittorrent .torrent
#OGG
AddType audio/ogg .oga
AddType video/ogg .ogv
AddType application/ogg .ogg
精彩评论