[I wanted to post this in case others were scratching their head, I've had a lot of users reporting it to me, and I sent the report to Reddit, but my contact is out of the office right now so in the interest of unscratching other peoples' heads and letting Reddit know I thought I'd post it. Hopefully this is the correct subreddit due to it affecting the API.]
tl;dr: It seems a change in the Reddit backend a few weeks back caused some weird behavior with Reddit videos and caused them both A) being uploaded incorrectly as well as B) having incorrect values in the API. I'll go over both with examples below.
A) Reddit videos are uploaded (and as a result displayed) incorrectly
For whatever reason, portrait/tall videos that are uploaded to Reddit in many cases (if not all) are getting black boxes added to the sides manually to the video file to make it a pseudo-horizontal video. However the image thumbnails representing the video are in the proper (tall) aspect ratio.
Example posts: One, Two, Three
Here's an example of how this looks in the official Reddit app: https://i.imgur.com/iP5xFc3.jpg
(As you can see, based on the thumbnail being reported correctly as tall media, but the video incorrectly being reported as being wide due to added black boxes, the video player has no idea which to trust as to the media's dimensions and overlays both weirdly.)
Here's some posts from other users encountering it: One, Two, Three
Stating the obvious here but the intended solution would be to not add black bars to the side of portrait videos, and if that's intended behavior for whatever reason, keep the thumbnail consistent.
B) Video dimensions are being reported in reverse via the API
Even for videos that are correctly uploaded, it seems some wires got crossed and the dimensions are being reported backward, which again creates that issue of "which to trust" when one is wrong?
Here's an example post: https://reddit.com/r/marvelstudios/comments/hovm01/1_year_later_and_i_still_feel_like_weve_been/
The video is a normal 16:9 aspect ratio video. Its dimensions are width: 1334 pixels, height: 750 pixels. The preview images provided by the API for the post report this correctly, "width: 1334, height: 750".
However the actual video JSON itself gets them backward for some reason, reporting "width: 750, height: 1334".
In addition to causing a confusing API result, it manifests on the website as a weirdly shaped video player that isn't shaped properly to the content like most of the players on Reddit are, instead adding black bars on the top and bottom to try to fit the reversed API dimensions: https://i.imgur.com/tQHtggw.png
That's all I got, just thought I might save another dev some head scratches and give a post I can point to users, as well as hopefully give the engineers at Reddit some reproduction steps, hopefully it isn't a tricky fix. Thanks for what you do, can't imagine a video uploader is an easy thing to write!
Subreddit
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/redditdev/c...