When creating a new entity with a video field the thumbnail is generated when the user presses the upload form prior to submission but if they simply press submit then no thumbnail is added unless the node is re-edited.

Comments

brenton created an issue. See original summary.

heshanlk’s picture

Component: Video Field » General
Status: Active » Closed (cannot reproduce)
ferrangil’s picture

Yes, that's exactly what is happening. You cannot reproduce the issue?

What about adding a simple check when transcoding the video? Just check if the field_X_thumbnail value is 0 and if it is, just add the first of the thumbnails for example.

ferrangil’s picture

Status: Closed (cannot reproduce) » Active

Could you give us a hint on how to fix this issue? I may be able to do some testing, but any help on how to do it would be appreciated.

heshanlk’s picture

@ferrangil, submit button should invoke the hook_field_insert and the hook_field_settings_form, but what is happening is transcoder generated thumbnail are not going to attach to the field during the form submission.

When you hit the upload the form will generate correctly with radios for thumbnails so this is the issue, may be we should define a new hook for this to set a default value of the thumbnail is not present.

When you are transcoding the video it will try to regenerate thumbnails if those are not present, did you wait for a transcode?. Wait till the transcoding is finished and check the node devel info to see if the thumbnail is attached.

ferrangil’s picture

@heshanlk, thank you for your reply and sorry for the delay in mine.

Yes, you're right. When the transcoder is called on cron, thumbnails are created and in the video_thumbnails table I can see 5 thumbnailfid for my video fid.

What is wrong is that the drupal table "field_data_field_xx_video" has a 0 in the column "field_xxx_video_thumbnail". As thumbnails are created, I guess a check should be done after creating them, and if this "field_xxx_video_thumbnail" field is empty (=0) we add the first or some of the fid of the thumbnails that were just generated.

You said

When you hit the upload the form will generate correctly with radios for thumbnails so this is the issue, may be we should define a new hook for this to set a default value of the thumbnail is not present.

but on node save, the thumbnails are not yet generated, so we cannot really assign any default thumbnail fid. If you meant a default fixed image, well... I guess it's much better to have one from the video itself.

Just to clarify, hitting the Upload button that goes with the video field does indeed upload the video and shows the thumbnails. It's just if you just select the video file and then go to the "Save" for the node.