You are here

function theme_emvideo_bliptv_flash in Embedded Media Field 6

2 theme calls to theme_emvideo_bliptv_flash()
emvideo_bliptv_preview in contrib/emvideo/providers/bliptv.inc
emvideo_bliptv_video in contrib/emvideo/providers/bliptv.inc

File

contrib/emvideo/providers/bliptv.inc, line 291
This include processes blip.tv media files for use by emfield.module.

Code

function theme_emvideo_bliptv_flash($code, $width, $height, $field, $item, $autoplay, $flv, $thumbnail, $options = array()) {
  static $count;
  if ($code) {
    $count++;
    $id = isset($options['id']) ? $options['id'] : "emfield_videocck_player_bliptv_{$count}";
    $autoplay = $autoplay ? 'autostart=true' : 'autostart=false';
    $rss = $item['data']['showpage'] ? "&feedurl={$item['data']['showpage']}/rss" : '';
    $post_id = $item['data']['post_id'];

    // if/when we allow featured shows to be embedded, this will handle that.
    //     $file = $item['data']['is_show'] ? "http://$code.blip.tv/rss/flash/" : 'http://blip.tv/rss/flash/'. $item['data']['post_id'];
    $embed_code = $item['data']['flv']['embed_code']['0'];
    $file = 'http://blip.tv/rss/flash/' . $item['data']['post_id'];
    $embed_file = 'http://blip.tv/scripts/flash/showplayer.swf?' . $autoplay . '&enablejs=true' . $rss . '&file=' . $file . '&showplayerpath=http://blip.tv/scripts/flash/showplayer.swf';
    if ($item['data']['video_cck_bliptv_data_version'] == 1) {

      // If this is an old version of the data, then we'll attempt to display.
      $autoplay = $autoplay ? 'autoStart=true' : 'autoStart=false';
      $embed_file = "http://blip.tv/scripts/flash/blipplayer.swf?{$autoplay}&file={$flv}%3Fsource%3D3";

      // Now we'll resave the node so the data is saved properly in the future.
      // @TODO: Do this in cron, or even in update?
      // Query would be something like:
      // SELECT nid FROM content_type_video WHERE field_video_provider = 'bliptv' AND field_video_data LIKE '%%"video_cck_bliptv_data_version";i:1;%%';
      // except that we don't know types and fields...
      if (($node = $options['node']) && $node->nid) {
        emfield_operations_reload(array(
          $options['node']->nid,
        ), FALSE);
      }
    }
    $output .= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="' . $width . '" height="' . $height . '">
    <param name="movie" value="http://blip.tv/play/' . $embed_code . '" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#FFFFFF" />
    <param name="wmode" value="transparent" />
    <!--[if !IE]> <-->
    <object data="http://blip.tv/play/' . $embed_code . '" width="' . $width . '" height="' . $height . '" type="application/x-shockwave-flash">
    <param name="quality" value="high" />
    <param name="bgcolor" value="#FFFFFF" />
    <param name="pluginurl" value="http://www.adobe.com/go/getflashplayer" />
    FAIL (the browser should render some flash content, not this).
    </object>
    <!--> <![endif]-->
    </object>';
  }
  return $output;
}