Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Jan 2013 at 20:15 UTC
Updated:
19 Jul 2013 at 15:27 UTC
The audio.js modules provides a field formatter for the file field type using the audio.js javascript library created by Anthony Kolber. http://kolber.github.com/audiojs/
It uses the native HTML5 where available and an invisible flash player to emulate for other browsers. It provides a consistent html player UI to all browsers which can be styled with custom css. It can be displayed as either a single player or playlist.
Project Page: http://drupal.org/sandbox/jtphelan/1899818
Repository: git clone --recursive --branch 7.x-1.x jtphelan@git.drupal.org:sandbox/jtphelan/1899818.git audio_js
Drupal Version 7
I've already run the automated review at http://ventral.org
Reviews of other projects:
Comments
Comment #1
brunodboCool module, this will a big help to people building websites with MP3 audio (I hope audio.js will support ogg soon).
Code looks good after a quick manual review, and the module works well.
A few minor comments:
Other than that, this looks good!
Comment #2
jphelan commentedThanks brunodbo.
Comment #3
jgalletta commentedHi,
Another manual code review:
I would put the js files in a /js folder, to be consistent with a bunch of other Drupal modules, but that's just a suggestion.
Your module uses the File field, you should add a dependency to the file module.
l5: the comment mentions the colorbox module, shoul be yours I think :)
l15: This doesn't look like help to me, merely a description. If like me you're lazy you can implement the hook_help like this:
l127: Typo
Otherwise, you should use the renderable arrays and theme functions available in d7, instead of using a big $output string.
I'm thinking about theme_item_list(), l(), and '#prefix' and '#suffix'.
Some resources about that:
http://drupal.org/node/930760
http://randyfay.com/content/drupal-7-render-arrays-and-new-render-example
http://drupal.stackexchange.com/questions/10788/rendering-theme-item-lis...
Comments should follow the same conventions than php comments, i.e should be proper phrases with a capitalized letter and an ending dot. And the file's purpose should be commented at the beginning of the file.
Some empty lines are useless.
The file's purpose should be commented at the beginning of the file. Useless empty lines too.
Comment #4
jphelan commentedjgalletta thanks for the review and suggestions. I've made all the updates and fixes you suggested.
Comment #5
klausiWe are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #6
jphelan commentedreviewed three projects
Comment #7
jgalletta commentedI confirm my review has been taken in account, I do not have more remarks on the code :)
I ran the Project application checklist a second time, and for me the project is ok.
Ensure that the application contains a repository and project page link.
=> OK
Ensure it´s not a duplication.
=> already existing audio.js project has been submitted to project application, but never finished, so OK
Ensure the user does not have multiple applications.
=> User has submitted an application in the past but the amount of code was too short, the project has been promoted but user is not a vetted git user, so OK
Ensure the repository actually contains code.
=> OK
Ensure the applicant is working in a version specific branch.
=> OK
Ensure branches and tags are following naming conventions.
=> OK
Ensure the repository does not contain a ‘LICENSE.txt’ file.
=> OK
Ensure the repository does not contain any 3rd party (non-GPL) code.
=> OK
Ensure the project page contains detailed information.
=> Informative enough.
Ensure the repository contains a detailed README.txt.
=> OK
Ensure the code contains a well-balanced amount of inline-comments.
=> OK
If not done yet run an automated review and ensure there are no major issues.
=> OK (http://ventral.org/pareview/httpgitdrupalorgsandboxjtphelan1899818git)
Ensure the applicant is using Drupals API correctly.
=> OK
Ensure the project does not contain any security issues.
=> OK
Comment #8
sprocketman commentedI tested this with a fresh pull of the audio.js library.
Manual review:
1. The path in audio_js_init doesn't seem to be correct. I believe it should be:
$audio_library = libraries_get_path('audiojs') . "/audiojs/audio.min.js";2. If I understand the Drupal docs on hook_init, you shouldn't use it to include js on every page. Instead either add a declaration to your .info file (scripts[] = sites/all/libraries/audiojs/audiojs/audo.min.js), or better yet add it in audo_js_field_formatter_view() so it's really only added if it is needed.
3. In audio_js_field_formatter_settings_summary(), you put 'Preload', 'Autoplay' and 'Loop' in t(), but not the actual settings for each of those. I think you want to use a placeholder within t() for the setting, and then add the setting like so:
4. In audio_js_field_formatter_view(), I believe you want to use check_plain() on the variables in your #markup form elements and t() for your $label variable used as the title of your l() function.
Comment #9
jphelan commentedThanks atozstudio.
For just the label would I do this?
t("@label", array('@label' => $label));I could not find an example of just passing a variable to the t() function.
Comment #10
sprocketman commentedOn 4. I don't think you need to use check_plain on the url since file_create_url is sanitizing its output already. And, yes, I think that is how you would treat $label in t(). It looks a little weird, but I'm not sure how else you would deal with it. BIG DISCLAIMER: I am not a security expert, so you might want to hit up others in the community to get their take ;-)
Comment #11
jphelan commentedThanks atozstudio.
Does anyone know if this is would be the correct way to pass a variable into the t() function? It's line 140 of the audio_js.module file if you would like more context.
Comment #12
pete-b commentedNice module, on the whole couldn't find a lot to fault.
One issue I found is in the implementation of
hook_requirements.libraries_get_pathreturns a path not an array, so the following test always returns false and the library is reported as not found on the status page, even if it is present:Nice to haves:
Was a little confused in the README.txt notes under INSTALLATION that the Drupal libraries folder should be in the root of the site. It'd be a bit clearer if you specify the path from the site root. e.g.
sites/all/libraries/audiojs/audio.min.jsUsing the playlist mode the track list is currently output as a ordered list which is nice; though if I was theming I'd prefer it to have a suitably named css class on the list element (audiojs-playlist?)
Also in playlist mode, the playlist loops any there doesn't seem to be a way to disable it though this may be a limitation of the library.
Comment #13
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #14
jphelan commentedpete-b and klausi - I've made all the changes your suggested, thanks.
Comment #15
klausino objections for more than a week, so ...
Thanks for your contribution, jphelan!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #16
jphelan commentedThanks klausi and everyone else who took the time to review my project.
Comment #18
sandeepbhalla37@gmail.com commentedhi everyone
i am having an issue in which i am not able 2 play sound on my webpage using audio.js....
i have enabled the module + pasted js files from http://kolber.github.io/audiojs/ in library....i am still not getting any audio player display on my webpage
this module just allowed me to add FILE field in content type
if anyone having brief knowledge about this ....he or she can reply !!!!!!!!!!!!!
thanks buddies.....
Comment #19
jphelan commentedThis is not the correct place to submit an issue. Please submit it in the projects issue queue.
https://drupal.org/project/issues/audio_js
Comment #19.0
jphelan commentedAdded Reviews of other projects