|Number of watchers on Github||439|
|Number of open issues||2|
|Average time to close an issue||1 day|
|Average time to merge a PR||about 1 hour|
|Open pull requests||0+|
|Closed pull requests||0+|
|Last commit||about 4 years ago|
|Repo Created||over 4 years ago|
|Repo Last Updated||over 2 years ago|
|Organization / Author||tumblr|
|Do you use laphs? Leave a review!|
|View open issues (2)|
|View laphs activity|
|View TODOs for laphs (2)|
|View on github|
|Book a Mock Interview With Me (Silicon Valley Engineering Leader, 100s of interviews conducted)|
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Add support for Apple's Live Photos in web browsers.
Install the library:
npm install --save laphs
Include it into your module:
var LivePhotos = require('laphs');
dist/laphs.min.js into your project and include it in a
<script> tag on your page. This will make the
LivePhotos global variable available.
The easiest way to use this library is by using special data-attributes on your Live Photo
<img src="http://40.media.tumblr.com/3613923b93c21e78bc9e8935220c186a/tumblr_o63c4ekE1X1twn7m0o1_1280.jpg" data-live-photo="http://53.media.tumblr.com/3613923b93c21e78bc9e8935220c186a/tumblr_o63c4ekE1X1twn7m0o1.mov" data-live-photo-still-image-time="1.71"/>
srcis the URL of the keyframe image
data-live-photois the URL of the Live Photo video file
data-live-photo-still-image-timeis the time (in seconds) corresponding to where they keyframe was pulled from the video
You can also pass elements or custom selectors manually, if you prefer:
LivePhotos.initialize(el); // or... LivePhotos.initialize([el1, el2, el3]); // or... LivePhotos.initialize('.my-live-photos');
LivePhotos function returns an array of
LivePhoto 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:
LivePhotos.noStyles(); // Subsequent calls will not inject the styles
Live Photos created using this library are wrapped in a
LivePhoto object that has an API for playback
The following methods are available on Live Photos:
loadtriggers loading the video assets for the Live Photo
playactivates Live Photo playback, stopping on the last frmae
stopdeactivates Live Photo playback, transitioning back to the keyframe
previewplays 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
LivePhoto object directly by passing an element with
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);
In order to accept your pull request, we need you to submit a CLA.
Complete the CLA here.
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.