Sure. And you don’t need to use my plugin to do it. This information is actually built in to WordPress for most video formats since version 3.6. It’s stored in the _wp_attachment_metadata array. You’ll probably want to use the length_formatted key. Here’s an example assuming you have the video attachment ID stored in a variable $attachment_ID :
$video_meta = get_post_meta( $attachment_ID, '_wp_attachment_metadata', true );
echo $video_meta['length_formatted'];
Perfect, I’ll give that a go.
Thanks
It doesn’t matter much, but I think it would also work with the function wp_get_attachment_metadata
$video_meta = wp_get_attachment_metadata( $attachment_ID );