Hi @Forgo,
You wont need to write a new shortcode function. Instead use this code to randomize the order of the media displayed using rtmedia gallery shortcode. This will randomize order wherever you have used the shortcode. You can additionally put different checks for different pages if you want ex: is_home() for homepage only.
add_filter('rtmedia-model-order-by-query','randomize_media_order', 99, 1);
function randomize_media_order( $order_by){
global $rtmedia_query;
if( isset ($rtmedia_query->is_gallery_shortcode) && $rtmedia_query->is_gallery_shortcode == true){
$order_by = ' ORDER BY RAND()';
}
return $order_by;
}
Check and see if this satisfies your requirement.