The Media Recorder module adds the ability to record audio using HTML5 or Flash and save them as file entities, using either the media browser or as a file field widget.

Sandbox: https://drupal.org/sandbox/kenianbei/1533270
Git: http://git.drupal.org:sandbox/kenianbei/1533270.git

When installing for testing make sure to add library dependencies as per the README.txt file.

Reviews of other projects:

Webform Hints
Mini Panel Reference
Simple User-Node Access

Comments

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

myvo’s picture

Status: Needs review » Needs work
StatusFileSize
new70.54 KB
new11.71 KB

Hi kenianbei,

After install successfully this module. I tried to use and got some issues for you :)

1. when I allow anonymous can access Voice Recorder page, I got this message:

Notice: Undefined property: stdClass::$sid in media_recorder_process_file() (line 462 of <....>/sites/all/modules/media_recorder/media_recorder.module).

2. On authenticated user, it usually high-light the control of recorder. See on the attachment 01.jpg.
After that, I refresh page and click on setting button, I can not do anything. See on 02.jpg
(browser: Chrome Version 26.0.1410.43; OS: Ubuntu 12.04)

3. After record success, click "Save recording" and I got:

Notice: Undefined property: stdClass::$fid in media_recorder_add_validate() (line 249 of <...>/sites/all/modules/media_recorder/media_recorder.module).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of <...>/includes/entity.inc).

This is great module. I like it.

kenianbei’s picture

Status: Needs work » Needs review

Hi myvo,

I've fixed issue #1, thanks for catching this.

For #2 & #3, I'm unable to reproduce these errors, which are most likely related. I haven't tested this on Ubuntu Chrome, and won't be able to until later this week. However I've tested this on Chrome, Firefox, Safari, IE8-10 on Mac and Windows, with no issues. I will check on Ubuntu later and if there is an issue I'll fix through the module issue queue.

There is a flash issue where the security panel is sometimes hard to click in webkit browsers. This is not something that I can fix easily, as it's related to how Wami recorder is written.

Norman

dclavain’s picture

Status: Needs review » Needs work

Hi kenianbei

Manual review

  • Use the hook_uninstall() to eliminate the variables media_recorder_width, media_recorder_height, media_recorder_timelimit, media_recorder_upload_directory, and media_recorder when you uninstall the module.
  • It uses "page arguments" instead of arg() to pass parameters to the callback.
    <?php
    function media_recorder_menu() {
      $items = array();
      // Callback that process the php://input from Wami.swf.
      $items['media_recorder/record/%'] = array(
        'title' => 'Record',
        'description' => 'Record a video or audio file.',
        'page callback' => 'media_recorder_record',
        'page arguments' => array(2),
        'access callback' => 'media_recorder_access',
        'callback arguments' => array(1),
        'type' => MENU_CALLBACK,
      );
    }
    
    /**
     * Menu callback for recording a media file.
     */
    function media_recorder_record($filename) {
      global $user;
    }
    ?>
    
  • You do not need to define a media_recorder_access function because by default access callback calls user_access function.
  • "callback arguments" is not a valid key.

Look at you https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_menu/7

kenianbei’s picture

Status: Needs work » Needs review

Thanks for the manual review!

I've added the install file and changed access checks to use file entity access callbacks.

Please let me know if there are any other issues.

Norman

kenianbei’s picture

Issue summary: View changes

Added application review sections and first app review.

kenianbei’s picture

Issue summary: View changes

Added another project review.

kenianbei’s picture

Issue tags: +PAreview: review bonus

Adding PAReview: review bonus tag.

christian-nguyen’s picture

I have a problem. I can't access page with link file/add/record". I get message "You are not authorized to access this page."
How can I fix this. Thanks!

kenianbei’s picture

Hi bemoon789,

File entity 'create and upload files' perm has to be enabled for that user to access the file add/record page.

Norman

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxkenianbei1533270git

I'm a robot and this is an automated message from Project Applications Scraper.

kenianbei’s picture

Status: Needs work » Needs review

Thank you O mighty PA robot... All fixed.

kenianbei’s picture

@myvo:

I found the problem with your #3 error above, it's fixed now. Thanks!

klausi’s picture

Status: Needs review » Postponed (maintainer needs more info)

https://drupal.org/project/audiorecorderfield

This sounds like a feature that should live in the existing audiorecorderfield project. Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. Please open an issue in the audiorecorderfield issue queue to discuss what you need. You should also get in contact with the maintainer(s) to offer your help to move the project forward. If you cannot reach the maintainer(s) please follow the abandoned project process.

If that fails for whatever reason please get back to us and set this back to "needs review".

kenianbei’s picture

Hi klausi, I can understand where you are coming from. The audiorecorderfield module isn't compatible with file entity & media as it stands, and is dependent on the audiofield module. I will contact the maintainer and see what he/she thinks, but it would require a complete rewrite of the their module to incorporate use of the media module, so I'm not sure if it is much better than opening a new project with a more relevant namespace.

klausi’s picture

Yeah, I can see that a new project could make sense in this case. Just make sure to document it explicitly on your project page what is different to audiorecorderfield.

Set this back to "needs review" whenever you are ready again.

kenianbei’s picture

Opened request here: https://drupal.org/node/2025387

kenianbei’s picture

Ahh... didn't see that you posted #14...

I'll give it a few days and see what tamerzg thinks and then reopen. Thanks for the flexibility.

kenianbei’s picture

Status: Postponed (maintainer needs more info) » Needs review

I haven't heard back from the audiorecorderfield maintainer, so I'm setting back to needs review.

Also, another reason to create a new project is my plan to add video recording as well as audio.

I added a blurb on the project page:

This module is different from the AudioRecorderField module in that relies on the media module for adding & displaying media, rather than the AudioField module.

There are also plans in the near future to add video recording functionality using webRTC or the Youtube Upload Widget.

sylvaticus’s picture

Status: Needs review » Needs work
StatusFileSize
new31.94 KB

This is a manual review :-)

First I would like to point to the importance of this module. AudioRecorderField (that I use) can only record using the Nanogong applet (java) or the Soundcloud flash recorder (flash). So, this module (if working) could fulfil the growing needs of HTML5 media recording.

Documentation issues

  1. The documentation indicate the required modules, but it miss to point out the ctools dependency
  2. From the documentation it's not clear which versions of wami library should be required. More in general, a higher level of details should be given on which exact versions of the libraries are supported.

Usage issues

  1. After having downloaded the module on a fresh Drupal installation, together with the latest versions of modules and required libraries (as of today 28/6/2013), I can't get the recording widget working in either windows(ie|firefox|chrome) or linux(firefox|chrome). Please find attached a screenshot of the module configuration page.
  2. In the same configuration page I can't get the description for the fields nor the fields that relate to the path.

Code issues

  1. You miss to include in media_recorder.info a statement like configure = admin/config/media/mediarecorder so that the "configure" link is placed aside of the module in the modules list page
  2. Same for the "help" link: you should implement hook_help() in order to have a help link in /admin/modules. For example, if you want just to point a link to the README.txt, you could use:
/**
 * Display help and module information
 * Implements hook_help().
 * @param path which path of the site we're displaying help
 * @param arg array that holds the current path as would be returned from arg() function
 * @return help text for the path
 */
function media_recorder_help($path, $arg) {
  if ($path == 'admin/help#media_recorder') {
    $output = file_get_contents(drupal_get_path('module', 'media_recorder') . '/README.txt');
    return nl2br($output);
  }
}

kenianbei’s picture

@sylvatiucus:

Thanks for the thorough review! I agree on all your points above. The major one is making sure there is good browser compatibility which I think I am failing at somewhat. I will do some thorough testing this weekend or next week and document or fix as needed.

kenianbei’s picture

More in-depth responses to #18:

Documentation issues:
1) Ctools and file_entity dependencies have been added, though these are assumed with media dependency.
2) Wami and Recorderjs both are not versioned. Not much I can do about this. Any suggestions?

Usage issues:
Still working on this, will post more in later comments.

Code issues:
1) Configure path is added.
2) Help is added as suggested, thanks!

I've also just added youtube upload widget support. In the process of doing this there was quite a bit of code change, but for the better.

Norman

kenianbei’s picture

Status: Needs work » Needs review

Browser Test Results:

Windows 7 64bit on Virtualbox
IE6,7,8: Not working, nor likely to be supported.
IE9: Flash fallback working with latest version of flash. I haven't tested earlier versions of flash.
Chrome 27.0.1453.116: HTML5 recorder working, make sure web audio flag is enabled. Didn't test flash fallback.
Firefox 22: Flash fallback working with latest version of flash.

Mac OS X 10.8
Safari: Flash fallback working with latest version of flash.
Chrome 27.0.1453.116: HTML5 recorder working. Didn't test flash fallback.
Firefox 22: Flash fallback working with latest version of flash.

Ubuntu 12.10 on Virtualbox
Chrome 28.0.1500.63: HTML5 recorder working. Didn't test flash fallback.
Firefox 22: Couldn't get the flash security panel to click 'Allow'. May need to redo Wami panel CSS.

Setting back to 'needs review' since all the major issues above have been addressed.

sylvaticus’s picture

Hi, I let the "needs review" tag as I think now it's a documentation-only issue.. as I coudn't get the browser working in the environments you pointed ---
I am particularly dump, but I guess the average Drupal user is more or less at my level so I expect you will have lot of support request :-) What you need to do in a clean drupal installation to get it working? For example Modernizr needs to get its own library, and you haven't mentioned it in the installation steps (then of course it's up to Modernizr module to give more details, but you should at least mention it in the installation steps).

Wami:
- which of the "right click to download" file you need to put on sites/all/libraries/wami/ ? Just "recorder.js" or also the other files ?
SWFObject:
- swfobject_2_2.zip is fine?
Recorderjs:
- just recorder.js file (no "recorderWorker.js") ?

kenianbei’s picture

Actually, I haven't tried to install from a fresh install in some time, I'll give it a go and add documentation as per your comment.

webevt’s picture

Hi

This a very interesting project! I'll look forward for it to evolve for video support.

Manual review:

  • media_recorder.module, line 160, 191: unused global variable $user - just a super minor issue.
  • media_recorder.module, line 263: there's a hardcoded path. Can you please explain me what the $filepath stands for? Wouldn't it be better to provide a corresponding setting for this?
      $filepath = 'public://media_recorder';
    
  • media_recorder.module, line 396: wouldn't it be better to create a template for the youtube recorder instead of putting it's layout as #markup?
  • media_recorder.module, line 471: text should be wrapped with t() function.

Proposals:

  • It will be great to have a drush command that installs all needed libraries.

It will be great to put info about browser support to the project page.

Regards

webevt’s picture

Status: Needs review » Needs work
kenianbei’s picture

Status: Needs work » Needs review

media_recorder.module, line 160, 191: unused global variable $user - just a super minor issue.

Those were from a previous access check which is now handled through hook_menu. I've removed them, thanks!

media_recorder.module, line 263: there's a hardcoded path. Can you please explain me what the $filepath stands for? Wouldn't it be better to provide a corresponding setting for this?

This is the temp path for storing recordings. We can't use the default drupal temp directory because it needs to be web accessible for playback during recording. It's reasonable to have this as a settings in the admin page, but I don't think anyone would want to change it.

media_recorder.module, line 396: wouldn't it be better to create a template for the youtube recorder instead of putting it's layout as #markup?

Yes, I was planning on adding it as a template, but since I just added the feature it was a low priority.

media_recorder.module, line 471: text should be wrapped with t() function.

Yes, fixed now.

klausi’s picture

Assigned: Unassigned » tim.plunkett
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

manual review:

  1. template_preprocess_media_recorder(): why do you need to call drupal_render() here? The render array is fine and should be rendered later, right?
  2. media_recorder_record(): drupal_json_output() sues echo itself, so no nee for echo here.
  3. media_recorder_add(): is the field name hardcoded here? Why? Please add a comment.
  4. media_recorder_field_widget_form_record_validate(): could you use entity_label() for $title somehow?
  5. media_recorder_youtube.js: all user facing text must run through Drupal.t() for translation.

But that are not application blockers, otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to tim.plunkett as he might have time to take a final look at this.

klausi’s picture

Trying to remove tag again.

klausi’s picture

Status: Reviewed & tested by the community » Fixed

no objections for more than a week, so ...

Thanks for your contribution, kenianbei!

I updated your account so you can 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 stay 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Adding 3rd app review.