Hi,
You don't need to make any changes to BuddyPress Media files for this. You can include custom fields to attachments by using the bp_media_add_media_fields
action.
You can add the following piece of code to your themes functions.php
add_action('bp_media_add_media_fields','custom_add_media_edit_fields',20);
function custom_add_media_edit_fields($media_type){
//$media_type gives you the type of media (image, video, audio) for conditional checks
global $bp_media_current_entry;
$media_id = $bp_media_current_entry->get_id();
$custom_field = get_post_meta($media_id, '_my_custom_field', true); ?>
My Custom Field
<?php
}
Then you would need to use the bp_media_after_update_media
to store the updated value
add_action('bp_media_after_update_media', 'save_my_custom_field');
function save_my_custom_field($object){
$type = $object->get_type(); // gives you the media type for conditional checks
$id = $object->get_id();
$my_custom_field = $_POST['my-custom-field'];
update_post_meta($id,'_my_custom_field',$my_custom_field);
}
That should do the trick.