Node.js Video Gallery

A few months ago, I wrote a Metro-style video gallery with Ajax, infinite scrolling and other fun stuff. I’ve now rewritten it in Node.js, which was surprisingly cathartic after coding the PHP original.

There’s a load of bumf about the original PHP version here (mostly relevant) and some supplementary info about this version here, though probably the best thing to do is to try the demo site. Yay!

Source on GitHub Keep reading >

VidStreamer.js – a simple Node.js video streamer

I’ve been really keen to learn Node.js for a while now, so I decided to translate the video gallery I wrote a while ago into Node (nearly done!). At the back end, the video gallery uses xmoovStream Server to stream the videos to the popular JW Player (I used Flash videos as I wanted to support bitrate switching).

As using a LAMP stack to support a Node app seemed wrong, I wrote a simple JavaScript video streamer. Most of the requirements came from looking at how xmoovStream Server works.

  • Supports http pseudostreaming
  • Streams Flash video and can resume streams
  • Streams other video and file formats and can resume these streams too
  • Works with JW Player’s bitrate switching

Source on GitHub Keep reading >

Aaarg!

A few years ago, I came across a couple of sites on Web Pages That Suck. (Both of which, I’m delighted to say, are still in more or less their original states five years after that post was published.)

HRODC postgraduate training courses

ACCEPT JESUS, FOREVER FORGIVEN!

While both are, of course, fine examples of important web design maxims, surely their impact would be much greater if they could be finessed into one great web page? After all, who could resist combining the eloquent brevity of a 1.2MB page full of tables with the understated finesse of animated rainbow gifs and autoplaying music?

Turns out I couldn’t. And, having just rediscovered the result, I thought I’d stick it up here.

Aaarg!

To enjoy the full experience, including the music and a bird that follows your cursor around, please view in an old version of IE.

Serving up random-but-consistent sample videos

Need to serve up some sample images or videos that are apparently random, but remain consistent each time you show them?

Download source

I recently uploaded a Video Gallery web app I’d made (demo, code download). Unfortunately I don’t have the real videos and pictures that it was supposed to use, so I thought I’d cut some clips from the silent-but-gorgeous They Call Us Animals music video footage. But the Video Gallery has about 300 different videos in the database, and I really didn’t want to make 900 sample clips (each one in 720p, 480p and 360p). So I made about 10, which seems enough to give a little variety.

But I couldn’t just serve up any video. Using the HTTP pseudostreaming support in JW Player, the site lets users change video sizes while they’re watching, and the player will switch to a different resolution source file if one is available to improve the viewing experience. It looks good, but the effect was rather spoiled when the video selector returned a higher resolution version of a completely different clip.

So I wrote a little PHP script that would serve up an apparently random sample video consistently. Keep reading >