News for hackers. Stuff that matters.
Re:Show HN: Deck for Reddit – A Reddit client optimized for ... by pedrogpimenta on Friday July 31, 2020 @05:10AM (#24006973)
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 :(

Re:Show HN: Deck for Reddit – A Reddit client optimized for ... by lopis on Friday July 31, 2020 @06:24AM (#24007293)
> 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.

Re:Show HN: Deck for Reddit – A Reddit client optimized for ... by easton on Friday July 31, 2020 @09:04AM (#24008190)
You 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?
Re:Show HN: Deck for Reddit – A Reddit client optimized for ... by kevincox on Friday July 31, 2020 @09:43AM (#24008471)
A 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).
Re:Show HN: Deck for Reddit – A Reddit client optimized for ... by mrgalaxy on Friday July 31, 2020 @09:46AM (#24008506)
So 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.

Re:Show HN: Deck for Reddit – A Reddit client optimized for ... by pjc50 on Friday July 31, 2020 @06:12AM (#24007238)
Would some sort of slightly ridiculous iframe fallback work? That is, just embed reddit's entire video play page?
Re:Show HN: Deck for Reddit – A Reddit client optimized for ... by pedrogpimenta on Friday July 31, 2020 @07:49AM (#24007756)
Embedding 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..."