@tig1960
Yes you can try this code snippet to add MP4 uploads
add_filter( 'um_allowed_file_types', 'um_allowed_file_types_custom', 10, 1 );
function um_allowed_file_types_custom( $array ) {
return array_merge( $array, array( 'mp4' => 'MP4' ));
}
You can add the code snippet to your active theme’s/child-theme’s functions.php file
or use the “Code Snippets” plugin.
https://ww.wp.xz.cn/plugins/code-snippets/
Thanks, I’ve tried via code snippets but that doesn’t work?
@tig1960
You will find MP4 as the last upload option.
Another question, can users upload .mov files and also what about HEVC files (Apple type)?
Thanks.
@tig1960
Yes you can upload additional file types by this code snippet,
where I have added a sort so MP3 and MP4 are together in the list
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' => 'MOV', 'hevc' => 'HEVC' ));
ksort( $array );
return $array;
}
To play the files you need more code for the browsers to understand the file format like the example in this guide
https://docs.ultimatemember.com/article/1692-mp3-field-embed-with-audio-tag