getCurrentTime() for YouTube Video

前端 未结 4 1092
故里飘歌
故里飘歌 2021-02-14 17:02

I\'m writing a Chrome Extension in Javascript and I want to get the current time for the playing video on youtube.com. I tried using the answer from question Getting Current You

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-14 17:27

    In 2020, it seems we should use: player.playerInfo.currentTime.

    full code on codepen

提交回复
热议问题