CAMDUG Node Event, SunCalc, Bubbles

26 Aug 2011 | By Alex Young | Tags events html5 video

CAMDUG Summer of Open Source

Like an idiot I forgot to post this sooner (I’ve been snowed under by cool JavaScript links lately!) The CAMDUG Summer of Open Source is tomorrow (27th August) in Cambridge UK, and has a Node open day, with speakers and coding sessions. Oleg Podsechin will be speaking, and he also recently gave a talk entitled The Future of Server-Side JavaScript at FrOSCon.


SunCalc (GitHub: mourner / suncalc, License: BSD) by Vladimir Agafonkin is a small library for calculating the Sun’s position, and sunlight phases.

This example will fetch the sunlight times for London:

var times = SunCalc.getTimes(new Date(), 51.5, -0.1);

It’ll also fetch the position of the Sun, returning the azimuth and altitude:

var sunrisePos = SunCalc.getSunPosition(times.sunrise, 51.5, -0.1);

It’s a nicely designed library with a lot of configuration options (detailed in the README).


BubblesJS by Pantelis Kalogiros can be used to manage captions and subtitles for HTML5 videos. It’ll even read .srt files:

var bubbles = new'video-srt');
bubbles.subtitles(false, {
  'English': {
    language: 'English',
    file: 'subs/'
  'Greek': {
    language: 'Greek',
    file: 'subs/'

The way it works is actually fairly simple. Progress can be tracked using element.currentTime, and it includes a built-in srt parser. The first parameter to subtitles is the type of parser, false makes it use the built-in one but remote parsers can also be used.

The author notes there isn’t currently a standard usable way of managing HTML5 subtitles, and he said he’s going to put the source on GitHub soon too.

blog comments powered by Disqus