why is jPlayer not playing my MP3 files in Firefox?

后端 未结 2 1634
旧巷少年郎
旧巷少年郎 2021-02-10 07:13

I am having trouble playing an MP3 file using jQuery Jplayer in Firefox 8. I have installed the latest flash for my browser and I can see that the jplayer.swf file is being down

2条回答
  •  一生所求
    2021-02-10 08:16

    there were a couple of things:

    1. Unless you specify an explicit Container Ancestor jPlayer defaults to using the DOM Element with the Id #jp_container_1, which you did not supply in your HTML
    2. As FF HTML 5 Audio cannot play MP3 it requires the latest jPlayer SWF to work, your jPlayer constructor code pointed to an old SWF version.

    Here is a Fiddle with the Fix: http://jsfiddle.net/75lb/gdLnT/

    The corrected HTML:

    The corrected Javascript:

    $("#jquery_jplayer").jPlayer({
        ready: function () {
          $(this).jPlayer("setMedia", { mp3: "http://sound26.mp3pk.com/indian/ladiesvsricky/ladiesvsrickybahl01(www.songs.pk).mp3" } );
        },
        //swfPath: "http://cloudfactory-transcription.s3.amazonaws.com/javascripts/",
        swfPath: "http://www.jplayer.org/latest/js/Jplayer.swf",
        supplied: "mp3",
        volume: 1,
        wmode:"window",
        solution: "html,flash",
    });
    

提交回复
热议问题