2

I would like to know how can I get the duration (in seconds) of the youtube video that is in iframe. I really dont know if I should use PHP or JS, so I will welcome any advice. Heres is my iframe:

<iframe width='420' height='315' id='video_player' src='https://www.youtube.com/embed/0rVwuowU6Fs' frameborder='1' allowfullscreen></iframe>

Thank you for any answer.

Adam Šulc
  • 526
  • 6
  • 24
  • 2
    Possible duplicate of https://stackoverflow.com/questions/15596753/youtube-api-v3-how-to-get-video-durations – Syscall Jan 27 '18 at 11:45
  • 1
    Possible duplicate of [Youtube API v3 , how to get video durations?](https://stackoverflow.com/questions/15596753/youtube-api-v3-how-to-get-video-durations) – A1Gard Jan 27 '18 at 11:52
  • 1
    The iframe is https and cant access with javascript to this, then you must use google api only. – A1Gard Jan 27 '18 at 11:53
  • Good, thanks for your advices. – Adam Šulc Jan 27 '18 at 12:40
  • [youtube-video-title-and-duration-without-api-key](https://stackoverflow.com/questions/41295517/youtube-video-title-and-duration-without-api-key) [converting-youtube-data-api-v3-video-duration-format-to-seconds-in-javascript](https://stackoverflow.com/questions/22148885/converting-youtube-data-api-v3-video-duration-format-to-seconds-in-javascript-no) – Madhuwantha Priyashan Jun 29 '22 at 17:25

0 Answers0