You are here

function theme_video_cck_livestream_flash in Embedded Media Field 5

The embedded flash displaying the livestream video.

2 theme calls to theme_video_cck_livestream_flash()
video_cck_livestream_preview in contrib/video_cck/providers/livestream.inc
hook video_cck_PROVIDER_preview this actually displays the preview-sized video we want, commonly for the teaser
video_cck_livestream_video in contrib/video_cck/providers/livestream.inc
hook video_cck_PROVIDER_video this actually displays the full/normal-sized video we want, usually on the default page view

File

contrib/video_cck/providers/livestream.inc, line 236
This include processes livestream.com media files for use by emfield.module.

Code

function theme_video_cck_livestream_flash($embed, $width, $height, $autoplay, $options = array()) {
  static $count;
  $output = '';
  if ($embed) {
    $fullscreen = isset($options['fullscreen']) ? $options['fullscreen'] : variable_get('video_cck_livestream_full_screen', 1);
    $fullscreen_value = $fullscreen ? "true" : "false";
    $autoplay = isset($autoplay) ? $autoplay : (isset($options['autoplay']) ? $options['autoplay'] : variable_get('video_cck_livestream_autoplay', 0));
    $autoplay_value = $autoplay ? 'true' : 'false';

    // Micah's ugly hack.
    $embed = str_replace('?', '&', $embed);
    $embed = str_replace('clipId', 'clip', $embed);

    // Livestream URLs from the rss api contain /ondemand/ instead of ?clip=
    // So we fix it
    $embed = str_replace('/ondemand/', '&clip=', $embed);

    //    $id = isset($options['id']) ? $options['id'] : 'video_cck-livestream-flash-'. (++$count);
    $div_id = isset($options['div_id']) ? $options['div_id'] : 'video_cck-livestream-flash-wrapper-' . $count;
    $output .= <<<FLASH
      <div id="{<span class="php-variable">$div_id</span>}">

      <object width="{<span class="php-variable">$width</span>}" height="{<span class="php-variable">$height</span>}" id="lsplayer" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
        <param name="movie" value="http://cdn.livestream.com/grid/LSPlayer.swf?channel={<span class="php-variable">$embed</span>}&amp;autoPlay={<span class="php-variable">$autoplay_value</span>}"></param>
        <param name="allowScriptAccess" value="always"></param>
        <param name="allowFullScreen" value="{<span class="php-variable">$fullscreen_value</span>}"></param>
        <embed name="lsplayer"
          wmode="transparent"
          src="http://cdn.livestream.com/grid/LSPlayer.swf?channel={<span class="php-variable">$embed</span>}&amp;autoPlay={<span class="php-variable">$autoplay_value</span>}"
          width="{<span class="php-variable">$width</span>}"
          height="{<span class="php-variable">$height</span>}"
          allowScriptAccess="always"
          allowFullScreen="{<span class="php-variable">$fullscreen_value</span>}"
          type="application/x-shockwave-flash">
        </embed>

      </object>
      </div>
FLASH;
  }
  return $output;
}