Want to demo your website, or perform multiple tests with the same gesture? With our web-based Playback tool, you can record, crop, play, and save snippets of your own Leap Motion usage in JavaScript.

The LeapJS Playback recorder plugin.

How it works

Playback is built on our JavaScript plugins system, so it’s easy to access and use. The snippets that you generated can be downloaded in JSON format, which returns frames as arrays. IDs, positions, velocities, confidence values – it’s all there in the data stream. Saved snippets can be included in your app with a single line of code:

var controller = new Leap.Controller();
  controller
    .use('playback', {
      recording: 'leap-playback-recording-110fps.json.lz'
    })
    .connect()

You can also drag and drop a saved stream directly into Playback:

Dropping a recording into Playback.

Potential uses

We used Playback along with our JavaScript rigged hand to create the demos on the Skeletal features page, but that’s just one possible application. Recently, we’ve seen projects like Chris Smith’s digital hand tremor assessment that rely on recording hand data. Playback could be incorporated into similar projects where saving tracking data is important.

Protip for power users (and an early access alpha!)

Decreasing file size. To decrease the size of your recordings, open the console and hit `controller.plugins.playback.player.recording.cullFrames()`. This will reduce your file size (and framerate) by half. This also messes up the crop points, so be sure to re-crop before playing or downloading.

Multiplayer gaming. We have an alpha version of a P2P networking plugin for multiplayer games over WebRTC.  If you’d like early access, we’d love to hear from you. Write in the comments or shoot us an email at developers@leapmotion.com.

Plugins are for everyone

What do you think of Playback? We’d love your feedback and help! Get involved on the project page. There are some pretty cool things happening to reduce filesize (e.g. frames can be dropped before export via the console, and it will interpolate to 60fps on replay), and we’re just getting started. Be sure to check out the full suite of LeapJS plugins and feel free to submit your own!

Peter is a software engineer at Leap Motion who loves to practice web development and bring the power of LeapJS to everyone.

Twitter