Thursday, April 20, 2017 [Tweets] [Favorites]

LivePhotosKit JavaScript API

Apple (via Juli Clover, Hacker News):

By including the LivePhotosKit JS script on your page, you can create players by simply adding declarative markup to your HTML. As the page loads, LivePhotosKit JS will determine what player instances are on the page and initialize them. You can use any HTML tag that supports child nodes.

At minimum, each tag requires the following data attribute: data-live-photo. Doing this allows LivePhotosKit JS to find the DOM elements to be initialized as players.

Then you can specify the locations of the photo and video components by setting the data-photo-src and data-video-src attributes, respectively.

I haven’t been using Live Photos because of the problems they cause with Lightroom.

Comments

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment