You are here

function emvideo_embed_form in Embedded Media Field 6.3

Same name and namespace in other branches
  1. 6 contrib/emvideo/emvideo.module \emvideo_embed_form()
  2. 6.2 contrib/emvideo/emvideo.module \emvideo_embed_form()
1 string reference to 'emvideo_embed_form'
theme_emvideo_video_embed in contrib/emvideo/emvideo.theme.inc
Formatter for emvideo_video_embed. This will return the 'embed code', typically used to embed media in an external site or blog.

File

contrib/emvideo/emvideo.module, line 566
Embedded Video module is a handler for 3rd party video files.

Code

function emvideo_embed_form($form_state = NULL, $field, $item, $formatter, $node, $options = array(), $other = array()) {
  $embed = $item['value'];
  $width = !empty($options['width']) ? $options['width'] : $field['widget']['video_width'];
  $height = !empty($options['height']) ? $options['height'] : $field['widget']['video_height'];
  $autoplay = !empty($options['autoplay']) ? $options['autoplay'] : $field['widget']['video_autoplay'];
  $title = !empty($options['title']) ? $options['title'] : t('Embed Code');
  $description = !empty($options['description']) ? $options['description'] : t('To embed this video on your own site, simply copy and paste the html code from this text area.');
  $text = emfield_include_invoke('emvideo', $item['provider'], 'video', $embed, $width, $height, $field, $item, $node, $autoplay, $options);
  $form = array();
  $form['emvideo_embed'] = array(
    '#type' => 'textarea',
    '#title' => $title,
    '#description' => $description,
    '#default_value' => $text,
  );
  return $form;
}