4 ms·
I'm also building, or trying to, a client for Reddit made with React. The thing I'm not achieving is properly rendering videos hosted on Reddit. I've come to t
by pedrogpimenta 6y ago
I'm also building, or trying to, a client for Reddit made with React. The thing I'm not achieving is properly rendering videos hosted on Reddit.
I've come to the conclusion that it's impossible. It's totally closed from being played outside of reddit.com by using CORS. I can't in any way play the DASH or HLS files from reddit.
I can load the mp4 fallback, but guess what? It's a video without audio. You can get the audio, but it's not documented anywhere (found on stackoverflow, I think). But of course, playing two files at once and syncing them is bound to break, specially on slow networks.
For a website dedicated to sharing stuff from all around the web (reddit didn't even have image hosting until a few years ago), it is really a dick move that you can't share stuff from reddit elsewhere.
It's a shame. Reddit is merely a shell of what it used to be, sadly.
Edit: You seem to have the same problem with video :(
- pjc50 6y agoWould some sort of slightly ridiculous iframe fallback work? That is, just embed reddit's entire video play page?
- pedrogpimenta 6y agoEmbedding the "video play" page will embed the entire page. I don't even know if it would work but it would cripple my webapp which is supposed to be fast, not like reddit's crappy interface. I mean, if I have to deal with that anyways, then I'll just use reddit's own interface. I still use it daily and I have a small reddit icon which will open the relevant reddit.com post on a new tab and I can see it then. It just shouldn't be like this, but "oh, well..."
- lopis 6y ago> For a website dedicated to sharing stuff from all around the we Reddit has moved away from being a sharing website to being a social network. This started years ago, but they have consistently move in the direction of siloing users. Strongly encourage users to upload images and videos directly to reddit; Reddit media cannot be hot-linked and always shows you the reddit thread; new features are only available in the official site and apps; certain media won't play properly on third party apps; website experience degraded by constantly pushing users to their app, where they can better control and track them.
- easton 6y agoYou may want to try to track down u/iamthatis, he wrote the Apollo app for iOS and has been able to get reddit video/galleries/etc working natively. He regularly rants against the api not being well supported, maybe he can share how he got around it?
- kevincox 6y agoA native app and a web app are completely different. Native apps don't need to respect CORS (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
- mrgalaxy 6y agoSo it's not impossible to get around CORS, but it will be expensive if you are dealing with video. One option is to load the videos through a proxy server to ignore the CORS headers. Really lame though. Reddit needs an embed thing like YouTube, but I have feeling they want people on Reddit, which is why links to Reddit media take you to the comment section.