The read-only HTMLMediaElement property duration indicates the length of the element's media in seconds.
duration
MDN Reference