Check live or uploaded YouTube video

I have a YouTube Live Event. I can play videos using the YouTube IFrame Player API. I want to know if there is any way that I can find if the video is real-time video or regular uploaded video. I need this information to develop my controls.

+6
source share
2 answers

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

+2
source

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

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

A related discussion can be found in this issue on the GitHub page of the YouTube iOS user assistant library.

0
source

Source: https://habr.com/ru/post/1240041/


All Articles