Can someone give me the exact code to insert programmatically a emfield value for a video.

Here is my actual portion of code for insert the emfield:

$node->field_emfield[LANGUAGE_NONE][] = array(
'fid' => $file->fid,
'display' => 1,
'description' => '',
);

It miss some information but I don't know what.
Thanks

Comments

nevets’s picture

Don't know the answer but to solve it I would temporary implement hook_node_insert() with this as the body of the function.

drupal_set_message("NODE:<pre>" . print_r($node, true) . '</pre>');

Then create a node of the appropriate type (one with a media field), populate the media field, save and look at the node dump.