Check if YouTube video is live or uploaded

前端 未结 2 1683
梦如初夏
梦如初夏 2021-01-05 14:15

I have a YouTube Live Event. I am able to play the video using the YouTube IFrame Player API. I want to know if there is any way that I can find if the video is a Live event

相关标签:
2条回答
  • 2021-01-05 14:24

    The only way you can do this (currently) is with youtube backend api. Get data about the video based on its id and in the response you have a property snippet.liveBroadcastContent which is either live, none, or upcoming.

    0 讨论(0)
  • 2021-01-05 14:30

    The IFrame API provides a Playback quality function which returns a string representation of the current video quality.

    From my tests, this function will return an undocumented string auto for live events.

    Related discussion can be found in this issue on YouTube's iOS Player Helper Library's GitHub page.

    0 讨论(0)
提交回复
热议问题