function mediafront_emfield_playlist_node in MediaFront 6.2
Same name and namespace in other branches
- 6 plugins/mediafront_emfield/mediafront_emfield.module \mediafront_emfield_playlist_node()
Implementation of hook_playlist_node
File
- plugins/
mediafront_emfield/ mediafront_emfield.module, line 5
Code
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;
}