You are here

function theme_emaudio_custom_url_flash in Embedded Media Field 6.3

Same name and namespace in other branches
  1. 6 contrib/emaudio/providers/custom_url.inc \theme_emaudio_custom_url_flash()
1 theme call to theme_emaudio_custom_url_flash()
emaudio_custom_url_audio in contrib/emaudio/providers/custom_url.inc
hook emaudio_PROVIDER_audio this actually displays the full/normal-sized video we want, usually on the default page view

File

contrib/emaudio/providers/custom_url.inc, line 111
This is an include file used by emfield.module.

Code

function theme_emaudio_custom_url_flash($url = NULL, $width = 0, $height = 0, $field = NULL, $data = array(), $node = NULL, $autoplay = FALSE) {

  // Display the audio using Flowplayer if it's available.
  if (module_exists('flowplayer')) {
    $config = array(
      'clip' => array(
        'autoPlay' => $autoplay,
        'url' => url($url, array(
          'absolute' => TRUE,
        )),
      ),
    );
    $attributes = array(
      'style' => "width:{$width}px;height:{$height}px;",
    );
    return theme('flowplayer', $config, 'emaudio_custom_url_flash', $attributes);
  }

  // Display the custom URL using the embed tag.
  switch ($data['data']['type']) {
    case 'wav':
    case 'ra':
    case 'mp3':
    case 'mid':
      $autoplay = $autoplay ? 'true' : 'false';
      return "<embed src='{$url}' autostart='{$autoplay}' width='{$width}' height='{$height}'></embed>";
  }
}