Hi, I'm using audiofield on my site (Drupal 7) and would really like to use jPlayer but it doesn't work.
Audio Players installed:
1. jPlayer
2. Wordpress Audio Player
3. Premium Beat Player
Page with jPlayer:
http://dev.stereofx.net/music/ur-love
http://stereofx.net/music/ur-love (Shows working Wordpress Player)
Wordpress and Premium Beat work fine. jPlayer loads up on page, but when pressing the play button the track does not play.
Tested in Opera, Firefox, Chrome, IE8 - Same result, all browsers.
The href attribute of the anchor tag is "#", the click event causes the # to appear in the URL and on the click event and the page goes to the top. It's like the click event is not returning false and should have something like event.preventDefault() or a javascriptVoid(); ?
I thought it could be conflicting with another script somewhere, but I disabled all modules until jQuery.js and jplayer.js were the only 2 scripts loading on the page and got the same result.
I also tried using different versions of jQuery - 1.5, 1.6 and 1.7, no difference, same result.
Do you have any idea's or suggestions where this problem is coming from or how to find & fix the bug?
Thank you for a great module, and your assistance. I look forward to any feedback.
Comment | File | Size | Author |
---|---|---|---|
#5 | audiofile-1.0b5-jplayer.diff | 2.2 KB | pgeorgi |
#2 | audiofield_add_swfpath.patch | 477 bytes | mkadin |
Comments
Comment #0.0
Rick Bergmann CreditAttribution: Rick Bergmann commentededited wording
Comment #0.1
Rick Bergmann CreditAttribution: Rick Bergmann commentedAdded Drupal 7
Comment #0.2
Rick Bergmann CreditAttribution: Rick Bergmann commentedfixed spelling mistakes
Comment #1
Rick Bergmann CreditAttribution: Rick Bergmann commentedAfter some research, my bug is not fixed yet, but I have found something which should be added to the audiofield.module file (line 273) for the jPalyer. The 'supplied' option should be set.
I have added in supplied : mp3 - in my case I'm using mp3, but it really needs a variable to hold the different available audio formats which we should be able to set. (I will try work on something like that if nobody beats me to it.)
Additionally, jPlayer should also have a swfPath option set to the path of the jPlayer swf file as I found while debugging the swf file was not being called from the correct directory and got a not found file. Here is my fix below:
Comment #2
mkadin CreditAttribution: mkadin commentedPatch attached in accordance with #1.
the swfPath is essential for the flash fallback behavior, which is necessary for firefox playing mp3's.
I can't get anything to work with jPlayer 2.1, that may also have been part of stereofx's problem...
Also making this a bug report as audiofield won't work in firefox with mp3s without this.
Comment #3
kiterminal CreditAttribution: kiterminal commentedI used jPlayer with jQuery and HTML5. I fixed this bug below
If you use HTML5, you will go to http://www.jplayer.org/download/ and download skin for jplayer.
Comment #4
Rick Bergmann CreditAttribution: Rick Bergmann commentedHi guys, thank you so much for your input! I haven't done any development on this in a while but just got back to it and this is where I'm at:
I rolled back to jPlayer 2.0, and finally some results but not 100% perfect yet, so I would appreciate any further advice...
After trying the patch and other code, and some more fiddling, I used this code which produced my result:
Result: Now only the first instance of jPlayer on the page is working, the other players still behave with the same issue as I had before. The problem now is that the first player plays all the tracks on the page at the same time. Each individual player should play it's own mp3.
Link:
http://dev.stereofx.net/music/progressive-house/not-a-love-song-ep
Any suggestions...?
Update:
After some more fiddling I produced some more interesting behaviors: (Line 246 - Audio Callback Function)
If I remove the plus
All players are now all clickable, however they all only play the first track at the same time
I'm really close to finally getting this to work, any help is really appreciated.
Thank You.
Comment #5
pgeorgi CreditAttribution: pgeorgi commentedAttached patch against 1.0-beta5 fixes the swf-path issue, a JS aggregation issue (/sites/all/.../jplayer.min.js not found), and the multiple-players-on-a-single-page issue on my system.
Comment #6
Rick Bergmann CreditAttribution: Rick Bergmann commentedThank you for the patch, tested and bugs are fixed now.
Comment #7
pgeorgi CreditAttribution: pgeorgi commentedI split it up in separate patches and forward ported it to beta6: https://github.com/pgeorgi/d7-audiofield/commits/7.x-1.0-beta6+jplayer
Comment #8
tamerzg CreditAttribution: tamerzg commentedPatches are commited to dev version.
Comment #9
Taxoman CreditAttribution: Taxoman commented@tamerzg: your comment in #8 is from August 24th, and still the 7.x-dev version is from May...
Does beta7 contain all the latest commits?
Comment #10
tamerzg CreditAttribution: tamerzg commentedYes beta7 contains this patch. Not sure why dev version show as May, I ll have to clear the git repository probably.
If you know how to work with git you can always get latest version at:
git clone --recursive --branch 7.x-1.x {YOURUSERNAME}@git.drupal.org:project/audiofield.git
Comment #11
pgeorgi CreditAttribution: pgeorgi commentedSome minor looking changes are left for it to work for me. Unfortunately they can have some side effects elsewhere.
The commit message should explain the change. If there are any questions, we can discuss things here.
I tried to fix the other players, but can't test them.
Two commits, one fixing jplayer for me, the other attempting to fix the other players: https://github.com/pgeorgi/d7-audiofield/commits/7.x-1.0-beta7+jplayer
Comment #12
jenlamptonI'm getting exactly the same problems with beta8.
I tired both jPlayer 2.1.0 and 2.3.0 with the same result.
I'm getting the following error even though the file it's looking for is exactly where it's looking for it:
I also checked out the 7.x-1.x branch from drupal.org directly, and that version is equally borked.
Comment #13
jenlamptonThere's no patch here that needs review, so changing the status.
Just a follow up note that the patch in this issue made the jPlayer work for me.
Comment #13.0
jenlamptonAdded link to Dev site showing broken jPlayer
Comment #14
RaulMuroc CreditAttribution: RaulMuroc commentedStill the same problem. I tried the patch suggested in #13 unsuccessfully.
We notice with a colleague that in his local environment it worked at first try and in my local environment this error raised.
Perhaps some configuration related to apache or php?
Comment #15
tamerzg CreditAttribution: tamerzg commentedNow version 7.x-1.0 supports Jplayer through https://www.drupal.org/project/jplayer so this should be working fine now.
Comment #16
RaulMuroc CreditAttribution: RaulMuroc commentedYes, tested and looks fine for me.
Comment #17
vchen CreditAttribution: vchen commentedupdated Audofield to 7.x-1.0 and using jPlayer 7.x-2.0-beta1.
Now jplayer doesn't even work at all. I get this error message in Chrome Developer Tools:
Uncaught TypeError: Cannot read property 'timeFormat' of undefined
Before, it would load on the first page load, but when you refresh, it's like none of the jplayer js loads at all and the whole thing breaks.
There seems to be some discrepancy with both audio field module README file and jPlayer's on where to save the player in the libraries folder. I made a copy of each player in both sites/all/libraries and sites/all/libraries/player directories and that doesn't seem to help.
Comment #18
vchen CreditAttribution: vchen commentedOkay I got it to the previous state where I'm able to play the audio on the first page load, but fails whenever I refresh the page.
I changed the jPlayer configuration back to "sites/all/libraries/player/jPlayer" under /admin/config/media/jplayer. (In efforts to try to fix the problem, I changed the location to "sites/all/libraries/jplayer" and that seem to have broke it even though the correct files were there too.)
For some reason, on my local site, there are no issues whatsoever and I have "Aggregate Javascript files" checked. On the server though, this problem seems to always happen.
Comment #19
vchen CreditAttribution: vchen commentedWhen the jPlayer is not working, this is missing:
class="jp-jplayer jplayer-protect-processed jplayer-protect-playlist-processed jp-jplayer-processed" style="width: 0px; height: 0px;"
not sure if that helps.
Comment #20
tamerzg CreditAttribution: tamerzg commentedBecause older versions of Audiofield had hardcoded support for jPlayer (it supported older release of jPlayer which had some security issues), I decided to move it out and instead support jPlayer through jplayer module: https://www.drupal.org/project/jplayer
Therefore when migrating to new version make sure:
1. You clear drupal caches
2. Download and enable jplayer module (it has readme file with instructions where jplayer should be)
3. Highly recommended: update jplayer to latest version 2.9.x
4. Now your existing audiofields should show new player.
Comment #21
vchen CreditAttribution: vchen commentedI uninstalled jplayer module and deleted the library. Cleared caches. Installed jplayer module and placed the jplayer library in sites/all/libraries/jplayer (version 2.9.2).
When I go to configuration > media > jplayer, and enter in sites/all/libraries/jplayer, it keeps giving me this error like it's not there:
When I go to /sites/all/libraries/jplayer/jquery.jplayer.min.js on the browser, I see the document. I cleared drupal caches multiple times, clear varnish cache, run cron, run update.php and it still doesn't seem to pick it up.
Comment #22
N1ghteyes CreditAttribution: N1ghteyes as a volunteer commentedIf anyone else is having the same problem as Vchen, its because the reg_ex for detecting jplayers version doesn't work on the minified file. Use jquery.jplayer.js instead.
Comment #23
urglik CreditAttribution: urglik commentedhowdy,
i'm having the same problem and would like to apply a patch available
in this discussion ( audiofile-1.0b5-jplayer.diff ) but i do not understand how to apply the patch. i'm using drupal 6 and jplayer is for the track'nstack module. currently the player shows words for the controls and not a skin. that's fine.
but when i click on play, the same thing happens as described at the head of this thread.
thank you.
Comment #24
ashutoshjha CreditAttribution: ashutoshjha commentedN1ghteyes, for library saving, you need to make changes in jplayer.module file with following lines:-
Just change this: preg_match('/Version:?[ ]*([\d.]+)/i', $contents, $matches);
to those: preg_match('/jPlayer?[ ]*([\d.]+)/i', $contents, $matches);
This works for me.
Comment #26
ws.agency CreditAttribution: ws.agency at Websolutions Agency commentedIssue is actually related to jPlayer module and its misconfiguration where you are missing jPlayer library. See this issue for more info #2444437: Uncaught TypeError: Cannot read property 'timeFormat' of undefined