r/ProgrammerHumor • u/weird_dude_69_420 • May 20 '22
Meme Found Reddit video player source code
460
u/OffBrandNameBrand May 20 '22
If Reddit devs need a hand, I am sure that r/ProgrammerHumor community could make a better video player just for the meme.
166
u/weird_dude_69_420 May 20 '22
I'm in.
79
49
May 20 '22
Here,
const VideoHandler = (): void -> { if (Video.IsInteresting() || Math.random() > 0.5) { RedditVideoPlayer.Play(); } else { RedditVideoPlayer.Play(); } };0
May 20 '22
[deleted]
12
u/YouTube-r May 20 '22
const VideoHandler = (): void -> { if (Video.IsInteresting()) { RedditVideoPlayer.Play(); } else if(Math.random() > 0.5) { RedditVideoPlayer.Play(); } else if(Math.random() < 0.5) { RedditVideoPlayer.Play(); } else if(true) { RedditVideoPlayer.Play(); } else if(!RedditVideoPlayer.isPlaying) { RedditVideoPlayer.Play(); } else if(RedditVideoPlayer.isPlaying) { RedditVideoPlayer.Play(); } else if(true) { RedditVideoPlayer.Play(); } else if(false) { RedditVideoPlayer.Play(); } };→ More replies (2)39
u/CoastingUphill May 20 '22
And just like that, 100 new side projects were started, never to be finished.
32
May 20 '22
They could also go back to an old version. Around a year ago it worked fine for me in the app
19
u/spikegk May 20 '22
Yeah but that was legacy code no one knew how to build anymore so it had to go.
12
u/50-Lucky May 20 '22
Somewhere in the code is //Epstein didnt kill himself
Guaranteed
→ More replies (1)5
u/kingerthethird May 20 '22
No, that's not a comment, it's a constant.
EPSTEINDIDNTKILLHIMSELF = TRUE;→ More replies (1)→ More replies (1)3
30
u/GodGrabber May 20 '22
document.onLoad = () => {
RedditVideoPlayer.play();
RedditVideoPlayer.stop();
RedditVideoPlayer.play();
RedditVideoPlayer.stop();
RedditVideoPlayer.play();
RedditVideoPlayer.stop();
if(Math.random() > 0.7) RedditVideoPlayer.play()
}
6
2
21
4
977
u/cmdkeyy May 20 '22
And when it does load, it plays in terrible quality before freezing after the first 5 seconds
219
u/Pokinator May 20 '22
I wish you could set universal quality settings. Every time I have to manually set it to max (usually 720p) and yet it still plays like shit. I'm willing to wait for it to buffer, don't nuke the video to 144 when I'm trying to read text in the video
→ More replies (1)78
u/Magikarpeles May 20 '22
Also it reloads the whole thing after every play through. I noticed this when I lost reception on my phone and it would simply refuse to replay even though I’d just watched it.
20
u/uchihajoeI May 20 '22
And then sometimes you go to another video and the audio from the previous video is still playing.
→ More replies (1)71
May 20 '22
Jokes aside, Reddit videos plays fine in HQ for a few seconds, and then it literately goes to 1 FPS and extremely hard-compressed blocky quality at something that looks like 72p. And I mean 1 FPS literately -- the "video" updates one time per second.
It is incredible that the "world largest website" has such big technical issues.
→ More replies (2)21
u/Tanglebrook May 20 '22
Yeah, what's with that? On desktop I don't have freezes or stutters, but exactly halfway into every video the quality tanks. It's like clockwork, and it's been like that for years. Embarrassing.
→ More replies (1)11
u/Jokingkin May 20 '22
Yep I barely watch videos on desktop because of this. Tho I use a 3rd party app for reddit on my phone since the media player plays properly.
→ More replies (1)3
569
u/dummyDummyOne May 20 '22
if it's a gif, serve .mp4 with no audio if it's an mp4, serve .gif
151
10
u/i_have_chosen_a_name May 20 '22
It if has sound, remove it. If it has no sound, add the oh no no no song to it.
238
627
u/KickinWithKaine May 20 '22
Image Transcription: Code
const VideoHandler = (): void -> {
if (Video.IsInteresting() || Math.random() > 0.5) {
RedditVideoPlayer.Freeze();
} else {
RedditVideoPlayer.Play();
}
};I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
379
u/Same_Return_579 May 20 '22
Good human
351
89
u/BotBlazing May 20 '22
Thank you, Same_Return_579, for voting on KickinWithKaine.
This bot wants to find the best and worst humans on Reddit. You can view results here.
Even if I don't reply to your comment, I'm still listening for votes. Check the webpage to see if your vote registered!
86
u/bruh_bot_69420 May 20 '22
I am 99.02496% sure that the above link contains rick roll.
Beep boop, I am a bot that uses an advanced machine learning algorithm to detect potential rick roll, learn more about the project here.
→ More replies (2)22
14
29
→ More replies (2)7
u/ExplodingOrngPinata May 20 '22
No joke I've read one of these comments and it was faster than waiting for a video to load.
I have gigabit internet.
Thank you for everything you do.
359
u/whiznat May 20 '22
This is fake. Reddit never just plays a video. You have to reload the page at least once, often twice, occasionally over and over and over.
→ More replies (19)
264
u/petergriffin1115 May 20 '22
If livestream:
runSoSmoothlyFeelsLikeOfline()
75
46
u/Rhinofreak May 20 '22
Livestream the prerecorded videos then
54
u/petergriffin1115 May 20 '22
Found the project manager (giving any random solution)
9
u/Rhinofreak May 20 '22
Bro wtf I'm actually working as one (more or less) right now
→ More replies (4)
93
u/ApatheticWithoutTheA May 20 '22
Amazing with how much Reddit is worth, they can’t hire a developer to fix the fucking video player!
16
u/g000r May 20 '22 edited May 20 '24
wistful attraction husky telephone marvelous dam imminent spoon beneficial plant
This post was mass deleted and anonymized with Redact
7
u/barofa May 20 '22
I don't know, the code seems very complex, I'm sure they did their best.
→ More replies (1)
35
u/coulls May 20 '22
I think I hit the other routine all the time.., the one where video brightness is set to 1000% on some videos. Ha ha!
→ More replies (1)9
24
May 20 '22
10
10
16
u/user32532 May 20 '22
an important part is missing like
video.setQuality("4KUHD")if (video.hasFinishedPlayingOnce()){video.setQuality("120p")video.enableRandomStutter(true)}
4
u/50-Lucky May 20 '22
Also
If (input.TimeSelect == true) video.freeze;
It's been ages since I did programming so I probably butchered that, but holy shit if you go to show someone a video and pick a timestamps etc you bet your ass that video never works again
7
u/LKZToroH May 20 '22
I don't know other options for web reddit but for mobile I use RIF as my reddit "browser" and I have 0 problems with videos using it. It even works for redgifs
3
u/hudgepudge May 20 '22
Was looking for someone else who had zero issues. RIF does a great job apparently.
5
u/LKZToroH May 20 '22
Rif the best imo. Simple, fast and received regular updates, also the ads are completely non intrusive
→ More replies (2)→ More replies (2)2
3
u/itsjustawindmill May 20 '22
TRWTF is that ligature on line 1. Stop it! Stoppit!!
5
u/weird_dude_69_420 May 20 '22
he he...I kinda like it. Anything wrong with it in your opinion?
2
u/itsjustawindmill May 20 '22
Yes. There’s a good post on practicaltypography.com that explains these in more detail, but here’s the long and short of it:
It’s impossible for such a font to distinguish between combos in strings and combos being used as language keywords/operators.
There is no agreed upon meaning for ligatures, so when presenting your code to others (as you did here) you run the risk of causing confusion. Does this language actually use the implication symbol? If I backspace once from the symbol, why does it replace it with an “=“ instead of deleting it? How come pasting into a different program/website (github? np++?) the code looks different?
Their only value is aesthetic, and this can be contested. So only use them if you’re 100% sure they won’t affect anyone else’s work, or (heaven forbid) you adopt a standard set of ligatures across your entire team.
→ More replies (5)3
u/weird_dude_69_420 May 20 '22
mmh..ok I'll check it out... I use it personally. I don't preach it as well. Seems like good reasons.
4
6
6
u/ogreUnwanted May 20 '22 edited May 22 '22
I know this is for fun and humour. But the syntax looks like typescript, but the naming convention of pascal case throws me off.
What is it?
5
4
4
4
u/d3vil401 May 20 '22
The line 3 (first if) should have not been using an OR || but an AND &&
At least from my experience
4
u/joedeandev May 20 '22
Clearly, isInteresting should be a standalone function that takes a Video (or Image) as its parameter.
→ More replies (1)
1
1
1
u/rndmcmder May 20 '22
You'll don't realize that the video is only interesting because you can't see it?
3
1
u/belacscole May 20 '22
these days i just call in one of the downloader bots just to watch the fucking video
1
1
1
1
u/TheAwesome98_Real May 20 '22
the way I understand this is it’s a half chance to freeze it it’s an interesting video. right?
1
1
u/Nine-LifedEnchanter May 20 '22
Let's say that I wasn't very good at programming.. what would you say that the random math bit was about? Asking for a friend.
1
u/weird_dude_69_420 May 20 '22
It would still try to screw you even if the video was not interesting. Should have made it true instead of that. 😆
→ More replies (1)
1
May 20 '22
Often faster to just use the savereddit extension and download the video, even with the shittiest internet in town it's still faster than that damn video player.
1
1
1
1
u/Romulus3799 May 20 '22
This is one of the only code memes I've seen where nobody can bitch about the code itself in the comments. It's perfect typescript, good job OP
1
3
May 20 '22
I really feel like they meant &&?
2
u/lukabrlek May 20 '22
Yeah, this way (with ||) it seems like it should play if it is interesting 100% of the time.
3
u/dejv913 May 20 '22
It's funny. All I see on Reddit are complaints about video player. Meanwhile here I am on old reddit and never experienced an issue.
Why are people using new reddit?
→ More replies (1)
1
u/excral May 20 '22
Hey, at least it's TypeScript
2
u/weird_dude_69_420 May 20 '22
maybe I should have done it in JS just to match reddit. I gave it too much.
0
2
u/Fluxfall May 20 '22
All videos turn into murder video quality. It's fucking horrible and I hate it. Choppy as fuck.
2
2
2
2
u/ExtraGreasy May 20 '22
I don't know how to code but all I need to know to sympathize with this is that the last line looks like a sad face };
2
2
May 20 '22 edited Jul 15 '25
provide water bedroom sophisticated wise adjoining air meeting piquant jellyfish
This post was mass deleted and anonymized with Redact
2
2
2
u/tnuke1 May 20 '22
Using boost for reddit no videos ever freeze, but there's an annoying bug that distorts the audio, but it's also present in the official app so idk
2
u/The_llama123 May 20 '22 edited May 20 '22
class RedditLoad (self):
> def __init__ (self):
> > self.__LoadImage = '140 P'
> def change_image (self, Quality):
> > self.__LoadImage = str(Quality)
if RedditImage == 'AD':
> Quality = '4K'
> > RedditLoad.change_image(Quality)
2
u/New-Tomato2349 May 20 '22
I can't be the only person here that's not had any issues with videos on Reddit, right?
2
2
2
1
u/markpreston54 May 20 '22
Actually, this could actually makes sense.
Too many users try to access interesting video and the system encounters bottleneck somewhere in between when too many users access the same file
→ More replies (1)
1
1
1
1
u/Rezaka116 May 20 '22
And that's how you make people spend more time on your website! This is genius
1
1
1
u/technobird22 May 20 '22
Hmm... so sometimes it doesn't freeze, but it drops the quality to something so bad you can't really see anything. It becomes incredibly pixelated.
I know it's not me because I have gigabit internet and can watch 4K YouTube videos fine 😂
1
u/Nasaku7 May 20 '22
At this point I'm just surprised how bad it is, even I managed to use an open source react player that just works 100% for all types of files and codecs, never ran into problems
1
1
u/S0B3RN0M4D May 20 '22
They did it on purpose to annoy its users.
Every viral website has a properly working video player, and Reddit's one has no special feature to justify its bugs.
Reddit team, call Pornhub and ask them which player do they use. Thank me later.
1
1
1
1
1
1
u/RandomEasternGuy May 20 '22
I am more annoyed by the fact that I'm receiving the same posts over and over again. There appears to be no flag for "seen", only for up or down voted posts. This problem is from their API, since it is the same on Boost and normal app.
1
1
1
1
1
u/Knuffya May 20 '22
So if a video is interesting, it will instantly stop and never play again? I would've and-joined these two expressions.
1
u/Timo6506 May 20 '22
Every time it freezes I have to go to the poster’s profile where the video actually plays
1
1
1
1
May 20 '22
r/notinteresting will like analyzing that algorithm, probably not as it is too interesting.
1
u/JeffBPesos May 20 '22
I guess that interesting videos get more views and are thus more likely to buffer.
1
1
1
u/_Nohbdy_ May 20 '22
Always works perfectly 100% of the time for me, unless my wifi is crap or reddit is having trouble with everything.
Using the RIF app, that's probably why.
1
1
u/callmetroller May 20 '22
What about the reddit app where it just starts randomly playing videos im not looking at at full volume
1
1
u/Thenderick May 20 '22
I still don't understand what the difference is between function x(){} and const x = function(){}... Can someone explain?
0
1
May 20 '22
I've never had any issues, but I see stuff about this all the time. What are people using to view reddit? And is it old or new reddit?
1
1
1
u/zeecookiemonster May 20 '22
Not a programmer, but there are some amazing other features:
1: Press play/pause too many times (random as above source code) and it will drop brightness to 50%
2: Click anywhere on the video (to pause it) and then if you click a spot that is above/below the pixel height of where you just clicked, no longer pause/play until you use the actual play/pause.
1
1
1
u/Fatdumbmagatard May 20 '22
? You guys using the official reddit app or something? Never had a video not play.
1

3.4k
u/WeSaidMeh May 20 '22
This is exactly my experience, glad I'm not alone. Why is this?