How to get resolution when the video quality of a video changed automatically in android youtube API?

1.3k views Asked by At

I am trying to develop an app using Android's YouTube API.and wanna get the resolution information when quality of a video changes automatically, but I haven't found the interface in YouTube Player API.

Please let me know if there is any other way to refer to the Youtube API or anything else.

1

There are 1 answers

2
KENdi On

You can get the resolution of a video by using the contentDetails as a part parameter in the Videos: list.

"contentDetails": {
"duration": "PT3M26S",
"dimension": "2d",
"definition": "hd",
"caption": "false",
"licensedContent": true
}

You can see in the definition part under the contentDetails the resolution of a video, but the value for it is either a high definition(hd) or standard definition(sd). You cannot get the video resolution as 360p, 720p etc. But the 720p and 1080p is considered as HD.