Hey there.
Not sure how or why this is happening, but for a gallery-style page of videos using the VideoPopup method (tested with others, $Player, etc), the thumbnails are the same. Viewing the source of output page shows that they reference the same .jpg for the thumb.
Here's what information I 'think' you need:
Running latest DataObjectManager (Build Date: 2011-04-01)
VideoPage.php:
class VideoPage extends Page
{
static $has_many = array (
'Videos' => 'Video'
);
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Videos", new FileDataObjectManager(
$this,
'Videos',
'Video',
'Video',
array('Title' => 'Title', 'Description' => 'Description'),
new FieldSet(
new TextField('Title'),
new TextareaField('Description')
)
));
return $fields;
}
}
class VideoPage_Controller extends Page_Controller
{
}
Video.php:
class Video extends DataObject
{
static $db = array (
'Title' => 'Varchar(100)',
'Description' => 'Text'
);
static $has_one = array (
// Make sure this comes first
'VideoPage' => 'VideoPage',
'Video' => 'FLV'
);
}
templates/Content/VideoPage.ss:
<% control Videos %>
<div class="resource" style="padding: 0 6px 0 25px; width:200px;">
<% control Video %>
<p>$VideoPopup(260x152,854x480)</p>
<% end_control %>
<div class="description">
<strong>$Title</strong>
<p>$Description</p>
</div>
</div>
<% end_control %>
In this case the Titles are different, the Descriptions are different and once clicked, the video that plays is different (all good and expected) -- just the thumbnail is the same across the board.
The kicker: In assets/video_thumbnails/ all the files are created properly, however the images on the parsed page are pointing to the _resampled directory, and pulling the same-named file, in this case 'croppedimage260152-.jpg' ...
It appears that the re-sampling process is truncating the file-names to the same name, so the last video file I upload gets turned into the thumbnail that they all end up using.
Bug? File-naming issues?
Any thoughts on the matter would be great.
Thanks!