Capture pictures and videos?


#1

Ok I know its possible, I just need a little help.

I found this:

function custom_rtmedia_camera_build($type) {
    if ( $type == 'photo' ) {
        global $rtmedia_media;
        $id = $rtmedia_media->id;
        $camera = get_rtmedia_meta($id,'camera');
        echo '<br /><br /><label for="camera">Camera</label>  ';
        echo '<input class="camera" id="camera" type="text" name="camera" value="'.$camera.'" />';
    }
}

add_action('rtmedia_add_edit_fields', 'custom_rtmedia_camera_build');

and this:

function custom_save_rtmedia_camera_build($id, $state) {
    $type = rtmedia_type($id);
    if ( $type == 'photo' ) {
        $camera = get_rtmedia_meta($id,'camera');
        if ( $camera != $_POST['camera'])
        update_rtmedia_meta($id,'camera',$_POST['camera']);
    }
}

add_action('rtmedia_after_update_media', 'custom_save_rtmedia_camera_build', 10,2);

Where do I add these codes? This is a must have feature for me.

Thanks.


#2

All of that would go in your themes functions.php file.

/wp-content/themes/YOUR-THEME-DIRECTORY/functions.php


#3

thank you, i will try it now and see if it works.


#4

How do I add the capture button? It still shows the standard upload form.


#5

Hi @kavan_lyles,

Can you please explain why do you want to add capture button and what is the purpose of this button ?


#6