Uploaded images, video’s etc. are stored as posts with the type “attachment”; use get_posts( )
with the right parameters.
Try this; the code loops trough all attachments and displays them:
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => null, // any parent
'post_mime_type' => 'YOUR-POST-MIME-TYPE'
);
$attachments = get_posts( $args );
if ( $attachments ) {
foreach ( $attachments as $post ) {
setup_postdata( $post );
the_title( );
the_attachment_link( $post->ID, false );
the_excerpt( );
}
}
Where YOUR-POST-MIMET-YPE
is the mime-type you’re looking for.
A full or partial mime-type, e.g. image, video, video/mp4, which is matched against a post’s post_mime_type field
So in your case you should try video
.
You also could use array( 'video', 'another-mime-type' )
for multiple mime-types.