function theme_file_entity_file_video

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 file_entity.theme.inc theme_file_entity_file_video($variables)
cle7 file_entity.theme.inc theme_file_entity_file_video($variables)
elmsmedia7 file_entity.theme.inc theme_file_entity_file_video($variables)
icor7 file_entity.theme.inc theme_file_entity_file_video($variables)
meedjum_blog7 file_entity.theme.inc theme_file_entity_file_video($variables)
mooc7 file_entity.theme.inc theme_file_entity_file_video($variables)

Returns HTML for displaying an HTML5 <video> tag.

Parameters

array $variables: An associative array containing:

  • file: Associative array of file data, which must include "uri".
  • controls: Boolean indicating whether or not controls should be displayed.
  • autoplay: Boolean indicating whether or not the video should start playing automatically.
  • loop: Boolean indicating whether or not the video should loop.
  • muted: Boolean indicating whether or not the sound should be muted.
  • width: Width, in pixels, of the video player.
  • height: Height, in pixels, of the video player.

Related topics

2 string references to the theme hook from theme_file_entity_file_video()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

file_entity_field_formatter_view in sites/all/modules/ulmus/file_entity/file_entity.field.inc
Implements hook_field_formatter_view().
file_entity_theme in sites/all/modules/ulmus/file_entity/file_entity.module
Implements hook_theme().

File

sites/all/modules/ulmus/file_entity/file_entity.theme.inc, line 128
Theme callbacks for the file entity module.

Code

function theme_file_entity_file_video($variables) {
  $files = $variables['files'];
  $output = '';

  $video_attributes = array();
  if ($variables['controls']) {
    $video_attributes['controls'] = 'controls';
  }
  if ($variables['autoplay']) {
    $video_attributes['autoplay'] = 'autoplay';
  }
  if ($variables['loop']) {
    $video_attributes['loop'] = 'loop';
  }
  if ($variables['muted']) {
    $video_attributes['muted'] = 'muted';
  }
  if ($variables['width'] && $variables['height']) {
    $video_attributes['width'] = $variables['width'];
    $video_attributes['height'] = $variables['height'];
  }

  $output .= '<video' . drupal_attributes($video_attributes) . '>';
  foreach ($files as $delta => $file) {
    $source_attributes = array(
      'src' => file_create_url($file['uri']),
      'type' => $file['filemime'],
    );
    $output .= '<source' . drupal_attributes($source_attributes) . ' />';
  }
  $output .= '</video>';
  return $output;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.