You are here

function lightbox2_emvideo in Lightbox2 6

Configures settings and outputs the video.

Parameters

nid: The node id.

width: The lightbox video width.

height: The lightbox video height.

field_name: The name of the cck field the video is contained in.

provider: The name of the 3rd party video provider.

id: The video id.

1 string reference to 'lightbox2_emvideo'
lightbox2_menu in ./lightbox2.module
Implementation of hook_menu().

File

./lightbox2.module, line 1107
Enables the use of lightbox2 which places images above your current page, not within. This frees you from the constraints of the layout, particularly column widths.

Code

function lightbox2_emvideo($node, $width, $height, $field_name, $provider, $id) {
  $field = content_fields($field_name);
  $field['widget']['video_width'] = $width;
  $field['widget']['video_height'] = $height;
  $field['widget']['video_autoplay'] = 1;
  if (!content_access('view', $field, NULL, $node)) {
    drupal_access_denied();
    return;
  }
  $items = $node->{$field_name};
  if (is_array($items)) {
    foreach ($items as $item) {
      if ($item['provider'] == $provider && $item['value'] == $id) {
        break;
      }
    }
  }
  print theme('emvideo_video_video', $field, $item, 'video_video', $node);
}