Some videos come with letterbox / pillarbox black frames like these for example:
https://www.youtube.com/watch?v=pSZofb3VKGU
https://www.youtube.com/watch?v=glGjB3nTmqw
compared to full size video 16/9:
https://www.youtube.com/watch?v=_ZAZD3ylG6Y
I wanted to get video resolution from youtube using their api, but after some investigating I think I am out of luck because I need fileDetails part from Youtube which can only be retrieved by video owner.
Can anybody think of another way to detect video comes in letterbox / pillarbox frame and detect dimensions? ( so I can scale the video myself when embedding, thus removing black borders )
Reference
You have to user
player
part when retrieving video. For exampleFollowing request
will give you following response. Once you embed this video you can see the black border is not there.
This is not working with the video id
glGjB3nTmqw
may be Youtube is not scaling the height I guess, not sure.My opinion you don't need to worry about the dimensions. You use the
player
to get the embed html & render it. Youtube will do all the work of removing the black bars.