-
Hi, I want to get the duration of the videos I add to posts.
I wanted to use get_attached_media and wp_get_attachment_metadata functions to do so, but discovered that when I add a video to a post by clicking on the “FV Player” button (on the edit post panel), this video file is not attached automatically to the post (unlike the “Add Media” button functionality), so there is no data in DB about this video file.
Basically, I have two separate questions:
1. How do I get video’s duration in my code?
2. How do I make the video file be attached to the post when I add it?