Apple Debuts Live Photos API for the Web

Apple Live Photos

Apple Live Photos

Live Photos, Apple’s answer to the GIF, is officially coming to the Web.

While other platforms such as Tumblr and Instagram have found ways to support the standard for some time, Apple now has an official API so any website can integrate moving images. The tool, a JavaScript API, lives inside of LivePhotosKit. Here’s how Apple describes it:

Use the LivePhotosKit JS library to play Live Photos on your web pages.

The JavaScript API presents the player in the form of a DOM element, much like an image or video tag, which can be configured with photo and video resources and other options, and have its playback controlled either programmatically by the consuming developer, or via pre-provided controls by the browsing end-user.

Although meant for the web, the LivePhotos API is available for apps, as well. Developers will need to familiarize themselves with two classes, LivePhotosKit and LivePhotosKit.Player. The former is the name for the library itself, while the latter is simply the player for Live Photos.

From there, two enumerations come into play: LivePhotosKit.Errors handles – well, errors in playback; LivePhotosKit.PlaybackStyle lets you choose either a snippet of the Live Photo for playback or the entire thing (good for thumbnail previews versus full images).

If you need a bit of hand-holding to get up and running, Apple has a sample project you can pick through. It’s based on Photos, Apple’s own image-management app, and supports albums and collections as well as display options and photo editing. The documentation for the Live Photos API is also really thorough.

This also brings Live Photos to Android. The API is supported on Chrome beta for Android, and Chrome (stable) and Safari for iOS. Windows and macOS will get Live Photos via Chrome and Firefox in addition to their respective proprietary browsers, Internet Explorer 11 and Safari.

Post a Comment

Your email address will not be published.