Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
You can do this very easily by just using the ImageField + FileField and then just upload an Image to your node. The player should pick it up and show it in the player.
function mediafront_array_replace_recursive( $toArray, $fromArray ) {
// Loop through array key/value pairs
foreach ($fromArray as $key => $value) {
// Value is an array
if (is_array($value)) {
// Traverse the array; replace or add result to original array
$toArray[$key] = mediafront_array_replace_recursive($toArray[$key], $fromArray[$key]);
}
// Value is not an array
else {
// Replace or add current value to original array
#469 → $toArray->{$key} = $value;
}
}
// Return the joined array
return $toArray;
}
Worked for me. An issue that I have is that I might have more than one Imagefield on my content type. How does mediafront determine which one to use. If I use a multiple imagefield it seems to use whichever image is last in the array. Should I create an imagefield called "poster image" which only allows one image?
will reveal the first frame of the video as the preview image. Code above used on a Mac in Safari with the simpleblack player template and a .m4v that appears in a video tag. YMMV.
Comments
Comment #1
Basstunes commentedSorry, just changed version to beta 1. My mistake.
Comment #2
travist commentedYou can do this very easily by just using the ImageField + FileField and then just upload an Image to your node. The player should pick it up and show it in the player.
Comment #3
Basstunes commentedThanks for answering! I'll give it a try!
Comment #4
yannickooThen I get this error
warning: Attempt to assign property of non-object in /home/xxx/public_html/drupal-6.16/sites/all/modules/mediafront/mediafront.module on line 496.yannick
Comment #5
yannickooComment #6
mstrelan commentedWorked for me. An issue that I have is that I might have more than one Imagefield on my content type. How does mediafront determine which one to use. If I use a multiple imagefield it seems to use whichever image is last in the array. Should I create an imagefield called "poster image" which only allows one image?
Comment #7
yannickooHere #857844: Select CCK field for media
Comment #8
mstrelan commented#6 also refers to #869656: Need to be able to specify whether an imagefield is to be "used by mediafront" or not.
Comment #9
digitalfrontiersmediaOverriding CSS with something akin to:
will reveal the first frame of the video as the preview image. Code above used on a Mac in Safari with the simpleblack player template and a .m4v that appears in a video tag. YMMV.