• Resolved vitoradler

    (@vitoradler)


    Hello! I need a fild on the registration form for the user to upload a validation video direct on the website. How can I do that?

    For my niche it’s impossible for them to upload the validation video on youtube or vimeo, it needs to be in the website directly.

    PS:. its a porn related website, so be careful when opening the website.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • @vitoradler

    Yes it’s possible to upload video files from the Registration page.
    The file types prepared by UM for uploads must probably be updated with your video types.

    Code snippet example:

    add_filter( 'um_allowed_file_types', 'um_allowed_file_types_custom', 10, 1 );
    
    function um_allowed_file_types_custom( $array ) {
    
        $array = array_merge( $array, array( 'mp4' => 'MP4', 'mov' => 'QuickTime video' ));
        asort( $array );
        return $array;
    }

    Install by adding the code snippet to your active theme’s functions.php file
    or use the “Code Snippets” Plugin

    https://www.ads-software.com/plugins/code-snippets/

    Thread Starter vitoradler

    (@vitoradler)

    Nice, it does worked, thanks. Just one other question, I need tha t video to show on the profile page but i’m not finding how to dynamic post it. Here is a profile example:

    https://www.scortvip.vitoradler.com/user/testevalidacao/

    @vitoradler

    You can try this code snippet and change the metakey value to your key name.

    add_filter( 'um_view_field_value_file', 'um_mp4_video_embed', 10, 2 );
    function um_mp4_video_embed( $res, $data ) {
    
        $metakey = 'file_upload_key';
    
        if( $metakey == $data['metakey'] ){
    
            $video_url = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . um_profile( $metakey );
            $res = "
                    <video width=\"400\" controls autoplay>
                    <source src=\"{$video_url}\" type=\"video/mp4\">
                    </video>
                    ";
        }
       
        return $res;
    }
    Thread Starter vitoradler

    (@vitoradler)

    Just did it, i’ve tryed to put the snippet on the functions.php, the option is not showing on the builders dynamic options. Also the standard file vizualization still as a file.

    Ps:. i’m not a programmer

    @vitoradler

    Did you replace file_upload_key with your meta_key for the video file?

    Thread Starter vitoradler

    (@vitoradler)

    Oh! i’ve mistaken the place i was suposed to change, now that worked perfectly, thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[NSFW] Uploading a video on a subscribe form’ is closed to new replies.