Need help with laphs?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

444 Stars 17 Forks Apache License 2.0 15 Commits 3 Opened issues


Apple Live Photo support on the web, courtesy of Tumblr

Services available


Need anything else?

Contributors list

No Data

Laphs: Live Photos on the Web

Add support for Apple's Live Photos in web browsers.


Using npm

Install the library:

npm install --save laphs

Include it into your module:

var LivePhotos = require('laphs');

The old-fashioned way


into your project and include it in a
 tag on your page. This will make the 
global variable available.


Full documentation

The easiest way to use this library is by using special data-attributes on your Live Photo


  • src
    is the URL of the keyframe image
  • data-live-photo
    is the URL of the Live Photo video file
  • data-live-photo-still-image-time
    is the time (in seconds) corresponding to where they keyframe was pulled from the video

Include this JavaScript to find and convert all such images that it finds on the page:


You can also pass elements or custom selectors manually, if you prefer:

// or...
LivePhotos.initialize([el1, el2, el3]);
// or...


function returns an array of
objects, which are described in more detail below.

By default, this library injects styles to make your Live Photos look nice. If you prefer, you can disable this behavior before you scan for Live Photos:

// Subsequent calls will not inject the styles

The LivePhoto Object

Live Photos created using this library are wrapped in a

object that has an API for playback

The following methods are available on Live Photos:

  • load
    triggers loading the video assets for the Live Photo
  • play
    activates Live Photo playback, stopping on the last frmae
  • stop
    deactivates Live Photo playback, transitioning back to the keyframe
  • preview
    plays a short clip of the video just before the keyframe, which mimicking the behavior of Live Photos viewed in the Photos App on an iOS device

If you like, you can create a

object directly by passing an element with
, and
var livePhoto = new LivePhotos.LivePhoto(el, options);

You may also pass the keyframe and video URLs and the keyframe time directly:

var livePhoto = new LivePhotos.LivePhoto(keyframeUrl, videoUrl, stillImageTime, options);


Pull Requests

  1. Fork the repo and create your branch from
  2. If you've added code that should be tested, add tests.
  3. If you've changed APIs, update the documentation.
  4. Ensure the test suite passes.
  5. If you haven't already, complete the Contributor License Agreement ("CLA").

Contributor License Agreement ("CLA")

In order to accept your pull request, we need you to submit a CLA.

Complete the CLA here.

Copyright and license

Copyright 2016 Tumblr, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.