You are here

mediafront_emfield.module in MediaFront 6

Same filename and directory in other branches
  1. 6.2 plugins/mediafront_emfield/mediafront_emfield.module

File

plugins/mediafront_emfield/mediafront_emfield.module
View source
<?php

/**
 * Implementation of hook_playlist_node
 */
function mediafront_emfield_playlist_node($node, $args) {
  $additions = array();
  foreach ($node as $fieldname => $field) {
    if (strpos($fieldname, 'field_') === 0) {
      if ($field[0]["data"] && $field[0]["data"]["thumbnail"]) {
        mediafront_add_media($additions, $field[0]["data"]["thumbnail"]);
      }
      if ($field[0]["data"] && $field[0]["data"]["emthumb"]) {
        mediafront_add_media($additions, $field[0]["data"]["emthumb"]);
      }
      if ($field[0]["provider"]) {
        $file = new stdClass();
        $file->player = $field[0]["provider"];
        $file->path = $field[0]["value"];
        $file->class = 'media';
        $file->mediaType = 'media';
        mediafront_add_media($additions, $file);
      }
    }
  }
  return $additions;
}

Functions

Namesort descending Description
mediafront_emfield_playlist_node Implementation of hook_playlist_node