유영준
유영준

Reputation: 1

How to get AspectRatio(or orientation) of youtube video

I have a question about youtube javscript API.

I want to get aspectRatio of specified video not mine.

I have been found the information about aspectRatio property of contentDetails at getting-started-guide(https://developers.google.com/youtube/v3/getting-started).

example ratio

But I don't find this aspectRatio property when I access this (https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&part=snippet,contentDetails,statistics,status&key=API_KEY)

Can only videos owner select video's aspectRatio by fileDetails?

Thank you!

Upvotes: 0

Views: 552

Answers (1)

ReyAnthonyRenacia
ReyAnthonyRenacia

Reputation: 17613

Yes. Only owners of the video are able to access the fileDetails properties - that includes the aspectRatio. If you try to make a videos.list request asking for fileDetails, you'll get this error response:

"message": "The request is not properly authorized to access video file or processing information. Note that the <code>fileDetails</code>, <code>processingDetails</code>, and <code>suggestions</code> parts are only available to that videos owner."

Upvotes: 0

Related Questions