如何获取YouTube视频的AspectRatio(或方向)

问题描述 投票:0回答:1

我对youtube javascript API有疑问。

我想得到指定视频的aspectRatio不是我的。

我在getting-started-guide(https://developers.google.com/youtube/v3/getting-started)中找到了有关contentDetails的aspectRatio属性的信息。

example ratio

但是当我访问这个时,我找不到这个aspectRatio属性(https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&part=snippet,contentDetails,statistics,status&key=API_KEY

只有视频所有者可以通过fileDetails选择视频的aspectRatio吗?

谢谢!

javascript youtube youtube-api youtube-data-api
1个回答
0
投票

是。只有视频的所有者才能访问fileDetails属性 - 包括aspectRatio。如果您尝试发出videos.list请求fileDetails,您将收到此错误响应:

"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."
© www.soinside.com 2019 - 2024. All rights reserved.