Not sure if this is a general issue with the Mediaelement module or specific to Media Recorder. In any case, audio recorded using media recorder cannot be played in IE 11 using the MediaElement audio player. It works fine in Firefox.

http://stackoverflow.com/questions/17854319/video-is-not-playing-in-ie8-...

Comments

kenianbei’s picture

Since media_recorder is player agnostic, I'd prefer to have this taken care of in the mediaelement module. You can also add this to a custom module, if you have browscap module installed:

/**
 * Implements hook_theme_registry_alter().
 * Adds a custom theme function for mediaelement audio.
 */
function MODULE_theme_registry_alter(&$theme_registry) {
  $theme_registry['mediaelement_audio']['theme path'] = drupal_get_path('module', 'MODULE');
  $theme_registry['mediaelement_audio']['function'] = 'MODULE_theme_mediaelement_audio';
}

/**
 * Fixes issue where mediaelement only displays download link for wav files in IE.
 * @see MODULE_theme_registry_alter().
 */
function MODULE_theme_mediaelement_audio(&$variables) {
  $browser = browscap_get_browser();
  $mimetype = file_get_mimetype($variables['attributes']['src']);

  // Output embed if this is IE.
  if ($browser['browser'] == 'IE' && $mimetype == 'audio/x-wav') {
    $output = '<embed type="audio/x-wav" width="100%" height="30" autostart="false" src="' . $variables['attributes']['src'] . '" />';
  }
  
  // Otherwise output HTML5 audio.
  else {
    $output = '<div class="mediaelement-audio">';
    $output .= '<audio ' . drupal_attributes($variables['attributes']) . ' ></audio>';
    if ($variables['settings']['download_link']) {
      $output .= '<div class="mediaelement-download-link"><a href="' . $variables['attributes']['src'] . '">' . filter_xss_admin($variables['settings']['download_text']) . '</a></div>';
    }
    $output .= '</div>';
  }

  return $output;
}
kenianbei’s picture

Status: Active » Closed (won't fix)
Anonymous’s picture

Thanks, I'll try out the custom module option with browscap and report back.

Anonymous’s picture

I created a custom module (browscap already installed/configured) but I still cannot play wav files created by media recorder. The media elements player displays fine, but clicking on the start play button does nothing.

Any ideas?

Anonymous’s picture