Hey YouTube, Implement This!

There’s practically an infinite supply of videos on the Internet.  But there are limited ways to discover and view video content.

Rather than waste words trying to explain visual concepts, let me just show you.  I took the top 1000 videos of all time on YouTube, and threw them into this special player I built:

Try it out!

Play around with it for a while, then come back to me.

The Product

People are great at processing moving images.  And we should be, since our visual cortex takes up 1/3 of our brains.  I wanted to create a viewing experience that took advantage of all this neural hardware.  I wanted users to feel a pleasant flow as they decide what to watch, and quickly jump from video to video.

To that end, I implemented the minimum set of features to provide this experience.  I didn’t want any other features — such as a speed control — that might introduce an additional cognitive loop.  I want viewers to just let the visual data flow, and not concern themselves about whether to speed up or reverse the stream.

Another aspect of the user experience, is the flow is infinite.  The players shows random slices of random videos, and it goes on forever.  1000 videos is only a tiny fraction of YouTube’s library (much less the entire web’s library).  But you can watch this player for a long time without the content losing its novelty.

The Technology

Some highlights from the technical side:

  • I use ActionScript because I had code with a polished player interface (i.e., displaying thumbnails while scrubbing the video).  The main reason to use html5 vs. ActionScript is to run on iOS devices.  But the browser on iOS doesn’t let you embed playing videos into a page, so it wouldn’t have worked on those devices anyway.  For what it’s worth, I really enjoy working in ActionScript, and I’m sad it’s going away.  But that’s a topic for another post.
  • The player takes advantage of high bandwidth.  Broadband speeds have been quietly increasing over the past few years.  Most people have much bigger pipes than a typical video play uses.  For instance, a DVD-quality video stream is roughly 1000 kilobits per second (or kbps).  I’ve got a cable modem, and I just measured over 20,000 kilobits per second.  In other words, my computer could stream 20 DVD-quality videos at once.
  • All the thumbnail videos you see scrolling by are compressed to 50 kbps (they’re 160×120 pixels with no audio).
  • I used YouTube’s API to get these videos, but unfortunately, their API only returns 1000 search results.  So I have no practical way of adding more content.  I really wish API designers would allow access to entire content libraries, but that’s also a topic for another post :)

Next Steps

I would love to see this “video wall” player as an option on all video sites.  I think it works really well with the enhanced interactivity possible on the Internet.

Technically, I can hook this player into different content libraries.  But there are a couple practical obstacles.

First, to make scrubbing work well, I need sprites that show different frame from the video.  Second, I need tiny 50 kbps thumbnail streams that show the videos scrolling across the wall.  For full integration, the site hosting the content needs to generate the sprites and tiny videos as part of their encoding pipeline.

Search vs. Browse

The two dominant metaphors for exploring information are searching and browsing.  Search is great when you have a clear intention behind what you’re looking for, and the information is well structured.  The “clear intention” often involves spending money, and that’s why Google is a $200 billion company.

But I’ve always had a soft spot for browsing.  When browsing, your intention is often a more diffuse desire for entertainment.  The information can be unstructured, like images and videos.  Search is serious, browse is fun.

In particular, I find browsing an interesting problem when your set of content is so large as to essentially be infinite.  I’ll go into more detail on aspects of browsing infinite content, but first here are some concepts that guide how I approach browsing.


Content is the set of items available for browsing.  On Netflix, it’s the movie library.  On Facebook, it’s all the posts that are visible to you.


A filter is a subset of the content.  Common filters include:

  • Text searches
  • Categories matching
  • Recommendations (or other relevancy filtering)
  • Date ranges


Once you apply a filter, you need to sort the results.  Now things get a little more interesting, based on how you sort:

  • Alphabetically — rarely the right choice.  Even in the case of searching text, you’re better off sorting by relevancy (which any decent text indexing tool like solr will provide).
  • Most popular — good in that you’re showing high-quality results, but bad in that the “most popular” view doesn’t change often.  If a user is likely to look at this slice of content regularly, you need to shake it up.  Some sites solve the problem of stale results by combining a “most popular” sort with a “content added in past week” filter.
  • Most recent — opposite trade off from “more popular”.  You get dynamic results, but their quality is low.  Works well if timeliness is important and the user has other ways of pruning the content for quality (like your Twitter feed).
  • Recently popular — I personally like to blend popularity and recency.  The easiest way to blend these two metrics is to discount the popularity of each piece of content by its age like so: recently\_popular_{i} = \frac{popular_{i}} {age_{i} + k}, where k is a constant that modulates how drastically popularity falls off with age.  It’s inherently subjective, so you’ll need to dial it in.
  • Random — rarely seen, but can be a great choice if the novelty is the most important factor in the user experience.


Now that we’ve filtered and sorted, there are interesting and underappreciated choices involved in how to display the content.

  • Fixed number per page or infinite scroll?  Infinite scroll has become fashionable in the past couple years, but it’s not without drawbacks.  As you add more elements to the page, it becomes heavier and less responsive. An even bigger issue with infinite scroll is state is lost when a user clicks to view details on something, and then clicks back.
  • What meta data to show?  It’s easy to scan information in the browse page, so all the stakeholders involved in the project will likely argue for their piece to get on the browse page.  But you also don’t want a cluttered look.

Default Values

One thing I’ve learned from watching users interact with web sites is the vast majority of them (like 95%) never change default values.  This is so important, I’ll say it again: your users will not change default values.

So while you could present lots of choices on how to filter and sort and view, the only one that matters is the default.

Infinite Content

As I mentioned earlier, I find some of these choices around browsing interesting in domains where there is so much content as to be essentially infinite, and when the user is just seeking novelty.

Here are a couple examples:

  • An endless flow of videos, which serves random moments from the top 1000 YouTube videos of all time.  It’s instantly engaging — no need to think about what you want to watch.
  • A social way to browse pictures.  I got these pictures from Reddit, which is one of my favorite sites.  But I often get frustrated browsing pictures on Reddit, because their “recently popular” sort doesn’t change enough.  I wanted an interface with a simple “NEXT” button to give me a fix whenever I click.

The Utility of Perspectives

There are some oddities in the perspective with which we see the world. The fact that we live at the bottom of a deep gravity well, on the surface of a gas covered planet going around a nuclear fireball 90 million miles away and think this to be normal is obviously some indication of how skewed our perspective tends to be, but we have done various things over intellectual history to slowly correct some of our misapprehensions.
– Douglas Adams

My parents were in the foreign service, so I moved around a lot as a child.  I spent years living in such places as Senegal, Egypt, and Bolivia.

Perhaps because of this background, I’ve always been aware of different people’s perspectives.  Not only does everyone have a different perspective, but the range of perspectives that intelligent people can possess is vast.

As the anthropologist Walter Goldschmidt wrote:

Anthropology has taught us that the world is differently defined in different places. It is not only that people have different customs; it is not only that people believe in different gods and expect different post-mortem fates. It is, rather, that the worlds of different peoples have different shapes. The very metaphysical presuppositions differ: space does not conform to Euclidean geometry, time does not form a continuous unidirectional flow, causation does not conform to Aristotelian logic, man is not differentiated from non-man or life from death, as in our world.

Now maybe you’re thinking “yeah yeah, I know, intelligent people can disagree about things and other cultures are really different, but how is this relevant to my life?

I’ll give you two ways: authority and power.

On authority: since there are so many different but valid ways of seeing things, no one else can lay claim to ultimate truth.  Everyone else is just making things up as they go along.  So it’s up to you to construct your own world view.  Figure out what perspectives resonate with you, and become your own authority figure.

On power: you have limited power over the external world.  Sure, you can move your limbs this way and that.  Can you make millions of dollars and retire rich?  Maybe, but that’s hard.  And good luck trying to make yourself younger.

But you have a lot of power over the perspectives you employ in dealing with the world.  And your perspectives shape your attitude, which shapes your internal reality.

In other words, if you can cultivate a persistent attitude that “life is an amazing gift and I’m just so grateful that I have these few years to enjoy it”, that attitude will make you happier than a bitter attitude plus all the money in the world.

Successfully cultivating a new attitude isn’t easy, but it is possible and is in fact easier than a lot of goals we burn ourselves out trying to achieve (see above on “make millions of dollars and retire rich”).

Happiness through Intelligence

“I used to think that the brain was the most wonderful organ in my body. Then I realized who was telling me this.”
– Emo Philips

If you ask most people what their #1 goal in life is, some form of “be as happy as possible” tends to be the top answer.

So I’m constantly baffled by how bad most people are — even incredibly smart people — at applying their intellectual faculties in service of this goal.

Our brains serve our genes, not vice versa

This inability makes sense when you think about it from an evolutionary psychology perspective.  The Darwinian game of “genes optimizing their ability to make more copies of themselves” has been going on for a couple billion years — many orders of magnitude longer than human-level intelligence has been around.

Animals that acquire resources and high social status have the best mating opportunities, so it’s little wonder that we’re naturally motivated to climb the resource / status ladder.  In fact, we likely evolved such big brains just so we could navigate the complex web of status hierarchies of our communities.

But, as research in positive psychology tells us, these trappings of status don’t make us happier.  It’s not about how much money you have (above a low threshold).  It’s not even about how smart or good looking you are.

Instead, the factors within our control that correlate with happiness (as opposed to genetics, which is outside our control) are such things as having free time, having good friends, regularly entering a state of flow, and feeling attached to something bigger than oneself.

So why can’t we apply our big brains to the task of making ourselves happier?  We can, but it’s hard, because our brains are not monolithic entities.

Elephant and the Rider

A metaphor that I like comes from the fantastic book The Happiness Hypothesis. To quote from the book:

The mind is divided in many ways, but the division that really matters is between conscious/reasoned processes and automatic/implicit processes. These two parts are like a rider on the back of an elephant. The rider’s inability to control the elephant by force explains many puzzles about our mental life, particularly why we have such trouble with weakness of will. Learning how to train the elephant is the secret of self-improvement.

You can use your conscious mind to make yourself happier, but it take more than a simple act of will.  You need to retrain the elephant.

The author lists three ways to retrain the elephant:

  • Cognitive behavioral therapy.  Basically, you practice becoming aware of negative thought patterns.  Whenever you catch yourself in a negative pattern (e.g. “I’m so bored with my life”), you substitute a positive thought (e.g. “I’m bored so… I should sign up for an acting class!”).  Over time, the negative patterns diffuse.
  • Meditation.  Practicing mediation makes you mindful of your thoughts, and able to intervene at a meta level by asking yourself “does this thought serve me”.  You learn to create a more positive internal state by not reacting to craving and aversion.
  • Prozac.  The shortcut to giving yourself a healthy balance of neurotransmitters :)

This retraining is hard.  It takes commitment to repeatedly practice the steps needed to retrain the elephant.  But if you think that “be as happy as possible” is your highest goal, shouldn’t you invest this energy?

Think about how many hours per week you devote to making money.  And you know (in your conscious brain) that this money isn’t going to move the happiness needle as much as having free time, good friends, a flow state, etc. — doesn’t it make rational sense to shift some of these hours away from making money (if you can’t find the time elsewhere) and instead apply them towards those activities that research says is more likely to make you happy?