Flowplayer work not correctly, when I create field video in content type with values more then one. On page displays only the first video.

Comments

kevinwal’s picture

If you're doing something like 2 players on page as we did below, you need to change the ID to be specific:

/**
 * Implements hook_field_formatter_view()
*/

function flowplayer_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();
  $settings = $display['settings'];

  switch ($display['type']) {
    case 'flowplayer':
      foreach ($items as $delta => $item) {
        $element[$delta] = array('#markup' => theme('flowplayer', array(
          'config' => file_create_url($item['uri']),
          'id' => 'flowplayer-' . $item['fid'],
        )));
      }
      break;
  }
  return $element;
}
KVF-IT’s picture

Issue summary: View changes

Hi

A bit late...only 3 years later hehe :)

Ehm I have made a module that should do what you kevinwal implies, but nothing happens :/

Should I change every 'flowplayer' with the unique div id 'livevideo', which is in the node entity render?

I mean the flowplayer gets assigned to the id 'livevideo' on my site.